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 _0x67c2=['remove','emit','hook','events','DashboardItem','save'];(function(_0x2dc70d,_0x26e805){var _0x3b9ecc=function(_0x52f7ef){while(--_0x52f7ef){_0x2dc70d['push'](_0x2dc70d['shift']());}};_0x3b9ecc(++_0x26e805);}(_0x67c2,0xc3));var _0x267c=function(_0x2a4458,_0x10ed3b){_0x2a4458=_0x2a4458-0x0;var _0x8ef7a0=_0x67c2[_0x2a4458];return _0x8ef7a0;};'use strict';var EventEmitter=require(_0x267c('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x267c('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x267c('0x2'),'afterUpdate':'update','afterDestroy':_0x267c('0x3')};function emitEvent(_0x5b2371){return function(_0xad5b56,_0x66fea3,_0x385da6){DashboardItemEvents[_0x267c('0x4')](_0x5b2371+':'+_0xad5b56['id'],_0xad5b56);DashboardItemEvents[_0x267c('0x4')](_0x5b2371,_0xad5b56);_0x385da6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x267c('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;