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 _0x8b2b=['../../mysqldb','WhatsappAccount','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x2c895a,_0xe949fd){var _0x2b9c0e=function(_0x43b9d0){while(--_0x43b9d0){_0x2c895a['push'](_0x2c895a['shift']());}};_0x2b9c0e(++_0xe949fd);}(_0x8b2b,0x18b));var _0xb8b2=function(_0x45253a,_0x3dae9e){_0x45253a=_0x45253a-0x0;var _0x1cec98=_0x8b2b[_0x45253a];return _0x1cec98;};'use strict';var EventEmitter=require(_0xb8b2('0x0'));var WhatsappAccount=require(_0xb8b2('0x1'))['db'][_0xb8b2('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xb8b2('0x3')](0x0);var events={'afterCreate':_0xb8b2('0x4'),'afterUpdate':'update','afterDestroy':_0xb8b2('0x5')};function emitEvent(_0x4cb8ec){return function(_0x478bdf,_0x2a8c6c,_0x861d06){WhatsappAccountEvents[_0xb8b2('0x6')](_0x4cb8ec+':'+_0x478bdf['id'],_0x478bdf);WhatsappAccountEvents[_0xb8b2('0x6')](_0x4cb8ec,_0x478bdf);_0x861d06(null);};}for(var e in events){if(events[_0xb8b2('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xb8b2('0x8')]=WhatsappAccountEvents;