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 _0x1caf=['exports','events','DashboardItem','remove','emit','hook'];(function(_0xf9c1d,_0x22129b){var _0x53a527=function(_0xacdd5c){while(--_0xacdd5c){_0xf9c1d['push'](_0xf9c1d['shift']());}};_0x53a527(++_0x22129b);}(_0x1caf,0x1e1));var _0xf1ca=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x1caf[_0x55e08b];return _0xd1a7ff;};'use strict';var EventEmitter=require(_0xf1ca('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xf1ca('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf1ca('0x2')};function emitEvent(_0x4c6608){return function(_0x14851b,_0x5a1889,_0x54b227){DashboardItemEvents['emit'](_0x4c6608+':'+_0x14851b['id'],_0x14851b);DashboardItemEvents[_0xf1ca('0x3')](_0x4c6608,_0x14851b);_0x54b227(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xf1ca('0x4')](e,emitEvent(event));}}module[_0xf1ca('0x5')]=DashboardItemEvents;