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 _0x5f28=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update'];(function(_0x2562ce,_0x46066d){var _0x5f399a=function(_0x40f782){while(--_0x40f782){_0x2562ce['push'](_0x2562ce['shift']());}};_0x5f399a(++_0x46066d);}(_0x5f28,0xaa));var _0x85f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f28[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x85f2('0x0'));var WhatsappAccount=require(_0x85f2('0x1'))['db'][_0x85f2('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x85f2('0x3')](0x0);var events={'afterCreate':_0x85f2('0x4'),'afterUpdate':_0x85f2('0x5'),'afterDestroy':_0x85f2('0x6')};function emitEvent(_0x5a4daa){return function(_0x3bbbce,_0x2ccf42,_0x14174e){WhatsappAccountEvents[_0x85f2('0x7')](_0x5a4daa+':'+_0x3bbbce['id'],_0x3bbbce);WhatsappAccountEvents[_0x85f2('0x7')](_0x5a4daa,_0x3bbbce);_0x14174e(null);};}for(var e in events){if(events[_0x85f2('0x8')](e)){var event=events[e];WhatsappAccount[_0x85f2('0x9')](e,emitEvent(event));}}module[_0x85f2('0xa')]=WhatsappAccountEvents;