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 _0x83d0=['emit','hasOwnProperty','hook','events','../../mysqldb','UserProfile','setMaxListeners','save','update'];(function(_0x1d9a84,_0x157084){var _0x418754=function(_0xfc0e01){while(--_0xfc0e01){_0x1d9a84['push'](_0x1d9a84['shift']());}};_0x418754(++_0x157084);}(_0x83d0,0xb7));var _0x083d=function(_0x4e93b7,_0x33abed){_0x4e93b7=_0x4e93b7-0x0;var _0x16caba=_0x83d0[_0x4e93b7];return _0x16caba;};'use strict';var EventEmitter=require(_0x083d('0x0'));var UserProfile=require(_0x083d('0x1'))['db'][_0x083d('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x083d('0x3')](0x0);var events={'afterCreate':_0x083d('0x4'),'afterUpdate':_0x083d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1f31e){return function(_0x4ff4cb,_0x5625dc,_0x404d77){UserProfileEvents[_0x083d('0x6')](_0x1f31e+':'+_0x4ff4cb['id'],_0x4ff4cb);UserProfileEvents[_0x083d('0x6')](_0x1f31e,_0x4ff4cb);_0x404d77(null);};}for(var e in events){if(events[_0x083d('0x7')](e)){var event=events[e];UserProfile[_0x083d('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents;