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 _0xfce0=['remove','emit','hasOwnProperty','hook','DashboardItem','setMaxListeners','save','update'];(function(_0x40c849,_0xbc22a1){var _0x7d3bef=function(_0x23df0c){while(--_0x23df0c){_0x40c849['push'](_0x40c849['shift']());}};_0x7d3bef(++_0xbc22a1);}(_0xfce0,0x15c));var _0x0fce=function(_0xa6a3b1,_0x5ccc11){_0xa6a3b1=_0xa6a3b1-0x0;var _0x4054ff=_0xfce0[_0xa6a3b1];return _0x4054ff;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0x0fce('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x0fce('0x1')](0x0);var events={'afterCreate':_0x0fce('0x2'),'afterUpdate':_0x0fce('0x3'),'afterDestroy':_0x0fce('0x4')};function emitEvent(_0x52744e){return function(_0x34cbca,_0x180d77,_0x3e772f){DashboardItemEvents[_0x0fce('0x5')](_0x52744e+':'+_0x34cbca['id'],_0x34cbca);DashboardItemEvents['emit'](_0x52744e,_0x34cbca);_0x3e772f(null);};}for(var e in events){if(events[_0x0fce('0x6')](e)){var event=events[e];DashboardItem[_0x0fce('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;