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 _0x48d5=['save','update','remove','emit','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0x48d5,0xec));var _0x548d=function(_0x3f48e0,_0x453a44){_0x3f48e0=_0x3f48e0-0x0;var _0x2333e1=_0x48d5[_0x3f48e0];return _0x2333e1;};'use strict';var EventEmitter=require(_0x548d('0x0'));var WhatsappAccount=require(_0x548d('0x1'))['db'][_0x548d('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x548d('0x3')](0x0);var events={'afterCreate':_0x548d('0x4'),'afterUpdate':_0x548d('0x5'),'afterDestroy':_0x548d('0x6')};function emitEvent(_0x555b96){return function(_0x3adfa1,_0x1ac9cc,_0x4733b7){WhatsappAccountEvents[_0x548d('0x7')](_0x555b96+':'+_0x3adfa1['id'],_0x3adfa1);WhatsappAccountEvents['emit'](_0x555b96,_0x3adfa1);_0x4733b7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x548d('0x8')](e,emitEvent(event));}}module[_0x548d('0x9')]=WhatsappAccountEvents;