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 _0x58cf=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0xb7524c,_0x38cced){var _0x4ce284=function(_0x47ff67){while(--_0x47ff67){_0xb7524c['push'](_0xb7524c['shift']());}};_0x4ce284(++_0x38cced);}(_0x58cf,0x196));var _0xf58c=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0x58cf[_0x4defd6];return _0x4c9276;};'use strict';var EventEmitter=require(_0xf58c('0x0'));var Team=require(_0xf58c('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xf58c('0x2')](0x0);var events={'afterCreate':_0xf58c('0x3'),'afterUpdate':_0xf58c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e5b0f){return function(_0x59845d,_0x47f7b6,_0x453fab){TeamEvents[_0xf58c('0x5')](_0x2e5b0f+':'+_0x59845d['id'],_0x59845d);TeamEvents[_0xf58c('0x5')](_0x2e5b0f,_0x59845d);_0x453fab(null);};}for(var e in events){if(events[_0xf58c('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xf58c('0x7')]=TeamEvents;