1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0xeb5d=['hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners','save','emit'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xeb5d[_0x46e363];return _0x3fb059;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xdeb5('0x0'))['db'][_0xdeb5('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xdeb5('0x2')](0x0);var events={'afterCreate':_0xdeb5('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x17d77f){return function(_0x16c31b,_0x546313,_0x19de5e){ChatWebsiteEvents[_0xdeb5('0x4')](_0x17d77f+':'+_0x16c31b['id'],_0x16c31b);ChatWebsiteEvents[_0xdeb5('0x4')](_0x17d77f,_0x16c31b);_0x19de5e(null);};}for(var e in events){if(events[_0xdeb5('0x5')](e)){var event=events[e];ChatWebsite[_0xdeb5('0x6')](e,emitEvent(event));}}module[_0xdeb5('0x7')]=ChatWebsiteEvents;