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 _0xde9c=['exports','events','../../mysqldb','setMaxListeners','save','update','hasOwnProperty','hook'];(function(_0x1ac121,_0x5d384b){var _0x47bf49=function(_0x2a901f){while(--_0x2a901f){_0x1ac121['push'](_0x1ac121['shift']());}};_0x47bf49(++_0x5d384b);}(_0xde9c,0xa9));var _0xcde9=function(_0x3159e6,_0x4c57f6){_0x3159e6=_0x3159e6-0x0;var _0x3e05a=_0xde9c[_0x3159e6];return _0x3e05a;};'use strict';var EventEmitter=require(_0xcde9('0x0'));var ChatWebsite=require(_0xcde9('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xcde9('0x2')](0x0);var events={'afterCreate':_0xcde9('0x3'),'afterUpdate':_0xcde9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x44e5bf){return function(_0x25e02b,_0x30a01a,_0x38b589){ChatWebsiteEvents['emit'](_0x44e5bf+':'+_0x25e02b['id'],_0x25e02b);ChatWebsiteEvents['emit'](_0x44e5bf,_0x25e02b);_0x38b589(null);};}for(var e in events){if(events[_0xcde9('0x5')](e)){var event=events[e];ChatWebsite[_0xcde9('0x6')](e,emitEvent(event));}}module[_0xcde9('0x7')]=ChatWebsiteEvents;