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 _0x25fa=['emit','hasOwnProperty','hook','exports','events','ChatWebsite','setMaxListeners','update','remove'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x25fa,0x109));var _0xa25f=function(_0x357efd,_0x1d7413){_0x357efd=_0x357efd-0x0;var _0x524c53=_0x25fa[_0x357efd];return _0x524c53;};'use strict';var EventEmitter=require(_0xa25f('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xa25f('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa25f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa25f('0x3'),'afterDestroy':_0xa25f('0x4')};function emitEvent(_0x256155){return function(_0x4d0b34,_0x4e444d,_0x2e8499){ChatWebsiteEvents['emit'](_0x256155+':'+_0x4d0b34['id'],_0x4d0b34);ChatWebsiteEvents[_0xa25f('0x5')](_0x256155,_0x4d0b34);_0x2e8499(null);};}for(var e in events){if(events[_0xa25f('0x6')](e)){var event=events[e];ChatWebsite[_0xa25f('0x7')](e,emitEvent(event));}}module[_0xa25f('0x8')]=ChatWebsiteEvents;