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 _0x398a=['hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x4ddfe1,_0x35939d){var _0x4aaf51=function(_0x1e99a0){while(--_0x1e99a0){_0x4ddfe1['push'](_0x4ddfe1['shift']());}};_0x4aaf51(++_0x35939d);}(_0x398a,0x11a));var _0xa398=function(_0x967512,_0x4af710){_0x967512=_0x967512-0x0;var _0x484475=_0x398a[_0x967512];return _0x484475;};'use strict';var EventEmitter=require(_0xa398('0x0'));var UserProfile=require(_0xa398('0x1'))['db'][_0xa398('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa398('0x3')](0x0);var events={'afterCreate':_0xa398('0x4'),'afterUpdate':_0xa398('0x5'),'afterDestroy':'remove'};function emitEvent(_0x538105){return function(_0x51a35c,_0x29c575,_0x3d14ae){UserProfileEvents[_0xa398('0x6')](_0x538105+':'+_0x51a35c['id'],_0x51a35c);UserProfileEvents[_0xa398('0x6')](_0x538105,_0x51a35c);_0x3d14ae(null);};}for(var e in events){if(events[_0xa398('0x7')](e)){var event=events[e];UserProfile[_0xa398('0x8')](e,emitEvent(event));}}module[_0xa398('0x9')]=UserProfileEvents;