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 _0x53d3=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x53d3,0xea));var _0x353d=function(_0x5581ee,_0x3c8072){_0x5581ee=_0x5581ee-0x0;var _0x2e2597=_0x53d3[_0x5581ee];return _0x2e2597;};'use strict';var EventEmitter=require(_0x353d('0x0'));var VoiceQueue=require(_0x353d('0x1'))['db'][_0x353d('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x353d('0x3')](0x0);var events={'afterCreate':_0x353d('0x4'),'afterUpdate':_0x353d('0x5'),'afterDestroy':_0x353d('0x6')};function emitEvent(_0x5e8e53){return function(_0x20d47e,_0x205029,_0x496e28){VoiceQueueEvents['emit'](_0x5e8e53+':'+_0x20d47e['id'],_0x20d47e);VoiceQueueEvents['emit'](_0x5e8e53,_0x20d47e);_0x496e28(null);};}for(var e in events){if(events[_0x353d('0x7')](e)){var event=events[e];VoiceQueue[_0x353d('0x8')](e,emitEvent(event));}}module[_0x353d('0x9')]=VoiceQueueEvents;