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 _0xcb81=['setMaxListeners','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4ced0e,_0x5c2624){var _0x10d996=function(_0x2efe65){while(--_0x2efe65){_0x4ced0e['push'](_0x4ced0e['shift']());}};_0x10d996(++_0x5c2624);}(_0xcb81,0x154));var _0x1cb8=function(_0x134d5e,_0x2a47d8){_0x134d5e=_0x134d5e-0x0;var _0x1e166a=_0xcb81[_0x134d5e];return _0x1e166a;};'use strict';var EventEmitter=require(_0x1cb8('0x0'));var ChatWebsite=require(_0x1cb8('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1cb8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x38c3ea){return function(_0x33a8f2,_0x237e94,_0x3642b9){ChatWebsiteEvents[_0x1cb8('0x3')](_0x38c3ea+':'+_0x33a8f2['id'],_0x33a8f2);ChatWebsiteEvents['emit'](_0x38c3ea,_0x33a8f2);_0x3642b9(null);};}for(var e in events){if(events[_0x1cb8('0x4')](e)){var event=events[e];ChatWebsite[_0x1cb8('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;