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 _0xcc87=['events','DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x24d24e,_0x4e17a4){var _0x20e068=function(_0x48d5e5){while(--_0x48d5e5){_0x24d24e['push'](_0x24d24e['shift']());}};_0x20e068(++_0x4e17a4);}(_0xcc87,0x158));var _0x7cc8=function(_0x343ec2,_0x4f4049){_0x343ec2=_0x343ec2-0x0;var _0x2af9eb=_0xcc87[_0x343ec2];return _0x2af9eb;};'use strict';var EventEmitter=require(_0x7cc8('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x7cc8('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7cc8('0x2')](0x0);var events={'afterCreate':_0x7cc8('0x3'),'afterUpdate':_0x7cc8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x18cce6){return function(_0x9080cd,_0x460ca7,_0x351d75){DashboardItemEvents[_0x7cc8('0x5')](_0x18cce6+':'+_0x9080cd['id'],_0x9080cd);DashboardItemEvents[_0x7cc8('0x5')](_0x18cce6,_0x9080cd);_0x351d75(null);};}for(var e in events){if(events[_0x7cc8('0x6')](e)){var event=events[e];DashboardItem[_0x7cc8('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;