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 _0x6c84=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','remove'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x6c84,0x112));var _0x46c8=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x6c84[_0x4c12ec];return _0x3ae42c;};'use strict';var EventEmitter=require(_0x46c8('0x0'));var ChatWebsite=require(_0x46c8('0x1'))['db'][_0x46c8('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x46c8('0x3')](0x0);var events={'afterCreate':_0x46c8('0x4'),'afterUpdate':'update','afterDestroy':_0x46c8('0x5')};function emitEvent(_0x4e8480){return function(_0x2f4e36,_0x5256eb,_0x5898b4){ChatWebsiteEvents[_0x46c8('0x6')](_0x4e8480+':'+_0x2f4e36['id'],_0x2f4e36);ChatWebsiteEvents[_0x46c8('0x6')](_0x4e8480,_0x2f4e36);_0x5898b4(null);};}for(var e in events){if(events[_0x46c8('0x7')](e)){var event=events[e];ChatWebsite[_0x46c8('0x8')](e,emitEvent(event));}}module[_0x46c8('0x9')]=ChatWebsiteEvents;