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 _0xd1db=['../../mysqldb','ChatQueue','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5b751e,_0x48aba2){var _0x499469=function(_0x4c2291){while(--_0x4c2291){_0x5b751e['push'](_0x5b751e['shift']());}};_0x499469(++_0x48aba2);}(_0xd1db,0x90));var _0xbd1d=function(_0x512980,_0x401e50){_0x512980=_0x512980-0x0;var _0x571f0a=_0xd1db[_0x512980];return _0x571f0a;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xbd1d('0x0'))['db'][_0xbd1d('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbd1d('0x2'),'afterUpdate':_0xbd1d('0x3'),'afterDestroy':_0xbd1d('0x4')};function emitEvent(_0x2eae3e){return function(_0x4ac4c7,_0x53ca6d,_0x176ee2){ChatQueueEvents[_0xbd1d('0x5')](_0x2eae3e+':'+_0x4ac4c7['id'],_0x4ac4c7);ChatQueueEvents[_0xbd1d('0x5')](_0x2eae3e,_0x4ac4c7);_0x176ee2(null);};}for(var e in events){if(events[_0xbd1d('0x6')](e)){var event=events[e];ChatQueue[_0xbd1d('0x7')](e,emitEvent(event));}}module[_0xbd1d('0x8')]=ChatQueueEvents;