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 _0x3e32=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x3e9b66,_0x164268){var _0x4fa973=function(_0x763aae){while(--_0x763aae){_0x3e9b66['push'](_0x3e9b66['shift']());}};_0x4fa973(++_0x164268);}(_0x3e32,0x194));var _0x23e3=function(_0x3144b3,_0x45f961){_0x3144b3=_0x3144b3-0x0;var _0x2517a9=_0x3e32[_0x3144b3];return _0x2517a9;};'use strict';var EventEmitter=require(_0x23e3('0x0'));var ChatQueue=require(_0x23e3('0x1'))['db'][_0x23e3('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x23e3('0x3')](0x0);var events={'afterCreate':_0x23e3('0x4'),'afterUpdate':_0x23e3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3df9d3){return function(_0xc8df06,_0x16d0df,_0x3b7a0d){ChatQueueEvents['emit'](_0x3df9d3+':'+_0xc8df06['id'],_0xc8df06);ChatQueueEvents[_0x23e3('0x6')](_0x3df9d3,_0xc8df06);_0x3b7a0d(null);};}for(var e in events){if(events[_0x23e3('0x7')](e)){var event=events[e];ChatQueue[_0x23e3('0x8')](e,emitEvent(event));}}module[_0x23e3('0x9')]=ChatQueueEvents;