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 _0xf8fa=['setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue'];(function(_0x3fe77c,_0xb71097){var _0x1be0cb=function(_0x14ea84){while(--_0x14ea84){_0x3fe77c['push'](_0x3fe77c['shift']());}};_0x1be0cb(++_0xb71097);}(_0xf8fa,0x1ec));var _0xaf8f=function(_0x4d8524,_0x1e8925){_0x4d8524=_0x4d8524-0x0;var _0xbdb413=_0xf8fa[_0x4d8524];return _0xbdb413;};'use strict';var EventEmitter=require(_0xaf8f('0x0'));var ChatQueue=require(_0xaf8f('0x1'))['db'][_0xaf8f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xaf8f('0x3')](0x0);var events={'afterCreate':_0xaf8f('0x4'),'afterUpdate':'update','afterDestroy':_0xaf8f('0x5')};function emitEvent(_0x339b84){return function(_0x2ac6ff,_0x34d773,_0x15d05f){ChatQueueEvents[_0xaf8f('0x6')](_0x339b84+':'+_0x2ac6ff['id'],_0x2ac6ff);ChatQueueEvents['emit'](_0x339b84,_0x2ac6ff);_0x15d05f(null);};}for(var e in events){if(events[_0xaf8f('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xaf8f('0x8')]=ChatQueueEvents;