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 _0xac95=['events','../../mysqldb','ChatWebsite','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x53ac41,_0x1a9fc2){var _0x2b0a52=function(_0x36d2e4){while(--_0x36d2e4){_0x53ac41['push'](_0x53ac41['shift']());}};_0x2b0a52(++_0x1a9fc2);}(_0xac95,0xa8));var _0x5ac9=function(_0x291c6e,_0x5b5c21){_0x291c6e=_0x291c6e-0x0;var _0x227fd1=_0xac95[_0x291c6e];return _0x227fd1;};'use strict';var EventEmitter=require(_0x5ac9('0x0'));var ChatWebsite=require(_0x5ac9('0x1'))['db'][_0x5ac9('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5ac9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5ac9('0x4')};function emitEvent(_0x1ebdea){return function(_0x550511,_0xafa08d,_0x3790d1){ChatWebsiteEvents['emit'](_0x1ebdea+':'+_0x550511['id'],_0x550511);ChatWebsiteEvents[_0x5ac9('0x5')](_0x1ebdea,_0x550511);_0x3790d1(null);};}for(var e in events){if(events[_0x5ac9('0x6')](e)){var event=events[e];ChatWebsite[_0x5ac9('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;