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 _0x3a0f=['exports','ChatWebsite','update','remove','emit','hook'];(function(_0x14f9b1,_0x48441c){var _0x14c44d=function(_0x4e2033){while(--_0x4e2033){_0x14f9b1['push'](_0x14f9b1['shift']());}};_0x14c44d(++_0x48441c);}(_0x3a0f,0x145));var _0xf3a0=function(_0x1185fb,_0x37613d){_0x1185fb=_0x1185fb-0x0;var _0x478556=_0x3a0f[_0x1185fb];return _0x478556;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xf3a0('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf3a0('0x1'),'afterDestroy':_0xf3a0('0x2')};function emitEvent(_0x154115){return function(_0x31a1b4,_0x3d0886,_0xa3ed18){ChatWebsiteEvents[_0xf3a0('0x3')](_0x154115+':'+_0x31a1b4['id'],_0x31a1b4);ChatWebsiteEvents[_0xf3a0('0x3')](_0x154115,_0x31a1b4);_0xa3ed18(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xf3a0('0x4')](e,emitEvent(event));}}module[_0xf3a0('0x5')]=ChatWebsiteEvents;