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 _0x20f0=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20f0,0x1be));var _0x020f=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x20f0[_0xbeb808];return _0x5d6909;};'use strict';var EventEmitter=require(_0x020f('0x0'));var UserProfile=require(_0x020f('0x1'))['db'][_0x020f('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x020f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x020f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x12da43){return function(_0x3e1c3a,_0x5285fd,_0x5ab5ee){UserProfileEvents[_0x020f('0x5')](_0x12da43+':'+_0x3e1c3a['id'],_0x3e1c3a);UserProfileEvents[_0x020f('0x5')](_0x12da43,_0x3e1c3a);_0x5ab5ee(null);};}for(var e in events){if(events[_0x020f('0x6')](e)){var event=events[e];UserProfile[_0x020f('0x7')](e,emitEvent(event));}}module[_0x020f('0x8')]=UserProfileEvents;