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 _0xeefe=['update','emit','hook','exports','events','DashboardItem','save'];(function(_0x1a9ac9,_0x3980f3){var _0xe812e9=function(_0x4c77be){while(--_0x4c77be){_0x1a9ac9['push'](_0x1a9ac9['shift']());}};_0xe812e9(++_0x3980f3);}(_0xeefe,0xf2));var _0xeeef=function(_0x5ab4e1,_0x238cd1){_0x5ab4e1=_0x5ab4e1-0x0;var _0x3b53fc=_0xeefe[_0x5ab4e1];return _0x3b53fc;};'use strict';var EventEmitter=require(_0xeeef('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xeeef('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeeef('0x2'),'afterUpdate':_0xeeef('0x3'),'afterDestroy':'remove'};function emitEvent(_0x20bd76){return function(_0x58512c,_0xf7b46c,_0x1d5b38){DashboardItemEvents[_0xeeef('0x4')](_0x20bd76+':'+_0x58512c['id'],_0x58512c);DashboardItemEvents[_0xeeef('0x4')](_0x20bd76,_0x58512c);_0x1d5b38(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xeeef('0x5')](e,emitEvent(event));}}module[_0xeeef('0x6')]=DashboardItemEvents;