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 _0x4c7a=['hasOwnProperty','exports','events','../../mysqldb','DashboardItem','setMaxListeners','update','remove','emit'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x4c7a,0xbf));var _0xa4c7=function(_0x4b8295,_0x551c76){_0x4b8295=_0x4b8295-0x0;var _0x13edba=_0x4c7a[_0x4b8295];return _0x13edba;};'use strict';var EventEmitter=require(_0xa4c7('0x0'));var DashboardItem=require(_0xa4c7('0x1'))['db'][_0xa4c7('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xa4c7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa4c7('0x4'),'afterDestroy':_0xa4c7('0x5')};function emitEvent(_0x205176){return function(_0x936fd5,_0x4b53e9,_0x5f3513){DashboardItemEvents[_0xa4c7('0x6')](_0x205176+':'+_0x936fd5['id'],_0x936fd5);DashboardItemEvents[_0xa4c7('0x6')](_0x205176,_0x936fd5);_0x5f3513(null);};}for(var e in events){if(events[_0xa4c7('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xa4c7('0x8')]=DashboardItemEvents;