From: Andrea Amorese
Date: Fri, 3 Dec 2021 14:33:23 +0000 (+0100)
Subject: Built motion from commit 9e2f92ed.|2.5.40
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22%7B%7Blicense.mail?a=commitdiff_plain;h=d6cebe878dca3dfd10fec5566f644d547a41c0dc;p=motion2.git
Built motion from commit 9e2f92ed.|2.5.40
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index a386bb1..18b90a8 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-12-03T10:52:32.419Z",
+ "time": "2021-12-03T14:08:13.428Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index e4c7239..fd2f6aa 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-12-03T10:52:32.419Z",
+ "time": "2021-12-03T14:08:13.428Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index 027a36a..90e797f 100644
--- a/server/api/action/action.attributes.js
+++ b/server/api/action/action.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a0d=['urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x53ec91,_0x7eb7bb){var _0x36d102=function(_0x279d65){while(--_0x279d65){_0x53ec91['push'](_0x53ec91['shift']());}};_0x36d102(++_0x7eb7bb);}(_0x2a0d,0x1c4));var _0xd2a0=function(_0x2d5b09,_0x3cdc73){_0x2d5b09=_0x2d5b09-0x0;var _0x3e106b=_0x2a0d[_0x2d5b09];return _0x3e106b;};'use strict';var Sequelize=require(_0xd2a0('0x0'));module[_0xd2a0('0x1')]={'name':{'type':Sequelize[_0xd2a0('0x2')],'get':function(_0x136dad){return this['getDataValue'](_0xd2a0('0x3'));}},'action':{'type':Sequelize[_0xd2a0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xd2a0('0x5'),_0xd2a0('0x6'),'motionbar',_0xd2a0('0x7'),_0xd2a0('0x8'),_0xd2a0('0x9'),_0xd2a0('0xa'),_0xd2a0('0xb')]],'msg':_0xd2a0('0xc')}},'comment':_0xd2a0('0xc')},'data1':{'type':Sequelize[_0xd2a0('0x4')](0x1000),'comment':_0xd2a0('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xd2a0('0xe')},'data4':{'type':Sequelize[_0xd2a0('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xd2a0('0x4')](0x1000),'comments':_0xd2a0('0xf')},'data6':{'type':Sequelize[_0xd2a0('0x4')],'comments':_0xd2a0('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':_0xd2a0('0x11')}};
\ No newline at end of file
+var _0x76a6=['exports','getDataValue','action','STRING','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x76a6,0x18b));var _0x676a=function(_0x50af9c,_0xf03b1e){_0x50af9c=_0x50af9c-0x0;var _0x5b5e5a=_0x76a6[_0x50af9c];return _0x5b5e5a;};'use strict';var Sequelize=require(_0x676a('0x0'));module[_0x676a('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xf9a7f3){return this[_0x676a('0x2')](_0x676a('0x3'));}},'action':{'type':Sequelize[_0x676a('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x676a('0x5'),_0x676a('0x6'),_0x676a('0x7'),'urlForward',_0x676a('0x8'),_0x676a('0x9'),_0x676a('0xa')]],'msg':_0x676a('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x676a('0x4')](0x1000),'comment':_0x676a('0xc')},'data2':{'type':Sequelize[_0x676a('0x4')](0x1000),'comment':_0x676a('0xd')},'data3':{'type':Sequelize[_0x676a('0x4')](0x1000),'comment':_0x676a('0xe')},'data4':{'type':Sequelize[_0x676a('0x4')](0x1000),'comments':_0x676a('0xf')},'data5':{'type':Sequelize[_0x676a('0x4')](0x1000),'comments':_0x676a('0x10')},'data6':{'type':Sequelize[_0x676a('0x4')],'comments':_0x676a('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index c795a77..39a7d60 100644
--- a/server/api/action/action.controller.js
+++ b/server/api/action/action.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5650=['mustache','path','sox','to-csv','fs-extra','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','body','find','catch','Action','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x1a9e78,_0x180720){var _0x113e06=function(_0x229c64){while(--_0x229c64){_0x1a9e78['push'](_0x1a9e78['shift']());}};_0x113e06(++_0x180720);}(_0x5650,0x1c6));var _0x0565=function(_0x1083f0,_0x190add){_0x1083f0=_0x1083f0-0x0;var _0x3e671f=_0x5650[_0x1083f0];return _0x3e671f;};'use strict';var emlformat=require(_0x0565('0x0'));var rimraf=require(_0x0565('0x1'));var zipdir=require(_0x0565('0x2'));var jsonpatch=require(_0x0565('0x3'));var rp=require(_0x0565('0x4'));var moment=require('moment');var BPromise=require(_0x0565('0x5'));var Mustache=require(_0x0565('0x6'));var util=require('util');var path=require(_0x0565('0x7'));var sox=require(_0x0565('0x8'));var csv=require(_0x0565('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0565('0xa'));var _=require('lodash');var squel=require(_0x0565('0xb'));var crypto=require('crypto');var jsforce=require(_0x0565('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0565('0x9'));var querystring=require(_0x0565('0xd'));var Papa=require('papaparse');var Redis=require(_0x0565('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0565('0xf'));var as=require(_0x0565('0x10'));var hardwareService=require(_0x0565('0x11'));var logger=require('../../config/logger')(_0x0565('0x12'));var utils=require(_0x0565('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0565('0x14'));var db=require(_0x0565('0x15'))['db'];function respondWithStatusCode(_0x9862cf,_0x27731b){_0x27731b=_0x27731b||0xcc;return function(_0x4eb259){if(_0x4eb259){return _0x9862cf[_0x0565('0x16')](_0x27731b);}return _0x9862cf[_0x0565('0x17')](_0x27731b)[_0x0565('0x18')]();};}function respondWithResult(_0x337014,_0x4fa192){_0x4fa192=_0x4fa192||0xc8;return function(_0x1f6759){if(_0x1f6759){return _0x337014[_0x0565('0x17')](_0x4fa192)[_0x0565('0x19')](_0x1f6759);}};}function respondWithFilteredResult(_0x5ef9f2,_0x586e8c){return function(_0x1324dd){if(_0x1324dd){var _0x25e44a=typeof _0x586e8c['offset']===_0x0565('0x1a')&&typeof _0x586e8c[_0x0565('0x1b')]===_0x0565('0x1a');var _0x3134e7=_0x1324dd[_0x0565('0x1c')];var _0x54660c=_0x25e44a?0x0:_0x586e8c[_0x0565('0x1d')];var _0x4f3031=_0x25e44a?_0x1324dd[_0x0565('0x1c')]:_0x586e8c[_0x0565('0x1d')]+_0x586e8c['limit'];var _0x38ce77;if(_0x4f3031>=_0x3134e7){_0x4f3031=_0x3134e7;_0x38ce77=0xc8;}else{_0x38ce77=0xce;}_0x5ef9f2['status'](_0x38ce77);return _0x5ef9f2[_0x0565('0x1e')](_0x0565('0x1f'),_0x54660c+'-'+_0x4f3031+'/'+_0x3134e7)[_0x0565('0x19')](_0x1324dd);}return null;};}function patchUpdates(_0x15d63c){return function(_0x534783){try{jsonpatch[_0x0565('0x20')](_0x534783,_0x15d63c,!![]);}catch(_0x4e5f52){return BPromise[_0x0565('0x21')](_0x4e5f52);}return _0x534783[_0x0565('0x22')]();};}function saveUpdates(_0x475504,_0x19b7cc){return function(_0x2fe5db){if(_0x2fe5db){return _0x2fe5db[_0x0565('0x23')](_0x475504)[_0x0565('0x24')](function(_0x45b586){return _0x45b586;});}return null;};}function removeEntity(_0x4e93b7,_0x20ef1f){return function(_0x29de05){if(_0x29de05){return _0x29de05[_0x0565('0x25')]()[_0x0565('0x24')](function(){_0x4e93b7[_0x0565('0x17')](0xcc)[_0x0565('0x18')]();});}};}function handleEntityNotFound(_0x3783f7,_0x2bda5d){return function(_0x3ec8bf){if(!_0x3ec8bf){_0x3783f7[_0x0565('0x16')](0x194);}return _0x3ec8bf;};}function handleError(_0x338187,_0x55e898){_0x55e898=_0x55e898||0x1f4;return function(_0xacfa74){logger[_0x0565('0x26')](_0xacfa74[_0x0565('0x27')]);if(_0xacfa74[_0x0565('0x28')]){delete _0xacfa74['name'];}_0x338187['status'](_0x55e898)['send'](_0xacfa74);};}exports['update']=function(_0x26372a,_0xd02001){if(_0x26372a[_0x0565('0x29')]['id']){delete _0x26372a['body']['id'];}return db['Action'][_0x0565('0x2a')]({'where':{'id':_0x26372a['params']['id']}})[_0x0565('0x24')](handleEntityNotFound(_0xd02001,null))['then'](saveUpdates(_0x26372a[_0x0565('0x29')],null))[_0x0565('0x24')](respondWithResult(_0xd02001,null))[_0x0565('0x2b')](handleError(_0xd02001,null));};exports['destroy']=function(_0x1952d8,_0xc73060){return db[_0x0565('0x2c')]['find']({'where':{'id':_0x1952d8[_0x0565('0x2d')]['id']}})[_0x0565('0x24')](handleEntityNotFound(_0xc73060,null))[_0x0565('0x24')](removeEntity(_0xc73060,null))['catch'](handleError(_0xc73060,null));};
\ No newline at end of file
+var _0xaedf=['fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','end','error','stack','name','find','then','body','catch','Action','params','rimraf','zip-dir'];(function(_0x4487b4,_0x1a719f){var _0x15fa42=function(_0x2fcbee){while(--_0x2fcbee){_0x4487b4['push'](_0x4487b4['shift']());}};_0x15fa42(++_0x1a719f);}(_0xaedf,0x132));var _0xfaed=function(_0xd1ef6b,_0x11e678){_0xd1ef6b=_0xd1ef6b-0x0;var _0x21a1fe=_0xaedf[_0xd1ef6b];return _0x21a1fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfaed('0x0'));var zipdir=require(_0xfaed('0x1'));var jsonpatch=require(_0xfaed('0x2'));var rp=require('request-promise');var moment=require(_0xfaed('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfaed('0x4'));var util=require(_0xfaed('0x5'));var path=require(_0xfaed('0x6'));var sox=require(_0xfaed('0x7'));var csv=require('to-csv');var ejs=require(_0xfaed('0x8'));var fs=require('fs');var fs_extra=require(_0xfaed('0x9'));var _=require(_0xfaed('0xa'));var squel=require(_0xfaed('0xb'));var crypto=require('crypto');var jsforce=require(_0xfaed('0xc'));var deskjs=require(_0xfaed('0xd'));var toCsv=require(_0xfaed('0xe'));var querystring=require(_0xfaed('0xf'));var Papa=require(_0xfaed('0x10'));var Redis=require(_0xfaed('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfaed('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfaed('0x13'));var logger=require('../../config/logger')(_0xfaed('0x14'));var utils=require(_0xfaed('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfaed('0x16'))['db'];function respondWithStatusCode(_0x56659f,_0xc8d341){_0xc8d341=_0xc8d341||0xcc;return function(_0x130d24){if(_0x130d24){return _0x56659f[_0xfaed('0x17')](_0xc8d341);}return _0x56659f[_0xfaed('0x18')](_0xc8d341)['end']();};}function respondWithResult(_0x1d4557,_0x593974){_0x593974=_0x593974||0xc8;return function(_0x5aa84c){if(_0x5aa84c){return _0x1d4557['status'](_0x593974)[_0xfaed('0x19')](_0x5aa84c);}};}function respondWithFilteredResult(_0x4878fc,_0x158e7b){return function(_0x19d9de){if(_0x19d9de){var _0x307ac0=typeof _0x158e7b[_0xfaed('0x1a')]===_0xfaed('0x1b')&&typeof _0x158e7b[_0xfaed('0x1c')]===_0xfaed('0x1b');var _0x515705=_0x19d9de[_0xfaed('0x1d')];var _0x2525f8=_0x307ac0?0x0:_0x158e7b[_0xfaed('0x1a')];var _0x45f8ff=_0x307ac0?_0x19d9de[_0xfaed('0x1d')]:_0x158e7b[_0xfaed('0x1a')]+_0x158e7b[_0xfaed('0x1c')];var _0x56dde5;if(_0x45f8ff>=_0x515705){_0x45f8ff=_0x515705;_0x56dde5=0xc8;}else{_0x56dde5=0xce;}_0x4878fc[_0xfaed('0x18')](_0x56dde5);return _0x4878fc[_0xfaed('0x1e')](_0xfaed('0x1f'),_0x2525f8+'-'+_0x45f8ff+'/'+_0x515705)['json'](_0x19d9de);}return null;};}function patchUpdates(_0x366469){return function(_0x11da66){try{jsonpatch['apply'](_0x11da66,_0x366469,!![]);}catch(_0xc0b1db){return BPromise['reject'](_0xc0b1db);}return _0x11da66[_0xfaed('0x20')]();};}function saveUpdates(_0x2c0683,_0x3d2e1b){return function(_0x3ec6b9){if(_0x3ec6b9){return _0x3ec6b9[_0xfaed('0x21')](_0x2c0683)['then'](function(_0x4a3dbc){return _0x4a3dbc;});}return null;};}function removeEntity(_0x27a0e6,_0x1e7fcf){return function(_0x4aa310){if(_0x4aa310){return _0x4aa310['destroy']()['then'](function(){_0x27a0e6[_0xfaed('0x18')](0xcc)[_0xfaed('0x22')]();});}};}function handleEntityNotFound(_0xce1ac1,_0x293632){return function(_0xa1ec81){if(!_0xa1ec81){_0xce1ac1[_0xfaed('0x17')](0x194);}return _0xa1ec81;};}function handleError(_0x1dfed0,_0x39754b){_0x39754b=_0x39754b||0x1f4;return function(_0x29dd79){logger[_0xfaed('0x23')](_0x29dd79[_0xfaed('0x24')]);if(_0x29dd79[_0xfaed('0x25')]){delete _0x29dd79[_0xfaed('0x25')];}_0x1dfed0[_0xfaed('0x18')](_0x39754b)['send'](_0x29dd79);};}exports[_0xfaed('0x21')]=function(_0x54dee5,_0x288a16){if(_0x54dee5['body']['id']){delete _0x54dee5['body']['id'];}return db['Action'][_0xfaed('0x26')]({'where':{'id':_0x54dee5['params']['id']}})['then'](handleEntityNotFound(_0x288a16,null))[_0xfaed('0x27')](saveUpdates(_0x54dee5[_0xfaed('0x28')],null))[_0xfaed('0x27')](respondWithResult(_0x288a16,null))[_0xfaed('0x29')](handleError(_0x288a16,null));};exports['destroy']=function(_0x21152c,_0x3a4383){return db[_0xfaed('0x2a')]['find']({'where':{'id':_0x21152c[_0xfaed('0x2b')]['id']}})[_0xfaed('0x27')](handleEntityNotFound(_0x3a4383,null))[_0xfaed('0x27')](removeEntity(_0x3a4383,null))['catch'](handleError(_0x3a4383,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 2f20b4c..475a0dc 100644
--- a/server/api/action/action.model.js
+++ b/server/api/action/action.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x91d3=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util'];(function(_0x3f5639,_0x2861c5){var _0x226cad=function(_0x1b3397){while(--_0x1b3397){_0x3f5639['push'](_0x3f5639['shift']());}};_0x226cad(++_0x2861c5);}(_0x91d3,0x113));var _0x391d=function(_0x5f4c64,_0x31e2ac){_0x5f4c64=_0x5f4c64-0x0;var _0x3da86e=_0x91d3[_0x5f4c64];return _0x3da86e;};'use strict';var _=require('lodash');var util=require(_0x391d('0x0'));var logger=require(_0x391d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x391d('0x2'));var rp=require(_0x391d('0x3'));var fs=require('fs');var path=require(_0x391d('0x4'));var rimraf=require(_0x391d('0x5'));var config=require(_0x391d('0x6'));var attributes=require(_0x391d('0x7'));module[_0x391d('0x8')]=function(_0x16101f,_0x13fe66){return _0x16101f[_0x391d('0x9')](_0x391d('0xa'),attributes,{'tableName':_0x391d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe6a3=['request-promise','path','../../config/environment','./action.attributes','exports','Action','lodash','util','../../config/logger','api'];(function(_0x9a79e7,_0x427dbd){var _0x9516b2=function(_0x1c396f){while(--_0x1c396f){_0x9a79e7['push'](_0x9a79e7['shift']());}};_0x9516b2(++_0x427dbd);}(_0xe6a3,0x11e));var _0x3e6a=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0xe6a3[_0x5a1a51];return _0x47edd7;};'use strict';var _=require(_0x3e6a('0x0'));var util=require(_0x3e6a('0x1'));var logger=require(_0x3e6a('0x2'))(_0x3e6a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3e6a('0x4'));var fs=require('fs');var path=require(_0x3e6a('0x5'));var rimraf=require('rimraf');var config=require(_0x3e6a('0x6'));var attributes=require(_0x3e6a('0x7'));module[_0x3e6a('0x8')]=function(_0x511667,_0x28bb64){return _0x511667['define'](_0x3e6a('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 6c2c7b9..8c3a515 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x814b,0x1a2));var _0xb814=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x814b[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x53ec,0x192));var _0xc53e=function(_0x39304b,_0x30a033){_0x39304b=_0x39304b-0x0;var _0x21160c=_0x53ec[_0x39304b];return _0x21160c;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index be3c5ea..248f953 100644
--- a/server/api/action/index.js
+++ b/server/api/action/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5a05=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x14152d,_0x252ee7){var _0x47f6c3=function(_0x446679){while(--_0x446679){_0x14152d['push'](_0x14152d['shift']());}};_0x47f6c3(++_0x252ee7);}(_0x5a05,0x1a3));var _0x55a0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5a05[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x55a0('0x0'));var util=require(_0x55a0('0x1'));var path=require(_0x55a0('0x2'));var timeout=require(_0x55a0('0x3'));var express=require(_0x55a0('0x4'));var router=express[_0x55a0('0x5')]();var fs_extra=require(_0x55a0('0x6'));var auth=require(_0x55a0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x55a0('0x8'));var controller=require(_0x55a0('0x9'));router[_0x55a0('0xa')](_0x55a0('0xb'),auth[_0x55a0('0xc')](),controller['update']);router[_0x55a0('0xd')]('/:id',auth[_0x55a0('0xc')](),controller[_0x55a0('0xe')]);module[_0x55a0('0xf')]=router;
\ No newline at end of file
+var _0x4b44=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','isAuthenticated','delete','/:id','destroy','exports','multer','util'];(function(_0x119b96,_0x587acd){var _0x516cbf=function(_0x5d4b36){while(--_0x5d4b36){_0x119b96['push'](_0x119b96['shift']());}};_0x516cbf(++_0x587acd);}(_0x4b44,0x1cc));var _0x44b4=function(_0x57c789,_0x1a1755){_0x57c789=_0x57c789-0x0;var _0x348157=_0x4b44[_0x57c789];return _0x348157;};'use strict';var multer=require(_0x44b4('0x0'));var util=require(_0x44b4('0x1'));var path=require('path');var timeout=require(_0x44b4('0x2'));var express=require(_0x44b4('0x3'));var router=express[_0x44b4('0x4')]();var fs_extra=require(_0x44b4('0x5'));var auth=require(_0x44b4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x44b4('0x7'));var controller=require(_0x44b4('0x8'));router['put']('/:id',auth[_0x44b4('0x9')](),controller['update']);router[_0x44b4('0xa')](_0x44b4('0xb'),auth[_0x44b4('0x9')](),controller[_0x44b4('0xc')]);module[_0x44b4('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 24ec2c9..465b695 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c09=['exports','STRING','TEXT'];(function(_0x3f7e9f,_0x5d8b0a){var _0x32236b=function(_0x13dca4){while(--_0x13dca4){_0x3f7e9f['push'](_0x3f7e9f['shift']());}};_0x32236b(++_0x5d8b0a);}(_0x7c09,0x102));var _0x97c0=function(_0x553dd8,_0x105301){_0x553dd8=_0x553dd8-0x0;var _0x348035=_0x7c09[_0x553dd8];return _0x348035;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}};
\ No newline at end of file
+var _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0x4b3e49,_0x9e566c){var _0x57e339=function(_0x1430e9){while(--_0x1430e9){_0x4b3e49['push'](_0x4b3e49['shift']());}};_0x57e339(++_0x9e566c);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x36757d,_0x3ed0a8){_0x36757d=_0x36757d-0x0;var _0x426b80=_0xb4c7[_0x36757d];return _0x426b80;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index a13557c..2509c7d 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.controller.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7dbb=['findAll','rows','catch','show','params','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','autoAssociation','error','preview','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','MIN(%s)','HOUR(%s)','ROUND(%s)','value','order','alias','web','fullPath','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','SELECT','run','runReport','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','CustomReports','UserProfileResource','then','sendStatus','stack','name','index','map','AnalyticCustomReport','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x1550ee,_0x475605){var _0x2faee8=function(_0x38dbea){while(--_0x38dbea){_0x1550ee['push'](_0x1550ee['shift']());}};_0x2faee8(++_0x475605);}(_0x7dbb,0x1ac));var _0xb7db=function(_0x2a1034,_0x1076d2){_0x2a1034=_0x2a1034-0x0;var _0x2afdf9=_0x7dbb[_0x2a1034];return _0x2afdf9;};'use strict';var emlformat=require(_0xb7db('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb7db('0x1'));var jsonpatch=require(_0xb7db('0x2'));var rp=require(_0xb7db('0x3'));var moment=require(_0xb7db('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb7db('0x5'));var util=require(_0xb7db('0x6'));var path=require(_0xb7db('0x7'));var sox=require('sox');var csv=require(_0xb7db('0x8'));var ejs=require(_0xb7db('0x9'));var fs=require('fs');var fs_extra=require(_0xb7db('0xa'));var _=require(_0xb7db('0xb'));var squel=require('squel');var crypto=require(_0xb7db('0xc'));var jsforce=require(_0xb7db('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb7db('0x8'));var querystring=require(_0xb7db('0xe'));var Papa=require(_0xb7db('0xf'));var Redis=require(_0xb7db('0x10'));var authService=require(_0xb7db('0x11'));var qs=require(_0xb7db('0x12'));var as=require(_0xb7db('0x13'));var hardwareService=require(_0xb7db('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb7db('0x15'));var licenseUtil=require(_0xb7db('0x16'));var db=require(_0xb7db('0x17'))['db'];var dbH=require(_0xb7db('0x17'))[_0xb7db('0x18')];function respondWithStatusCode(_0x130e94,_0x16d848){_0x16d848=_0x16d848||0xcc;return function(_0x1b8902){if(_0x1b8902){return _0x130e94['sendStatus'](_0x16d848);}return _0x130e94[_0xb7db('0x19')](_0x16d848)[_0xb7db('0x1a')]();};}function respondWithResult(_0x2da35c,_0x542493){_0x542493=_0x542493||0xc8;return function(_0x2e0ba5){if(_0x2e0ba5){return _0x2da35c[_0xb7db('0x19')](_0x542493)[_0xb7db('0x1b')](_0x2e0ba5);}};}function respondWithFilteredResult(_0x299a29,_0x3f8a2e){return function(_0x2b233d){if(_0x2b233d){var _0x474839=typeof _0x3f8a2e[_0xb7db('0x1c')]===_0xb7db('0x1d')&&typeof _0x3f8a2e[_0xb7db('0x1e')]===_0xb7db('0x1d');var _0x2e6deb=_0x2b233d['count'];var _0x2717eb=_0x474839?0x0:_0x3f8a2e[_0xb7db('0x1c')];var _0x2af235=_0x474839?_0x2b233d[_0xb7db('0x1f')]:_0x3f8a2e['offset']+_0x3f8a2e[_0xb7db('0x1e')];var _0x5c47bb;if(_0x2af235>=_0x2e6deb){_0x2af235=_0x2e6deb;_0x5c47bb=0xc8;}else{_0x5c47bb=0xce;}_0x299a29['status'](_0x5c47bb);return _0x299a29[_0xb7db('0x20')](_0xb7db('0x21'),_0x2717eb+'-'+_0x2af235+'/'+_0x2e6deb)['json'](_0x2b233d);}return null;};}function patchUpdates(_0x397ffe){return function(_0x3be73f){try{jsonpatch[_0xb7db('0x22')](_0x3be73f,_0x397ffe,!![]);}catch(_0x566579){return BPromise['reject'](_0x566579);}return _0x3be73f[_0xb7db('0x23')]();};}function saveUpdates(_0x183d01,_0x177860){return function(_0x3c54f7){if(_0x3c54f7){return _0x3c54f7[_0xb7db('0x24')](_0x183d01)['then'](function(_0x286778){return _0x286778;});}return null;};}function removeEntity(_0x84ad76,_0x57a2f0){return function(_0x3af32d){if(_0x3af32d){return _0x3af32d[_0xb7db('0x25')]()['then'](function(){var _0x465e19=_0x3af32d['get']({'plain':!![]});var _0x157998=_0xb7db('0x26');return db[_0xb7db('0x27')][_0xb7db('0x25')]({'where':{'type':_0x157998,'resourceId':_0x465e19['id']}})['then'](function(){return _0x3af32d;});})[_0xb7db('0x28')](function(){_0x84ad76['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a661b,_0x13022a){return function(_0x346fa){if(!_0x346fa){_0x2a661b[_0xb7db('0x29')](0x194);}return _0x346fa;};}function handleError(_0x21dc11,_0xdd1c53){_0xdd1c53=_0xdd1c53||0x1f4;return function(_0x1a4798){logger['error'](_0x1a4798[_0xb7db('0x2a')]);if(_0x1a4798[_0xb7db('0x2b')]){delete _0x1a4798['name'];}_0x21dc11[_0xb7db('0x19')](_0xdd1c53)['send'](_0x1a4798);};}exports[_0xb7db('0x2c')]=function(_0xd2aa5e,_0x36691f){var _0x25b1b3={},_0x541cea={},_0x2a7734={'count':0x0,'rows':[]};var _0x163326=_[_0xb7db('0x2d')](db[_0xb7db('0x2e')][_0xb7db('0x2f')],function(_0x2fd48d){return{'name':_0x2fd48d['fieldName'],'type':_0x2fd48d[_0xb7db('0x30')][_0xb7db('0x31')]};});_0x541cea['model']=_[_0xb7db('0x2d')](_0x163326,_0xb7db('0x2b'));_0x541cea[_0xb7db('0x32')]=_[_0xb7db('0x33')](_0xd2aa5e[_0xb7db('0x32')]);_0x541cea[_0xb7db('0x34')]=_[_0xb7db('0x35')](_0x541cea[_0xb7db('0x36')],_0x541cea[_0xb7db('0x32')]);_0x25b1b3['attributes']=_['intersection'](_0x541cea[_0xb7db('0x36')],qs[_0xb7db('0x37')](_0xd2aa5e['query'][_0xb7db('0x37')]));_0x25b1b3[_0xb7db('0x38')]=_0x25b1b3[_0xb7db('0x38')]['length']?_0x25b1b3[_0xb7db('0x38')]:_0x541cea[_0xb7db('0x36')];if(!_0xd2aa5e[_0xb7db('0x32')]['hasOwnProperty'](_0xb7db('0x39'))){_0x25b1b3[_0xb7db('0x1e')]=qs['limit'](_0xd2aa5e[_0xb7db('0x32')][_0xb7db('0x1e')]);_0x25b1b3[_0xb7db('0x1c')]=qs['offset'](_0xd2aa5e[_0xb7db('0x32')]['offset']);}_0x25b1b3['order']=qs[_0xb7db('0x3a')](_0xd2aa5e[_0xb7db('0x32')][_0xb7db('0x3a')]);_0x25b1b3[_0xb7db('0x3b')]=qs[_0xb7db('0x34')](_[_0xb7db('0x3c')](_0xd2aa5e[_0xb7db('0x32')],_0x541cea[_0xb7db('0x34')]),_0x163326);if(_0xd2aa5e['query'][_0xb7db('0x3d')]){_0x25b1b3['where']=_[_0xb7db('0x3e')](_0x25b1b3[_0xb7db('0x3b')],{'$or':_[_0xb7db('0x2d')](_0x163326,function(_0xbad4f9){if(_0xbad4f9[_0xb7db('0x30')]!==_0xb7db('0x3f')){var _0x39fe80={};_0x39fe80[_0xbad4f9[_0xb7db('0x2b')]]={'$like':'%'+_0xd2aa5e['query'][_0xb7db('0x3d')]+'%'};return _0x39fe80;}})});}_0x25b1b3=_['merge']({},_0x25b1b3,_0xd2aa5e[_0xb7db('0x40')]);var _0x50b048={'where':_0x25b1b3[_0xb7db('0x3b')]};return db['AnalyticCustomReport']['count'](_0x50b048)['then'](function(_0x126d9c){_0x2a7734['count']=_0x126d9c;if(_0xd2aa5e[_0xb7db('0x32')][_0xb7db('0x41')]){_0x25b1b3[_0xb7db('0x42')]=[{'all':!![]}];}return db[_0xb7db('0x2e')][_0xb7db('0x43')](_0x25b1b3);})[_0xb7db('0x28')](function(_0x34bd40){_0x2a7734[_0xb7db('0x44')]=_0x34bd40;return _0x2a7734;})[_0xb7db('0x28')](respondWithFilteredResult(_0x36691f,_0x25b1b3))[_0xb7db('0x45')](handleError(_0x36691f,null));};exports[_0xb7db('0x46')]=function(_0x958ed6,_0x163716){var _0x291e01={'raw':![],'where':{'id':_0x958ed6[_0xb7db('0x47')]['id']}},_0x1e9fcd={};_0x1e9fcd['model']=_[_0xb7db('0x33')](db[_0xb7db('0x2e')][_0xb7db('0x2f')]);_0x1e9fcd['query']=_['keys'](_0x958ed6[_0xb7db('0x32')]);_0x1e9fcd[_0xb7db('0x34')]=_['intersection'](_0x1e9fcd[_0xb7db('0x36')],_0x1e9fcd[_0xb7db('0x32')]);_0x291e01[_0xb7db('0x38')]=_[_0xb7db('0x35')](_0x1e9fcd['model'],qs[_0xb7db('0x37')](_0x958ed6[_0xb7db('0x32')][_0xb7db('0x37')]));_0x291e01[_0xb7db('0x38')]=_0x291e01[_0xb7db('0x38')][_0xb7db('0x48')]?_0x291e01[_0xb7db('0x38')]:_0x1e9fcd[_0xb7db('0x36')];if(_0x958ed6[_0xb7db('0x32')]['includeAll']){_0x291e01[_0xb7db('0x42')]=[{'all':!![]}];}_0x291e01=_[_0xb7db('0x3e')]({},_0x291e01,_0x958ed6[_0xb7db('0x40')]);return db[_0xb7db('0x2e')][_0xb7db('0x49')](_0x291e01)['then'](handleEntityNotFound(_0x163716,null))[_0xb7db('0x28')](respondWithResult(_0x163716,null))[_0xb7db('0x45')](handleError(_0x163716,null));};exports[_0xb7db('0x4a')]=function(_0x5c0d0a,_0x3ee52b){return db['AnalyticCustomReport'][_0xb7db('0x4a')](_0x5c0d0a[_0xb7db('0x4b')],{})[_0xb7db('0x28')](function(_0x5356a7){var _0x4754cd=_0x5c0d0a['user'][_0xb7db('0x4c')]({'plain':!![]});if(!_0x4754cd)throw new Error(_0xb7db('0x4d'));if(_0x4754cd[_0xb7db('0x4e')]===_0xb7db('0x4f')){var _0xc21a47=_0x5356a7[_0xb7db('0x4c')]({'plain':!![]});var _0x859064=_0xb7db('0x50');return db['UserProfileSection'][_0xb7db('0x49')]({'where':{'name':_0x859064,'userProfileId':_0x4754cd['userProfileId']},'raw':!![]})[_0xb7db('0x28')](function(_0x507a70){if(_0x507a70&&_0x507a70[_0xb7db('0x51')]===0x0){return db['UserProfileResource'][_0xb7db('0x4a')]({'name':_0xc21a47[_0xb7db('0x2b')],'resourceId':_0xc21a47['id'],'type':'CustomReports','sectionId':_0x507a70['id']},{})['then'](function(){return _0x5356a7;});}else{return _0x5356a7;}})[_0xb7db('0x45')](function(_0x1b5a8a){logger[_0xb7db('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b5a8a);throw _0x1b5a8a;});}return _0x5356a7;})[_0xb7db('0x28')](respondWithResult(_0x3ee52b,0xc9))['catch'](handleError(_0x3ee52b,null));};exports['update']=function(_0x359550,_0x268760){if(_0x359550['body']['id']){delete _0x359550[_0xb7db('0x4b')]['id'];}return db['AnalyticCustomReport'][_0xb7db('0x49')]({'where':{'id':_0x359550[_0xb7db('0x47')]['id']}})['then'](handleEntityNotFound(_0x268760,null))[_0xb7db('0x28')](saveUpdates(_0x359550[_0xb7db('0x4b')],null))[_0xb7db('0x28')](respondWithResult(_0x268760,null))[_0xb7db('0x45')](handleError(_0x268760,null));};exports[_0xb7db('0x25')]=function(_0x50e828,_0x38e441){return db[_0xb7db('0x2e')][_0xb7db('0x49')]({'where':{'id':_0x50e828[_0xb7db('0x47')]['id']}})['then'](handleEntityNotFound(_0x38e441,null))[_0xb7db('0x28')](removeEntity(_0x38e441,null))['catch'](handleError(_0x38e441,null));};exports[_0xb7db('0x53')]=function(_0x2c6d6e,_0x15baf4){var _0x74e133=0xa;var _0x56aa41=[_0xb7db('0x54'),_0xb7db('0x55'),_0xb7db('0x56'),_0xb7db('0x57')];var _0x11fe23={'SUM':'SUM(%s)','COUNT':_0xb7db('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb7db('0x59'),'MIN':'MIN(%s)','AVG':_0xb7db('0x5a'),'GROUP_CONCAT':_0xb7db('0x5b'),'GROUP_CONCAT ASC':_0xb7db('0x5c'),'GROUP_CONCAT DESC':_0xb7db('0x5d')};var _0x4b2cde={'SEC_TO_TIME':_0xb7db('0x5e'),'DATE':_0xb7db('0x5f'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb7db('0x60')};var _0x1a4e1a=function(_0x5defd9){return!_[_0xb7db('0x61')]([_0xb7db('0x62'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xb7db('0x63')],_0x5defd9);};var _0x256557=function(_0xddfd5e){if(!_0xddfd5e||!_0xddfd5e['rules'][_0xb7db('0x48')]){return'';}for(var _0x1dcb12='(',_0x29e52f=0x0;_0x29e52f<_0xddfd5e[_0xb7db('0x64')][_0xb7db('0x48')];_0x29e52f+=0x1){_0x29e52f>0x0&&(_0x1dcb12+='\x20'+_0xddfd5e[_0xb7db('0x65')]+'\x20');_0x1dcb12+=_0xddfd5e[_0xb7db('0x64')][_0x29e52f][_0xb7db('0x66')]?_0x256557(_0xddfd5e[_0xb7db('0x64')][_0x29e52f][_0xb7db('0x66')]):_0xddfd5e[_0xb7db('0x64')][_0x29e52f][_0xb7db('0x67')]+'\x20'+_0xddfd5e[_0xb7db('0x64')][_0x29e52f][_0xb7db('0x68')]+(_0x1a4e1a(_0xddfd5e[_0xb7db('0x64')][_0x29e52f][_0xb7db('0x68')])?'\x20'+_0xddfd5e['rules'][_0x29e52f]['value']:'');}return _0x1dcb12+')';};var _0x22c998={'where':{'id':_0x2c6d6e[_0xb7db('0x47')]['id']}},_0x22ab0b,_0x26e97b,_0x4742a0,_0x3b09bd,_0x2fe519;_0x22c998=_[_0xb7db('0x3e')]({},_0x22c998,_0x2c6d6e[_0xb7db('0x40')]);return db[_0xb7db('0x2e')][_0xb7db('0x49')](_0x22c998)[_0xb7db('0x28')](function(_0x2738ac){if(_0x2738ac){_0x22ab0b=_0x2738ac;return _0x2738ac[_0xb7db('0x69')]();}return null;})['then'](function(_0x586416){if(_0x586416){if(!_0x586416[_0xb7db('0x48')]){throw new db[(_0xb7db('0x6a'))][(_0xb7db('0x6b'))](_0xb7db('0x6c'),0x193);}_0x26e97b=_0x586416;return db[_0xb7db('0x6d')][_0xb7db('0x43')]({'raw':!![]});}return null;})[_0xb7db('0x28')](function(_0xf98bfb){if(_0xf98bfb){_0x4742a0=_[_0xb7db('0x6e')](_0xf98bfb,'id');var _0x1a202e;var _0x1aed69=squel[_0xb7db('0x6f')]();_0x1aed69[_0xb7db('0x70')](_0x22ab0b[_0xb7db('0x71')]);for(var _0xb09e1a=0x0;_0xb09e1a<_0x26e97b[_0xb7db('0x48')];_0xb09e1a+=0x1){_0x1a202e=_0x26e97b[_0xb09e1a]['MetricId']?_0x4742a0[_0x26e97b[_0xb09e1a][_0xb7db('0x72')]][_0xb7db('0x73')]:_0x26e97b[_0xb09e1a][_0xb7db('0x67')];_0x1a202e=_0x26e97b[_0xb09e1a][_0xb7db('0x74')]?_[_0xb7db('0x75')](_0x11fe23[_0x26e97b[_0xb09e1a][_0xb7db('0x74')]],'%s',_0x1a202e):_0x1a202e;_0x1a202e=_0x26e97b[_0xb09e1a][_0xb7db('0x76')]?_[_0xb7db('0x75')](_0x4b2cde[_0x26e97b[_0xb09e1a][_0xb7db('0x76')]],'%s',_0x1a202e):_0x1a202e;if(_0x26e97b[_0xb09e1a][_0xb7db('0x77')]){_0x1aed69[_0xb7db('0x66')](_0x1a202e);}_0x26e97b[_0xb09e1a][_0xb7db('0x78')]&&_0x1aed69['order'](_0x1a202e,_0x26e97b[_0xb09e1a][_0xb7db('0x78')]===_0xb7db('0x79')?![]:!![]);_0x1aed69[_0xb7db('0x67')](_0x1a202e,_0x26e97b[_0xb09e1a]['alias']||_0x1a202e);}if(_0x22ab0b['joins']){_0x22ab0b[_0xb7db('0x7a')]=JSON[_0xb7db('0x7b')](_0x22ab0b[_0xb7db('0x7a')]);for(var _0x84bfc7=0x0;_0x84bfc7<_0x22ab0b[_0xb7db('0x7a')][_0xb7db('0x48')];_0x84bfc7+=0x1){if(_0x22ab0b['joins'][_0x84bfc7][_0xb7db('0x30')]&&_[_0xb7db('0x61')](_0x56aa41,_0x22ab0b[_0xb7db('0x7a')][_0x84bfc7][_0xb7db('0x30')])&&_0x22ab0b[_0xb7db('0x7a')][_0x84bfc7][_0xb7db('0x7c')]&&_0x22ab0b['joins'][_0x84bfc7][_0xb7db('0x7d')]&&_0x22ab0b[_0xb7db('0x7a')][_0x84bfc7][_0xb7db('0x7e')]){_0x1aed69[_0x22ab0b['joins'][_0x84bfc7]['type']](_0x22ab0b['joins'][_0x84bfc7][_0xb7db('0x7d')],null,util[_0xb7db('0x76')](_0xb7db('0x7f'),_0x22ab0b[_0xb7db('0x71')],_0x22ab0b['joins'][_0x84bfc7][_0xb7db('0x7c')],_0x22ab0b[_0xb7db('0x7a')][_0x84bfc7][_0xb7db('0x7d')],_0x22ab0b['joins'][_0x84bfc7]['foreignKey']));}}}if(_0x22ab0b['conditions']){_0x22ab0b[_0xb7db('0x80')]=JSON[_0xb7db('0x7b')](_0x22ab0b[_0xb7db('0x80')]);_0x1aed69[_0xb7db('0x3b')](_0x256557(_0x22ab0b[_0xb7db('0x80')][_0xb7db('0x66')]));}_0x2fe519=_0x1aed69[_0xb7db('0x81')]();_0x1aed69[_0xb7db('0x1e')](_0x74e133);_0x1aed69[_0xb7db('0x1c')](0x0);logger[_0xb7db('0x82')](_0xb7db('0x83'),_0x1aed69[_0xb7db('0x84')]());return dbH['sequelize'][_0xb7db('0x32')](_0x1aed69[_0xb7db('0x84')](),{'type':dbH[_0xb7db('0x85')][_0xb7db('0x86')]['SELECT']});}})[_0xb7db('0x28')](respondWithResult(_0x15baf4,null))[_0xb7db('0x45')](handleError(_0x15baf4,null));};function runReport(_0x328b54,_0x20e038,_0xe7828d){var _0x1b8cb3=_0x20e038[_0xb7db('0x2b')];var _0x419e7d=0xa;var _0x5ca584=[_0xb7db('0x54'),_0xb7db('0x55'),_0xb7db('0x56'),_0xb7db('0x57')];var _0x19dcc3={'SUM':_0xb7db('0x87'),'COUNT':_0xb7db('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb7db('0x59'),'MIN':_0xb7db('0x88'),'AVG':_0xb7db('0x5a'),'GROUP_CONCAT':_0xb7db('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb7db('0x5d')};var _0x5138b4={'SEC_TO_TIME':_0xb7db('0x5e'),'DATE':'DATE(%s)','HOUR':_0xb7db('0x89'),'ROUND':_0xb7db('0x8a'),'UNIX_TIMESTAMP':_0xb7db('0x60')};var _0x56ad55=function(_0x140bfb){return!_['includes']([_0xb7db('0x62'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xb7db('0x63')],_0x140bfb);};var _0x198de9=function(_0x33178c){if(!_0x33178c||!_0x33178c[_0xb7db('0x64')]['length']){return'';}for(var _0xaa19e4='(',_0x4d3786=0x0;_0x4d3786<_0x33178c[_0xb7db('0x64')][_0xb7db('0x48')];_0x4d3786+=0x1){_0x4d3786>0x0&&(_0xaa19e4+='\x20'+_0x33178c[_0xb7db('0x65')]+'\x20');_0xaa19e4+=_0x33178c[_0xb7db('0x64')][_0x4d3786][_0xb7db('0x66')]?_0x198de9(_0x33178c[_0xb7db('0x64')][_0x4d3786][_0xb7db('0x66')]):_0x33178c[_0xb7db('0x64')][_0x4d3786][_0xb7db('0x67')]+'\x20'+_0x33178c['rules'][_0x4d3786][_0xb7db('0x68')]+(_0x56ad55(_0x33178c[_0xb7db('0x64')][_0x4d3786]['condition'])?'\x20'+_0x33178c['rules'][_0x4d3786][_0xb7db('0x8b')]:'');}return _0xaa19e4+')';};var _0x3260f2={'where':{'id':_0x328b54['id']}},_0x143217,_0x26f465,_0xa9b976,_0x50b0ae,_0x4d5138;_0x3260f2=_[_0xb7db('0x3e')]({},_0x3260f2,_0xe7828d);return db[_0xb7db('0x2e')][_0xb7db('0x49')](_0x3260f2)[_0xb7db('0x28')](function(_0x5068e9){if(_0x5068e9){_0x143217=_0x5068e9;return _0x5068e9[_0xb7db('0x69')]();}return null;})['then'](function(_0x21945a){if(_0x21945a){if(!_0x21945a['length']){throw new db[(_0xb7db('0x6a'))]['ValidationErrorItem'](_0xb7db('0x6c'),0x193);}_0x26f465=_0x21945a;return db['AnalyticMetric'][_0xb7db('0x43')]({'raw':!![]});}return null;})[_0xb7db('0x28')](function(_0x37808e){if(_0x37808e){_0xa9b976=_['keyBy'](_0x37808e,'id');var _0x22f27b;var _0x5bf3eb=squel[_0xb7db('0x6f')]();_0x5bf3eb[_0xb7db('0x70')](_0x143217[_0xb7db('0x71')]);for(var _0xc85814=0x0;_0xc85814<_0x26f465[_0xb7db('0x48')];_0xc85814+=0x1){_0x22f27b=_0x26f465[_0xc85814][_0xb7db('0x72')]?_0xa9b976[_0x26f465[_0xc85814][_0xb7db('0x72')]]['metric']:_0x26f465[_0xc85814]['field'];_0x22f27b=_0x26f465[_0xc85814][_0xb7db('0x74')]?_['replace'](_0x19dcc3[_0x26f465[_0xc85814][_0xb7db('0x74')]],'%s',_0x22f27b):_0x22f27b;_0x22f27b=_0x26f465[_0xc85814][_0xb7db('0x76')]?_[_0xb7db('0x75')](_0x5138b4[_0x26f465[_0xc85814][_0xb7db('0x76')]],'%s',_0x22f27b):_0x22f27b;if(_0x26f465[_0xc85814][_0xb7db('0x77')]){_0x5bf3eb[_0xb7db('0x66')](_0x22f27b);}_0x26f465[_0xc85814]['orderBy']&&_0x5bf3eb[_0xb7db('0x8c')](_0x22f27b,_0x26f465[_0xc85814][_0xb7db('0x78')]===_0xb7db('0x79')?![]:!![]);_0x5bf3eb['field'](_0x22f27b,_0x26f465[_0xc85814][_0xb7db('0x8d')]||_0x22f27b);}if(_0x143217[_0xb7db('0x7a')]){_0x143217['joins']=JSON[_0xb7db('0x7b')](_0x143217[_0xb7db('0x7a')]);for(var _0x114bb0=0x0;_0x114bb0<_0x143217['joins'][_0xb7db('0x48')];_0x114bb0+=0x1){if(_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x30')]&&_[_0xb7db('0x61')](_0x5ca584,_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x30')])&&_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x7c')]&&_0x143217['joins'][_0x114bb0][_0xb7db('0x7d')]&&_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x7e')]){_0x5bf3eb[_0x143217[_0xb7db('0x7a')][_0x114bb0]['type']](_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x7d')],null,util[_0xb7db('0x76')](_0xb7db('0x7f'),_0x143217[_0xb7db('0x71')],_0x143217['joins'][_0x114bb0][_0xb7db('0x7c')],_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x7d')],_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x7e')]));}}}if(_0x143217[_0xb7db('0x80')]){_0x143217['conditions']=JSON['parse'](_0x143217[_0xb7db('0x80')]);_0x5bf3eb[_0xb7db('0x3b')](_0x198de9(_0x143217[_0xb7db('0x80')][_0xb7db('0x66')]));}_0x4d5138=_0x5bf3eb[_0xb7db('0x81')]();_0x5bf3eb[_0xb7db('0x1e')](_0x419e7d);_0x5bf3eb[_0xb7db('0x1c')](0x0);return;}})[_0xb7db('0x28')](function(){if(_0x20e038['output']===_0xb7db('0x8e')){return null;}var _0x54ef0e=_['merge'](_0x20e038,{'name':_0x20e038[_0xb7db('0x8f')]||_0x20e038[_0xb7db('0x2b')]||_0x143217[_0xb7db('0x2b')],'basename':_0x1b8cb3,'savename':util[_0xb7db('0x76')](_0xb7db('0x90'),_0x20e038[_0xb7db('0x2b')]||_0x143217[_0xb7db('0x2b')],require('randomstring')[_0xb7db('0x91')](0x4),_0x20e038[_0xb7db('0x92')]||_0xb7db('0x93')),'reportId':_0x143217['id'],'reportType':_0xb7db('0x94')});return db[_0xb7db('0x95')][_0xb7db('0x4a')](_0x54ef0e,{'raw':!![]});})['then'](function(_0x37f369){if(_0x143217['table']===_0xb7db('0x96')){_0x4d5138['where'](_0x143217['table']+_0xb7db('0x97'),_0x20e038[_0xb7db('0x98')],_0x20e038[_0xb7db('0x99')]);}else{_0x4d5138[_0xb7db('0x3b')](_0x143217[_0xb7db('0x71')]+_0xb7db('0x9a'),_0x20e038[_0xb7db('0x98')],_0x20e038[_0xb7db('0x99')]);}if(_0x37f369){logger[_0xb7db('0x9b')]('Run\x20Query:',_0x4d5138['toString']());require(_0xb7db('0x9c'))['fork'](path[_0xb7db('0x54')](__dirname,_0xb7db('0x9d'),_0x37f369[_0xb7db('0x92')]),[_0x37f369['id'],_0x4d5138[_0xb7db('0x84')](),path['join'](__dirname,_0xb7db('0x9e'),_0x37f369['savename']),_0x1b8cb3]);return _0x37f369;}else{var _0x1bf7f0=squel[_0xb7db('0x6f')]();_0x1bf7f0[_0xb7db('0x70')]('('+_0x4d5138[_0xb7db('0x84')]()+')','countTable');_0x1bf7f0[_0xb7db('0x67')]('COUNT(*)',_0xb7db('0x1f'));_0x4d5138[_0xb7db('0x1e')](_0x20e038['limit']||_0x419e7d);_0x4d5138['offset'](_0x20e038[_0xb7db('0x1c')]||0x0);return dbH['sequelize'][_0xb7db('0x32')](_0x1bf7f0[_0xb7db('0x84')](),{'type':dbH[_0xb7db('0x85')][_0xb7db('0x86')][_0xb7db('0x9f')]})[_0xb7db('0x28')](function(_0x8ee0a7){if(!_0x8ee0a7[_0xb7db('0x48')]){_0x50b0ae=0x0;}else{_0x50b0ae=_0x8ee0a7[0x0][_0xb7db('0x1f')]||0x0;}return dbH[_0xb7db('0x85')]['query'](_0x4d5138[_0xb7db('0x84')](),{'type':dbH[_0xb7db('0x85')][_0xb7db('0x86')]['SELECT']});})[_0xb7db('0x28')](function(_0x8526ec){return{'rows':_0x8526ec||[],'count':_0x50b0ae};});}});}exports[_0xb7db('0xa0')]=function(_0x259806,_0x1508d7){return runReport(_0x259806[_0xb7db('0x47')],_0x259806[_0xb7db('0x32')],_0x259806[_0xb7db('0x40')])['then'](respondWithResult(_0x1508d7,null))['catch'](handleError(_0x1508d7,null));};exports[_0xb7db('0xa1')]=runReport;exports[_0xb7db('0x32')]=function(_0x154baa,_0x244c78){var _0x499273=0xa;var _0x3e5ba1=['join',_0xb7db('0x55'),'right_join','cross_join'];var _0x1e3310={'SUM':_0xb7db('0x87'),'COUNT':_0xb7db('0x58'),'COUNT DISTINCT':_0xb7db('0xa2'),'MAX':_0xb7db('0x59'),'MIN':_0xb7db('0x88'),'AVG':_0xb7db('0x5a'),'GROUP_CONCAT':_0xb7db('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb7db('0x5d')};var _0x333c25={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xb7db('0x89'),'ROUND':_0xb7db('0x8a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xf5cae=function(_0x4cd16b){return!_[_0xb7db('0x61')]([_0xb7db('0x62'),_0xb7db('0xa3'),_0xb7db('0xa4'),'IS\x20NOT\x20EMPTY'],_0x4cd16b);};var _0x3b2a82=function(_0x2bb688){if(!_0x2bb688||!_0x2bb688['rules'][_0xb7db('0x48')]){return'';}for(var _0x30ab84='(',_0x25ae74=0x0;_0x25ae74<_0x2bb688[_0xb7db('0x64')][_0xb7db('0x48')];_0x25ae74+=0x1){_0x25ae74>0x0&&(_0x30ab84+='\x20'+_0x2bb688[_0xb7db('0x65')]+'\x20');_0x30ab84+=_0x2bb688[_0xb7db('0x64')][_0x25ae74][_0xb7db('0x66')]?_0x3b2a82(_0x2bb688[_0xb7db('0x64')][_0x25ae74][_0xb7db('0x66')]):_0x2bb688[_0xb7db('0x64')][_0x25ae74]['field']+'\x20'+_0x2bb688[_0xb7db('0x64')][_0x25ae74][_0xb7db('0x68')]+(_0xf5cae(_0x2bb688['rules'][_0x25ae74][_0xb7db('0x68')])?'\x20'+_0x2bb688[_0xb7db('0x64')][_0x25ae74][_0xb7db('0x8b')]:'');}return _0x30ab84+')';};var _0x58215d={'where':{'id':_0x154baa[_0xb7db('0x47')]['id']}},_0x54f775,_0x157f80,_0x296e4b,_0x140491,_0x4608c6;_0x58215d=_['merge']({},_0x58215d,_0x154baa['options']);return db[_0xb7db('0x2e')]['find'](_0x58215d)['then'](function(_0x32aa7c){if(_0x32aa7c){_0x54f775=_0x32aa7c;return _0x32aa7c[_0xb7db('0x69')]();}return null;})[_0xb7db('0x28')](function(_0x52278a){if(_0x52278a){if(!_0x52278a['length']){throw new db[(_0xb7db('0x6a'))][(_0xb7db('0x6b'))](_0xb7db('0x6c'),0x193);}_0x157f80=_0x52278a;return db[_0xb7db('0x6d')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x4260fa){if(_0x4260fa){_0x296e4b=_['keyBy'](_0x4260fa,'id');var _0x199424;var _0x937325=squel[_0xb7db('0x6f')]();_0x937325[_0xb7db('0x70')](_0x54f775[_0xb7db('0x71')]);for(var _0xc18a1c=0x0;_0xc18a1c<_0x157f80['length'];_0xc18a1c+=0x1){_0x199424=_0x157f80[_0xc18a1c]['MetricId']?_0x296e4b[_0x157f80[_0xc18a1c][_0xb7db('0x72')]][_0xb7db('0x73')]:_0x157f80[_0xc18a1c][_0xb7db('0x67')];_0x199424=_0x157f80[_0xc18a1c][_0xb7db('0x74')]?_[_0xb7db('0x75')](_0x1e3310[_0x157f80[_0xc18a1c]['function']],'%s',_0x199424):_0x199424;_0x199424=_0x157f80[_0xc18a1c][_0xb7db('0x76')]?_['replace'](_0x333c25[_0x157f80[_0xc18a1c]['format']],'%s',_0x199424):_0x199424;if(_0x157f80[_0xc18a1c]['groupBy']){_0x937325[_0xb7db('0x66')](_0x199424);}_0x157f80[_0xc18a1c][_0xb7db('0x78')]&&_0x937325[_0xb7db('0x8c')](_0x199424,_0x157f80[_0xc18a1c][_0xb7db('0x78')]===_0xb7db('0x79')?![]:!![]);_0x937325[_0xb7db('0x67')](_0x199424,_0x157f80[_0xc18a1c][_0xb7db('0x8d')]||_0x199424);}if(_0x54f775[_0xb7db('0x7a')]){_0x54f775['joins']=JSON[_0xb7db('0x7b')](_0x54f775[_0xb7db('0x7a')]);for(var _0x55d56=0x0;_0x55d56<_0x54f775['joins'][_0xb7db('0x48')];_0x55d56+=0x1){if(_0x54f775[_0xb7db('0x7a')][_0x55d56][_0xb7db('0x30')]&&_['includes'](_0x3e5ba1,_0x54f775[_0xb7db('0x7a')][_0x55d56][_0xb7db('0x30')])&&_0x54f775['joins'][_0x55d56][_0xb7db('0x7c')]&&_0x54f775[_0xb7db('0x7a')][_0x55d56][_0xb7db('0x7d')]&&_0x54f775[_0xb7db('0x7a')][_0x55d56][_0xb7db('0x7e')]){_0x937325[_0x54f775['joins'][_0x55d56]['type']](_0x54f775[_0xb7db('0x7a')][_0x55d56][_0xb7db('0x7d')],null,util[_0xb7db('0x76')](_0xb7db('0x7f'),_0x54f775[_0xb7db('0x71')],_0x54f775[_0xb7db('0x7a')][_0x55d56][_0xb7db('0x7c')],_0x54f775['joins'][_0x55d56][_0xb7db('0x7d')],_0x54f775[_0xb7db('0x7a')][_0x55d56]['foreignKey']));}}}if(_0x54f775[_0xb7db('0x80')]){_0x54f775[_0xb7db('0x80')]=JSON[_0xb7db('0x7b')](_0x54f775[_0xb7db('0x80')]);_0x937325[_0xb7db('0x3b')](_0x3b2a82(_0x54f775[_0xb7db('0x80')][_0xb7db('0x66')]));}_0x4608c6=_0x937325['clone']();_0x937325['limit'](_0x499273);_0x937325[_0xb7db('0x1c')](0x0);logger['debug'](_0xb7db('0x83'),_0x937325['toString']());return dbH[_0xb7db('0x85')][_0xb7db('0x32')](_0x937325[_0xb7db('0x84')](),{'type':dbH[_0xb7db('0x85')][_0xb7db('0x86')][_0xb7db('0x9f')]});}})[_0xb7db('0x28')](function(){return{'sql':_0x4608c6[_0xb7db('0x84')]()};})['then'](respondWithResult(_0x244c78,null))[_0xb7db('0x45')](handleError(_0x244c78,null));};
\ No newline at end of file
+var _0xc422=['sequelize','QueryTypes','SELECT','cross_join','AVG(%s)','ROUND(%s)','Sequelize','metric','DESC','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','fork','savename','countTable','run','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','UserProfileSection','userProfileId','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','replace','function','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString'];(function(_0x3d8502,_0x5b23b4){var _0x2e8073=function(_0x57820e){while(--_0x57820e){_0x3d8502['push'](_0x3d8502['shift']());}};_0x2e8073(++_0x5b23b4);}(_0xc422,0x157));var _0x2c42=function(_0x3f6d90,_0x1cf673){_0x3f6d90=_0x3f6d90-0x0;var _0x4981ea=_0xc422[_0x3f6d90];return _0x4981ea;};'use strict';var emlformat=require(_0x2c42('0x0'));var rimraf=require(_0x2c42('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c42('0x2'));var rp=require(_0x2c42('0x3'));var moment=require(_0x2c42('0x4'));var BPromise=require(_0x2c42('0x5'));var Mustache=require('mustache');var util=require(_0x2c42('0x6'));var path=require(_0x2c42('0x7'));var sox=require('sox');var csv=require(_0x2c42('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c42('0x9'));var _=require(_0x2c42('0xa'));var squel=require(_0x2c42('0xb'));var crypto=require('crypto');var jsforce=require(_0x2c42('0xc'));var deskjs=require(_0x2c42('0xd'));var toCsv=require(_0x2c42('0x8'));var querystring=require(_0x2c42('0xe'));var Papa=require(_0x2c42('0xf'));var Redis=require('ioredis');var authService=require(_0x2c42('0x10'));var qs=require(_0x2c42('0x11'));var as=require(_0x2c42('0x12'));var hardwareService=require(_0x2c42('0x13'));var logger=require('../../config/logger')(_0x2c42('0x14'));var utils=require(_0x2c42('0x15'));var config=require(_0x2c42('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c42('0x17'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x5611b3,_0x3a31f5){_0x3a31f5=_0x3a31f5||0xcc;return function(_0x5005d3){if(_0x5005d3){return _0x5611b3[_0x2c42('0x18')](_0x3a31f5);}return _0x5611b3['status'](_0x3a31f5)['end']();};}function respondWithResult(_0x4acbc2,_0x3f8271){_0x3f8271=_0x3f8271||0xc8;return function(_0x38c0a6){if(_0x38c0a6){return _0x4acbc2[_0x2c42('0x19')](_0x3f8271)[_0x2c42('0x1a')](_0x38c0a6);}};}function respondWithFilteredResult(_0x412c35,_0x37a854){return function(_0x113af5){if(_0x113af5){var _0x895138=typeof _0x37a854[_0x2c42('0x1b')]==='undefined'&&typeof _0x37a854['limit']===_0x2c42('0x1c');var _0x3383f9=_0x113af5[_0x2c42('0x1d')];var _0x5583ec=_0x895138?0x0:_0x37a854[_0x2c42('0x1b')];var _0x5f1cea=_0x895138?_0x113af5[_0x2c42('0x1d')]:_0x37a854[_0x2c42('0x1b')]+_0x37a854[_0x2c42('0x1e')];var _0x12f1e4;if(_0x5f1cea>=_0x3383f9){_0x5f1cea=_0x3383f9;_0x12f1e4=0xc8;}else{_0x12f1e4=0xce;}_0x412c35[_0x2c42('0x19')](_0x12f1e4);return _0x412c35[_0x2c42('0x1f')]('Content-Range',_0x5583ec+'-'+_0x5f1cea+'/'+_0x3383f9)['json'](_0x113af5);}return null;};}function patchUpdates(_0x446be){return function(_0x2c43ba){try{jsonpatch[_0x2c42('0x20')](_0x2c43ba,_0x446be,!![]);}catch(_0x5d9b19){return BPromise['reject'](_0x5d9b19);}return _0x2c43ba[_0x2c42('0x21')]();};}function saveUpdates(_0x16a64f,_0x138e6b){return function(_0xa3ce8b){if(_0xa3ce8b){return _0xa3ce8b[_0x2c42('0x22')](_0x16a64f)[_0x2c42('0x23')](function(_0x2c9d36){return _0x2c9d36;});}return null;};}function removeEntity(_0x5bb0b9,_0x141be8){return function(_0x280b3c){if(_0x280b3c){return _0x280b3c[_0x2c42('0x24')]()[_0x2c42('0x23')](function(){var _0x361c48=_0x280b3c[_0x2c42('0x25')]({'plain':!![]});var _0x6b041d=_0x2c42('0x26');return db[_0x2c42('0x27')][_0x2c42('0x24')]({'where':{'type':_0x6b041d,'resourceId':_0x361c48['id']}})[_0x2c42('0x23')](function(){return _0x280b3c;});})[_0x2c42('0x23')](function(){_0x5bb0b9[_0x2c42('0x19')](0xcc)[_0x2c42('0x28')]();});}};}function handleEntityNotFound(_0x29129a,_0x189993){return function(_0x138652){if(!_0x138652){_0x29129a['sendStatus'](0x194);}return _0x138652;};}function handleError(_0x47d1e1,_0x3666e1){_0x3666e1=_0x3666e1||0x1f4;return function(_0x1bee66){logger[_0x2c42('0x29')](_0x1bee66[_0x2c42('0x2a')]);if(_0x1bee66[_0x2c42('0x2b')]){delete _0x1bee66[_0x2c42('0x2b')];}_0x47d1e1[_0x2c42('0x19')](_0x3666e1)[_0x2c42('0x2c')](_0x1bee66);};}exports[_0x2c42('0x2d')]=function(_0x3f65a7,_0x38e966){var _0x59c1b5={},_0x2d047c={},_0x510edf={'count':0x0,'rows':[]};var _0x462d19=_[_0x2c42('0x2e')](db[_0x2c42('0x2f')][_0x2c42('0x30')],function(_0x3d572d){return{'name':_0x3d572d[_0x2c42('0x31')],'type':_0x3d572d[_0x2c42('0x32')][_0x2c42('0x33')]};});_0x2d047c[_0x2c42('0x34')]=_[_0x2c42('0x2e')](_0x462d19,_0x2c42('0x2b'));_0x2d047c[_0x2c42('0x35')]=_[_0x2c42('0x36')](_0x3f65a7['query']);_0x2d047c[_0x2c42('0x37')]=_[_0x2c42('0x38')](_0x2d047c[_0x2c42('0x34')],_0x2d047c[_0x2c42('0x35')]);_0x59c1b5['attributes']=_[_0x2c42('0x38')](_0x2d047c[_0x2c42('0x34')],qs['fields'](_0x3f65a7['query'][_0x2c42('0x39')]));_0x59c1b5['attributes']=_0x59c1b5[_0x2c42('0x3a')][_0x2c42('0x3b')]?_0x59c1b5[_0x2c42('0x3a')]:_0x2d047c[_0x2c42('0x34')];if(!_0x3f65a7[_0x2c42('0x35')]['hasOwnProperty'](_0x2c42('0x3c'))){_0x59c1b5[_0x2c42('0x1e')]=qs[_0x2c42('0x1e')](_0x3f65a7[_0x2c42('0x35')][_0x2c42('0x1e')]);_0x59c1b5['offset']=qs[_0x2c42('0x1b')](_0x3f65a7[_0x2c42('0x35')]['offset']);}_0x59c1b5[_0x2c42('0x3d')]=qs[_0x2c42('0x3e')](_0x3f65a7[_0x2c42('0x35')][_0x2c42('0x3e')]);_0x59c1b5[_0x2c42('0x3f')]=qs[_0x2c42('0x37')](_[_0x2c42('0x40')](_0x3f65a7[_0x2c42('0x35')],_0x2d047c[_0x2c42('0x37')]),_0x462d19);if(_0x3f65a7[_0x2c42('0x35')][_0x2c42('0x41')]){_0x59c1b5[_0x2c42('0x3f')]=_[_0x2c42('0x42')](_0x59c1b5[_0x2c42('0x3f')],{'$or':_[_0x2c42('0x2e')](_0x462d19,function(_0x5891d5){if(_0x5891d5[_0x2c42('0x32')]!=='VIRTUAL'){var _0x3726df={};_0x3726df[_0x5891d5['name']]={'$like':'%'+_0x3f65a7[_0x2c42('0x35')][_0x2c42('0x41')]+'%'};return _0x3726df;}})});}_0x59c1b5=_[_0x2c42('0x42')]({},_0x59c1b5,_0x3f65a7[_0x2c42('0x43')]);var _0xd6533a={'where':_0x59c1b5['where']};return db[_0x2c42('0x2f')]['count'](_0xd6533a)[_0x2c42('0x23')](function(_0x2ee8aa){_0x510edf[_0x2c42('0x1d')]=_0x2ee8aa;if(_0x3f65a7[_0x2c42('0x35')][_0x2c42('0x44')]){_0x59c1b5[_0x2c42('0x45')]=[{'all':!![]}];}return db[_0x2c42('0x2f')][_0x2c42('0x46')](_0x59c1b5);})[_0x2c42('0x23')](function(_0x342571){_0x510edf['rows']=_0x342571;return _0x510edf;})[_0x2c42('0x23')](respondWithFilteredResult(_0x38e966,_0x59c1b5))[_0x2c42('0x47')](handleError(_0x38e966,null));};exports['show']=function(_0x54540e,_0x302aa1){var _0x40cf84={'raw':![],'where':{'id':_0x54540e[_0x2c42('0x48')]['id']}},_0x3128e0={};_0x3128e0[_0x2c42('0x34')]=_[_0x2c42('0x36')](db[_0x2c42('0x2f')]['rawAttributes']);_0x3128e0[_0x2c42('0x35')]=_['keys'](_0x54540e[_0x2c42('0x35')]);_0x3128e0[_0x2c42('0x37')]=_[_0x2c42('0x38')](_0x3128e0[_0x2c42('0x34')],_0x3128e0[_0x2c42('0x35')]);_0x40cf84[_0x2c42('0x3a')]=_[_0x2c42('0x38')](_0x3128e0['model'],qs[_0x2c42('0x39')](_0x54540e[_0x2c42('0x35')][_0x2c42('0x39')]));_0x40cf84[_0x2c42('0x3a')]=_0x40cf84[_0x2c42('0x3a')][_0x2c42('0x3b')]?_0x40cf84['attributes']:_0x3128e0[_0x2c42('0x34')];if(_0x54540e['query'][_0x2c42('0x44')]){_0x40cf84[_0x2c42('0x45')]=[{'all':!![]}];}_0x40cf84=_[_0x2c42('0x42')]({},_0x40cf84,_0x54540e[_0x2c42('0x43')]);return db[_0x2c42('0x2f')][_0x2c42('0x49')](_0x40cf84)[_0x2c42('0x23')](handleEntityNotFound(_0x302aa1,null))[_0x2c42('0x23')](respondWithResult(_0x302aa1,null))['catch'](handleError(_0x302aa1,null));};exports[_0x2c42('0x4a')]=function(_0x473abd,_0x38e5a7){return db[_0x2c42('0x2f')][_0x2c42('0x4a')](_0x473abd[_0x2c42('0x4b')],{})[_0x2c42('0x23')](function(_0x1d09a5){var _0x1e25f6=_0x473abd[_0x2c42('0x4c')]['get']({'plain':!![]});if(!_0x1e25f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e25f6['role']===_0x2c42('0x4c')){var _0x338182=_0x1d09a5[_0x2c42('0x25')]({'plain':!![]});var _0x53c12e='Reports';return db[_0x2c42('0x4d')][_0x2c42('0x49')]({'where':{'name':_0x53c12e,'userProfileId':_0x1e25f6[_0x2c42('0x4e')]},'raw':!![]})[_0x2c42('0x23')](function(_0x2b4f3a){if(_0x2b4f3a&&_0x2b4f3a['autoAssociation']===0x0){return db[_0x2c42('0x27')][_0x2c42('0x4a')]({'name':_0x338182['name'],'resourceId':_0x338182['id'],'type':_0x2c42('0x26'),'sectionId':_0x2b4f3a['id']},{})['then'](function(){return _0x1d09a5;});}else{return _0x1d09a5;}})[_0x2c42('0x47')](function(_0x5186e8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5186e8);throw _0x5186e8;});}return _0x1d09a5;})[_0x2c42('0x23')](respondWithResult(_0x38e5a7,0xc9))[_0x2c42('0x47')](handleError(_0x38e5a7,null));};exports['update']=function(_0x1b5137,_0x14d31c){if(_0x1b5137[_0x2c42('0x4b')]['id']){delete _0x1b5137['body']['id'];}return db[_0x2c42('0x2f')][_0x2c42('0x49')]({'where':{'id':_0x1b5137[_0x2c42('0x48')]['id']}})[_0x2c42('0x23')](handleEntityNotFound(_0x14d31c,null))[_0x2c42('0x23')](saveUpdates(_0x1b5137[_0x2c42('0x4b')],null))[_0x2c42('0x23')](respondWithResult(_0x14d31c,null))['catch'](handleError(_0x14d31c,null));};exports[_0x2c42('0x24')]=function(_0x15574f,_0x25a5b4){return db['AnalyticCustomReport'][_0x2c42('0x49')]({'where':{'id':_0x15574f['params']['id']}})['then'](handleEntityNotFound(_0x25a5b4,null))[_0x2c42('0x23')](removeEntity(_0x25a5b4,null))[_0x2c42('0x47')](handleError(_0x25a5b4,null));};exports['preview']=function(_0x47b6ef,_0x4564f0){var _0xd7a844=0xa;var _0x256753=[_0x2c42('0x4f'),_0x2c42('0x50'),_0x2c42('0x51'),'cross_join'];var _0x525275={'SUM':_0x2c42('0x52'),'COUNT':_0x2c42('0x53'),'COUNT DISTINCT':_0x2c42('0x54'),'MAX':_0x2c42('0x55'),'MIN':_0x2c42('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2c42('0x57'),'GROUP_CONCAT ASC':_0x2c42('0x58'),'GROUP_CONCAT DESC':_0x2c42('0x59')};var _0x1fa40a={'SEC_TO_TIME':_0x2c42('0x5a'),'DATE':_0x2c42('0x5b'),'HOUR':_0x2c42('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x2c42('0x5d')};var _0xde2832=function(_0x1ffc64){return!_[_0x2c42('0x5e')]([_0x2c42('0x5f'),_0x2c42('0x60'),_0x2c42('0x61'),_0x2c42('0x62')],_0x1ffc64);};var _0x23b8b5=function(_0x157e73){if(!_0x157e73||!_0x157e73[_0x2c42('0x63')][_0x2c42('0x3b')]){return'';}for(var _0x5b2d8a='(',_0x26a65f=0x0;_0x26a65f<_0x157e73[_0x2c42('0x63')][_0x2c42('0x3b')];_0x26a65f+=0x1){_0x26a65f>0x0&&(_0x5b2d8a+='\x20'+_0x157e73[_0x2c42('0x64')]+'\x20');_0x5b2d8a+=_0x157e73[_0x2c42('0x63')][_0x26a65f][_0x2c42('0x65')]?_0x23b8b5(_0x157e73[_0x2c42('0x63')][_0x26a65f][_0x2c42('0x65')]):_0x157e73['rules'][_0x26a65f][_0x2c42('0x66')]+'\x20'+_0x157e73[_0x2c42('0x63')][_0x26a65f]['condition']+(_0xde2832(_0x157e73[_0x2c42('0x63')][_0x26a65f][_0x2c42('0x67')])?'\x20'+_0x157e73[_0x2c42('0x63')][_0x26a65f][_0x2c42('0x68')]:'');}return _0x5b2d8a+')';};var _0x606413={'where':{'id':_0x47b6ef[_0x2c42('0x48')]['id']}},_0x508eed,_0x529ffd,_0x1cd4a8,_0x410028,_0x358b4e;_0x606413=_['merge']({},_0x606413,_0x47b6ef[_0x2c42('0x43')]);return db[_0x2c42('0x2f')][_0x2c42('0x49')](_0x606413)['then'](function(_0x2de41c){if(_0x2de41c){_0x508eed=_0x2de41c;return _0x2de41c[_0x2c42('0x69')]();}return null;})['then'](function(_0x1d5a62){if(_0x1d5a62){if(!_0x1d5a62[_0x2c42('0x3b')]){throw new db['Sequelize'][(_0x2c42('0x6a'))](_0x2c42('0x6b'),0x193);}_0x529ffd=_0x1d5a62;return db[_0x2c42('0x6c')][_0x2c42('0x46')]({'raw':!![]});}return null;})[_0x2c42('0x23')](function(_0x3f7409){if(_0x3f7409){_0x1cd4a8=_[_0x2c42('0x6d')](_0x3f7409,'id');var _0xfc73ab;var _0x23af6b=squel[_0x2c42('0x6e')]();_0x23af6b[_0x2c42('0x6f')](_0x508eed[_0x2c42('0x70')]);for(var _0x30a692=0x0;_0x30a692<_0x529ffd[_0x2c42('0x3b')];_0x30a692+=0x1){_0xfc73ab=_0x529ffd[_0x30a692]['MetricId']?_0x1cd4a8[_0x529ffd[_0x30a692][_0x2c42('0x71')]]['metric']:_0x529ffd[_0x30a692][_0x2c42('0x66')];_0xfc73ab=_0x529ffd[_0x30a692]['function']?_[_0x2c42('0x72')](_0x525275[_0x529ffd[_0x30a692][_0x2c42('0x73')]],'%s',_0xfc73ab):_0xfc73ab;_0xfc73ab=_0x529ffd[_0x30a692][_0x2c42('0x74')]?_[_0x2c42('0x72')](_0x1fa40a[_0x529ffd[_0x30a692]['format']],'%s',_0xfc73ab):_0xfc73ab;if(_0x529ffd[_0x30a692][_0x2c42('0x75')]){_0x23af6b[_0x2c42('0x65')](_0xfc73ab);}_0x529ffd[_0x30a692][_0x2c42('0x76')]&&_0x23af6b[_0x2c42('0x3d')](_0xfc73ab,_0x529ffd[_0x30a692]['orderBy']==='DESC'?![]:!![]);_0x23af6b['field'](_0xfc73ab,_0x529ffd[_0x30a692][_0x2c42('0x77')]||_0xfc73ab);}if(_0x508eed['joins']){_0x508eed[_0x2c42('0x78')]=JSON['parse'](_0x508eed[_0x2c42('0x78')]);for(var _0x2229c4=0x0;_0x2229c4<_0x508eed[_0x2c42('0x78')]['length'];_0x2229c4+=0x1){if(_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x32')]&&_['includes'](_0x256753,_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x32')])&&_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x79')]&&_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x7a')]&&_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x7b')]){_0x23af6b[_0x508eed['joins'][_0x2229c4][_0x2c42('0x32')]](_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x7a')],null,util[_0x2c42('0x74')](_0x2c42('0x7c'),_0x508eed[_0x2c42('0x70')],_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x79')],_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x7a')],_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x7b')]));}}}if(_0x508eed[_0x2c42('0x7d')]){_0x508eed[_0x2c42('0x7d')]=JSON[_0x2c42('0x7e')](_0x508eed[_0x2c42('0x7d')]);_0x23af6b['where'](_0x23b8b5(_0x508eed['conditions'][_0x2c42('0x65')]));}_0x358b4e=_0x23af6b[_0x2c42('0x7f')]();_0x23af6b[_0x2c42('0x1e')](_0xd7a844);_0x23af6b[_0x2c42('0x1b')](0x0);logger[_0x2c42('0x80')](_0x2c42('0x81'),_0x23af6b[_0x2c42('0x82')]());return dbH[_0x2c42('0x83')][_0x2c42('0x35')](_0x23af6b[_0x2c42('0x82')](),{'type':dbH[_0x2c42('0x83')][_0x2c42('0x84')][_0x2c42('0x85')]});}})[_0x2c42('0x23')](respondWithResult(_0x4564f0,null))[_0x2c42('0x47')](handleError(_0x4564f0,null));};function runReport(_0x345ebf,_0x1cbf9a,_0x50975e){var _0x114f01=_0x1cbf9a[_0x2c42('0x2b')];var _0x5dcc93=0xa;var _0x46e21c=[_0x2c42('0x4f'),'left_join',_0x2c42('0x51'),_0x2c42('0x86')];var _0x1ac7be={'SUM':_0x2c42('0x52'),'COUNT':_0x2c42('0x53'),'COUNT DISTINCT':_0x2c42('0x54'),'MAX':_0x2c42('0x55'),'MIN':_0x2c42('0x56'),'AVG':_0x2c42('0x87'),'GROUP_CONCAT':_0x2c42('0x57'),'GROUP_CONCAT ASC':_0x2c42('0x58'),'GROUP_CONCAT DESC':_0x2c42('0x59')};var _0x3663c5={'SEC_TO_TIME':_0x2c42('0x5a'),'DATE':'DATE(%s)','HOUR':_0x2c42('0x5c'),'ROUND':_0x2c42('0x88'),'UNIX_TIMESTAMP':_0x2c42('0x5d')};var _0x55c9ef=function(_0x4bbf51){return!_['includes']([_0x2c42('0x5f'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2c42('0x62')],_0x4bbf51);};var _0x5028f0=function(_0x19254d){if(!_0x19254d||!_0x19254d[_0x2c42('0x63')][_0x2c42('0x3b')]){return'';}for(var _0x4ae6c1='(',_0x543179=0x0;_0x543179<_0x19254d[_0x2c42('0x63')][_0x2c42('0x3b')];_0x543179+=0x1){_0x543179>0x0&&(_0x4ae6c1+='\x20'+_0x19254d[_0x2c42('0x64')]+'\x20');_0x4ae6c1+=_0x19254d['rules'][_0x543179]['group']?_0x5028f0(_0x19254d[_0x2c42('0x63')][_0x543179][_0x2c42('0x65')]):_0x19254d[_0x2c42('0x63')][_0x543179][_0x2c42('0x66')]+'\x20'+_0x19254d['rules'][_0x543179]['condition']+(_0x55c9ef(_0x19254d[_0x2c42('0x63')][_0x543179][_0x2c42('0x67')])?'\x20'+_0x19254d[_0x2c42('0x63')][_0x543179]['value']:'');}return _0x4ae6c1+')';};var _0x38d1ca={'where':{'id':_0x345ebf['id']}},_0x33e96e,_0x47085f,_0x1816df,_0x459d6d,_0xbf72b5;_0x38d1ca=_[_0x2c42('0x42')]({},_0x38d1ca,_0x50975e);return db[_0x2c42('0x2f')][_0x2c42('0x49')](_0x38d1ca)[_0x2c42('0x23')](function(_0x452808){if(_0x452808){_0x33e96e=_0x452808;return _0x452808['getFields']();}return null;})[_0x2c42('0x23')](function(_0x5b45e9){if(_0x5b45e9){if(!_0x5b45e9[_0x2c42('0x3b')]){throw new db[(_0x2c42('0x89'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x47085f=_0x5b45e9;return db[_0x2c42('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x2c42('0x23')](function(_0x4e1644){if(_0x4e1644){_0x1816df=_[_0x2c42('0x6d')](_0x4e1644,'id');var _0x259738;var _0x313297=squel[_0x2c42('0x6e')]();_0x313297[_0x2c42('0x6f')](_0x33e96e[_0x2c42('0x70')]);for(var _0x40d997=0x0;_0x40d997<_0x47085f['length'];_0x40d997+=0x1){_0x259738=_0x47085f[_0x40d997]['MetricId']?_0x1816df[_0x47085f[_0x40d997][_0x2c42('0x71')]][_0x2c42('0x8a')]:_0x47085f[_0x40d997]['field'];_0x259738=_0x47085f[_0x40d997][_0x2c42('0x73')]?_['replace'](_0x1ac7be[_0x47085f[_0x40d997]['function']],'%s',_0x259738):_0x259738;_0x259738=_0x47085f[_0x40d997][_0x2c42('0x74')]?_[_0x2c42('0x72')](_0x3663c5[_0x47085f[_0x40d997][_0x2c42('0x74')]],'%s',_0x259738):_0x259738;if(_0x47085f[_0x40d997][_0x2c42('0x75')]){_0x313297[_0x2c42('0x65')](_0x259738);}_0x47085f[_0x40d997]['orderBy']&&_0x313297['order'](_0x259738,_0x47085f[_0x40d997][_0x2c42('0x76')]===_0x2c42('0x8b')?![]:!![]);_0x313297['field'](_0x259738,_0x47085f[_0x40d997]['alias']||_0x259738);}if(_0x33e96e[_0x2c42('0x78')]){_0x33e96e[_0x2c42('0x78')]=JSON[_0x2c42('0x7e')](_0x33e96e[_0x2c42('0x78')]);for(var _0x29991c=0x0;_0x29991c<_0x33e96e['joins'][_0x2c42('0x3b')];_0x29991c+=0x1){if(_0x33e96e['joins'][_0x29991c][_0x2c42('0x32')]&&_[_0x2c42('0x5e')](_0x46e21c,_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x32')])&&_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x79')]&&_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x7a')]&&_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x7b')]){_0x313297[_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x32')]](_0x33e96e[_0x2c42('0x78')][_0x29991c]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x33e96e['table'],_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x79')],_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x7a')],_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x7b')]));}}}if(_0x33e96e[_0x2c42('0x7d')]){_0x33e96e[_0x2c42('0x7d')]=JSON['parse'](_0x33e96e[_0x2c42('0x7d')]);_0x313297[_0x2c42('0x3f')](_0x5028f0(_0x33e96e['conditions'][_0x2c42('0x65')]));}_0xbf72b5=_0x313297['clone']();_0x313297[_0x2c42('0x1e')](_0x5dcc93);_0x313297[_0x2c42('0x1b')](0x0);return;}})[_0x2c42('0x23')](function(){if(_0x1cbf9a[_0x2c42('0x8c')]==='web'){return null;}var _0x3ade95=_['merge'](_0x1cbf9a,{'name':_0x1cbf9a[_0x2c42('0x8d')]||_0x1cbf9a[_0x2c42('0x2b')]||_0x33e96e[_0x2c42('0x2b')],'basename':_0x114f01,'savename':util[_0x2c42('0x74')](_0x2c42('0x8e'),_0x1cbf9a['name']||_0x33e96e[_0x2c42('0x2b')],require(_0x2c42('0x8f'))[_0x2c42('0x90')](0x4),_0x1cbf9a[_0x2c42('0x8c')]||_0x2c42('0x91')),'reportId':_0x33e96e['id'],'reportType':_0x2c42('0x92')});return db[_0x2c42('0x93')][_0x2c42('0x4a')](_0x3ade95,{'raw':!![]});})['then'](function(_0x2268a2){if(_0x33e96e[_0x2c42('0x70')]===_0x2c42('0x94')){_0xbf72b5[_0x2c42('0x3f')](_0x33e96e[_0x2c42('0x70')]+_0x2c42('0x95'),_0x1cbf9a[_0x2c42('0x96')],_0x1cbf9a[_0x2c42('0x97')]);}else{_0xbf72b5[_0x2c42('0x3f')](_0x33e96e[_0x2c42('0x70')]+_0x2c42('0x98'),_0x1cbf9a[_0x2c42('0x96')],_0x1cbf9a[_0x2c42('0x97')]);}if(_0x2268a2){logger['info']('Run\x20Query:',_0xbf72b5[_0x2c42('0x82')]());require(_0x2c42('0x99'))[_0x2c42('0x9a')](path[_0x2c42('0x4f')](__dirname,'../../components/export/',_0x2268a2[_0x2c42('0x8c')]),[_0x2268a2['id'],_0xbf72b5[_0x2c42('0x82')](),path[_0x2c42('0x4f')](__dirname,'../../files/reports',_0x2268a2[_0x2c42('0x9b')]),_0x114f01]);return _0x2268a2;}else{var _0x34801c=squel['select']();_0x34801c[_0x2c42('0x6f')]('('+_0xbf72b5[_0x2c42('0x82')]()+')',_0x2c42('0x9c'));_0x34801c['field']('COUNT(*)',_0x2c42('0x1d'));_0xbf72b5[_0x2c42('0x1e')](_0x1cbf9a[_0x2c42('0x1e')]||_0x5dcc93);_0xbf72b5[_0x2c42('0x1b')](_0x1cbf9a[_0x2c42('0x1b')]||0x0);return dbH[_0x2c42('0x83')][_0x2c42('0x35')](_0x34801c[_0x2c42('0x82')](),{'type':dbH[_0x2c42('0x83')][_0x2c42('0x84')][_0x2c42('0x85')]})['then'](function(_0x2d6b54){if(!_0x2d6b54[_0x2c42('0x3b')]){_0x459d6d=0x0;}else{_0x459d6d=_0x2d6b54[0x0][_0x2c42('0x1d')]||0x0;}return dbH[_0x2c42('0x83')][_0x2c42('0x35')](_0xbf72b5[_0x2c42('0x82')](),{'type':dbH[_0x2c42('0x83')][_0x2c42('0x84')][_0x2c42('0x85')]});})[_0x2c42('0x23')](function(_0x3c813e){return{'rows':_0x3c813e||[],'count':_0x459d6d};});}});}exports[_0x2c42('0x9d')]=function(_0x16b503,_0x30f956){return runReport(_0x16b503[_0x2c42('0x48')],_0x16b503[_0x2c42('0x35')],_0x16b503[_0x2c42('0x43')])[_0x2c42('0x23')](respondWithResult(_0x30f956,null))[_0x2c42('0x47')](handleError(_0x30f956,null));};exports['runReport']=runReport;exports[_0x2c42('0x35')]=function(_0x37fa48,_0x13434a){var _0x2ea083=0xa;var _0x4776e9=[_0x2c42('0x4f'),'left_join','right_join',_0x2c42('0x86')];var _0x3c52ea={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2c42('0x54'),'MAX':_0x2c42('0x55'),'MIN':_0x2c42('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2c42('0x57'),'GROUP_CONCAT ASC':_0x2c42('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x538ee6={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2c42('0x5b'),'HOUR':_0x2c42('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4b8e07=function(_0x31130a){return!_[_0x2c42('0x5e')]([_0x2c42('0x5f'),_0x2c42('0x60'),_0x2c42('0x61'),'IS\x20NOT\x20EMPTY'],_0x31130a);};var _0x18eb63=function(_0x45aa8d){if(!_0x45aa8d||!_0x45aa8d[_0x2c42('0x63')][_0x2c42('0x3b')]){return'';}for(var _0x4bbe0b='(',_0x299b10=0x0;_0x299b10<_0x45aa8d[_0x2c42('0x63')][_0x2c42('0x3b')];_0x299b10+=0x1){_0x299b10>0x0&&(_0x4bbe0b+='\x20'+_0x45aa8d['operator']+'\x20');_0x4bbe0b+=_0x45aa8d[_0x2c42('0x63')][_0x299b10][_0x2c42('0x65')]?_0x18eb63(_0x45aa8d[_0x2c42('0x63')][_0x299b10][_0x2c42('0x65')]):_0x45aa8d[_0x2c42('0x63')][_0x299b10][_0x2c42('0x66')]+'\x20'+_0x45aa8d['rules'][_0x299b10][_0x2c42('0x67')]+(_0x4b8e07(_0x45aa8d[_0x2c42('0x63')][_0x299b10][_0x2c42('0x67')])?'\x20'+_0x45aa8d[_0x2c42('0x63')][_0x299b10][_0x2c42('0x68')]:'');}return _0x4bbe0b+')';};var _0x58eaa7={'where':{'id':_0x37fa48[_0x2c42('0x48')]['id']}},_0x525b36,_0xcdd411,_0x3112e6,_0x37c7f3,_0x6fe97;_0x58eaa7=_[_0x2c42('0x42')]({},_0x58eaa7,_0x37fa48[_0x2c42('0x43')]);return db[_0x2c42('0x2f')][_0x2c42('0x49')](_0x58eaa7)[_0x2c42('0x23')](function(_0x210486){if(_0x210486){_0x525b36=_0x210486;return _0x210486['getFields']();}return null;})[_0x2c42('0x23')](function(_0x35909f){if(_0x35909f){if(!_0x35909f['length']){throw new db[(_0x2c42('0x89'))][(_0x2c42('0x6a'))](_0x2c42('0x6b'),0x193);}_0xcdd411=_0x35909f;return db[_0x2c42('0x6c')][_0x2c42('0x46')]({'raw':!![]});}return null;})[_0x2c42('0x23')](function(_0x4eeaca){if(_0x4eeaca){_0x3112e6=_['keyBy'](_0x4eeaca,'id');var _0x55a694;var _0x326abe=squel[_0x2c42('0x6e')]();_0x326abe[_0x2c42('0x6f')](_0x525b36['table']);for(var _0x340cb1=0x0;_0x340cb1<_0xcdd411[_0x2c42('0x3b')];_0x340cb1+=0x1){_0x55a694=_0xcdd411[_0x340cb1][_0x2c42('0x71')]?_0x3112e6[_0xcdd411[_0x340cb1]['MetricId']][_0x2c42('0x8a')]:_0xcdd411[_0x340cb1][_0x2c42('0x66')];_0x55a694=_0xcdd411[_0x340cb1][_0x2c42('0x73')]?_[_0x2c42('0x72')](_0x3c52ea[_0xcdd411[_0x340cb1][_0x2c42('0x73')]],'%s',_0x55a694):_0x55a694;_0x55a694=_0xcdd411[_0x340cb1][_0x2c42('0x74')]?_[_0x2c42('0x72')](_0x538ee6[_0xcdd411[_0x340cb1]['format']],'%s',_0x55a694):_0x55a694;if(_0xcdd411[_0x340cb1][_0x2c42('0x75')]){_0x326abe['group'](_0x55a694);}_0xcdd411[_0x340cb1]['orderBy']&&_0x326abe[_0x2c42('0x3d')](_0x55a694,_0xcdd411[_0x340cb1][_0x2c42('0x76')]===_0x2c42('0x8b')?![]:!![]);_0x326abe[_0x2c42('0x66')](_0x55a694,_0xcdd411[_0x340cb1][_0x2c42('0x77')]||_0x55a694);}if(_0x525b36['joins']){_0x525b36['joins']=JSON[_0x2c42('0x7e')](_0x525b36[_0x2c42('0x78')]);for(var _0x6a83b=0x0;_0x6a83b<_0x525b36[_0x2c42('0x78')]['length'];_0x6a83b+=0x1){if(_0x525b36[_0x2c42('0x78')][_0x6a83b]['type']&&_[_0x2c42('0x5e')](_0x4776e9,_0x525b36[_0x2c42('0x78')][_0x6a83b]['type'])&&_0x525b36[_0x2c42('0x78')][_0x6a83b][_0x2c42('0x79')]&&_0x525b36['joins'][_0x6a83b][_0x2c42('0x7a')]&&_0x525b36['joins'][_0x6a83b][_0x2c42('0x7b')]){_0x326abe[_0x525b36['joins'][_0x6a83b][_0x2c42('0x32')]](_0x525b36[_0x2c42('0x78')][_0x6a83b][_0x2c42('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x525b36['table'],_0x525b36[_0x2c42('0x78')][_0x6a83b][_0x2c42('0x79')],_0x525b36[_0x2c42('0x78')][_0x6a83b][_0x2c42('0x7a')],_0x525b36['joins'][_0x6a83b][_0x2c42('0x7b')]));}}}if(_0x525b36[_0x2c42('0x7d')]){_0x525b36[_0x2c42('0x7d')]=JSON[_0x2c42('0x7e')](_0x525b36[_0x2c42('0x7d')]);_0x326abe[_0x2c42('0x3f')](_0x18eb63(_0x525b36[_0x2c42('0x7d')][_0x2c42('0x65')]));}_0x6fe97=_0x326abe[_0x2c42('0x7f')]();_0x326abe[_0x2c42('0x1e')](_0x2ea083);_0x326abe[_0x2c42('0x1b')](0x0);logger['debug'](_0x2c42('0x81'),_0x326abe['toString']());return dbH[_0x2c42('0x83')][_0x2c42('0x35')](_0x326abe[_0x2c42('0x82')](),{'type':dbH[_0x2c42('0x83')][_0x2c42('0x84')]['SELECT']});}})[_0x2c42('0x23')](function(){return{'sql':_0x6fe97[_0x2c42('0x82')]()};})[_0x2c42('0x23')](respondWithResult(_0x13434a,null))[_0x2c42('0x47')](handleError(_0x13434a,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 5de139e..99c2098 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.model.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2710=['api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x2ffa8f,_0x196569){var _0xac60a5=function(_0x53b51b){while(--_0x53b51b){_0x2ffa8f['push'](_0x2ffa8f['shift']());}};_0xac60a5(++_0x196569);}(_0x2710,0x72));var _0x0271=function(_0x333683,_0x2e51dc){_0x333683=_0x333683-0x0;var _0x570c76=_0x2710[_0x333683];return _0x570c76;};'use strict';var _=require(_0x0271('0x0'));var util=require(_0x0271('0x1'));var logger=require(_0x0271('0x2'))(_0x0271('0x3'));var moment=require('moment');var BPromise=require(_0x0271('0x4'));var rp=require(_0x0271('0x5'));var fs=require('fs');var path=require(_0x0271('0x6'));var rimraf=require(_0x0271('0x7'));var config=require(_0x0271('0x8'));var attributes=require(_0x0271('0x9'));module[_0x0271('0xa')]=function(_0x146a13,_0x42dc30){return _0x146a13['define'](_0x0271('0xb'),attributes,{'tableName':_0x0271('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa816=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','define','analytics_custom_reports'];(function(_0x4609b7,_0x4148b3){var _0x4332b6=function(_0x4ef6b5){while(--_0x4ef6b5){_0x4609b7['push'](_0x4609b7['shift']());}};_0x4332b6(++_0x4148b3);}(_0xa816,0x1e4));var _0x6a81=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0xa816[_0xa3463d];return _0x50fd67;};'use strict';var _=require(_0x6a81('0x0'));var util=require('util');var logger=require(_0x6a81('0x1'))(_0x6a81('0x2'));var moment=require(_0x6a81('0x3'));var BPromise=require(_0x6a81('0x4'));var rp=require(_0x6a81('0x5'));var fs=require('fs');var path=require(_0x6a81('0x6'));var rimraf=require(_0x6a81('0x7'));var config=require('../../config/environment');var attributes=require(_0x6a81('0x8'));module['exports']=function(_0x1667b4,_0x54f2f8){return _0x1667b4[_0x6a81('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x6a81('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 7262ca4..886d59a 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd407=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4706a6,_0x5a1c63){var _0x1bb705=function(_0x484ebb){while(--_0x484ebb){_0x4706a6['push'](_0x4706a6['shift']());}};_0x1bb705(++_0x5a1c63);}(_0xd407,0x19c));var _0x7d40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd407[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d40('0x0'));var util=require(_0x7d40('0x1'));var moment=require('moment');var BPromise=require(_0x7d40('0x2'));var rs=require(_0x7d40('0x3'));var fs=require('fs');var Redis=require(_0x7d40('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d40('0x5'));var logger=require(_0x7d40('0x6'))(_0x7d40('0x7'));var config=require(_0x7d40('0x8'));var jayson=require(_0x7d40('0x9'));var client=jayson['client'][_0x7d40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf705e7,_0xef9379,_0x597d51){return new BPromise(function(_0x1c8e44,_0x4db825){return client[_0x7d40('0xb')](_0xf705e7,_0x597d51)[_0x7d40('0xc')](function(_0x438448){logger[_0x7d40('0xd')](_0x7d40('0xe'),_0xef9379,_0x7d40('0xf'));logger[_0x7d40('0x10')](_0x7d40('0x11'),_0xef9379,'request\x20sent',JSON['stringify'](_0x438448));if(_0x438448[_0x7d40('0x12')]){if(_0x438448[_0x7d40('0x12')][_0x7d40('0x13')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xef9379,_0x438448[_0x7d40('0x12')][_0x7d40('0x14')]);return _0x4db825(_0x438448[_0x7d40('0x12')][_0x7d40('0x14')]);}logger['error'](_0x7d40('0xe'),_0xef9379,_0x438448[_0x7d40('0x12')]['message']);return _0x1c8e44(_0x438448['error']['message']);}else{logger[_0x7d40('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0xef9379,_0x7d40('0xf'));_0x1c8e44(_0x438448['result'][_0x7d40('0x14')]);}})[_0x7d40('0x15')](function(_0x2c0dc3){logger[_0x7d40('0x12')](_0x7d40('0xe'),_0xef9379,_0x2c0dc3);_0x4db825(_0x2c0dc3);});});}
\ No newline at end of file
+var _0x08b3=['request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x40642c,_0x3d3961){var _0x68f27a=function(_0xf59c13){while(--_0xf59c13){_0x40642c['push'](_0x40642c['shift']());}};_0x68f27a(++_0x3d3961);}(_0x08b3,0x96));var _0x308b=function(_0x59fce9,_0x8999e6){_0x59fce9=_0x59fce9-0x0;var _0x4e9034=_0x08b3[_0x59fce9];return _0x4e9034;};'use strict';var _=require('lodash');var util=require(_0x308b('0x0'));var moment=require(_0x308b('0x1'));var BPromise=require(_0x308b('0x2'));var rs=require(_0x308b('0x3'));var fs=require('fs');var Redis=require(_0x308b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x308b('0x5'))(_0x308b('0x6'));var config=require(_0x308b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x308b('0x8')][_0x308b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbd6cca,_0x237810,_0x46209d){return new BPromise(function(_0x3ec41f,_0xd2acf2){return client[_0x308b('0xa')](_0xbd6cca,_0x46209d)['then'](function(_0x3b0787){logger[_0x308b('0xb')](_0x308b('0xc'),_0x237810,_0x308b('0xd'));logger['debug'](_0x308b('0xe'),_0x237810,_0x308b('0xd'),JSON[_0x308b('0xf')](_0x3b0787));if(_0x3b0787[_0x308b('0x10')]){if(_0x3b0787['error'][_0x308b('0x11')]===0x1f4){logger['error'](_0x308b('0xc'),_0x237810,_0x3b0787[_0x308b('0x10')]['message']);return _0xd2acf2(_0x3b0787[_0x308b('0x10')]['message']);}logger['error'](_0x308b('0xc'),_0x237810,_0x3b0787[_0x308b('0x10')][_0x308b('0x12')]);return _0x3ec41f(_0x3b0787[_0x308b('0x10')][_0x308b('0x12')]);}else{logger[_0x308b('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x237810,'request\x20sent');_0x3ec41f(_0x3b0787['result'][_0x308b('0x12')]);}})[_0x308b('0x13')](function(_0x5232f7){logger[_0x308b('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x237810,_0x5232f7);_0xd2acf2(_0x5232f7);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 1acfd7a..2270b6e 100644
--- a/server/api/analyticCustomReport/index.js
+++ b/server/api/analyticCustomReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4616=['/:id/run','run','/:id/query','put','delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview'];(function(_0x56efbe,_0x32c151){var _0x1056da=function(_0x1754a9){while(--_0x1754a9){_0x56efbe['push'](_0x56efbe['shift']());}};_0x1056da(++_0x32c151);}(_0x4616,0x8c));var _0x6461=function(_0x2f297d,_0x24d632){_0x2f297d=_0x2f297d-0x0;var _0x372daa=_0x4616[_0x2f297d];return _0x372daa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6461('0x0'));var timeout=require(_0x6461('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6461('0x2'));var auth=require(_0x6461('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6461('0x4'));router[_0x6461('0x5')]('/',auth[_0x6461('0x6')](),controller[_0x6461('0x7')]);router[_0x6461('0x5')](_0x6461('0x8'),auth['isAuthenticated'](),controller[_0x6461('0x9')]);router['get'](_0x6461('0xa'),auth['isAuthenticated'](),controller[_0x6461('0xb')]);router[_0x6461('0x5')](_0x6461('0xc'),auth[_0x6461('0x6')](),controller[_0x6461('0xd')]);router['get'](_0x6461('0xe'),auth[_0x6461('0x6')](),controller['query']);router['post']('/',auth[_0x6461('0x6')](),controller['create']);router[_0x6461('0xf')](_0x6461('0x8'),auth[_0x6461('0x6')](),controller['update']);router[_0x6461('0x10')](_0x6461('0x8'),auth[_0x6461('0x6')](),controller[_0x6461('0x11')]);module[_0x6461('0x12')]=router;
\ No newline at end of file
+var _0x1a3e=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','post','create','put','destroy'];(function(_0x56bc9e,_0x3f8519){var _0x652193=function(_0x24415b){while(--_0x24415b){_0x56bc9e['push'](_0x56bc9e['shift']());}};_0x652193(++_0x3f8519);}(_0x1a3e,0xe7));var _0xe1a3=function(_0x3fe253,_0xcca7e7){_0x3fe253=_0x3fe253-0x0;var _0x1a345e=_0x1a3e[_0x3fe253];return _0x1a345e;};'use strict';var multer=require(_0xe1a3('0x0'));var util=require(_0xe1a3('0x1'));var path=require(_0xe1a3('0x2'));var timeout=require(_0xe1a3('0x3'));var express=require(_0xe1a3('0x4'));var router=express[_0xe1a3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe1a3('0x6'));var interaction=require(_0xe1a3('0x7'));var config=require(_0xe1a3('0x8'));var controller=require('./analyticCustomReport.controller');router[_0xe1a3('0x9')]('/',auth[_0xe1a3('0xa')](),controller[_0xe1a3('0xb')]);router['get'](_0xe1a3('0xc'),auth[_0xe1a3('0xa')](),controller[_0xe1a3('0xd')]);router[_0xe1a3('0x9')](_0xe1a3('0xe'),auth[_0xe1a3('0xa')](),controller[_0xe1a3('0xf')]);router[_0xe1a3('0x9')](_0xe1a3('0x10'),auth[_0xe1a3('0xa')](),controller['run']);router[_0xe1a3('0x9')](_0xe1a3('0x11'),auth[_0xe1a3('0xa')](),controller['query']);router[_0xe1a3('0x12')]('/',auth['isAuthenticated'](),controller[_0xe1a3('0x13')]);router[_0xe1a3('0x14')](_0xe1a3('0xc'),auth[_0xe1a3('0xa')](),controller['update']);router['delete'](_0xe1a3('0xc'),auth[_0xe1a3('0xa')](),controller[_0xe1a3('0x15')]);module[_0xe1a3('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index f732884..62d7965 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x31523e,_0x3ce635){var _0x195270=function(_0x12df4e){while(--_0x12df4e){_0x31523e['push'](_0x31523e['shift']());}};_0x195270(++_0x3ce635);}(_0xac9d,0x14d));var _0xdac9=function(_0x2330cf,_0x5add9f){_0x2330cf=_0x2330cf-0x0;var _0x5e230f=_0xac9d[_0x2330cf];return _0x5e230f;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}};
\ No newline at end of file
+var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x4d6554,_0x24a2bf){var _0xd9f05b=function(_0x679c5e){while(--_0x679c5e){_0x4d6554['push'](_0x4d6554['shift']());}};_0xd9f05b(++_0x24a2bf);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0x24ca[_0x2d994d];return _0xd54be4;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 4fd6f6a..aa9df8c 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x131af9,_0x4c62e1){var _0x211521=function(_0x1e696e){while(--_0x1e696e){_0x131af9['push'](_0x131af9['shift']());}};_0x211521(++_0x4c62e1);}(_0x1cb9,0x14e));var _0x91cb=function(_0x21ab49,_0x207310){_0x21ab49=_0x21ab49-0x0;var _0x486c37=_0x1cb9[_0x21ab49];return _0x486c37;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
+var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x2ef3,0xba));var _0x32ef=function(_0x1b5771,_0x116da0){_0x1b5771=_0x1b5771-0x0;var _0x320539=_0x2ef3[_0x1b5771];return _0x320539;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 307ac67..4cc0dc8 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe561=['define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','bluebird','path','rimraf','./analyticDefaultReport.attributes','exports'];(function(_0xccf869,_0x2556a5){var _0x21a9db=function(_0xcc4835){while(--_0xcc4835){_0xccf869['push'](_0xccf869['shift']());}};_0x21a9db(++_0x2556a5);}(_0xe561,0x179));var _0x1e56=function(_0x34ad09,_0xba8f16){_0x34ad09=_0x34ad09-0x0;var _0x4c8431=_0xe561[_0x34ad09];return _0x4c8431;};'use strict';var _=require('lodash');var util=require(_0x1e56('0x0'));var logger=require(_0x1e56('0x1'))(_0x1e56('0x2'));var moment=require('moment');var BPromise=require(_0x1e56('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e56('0x4'));var rimraf=require(_0x1e56('0x5'));var config=require('../../config/environment');var attributes=require(_0x1e56('0x6'));module[_0x1e56('0x7')]=function(_0x4d61fc,_0xc4dcf7){return _0x4d61fc[_0x1e56('0x8')](_0x1e56('0x9'),attributes,{'tableName':_0x1e56('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeac8=['exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x4bbd93,_0x205605){var _0x669c4=function(_0x12a82f){while(--_0x12a82f){_0x4bbd93['push'](_0x4bbd93['shift']());}};_0x669c4(++_0x205605);}(_0xeac8,0x184));var _0x8eac=function(_0x3a2711,_0x5af498){_0x3a2711=_0x3a2711-0x0;var _0x228c51=_0xeac8[_0x3a2711];return _0x228c51;};'use strict';var _=require('lodash');var util=require(_0x8eac('0x0'));var logger=require(_0x8eac('0x1'))(_0x8eac('0x2'));var moment=require(_0x8eac('0x3'));var BPromise=require(_0x8eac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8eac('0x5'));var config=require(_0x8eac('0x6'));var attributes=require(_0x8eac('0x7'));module[_0x8eac('0x8')]=function(_0x25de97,_0x5ed729){return _0x25de97[_0x8eac('0x9')](_0x8eac('0xa'),attributes,{'tableName':_0x8eac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 1f1f226..091cddd 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x173b=['request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x19307c,_0x4a39e5){var _0x917eaa=function(_0x45f13d){while(--_0x45f13d){_0x19307c['push'](_0x19307c['shift']());}};_0x917eaa(++_0x4a39e5);}(_0x173b,0x183));var _0xb173=function(_0x5dd2ca,_0x224bf6){_0x5dd2ca=_0x5dd2ca-0x0;var _0xdac8d9=_0x173b[_0x5dd2ca];return _0xdac8d9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb173('0x0'));var BPromise=require(_0xb173('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb173('0x2'))['db'];var utils=require(_0xb173('0x3'));var logger=require(_0xb173('0x4'))(_0xb173('0x5'));var config=require('../../config/environment');var jayson=require(_0xb173('0x6'));var client=jayson[_0xb173('0x7')][_0xb173('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d324d,_0x53329b,_0x4af805){return new BPromise(function(_0x15fce1,_0x55999e){return client[_0xb173('0x9')](_0x2d324d,_0x4af805)[_0xb173('0xa')](function(_0x96ed1a){logger[_0xb173('0xb')](_0xb173('0xc'),_0x53329b,_0xb173('0xd'));logger[_0xb173('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x53329b,_0xb173('0xd'),JSON['stringify'](_0x96ed1a));if(_0x96ed1a[_0xb173('0xf')]){if(_0x96ed1a[_0xb173('0xf')]['code']===0x1f4){logger[_0xb173('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x53329b,_0x96ed1a['error'][_0xb173('0x10')]);return _0x55999e(_0x96ed1a[_0xb173('0xf')]['message']);}logger[_0xb173('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x53329b,_0x96ed1a['error'][_0xb173('0x10')]);return _0x15fce1(_0x96ed1a[_0xb173('0xf')][_0xb173('0x10')]);}else{logger[_0xb173('0xb')](_0xb173('0xc'),_0x53329b,_0xb173('0xd'));_0x15fce1(_0x96ed1a['result'][_0xb173('0x10')]);}})[_0xb173('0x11')](function(_0x4380e7){logger[_0xb173('0xf')](_0xb173('0xc'),_0x53329b,_0x4380e7);_0x55999e(_0x4380e7);});});}
\ No newline at end of file
+var _0x06f7=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x275cfd,_0x3183b8){var _0x21e837=function(_0x539df5){while(--_0x539df5){_0x275cfd['push'](_0x275cfd['shift']());}};_0x21e837(++_0x3183b8);}(_0x06f7,0xb3));var _0x706f=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0x06f7[_0x1ee9a1];return _0x21270f;};'use strict';var _=require(_0x706f('0x0'));var util=require(_0x706f('0x1'));var moment=require(_0x706f('0x2'));var BPromise=require(_0x706f('0x3'));var rs=require(_0x706f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x706f('0x5'))['db'];var utils=require(_0x706f('0x6'));var logger=require(_0x706f('0x7'))(_0x706f('0x8'));var config=require(_0x706f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x706f('0xa')][_0x706f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb89b6c,_0x5c818a,_0x3491f9){return new BPromise(function(_0x22e8ef,_0x4d247a){return client[_0x706f('0xc')](_0xb89b6c,_0x3491f9)[_0x706f('0xd')](function(_0x4460f4){logger[_0x706f('0xe')](_0x706f('0xf'),_0x5c818a,'request\x20sent');logger[_0x706f('0x10')](_0x706f('0x11'),_0x5c818a,_0x706f('0x12'),JSON[_0x706f('0x13')](_0x4460f4));if(_0x4460f4[_0x706f('0x14')]){if(_0x4460f4[_0x706f('0x14')][_0x706f('0x15')]===0x1f4){logger[_0x706f('0x14')](_0x706f('0xf'),_0x5c818a,_0x4460f4[_0x706f('0x14')]['message']);return _0x4d247a(_0x4460f4[_0x706f('0x14')]['message']);}logger[_0x706f('0x14')](_0x706f('0xf'),_0x5c818a,_0x4460f4[_0x706f('0x14')][_0x706f('0x16')]);return _0x22e8ef(_0x4460f4[_0x706f('0x14')][_0x706f('0x16')]);}else{logger['info'](_0x706f('0xf'),_0x5c818a,_0x706f('0x12'));_0x22e8ef(_0x4460f4[_0x706f('0x17')]['message']);}})[_0x706f('0x18')](function(_0x1699d1){logger[_0x706f('0x14')](_0x706f('0xf'),_0x5c818a,_0x1699d1);_0x4d247a(_0x1699d1);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 4be67f2..da6b4b5 100644
--- a/server/api/analyticDefaultReport/index.js
+++ b/server/api/analyticDefaultReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa729=['multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','delete','destroy'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xa729,0x160));var _0x9a72=function(_0x294ee4,_0x3773a9){_0x294ee4=_0x294ee4-0x0;var _0x1a3f59=_0xa729[_0x294ee4];return _0x1a3f59;};'use strict';var multer=require(_0x9a72('0x0'));var util=require(_0x9a72('0x1'));var path=require(_0x9a72('0x2'));var timeout=require('connect-timeout');var express=require(_0x9a72('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9a72('0x4'));var interaction=require(_0x9a72('0x5'));var config=require(_0x9a72('0x6'));var controller=require(_0x9a72('0x7'));router[_0x9a72('0x8')]('/',auth[_0x9a72('0x9')](),controller[_0x9a72('0xa')]);router[_0x9a72('0x8')](_0x9a72('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x9a72('0xc'),auth[_0x9a72('0x9')](),controller[_0x9a72('0xd')]);router[_0x9a72('0x8')](_0x9a72('0xe'),auth[_0x9a72('0x9')](),controller[_0x9a72('0xf')]);router[_0x9a72('0x8')](_0x9a72('0x10'),auth[_0x9a72('0x9')](),controller[_0x9a72('0x11')]);router['post']('/',auth[_0x9a72('0x9')](),controller[_0x9a72('0x12')]);router[_0x9a72('0x13')]('/:id',auth[_0x9a72('0x9')](),controller['update']);router[_0x9a72('0x14')](_0x9a72('0xb'),auth['isAuthenticated'](),controller[_0x9a72('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x8df7=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','show','/:id/preview','preview','run','query','post','create','put','/:id','delete','destroy','multer','util'];(function(_0x3de7e0,_0x28cbff){var _0x11d0b3=function(_0xd95412){while(--_0xd95412){_0x3de7e0['push'](_0x3de7e0['shift']());}};_0x11d0b3(++_0x28cbff);}(_0x8df7,0xfb));var _0x78df=function(_0x5aa637,_0x4c6695){_0x5aa637=_0x5aa637-0x0;var _0x9df395=_0x8df7[_0x5aa637];return _0x9df395;};'use strict';var multer=require(_0x78df('0x0'));var util=require(_0x78df('0x1'));var path=require(_0x78df('0x2'));var timeout=require(_0x78df('0x3'));var express=require(_0x78df('0x4'));var router=express[_0x78df('0x5')]();var fs_extra=require(_0x78df('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x78df('0x7'));var config=require(_0x78df('0x8'));var controller=require(_0x78df('0x9'));router[_0x78df('0xa')]('/',auth[_0x78df('0xb')](),controller['index']);router[_0x78df('0xa')]('/:id',auth[_0x78df('0xb')](),controller[_0x78df('0xc')]);router['get'](_0x78df('0xd'),auth[_0x78df('0xb')](),controller[_0x78df('0xe')]);router[_0x78df('0xa')]('/:id/run',auth[_0x78df('0xb')](),controller[_0x78df('0xf')]);router['get']('/:id/query',auth[_0x78df('0xb')](),controller[_0x78df('0x10')]);router[_0x78df('0x11')]('/',auth['isAuthenticated'](),controller[_0x78df('0x12')]);router[_0x78df('0x13')](_0x78df('0x14'),auth[_0x78df('0xb')](),controller['update']);router[_0x78df('0x15')](_0x78df('0x14'),auth[_0x78df('0xb')](),controller[_0x78df('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 1912906..14f30d6 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4e65=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','DATE','manual','INTEGER'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x4e65,0xfb));var _0x54e6=function(_0x5b6cda,_0x1e546c){_0x5b6cda=_0x5b6cda-0x0;var _0x55e5c8=_0x4e65[_0x5b6cda];return _0x55e5c8;};'use strict';var Sequelize=require(_0x54e6('0x0'));var moment=require(_0x54e6('0x1'));module[_0x54e6('0x2')]={'name':{'type':Sequelize[_0x54e6('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x54e6('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x54e6('0x4')](_0x54e6('0x5'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x54e6('0x5')},'savename':{'type':Sequelize[_0x54e6('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x54e6('0x6')]},'status':{'type':Sequelize[_0x54e6('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x54e6('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0x54e6('0x7')},'reportId':{'type':Sequelize[_0x54e6('0x8')](0xb)[_0x54e6('0x9')]},'reportType':{'type':Sequelize[_0x54e6('0x3')]}};
\ No newline at end of file
+var _0x8739=['UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE','scheduled','manual','INTEGER'];(function(_0x4c1f6b,_0x5b3e78){var _0x551c7a=function(_0x27234c){while(--_0x27234c){_0x4c1f6b['push'](_0x4c1f6b['shift']());}};_0x551c7a(++_0x5b3e78);}(_0x8739,0xfd));var _0x9873=function(_0x5d0114,_0x2f2cc7){_0x5d0114=_0x5d0114-0x0;var _0x31b6e0=_0x8739[_0x5d0114];return _0x31b6e0;};'use strict';var Sequelize=require(_0x9873('0x0'));var moment=require(_0x9873('0x1'));module[_0x9873('0x2')]={'name':{'type':Sequelize[_0x9873('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x9873('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x9873('0x4'),_0x9873('0x5'),_0x9873('0x6')),'allowNull':![],'defaultValue':_0x9873('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x9873('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0x9873('0x8')),'allowNull':![],'defaultValue':_0x9873('0x9')},'reportId':{'type':Sequelize[_0x9873('0xa')](0xb)[_0x9873('0xb')]},'reportType':{'type':Sequelize[_0x9873('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index f2fd5f1..d47c511 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55eb=['../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','rawAttributes','find','create','body','user','role','get','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x50ad5c,_0x554a69){var _0x56e5f9=function(_0x1c9107){while(--_0x1c9107){_0x50ad5c['push'](_0x50ad5c['shift']());}};_0x56e5f9(++_0x554a69);}(_0x55eb,0xac));var _0xb55e=function(_0x14ad7a,_0x5b826a){_0x14ad7a=_0x14ad7a-0x0;var _0x334dd2=_0x55eb[_0x14ad7a];return _0x334dd2;};'use strict';var emlformat=require(_0xb55e('0x0'));var rimraf=require(_0xb55e('0x1'));var zipdir=require(_0xb55e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb55e('0x3'));var moment=require(_0xb55e('0x4'));var BPromise=require(_0xb55e('0x5'));var Mustache=require('mustache');var util=require(_0xb55e('0x6'));var path=require(_0xb55e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb55e('0x8'));var fs=require('fs');var fs_extra=require(_0xb55e('0x9'));var _=require(_0xb55e('0xa'));var squel=require('squel');var crypto=require(_0xb55e('0xb'));var jsforce=require(_0xb55e('0xc'));var deskjs=require(_0xb55e('0xd'));var toCsv=require(_0xb55e('0xe'));var querystring=require(_0xb55e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb55e('0x10'));var qs=require(_0xb55e('0x11'));var as=require(_0xb55e('0x12'));var hardwareService=require(_0xb55e('0x13'));var logger=require(_0xb55e('0x14'))(_0xb55e('0x15'));var utils=require('../../config/utils');var config=require(_0xb55e('0x16'));var licenseUtil=require(_0xb55e('0x17'));var db=require(_0xb55e('0x18'))['db'];function respondWithStatusCode(_0x43af48,_0x26d955){_0x26d955=_0x26d955||0xcc;return function(_0x16e7c3){if(_0x16e7c3){return _0x43af48['sendStatus'](_0x26d955);}return _0x43af48['status'](_0x26d955)[_0xb55e('0x19')]();};}function respondWithResult(_0x43becf,_0x33494d){_0x33494d=_0x33494d||0xc8;return function(_0x273710){if(_0x273710){return _0x43becf[_0xb55e('0x1a')](_0x33494d)[_0xb55e('0x1b')](_0x273710);}};}function respondWithFilteredResult(_0x1ac054,_0x4e9aad){return function(_0x43cd4c){if(_0x43cd4c){var _0x42a503=typeof _0x4e9aad[_0xb55e('0x1c')]==='undefined'&&typeof _0x4e9aad[_0xb55e('0x1d')]===_0xb55e('0x1e');var _0x2bc8d3=_0x43cd4c[_0xb55e('0x1f')];var _0x1c5aec=_0x42a503?0x0:_0x4e9aad[_0xb55e('0x1c')];var _0x46932c=_0x42a503?_0x43cd4c[_0xb55e('0x1f')]:_0x4e9aad[_0xb55e('0x1c')]+_0x4e9aad['limit'];var _0x42b4b1;if(_0x46932c>=_0x2bc8d3){_0x46932c=_0x2bc8d3;_0x42b4b1=0xc8;}else{_0x42b4b1=0xce;}_0x1ac054[_0xb55e('0x1a')](_0x42b4b1);return _0x1ac054[_0xb55e('0x20')](_0xb55e('0x21'),_0x1c5aec+'-'+_0x46932c+'/'+_0x2bc8d3)['json'](_0x43cd4c);}return null;};}function patchUpdates(_0x17a5c1){return function(_0x3e2c41){try{jsonpatch[_0xb55e('0x22')](_0x3e2c41,_0x17a5c1,!![]);}catch(_0xd0600c){return BPromise['reject'](_0xd0600c);}return _0x3e2c41[_0xb55e('0x23')]();};}function saveUpdates(_0x30b70f,_0x2a3c60){return function(_0x551fc5){if(_0x551fc5){return _0x551fc5[_0xb55e('0x24')](_0x30b70f)[_0xb55e('0x25')](function(_0x436394){return _0x436394;});}return null;};}function removeEntity(_0xd5c044,_0x33e1f7){return function(_0x37db75){if(_0x37db75){return _0x37db75[_0xb55e('0x26')]()[_0xb55e('0x25')](function(){var _0x4b4b31=_0x37db75['get']({'plain':!![]});var _0x1b5b40=_0xb55e('0x27');return db[_0xb55e('0x28')]['destroy']({'where':{'type':_0x1b5b40,'resourceId':_0x4b4b31['id']}})[_0xb55e('0x25')](function(){return _0x37db75;});})[_0xb55e('0x25')](function(){_0xd5c044[_0xb55e('0x1a')](0xcc)[_0xb55e('0x19')]();});}};}function handleEntityNotFound(_0x40817c,_0x113fe9){return function(_0x5e87fd){if(!_0x5e87fd){_0x40817c[_0xb55e('0x29')](0x194);}return _0x5e87fd;};}function handleError(_0x60daf4,_0x564d85){_0x564d85=_0x564d85||0x1f4;return function(_0x84a3ca){logger[_0xb55e('0x2a')](_0x84a3ca[_0xb55e('0x2b')]);if(_0x84a3ca['name']){delete _0x84a3ca[_0xb55e('0x2c')];}_0x60daf4['status'](_0x564d85)[_0xb55e('0x2d')](_0x84a3ca);};}exports[_0xb55e('0x2e')]=function(_0x53c668,_0x35ee24){var _0x5c328b={},_0x16991d={},_0x213ef5={'count':0x0,'rows':[]};var _0x226b05=_[_0xb55e('0x2f')](db[_0xb55e('0x30')]['rawAttributes'],function(_0x56be4c){return{'name':_0x56be4c['fieldName'],'type':_0x56be4c[_0xb55e('0x31')][_0xb55e('0x32')]};});_0x16991d['model']=_[_0xb55e('0x2f')](_0x226b05,'name');_0x16991d[_0xb55e('0x33')]=_[_0xb55e('0x34')](_0x53c668[_0xb55e('0x33')]);_0x16991d[_0xb55e('0x35')]=_['intersection'](_0x16991d[_0xb55e('0x36')],_0x16991d[_0xb55e('0x33')]);_0x5c328b[_0xb55e('0x37')]=_[_0xb55e('0x38')](_0x16991d[_0xb55e('0x36')],qs['fields'](_0x53c668[_0xb55e('0x33')][_0xb55e('0x39')]));_0x5c328b['attributes']=_0x5c328b['attributes'][_0xb55e('0x3a')]?_0x5c328b[_0xb55e('0x37')]:_0x16991d[_0xb55e('0x36')];if(!_0x53c668[_0xb55e('0x33')][_0xb55e('0x3b')](_0xb55e('0x3c'))){_0x5c328b[_0xb55e('0x1d')]=qs[_0xb55e('0x1d')](_0x53c668[_0xb55e('0x33')][_0xb55e('0x1d')]);_0x5c328b[_0xb55e('0x1c')]=qs[_0xb55e('0x1c')](_0x53c668[_0xb55e('0x33')][_0xb55e('0x1c')]);}_0x5c328b[_0xb55e('0x3d')]=qs[_0xb55e('0x3e')](_0x53c668['query'][_0xb55e('0x3e')]);_0x5c328b[_0xb55e('0x3f')]=qs[_0xb55e('0x35')](_[_0xb55e('0x40')](_0x53c668[_0xb55e('0x33')],_0x16991d[_0xb55e('0x35')]),_0x226b05);if(_0x53c668[_0xb55e('0x33')][_0xb55e('0x41')]){_0x5c328b[_0xb55e('0x3f')]=_[_0xb55e('0x42')](_0x5c328b['where'],{'$or':_[_0xb55e('0x2f')](_0x226b05,function(_0x36776f){if(_0x36776f['type']!==_0xb55e('0x43')){var _0x4c478c={};_0x4c478c[_0x36776f[_0xb55e('0x2c')]]={'$like':'%'+_0x53c668[_0xb55e('0x33')][_0xb55e('0x41')]+'%'};return _0x4c478c;}})});}_0x5c328b=_[_0xb55e('0x42')]({},_0x5c328b,_0x53c668[_0xb55e('0x44')]);var _0x5f3691={'where':_0x5c328b['where']};return db['AnalyticExtractedReport'][_0xb55e('0x1f')](_0x5f3691)[_0xb55e('0x25')](function(_0x5e1743){_0x213ef5[_0xb55e('0x1f')]=_0x5e1743;if(_0x53c668['query'][_0xb55e('0x45')]){_0x5c328b[_0xb55e('0x46')]=[{'all':!![]}];}return db[_0xb55e('0x30')]['findAll'](_0x5c328b);})[_0xb55e('0x25')](function(_0xbf0ebc){_0x213ef5[_0xb55e('0x47')]=_0xbf0ebc;return _0x213ef5;})[_0xb55e('0x25')](respondWithFilteredResult(_0x35ee24,_0x5c328b))['catch'](handleError(_0x35ee24,null));};exports['show']=function(_0x910e4d,_0x28e51f){var _0x5332f8={'raw':!![],'where':{'id':_0x910e4d[_0xb55e('0x48')]['id']}},_0x2994e6={};_0x2994e6['model']=_[_0xb55e('0x34')](db['AnalyticExtractedReport'][_0xb55e('0x49')]);_0x2994e6['query']=_['keys'](_0x910e4d['query']);_0x2994e6[_0xb55e('0x35')]=_['intersection'](_0x2994e6[_0xb55e('0x36')],_0x2994e6[_0xb55e('0x33')]);_0x5332f8[_0xb55e('0x37')]=_[_0xb55e('0x38')](_0x2994e6[_0xb55e('0x36')],qs[_0xb55e('0x39')](_0x910e4d[_0xb55e('0x33')][_0xb55e('0x39')]));_0x5332f8['attributes']=_0x5332f8['attributes'][_0xb55e('0x3a')]?_0x5332f8['attributes']:_0x2994e6[_0xb55e('0x36')];if(_0x910e4d['query'][_0xb55e('0x45')]){_0x5332f8[_0xb55e('0x46')]=[{'all':!![]}];}_0x5332f8=_[_0xb55e('0x42')]({},_0x5332f8,_0x910e4d[_0xb55e('0x44')]);return db[_0xb55e('0x30')][_0xb55e('0x4a')](_0x5332f8)['then'](handleEntityNotFound(_0x28e51f,null))[_0xb55e('0x25')](respondWithResult(_0x28e51f,null))['catch'](handleError(_0x28e51f,null));};exports[_0xb55e('0x4b')]=function(_0x583a67,_0x36d5f9){return db[_0xb55e('0x30')][_0xb55e('0x4b')](_0x583a67[_0xb55e('0x4c')],{})[_0xb55e('0x25')](function(_0x208d39){var _0x4ca605=_0x583a67[_0xb55e('0x4d')]['get']({'plain':!![]});if(!_0x4ca605)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ca605[_0xb55e('0x4e')]==='user'){var _0x5a6fd2=_0x208d39[_0xb55e('0x4f')]({'plain':!![]});var _0x2aed63=_0xb55e('0x27');return db[_0xb55e('0x50')][_0xb55e('0x4a')]({'where':{'name':_0x2aed63,'userProfileId':_0x4ca605[_0xb55e('0x51')]},'raw':!![]})[_0xb55e('0x25')](function(_0x167eb5){if(_0x167eb5&&_0x167eb5[_0xb55e('0x52')]===0x0){return db[_0xb55e('0x28')][_0xb55e('0x4b')]({'name':_0x5a6fd2[_0xb55e('0x2c')],'resourceId':_0x5a6fd2['id'],'type':_0x167eb5[_0xb55e('0x2c')],'sectionId':_0x167eb5['id']},{})[_0xb55e('0x25')](function(){return _0x208d39;});}else{return _0x208d39;}})[_0xb55e('0x53')](function(_0x175219){logger['error'](_0xb55e('0x54'),_0x175219);throw _0x175219;});}return _0x208d39;})[_0xb55e('0x25')](respondWithResult(_0x36d5f9,0xc9))[_0xb55e('0x53')](handleError(_0x36d5f9,null));};exports['update']=function(_0x41c41e,_0x2f5785){if(_0x41c41e[_0xb55e('0x4c')]['id']){delete _0x41c41e[_0xb55e('0x4c')]['id'];}return db[_0xb55e('0x30')][_0xb55e('0x4a')]({'where':{'id':_0x41c41e[_0xb55e('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f5785,null))[_0xb55e('0x25')](saveUpdates(_0x41c41e[_0xb55e('0x4c')],null))[_0xb55e('0x25')](respondWithResult(_0x2f5785,null))['catch'](handleError(_0x2f5785,null));};exports[_0xb55e('0x26')]=function(_0x354d30,_0xacf257){return db[_0xb55e('0x30')][_0xb55e('0x4a')]({'where':{'id':_0x354d30[_0xb55e('0x48')]['id']}})[_0xb55e('0x25')](handleEntityNotFound(_0xacf257,null))[_0xb55e('0x25')](removeEntity(_0xacf257,null))['catch'](handleError(_0xacf257,null));};exports[_0xb55e('0x55')]=function(_0x299a33,_0x32bf4e,_0x260c63){return db['AnalyticExtractedReport'][_0xb55e('0x4a')]({'where':{'id':_0x299a33['params']['id']},'attributes':[_0xb55e('0x2c'),_0xb55e('0x56'),_0xb55e('0x57'),_0xb55e('0x58')],'raw':!![]})[_0xb55e('0x25')](handleEntityNotFound(_0x32bf4e,null))[_0xb55e('0x25')](function(_0x5733c3){if(_0x5733c3){if(!fs[_0xb55e('0x59')](path[_0xb55e('0x5a')](config[_0xb55e('0x5b')],_0xb55e('0x5c'),_0x5733c3[_0xb55e('0x57')]))){throw new db[(_0xb55e('0x5d'))]['ValidationError'](_0xb55e('0x5e'));}if(_0x299a33[_0xb55e('0x33')]['exists']){return _0x32bf4e['sendStatus'](0xc8);}return _0x32bf4e[_0xb55e('0x55')](path[_0xb55e('0x5a')](config['root'],_0xb55e('0x5c'),_0x5733c3['savename']),util[_0xb55e('0x5f')](_0xb55e('0x60'),_0x5733c3['basename']||_0x5733c3['name'],_0x5733c3[_0xb55e('0x58')][_0xb55e('0x61')]()));}})[_0xb55e('0x53')](handleError(_0x32bf4e,null));};
\ No newline at end of file
+var _0x1e94=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','update','params','download','basename','output','existsSync','join','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','sendStatus','root','format','%s.%s','toLowerCase','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','destroy','then','get','ExtractedReports','UserProfileResource','error','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','key','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','includeAll','rows','catch','show','model','find'];(function(_0x30146e,_0x168495){var _0x4fe38d=function(_0x4e353f){while(--_0x4e353f){_0x30146e['push'](_0x30146e['shift']());}};_0x4fe38d(++_0x168495);}(_0x1e94,0xd2));var _0x41e9=function(_0xd25da3,_0x2a7b4f){_0xd25da3=_0xd25da3-0x0;var _0x531cab=_0x1e94[_0xd25da3];return _0x531cab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x41e9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x41e9('0x1'));var rp=require(_0x41e9('0x2'));var moment=require(_0x41e9('0x3'));var BPromise=require(_0x41e9('0x4'));var Mustache=require(_0x41e9('0x5'));var util=require(_0x41e9('0x6'));var path=require(_0x41e9('0x7'));var sox=require(_0x41e9('0x8'));var csv=require(_0x41e9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41e9('0xa'));var squel=require(_0x41e9('0xb'));var crypto=require(_0x41e9('0xc'));var jsforce=require(_0x41e9('0xd'));var deskjs=require(_0x41e9('0xe'));var toCsv=require(_0x41e9('0x9'));var querystring=require(_0x41e9('0xf'));var Papa=require(_0x41e9('0x10'));var Redis=require(_0x41e9('0x11'));var authService=require(_0x41e9('0x12'));var qs=require(_0x41e9('0x13'));var as=require(_0x41e9('0x14'));var hardwareService=require(_0x41e9('0x15'));var logger=require(_0x41e9('0x16'))(_0x41e9('0x17'));var utils=require(_0x41e9('0x18'));var config=require(_0x41e9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x41e9('0x1a'))['db'];function respondWithStatusCode(_0x3130db,_0x4a11e8){_0x4a11e8=_0x4a11e8||0xcc;return function(_0x597dfd){if(_0x597dfd){return _0x3130db['sendStatus'](_0x4a11e8);}return _0x3130db[_0x41e9('0x1b')](_0x4a11e8)[_0x41e9('0x1c')]();};}function respondWithResult(_0x164200,_0x5cde4e){_0x5cde4e=_0x5cde4e||0xc8;return function(_0xe5196f){if(_0xe5196f){return _0x164200[_0x41e9('0x1b')](_0x5cde4e)[_0x41e9('0x1d')](_0xe5196f);}};}function respondWithFilteredResult(_0x14e025,_0x24493b){return function(_0x3fe45d){if(_0x3fe45d){var _0xfe13=typeof _0x24493b['offset']===_0x41e9('0x1e')&&typeof _0x24493b['limit']==='undefined';var _0x259bc6=_0x3fe45d[_0x41e9('0x1f')];var _0x53e7af=_0xfe13?0x0:_0x24493b[_0x41e9('0x20')];var _0x159d1f=_0xfe13?_0x3fe45d[_0x41e9('0x1f')]:_0x24493b['offset']+_0x24493b[_0x41e9('0x21')];var _0x30c6f9;if(_0x159d1f>=_0x259bc6){_0x159d1f=_0x259bc6;_0x30c6f9=0xc8;}else{_0x30c6f9=0xce;}_0x14e025[_0x41e9('0x1b')](_0x30c6f9);return _0x14e025[_0x41e9('0x22')](_0x41e9('0x23'),_0x53e7af+'-'+_0x159d1f+'/'+_0x259bc6)['json'](_0x3fe45d);}return null;};}function patchUpdates(_0x1e5d5f){return function(_0xe18606){try{jsonpatch[_0x41e9('0x24')](_0xe18606,_0x1e5d5f,!![]);}catch(_0x4a359e){return BPromise[_0x41e9('0x25')](_0x4a359e);}return _0xe18606['save']();};}function saveUpdates(_0x311da1,_0x5a839f){return function(_0x34f2ae){if(_0x34f2ae){return _0x34f2ae['update'](_0x311da1)['then'](function(_0x5881b1){return _0x5881b1;});}return null;};}function removeEntity(_0x1e4e13,_0x39e293){return function(_0x108ae7){if(_0x108ae7){return _0x108ae7[_0x41e9('0x26')]()[_0x41e9('0x27')](function(){var _0xeff6b5=_0x108ae7[_0x41e9('0x28')]({'plain':!![]});var _0x21df56=_0x41e9('0x29');return db[_0x41e9('0x2a')][_0x41e9('0x26')]({'where':{'type':_0x21df56,'resourceId':_0xeff6b5['id']}})['then'](function(){return _0x108ae7;});})[_0x41e9('0x27')](function(){_0x1e4e13[_0x41e9('0x1b')](0xcc)[_0x41e9('0x1c')]();});}};}function handleEntityNotFound(_0x2aa2b7,_0x35cc84){return function(_0x5092c6){if(!_0x5092c6){_0x2aa2b7['sendStatus'](0x194);}return _0x5092c6;};}function handleError(_0x12a8bf,_0x17c518){_0x17c518=_0x17c518||0x1f4;return function(_0x245867){logger[_0x41e9('0x2b')](_0x245867['stack']);if(_0x245867[_0x41e9('0x2c')]){delete _0x245867[_0x41e9('0x2c')];}_0x12a8bf[_0x41e9('0x1b')](_0x17c518)[_0x41e9('0x2d')](_0x245867);};}exports[_0x41e9('0x2e')]=function(_0x34c6f4,_0x252eb1){var _0x384436={},_0x392bdb={},_0x429c97={'count':0x0,'rows':[]};var _0x26d4b5=_['map'](db[_0x41e9('0x2f')][_0x41e9('0x30')],function(_0x1fe23d){return{'name':_0x1fe23d[_0x41e9('0x31')],'type':_0x1fe23d['type'][_0x41e9('0x32')]};});_0x392bdb['model']=_[_0x41e9('0x33')](_0x26d4b5,'name');_0x392bdb[_0x41e9('0x34')]=_[_0x41e9('0x35')](_0x34c6f4[_0x41e9('0x34')]);_0x392bdb['filters']=_[_0x41e9('0x36')](_0x392bdb['model'],_0x392bdb['query']);_0x384436[_0x41e9('0x37')]=_[_0x41e9('0x36')](_0x392bdb['model'],qs[_0x41e9('0x38')](_0x34c6f4['query'][_0x41e9('0x38')]));_0x384436[_0x41e9('0x37')]=_0x384436['attributes'][_0x41e9('0x39')]?_0x384436[_0x41e9('0x37')]:_0x392bdb['model'];if(!_0x34c6f4[_0x41e9('0x34')][_0x41e9('0x3a')]('nolimit')){_0x384436[_0x41e9('0x21')]=qs[_0x41e9('0x21')](_0x34c6f4['query']['limit']);_0x384436[_0x41e9('0x20')]=qs[_0x41e9('0x20')](_0x34c6f4[_0x41e9('0x34')][_0x41e9('0x20')]);}_0x384436['order']=qs[_0x41e9('0x3b')](_0x34c6f4[_0x41e9('0x34')][_0x41e9('0x3b')]);_0x384436[_0x41e9('0x3c')]=qs[_0x41e9('0x3d')](_[_0x41e9('0x3e')](_0x34c6f4['query'],_0x392bdb[_0x41e9('0x3d')]),_0x26d4b5);if(_0x34c6f4[_0x41e9('0x34')][_0x41e9('0x3f')]){_0x384436['where']=_[_0x41e9('0x40')](_0x384436[_0x41e9('0x3c')],{'$or':_['map'](_0x26d4b5,function(_0x288634){if(_0x288634['type']!=='VIRTUAL'){var _0x2ef1de={};_0x2ef1de[_0x288634['name']]={'$like':'%'+_0x34c6f4[_0x41e9('0x34')][_0x41e9('0x3f')]+'%'};return _0x2ef1de;}})});}_0x384436=_[_0x41e9('0x40')]({},_0x384436,_0x34c6f4[_0x41e9('0x41')]);var _0xbae75b={'where':_0x384436[_0x41e9('0x3c')]};return db[_0x41e9('0x2f')][_0x41e9('0x1f')](_0xbae75b)[_0x41e9('0x27')](function(_0x3194b8){_0x429c97[_0x41e9('0x1f')]=_0x3194b8;if(_0x34c6f4[_0x41e9('0x34')][_0x41e9('0x42')]){_0x384436['include']=[{'all':!![]}];}return db[_0x41e9('0x2f')]['findAll'](_0x384436);})['then'](function(_0x19d816){_0x429c97[_0x41e9('0x43')]=_0x19d816;return _0x429c97;})[_0x41e9('0x27')](respondWithFilteredResult(_0x252eb1,_0x384436))[_0x41e9('0x44')](handleError(_0x252eb1,null));};exports[_0x41e9('0x45')]=function(_0x2baab4,_0x41b71a){var _0x1c2b0e={'raw':!![],'where':{'id':_0x2baab4['params']['id']}},_0x1b92a6={};_0x1b92a6[_0x41e9('0x46')]=_[_0x41e9('0x35')](db[_0x41e9('0x2f')]['rawAttributes']);_0x1b92a6[_0x41e9('0x34')]=_[_0x41e9('0x35')](_0x2baab4[_0x41e9('0x34')]);_0x1b92a6[_0x41e9('0x3d')]=_[_0x41e9('0x36')](_0x1b92a6['model'],_0x1b92a6['query']);_0x1c2b0e[_0x41e9('0x37')]=_[_0x41e9('0x36')](_0x1b92a6[_0x41e9('0x46')],qs['fields'](_0x2baab4[_0x41e9('0x34')][_0x41e9('0x38')]));_0x1c2b0e[_0x41e9('0x37')]=_0x1c2b0e[_0x41e9('0x37')][_0x41e9('0x39')]?_0x1c2b0e[_0x41e9('0x37')]:_0x1b92a6['model'];if(_0x2baab4[_0x41e9('0x34')]['includeAll']){_0x1c2b0e['include']=[{'all':!![]}];}_0x1c2b0e=_[_0x41e9('0x40')]({},_0x1c2b0e,_0x2baab4[_0x41e9('0x41')]);return db['AnalyticExtractedReport'][_0x41e9('0x47')](_0x1c2b0e)[_0x41e9('0x27')](handleEntityNotFound(_0x41b71a,null))[_0x41e9('0x27')](respondWithResult(_0x41b71a,null))[_0x41e9('0x44')](handleError(_0x41b71a,null));};exports[_0x41e9('0x48')]=function(_0x4c5744,_0x58ab3c){return db[_0x41e9('0x2f')][_0x41e9('0x48')](_0x4c5744[_0x41e9('0x49')],{})[_0x41e9('0x27')](function(_0x2672f8){var _0x141086=_0x4c5744[_0x41e9('0x4a')][_0x41e9('0x28')]({'plain':!![]});if(!_0x141086)throw new Error(_0x41e9('0x4b'));if(_0x141086[_0x41e9('0x4c')]===_0x41e9('0x4a')){var _0x5797f4=_0x2672f8['get']({'plain':!![]});var _0x18f73b=_0x41e9('0x29');return db['UserProfileSection'][_0x41e9('0x47')]({'where':{'name':_0x18f73b,'userProfileId':_0x141086['userProfileId']},'raw':!![]})[_0x41e9('0x27')](function(_0x443e1){if(_0x443e1&&_0x443e1['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5797f4[_0x41e9('0x2c')],'resourceId':_0x5797f4['id'],'type':_0x443e1[_0x41e9('0x2c')],'sectionId':_0x443e1['id']},{})['then'](function(){return _0x2672f8;});}else{return _0x2672f8;}})[_0x41e9('0x44')](function(_0x53c702){logger[_0x41e9('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53c702);throw _0x53c702;});}return _0x2672f8;})[_0x41e9('0x27')](respondWithResult(_0x58ab3c,0xc9))[_0x41e9('0x44')](handleError(_0x58ab3c,null));};exports[_0x41e9('0x4d')]=function(_0x2bb982,_0x28f4b6){if(_0x2bb982[_0x41e9('0x49')]['id']){delete _0x2bb982[_0x41e9('0x49')]['id'];}return db[_0x41e9('0x2f')][_0x41e9('0x47')]({'where':{'id':_0x2bb982[_0x41e9('0x4e')]['id']}})[_0x41e9('0x27')](handleEntityNotFound(_0x28f4b6,null))[_0x41e9('0x27')](saveUpdates(_0x2bb982[_0x41e9('0x49')],null))[_0x41e9('0x27')](respondWithResult(_0x28f4b6,null))[_0x41e9('0x44')](handleError(_0x28f4b6,null));};exports[_0x41e9('0x26')]=function(_0x2e3bef,_0xa1bba8){return db[_0x41e9('0x2f')][_0x41e9('0x47')]({'where':{'id':_0x2e3bef[_0x41e9('0x4e')]['id']}})['then'](handleEntityNotFound(_0xa1bba8,null))[_0x41e9('0x27')](removeEntity(_0xa1bba8,null))['catch'](handleError(_0xa1bba8,null));};exports[_0x41e9('0x4f')]=function(_0x247410,_0x1d18f1,_0x4ba30c){return db[_0x41e9('0x2f')]['find']({'where':{'id':_0x247410[_0x41e9('0x4e')]['id']},'attributes':['name',_0x41e9('0x50'),'savename',_0x41e9('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x1d18f1,null))[_0x41e9('0x27')](function(_0x1c09a0){if(_0x1c09a0){if(!fs[_0x41e9('0x52')](path[_0x41e9('0x53')](config['root'],_0x41e9('0x54'),_0x1c09a0[_0x41e9('0x55')]))){throw new db[(_0x41e9('0x56'))][(_0x41e9('0x57'))](_0x41e9('0x58'));}if(_0x247410[_0x41e9('0x34')]['exists']){return _0x1d18f1[_0x41e9('0x59')](0xc8);}return _0x1d18f1['download'](path[_0x41e9('0x53')](config[_0x41e9('0x5a')],'server/files/reports',_0x1c09a0[_0x41e9('0x55')]),util[_0x41e9('0x5b')](_0x41e9('0x5c'),_0x1c09a0[_0x41e9('0x50')]||_0x1c09a0['name'],_0x1c09a0[_0x41e9('0x51')][_0x41e9('0x5d')]()));}})[_0x41e9('0x44')](handleError(_0x1d18f1,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 451280a..8a9de84 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7bbb=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./analyticExtractedReport.attributes','exports','define'];(function(_0xecab6a,_0x3c768a){var _0x40b98b=function(_0x448a28){while(--_0x448a28){_0xecab6a['push'](_0xecab6a['shift']());}};_0x40b98b(++_0x3c768a);}(_0x7bbb,0xaa));var _0xb7bb=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7bbb[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0xb7bb('0x0'));var util=require('util');var logger=require(_0xb7bb('0x1'))(_0xb7bb('0x2'));var moment=require(_0xb7bb('0x3'));var BPromise=require(_0xb7bb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7bb('0x5'));var rimraf=require(_0xb7bb('0x6'));var config=require('../../config/environment');var attributes=require(_0xb7bb('0x7'));module[_0xb7bb('0x8')]=function(_0x3d7920,_0x5cb807){return _0x3d7920[_0xb7bb('0x9')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcd12=['define','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x5a0d62,_0x746560){var _0x405432=function(_0x14530c){while(--_0x14530c){_0x5a0d62['push'](_0x5a0d62['shift']());}};_0x405432(++_0x746560);}(_0xcd12,0xb5));var _0x2cd1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd12[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cd1('0x0'));var util=require(_0x2cd1('0x1'));var logger=require('../../config/logger')(_0x2cd1('0x2'));var moment=require(_0x2cd1('0x3'));var BPromise=require(_0x2cd1('0x4'));var rp=require(_0x2cd1('0x5'));var fs=require('fs');var path=require(_0x2cd1('0x6'));var rimraf=require(_0x2cd1('0x7'));var config=require(_0x2cd1('0x8'));var attributes=require(_0x2cd1('0x9'));module[_0x2cd1('0xa')]=function(_0x514ffb,_0x5d6419){return _0x514ffb[_0x2cd1('0xb')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 17c2180..33074da 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4614=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x33430c,_0x4cc99c){var _0x31fcbf=function(_0x1f2d41){while(--_0x1f2d41){_0x33430c['push'](_0x33430c['shift']());}};_0x31fcbf(++_0x4cc99c);}(_0x4614,0x85));var _0x4461=function(_0x508076,_0x1980e6){_0x508076=_0x508076-0x0;var _0x20328a=_0x4614[_0x508076];return _0x20328a;};'use strict';var _=require(_0x4461('0x0'));var util=require(_0x4461('0x1'));var moment=require(_0x4461('0x2'));var BPromise=require(_0x4461('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4461('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4461('0x5'))(_0x4461('0x6'));var config=require(_0x4461('0x7'));var jayson=require(_0x4461('0x8'));var client=jayson[_0x4461('0x9')][_0x4461('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f96b8,_0xbdf0b4,_0x32d563){return new BPromise(function(_0x1616c0,_0x56e63d){return client[_0x4461('0xb')](_0x5f96b8,_0x32d563)[_0x4461('0xc')](function(_0x48c6bb){logger[_0x4461('0xd')](_0x4461('0xe'),_0xbdf0b4,_0x4461('0xf'));logger['debug'](_0x4461('0x10'),_0xbdf0b4,_0x4461('0xf'),JSON[_0x4461('0x11')](_0x48c6bb));if(_0x48c6bb['error']){if(_0x48c6bb[_0x4461('0x12')]['code']===0x1f4){logger[_0x4461('0x12')](_0x4461('0xe'),_0xbdf0b4,_0x48c6bb['error'][_0x4461('0x13')]);return _0x56e63d(_0x48c6bb[_0x4461('0x12')][_0x4461('0x13')]);}logger[_0x4461('0x12')](_0x4461('0xe'),_0xbdf0b4,_0x48c6bb['error'][_0x4461('0x13')]);return _0x1616c0(_0x48c6bb[_0x4461('0x12')][_0x4461('0x13')]);}else{logger[_0x4461('0xd')](_0x4461('0xe'),_0xbdf0b4,'request\x20sent');_0x1616c0(_0x48c6bb[_0x4461('0x14')][_0x4461('0x13')]);}})['catch'](function(_0x1ce854){logger[_0x4461('0x12')](_0x4461('0xe'),_0xbdf0b4,_0x1ce854);_0x56e63d(_0x1ce854);});});}
\ No newline at end of file
+var _0x3c6a=['catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result'];(function(_0xa2c0a3,_0x5bbac0){var _0x52c618=function(_0x20f7fd){while(--_0x20f7fd){_0xa2c0a3['push'](_0xa2c0a3['shift']());}};_0x52c618(++_0x5bbac0);}(_0x3c6a,0xb5));var _0xa3c6=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0x3c6a[_0x215dc8];return _0x583ea3;};'use strict';var _=require(_0xa3c6('0x0'));var util=require(_0xa3c6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa3c6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa3c6('0x3'))['db'];var utils=require(_0xa3c6('0x4'));var logger=require(_0xa3c6('0x5'))(_0xa3c6('0x6'));var config=require('../../config/environment');var jayson=require(_0xa3c6('0x7'));var client=jayson[_0xa3c6('0x8')][_0xa3c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x128cc2,_0x93316a,_0x1cfd8f){return new BPromise(function(_0x38c35d,_0x3a8181){return client[_0xa3c6('0xa')](_0x128cc2,_0x1cfd8f)['then'](function(_0x3e56d0){logger['info'](_0xa3c6('0xb'),_0x93316a,'request\x20sent');logger[_0xa3c6('0xc')](_0xa3c6('0xd'),_0x93316a,_0xa3c6('0xe'),JSON['stringify'](_0x3e56d0));if(_0x3e56d0[_0xa3c6('0xf')]){if(_0x3e56d0['error']['code']===0x1f4){logger[_0xa3c6('0xf')](_0xa3c6('0xb'),_0x93316a,_0x3e56d0[_0xa3c6('0xf')][_0xa3c6('0x10')]);return _0x3a8181(_0x3e56d0[_0xa3c6('0xf')][_0xa3c6('0x10')]);}logger[_0xa3c6('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x93316a,_0x3e56d0['error'][_0xa3c6('0x10')]);return _0x38c35d(_0x3e56d0[_0xa3c6('0xf')]['message']);}else{logger[_0xa3c6('0x11')](_0xa3c6('0xb'),_0x93316a,_0xa3c6('0xe'));_0x38c35d(_0x3e56d0[_0xa3c6('0x12')][_0xa3c6('0x10')]);}})[_0xa3c6('0x13')](function(_0x2f44de){logger[_0xa3c6('0xf')](_0xa3c6('0xb'),_0x93316a,_0x2f44de);_0x3a8181(_0x2f44de);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 24fec88..432e13e 100644
--- a/server/api/analyticExtractedReport/index.js
+++ b/server/api/analyticExtractedReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe2a=['multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','delete','exports'];(function(_0x519dcb,_0x2a11dc){var _0x516618=function(_0x4d0fe3){while(--_0x4d0fe3){_0x519dcb['push'](_0x519dcb['shift']());}};_0x516618(++_0x2a11dc);}(_0xbe2a,0x1e6));var _0xabe2=function(_0x3b8aeb,_0x50899d){_0x3b8aeb=_0x3b8aeb-0x0;var _0x73919d=_0xbe2a[_0x3b8aeb];return _0x73919d;};'use strict';var multer=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xabe2('0x2'));var auth=require(_0xabe2('0x3'));var interaction=require(_0xabe2('0x4'));var config=require(_0xabe2('0x5'));var controller=require('./analyticExtractedReport.controller');router[_0xabe2('0x6')]('/',auth[_0xabe2('0x7')](),controller[_0xabe2('0x8')]);router['get'](_0xabe2('0x9'),auth[_0xabe2('0x7')](),controller[_0xabe2('0xa')]);router[_0xabe2('0x6')](_0xabe2('0xb'),auth[_0xabe2('0x7')](),controller[_0xabe2('0xc')]);router[_0xabe2('0xd')]('/',auth['isAuthenticated'](),controller[_0xabe2('0xe')]);router['put'](_0xabe2('0x9'),auth[_0xabe2('0x7')](),controller[_0xabe2('0xf')]);router[_0xabe2('0x10')](_0xabe2('0x9'),auth[_0xabe2('0x7')](),controller['destroy']);module[_0xabe2('0x11')]=router;
\ No newline at end of file
+var _0x90b8=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create'];(function(_0x2168f8,_0x407daa){var _0x39f31b=function(_0x2da764){while(--_0x2da764){_0x2168f8['push'](_0x2168f8['shift']());}};_0x39f31b(++_0x407daa);}(_0x90b8,0xeb));var _0x890b=function(_0x4fa0ea,_0x2cd534){_0x4fa0ea=_0x4fa0ea-0x0;var _0x51d027=_0x90b8[_0x4fa0ea];return _0x51d027;};'use strict';var multer=require(_0x890b('0x0'));var util=require(_0x890b('0x1'));var path=require(_0x890b('0x2'));var timeout=require(_0x890b('0x3'));var express=require(_0x890b('0x4'));var router=express[_0x890b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x890b('0x6'));var interaction=require(_0x890b('0x7'));var config=require('../../config/environment');var controller=require(_0x890b('0x8'));router[_0x890b('0x9')]('/',auth[_0x890b('0xa')](),controller['index']);router[_0x890b('0x9')](_0x890b('0xb'),auth[_0x890b('0xa')](),controller[_0x890b('0xc')]);router[_0x890b('0x9')](_0x890b('0xd'),auth[_0x890b('0xa')](),controller[_0x890b('0xe')]);router[_0x890b('0xf')]('/',auth[_0x890b('0xa')](),controller[_0x890b('0x10')]);router[_0x890b('0x11')](_0x890b('0xb'),auth[_0x890b('0xa')](),controller['update']);router[_0x890b('0x12')]('/:id',auth[_0x890b('0xa')](),controller[_0x890b('0x13')]);module[_0x890b('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index b7455e6..de12aa8 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0dbc=['BOOLEAN','sequelize','exports','STRING'];(function(_0x277fa3,_0x3b2dde){var _0x2e4520=function(_0x209eab){while(--_0x209eab){_0x277fa3['push'](_0x277fa3['shift']());}};_0x2e4520(++_0x3b2dde);}(_0x0dbc,0x1a5));var _0xc0db=function(_0x1f9a85,_0x4bfcdd){_0x1f9a85=_0x1f9a85-0x0;var _0x4e67b3=_0x0dbc[_0x1f9a85];return _0x4e67b3;};'use strict';var Sequelize=require(_0xc0db('0x0'));module[_0xc0db('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xc0db('0x2')]},'groupBy':{'type':Sequelize[_0xc0db('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xc0db('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc736=['exports','TEXT','BOOLEAN','STRING','sequelize'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xc736,0x149));var _0x6c73=function(_0x2f21e8,_0xbfc604){_0x2f21e8=_0x2f21e8-0x0;var _0x460c1c=_0xc736[_0x2f21e8];return _0x460c1c;};'use strict';var Sequelize=require(_0x6c73('0x0'));module[_0x6c73('0x1')]={'field':{'type':Sequelize[_0x6c73('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x6c73('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6c73('0x4')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 5d43716..6b0a025 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.controller.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ca7=['intersection','attributes','fields','query','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','find','catch','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','sequelize','transaction','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','filters'];(function(_0x451130,_0x595ee2){var _0x68c08e=function(_0x23fe84){while(--_0x23fe84){_0x451130['push'](_0x451130['shift']());}};_0x68c08e(++_0x595ee2);}(_0x8ca7,0x1a2));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x78ca('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x78ca('0x1'));var rp=require(_0x78ca('0x2'));var moment=require(_0x78ca('0x3'));var BPromise=require(_0x78ca('0x4'));var Mustache=require(_0x78ca('0x5'));var util=require(_0x78ca('0x6'));var path=require('path');var sox=require(_0x78ca('0x7'));var csv=require(_0x78ca('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78ca('0x9'));var _=require(_0x78ca('0xa'));var squel=require(_0x78ca('0xb'));var crypto=require('crypto');var jsforce=require(_0x78ca('0xc'));var deskjs=require(_0x78ca('0xd'));var toCsv=require(_0x78ca('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x78ca('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x78ca('0xf'));var as=require(_0x78ca('0x10'));var hardwareService=require(_0x78ca('0x11'));var logger=require(_0x78ca('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x78ca('0x13'));var licenseUtil=require(_0x78ca('0x14'));var db=require(_0x78ca('0x15'))['db'];function respondWithStatusCode(_0x3c8170,_0x14ab4e){_0x14ab4e=_0x14ab4e||0xcc;return function(_0x4badeb){if(_0x4badeb){return _0x3c8170['sendStatus'](_0x14ab4e);}return _0x3c8170[_0x78ca('0x16')](_0x14ab4e)[_0x78ca('0x17')]();};}function respondWithResult(_0x2c7263,_0x4aea60){_0x4aea60=_0x4aea60||0xc8;return function(_0xc701d8){if(_0xc701d8){return _0x2c7263[_0x78ca('0x16')](_0x4aea60)[_0x78ca('0x18')](_0xc701d8);}};}function respondWithFilteredResult(_0x87ee3,_0x408d60){return function(_0xa1d86c){if(_0xa1d86c){var _0x207d51=typeof _0x408d60['offset']===_0x78ca('0x19')&&typeof _0x408d60[_0x78ca('0x1a')]===_0x78ca('0x19');var _0x3ffd41=_0xa1d86c[_0x78ca('0x1b')];var _0x742768=_0x207d51?0x0:_0x408d60[_0x78ca('0x1c')];var _0x17e7df=_0x207d51?_0xa1d86c[_0x78ca('0x1b')]:_0x408d60[_0x78ca('0x1c')]+_0x408d60['limit'];var _0x4dff00;if(_0x17e7df>=_0x3ffd41){_0x17e7df=_0x3ffd41;_0x4dff00=0xc8;}else{_0x4dff00=0xce;}_0x87ee3[_0x78ca('0x16')](_0x4dff00);return _0x87ee3[_0x78ca('0x1d')]('Content-Range',_0x742768+'-'+_0x17e7df+'/'+_0x3ffd41)[_0x78ca('0x18')](_0xa1d86c);}return null;};}function patchUpdates(_0x5006ad){return function(_0x418ae7){try{jsonpatch[_0x78ca('0x1e')](_0x418ae7,_0x5006ad,!![]);}catch(_0x310ae9){return BPromise[_0x78ca('0x1f')](_0x310ae9);}return _0x418ae7[_0x78ca('0x20')]();};}function saveUpdates(_0x5908c7,_0x2fe0a3){return function(_0x16c783){if(_0x16c783){return _0x16c783[_0x78ca('0x21')](_0x5908c7)[_0x78ca('0x22')](function(_0xae2c48){return _0xae2c48;});}return null;};}function removeEntity(_0x3ceae5,_0x19f526){return function(_0x439666){if(_0x439666){return _0x439666[_0x78ca('0x23')]()['then'](function(){_0x3ceae5[_0x78ca('0x16')](0xcc)[_0x78ca('0x17')]();});}};}function handleEntityNotFound(_0x83fe4e,_0x546c7e){return function(_0x2fb721){if(!_0x2fb721){_0x83fe4e[_0x78ca('0x24')](0x194);}return _0x2fb721;};}function handleError(_0x501c8d,_0xb3f8e){_0xb3f8e=_0xb3f8e||0x1f4;return function(_0x588fc6){logger['error'](_0x588fc6[_0x78ca('0x25')]);if(_0x588fc6[_0x78ca('0x26')]){delete _0x588fc6[_0x78ca('0x26')];}_0x501c8d['status'](_0xb3f8e)[_0x78ca('0x27')](_0x588fc6);};}exports[_0x78ca('0x28')]=function(_0x5394ea,_0x53a1f4){var _0x4ab05={},_0xaea698={},_0x2b1dc2={'count':0x0,'rows':[]};var _0x38aad8=_[_0x78ca('0x29')](db[_0x78ca('0x2a')][_0x78ca('0x2b')],function(_0x58debc){return{'name':_0x58debc[_0x78ca('0x2c')],'type':_0x58debc[_0x78ca('0x2d')][_0x78ca('0x2e')]};});_0xaea698[_0x78ca('0x2f')]=_[_0x78ca('0x29')](_0x38aad8,_0x78ca('0x26'));_0xaea698['query']=_[_0x78ca('0x30')](_0x5394ea['query']);_0xaea698[_0x78ca('0x31')]=_[_0x78ca('0x32')](_0xaea698['model'],_0xaea698['query']);_0x4ab05[_0x78ca('0x33')]=_['intersection'](_0xaea698[_0x78ca('0x2f')],qs[_0x78ca('0x34')](_0x5394ea[_0x78ca('0x35')]['fields']));_0x4ab05[_0x78ca('0x33')]=_0x4ab05[_0x78ca('0x33')][_0x78ca('0x36')]?_0x4ab05[_0x78ca('0x33')]:_0xaea698[_0x78ca('0x2f')];if(!_0x5394ea[_0x78ca('0x35')][_0x78ca('0x37')]('nolimit')){_0x4ab05[_0x78ca('0x1a')]=qs[_0x78ca('0x1a')](_0x5394ea[_0x78ca('0x35')][_0x78ca('0x1a')]);_0x4ab05['offset']=qs[_0x78ca('0x1c')](_0x5394ea[_0x78ca('0x35')][_0x78ca('0x1c')]);}_0x4ab05[_0x78ca('0x38')]=qs[_0x78ca('0x39')](_0x5394ea[_0x78ca('0x35')][_0x78ca('0x39')]);_0x4ab05['where']=qs[_0x78ca('0x31')](_[_0x78ca('0x3a')](_0x5394ea['query'],_0xaea698[_0x78ca('0x31')]),_0x38aad8);if(_0x5394ea[_0x78ca('0x35')][_0x78ca('0x3b')]){_0x4ab05[_0x78ca('0x3c')]=_[_0x78ca('0x3d')](_0x4ab05[_0x78ca('0x3c')],{'$or':_[_0x78ca('0x29')](_0x38aad8,function(_0x1861f6){if(_0x1861f6[_0x78ca('0x2d')]!==_0x78ca('0x3e')){var _0x7c640b={};_0x7c640b[_0x1861f6[_0x78ca('0x26')]]={'$like':'%'+_0x5394ea[_0x78ca('0x35')]['filter']+'%'};return _0x7c640b;}})});}_0x4ab05=_['merge']({},_0x4ab05,_0x5394ea[_0x78ca('0x3f')]);var _0x135d44={'where':_0x4ab05['where']};return db[_0x78ca('0x2a')][_0x78ca('0x1b')](_0x135d44)[_0x78ca('0x22')](function(_0x945687){_0x2b1dc2['count']=_0x945687;if(_0x5394ea[_0x78ca('0x35')][_0x78ca('0x40')]){_0x4ab05[_0x78ca('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x78ca('0x42')](_0x4ab05);})['then'](function(_0x153f1b){_0x2b1dc2['rows']=_0x153f1b;return _0x2b1dc2;})[_0x78ca('0x22')](respondWithFilteredResult(_0x53a1f4,_0x4ab05))['catch'](handleError(_0x53a1f4,null));};exports['show']=function(_0x52ff40,_0x428a4a){var _0x56e17c={'raw':![],'where':{'id':_0x52ff40[_0x78ca('0x43')]['id']}},_0x1555fd={};_0x1555fd[_0x78ca('0x2f')]=_[_0x78ca('0x30')](db[_0x78ca('0x2a')][_0x78ca('0x2b')]);_0x1555fd['query']=_[_0x78ca('0x30')](_0x52ff40['query']);_0x1555fd[_0x78ca('0x31')]=_['intersection'](_0x1555fd[_0x78ca('0x2f')],_0x1555fd[_0x78ca('0x35')]);_0x56e17c[_0x78ca('0x33')]=_['intersection'](_0x1555fd[_0x78ca('0x2f')],qs[_0x78ca('0x34')](_0x52ff40[_0x78ca('0x35')][_0x78ca('0x34')]));_0x56e17c[_0x78ca('0x33')]=_0x56e17c[_0x78ca('0x33')][_0x78ca('0x36')]?_0x56e17c[_0x78ca('0x33')]:_0x1555fd['model'];if(_0x52ff40['query']['includeAll']){_0x56e17c['include']=[{'all':!![]}];}_0x56e17c=_[_0x78ca('0x3d')]({},_0x56e17c,_0x52ff40[_0x78ca('0x3f')]);return db[_0x78ca('0x2a')][_0x78ca('0x44')](_0x56e17c)[_0x78ca('0x22')](handleEntityNotFound(_0x428a4a,null))[_0x78ca('0x22')](respondWithResult(_0x428a4a,null))[_0x78ca('0x45')](handleError(_0x428a4a,null));};exports['create']=function(_0x360141,_0x1e4fff){return db[_0x78ca('0x2a')][_0x78ca('0x46')](_0x360141[_0x78ca('0x47')],{})[_0x78ca('0x22')](respondWithResult(_0x1e4fff,0xc9))['catch'](handleError(_0x1e4fff,null));};exports[_0x78ca('0x48')]=function(_0x32f41c,_0x414603){return db[_0x78ca('0x2a')][_0x78ca('0x48')](_0x32f41c[_0x78ca('0x47')],{'raw':![],'individualHooks':!![]})[_0x78ca('0x22')](respondWithResult(_0x414603,0xc9))[_0x78ca('0x45')](handleError(_0x414603,null));};exports['update']=function(_0x2dfa36,_0x5884f2){if(_0x2dfa36[_0x78ca('0x47')]['id']){delete _0x2dfa36[_0x78ca('0x47')]['id'];}return db[_0x78ca('0x2a')][_0x78ca('0x44')]({'where':{'id':_0x2dfa36[_0x78ca('0x43')]['id']}})[_0x78ca('0x22')](handleEntityNotFound(_0x5884f2,null))[_0x78ca('0x22')](saveUpdates(_0x2dfa36[_0x78ca('0x47')],null))[_0x78ca('0x22')](respondWithResult(_0x5884f2,null))[_0x78ca('0x45')](handleError(_0x5884f2,null));};exports[_0x78ca('0x23')]=function(_0x1a69dd,_0x5a4ae3){return db[_0x78ca('0x2a')]['find']({'where':{'id':_0x1a69dd[_0x78ca('0x43')]['id']}})['then'](handleEntityNotFound(_0x5a4ae3,null))['then'](removeEntity(_0x5a4ae3,null))[_0x78ca('0x45')](handleError(_0x5a4ae3,null));};exports[_0x78ca('0x49')]=function(_0x5881ad,_0x323091){return db[_0x78ca('0x2a')]['destroy']({'where':{'id':_0x5881ad[_0x78ca('0x35')][_0x78ca('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x323091,0xcc))['catch'](handleError(_0x323091,null));};exports['addFields']=function(_0x5898a5,_0x5c008b,_0x1945a3){return db[_0x78ca('0x4b')]['findOne']({'where':{'id':_0x5898a5[_0x78ca('0x43')]['id']}})[_0x78ca('0x22')](handleEntityNotFound(_0x5c008b,null))[_0x78ca('0x22')](function(_0x141607){if(_0x141607){return db[_0x78ca('0x4c')][_0x78ca('0x4d')](function(_0x514753){return db[_0x78ca('0x2a')][_0x78ca('0x23')]({'where':{'CustomReportId':_0x5898a5[_0x78ca('0x43')]['id']},'transaction':_0x514753})[_0x78ca('0x22')](function(_0xefb957){var _0x279583=_[_0x78ca('0x29')](_0x5898a5[_0x78ca('0x47')],function(_0x1da465){delete _0x1da465['id'];_0x1da465['CustomReportId']=_0x5898a5[_0x78ca('0x43')]['id'];return _0x1da465;});return db[_0x78ca('0x2a')][_0x78ca('0x48')](_0x279583,{'transaction':_0x514753});});})[_0x78ca('0x22')](function(){return db[_0x78ca('0x2a')]['findAll']({'where':{'CustomReportId':_0x5898a5[_0x78ca('0x43')]['id']}});});}})['then'](respondWithResult(_0x5c008b,null))[_0x78ca('0x45')](handleError(_0x5c008b,null));};
\ No newline at end of file
+var _0x0a0d=['sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','AnalyticFieldReport','include','findAll','rows','show','params','includeAll','merge','options','find','create','body','catch','bulkCreate','destroy','bulkDestroy','ids','addFields','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x2d22dd,_0x9ff970){var _0x260e94=function(_0x234403){while(--_0x234403){_0x2d22dd['push'](_0x2d22dd['shift']());}};_0x260e94(++_0x9ff970);}(_0x0a0d,0x1ce));var _0xd0a0=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0x0a0d[_0x1f44e4];return _0x591989;};'use strict';var emlformat=require(_0xd0a0('0x0'));var rimraf=require(_0xd0a0('0x1'));var zipdir=require(_0xd0a0('0x2'));var jsonpatch=require(_0xd0a0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd0a0('0x4'));var Mustache=require(_0xd0a0('0x5'));var util=require(_0xd0a0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd0a0('0x7'));var ejs=require(_0xd0a0('0x8'));var fs=require('fs');var fs_extra=require(_0xd0a0('0x9'));var _=require(_0xd0a0('0xa'));var squel=require(_0xd0a0('0xb'));var crypto=require('crypto');var jsforce=require(_0xd0a0('0xc'));var deskjs=require(_0xd0a0('0xd'));var toCsv=require(_0xd0a0('0x7'));var querystring=require(_0xd0a0('0xe'));var Papa=require(_0xd0a0('0xf'));var Redis=require(_0xd0a0('0x10'));var authService=require(_0xd0a0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd0a0('0x12'));var hardwareService=require(_0xd0a0('0x13'));var logger=require(_0xd0a0('0x14'))('api');var utils=require(_0xd0a0('0x15'));var config=require(_0xd0a0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd0a0('0x17'))['db'];function respondWithStatusCode(_0x14add0,_0x4ade9){_0x4ade9=_0x4ade9||0xcc;return function(_0x3f17f1){if(_0x3f17f1){return _0x14add0[_0xd0a0('0x18')](_0x4ade9);}return _0x14add0['status'](_0x4ade9)[_0xd0a0('0x19')]();};}function respondWithResult(_0x22508f,_0x3236cc){_0x3236cc=_0x3236cc||0xc8;return function(_0x3aa034){if(_0x3aa034){return _0x22508f[_0xd0a0('0x1a')](_0x3236cc)[_0xd0a0('0x1b')](_0x3aa034);}};}function respondWithFilteredResult(_0x343e04,_0x20a083){return function(_0x5433ed){if(_0x5433ed){var _0x49b431=typeof _0x20a083[_0xd0a0('0x1c')]==='undefined'&&typeof _0x20a083['limit']===_0xd0a0('0x1d');var _0x4cc53e=_0x5433ed[_0xd0a0('0x1e')];var _0x272399=_0x49b431?0x0:_0x20a083[_0xd0a0('0x1c')];var _0x481f84=_0x49b431?_0x5433ed['count']:_0x20a083[_0xd0a0('0x1c')]+_0x20a083[_0xd0a0('0x1f')];var _0x4f2e69;if(_0x481f84>=_0x4cc53e){_0x481f84=_0x4cc53e;_0x4f2e69=0xc8;}else{_0x4f2e69=0xce;}_0x343e04['status'](_0x4f2e69);return _0x343e04['set'](_0xd0a0('0x20'),_0x272399+'-'+_0x481f84+'/'+_0x4cc53e)[_0xd0a0('0x1b')](_0x5433ed);}return null;};}function patchUpdates(_0x109585){return function(_0x4c2e3d){try{jsonpatch[_0xd0a0('0x21')](_0x4c2e3d,_0x109585,!![]);}catch(_0x332915){return BPromise[_0xd0a0('0x22')](_0x332915);}return _0x4c2e3d[_0xd0a0('0x23')]();};}function saveUpdates(_0x26bfc6,_0x3fc504){return function(_0x228e4e){if(_0x228e4e){return _0x228e4e[_0xd0a0('0x24')](_0x26bfc6)[_0xd0a0('0x25')](function(_0x31d554){return _0x31d554;});}return null;};}function removeEntity(_0x147821,_0x23c008){return function(_0x36893a){if(_0x36893a){return _0x36893a['destroy']()[_0xd0a0('0x25')](function(){_0x147821['status'](0xcc)[_0xd0a0('0x19')]();});}};}function handleEntityNotFound(_0x4d9085,_0x5823c9){return function(_0x466d96){if(!_0x466d96){_0x4d9085[_0xd0a0('0x18')](0x194);}return _0x466d96;};}function handleError(_0x13d557,_0x3ee23f){_0x3ee23f=_0x3ee23f||0x1f4;return function(_0x4400cd){logger[_0xd0a0('0x26')](_0x4400cd[_0xd0a0('0x27')]);if(_0x4400cd[_0xd0a0('0x28')]){delete _0x4400cd[_0xd0a0('0x28')];}_0x13d557[_0xd0a0('0x1a')](_0x3ee23f)[_0xd0a0('0x29')](_0x4400cd);};}exports[_0xd0a0('0x2a')]=function(_0x2edcbc,_0x1580e5){var _0x4df364={},_0x445eaf={},_0x137f13={'count':0x0,'rows':[]};var _0x43041f=_[_0xd0a0('0x2b')](db['AnalyticFieldReport'][_0xd0a0('0x2c')],function(_0x1d1d53){return{'name':_0x1d1d53[_0xd0a0('0x2d')],'type':_0x1d1d53[_0xd0a0('0x2e')]['key']};});_0x445eaf[_0xd0a0('0x2f')]=_[_0xd0a0('0x2b')](_0x43041f,'name');_0x445eaf[_0xd0a0('0x30')]=_[_0xd0a0('0x31')](_0x2edcbc[_0xd0a0('0x30')]);_0x445eaf[_0xd0a0('0x32')]=_[_0xd0a0('0x33')](_0x445eaf[_0xd0a0('0x2f')],_0x445eaf['query']);_0x4df364[_0xd0a0('0x34')]=_[_0xd0a0('0x33')](_0x445eaf[_0xd0a0('0x2f')],qs['fields'](_0x2edcbc[_0xd0a0('0x30')][_0xd0a0('0x35')]));_0x4df364[_0xd0a0('0x34')]=_0x4df364['attributes']['length']?_0x4df364[_0xd0a0('0x34')]:_0x445eaf[_0xd0a0('0x2f')];if(!_0x2edcbc[_0xd0a0('0x30')][_0xd0a0('0x36')]('nolimit')){_0x4df364[_0xd0a0('0x1f')]=qs[_0xd0a0('0x1f')](_0x2edcbc['query'][_0xd0a0('0x1f')]);_0x4df364[_0xd0a0('0x1c')]=qs[_0xd0a0('0x1c')](_0x2edcbc['query'][_0xd0a0('0x1c')]);}_0x4df364[_0xd0a0('0x37')]=qs[_0xd0a0('0x38')](_0x2edcbc[_0xd0a0('0x30')][_0xd0a0('0x38')]);_0x4df364[_0xd0a0('0x39')]=qs['filters'](_[_0xd0a0('0x3a')](_0x2edcbc[_0xd0a0('0x30')],_0x445eaf[_0xd0a0('0x32')]),_0x43041f);if(_0x2edcbc[_0xd0a0('0x30')][_0xd0a0('0x3b')]){_0x4df364[_0xd0a0('0x39')]=_['merge'](_0x4df364[_0xd0a0('0x39')],{'$or':_[_0xd0a0('0x2b')](_0x43041f,function(_0x319c5d){if(_0x319c5d[_0xd0a0('0x2e')]!=='VIRTUAL'){var _0xc90d01={};_0xc90d01[_0x319c5d['name']]={'$like':'%'+_0x2edcbc['query'][_0xd0a0('0x3b')]+'%'};return _0xc90d01;}})});}_0x4df364=_['merge']({},_0x4df364,_0x2edcbc['options']);var _0x59bd8a={'where':_0x4df364[_0xd0a0('0x39')]};return db[_0xd0a0('0x3c')][_0xd0a0('0x1e')](_0x59bd8a)[_0xd0a0('0x25')](function(_0x41e7b9){_0x137f13[_0xd0a0('0x1e')]=_0x41e7b9;if(_0x2edcbc[_0xd0a0('0x30')]['includeAll']){_0x4df364[_0xd0a0('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xd0a0('0x3e')](_0x4df364);})[_0xd0a0('0x25')](function(_0x363a2f){_0x137f13[_0xd0a0('0x3f')]=_0x363a2f;return _0x137f13;})[_0xd0a0('0x25')](respondWithFilteredResult(_0x1580e5,_0x4df364))['catch'](handleError(_0x1580e5,null));};exports[_0xd0a0('0x40')]=function(_0x28c83a,_0xeced8d){var _0x3e03ac={'raw':![],'where':{'id':_0x28c83a[_0xd0a0('0x41')]['id']}},_0x8d66ce={};_0x8d66ce[_0xd0a0('0x2f')]=_[_0xd0a0('0x31')](db[_0xd0a0('0x3c')][_0xd0a0('0x2c')]);_0x8d66ce[_0xd0a0('0x30')]=_[_0xd0a0('0x31')](_0x28c83a['query']);_0x8d66ce['filters']=_[_0xd0a0('0x33')](_0x8d66ce[_0xd0a0('0x2f')],_0x8d66ce['query']);_0x3e03ac[_0xd0a0('0x34')]=_[_0xd0a0('0x33')](_0x8d66ce[_0xd0a0('0x2f')],qs['fields'](_0x28c83a[_0xd0a0('0x30')]['fields']));_0x3e03ac[_0xd0a0('0x34')]=_0x3e03ac[_0xd0a0('0x34')]['length']?_0x3e03ac['attributes']:_0x8d66ce[_0xd0a0('0x2f')];if(_0x28c83a['query'][_0xd0a0('0x42')]){_0x3e03ac[_0xd0a0('0x3d')]=[{'all':!![]}];}_0x3e03ac=_[_0xd0a0('0x43')]({},_0x3e03ac,_0x28c83a[_0xd0a0('0x44')]);return db[_0xd0a0('0x3c')][_0xd0a0('0x45')](_0x3e03ac)[_0xd0a0('0x25')](handleEntityNotFound(_0xeced8d,null))['then'](respondWithResult(_0xeced8d,null))['catch'](handleError(_0xeced8d,null));};exports[_0xd0a0('0x46')]=function(_0x2fffc5,_0x31a259){return db[_0xd0a0('0x3c')][_0xd0a0('0x46')](_0x2fffc5[_0xd0a0('0x47')],{})[_0xd0a0('0x25')](respondWithResult(_0x31a259,0xc9))[_0xd0a0('0x48')](handleError(_0x31a259,null));};exports[_0xd0a0('0x49')]=function(_0x1c0c47,_0x39e4fd){return db[_0xd0a0('0x3c')][_0xd0a0('0x49')](_0x1c0c47[_0xd0a0('0x47')],{'raw':![],'individualHooks':!![]})[_0xd0a0('0x25')](respondWithResult(_0x39e4fd,0xc9))[_0xd0a0('0x48')](handleError(_0x39e4fd,null));};exports[_0xd0a0('0x24')]=function(_0x417f33,_0x349dce){if(_0x417f33[_0xd0a0('0x47')]['id']){delete _0x417f33['body']['id'];}return db[_0xd0a0('0x3c')]['find']({'where':{'id':_0x417f33['params']['id']}})[_0xd0a0('0x25')](handleEntityNotFound(_0x349dce,null))['then'](saveUpdates(_0x417f33[_0xd0a0('0x47')],null))[_0xd0a0('0x25')](respondWithResult(_0x349dce,null))[_0xd0a0('0x48')](handleError(_0x349dce,null));};exports[_0xd0a0('0x4a')]=function(_0x620a96,_0x266424){return db['AnalyticFieldReport'][_0xd0a0('0x45')]({'where':{'id':_0x620a96['params']['id']}})[_0xd0a0('0x25')](handleEntityNotFound(_0x266424,null))[_0xd0a0('0x25')](removeEntity(_0x266424,null))[_0xd0a0('0x48')](handleError(_0x266424,null));};exports[_0xd0a0('0x4b')]=function(_0x3d5e4c,_0x967b40){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x3d5e4c[_0xd0a0('0x30')][_0xd0a0('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x967b40,0xcc))['catch'](handleError(_0x967b40,null));};exports[_0xd0a0('0x4d')]=function(_0x169db9,_0x2504cc,_0x14d19d){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x169db9['params']['id']}})[_0xd0a0('0x25')](handleEntityNotFound(_0x2504cc,null))['then'](function(_0x2deabd){if(_0x2deabd){return db[_0xd0a0('0x4e')][_0xd0a0('0x4f')](function(_0x5c5048){return db[_0xd0a0('0x3c')][_0xd0a0('0x4a')]({'where':{'CustomReportId':_0x169db9[_0xd0a0('0x41')]['id']},'transaction':_0x5c5048})[_0xd0a0('0x25')](function(_0x2fc9ae){var _0x252a67=_['map'](_0x169db9[_0xd0a0('0x47')],function(_0x59c219){delete _0x59c219['id'];_0x59c219[_0xd0a0('0x50')]=_0x169db9['params']['id'];return _0x59c219;});return db[_0xd0a0('0x3c')][_0xd0a0('0x49')](_0x252a67,{'transaction':_0x5c5048});});})[_0xd0a0('0x25')](function(){return db[_0xd0a0('0x3c')][_0xd0a0('0x3e')]({'where':{'CustomReportId':_0x169db9[_0xd0a0('0x41')]['id']}});});}})[_0xd0a0('0x25')](respondWithResult(_0x2504cc,null))[_0xd0a0('0x48')](handleError(_0x2504cc,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index fad0012..9fdc516 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.model.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5465=['exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','rimraf','../../config/environment'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x5465,0x1aa));var _0x5546=function(_0x155b18,_0x1b209c){_0x155b18=_0x155b18-0x0;var _0x52aeac=_0x5465[_0x155b18];return _0x52aeac;};'use strict';var _=require(_0x5546('0x0'));var util=require(_0x5546('0x1'));var logger=require(_0x5546('0x2'))('api');var moment=require(_0x5546('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5546('0x4'));var config=require(_0x5546('0x5'));var attributes=require('./analyticFieldReport.attributes');module[_0x5546('0x6')]=function(_0x559dfa,_0xb17308){return _0x559dfa['define'](_0x5546('0x7'),attributes,{'tableName':_0x5546('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8a2b=['bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','util','../../config/logger','api','moment'];(function(_0x51cc24,_0x4ff185){var _0x2656b9=function(_0x2438e6){while(--_0x2438e6){_0x51cc24['push'](_0x51cc24['shift']());}};_0x2656b9(++_0x4ff185);}(_0x8a2b,0x140));var _0xb8a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a2b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8a2('0x0'));var util=require(_0xb8a2('0x1'));var logger=require(_0xb8a2('0x2'))(_0xb8a2('0x3'));var moment=require(_0xb8a2('0x4'));var BPromise=require(_0xb8a2('0x5'));var rp=require(_0xb8a2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb8a2('0x7'));var config=require(_0xb8a2('0x8'));var attributes=require(_0xb8a2('0x9'));module[_0xb8a2('0xa')]=function(_0x57418d,_0x3e5d15){return _0x57418d[_0xb8a2('0xb')]('AnalyticFieldReport',attributes,{'tableName':_0xb8a2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 9e88ca6..8ea1ffb 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3897=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3fa911,_0x4618a6){var _0x1059e5=function(_0x144c36){while(--_0x144c36){_0x3fa911['push'](_0x3fa911['shift']());}};_0x1059e5(++_0x4618a6);}(_0x3897,0x103));var _0x7389=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x3897[_0x5b7788];return _0x573871;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7389('0x0'));var BPromise=require('bluebird');var rs=require(_0x7389('0x1'));var fs=require('fs');var Redis=require(_0x7389('0x2'));var db=require(_0x7389('0x3'))['db'];var utils=require(_0x7389('0x4'));var logger=require(_0x7389('0x5'))(_0x7389('0x6'));var config=require('../../config/environment');var jayson=require(_0x7389('0x7'));var client=jayson[_0x7389('0x8')][_0x7389('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x174d84,_0x4c7e6c,_0x2ad31c){return new BPromise(function(_0xdd4899,_0x391886){return client[_0x7389('0xa')](_0x174d84,_0x2ad31c)[_0x7389('0xb')](function(_0x2a9ec4){logger[_0x7389('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4c7e6c,_0x7389('0xd'));logger[_0x7389('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4c7e6c,'request\x20sent',JSON[_0x7389('0xf')](_0x2a9ec4));if(_0x2a9ec4[_0x7389('0x10')]){if(_0x2a9ec4['error'][_0x7389('0x11')]===0x1f4){logger[_0x7389('0x10')](_0x7389('0x12'),_0x4c7e6c,_0x2a9ec4[_0x7389('0x10')]['message']);return _0x391886(_0x2a9ec4[_0x7389('0x10')][_0x7389('0x13')]);}logger[_0x7389('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4c7e6c,_0x2a9ec4[_0x7389('0x10')][_0x7389('0x13')]);return _0xdd4899(_0x2a9ec4['error'][_0x7389('0x13')]);}else{logger[_0x7389('0xc')](_0x7389('0x12'),_0x4c7e6c,_0x7389('0xd'));_0xdd4899(_0x2a9ec4[_0x7389('0x14')]['message']);}})[_0x7389('0x15')](function(_0x46ce7){logger[_0x7389('0x10')](_0x7389('0x12'),_0x4c7e6c,_0x46ce7);_0x391886(_0x46ce7);});});}
\ No newline at end of file
+var _0x0294=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x586a8a,_0x1ed840){var _0x4fb71d=function(_0x311e85){while(--_0x311e85){_0x586a8a['push'](_0x586a8a['shift']());}};_0x4fb71d(++_0x1ed840);}(_0x0294,0x9c));var _0x4029=function(_0x4c4428,_0xf19bb0){_0x4c4428=_0x4c4428-0x0;var _0x275e73=_0x0294[_0x4c4428];return _0x275e73;};'use strict';var _=require(_0x4029('0x0'));var util=require(_0x4029('0x1'));var moment=require(_0x4029('0x2'));var BPromise=require(_0x4029('0x3'));var rs=require(_0x4029('0x4'));var fs=require('fs');var Redis=require(_0x4029('0x5'));var db=require(_0x4029('0x6'))['db'];var utils=require(_0x4029('0x7'));var logger=require('../../config/logger')(_0x4029('0x8'));var config=require(_0x4029('0x9'));var jayson=require(_0x4029('0xa'));var client=jayson[_0x4029('0xb')][_0x4029('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d4f17,_0x163d39,_0x438e98){return new BPromise(function(_0x1a4818,_0x36c43){return client['request'](_0x1d4f17,_0x438e98)[_0x4029('0xd')](function(_0x28f0a0){logger[_0x4029('0xe')](_0x4029('0xf'),_0x163d39,_0x4029('0x10'));logger[_0x4029('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x163d39,_0x4029('0x10'),JSON[_0x4029('0x12')](_0x28f0a0));if(_0x28f0a0[_0x4029('0x13')]){if(_0x28f0a0['error'][_0x4029('0x14')]===0x1f4){logger[_0x4029('0x13')](_0x4029('0xf'),_0x163d39,_0x28f0a0[_0x4029('0x13')][_0x4029('0x15')]);return _0x36c43(_0x28f0a0[_0x4029('0x13')][_0x4029('0x15')]);}logger[_0x4029('0x13')](_0x4029('0xf'),_0x163d39,_0x28f0a0['error'][_0x4029('0x15')]);return _0x1a4818(_0x28f0a0[_0x4029('0x13')]['message']);}else{logger[_0x4029('0xe')](_0x4029('0xf'),_0x163d39,'request\x20sent');_0x1a4818(_0x28f0a0[_0x4029('0x16')][_0x4029('0x15')]);}})['catch'](function(_0x25270d){logger[_0x4029('0x13')](_0x4029('0xf'),_0x163d39,_0x25270d);_0x36c43(_0x25270d);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 9f227ec..45c9d59 100644
--- a/server/api/analyticFieldReport/index.js
+++ b/server/api/analyticFieldReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x108710,_0x382c40){var _0x4d6483=function(_0xbc5a9b){while(--_0xbc5a9b){_0x108710['push'](_0x108710['shift']());}};_0x4d6483(++_0x382c40);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x52224b,_0x5d5d40){var _0x25ec5e=function(_0x1aa21c){while(--_0x1aa21c){_0x52224b['push'](_0x52224b['shift']());}};_0x25ec5e(++_0x5d5d40);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index e374493..28c3f52 100644
--- a/server/api/analyticMetric/analyticMetric.attributes.js
+++ b/server/api/analyticMetric/analyticMetric.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa571=['STRING','name','TEXT','sequelize','exports'];(function(_0x1d2adf,_0x8b056f){var _0x431bd7=function(_0x2785a7){while(--_0x2785a7){_0x1d2adf['push'](_0x1d2adf['shift']());}};_0x431bd7(++_0x8b056f);}(_0xa571,0x107));var _0x1a57=function(_0x200131,_0x4041e5){_0x200131=_0x200131-0x0;var _0x1f87f2=_0xa571[_0x200131];return _0x1f87f2;};'use strict';var Sequelize=require(_0x1a57('0x0'));module[_0x1a57('0x1')]={'name':{'type':Sequelize[_0x1a57('0x2')],'allowNull':![],'unique':_0x1a57('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1a57('0x4')]},'description':{'type':Sequelize[_0x1a57('0x2')]}};
\ No newline at end of file
+var _0xb9a7=['exports','TEXT'];(function(_0x18c326,_0x42e955){var _0x22eb44=function(_0xc20de9){while(--_0xc20de9){_0x18c326['push'](_0x18c326['shift']());}};_0x22eb44(++_0x42e955);}(_0xb9a7,0x112));var _0x7b9a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xb9a7[_0x342baa];return _0x1208f3;};'use strict';var Sequelize=require('sequelize');module[_0x7b9a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x7b9a('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 2a4a0a5..e0b45bd 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x13d356,_0x300946){var _0x307728=function(_0xef4834){while(--_0xef4834){_0x13d356['push'](_0x13d356['shift']());}};_0x307728(++_0x300946);}(_0x55ca,0x126));var _0xa55c=function(_0x32f38b,_0x1b4fc7){_0x32f38b=_0x32f38b-0x0;var _0x15ec9b=_0x55ca[_0x32f38b];return _0x15ec9b;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
+var _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x1d082c,_0xe33399){var _0x135ef2=function(_0x239eb5){while(--_0x239eb5){_0x1d082c['push'](_0x1d082c['shift']());}};_0x135ef2(++_0xe33399);}(_0x98a8,0x12c));var _0x898a=function(_0x47138d,_0x444fc8){_0x47138d=_0x47138d-0x0;var _0x486875=_0x98a8[_0x47138d];return _0x486875;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 601743f..568050f 100644
--- a/server/api/analyticMetric/analyticMetric.model.js
+++ b/server/api/analyticMetric/analyticMetric.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaf1b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','lodash','util','../../config/logger','api'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xaf1b,0x11a));var _0xbaf1=function(_0xfad108,_0x1f02b5){_0xfad108=_0xfad108-0x0;var _0x2efce9=_0xaf1b[_0xfad108];return _0x2efce9;};'use strict';var _=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var logger=require(_0xbaf1('0x2'))(_0xbaf1('0x3'));var moment=require(_0xbaf1('0x4'));var BPromise=require(_0xbaf1('0x5'));var rp=require(_0xbaf1('0x6'));var fs=require('fs');var path=require(_0xbaf1('0x7'));var rimraf=require(_0xbaf1('0x8'));var config=require(_0xbaf1('0x9'));var attributes=require(_0xbaf1('0xa'));module[_0xbaf1('0xb')]=function(_0x7dd657,_0x2f05ad){return _0x7dd657['define'](_0xbaf1('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x90b1=['define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x559702,_0x2fa1a9){var _0x25a86b=function(_0x1fb936){while(--_0x1fb936){_0x559702['push'](_0x559702['shift']());}};_0x25a86b(++_0x2fa1a9);}(_0x90b1,0x1bb));var _0x190b=function(_0x229564,_0x5e5fc6){_0x229564=_0x229564-0x0;var _0x5c8aaf=_0x90b1[_0x229564];return _0x5c8aaf;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index f96418f..a1d89ab 100644
--- a/server/api/analyticMetric/analyticMetric.rpc.js
+++ b/server/api/analyticMetric/analyticMetric.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0ec1=['http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x0ec1,0x18a));var _0x10ec=function(_0x170504,_0x26d44d){_0x170504=_0x170504-0x0;var _0x848214=_0x0ec1[_0x170504];return _0x848214;};'use strict';var _=require(_0x10ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x10ec('0x1'));var rs=require(_0x10ec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x10ec('0x3'))('rpc');var config=require(_0x10ec('0x4'));var jayson=require(_0x10ec('0x5'));var client=jayson['client'][_0x10ec('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4ef4a3,_0x32b345,_0x14fa91){return new BPromise(function(_0x1ea0fb,_0x88b0fc){return client[_0x10ec('0x7')](_0x4ef4a3,_0x14fa91)[_0x10ec('0x8')](function(_0x5bd0ab){logger[_0x10ec('0x9')](_0x10ec('0xa'),_0x32b345,'request\x20sent');logger[_0x10ec('0xb')](_0x10ec('0xc'),_0x32b345,_0x10ec('0xd'),JSON[_0x10ec('0xe')](_0x5bd0ab));if(_0x5bd0ab[_0x10ec('0xf')]){if(_0x5bd0ab[_0x10ec('0xf')][_0x10ec('0x10')]===0x1f4){logger[_0x10ec('0xf')](_0x10ec('0xa'),_0x32b345,_0x5bd0ab[_0x10ec('0xf')][_0x10ec('0x11')]);return _0x88b0fc(_0x5bd0ab[_0x10ec('0xf')][_0x10ec('0x11')]);}logger[_0x10ec('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x32b345,_0x5bd0ab[_0x10ec('0xf')]['message']);return _0x1ea0fb(_0x5bd0ab[_0x10ec('0xf')][_0x10ec('0x11')]);}else{logger[_0x10ec('0x9')](_0x10ec('0xa'),_0x32b345,'request\x20sent');_0x1ea0fb(_0x5bd0ab[_0x10ec('0x12')]['message']);}})[_0x10ec('0x13')](function(_0x23174b){logger[_0x10ec('0xf')](_0x10ec('0xa'),_0x32b345,_0x23174b);_0x88b0fc(_0x23174b);});});}
\ No newline at end of file
+var _0x5fe7=['../../config/utils','../../config/logger','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x23ac72,_0x14386b){var _0xee2497=function(_0x201692){while(--_0x201692){_0x23ac72['push'](_0x23ac72['shift']());}};_0xee2497(++_0x14386b);}(_0x5fe7,0xa8));var _0x75fe=function(_0x454383,_0x9883dc){_0x454383=_0x454383-0x0;var _0x582724=_0x5fe7[_0x454383];return _0x582724;};'use strict';var _=require('lodash');var util=require(_0x75fe('0x0'));var moment=require(_0x75fe('0x1'));var BPromise=require(_0x75fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x75fe('0x3'));var logger=require(_0x75fe('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x75fe('0x5'));var client=jayson[_0x75fe('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e19d7,_0x190732,_0x11bf61){return new BPromise(function(_0x243689,_0x4967da){return client[_0x75fe('0x7')](_0x4e19d7,_0x11bf61)[_0x75fe('0x8')](function(_0xfa2f67){logger[_0x75fe('0x9')](_0x75fe('0xa'),_0x190732,_0x75fe('0xb'));logger[_0x75fe('0xc')](_0x75fe('0xd'),_0x190732,_0x75fe('0xb'),JSON[_0x75fe('0xe')](_0xfa2f67));if(_0xfa2f67[_0x75fe('0xf')]){if(_0xfa2f67[_0x75fe('0xf')][_0x75fe('0x10')]===0x1f4){logger[_0x75fe('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x190732,_0xfa2f67[_0x75fe('0xf')]['message']);return _0x4967da(_0xfa2f67['error']['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x190732,_0xfa2f67[_0x75fe('0xf')][_0x75fe('0x11')]);return _0x243689(_0xfa2f67[_0x75fe('0xf')]['message']);}else{logger['info'](_0x75fe('0xa'),_0x190732,_0x75fe('0xb'));_0x243689(_0xfa2f67['result'][_0x75fe('0x11')]);}})[_0x75fe('0x12')](function(_0x3ede77){logger['error'](_0x75fe('0xa'),_0x190732,_0x3ede77);_0x4967da(_0x3ede77);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 1cd23ca..22acfbf 100644
--- a/server/api/analyticMetric/index.js
+++ b/server/api/analyticMetric/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5502=['create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','show','post'];(function(_0x325688,_0x3a55bd){var _0x588277=function(_0x32b3db){while(--_0x32b3db){_0x325688['push'](_0x325688['shift']());}};_0x588277(++_0x3a55bd);}(_0x5502,0x69));var _0x2550=function(_0x5be9a6,_0x1df31c){_0x5be9a6=_0x5be9a6-0x0;var _0x5dd8e1=_0x5502[_0x5be9a6];return _0x5dd8e1;};'use strict';var multer=require(_0x2550('0x0'));var util=require(_0x2550('0x1'));var path=require(_0x2550('0x2'));var timeout=require(_0x2550('0x3'));var express=require(_0x2550('0x4'));var router=express[_0x2550('0x5')]();var fs_extra=require(_0x2550('0x6'));var auth=require(_0x2550('0x7'));var interaction=require(_0x2550('0x8'));var config=require(_0x2550('0x9'));var controller=require(_0x2550('0xa'));router[_0x2550('0xb')]('/',auth[_0x2550('0xc')](),controller['index']);router[_0x2550('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x2550('0xd')]);router[_0x2550('0xe')]('/',auth['isAuthenticated'](),controller[_0x2550('0xf')]);router['put'](_0x2550('0x10'),auth[_0x2550('0xc')](),controller[_0x2550('0x11')]);router[_0x2550('0x12')](_0x2550('0x10'),auth[_0x2550('0xc')](),controller['destroy']);module[_0x2550('0x13')]=router;
\ No newline at end of file
+var _0xf698=['get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x8800fa,_0x4c1902){var _0x2e4faf=function(_0xa5da1f){while(--_0xa5da1f){_0x8800fa['push'](_0x8800fa['shift']());}};_0x2e4faf(++_0x4c1902);}(_0xf698,0x1de));var _0x8f69=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0xf698[_0x5ad07c];return _0x204bae;};'use strict';var multer=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var path=require('path');var timeout=require(_0x8f69('0x2'));var express=require(_0x8f69('0x3'));var router=express['Router']();var fs_extra=require(_0x8f69('0x4'));var auth=require(_0x8f69('0x5'));var interaction=require(_0x8f69('0x6'));var config=require(_0x8f69('0x7'));var controller=require('./analyticMetric.controller');router[_0x8f69('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8f69('0x9'),auth[_0x8f69('0xa')](),controller[_0x8f69('0xb')]);router[_0x8f69('0xc')]('/',auth[_0x8f69('0xa')](),controller[_0x8f69('0xd')]);router[_0x8f69('0xe')](_0x8f69('0x9'),auth[_0x8f69('0xa')](),controller[_0x8f69('0xf')]);router[_0x8f69('0x10')](_0x8f69('0x9'),auth['isAuthenticated'](),controller[_0x8f69('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 25d9ab6..796d033 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9d4a=['exports','sequelize'];(function(_0x4f8a7b,_0x4f9ea9){var _0x525fd3=function(_0x101c79){while(--_0x101c79){_0x4f8a7b['push'](_0x4f8a7b['shift']());}};_0x525fd3(++_0x4f9ea9);}(_0x9d4a,0x197));var _0xa9d4=function(_0x47f48b,_0x2048d8){_0x47f48b=_0x47f48b-0x0;var _0x19c0ed=_0x9d4a[_0x47f48b];return _0x19c0ed;};'use strict';var Sequelize=require(_0xa9d4('0x0'));module[_0xa9d4('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xce9d=['sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xce9d,0x1f0));var _0xdce9=function(_0xc39c0c,_0x15827b){_0xc39c0c=_0xc39c0c-0x0;var _0x12cddf=_0xce9d[_0xc39c0c];return _0x12cddf;};'use strict';var Sequelize=require(_0xdce9('0x0'));module[_0xdce9('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 6b5b01e..9ad7136 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.controller.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbdae=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','map','AnalyticTreeReport','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js'];(function(_0x38d99c,_0x584720){var _0x58d58e=function(_0x2b15cc){while(--_0x2b15cc){_0x38d99c['push'](_0x38d99c['shift']());}};_0x58d58e(++_0x584720);}(_0xbdae,0x1be));var _0xebda=function(_0x5ded2a,_0x2b3e6a){_0x5ded2a=_0x5ded2a-0x0;var _0x403110=_0xbdae[_0x5ded2a];return _0x403110;};'use strict';var emlformat=require(_0xebda('0x0'));var rimraf=require(_0xebda('0x1'));var zipdir=require(_0xebda('0x2'));var jsonpatch=require(_0xebda('0x3'));var rp=require(_0xebda('0x4'));var moment=require(_0xebda('0x5'));var BPromise=require(_0xebda('0x6'));var Mustache=require(_0xebda('0x7'));var util=require('util');var path=require(_0xebda('0x8'));var sox=require(_0xebda('0x9'));var csv=require(_0xebda('0xa'));var ejs=require(_0xebda('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xebda('0xc'));var squel=require(_0xebda('0xd'));var crypto=require(_0xebda('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xebda('0xf'));var toCsv=require('to-csv');var querystring=require(_0xebda('0x10'));var Papa=require(_0xebda('0x11'));var Redis=require(_0xebda('0x12'));var authService=require(_0xebda('0x13'));var qs=require(_0xebda('0x14'));var as=require(_0xebda('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xebda('0x16'));var utils=require(_0xebda('0x17'));var config=require(_0xebda('0x18'));var licenseUtil=require(_0xebda('0x19'));var db=require(_0xebda('0x1a'))['db'];function respondWithStatusCode(_0x16c772,_0x48db6e){_0x48db6e=_0x48db6e||0xcc;return function(_0x2e6a40){if(_0x2e6a40){return _0x16c772[_0xebda('0x1b')](_0x48db6e);}return _0x16c772[_0xebda('0x1c')](_0x48db6e)['end']();};}function respondWithResult(_0xf24900,_0x428ebd){_0x428ebd=_0x428ebd||0xc8;return function(_0x94d8f0){if(_0x94d8f0){return _0xf24900[_0xebda('0x1c')](_0x428ebd)['json'](_0x94d8f0);}};}function respondWithFilteredResult(_0x6ff14c,_0x8f8d0a){return function(_0x33bae1){if(_0x33bae1){var _0x49fa3b=typeof _0x8f8d0a[_0xebda('0x1d')]===_0xebda('0x1e')&&typeof _0x8f8d0a[_0xebda('0x1f')]===_0xebda('0x1e');var _0x3e1971=_0x33bae1[_0xebda('0x20')];var _0x513501=_0x49fa3b?0x0:_0x8f8d0a[_0xebda('0x1d')];var _0x2beb8e=_0x49fa3b?_0x33bae1[_0xebda('0x20')]:_0x8f8d0a['offset']+_0x8f8d0a[_0xebda('0x1f')];var _0x1e7ed9;if(_0x2beb8e>=_0x3e1971){_0x2beb8e=_0x3e1971;_0x1e7ed9=0xc8;}else{_0x1e7ed9=0xce;}_0x6ff14c[_0xebda('0x1c')](_0x1e7ed9);return _0x6ff14c[_0xebda('0x21')](_0xebda('0x22'),_0x513501+'-'+_0x2beb8e+'/'+_0x3e1971)[_0xebda('0x23')](_0x33bae1);}return null;};}function patchUpdates(_0x1866d0){return function(_0x3b1701){try{jsonpatch[_0xebda('0x24')](_0x3b1701,_0x1866d0,!![]);}catch(_0x426311){return BPromise[_0xebda('0x25')](_0x426311);}return _0x3b1701[_0xebda('0x26')]();};}function saveUpdates(_0x352ea5,_0x25c0b3){return function(_0x5e32ad){if(_0x5e32ad){return _0x5e32ad[_0xebda('0x27')](_0x352ea5)[_0xebda('0x28')](function(_0x1bbb38){return _0x1bbb38;});}return null;};}function removeEntity(_0x26d691,_0x45c6a6){return function(_0x329fae){if(_0x329fae){return _0x329fae[_0xebda('0x29')]()[_0xebda('0x28')](function(){_0x26d691[_0xebda('0x1c')](0xcc)[_0xebda('0x2a')]();});}};}function handleEntityNotFound(_0x23415f,_0x1f6b01){return function(_0x3275c6){if(!_0x3275c6){_0x23415f['sendStatus'](0x194);}return _0x3275c6;};}function handleError(_0x4cd486,_0x568447){_0x568447=_0x568447||0x1f4;return function(_0x48499f){logger[_0xebda('0x2b')](_0x48499f[_0xebda('0x2c')]);if(_0x48499f[_0xebda('0x2d')]){delete _0x48499f[_0xebda('0x2d')];}_0x4cd486['status'](_0x568447)['send'](_0x48499f);};}exports['index']=function(_0x53a2aa,_0x561bbc){var _0x15c65b={},_0x46dd9a={},_0x574c1d={'count':0x0,'rows':[]};var _0x3a0480=_[_0xebda('0x2e')](db[_0xebda('0x2f')][_0xebda('0x30')],function(_0x4e1e9a){return{'name':_0x4e1e9a[_0xebda('0x31')],'type':_0x4e1e9a['type']['key']};});_0x46dd9a[_0xebda('0x32')]=_[_0xebda('0x2e')](_0x3a0480,_0xebda('0x2d'));_0x46dd9a['query']=_[_0xebda('0x33')](_0x53a2aa[_0xebda('0x34')]);_0x46dd9a[_0xebda('0x35')]=_[_0xebda('0x36')](_0x46dd9a[_0xebda('0x32')],_0x46dd9a[_0xebda('0x34')]);_0x15c65b[_0xebda('0x37')]=_[_0xebda('0x36')](_0x46dd9a['model'],qs[_0xebda('0x38')](_0x53a2aa[_0xebda('0x34')][_0xebda('0x38')]));_0x15c65b[_0xebda('0x37')]=_0x15c65b['attributes'][_0xebda('0x39')]?_0x15c65b[_0xebda('0x37')]:_0x46dd9a[_0xebda('0x32')];if(!_0x53a2aa['query']['hasOwnProperty'](_0xebda('0x3a'))){_0x15c65b[_0xebda('0x1f')]=qs['limit'](_0x53a2aa[_0xebda('0x34')][_0xebda('0x1f')]);_0x15c65b[_0xebda('0x1d')]=qs[_0xebda('0x1d')](_0x53a2aa['query'][_0xebda('0x1d')]);}_0x15c65b[_0xebda('0x3b')]=qs[_0xebda('0x3c')](_0x53a2aa[_0xebda('0x34')]['sort']);_0x15c65b[_0xebda('0x3d')]=qs[_0xebda('0x35')](_[_0xebda('0x3e')](_0x53a2aa[_0xebda('0x34')],_0x46dd9a[_0xebda('0x35')]),_0x3a0480);if(_0x53a2aa[_0xebda('0x34')][_0xebda('0x3f')]){_0x15c65b[_0xebda('0x3d')]=_[_0xebda('0x40')](_0x15c65b['where'],{'$or':_[_0xebda('0x2e')](_0x3a0480,function(_0x591f90){if(_0x591f90[_0xebda('0x41')]!==_0xebda('0x42')){var _0x480279={};_0x480279[_0x591f90[_0xebda('0x2d')]]={'$like':'%'+_0x53a2aa[_0xebda('0x34')][_0xebda('0x3f')]+'%'};return _0x480279;}})});}_0x15c65b=_[_0xebda('0x40')]({},_0x15c65b,_0x53a2aa['options']);var _0x1a1fb1={'where':_0x15c65b[_0xebda('0x3d')]};return db[_0xebda('0x2f')][_0xebda('0x20')](_0x1a1fb1)['then'](function(_0x295dc7){_0x574c1d[_0xebda('0x20')]=_0x295dc7;if(_0x53a2aa['query'][_0xebda('0x43')]){_0x15c65b[_0xebda('0x44')]=[{'all':!![]}];}return db[_0xebda('0x2f')][_0xebda('0x45')](_0x15c65b);})[_0xebda('0x28')](function(_0x5064d4){_0x574c1d['rows']=_0x5064d4;return _0x574c1d;})[_0xebda('0x28')](respondWithFilteredResult(_0x561bbc,_0x15c65b))[_0xebda('0x46')](handleError(_0x561bbc,null));};exports[_0xebda('0x47')]=function(_0x10cb5d,_0x4fb218){var _0x4e1b0c={'raw':!![],'where':{'id':_0x10cb5d['params']['id']}},_0x4e9830={};_0x4e9830[_0xebda('0x32')]=_[_0xebda('0x33')](db[_0xebda('0x2f')]['rawAttributes']);_0x4e9830[_0xebda('0x34')]=_['keys'](_0x10cb5d[_0xebda('0x34')]);_0x4e9830[_0xebda('0x35')]=_[_0xebda('0x36')](_0x4e9830[_0xebda('0x32')],_0x4e9830[_0xebda('0x34')]);_0x4e1b0c[_0xebda('0x37')]=_['intersection'](_0x4e9830[_0xebda('0x32')],qs[_0xebda('0x38')](_0x10cb5d['query']['fields']));_0x4e1b0c[_0xebda('0x37')]=_0x4e1b0c[_0xebda('0x37')][_0xebda('0x39')]?_0x4e1b0c[_0xebda('0x37')]:_0x4e9830['model'];if(_0x10cb5d[_0xebda('0x34')][_0xebda('0x43')]){_0x4e1b0c[_0xebda('0x44')]=[{'all':!![]}];}_0x4e1b0c=_['merge']({},_0x4e1b0c,_0x10cb5d[_0xebda('0x48')]);return db[_0xebda('0x2f')][_0xebda('0x49')](_0x4e1b0c)['then'](handleEntityNotFound(_0x4fb218,null))[_0xebda('0x28')](respondWithResult(_0x4fb218,null))[_0xebda('0x46')](handleError(_0x4fb218,null));};exports[_0xebda('0x4a')]=function(_0x3e44d1,_0x31645f){return db[_0xebda('0x2f')][_0xebda('0x4a')](_0x3e44d1[_0xebda('0x4b')],{})[_0xebda('0x28')](respondWithResult(_0x31645f,0xc9))[_0xebda('0x46')](handleError(_0x31645f,null));};exports[_0xebda('0x27')]=function(_0x5ce498,_0x224e30){if(_0x5ce498[_0xebda('0x4b')]['id']){delete _0x5ce498[_0xebda('0x4b')]['id'];}return db[_0xebda('0x2f')]['find']({'where':{'id':_0x5ce498[_0xebda('0x4c')]['id']}})[_0xebda('0x28')](handleEntityNotFound(_0x224e30,null))['then'](saveUpdates(_0x5ce498[_0xebda('0x4b')],null))[_0xebda('0x28')](respondWithResult(_0x224e30,null))[_0xebda('0x46')](handleError(_0x224e30,null));};exports[_0xebda('0x29')]=function(_0x59f396,_0x22d3e1){return db[_0xebda('0x2f')][_0xebda('0x49')]({'where':{'id':_0x59f396[_0xebda('0x4c')]['id']}})[_0xebda('0x28')](handleEntityNotFound(_0x22d3e1,null))[_0xebda('0x28')](removeEntity(_0x22d3e1,null))[_0xebda('0x46')](handleError(_0x22d3e1,null));};
\ No newline at end of file
+var _0x9976=['zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','AnalyticTreeReport','rawAttributes','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','catch','show','params','keys','find','create','body','rimraf'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x9976,0x93));var _0x6997=function(_0x1987b2,_0x420228){_0x1987b2=_0x1987b2-0x0;var _0x4659cb=_0x9976[_0x1987b2];return _0x4659cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6997('0x0'));var zipdir=require(_0x6997('0x1'));var jsonpatch=require(_0x6997('0x2'));var rp=require(_0x6997('0x3'));var moment=require(_0x6997('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6997('0x5'));var path=require(_0x6997('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6997('0x7'));var fs=require('fs');var fs_extra=require(_0x6997('0x8'));var _=require(_0x6997('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6997('0xa'));var deskjs=require(_0x6997('0xb'));var toCsv=require(_0x6997('0xc'));var querystring=require(_0x6997('0xd'));var Papa=require(_0x6997('0xe'));var Redis=require(_0x6997('0xf'));var authService=require(_0x6997('0x10'));var qs=require(_0x6997('0x11'));var as=require(_0x6997('0x12'));var hardwareService=require(_0x6997('0x13'));var logger=require(_0x6997('0x14'))(_0x6997('0x15'));var utils=require(_0x6997('0x16'));var config=require(_0x6997('0x17'));var licenseUtil=require(_0x6997('0x18'));var db=require(_0x6997('0x19'))['db'];function respondWithStatusCode(_0x3a54aa,_0x3e9527){_0x3e9527=_0x3e9527||0xcc;return function(_0x1644a0){if(_0x1644a0){return _0x3a54aa[_0x6997('0x1a')](_0x3e9527);}return _0x3a54aa['status'](_0x3e9527)[_0x6997('0x1b')]();};}function respondWithResult(_0x383199,_0xafff69){_0xafff69=_0xafff69||0xc8;return function(_0x4569dd){if(_0x4569dd){return _0x383199[_0x6997('0x1c')](_0xafff69)[_0x6997('0x1d')](_0x4569dd);}};}function respondWithFilteredResult(_0x3f2575,_0x4c5882){return function(_0x36b3f2){if(_0x36b3f2){var _0xaf6035=typeof _0x4c5882['offset']===_0x6997('0x1e')&&typeof _0x4c5882['limit']===_0x6997('0x1e');var _0x574736=_0x36b3f2[_0x6997('0x1f')];var _0x2faf1b=_0xaf6035?0x0:_0x4c5882[_0x6997('0x20')];var _0x489f92=_0xaf6035?_0x36b3f2['count']:_0x4c5882['offset']+_0x4c5882['limit'];var _0x49f083;if(_0x489f92>=_0x574736){_0x489f92=_0x574736;_0x49f083=0xc8;}else{_0x49f083=0xce;}_0x3f2575['status'](_0x49f083);return _0x3f2575['set'](_0x6997('0x21'),_0x2faf1b+'-'+_0x489f92+'/'+_0x574736)[_0x6997('0x1d')](_0x36b3f2);}return null;};}function patchUpdates(_0x5d98ec){return function(_0x225f85){try{jsonpatch[_0x6997('0x22')](_0x225f85,_0x5d98ec,!![]);}catch(_0x4199bc){return BPromise[_0x6997('0x23')](_0x4199bc);}return _0x225f85[_0x6997('0x24')]();};}function saveUpdates(_0x1b3195,_0x4be39b){return function(_0x52af9e){if(_0x52af9e){return _0x52af9e[_0x6997('0x25')](_0x1b3195)[_0x6997('0x26')](function(_0x37d6ed){return _0x37d6ed;});}return null;};}function removeEntity(_0x3e05d3,_0x204417){return function(_0x1d6245){if(_0x1d6245){return _0x1d6245[_0x6997('0x27')]()[_0x6997('0x26')](function(){_0x3e05d3[_0x6997('0x1c')](0xcc)[_0x6997('0x1b')]();});}};}function handleEntityNotFound(_0x1d05c8,_0x4ab56f){return function(_0x1a36e3){if(!_0x1a36e3){_0x1d05c8[_0x6997('0x1a')](0x194);}return _0x1a36e3;};}function handleError(_0x42cfd4,_0x5539e2){_0x5539e2=_0x5539e2||0x1f4;return function(_0x2b7a4e){logger['error'](_0x2b7a4e['stack']);if(_0x2b7a4e[_0x6997('0x28')]){delete _0x2b7a4e['name'];}_0x42cfd4[_0x6997('0x1c')](_0x5539e2)[_0x6997('0x29')](_0x2b7a4e);};}exports[_0x6997('0x2a')]=function(_0x5c434b,_0x281b58){var _0xf4f3a2={},_0x1f5d62={},_0x1571db={'count':0x0,'rows':[]};var _0x4e0037=_[_0x6997('0x2b')](db[_0x6997('0x2c')][_0x6997('0x2d')],function(_0x5e0c19){return{'name':_0x5e0c19['fieldName'],'type':_0x5e0c19['type'][_0x6997('0x2e')]};});_0x1f5d62[_0x6997('0x2f')]=_[_0x6997('0x2b')](_0x4e0037,_0x6997('0x28'));_0x1f5d62[_0x6997('0x30')]=_['keys'](_0x5c434b[_0x6997('0x30')]);_0x1f5d62['filters']=_['intersection'](_0x1f5d62[_0x6997('0x2f')],_0x1f5d62[_0x6997('0x30')]);_0xf4f3a2['attributes']=_[_0x6997('0x31')](_0x1f5d62['model'],qs[_0x6997('0x32')](_0x5c434b['query'][_0x6997('0x32')]));_0xf4f3a2['attributes']=_0xf4f3a2[_0x6997('0x33')]['length']?_0xf4f3a2[_0x6997('0x33')]:_0x1f5d62[_0x6997('0x2f')];if(!_0x5c434b[_0x6997('0x30')][_0x6997('0x34')](_0x6997('0x35'))){_0xf4f3a2[_0x6997('0x36')]=qs[_0x6997('0x36')](_0x5c434b[_0x6997('0x30')][_0x6997('0x36')]);_0xf4f3a2[_0x6997('0x20')]=qs[_0x6997('0x20')](_0x5c434b['query'][_0x6997('0x20')]);}_0xf4f3a2[_0x6997('0x37')]=qs[_0x6997('0x38')](_0x5c434b[_0x6997('0x30')]['sort']);_0xf4f3a2[_0x6997('0x39')]=qs[_0x6997('0x3a')](_[_0x6997('0x3b')](_0x5c434b[_0x6997('0x30')],_0x1f5d62['filters']),_0x4e0037);if(_0x5c434b[_0x6997('0x30')]['filter']){_0xf4f3a2[_0x6997('0x39')]=_[_0x6997('0x3c')](_0xf4f3a2[_0x6997('0x39')],{'$or':_[_0x6997('0x2b')](_0x4e0037,function(_0x4a453a){if(_0x4a453a[_0x6997('0x3d')]!==_0x6997('0x3e')){var _0x40fbdb={};_0x40fbdb[_0x4a453a['name']]={'$like':'%'+_0x5c434b['query'][_0x6997('0x3f')]+'%'};return _0x40fbdb;}})});}_0xf4f3a2=_[_0x6997('0x3c')]({},_0xf4f3a2,_0x5c434b[_0x6997('0x40')]);var _0x528b6f={'where':_0xf4f3a2[_0x6997('0x39')]};return db['AnalyticTreeReport'][_0x6997('0x1f')](_0x528b6f)[_0x6997('0x26')](function(_0x52ccae){_0x1571db[_0x6997('0x1f')]=_0x52ccae;if(_0x5c434b['query'][_0x6997('0x41')]){_0xf4f3a2[_0x6997('0x42')]=[{'all':!![]}];}return db[_0x6997('0x2c')]['findAll'](_0xf4f3a2);})[_0x6997('0x26')](function(_0x53f271){_0x1571db['rows']=_0x53f271;return _0x1571db;})['then'](respondWithFilteredResult(_0x281b58,_0xf4f3a2))[_0x6997('0x43')](handleError(_0x281b58,null));};exports[_0x6997('0x44')]=function(_0x42301c,_0x235d8c){var _0x2d6f4b={'raw':!![],'where':{'id':_0x42301c[_0x6997('0x45')]['id']}},_0x3289cf={};_0x3289cf[_0x6997('0x2f')]=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x3289cf[_0x6997('0x30')]=_[_0x6997('0x46')](_0x42301c['query']);_0x3289cf['filters']=_['intersection'](_0x3289cf[_0x6997('0x2f')],_0x3289cf['query']);_0x2d6f4b['attributes']=_[_0x6997('0x31')](_0x3289cf[_0x6997('0x2f')],qs[_0x6997('0x32')](_0x42301c['query'][_0x6997('0x32')]));_0x2d6f4b['attributes']=_0x2d6f4b['attributes']['length']?_0x2d6f4b[_0x6997('0x33')]:_0x3289cf[_0x6997('0x2f')];if(_0x42301c[_0x6997('0x30')]['includeAll']){_0x2d6f4b['include']=[{'all':!![]}];}_0x2d6f4b=_[_0x6997('0x3c')]({},_0x2d6f4b,_0x42301c['options']);return db['AnalyticTreeReport'][_0x6997('0x47')](_0x2d6f4b)['then'](handleEntityNotFound(_0x235d8c,null))[_0x6997('0x26')](respondWithResult(_0x235d8c,null))[_0x6997('0x43')](handleError(_0x235d8c,null));};exports[_0x6997('0x48')]=function(_0x3b9a48,_0x1972e0){return db[_0x6997('0x2c')]['create'](_0x3b9a48[_0x6997('0x49')],{})[_0x6997('0x26')](respondWithResult(_0x1972e0,0xc9))[_0x6997('0x43')](handleError(_0x1972e0,null));};exports[_0x6997('0x25')]=function(_0x36498a,_0xd4ba96){if(_0x36498a[_0x6997('0x49')]['id']){delete _0x36498a[_0x6997('0x49')]['id'];}return db[_0x6997('0x2c')][_0x6997('0x47')]({'where':{'id':_0x36498a[_0x6997('0x45')]['id']}})[_0x6997('0x26')](handleEntityNotFound(_0xd4ba96,null))['then'](saveUpdates(_0x36498a[_0x6997('0x49')],null))[_0x6997('0x26')](respondWithResult(_0xd4ba96,null))['catch'](handleError(_0xd4ba96,null));};exports['destroy']=function(_0x2ef2b8,_0x242748){return db[_0x6997('0x2c')][_0x6997('0x47')]({'where':{'id':_0x2ef2b8[_0x6997('0x45')]['id']}})[_0x6997('0x26')](handleEntityNotFound(_0x242748,null))['then'](removeEntity(_0x242748,null))[_0x6997('0x43')](handleError(_0x242748,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 227b261..d818c5d 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.model.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0ab8=['../../config/logger','moment','bluebird','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x482f12,_0x253849){var _0x2bd90b=function(_0x4632cb){while(--_0x4632cb){_0x482f12['push'](_0x482f12['shift']());}};_0x2bd90b(++_0x253849);}(_0x0ab8,0x134));var _0x80ab=function(_0xdc9d7b,_0x13fa24){_0xdc9d7b=_0xdc9d7b-0x0;var _0x3f59e4=_0x0ab8[_0xdc9d7b];return _0x3f59e4;};'use strict';var _=require(_0x80ab('0x0'));var util=require(_0x80ab('0x1'));var logger=require(_0x80ab('0x2'))('api');var moment=require(_0x80ab('0x3'));var BPromise=require(_0x80ab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x80ab('0x5'));module[_0x80ab('0x6')]=function(_0x23cba4,_0x52924d){return _0x23cba4[_0x80ab('0x7')](_0x80ab('0x8'),attributes,{'tableName':_0x80ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x423d=['define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x21dd14,_0x23fbef){var _0x4bb93b=function(_0x22762d){while(--_0x22762d){_0x21dd14['push'](_0x21dd14['shift']());}};_0x4bb93b(++_0x23fbef);}(_0x423d,0x87));var _0xd423=function(_0x19c098,_0x1b8383){_0x19c098=_0x19c098-0x0;var _0x39a846=_0x423d[_0x19c098];return _0x39a846;};'use strict';var _=require(_0xd423('0x0'));var util=require('util');var logger=require(_0xd423('0x1'))('api');var moment=require(_0xd423('0x2'));var BPromise=require(_0xd423('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd423('0x4'));var rimraf=require(_0xd423('0x5'));var config=require(_0xd423('0x6'));var attributes=require(_0xd423('0x7'));module['exports']=function(_0x4ea82b,_0x3e2497){return _0x4ea82b[_0xd423('0x8')](_0xd423('0x9'),attributes,{'tableName':_0xd423('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index a439840..85692e9 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x229f6c,_0x2e0a92){var _0x1712a0=function(_0x4c853d){while(--_0x4c853d){_0x229f6c['push'](_0x229f6c['shift']());}};_0x1712a0(++_0x2e0a92);}(_0x5f2f,0x73));var _0xf5f2=function(_0xd66bb0,_0x4d39ac){_0xd66bb0=_0xd66bb0-0x0;var _0x3f1cd8=_0x5f2f[_0xd66bb0];return _0x3f1cd8;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x19d30d,_0xb5dbf7){_0x19d30d=_0x19d30d-0x0;var _0x2cbc03=_0x7a54[_0x19d30d];return _0x2cbc03;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 62ee193..bfc22f7 100644
--- a/server/api/analyticTreeReport/index.js
+++ b/server/api/analyticTreeReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd253=['path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xd253,0x6b));var _0x3d25=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd253[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x3d25('0x0'));var util=require('util');var path=require(_0x3d25('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3d25('0x2'));var auth=require(_0x3d25('0x3'));var interaction=require(_0x3d25('0x4'));var config=require(_0x3d25('0x5'));var controller=require(_0x3d25('0x6'));router['get']('/',auth[_0x3d25('0x7')](),controller[_0x3d25('0x8')]);router['get'](_0x3d25('0x9'),auth['isAuthenticated'](),controller[_0x3d25('0xa')]);router[_0x3d25('0xb')]('/',auth[_0x3d25('0x7')](),controller[_0x3d25('0xc')]);router[_0x3d25('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3d25('0xe')]);router[_0x3d25('0xf')](_0x3d25('0x9'),auth[_0x3d25('0x7')](),controller[_0x3d25('0x10')]);module[_0x3d25('0x11')]=router;
\ No newline at end of file
+var _0xacf6=['update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','put'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xacf6,0x81));var _0x6acf=function(_0x4ceda1,_0x265d30){_0x4ceda1=_0x4ceda1-0x0;var _0x424fbf=_0xacf6[_0x4ceda1];return _0x424fbf;};'use strict';var multer=require('multer');var util=require(_0x6acf('0x0'));var path=require(_0x6acf('0x1'));var timeout=require('connect-timeout');var express=require(_0x6acf('0x2'));var router=express[_0x6acf('0x3')]();var fs_extra=require(_0x6acf('0x4'));var auth=require(_0x6acf('0x5'));var interaction=require(_0x6acf('0x6'));var config=require(_0x6acf('0x7'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x6acf('0x8')](),controller[_0x6acf('0x9')]);router[_0x6acf('0xa')](_0x6acf('0xb'),auth[_0x6acf('0x8')](),controller['show']);router[_0x6acf('0xc')]('/',auth[_0x6acf('0x8')](),controller[_0x6acf('0xd')]);router[_0x6acf('0xe')](_0x6acf('0xb'),auth['isAuthenticated'](),controller[_0x6acf('0xf')]);router['delete'](_0x6acf('0xb'),auth['isAuthenticated'](),controller[_0x6acf('0x10')]);module[_0x6acf('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 21dd949..3f788e3 100644
--- a/server/api/attachment/attachment.attributes.js
+++ b/server/api/attachment/attachment.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x19ea=['sequelize','STRING'];(function(_0x5d0609,_0x127562){var _0xaa3fd1=function(_0x47f457){while(--_0x47f457){_0x5d0609['push'](_0x5d0609['shift']());}};_0xaa3fd1(++_0x127562);}(_0x19ea,0xfe));var _0xa19e=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x19ea[_0x47e549];return _0x251374;};'use strict';var Sequelize=require(_0xa19e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xa19e('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8a55=['exports','STRING','sequelize'];(function(_0x534754,_0x3b375c){var _0x4069d2=function(_0x30a673){while(--_0x30a673){_0x534754['push'](_0x534754['shift']());}};_0x4069d2(++_0x3b375c);}(_0x8a55,0x185));var _0x58a5=function(_0xf70d01,_0x4d7c0e){_0xf70d01=_0xf70d01-0x0;var _0x17d61c=_0x8a55[_0xf70d01];return _0x17d61c;};'use strict';var Sequelize=require(_0x58a5('0x0'));module[_0x58a5('0x1')]={'name':{'type':Sequelize[_0x58a5('0x2')]},'basename':{'type':Sequelize[_0x58a5('0x2')]},'type':{'type':Sequelize[_0x58a5('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 49a77c2..ae44772 100644
--- a/server/api/attachment/attachment.controller.js
+++ b/server/api/attachment/attachment.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb85=['sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','catch','show','find','includeAll','get','omit','createdAt','updatedAt','body','create','params','file','basename','mimetype','download','ChatOfflineMessageId','root','server/files/attachments/','join','rimraf','moment','mustache','util','path','sox','fs-extra','lodash','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3de7a2,_0x6f2c0f){var _0x512a3c=function(_0x5a5add){while(--_0x5a5add){_0x3de7a2['push'](_0x3de7a2['shift']());}};_0x512a3c(++_0x6f2c0f);}(_0xcb85,0x12f));var _0x5cb8=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0xcb85[_0x128bef];return _0x1ba862;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5cb8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5cb8('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x5cb8('0x2'));var util=require(_0x5cb8('0x3'));var path=require(_0x5cb8('0x4'));var sox=require(_0x5cb8('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cb8('0x6'));var _=require(_0x5cb8('0x7'));var squel=require('squel');var crypto=require(_0x5cb8('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5cb8('0x9'));var querystring=require(_0x5cb8('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5cb8('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x5cb8('0xc'));var hardwareService=require(_0x5cb8('0xd'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5cb8('0xe'));var licenseUtil=require(_0x5cb8('0xf'));var db=require(_0x5cb8('0x10'))['db'];function respondWithStatusCode(_0x3193de,_0x220fa4){_0x220fa4=_0x220fa4||0xcc;return function(_0x1fa9f8){if(_0x1fa9f8){return _0x3193de[_0x5cb8('0x11')](_0x220fa4);}return _0x3193de[_0x5cb8('0x12')](_0x220fa4)['end']();};}function respondWithResult(_0x28edb2,_0x5e45d7){_0x5e45d7=_0x5e45d7||0xc8;return function(_0x897f98){if(_0x897f98){return _0x28edb2[_0x5cb8('0x12')](_0x5e45d7)['json'](_0x897f98);}};}function respondWithFilteredResult(_0x440739,_0x5b7367){return function(_0x2edff6){if(_0x2edff6){var _0xd9dfc1=typeof _0x5b7367[_0x5cb8('0x13')]==='undefined'&&typeof _0x5b7367[_0x5cb8('0x14')]===_0x5cb8('0x15');var _0x16f81f=_0x2edff6[_0x5cb8('0x16')];var _0x50ac64=_0xd9dfc1?0x0:_0x5b7367[_0x5cb8('0x13')];var _0x19d45c=_0xd9dfc1?_0x2edff6[_0x5cb8('0x16')]:_0x5b7367[_0x5cb8('0x13')]+_0x5b7367[_0x5cb8('0x14')];var _0x7ed90;if(_0x19d45c>=_0x16f81f){_0x19d45c=_0x16f81f;_0x7ed90=0xc8;}else{_0x7ed90=0xce;}_0x440739[_0x5cb8('0x12')](_0x7ed90);return _0x440739['set'](_0x5cb8('0x17'),_0x50ac64+'-'+_0x19d45c+'/'+_0x16f81f)[_0x5cb8('0x18')](_0x2edff6);}return null;};}function patchUpdates(_0x294e49){return function(_0x1bd330){try{jsonpatch[_0x5cb8('0x19')](_0x1bd330,_0x294e49,!![]);}catch(_0x2b1fb6){return BPromise[_0x5cb8('0x1a')](_0x2b1fb6);}return _0x1bd330[_0x5cb8('0x1b')]();};}function saveUpdates(_0x8e993e,_0x40d9a5){return function(_0x5835c6){if(_0x5835c6){return _0x5835c6[_0x5cb8('0x1c')](_0x8e993e)[_0x5cb8('0x1d')](function(_0x1b7c03){return _0x1b7c03;});}return null;};}function removeEntity(_0x3907f1,_0x2784b6){return function(_0x26b38f){if(_0x26b38f){return _0x26b38f[_0x5cb8('0x1e')]()[_0x5cb8('0x1d')](function(){_0x3907f1[_0x5cb8('0x12')](0xcc)[_0x5cb8('0x1f')]();});}};}function handleEntityNotFound(_0x4ea123,_0x5f2589){return function(_0x277122){if(!_0x277122){_0x4ea123[_0x5cb8('0x11')](0x194);}return _0x277122;};}function handleError(_0x343fe0,_0x2629a5){_0x2629a5=_0x2629a5||0x1f4;return function(_0x17389f){logger[_0x5cb8('0x20')](_0x17389f[_0x5cb8('0x21')]);if(_0x17389f[_0x5cb8('0x22')]){delete _0x17389f[_0x5cb8('0x22')];}_0x343fe0[_0x5cb8('0x12')](_0x2629a5)[_0x5cb8('0x23')](_0x17389f);};}exports[_0x5cb8('0x24')]=function(_0x5e6b50,_0x19a713){var _0x412b35={},_0xebb2f4={},_0x1137b6={'count':0x0,'rows':[]};var _0x53c46d=_[_0x5cb8('0x25')](db[_0x5cb8('0x26')][_0x5cb8('0x27')],function(_0x3be27e){return{'name':_0x3be27e[_0x5cb8('0x28')],'type':_0x3be27e[_0x5cb8('0x29')][_0x5cb8('0x2a')]};});_0xebb2f4['model']=_[_0x5cb8('0x25')](_0x53c46d,_0x5cb8('0x22'));_0xebb2f4[_0x5cb8('0x2b')]=_[_0x5cb8('0x2c')](_0x5e6b50[_0x5cb8('0x2b')]);_0xebb2f4[_0x5cb8('0x2d')]=_[_0x5cb8('0x2e')](_0xebb2f4[_0x5cb8('0x2f')],_0xebb2f4['query']);_0x412b35[_0x5cb8('0x30')]=_[_0x5cb8('0x2e')](_0xebb2f4[_0x5cb8('0x2f')],qs[_0x5cb8('0x31')](_0x5e6b50['query']['fields']));_0x412b35[_0x5cb8('0x30')]=_0x412b35[_0x5cb8('0x30')][_0x5cb8('0x32')]?_0x412b35[_0x5cb8('0x30')]:_0xebb2f4['model'];if(!_0x5e6b50[_0x5cb8('0x2b')][_0x5cb8('0x33')](_0x5cb8('0x34'))){_0x412b35[_0x5cb8('0x14')]=qs[_0x5cb8('0x14')](_0x5e6b50[_0x5cb8('0x2b')][_0x5cb8('0x14')]);_0x412b35[_0x5cb8('0x13')]=qs[_0x5cb8('0x13')](_0x5e6b50['query'][_0x5cb8('0x13')]);}_0x412b35[_0x5cb8('0x35')]=qs[_0x5cb8('0x36')](_0x5e6b50[_0x5cb8('0x2b')][_0x5cb8('0x36')]);_0x412b35[_0x5cb8('0x37')]=qs[_0x5cb8('0x2d')](_[_0x5cb8('0x38')](_0x5e6b50[_0x5cb8('0x2b')],_0xebb2f4[_0x5cb8('0x2d')]),_0x53c46d);if(_0x5e6b50['query']['filter']){_0x412b35[_0x5cb8('0x37')]=_['merge'](_0x412b35[_0x5cb8('0x37')],{'$or':_['map'](_0x53c46d,function(_0x593b9e){if(_0x593b9e['type']!=='VIRTUAL'){var _0x448091={};_0x448091[_0x593b9e[_0x5cb8('0x22')]]={'$like':'%'+_0x5e6b50[_0x5cb8('0x2b')][_0x5cb8('0x39')]+'%'};return _0x448091;}})});}_0x412b35=_[_0x5cb8('0x3a')]({},_0x412b35,_0x5e6b50[_0x5cb8('0x3b')]);var _0x176648={'where':_0x412b35[_0x5cb8('0x37')]};return db[_0x5cb8('0x26')][_0x5cb8('0x16')](_0x176648)['then'](function(_0x170f40){_0x1137b6[_0x5cb8('0x16')]=_0x170f40;if(_0x5e6b50['query']['includeAll']){_0x412b35[_0x5cb8('0x3c')]=[{'all':!![]}];}return db[_0x5cb8('0x26')]['findAll'](_0x412b35);})[_0x5cb8('0x1d')](function(_0x4b0c59){_0x1137b6['rows']=_0x4b0c59;return _0x1137b6;})[_0x5cb8('0x1d')](respondWithFilteredResult(_0x19a713,_0x412b35))[_0x5cb8('0x3d')](handleError(_0x19a713,null));};exports[_0x5cb8('0x3e')]=function(_0xb02a5a,_0x34ccf5){var _0x555a6e={'raw':!![],'where':{'id':_0xb02a5a['params']['id']}},_0x23e1ea={};_0x23e1ea[_0x5cb8('0x2f')]=_[_0x5cb8('0x2c')](db[_0x5cb8('0x26')][_0x5cb8('0x27')]);_0x23e1ea['query']=_['keys'](_0xb02a5a[_0x5cb8('0x2b')]);_0x23e1ea[_0x5cb8('0x2d')]=_[_0x5cb8('0x2e')](_0x23e1ea[_0x5cb8('0x2f')],_0x23e1ea[_0x5cb8('0x2b')]);_0x555a6e[_0x5cb8('0x30')]=_['intersection'](_0x23e1ea[_0x5cb8('0x2f')],qs['fields'](_0xb02a5a[_0x5cb8('0x2b')][_0x5cb8('0x31')]));_0x555a6e[_0x5cb8('0x30')]=_0x555a6e[_0x5cb8('0x30')][_0x5cb8('0x32')]?_0x555a6e[_0x5cb8('0x30')]:_0x23e1ea[_0x5cb8('0x2f')];if(_0xb02a5a[_0x5cb8('0x2b')]['includeAll']){_0x555a6e[_0x5cb8('0x3c')]=[{'all':!![]}];}_0x555a6e=_[_0x5cb8('0x3a')]({},_0x555a6e,_0xb02a5a[_0x5cb8('0x3b')]);return db[_0x5cb8('0x26')][_0x5cb8('0x3f')](_0x555a6e)[_0x5cb8('0x1d')](handleEntityNotFound(_0x34ccf5,null))[_0x5cb8('0x1d')](respondWithResult(_0x34ccf5,null))[_0x5cb8('0x3d')](handleError(_0x34ccf5,null));};exports['clone']=function(_0x3dbcb2,_0x5b3272){var _0x2124c0={'where':{'id':_0x3dbcb2['params']['id']}},_0x451827={};_0x451827[_0x5cb8('0x2f')]=_[_0x5cb8('0x2c')](db['Attachment'][_0x5cb8('0x27')]);_0x2124c0[_0x5cb8('0x30')]=_[_0x5cb8('0x2e')](_0x451827[_0x5cb8('0x2f')],qs[_0x5cb8('0x31')](_0x3dbcb2['query']['fields']));_0x2124c0[_0x5cb8('0x30')]=_0x2124c0[_0x5cb8('0x30')]['length']?_0x2124c0[_0x5cb8('0x30')]:_0x451827[_0x5cb8('0x2f')];if(_0x3dbcb2[_0x5cb8('0x2b')][_0x5cb8('0x40')]){_0x2124c0[_0x5cb8('0x3c')]=[{'all':!![]}];}_0x2124c0=_[_0x5cb8('0x3a')]({},_0x2124c0,_0x3dbcb2[_0x5cb8('0x3b')]);return db[_0x5cb8('0x26')][_0x5cb8('0x3f')](_0x2124c0)[_0x5cb8('0x1d')](handleEntityNotFound(_0x5b3272,null))['then'](function(_0x323157){if(_0x323157){var _0x41618f=_0x323157[_0x5cb8('0x41')]({'plain':!![]});_0x41618f=qs[_0x5cb8('0x42')](_0x41618f,['id',_0x5cb8('0x43'),_0x5cb8('0x44')]);_0x3dbcb2[_0x5cb8('0x45')]=_[_0x5cb8('0x42')](_0x3dbcb2[_0x5cb8('0x45')],['id',_0x5cb8('0x43'),'updatedAt']);return db[_0x5cb8('0x26')][_0x5cb8('0x46')](_[_0x5cb8('0x3a')](_0x41618f,_0x3dbcb2[_0x5cb8('0x45')]),{'include':_0x3dbcb2[_0x5cb8('0x2b')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x5cb8('0x1d')](respondWithResult(_0x5b3272,0xc9))['catch'](handleError(_0x5b3272,null));};exports[_0x5cb8('0x1c')]=function(_0x2e3da9,_0x3c2a6d){if(_0x2e3da9['body']['id']){delete _0x2e3da9[_0x5cb8('0x45')]['id'];}return db[_0x5cb8('0x26')][_0x5cb8('0x3f')]({'where':{'id':_0x2e3da9[_0x5cb8('0x47')]['id']}})[_0x5cb8('0x1d')](handleEntityNotFound(_0x3c2a6d,null))['then'](saveUpdates(_0x2e3da9[_0x5cb8('0x45')],null))['then'](respondWithResult(_0x3c2a6d,null))[_0x5cb8('0x3d')](handleError(_0x3c2a6d,null));};exports['destroy']=function(_0x16ef08,_0x2b234c){return db[_0x5cb8('0x26')]['find']({'where':{'id':_0x16ef08[_0x5cb8('0x47')]['id']}})[_0x5cb8('0x1d')](handleEntityNotFound(_0x2b234c,null))[_0x5cb8('0x1d')](removeEntity(_0x2b234c,null))[_0x5cb8('0x3d')](handleError(_0x2b234c,null));};exports[_0x5cb8('0x46')]=function(_0x4d804d,_0x3cbce3,_0x445514){_0x4d804d[_0x5cb8('0x45')]['name']=_0x4d804d[_0x5cb8('0x48')]['originalname'];_0x4d804d[_0x5cb8('0x45')][_0x5cb8('0x49')]=_0x4d804d[_0x5cb8('0x48')]['filename'];_0x4d804d[_0x5cb8('0x45')][_0x5cb8('0x29')]=_0x4d804d[_0x5cb8('0x48')][_0x5cb8('0x4a')];return db['Attachment'][_0x5cb8('0x46')](_0x4d804d[_0x5cb8('0x45')])[_0x5cb8('0x1d')](respondWithResult(_0x3cbce3,0xc9))[_0x5cb8('0x3d')](handleError(_0x3cbce3,null));};exports[_0x5cb8('0x4b')]=function(_0x13dd83,_0x22385f,_0x37d678){return db[_0x5cb8('0x26')]['findOne']({'where':{'id':_0x13dd83[_0x5cb8('0x47')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x22385f,null))[_0x5cb8('0x1d')](function(_0x103fb0){if(_0x103fb0){var _0xba7a09=_0x103fb0[_0x5cb8('0x4c')]!==null;var _0x3a32fc=path['join'](config[_0x5cb8('0x4d')],_0x5cb8('0x4e'));if(_0xba7a09){_0x3a32fc=path['join'](_0x3a32fc,'offline-chat/');}var _0x2ada63=path[_0x5cb8('0x4f')](_0x3a32fc,_0x103fb0[_0x5cb8('0x49')]);return _0x22385f[_0x5cb8('0x4b')](_0x2ada63);}})[_0x5cb8('0x3d')](handleError(_0x22385f,null));};
\ No newline at end of file
+var _0xffe1=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','clone','params','get','omit','createdAt','updatedAt','body','create','catch','file','originalname','basename','filename','mimetype','ChatOfflineMessageId','root','offline-chat/','join','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x5c5032,_0x1a6cff){var _0x2855a1=function(_0x3609a5){while(--_0x3609a5){_0x5c5032['push'](_0x5c5032['shift']());}};_0x2855a1(++_0x1a6cff);}(_0xffe1,0x107));var _0x1ffe=function(_0x490d2f,_0x414559){_0x490d2f=_0x490d2f-0x0;var _0x371141=_0xffe1[_0x490d2f];return _0x371141;};'use strict';var emlformat=require(_0x1ffe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ffe('0x1'));var jsonpatch=require(_0x1ffe('0x2'));var rp=require(_0x1ffe('0x3'));var moment=require(_0x1ffe('0x4'));var BPromise=require(_0x1ffe('0x5'));var Mustache=require(_0x1ffe('0x6'));var util=require(_0x1ffe('0x7'));var path=require('path');var sox=require(_0x1ffe('0x8'));var csv=require(_0x1ffe('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ffe('0xa'));var _=require(_0x1ffe('0xb'));var squel=require(_0x1ffe('0xc'));var crypto=require(_0x1ffe('0xd'));var jsforce=require(_0x1ffe('0xe'));var deskjs=require(_0x1ffe('0xf'));var toCsv=require(_0x1ffe('0x9'));var querystring=require(_0x1ffe('0x10'));var Papa=require(_0x1ffe('0x11'));var Redis=require(_0x1ffe('0x12'));var authService=require(_0x1ffe('0x13'));var qs=require(_0x1ffe('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ffe('0x15'));var logger=require(_0x1ffe('0x16'))(_0x1ffe('0x17'));var utils=require(_0x1ffe('0x18'));var config=require(_0x1ffe('0x19'));var licenseUtil=require(_0x1ffe('0x1a'));var db=require(_0x1ffe('0x1b'))['db'];function respondWithStatusCode(_0x194dea,_0x1b6593){_0x1b6593=_0x1b6593||0xcc;return function(_0x356cb4){if(_0x356cb4){return _0x194dea[_0x1ffe('0x1c')](_0x1b6593);}return _0x194dea[_0x1ffe('0x1d')](_0x1b6593)[_0x1ffe('0x1e')]();};}function respondWithResult(_0x2f2c2a,_0x51e668){_0x51e668=_0x51e668||0xc8;return function(_0x4caf0b){if(_0x4caf0b){return _0x2f2c2a[_0x1ffe('0x1d')](_0x51e668)[_0x1ffe('0x1f')](_0x4caf0b);}};}function respondWithFilteredResult(_0x2eed11,_0x165b46){return function(_0x30d3c4){if(_0x30d3c4){var _0xd621db=typeof _0x165b46[_0x1ffe('0x20')]===_0x1ffe('0x21')&&typeof _0x165b46['limit']===_0x1ffe('0x21');var _0x2b15b6=_0x30d3c4[_0x1ffe('0x22')];var _0x3f0fad=_0xd621db?0x0:_0x165b46['offset'];var _0x47693e=_0xd621db?_0x30d3c4[_0x1ffe('0x22')]:_0x165b46[_0x1ffe('0x20')]+_0x165b46[_0x1ffe('0x23')];var _0x36a804;if(_0x47693e>=_0x2b15b6){_0x47693e=_0x2b15b6;_0x36a804=0xc8;}else{_0x36a804=0xce;}_0x2eed11['status'](_0x36a804);return _0x2eed11[_0x1ffe('0x24')](_0x1ffe('0x25'),_0x3f0fad+'-'+_0x47693e+'/'+_0x2b15b6)['json'](_0x30d3c4);}return null;};}function patchUpdates(_0x391164){return function(_0x2c2aaf){try{jsonpatch[_0x1ffe('0x26')](_0x2c2aaf,_0x391164,!![]);}catch(_0x36e51b){return BPromise[_0x1ffe('0x27')](_0x36e51b);}return _0x2c2aaf[_0x1ffe('0x28')]();};}function saveUpdates(_0x277b31,_0x58a225){return function(_0x894417){if(_0x894417){return _0x894417['update'](_0x277b31)[_0x1ffe('0x29')](function(_0x349c00){return _0x349c00;});}return null;};}function removeEntity(_0x15063a,_0x458dd9){return function(_0x53f34f){if(_0x53f34f){return _0x53f34f[_0x1ffe('0x2a')]()[_0x1ffe('0x29')](function(){_0x15063a[_0x1ffe('0x1d')](0xcc)[_0x1ffe('0x1e')]();});}};}function handleEntityNotFound(_0x53cd34,_0x3694dc){return function(_0x3d53f2){if(!_0x3d53f2){_0x53cd34[_0x1ffe('0x1c')](0x194);}return _0x3d53f2;};}function handleError(_0x4d62e2,_0x16d608){_0x16d608=_0x16d608||0x1f4;return function(_0x3b2ebe){logger[_0x1ffe('0x2b')](_0x3b2ebe['stack']);if(_0x3b2ebe[_0x1ffe('0x2c')]){delete _0x3b2ebe[_0x1ffe('0x2c')];}_0x4d62e2[_0x1ffe('0x1d')](_0x16d608)[_0x1ffe('0x2d')](_0x3b2ebe);};}exports[_0x1ffe('0x2e')]=function(_0x226fd0,_0x5aaac9){var _0x1b86e0={},_0xbac5dd={},_0x4809c2={'count':0x0,'rows':[]};var _0x431892=_['map'](db[_0x1ffe('0x2f')][_0x1ffe('0x30')],function(_0x2d0292){return{'name':_0x2d0292[_0x1ffe('0x31')],'type':_0x2d0292[_0x1ffe('0x32')][_0x1ffe('0x33')]};});_0xbac5dd[_0x1ffe('0x34')]=_[_0x1ffe('0x35')](_0x431892,'name');_0xbac5dd[_0x1ffe('0x36')]=_[_0x1ffe('0x37')](_0x226fd0[_0x1ffe('0x36')]);_0xbac5dd['filters']=_[_0x1ffe('0x38')](_0xbac5dd['model'],_0xbac5dd[_0x1ffe('0x36')]);_0x1b86e0[_0x1ffe('0x39')]=_['intersection'](_0xbac5dd['model'],qs[_0x1ffe('0x3a')](_0x226fd0['query'][_0x1ffe('0x3a')]));_0x1b86e0[_0x1ffe('0x39')]=_0x1b86e0[_0x1ffe('0x39')][_0x1ffe('0x3b')]?_0x1b86e0[_0x1ffe('0x39')]:_0xbac5dd[_0x1ffe('0x34')];if(!_0x226fd0['query'][_0x1ffe('0x3c')](_0x1ffe('0x3d'))){_0x1b86e0[_0x1ffe('0x23')]=qs[_0x1ffe('0x23')](_0x226fd0['query'][_0x1ffe('0x23')]);_0x1b86e0['offset']=qs[_0x1ffe('0x20')](_0x226fd0[_0x1ffe('0x36')][_0x1ffe('0x20')]);}_0x1b86e0['order']=qs[_0x1ffe('0x3e')](_0x226fd0[_0x1ffe('0x36')][_0x1ffe('0x3e')]);_0x1b86e0[_0x1ffe('0x3f')]=qs[_0x1ffe('0x40')](_[_0x1ffe('0x41')](_0x226fd0[_0x1ffe('0x36')],_0xbac5dd[_0x1ffe('0x40')]),_0x431892);if(_0x226fd0['query'][_0x1ffe('0x42')]){_0x1b86e0[_0x1ffe('0x3f')]=_[_0x1ffe('0x43')](_0x1b86e0[_0x1ffe('0x3f')],{'$or':_[_0x1ffe('0x35')](_0x431892,function(_0x5d16fe){if(_0x5d16fe[_0x1ffe('0x32')]!==_0x1ffe('0x44')){var _0x5a2b43={};_0x5a2b43[_0x5d16fe['name']]={'$like':'%'+_0x226fd0['query']['filter']+'%'};return _0x5a2b43;}})});}_0x1b86e0=_[_0x1ffe('0x43')]({},_0x1b86e0,_0x226fd0[_0x1ffe('0x45')]);var _0x3b10d5={'where':_0x1b86e0[_0x1ffe('0x3f')]};return db[_0x1ffe('0x2f')]['count'](_0x3b10d5)[_0x1ffe('0x29')](function(_0x41962a){_0x4809c2[_0x1ffe('0x22')]=_0x41962a;if(_0x226fd0[_0x1ffe('0x36')][_0x1ffe('0x46')]){_0x1b86e0[_0x1ffe('0x47')]=[{'all':!![]}];}return db[_0x1ffe('0x2f')][_0x1ffe('0x48')](_0x1b86e0);})['then'](function(_0x40bbf5){_0x4809c2[_0x1ffe('0x49')]=_0x40bbf5;return _0x4809c2;})[_0x1ffe('0x29')](respondWithFilteredResult(_0x5aaac9,_0x1b86e0))['catch'](handleError(_0x5aaac9,null));};exports[_0x1ffe('0x4a')]=function(_0x4c17d1,_0x4b4db6){var _0x1efd21={'raw':!![],'where':{'id':_0x4c17d1['params']['id']}},_0x1c4228={};_0x1c4228['model']=_[_0x1ffe('0x37')](db[_0x1ffe('0x2f')][_0x1ffe('0x30')]);_0x1c4228[_0x1ffe('0x36')]=_[_0x1ffe('0x37')](_0x4c17d1[_0x1ffe('0x36')]);_0x1c4228[_0x1ffe('0x40')]=_[_0x1ffe('0x38')](_0x1c4228[_0x1ffe('0x34')],_0x1c4228[_0x1ffe('0x36')]);_0x1efd21[_0x1ffe('0x39')]=_['intersection'](_0x1c4228[_0x1ffe('0x34')],qs[_0x1ffe('0x3a')](_0x4c17d1[_0x1ffe('0x36')][_0x1ffe('0x3a')]));_0x1efd21[_0x1ffe('0x39')]=_0x1efd21[_0x1ffe('0x39')][_0x1ffe('0x3b')]?_0x1efd21[_0x1ffe('0x39')]:_0x1c4228[_0x1ffe('0x34')];if(_0x4c17d1[_0x1ffe('0x36')][_0x1ffe('0x46')]){_0x1efd21['include']=[{'all':!![]}];}_0x1efd21=_['merge']({},_0x1efd21,_0x4c17d1[_0x1ffe('0x45')]);return db[_0x1ffe('0x2f')][_0x1ffe('0x4b')](_0x1efd21)['then'](handleEntityNotFound(_0x4b4db6,null))[_0x1ffe('0x29')](respondWithResult(_0x4b4db6,null))['catch'](handleError(_0x4b4db6,null));};exports[_0x1ffe('0x4c')]=function(_0x513291,_0x538d3e){var _0xa4d2e5={'where':{'id':_0x513291[_0x1ffe('0x4d')]['id']}},_0x1cd806={};_0x1cd806['model']=_['keys'](db[_0x1ffe('0x2f')][_0x1ffe('0x30')]);_0xa4d2e5[_0x1ffe('0x39')]=_[_0x1ffe('0x38')](_0x1cd806['model'],qs['fields'](_0x513291[_0x1ffe('0x36')]['fields']));_0xa4d2e5[_0x1ffe('0x39')]=_0xa4d2e5[_0x1ffe('0x39')][_0x1ffe('0x3b')]?_0xa4d2e5[_0x1ffe('0x39')]:_0x1cd806[_0x1ffe('0x34')];if(_0x513291['query'][_0x1ffe('0x46')]){_0xa4d2e5[_0x1ffe('0x47')]=[{'all':!![]}];}_0xa4d2e5=_[_0x1ffe('0x43')]({},_0xa4d2e5,_0x513291[_0x1ffe('0x45')]);return db['Attachment'][_0x1ffe('0x4b')](_0xa4d2e5)[_0x1ffe('0x29')](handleEntityNotFound(_0x538d3e,null))[_0x1ffe('0x29')](function(_0x3a7a23){if(_0x3a7a23){var _0x336c72=_0x3a7a23[_0x1ffe('0x4e')]({'plain':!![]});_0x336c72=qs[_0x1ffe('0x4f')](_0x336c72,['id',_0x1ffe('0x50'),_0x1ffe('0x51')]);_0x513291[_0x1ffe('0x52')]=_[_0x1ffe('0x4f')](_0x513291[_0x1ffe('0x52')],['id','createdAt',_0x1ffe('0x51')]);return db[_0x1ffe('0x2f')][_0x1ffe('0x53')](_[_0x1ffe('0x43')](_0x336c72,_0x513291['body']),{'include':_0x513291[_0x1ffe('0x36')][_0x1ffe('0x46')]?[{'all':!![]}]:undefined});}})[_0x1ffe('0x29')](respondWithResult(_0x538d3e,0xc9))[_0x1ffe('0x54')](handleError(_0x538d3e,null));};exports['update']=function(_0x4d59d1,_0x16d404){if(_0x4d59d1[_0x1ffe('0x52')]['id']){delete _0x4d59d1[_0x1ffe('0x52')]['id'];}return db[_0x1ffe('0x2f')]['find']({'where':{'id':_0x4d59d1[_0x1ffe('0x4d')]['id']}})['then'](handleEntityNotFound(_0x16d404,null))[_0x1ffe('0x29')](saveUpdates(_0x4d59d1[_0x1ffe('0x52')],null))['then'](respondWithResult(_0x16d404,null))[_0x1ffe('0x54')](handleError(_0x16d404,null));};exports[_0x1ffe('0x2a')]=function(_0x3da369,_0x53c884){return db[_0x1ffe('0x2f')][_0x1ffe('0x4b')]({'where':{'id':_0x3da369[_0x1ffe('0x4d')]['id']}})['then'](handleEntityNotFound(_0x53c884,null))[_0x1ffe('0x29')](removeEntity(_0x53c884,null))[_0x1ffe('0x54')](handleError(_0x53c884,null));};exports[_0x1ffe('0x53')]=function(_0x30b772,_0x43fb55,_0x5dc8ca){_0x30b772['body'][_0x1ffe('0x2c')]=_0x30b772[_0x1ffe('0x55')][_0x1ffe('0x56')];_0x30b772['body'][_0x1ffe('0x57')]=_0x30b772[_0x1ffe('0x55')][_0x1ffe('0x58')];_0x30b772[_0x1ffe('0x52')]['type']=_0x30b772[_0x1ffe('0x55')][_0x1ffe('0x59')];return db[_0x1ffe('0x2f')]['create'](_0x30b772[_0x1ffe('0x52')])[_0x1ffe('0x29')](respondWithResult(_0x43fb55,0xc9))[_0x1ffe('0x54')](handleError(_0x43fb55,null));};exports['download']=function(_0x2ff493,_0x25188a,_0x43851a){return db[_0x1ffe('0x2f')]['findOne']({'where':{'id':_0x2ff493[_0x1ffe('0x4d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x25188a,null))[_0x1ffe('0x29')](function(_0x398c9f){if(_0x398c9f){var _0x2b11d8=_0x398c9f[_0x1ffe('0x5a')]!==null;var _0x2d5db5=path['join'](config[_0x1ffe('0x5b')],'server/files/attachments/');if(_0x2b11d8){_0x2d5db5=path['join'](_0x2d5db5,_0x1ffe('0x5c'));}var _0x282947=path[_0x1ffe('0x5d')](_0x2d5db5,_0x398c9f[_0x1ffe('0x57')]);return _0x25188a[_0x1ffe('0x5e')](_0x282947);}})[_0x1ffe('0x54')](handleError(_0x25188a,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 9af5b09..7e05c77 100644
--- a/server/api/attachment/attachment.model.js
+++ b/server/api/attachment/attachment.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4eb8=['bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','Attachment','util','../../config/logger','api','moment'];(function(_0x2cb419,_0x7f6a47){var _0x484f4b=function(_0x173371){while(--_0x173371){_0x2cb419['push'](_0x2cb419['shift']());}};_0x484f4b(++_0x7f6a47);}(_0x4eb8,0xec));var _0x84eb=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x4eb8[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require('lodash');var util=require(_0x84eb('0x0'));var logger=require(_0x84eb('0x1'))(_0x84eb('0x2'));var moment=require(_0x84eb('0x3'));var BPromise=require(_0x84eb('0x4'));var rp=require(_0x84eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x84eb('0x6'));var config=require(_0x84eb('0x7'));var attributes=require(_0x84eb('0x8'));module['exports']=function(_0x34025d,_0x49c14f){return _0x34025d['define'](_0x84eb('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x16e3=['../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x16e3,0x117));var _0x316e=function(_0x25a5a6,_0x287847){_0x25a5a6=_0x25a5a6-0x0;var _0x129907=_0x16e3[_0x25a5a6];return _0x129907;};'use strict';var _=require(_0x316e('0x0'));var util=require(_0x316e('0x1'));var logger=require(_0x316e('0x2'))(_0x316e('0x3'));var moment=require('moment');var BPromise=require(_0x316e('0x4'));var rp=require(_0x316e('0x5'));var fs=require('fs');var path=require(_0x316e('0x6'));var rimraf=require('rimraf');var config=require(_0x316e('0x7'));var attributes=require(_0x316e('0x8'));module[_0x316e('0x9')]=function(_0x1d9b31,_0x2be93f){return _0x1d9b31[_0x316e('0xa')](_0x316e('0xb'),attributes,{'tableName':_0x316e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 25a24e2..2f4eaf4 100644
--- a/server/api/attachment/attachment.rpc.js
+++ b/server/api/attachment/attachment.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xee24=['body','options','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','info','result','catch','CreateAttachment','Attachment','create'];(function(_0x359d82,_0x3562b2){var _0x1ebefe=function(_0x5a1ade){while(--_0x5a1ade){_0x359d82['push'](_0x359d82['shift']());}};_0x1ebefe(++_0x3562b2);}(_0xee24,0x1a6));var _0x4ee2=function(_0x102402,_0x4eaaf8){_0x102402=_0x102402-0x0;var _0x321b44=_0xee24[_0x102402];return _0x321b44;};'use strict';var _=require('lodash');var util=require(_0x4ee2('0x0'));var moment=require(_0x4ee2('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ee2('0x2'));var fs=require('fs');var Redis=require(_0x4ee2('0x3'));var db=require(_0x4ee2('0x4'))['db'];var utils=require(_0x4ee2('0x5'));var logger=require('../../config/logger')(_0x4ee2('0x6'));var config=require(_0x4ee2('0x7'));var jayson=require(_0x4ee2('0x8'));var client=jayson[_0x4ee2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e6e11,_0x319d9d,_0xe966eb){return new BPromise(function(_0x9a963c,_0x8d7266){return client[_0x4ee2('0xa')](_0x2e6e11,_0xe966eb)[_0x4ee2('0xb')](function(_0x3b6028){logger['info']('Attachment,\x20%s,\x20%s',_0x319d9d,_0x4ee2('0xc'));logger[_0x4ee2('0xd')](_0x4ee2('0xe'),_0x319d9d,_0x4ee2('0xc'),JSON[_0x4ee2('0xf')](_0x3b6028));if(_0x3b6028['error']){if(_0x3b6028[_0x4ee2('0x10')][_0x4ee2('0x11')]===0x1f4){logger[_0x4ee2('0x10')](_0x4ee2('0x12'),_0x319d9d,_0x3b6028['error'][_0x4ee2('0x13')]);return _0x8d7266(_0x3b6028[_0x4ee2('0x10')][_0x4ee2('0x13')]);}logger[_0x4ee2('0x10')]('Attachment,\x20%s,\x20%s',_0x319d9d,_0x3b6028['error'][_0x4ee2('0x13')]);return _0x9a963c(_0x3b6028[_0x4ee2('0x10')]['message']);}else{logger[_0x4ee2('0x14')](_0x4ee2('0x12'),_0x319d9d,_0x4ee2('0xc'));_0x9a963c(_0x3b6028[_0x4ee2('0x15')][_0x4ee2('0x13')]);}})[_0x4ee2('0x16')](function(_0x5e19f8){logger[_0x4ee2('0x10')](_0x4ee2('0x12'),_0x319d9d,_0x5e19f8);_0x8d7266(_0x5e19f8);});});}exports[_0x4ee2('0x17')]=function(_0x4aba2b){var _0x23df00=this;return new Promise(function(_0xb8e027,_0x3ba412){return db[_0x4ee2('0x18')][_0x4ee2('0x19')](_0x4aba2b[_0x4ee2('0x1a')],{'raw':_0x4aba2b[_0x4ee2('0x1b')]?_0x4aba2b[_0x4ee2('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x33e66e){logger['info'](_0x4ee2('0x17'),_0x4aba2b);logger[_0x4ee2('0xd')](_0x4ee2('0x17'),_0x4aba2b,JSON[_0x4ee2('0xf')](_0x33e66e));_0xb8e027(_0x33e66e);})[_0x4ee2('0x16')](function(_0x53f246){logger[_0x4ee2('0x10')]('CreateAttachment',_0x53f246[_0x4ee2('0x13')],_0x4aba2b);_0x3ba412(_0x23df00[_0x4ee2('0x10')](0x1f4,_0x53f246[_0x4ee2('0x13')]));});});};
\ No newline at end of file
+var _0x81d5=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','Attachment','body','options','raw','then','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x27dc75,_0x10560b){var _0x316106=function(_0xa01dec){while(--_0xa01dec){_0x27dc75['push'](_0x27dc75['shift']());}};_0x316106(++_0x10560b);}(_0x81d5,0x1ab));var _0x581d=function(_0x534bb8,_0x17fd36){_0x534bb8=_0x534bb8-0x0;var _0x33287c=_0x81d5[_0x534bb8];return _0x33287c;};'use strict';var _=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var moment=require('moment');var BPromise=require(_0x581d('0x2'));var rs=require(_0x581d('0x3'));var fs=require('fs');var Redis=require(_0x581d('0x4'));var db=require(_0x581d('0x5'))['db'];var utils=require(_0x581d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x581d('0x7'));var jayson=require(_0x581d('0x8'));var client=jayson[_0x581d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16067b,_0x2f32bf,_0x43124c){return new BPromise(function(_0x497368,_0xf1a3b6){return client['request'](_0x16067b,_0x43124c)['then'](function(_0x5d8fa3){logger[_0x581d('0xa')](_0x581d('0xb'),_0x2f32bf,_0x581d('0xc'));logger[_0x581d('0xd')](_0x581d('0xe'),_0x2f32bf,'request\x20sent',JSON[_0x581d('0xf')](_0x5d8fa3));if(_0x5d8fa3[_0x581d('0x10')]){if(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x11')]===0x1f4){logger[_0x581d('0x10')](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);return _0xf1a3b6(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);}logger['error'](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')]['message']);return _0x497368(_0x5d8fa3['error']['message']);}else{logger['info'](_0x581d('0xb'),_0x2f32bf,'request\x20sent');_0x497368(_0x5d8fa3[_0x581d('0x13')][_0x581d('0x12')]);}})['catch'](function(_0x1890d0){logger['error'](_0x581d('0xb'),_0x2f32bf,_0x1890d0);_0xf1a3b6(_0x1890d0);});});}exports[_0x581d('0x14')]=function(_0x1e059d){var _0x42f7db=this;return new Promise(function(_0x1f790f,_0x2cff0d){return db[_0x581d('0x15')]['create'](_0x1e059d[_0x581d('0x16')],{'raw':_0x1e059d[_0x581d('0x17')]?_0x1e059d[_0x581d('0x17')][_0x581d('0x18')]===undefined?!![]:![]:!![]})[_0x581d('0x19')](function(_0x2a2aba){logger[_0x581d('0xa')](_0x581d('0x14'),_0x1e059d);logger[_0x581d('0xd')](_0x581d('0x14'),_0x1e059d,JSON[_0x581d('0xf')](_0x2a2aba));_0x1f790f(_0x2a2aba);})[_0x581d('0x1a')](function(_0x5add13){logger[_0x581d('0x10')](_0x581d('0x14'),_0x5add13[_0x581d('0x12')],_0x1e059d);_0x2cff0d(_0x42f7db[_0x581d('0x10')](0x1f4,_0x5add13[_0x581d('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 9a174aa..3817d58 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x42e6a1,_0x4e436e){var _0x433176=function(_0x5280f7){while(--_0x5280f7){_0x42e6a1['push'](_0x42e6a1['shift']());}};_0x433176(++_0x4e436e);}(_0x2032,0xd9));var _0x2203=function(_0x306fe1,_0x45215b){_0x306fe1=_0x306fe1-0x0;var _0x2777da=_0x2032[_0x306fe1];return _0x2777da;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x2bfe2a,_0x1608a3){var _0x1f15cb=function(_0x136b55){while(--_0x136b55){_0x2bfe2a['push'](_0x2bfe2a['shift']());}};_0x1f15cb(++_0x1608a3);}(_0xadb5,0xad));var _0x5adb=function(_0x2721ef,_0x16ed8c){_0x2721ef=_0x2721ef-0x0;var _0x46a995=_0xadb5[_0x2721ef];return _0x46a995;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index e614bb3..b6c13ac 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6909=['clearBlockUser','getLicense','catch','status','message','login','ad-login','signToken','json','online','use','password','User','passport-local','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','salt','role','blocked','blockedAt','agent','name','disabled','blockDuration','add'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x6909,0x1e3));var _0x9690=function(_0x3bbc33,_0x52fc5c){_0x3bbc33=_0x3bbc33-0x0;var _0x20a80f=_0x6909[_0x3bbc33];return _0x20a80f;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x9690('0x0'))['Strategy'];var moment=require(_0x9690('0x1'));var ActiveDirectory=require(_0x9690('0x2'));var BPromise=require(_0x9690('0x3'));var util=require('util');var db=require(_0x9690('0x4'))['db'];var authService=require(_0x9690('0x5'));var utils=require(_0x9690('0x6'));var config=require('../../config/environment');var logger=require(_0x9690('0x7'))(_0x9690('0x8'));function isActiveDirectoryConfigured(_0x184bb1){var _0x75cbcb=![];if(typeof _0x184bb1[_0x9690('0x9')]!==_0x9690('0xa')){_0x75cbcb=_0x184bb1[_0x9690('0x9')][_0x9690('0xb')]&&_0x184bb1[_0x9690('0x9')][_0x9690('0xc')]&&_0x184bb1['activedirectory'][_0x9690('0xd')];}return _0x75cbcb;}function adAuthenticate(_0x2658c6,_0x24eae8,_0x39847f){return new BPromise(function(_0x12b229,_0x4194aa){try{var _0x369cd4=new ActiveDirectory(_0x2658c6);_0x369cd4[_0x9690('0xe')](_0x24eae8,_0x39847f,function(_0x35e041,_0x642f21){if(_0x35e041){logger['error'](_0x9690('0xf'),_0x24eae8,util['inspect'](_0x35e041,{'showHidden':![],'depth':null}));_0x4194aa('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x642f21){logger[_0x9690('0x10')](_0x9690('0x11'),_0x24eae8);_0x4194aa(_0x9690('0x12'));}else{_0x12b229(_0x642f21);}});}catch(_0x1042c5){_0x4194aa(_0x1042c5);}});}function ActiveDirectoryAuthenticate(_0x1ff67c,_0x413c26,_0x2ccb90,_0x2448aa){var _0x850d83,_0x139e3d;if(!isActiveDirectoryConfigured(config)){logger[_0x9690('0x10')](_0x9690('0x13'),_0x413c26);return _0x2448aa(null,![],{'message':_0x9690('0x12')});}return db[_0x9690('0x14')][_0x9690('0x15')]({'where':{'id':0x1},'attributes':[_0x9690('0x16'),'blockDuration'],'raw':!![]})[_0x9690('0x17')](function(_0x38b188){_0x850d83=_0x38b188;if(!_0x850d83[_0x9690('0x16')]){logger[_0x9690('0x10')](_0x9690('0x18'),_0x413c26);throw new Error(_0x9690('0x12'));}return _0x1ff67c[_0x9690('0x15')]({'logging':!![],'attributes':['id','name','password',_0x9690('0x19'),_0x9690('0x1a'),'disabled',_0x9690('0x1b'),_0x9690('0x1c'),'online'],'where':{'name':_0x413c26,'role':{'$or':['admin','user',_0x9690('0x1d')]},'adSsoEnabled':!![]}});})[_0x9690('0x17')](function(_0x5f0c14){if(!_0x5f0c14||_0x5f0c14&&_0x5f0c14[_0x9690('0x1e')]!==_0x413c26){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x139e3d=_0x5f0c14;var _0x33afcd=_0x139e3d[_0x9690('0x1e')]+'@'+config[_0x9690('0x9')][_0x9690('0xd')];return adAuthenticate(config[_0x9690('0x9')],_0x33afcd,_0x2ccb90);})['then'](function(_0x5c64f8){if(_0x139e3d[_0x9690('0x1f')]){throw new Error(_0x9690('0x12'));}if(_0x850d83[_0x9690('0x20')]>0x0){if(_0x139e3d['blocked']){if(moment(_0x139e3d['blockedAt'])[_0x9690('0x21')](_0x850d83['blockDuration'],'minutes')>moment()){throw new Error(_0x9690('0x12'));}return utils[_0x9690('0x22')](_0x139e3d,0x0,![],null)[_0x9690('0x17')](function(){return utils['getLicense'](_0x139e3d);})['then'](function(){return _0x2448aa(null,_0x139e3d);});}else{return utils['getLicense'](_0x139e3d)[_0x9690('0x17')](function(){return _0x2448aa(null,_0x139e3d);});}}else{return utils[_0x9690('0x23')](_0x139e3d)[_0x9690('0x17')](function(){return _0x2448aa(null,_0x139e3d);});}})[_0x9690('0x24')](function(_0x9fd2bb){return _0x2448aa(null,![],_0x9fd2bb);});}function handleError(_0x21b3e3,_0x46ec11,_0x58a895){return _0x21b3e3[_0x9690('0x25')](_0x46ec11||0x1f4)['send']({'message':_0x58a895?_0x58a895[_0x9690('0x26')]||_0x58a895:''});}exports[_0x9690('0x27')]=function(_0x27a4aa,_0x2c90b1,_0x23e48d){passport['authenticate'](_0x9690('0x28'),function(_0x91d164,_0x1fbedf,_0x3e520c){var _0x1c9272=_0x91d164||_0x3e520c;if(_0x1c9272){return handleError(_0x2c90b1,0x191,_0x1c9272);}if(!_0x1fbedf){return handleError(_0x2c90b1,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x354631={'payload':{'id':_0x1fbedf['id'],'role':_0x1fbedf[_0x9690('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x9690('0x29')](_0x354631)[_0x9690('0x17')](function(_0x28dc84){_0x2c90b1[_0x9690('0x2a')]({'id':_0x1fbedf['id'],'token':_0x28dc84,'statusCall':'','isAlreadyLogged':_0x1fbedf[_0x9690('0x2b')]});});}})(_0x27a4aa,_0x2c90b1,_0x23e48d);};passport[_0x9690('0x2c')](_0x9690('0x28'),new LocalStrategy({'usernameField':'name','passwordField':_0x9690('0x2d')},function(_0x1b8d77,_0x113ffb,_0x15982a){return ActiveDirectoryAuthenticate(db[_0x9690('0x2e')],_0x1b8d77,_0x113ffb,_0x15982a);}));
\ No newline at end of file
+var _0xb9ca=['undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','name','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','blockDuration','minutes','clearBlockUser','getLicense','catch','status','send','login','ad-login','signToken','json','use','password','passport','Strategy','moment','bluebird','util','../../config/utils','../../config/environment','../../config/logger','api','activedirectory'];(function(_0x5690c9,_0x4af3fa){var _0x4cac4a=function(_0x42aaea){while(--_0x42aaea){_0x5690c9['push'](_0x5690c9['shift']());}};_0x4cac4a(++_0x4af3fa);}(_0xb9ca,0x16e));var _0xab9c=function(_0x2c8d62,_0x29e4b0){_0x2c8d62=_0x2c8d62-0x0;var _0x3bddf8=_0xb9ca[_0x2c8d62];return _0x3bddf8;};'use strict';var passport=require(_0xab9c('0x0'));var LocalStrategy=require('passport-local')[_0xab9c('0x1')];var moment=require(_0xab9c('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xab9c('0x3'));var util=require(_0xab9c('0x4'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0xab9c('0x5'));var config=require(_0xab9c('0x6'));var logger=require(_0xab9c('0x7'))(_0xab9c('0x8'));function isActiveDirectoryConfigured(_0x405f0c){var _0x136024=![];if(typeof _0x405f0c[_0xab9c('0x9')]!==_0xab9c('0xa')){_0x136024=_0x405f0c[_0xab9c('0x9')][_0xab9c('0xb')]&&_0x405f0c[_0xab9c('0x9')][_0xab9c('0xc')]&&_0x405f0c[_0xab9c('0x9')][_0xab9c('0xd')];}return _0x136024;}function adAuthenticate(_0x55946b,_0x44e411,_0x19d71f){return new BPromise(function(_0x274e59,_0x1267fe){try{var _0xb88cc0=new ActiveDirectory(_0x55946b);_0xb88cc0[_0xab9c('0xe')](_0x44e411,_0x19d71f,function(_0x35394b,_0x249af9){if(_0x35394b){logger[_0xab9c('0xf')](_0xab9c('0x10'),_0x44e411,util['inspect'](_0x35394b,{'showHidden':![],'depth':null}));_0x1267fe(_0xab9c('0x11'));}else if(!_0x249af9){logger[_0xab9c('0xf')](_0xab9c('0x12'),_0x44e411);_0x1267fe(_0xab9c('0x11'));}else{_0x274e59(_0x249af9);}});}catch(_0x441dbb){_0x1267fe(_0x441dbb);}});}function ActiveDirectoryAuthenticate(_0x3293d6,_0x28b10e,_0x2ab4dd,_0x3d4034){var _0x5af598,_0x393d37;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xab9c('0x13'),_0x28b10e);return _0x3d4034(null,![],{'message':_0xab9c('0x11')});}return db[_0xab9c('0x14')][_0xab9c('0x15')]({'where':{'id':0x1},'attributes':[_0xab9c('0x16'),'blockDuration'],'raw':!![]})[_0xab9c('0x17')](function(_0x781dd1){_0x5af598=_0x781dd1;if(!_0x5af598['adSsoEnabled']){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x28b10e);throw new Error(_0xab9c('0x11'));}return _0x3293d6['findOne']({'logging':!![],'attributes':['id',_0xab9c('0x18'),'password',_0xab9c('0x19'),_0xab9c('0x1a'),_0xab9c('0x1b'),_0xab9c('0x1c'),_0xab9c('0x1d'),_0xab9c('0x1e')],'where':{'name':_0x28b10e,'role':{'$or':[_0xab9c('0x1f'),_0xab9c('0x20'),_0xab9c('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x10a9eb){if(!_0x10a9eb||_0x10a9eb&&_0x10a9eb['name']!==_0x28b10e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x393d37=_0x10a9eb;var _0x399711=_0x393d37[_0xab9c('0x18')]+'@'+config[_0xab9c('0x9')][_0xab9c('0xd')];return adAuthenticate(config[_0xab9c('0x9')],_0x399711,_0x2ab4dd);})['then'](function(_0x292aa5){if(_0x393d37['disabled']){throw new Error(_0xab9c('0x11'));}if(_0x5af598[_0xab9c('0x22')]>0x0){if(_0x393d37[_0xab9c('0x1c')]){if(moment(_0x393d37['blockedAt'])['add'](_0x5af598[_0xab9c('0x22')],_0xab9c('0x23'))>moment()){throw new Error(_0xab9c('0x11'));}return utils[_0xab9c('0x24')](_0x393d37,0x0,![],null)[_0xab9c('0x17')](function(){return utils['getLicense'](_0x393d37);})[_0xab9c('0x17')](function(){return _0x3d4034(null,_0x393d37);});}else{return utils['getLicense'](_0x393d37)[_0xab9c('0x17')](function(){return _0x3d4034(null,_0x393d37);});}}else{return utils[_0xab9c('0x25')](_0x393d37)['then'](function(){return _0x3d4034(null,_0x393d37);});}})[_0xab9c('0x26')](function(_0xf83bdc){return _0x3d4034(null,![],_0xf83bdc);});}function handleError(_0x14f924,_0x58f253,_0x11bba1){return _0x14f924[_0xab9c('0x27')](_0x58f253||0x1f4)[_0xab9c('0x28')]({'message':_0x11bba1?_0x11bba1['message']||_0x11bba1:''});}exports[_0xab9c('0x29')]=function(_0x13fa46,_0x2856f6,_0x444e72){passport[_0xab9c('0xe')](_0xab9c('0x2a'),function(_0x108159,_0x24f078,_0x2d56b7){var _0x4c9b8a=_0x108159||_0x2d56b7;if(_0x4c9b8a){return handleError(_0x2856f6,0x191,_0x4c9b8a);}if(!_0x24f078){return handleError(_0x2856f6,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x38cf3a={'payload':{'id':_0x24f078['id'],'role':_0x24f078[_0xab9c('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0xab9c('0x2b')](_0x38cf3a)[_0xab9c('0x17')](function(_0x861fe3){_0x2856f6[_0xab9c('0x2c')]({'id':_0x24f078['id'],'token':_0x861fe3,'statusCall':'','isAlreadyLogged':_0x24f078[_0xab9c('0x1e')]});});}})(_0x13fa46,_0x2856f6,_0x444e72);};passport[_0xab9c('0x2d')](_0xab9c('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0xab9c('0x2e')},function(_0x2284fd,_0x4a6ba3,_0x4be3e2){return ActiveDirectoryAuthenticate(db['User'],_0x2284fd,_0x4a6ba3,_0x4be3e2);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index dd56038..6e1a75a 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x16b4=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x16b4,0x184));var _0x416b=function(_0x52dad4,_0x10c9c3){_0x52dad4=_0x52dad4-0x0;var _0x50da26=_0x16b4[_0x52dad4];return _0x50da26;};'use strict';var express=require(_0x416b('0x0'));var router=express[_0x416b('0x1')]();var controller=require(_0x416b('0x2'));router[_0x416b('0x3')]('/',controller[_0x416b('0x4')]);module[_0x416b('0x5')]=router;
\ No newline at end of file
+var _0x330e=['express','post','login','exports'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x330e,0xb4));var _0xe330=function(_0x4adf25,_0xc1c299){_0x4adf25=_0x4adf25-0x0;var _0x239fdc=_0x330e[_0x4adf25];return _0x239fdc;};'use strict';var express=require(_0xe330('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0xe330('0x1')]('/',controller[_0xe330('0x2')]);module[_0xe330('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index eb76fa4..00cf025 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7a54,0x106));var _0x47a5=function(_0x15456c,_0x4aa841){_0x15456c=_0x15456c-0x0;var _0x3fd34c=_0x7a54[_0x15456c];return _0x3fd34c;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x7a54,0x106));var _0x47a5=function(_0x14d4a0,_0x4f84d4){_0x14d4a0=_0x14d4a0-0x0;var _0x51f46a=_0x7a54[_0x14d4a0];return _0x51f46a;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 50fd3f3..f8703b6 100644
--- a/server/api/authGoogle/index.js
+++ b/server/api/authGoogle/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f39=['../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','isMiddleware','exports','express','Router','./authGoogle.controller'];(function(_0x1778e1,_0x3e1727){var _0x2bc4c6=function(_0x359c65){while(--_0x359c65){_0x1778e1['push'](_0x1778e1['shift']());}};_0x2bc4c6(++_0x3e1727);}(_0x9f39,0x152));var _0x99f3=function(_0x80582b,_0x653bda){_0x80582b=_0x80582b-0x0;var _0x7e7b8c=_0x9f39[_0x80582b];return _0x7e7b8c;};'use strict';var express=require(_0x99f3('0x0'));var passport=require('passport');var router=express[_0x99f3('0x1')]();var controller=require(_0x99f3('0x2'));var userController=require(_0x99f3('0x3'));var authService=require(_0x99f3('0x4'));router['get']('/',controller[_0x99f3('0x5')]);router[_0x99f3('0x6')](_0x99f3('0x7'),controller[_0x99f3('0x8')],authService[_0x99f3('0x9')],userController[_0x99f3('0x5')],authService['setTokenCookie']);module[_0x99f3('0xa')]=router;
\ No newline at end of file
+var _0x20e7=['get','login','/callback','callback','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x20e7,0x178));var _0x720e=function(_0x5d8512,_0x21488a){_0x5d8512=_0x5d8512-0x0;var _0x29e571=_0x20e7[_0x5d8512];return _0x29e571;};'use strict';var express=require(_0x720e('0x0'));var passport=require(_0x720e('0x1'));var router=express['Router']();var controller=require(_0x720e('0x2'));var userController=require(_0x720e('0x3'));var authService=require('../../components/auth/service');router[_0x720e('0x4')]('/',controller[_0x720e('0x5')]);router[_0x720e('0x4')](_0x720e('0x6'),controller[_0x720e('0x7')],authService['isMiddleware'],userController[_0x720e('0x5')],authService[_0x720e('0x8')]);module[_0x720e('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 2b6f285..fb2814e 100644
--- a/server/api/authLocal/authLocal.controller.js
+++ b/server/api/authLocal/authLocal.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8ecd=['enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','save','use','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','clearBlockUser','disabled','getLicense','blocked','catch','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','authentication','pass','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','Reset\x20Email\x20sent!','reset','params','token'];(function(_0x1ae121,_0x40a449){var _0x371bdb=function(_0x59f9bf){while(--_0x59f9bf){_0x1ae121['push'](_0x1ae121['shift']());}};_0x371bdb(++_0x40a449);}(_0x8ecd,0xf7));var _0xd8ec=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0x8ecd[_0x393500];return _0x120d3b;};'use strict';var util=require('util');var passport=require(_0xd8ec('0x0'));var LocalStrategy=require(_0xd8ec('0x1'))[_0xd8ec('0x2')];var jayson=require(_0xd8ec('0x3'));var _=require(_0xd8ec('0x4'));var rs=require(_0xd8ec('0x5'));var moment=require(_0xd8ec('0x6'));var db=require(_0xd8ec('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xd8ec('0x8'));var client=jayson['client'][_0xd8ec('0x9')]({'port':0x232b});function localAuthenticate(_0x395846,_0x5b577b,_0x50c391,_0x2ccf72){var _0x16a29c,_0x53427c;return db[_0xd8ec('0xa')][_0xd8ec('0xb')]({'where':{'id':0x1},'attributes':[_0xd8ec('0xc'),_0xd8ec('0xd')],'raw':!![]})[_0xd8ec('0xe')](function(_0x1f4571){_0x16a29c=_0x1f4571;return _0x395846[_0xd8ec('0xb')]({'attributes':['id',_0xd8ec('0xf'),_0xd8ec('0x10'),_0xd8ec('0x11'),_0xd8ec('0x12'),'disabled','blocked',_0xd8ec('0x13'),'loginAttempts'],'where':{'name':_0x5b577b,'role':{'$or':[_0xd8ec('0x14'),_0xd8ec('0x15'),_0xd8ec('0x16')]}}});})[_0xd8ec('0xe')](function(_0x1732ab){if(!_0x1732ab||_0x1732ab&&_0x1732ab[_0xd8ec('0xf')]!==_0x5b577b){throw new Error(_0xd8ec('0x17'));}else{_0x53427c=_0x1732ab;return _0x53427c;}})[_0xd8ec('0xe')](function(){_0x53427c[_0xd8ec('0x18')](_0x50c391,function(_0x359088,_0x42a6e9){var _0x2769bc=_0x53427c['loginAttempts']+0x1;if(_0x359088){return _0x2ccf72(_0x359088);}else if(!_0x42a6e9){if(_0x53427c['disabled']){return _0x2ccf72(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x16a29c[_0xd8ec('0xc')]>0x0){if(_0x53427c['blocked']){if(_0x16a29c[_0xd8ec('0xd')]>0x0){if(moment(_0x53427c[_0xd8ec('0x13')])[_0xd8ec('0x19')](_0x16a29c['blockDuration'],'minutes')>moment()){return _0x2ccf72(null,![],{'message':_0xd8ec('0x17')});}else{return utils[_0xd8ec('0x1a')](_0x53427c,_0x2769bc,![],null)[_0xd8ec('0xe')](function(){return _0x2ccf72(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2ccf72(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2769bc>=_0x16a29c[_0xd8ec('0xc')]){return utils[_0xd8ec('0x1a')](_0x53427c,0x0,!![],moment())[_0xd8ec('0xe')](function(){return _0x2ccf72(null,![],{'message':_0xd8ec('0x17')});});}else{return utils[_0xd8ec('0x1a')](_0x53427c,_0x2769bc,![],null)[_0xd8ec('0xe')](function(){return _0x2ccf72(null,![],{'message':_0xd8ec('0x17')});});}}}else{return _0x2ccf72(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x53427c[_0xd8ec('0x1b')]){return _0x2ccf72(null,![],{'message':_0xd8ec('0x17')});}else if(_0x16a29c[_0xd8ec('0xc')]>0x0){if(_0x53427c['blocked']){if(_0x16a29c['blockDuration']>0x0){if(moment(_0x53427c['blockedAt'])['add'](_0x16a29c['blockDuration'],'minutes')>moment()){return _0x2ccf72(null,![],{'message':_0xd8ec('0x17')});}else{return utils[_0xd8ec('0x1a')](_0x53427c,0x0,![],null)[_0xd8ec('0xe')](function(){return utils[_0xd8ec('0x1c')](_0x53427c);})['then'](function(){return _0x2ccf72(null,_0x53427c);});}}else{return _0x2ccf72(null,![],{'message':_0xd8ec('0x17')});}}else{return utils['clearBlockUser'](_0x53427c,0x0,![],null)[_0xd8ec('0xe')](function(){return utils['getLicense'](_0x53427c);})[_0xd8ec('0xe')](function(){return _0x2ccf72(null,_0x53427c);})['catch'](function(_0x365579){return _0x2ccf72(null,![],_0x365579);});}}else{if(_0x53427c[_0xd8ec('0x1d')]){return _0x2ccf72(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x53427c)[_0xd8ec('0xe')](function(){return _0x2ccf72(null,_0x53427c);});}}}});})[_0xd8ec('0x1e')](function(_0x2511aa){return _0x2ccf72(null,![],_0x2511aa);});}function sendServiceMail(_0x33a7c1){return db['MailAccount'][_0xd8ec('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xd8ec('0xf'),_0xd8ec('0x20')],'include':[{'model':db[_0xd8ec('0x21')],'as':'Smtp'}]})[_0xd8ec('0xe')](function(_0x240904){if(!_0x240904){throw new Error(_0xd8ec('0x22'));}var _0x3fa272={'tls':{'rejectUnauthorized':![]}};if(_0x240904[_0xd8ec('0x23')][_0xd8ec('0x24')]){_0x3fa272[_0xd8ec('0x24')]=_0x240904[_0xd8ec('0x23')][_0xd8ec('0x24')];}else{_0x3fa272[_0xd8ec('0x25')]=_0x240904[_0xd8ec('0x23')]['host'];_0x3fa272[_0xd8ec('0x26')]=_0x240904[_0xd8ec('0x23')][_0xd8ec('0x26')];_0x3fa272['secure']=_0x240904['Smtp']['secure'];}if(_0x240904[_0xd8ec('0x23')][_0xd8ec('0x27')]){_0x3fa272['auth']={'user':_0x240904[_0xd8ec('0x23')][_0xd8ec('0x15')],'pass':_0x240904['Smtp'][_0xd8ec('0x28')]};}var _0x5b3d3a={'account':_0x3fa272,'message':_['merge']({'from':util[_0xd8ec('0x29')](_0xd8ec('0x2a'),_0x240904[_0xd8ec('0xf')],_0x240904[_0xd8ec('0x20')]||_0x240904[_0xd8ec('0x23')][_0xd8ec('0x15')])},_0x33a7c1)};return client[_0xd8ec('0x2b')]('SendMail',_0x5b3d3a);})[_0xd8ec('0xe')](function(_0x29b12b){if(_0x29b12b[_0xd8ec('0x2c')]){throw new Error(util[_0xd8ec('0x29')](_0xd8ec('0x2d'),_0x29b12b[_0xd8ec('0x2c')][_0xd8ec('0x2e')]||JSON[_0xd8ec('0x2f')](_0x29b12b[_0xd8ec('0x2c')])));}return!![];});}function handleError(_0x227e04,_0x3e5678,_0x1c3616){return _0x227e04[_0xd8ec('0x30')](_0x3e5678||0x1f4)[_0xd8ec('0x31')]({'message':_0x1c3616?_0x1c3616[_0xd8ec('0x2e')]||_0x1c3616:''});}exports[_0xd8ec('0x32')]=function(_0x53f016,_0x2f6fb8,_0x19a380){passport[_0xd8ec('0x18')](_0xd8ec('0x33'),function(_0x112599,_0x13e27d,_0x13ef65){var _0x4b6396=_0x112599||_0x13ef65;if(_0x4b6396){return handleError(_0x2f6fb8,0x191,_0x4b6396);}if(!_0x13e27d){return handleError(_0x2f6fb8,0x194,{'message':_0xd8ec('0x34')});}else{var _0x34f341={'payload':{'id':_0x13e27d['id'],'role':_0x13e27d[_0xd8ec('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x34f341)[_0xd8ec('0xe')](function(_0x289ed9){_0x2f6fb8['json']({'id':_0x13e27d['id'],'token':_0x289ed9,'statusCall':'','isAlreadyLogged':_0x13e27d[_0xd8ec('0x35')]});});}})(_0x53f016,_0x2f6fb8,_0x19a380);};exports[_0xd8ec('0x36')]=function(_0x3a36f3,_0x31d043,_0x21b2c2){if(!_0x3a36f3[_0xd8ec('0x37')][_0xd8ec('0x20')]){return handleError(_0x31d043,0x1f4,{'message':_0xd8ec('0x38')});}var _0x2dddaf=rs[_0xd8ec('0x39')]();_0x3a36f3['body'][_0xd8ec('0x20')]=_0x3a36f3[_0xd8ec('0x37')]['email'][_0xd8ec('0x3a')]()[_0xd8ec('0x3b')]();var _0x1ccee4;return db[_0xd8ec('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd8ec('0xd')],'raw':!![]})[_0xd8ec('0xe')](function(_0x23f428){_0x1ccee4=_0x23f428;return db['User'][_0xd8ec('0x1f')]({'where':{'email':_0x3a36f3[_0xd8ec('0x37')][_0xd8ec('0x20')]}});})['then'](function(_0x43524c){if(!_0x43524c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x43524c[_0xd8ec('0x1b')]){throw new Error(_0xd8ec('0x3c'));}if(_0x43524c[_0xd8ec('0x1d')]){if(moment(_0x43524c[_0xd8ec('0x13')])['add'](_0x1ccee4[_0xd8ec('0xd')],_0xd8ec('0x3d'))>moment()){throw new Error(_0xd8ec('0x3e'));}else{_0x43524c['blocked']=![];_0x43524c['blockedAt']=null;}}_0x43524c[_0xd8ec('0x3f')]=_0x2dddaf;_0x43524c[_0xd8ec('0x40')]=Date[_0xd8ec('0x41')]()+0x36ee80;return _0x43524c['save']();})[_0xd8ec('0xe')](function(){return sendServiceMail({'to':_0x3a36f3[_0xd8ec('0x37')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xd8ec('0x42')+_0xd8ec('0x43')+_0xd8ec('0x44')+_0x3a36f3['headers'][_0xd8ec('0x25')]+'/reset/'+_0x2dddaf+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xd8ec('0xe')](function(){_0x31d043['status'](0xc8)[_0xd8ec('0x31')]({'message':_0xd8ec('0x45')});})[_0xd8ec('0x1e')](function(_0x5a6bb8){return handleError(_0x31d043,0x1f4,_0x5a6bb8);});};exports[_0xd8ec('0x46')]=function(_0x5c484c,_0x3af6cc,_0x14d785){return db['User'][_0xd8ec('0x1f')]({'where':{'resetPasswordToken':_0x5c484c[_0xd8ec('0x47')][_0xd8ec('0x48')],'resetPasswordExpires':{'$gt':Date[_0xd8ec('0x41')]()}}})[_0xd8ec('0xe')](function(_0x38c3f1){if(!_0x38c3f1){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xd8ec('0xa')]['findOne']({'attributes':['id','securePassword',_0xd8ec('0x49'),_0xd8ec('0x4a')]})[_0xd8ec('0xe')](function(_0x36b9ba){if(_0x36b9ba[_0xd8ec('0x4b')])authService[_0xd8ec('0x4c')](_0x5c484c[_0xd8ec('0x37')]['password']);if(!_0x36b9ba['enforcePasswordHistory']||!_0x38c3f1[_0xd8ec('0x4d')])return _0x38c3f1;authService['validatePasswordHistory'](_0x5c484c[_0xd8ec('0x37')][_0xd8ec('0x10')],_0x38c3f1[_0xd8ec('0x4d')],_0x36b9ba[_0xd8ec('0x4a')]);return _0x38c3f1;})[_0xd8ec('0xe')](function(){_0x38c3f1[_0xd8ec('0x10')]=_0x5c484c[_0xd8ec('0x37')][_0xd8ec('0x10')];_0x38c3f1[_0xd8ec('0x3f')]=null;_0x38c3f1[_0xd8ec('0x40')]=null;return _0x38c3f1[_0xd8ec('0x4e')]();});})[_0xd8ec('0xe')](function(){_0x3af6cc['status'](0xc8)[_0xd8ec('0x31')]({'message':'Password\x20reset!'});})[_0xd8ec('0x1e')](function(_0x4f2e0){return handleError(_0x3af6cc,0x1f4,_0x4f2e0);});};passport[_0xd8ec('0x4f')](_0xd8ec('0x33'),new LocalStrategy({'usernameField':_0xd8ec('0xf'),'passwordField':_0xd8ec('0x10')},function(_0x30c25b,_0x2150d1,_0x31c15a){return localAuthenticate(db['User'],_0x30c25b,_0x2150d1,_0x31c15a);}));
\ No newline at end of file
+var _0x64e1=['name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','Smtp','service','secure','authentication','auth','user','pass','merge','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','Setting','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','resetPasswordExpires','Password\x20reset!','use','util','passport','lodash','randomstring','../../mysqldb','../../components/auth/service','client','http','allowedLoginAttempts','blockDuration','findOne'];(function(_0xc8bf1a,_0x43f6dd){var _0x206e52=function(_0x3d4498){while(--_0x3d4498){_0xc8bf1a['push'](_0xc8bf1a['shift']());}};_0x206e52(++_0x43f6dd);}(_0x64e1,0x9d));var _0x164e=function(_0x231ede,_0x4856bb){_0x231ede=_0x231ede-0x0;var _0x3fdd8a=_0x64e1[_0x231ede];return _0x3fdd8a;};'use strict';var util=require(_0x164e('0x0'));var passport=require(_0x164e('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require('jayson/promise');var _=require(_0x164e('0x2'));var rs=require(_0x164e('0x3'));var moment=require('moment');var db=require(_0x164e('0x4'))['db'];var authService=require(_0x164e('0x5'));var utils=require('../../config/utils');var client=jayson[_0x164e('0x6')][_0x164e('0x7')]({'port':0x232b});function localAuthenticate(_0xed8b56,_0x1a5175,_0x430444,_0x18c2c1){var _0x2b519c,_0x1d8d20;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x164e('0x8'),_0x164e('0x9')],'raw':!![]})['then'](function(_0x514a45){_0x2b519c=_0x514a45;return _0xed8b56[_0x164e('0xa')]({'attributes':['id',_0x164e('0xb'),_0x164e('0xc'),_0x164e('0xd'),_0x164e('0xe'),_0x164e('0xf'),_0x164e('0x10'),_0x164e('0x11'),_0x164e('0x12')],'where':{'name':_0x1a5175,'role':{'$or':[_0x164e('0x13'),'user',_0x164e('0x14')]}}});})[_0x164e('0x15')](function(_0x6e6d4c){if(!_0x6e6d4c||_0x6e6d4c&&_0x6e6d4c[_0x164e('0xb')]!==_0x1a5175){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1d8d20=_0x6e6d4c;return _0x1d8d20;}})[_0x164e('0x15')](function(){_0x1d8d20[_0x164e('0x16')](_0x430444,function(_0x2f643c,_0x173ae6){var _0x2fca3d=_0x1d8d20[_0x164e('0x12')]+0x1;if(_0x2f643c){return _0x18c2c1(_0x2f643c);}else if(!_0x173ae6){if(_0x1d8d20[_0x164e('0xf')]){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}else if(_0x2b519c[_0x164e('0x8')]>0x0){if(_0x1d8d20[_0x164e('0x10')]){if(_0x2b519c[_0x164e('0x9')]>0x0){if(moment(_0x1d8d20[_0x164e('0x11')])[_0x164e('0x18')](_0x2b519c[_0x164e('0x9')],_0x164e('0x19'))>moment()){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}else{return utils[_0x164e('0x1a')](_0x1d8d20,_0x2fca3d,![],null)['then'](function(){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});});}}else{return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}}else{if(_0x2fca3d>=_0x2b519c[_0x164e('0x8')]){return utils['clearBlockUser'](_0x1d8d20,0x0,!![],moment())[_0x164e('0x15')](function(){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});});}else{return utils[_0x164e('0x1a')](_0x1d8d20,_0x2fca3d,![],null)[_0x164e('0x15')](function(){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});});}}}else{return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}}else{if(_0x1d8d20[_0x164e('0xf')]){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}else if(_0x2b519c[_0x164e('0x8')]>0x0){if(_0x1d8d20[_0x164e('0x10')]){if(_0x2b519c['blockDuration']>0x0){if(moment(_0x1d8d20[_0x164e('0x11')])[_0x164e('0x18')](_0x2b519c[_0x164e('0x9')],_0x164e('0x19'))>moment()){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}else{return utils[_0x164e('0x1a')](_0x1d8d20,0x0,![],null)[_0x164e('0x15')](function(){return utils[_0x164e('0x1b')](_0x1d8d20);})[_0x164e('0x15')](function(){return _0x18c2c1(null,_0x1d8d20);});}}else{return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}}else{return utils[_0x164e('0x1a')](_0x1d8d20,0x0,![],null)[_0x164e('0x15')](function(){return utils[_0x164e('0x1b')](_0x1d8d20);})[_0x164e('0x15')](function(){return _0x18c2c1(null,_0x1d8d20);})[_0x164e('0x1c')](function(_0x5155ba){return _0x18c2c1(null,![],_0x5155ba);});}}else{if(_0x1d8d20[_0x164e('0x10')]){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}else{return utils[_0x164e('0x1b')](_0x1d8d20)[_0x164e('0x15')](function(){return _0x18c2c1(null,_0x1d8d20);});}}}});})['catch'](function(_0x2861b9){return _0x18c2c1(null,![],_0x2861b9);});}function sendServiceMail(_0x171333){return db[_0x164e('0x1d')]['find']({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0x164e('0x1e')}]})[_0x164e('0x15')](function(_0x49d8ef){if(!_0x49d8ef){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x81c96a={'tls':{'rejectUnauthorized':![]}};if(_0x49d8ef[_0x164e('0x1e')][_0x164e('0x1f')]){_0x81c96a[_0x164e('0x1f')]=_0x49d8ef[_0x164e('0x1e')][_0x164e('0x1f')];}else{_0x81c96a['host']=_0x49d8ef[_0x164e('0x1e')]['host'];_0x81c96a['port']=_0x49d8ef[_0x164e('0x1e')]['port'];_0x81c96a['secure']=_0x49d8ef[_0x164e('0x1e')][_0x164e('0x20')];}if(_0x49d8ef[_0x164e('0x1e')][_0x164e('0x21')]){_0x81c96a[_0x164e('0x22')]={'user':_0x49d8ef[_0x164e('0x1e')][_0x164e('0x23')],'pass':_0x49d8ef[_0x164e('0x1e')][_0x164e('0x24')]};}var _0x3589ad={'account':_0x81c96a,'message':_[_0x164e('0x25')]({'from':util['format'](_0x164e('0x26'),_0x49d8ef[_0x164e('0xb')],_0x49d8ef[_0x164e('0x27')]||_0x49d8ef[_0x164e('0x1e')]['user'])},_0x171333)};return client[_0x164e('0x28')](_0x164e('0x29'),_0x3589ad);})[_0x164e('0x15')](function(_0x4b6c19){if(_0x4b6c19[_0x164e('0x2a')]){throw new Error(util['format'](_0x164e('0x2b'),_0x4b6c19['error']['message']||JSON[_0x164e('0x2c')](_0x4b6c19[_0x164e('0x2a')])));}return!![];});}function handleError(_0x10f2ba,_0x231b16,_0x20f9cd){return _0x10f2ba[_0x164e('0x2d')](_0x231b16||0x1f4)[_0x164e('0x2e')]({'message':_0x20f9cd?_0x20f9cd['message']||_0x20f9cd:''});}exports[_0x164e('0x2f')]=function(_0x16fdb2,_0x1994e9,_0x387206){passport[_0x164e('0x16')](_0x164e('0x30'),function(_0x2de146,_0x5805e7,_0x8ebf7c){var _0x3562f4=_0x2de146||_0x8ebf7c;if(_0x3562f4){return handleError(_0x1994e9,0x191,_0x3562f4);}if(!_0x5805e7){return handleError(_0x1994e9,0x194,{'message':_0x164e('0x31')});}else{var _0x1d799d={'payload':{'id':_0x5805e7['id'],'role':_0x5805e7[_0x164e('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x164e('0x32')](_0x1d799d)[_0x164e('0x15')](function(_0x59d30e){_0x1994e9[_0x164e('0x33')]({'id':_0x5805e7['id'],'token':_0x59d30e,'statusCall':'','isAlreadyLogged':_0x5805e7[_0x164e('0x34')]});});}})(_0x16fdb2,_0x1994e9,_0x387206);};exports[_0x164e('0x35')]=function(_0x380c92,_0x11eaca,_0x435c20){if(!_0x380c92['body'][_0x164e('0x27')]){return handleError(_0x11eaca,0x1f4,{'message':_0x164e('0x36')});}var _0x17d55d=rs[_0x164e('0x37')]();_0x380c92['body']['email']=_0x380c92[_0x164e('0x38')][_0x164e('0x27')][_0x164e('0x39')]()[_0x164e('0x3a')]();var _0x2ec6d5;return db[_0x164e('0x3b')]['findOne']({'where':{'id':0x1},'attributes':[_0x164e('0x8'),_0x164e('0x9')],'raw':!![]})[_0x164e('0x15')](function(_0x20fa67){_0x2ec6d5=_0x20fa67;return db[_0x164e('0x3c')][_0x164e('0x3d')]({'where':{'email':_0x380c92[_0x164e('0x38')][_0x164e('0x27')]}});})[_0x164e('0x15')](function(_0x462a8b){if(!_0x462a8b){throw new Error(_0x164e('0x3e'));}if(_0x462a8b['disabled']){throw new Error(_0x164e('0x3f'));}if(_0x462a8b['blocked']){if(moment(_0x462a8b['blockedAt'])[_0x164e('0x18')](_0x2ec6d5[_0x164e('0x9')],'minutes')>moment()){throw new Error(_0x164e('0x40'));}else{_0x462a8b[_0x164e('0x10')]=![];_0x462a8b[_0x164e('0x11')]=null;}}_0x462a8b[_0x164e('0x41')]=_0x17d55d;_0x462a8b['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x462a8b[_0x164e('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x380c92[_0x164e('0x38')][_0x164e('0x27')],'subject':_0x164e('0x43'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x164e('0x44')+_0x164e('0x45')+_0x380c92[_0x164e('0x46')][_0x164e('0x47')]+_0x164e('0x48')+_0x17d55d+'\x0a\x0a'+_0x164e('0x49')});})['then'](function(){_0x11eaca[_0x164e('0x2d')](0xc8)[_0x164e('0x2e')]({'message':_0x164e('0x4a')});})[_0x164e('0x1c')](function(_0x5ba043){return handleError(_0x11eaca,0x1f4,_0x5ba043);});};exports['reset']=function(_0x5e8cc6,_0x2ba370,_0x5cfd8c){return db[_0x164e('0x3c')][_0x164e('0x3d')]({'where':{'resetPasswordToken':_0x5e8cc6['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x164e('0x4b')]()}}})[_0x164e('0x15')](function(_0x2ca490){if(!_0x2ca490){throw new Error(_0x164e('0x4c'));}return db[_0x164e('0x3b')][_0x164e('0xa')]({'attributes':['id',_0x164e('0x4d'),'enforcePasswordHistory',_0x164e('0x4e')]})[_0x164e('0x15')](function(_0x348a50){if(_0x348a50['securePassword'])authService['validatePasswordPattern'](_0x5e8cc6['body']['password']);if(!_0x348a50[_0x164e('0x4f')]||!_0x2ca490[_0x164e('0x50')])return _0x2ca490;authService['validatePasswordHistory'](_0x5e8cc6[_0x164e('0x38')][_0x164e('0xc')],_0x2ca490['previousPasswords'],_0x348a50[_0x164e('0x4e')]);return _0x2ca490;})[_0x164e('0x15')](function(){_0x2ca490['password']=_0x5e8cc6[_0x164e('0x38')][_0x164e('0xc')];_0x2ca490['resetPasswordToken']=null;_0x2ca490[_0x164e('0x51')]=null;return _0x2ca490[_0x164e('0x42')]();});})[_0x164e('0x15')](function(){_0x2ba370['status'](0xc8)['send']({'message':_0x164e('0x52')});})[_0x164e('0x1c')](function(_0x44c03e){return handleError(_0x2ba370,0x1f4,_0x44c03e);});};passport[_0x164e('0x53')](_0x164e('0x30'),new LocalStrategy({'usernameField':_0x164e('0xb'),'passwordField':_0x164e('0xc')},function(_0xe1f9ec,_0xe49dc7,_0x28c2f1){return localAuthenticate(db[_0x164e('0x3c')],_0xe1f9ec,_0xe49dc7,_0x28c2f1);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index d7e9e46..1198bce 100644
--- a/server/api/authLocal/index.js
+++ b/server/api/authLocal/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x996d=['forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post','/forgot'];(function(_0xf4bfc4,_0x2972e9){var _0x1e3353=function(_0x495ad3){while(--_0x495ad3){_0xf4bfc4['push'](_0xf4bfc4['shift']());}};_0x1e3353(++_0x2972e9);}(_0x996d,0x9d));var _0xd996=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x996d[_0x17928f];return _0x500b63;};'use strict';var express=require(_0xd996('0x0'));var router=express[_0xd996('0x1')]();var controller=require(_0xd996('0x2'));router['post']('/',controller['login']);router[_0xd996('0x3')](_0xd996('0x4'),controller[_0xd996('0x5')]);router['post'](_0xd996('0x6'),controller[_0xd996('0x7')]);module[_0xd996('0x8')]=router;
\ No newline at end of file
+var _0x05a8=['./authLocal.controller','post','forgot','/reset/:token','exports','express','Router'];(function(_0x5a1aea,_0x28b3c9){var _0x8e73ce=function(_0x453f6c){while(--_0x453f6c){_0x5a1aea['push'](_0x5a1aea['shift']());}};_0x8e73ce(++_0x28b3c9);}(_0x05a8,0x1e8));var _0x805a=function(_0x2e6267,_0x441579){_0x2e6267=_0x2e6267-0x0;var _0x55c699=_0x05a8[_0x2e6267];return _0x55c699;};'use strict';var express=require(_0x805a('0x0'));var router=express[_0x805a('0x1')]();var controller=require(_0x805a('0x2'));router[_0x805a('0x3')]('/',controller['login']);router[_0x805a('0x3')]('/forgot',controller[_0x805a('0x4')]);router[_0x805a('0x3')](_0x805a('0x5'),controller['reset']);module[_0x805a('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index ff9c5bb..8f8311d 100644
--- a/server/api/automation/automation.attributes.js
+++ b/server/api/automation/automation.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb4b=['exports','STRING','INTEGER','sequelize'];(function(_0x9537ff,_0x565939){var _0x548a6f=function(_0x52f094){while(--_0x52f094){_0x9537ff['push'](_0x9537ff['shift']());}};_0x548a6f(++_0x565939);}(_0xcb4b,0xab));var _0xbcb4=function(_0xceda8c,_0x42e367){_0xceda8c=_0xceda8c-0x0;var _0x3fa307=_0xcb4b[_0xceda8c];return _0x3fa307;};'use strict';var Sequelize=require(_0xbcb4('0x0'));module[_0xbcb4('0x1')]={'name':{'type':Sequelize[_0xbcb4('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xbcb4('0x2')]},'description':{'type':Sequelize[_0xbcb4('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbcb4('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x8c58=['STRING','BOOLEAN','sequelize'];(function(_0x30f6ed,_0x417bde){var _0x393e89=function(_0x25eabc){while(--_0x25eabc){_0x30f6ed['push'](_0x30f6ed['shift']());}};_0x393e89(++_0x417bde);}(_0x8c58,0xc2));var _0x88c5=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x8c58[_0x4c0622];return _0x1799d8;};'use strict';var Sequelize=require(_0x88c5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x88c5('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x88c5('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 963e4e0..d74ed18 100644
--- a/server/api/automation/automation.controller.js
+++ b/server/api/automation/automation.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x222e=['getActions','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','map','Automation','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','intersection','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action'];(function(_0x22099d,_0x409006){var _0x10f602=function(_0x2c1f6f){while(--_0x2c1f6f){_0x22099d['push'](_0x22099d['shift']());}};_0x10f602(++_0x409006);}(_0x222e,0x149));var _0xe222=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x222e[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xe222('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe222('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe222('0x2'));var Mustache=require(_0xe222('0x3'));var util=require(_0xe222('0x4'));var path=require(_0xe222('0x5'));var sox=require(_0xe222('0x6'));var csv=require(_0xe222('0x7'));var ejs=require(_0xe222('0x8'));var fs=require('fs');var fs_extra=require(_0xe222('0x9'));var _=require(_0xe222('0xa'));var squel=require(_0xe222('0xb'));var crypto=require(_0xe222('0xc'));var jsforce=require(_0xe222('0xd'));var deskjs=require(_0xe222('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe222('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe222('0x10'));var qs=require(_0xe222('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe222('0x12'))(_0xe222('0x13'));var utils=require(_0xe222('0x14'));var config=require(_0xe222('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x136de2,_0x32fde3){_0x32fde3=_0x32fde3||0xcc;return function(_0x5bab1b){if(_0x5bab1b){return _0x136de2[_0xe222('0x16')](_0x32fde3);}return _0x136de2[_0xe222('0x17')](_0x32fde3)[_0xe222('0x18')]();};}function respondWithResult(_0x46012b,_0x231327){_0x231327=_0x231327||0xc8;return function(_0x67dde){if(_0x67dde){return _0x46012b[_0xe222('0x17')](_0x231327)['json'](_0x67dde);}};}function respondWithFilteredResult(_0x10cb4a,_0x562c2e){return function(_0x4f84d0){if(_0x4f84d0){var _0xdcfbfe=typeof _0x562c2e[_0xe222('0x19')]==='undefined'&&typeof _0x562c2e[_0xe222('0x1a')]===_0xe222('0x1b');var _0x54a8aa=_0x4f84d0[_0xe222('0x1c')];var _0x170bf8=_0xdcfbfe?0x0:_0x562c2e[_0xe222('0x19')];var _0x45393f=_0xdcfbfe?_0x4f84d0[_0xe222('0x1c')]:_0x562c2e[_0xe222('0x19')]+_0x562c2e[_0xe222('0x1a')];var _0x49086e;if(_0x45393f>=_0x54a8aa){_0x45393f=_0x54a8aa;_0x49086e=0xc8;}else{_0x49086e=0xce;}_0x10cb4a['status'](_0x49086e);return _0x10cb4a[_0xe222('0x1d')](_0xe222('0x1e'),_0x170bf8+'-'+_0x45393f+'/'+_0x54a8aa)[_0xe222('0x1f')](_0x4f84d0);}return null;};}function patchUpdates(_0x44d59b){return function(_0x4f21f6){try{jsonpatch[_0xe222('0x20')](_0x4f21f6,_0x44d59b,!![]);}catch(_0x51dade){return BPromise[_0xe222('0x21')](_0x51dade);}return _0x4f21f6[_0xe222('0x22')]();};}function saveUpdates(_0xd04c25,_0x25a7e3){return function(_0x37cca9){if(_0x37cca9){return _0x37cca9[_0xe222('0x23')](_0xd04c25)[_0xe222('0x24')](function(_0x4ac92f){return _0x4ac92f;});}return null;};}function removeEntity(_0x153bfb,_0x3e84e2){return function(_0x2ea778){if(_0x2ea778){return _0x2ea778[_0xe222('0x25')]()['then'](function(){_0x153bfb['status'](0xcc)[_0xe222('0x18')]();});}};}function handleEntityNotFound(_0x19849b,_0x5194ff){return function(_0x98b0be){if(!_0x98b0be){_0x19849b[_0xe222('0x16')](0x194);}return _0x98b0be;};}function handleError(_0x21620a,_0x3c4b3f){_0x3c4b3f=_0x3c4b3f||0x1f4;return function(_0x3520b7){logger['error'](_0x3520b7['stack']);if(_0x3520b7['name']){delete _0x3520b7[_0xe222('0x26')];}_0x21620a[_0xe222('0x17')](_0x3c4b3f)[_0xe222('0x27')](_0x3520b7);};}exports[_0xe222('0x28')]=function(_0x17ef71,_0x3114fa){var _0x40cd1f={},_0x3c6c95={},_0x52dea1={'count':0x0,'rows':[]};var _0x53f8c6=_[_0xe222('0x29')](db[_0xe222('0x2a')][_0xe222('0x2b')],function(_0x3c1779){return{'name':_0x3c1779[_0xe222('0x2c')],'type':_0x3c1779[_0xe222('0x2d')]['key']};});_0x3c6c95[_0xe222('0x2e')]=_[_0xe222('0x29')](_0x53f8c6,_0xe222('0x26'));_0x3c6c95[_0xe222('0x2f')]=_[_0xe222('0x30')](_0x17ef71[_0xe222('0x2f')]);_0x3c6c95[_0xe222('0x31')]=_['intersection'](_0x3c6c95[_0xe222('0x2e')],_0x3c6c95[_0xe222('0x2f')]);_0x40cd1f[_0xe222('0x32')]=_['intersection'](_0x3c6c95[_0xe222('0x2e')],qs[_0xe222('0x33')](_0x17ef71[_0xe222('0x2f')][_0xe222('0x33')]));_0x40cd1f[_0xe222('0x32')]=_0x40cd1f['attributes'][_0xe222('0x34')]?_0x40cd1f[_0xe222('0x32')]:_0x3c6c95[_0xe222('0x2e')];if(!_0x17ef71[_0xe222('0x2f')][_0xe222('0x35')](_0xe222('0x36'))){_0x40cd1f[_0xe222('0x1a')]=qs[_0xe222('0x1a')](_0x17ef71[_0xe222('0x2f')][_0xe222('0x1a')]);_0x40cd1f[_0xe222('0x19')]=qs[_0xe222('0x19')](_0x17ef71[_0xe222('0x2f')][_0xe222('0x19')]);}_0x40cd1f[_0xe222('0x37')]=qs[_0xe222('0x38')](_0x17ef71['query']['sort']);_0x40cd1f[_0xe222('0x39')]=qs[_0xe222('0x31')](_[_0xe222('0x3a')](_0x17ef71[_0xe222('0x2f')],_0x3c6c95[_0xe222('0x31')]),_0x53f8c6);if(_0x17ef71[_0xe222('0x2f')]['filter']){_0x40cd1f[_0xe222('0x39')]=_[_0xe222('0x3b')](_0x40cd1f[_0xe222('0x39')],{'$or':_[_0xe222('0x29')](_0x53f8c6,function(_0x5c50c2){if(_0x5c50c2[_0xe222('0x2d')]!==_0xe222('0x3c')){var _0xa1a6e9={};_0xa1a6e9[_0x5c50c2[_0xe222('0x26')]]={'$like':'%'+_0x17ef71[_0xe222('0x2f')][_0xe222('0x3d')]+'%'};return _0xa1a6e9;}})});}_0x40cd1f=_[_0xe222('0x3b')]({},_0x40cd1f,_0x17ef71[_0xe222('0x3e')]);var _0x130409={'where':_0x40cd1f[_0xe222('0x39')]};return db[_0xe222('0x2a')][_0xe222('0x1c')](_0x130409)[_0xe222('0x24')](function(_0x2944be){_0x52dea1['count']=_0x2944be;if(_0x17ef71['query'][_0xe222('0x3f')]){_0x40cd1f[_0xe222('0x40')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x40cd1f);})[_0xe222('0x24')](function(_0x379cd0){_0x52dea1[_0xe222('0x41')]=_0x379cd0;return _0x52dea1;})[_0xe222('0x24')](respondWithFilteredResult(_0x3114fa,_0x40cd1f))[_0xe222('0x42')](handleError(_0x3114fa,null));};exports[_0xe222('0x43')]=function(_0x168fe7,_0x309f46){var _0x495800={'raw':![],'where':{'id':_0x168fe7[_0xe222('0x44')]['id']}},_0x1deb7e={};_0x1deb7e[_0xe222('0x2e')]=_['keys'](db[_0xe222('0x2a')][_0xe222('0x2b')]);_0x1deb7e[_0xe222('0x2f')]=_['keys'](_0x168fe7[_0xe222('0x2f')]);_0x1deb7e[_0xe222('0x31')]=_[_0xe222('0x45')](_0x1deb7e[_0xe222('0x2e')],_0x1deb7e[_0xe222('0x2f')]);_0x495800[_0xe222('0x32')]=_[_0xe222('0x45')](_0x1deb7e[_0xe222('0x2e')],qs[_0xe222('0x33')](_0x168fe7[_0xe222('0x2f')][_0xe222('0x33')]));_0x495800[_0xe222('0x32')]=_0x495800[_0xe222('0x32')][_0xe222('0x34')]?_0x495800[_0xe222('0x32')]:_0x1deb7e['model'];if(_0x168fe7[_0xe222('0x2f')]['includeAll']){_0x495800['include']=[{'all':!![]}];}_0x495800=_[_0xe222('0x3b')]({},_0x495800,_0x168fe7['options']);return db[_0xe222('0x2a')]['find'](_0x495800)[_0xe222('0x24')](handleEntityNotFound(_0x309f46,null))['then'](respondWithResult(_0x309f46,null))['catch'](handleError(_0x309f46,null));};exports['create']=function(_0xff65c0,_0x372d7e){return db[_0xe222('0x2a')][_0xe222('0x46')](_0xff65c0[_0xe222('0x47')],{})['then'](respondWithResult(_0x372d7e,0xc9))['catch'](handleError(_0x372d7e,null));};exports[_0xe222('0x23')]=function(_0x43704e,_0x42efe6){if(_0x43704e[_0xe222('0x47')]['id']){delete _0x43704e[_0xe222('0x47')]['id'];}return db[_0xe222('0x2a')]['find']({'where':{'id':_0x43704e[_0xe222('0x44')]['id']}})[_0xe222('0x24')](handleEntityNotFound(_0x42efe6,null))[_0xe222('0x24')](saveUpdates(_0x43704e[_0xe222('0x47')],null))[_0xe222('0x24')](respondWithResult(_0x42efe6,null))[_0xe222('0x42')](handleError(_0x42efe6,null));};exports[_0xe222('0x25')]=function(_0x253eae,_0xccd460){return db[_0xe222('0x2a')][_0xe222('0x48')]({'where':{'id':_0x253eae['params']['id']}})[_0xe222('0x24')](handleEntityNotFound(_0xccd460,null))['then'](removeEntity(_0xccd460,null))[_0xe222('0x42')](handleError(_0xccd460,null));};exports[_0xe222('0x49')]=function(_0xa355ad,_0x11a5ce,_0x1a3c0a){return db[_0xe222('0x4a')][_0xe222('0x48')]({'where':{'id':_0xa355ad[_0xe222('0x44')]['id']}})[_0xe222('0x24')](handleEntityNotFound(_0x11a5ce,null))['then'](function(_0x197690){if(_0x197690){return _0x197690[_0xe222('0x49')](_0xa355ad[_0xe222('0x47')][_0xe222('0x4b')],_[_0xe222('0x4c')](_0xa355ad[_0xe222('0x47')],[_0xe222('0x4b'),'id'])||{});}})[_0xe222('0x24')](respondWithResult(_0x11a5ce,null))[_0xe222('0x42')](handleError(_0x11a5ce,null));};exports[_0xe222('0x4d')]=function(_0x389b36,_0x2673f1,_0x3c0a0c){var _0x19c9ee={};var _0xbc00ee={};var _0x5b24c7;var _0x268a2d;return db[_0xe222('0x2a')][_0xe222('0x4e')]({'where':{'id':_0x389b36[_0xe222('0x44')]['id']}})[_0xe222('0x24')](handleEntityNotFound(_0x2673f1,null))[_0xe222('0x24')](function(_0x327ba9){if(_0x327ba9){_0x5b24c7=_0x327ba9;_0xbc00ee[_0xe222('0x2e')]=_['keys'](db[_0xe222('0x4a')]['rawAttributes']);_0xbc00ee['query']=_[_0xe222('0x30')](_0x389b36[_0xe222('0x2f')]);_0xbc00ee['filters']=_['intersection'](_0xbc00ee[_0xe222('0x2e')],_0xbc00ee[_0xe222('0x2f')]);_0x19c9ee[_0xe222('0x32')]=_['intersection'](_0xbc00ee['model'],qs[_0xe222('0x33')](_0x389b36[_0xe222('0x2f')][_0xe222('0x33')]));_0x19c9ee[_0xe222('0x32')]=_0x19c9ee[_0xe222('0x32')][_0xe222('0x34')]?_0x19c9ee[_0xe222('0x32')]:_0xbc00ee[_0xe222('0x2e')];_0x19c9ee[_0xe222('0x37')]=qs[_0xe222('0x38')](_0x389b36['query']['sort']);_0x19c9ee[_0xe222('0x39')]=qs[_0xe222('0x31')](_[_0xe222('0x3a')](_0x389b36[_0xe222('0x2f')],_0xbc00ee[_0xe222('0x31')]));if(_0x389b36[_0xe222('0x2f')][_0xe222('0x3d')]){_0x19c9ee['where']=_['merge'](_0x19c9ee[_0xe222('0x39')],{'$or':_[_0xe222('0x29')](_0x19c9ee[_0xe222('0x32')],function(_0x5bc090){var _0x49d46d={};_0x49d46d[_0x5bc090]={'$like':'%'+_0x389b36[_0xe222('0x2f')][_0xe222('0x3d')]+'%'};return _0x49d46d;})});}_0x19c9ee=_[_0xe222('0x3b')]({},_0x19c9ee,_0x389b36[_0xe222('0x3e')]);return _0x5b24c7[_0xe222('0x4d')](_0x19c9ee);}})[_0xe222('0x24')](function(_0x2437bb){if(_0x2437bb){_0x268a2d=_0x2437bb[_0xe222('0x34')];if(!_0x389b36['query'][_0xe222('0x35')](_0xe222('0x36'))){_0x19c9ee['limit']=qs[_0xe222('0x1a')](_0x389b36['query'][_0xe222('0x1a')]);_0x19c9ee[_0xe222('0x19')]=qs['offset'](_0x389b36[_0xe222('0x2f')][_0xe222('0x19')]);}return _0x5b24c7[_0xe222('0x4d')](_0x19c9ee);}})[_0xe222('0x24')](function(_0x1bb8b8){if(_0x1bb8b8){return _0x1bb8b8?{'count':_0x268a2d,'rows':_0x1bb8b8}:null;}})['then'](respondWithResult(_0x2673f1,null))[_0xe222('0x42')](handleError(_0x2673f1,null));};exports[_0xe222('0x4f')]=function(_0x1879c1,_0x21ac31,_0x502feb){return db[_0xe222('0x50')][_0xe222('0x48')]({'where':{'id':_0x1879c1[_0xe222('0x44')]['id']}})[_0xe222('0x24')](handleEntityNotFound(_0x21ac31,null))['then'](function(_0x2e2f36){if(_0x2e2f36){return _0x2e2f36[_0xe222('0x4f')](_0x1879c1[_0xe222('0x47')][_0xe222('0x4b')],_['omit'](_0x1879c1['body'],[_0xe222('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x21ac31,null))[_0xe222('0x42')](handleError(_0x21ac31,null));};exports['getActions']=function(_0x12f36c,_0x5a1ad1,_0x530696){var _0x59775f={};var _0x2745a6={};var _0x2661d6;var _0x35d4eb;return db[_0xe222('0x2a')][_0xe222('0x4e')]({'where':{'id':_0x12f36c[_0xe222('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a1ad1,null))[_0xe222('0x24')](function(_0x1aea78){if(_0x1aea78){_0x2661d6=_0x1aea78;_0x2745a6['model']=_[_0xe222('0x30')](db[_0xe222('0x50')][_0xe222('0x2b')]);_0x2745a6[_0xe222('0x2f')]=_[_0xe222('0x30')](_0x12f36c['query']);_0x2745a6[_0xe222('0x31')]=_[_0xe222('0x45')](_0x2745a6[_0xe222('0x2e')],_0x2745a6[_0xe222('0x2f')]);_0x59775f[_0xe222('0x32')]=_[_0xe222('0x45')](_0x2745a6['model'],qs['fields'](_0x12f36c[_0xe222('0x2f')][_0xe222('0x33')]));_0x59775f['attributes']=_0x59775f[_0xe222('0x32')][_0xe222('0x34')]?_0x59775f[_0xe222('0x32')]:_0x2745a6['model'];_0x59775f[_0xe222('0x37')]=qs[_0xe222('0x38')](_0x12f36c['query'][_0xe222('0x38')]);_0x59775f[_0xe222('0x39')]=qs[_0xe222('0x31')](_[_0xe222('0x3a')](_0x12f36c['query'],_0x2745a6[_0xe222('0x31')]));if(_0x12f36c['query'][_0xe222('0x3d')]){_0x59775f[_0xe222('0x39')]=_[_0xe222('0x3b')](_0x59775f[_0xe222('0x39')],{'$or':_[_0xe222('0x29')](_0x59775f['attributes'],function(_0x4e2b82){var _0x45d6b9={};_0x45d6b9[_0x4e2b82]={'$like':'%'+_0x12f36c[_0xe222('0x2f')][_0xe222('0x3d')]+'%'};return _0x45d6b9;})});}_0x59775f=_['merge']({},_0x59775f,_0x12f36c['options']);return _0x2661d6[_0xe222('0x51')](_0x59775f);}})['then'](function(_0x581265){if(_0x581265){_0x35d4eb=_0x581265['length'];if(!_0x12f36c['query'][_0xe222('0x35')](_0xe222('0x36'))){_0x59775f[_0xe222('0x1a')]=qs[_0xe222('0x1a')](_0x12f36c[_0xe222('0x2f')][_0xe222('0x1a')]);_0x59775f[_0xe222('0x19')]=qs[_0xe222('0x19')](_0x12f36c[_0xe222('0x2f')][_0xe222('0x19')]);}return _0x2661d6[_0xe222('0x51')](_0x59775f);}})['then'](function(_0x162183){if(_0x162183){return _0x162183?{'count':_0x35d4eb,'rows':_0x162183}:null;}})[_0xe222('0x24')](respondWithResult(_0x5a1ad1,null))[_0xe222('0x42')](handleError(_0x5a1ad1,null));};
\ No newline at end of file
+var _0x332e=['set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','params','include','find','create','body','update','Condition','ids','omit','getConditions','findOne','sort','pick','Action','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset'];(function(_0x3dd445,_0xaa0173){var _0xfed7d0=function(_0xd4cee1){while(--_0xd4cee1){_0x3dd445['push'](_0x3dd445['shift']());}};_0xfed7d0(++_0xaa0173);}(_0x332e,0x1df));var _0xe332=function(_0x380307,_0x440ccd){_0x380307=_0x380307-0x0;var _0x9ea14b=_0x332e[_0x380307];return _0x9ea14b;};'use strict';var emlformat=require(_0xe332('0x0'));var rimraf=require(_0xe332('0x1'));var zipdir=require(_0xe332('0x2'));var jsonpatch=require(_0xe332('0x3'));var rp=require(_0xe332('0x4'));var moment=require(_0xe332('0x5'));var BPromise=require(_0xe332('0x6'));var Mustache=require('mustache');var util=require(_0xe332('0x7'));var path=require(_0xe332('0x8'));var sox=require('sox');var csv=require(_0xe332('0x9'));var ejs=require(_0xe332('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe332('0xb'));var squel=require(_0xe332('0xc'));var crypto=require('crypto');var jsforce=require(_0xe332('0xd'));var deskjs=require(_0xe332('0xe'));var toCsv=require(_0xe332('0x9'));var querystring=require('querystring');var Papa=require(_0xe332('0xf'));var Redis=require(_0xe332('0x10'));var authService=require(_0xe332('0x11'));var qs=require(_0xe332('0x12'));var as=require(_0xe332('0x13'));var hardwareService=require(_0xe332('0x14'));var logger=require(_0xe332('0x15'))('api');var utils=require(_0xe332('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe332('0x17'));var db=require(_0xe332('0x18'))['db'];function respondWithStatusCode(_0x9b4911,_0x39a73a){_0x39a73a=_0x39a73a||0xcc;return function(_0x1edbf9){if(_0x1edbf9){return _0x9b4911['sendStatus'](_0x39a73a);}return _0x9b4911[_0xe332('0x19')](_0x39a73a)['end']();};}function respondWithResult(_0x5a9bdd,_0x16ce8b){_0x16ce8b=_0x16ce8b||0xc8;return function(_0x240639){if(_0x240639){return _0x5a9bdd[_0xe332('0x19')](_0x16ce8b)[_0xe332('0x1a')](_0x240639);}};}function respondWithFilteredResult(_0xd3979f,_0xde707){return function(_0x335d2d){if(_0x335d2d){var _0x4e5be0=typeof _0xde707['offset']==='undefined'&&typeof _0xde707[_0xe332('0x1b')]===_0xe332('0x1c');var _0x596a49=_0x335d2d[_0xe332('0x1d')];var _0x274971=_0x4e5be0?0x0:_0xde707[_0xe332('0x1e')];var _0x166c04=_0x4e5be0?_0x335d2d[_0xe332('0x1d')]:_0xde707['offset']+_0xde707[_0xe332('0x1b')];var _0x3baf2f;if(_0x166c04>=_0x596a49){_0x166c04=_0x596a49;_0x3baf2f=0xc8;}else{_0x3baf2f=0xce;}_0xd3979f[_0xe332('0x19')](_0x3baf2f);return _0xd3979f[_0xe332('0x1f')](_0xe332('0x20'),_0x274971+'-'+_0x166c04+'/'+_0x596a49)['json'](_0x335d2d);}return null;};}function patchUpdates(_0x17762e){return function(_0x38d81b){try{jsonpatch[_0xe332('0x21')](_0x38d81b,_0x17762e,!![]);}catch(_0x3a4b89){return BPromise[_0xe332('0x22')](_0x3a4b89);}return _0x38d81b[_0xe332('0x23')]();};}function saveUpdates(_0x22beec,_0x40472e){return function(_0x3108f3){if(_0x3108f3){return _0x3108f3['update'](_0x22beec)[_0xe332('0x24')](function(_0xfbc963){return _0xfbc963;});}return null;};}function removeEntity(_0xfc1605,_0x3fe1f9){return function(_0x252c75){if(_0x252c75){return _0x252c75[_0xe332('0x25')]()[_0xe332('0x24')](function(){_0xfc1605['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x276389,_0x1fb14e){return function(_0x53fc1f){if(!_0x53fc1f){_0x276389['sendStatus'](0x194);}return _0x53fc1f;};}function handleError(_0x5e52cd,_0x43dcb3){_0x43dcb3=_0x43dcb3||0x1f4;return function(_0x224b8d){logger[_0xe332('0x26')](_0x224b8d[_0xe332('0x27')]);if(_0x224b8d[_0xe332('0x28')]){delete _0x224b8d[_0xe332('0x28')];}_0x5e52cd[_0xe332('0x19')](_0x43dcb3)[_0xe332('0x29')](_0x224b8d);};}exports[_0xe332('0x2a')]=function(_0x86987c,_0x1f5236){var _0x27e6a8={},_0x46de9f={},_0x5b0935={'count':0x0,'rows':[]};var _0x15c16c=_['map'](db[_0xe332('0x2b')][_0xe332('0x2c')],function(_0x493322){return{'name':_0x493322[_0xe332('0x2d')],'type':_0x493322[_0xe332('0x2e')][_0xe332('0x2f')]};});_0x46de9f['model']=_[_0xe332('0x30')](_0x15c16c,'name');_0x46de9f[_0xe332('0x31')]=_[_0xe332('0x32')](_0x86987c[_0xe332('0x31')]);_0x46de9f['filters']=_[_0xe332('0x33')](_0x46de9f[_0xe332('0x34')],_0x46de9f['query']);_0x27e6a8[_0xe332('0x35')]=_[_0xe332('0x33')](_0x46de9f[_0xe332('0x34')],qs['fields'](_0x86987c['query'][_0xe332('0x36')]));_0x27e6a8[_0xe332('0x35')]=_0x27e6a8[_0xe332('0x35')][_0xe332('0x37')]?_0x27e6a8[_0xe332('0x35')]:_0x46de9f['model'];if(!_0x86987c[_0xe332('0x31')][_0xe332('0x38')](_0xe332('0x39'))){_0x27e6a8[_0xe332('0x1b')]=qs[_0xe332('0x1b')](_0x86987c[_0xe332('0x31')][_0xe332('0x1b')]);_0x27e6a8[_0xe332('0x1e')]=qs['offset'](_0x86987c[_0xe332('0x31')][_0xe332('0x1e')]);}_0x27e6a8[_0xe332('0x3a')]=qs['sort'](_0x86987c[_0xe332('0x31')]['sort']);_0x27e6a8[_0xe332('0x3b')]=qs[_0xe332('0x3c')](_['pick'](_0x86987c[_0xe332('0x31')],_0x46de9f[_0xe332('0x3c')]),_0x15c16c);if(_0x86987c[_0xe332('0x31')][_0xe332('0x3d')]){_0x27e6a8[_0xe332('0x3b')]=_['merge'](_0x27e6a8[_0xe332('0x3b')],{'$or':_['map'](_0x15c16c,function(_0x398e12){if(_0x398e12[_0xe332('0x2e')]!==_0xe332('0x3e')){var _0x161894={};_0x161894[_0x398e12[_0xe332('0x28')]]={'$like':'%'+_0x86987c[_0xe332('0x31')][_0xe332('0x3d')]+'%'};return _0x161894;}})});}_0x27e6a8=_[_0xe332('0x3f')]({},_0x27e6a8,_0x86987c[_0xe332('0x40')]);var _0x8c4861={'where':_0x27e6a8['where']};return db[_0xe332('0x2b')]['count'](_0x8c4861)[_0xe332('0x24')](function(_0x28baa7){_0x5b0935[_0xe332('0x1d')]=_0x28baa7;if(_0x86987c[_0xe332('0x31')][_0xe332('0x41')]){_0x27e6a8['include']=[{'all':!![]}];}return db[_0xe332('0x2b')]['findAll'](_0x27e6a8);})[_0xe332('0x24')](function(_0x1896e8){_0x5b0935[_0xe332('0x42')]=_0x1896e8;return _0x5b0935;})['then'](respondWithFilteredResult(_0x1f5236,_0x27e6a8))[_0xe332('0x43')](handleError(_0x1f5236,null));};exports[_0xe332('0x44')]=function(_0x117487,_0x37a1f0){var _0x5bd80b={'raw':![],'where':{'id':_0x117487[_0xe332('0x45')]['id']}},_0x48770d={};_0x48770d['model']=_['keys'](db[_0xe332('0x2b')]['rawAttributes']);_0x48770d[_0xe332('0x31')]=_[_0xe332('0x32')](_0x117487[_0xe332('0x31')]);_0x48770d[_0xe332('0x3c')]=_['intersection'](_0x48770d[_0xe332('0x34')],_0x48770d[_0xe332('0x31')]);_0x5bd80b['attributes']=_[_0xe332('0x33')](_0x48770d[_0xe332('0x34')],qs[_0xe332('0x36')](_0x117487[_0xe332('0x31')]['fields']));_0x5bd80b['attributes']=_0x5bd80b[_0xe332('0x35')]['length']?_0x5bd80b[_0xe332('0x35')]:_0x48770d['model'];if(_0x117487[_0xe332('0x31')][_0xe332('0x41')]){_0x5bd80b[_0xe332('0x46')]=[{'all':!![]}];}_0x5bd80b=_[_0xe332('0x3f')]({},_0x5bd80b,_0x117487[_0xe332('0x40')]);return db[_0xe332('0x2b')][_0xe332('0x47')](_0x5bd80b)['then'](handleEntityNotFound(_0x37a1f0,null))[_0xe332('0x24')](respondWithResult(_0x37a1f0,null))[_0xe332('0x43')](handleError(_0x37a1f0,null));};exports[_0xe332('0x48')]=function(_0x34c5db,_0x3ab7ed){return db['Automation']['create'](_0x34c5db[_0xe332('0x49')],{})['then'](respondWithResult(_0x3ab7ed,0xc9))[_0xe332('0x43')](handleError(_0x3ab7ed,null));};exports[_0xe332('0x4a')]=function(_0x23b757,_0x1d5c69){if(_0x23b757[_0xe332('0x49')]['id']){delete _0x23b757[_0xe332('0x49')]['id'];}return db[_0xe332('0x2b')][_0xe332('0x47')]({'where':{'id':_0x23b757['params']['id']}})[_0xe332('0x24')](handleEntityNotFound(_0x1d5c69,null))[_0xe332('0x24')](saveUpdates(_0x23b757['body'],null))[_0xe332('0x24')](respondWithResult(_0x1d5c69,null))[_0xe332('0x43')](handleError(_0x1d5c69,null));};exports[_0xe332('0x25')]=function(_0x590844,_0x4b80d5){return db[_0xe332('0x2b')][_0xe332('0x47')]({'where':{'id':_0x590844[_0xe332('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b80d5,null))[_0xe332('0x24')](removeEntity(_0x4b80d5,null))[_0xe332('0x43')](handleError(_0x4b80d5,null));};exports['addConditions']=function(_0x9ba8c5,_0x33371b,_0x3017e3){return db[_0xe332('0x4b')][_0xe332('0x47')]({'where':{'id':_0x9ba8c5[_0xe332('0x45')]['id']}})['then'](handleEntityNotFound(_0x33371b,null))[_0xe332('0x24')](function(_0x31731d){if(_0x31731d){return _0x31731d['addConditions'](_0x9ba8c5['body'][_0xe332('0x4c')],_[_0xe332('0x4d')](_0x9ba8c5[_0xe332('0x49')],[_0xe332('0x4c'),'id'])||{});}})[_0xe332('0x24')](respondWithResult(_0x33371b,null))[_0xe332('0x43')](handleError(_0x33371b,null));};exports[_0xe332('0x4e')]=function(_0x4759c3,_0x1fbeba,_0x12a571){var _0x57b531={};var _0x24ea22={};var _0x1822be;var _0x392ac9;return db[_0xe332('0x2b')][_0xe332('0x4f')]({'where':{'id':_0x4759c3[_0xe332('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fbeba,null))[_0xe332('0x24')](function(_0x4eb0c1){if(_0x4eb0c1){_0x1822be=_0x4eb0c1;_0x24ea22[_0xe332('0x34')]=_[_0xe332('0x32')](db['Condition'][_0xe332('0x2c')]);_0x24ea22['query']=_[_0xe332('0x32')](_0x4759c3[_0xe332('0x31')]);_0x24ea22[_0xe332('0x3c')]=_[_0xe332('0x33')](_0x24ea22[_0xe332('0x34')],_0x24ea22[_0xe332('0x31')]);_0x57b531[_0xe332('0x35')]=_[_0xe332('0x33')](_0x24ea22['model'],qs['fields'](_0x4759c3[_0xe332('0x31')][_0xe332('0x36')]));_0x57b531['attributes']=_0x57b531['attributes']['length']?_0x57b531[_0xe332('0x35')]:_0x24ea22[_0xe332('0x34')];_0x57b531['order']=qs[_0xe332('0x50')](_0x4759c3[_0xe332('0x31')][_0xe332('0x50')]);_0x57b531[_0xe332('0x3b')]=qs[_0xe332('0x3c')](_[_0xe332('0x51')](_0x4759c3[_0xe332('0x31')],_0x24ea22[_0xe332('0x3c')]));if(_0x4759c3['query'][_0xe332('0x3d')]){_0x57b531[_0xe332('0x3b')]=_[_0xe332('0x3f')](_0x57b531[_0xe332('0x3b')],{'$or':_[_0xe332('0x30')](_0x57b531[_0xe332('0x35')],function(_0x522d3e){var _0x30c3c3={};_0x30c3c3[_0x522d3e]={'$like':'%'+_0x4759c3[_0xe332('0x31')]['filter']+'%'};return _0x30c3c3;})});}_0x57b531=_[_0xe332('0x3f')]({},_0x57b531,_0x4759c3['options']);return _0x1822be[_0xe332('0x4e')](_0x57b531);}})[_0xe332('0x24')](function(_0x4d7bd9){if(_0x4d7bd9){_0x392ac9=_0x4d7bd9[_0xe332('0x37')];if(!_0x4759c3[_0xe332('0x31')][_0xe332('0x38')](_0xe332('0x39'))){_0x57b531[_0xe332('0x1b')]=qs[_0xe332('0x1b')](_0x4759c3[_0xe332('0x31')][_0xe332('0x1b')]);_0x57b531[_0xe332('0x1e')]=qs[_0xe332('0x1e')](_0x4759c3[_0xe332('0x31')][_0xe332('0x1e')]);}return _0x1822be['getConditions'](_0x57b531);}})[_0xe332('0x24')](function(_0x34565b){if(_0x34565b){return _0x34565b?{'count':_0x392ac9,'rows':_0x34565b}:null;}})[_0xe332('0x24')](respondWithResult(_0x1fbeba,null))[_0xe332('0x43')](handleError(_0x1fbeba,null));};exports['addActions']=function(_0x17b3af,_0x469b73,_0x194cad){return db[_0xe332('0x52')][_0xe332('0x47')]({'where':{'id':_0x17b3af['params']['id']}})['then'](handleEntityNotFound(_0x469b73,null))[_0xe332('0x24')](function(_0x416815){if(_0x416815){return _0x416815[_0xe332('0x53')](_0x17b3af[_0xe332('0x49')]['ids'],_[_0xe332('0x4d')](_0x17b3af[_0xe332('0x49')],[_0xe332('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x469b73,null))[_0xe332('0x43')](handleError(_0x469b73,null));};exports[_0xe332('0x54')]=function(_0x36af1a,_0x39e49c,_0x302810){var _0x3ac3e9={};var _0x5e6d9e={};var _0x25f690;var _0x18c1fa;return db[_0xe332('0x2b')][_0xe332('0x4f')]({'where':{'id':_0x36af1a[_0xe332('0x45')]['id']}})[_0xe332('0x24')](handleEntityNotFound(_0x39e49c,null))[_0xe332('0x24')](function(_0x5aea68){if(_0x5aea68){_0x25f690=_0x5aea68;_0x5e6d9e['model']=_[_0xe332('0x32')](db[_0xe332('0x52')][_0xe332('0x2c')]);_0x5e6d9e[_0xe332('0x31')]=_[_0xe332('0x32')](_0x36af1a[_0xe332('0x31')]);_0x5e6d9e[_0xe332('0x3c')]=_[_0xe332('0x33')](_0x5e6d9e[_0xe332('0x34')],_0x5e6d9e['query']);_0x3ac3e9[_0xe332('0x35')]=_[_0xe332('0x33')](_0x5e6d9e[_0xe332('0x34')],qs[_0xe332('0x36')](_0x36af1a[_0xe332('0x31')][_0xe332('0x36')]));_0x3ac3e9[_0xe332('0x35')]=_0x3ac3e9[_0xe332('0x35')][_0xe332('0x37')]?_0x3ac3e9['attributes']:_0x5e6d9e[_0xe332('0x34')];_0x3ac3e9[_0xe332('0x3a')]=qs[_0xe332('0x50')](_0x36af1a['query'][_0xe332('0x50')]);_0x3ac3e9[_0xe332('0x3b')]=qs['filters'](_['pick'](_0x36af1a['query'],_0x5e6d9e[_0xe332('0x3c')]));if(_0x36af1a['query']['filter']){_0x3ac3e9[_0xe332('0x3b')]=_['merge'](_0x3ac3e9[_0xe332('0x3b')],{'$or':_[_0xe332('0x30')](_0x3ac3e9[_0xe332('0x35')],function(_0xff298a){var _0x545534={};_0x545534[_0xff298a]={'$like':'%'+_0x36af1a[_0xe332('0x31')][_0xe332('0x3d')]+'%'};return _0x545534;})});}_0x3ac3e9=_[_0xe332('0x3f')]({},_0x3ac3e9,_0x36af1a[_0xe332('0x40')]);return _0x25f690['getActions'](_0x3ac3e9);}})[_0xe332('0x24')](function(_0x9f2f3){if(_0x9f2f3){_0x18c1fa=_0x9f2f3['length'];if(!_0x36af1a[_0xe332('0x31')][_0xe332('0x38')](_0xe332('0x39'))){_0x3ac3e9['limit']=qs[_0xe332('0x1b')](_0x36af1a[_0xe332('0x31')][_0xe332('0x1b')]);_0x3ac3e9[_0xe332('0x1e')]=qs[_0xe332('0x1e')](_0x36af1a[_0xe332('0x31')][_0xe332('0x1e')]);}return _0x25f690['getActions'](_0x3ac3e9);}})[_0xe332('0x24')](function(_0x1665f3){if(_0x1665f3){return _0x1665f3?{'count':_0x18c1fa,'rows':_0x1665f3}:null;}})[_0xe332('0x24')](respondWithResult(_0x39e49c,null))[_0xe332('0x43')](handleError(_0x39e49c,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 07e81dc..bcdfbd5 100644
--- a/server/api/automation/automation.model.js
+++ b/server/api/automation/automation.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6c31=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','Automation','tools_automations','util'];(function(_0x4adcbe,_0x3422e1){var _0x2c4230=function(_0x20c650){while(--_0x20c650){_0x4adcbe['push'](_0x4adcbe['shift']());}};_0x2c4230(++_0x3422e1);}(_0x6c31,0x13e));var _0x16c3=function(_0x470d13,_0x3f22fa){_0x470d13=_0x470d13-0x0;var _0x18cc32=_0x6c31[_0x470d13];return _0x18cc32;};'use strict';var _=require('lodash');var util=require(_0x16c3('0x0'));var logger=require(_0x16c3('0x1'))(_0x16c3('0x2'));var moment=require('moment');var BPromise=require(_0x16c3('0x3'));var rp=require(_0x16c3('0x4'));var fs=require('fs');var path=require(_0x16c3('0x5'));var rimraf=require(_0x16c3('0x6'));var config=require(_0x16c3('0x7'));var attributes=require(_0x16c3('0x8'));module['exports']=function(_0xabc2e2,_0x271fb6){return _0xabc2e2['define'](_0x16c3('0x9'),attributes,{'tableName':_0x16c3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcd3b=['../../config/logger','api','bluebird','request-promise','../../config/environment','./automation.attributes','Automation','lodash','util'];(function(_0x6b8d31,_0x5bcae3){var _0x2cd1d7=function(_0x393aef){while(--_0x393aef){_0x6b8d31['push'](_0x6b8d31['shift']());}};_0x2cd1d7(++_0x5bcae3);}(_0xcd3b,0xc4));var _0xbcd3=function(_0x434cca,_0x53d7fc){_0x434cca=_0x434cca-0x0;var _0x17de4c=_0xcd3b[_0x434cca];return _0x17de4c;};'use strict';var _=require(_0xbcd3('0x0'));var util=require(_0xbcd3('0x1'));var logger=require(_0xbcd3('0x2'))(_0xbcd3('0x3'));var moment=require('moment');var BPromise=require(_0xbcd3('0x4'));var rp=require(_0xbcd3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbcd3('0x6'));var attributes=require(_0xbcd3('0x7'));module['exports']=function(_0x56722d,_0x5372fd){return _0x56722d['define'](_0xbcd3('0x8'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index c45f3ad..5412ead 100644
--- a/server/api/automation/automation.rpc.js
+++ b/server/api/automation/automation.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdfdd=['request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','Automation,\x20%s,\x20%s'];(function(_0x14a4d0,_0x4c7068){var _0x18c8ab=function(_0x10bd3b){while(--_0x10bd3b){_0x14a4d0['push'](_0x14a4d0['shift']());}};_0x18c8ab(++_0x4c7068);}(_0xdfdd,0x104));var _0xddfd=function(_0x1972cf,_0x33ce05){_0x1972cf=_0x1972cf-0x0;var _0x570700=_0xdfdd[_0x1972cf];return _0x570700;};'use strict';var _=require(_0xddfd('0x0'));var util=require(_0xddfd('0x1'));var moment=require(_0xddfd('0x2'));var BPromise=require(_0xddfd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddfd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xddfd('0x5'));var logger=require('../../config/logger')(_0xddfd('0x6'));var config=require(_0xddfd('0x7'));var jayson=require(_0xddfd('0x8'));var client=jayson[_0xddfd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25fcbc,_0x485ede,_0x2e8f21){return new BPromise(function(_0x45bdd0,_0xf134d7){return client[_0xddfd('0xa')](_0x25fcbc,_0x2e8f21)[_0xddfd('0xb')](function(_0x2a3b1e){logger['info'](_0xddfd('0xc'),_0x485ede,_0xddfd('0xd'));logger['debug'](_0xddfd('0xe'),_0x485ede,_0xddfd('0xd'),JSON[_0xddfd('0xf')](_0x2a3b1e));if(_0x2a3b1e[_0xddfd('0x10')]){if(_0x2a3b1e[_0xddfd('0x10')]['code']===0x1f4){logger[_0xddfd('0x10')]('Automation,\x20%s,\x20%s',_0x485ede,_0x2a3b1e[_0xddfd('0x10')]['message']);return _0xf134d7(_0x2a3b1e[_0xddfd('0x10')]['message']);}logger[_0xddfd('0x10')]('Automation,\x20%s,\x20%s',_0x485ede,_0x2a3b1e[_0xddfd('0x10')][_0xddfd('0x11')]);return _0x45bdd0(_0x2a3b1e[_0xddfd('0x10')][_0xddfd('0x11')]);}else{logger[_0xddfd('0x12')]('Automation,\x20%s,\x20%s',_0x485ede,_0xddfd('0xd'));_0x45bdd0(_0x2a3b1e[_0xddfd('0x13')][_0xddfd('0x11')]);}})[_0xddfd('0x14')](function(_0xa85d01){logger[_0xddfd('0x10')](_0xddfd('0xc'),_0x485ede,_0xa85d01);_0xf134d7(_0xa85d01);});});}
\ No newline at end of file
+var _0xbc36=['info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x221fe1,_0x28aef0){var _0x2c8967=function(_0x5f039f){while(--_0x5f039f){_0x221fe1['push'](_0x221fe1['shift']());}};_0x2c8967(++_0x28aef0);}(_0xbc36,0x169));var _0x6bc3=function(_0x656ab4,_0x2edd3f){_0x656ab4=_0x656ab4-0x0;var _0x37758b=_0xbc36[_0x656ab4];return _0x37758b;};'use strict';var _=require(_0x6bc3('0x0'));var util=require('util');var moment=require(_0x6bc3('0x1'));var BPromise=require(_0x6bc3('0x2'));var rs=require(_0x6bc3('0x3'));var fs=require('fs');var Redis=require(_0x6bc3('0x4'));var db=require(_0x6bc3('0x5'))['db'];var utils=require(_0x6bc3('0x6'));var logger=require(_0x6bc3('0x7'))(_0x6bc3('0x8'));var config=require(_0x6bc3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6bc3('0xa')][_0x6bc3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5584a5,_0x33e11c,_0x1f894a){return new BPromise(function(_0xf07594,_0x4de32d){return client[_0x6bc3('0xc')](_0x5584a5,_0x1f894a)[_0x6bc3('0xd')](function(_0x33e8e0){logger[_0x6bc3('0xe')]('Automation,\x20%s,\x20%s',_0x33e11c,_0x6bc3('0xf'));logger[_0x6bc3('0x10')](_0x6bc3('0x11'),_0x33e11c,_0x6bc3('0xf'),JSON[_0x6bc3('0x12')](_0x33e8e0));if(_0x33e8e0[_0x6bc3('0x13')]){if(_0x33e8e0[_0x6bc3('0x13')][_0x6bc3('0x14')]===0x1f4){logger[_0x6bc3('0x13')]('Automation,\x20%s,\x20%s',_0x33e11c,_0x33e8e0[_0x6bc3('0x13')]['message']);return _0x4de32d(_0x33e8e0[_0x6bc3('0x13')]['message']);}logger[_0x6bc3('0x13')](_0x6bc3('0x15'),_0x33e11c,_0x33e8e0['error'][_0x6bc3('0x16')]);return _0xf07594(_0x33e8e0['error']['message']);}else{logger[_0x6bc3('0xe')](_0x6bc3('0x15'),_0x33e11c,_0x6bc3('0xf'));_0xf07594(_0x33e8e0[_0x6bc3('0x17')][_0x6bc3('0x16')]);}})[_0x6bc3('0x18')](function(_0xa1782){logger['error'](_0x6bc3('0x15'),_0x33e11c,_0xa1782);_0x4de32d(_0xa1782);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 3c34b89..b1d386e 100644
--- a/server/api/automation/index.js
+++ b/server/api/automation/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','./automation.controller','isAuthenticated','index','get','/:id','/:id/conditions','getConditions','getActions','create','addConditions','/:id/actions','put','update','delete','destroy','path','connect-timeout'];(function(_0x29ce6c,_0x4642d5){var _0x27a08c=function(_0x2943a4){while(--_0x2943a4){_0x29ce6c['push'](_0x29ce6c['shift']());}};_0x27a08c(++_0x4642d5);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/actions',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['post']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0xe')]);router['post']('/:id/conditions',auth[_0x49c4('0x7')](),controller[_0x49c4('0xf')]);router['post'](_0x49c4('0x10'),auth[_0x49c4('0x7')](),controller['addActions']);router[_0x49c4('0x11')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router[_0x49c4('0x13')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xc3fe=['delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','index','get','show','/:id/conditions','isAuthenticated','getConditions','getActions','post','create','addConditions','addActions','update'];(function(_0x4b5d06,_0x31c5e1){var _0x4be5ff=function(_0x8954c1){while(--_0x8954c1){_0x4b5d06['push'](_0x4b5d06['shift']());}};_0x4be5ff(++_0x31c5e1);}(_0xc3fe,0xff));var _0xec3f=function(_0x2dc942,_0x583b72){_0x2dc942=_0x2dc942-0x0;var _0x5e89f5=_0xc3fe[_0x2dc942];return _0x5e89f5;};'use strict';var multer=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var path=require(_0xec3f('0x2'));var timeout=require('connect-timeout');var express=require(_0xec3f('0x3'));var router=express[_0xec3f('0x4')]();var fs_extra=require(_0xec3f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xec3f('0x6'));var config=require(_0xec3f('0x7'));var controller=require(_0xec3f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xec3f('0x9')]);router[_0xec3f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xec3f('0xb')]);router['get'](_0xec3f('0xc'),auth[_0xec3f('0xd')](),controller[_0xec3f('0xe')]);router[_0xec3f('0xa')]('/:id/actions',auth[_0xec3f('0xd')](),controller[_0xec3f('0xf')]);router[_0xec3f('0x10')]('/',auth[_0xec3f('0xd')](),controller[_0xec3f('0x11')]);router[_0xec3f('0x10')]('/:id/conditions',auth[_0xec3f('0xd')](),controller[_0xec3f('0x12')]);router[_0xec3f('0x10')]('/:id/actions',auth['isAuthenticated'](),controller[_0xec3f('0x13')]);router['put']('/:id',auth[_0xec3f('0xd')](),controller[_0xec3f('0x14')]);router[_0xec3f('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xec3f('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 00077d9..47835ca 100644
--- a/server/api/campaign/campaign.attributes.js
+++ b/server/api/campaign/campaign.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc9a0=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ENUM','ivr','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length'];(function(_0x340b16,_0x583b62){var _0x5cfc82=function(_0x3de90a){while(--_0x3de90a){_0x340b16['push'](_0x340b16['shift']());}};_0x5cfc82(++_0x583b62);}(_0xc9a0,0x12c));var _0x0c9a=function(_0x59f73b,_0x5d16f8){_0x59f73b=_0x59f73b-0x0;var _0xba25ca=_0xc9a0[_0x59f73b];return _0xba25ca;};'use strict';var Sequelize=require(_0x0c9a('0x0'));module[_0x0c9a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0c9a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0c9a('0x3')](_0x0c9a('0x4')),'allowNull':![],'defaultValue':_0x0c9a('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0c9a('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x0c9a('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0c9a('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0c9a('0x8')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x0c9a('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)[_0x0c9a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0c9a('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c9a('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0c9a('0xe')},'dialTimezone':{'type':Sequelize[_0x0c9a('0x8')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0c9a('0x8')],'defaultValue':_0x0c9a('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0c9a('0x10'),'never',_0x0c9a('0x11')),'defaultValue':_0x0c9a('0x10')},'dialAMDActive':{'type':Sequelize[_0x0c9a('0x5')],'defaultValue':0x0,'comment':_0x0c9a('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0c9a('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x0c9a('0xa')](0x9)[_0x0c9a('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0c9a('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0c9a('0xa')](0x9)[_0x0c9a('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0c9a('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0c9a('0xa')](0x9)[_0x0c9a('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0c9a('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x0c9a('0xa')](0x9)[_0x0c9a('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0c9a('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0c9a('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0c9a('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0c9a('0xa')](0x9)[_0x0c9a('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0c9a('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0c9a('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0c9a('0xa')](0x9)[_0x0c9a('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0c9a('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x0c9a('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0c9a('0xa')](0x3)[_0x0c9a('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0c9a('0x1c')},'dialCutDigit':{'type':Sequelize[_0x0c9a('0xa')](0x3)[_0x0c9a('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0c9a('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c9a('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)[_0x0c9a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c9a('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)[_0x0c9a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)[_0x0c9a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x4b6f=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr'];(function(_0x2638c7,_0x233cb5){var _0xd9d91d=function(_0x1a82cb){while(--_0x1a82cb){_0x2638c7['push'](_0x2638c7['shift']());}};_0xd9d91d(++_0x233cb5);}(_0x4b6f,0xea));var _0xf4b6=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4b6f[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0xf4b6('0x0'));module['exports']={'name':{'type':Sequelize[_0xf4b6('0x1')],'unique':_0xf4b6('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xf4b6('0x3')),'allowNull':![],'defaultValue':_0xf4b6('0x3')},'description':{'type':Sequelize[_0xf4b6('0x1')]},'active':{'type':Sequelize[_0xf4b6('0x4')],'defaultValue':0x0,'comment':_0xf4b6('0x5')},'limitCalls':{'type':Sequelize[_0xf4b6('0x6')](0x4)[_0xf4b6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf4b6('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf4b6('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xf4b6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b6('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b6('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'comment':_0xf4b6('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf4b6('0xe')},'dialTimezone':{'type':Sequelize[_0xf4b6('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf4b6('0x1')],'defaultValue':_0xf4b6('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xf4b6('0x10')](_0xf4b6('0x11'),_0xf4b6('0x12'),_0xf4b6('0x13')),'defaultValue':_0xf4b6('0x11')},'dialAMDActive':{'type':Sequelize[_0xf4b6('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf4b6('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf4b6('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf4b6('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf4b6('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xf4b6('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf4b6('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf4b6('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf4b6('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xf4b6('0x10')](_0xf4b6('0x1a'),_0xf4b6('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xf4b6('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf4b6('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b6('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b6('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index d612c8e..06875ec 100644
--- a/server/api/campaign/campaign.controller.js
+++ b/server/api/campaign/campaign.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbe2f=['../../config/license/util','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','apply','save','then','get','destroy','name','map','Campaign','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','includeAll','findAll','rows','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','options','omit','body','createdAt','updatedAt','role','IvrCampaigns','UserProfileSection','update','getHoppers','findOne','filter','CmHopper','CmHopperHistory','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','phone\x20IS\x20NOT\x20NULL','removeBlackLists','rimraf','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0xbe2f,0xec));var _0xfbe2=function(_0x6c8455,_0x566ea1){_0x6c8455=_0x6c8455-0x0;var _0x2c92f2=_0xbe2f[_0x6c8455];return _0x2c92f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfbe2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfbe2('0x1'));var BPromise=require(_0xfbe2('0x2'));var Mustache=require(_0xfbe2('0x3'));var util=require('util');var path=require(_0xfbe2('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfbe2('0x5'));var fs=require('fs');var fs_extra=require(_0xfbe2('0x6'));var _=require(_0xfbe2('0x7'));var squel=require(_0xfbe2('0x8'));var crypto=require(_0xfbe2('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfbe2('0xa'));var toCsv=require('to-csv');var querystring=require(_0xfbe2('0xb'));var Papa=require(_0xfbe2('0xc'));var Redis=require(_0xfbe2('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbe2('0xe'));var logger=require('../../config/logger')(_0xfbe2('0xf'));var utils=require(_0xfbe2('0x10'));var config=require(_0xfbe2('0x11'));var licenseUtil=require(_0xfbe2('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x519b0a,_0x321ce4){_0x321ce4=_0x321ce4||0xcc;return function(_0x5548b9){if(_0x5548b9){return _0x519b0a[_0xfbe2('0x13')](_0x321ce4);}return _0x519b0a['status'](_0x321ce4)[_0xfbe2('0x14')]();};}function respondWithResult(_0x4136fe,_0x4dc52b){_0x4dc52b=_0x4dc52b||0xc8;return function(_0x169246){if(_0x169246){return _0x4136fe[_0xfbe2('0x15')](_0x4dc52b)['json'](_0x169246);}};}function respondWithFilteredResult(_0x1f8c5e,_0x397d4d){return function(_0x4d8d57){if(_0x4d8d57){var _0xce708e=typeof _0x397d4d['offset']==='undefined'&&typeof _0x397d4d[_0xfbe2('0x16')]===_0xfbe2('0x17');var _0x34a06d=_0x4d8d57[_0xfbe2('0x18')];var _0x360a9f=_0xce708e?0x0:_0x397d4d[_0xfbe2('0x19')];var _0x3839ba=_0xce708e?_0x4d8d57[_0xfbe2('0x18')]:_0x397d4d[_0xfbe2('0x19')]+_0x397d4d[_0xfbe2('0x16')];var _0x5b3379;if(_0x3839ba>=_0x34a06d){_0x3839ba=_0x34a06d;_0x5b3379=0xc8;}else{_0x5b3379=0xce;}_0x1f8c5e[_0xfbe2('0x15')](_0x5b3379);return _0x1f8c5e[_0xfbe2('0x1a')](_0xfbe2('0x1b'),_0x360a9f+'-'+_0x3839ba+'/'+_0x34a06d)[_0xfbe2('0x1c')](_0x4d8d57);}return null;};}function patchUpdates(_0x594e0d){return function(_0x2e6506){try{jsonpatch[_0xfbe2('0x1d')](_0x2e6506,_0x594e0d,!![]);}catch(_0x49d32c){return BPromise['reject'](_0x49d32c);}return _0x2e6506[_0xfbe2('0x1e')]();};}function saveUpdates(_0x9857b3,_0x1420d5){return function(_0x5ed2a1){if(_0x5ed2a1){return _0x5ed2a1['update'](_0x9857b3)[_0xfbe2('0x1f')](function(_0x507604){return _0x507604;});}return null;};}function removeEntity(_0x3d953b,_0x5a4b67){return function(_0x3acd82){if(_0x3acd82){return _0x3acd82['destroy']()[_0xfbe2('0x1f')](function(){var _0x1352ed=_0x3acd82[_0xfbe2('0x20')]({'plain':!![]});var _0x55c9ff='IvrCampaigns';return db['UserProfileResource'][_0xfbe2('0x21')]({'where':{'type':_0x55c9ff,'resourceId':_0x1352ed['id']}})[_0xfbe2('0x1f')](function(){return _0x3acd82;});})['then'](function(){_0x3d953b[_0xfbe2('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b2563,_0xbface4){return function(_0x3aae23){if(!_0x3aae23){_0x3b2563[_0xfbe2('0x13')](0x194);}return _0x3aae23;};}function handleError(_0x3c2cae,_0x1a09d1){_0x1a09d1=_0x1a09d1||0x1f4;return function(_0x390d0f){logger['error'](_0x390d0f['stack']);if(_0x390d0f[_0xfbe2('0x22')]){delete _0x390d0f[_0xfbe2('0x22')];}_0x3c2cae[_0xfbe2('0x15')](_0x1a09d1)['send'](_0x390d0f);};}exports['index']=function(_0x1d2a70,_0x43e15b){var _0x2e62f0={},_0x32e83a={},_0x34ef5d={'count':0x0,'rows':[]};var _0x29eb39=_[_0xfbe2('0x23')](db[_0xfbe2('0x24')][_0xfbe2('0x25')],function(_0x4995cd){return{'name':_0x4995cd[_0xfbe2('0x26')],'type':_0x4995cd[_0xfbe2('0x27')][_0xfbe2('0x28')]};});_0x32e83a[_0xfbe2('0x29')]=_[_0xfbe2('0x23')](_0x29eb39,'name');_0x32e83a['query']=_[_0xfbe2('0x2a')](_0x1d2a70[_0xfbe2('0x2b')]);_0x32e83a['filters']=_['intersection'](_0x32e83a[_0xfbe2('0x29')],_0x32e83a[_0xfbe2('0x2b')]);_0x2e62f0[_0xfbe2('0x2c')]=_[_0xfbe2('0x2d')](_0x32e83a['model'],qs[_0xfbe2('0x2e')](_0x1d2a70['query'][_0xfbe2('0x2e')]));_0x2e62f0['attributes']=_0x2e62f0[_0xfbe2('0x2c')][_0xfbe2('0x2f')]?_0x2e62f0[_0xfbe2('0x2c')]:_0x32e83a[_0xfbe2('0x29')];if(!_0x1d2a70[_0xfbe2('0x2b')][_0xfbe2('0x30')](_0xfbe2('0x31'))){_0x2e62f0['limit']=qs[_0xfbe2('0x16')](_0x1d2a70[_0xfbe2('0x2b')][_0xfbe2('0x16')]);_0x2e62f0['offset']=qs[_0xfbe2('0x19')](_0x1d2a70[_0xfbe2('0x2b')][_0xfbe2('0x19')]);}_0x2e62f0[_0xfbe2('0x32')]=qs[_0xfbe2('0x33')](_0x1d2a70['query'][_0xfbe2('0x33')]);_0x2e62f0['where']=qs['filters'](_[_0xfbe2('0x34')](_0x1d2a70['query'],_0x32e83a[_0xfbe2('0x35')]),_0x29eb39);if(_0x1d2a70[_0xfbe2('0x2b')]['filter']){_0x2e62f0[_0xfbe2('0x36')]=_[_0xfbe2('0x37')](_0x2e62f0['where'],{'$or':_[_0xfbe2('0x23')](_0x29eb39,function(_0xc81fc7){if(_0xc81fc7['type']!=='VIRTUAL'){var _0x1773af={};_0x1773af[_0xc81fc7['name']]={'$like':'%'+_0x1d2a70[_0xfbe2('0x2b')]['filter']+'%'};return _0x1773af;}})});}_0x2e62f0=_[_0xfbe2('0x37')]({},_0x2e62f0,_0x1d2a70['options']);var _0x11617e={'where':_0x2e62f0['where']};return db[_0xfbe2('0x24')]['count'](_0x11617e)[_0xfbe2('0x1f')](function(_0x493980){_0x34ef5d[_0xfbe2('0x18')]=_0x493980;if(_0x1d2a70[_0xfbe2('0x2b')][_0xfbe2('0x38')]){_0x2e62f0['include']=[{'all':!![]}];}return db['Campaign'][_0xfbe2('0x39')](_0x2e62f0);})[_0xfbe2('0x1f')](function(_0x9ca8df){_0x34ef5d[_0xfbe2('0x3a')]=_0x9ca8df;return _0x34ef5d;})[_0xfbe2('0x1f')](respondWithFilteredResult(_0x43e15b,_0x2e62f0))[_0xfbe2('0x3b')](handleError(_0x43e15b,null));};exports[_0xfbe2('0x3c')]=function(_0x45b0ca,_0x388496){var _0x3253a7={'raw':![],'where':{'id':_0x45b0ca['params']['id']}},_0x1dc77e={};_0x1dc77e[_0xfbe2('0x29')]=_[_0xfbe2('0x2a')](db[_0xfbe2('0x24')][_0xfbe2('0x25')]);_0x1dc77e[_0xfbe2('0x2b')]=_['keys'](_0x45b0ca[_0xfbe2('0x2b')]);_0x1dc77e[_0xfbe2('0x35')]=_[_0xfbe2('0x2d')](_0x1dc77e['model'],_0x1dc77e[_0xfbe2('0x2b')]);_0x3253a7[_0xfbe2('0x2c')]=_[_0xfbe2('0x2d')](_0x1dc77e[_0xfbe2('0x29')],qs[_0xfbe2('0x2e')](_0x45b0ca[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0x3253a7[_0xfbe2('0x2c')]=_0x3253a7[_0xfbe2('0x2c')][_0xfbe2('0x2f')]?_0x3253a7[_0xfbe2('0x2c')]:_0x1dc77e['model'];if(_0x45b0ca[_0xfbe2('0x2b')][_0xfbe2('0x38')]){_0x3253a7[_0xfbe2('0x3d')]=[{'all':!![]}];}_0x3253a7=_[_0xfbe2('0x37')]({},_0x3253a7,_0x45b0ca['options']);return db[_0xfbe2('0x24')][_0xfbe2('0x3e')](_0x3253a7)[_0xfbe2('0x1f')](handleEntityNotFound(_0x388496,null))[_0xfbe2('0x1f')](respondWithResult(_0x388496,null))[_0xfbe2('0x3b')](handleError(_0x388496,null));};exports[_0xfbe2('0x3f')]=function(_0x1b9e8a,_0x3711a3){return db['Campaign'][_0xfbe2('0x3f')](_0x1b9e8a['body'],{})[_0xfbe2('0x1f')](function(_0x258bef){var _0x5032b9=_0x1b9e8a[_0xfbe2('0x40')][_0xfbe2('0x20')]({'plain':!![]});if(!_0x5032b9)throw new Error(_0xfbe2('0x41'));if(_0x5032b9['role']===_0xfbe2('0x40')){var _0x3c0ec7=_0x258bef[_0xfbe2('0x20')]({'plain':!![]});var _0x5f175e='IvrCampaigns';return db['UserProfileSection'][_0xfbe2('0x3e')]({'where':{'name':_0x5f175e,'userProfileId':_0x5032b9[_0xfbe2('0x42')]},'raw':!![]})[_0xfbe2('0x1f')](function(_0x5ef520){if(_0x5ef520&&_0x5ef520['autoAssociation']===0x0){return db[_0xfbe2('0x43')]['create']({'name':_0x3c0ec7['name'],'resourceId':_0x3c0ec7['id'],'type':_0x5ef520['name'],'sectionId':_0x5ef520['id']},{})[_0xfbe2('0x1f')](function(){return _0x258bef;});}else{return _0x258bef;}})['catch'](function(_0x5aab4f){logger['error'](_0xfbe2('0x44'),_0x5aab4f);throw _0x5aab4f;});}return _0x258bef;})['then'](respondWithResult(_0x3711a3,0xc9))[_0xfbe2('0x3b')](handleError(_0x3711a3,null));};exports[_0xfbe2('0x45')]=function(_0x52d5bf,_0x49fbd8){var _0x307cca={'where':{'id':_0x52d5bf[_0xfbe2('0x46')]['id']}},_0x2c942d={};_0x2c942d[_0xfbe2('0x29')]=_['keys'](db[_0xfbe2('0x24')][_0xfbe2('0x25')]);_0x307cca[_0xfbe2('0x2c')]=_[_0xfbe2('0x2d')](_0x2c942d[_0xfbe2('0x29')],qs['fields'](_0x52d5bf['query']['fields']));_0x307cca[_0xfbe2('0x2c')]=_0x307cca[_0xfbe2('0x2c')][_0xfbe2('0x2f')]?_0x307cca[_0xfbe2('0x2c')]:_0x2c942d['model'];if(_0x52d5bf[_0xfbe2('0x2b')][_0xfbe2('0x38')]){_0x307cca[_0xfbe2('0x3d')]=[{'all':!![]}];}_0x307cca=_[_0xfbe2('0x37')]({},_0x307cca,_0x52d5bf[_0xfbe2('0x47')]);return db[_0xfbe2('0x24')]['find'](_0x307cca)[_0xfbe2('0x1f')](handleEntityNotFound(_0x49fbd8,null))[_0xfbe2('0x1f')](function(_0x534a55){if(_0x534a55){var _0x2bcfc2=_0x534a55['get']({'plain':!![]});_0x2bcfc2=qs[_0xfbe2('0x48')](_0x2bcfc2,['id','createdAt','updatedAt']);_0x52d5bf[_0xfbe2('0x49')]=_[_0xfbe2('0x48')](_0x52d5bf[_0xfbe2('0x49')],['id',_0xfbe2('0x4a'),_0xfbe2('0x4b')]);return db[_0xfbe2('0x24')][_0xfbe2('0x3f')](_['merge'](_0x2bcfc2,_0x52d5bf['body']),{'include':_0x52d5bf['query'][_0xfbe2('0x38')]?[{'all':!![]}]:undefined})[_0xfbe2('0x1f')](function(_0xc2724d){var _0x19f414=_0x52d5bf[_0xfbe2('0x40')][_0xfbe2('0x20')]({'plain':!![]});if(!_0x19f414)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19f414[_0xfbe2('0x4c')]===_0xfbe2('0x40')){var _0x51b51b=_0xc2724d['get']({'plain':!![]});var _0x2f0562=_0xfbe2('0x4d');return db[_0xfbe2('0x4e')][_0xfbe2('0x3e')]({'where':{'name':_0x2f0562,'userProfileId':_0x19f414[_0xfbe2('0x42')]},'raw':!![]})[_0xfbe2('0x1f')](function(_0x228ca5){if(_0x228ca5&&_0x228ca5['autoAssociation']===0x0){return db[_0xfbe2('0x43')][_0xfbe2('0x3f')]({'name':_0x51b51b[_0xfbe2('0x22')],'resourceId':_0x51b51b['id'],'type':_0x228ca5[_0xfbe2('0x22')],'sectionId':_0x228ca5['id']},{})[_0xfbe2('0x1f')](function(){return _0xc2724d;});}else{return _0xc2724d;}})['catch'](function(_0x19ee54){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19ee54);throw _0x19ee54;});}return _0xc2724d;});}})['then'](respondWithResult(_0x49fbd8,0xc9))[_0xfbe2('0x3b')](handleError(_0x49fbd8,null));};exports[_0xfbe2('0x4f')]=function(_0x4aa9b8,_0x58da3c){if(_0x4aa9b8['body']['id']){delete _0x4aa9b8[_0xfbe2('0x49')]['id'];}return db[_0xfbe2('0x24')][_0xfbe2('0x3e')]({'where':{'id':_0x4aa9b8[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x58da3c,null))[_0xfbe2('0x1f')](saveUpdates(_0x4aa9b8[_0xfbe2('0x49')],null))[_0xfbe2('0x1f')](respondWithResult(_0x58da3c,null))[_0xfbe2('0x3b')](handleError(_0x58da3c,null));};exports[_0xfbe2('0x21')]=function(_0x2a484f,_0xb7af88){return db['Campaign']['find']({'where':{'id':_0x2a484f['params']['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0xb7af88,null))[_0xfbe2('0x1f')](removeEntity(_0xb7af88,null))[_0xfbe2('0x3b')](handleError(_0xb7af88,null));};exports[_0xfbe2('0x50')]=function(_0x3d6609,_0x29e7b2,_0x3a934f){var _0x15f666={'raw':!![],'where':{}};var _0x513810={};var _0x15938c={'count':0x0,'rows':[]};return db[_0xfbe2('0x24')][_0xfbe2('0x51')]({'where':{'id':_0x3d6609['params']['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x29e7b2,null))['then'](function(_0x148370){if(_0x148370){_0x513810[_0xfbe2('0x29')]=_[_0xfbe2('0x2a')](db['CmHopper'][_0xfbe2('0x25')]);_0x513810[_0xfbe2('0x2b')]=_['keys'](_0x3d6609[_0xfbe2('0x2b')]);_0x513810[_0xfbe2('0x35')]=_[_0xfbe2('0x2d')](_0x513810[_0xfbe2('0x29')],_0x513810['query']);_0x15f666[_0xfbe2('0x2c')]=_['intersection'](_0x513810[_0xfbe2('0x29')],qs[_0xfbe2('0x2e')](_0x3d6609[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0x15f666[_0xfbe2('0x2c')]=_0x15f666[_0xfbe2('0x2c')]['length']?_0x15f666[_0xfbe2('0x2c')]:_0x513810[_0xfbe2('0x29')];if(!_0x3d6609['query']['hasOwnProperty'](_0xfbe2('0x31'))){_0x15f666[_0xfbe2('0x16')]=qs[_0xfbe2('0x16')](_0x3d6609[_0xfbe2('0x2b')][_0xfbe2('0x16')]);_0x15f666[_0xfbe2('0x19')]=qs[_0xfbe2('0x19')](_0x3d6609[_0xfbe2('0x2b')][_0xfbe2('0x19')]);}_0x15f666['order']=qs[_0xfbe2('0x33')](_0x3d6609[_0xfbe2('0x2b')][_0xfbe2('0x33')]);_0x15f666[_0xfbe2('0x36')]=qs['filters'](_[_0xfbe2('0x34')](_0x3d6609['query'],_0x513810[_0xfbe2('0x35')]));_0x15f666[_0xfbe2('0x36')]['CampaignId']=_0x148370['id'];if(_0x3d6609[_0xfbe2('0x2b')][_0xfbe2('0x52')]){_0x15f666[_0xfbe2('0x36')]=_['merge'](_0x15f666[_0xfbe2('0x36')],{'$or':_[_0xfbe2('0x23')](_0x15f666[_0xfbe2('0x2c')],function(_0x346106){var _0x20c3df={};_0x20c3df[_0x346106]={'$like':'%'+_0x3d6609['query'][_0xfbe2('0x52')]+'%'};return _0x20c3df;})});}_0x15f666=_[_0xfbe2('0x37')]({},_0x15f666,_0x3d6609[_0xfbe2('0x47')]);return db[_0xfbe2('0x53')][_0xfbe2('0x18')]({'where':_0x15f666['where']})[_0xfbe2('0x1f')](function(_0x3b66e8){_0x15938c[_0xfbe2('0x18')]=_0x3b66e8;if(_0x3d6609[_0xfbe2('0x2b')]['includeAll']){_0x15f666['include']=[{'all':!![]}];}return db[_0xfbe2('0x53')][_0xfbe2('0x39')](_0x15f666);})['then'](function(_0x5b62c3){_0x15938c[_0xfbe2('0x3a')]=_0x5b62c3;return _0x15938c;});}})[_0xfbe2('0x1f')](respondWithFilteredResult(_0x29e7b2,_0x15f666))['catch'](handleError(_0x29e7b2,null));};exports['getHopperHistories']=function(_0x5d1fa5,_0x347a54,_0x2d0342){var _0x5e51c0={'raw':!![],'where':{}};var _0x49c03b={};var _0x194c88={'count':0x0,'rows':[]};return db[_0xfbe2('0x24')]['findOne']({'where':{'id':_0x5d1fa5['params']['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x347a54,null))[_0xfbe2('0x1f')](function(_0x43d1b2){if(_0x43d1b2){_0x49c03b['model']=_[_0xfbe2('0x2a')](db[_0xfbe2('0x54')][_0xfbe2('0x25')]);_0x49c03b[_0xfbe2('0x2b')]=_['keys'](_0x5d1fa5['query']);_0x49c03b[_0xfbe2('0x35')]=_[_0xfbe2('0x2d')](_0x49c03b['model'],_0x49c03b[_0xfbe2('0x2b')]);_0x5e51c0[_0xfbe2('0x2c')]=_['intersection'](_0x49c03b[_0xfbe2('0x29')],qs[_0xfbe2('0x2e')](_0x5d1fa5[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0x5e51c0['attributes']=_0x5e51c0['attributes'][_0xfbe2('0x2f')]?_0x5e51c0[_0xfbe2('0x2c')]:_0x49c03b[_0xfbe2('0x29')];if(!_0x5d1fa5[_0xfbe2('0x2b')][_0xfbe2('0x30')](_0xfbe2('0x31'))){_0x5e51c0[_0xfbe2('0x16')]=qs[_0xfbe2('0x16')](_0x5d1fa5[_0xfbe2('0x2b')][_0xfbe2('0x16')]);_0x5e51c0[_0xfbe2('0x19')]=qs['offset'](_0x5d1fa5[_0xfbe2('0x2b')][_0xfbe2('0x19')]);}_0x5e51c0[_0xfbe2('0x32')]=qs[_0xfbe2('0x33')](_0x5d1fa5['query']['sort']);_0x5e51c0['where']=qs['filters'](_[_0xfbe2('0x34')](_0x5d1fa5['query'],_0x49c03b['filters']));_0x5e51c0[_0xfbe2('0x36')]['CampaignId']=_0x43d1b2['id'];if(_0x5d1fa5['query'][_0xfbe2('0x52')]){_0x5e51c0[_0xfbe2('0x36')]=_[_0xfbe2('0x37')](_0x5e51c0[_0xfbe2('0x36')],{'$or':_[_0xfbe2('0x23')](_0x5e51c0['attributes'],function(_0x5ec32a){var _0x2941f9={};_0x2941f9[_0x5ec32a]={'$like':'%'+_0x5d1fa5[_0xfbe2('0x2b')]['filter']+'%'};return _0x2941f9;})});}_0x5e51c0=_[_0xfbe2('0x37')]({},_0x5e51c0,_0x5d1fa5[_0xfbe2('0x47')]);return db['CmHopperHistory'][_0xfbe2('0x18')]({'where':_0x5e51c0[_0xfbe2('0x36')]})['then'](function(_0x1ff861){_0x194c88['count']=_0x1ff861;if(_0x5d1fa5['query'][_0xfbe2('0x38')]){_0x5e51c0[_0xfbe2('0x3d')]=[{'all':!![]}];}return db[_0xfbe2('0x54')]['findAll'](_0x5e51c0);})['then'](function(_0x3d77cd){_0x194c88[_0xfbe2('0x3a')]=_0x3d77cd;return _0x194c88;});}})[_0xfbe2('0x1f')](respondWithFilteredResult(_0x347a54,_0x5e51c0))[_0xfbe2('0x3b')](handleError(_0x347a54,null));};exports['getHopperFinals']=function(_0x160619,_0x30d1fe,_0x275602){var _0x193740={'raw':!![],'where':{}};var _0x340a0b={};var _0x39330a={'count':0x0,'rows':[]};return db[_0xfbe2('0x24')][_0xfbe2('0x51')]({'where':{'id':_0x160619[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x30d1fe,null))['then'](function(_0x23c092){if(_0x23c092){_0x340a0b[_0xfbe2('0x29')]=_[_0xfbe2('0x2a')](db['CmHopperFinal'][_0xfbe2('0x25')]);_0x340a0b[_0xfbe2('0x2b')]=_[_0xfbe2('0x2a')](_0x160619[_0xfbe2('0x2b')]);_0x340a0b[_0xfbe2('0x35')]=_[_0xfbe2('0x2d')](_0x340a0b[_0xfbe2('0x29')],_0x340a0b[_0xfbe2('0x2b')]);_0x193740[_0xfbe2('0x2c')]=_[_0xfbe2('0x2d')](_0x340a0b[_0xfbe2('0x29')],qs[_0xfbe2('0x2e')](_0x160619[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0x193740['attributes']=_0x193740[_0xfbe2('0x2c')]['length']?_0x193740[_0xfbe2('0x2c')]:_0x340a0b[_0xfbe2('0x29')];if(!_0x160619[_0xfbe2('0x2b')][_0xfbe2('0x30')](_0xfbe2('0x31'))){_0x193740[_0xfbe2('0x16')]=qs['limit'](_0x160619['query'][_0xfbe2('0x16')]);_0x193740[_0xfbe2('0x19')]=qs[_0xfbe2('0x19')](_0x160619[_0xfbe2('0x2b')][_0xfbe2('0x19')]);}_0x193740[_0xfbe2('0x32')]=qs[_0xfbe2('0x33')](_0x160619[_0xfbe2('0x2b')][_0xfbe2('0x33')]);_0x193740[_0xfbe2('0x36')]=qs['filters'](_[_0xfbe2('0x34')](_0x160619['query'],_0x340a0b[_0xfbe2('0x35')]));_0x193740[_0xfbe2('0x36')][_0xfbe2('0x55')]=_0x23c092['id'];if(_0x160619[_0xfbe2('0x2b')][_0xfbe2('0x52')]){_0x193740['where']=_[_0xfbe2('0x37')](_0x193740[_0xfbe2('0x36')],{'$or':_['map'](_0x193740[_0xfbe2('0x2c')],function(_0x28d5cd){var _0x82700e={};_0x82700e[_0x28d5cd]={'$like':'%'+_0x160619['query'][_0xfbe2('0x52')]+'%'};return _0x82700e;})});}_0x193740=_[_0xfbe2('0x37')]({},_0x193740,_0x160619[_0xfbe2('0x47')]);return db[_0xfbe2('0x56')]['count']({'where':_0x193740[_0xfbe2('0x36')]})[_0xfbe2('0x1f')](function(_0x5055cf){_0x39330a[_0xfbe2('0x18')]=_0x5055cf;if(_0x160619[_0xfbe2('0x2b')][_0xfbe2('0x38')]){_0x193740[_0xfbe2('0x3d')]=[{'all':!![]}];}return db[_0xfbe2('0x56')]['findAll'](_0x193740);})[_0xfbe2('0x1f')](function(_0x454e35){_0x39330a[_0xfbe2('0x3a')]=_0x454e35;return _0x39330a;});}})[_0xfbe2('0x1f')](respondWithFilteredResult(_0x30d1fe,_0x193740))['catch'](handleError(_0x30d1fe,null));};exports[_0xfbe2('0x57')]=function(_0x5139f1,_0x43b418,_0xe2abe7){var _0x481ecc={'raw':!![],'where':{}};var _0x410fbd={};var _0x69fa11={'count':0x0,'rows':[]};return db[_0xfbe2('0x24')][_0xfbe2('0x51')]({'where':{'id':_0x5139f1[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x43b418,null))[_0xfbe2('0x1f')](function(_0x2362c2){if(_0x2362c2){_0x410fbd[_0xfbe2('0x29')]=_[_0xfbe2('0x2a')](db[_0xfbe2('0x58')][_0xfbe2('0x25')]);_0x410fbd[_0xfbe2('0x2b')]=_[_0xfbe2('0x2a')](_0x5139f1[_0xfbe2('0x2b')]);_0x410fbd[_0xfbe2('0x35')]=_[_0xfbe2('0x2d')](_0x410fbd[_0xfbe2('0x29')],_0x410fbd['query']);_0x481ecc[_0xfbe2('0x2c')]=_['intersection'](_0x410fbd['model'],qs['fields'](_0x5139f1[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0x481ecc['attributes']=_0x481ecc[_0xfbe2('0x2c')][_0xfbe2('0x2f')]?_0x481ecc[_0xfbe2('0x2c')]:_0x410fbd[_0xfbe2('0x29')];if(!_0x5139f1['query']['hasOwnProperty'](_0xfbe2('0x31'))){_0x481ecc[_0xfbe2('0x16')]=qs[_0xfbe2('0x16')](_0x5139f1[_0xfbe2('0x2b')][_0xfbe2('0x16')]);_0x481ecc[_0xfbe2('0x19')]=qs[_0xfbe2('0x19')](_0x5139f1[_0xfbe2('0x2b')][_0xfbe2('0x19')]);}_0x481ecc[_0xfbe2('0x32')]=qs[_0xfbe2('0x33')](_0x5139f1[_0xfbe2('0x2b')][_0xfbe2('0x33')]);_0x481ecc[_0xfbe2('0x36')]=qs[_0xfbe2('0x35')](_[_0xfbe2('0x34')](_0x5139f1['query'],_0x410fbd['filters']));_0x481ecc[_0xfbe2('0x36')]['CampaignId']=_0x2362c2['id'];if(_0x5139f1[_0xfbe2('0x2b')]['filter']){_0x481ecc[_0xfbe2('0x36')]=_[_0xfbe2('0x37')](_0x481ecc['where'],{'$or':_[_0xfbe2('0x23')](_0x481ecc[_0xfbe2('0x2c')],function(_0x51d176){var _0x21cd6a={};_0x21cd6a[_0x51d176]={'$like':'%'+_0x5139f1[_0xfbe2('0x2b')]['filter']+'%'};return _0x21cd6a;})});}_0x481ecc=_[_0xfbe2('0x37')]({},_0x481ecc,_0x5139f1['options']);return db['CmHopperBlack'][_0xfbe2('0x18')]({'where':_0x481ecc[_0xfbe2('0x36')]})['then'](function(_0x2be46f){_0x69fa11[_0xfbe2('0x18')]=_0x2be46f;if(_0x5139f1[_0xfbe2('0x2b')]['includeAll']){_0x481ecc[_0xfbe2('0x3d')]=[{'all':!![]}];}return db[_0xfbe2('0x58')][_0xfbe2('0x39')](_0x481ecc);})[_0xfbe2('0x1f')](function(_0xa7b23b){_0x69fa11['rows']=_0xa7b23b;return _0x69fa11;});}})[_0xfbe2('0x1f')](respondWithFilteredResult(_0x43b418,_0x481ecc))[_0xfbe2('0x3b')](handleError(_0x43b418,null));};exports[_0xfbe2('0x59')]=function(_0x572861,_0x2901e5,_0x2e0d5a){var _0xd6b80c={};var _0x4b70e2={};var _0x3e6e7f;var _0x3ed94f;return db[_0xfbe2('0x24')]['findOne']({'where':{'id':_0x572861[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x2901e5,null))[_0xfbe2('0x1f')](function(_0x3d6746){if(_0x3d6746){_0x3e6e7f=_0x3d6746;_0x4b70e2['model']=_[_0xfbe2('0x2a')](db['CmList'][_0xfbe2('0x25')]);_0x4b70e2['query']=_[_0xfbe2('0x2a')](_0x572861[_0xfbe2('0x2b')]);_0x4b70e2['filters']=_['intersection'](_0x4b70e2[_0xfbe2('0x29')],_0x4b70e2[_0xfbe2('0x2b')]);_0xd6b80c['attributes']=_['intersection'](_0x4b70e2[_0xfbe2('0x29')],qs[_0xfbe2('0x2e')](_0x572861[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0xd6b80c[_0xfbe2('0x2c')]=_0xd6b80c[_0xfbe2('0x2c')]['length']?_0xd6b80c[_0xfbe2('0x2c')]:_0x4b70e2['model'];_0xd6b80c[_0xfbe2('0x32')]=qs[_0xfbe2('0x33')](_0x572861['query'][_0xfbe2('0x33')]);_0xd6b80c[_0xfbe2('0x36')]=qs['filters'](_[_0xfbe2('0x34')](_0x572861[_0xfbe2('0x2b')],_0x4b70e2[_0xfbe2('0x35')]));if(_0x572861[_0xfbe2('0x2b')][_0xfbe2('0x52')]){_0xd6b80c[_0xfbe2('0x36')]=_[_0xfbe2('0x37')](_0xd6b80c['where'],{'$or':_[_0xfbe2('0x23')](_0xd6b80c[_0xfbe2('0x2c')],function(_0x2c5e35){var _0x16fab3={};_0x16fab3[_0x2c5e35]={'$like':'%'+_0x572861['query'][_0xfbe2('0x52')]+'%'};return _0x16fab3;})});}_0xd6b80c=_['merge']({},_0xd6b80c,_0x572861[_0xfbe2('0x47')]);return _0x3e6e7f[_0xfbe2('0x59')](_0xd6b80c);}})[_0xfbe2('0x1f')](function(_0x50be4c){if(_0x50be4c){_0x3ed94f=_0x50be4c[_0xfbe2('0x2f')];if(!_0x572861['query'][_0xfbe2('0x30')]('nolimit')){_0xd6b80c['limit']=qs[_0xfbe2('0x16')](_0x572861[_0xfbe2('0x2b')]['limit']);_0xd6b80c[_0xfbe2('0x19')]=qs['offset'](_0x572861[_0xfbe2('0x2b')]['offset']);}return _0x3e6e7f[_0xfbe2('0x59')](_0xd6b80c);}})[_0xfbe2('0x1f')](function(_0x5e925f){if(_0x5e925f){return _0x5e925f?{'count':_0x3ed94f,'rows':_0x5e925f}:null;}})[_0xfbe2('0x1f')](respondWithResult(_0x2901e5,null))['catch'](handleError(_0x2901e5,null));};exports[_0xfbe2('0x5a')]=function(_0x45b727,_0x15baf5,_0x17f884){var _0x4e9865,_0x54b673;return db['Campaign'][_0xfbe2('0x3e')]({'where':{'id':_0x45b727[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x15baf5,null))[_0xfbe2('0x1f')](function(_0x26969e){if(_0x26969e){_0x54b673=_0x26969e;return _0x26969e[_0xfbe2('0x5a')](_0x45b727['body'][_0xfbe2('0x5b')],_['omit'](_0x45b727[_0xfbe2('0x49')],[_0xfbe2('0x5b'),'id'])||{});}return null;})[_0xfbe2('0x5c')](function(_0x2f74d2){var _0x20e11f;_0x4e9865=_0x2f74d2||[];var _0x125eeb=[];if(_0x2f74d2){for(var _0x15c0ad=0x0;_0x15c0ad<_0x2f74d2[_0xfbe2('0x2f')];_0x15c0ad+=0x1){var _0x3326a9=_0x2f74d2[_0x15c0ad][_0xfbe2('0x20')]({'plain':!![]});_0x54b673[_0xfbe2('0x5d')]=_0x45b727[_0xfbe2('0x49')][_0xfbe2('0x5d')]?_0x45b727[_0xfbe2('0x49')][_0xfbe2('0x5d')]:_0x54b673[_0xfbe2('0x5d')];switch(_0x54b673['dialCheckDuplicateType']){case _0xfbe2('0x5e'):_0x20e11f=squel[_0xfbe2('0x5f')]()[_0xfbe2('0x60')](_0xfbe2('0x61'))[_0xfbe2('0x62')]([_0xfbe2('0x63'),_0xfbe2('0x64'),_0xfbe2('0x65'),_0xfbe2('0x66'),_0xfbe2('0x55'),_0xfbe2('0x4a'),_0xfbe2('0x4b')],squel[_0xfbe2('0x67')]()[_0xfbe2('0x68')](_0xfbe2('0x63'),_0xfbe2('0x63'))[_0xfbe2('0x68')]('NOW()',_0xfbe2('0x64'))['field']('id',_0xfbe2('0x65'))['field'](_0x3326a9[_0xfbe2('0x69')][_0xfbe2('0x6a')](),'ListId')[_0xfbe2('0x68')](_0x45b727['params']['id'][_0xfbe2('0x6a')](),_0xfbe2('0x55'))[_0xfbe2('0x68')]('NOW()',_0xfbe2('0x4a'))[_0xfbe2('0x68')](_0xfbe2('0x6b'),'updatedAt')[_0xfbe2('0x6c')](_0xfbe2('0x6d'))[_0xfbe2('0x36')](_0xfbe2('0x6e'))[_0xfbe2('0x36')](_0xfbe2('0x6f'),_0x3326a9['CmListId'][_0xfbe2('0x6a')]())[_0xfbe2('0x36')]('phone\x20IS\x20NOT\x20NULL')[_0xfbe2('0x36')](_0xfbe2('0x70'),squel['select']()[_0xfbe2('0x68')](_0xfbe2('0x71'))['from'](_0xfbe2('0x72'))[_0xfbe2('0x36')](_0xfbe2('0x73'),_0x45b727[_0xfbe2('0x46')]['id'][_0xfbe2('0x6a')]()))[_0xfbe2('0x36')](_0xfbe2('0x70'),squel['select']()[_0xfbe2('0x68')]('COALESCE(phone,\x27\x27)')[_0xfbe2('0x6c')](_0xfbe2('0x61'))[_0xfbe2('0x36')]('CampaignId\x20=\x20?',_0x45b727[_0xfbe2('0x46')]['id'][_0xfbe2('0x6a')]())))[_0xfbe2('0x6a')]();break;case _0xfbe2('0x74'):_0x20e11f=squel[_0xfbe2('0x5f')]()[_0xfbe2('0x60')]('cm_hopper')['fromQuery'](['phone',_0xfbe2('0x64'),_0xfbe2('0x65'),'ListId',_0xfbe2('0x55'),_0xfbe2('0x4a'),_0xfbe2('0x4b')],squel[_0xfbe2('0x67')]()['field'](_0xfbe2('0x63'),_0xfbe2('0x63'))[_0xfbe2('0x68')](_0xfbe2('0x6b'),'scheduledAt')[_0xfbe2('0x68')]('id','ContactId')[_0xfbe2('0x68')](_0x3326a9['CmListId']['toString'](),_0xfbe2('0x66'))['field'](_0x45b727['params']['id']['toString'](),_0xfbe2('0x55'))[_0xfbe2('0x68')]('NOW()',_0xfbe2('0x4a'))[_0xfbe2('0x68')]('NOW()','updatedAt')[_0xfbe2('0x6c')](_0xfbe2('0x6d'))[_0xfbe2('0x36')](_0xfbe2('0x6e'))[_0xfbe2('0x36')](_0xfbe2('0x6f'),_0x3326a9[_0xfbe2('0x69')][_0xfbe2('0x6a')]())[_0xfbe2('0x36')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xfbe2('0x70'),squel[_0xfbe2('0x67')]()[_0xfbe2('0x68')]('COALESCE(phone,\x27\x27)')[_0xfbe2('0x6c')](_0xfbe2('0x61'))['where'](_0xfbe2('0x73'),_0x45b727[_0xfbe2('0x46')]['id'][_0xfbe2('0x6a')]())))[_0xfbe2('0x6a')]();break;default:_0x20e11f=squel[_0xfbe2('0x5f')]()[_0xfbe2('0x60')]('cm_hopper')[_0xfbe2('0x62')]([_0xfbe2('0x63'),_0xfbe2('0x64'),_0xfbe2('0x65'),_0xfbe2('0x66'),_0xfbe2('0x55'),_0xfbe2('0x4a'),'updatedAt'],squel[_0xfbe2('0x67')]()[_0xfbe2('0x68')](_0xfbe2('0x63'),_0xfbe2('0x63'))[_0xfbe2('0x68')](_0xfbe2('0x6b'),_0xfbe2('0x64'))['field']('id',_0xfbe2('0x65'))[_0xfbe2('0x68')](_0x3326a9[_0xfbe2('0x69')][_0xfbe2('0x6a')](),_0xfbe2('0x66'))['field'](_0x45b727[_0xfbe2('0x46')]['id'][_0xfbe2('0x6a')](),'CampaignId')['field'](_0xfbe2('0x6b'),_0xfbe2('0x4a'))['field'](_0xfbe2('0x6b'),_0xfbe2('0x4b'))[_0xfbe2('0x6c')]('cm_contacts')[_0xfbe2('0x36')](_0xfbe2('0x6e'))[_0xfbe2('0x36')](_0xfbe2('0x6f'),_0x3326a9[_0xfbe2('0x69')][_0xfbe2('0x6a')]())[_0xfbe2('0x36')]('phone\x20IS\x20NOT\x20NULL'))[_0xfbe2('0x6a')]();}_0x125eeb[_0xfbe2('0x75')](db[_0xfbe2('0x76')][_0xfbe2('0x2b')](_0x20e11f));}return BPromise[_0xfbe2('0x77')](_0x125eeb);}})[_0xfbe2('0x1f')](function(){return _0x4e9865;})[_0xfbe2('0x1f')](respondWithResult(_0x15baf5,null))[_0xfbe2('0x3b')](handleError(_0x15baf5,null));};exports[_0xfbe2('0x78')]=function(_0x3f9c4f,_0x42712b,_0x465450){return db[_0xfbe2('0x24')][_0xfbe2('0x3e')]({'where':{'id':_0x3f9c4f[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x42712b,null))[_0xfbe2('0x1f')](function(_0x201992){if(_0x201992){return _0x201992[_0xfbe2('0x78')](_0x3f9c4f[_0xfbe2('0x2b')][_0xfbe2('0x5b')]);}})[_0xfbe2('0x1f')](function(_0x593d08){if(_0x593d08){return db[_0xfbe2('0x53')]['destroy']({'where':{'ListId':_0x3f9c4f['query'][_0xfbe2('0x5b')],'CampaignId':_0x3f9c4f[_0xfbe2('0x46')]['id']}})['then'](function(){return _0x593d08;});}})['then'](respondWithStatusCode(_0x42712b,null))[_0xfbe2('0x3b')](handleError(_0x42712b,null));};exports[_0xfbe2('0x79')]=function(_0x55c8ed,_0x44b239,_0x27492e){var _0xcf396d={};var _0x38dd4d={};var _0x955d8e;var _0x1b193f;return db['Campaign'][_0xfbe2('0x51')]({'where':{'id':_0x55c8ed[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x44b239,null))[_0xfbe2('0x1f')](function(_0x3d743f){if(_0x3d743f){_0x955d8e=_0x3d743f;_0x38dd4d[_0xfbe2('0x29')]=_[_0xfbe2('0x2a')](db[_0xfbe2('0x7a')][_0xfbe2('0x25')]);_0x38dd4d[_0xfbe2('0x2b')]=_[_0xfbe2('0x2a')](_0x55c8ed[_0xfbe2('0x2b')]);_0x38dd4d[_0xfbe2('0x35')]=_[_0xfbe2('0x2d')](_0x38dd4d[_0xfbe2('0x29')],_0x38dd4d['query']);_0xcf396d['attributes']=_['intersection'](_0x38dd4d[_0xfbe2('0x29')],qs[_0xfbe2('0x2e')](_0x55c8ed[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0xcf396d[_0xfbe2('0x2c')]=_0xcf396d[_0xfbe2('0x2c')][_0xfbe2('0x2f')]?_0xcf396d[_0xfbe2('0x2c')]:_0x38dd4d[_0xfbe2('0x29')];_0xcf396d[_0xfbe2('0x32')]=qs['sort'](_0x55c8ed[_0xfbe2('0x2b')][_0xfbe2('0x33')]);_0xcf396d[_0xfbe2('0x36')]=qs['filters'](_[_0xfbe2('0x34')](_0x55c8ed[_0xfbe2('0x2b')],_0x38dd4d[_0xfbe2('0x35')]));if(_0x55c8ed[_0xfbe2('0x2b')]['filter']){_0xcf396d[_0xfbe2('0x36')]=_[_0xfbe2('0x37')](_0xcf396d[_0xfbe2('0x36')],{'$or':_['map'](_0xcf396d[_0xfbe2('0x2c')],function(_0xe9720f){var _0x1e47c1={};_0x1e47c1[_0xe9720f]={'$like':'%'+_0x55c8ed[_0xfbe2('0x2b')]['filter']+'%'};return _0x1e47c1;})});}_0xcf396d=_['merge']({},_0xcf396d,_0x55c8ed['options']);return _0x955d8e[_0xfbe2('0x79')](_0xcf396d);}})['then'](function(_0x2dd2eb){if(_0x2dd2eb){_0x1b193f=_0x2dd2eb[_0xfbe2('0x2f')];if(!_0x55c8ed['query']['hasOwnProperty'](_0xfbe2('0x31'))){_0xcf396d[_0xfbe2('0x16')]=qs[_0xfbe2('0x16')](_0x55c8ed['query'][_0xfbe2('0x16')]);_0xcf396d['offset']=qs[_0xfbe2('0x19')](_0x55c8ed[_0xfbe2('0x2b')]['offset']);}return _0x955d8e['getBlackLists'](_0xcf396d);}})[_0xfbe2('0x1f')](function(_0x4a7566){if(_0x4a7566){return _0x4a7566?{'count':_0x1b193f,'rows':_0x4a7566}:null;}})[_0xfbe2('0x1f')](respondWithResult(_0x44b239,null))['catch'](handleError(_0x44b239,null));};exports[_0xfbe2('0x7b')]=function(_0x1ab9b8,_0xbcdeec,_0x2cd943){var _0x5e81a2,_0x66073b;return db[_0xfbe2('0x24')][_0xfbe2('0x3e')]({'where':{'id':_0x1ab9b8['params']['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0xbcdeec,null))[_0xfbe2('0x1f')](function(_0x1eb559){if(_0x1eb559){_0x66073b=_0x1eb559;return _0x1eb559[_0xfbe2('0x7b')](_0x1ab9b8[_0xfbe2('0x49')]['ids'],_[_0xfbe2('0x48')](_0x1ab9b8[_0xfbe2('0x49')],[_0xfbe2('0x5b'),'id'])||{});}return null;})[_0xfbe2('0x5c')](function(_0x2493d4){var _0x1b8064;_0x5e81a2=_0x2493d4||[];var _0x18672d=[];if(_0x2493d4){for(var _0x5d0f58=0x0;_0x5d0f58<_0x2493d4[_0xfbe2('0x2f')];_0x5d0f58+=0x1){var _0x38e3e1=_0x2493d4[_0x5d0f58]['get']({'plain':!![]});_0x1b8064=squel[_0xfbe2('0x5f')]()[_0xfbe2('0x60')](_0xfbe2('0x7c'))[_0xfbe2('0x62')]([_0xfbe2('0x63'),'ContactId','ListId',_0xfbe2('0x55'),_0xfbe2('0x4a'),_0xfbe2('0x4b')],squel['select']()[_0xfbe2('0x68')](_0xfbe2('0x63'),_0xfbe2('0x63'))['field']('id',_0xfbe2('0x65'))[_0xfbe2('0x68')](_0x38e3e1['CmListId'][_0xfbe2('0x6a')](),_0xfbe2('0x66'))[_0xfbe2('0x68')](_0x1ab9b8[_0xfbe2('0x46')]['id'][_0xfbe2('0x6a')](),'CampaignId')[_0xfbe2('0x68')](_0xfbe2('0x6b'),_0xfbe2('0x4a'))[_0xfbe2('0x68')](_0xfbe2('0x6b'),'updatedAt')[_0xfbe2('0x6c')](_0xfbe2('0x6d'))[_0xfbe2('0x36')](_0xfbe2('0x6e'))['where']('ListId\x20=\x20?',_0x38e3e1[_0xfbe2('0x69')][_0xfbe2('0x6a')]())[_0xfbe2('0x36')](_0xfbe2('0x7d')))[_0xfbe2('0x6a')]();_0x18672d['push'](db[_0xfbe2('0x76')]['query'](_0x1b8064));}return BPromise['all'](_0x18672d);}})[_0xfbe2('0x1f')](function(){return _0x5e81a2;})['then'](respondWithResult(_0xbcdeec,null))['catch'](handleError(_0xbcdeec,null));};exports[_0xfbe2('0x7e')]=function(_0x58e3f7,_0x3466da,_0x356d93){return db[_0xfbe2('0x24')][_0xfbe2('0x3e')]({'where':{'id':_0x58e3f7[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x3466da,null))[_0xfbe2('0x1f')](function(_0x560764){if(_0x560764){return _0x560764[_0xfbe2('0x7e')](_0x58e3f7['query']['ids']);}})[_0xfbe2('0x1f')](function(_0x7128c7){if(_0x7128c7){return db[_0xfbe2('0x58')]['destroy']({'where':{'ListId':_0x58e3f7['query'][_0xfbe2('0x5b')],'CampaignId':_0x58e3f7['params']['id']}})[_0xfbe2('0x1f')](function(){return _0x7128c7;});}})[_0xfbe2('0x1f')](respondWithStatusCode(_0x3466da,null))[_0xfbe2('0x3b')](handleError(_0x3466da,null));};
\ No newline at end of file
+var _0x23b4=['filter','VIRTUAL','include','rows','show','params','length','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','updatedAt','createdAt','role','autoAssociation','getHoppers','CmHopper','findAll','getHopperHistories','findOne','CmHopperHistory','CampaignId','getHopperFinals','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','insert','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map','Campaign','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x4e52fa,_0x5945ee){var _0x3b2d46=function(_0x216153){while(--_0x216153){_0x4e52fa['push'](_0x4e52fa['shift']());}};_0x3b2d46(++_0x5945ee);}(_0x23b4,0x1da));var _0x423b=function(_0x179b80,_0x440291){_0x179b80=_0x179b80-0x0;var _0x1e8d03=_0x23b4[_0x179b80];return _0x1e8d03;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x423b('0x0'));var jsonpatch=require(_0x423b('0x1'));var rp=require(_0x423b('0x2'));var moment=require(_0x423b('0x3'));var BPromise=require(_0x423b('0x4'));var Mustache=require(_0x423b('0x5'));var util=require(_0x423b('0x6'));var path=require(_0x423b('0x7'));var sox=require('sox');var csv=require(_0x423b('0x8'));var ejs=require(_0x423b('0x9'));var fs=require('fs');var fs_extra=require(_0x423b('0xa'));var _=require(_0x423b('0xb'));var squel=require(_0x423b('0xc'));var crypto=require(_0x423b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x423b('0xe'));var toCsv=require(_0x423b('0x8'));var querystring=require(_0x423b('0xf'));var Papa=require(_0x423b('0x10'));var Redis=require(_0x423b('0x11'));var authService=require(_0x423b('0x12'));var qs=require(_0x423b('0x13'));var as=require(_0x423b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x423b('0x15'))(_0x423b('0x16'));var utils=require(_0x423b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x423b('0x18'));var db=require(_0x423b('0x19'))['db'];function respondWithStatusCode(_0x286c56,_0x3a2b93){_0x3a2b93=_0x3a2b93||0xcc;return function(_0x19c823){if(_0x19c823){return _0x286c56[_0x423b('0x1a')](_0x3a2b93);}return _0x286c56['status'](_0x3a2b93)[_0x423b('0x1b')]();};}function respondWithResult(_0x39419a,_0x443941){_0x443941=_0x443941||0xc8;return function(_0x455802){if(_0x455802){return _0x39419a[_0x423b('0x1c')](_0x443941)[_0x423b('0x1d')](_0x455802);}};}function respondWithFilteredResult(_0x16ef5e,_0x4e3689){return function(_0x231e41){if(_0x231e41){var _0x4616be=typeof _0x4e3689[_0x423b('0x1e')]===_0x423b('0x1f')&&typeof _0x4e3689[_0x423b('0x20')]===_0x423b('0x1f');var _0x15eba2=_0x231e41[_0x423b('0x21')];var _0x2b584f=_0x4616be?0x0:_0x4e3689[_0x423b('0x1e')];var _0x5e73bd=_0x4616be?_0x231e41[_0x423b('0x21')]:_0x4e3689[_0x423b('0x1e')]+_0x4e3689[_0x423b('0x20')];var _0x20e844;if(_0x5e73bd>=_0x15eba2){_0x5e73bd=_0x15eba2;_0x20e844=0xc8;}else{_0x20e844=0xce;}_0x16ef5e[_0x423b('0x1c')](_0x20e844);return _0x16ef5e[_0x423b('0x22')](_0x423b('0x23'),_0x2b584f+'-'+_0x5e73bd+'/'+_0x15eba2)['json'](_0x231e41);}return null;};}function patchUpdates(_0x523520){return function(_0x53af19){try{jsonpatch[_0x423b('0x24')](_0x53af19,_0x523520,!![]);}catch(_0x1c6fda){return BPromise[_0x423b('0x25')](_0x1c6fda);}return _0x53af19['save']();};}function saveUpdates(_0x1bef8f,_0xcd07d6){return function(_0x5e1256){if(_0x5e1256){return _0x5e1256[_0x423b('0x26')](_0x1bef8f)[_0x423b('0x27')](function(_0x5bdcb1){return _0x5bdcb1;});}return null;};}function removeEntity(_0x23226c,_0x139885){return function(_0x6b9346){if(_0x6b9346){return _0x6b9346[_0x423b('0x28')]()[_0x423b('0x27')](function(){var _0x3b16f7=_0x6b9346[_0x423b('0x29')]({'plain':!![]});var _0x1cd3e8=_0x423b('0x2a');return db['UserProfileResource'][_0x423b('0x28')]({'where':{'type':_0x1cd3e8,'resourceId':_0x3b16f7['id']}})[_0x423b('0x27')](function(){return _0x6b9346;});})['then'](function(){_0x23226c[_0x423b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaf1295,_0x23daf5){return function(_0x4e0bb2){if(!_0x4e0bb2){_0xaf1295[_0x423b('0x1a')](0x194);}return _0x4e0bb2;};}function handleError(_0x28577c,_0x101280){_0x101280=_0x101280||0x1f4;return function(_0x1a5c71){logger[_0x423b('0x2b')](_0x1a5c71[_0x423b('0x2c')]);if(_0x1a5c71[_0x423b('0x2d')]){delete _0x1a5c71[_0x423b('0x2d')];}_0x28577c[_0x423b('0x1c')](_0x101280)[_0x423b('0x2e')](_0x1a5c71);};}exports[_0x423b('0x2f')]=function(_0x5b8b0,_0x3a8fbd){var _0x23d3ca={},_0x5c40c9={},_0x3dc41c={'count':0x0,'rows':[]};var _0x189983=_[_0x423b('0x30')](db[_0x423b('0x31')][_0x423b('0x32')],function(_0x3e8da4){return{'name':_0x3e8da4['fieldName'],'type':_0x3e8da4[_0x423b('0x33')][_0x423b('0x34')]};});_0x5c40c9[_0x423b('0x35')]=_['map'](_0x189983,_0x423b('0x2d'));_0x5c40c9[_0x423b('0x36')]=_[_0x423b('0x37')](_0x5b8b0['query']);_0x5c40c9['filters']=_[_0x423b('0x38')](_0x5c40c9['model'],_0x5c40c9['query']);_0x23d3ca['attributes']=_[_0x423b('0x38')](_0x5c40c9[_0x423b('0x35')],qs[_0x423b('0x39')](_0x5b8b0[_0x423b('0x36')][_0x423b('0x39')]));_0x23d3ca[_0x423b('0x3a')]=_0x23d3ca[_0x423b('0x3a')]['length']?_0x23d3ca[_0x423b('0x3a')]:_0x5c40c9['model'];if(!_0x5b8b0[_0x423b('0x36')][_0x423b('0x3b')](_0x423b('0x3c'))){_0x23d3ca[_0x423b('0x20')]=qs[_0x423b('0x20')](_0x5b8b0['query'][_0x423b('0x20')]);_0x23d3ca[_0x423b('0x1e')]=qs[_0x423b('0x1e')](_0x5b8b0[_0x423b('0x36')]['offset']);}_0x23d3ca[_0x423b('0x3d')]=qs['sort'](_0x5b8b0[_0x423b('0x36')][_0x423b('0x3e')]);_0x23d3ca[_0x423b('0x3f')]=qs[_0x423b('0x40')](_[_0x423b('0x41')](_0x5b8b0[_0x423b('0x36')],_0x5c40c9[_0x423b('0x40')]),_0x189983);if(_0x5b8b0['query'][_0x423b('0x42')]){_0x23d3ca[_0x423b('0x3f')]=_['merge'](_0x23d3ca['where'],{'$or':_[_0x423b('0x30')](_0x189983,function(_0x46d19b){if(_0x46d19b[_0x423b('0x33')]!==_0x423b('0x43')){var _0x3bab0f={};_0x3bab0f[_0x46d19b[_0x423b('0x2d')]]={'$like':'%'+_0x5b8b0[_0x423b('0x36')]['filter']+'%'};return _0x3bab0f;}})});}_0x23d3ca=_['merge']({},_0x23d3ca,_0x5b8b0['options']);var _0x336b07={'where':_0x23d3ca[_0x423b('0x3f')]};return db['Campaign'][_0x423b('0x21')](_0x336b07)[_0x423b('0x27')](function(_0x1179ec){_0x3dc41c[_0x423b('0x21')]=_0x1179ec;if(_0x5b8b0['query']['includeAll']){_0x23d3ca[_0x423b('0x44')]=[{'all':!![]}];}return db[_0x423b('0x31')]['findAll'](_0x23d3ca);})[_0x423b('0x27')](function(_0x4346cd){_0x3dc41c[_0x423b('0x45')]=_0x4346cd;return _0x3dc41c;})[_0x423b('0x27')](respondWithFilteredResult(_0x3a8fbd,_0x23d3ca))['catch'](handleError(_0x3a8fbd,null));};exports[_0x423b('0x46')]=function(_0xe1955f,_0x271f40){var _0x3ea839={'raw':![],'where':{'id':_0xe1955f[_0x423b('0x47')]['id']}},_0x47bdcd={};_0x47bdcd[_0x423b('0x35')]=_[_0x423b('0x37')](db[_0x423b('0x31')][_0x423b('0x32')]);_0x47bdcd['query']=_[_0x423b('0x37')](_0xe1955f['query']);_0x47bdcd[_0x423b('0x40')]=_[_0x423b('0x38')](_0x47bdcd[_0x423b('0x35')],_0x47bdcd['query']);_0x3ea839['attributes']=_[_0x423b('0x38')](_0x47bdcd['model'],qs[_0x423b('0x39')](_0xe1955f['query'][_0x423b('0x39')]));_0x3ea839[_0x423b('0x3a')]=_0x3ea839[_0x423b('0x3a')][_0x423b('0x48')]?_0x3ea839[_0x423b('0x3a')]:_0x47bdcd['model'];if(_0xe1955f[_0x423b('0x36')]['includeAll']){_0x3ea839[_0x423b('0x44')]=[{'all':!![]}];}_0x3ea839=_[_0x423b('0x49')]({},_0x3ea839,_0xe1955f[_0x423b('0x4a')]);return db[_0x423b('0x31')][_0x423b('0x4b')](_0x3ea839)['then'](handleEntityNotFound(_0x271f40,null))[_0x423b('0x27')](respondWithResult(_0x271f40,null))[_0x423b('0x4c')](handleError(_0x271f40,null));};exports['create']=function(_0x474206,_0xfb65b8){return db[_0x423b('0x31')][_0x423b('0x4d')](_0x474206[_0x423b('0x4e')],{})[_0x423b('0x27')](function(_0x5e7610){var _0x59cdec=_0x474206[_0x423b('0x4f')]['get']({'plain':!![]});if(!_0x59cdec)throw new Error(_0x423b('0x50'));if(_0x59cdec['role']==='user'){var _0x186435=_0x5e7610[_0x423b('0x29')]({'plain':!![]});var _0x5b0985=_0x423b('0x2a');return db[_0x423b('0x51')][_0x423b('0x4b')]({'where':{'name':_0x5b0985,'userProfileId':_0x59cdec[_0x423b('0x52')]},'raw':!![]})['then'](function(_0x21e564){if(_0x21e564&&_0x21e564['autoAssociation']===0x0){return db['UserProfileResource'][_0x423b('0x4d')]({'name':_0x186435[_0x423b('0x2d')],'resourceId':_0x186435['id'],'type':_0x21e564[_0x423b('0x2d')],'sectionId':_0x21e564['id']},{})[_0x423b('0x27')](function(){return _0x5e7610;});}else{return _0x5e7610;}})[_0x423b('0x4c')](function(_0x5c534f){logger[_0x423b('0x2b')](_0x423b('0x53'),_0x5c534f);throw _0x5c534f;});}return _0x5e7610;})['then'](respondWithResult(_0xfb65b8,0xc9))[_0x423b('0x4c')](handleError(_0xfb65b8,null));};exports[_0x423b('0x54')]=function(_0x316ab7,_0xe341da){var _0xa060e8={'where':{'id':_0x316ab7[_0x423b('0x47')]['id']}},_0x3238c6={};_0x3238c6[_0x423b('0x35')]=_['keys'](db[_0x423b('0x31')]['rawAttributes']);_0xa060e8['attributes']=_[_0x423b('0x38')](_0x3238c6[_0x423b('0x35')],qs[_0x423b('0x39')](_0x316ab7[_0x423b('0x36')][_0x423b('0x39')]));_0xa060e8[_0x423b('0x3a')]=_0xa060e8[_0x423b('0x3a')]['length']?_0xa060e8[_0x423b('0x3a')]:_0x3238c6[_0x423b('0x35')];if(_0x316ab7['query'][_0x423b('0x55')]){_0xa060e8['include']=[{'all':!![]}];}_0xa060e8=_[_0x423b('0x49')]({},_0xa060e8,_0x316ab7[_0x423b('0x4a')]);return db[_0x423b('0x31')][_0x423b('0x4b')](_0xa060e8)['then'](handleEntityNotFound(_0xe341da,null))[_0x423b('0x27')](function(_0x16fa8b){if(_0x16fa8b){var _0x3ab243=_0x16fa8b[_0x423b('0x29')]({'plain':!![]});_0x3ab243=qs[_0x423b('0x56')](_0x3ab243,['id','createdAt',_0x423b('0x57')]);_0x316ab7[_0x423b('0x4e')]=_[_0x423b('0x56')](_0x316ab7[_0x423b('0x4e')],['id',_0x423b('0x58'),_0x423b('0x57')]);return db['Campaign'][_0x423b('0x4d')](_[_0x423b('0x49')](_0x3ab243,_0x316ab7[_0x423b('0x4e')]),{'include':_0x316ab7[_0x423b('0x36')]['includeAll']?[{'all':!![]}]:undefined})[_0x423b('0x27')](function(_0xfba006){var _0x4db0f3=_0x316ab7[_0x423b('0x4f')][_0x423b('0x29')]({'plain':!![]});if(!_0x4db0f3)throw new Error(_0x423b('0x50'));if(_0x4db0f3[_0x423b('0x59')]===_0x423b('0x4f')){var _0x47da38=_0xfba006[_0x423b('0x29')]({'plain':!![]});var _0xa8c163=_0x423b('0x2a');return db[_0x423b('0x51')]['find']({'where':{'name':_0xa8c163,'userProfileId':_0x4db0f3[_0x423b('0x52')]},'raw':!![]})[_0x423b('0x27')](function(_0x3f7641){if(_0x3f7641&&_0x3f7641[_0x423b('0x5a')]===0x0){return db['UserProfileResource'][_0x423b('0x4d')]({'name':_0x47da38['name'],'resourceId':_0x47da38['id'],'type':_0x3f7641['name'],'sectionId':_0x3f7641['id']},{})[_0x423b('0x27')](function(){return _0xfba006;});}else{return _0xfba006;}})['catch'](function(_0xfcf2d7){logger['error'](_0x423b('0x53'),_0xfcf2d7);throw _0xfcf2d7;});}return _0xfba006;});}})['then'](respondWithResult(_0xe341da,0xc9))[_0x423b('0x4c')](handleError(_0xe341da,null));};exports[_0x423b('0x26')]=function(_0xbbd109,_0x5170d7){if(_0xbbd109[_0x423b('0x4e')]['id']){delete _0xbbd109[_0x423b('0x4e')]['id'];}return db[_0x423b('0x31')]['find']({'where':{'id':_0xbbd109[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x5170d7,null))[_0x423b('0x27')](saveUpdates(_0xbbd109[_0x423b('0x4e')],null))[_0x423b('0x27')](respondWithResult(_0x5170d7,null))[_0x423b('0x4c')](handleError(_0x5170d7,null));};exports[_0x423b('0x28')]=function(_0x15349d,_0x3f3fb6){return db[_0x423b('0x31')][_0x423b('0x4b')]({'where':{'id':_0x15349d['params']['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x3f3fb6,null))[_0x423b('0x27')](removeEntity(_0x3f3fb6,null))[_0x423b('0x4c')](handleError(_0x3f3fb6,null));};exports[_0x423b('0x5b')]=function(_0x1f57b9,_0x1863c6,_0x1cbb6d){var _0x1c2284={'raw':!![],'where':{}};var _0x5d3b76={};var _0x13b908={'count':0x0,'rows':[]};return db[_0x423b('0x31')]['findOne']({'where':{'id':_0x1f57b9[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x1863c6,null))['then'](function(_0x120f55){if(_0x120f55){_0x5d3b76[_0x423b('0x35')]=_[_0x423b('0x37')](db[_0x423b('0x5c')][_0x423b('0x32')]);_0x5d3b76[_0x423b('0x36')]=_[_0x423b('0x37')](_0x1f57b9[_0x423b('0x36')]);_0x5d3b76[_0x423b('0x40')]=_[_0x423b('0x38')](_0x5d3b76[_0x423b('0x35')],_0x5d3b76['query']);_0x1c2284['attributes']=_['intersection'](_0x5d3b76[_0x423b('0x35')],qs[_0x423b('0x39')](_0x1f57b9['query'][_0x423b('0x39')]));_0x1c2284[_0x423b('0x3a')]=_0x1c2284[_0x423b('0x3a')][_0x423b('0x48')]?_0x1c2284[_0x423b('0x3a')]:_0x5d3b76['model'];if(!_0x1f57b9[_0x423b('0x36')][_0x423b('0x3b')](_0x423b('0x3c'))){_0x1c2284[_0x423b('0x20')]=qs[_0x423b('0x20')](_0x1f57b9[_0x423b('0x36')]['limit']);_0x1c2284['offset']=qs[_0x423b('0x1e')](_0x1f57b9[_0x423b('0x36')][_0x423b('0x1e')]);}_0x1c2284[_0x423b('0x3d')]=qs['sort'](_0x1f57b9[_0x423b('0x36')][_0x423b('0x3e')]);_0x1c2284['where']=qs[_0x423b('0x40')](_['pick'](_0x1f57b9['query'],_0x5d3b76['filters']));_0x1c2284['where']['CampaignId']=_0x120f55['id'];if(_0x1f57b9[_0x423b('0x36')][_0x423b('0x42')]){_0x1c2284['where']=_[_0x423b('0x49')](_0x1c2284[_0x423b('0x3f')],{'$or':_[_0x423b('0x30')](_0x1c2284[_0x423b('0x3a')],function(_0x300416){var _0x2b7697={};_0x2b7697[_0x300416]={'$like':'%'+_0x1f57b9[_0x423b('0x36')][_0x423b('0x42')]+'%'};return _0x2b7697;})});}_0x1c2284=_['merge']({},_0x1c2284,_0x1f57b9[_0x423b('0x4a')]);return db['CmHopper'][_0x423b('0x21')]({'where':_0x1c2284[_0x423b('0x3f')]})[_0x423b('0x27')](function(_0x1233cd){_0x13b908[_0x423b('0x21')]=_0x1233cd;if(_0x1f57b9[_0x423b('0x36')][_0x423b('0x55')]){_0x1c2284[_0x423b('0x44')]=[{'all':!![]}];}return db[_0x423b('0x5c')][_0x423b('0x5d')](_0x1c2284);})[_0x423b('0x27')](function(_0x7726d3){_0x13b908[_0x423b('0x45')]=_0x7726d3;return _0x13b908;});}})[_0x423b('0x27')](respondWithFilteredResult(_0x1863c6,_0x1c2284))[_0x423b('0x4c')](handleError(_0x1863c6,null));};exports[_0x423b('0x5e')]=function(_0x3efad9,_0x506224,_0x5e2efb){var _0x512c6c={'raw':!![],'where':{}};var _0x118b89={};var _0x512526={'count':0x0,'rows':[]};return db[_0x423b('0x31')][_0x423b('0x5f')]({'where':{'id':_0x3efad9[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x506224,null))[_0x423b('0x27')](function(_0x128099){if(_0x128099){_0x118b89[_0x423b('0x35')]=_[_0x423b('0x37')](db[_0x423b('0x60')]['rawAttributes']);_0x118b89[_0x423b('0x36')]=_[_0x423b('0x37')](_0x3efad9['query']);_0x118b89[_0x423b('0x40')]=_['intersection'](_0x118b89[_0x423b('0x35')],_0x118b89[_0x423b('0x36')]);_0x512c6c[_0x423b('0x3a')]=_['intersection'](_0x118b89[_0x423b('0x35')],qs['fields'](_0x3efad9[_0x423b('0x36')][_0x423b('0x39')]));_0x512c6c['attributes']=_0x512c6c[_0x423b('0x3a')]['length']?_0x512c6c[_0x423b('0x3a')]:_0x118b89[_0x423b('0x35')];if(!_0x3efad9[_0x423b('0x36')]['hasOwnProperty']('nolimit')){_0x512c6c[_0x423b('0x20')]=qs[_0x423b('0x20')](_0x3efad9['query'][_0x423b('0x20')]);_0x512c6c['offset']=qs['offset'](_0x3efad9[_0x423b('0x36')][_0x423b('0x1e')]);}_0x512c6c[_0x423b('0x3d')]=qs[_0x423b('0x3e')](_0x3efad9[_0x423b('0x36')][_0x423b('0x3e')]);_0x512c6c[_0x423b('0x3f')]=qs[_0x423b('0x40')](_[_0x423b('0x41')](_0x3efad9[_0x423b('0x36')],_0x118b89[_0x423b('0x40')]));_0x512c6c[_0x423b('0x3f')][_0x423b('0x61')]=_0x128099['id'];if(_0x3efad9['query'][_0x423b('0x42')]){_0x512c6c[_0x423b('0x3f')]=_['merge'](_0x512c6c['where'],{'$or':_[_0x423b('0x30')](_0x512c6c[_0x423b('0x3a')],function(_0x1c88a6){var _0xb343f7={};_0xb343f7[_0x1c88a6]={'$like':'%'+_0x3efad9[_0x423b('0x36')][_0x423b('0x42')]+'%'};return _0xb343f7;})});}_0x512c6c=_[_0x423b('0x49')]({},_0x512c6c,_0x3efad9[_0x423b('0x4a')]);return db[_0x423b('0x60')][_0x423b('0x21')]({'where':_0x512c6c[_0x423b('0x3f')]})[_0x423b('0x27')](function(_0x22855e){_0x512526[_0x423b('0x21')]=_0x22855e;if(_0x3efad9[_0x423b('0x36')][_0x423b('0x55')]){_0x512c6c[_0x423b('0x44')]=[{'all':!![]}];}return db[_0x423b('0x60')][_0x423b('0x5d')](_0x512c6c);})[_0x423b('0x27')](function(_0x273eb7){_0x512526['rows']=_0x273eb7;return _0x512526;});}})[_0x423b('0x27')](respondWithFilteredResult(_0x506224,_0x512c6c))[_0x423b('0x4c')](handleError(_0x506224,null));};exports[_0x423b('0x62')]=function(_0x4238e4,_0x55b16a,_0x4204c6){var _0x41671b={'raw':!![],'where':{}};var _0x17686e={};var _0x55a9aa={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4238e4[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x55b16a,null))['then'](function(_0xf906b8){if(_0xf906b8){_0x17686e['model']=_['keys'](db['CmHopperFinal'][_0x423b('0x32')]);_0x17686e['query']=_[_0x423b('0x37')](_0x4238e4[_0x423b('0x36')]);_0x17686e[_0x423b('0x40')]=_[_0x423b('0x38')](_0x17686e['model'],_0x17686e[_0x423b('0x36')]);_0x41671b[_0x423b('0x3a')]=_[_0x423b('0x38')](_0x17686e['model'],qs[_0x423b('0x39')](_0x4238e4['query'][_0x423b('0x39')]));_0x41671b[_0x423b('0x3a')]=_0x41671b[_0x423b('0x3a')][_0x423b('0x48')]?_0x41671b['attributes']:_0x17686e['model'];if(!_0x4238e4[_0x423b('0x36')][_0x423b('0x3b')](_0x423b('0x3c'))){_0x41671b[_0x423b('0x20')]=qs[_0x423b('0x20')](_0x4238e4[_0x423b('0x36')][_0x423b('0x20')]);_0x41671b['offset']=qs[_0x423b('0x1e')](_0x4238e4['query'][_0x423b('0x1e')]);}_0x41671b[_0x423b('0x3d')]=qs[_0x423b('0x3e')](_0x4238e4['query'][_0x423b('0x3e')]);_0x41671b[_0x423b('0x3f')]=qs['filters'](_[_0x423b('0x41')](_0x4238e4['query'],_0x17686e[_0x423b('0x40')]));_0x41671b[_0x423b('0x3f')][_0x423b('0x61')]=_0xf906b8['id'];if(_0x4238e4[_0x423b('0x36')][_0x423b('0x42')]){_0x41671b['where']=_[_0x423b('0x49')](_0x41671b[_0x423b('0x3f')],{'$or':_[_0x423b('0x30')](_0x41671b[_0x423b('0x3a')],function(_0x25c3c1){var _0x167f50={};_0x167f50[_0x25c3c1]={'$like':'%'+_0x4238e4[_0x423b('0x36')][_0x423b('0x42')]+'%'};return _0x167f50;})});}_0x41671b=_[_0x423b('0x49')]({},_0x41671b,_0x4238e4[_0x423b('0x4a')]);return db['CmHopperFinal']['count']({'where':_0x41671b[_0x423b('0x3f')]})[_0x423b('0x27')](function(_0x508692){_0x55a9aa[_0x423b('0x21')]=_0x508692;if(_0x4238e4[_0x423b('0x36')][_0x423b('0x55')]){_0x41671b['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x423b('0x5d')](_0x41671b);})[_0x423b('0x27')](function(_0x3934d5){_0x55a9aa['rows']=_0x3934d5;return _0x55a9aa;});}})[_0x423b('0x27')](respondWithFilteredResult(_0x55b16a,_0x41671b))['catch'](handleError(_0x55b16a,null));};exports['getHopperBlacks']=function(_0x2591e8,_0x587514,_0x5b6301){var _0x55485d={'raw':!![],'where':{}};var _0x3224ea={};var _0x1fd284={'count':0x0,'rows':[]};return db[_0x423b('0x31')][_0x423b('0x5f')]({'where':{'id':_0x2591e8[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x587514,null))[_0x423b('0x27')](function(_0x24b74b){if(_0x24b74b){_0x3224ea[_0x423b('0x35')]=_[_0x423b('0x37')](db[_0x423b('0x63')][_0x423b('0x32')]);_0x3224ea[_0x423b('0x36')]=_[_0x423b('0x37')](_0x2591e8[_0x423b('0x36')]);_0x3224ea[_0x423b('0x40')]=_[_0x423b('0x38')](_0x3224ea['model'],_0x3224ea['query']);_0x55485d[_0x423b('0x3a')]=_[_0x423b('0x38')](_0x3224ea[_0x423b('0x35')],qs[_0x423b('0x39')](_0x2591e8[_0x423b('0x36')]['fields']));_0x55485d[_0x423b('0x3a')]=_0x55485d[_0x423b('0x3a')][_0x423b('0x48')]?_0x55485d[_0x423b('0x3a')]:_0x3224ea[_0x423b('0x35')];if(!_0x2591e8[_0x423b('0x36')][_0x423b('0x3b')](_0x423b('0x3c'))){_0x55485d[_0x423b('0x20')]=qs[_0x423b('0x20')](_0x2591e8['query'][_0x423b('0x20')]);_0x55485d[_0x423b('0x1e')]=qs[_0x423b('0x1e')](_0x2591e8[_0x423b('0x36')][_0x423b('0x1e')]);}_0x55485d[_0x423b('0x3d')]=qs[_0x423b('0x3e')](_0x2591e8[_0x423b('0x36')][_0x423b('0x3e')]);_0x55485d[_0x423b('0x3f')]=qs[_0x423b('0x40')](_[_0x423b('0x41')](_0x2591e8[_0x423b('0x36')],_0x3224ea[_0x423b('0x40')]));_0x55485d['where'][_0x423b('0x61')]=_0x24b74b['id'];if(_0x2591e8[_0x423b('0x36')][_0x423b('0x42')]){_0x55485d[_0x423b('0x3f')]=_[_0x423b('0x49')](_0x55485d['where'],{'$or':_['map'](_0x55485d['attributes'],function(_0x5a9592){var _0x2ed846={};_0x2ed846[_0x5a9592]={'$like':'%'+_0x2591e8[_0x423b('0x36')][_0x423b('0x42')]+'%'};return _0x2ed846;})});}_0x55485d=_[_0x423b('0x49')]({},_0x55485d,_0x2591e8[_0x423b('0x4a')]);return db[_0x423b('0x63')]['count']({'where':_0x55485d['where']})[_0x423b('0x27')](function(_0x1617c8){_0x1fd284[_0x423b('0x21')]=_0x1617c8;if(_0x2591e8[_0x423b('0x36')]['includeAll']){_0x55485d[_0x423b('0x44')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x423b('0x5d')](_0x55485d);})['then'](function(_0x27cc07){_0x1fd284[_0x423b('0x45')]=_0x27cc07;return _0x1fd284;});}})[_0x423b('0x27')](respondWithFilteredResult(_0x587514,_0x55485d))[_0x423b('0x4c')](handleError(_0x587514,null));};exports['getLists']=function(_0x506581,_0x6876e,_0x511896){var _0x26e25d={};var _0x4ba477={};var _0x2a9845;var _0x12ae73;return db[_0x423b('0x31')]['findOne']({'where':{'id':_0x506581[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x6876e,null))[_0x423b('0x27')](function(_0x4bf9da){if(_0x4bf9da){_0x2a9845=_0x4bf9da;_0x4ba477[_0x423b('0x35')]=_[_0x423b('0x37')](db['CmList']['rawAttributes']);_0x4ba477['query']=_[_0x423b('0x37')](_0x506581[_0x423b('0x36')]);_0x4ba477['filters']=_['intersection'](_0x4ba477[_0x423b('0x35')],_0x4ba477[_0x423b('0x36')]);_0x26e25d[_0x423b('0x3a')]=_[_0x423b('0x38')](_0x4ba477[_0x423b('0x35')],qs['fields'](_0x506581[_0x423b('0x36')][_0x423b('0x39')]));_0x26e25d['attributes']=_0x26e25d['attributes'][_0x423b('0x48')]?_0x26e25d['attributes']:_0x4ba477[_0x423b('0x35')];_0x26e25d[_0x423b('0x3d')]=qs['sort'](_0x506581[_0x423b('0x36')]['sort']);_0x26e25d[_0x423b('0x3f')]=qs[_0x423b('0x40')](_[_0x423b('0x41')](_0x506581[_0x423b('0x36')],_0x4ba477[_0x423b('0x40')]));if(_0x506581[_0x423b('0x36')][_0x423b('0x42')]){_0x26e25d[_0x423b('0x3f')]=_[_0x423b('0x49')](_0x26e25d['where'],{'$or':_['map'](_0x26e25d[_0x423b('0x3a')],function(_0x2b58d7){var _0x3bb518={};_0x3bb518[_0x2b58d7]={'$like':'%'+_0x506581[_0x423b('0x36')][_0x423b('0x42')]+'%'};return _0x3bb518;})});}_0x26e25d=_['merge']({},_0x26e25d,_0x506581[_0x423b('0x4a')]);return _0x2a9845['getLists'](_0x26e25d);}})[_0x423b('0x27')](function(_0x269f85){if(_0x269f85){_0x12ae73=_0x269f85[_0x423b('0x48')];if(!_0x506581[_0x423b('0x36')][_0x423b('0x3b')](_0x423b('0x3c'))){_0x26e25d[_0x423b('0x20')]=qs[_0x423b('0x20')](_0x506581[_0x423b('0x36')]['limit']);_0x26e25d[_0x423b('0x1e')]=qs[_0x423b('0x1e')](_0x506581[_0x423b('0x36')]['offset']);}return _0x2a9845[_0x423b('0x64')](_0x26e25d);}})['then'](function(_0x4a2550){if(_0x4a2550){return _0x4a2550?{'count':_0x12ae73,'rows':_0x4a2550}:null;}})['then'](respondWithResult(_0x6876e,null))['catch'](handleError(_0x6876e,null));};exports[_0x423b('0x65')]=function(_0x2c92d9,_0x31a50e,_0x78fae9){var _0x3ade8c,_0x44ffec;return db[_0x423b('0x31')][_0x423b('0x4b')]({'where':{'id':_0x2c92d9[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x31a50e,null))[_0x423b('0x27')](function(_0x2b33b7){if(_0x2b33b7){_0x44ffec=_0x2b33b7;return _0x2b33b7[_0x423b('0x65')](_0x2c92d9['body'][_0x423b('0x66')],_[_0x423b('0x56')](_0x2c92d9[_0x423b('0x4e')],[_0x423b('0x66'),'id'])||{});}return null;})[_0x423b('0x67')](function(_0x5c74ae){var _0x4c7963;_0x3ade8c=_0x5c74ae||[];var _0x48ee22=[];if(_0x5c74ae){for(var _0x2f5c28=0x0;_0x2f5c28<_0x5c74ae['length'];_0x2f5c28+=0x1){var _0x157c05=_0x5c74ae[_0x2f5c28][_0x423b('0x29')]({'plain':!![]});_0x44ffec['dialCheckDuplicateType']=_0x2c92d9[_0x423b('0x4e')][_0x423b('0x68')]?_0x2c92d9[_0x423b('0x4e')][_0x423b('0x68')]:_0x44ffec[_0x423b('0x68')];switch(_0x44ffec[_0x423b('0x68')]){case _0x423b('0x69'):_0x4c7963=squel['insert']()[_0x423b('0x6a')](_0x423b('0x6b'))[_0x423b('0x6c')]([_0x423b('0x6d'),_0x423b('0x6e'),_0x423b('0x6f'),_0x423b('0x70'),_0x423b('0x61'),'createdAt',_0x423b('0x57')],squel[_0x423b('0x71')]()[_0x423b('0x72')](_0x423b('0x6d'),_0x423b('0x6d'))[_0x423b('0x72')](_0x423b('0x73'),_0x423b('0x6e'))[_0x423b('0x72')]('id',_0x423b('0x6f'))[_0x423b('0x72')](_0x157c05[_0x423b('0x74')][_0x423b('0x75')](),'ListId')[_0x423b('0x72')](_0x2c92d9['params']['id'][_0x423b('0x75')](),_0x423b('0x61'))[_0x423b('0x72')](_0x423b('0x73'),_0x423b('0x58'))['field'](_0x423b('0x73'),_0x423b('0x57'))[_0x423b('0x76')]('cm_contacts')[_0x423b('0x3f')]('deletedAt\x20IS\x20NULL')[_0x423b('0x3f')](_0x423b('0x77'),_0x157c05['CmListId'][_0x423b('0x75')]())[_0x423b('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x423b('0x78'),squel[_0x423b('0x71')]()[_0x423b('0x72')](_0x423b('0x79'))[_0x423b('0x76')]('cm_hopper_final')[_0x423b('0x3f')](_0x423b('0x7a'),_0x2c92d9['params']['id'][_0x423b('0x75')]()))['where'](_0x423b('0x78'),squel[_0x423b('0x71')]()['field']('COALESCE(phone,\x27\x27)')[_0x423b('0x76')]('cm_hopper')[_0x423b('0x3f')](_0x423b('0x7a'),_0x2c92d9[_0x423b('0x47')]['id']['toString']())))[_0x423b('0x75')]();break;case'onlyIfOpen':_0x4c7963=squel['insert']()[_0x423b('0x6a')](_0x423b('0x6b'))[_0x423b('0x6c')](['phone',_0x423b('0x6e'),_0x423b('0x6f'),'ListId',_0x423b('0x61'),_0x423b('0x58'),_0x423b('0x57')],squel[_0x423b('0x71')]()[_0x423b('0x72')](_0x423b('0x6d'),'phone')['field'](_0x423b('0x73'),'scheduledAt')['field']('id','ContactId')[_0x423b('0x72')](_0x157c05[_0x423b('0x74')][_0x423b('0x75')](),_0x423b('0x70'))[_0x423b('0x72')](_0x2c92d9[_0x423b('0x47')]['id'][_0x423b('0x75')](),_0x423b('0x61'))[_0x423b('0x72')](_0x423b('0x73'),_0x423b('0x58'))[_0x423b('0x72')]('NOW()',_0x423b('0x57'))[_0x423b('0x76')](_0x423b('0x7b'))[_0x423b('0x3f')](_0x423b('0x7c'))[_0x423b('0x3f')]('ListId\x20=\x20?',_0x157c05[_0x423b('0x74')][_0x423b('0x75')]())[_0x423b('0x3f')](_0x423b('0x7d'))[_0x423b('0x3f')](_0x423b('0x78'),squel[_0x423b('0x71')]()[_0x423b('0x72')](_0x423b('0x7e'))[_0x423b('0x76')](_0x423b('0x6b'))[_0x423b('0x3f')](_0x423b('0x7a'),_0x2c92d9[_0x423b('0x47')]['id'][_0x423b('0x75')]())))['toString']();break;default:_0x4c7963=squel[_0x423b('0x7f')]()[_0x423b('0x6a')]('cm_hopper')[_0x423b('0x6c')](['phone','scheduledAt',_0x423b('0x6f'),_0x423b('0x70'),_0x423b('0x61'),'createdAt',_0x423b('0x57')],squel[_0x423b('0x71')]()[_0x423b('0x72')]('phone',_0x423b('0x6d'))[_0x423b('0x72')](_0x423b('0x73'),_0x423b('0x6e'))[_0x423b('0x72')]('id',_0x423b('0x6f'))[_0x423b('0x72')](_0x157c05[_0x423b('0x74')][_0x423b('0x75')](),_0x423b('0x70'))[_0x423b('0x72')](_0x2c92d9[_0x423b('0x47')]['id'][_0x423b('0x75')](),'CampaignId')[_0x423b('0x72')]('NOW()',_0x423b('0x58'))[_0x423b('0x72')]('NOW()',_0x423b('0x57'))[_0x423b('0x76')](_0x423b('0x7b'))['where'](_0x423b('0x7c'))[_0x423b('0x3f')](_0x423b('0x77'),_0x157c05[_0x423b('0x74')][_0x423b('0x75')]())['where'](_0x423b('0x7d')))[_0x423b('0x75')]();}_0x48ee22[_0x423b('0x80')](db[_0x423b('0x81')][_0x423b('0x36')](_0x4c7963));}return BPromise[_0x423b('0x82')](_0x48ee22);}})[_0x423b('0x27')](function(){return _0x3ade8c;})[_0x423b('0x27')](respondWithResult(_0x31a50e,null))[_0x423b('0x4c')](handleError(_0x31a50e,null));};exports[_0x423b('0x83')]=function(_0x5afd01,_0x21d065,_0xfb1e29){return db[_0x423b('0x31')][_0x423b('0x4b')]({'where':{'id':_0x5afd01[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x21d065,null))['then'](function(_0x4e7222){if(_0x4e7222){return _0x4e7222['removeLists'](_0x5afd01[_0x423b('0x36')][_0x423b('0x66')]);}})[_0x423b('0x27')](function(_0x196804){if(_0x196804){return db[_0x423b('0x5c')][_0x423b('0x28')]({'where':{'ListId':_0x5afd01[_0x423b('0x36')][_0x423b('0x66')],'CampaignId':_0x5afd01[_0x423b('0x47')]['id']}})[_0x423b('0x27')](function(){return _0x196804;});}})[_0x423b('0x27')](respondWithStatusCode(_0x21d065,null))[_0x423b('0x4c')](handleError(_0x21d065,null));};exports[_0x423b('0x84')]=function(_0x2aa4f3,_0x268024,_0x17a900){var _0x57800a={};var _0x719649={};var _0x37a2ad;var _0x145a8c;return db[_0x423b('0x31')]['findOne']({'where':{'id':_0x2aa4f3[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x268024,null))[_0x423b('0x27')](function(_0x34b08b){if(_0x34b08b){_0x37a2ad=_0x34b08b;_0x719649[_0x423b('0x35')]=_[_0x423b('0x37')](db['CmList'][_0x423b('0x32')]);_0x719649['query']=_[_0x423b('0x37')](_0x2aa4f3[_0x423b('0x36')]);_0x719649[_0x423b('0x40')]=_[_0x423b('0x38')](_0x719649[_0x423b('0x35')],_0x719649[_0x423b('0x36')]);_0x57800a['attributes']=_[_0x423b('0x38')](_0x719649[_0x423b('0x35')],qs[_0x423b('0x39')](_0x2aa4f3[_0x423b('0x36')][_0x423b('0x39')]));_0x57800a[_0x423b('0x3a')]=_0x57800a[_0x423b('0x3a')][_0x423b('0x48')]?_0x57800a[_0x423b('0x3a')]:_0x719649['model'];_0x57800a[_0x423b('0x3d')]=qs['sort'](_0x2aa4f3[_0x423b('0x36')][_0x423b('0x3e')]);_0x57800a[_0x423b('0x3f')]=qs[_0x423b('0x40')](_['pick'](_0x2aa4f3[_0x423b('0x36')],_0x719649[_0x423b('0x40')]));if(_0x2aa4f3['query'][_0x423b('0x42')]){_0x57800a[_0x423b('0x3f')]=_['merge'](_0x57800a[_0x423b('0x3f')],{'$or':_[_0x423b('0x30')](_0x57800a[_0x423b('0x3a')],function(_0x4d8fe9){var _0x2700af={};_0x2700af[_0x4d8fe9]={'$like':'%'+_0x2aa4f3['query'][_0x423b('0x42')]+'%'};return _0x2700af;})});}_0x57800a=_['merge']({},_0x57800a,_0x2aa4f3[_0x423b('0x4a')]);return _0x37a2ad['getBlackLists'](_0x57800a);}})[_0x423b('0x27')](function(_0x56062d){if(_0x56062d){_0x145a8c=_0x56062d[_0x423b('0x48')];if(!_0x2aa4f3['query'][_0x423b('0x3b')]('nolimit')){_0x57800a['limit']=qs[_0x423b('0x20')](_0x2aa4f3['query'][_0x423b('0x20')]);_0x57800a['offset']=qs[_0x423b('0x1e')](_0x2aa4f3['query']['offset']);}return _0x37a2ad[_0x423b('0x84')](_0x57800a);}})[_0x423b('0x27')](function(_0x1b150c){if(_0x1b150c){return _0x1b150c?{'count':_0x145a8c,'rows':_0x1b150c}:null;}})['then'](respondWithResult(_0x268024,null))[_0x423b('0x4c')](handleError(_0x268024,null));};exports['addBlackLists']=function(_0x34ac0f,_0x149d31,_0x4d362a){var _0x513634,_0xc11d77;return db[_0x423b('0x31')][_0x423b('0x4b')]({'where':{'id':_0x34ac0f['params']['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x149d31,null))['then'](function(_0x4480a8){if(_0x4480a8){_0xc11d77=_0x4480a8;return _0x4480a8[_0x423b('0x85')](_0x34ac0f[_0x423b('0x4e')][_0x423b('0x66')],_[_0x423b('0x56')](_0x34ac0f['body'],[_0x423b('0x66'),'id'])||{});}return null;})[_0x423b('0x67')](function(_0x403b9e){var _0x539ef2;_0x513634=_0x403b9e||[];var _0x1a97a8=[];if(_0x403b9e){for(var _0x4fe773=0x0;_0x4fe773<_0x403b9e[_0x423b('0x48')];_0x4fe773+=0x1){var _0x29a581=_0x403b9e[_0x4fe773][_0x423b('0x29')]({'plain':!![]});_0x539ef2=squel['insert']()['into'](_0x423b('0x86'))[_0x423b('0x6c')](['phone',_0x423b('0x6f'),_0x423b('0x70'),_0x423b('0x61'),'createdAt',_0x423b('0x57')],squel[_0x423b('0x71')]()[_0x423b('0x72')](_0x423b('0x6d'),'phone')['field']('id','ContactId')['field'](_0x29a581[_0x423b('0x74')][_0x423b('0x75')](),_0x423b('0x70'))[_0x423b('0x72')](_0x34ac0f[_0x423b('0x47')]['id']['toString'](),_0x423b('0x61'))[_0x423b('0x72')](_0x423b('0x73'),_0x423b('0x58'))[_0x423b('0x72')](_0x423b('0x73'),_0x423b('0x57'))['from'](_0x423b('0x7b'))[_0x423b('0x3f')](_0x423b('0x7c'))['where'](_0x423b('0x77'),_0x29a581[_0x423b('0x74')][_0x423b('0x75')]())[_0x423b('0x3f')](_0x423b('0x7d')))[_0x423b('0x75')]();_0x1a97a8[_0x423b('0x80')](db[_0x423b('0x81')][_0x423b('0x36')](_0x539ef2));}return BPromise[_0x423b('0x82')](_0x1a97a8);}})[_0x423b('0x27')](function(){return _0x513634;})[_0x423b('0x27')](respondWithResult(_0x149d31,null))['catch'](handleError(_0x149d31,null));};exports['removeBlackLists']=function(_0x3aabf3,_0x5e66d9,_0x495db9){return db[_0x423b('0x31')][_0x423b('0x4b')]({'where':{'id':_0x3aabf3[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x5e66d9,null))[_0x423b('0x27')](function(_0x2c13ed){if(_0x2c13ed){return _0x2c13ed['removeBlackLists'](_0x3aabf3['query']['ids']);}})[_0x423b('0x27')](function(_0x39ab2b){if(_0x39ab2b){return db[_0x423b('0x63')][_0x423b('0x28')]({'where':{'ListId':_0x3aabf3[_0x423b('0x36')][_0x423b('0x66')],'CampaignId':_0x3aabf3[_0x423b('0x47')]['id']}})[_0x423b('0x27')](function(){return _0x39ab2b;});}})[_0x423b('0x27')](respondWithStatusCode(_0x5e66d9,null))[_0x423b('0x4c')](handleError(_0x5e66d9,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 5d225d9..68e2fed 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x494ea5,_0x234211){var _0x3e6800=function(_0x32ae92){while(--_0x32ae92){_0x494ea5['push'](_0x494ea5['shift']());}};_0x3e6800(++_0x234211);}(_0x7a54,0x106));var _0x47a5=function(_0x41cc33,_0x28c426){_0x41cc33=_0x41cc33-0x0;var _0x538099=_0x7a54[_0x41cc33];return _0x538099;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 0fa8217..c7cc3bd 100644
--- a/server/api/campaign/campaign.rpc.js
+++ b/server/api/campaign/campaign.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x502a=['client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x43c7f7,_0x5777a9){var _0x778627=function(_0x365702){while(--_0x365702){_0x43c7f7['push'](_0x43c7f7['shift']());}};_0x778627(++_0x5777a9);}(_0x502a,0xd8));var _0xa502=function(_0x171ab8,_0x5c0446){_0x171ab8=_0x171ab8-0x0;var _0x3bb207=_0x502a[_0x171ab8];return _0x3bb207;};'use strict';var _=require(_0xa502('0x0'));var util=require(_0xa502('0x1'));var moment=require('moment');var BPromise=require(_0xa502('0x2'));var rs=require(_0xa502('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa502('0x4'));var logger=require('../../config/logger')(_0xa502('0x5'));var config=require(_0xa502('0x6'));var jayson=require(_0xa502('0x7'));var client=jayson[_0xa502('0x8')][_0xa502('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x489407,_0x329022,_0x29fb03){return new BPromise(function(_0x4d30f2,_0x4e4e5d){return client[_0xa502('0xa')](_0x489407,_0x29fb03)[_0xa502('0xb')](function(_0x5251fa){logger[_0xa502('0xc')](_0xa502('0xd'),_0x329022,_0xa502('0xe'));logger['debug'](_0xa502('0xf'),_0x329022,_0xa502('0xe'),JSON[_0xa502('0x10')](_0x5251fa));if(_0x5251fa['error']){if(_0x5251fa[_0xa502('0x11')][_0xa502('0x12')]===0x1f4){logger['error'](_0xa502('0xd'),_0x329022,_0x5251fa[_0xa502('0x11')]['message']);return _0x4e4e5d(_0x5251fa[_0xa502('0x11')][_0xa502('0x13')]);}logger[_0xa502('0x11')]('Campaign,\x20%s,\x20%s',_0x329022,_0x5251fa[_0xa502('0x11')][_0xa502('0x13')]);return _0x4d30f2(_0x5251fa[_0xa502('0x11')]['message']);}else{logger[_0xa502('0xc')](_0xa502('0xd'),_0x329022,_0xa502('0xe'));_0x4d30f2(_0x5251fa[_0xa502('0x14')][_0xa502('0x13')]);}})[_0xa502('0x15')](function(_0x3107a0){logger[_0xa502('0x11')](_0xa502('0xd'),_0x329022,_0x3107a0);_0x4e4e5d(_0x3107a0);});});}exports[_0xa502('0x16')]=function(_0x1445ec){var _0x315455=this;return new Promise(function(_0x1d2f3d,_0x166453){return db[_0xa502('0x17')][_0xa502('0x18')]({'raw':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1445ec['options']?_0x1445ec[_0xa502('0x19')][_0xa502('0x1a')]||null:null,'attributes':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')][_0xa502('0x1b')]||null:null,'limit':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')][_0xa502('0x1c')]||null:null,'include':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')][_0xa502('0x1d')]?_[_0xa502('0x1e')](_0x1445ec['options'][_0xa502('0x1d')],function(_0x1e6c5a){return{'model':db[_0x1e6c5a[_0xa502('0x1f')]],'as':_0x1e6c5a['as'],'attributes':_0x1e6c5a[_0xa502('0x1b')],'include':_0x1e6c5a[_0xa502('0x1d')]?_[_0xa502('0x1e')](_0x1e6c5a[_0xa502('0x1d')],function(_0x55476d){return{'model':db[_0x55476d['model']],'as':_0x55476d['as'],'attributes':_0x55476d[_0xa502('0x1b')],'include':_0x55476d['include']?_[_0xa502('0x1e')](_0x55476d[_0xa502('0x1d')],function(_0x5d04ad){return{'model':db[_0x5d04ad[_0xa502('0x1f')]],'as':_0x5d04ad['as'],'attributes':_0x5d04ad[_0xa502('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb2c9a0){logger[_0xa502('0xc')](_0xa502('0x16'),_0x1445ec);logger['debug']('GetCampaign',_0x1445ec,JSON['stringify'](_0xb2c9a0));_0x1d2f3d(_0xb2c9a0);})[_0xa502('0x15')](function(_0x34f7fa){logger['error']('GetCampaign',_0x34f7fa[_0xa502('0x13')],_0x1445ec);_0x166453(_0x315455[_0xa502('0x11')](0x1f4,_0x34f7fa['message']));});});};
\ No newline at end of file
+var _0x6c6f=['model','GetCampaign','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','findAll','options','raw','where','attributes','include','map'];(function(_0x2aa9df,_0x3a0bfa){var _0x9c98c2=function(_0xd1e1c1){while(--_0xd1e1c1){_0x2aa9df['push'](_0x2aa9df['shift']());}};_0x9c98c2(++_0x3a0bfa);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x1cbaed,_0x1ce0cf){_0x1cbaed=_0x1cbaed-0x0;var _0x4ec2de=_0x6c6f[_0x1cbaed];return _0x4ec2de;};'use strict';var _=require(_0xf6c6('0x0'));var util=require(_0xf6c6('0x1'));var moment=require(_0xf6c6('0x2'));var BPromise=require(_0xf6c6('0x3'));var rs=require(_0xf6c6('0x4'));var fs=require('fs');var Redis=require(_0xf6c6('0x5'));var db=require(_0xf6c6('0x6'))['db'];var utils=require(_0xf6c6('0x7'));var logger=require(_0xf6c6('0x8'))(_0xf6c6('0x9'));var config=require(_0xf6c6('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf6c6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c27f8,_0x34ea40,_0x5b34df){return new BPromise(function(_0x308c42,_0x296564){return client[_0xf6c6('0xc')](_0x4c27f8,_0x5b34df)[_0xf6c6('0xd')](function(_0x2d2053){logger['info'](_0xf6c6('0xe'),_0x34ea40,_0xf6c6('0xf'));logger['debug'](_0xf6c6('0x10'),_0x34ea40,_0xf6c6('0xf'),JSON[_0xf6c6('0x11')](_0x2d2053));if(_0x2d2053['error']){if(_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x13')]===0x1f4){logger[_0xf6c6('0x12')](_0xf6c6('0xe'),_0x34ea40,_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x14')]);return _0x296564(_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x14')]);}logger[_0xf6c6('0x12')](_0xf6c6('0xe'),_0x34ea40,_0x2d2053['error'][_0xf6c6('0x14')]);return _0x308c42(_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x14')]);}else{logger[_0xf6c6('0x15')]('Campaign,\x20%s,\x20%s',_0x34ea40,'request\x20sent');_0x308c42(_0x2d2053[_0xf6c6('0x16')][_0xf6c6('0x14')]);}})['catch'](function(_0x9f633c){logger[_0xf6c6('0x12')](_0xf6c6('0xe'),_0x34ea40,_0x9f633c);_0x296564(_0x9f633c);});});}exports['GetCampaign']=function(_0x8d6718){var _0x1455c5=this;return new Promise(function(_0x57a496,_0x23ed9c){return db['Campaign'][_0xf6c6('0x17')]({'raw':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718['options'][_0xf6c6('0x19')]===undefined?!![]:![]:!![],'where':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718[_0xf6c6('0x18')][_0xf6c6('0x1a')]||null:null,'attributes':_0x8d6718['options']?_0x8d6718['options'][_0xf6c6('0x1b')]||null:null,'limit':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718[_0xf6c6('0x18')]['limit']||null:null,'include':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718[_0xf6c6('0x18')][_0xf6c6('0x1c')]?_[_0xf6c6('0x1d')](_0x8d6718[_0xf6c6('0x18')][_0xf6c6('0x1c')],function(_0x43e074){return{'model':db[_0x43e074[_0xf6c6('0x1e')]],'as':_0x43e074['as'],'attributes':_0x43e074['attributes'],'include':_0x43e074[_0xf6c6('0x1c')]?_[_0xf6c6('0x1d')](_0x43e074[_0xf6c6('0x1c')],function(_0x37cc28){return{'model':db[_0x37cc28['model']],'as':_0x37cc28['as'],'attributes':_0x37cc28[_0xf6c6('0x1b')],'include':_0x37cc28[_0xf6c6('0x1c')]?_[_0xf6c6('0x1d')](_0x37cc28[_0xf6c6('0x1c')],function(_0x365f43){return{'model':db[_0x365f43[_0xf6c6('0x1e')]],'as':_0x365f43['as'],'attributes':_0x365f43[_0xf6c6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf6c6('0xd')](function(_0x3f00ae){logger[_0xf6c6('0x15')](_0xf6c6('0x1f'),_0x8d6718);logger[_0xf6c6('0x20')](_0xf6c6('0x1f'),_0x8d6718,JSON[_0xf6c6('0x11')](_0x3f00ae));_0x57a496(_0x3f00ae);})[_0xf6c6('0x21')](function(_0x4c5a20){logger[_0xf6c6('0x12')](_0xf6c6('0x1f'),_0x4c5a20[_0xf6c6('0x14')],_0x8d6718);_0x23ed9c(_0x1455c5[_0xf6c6('0x12')](0x1f4,_0x4c5a20[_0xf6c6('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 0588597..ded3bbd 100644
--- a/server/api/campaign/index.js
+++ b/server/api/campaign/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf378=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports','multer','path'];(function(_0x59575d,_0x3c389b){var _0x4a6ad4=function(_0x49fe37){while(--_0x49fe37){_0x59575d['push'](_0x59575d['shift']());}};_0x4a6ad4(++_0x3c389b);}(_0xf378,0x18a));var _0x8f37=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf378[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x8f37('0x0'));var util=require('util');var path=require(_0x8f37('0x1'));var timeout=require(_0x8f37('0x2'));var express=require(_0x8f37('0x3'));var router=express[_0x8f37('0x4')]();var fs_extra=require(_0x8f37('0x5'));var auth=require(_0x8f37('0x6'));var interaction=require(_0x8f37('0x7'));var config=require(_0x8f37('0x8'));var controller=require('./campaign.controller');router[_0x8f37('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8f37('0xa'),auth[_0x8f37('0xb')](),controller[_0x8f37('0xc')]);router[_0x8f37('0x9')](_0x8f37('0xd'),auth[_0x8f37('0xb')](),controller[_0x8f37('0xe')]);router[_0x8f37('0x9')](_0x8f37('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x8f37('0x9')](_0x8f37('0x10'),auth['isAuthenticated'](),controller[_0x8f37('0x11')]);router[_0x8f37('0x9')](_0x8f37('0x12'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x13')]);router[_0x8f37('0x9')](_0x8f37('0x14'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x15')]);router[_0x8f37('0x9')](_0x8f37('0x16'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x17')]);router['post']('/',auth[_0x8f37('0xb')](),controller[_0x8f37('0x18')]);router[_0x8f37('0x19')](_0x8f37('0x1a'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x1b')]);router['post'](_0x8f37('0x14'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x1c')]);router[_0x8f37('0x19')](_0x8f37('0x16'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x1d')]);router[_0x8f37('0x1e')](_0x8f37('0xa'),auth[_0x8f37('0xb')](),controller['update']);router[_0x8f37('0x1f')]('/:id',auth[_0x8f37('0xb')](),controller[_0x8f37('0x20')]);router[_0x8f37('0x1f')](_0x8f37('0x14'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x21')]);router['delete']('/:id/blacklists',auth[_0x8f37('0xb')](),controller[_0x8f37('0x22')]);module[_0x8f37('0x23')]=router;
\ No newline at end of file
+var _0xb00d=['../../components/auth/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','create','post','/:id/clone','clone','addBlackLists','put','/:id','destroy','delete','removeLists','/:id/blacklists','removeBlackLists','multer','util','path','connect-timeout','express','Router'];(function(_0x5c6e52,_0x5297ff){var _0x193919=function(_0x5e5a54){while(--_0x5e5a54){_0x5c6e52['push'](_0x5c6e52['shift']());}};_0x193919(++_0x5297ff);}(_0xb00d,0x19e));var _0xdb00=function(_0x423549,_0x242e63){_0x423549=_0x423549-0x0;var _0xdcb104=_0xb00d[_0x423549];return _0xdcb104;};'use strict';var multer=require(_0xdb00('0x0'));var util=require(_0xdb00('0x1'));var path=require(_0xdb00('0x2'));var timeout=require(_0xdb00('0x3'));var express=require(_0xdb00('0x4'));var router=express[_0xdb00('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdb00('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdb00('0x7'));var controller=require(_0xdb00('0x8'));router['get']('/',auth[_0xdb00('0x9')](),controller[_0xdb00('0xa')]);router[_0xdb00('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xdb00('0xc')]);router[_0xdb00('0xb')](_0xdb00('0xd'),auth[_0xdb00('0x9')](),controller[_0xdb00('0xe')]);router['get'](_0xdb00('0xf'),auth[_0xdb00('0x9')](),controller[_0xdb00('0x10')]);router[_0xdb00('0xb')]('/:id/hopper_finals',auth[_0xdb00('0x9')](),controller[_0xdb00('0x11')]);router['get'](_0xdb00('0x12'),auth['isAuthenticated'](),controller[_0xdb00('0x13')]);router[_0xdb00('0xb')](_0xdb00('0x14'),auth['isAuthenticated'](),controller[_0xdb00('0x15')]);router[_0xdb00('0xb')]('/:id/blacklists',auth[_0xdb00('0x9')](),controller[_0xdb00('0x16')]);router['post']('/',auth[_0xdb00('0x9')](),controller[_0xdb00('0x17')]);router[_0xdb00('0x18')](_0xdb00('0x19'),auth['isAuthenticated'](),controller[_0xdb00('0x1a')]);router[_0xdb00('0x18')](_0xdb00('0x14'),auth[_0xdb00('0x9')](),controller['addLists']);router[_0xdb00('0x18')]('/:id/blacklists',auth[_0xdb00('0x9')](),controller[_0xdb00('0x1b')]);router[_0xdb00('0x1c')]('/:id',auth[_0xdb00('0x9')](),controller['update']);router['delete'](_0xdb00('0x1d'),auth['isAuthenticated'](),controller[_0xdb00('0x1e')]);router[_0xdb00('0x1f')](_0xdb00('0x14'),auth[_0xdb00('0x9')](),controller[_0xdb00('0x20')]);router[_0xdb00('0x1f')](_0xdb00('0x21'),auth['isAuthenticated'](),controller[_0xdb00('0x22')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index de79f10..5af7505 100644
--- a/server/api/cannedAnswer/cannedAnswer.attributes.js
+++ b/server/api/cannedAnswer/cannedAnswer.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x278c=['exports','TEXT','STRING','getDataValue','key','sequelize'];(function(_0x372b79,_0x34ff1c){var _0x1eacc3=function(_0x206347){while(--_0x206347){_0x372b79['push'](_0x372b79['shift']());}};_0x1eacc3(++_0x34ff1c);}(_0x278c,0x18b));var _0xc278=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0x278c[_0x474d97];return _0x1edf25;};'use strict';var Sequelize=require(_0xc278('0x0'));module[_0xc278('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xc278('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc278('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc278('0x4')](_0xc278('0x5'));}}};
\ No newline at end of file
+var _0x0ea2=['getDataValue','key','exports','STRING','TEXT','VIRTUAL'];(function(_0x5f31e9,_0xf44932){var _0x165bed=function(_0xfa0e79){while(--_0xfa0e79){_0x5f31e9['push'](_0x5f31e9['shift']());}};_0x165bed(++_0xf44932);}(_0x0ea2,0x1e2));var _0x20ea=function(_0xbb7389,_0x12b29d){_0xbb7389=_0xbb7389-0x0;var _0x12537b=_0x0ea2[_0xbb7389];return _0x12537b;};'use strict';var Sequelize=require('sequelize');module[_0x20ea('0x0')]={'key':{'type':Sequelize[_0x20ea('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x20ea('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x20ea('0x1')]},'name':{'type':Sequelize[_0x20ea('0x3')],'get':function(){return this[_0x20ea('0x4')](_0x20ea('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index b9f7f51..091a42a 100644
--- a/server/api/cannedAnswer/cannedAnswer.controller.js
+++ b/server/api/cannedAnswer/cannedAnswer.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe181=['The\x20inserted\x20key\x20already\x20exists.','create','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','includeAll','include','catch','keys','length','find','params','body','MailAccountId','OpenchannelAccountId','ChatWebsiteId'];(function(_0x4e7c0c,_0x4bcbaa){var _0x15f0a9=function(_0x544d4e){while(--_0x544d4e){_0x4e7c0c['push'](_0x4e7c0c['shift']());}};_0x15f0a9(++_0x4bcbaa);}(_0xe181,0x109));var _0x1e18=function(_0xd49e15,_0x5e34ac){_0xd49e15=_0xd49e15-0x0;var _0x306b6a=_0xe181[_0xd49e15];return _0x306b6a;};'use strict';var emlformat=require(_0x1e18('0x0'));var rimraf=require(_0x1e18('0x1'));var zipdir=require(_0x1e18('0x2'));var jsonpatch=require(_0x1e18('0x3'));var rp=require('request-promise');var moment=require(_0x1e18('0x4'));var BPromise=require(_0x1e18('0x5'));var Mustache=require('mustache');var util=require(_0x1e18('0x6'));var path=require(_0x1e18('0x7'));var sox=require(_0x1e18('0x8'));var csv=require(_0x1e18('0x9'));var ejs=require(_0x1e18('0xa'));var fs=require('fs');var fs_extra=require(_0x1e18('0xb'));var _=require(_0x1e18('0xc'));var squel=require(_0x1e18('0xd'));var crypto=require(_0x1e18('0xe'));var jsforce=require(_0x1e18('0xf'));var deskjs=require(_0x1e18('0x10'));var toCsv=require(_0x1e18('0x9'));var querystring=require('querystring');var Papa=require(_0x1e18('0x11'));var Redis=require('ioredis');var authService=require(_0x1e18('0x12'));var qs=require(_0x1e18('0x13'));var as=require(_0x1e18('0x14'));var hardwareService=require(_0x1e18('0x15'));var logger=require('../../config/logger')(_0x1e18('0x16'));var utils=require(_0x1e18('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1e18('0x18'));var db=require(_0x1e18('0x19'))['db'];function respondWithStatusCode(_0x1bf1f4,_0x240beb){_0x240beb=_0x240beb||0xcc;return function(_0xae8da3){if(_0xae8da3){return _0x1bf1f4['sendStatus'](_0x240beb);}return _0x1bf1f4[_0x1e18('0x1a')](_0x240beb)[_0x1e18('0x1b')]();};}function respondWithResult(_0x355a65,_0x24881c){_0x24881c=_0x24881c||0xc8;return function(_0xf8f007){if(_0xf8f007){return _0x355a65[_0x1e18('0x1a')](_0x24881c)['json'](_0xf8f007);}};}function respondWithFilteredResult(_0x57ff6a,_0x308c6f){return function(_0x4cd8cd){if(_0x4cd8cd){var _0x76612e=typeof _0x308c6f[_0x1e18('0x1c')]===_0x1e18('0x1d')&&typeof _0x308c6f[_0x1e18('0x1e')]===_0x1e18('0x1d');var _0x53e268=_0x4cd8cd[_0x1e18('0x1f')];var _0x42ba39=_0x76612e?0x0:_0x308c6f['offset'];var _0x6512a=_0x76612e?_0x4cd8cd[_0x1e18('0x1f')]:_0x308c6f[_0x1e18('0x1c')]+_0x308c6f[_0x1e18('0x1e')];var _0x11e729;if(_0x6512a>=_0x53e268){_0x6512a=_0x53e268;_0x11e729=0xc8;}else{_0x11e729=0xce;}_0x57ff6a['status'](_0x11e729);return _0x57ff6a[_0x1e18('0x20')](_0x1e18('0x21'),_0x42ba39+'-'+_0x6512a+'/'+_0x53e268)[_0x1e18('0x22')](_0x4cd8cd);}return null;};}function patchUpdates(_0x4f7f97){return function(_0x252829){try{jsonpatch[_0x1e18('0x23')](_0x252829,_0x4f7f97,!![]);}catch(_0xd707c3){return BPromise[_0x1e18('0x24')](_0xd707c3);}return _0x252829['save']();};}function saveUpdates(_0x35c18c,_0x1ecddb){return function(_0x3b7cf0){if(_0x3b7cf0){return _0x3b7cf0[_0x1e18('0x25')](_0x35c18c)[_0x1e18('0x26')](function(_0x12a3c5){return _0x12a3c5;});}return null;};}function removeEntity(_0x4e1796,_0x28238f){return function(_0x225110){if(_0x225110){return _0x225110[_0x1e18('0x27')]()[_0x1e18('0x26')](function(){var _0x4fcba2=_0x225110[_0x1e18('0x28')]({'plain':!![]});var _0x18db1a=_0x1e18('0x29');return db['UserProfileResource'][_0x1e18('0x27')]({'where':{'type':_0x18db1a,'resourceId':_0x4fcba2['id']}})[_0x1e18('0x26')](function(){return _0x225110;});})[_0x1e18('0x26')](function(){_0x4e1796['status'](0xcc)[_0x1e18('0x1b')]();});}};}function handleEntityNotFound(_0x3fcad0,_0x51b9e9){return function(_0x193a2d){if(!_0x193a2d){_0x3fcad0[_0x1e18('0x2a')](0x194);}return _0x193a2d;};}function handleError(_0x50bd61,_0x390730){_0x390730=_0x390730||0x1f4;return function(_0x51530f){logger[_0x1e18('0x2b')](_0x51530f[_0x1e18('0x2c')]);if(_0x51530f[_0x1e18('0x2d')]){delete _0x51530f['name'];}_0x50bd61[_0x1e18('0x1a')](_0x390730)[_0x1e18('0x2e')](_0x51530f);};}exports[_0x1e18('0x2f')]=function(_0x2e8449,_0x2766da){var _0x20ccd0={},_0x845875={},_0x47c054={'count':0x0,'rows':[]};var _0x58e327=_[_0x1e18('0x30')](db['CannedAnswer'][_0x1e18('0x31')],function(_0x1647ed){return{'name':_0x1647ed[_0x1e18('0x32')],'type':_0x1647ed[_0x1e18('0x33')][_0x1e18('0x34')]};});_0x845875[_0x1e18('0x35')]=_[_0x1e18('0x30')](_0x58e327,_0x1e18('0x2d'));_0x845875[_0x1e18('0x36')]=_['keys'](_0x2e8449[_0x1e18('0x36')]);_0x845875['filters']=_[_0x1e18('0x37')](_0x845875[_0x1e18('0x35')],_0x845875['query']);_0x20ccd0[_0x1e18('0x38')]=_['intersection'](_0x845875[_0x1e18('0x35')],qs['fields'](_0x2e8449[_0x1e18('0x36')][_0x1e18('0x39')]));_0x20ccd0[_0x1e18('0x38')]=_0x20ccd0['attributes']['length']?_0x20ccd0[_0x1e18('0x38')]:_0x845875['model'];if(!_0x2e8449['query']['hasOwnProperty'](_0x1e18('0x3a'))){_0x20ccd0[_0x1e18('0x1e')]=qs[_0x1e18('0x1e')](_0x2e8449[_0x1e18('0x36')]['limit']);_0x20ccd0[_0x1e18('0x1c')]=qs['offset'](_0x2e8449[_0x1e18('0x36')][_0x1e18('0x1c')]);}_0x20ccd0[_0x1e18('0x3b')]=qs[_0x1e18('0x3c')](_0x2e8449[_0x1e18('0x36')][_0x1e18('0x3c')]);_0x20ccd0[_0x1e18('0x3d')]=qs[_0x1e18('0x3e')](_[_0x1e18('0x3f')](_0x2e8449['query'],_0x845875[_0x1e18('0x3e')]),_0x58e327);if(_0x2e8449[_0x1e18('0x36')][_0x1e18('0x40')]){_0x20ccd0[_0x1e18('0x3d')]=_[_0x1e18('0x41')](_0x20ccd0[_0x1e18('0x3d')],{'$or':[{'key':{'$like':'%'+_0x2e8449['query']['filter']+'%'}},{'value':{'$like':'%'+_0x2e8449[_0x1e18('0x36')][_0x1e18('0x40')]+'%'}}]});}_0x20ccd0=_['merge']({},_0x20ccd0,_0x2e8449[_0x1e18('0x42')]);var _0x388e01={'where':_0x20ccd0[_0x1e18('0x3d')]};return db[_0x1e18('0x43')][_0x1e18('0x1f')](_0x388e01)['then'](function(_0x250a30){_0x47c054[_0x1e18('0x1f')]=_0x250a30;if(_0x2e8449[_0x1e18('0x36')][_0x1e18('0x44')]){_0x20ccd0[_0x1e18('0x45')]=[{'all':!![]}];}return db[_0x1e18('0x43')]['findAll'](_0x20ccd0);})['then'](function(_0x4eaf90){_0x47c054['rows']=_0x4eaf90;return _0x47c054;})[_0x1e18('0x26')](respondWithFilteredResult(_0x2766da,_0x20ccd0))[_0x1e18('0x46')](handleError(_0x2766da,null));};exports['show']=function(_0x46f218,_0x4287e7){var _0x32b45d={'raw':!![],'where':{'id':_0x46f218['params']['id']}},_0x157519={};_0x157519['model']=_[_0x1e18('0x47')](db[_0x1e18('0x43')][_0x1e18('0x31')]);_0x157519[_0x1e18('0x36')]=_[_0x1e18('0x47')](_0x46f218['query']);_0x157519[_0x1e18('0x3e')]=_['intersection'](_0x157519[_0x1e18('0x35')],_0x157519[_0x1e18('0x36')]);_0x32b45d['attributes']=_['intersection'](_0x157519[_0x1e18('0x35')],qs[_0x1e18('0x39')](_0x46f218[_0x1e18('0x36')][_0x1e18('0x39')]));_0x32b45d['attributes']=_0x32b45d['attributes'][_0x1e18('0x48')]?_0x32b45d['attributes']:_0x157519['model'];if(_0x46f218[_0x1e18('0x36')][_0x1e18('0x44')]){_0x32b45d['include']=[{'all':!![]}];}_0x32b45d=_[_0x1e18('0x41')]({},_0x32b45d,_0x46f218[_0x1e18('0x42')]);return db[_0x1e18('0x43')][_0x1e18('0x49')](_0x32b45d)['then'](handleEntityNotFound(_0x4287e7,null))[_0x1e18('0x26')](respondWithResult(_0x4287e7,null))[_0x1e18('0x46')](handleError(_0x4287e7,null));};exports[_0x1e18('0x25')]=function(_0xeef8a9,_0x42d3f2){if(_0xeef8a9['body']['id']){delete _0xeef8a9['body']['id'];}return db['CannedAnswer'][_0x1e18('0x49')]({'where':{'id':_0xeef8a9[_0x1e18('0x4a')]['id']}})['then'](handleEntityNotFound(_0x42d3f2,null))[_0x1e18('0x26')](saveUpdates(_0xeef8a9[_0x1e18('0x4b')],null))[_0x1e18('0x26')](respondWithResult(_0x42d3f2,null))[_0x1e18('0x46')](handleError(_0x42d3f2,null));};exports[_0x1e18('0x27')]=function(_0x420084,_0x93f745){return db[_0x1e18('0x43')][_0x1e18('0x49')]({'where':{'id':_0x420084[_0x1e18('0x4a')]['id']}})[_0x1e18('0x26')](handleEntityNotFound(_0x93f745,null))['then'](removeEntity(_0x93f745,null))[_0x1e18('0x46')](handleError(_0x93f745,null));};exports['create']=function(_0x4428e0,_0x443f46){var _0x49a573={'key':_0x4428e0[_0x1e18('0x4b')]['key']};if(_0x4428e0[_0x1e18('0x4b')][_0x1e18('0x4c')]){_0x49a573['MailAccountId']=_0x4428e0[_0x1e18('0x4b')][_0x1e18('0x4c')];}else if(_0x4428e0[_0x1e18('0x4b')]['SmsAccountId']){_0x49a573['SmsAccountId']=_0x4428e0[_0x1e18('0x4b')]['SmsAccountId'];}else if(_0x4428e0['body'][_0x1e18('0x4d')]){_0x49a573[_0x1e18('0x4d')]=_0x4428e0[_0x1e18('0x4b')]['OpenchannelAccountId'];}else if(_0x4428e0[_0x1e18('0x4b')][_0x1e18('0x4e')]){_0x49a573['ChatWebsiteId']=_0x4428e0[_0x1e18('0x4b')][_0x1e18('0x4e')];}return db[_0x1e18('0x43')][_0x1e18('0x49')]({'where':_0x49a573})[_0x1e18('0x26')](function(_0x58bf26){if(_0x58bf26){throw new db['Sequelize']['ValidationError'](_0x1e18('0x4f'));}return db['CannedAnswer'][_0x1e18('0x50')](_0x4428e0[_0x1e18('0x4b')]);})[_0x1e18('0x26')](function(_0x2a283f){var _0x3297ac=_0x4428e0[_0x1e18('0x51')][_0x1e18('0x28')]({'plain':!![]});if(!_0x3297ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3297ac[_0x1e18('0x52')]==='user'){var _0x4952ee=_0x2a283f[_0x1e18('0x28')]({'plain':!![]});return db[_0x1e18('0x53')][_0x1e18('0x49')]({'where':{'name':_0x1e18('0x29'),'userProfileId':_0x3297ac[_0x1e18('0x54')]},'raw':!![]})[_0x1e18('0x26')](function(_0x2994b3){if(_0x2994b3&&_0x2994b3['autoAssociation']===0x0){return db['UserProfileResource'][_0x1e18('0x50')]({'name':_0x4952ee[_0x1e18('0x2d')],'resourceId':_0x4952ee['id'],'type':_0x2994b3[_0x1e18('0x2d')],'sectionId':_0x2994b3['id']},{})[_0x1e18('0x26')](function(){return _0x2a283f;});}else{return _0x2a283f;}})['catch'](function(_0x22d6f6){logger[_0x1e18('0x2b')](_0x1e18('0x55'),_0x22d6f6);throw _0x22d6f6;});}return _0x2a283f;})[_0x1e18('0x26')](respondWithResult(_0x443f46,0xc9))[_0x1e18('0x46')](handleError(_0x443f46,null));};
\ No newline at end of file
+var _0xe8f5=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','status','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','CannedAnswer','findAll','rows','catch','params','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x1d5b27,_0x58e662){var _0xd507df=function(_0x598e2d){while(--_0x598e2d){_0x1d5b27['push'](_0x1d5b27['shift']());}};_0xd507df(++_0x58e662);}(_0xe8f5,0x1a6));var _0x5e8f=function(_0xacc97a,_0x3a0645){_0xacc97a=_0xacc97a-0x0;var _0x3839ff=_0xe8f5[_0xacc97a];return _0x3839ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e8f('0x0'));var zipdir=require(_0x5e8f('0x1'));var jsonpatch=require(_0x5e8f('0x2'));var rp=require(_0x5e8f('0x3'));var moment=require(_0x5e8f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5e8f('0x5'));var util=require('util');var path=require(_0x5e8f('0x6'));var sox=require(_0x5e8f('0x7'));var csv=require(_0x5e8f('0x8'));var ejs=require(_0x5e8f('0x9'));var fs=require('fs');var fs_extra=require(_0x5e8f('0xa'));var _=require(_0x5e8f('0xb'));var squel=require(_0x5e8f('0xc'));var crypto=require('crypto');var jsforce=require(_0x5e8f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5e8f('0x8'));var querystring=require(_0x5e8f('0xe'));var Papa=require('papaparse');var Redis=require(_0x5e8f('0xf'));var authService=require(_0x5e8f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5e8f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5e8f('0x12'));var config=require(_0x5e8f('0x13'));var licenseUtil=require(_0x5e8f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b553b,_0xc3ba01){_0xc3ba01=_0xc3ba01||0xcc;return function(_0x20f7b9){if(_0x20f7b9){return _0x4b553b[_0x5e8f('0x15')](_0xc3ba01);}return _0x4b553b['status'](_0xc3ba01)[_0x5e8f('0x16')]();};}function respondWithResult(_0x3d25be,_0x1fa68c){_0x1fa68c=_0x1fa68c||0xc8;return function(_0x1020f6){if(_0x1020f6){return _0x3d25be['status'](_0x1fa68c)[_0x5e8f('0x17')](_0x1020f6);}};}function respondWithFilteredResult(_0x184826,_0x26f6f9){return function(_0xe35ada){if(_0xe35ada){var _0x2a5938=typeof _0x26f6f9[_0x5e8f('0x18')]==='undefined'&&typeof _0x26f6f9[_0x5e8f('0x19')]===_0x5e8f('0x1a');var _0x18a4ee=_0xe35ada[_0x5e8f('0x1b')];var _0x1cb31c=_0x2a5938?0x0:_0x26f6f9['offset'];var _0x26b721=_0x2a5938?_0xe35ada[_0x5e8f('0x1b')]:_0x26f6f9[_0x5e8f('0x18')]+_0x26f6f9[_0x5e8f('0x19')];var _0x383381;if(_0x26b721>=_0x18a4ee){_0x26b721=_0x18a4ee;_0x383381=0xc8;}else{_0x383381=0xce;}_0x184826['status'](_0x383381);return _0x184826['set'](_0x5e8f('0x1c'),_0x1cb31c+'-'+_0x26b721+'/'+_0x18a4ee)[_0x5e8f('0x17')](_0xe35ada);}return null;};}function patchUpdates(_0x4aa8c9){return function(_0x28a516){try{jsonpatch[_0x5e8f('0x1d')](_0x28a516,_0x4aa8c9,!![]);}catch(_0x35e564){return BPromise[_0x5e8f('0x1e')](_0x35e564);}return _0x28a516[_0x5e8f('0x1f')]();};}function saveUpdates(_0x10ef0b,_0x1d7202){return function(_0xbc1793){if(_0xbc1793){return _0xbc1793[_0x5e8f('0x20')](_0x10ef0b)[_0x5e8f('0x21')](function(_0x47f0d7){return _0x47f0d7;});}return null;};}function removeEntity(_0x17e301,_0x41ef4c){return function(_0x3c38d7){if(_0x3c38d7){return _0x3c38d7[_0x5e8f('0x22')]()[_0x5e8f('0x21')](function(){var _0x366007=_0x3c38d7[_0x5e8f('0x23')]({'plain':!![]});var _0x53570c=_0x5e8f('0x24');return db[_0x5e8f('0x25')]['destroy']({'where':{'type':_0x53570c,'resourceId':_0x366007['id']}})[_0x5e8f('0x21')](function(){return _0x3c38d7;});})['then'](function(){_0x17e301[_0x5e8f('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6f9cd5,_0x378220){return function(_0x5d67db){if(!_0x5d67db){_0x6f9cd5[_0x5e8f('0x15')](0x194);}return _0x5d67db;};}function handleError(_0x5271fd,_0x5a7f32){_0x5a7f32=_0x5a7f32||0x1f4;return function(_0x745ab2){logger[_0x5e8f('0x27')](_0x745ab2[_0x5e8f('0x28')]);if(_0x745ab2['name']){delete _0x745ab2[_0x5e8f('0x29')];}_0x5271fd[_0x5e8f('0x26')](_0x5a7f32)['send'](_0x745ab2);};}exports[_0x5e8f('0x2a')]=function(_0xd4063d,_0x414397){var _0x4d5682={},_0x30a1c2={},_0x5abe29={'count':0x0,'rows':[]};var _0x5be419=_['map'](db['CannedAnswer'][_0x5e8f('0x2b')],function(_0xc6a068){return{'name':_0xc6a068[_0x5e8f('0x2c')],'type':_0xc6a068[_0x5e8f('0x2d')][_0x5e8f('0x2e')]};});_0x30a1c2[_0x5e8f('0x2f')]=_[_0x5e8f('0x30')](_0x5be419,_0x5e8f('0x29'));_0x30a1c2[_0x5e8f('0x31')]=_[_0x5e8f('0x32')](_0xd4063d['query']);_0x30a1c2[_0x5e8f('0x33')]=_['intersection'](_0x30a1c2[_0x5e8f('0x2f')],_0x30a1c2[_0x5e8f('0x31')]);_0x4d5682[_0x5e8f('0x34')]=_[_0x5e8f('0x35')](_0x30a1c2[_0x5e8f('0x2f')],qs[_0x5e8f('0x36')](_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x36')]));_0x4d5682[_0x5e8f('0x34')]=_0x4d5682[_0x5e8f('0x34')][_0x5e8f('0x37')]?_0x4d5682[_0x5e8f('0x34')]:_0x30a1c2[_0x5e8f('0x2f')];if(!_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x38')](_0x5e8f('0x39'))){_0x4d5682[_0x5e8f('0x19')]=qs['limit'](_0xd4063d['query'][_0x5e8f('0x19')]);_0x4d5682[_0x5e8f('0x18')]=qs['offset'](_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x18')]);}_0x4d5682[_0x5e8f('0x3a')]=qs[_0x5e8f('0x3b')](_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x3b')]);_0x4d5682['where']=qs[_0x5e8f('0x33')](_[_0x5e8f('0x3c')](_0xd4063d['query'],_0x30a1c2[_0x5e8f('0x33')]),_0x5be419);if(_0xd4063d['query'][_0x5e8f('0x3d')]){_0x4d5682[_0x5e8f('0x3e')]=_[_0x5e8f('0x3f')](_0x4d5682[_0x5e8f('0x3e')],{'$or':[{'key':{'$like':'%'+_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x3d')]+'%'}},{'value':{'$like':'%'+_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x3d')]+'%'}}]});}_0x4d5682=_['merge']({},_0x4d5682,_0xd4063d['options']);var _0x7be2ed={'where':_0x4d5682[_0x5e8f('0x3e')]};return db['CannedAnswer'][_0x5e8f('0x1b')](_0x7be2ed)['then'](function(_0x3128c3){_0x5abe29[_0x5e8f('0x1b')]=_0x3128c3;if(_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x40')]){_0x4d5682[_0x5e8f('0x41')]=[{'all':!![]}];}return db[_0x5e8f('0x42')][_0x5e8f('0x43')](_0x4d5682);})[_0x5e8f('0x21')](function(_0x4b0535){_0x5abe29[_0x5e8f('0x44')]=_0x4b0535;return _0x5abe29;})[_0x5e8f('0x21')](respondWithFilteredResult(_0x414397,_0x4d5682))[_0x5e8f('0x45')](handleError(_0x414397,null));};exports['show']=function(_0x1191f4,_0x1d4a81){var _0xb698b5={'raw':!![],'where':{'id':_0x1191f4[_0x5e8f('0x46')]['id']}},_0x4be6a0={};_0x4be6a0[_0x5e8f('0x2f')]=_[_0x5e8f('0x32')](db[_0x5e8f('0x42')]['rawAttributes']);_0x4be6a0[_0x5e8f('0x31')]=_[_0x5e8f('0x32')](_0x1191f4[_0x5e8f('0x31')]);_0x4be6a0[_0x5e8f('0x33')]=_[_0x5e8f('0x35')](_0x4be6a0['model'],_0x4be6a0[_0x5e8f('0x31')]);_0xb698b5[_0x5e8f('0x34')]=_[_0x5e8f('0x35')](_0x4be6a0[_0x5e8f('0x2f')],qs[_0x5e8f('0x36')](_0x1191f4[_0x5e8f('0x31')][_0x5e8f('0x36')]));_0xb698b5['attributes']=_0xb698b5['attributes'][_0x5e8f('0x37')]?_0xb698b5[_0x5e8f('0x34')]:_0x4be6a0['model'];if(_0x1191f4[_0x5e8f('0x31')][_0x5e8f('0x40')]){_0xb698b5[_0x5e8f('0x41')]=[{'all':!![]}];}_0xb698b5=_['merge']({},_0xb698b5,_0x1191f4[_0x5e8f('0x47')]);return db['CannedAnswer'][_0x5e8f('0x48')](_0xb698b5)[_0x5e8f('0x21')](handleEntityNotFound(_0x1d4a81,null))[_0x5e8f('0x21')](respondWithResult(_0x1d4a81,null))[_0x5e8f('0x45')](handleError(_0x1d4a81,null));};exports[_0x5e8f('0x20')]=function(_0xddb137,_0x29c4e4){if(_0xddb137[_0x5e8f('0x49')]['id']){delete _0xddb137['body']['id'];}return db['CannedAnswer']['find']({'where':{'id':_0xddb137[_0x5e8f('0x46')]['id']}})[_0x5e8f('0x21')](handleEntityNotFound(_0x29c4e4,null))[_0x5e8f('0x21')](saveUpdates(_0xddb137[_0x5e8f('0x49')],null))[_0x5e8f('0x21')](respondWithResult(_0x29c4e4,null))[_0x5e8f('0x45')](handleError(_0x29c4e4,null));};exports[_0x5e8f('0x22')]=function(_0x13f7e5,_0x3d7420){return db[_0x5e8f('0x42')][_0x5e8f('0x48')]({'where':{'id':_0x13f7e5[_0x5e8f('0x46')]['id']}})[_0x5e8f('0x21')](handleEntityNotFound(_0x3d7420,null))[_0x5e8f('0x21')](removeEntity(_0x3d7420,null))[_0x5e8f('0x45')](handleError(_0x3d7420,null));};exports[_0x5e8f('0x4a')]=function(_0x5063ce,_0x28e4f3){var _0x58a19c={'key':_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x2e')]};if(_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4b')]){_0x58a19c[_0x5e8f('0x4b')]=_0x5063ce['body'][_0x5e8f('0x4b')];}else if(_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4c')]){_0x58a19c[_0x5e8f('0x4c')]=_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4c')];}else if(_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4d')]){_0x58a19c[_0x5e8f('0x4d')]=_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4d')];}else if(_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4e')]){_0x58a19c[_0x5e8f('0x4e')]=_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4e')];}return db[_0x5e8f('0x42')][_0x5e8f('0x48')]({'where':_0x58a19c})[_0x5e8f('0x21')](function(_0x5b8d78){if(_0x5b8d78){throw new db[(_0x5e8f('0x4f'))]['ValidationError'](_0x5e8f('0x50'));}return db['CannedAnswer'][_0x5e8f('0x4a')](_0x5063ce['body']);})['then'](function(_0x2e0916){var _0x30e720=_0x5063ce[_0x5e8f('0x51')][_0x5e8f('0x23')]({'plain':!![]});if(!_0x30e720)throw new Error(_0x5e8f('0x52'));if(_0x30e720[_0x5e8f('0x53')]===_0x5e8f('0x51')){var _0xb53d86=_0x2e0916[_0x5e8f('0x23')]({'plain':!![]});return db[_0x5e8f('0x54')]['find']({'where':{'name':_0x5e8f('0x24'),'userProfileId':_0x30e720[_0x5e8f('0x55')]},'raw':!![]})[_0x5e8f('0x21')](function(_0x366622){if(_0x366622&&_0x366622[_0x5e8f('0x56')]===0x0){return db[_0x5e8f('0x25')][_0x5e8f('0x4a')]({'name':_0xb53d86['name'],'resourceId':_0xb53d86['id'],'type':_0x366622[_0x5e8f('0x29')],'sectionId':_0x366622['id']},{})[_0x5e8f('0x21')](function(){return _0x2e0916;});}else{return _0x2e0916;}})[_0x5e8f('0x45')](function(_0x1203f4){logger[_0x5e8f('0x27')](_0x5e8f('0x57'),_0x1203f4);throw _0x1203f4;});}return _0x2e0916;})[_0x5e8f('0x21')](respondWithResult(_0x28e4f3,0xc9))[_0x5e8f('0x45')](handleError(_0x28e4f3,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index e131c29..73c975a 100644
--- a/server/api/cannedAnswer/cannedAnswer.model.js
+++ b/server/api/cannedAnswer/cannedAnswer.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f95=['request-promise','path','rimraf','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x9f95,0x97));var _0x59f9=function(_0x1093dc,_0xa31577){_0x1093dc=_0x1093dc-0x0;var _0x53bdb3=_0x9f95[_0x1093dc];return _0x53bdb3;};'use strict';var _=require(_0x59f9('0x0'));var util=require('util');var logger=require(_0x59f9('0x1'))(_0x59f9('0x2'));var moment=require(_0x59f9('0x3'));var BPromise=require(_0x59f9('0x4'));var rp=require(_0x59f9('0x5'));var fs=require('fs');var path=require(_0x59f9('0x6'));var rimraf=require(_0x59f9('0x7'));var config=require('../../config/environment');var attributes=require(_0x59f9('0x8'));module['exports']=function(_0x5e5229,_0x58b0d6){return _0x5e5229['define'](_0x59f9('0x9'),attributes,{'tableName':_0x59f9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x59f9('0xb'),'collate':_0x59f9('0xc')});};
\ No newline at end of file
+var _0x02f9=['bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x223f48,_0x1bb823){var _0x333fe7=function(_0x11ef45){while(--_0x11ef45){_0x223f48['push'](_0x223f48['shift']());}};_0x333fe7(++_0x1bb823);}(_0x02f9,0x1db));var _0x902f=function(_0x395d71,_0x352d8c){_0x395d71=_0x395d71-0x0;var _0x41a8a3=_0x02f9[_0x395d71];return _0x41a8a3;};'use strict';var _=require(_0x902f('0x0'));var util=require(_0x902f('0x1'));var logger=require(_0x902f('0x2'))(_0x902f('0x3'));var moment=require(_0x902f('0x4'));var BPromise=require(_0x902f('0x5'));var rp=require(_0x902f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x902f('0x7'));var config=require(_0x902f('0x8'));var attributes=require(_0x902f('0x9'));module[_0x902f('0xa')]=function(_0x4c1616,_0x4afe9f){return _0x4c1616[_0x902f('0xb')](_0x902f('0xc'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x902f('0xd'),'collate':_0x902f('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index f0c44a0..1a2f141 100644
--- a/server/api/cannedAnswer/cannedAnswer.rpc.js
+++ b/server/api/cannedAnswer/cannedAnswer.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30455d,_0x2a3f2b){var _0xe88fd6=function(_0x354bc4){while(--_0x354bc4){_0x30455d['push'](_0x30455d['shift']());}};_0xe88fd6(++_0x2a3f2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x59f145,_0x1da9d8){var _0x395b82=function(_0x5ecb7f){while(--_0x5ecb7f){_0x59f145['push'](_0x59f145['shift']());}};_0x395b82(++_0x1da9d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index a6f4820..64866f0 100644
--- a/server/api/cannedAnswer/index.js
+++ b/server/api/cannedAnswer/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a1a=['create','put','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show'];(function(_0x51df7f,_0x215088){var _0x34d800=function(_0x18ea66){while(--_0x18ea66){_0x51df7f['push'](_0x51df7f['shift']());}};_0x34d800(++_0x215088);}(_0x2a1a,0x75));var _0xa2a1=function(_0x21b7b9,_0x4bb51c){_0x21b7b9=_0x21b7b9-0x0;var _0x432587=_0x2a1a[_0x21b7b9];return _0x432587;};'use strict';var multer=require(_0xa2a1('0x0'));var util=require(_0xa2a1('0x1'));var path=require('path');var timeout=require(_0xa2a1('0x2'));var express=require('express');var router=express[_0xa2a1('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa2a1('0x4'));var config=require('../../config/environment');var controller=require(_0xa2a1('0x5'));router[_0xa2a1('0x6')]('/',auth[_0xa2a1('0x7')](),controller[_0xa2a1('0x8')]);router[_0xa2a1('0x6')](_0xa2a1('0x9'),auth[_0xa2a1('0x7')](),controller[_0xa2a1('0xa')]);router['post']('/',auth[_0xa2a1('0x7')](),controller[_0xa2a1('0xb')]);router[_0xa2a1('0xc')](_0xa2a1('0x9'),auth[_0xa2a1('0x7')](),controller['update']);router[_0xa2a1('0xd')](_0xa2a1('0x9'),auth[_0xa2a1('0x7')](),controller[_0xa2a1('0xe')]);module[_0xa2a1('0xf')]=router;
\ No newline at end of file
+var _0x6ab8=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','post'];(function(_0x39ded1,_0xaee436){var _0x2e248e=function(_0x193df3){while(--_0x193df3){_0x39ded1['push'](_0x39ded1['shift']());}};_0x2e248e(++_0xaee436);}(_0x6ab8,0xe2));var _0x86ab=function(_0x4a5327,_0x237970){_0x4a5327=_0x4a5327-0x0;var _0x139a16=_0x6ab8[_0x4a5327];return _0x139a16;};'use strict';var multer=require(_0x86ab('0x0'));var util=require('util');var path=require(_0x86ab('0x1'));var timeout=require(_0x86ab('0x2'));var express=require(_0x86ab('0x3'));var router=express[_0x86ab('0x4')]();var fs_extra=require(_0x86ab('0x5'));var auth=require(_0x86ab('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x86ab('0x7'));var controller=require('./cannedAnswer.controller');router[_0x86ab('0x8')]('/',auth['isAuthenticated'](),controller[_0x86ab('0x9')]);router[_0x86ab('0x8')](_0x86ab('0xa'),auth[_0x86ab('0xb')](),controller[_0x86ab('0xc')]);router[_0x86ab('0xd')]('/',auth[_0x86ab('0xb')](),controller[_0x86ab('0xe')]);router[_0x86ab('0xf')]('/:id',auth[_0x86ab('0xb')](),controller[_0x86ab('0x10')]);router[_0x86ab('0x11')](_0x86ab('0xa'),auth[_0x86ab('0xb')](),controller[_0x86ab('0x12')]);module[_0x86ab('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 547588f..dd8ee7e 100644
--- a/server/api/cdr/cdr.attributes.js
+++ b/server/api/cdr/cdr.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2fa=['sequelize','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3da693,_0x358562){var _0x321653=function(_0x3cafce){while(--_0x3cafce){_0x3da693['push'](_0x3da693['shift']());}};_0x321653(++_0x358562);}(_0xf2fa,0xd0));var _0xaf2f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf2fa[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xaf2f('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xaf2f('0x1')},'clid':{'type':Sequelize[_0xaf2f('0x2')]},'src':{'type':Sequelize[_0xaf2f('0x2')]},'dst':{'type':Sequelize[_0xaf2f('0x2')]},'dcontext':{'type':Sequelize[_0xaf2f('0x2')]},'channel':{'type':Sequelize[_0xaf2f('0x2')]},'dstchannel':{'type':Sequelize[_0xaf2f('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xaf2f('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xaf2f('0x2')]},'amaflags':{'type':Sequelize[_0xaf2f('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xaf2f('0x2')]},'userfield':{'type':Sequelize[_0xaf2f('0x2')]},'uniqueid':{'type':Sequelize[_0xaf2f('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xaf2f('0x2')]},'tag':{'type':Sequelize[_0xaf2f('0x2')]}};
\ No newline at end of file
+var _0x99e9=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x2c6329,_0x598d7c){var _0x23545e=function(_0x46632b){while(--_0x46632b){_0x2c6329['push'](_0x2c6329['shift']());}};_0x23545e(++_0x598d7c);}(_0x99e9,0xb4));var _0x999e=function(_0x3c04ef,_0x9d110c){_0x3c04ef=_0x3c04ef-0x0;var _0x6a3a69=_0x99e9[_0x3c04ef];return _0x6a3a69;};'use strict';var Sequelize=require('sequelize');module[_0x999e('0x0')]={'calldate':{'type':Sequelize[_0x999e('0x1')],'allowNull':![],'defaultValue':_0x999e('0x2')},'clid':{'type':Sequelize[_0x999e('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x999e('0x3')]},'dcontext':{'type':Sequelize[_0x999e('0x3')]},'channel':{'type':Sequelize[_0x999e('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x999e('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x999e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x999e('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x999e('0x3')]},'amaflags':{'type':Sequelize[_0x999e('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x999e('0x3')]},'uniqueid':{'type':Sequelize[_0x999e('0x3')]},'linkedid':{'type':Sequelize[_0x999e('0x3')]},'sequence':{'type':Sequelize[_0x999e('0x3')]},'peeraccount':{'type':Sequelize[_0x999e('0x3')]},'type':{'type':Sequelize[_0x999e('0x3')]},'tag':{'type':Sequelize[_0x999e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index f6700ae..a11efaf 100644
--- a/server/api/cdr/cdr.controller.js
+++ b/server/api/cdr/cdr.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0207=['offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','end','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json'];(function(_0x36fed7,_0x4d0eb4){var _0x13adde=function(_0x219f83){while(--_0x219f83){_0x36fed7['push'](_0x36fed7['shift']());}};_0x13adde(++_0x4d0eb4);}(_0x0207,0x162));var _0x7020=function(_0x420ccc,_0x26959c){_0x420ccc=_0x420ccc-0x0;var _0x7ccd55=_0x0207[_0x420ccc];return _0x7ccd55;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7020('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7020('0x1'));var moment=require(_0x7020('0x2'));var BPromise=require(_0x7020('0x3'));var Mustache=require(_0x7020('0x4'));var util=require(_0x7020('0x5'));var path=require(_0x7020('0x6'));var sox=require(_0x7020('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7020('0x8'));var _=require(_0x7020('0x9'));var squel=require(_0x7020('0xa'));var crypto=require(_0x7020('0xb'));var jsforce=require(_0x7020('0xc'));var deskjs=require(_0x7020('0xd'));var toCsv=require(_0x7020('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7020('0xf'));var authService=require(_0x7020('0x10'));var qs=require(_0x7020('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7020('0x12'));var logger=require(_0x7020('0x13'))('api');var utils=require(_0x7020('0x14'));var config=require(_0x7020('0x15'));var licenseUtil=require(_0x7020('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d7d79,_0x598198){_0x598198=_0x598198||0xcc;return function(_0xd41aed){if(_0xd41aed){return _0x2d7d79[_0x7020('0x17')](_0x598198);}return _0x2d7d79[_0x7020('0x18')](_0x598198)['end']();};}function respondWithResult(_0x9403e5,_0x5f5872){_0x5f5872=_0x5f5872||0xc8;return function(_0x3b8d60){if(_0x3b8d60){return _0x9403e5[_0x7020('0x18')](_0x5f5872)[_0x7020('0x19')](_0x3b8d60);}};}function respondWithFilteredResult(_0x176190,_0x17260e){return function(_0x308324){if(_0x308324){var _0x55c8b9=typeof _0x17260e[_0x7020('0x1a')]==='undefined'&&typeof _0x17260e[_0x7020('0x1b')]===_0x7020('0x1c');var _0x1a3569=_0x308324[_0x7020('0x1d')];var _0x4fe6f1=_0x55c8b9?0x0:_0x17260e[_0x7020('0x1a')];var _0x3ac2f6=_0x55c8b9?_0x308324[_0x7020('0x1d')]:_0x17260e[_0x7020('0x1a')]+_0x17260e[_0x7020('0x1b')];var _0x1a79fb;if(_0x3ac2f6>=_0x1a3569){_0x3ac2f6=_0x1a3569;_0x1a79fb=0xc8;}else{_0x1a79fb=0xce;}_0x176190['status'](_0x1a79fb);return _0x176190['set'](_0x7020('0x1e'),_0x4fe6f1+'-'+_0x3ac2f6+'/'+_0x1a3569)[_0x7020('0x19')](_0x308324);}return null;};}function patchUpdates(_0x1d1986){return function(_0xb96d30){try{jsonpatch['apply'](_0xb96d30,_0x1d1986,!![]);}catch(_0x382e06){return BPromise[_0x7020('0x1f')](_0x382e06);}return _0xb96d30[_0x7020('0x20')]();};}function saveUpdates(_0x860099,_0x493cc7){return function(_0xcc48f){if(_0xcc48f){return _0xcc48f[_0x7020('0x21')](_0x860099)[_0x7020('0x22')](function(_0x362705){return _0x362705;});}return null;};}function removeEntity(_0x384fe9,_0xe3f4d2){return function(_0x147986){if(_0x147986){return _0x147986[_0x7020('0x23')]()['then'](function(){_0x384fe9[_0x7020('0x18')](0xcc)[_0x7020('0x24')]();});}};}function handleEntityNotFound(_0x35b539,_0x5586f8){return function(_0x28f9f0){if(!_0x28f9f0){_0x35b539['sendStatus'](0x194);}return _0x28f9f0;};}function handleError(_0x496471,_0x50aecb){_0x50aecb=_0x50aecb||0x1f4;return function(_0x178cbd){logger['error'](_0x178cbd[_0x7020('0x25')]);if(_0x178cbd['name']){delete _0x178cbd[_0x7020('0x26')];}_0x496471[_0x7020('0x18')](_0x50aecb)[_0x7020('0x27')](_0x178cbd);};}exports[_0x7020('0x28')]=function(_0xb03bd6,_0x1dff20){var _0x2ba734={},_0x15a1cc={},_0xc51979={'count':0x0,'rows':[]};var _0x2c9c86=_[_0x7020('0x29')](db[_0x7020('0x2a')][_0x7020('0x2b')],function(_0x47a996){return{'name':_0x47a996[_0x7020('0x2c')],'type':_0x47a996[_0x7020('0x2d')][_0x7020('0x2e')]};});_0x15a1cc[_0x7020('0x2f')]=_[_0x7020('0x29')](_0x2c9c86,_0x7020('0x26'));_0x15a1cc[_0x7020('0x30')]=_[_0x7020('0x31')](_0xb03bd6[_0x7020('0x30')]);_0x15a1cc[_0x7020('0x32')]=_[_0x7020('0x33')](_0x15a1cc[_0x7020('0x2f')],_0x15a1cc[_0x7020('0x30')]);_0x2ba734[_0x7020('0x34')]=_['intersection'](_0x15a1cc[_0x7020('0x2f')],qs[_0x7020('0x35')](_0xb03bd6[_0x7020('0x30')][_0x7020('0x35')]));_0x2ba734[_0x7020('0x34')]=_0x2ba734[_0x7020('0x34')][_0x7020('0x36')]?_0x2ba734[_0x7020('0x34')]:_0x15a1cc[_0x7020('0x2f')];if(!_0xb03bd6[_0x7020('0x30')][_0x7020('0x37')](_0x7020('0x38'))){_0x2ba734[_0x7020('0x1b')]=qs[_0x7020('0x1b')](_0xb03bd6['query'][_0x7020('0x1b')]);_0x2ba734[_0x7020('0x1a')]=qs[_0x7020('0x1a')](_0xb03bd6['query'][_0x7020('0x1a')]);}_0x2ba734[_0x7020('0x39')]=qs[_0x7020('0x3a')](_0xb03bd6[_0x7020('0x30')][_0x7020('0x3a')]);_0x2ba734[_0x7020('0x3b')]=qs['filters'](_[_0x7020('0x3c')](_0xb03bd6['query'],_0x15a1cc['filters']),_0x2c9c86);if(_0xb03bd6['query'][_0x7020('0x3d')]){_0x2ba734[_0x7020('0x3b')]=_[_0x7020('0x3e')](_0x2ba734[_0x7020('0x3b')],{'$or':_[_0x7020('0x29')](_0x2c9c86,function(_0x4f1cca){if(_0x4f1cca['type']!==_0x7020('0x3f')){var _0x209d94={};_0x209d94[_0x4f1cca[_0x7020('0x26')]]={'$like':'%'+_0xb03bd6[_0x7020('0x30')]['filter']+'%'};return _0x209d94;}})});}_0x2ba734=_[_0x7020('0x3e')]({},_0x2ba734,_0xb03bd6['options']);var _0x35ebee={'where':_0x2ba734[_0x7020('0x3b')]};return db[_0x7020('0x2a')]['count'](_0x35ebee)['then'](function(_0x19b26a){_0xc51979['count']=_0x19b26a;if(_0xb03bd6[_0x7020('0x30')][_0x7020('0x40')]){_0x2ba734['include']=[{'all':!![]}];}return db[_0x7020('0x2a')][_0x7020('0x41')](_0x2ba734);})[_0x7020('0x22')](function(_0x4b4856){_0xc51979[_0x7020('0x42')]=_0x4b4856;return _0xc51979;})['then'](respondWithFilteredResult(_0x1dff20,_0x2ba734))[_0x7020('0x43')](handleError(_0x1dff20,null));};exports[_0x7020('0x44')]=function(_0xf5320b,_0x4d7dae){var _0x31ba95={'raw':!![],'where':{'id':_0xf5320b[_0x7020('0x45')]['id']}},_0xa389b0={};_0xa389b0[_0x7020('0x2f')]=_[_0x7020('0x31')](db['Cdr'][_0x7020('0x2b')]);_0xa389b0[_0x7020('0x30')]=_[_0x7020('0x31')](_0xf5320b[_0x7020('0x30')]);_0xa389b0['filters']=_[_0x7020('0x33')](_0xa389b0['model'],_0xa389b0['query']);_0x31ba95['attributes']=_[_0x7020('0x33')](_0xa389b0['model'],qs[_0x7020('0x35')](_0xf5320b[_0x7020('0x30')][_0x7020('0x35')]));_0x31ba95['attributes']=_0x31ba95[_0x7020('0x34')]['length']?_0x31ba95[_0x7020('0x34')]:_0xa389b0[_0x7020('0x2f')];if(_0xf5320b[_0x7020('0x30')][_0x7020('0x40')]){_0x31ba95[_0x7020('0x46')]=[{'all':!![]}];}_0x31ba95=_[_0x7020('0x3e')]({},_0x31ba95,_0xf5320b[_0x7020('0x47')]);return db[_0x7020('0x2a')][_0x7020('0x48')](_0x31ba95)[_0x7020('0x22')](handleEntityNotFound(_0x4d7dae,null))[_0x7020('0x22')](respondWithResult(_0x4d7dae,null))[_0x7020('0x43')](handleError(_0x4d7dae,null));};exports[_0x7020('0x49')]=function(_0x3b5fe3,_0x3dcf52){return db[_0x7020('0x2a')][_0x7020('0x49')](_0x3b5fe3[_0x7020('0x4a')],{})['then'](respondWithResult(_0x3dcf52,0xc9))[_0x7020('0x43')](handleError(_0x3dcf52,null));};exports[_0x7020('0x21')]=function(_0x1b8198,_0x2a3344){if(_0x1b8198[_0x7020('0x4a')]['id']){delete _0x1b8198['body']['id'];}return db['Cdr'][_0x7020('0x48')]({'where':{'id':_0x1b8198['params']['id']}})[_0x7020('0x22')](handleEntityNotFound(_0x2a3344,null))[_0x7020('0x22')](saveUpdates(_0x1b8198[_0x7020('0x4a')],null))[_0x7020('0x22')](respondWithResult(_0x2a3344,null))['catch'](handleError(_0x2a3344,null));};exports['destroy']=function(_0xfbd73a,_0x2a4656){return db[_0x7020('0x2a')][_0x7020('0x48')]({'where':{'id':_0xfbd73a[_0x7020('0x45')]['id']}})[_0x7020('0x22')](handleEntityNotFound(_0x2a4656,null))[_0x7020('0x22')](removeEntity(_0x2a4656,null))[_0x7020('0x43')](handleError(_0x2a4656,null));};exports[_0x7020('0x4b')]=function(_0x6ce509,_0x3b583b){return db[_0x7020('0x2a')]['describe']()['then'](respondWithResult(_0x3b583b,null))['catch'](handleError(_0x3b583b,null));};
\ No newline at end of file
+var _0xeff8=['include','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length'];(function(_0x36af89,_0x4529ea){var _0x48f345=function(_0x4639fc){while(--_0x4639fc){_0x36af89['push'](_0x36af89['shift']());}};_0x48f345(++_0x4529ea);}(_0xeff8,0x186));var _0x8eff=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0xeff8[_0x4017b0];return _0x5ed4f7;};'use strict';var emlformat=require(_0x8eff('0x0'));var rimraf=require(_0x8eff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eff('0x2'));var rp=require(_0x8eff('0x3'));var moment=require(_0x8eff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8eff('0x5'));var util=require(_0x8eff('0x6'));var path=require(_0x8eff('0x7'));var sox=require(_0x8eff('0x8'));var csv=require('to-csv');var ejs=require(_0x8eff('0x9'));var fs=require('fs');var fs_extra=require(_0x8eff('0xa'));var _=require(_0x8eff('0xb'));var squel=require(_0x8eff('0xc'));var crypto=require('crypto');var jsforce=require(_0x8eff('0xd'));var deskjs=require(_0x8eff('0xe'));var toCsv=require(_0x8eff('0xf'));var querystring=require(_0x8eff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8eff('0x11'));var qs=require(_0x8eff('0x12'));var as=require(_0x8eff('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8eff('0x14'))(_0x8eff('0x15'));var utils=require('../../config/utils');var config=require(_0x8eff('0x16'));var licenseUtil=require(_0x8eff('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a399e,_0x45f280){_0x45f280=_0x45f280||0xcc;return function(_0x43c914){if(_0x43c914){return _0x4a399e[_0x8eff('0x18')](_0x45f280);}return _0x4a399e[_0x8eff('0x19')](_0x45f280)[_0x8eff('0x1a')]();};}function respondWithResult(_0x56efdf,_0x3e7c01){_0x3e7c01=_0x3e7c01||0xc8;return function(_0x212a2e){if(_0x212a2e){return _0x56efdf[_0x8eff('0x19')](_0x3e7c01)[_0x8eff('0x1b')](_0x212a2e);}};}function respondWithFilteredResult(_0x228eb1,_0x4cfc91){return function(_0x16202e){if(_0x16202e){var _0xdbb753=typeof _0x4cfc91[_0x8eff('0x1c')]===_0x8eff('0x1d')&&typeof _0x4cfc91[_0x8eff('0x1e')]==='undefined';var _0x32b791=_0x16202e[_0x8eff('0x1f')];var _0x3cd1dc=_0xdbb753?0x0:_0x4cfc91[_0x8eff('0x1c')];var _0x2cd7c5=_0xdbb753?_0x16202e[_0x8eff('0x1f')]:_0x4cfc91[_0x8eff('0x1c')]+_0x4cfc91[_0x8eff('0x1e')];var _0x1b003c;if(_0x2cd7c5>=_0x32b791){_0x2cd7c5=_0x32b791;_0x1b003c=0xc8;}else{_0x1b003c=0xce;}_0x228eb1[_0x8eff('0x19')](_0x1b003c);return _0x228eb1[_0x8eff('0x20')](_0x8eff('0x21'),_0x3cd1dc+'-'+_0x2cd7c5+'/'+_0x32b791)[_0x8eff('0x1b')](_0x16202e);}return null;};}function patchUpdates(_0x2a7337){return function(_0xdbb7b5){try{jsonpatch[_0x8eff('0x22')](_0xdbb7b5,_0x2a7337,!![]);}catch(_0x5e157c){return BPromise[_0x8eff('0x23')](_0x5e157c);}return _0xdbb7b5[_0x8eff('0x24')]();};}function saveUpdates(_0x5a2492,_0x1c4ad3){return function(_0x5ea31f){if(_0x5ea31f){return _0x5ea31f[_0x8eff('0x25')](_0x5a2492)[_0x8eff('0x26')](function(_0x1ccc79){return _0x1ccc79;});}return null;};}function removeEntity(_0x59cc32,_0x1ee09c){return function(_0x4e891c){if(_0x4e891c){return _0x4e891c[_0x8eff('0x27')]()[_0x8eff('0x26')](function(){_0x59cc32['status'](0xcc)[_0x8eff('0x1a')]();});}};}function handleEntityNotFound(_0x5ec3d7,_0x40404b){return function(_0x3b698b){if(!_0x3b698b){_0x5ec3d7[_0x8eff('0x18')](0x194);}return _0x3b698b;};}function handleError(_0x41324b,_0x6359df){_0x6359df=_0x6359df||0x1f4;return function(_0x2e8067){logger['error'](_0x2e8067[_0x8eff('0x28')]);if(_0x2e8067[_0x8eff('0x29')]){delete _0x2e8067[_0x8eff('0x29')];}_0x41324b[_0x8eff('0x19')](_0x6359df)[_0x8eff('0x2a')](_0x2e8067);};}exports[_0x8eff('0x2b')]=function(_0x4cc146,_0x4ed3b8){var _0x44dcdb={},_0x472b19={},_0x17ff3f={'count':0x0,'rows':[]};var _0x5ce071=_[_0x8eff('0x2c')](db[_0x8eff('0x2d')][_0x8eff('0x2e')],function(_0x1da0fa){return{'name':_0x1da0fa[_0x8eff('0x2f')],'type':_0x1da0fa[_0x8eff('0x30')][_0x8eff('0x31')]};});_0x472b19[_0x8eff('0x32')]=_[_0x8eff('0x2c')](_0x5ce071,_0x8eff('0x29'));_0x472b19[_0x8eff('0x33')]=_[_0x8eff('0x34')](_0x4cc146['query']);_0x472b19[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],_0x472b19[_0x8eff('0x33')]);_0x44dcdb['attributes']=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],qs['fields'](_0x4cc146['query'][_0x8eff('0x37')]));_0x44dcdb[_0x8eff('0x38')]=_0x44dcdb['attributes']['length']?_0x44dcdb['attributes']:_0x472b19[_0x8eff('0x32')];if(!_0x4cc146['query'][_0x8eff('0x39')]('nolimit')){_0x44dcdb[_0x8eff('0x1e')]=qs[_0x8eff('0x1e')](_0x4cc146[_0x8eff('0x33')][_0x8eff('0x1e')]);_0x44dcdb[_0x8eff('0x1c')]=qs[_0x8eff('0x1c')](_0x4cc146['query'][_0x8eff('0x1c')]);}_0x44dcdb['order']=qs[_0x8eff('0x3a')](_0x4cc146['query'][_0x8eff('0x3a')]);_0x44dcdb[_0x8eff('0x3b')]=qs[_0x8eff('0x35')](_[_0x8eff('0x3c')](_0x4cc146['query'],_0x472b19[_0x8eff('0x35')]),_0x5ce071);if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x3d')]){_0x44dcdb['where']=_[_0x8eff('0x3e')](_0x44dcdb[_0x8eff('0x3b')],{'$or':_[_0x8eff('0x2c')](_0x5ce071,function(_0x345bc7){if(_0x345bc7[_0x8eff('0x30')]!==_0x8eff('0x3f')){var _0x29f68e={};_0x29f68e[_0x345bc7[_0x8eff('0x29')]]={'$like':'%'+_0x4cc146[_0x8eff('0x33')]['filter']+'%'};return _0x29f68e;}})});}_0x44dcdb=_['merge']({},_0x44dcdb,_0x4cc146[_0x8eff('0x40')]);var _0x114f8e={'where':_0x44dcdb[_0x8eff('0x3b')]};return db[_0x8eff('0x2d')][_0x8eff('0x1f')](_0x114f8e)[_0x8eff('0x26')](function(_0x18b132){_0x17ff3f['count']=_0x18b132;if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x41')]){_0x44dcdb['include']=[{'all':!![]}];}return db[_0x8eff('0x2d')][_0x8eff('0x42')](_0x44dcdb);})[_0x8eff('0x26')](function(_0x18309b){_0x17ff3f[_0x8eff('0x43')]=_0x18309b;return _0x17ff3f;})[_0x8eff('0x26')](respondWithFilteredResult(_0x4ed3b8,_0x44dcdb))[_0x8eff('0x44')](handleError(_0x4ed3b8,null));};exports[_0x8eff('0x45')]=function(_0x6d0568,_0x480c4c){var _0x37f376={'raw':!![],'where':{'id':_0x6d0568[_0x8eff('0x46')]['id']}},_0x27a8c9={};_0x27a8c9[_0x8eff('0x32')]=_[_0x8eff('0x34')](db['Cdr'][_0x8eff('0x2e')]);_0x27a8c9['query']=_[_0x8eff('0x34')](_0x6d0568[_0x8eff('0x33')]);_0x27a8c9[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x27a8c9['model'],_0x27a8c9[_0x8eff('0x33')]);_0x37f376[_0x8eff('0x38')]=_[_0x8eff('0x36')](_0x27a8c9['model'],qs['fields'](_0x6d0568[_0x8eff('0x33')][_0x8eff('0x37')]));_0x37f376[_0x8eff('0x38')]=_0x37f376[_0x8eff('0x38')][_0x8eff('0x47')]?_0x37f376['attributes']:_0x27a8c9[_0x8eff('0x32')];if(_0x6d0568['query'][_0x8eff('0x41')]){_0x37f376[_0x8eff('0x48')]=[{'all':!![]}];}_0x37f376=_['merge']({},_0x37f376,_0x6d0568['options']);return db['Cdr']['find'](_0x37f376)['then'](handleEntityNotFound(_0x480c4c,null))['then'](respondWithResult(_0x480c4c,null))[_0x8eff('0x44')](handleError(_0x480c4c,null));};exports[_0x8eff('0x49')]=function(_0x33aa8d,_0x1b5fda){return db[_0x8eff('0x2d')][_0x8eff('0x49')](_0x33aa8d[_0x8eff('0x4a')],{})[_0x8eff('0x26')](respondWithResult(_0x1b5fda,0xc9))[_0x8eff('0x44')](handleError(_0x1b5fda,null));};exports[_0x8eff('0x25')]=function(_0x4c7013,_0x11e53c){if(_0x4c7013['body']['id']){delete _0x4c7013[_0x8eff('0x4a')]['id'];}return db[_0x8eff('0x2d')][_0x8eff('0x4b')]({'where':{'id':_0x4c7013[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x11e53c,null))[_0x8eff('0x26')](saveUpdates(_0x4c7013[_0x8eff('0x4a')],null))[_0x8eff('0x26')](respondWithResult(_0x11e53c,null))[_0x8eff('0x44')](handleError(_0x11e53c,null));};exports[_0x8eff('0x27')]=function(_0x2a4dbb,_0x452f7a){return db['Cdr'][_0x8eff('0x4b')]({'where':{'id':_0x2a4dbb[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x452f7a,null))[_0x8eff('0x26')](removeEntity(_0x452f7a,null))[_0x8eff('0x44')](handleError(_0x452f7a,null));};exports[_0x8eff('0x4c')]=function(_0x16473d,_0x9eb0b9){return db[_0x8eff('0x2d')]['describe']()['then'](respondWithResult(_0x9eb0b9,null))[_0x8eff('0x44')](handleError(_0x9eb0b9,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 659586f..67d8a53 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x49b6f2,_0x3e9d41){var _0x4d46d8=function(_0x370467){while(--_0x370467){_0x49b6f2['push'](_0x49b6f2['shift']());}};_0x4d46d8(++_0x3e9d41);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xb4ebab,_0x57c2f0){var _0x58d314=function(_0x19d2f2){while(--_0x19d2f2){_0xb4ebab['push'](_0xb4ebab['shift']());}};_0x58d314(++_0x57c2f0);}(_0x7a54,0x106));var _0x47a5=function(_0x73ad99,_0x5705ea){_0x73ad99=_0x73ad99-0x0;var _0x3a5b36=_0x7a54[_0x73ad99];return _0x3a5b36;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index fb9d80e..f81f321 100644
--- a/server/api/cdr/cdr.rpc.js
+++ b/server/api/cdr/cdr.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x693f=['info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','Cdr,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x1bd1cf,_0x4f73bb){var _0x253604=function(_0x4211cf){while(--_0x4211cf){_0x1bd1cf['push'](_0x1bd1cf['shift']());}};_0x253604(++_0x4f73bb);}(_0x693f,0x16e));var _0xf693=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x693f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf693('0x0'));var util=require(_0xf693('0x1'));var moment=require(_0xf693('0x2'));var BPromise=require('bluebird');var rs=require(_0xf693('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf693('0x4'))['db'];var utils=require(_0xf693('0x5'));var logger=require(_0xf693('0x6'))(_0xf693('0x7'));var config=require(_0xf693('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf693('0x9')][_0xf693('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bfe86,_0x175890,_0x5e4ade){return new BPromise(function(_0x1875de,_0x34a575){return client['request'](_0x5bfe86,_0x5e4ade)[_0xf693('0xb')](function(_0x410dcc){logger[_0xf693('0xc')]('Cdr,\x20%s,\x20%s',_0x175890,_0xf693('0xd'));logger[_0xf693('0xe')](_0xf693('0xf'),_0x175890,_0xf693('0xd'),JSON['stringify'](_0x410dcc));if(_0x410dcc['error']){if(_0x410dcc[_0xf693('0x10')][_0xf693('0x11')]===0x1f4){logger[_0xf693('0x10')]('Cdr,\x20%s,\x20%s',_0x175890,_0x410dcc[_0xf693('0x10')]['message']);return _0x34a575(_0x410dcc[_0xf693('0x10')][_0xf693('0x12')]);}logger['error'](_0xf693('0x13'),_0x175890,_0x410dcc[_0xf693('0x10')][_0xf693('0x12')]);return _0x1875de(_0x410dcc[_0xf693('0x10')]['message']);}else{logger[_0xf693('0xc')](_0xf693('0x13'),_0x175890,_0xf693('0xd'));_0x1875de(_0x410dcc['result'][_0xf693('0x12')]);}})[_0xf693('0x14')](function(_0x2caaa1){logger[_0xf693('0x10')](_0xf693('0x13'),_0x175890,_0x2caaa1);_0x34a575(_0x2caaa1);});});}
\ No newline at end of file
+var _0x0435=['../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message','result','catch','randomstring','ioredis','../../mysqldb'];(function(_0x2b4b0b,_0x326eb3){var _0x4316e9=function(_0x37a483){while(--_0x37a483){_0x2b4b0b['push'](_0x2b4b0b['shift']());}};_0x4316e9(++_0x326eb3);}(_0x0435,0x12f));var _0x5043=function(_0xac9bb8,_0x4c1343){_0xac9bb8=_0xac9bb8-0x0;var _0x8c7c24=_0x0435[_0xac9bb8];return _0x8c7c24;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5043('0x0'));var fs=require('fs');var Redis=require(_0x5043('0x1'));var db=require(_0x5043('0x2'))['db'];var utils=require(_0x5043('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x5043('0x4'));var jayson=require(_0x5043('0x5'));var client=jayson[_0x5043('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaef61e,_0x3e2bcd,_0x276310){return new BPromise(function(_0x49c459,_0x252527){return client[_0x5043('0x7')](_0xaef61e,_0x276310)[_0x5043('0x8')](function(_0x347627){logger[_0x5043('0x9')]('Cdr,\x20%s,\x20%s',_0x3e2bcd,_0x5043('0xa'));logger['debug'](_0x5043('0xb'),_0x3e2bcd,_0x5043('0xa'),JSON['stringify'](_0x347627));if(_0x347627[_0x5043('0xc')]){if(_0x347627[_0x5043('0xc')][_0x5043('0xd')]===0x1f4){logger['error'](_0x5043('0xe'),_0x3e2bcd,_0x347627[_0x5043('0xc')]['message']);return _0x252527(_0x347627[_0x5043('0xc')][_0x5043('0xf')]);}logger['error'](_0x5043('0xe'),_0x3e2bcd,_0x347627[_0x5043('0xc')][_0x5043('0xf')]);return _0x49c459(_0x347627['error'][_0x5043('0xf')]);}else{logger[_0x5043('0x9')]('Cdr,\x20%s,\x20%s',_0x3e2bcd,'request\x20sent');_0x49c459(_0x347627[_0x5043('0x10')][_0x5043('0xf')]);}})[_0x5043('0x11')](function(_0x1e456d){logger['error'](_0x5043('0xe'),_0x3e2bcd,_0x1e456d);_0x252527(_0x1e456d);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 1dbf5ef..3c6ec23 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x48a256,_0x530521){var _0x15c127=function(_0x701eca){while(--_0x701eca){_0x48a256['push'](_0x48a256['shift']());}};_0x15c127(++_0x530521);}(_0xb10b,0x12a));var _0xbb10=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0xb10b[_0x4cc280];return _0x16ed24;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x486eff,_0x5cb3b0){var _0x95293b=function(_0x25b947){while(--_0x25b947){_0x486eff['push'](_0x486eff['shift']());}};_0x95293b(++_0x5cb3b0);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 6687943..379ebe6 100644
--- a/server/api/chatApplication/chatApplication.attributes.js
+++ b/server/api/chatApplication/chatApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a80=['STRING','noop','*,*,*,*','sequelize','INTEGER'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x7a80,0x125));var _0x07a8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7a80[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x07a8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x07a8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x07a8('0x2')],'allowNull':![],'defaultValue':_0x07a8('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x07a8('0x2')]},'interval':{'type':Sequelize[_0x07a8('0x2')],'defaultValue':_0x07a8('0x4')}};
\ No newline at end of file
+var _0xb30c=['sequelize','exports','INTEGER','noop','*,*,*,*'];(function(_0x4ab2b6,_0x2e4dd5){var _0x3bb690=function(_0x3388e7){while(--_0x3388e7){_0x4ab2b6['push'](_0x4ab2b6['shift']());}};_0x3bb690(++_0x2e4dd5);}(_0xb30c,0x122));var _0xcb30=function(_0xd363e9,_0x41739f){_0xd363e9=_0xd363e9-0x0;var _0x20a0c4=_0xb30c[_0xd363e9];return _0x20a0c4;};'use strict';var Sequelize=require(_0xcb30('0x0'));module[_0xcb30('0x1')]={'priority':{'type':Sequelize[_0xcb30('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcb30('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcb30('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index dd78343..f556e4f 100644
--- a/server/api/chatApplication/chatApplication.controller.js
+++ b/server/api/chatApplication/chatApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc2af=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','update','params','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0xf28023,_0x2853f6){var _0x1aa966=function(_0x45fe6c){while(--_0x45fe6c){_0xf28023['push'](_0xf28023['shift']());}};_0x1aa966(++_0x2853f6);}(_0xc2af,0x1bc));var _0xfc2a=function(_0x26b5ab,_0x2e1f9b){_0x26b5ab=_0x26b5ab-0x0;var _0x5d0ce4=_0xc2af[_0x26b5ab];return _0x5d0ce4;};'use strict';var emlformat=require(_0xfc2a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc2a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc2a('0x2'));var moment=require(_0xfc2a('0x3'));var BPromise=require(_0xfc2a('0x4'));var Mustache=require(_0xfc2a('0x5'));var util=require(_0xfc2a('0x6'));var path=require(_0xfc2a('0x7'));var sox=require(_0xfc2a('0x8'));var csv=require(_0xfc2a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc2a('0xa'));var _=require('lodash');var squel=require(_0xfc2a('0xb'));var crypto=require('crypto');var jsforce=require(_0xfc2a('0xc'));var deskjs=require(_0xfc2a('0xd'));var toCsv=require(_0xfc2a('0x9'));var querystring=require(_0xfc2a('0xe'));var Papa=require('papaparse');var Redis=require(_0xfc2a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfc2a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc2a('0x11'));var logger=require(_0xfc2a('0x12'))(_0xfc2a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfc2a('0x14'));var db=require(_0xfc2a('0x15'))['db'];function respondWithStatusCode(_0x771766,_0x41395e){_0x41395e=_0x41395e||0xcc;return function(_0x268993){if(_0x268993){return _0x771766[_0xfc2a('0x16')](_0x41395e);}return _0x771766[_0xfc2a('0x17')](_0x41395e)[_0xfc2a('0x18')]();};}function respondWithResult(_0xe4b058,_0x55574a){_0x55574a=_0x55574a||0xc8;return function(_0x4e6b7e){if(_0x4e6b7e){return _0xe4b058[_0xfc2a('0x17')](_0x55574a)[_0xfc2a('0x19')](_0x4e6b7e);}};}function respondWithFilteredResult(_0x594a59,_0x12dd07){return function(_0x2f311c){if(_0x2f311c){var _0x21654f=typeof _0x12dd07[_0xfc2a('0x1a')]===_0xfc2a('0x1b')&&typeof _0x12dd07[_0xfc2a('0x1c')]===_0xfc2a('0x1b');var _0x678f8d=_0x2f311c[_0xfc2a('0x1d')];var _0x1e1524=_0x21654f?0x0:_0x12dd07[_0xfc2a('0x1a')];var _0x39bcb2=_0x21654f?_0x2f311c[_0xfc2a('0x1d')]:_0x12dd07['offset']+_0x12dd07[_0xfc2a('0x1c')];var _0x15ff6d;if(_0x39bcb2>=_0x678f8d){_0x39bcb2=_0x678f8d;_0x15ff6d=0xc8;}else{_0x15ff6d=0xce;}_0x594a59['status'](_0x15ff6d);return _0x594a59[_0xfc2a('0x1e')]('Content-Range',_0x1e1524+'-'+_0x39bcb2+'/'+_0x678f8d)['json'](_0x2f311c);}return null;};}function patchUpdates(_0x3e88fe){return function(_0x2b7f5c){try{jsonpatch[_0xfc2a('0x1f')](_0x2b7f5c,_0x3e88fe,!![]);}catch(_0x40ed0b){return BPromise[_0xfc2a('0x20')](_0x40ed0b);}return _0x2b7f5c['save']();};}function saveUpdates(_0x722009,_0x4908d7){return function(_0x5432f2){if(_0x5432f2){return _0x5432f2['update'](_0x722009)[_0xfc2a('0x21')](function(_0x57b67c){return _0x57b67c;});}return null;};}function removeEntity(_0x4d6b68,_0x43e237){return function(_0x10396d){if(_0x10396d){return _0x10396d[_0xfc2a('0x22')]()[_0xfc2a('0x21')](function(){_0x4d6b68['status'](0xcc)[_0xfc2a('0x18')]();});}};}function handleEntityNotFound(_0x192f0b,_0x33574a){return function(_0x5ea9f8){if(!_0x5ea9f8){_0x192f0b[_0xfc2a('0x16')](0x194);}return _0x5ea9f8;};}function handleError(_0x24ff4e,_0x542c9e){_0x542c9e=_0x542c9e||0x1f4;return function(_0x55c0bc){logger[_0xfc2a('0x23')](_0x55c0bc['stack']);if(_0x55c0bc[_0xfc2a('0x24')]){delete _0x55c0bc[_0xfc2a('0x24')];}_0x24ff4e[_0xfc2a('0x17')](_0x542c9e)[_0xfc2a('0x25')](_0x55c0bc);};}exports['show']=function(_0x4fe30d,_0x5f4165){var _0x3bf69f={'raw':!![],'where':{'id':_0x4fe30d['params']['id']}},_0x1f91f5={};_0x1f91f5[_0xfc2a('0x26')]=_[_0xfc2a('0x27')](db[_0xfc2a('0x28')][_0xfc2a('0x29')]);_0x1f91f5[_0xfc2a('0x2a')]=_[_0xfc2a('0x27')](_0x4fe30d[_0xfc2a('0x2a')]);_0x1f91f5[_0xfc2a('0x2b')]=_[_0xfc2a('0x2c')](_0x1f91f5['model'],_0x1f91f5[_0xfc2a('0x2a')]);_0x3bf69f[_0xfc2a('0x2d')]=_[_0xfc2a('0x2c')](_0x1f91f5[_0xfc2a('0x26')],qs[_0xfc2a('0x2e')](_0x4fe30d[_0xfc2a('0x2a')][_0xfc2a('0x2e')]));_0x3bf69f[_0xfc2a('0x2d')]=_0x3bf69f[_0xfc2a('0x2d')][_0xfc2a('0x2f')]?_0x3bf69f[_0xfc2a('0x2d')]:_0x1f91f5[_0xfc2a('0x26')];if(_0x4fe30d['query'][_0xfc2a('0x30')]){_0x3bf69f[_0xfc2a('0x31')]=[{'all':!![]}];}_0x3bf69f=_[_0xfc2a('0x32')]({},_0x3bf69f,_0x4fe30d[_0xfc2a('0x33')]);return db['ChatApplication'][_0xfc2a('0x34')](_0x3bf69f)['then'](handleEntityNotFound(_0x5f4165,null))[_0xfc2a('0x21')](respondWithResult(_0x5f4165,null))['catch'](handleError(_0x5f4165,null));};exports[_0xfc2a('0x35')]=function(_0x1a423d,_0x53491a){if(_0x1a423d['body']['id']){delete _0x1a423d['body']['id'];}return db['ChatApplication'][_0xfc2a('0x34')]({'where':{'id':_0x1a423d[_0xfc2a('0x36')]['id']}})['then'](handleEntityNotFound(_0x53491a,null))['then'](saveUpdates(_0x1a423d[_0xfc2a('0x37')],null))[_0xfc2a('0x21')](respondWithResult(_0x53491a,null))[_0xfc2a('0x38')](handleError(_0x53491a,null));};exports[_0xfc2a('0x22')]=function(_0x30a32a,_0x5dde47){return db[_0xfc2a('0x28')][_0xfc2a('0x34')]({'where':{'id':_0x30a32a['params']['id']}})[_0xfc2a('0x21')](handleEntityNotFound(_0x5dde47,null))[_0xfc2a('0x21')](removeEntity(_0x5dde47,null))[_0xfc2a('0x38')](handleError(_0x5dde47,null));};
\ No newline at end of file
+var _0xffdc=['attributes','fields','includeAll','options','ChatApplication','body','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model','rawAttributes','query','keys','filters','intersection'];(function(_0x56d196,_0x204092){var _0x30a8ee=function(_0x15c46d){while(--_0x15c46d){_0x56d196['push'](_0x56d196['shift']());}};_0x30a8ee(++_0x204092);}(_0xffdc,0x7f));var _0xcffd=function(_0x4a9b3f,_0x158971){_0x4a9b3f=_0x4a9b3f-0x0;var _0x48b4f0=_0xffdc[_0x4a9b3f];return _0x48b4f0;};'use strict';var emlformat=require(_0xcffd('0x0'));var rimraf=require(_0xcffd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcffd('0x2'));var rp=require(_0xcffd('0x3'));var moment=require('moment');var BPromise=require(_0xcffd('0x4'));var Mustache=require(_0xcffd('0x5'));var util=require(_0xcffd('0x6'));var path=require(_0xcffd('0x7'));var sox=require(_0xcffd('0x8'));var csv=require('to-csv');var ejs=require(_0xcffd('0x9'));var fs=require('fs');var fs_extra=require(_0xcffd('0xa'));var _=require(_0xcffd('0xb'));var squel=require(_0xcffd('0xc'));var crypto=require(_0xcffd('0xd'));var jsforce=require(_0xcffd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcffd('0xf'));var querystring=require(_0xcffd('0x10'));var Papa=require('papaparse');var Redis=require(_0xcffd('0x11'));var authService=require(_0xcffd('0x12'));var qs=require(_0xcffd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcffd('0x14'));var logger=require(_0xcffd('0x15'))(_0xcffd('0x16'));var utils=require(_0xcffd('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcffd('0x18'))['db'];function respondWithStatusCode(_0x187ca8,_0x1340b0){_0x1340b0=_0x1340b0||0xcc;return function(_0x4ec693){if(_0x4ec693){return _0x187ca8[_0xcffd('0x19')](_0x1340b0);}return _0x187ca8['status'](_0x1340b0)['end']();};}function respondWithResult(_0x765795,_0x20e134){_0x20e134=_0x20e134||0xc8;return function(_0x4edde4){if(_0x4edde4){return _0x765795[_0xcffd('0x1a')](_0x20e134)[_0xcffd('0x1b')](_0x4edde4);}};}function respondWithFilteredResult(_0x3d1e6e,_0x32f579){return function(_0x4ec386){if(_0x4ec386){var _0x4921d1=typeof _0x32f579[_0xcffd('0x1c')]===_0xcffd('0x1d')&&typeof _0x32f579[_0xcffd('0x1e')]===_0xcffd('0x1d');var _0x867e85=_0x4ec386['count'];var _0x4216c4=_0x4921d1?0x0:_0x32f579['offset'];var _0x18e9e1=_0x4921d1?_0x4ec386[_0xcffd('0x1f')]:_0x32f579[_0xcffd('0x1c')]+_0x32f579[_0xcffd('0x1e')];var _0x33a27e;if(_0x18e9e1>=_0x867e85){_0x18e9e1=_0x867e85;_0x33a27e=0xc8;}else{_0x33a27e=0xce;}_0x3d1e6e[_0xcffd('0x1a')](_0x33a27e);return _0x3d1e6e[_0xcffd('0x20')](_0xcffd('0x21'),_0x4216c4+'-'+_0x18e9e1+'/'+_0x867e85)['json'](_0x4ec386);}return null;};}function patchUpdates(_0x73d51a){return function(_0x1f36f4){try{jsonpatch[_0xcffd('0x22')](_0x1f36f4,_0x73d51a,!![]);}catch(_0x4029a7){return BPromise[_0xcffd('0x23')](_0x4029a7);}return _0x1f36f4[_0xcffd('0x24')]();};}function saveUpdates(_0x1ad69f,_0x5d2d3c){return function(_0x52fc51){if(_0x52fc51){return _0x52fc51[_0xcffd('0x25')](_0x1ad69f)[_0xcffd('0x26')](function(_0x44f901){return _0x44f901;});}return null;};}function removeEntity(_0x3935ff,_0x3c3839){return function(_0x345a4d){if(_0x345a4d){return _0x345a4d[_0xcffd('0x27')]()[_0xcffd('0x26')](function(){_0x3935ff[_0xcffd('0x1a')](0xcc)[_0xcffd('0x28')]();});}};}function handleEntityNotFound(_0x37185d,_0x1f232a){return function(_0x544ae7){if(!_0x544ae7){_0x37185d[_0xcffd('0x19')](0x194);}return _0x544ae7;};}function handleError(_0x2b5044,_0x2c66a7){_0x2c66a7=_0x2c66a7||0x1f4;return function(_0x547bdb){logger[_0xcffd('0x29')](_0x547bdb[_0xcffd('0x2a')]);if(_0x547bdb[_0xcffd('0x2b')]){delete _0x547bdb['name'];}_0x2b5044['status'](_0x2c66a7)[_0xcffd('0x2c')](_0x547bdb);};}exports[_0xcffd('0x2d')]=function(_0x4b1c7d,_0x3cb0dd){var _0x6641e={'raw':!![],'where':{'id':_0x4b1c7d[_0xcffd('0x2e')]['id']}},_0x5a97cf={};_0x5a97cf[_0xcffd('0x2f')]=_['keys'](db['ChatApplication'][_0xcffd('0x30')]);_0x5a97cf[_0xcffd('0x31')]=_[_0xcffd('0x32')](_0x4b1c7d['query']);_0x5a97cf[_0xcffd('0x33')]=_[_0xcffd('0x34')](_0x5a97cf['model'],_0x5a97cf[_0xcffd('0x31')]);_0x6641e[_0xcffd('0x35')]=_['intersection'](_0x5a97cf[_0xcffd('0x2f')],qs['fields'](_0x4b1c7d[_0xcffd('0x31')][_0xcffd('0x36')]));_0x6641e['attributes']=_0x6641e[_0xcffd('0x35')]['length']?_0x6641e['attributes']:_0x5a97cf[_0xcffd('0x2f')];if(_0x4b1c7d[_0xcffd('0x31')][_0xcffd('0x37')]){_0x6641e['include']=[{'all':!![]}];}_0x6641e=_['merge']({},_0x6641e,_0x4b1c7d[_0xcffd('0x38')]);return db[_0xcffd('0x39')]['find'](_0x6641e)['then'](handleEntityNotFound(_0x3cb0dd,null))[_0xcffd('0x26')](respondWithResult(_0x3cb0dd,null))['catch'](handleError(_0x3cb0dd,null));};exports[_0xcffd('0x25')]=function(_0x19b027,_0x2144bc){if(_0x19b027[_0xcffd('0x3a')]['id']){delete _0x19b027[_0xcffd('0x3a')]['id'];}return db[_0xcffd('0x39')]['find']({'where':{'id':_0x19b027[_0xcffd('0x2e')]['id']}})[_0xcffd('0x26')](handleEntityNotFound(_0x2144bc,null))[_0xcffd('0x26')](saveUpdates(_0x19b027[_0xcffd('0x3a')],null))[_0xcffd('0x26')](respondWithResult(_0x2144bc,null))[_0xcffd('0x3b')](handleError(_0x2144bc,null));};exports['destroy']=function(_0xf81fb3,_0x4b9fc9){return db[_0xcffd('0x39')]['find']({'where':{'id':_0xf81fb3[_0xcffd('0x2e')]['id']}})[_0xcffd('0x26')](handleEntityNotFound(_0x4b9fc9,null))[_0xcffd('0x26')](removeEntity(_0x4b9fc9,null))[_0xcffd('0x3b')](handleError(_0x4b9fc9,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index b2d1004..fb40b0d 100644
--- a/server/api/chatApplication/chatApplication.model.js
+++ b/server/api/chatApplication/chatApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6cd0=['utf8mb4','utf8mb4_unicode_ci','lodash','api','request-promise','path','../../config/environment','exports','ChatApplication','chat_applications'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6cd0,0x1ce));var _0x06cd=function(_0x1d30e4,_0x5e44c7){_0x1d30e4=_0x1d30e4-0x0;var _0x416b9e=_0x6cd0[_0x1d30e4];return _0x416b9e;};'use strict';var _=require(_0x06cd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x06cd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x06cd('0x2'));var fs=require('fs');var path=require(_0x06cd('0x3'));var rimraf=require('rimraf');var config=require(_0x06cd('0x4'));var attributes=require('./chatApplication.attributes');module[_0x06cd('0x5')]=function(_0x1c0f56,_0x4997de){return _0x1c0f56['define'](_0x06cd('0x6'),attributes,{'tableName':_0x06cd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x06cd('0x8'),'collate':_0x06cd('0x9')});};
\ No newline at end of file
+var _0x7884=['../../config/environment','exports','define','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x1b9d97,_0x19159b){var _0x1d7a29=function(_0x5456d9){while(--_0x5456d9){_0x1b9d97['push'](_0x1b9d97['shift']());}};_0x1d7a29(++_0x19159b);}(_0x7884,0x10d));var _0x4788=function(_0x29a5ca,_0x35103b){_0x29a5ca=_0x29a5ca-0x0;var _0x4af43f=_0x7884[_0x29a5ca];return _0x4af43f;};'use strict';var _=require(_0x4788('0x0'));var util=require(_0x4788('0x1'));var logger=require(_0x4788('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4788('0x3'));var rp=require(_0x4788('0x4'));var fs=require('fs');var path=require(_0x4788('0x5'));var rimraf=require(_0x4788('0x6'));var config=require(_0x4788('0x7'));var attributes=require('./chatApplication.attributes');module[_0x4788('0x8')]=function(_0x1227fe,_0xaf9370){return _0x1227fe[_0x4788('0x9')]('ChatApplication',attributes,{'tableName':_0x4788('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4788('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 8fe759f..7e61a84 100644
--- a/server/api/chatApplication/chatApplication.rpc.js
+++ b/server/api/chatApplication/chatApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x34f9=['moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x34f9,0x1cc));var _0x934f=function(_0x39be6d,_0x575466){_0x39be6d=_0x39be6d-0x0;var _0x3bea28=_0x34f9[_0x39be6d];return _0x3bea28;};'use strict';var _=require(_0x934f('0x0'));var util=require(_0x934f('0x1'));var moment=require(_0x934f('0x2'));var BPromise=require(_0x934f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x934f('0x4'));var db=require(_0x934f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x934f('0x6'));var config=require(_0x934f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x934f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x109356,_0xdc5484,_0x50b105){return new BPromise(function(_0x1f2acb,_0x5e6f14){return client['request'](_0x109356,_0x50b105)[_0x934f('0x9')](function(_0x26b4f7){logger[_0x934f('0xa')](_0x934f('0xb'),_0xdc5484,_0x934f('0xc'));logger[_0x934f('0xd')](_0x934f('0xe'),_0xdc5484,_0x934f('0xc'),JSON[_0x934f('0xf')](_0x26b4f7));if(_0x26b4f7[_0x934f('0x10')]){if(_0x26b4f7['error'][_0x934f('0x11')]===0x1f4){logger['error'](_0x934f('0xb'),_0xdc5484,_0x26b4f7[_0x934f('0x10')][_0x934f('0x12')]);return _0x5e6f14(_0x26b4f7[_0x934f('0x10')][_0x934f('0x12')]);}logger[_0x934f('0x10')](_0x934f('0xb'),_0xdc5484,_0x26b4f7[_0x934f('0x10')]['message']);return _0x1f2acb(_0x26b4f7['error'][_0x934f('0x12')]);}else{logger[_0x934f('0xa')]('ChatApplication,\x20%s,\x20%s',_0xdc5484,_0x934f('0xc'));_0x1f2acb(_0x26b4f7[_0x934f('0x13')][_0x934f('0x12')]);}})[_0x934f('0x14')](function(_0x258381){logger[_0x934f('0x10')](_0x934f('0xb'),_0xdc5484,_0x258381);_0x5e6f14(_0x258381);});});}
\ No newline at end of file
+var _0xe091=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x1e32b8,_0x1347a6){var _0x5ab379=function(_0x12b349){while(--_0x12b349){_0x1e32b8['push'](_0x1e32b8['shift']());}};_0x5ab379(++_0x1347a6);}(_0xe091,0xee));var _0x1e09=function(_0x472ad1,_0x5dbfef){_0x472ad1=_0x472ad1-0x0;var _0x416d54=_0xe091[_0x472ad1];return _0x416d54;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1e09('0x0'));var BPromise=require(_0x1e09('0x1'));var rs=require(_0x1e09('0x2'));var fs=require('fs');var Redis=require(_0x1e09('0x3'));var db=require(_0x1e09('0x4'))['db'];var utils=require(_0x1e09('0x5'));var logger=require('../../config/logger')(_0x1e09('0x6'));var config=require(_0x1e09('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1e09('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fed96,_0x3c1fdb,_0x189ae6){return new BPromise(function(_0x527da5,_0x191cce){return client[_0x1e09('0x9')](_0x3fed96,_0x189ae6)[_0x1e09('0xa')](function(_0xf42ebf){logger[_0x1e09('0xb')](_0x1e09('0xc'),_0x3c1fdb,_0x1e09('0xd'));logger[_0x1e09('0xe')](_0x1e09('0xf'),_0x3c1fdb,_0x1e09('0xd'),JSON[_0x1e09('0x10')](_0xf42ebf));if(_0xf42ebf['error']){if(_0xf42ebf[_0x1e09('0x11')][_0x1e09('0x12')]===0x1f4){logger[_0x1e09('0x11')](_0x1e09('0xc'),_0x3c1fdb,_0xf42ebf[_0x1e09('0x11')][_0x1e09('0x13')]);return _0x191cce(_0xf42ebf[_0x1e09('0x11')][_0x1e09('0x13')]);}logger[_0x1e09('0x11')](_0x1e09('0xc'),_0x3c1fdb,_0xf42ebf[_0x1e09('0x11')]['message']);return _0x527da5(_0xf42ebf['error']['message']);}else{logger[_0x1e09('0xb')](_0x1e09('0xc'),_0x3c1fdb,_0x1e09('0xd'));_0x527da5(_0xf42ebf['result'][_0x1e09('0x13')]);}})[_0x1e09('0x14')](function(_0xdd904b){logger[_0x1e09('0x11')](_0x1e09('0xc'),_0x3c1fdb,_0xdd904b);_0x191cce(_0xdd904b);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 89a6177..ce9504e 100644
--- a/server/api/chatApplication/index.js
+++ b/server/api/chatApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1269=['get','/:id','isAuthenticated','show','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x48e10a,_0x26461e){var _0x40d048=function(_0x1a9e61){while(--_0x1a9e61){_0x48e10a['push'](_0x48e10a['shift']());}};_0x40d048(++_0x26461e);}(_0x1269,0x1d7));var _0x9126=function(_0x516f52,_0x210b10){_0x516f52=_0x516f52-0x0;var _0x5d06db=_0x1269[_0x516f52];return _0x5d06db;};'use strict';var multer=require(_0x9126('0x0'));var util=require('util');var path=require(_0x9126('0x1'));var timeout=require(_0x9126('0x2'));var express=require(_0x9126('0x3'));var router=express[_0x9126('0x4')]();var fs_extra=require(_0x9126('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9126('0x6'));var config=require(_0x9126('0x7'));var controller=require(_0x9126('0x8'));router[_0x9126('0x9')](_0x9126('0xa'),auth[_0x9126('0xb')](),controller[_0x9126('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9126('0xd')]);router['delete'](_0x9126('0xa'),auth['isAuthenticated'](),controller[_0x9126('0xe')]);module[_0x9126('0xf')]=router;
\ No newline at end of file
+var _0x9deb=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','update'];(function(_0x2c98a0,_0x49f71c){var _0x4e58ac=function(_0x41b3d9){while(--_0x41b3d9){_0x2c98a0['push'](_0x2c98a0['shift']());}};_0x4e58ac(++_0x49f71c);}(_0x9deb,0x18f));var _0xb9de=function(_0x3d951d,_0x1a1aa5){_0x3d951d=_0x3d951d-0x0;var _0x2fa9bf=_0x9deb[_0x3d951d];return _0x2fa9bf;};'use strict';var multer=require(_0xb9de('0x0'));var util=require(_0xb9de('0x1'));var path=require(_0xb9de('0x2'));var timeout=require(_0xb9de('0x3'));var express=require(_0xb9de('0x4'));var router=express[_0xb9de('0x5')]();var fs_extra=require(_0xb9de('0x6'));var auth=require(_0xb9de('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb9de('0x8'));var controller=require(_0xb9de('0x9'));router[_0xb9de('0xa')](_0xb9de('0xb'),auth[_0xb9de('0xc')](),controller[_0xb9de('0xd')]);router['put']('/:id',auth[_0xb9de('0xc')](),controller[_0xb9de('0xe')]);router[_0xb9de('0xf')](_0xb9de('0xb'),auth['isAuthenticated'](),controller[_0xb9de('0x10')]);module[_0xb9de('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 51edb36..9f9bb53 100644
--- a/server/api/chatGroup/chatGroup.attributes.js
+++ b/server/api/chatGroup/chatGroup.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x377e=['BOOLEAN','sequelize'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0x377e,0x1e9));var _0xe377=function(_0x2fc2e4,_0xf15e31){_0x2fc2e4=_0x2fc2e4-0x0;var _0x21d7b3=_0x377e[_0x2fc2e4];return _0x21d7b3;};'use strict';var Sequelize=require(_0xe377('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xe377('0x1')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x16b9=['BOOLEAN','exports','STRING'];(function(_0x34afc1,_0x3dd494){var _0x496f9c=function(_0x4ec5ea){while(--_0x4ec5ea){_0x34afc1['push'](_0x34afc1['shift']());}};_0x496f9c(++_0x3dd494);}(_0x16b9,0xf1));var _0x916b=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x16b9[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require('sequelize');module[_0x916b('0x0')]={'name':{'type':Sequelize[_0x916b('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x916b('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index ea3656b..1c45e6a 100644
--- a/server/api/chatGroup/chatGroup.controller.js
+++ b/server/api/chatGroup/chatGroup.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2e50=['show','params','rawAttributes','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','findOne','getMembers','removeMembers','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./chatGroup.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','stack','name','send','index','ChatGroup','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows'];(function(_0x15f724,_0x2794ef){var _0x49b152=function(_0x561b35){while(--_0x561b35){_0x15f724['push'](_0x15f724['shift']());}};_0x49b152(++_0x2794ef);}(_0x2e50,0x192));var _0x02e5=function(_0x27d10a,_0x35ff44){_0x27d10a=_0x27d10a-0x0;var _0x63302e=_0x2e50[_0x27d10a];return _0x63302e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02e5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x02e5('0x1'));var rp=require(_0x02e5('0x2'));var moment=require('moment');var BPromise=require(_0x02e5('0x3'));var Mustache=require(_0x02e5('0x4'));var util=require(_0x02e5('0x5'));var path=require(_0x02e5('0x6'));var sox=require(_0x02e5('0x7'));var csv=require(_0x02e5('0x8'));var ejs=require(_0x02e5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02e5('0xa'));var squel=require('squel');var crypto=require(_0x02e5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x02e5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x02e5('0xd'));var Papa=require(_0x02e5('0xe'));var Redis=require(_0x02e5('0xf'));var authService=require(_0x02e5('0x10'));var qs=require(_0x02e5('0x11'));var as=require(_0x02e5('0x12'));var hardwareService=require(_0x02e5('0x13'));var logger=require(_0x02e5('0x14'))(_0x02e5('0x15'));var utils=require(_0x02e5('0x16'));var config=require(_0x02e5('0x17'));var licenseUtil=require(_0x02e5('0x18'));var db=require(_0x02e5('0x19'))['db'];config['redis']=_['defaults'](config[_0x02e5('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02e5('0x1a')]));require(_0x02e5('0x1b'))[_0x02e5('0x1c')](socket);function respondWithStatusCode(_0x322419,_0x3ce1fd){_0x3ce1fd=_0x3ce1fd||0xcc;return function(_0x1ee7f6){if(_0x1ee7f6){return _0x322419[_0x02e5('0x1d')](_0x3ce1fd);}return _0x322419['status'](_0x3ce1fd)[_0x02e5('0x1e')]();};}function respondWithResult(_0x5b82dd,_0x5c6ee3){_0x5c6ee3=_0x5c6ee3||0xc8;return function(_0x46134b){if(_0x46134b){return _0x5b82dd[_0x02e5('0x1f')](_0x5c6ee3)['json'](_0x46134b);}};}function respondWithFilteredResult(_0x55710a,_0x43e706){return function(_0x1c3fd0){if(_0x1c3fd0){var _0x2829f0=typeof _0x43e706[_0x02e5('0x20')]===_0x02e5('0x21')&&typeof _0x43e706[_0x02e5('0x22')]===_0x02e5('0x21');var _0x128405=_0x1c3fd0[_0x02e5('0x23')];var _0x572bef=_0x2829f0?0x0:_0x43e706[_0x02e5('0x20')];var _0x23892e=_0x2829f0?_0x1c3fd0['count']:_0x43e706[_0x02e5('0x20')]+_0x43e706['limit'];var _0x104293;if(_0x23892e>=_0x128405){_0x23892e=_0x128405;_0x104293=0xc8;}else{_0x104293=0xce;}_0x55710a[_0x02e5('0x1f')](_0x104293);return _0x55710a[_0x02e5('0x24')](_0x02e5('0x25'),_0x572bef+'-'+_0x23892e+'/'+_0x128405)[_0x02e5('0x26')](_0x1c3fd0);}return null;};}function patchUpdates(_0x487831){return function(_0x3b0716){try{jsonpatch[_0x02e5('0x27')](_0x3b0716,_0x487831,!![]);}catch(_0x45e42b){return BPromise[_0x02e5('0x28')](_0x45e42b);}return _0x3b0716['save']();};}function saveUpdates(_0x1c6977,_0x527acc){return function(_0x32a44c){if(_0x32a44c){return _0x32a44c['update'](_0x1c6977)[_0x02e5('0x29')](function(_0x2b0700){return _0x2b0700;});}return null;};}function removeEntity(_0x317985,_0x428ec3){return function(_0x111981){if(_0x111981){return _0x111981[_0x02e5('0x2a')]()[_0x02e5('0x29')](function(){_0x317985['status'](0xcc)[_0x02e5('0x1e')]();});}};}function handleEntityNotFound(_0x225357,_0x55e7c7){return function(_0x14c022){if(!_0x14c022){_0x225357[_0x02e5('0x1d')](0x194);}return _0x14c022;};}function handleError(_0x219c5b,_0x48e19e){_0x48e19e=_0x48e19e||0x1f4;return function(_0x499e66){logger['error'](_0x499e66[_0x02e5('0x2b')]);if(_0x499e66[_0x02e5('0x2c')]){delete _0x499e66[_0x02e5('0x2c')];}_0x219c5b[_0x02e5('0x1f')](_0x48e19e)[_0x02e5('0x2d')](_0x499e66);};}exports[_0x02e5('0x2e')]=function(_0x11e6a0,_0x29e5e6){var _0x61f33c={},_0x361d47={},_0x54ad0b={'count':0x0,'rows':[]};var _0x14ec2c=_['map'](db[_0x02e5('0x2f')]['rawAttributes'],function(_0x4c46e2){return{'name':_0x4c46e2['fieldName'],'type':_0x4c46e2[_0x02e5('0x30')][_0x02e5('0x31')]};});_0x361d47[_0x02e5('0x32')]=_[_0x02e5('0x33')](_0x14ec2c,_0x02e5('0x2c'));_0x361d47[_0x02e5('0x34')]=_[_0x02e5('0x35')](_0x11e6a0['query']);_0x361d47[_0x02e5('0x36')]=_[_0x02e5('0x37')](_0x361d47[_0x02e5('0x32')],_0x361d47[_0x02e5('0x34')]);_0x61f33c[_0x02e5('0x38')]=_[_0x02e5('0x37')](_0x361d47[_0x02e5('0x32')],qs[_0x02e5('0x39')](_0x11e6a0[_0x02e5('0x34')][_0x02e5('0x39')]));_0x61f33c[_0x02e5('0x38')]=_0x61f33c[_0x02e5('0x38')][_0x02e5('0x3a')]?_0x61f33c['attributes']:_0x361d47['model'];if(!_0x11e6a0[_0x02e5('0x34')][_0x02e5('0x3b')](_0x02e5('0x3c'))){_0x61f33c[_0x02e5('0x22')]=qs['limit'](_0x11e6a0[_0x02e5('0x34')][_0x02e5('0x22')]);_0x61f33c[_0x02e5('0x20')]=qs[_0x02e5('0x20')](_0x11e6a0[_0x02e5('0x34')][_0x02e5('0x20')]);}_0x61f33c[_0x02e5('0x3d')]=qs[_0x02e5('0x3e')](_0x11e6a0['query'][_0x02e5('0x3e')]);_0x61f33c[_0x02e5('0x3f')]=qs[_0x02e5('0x36')](_[_0x02e5('0x40')](_0x11e6a0[_0x02e5('0x34')],_0x361d47[_0x02e5('0x36')]),_0x14ec2c);if(_0x11e6a0[_0x02e5('0x34')]['filter']){_0x61f33c[_0x02e5('0x3f')]=_[_0x02e5('0x41')](_0x61f33c[_0x02e5('0x3f')],{'$or':_['map'](_0x14ec2c,function(_0x4c9de3){if(_0x4c9de3[_0x02e5('0x30')]!==_0x02e5('0x42')){var _0x1a80d0={};_0x1a80d0[_0x4c9de3['name']]={'$like':'%'+_0x11e6a0[_0x02e5('0x34')][_0x02e5('0x43')]+'%'};return _0x1a80d0;}})});}_0x61f33c=_[_0x02e5('0x41')]({},_0x61f33c,_0x11e6a0[_0x02e5('0x44')]);var _0x58c208={'where':_0x61f33c[_0x02e5('0x3f')]};return db[_0x02e5('0x2f')][_0x02e5('0x23')](_0x58c208)['then'](function(_0x176ae7){_0x54ad0b[_0x02e5('0x23')]=_0x176ae7;if(_0x11e6a0['query'][_0x02e5('0x45')]){_0x61f33c[_0x02e5('0x46')]=[{'all':!![]}];}return db[_0x02e5('0x2f')][_0x02e5('0x47')](_0x61f33c);})[_0x02e5('0x29')](function(_0x1e0a64){_0x54ad0b[_0x02e5('0x48')]=_0x1e0a64;return _0x54ad0b;})[_0x02e5('0x29')](respondWithFilteredResult(_0x29e5e6,_0x61f33c))['catch'](handleError(_0x29e5e6,null));};exports[_0x02e5('0x49')]=function(_0x2272a2,_0x280a4b){var _0x3e2570={'raw':!![],'where':{'id':_0x2272a2[_0x02e5('0x4a')]['id']}},_0x2e2c5a={};_0x2e2c5a[_0x02e5('0x32')]=_[_0x02e5('0x35')](db[_0x02e5('0x2f')][_0x02e5('0x4b')]);_0x2e2c5a[_0x02e5('0x34')]=_[_0x02e5('0x35')](_0x2272a2[_0x02e5('0x34')]);_0x2e2c5a[_0x02e5('0x36')]=_[_0x02e5('0x37')](_0x2e2c5a[_0x02e5('0x32')],_0x2e2c5a[_0x02e5('0x34')]);_0x3e2570[_0x02e5('0x38')]=_[_0x02e5('0x37')](_0x2e2c5a[_0x02e5('0x32')],qs[_0x02e5('0x39')](_0x2272a2['query']['fields']));_0x3e2570[_0x02e5('0x38')]=_0x3e2570[_0x02e5('0x38')]['length']?_0x3e2570[_0x02e5('0x38')]:_0x2e2c5a[_0x02e5('0x32')];if(_0x2272a2[_0x02e5('0x34')][_0x02e5('0x45')]){_0x3e2570['include']=[{'all':!![]}];}_0x3e2570=_[_0x02e5('0x41')]({},_0x3e2570,_0x2272a2[_0x02e5('0x44')]);return db[_0x02e5('0x2f')][_0x02e5('0x4c')](_0x3e2570)[_0x02e5('0x29')](handleEntityNotFound(_0x280a4b,null))[_0x02e5('0x29')](respondWithResult(_0x280a4b,null))[_0x02e5('0x4d')](handleError(_0x280a4b,null));};exports[_0x02e5('0x4e')]=function(_0x5ee6c8,_0x3aa169){return db['ChatGroup'][_0x02e5('0x4e')](_0x5ee6c8[_0x02e5('0x4f')],{})[_0x02e5('0x29')](respondWithResult(_0x3aa169,0xc9))[_0x02e5('0x4d')](handleError(_0x3aa169,null));};exports['update']=function(_0x1c5428,_0x39c894){if(_0x1c5428[_0x02e5('0x4f')]['id']){delete _0x1c5428['body']['id'];}return db[_0x02e5('0x2f')][_0x02e5('0x4c')]({'where':{'id':_0x1c5428[_0x02e5('0x4a')]['id']}})[_0x02e5('0x29')](handleEntityNotFound(_0x39c894,null))['then'](saveUpdates(_0x1c5428[_0x02e5('0x4f')],null))[_0x02e5('0x29')](respondWithResult(_0x39c894,null))[_0x02e5('0x4d')](handleError(_0x39c894,null));};exports['destroy']=function(_0x593e50,_0x11b21c){return db[_0x02e5('0x2f')][_0x02e5('0x4c')]({'where':{'id':_0x593e50['params']['id']}})['then'](handleEntityNotFound(_0x11b21c,null))['then'](removeEntity(_0x11b21c,null))[_0x02e5('0x4d')](handleError(_0x11b21c,null));};exports[_0x02e5('0x50')]=function(_0x1906fe,_0x34e6c9){return db[_0x02e5('0x2f')]['describe']()['then'](respondWithResult(_0x34e6c9,null))[_0x02e5('0x4d')](handleError(_0x34e6c9,null));};exports[_0x02e5('0x51')]=function(_0x1dc034,_0xfb80bb,_0x30a928){return db[_0x02e5('0x52')]['count']({'where':{'ChatGroupId':_0x1dc034['params']['id'],'ToId':_0x1dc034[_0x02e5('0x53')]['id'],'read':![]}})['then'](function(_0xe089a0){return{'id':_[_0x02e5('0x54')](_0x1dc034[_0x02e5('0x4a')]['id']),'count':_0xe089a0};})[_0x02e5('0x29')](respondWithResult(_0xfb80bb,null))['catch'](handleError(_0xfb80bb,null));};exports[_0x02e5('0x55')]=function(_0x1a2688,_0x23ec58,_0x33300d){return db['ChatGroup'][_0x02e5('0x4c')]({'where':{'id':_0x1a2688['params']['id']}})['then'](handleEntityNotFound(_0x23ec58,null))[_0x02e5('0x29')](function(_0x12cd0d){if(_0x12cd0d){return _0x12cd0d['addMembers'](_0x1a2688[_0x02e5('0x4f')][_0x02e5('0x56')],_['omit'](_0x1a2688[_0x02e5('0x4f')],[_0x02e5('0x56'),'id'])||{});}})[_0x02e5('0x29')](respondWithResult(_0x23ec58,null))[_0x02e5('0x4d')](handleError(_0x23ec58,null));};exports['getMembers']=function(_0x5138ab,_0x1aa671,_0x124e36){var _0x247fed={};var _0x28c532={};var _0x8dccab;var _0x43b0a4;return db[_0x02e5('0x2f')][_0x02e5('0x57')]({'where':{'id':_0x5138ab[_0x02e5('0x4a')]['id']}})[_0x02e5('0x29')](handleEntityNotFound(_0x1aa671,null))[_0x02e5('0x29')](function(_0x56d80b){if(_0x56d80b){_0x8dccab=_0x56d80b;_0x28c532[_0x02e5('0x32')]=_[_0x02e5('0x35')](db['User'][_0x02e5('0x4b')]);_0x28c532[_0x02e5('0x34')]=_[_0x02e5('0x35')](_0x5138ab[_0x02e5('0x34')]);_0x28c532[_0x02e5('0x36')]=_['intersection'](_0x28c532[_0x02e5('0x32')],_0x28c532[_0x02e5('0x34')]);_0x247fed[_0x02e5('0x38')]=_['intersection'](_0x28c532['model'],qs[_0x02e5('0x39')](_0x5138ab['query'][_0x02e5('0x39')]));_0x247fed[_0x02e5('0x38')]=_0x247fed[_0x02e5('0x38')][_0x02e5('0x3a')]?_0x247fed[_0x02e5('0x38')]:_0x28c532['model'];_0x247fed[_0x02e5('0x3d')]=qs[_0x02e5('0x3e')](_0x5138ab[_0x02e5('0x34')][_0x02e5('0x3e')]);_0x247fed[_0x02e5('0x3f')]=qs[_0x02e5('0x36')](_['pick'](_0x5138ab[_0x02e5('0x34')],_0x28c532['filters']));if(_0x5138ab[_0x02e5('0x34')][_0x02e5('0x43')]){_0x247fed['where']=_[_0x02e5('0x41')](_0x247fed[_0x02e5('0x3f')],{'$or':_[_0x02e5('0x33')](_0x247fed[_0x02e5('0x38')],function(_0xa9c44a){var _0x54e755={};_0x54e755[_0xa9c44a]={'$like':'%'+_0x5138ab[_0x02e5('0x34')][_0x02e5('0x43')]+'%'};return _0x54e755;})});}_0x247fed=_[_0x02e5('0x41')]({},_0x247fed,_0x5138ab[_0x02e5('0x44')]);return _0x8dccab[_0x02e5('0x58')](_0x247fed);}})[_0x02e5('0x29')](function(_0x13919a){if(_0x13919a){_0x43b0a4=_0x13919a[_0x02e5('0x3a')];if(!_0x5138ab['query']['hasOwnProperty'](_0x02e5('0x3c'))){_0x247fed[_0x02e5('0x22')]=qs[_0x02e5('0x22')](_0x5138ab[_0x02e5('0x34')][_0x02e5('0x22')]);_0x247fed['offset']=qs[_0x02e5('0x20')](_0x5138ab[_0x02e5('0x34')]['offset']);}return _0x8dccab[_0x02e5('0x58')](_0x247fed);}})[_0x02e5('0x29')](function(_0x50da90){if(_0x50da90){return _0x50da90?{'count':_0x43b0a4,'rows':_0x50da90}:null;}})['then'](respondWithResult(_0x1aa671,null))[_0x02e5('0x4d')](handleError(_0x1aa671,null));};exports[_0x02e5('0x59')]=function(_0x511ebb,_0x4d66a8,_0x71ed2b){return db[_0x02e5('0x2f')][_0x02e5('0x4c')]({'where':{'id':_0x511ebb[_0x02e5('0x4a')]['id']}})[_0x02e5('0x29')](handleEntityNotFound(_0x4d66a8,null))[_0x02e5('0x29')](function(_0x4c08a2){if(_0x4c08a2){return _0x4c08a2[_0x02e5('0x59')](_0x511ebb[_0x02e5('0x34')][_0x02e5('0x56')]);}})[_0x02e5('0x29')](respondWithStatusCode(_0x4d66a8,null))[_0x02e5('0x4d')](handleError(_0x4d66a8,null));};exports['addMessage']=function(_0x43994a,_0x4ebf70,_0x27fcd4){if(_0x43994a[_0x02e5('0x4f')]['id']){delete _0x43994a[_0x02e5('0x4f')]['id'];}return db[_0x02e5('0x2f')][_0x02e5('0x4c')]({'where':{'id':_0x43994a[_0x02e5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ebf70,null))[_0x02e5('0x29')](function(_0x344912){if(_0x344912){_0x43994a['body']['ChatGroupId']=_0x344912['id'];return db[_0x02e5('0x52')][_0x02e5('0x4e')](_0x43994a[_0x02e5('0x4f')]);}})[_0x02e5('0x29')](respondWithResult(_0x4ebf70,null))[_0x02e5('0x4d')](handleError(_0x4ebf70,null));};exports['getMessages']=function(_0x3e85f3,_0x148a46,_0x139a39){var _0x4d3276={};var _0x29b7f4={};var _0x4a24d6;var _0x51460b;return db['ChatGroup']['findOne']({'where':{'id':_0x3e85f3[_0x02e5('0x4a')]['id']}})[_0x02e5('0x29')](handleEntityNotFound(_0x148a46,null))['then'](function(_0x256b13){if(_0x256b13){_0x4a24d6=_0x256b13;_0x29b7f4[_0x02e5('0x32')]=_[_0x02e5('0x35')](db['ChatInternalMessage'][_0x02e5('0x4b')]);_0x29b7f4['query']=_[_0x02e5('0x35')](_0x3e85f3[_0x02e5('0x34')]);_0x29b7f4[_0x02e5('0x36')]=_[_0x02e5('0x37')](_0x29b7f4[_0x02e5('0x32')],_0x29b7f4['query']);_0x4d3276[_0x02e5('0x38')]=_['intersection'](_0x29b7f4[_0x02e5('0x32')],qs[_0x02e5('0x39')](_0x3e85f3[_0x02e5('0x34')][_0x02e5('0x39')]));_0x4d3276[_0x02e5('0x38')]=_0x4d3276['attributes'][_0x02e5('0x3a')]?_0x4d3276[_0x02e5('0x38')]:_0x29b7f4[_0x02e5('0x32')];_0x4d3276[_0x02e5('0x3d')]=qs[_0x02e5('0x3e')](_0x3e85f3['query'][_0x02e5('0x3e')]);_0x4d3276[_0x02e5('0x3f')]=qs[_0x02e5('0x36')](_[_0x02e5('0x40')](_0x3e85f3['query'],_0x29b7f4[_0x02e5('0x36')]));if(_0x3e85f3[_0x02e5('0x34')]['filter']){_0x4d3276['where']=_['merge'](_0x4d3276['where'],{'$or':_['map'](_0x4d3276[_0x02e5('0x38')],function(_0x3467c7){var _0x279815={};_0x279815[_0x3467c7]={'$like':'%'+_0x3e85f3[_0x02e5('0x34')][_0x02e5('0x43')]+'%'};return _0x279815;})});}if(_0x3e85f3[_0x02e5('0x34')][_0x02e5('0x5a')]){var _0xda2f2e=_0x3e85f3[_0x02e5('0x34')]['$gte'][_0x02e5('0x5b')](',');var _0x128d32={};_0x128d32[_0xda2f2e[0x0]]={'$gte':moment(_0xda2f2e[0x1])[_0x02e5('0x5c')](_0x02e5('0x5d'))};_0x4d3276[_0x02e5('0x3f')]=_[_0x02e5('0x41')](_0x4d3276[_0x02e5('0x3f')],_0x128d32);}_0x4d3276=_[_0x02e5('0x41')]({},_0x4d3276,_0x3e85f3[_0x02e5('0x44')]);return _0x4a24d6[_0x02e5('0x5e')](_0x4d3276);}})[_0x02e5('0x29')](function(_0x4addcd){if(_0x4addcd){_0x51460b=_0x4addcd[_0x02e5('0x3a')];if(!_0x3e85f3['query'][_0x02e5('0x3b')](_0x02e5('0x3c'))){_0x4d3276[_0x02e5('0x22')]=qs['limit'](_0x3e85f3['query']['limit']);_0x4d3276[_0x02e5('0x20')]=qs[_0x02e5('0x20')](_0x3e85f3[_0x02e5('0x34')]['offset']);}return _0x4a24d6[_0x02e5('0x5e')](_0x4d3276);}})[_0x02e5('0x29')](function(_0x4bbeb0){if(_0x4bbeb0){return _0x4bbeb0?{'count':_0x51460b,'rows':_0x4bbeb0}:null;}})['then'](respondWithResult(_0x148a46,null))['catch'](handleError(_0x148a46,null));};
\ No newline at end of file
+var _0xc210=['removeMembers','ChatGroupId','ChatInternalMessage','getMessages','findOne','$gte','split','format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','localhost','redis','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','destroy','then','end','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','update','describe','user','toInteger','addMembers','omit','ids','getMembers','hasOwnProperty'];(function(_0x52f03d,_0x438fa1){var _0x3fdf30=function(_0x5e61bd){while(--_0x5e61bd){_0x52f03d['push'](_0x52f03d['shift']());}};_0x3fdf30(++_0x438fa1);}(_0xc210,0x1e8));var _0x0c21=function(_0x17fd65,_0x556d01){_0x17fd65=_0x17fd65-0x0;var _0x27d033=_0xc210[_0x17fd65];return _0x27d033;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c21('0x0'));var zipdir=require(_0x0c21('0x1'));var jsonpatch=require(_0x0c21('0x2'));var rp=require(_0x0c21('0x3'));var moment=require('moment');var BPromise=require(_0x0c21('0x4'));var Mustache=require(_0x0c21('0x5'));var util=require(_0x0c21('0x6'));var path=require(_0x0c21('0x7'));var sox=require('sox');var csv=require(_0x0c21('0x8'));var ejs=require(_0x0c21('0x9'));var fs=require('fs');var fs_extra=require(_0x0c21('0xa'));var _=require('lodash');var squel=require(_0x0c21('0xb'));var crypto=require(_0x0c21('0xc'));var jsforce=require(_0x0c21('0xd'));var deskjs=require(_0x0c21('0xe'));var toCsv=require(_0x0c21('0x8'));var querystring=require(_0x0c21('0xf'));var Papa=require(_0x0c21('0x10'));var Redis=require(_0x0c21('0x11'));var authService=require(_0x0c21('0x12'));var qs=require(_0x0c21('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c21('0x14'));var logger=require(_0x0c21('0x15'))(_0x0c21('0x16'));var utils=require(_0x0c21('0x17'));var config=require(_0x0c21('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c21('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x0c21('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c21('0x1b')]));require(_0x0c21('0x1c'))[_0x0c21('0x1d')](socket);function respondWithStatusCode(_0x1a4e48,_0xdf3079){_0xdf3079=_0xdf3079||0xcc;return function(_0x5ebd29){if(_0x5ebd29){return _0x1a4e48[_0x0c21('0x1e')](_0xdf3079);}return _0x1a4e48[_0x0c21('0x1f')](_0xdf3079)['end']();};}function respondWithResult(_0x3b759f,_0x282f69){_0x282f69=_0x282f69||0xc8;return function(_0x56adfb){if(_0x56adfb){return _0x3b759f[_0x0c21('0x1f')](_0x282f69)[_0x0c21('0x20')](_0x56adfb);}};}function respondWithFilteredResult(_0x4ba416,_0x348989){return function(_0x411f4a){if(_0x411f4a){var _0x214fc8=typeof _0x348989[_0x0c21('0x21')]==='undefined'&&typeof _0x348989['limit']===_0x0c21('0x22');var _0xff65a=_0x411f4a[_0x0c21('0x23')];var _0x374b74=_0x214fc8?0x0:_0x348989[_0x0c21('0x21')];var _0x1a91b6=_0x214fc8?_0x411f4a[_0x0c21('0x23')]:_0x348989[_0x0c21('0x21')]+_0x348989[_0x0c21('0x24')];var _0x4cb6dd;if(_0x1a91b6>=_0xff65a){_0x1a91b6=_0xff65a;_0x4cb6dd=0xc8;}else{_0x4cb6dd=0xce;}_0x4ba416['status'](_0x4cb6dd);return _0x4ba416['set'](_0x0c21('0x25'),_0x374b74+'-'+_0x1a91b6+'/'+_0xff65a)['json'](_0x411f4a);}return null;};}function patchUpdates(_0x29fd87){return function(_0x582329){try{jsonpatch[_0x0c21('0x26')](_0x582329,_0x29fd87,!![]);}catch(_0x1d677d){return BPromise['reject'](_0x1d677d);}return _0x582329[_0x0c21('0x27')]();};}function saveUpdates(_0x349315,_0x38f74d){return function(_0x4ec5a6){if(_0x4ec5a6){return _0x4ec5a6['update'](_0x349315)['then'](function(_0x2be73a){return _0x2be73a;});}return null;};}function removeEntity(_0x5acc85,_0x37cafa){return function(_0x2c3848){if(_0x2c3848){return _0x2c3848[_0x0c21('0x28')]()[_0x0c21('0x29')](function(){_0x5acc85['status'](0xcc)[_0x0c21('0x2a')]();});}};}function handleEntityNotFound(_0x3bf181,_0x11f57d){return function(_0x4fd3cf){if(!_0x4fd3cf){_0x3bf181['sendStatus'](0x194);}return _0x4fd3cf;};}function handleError(_0x3cf7a0,_0x5d5bbd){_0x5d5bbd=_0x5d5bbd||0x1f4;return function(_0xb0ed8){logger['error'](_0xb0ed8[_0x0c21('0x2b')]);if(_0xb0ed8[_0x0c21('0x2c')]){delete _0xb0ed8[_0x0c21('0x2c')];}_0x3cf7a0[_0x0c21('0x1f')](_0x5d5bbd)[_0x0c21('0x2d')](_0xb0ed8);};}exports[_0x0c21('0x2e')]=function(_0x5eb5ed,_0x3b45e4){var _0x368953={},_0x1c18dc={},_0x1ad553={'count':0x0,'rows':[]};var _0x44d32a=_[_0x0c21('0x2f')](db[_0x0c21('0x30')][_0x0c21('0x31')],function(_0x5d1d52){return{'name':_0x5d1d52[_0x0c21('0x32')],'type':_0x5d1d52['type'][_0x0c21('0x33')]};});_0x1c18dc[_0x0c21('0x34')]=_[_0x0c21('0x2f')](_0x44d32a,'name');_0x1c18dc[_0x0c21('0x35')]=_[_0x0c21('0x36')](_0x5eb5ed[_0x0c21('0x35')]);_0x1c18dc[_0x0c21('0x37')]=_[_0x0c21('0x38')](_0x1c18dc[_0x0c21('0x34')],_0x1c18dc[_0x0c21('0x35')]);_0x368953[_0x0c21('0x39')]=_[_0x0c21('0x38')](_0x1c18dc[_0x0c21('0x34')],qs[_0x0c21('0x3a')](_0x5eb5ed[_0x0c21('0x35')]['fields']));_0x368953[_0x0c21('0x39')]=_0x368953[_0x0c21('0x39')][_0x0c21('0x3b')]?_0x368953['attributes']:_0x1c18dc[_0x0c21('0x34')];if(!_0x5eb5ed[_0x0c21('0x35')]['hasOwnProperty'](_0x0c21('0x3c'))){_0x368953[_0x0c21('0x24')]=qs[_0x0c21('0x24')](_0x5eb5ed['query'][_0x0c21('0x24')]);_0x368953['offset']=qs['offset'](_0x5eb5ed['query']['offset']);}_0x368953[_0x0c21('0x3d')]=qs['sort'](_0x5eb5ed[_0x0c21('0x35')][_0x0c21('0x3e')]);_0x368953[_0x0c21('0x3f')]=qs[_0x0c21('0x37')](_[_0x0c21('0x40')](_0x5eb5ed[_0x0c21('0x35')],_0x1c18dc['filters']),_0x44d32a);if(_0x5eb5ed[_0x0c21('0x35')][_0x0c21('0x41')]){_0x368953[_0x0c21('0x3f')]=_[_0x0c21('0x42')](_0x368953['where'],{'$or':_[_0x0c21('0x2f')](_0x44d32a,function(_0x351566){if(_0x351566[_0x0c21('0x43')]!==_0x0c21('0x44')){var _0x20ff91={};_0x20ff91[_0x351566[_0x0c21('0x2c')]]={'$like':'%'+_0x5eb5ed[_0x0c21('0x35')][_0x0c21('0x41')]+'%'};return _0x20ff91;}})});}_0x368953=_[_0x0c21('0x42')]({},_0x368953,_0x5eb5ed[_0x0c21('0x45')]);var _0x418617={'where':_0x368953[_0x0c21('0x3f')]};return db[_0x0c21('0x30')][_0x0c21('0x23')](_0x418617)['then'](function(_0x54e137){_0x1ad553['count']=_0x54e137;if(_0x5eb5ed[_0x0c21('0x35')][_0x0c21('0x46')]){_0x368953['include']=[{'all':!![]}];}return db[_0x0c21('0x30')][_0x0c21('0x47')](_0x368953);})['then'](function(_0x24030f){_0x1ad553[_0x0c21('0x48')]=_0x24030f;return _0x1ad553;})['then'](respondWithFilteredResult(_0x3b45e4,_0x368953))[_0x0c21('0x49')](handleError(_0x3b45e4,null));};exports[_0x0c21('0x4a')]=function(_0x3c4e6a,_0x1a67e7){var _0x91505d={'raw':!![],'where':{'id':_0x3c4e6a[_0x0c21('0x4b')]['id']}},_0x4ba039={};_0x4ba039['model']=_[_0x0c21('0x36')](db['ChatGroup'][_0x0c21('0x31')]);_0x4ba039[_0x0c21('0x35')]=_['keys'](_0x3c4e6a[_0x0c21('0x35')]);_0x4ba039['filters']=_[_0x0c21('0x38')](_0x4ba039[_0x0c21('0x34')],_0x4ba039[_0x0c21('0x35')]);_0x91505d[_0x0c21('0x39')]=_[_0x0c21('0x38')](_0x4ba039['model'],qs[_0x0c21('0x3a')](_0x3c4e6a[_0x0c21('0x35')][_0x0c21('0x3a')]));_0x91505d[_0x0c21('0x39')]=_0x91505d[_0x0c21('0x39')][_0x0c21('0x3b')]?_0x91505d['attributes']:_0x4ba039[_0x0c21('0x34')];if(_0x3c4e6a[_0x0c21('0x35')][_0x0c21('0x46')]){_0x91505d['include']=[{'all':!![]}];}_0x91505d=_[_0x0c21('0x42')]({},_0x91505d,_0x3c4e6a[_0x0c21('0x45')]);return db[_0x0c21('0x30')][_0x0c21('0x4c')](_0x91505d)[_0x0c21('0x29')](handleEntityNotFound(_0x1a67e7,null))[_0x0c21('0x29')](respondWithResult(_0x1a67e7,null))[_0x0c21('0x49')](handleError(_0x1a67e7,null));};exports[_0x0c21('0x4d')]=function(_0x1b23ea,_0x4b1f66){return db[_0x0c21('0x30')]['create'](_0x1b23ea[_0x0c21('0x4e')],{})[_0x0c21('0x29')](respondWithResult(_0x4b1f66,0xc9))[_0x0c21('0x49')](handleError(_0x4b1f66,null));};exports[_0x0c21('0x4f')]=function(_0x6275ca,_0x195dbe){if(_0x6275ca['body']['id']){delete _0x6275ca[_0x0c21('0x4e')]['id'];}return db[_0x0c21('0x30')][_0x0c21('0x4c')]({'where':{'id':_0x6275ca[_0x0c21('0x4b')]['id']}})[_0x0c21('0x29')](handleEntityNotFound(_0x195dbe,null))[_0x0c21('0x29')](saveUpdates(_0x6275ca[_0x0c21('0x4e')],null))['then'](respondWithResult(_0x195dbe,null))[_0x0c21('0x49')](handleError(_0x195dbe,null));};exports[_0x0c21('0x28')]=function(_0x141613,_0xcc86f6){return db[_0x0c21('0x30')][_0x0c21('0x4c')]({'where':{'id':_0x141613[_0x0c21('0x4b')]['id']}})[_0x0c21('0x29')](handleEntityNotFound(_0xcc86f6,null))[_0x0c21('0x29')](removeEntity(_0xcc86f6,null))[_0x0c21('0x49')](handleError(_0xcc86f6,null));};exports[_0x0c21('0x50')]=function(_0x1e6827,_0x3eeecd){return db['ChatGroup'][_0x0c21('0x50')]()[_0x0c21('0x29')](respondWithResult(_0x3eeecd,null))[_0x0c21('0x49')](handleError(_0x3eeecd,null));};exports['getUnread']=function(_0x239456,_0x267b11,_0x129070){return db['ChatInternalMessage'][_0x0c21('0x23')]({'where':{'ChatGroupId':_0x239456[_0x0c21('0x4b')]['id'],'ToId':_0x239456[_0x0c21('0x51')]['id'],'read':![]}})[_0x0c21('0x29')](function(_0x1543b0){return{'id':_[_0x0c21('0x52')](_0x239456[_0x0c21('0x4b')]['id']),'count':_0x1543b0};})[_0x0c21('0x29')](respondWithResult(_0x267b11,null))['catch'](handleError(_0x267b11,null));};exports[_0x0c21('0x53')]=function(_0x378598,_0x598376,_0x1a3d1a){return db[_0x0c21('0x30')][_0x0c21('0x4c')]({'where':{'id':_0x378598[_0x0c21('0x4b')]['id']}})['then'](handleEntityNotFound(_0x598376,null))[_0x0c21('0x29')](function(_0x243674){if(_0x243674){return _0x243674[_0x0c21('0x53')](_0x378598[_0x0c21('0x4e')]['ids'],_[_0x0c21('0x54')](_0x378598[_0x0c21('0x4e')],[_0x0c21('0x55'),'id'])||{});}})['then'](respondWithResult(_0x598376,null))[_0x0c21('0x49')](handleError(_0x598376,null));};exports[_0x0c21('0x56')]=function(_0x5ba49e,_0x1b88d3,_0x1c0415){var _0x3ac111={};var _0x4ae396={};var _0x32f121;var _0x51b622;return db[_0x0c21('0x30')]['findOne']({'where':{'id':_0x5ba49e[_0x0c21('0x4b')]['id']}})[_0x0c21('0x29')](handleEntityNotFound(_0x1b88d3,null))[_0x0c21('0x29')](function(_0x5e5ce6){if(_0x5e5ce6){_0x32f121=_0x5e5ce6;_0x4ae396[_0x0c21('0x34')]=_[_0x0c21('0x36')](db['User'][_0x0c21('0x31')]);_0x4ae396[_0x0c21('0x35')]=_[_0x0c21('0x36')](_0x5ba49e[_0x0c21('0x35')]);_0x4ae396[_0x0c21('0x37')]=_[_0x0c21('0x38')](_0x4ae396[_0x0c21('0x34')],_0x4ae396[_0x0c21('0x35')]);_0x3ac111['attributes']=_['intersection'](_0x4ae396[_0x0c21('0x34')],qs[_0x0c21('0x3a')](_0x5ba49e[_0x0c21('0x35')][_0x0c21('0x3a')]));_0x3ac111[_0x0c21('0x39')]=_0x3ac111[_0x0c21('0x39')]['length']?_0x3ac111[_0x0c21('0x39')]:_0x4ae396[_0x0c21('0x34')];_0x3ac111[_0x0c21('0x3d')]=qs[_0x0c21('0x3e')](_0x5ba49e['query'][_0x0c21('0x3e')]);_0x3ac111[_0x0c21('0x3f')]=qs[_0x0c21('0x37')](_['pick'](_0x5ba49e['query'],_0x4ae396[_0x0c21('0x37')]));if(_0x5ba49e[_0x0c21('0x35')][_0x0c21('0x41')]){_0x3ac111[_0x0c21('0x3f')]=_['merge'](_0x3ac111[_0x0c21('0x3f')],{'$or':_[_0x0c21('0x2f')](_0x3ac111[_0x0c21('0x39')],function(_0x342d7b){var _0x4f6e99={};_0x4f6e99[_0x342d7b]={'$like':'%'+_0x5ba49e[_0x0c21('0x35')][_0x0c21('0x41')]+'%'};return _0x4f6e99;})});}_0x3ac111=_['merge']({},_0x3ac111,_0x5ba49e[_0x0c21('0x45')]);return _0x32f121[_0x0c21('0x56')](_0x3ac111);}})[_0x0c21('0x29')](function(_0x2a94c8){if(_0x2a94c8){_0x51b622=_0x2a94c8['length'];if(!_0x5ba49e[_0x0c21('0x35')][_0x0c21('0x57')](_0x0c21('0x3c'))){_0x3ac111[_0x0c21('0x24')]=qs[_0x0c21('0x24')](_0x5ba49e[_0x0c21('0x35')][_0x0c21('0x24')]);_0x3ac111['offset']=qs[_0x0c21('0x21')](_0x5ba49e['query'][_0x0c21('0x21')]);}return _0x32f121[_0x0c21('0x56')](_0x3ac111);}})[_0x0c21('0x29')](function(_0x300de5){if(_0x300de5){return _0x300de5?{'count':_0x51b622,'rows':_0x300de5}:null;}})[_0x0c21('0x29')](respondWithResult(_0x1b88d3,null))[_0x0c21('0x49')](handleError(_0x1b88d3,null));};exports[_0x0c21('0x58')]=function(_0x2c12dc,_0x3bacbd,_0x4aad1a){return db[_0x0c21('0x30')][_0x0c21('0x4c')]({'where':{'id':_0x2c12dc[_0x0c21('0x4b')]['id']}})[_0x0c21('0x29')](handleEntityNotFound(_0x3bacbd,null))[_0x0c21('0x29')](function(_0x92d3d1){if(_0x92d3d1){return _0x92d3d1[_0x0c21('0x58')](_0x2c12dc['query'][_0x0c21('0x55')]);}})['then'](respondWithStatusCode(_0x3bacbd,null))[_0x0c21('0x49')](handleError(_0x3bacbd,null));};exports['addMessage']=function(_0x59a4cb,_0x4290c2,_0x5dcbf0){if(_0x59a4cb[_0x0c21('0x4e')]['id']){delete _0x59a4cb[_0x0c21('0x4e')]['id'];}return db['ChatGroup'][_0x0c21('0x4c')]({'where':{'id':_0x59a4cb[_0x0c21('0x4b')]['id']}})[_0x0c21('0x29')](handleEntityNotFound(_0x4290c2,null))[_0x0c21('0x29')](function(_0x50e67a){if(_0x50e67a){_0x59a4cb['body'][_0x0c21('0x59')]=_0x50e67a['id'];return db[_0x0c21('0x5a')]['create'](_0x59a4cb[_0x0c21('0x4e')]);}})[_0x0c21('0x29')](respondWithResult(_0x4290c2,null))[_0x0c21('0x49')](handleError(_0x4290c2,null));};exports[_0x0c21('0x5b')]=function(_0xb03b5b,_0x57de81,_0x2db337){var _0x353e19={};var _0x197a7d={};var _0x2ddcb2;var _0x22a6a2;return db[_0x0c21('0x30')][_0x0c21('0x5c')]({'where':{'id':_0xb03b5b[_0x0c21('0x4b')]['id']}})[_0x0c21('0x29')](handleEntityNotFound(_0x57de81,null))[_0x0c21('0x29')](function(_0x373dee){if(_0x373dee){_0x2ddcb2=_0x373dee;_0x197a7d['model']=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x197a7d['query']=_['keys'](_0xb03b5b[_0x0c21('0x35')]);_0x197a7d[_0x0c21('0x37')]=_[_0x0c21('0x38')](_0x197a7d[_0x0c21('0x34')],_0x197a7d[_0x0c21('0x35')]);_0x353e19[_0x0c21('0x39')]=_[_0x0c21('0x38')](_0x197a7d[_0x0c21('0x34')],qs['fields'](_0xb03b5b['query'][_0x0c21('0x3a')]));_0x353e19[_0x0c21('0x39')]=_0x353e19[_0x0c21('0x39')]['length']?_0x353e19[_0x0c21('0x39')]:_0x197a7d[_0x0c21('0x34')];_0x353e19['order']=qs[_0x0c21('0x3e')](_0xb03b5b[_0x0c21('0x35')][_0x0c21('0x3e')]);_0x353e19[_0x0c21('0x3f')]=qs[_0x0c21('0x37')](_['pick'](_0xb03b5b[_0x0c21('0x35')],_0x197a7d[_0x0c21('0x37')]));if(_0xb03b5b[_0x0c21('0x35')][_0x0c21('0x41')]){_0x353e19[_0x0c21('0x3f')]=_[_0x0c21('0x42')](_0x353e19['where'],{'$or':_[_0x0c21('0x2f')](_0x353e19['attributes'],function(_0x5b5330){var _0x3d69c9={};_0x3d69c9[_0x5b5330]={'$like':'%'+_0xb03b5b[_0x0c21('0x35')]['filter']+'%'};return _0x3d69c9;})});}if(_0xb03b5b[_0x0c21('0x35')][_0x0c21('0x5d')]){var _0x1df437=_0xb03b5b['query'][_0x0c21('0x5d')][_0x0c21('0x5e')](',');var _0x2c3180={};_0x2c3180[_0x1df437[0x0]]={'$gte':moment(_0x1df437[0x1])[_0x0c21('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x353e19[_0x0c21('0x3f')]=_[_0x0c21('0x42')](_0x353e19['where'],_0x2c3180);}_0x353e19=_[_0x0c21('0x42')]({},_0x353e19,_0xb03b5b[_0x0c21('0x45')]);return _0x2ddcb2[_0x0c21('0x5b')](_0x353e19);}})[_0x0c21('0x29')](function(_0x414fd1){if(_0x414fd1){_0x22a6a2=_0x414fd1[_0x0c21('0x3b')];if(!_0xb03b5b['query']['hasOwnProperty'](_0x0c21('0x3c'))){_0x353e19[_0x0c21('0x24')]=qs[_0x0c21('0x24')](_0xb03b5b[_0x0c21('0x35')]['limit']);_0x353e19[_0x0c21('0x21')]=qs[_0x0c21('0x21')](_0xb03b5b[_0x0c21('0x35')][_0x0c21('0x21')]);}return _0x2ddcb2[_0x0c21('0x5b')](_0x353e19);}})[_0x0c21('0x29')](function(_0x103818){if(_0x103818){return _0x103818?{'count':_0x22a6a2,'rows':_0x103818}:null;}})[_0x0c21('0x29')](respondWithResult(_0x57de81,null))[_0x0c21('0x49')](handleError(_0x57de81,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 3ee2b36..aee111d 100644
--- a/server/api/chatGroup/chatGroup.events.js
+++ b/server/api/chatGroup/chatGroup.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5078=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3836ee,_0x3e61aa){var _0x3c9652=function(_0x3a7eb1){while(--_0x3a7eb1){_0x3836ee['push'](_0x3836ee['shift']());}};_0x3c9652(++_0x3e61aa);}(_0x5078,0x148));var _0x8507=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0x5078[_0x211632];return _0x5a1da1;};'use strict';var EventEmitter=require(_0x8507('0x0'));var ChatGroup=require(_0x8507('0x1'))['db'][_0x8507('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8507('0x3')](0x0);var events={'afterCreate':_0x8507('0x4'),'afterUpdate':_0x8507('0x5'),'afterDestroy':_0x8507('0x6')};function emitEvent(_0x20608d){return function(_0x1a4930,_0x239a82,_0x2aa379){ChatGroupEvents[_0x8507('0x7')](_0x20608d+':'+_0x1a4930['id'],_0x1a4930);ChatGroupEvents[_0x8507('0x7')](_0x20608d,_0x1a4930);_0x2aa379(null);};}for(var e in events){if(events[_0x8507('0x8')](e)){var event=events[e];ChatGroup[_0x8507('0x9')](e,emitEvent(event));}}module[_0x8507('0xa')]=ChatGroupEvents;
\ No newline at end of file
+var _0x0bb0=['update','remove','emit','hasOwnProperty','hook','exports','events','ChatGroup','setMaxListeners','save'];(function(_0xea80ce,_0x4ea841){var _0x16c55e=function(_0x50b667){while(--_0x50b667){_0xea80ce['push'](_0xea80ce['shift']());}};_0x16c55e(++_0x4ea841);}(_0x0bb0,0x11e));var _0x00bb=function(_0x20d17c,_0x4e8132){_0x20d17c=_0x20d17c-0x0;var _0x429799=_0x0bb0[_0x20d17c];return _0x429799;};'use strict';var EventEmitter=require(_0x00bb('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x00bb('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x00bb('0x2')](0x0);var events={'afterCreate':_0x00bb('0x3'),'afterUpdate':_0x00bb('0x4'),'afterDestroy':_0x00bb('0x5')};function emitEvent(_0x4abb06){return function(_0x51369a,_0x506171,_0x5ad1d0){ChatGroupEvents[_0x00bb('0x6')](_0x4abb06+':'+_0x51369a['id'],_0x51369a);ChatGroupEvents[_0x00bb('0x6')](_0x4abb06,_0x51369a);_0x5ad1d0(null);};}for(var e in events){if(events[_0x00bb('0x7')](e)){var event=events[e];ChatGroup[_0x00bb('0x8')](e,emitEvent(event));}}module[_0x00bb('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 7d5fc8f..60ce74f 100644
--- a/server/api/chatGroup/chatGroup.model.js
+++ b/server/api/chatGroup/chatGroup.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f85=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup'];(function(_0x1d6a29,_0x1f9cf9){var _0x1d3206=function(_0x314ffd){while(--_0x314ffd){_0x1d6a29['push'](_0x1d6a29['shift']());}};_0x1d3206(++_0x1f9cf9);}(_0x3f85,0x145));var _0x53f8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3f85[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x53f8('0x0'));var util=require(_0x53f8('0x1'));var logger=require(_0x53f8('0x2'))(_0x53f8('0x3'));var moment=require(_0x53f8('0x4'));var BPromise=require(_0x53f8('0x5'));var rp=require(_0x53f8('0x6'));var fs=require('fs');var path=require(_0x53f8('0x7'));var rimraf=require(_0x53f8('0x8'));var config=require(_0x53f8('0x9'));var attributes=require('./chatGroup.attributes');module[_0x53f8('0xa')]=function(_0x498292,_0xdcbe19){return _0x498292[_0x53f8('0xb')](_0x53f8('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f75=['moment','path','../../config/environment','exports','define','ChatGroup','lodash','util','../../config/logger'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0x4f75,0xde));var _0x54f7=function(_0x41637d,_0x2546a2){_0x41637d=_0x41637d-0x0;var _0x3fa9d7=_0x4f75[_0x41637d];return _0x3fa9d7;};'use strict';var _=require(_0x54f7('0x0'));var util=require(_0x54f7('0x1'));var logger=require(_0x54f7('0x2'))('api');var moment=require(_0x54f7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x54f7('0x4'));var rimraf=require('rimraf');var config=require(_0x54f7('0x5'));var attributes=require('./chatGroup.attributes');module[_0x54f7('0x6')]=function(_0x13424b,_0x12846b){return _0x13424b[_0x54f7('0x7')](_0x54f7('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index ce48d30..4d746a6 100644
--- a/server/api/chatGroup/chatGroup.rpc.js
+++ b/server/api/chatGroup/chatGroup.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb13=['request\x20sent','stringify','error','message','ChatGroup,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x19d873,_0x1b5249){var _0x26be90=function(_0x10fb7f){while(--_0x10fb7f){_0x19d873['push'](_0x19d873['shift']());}};_0x26be90(++_0x1b5249);}(_0xdb13,0x10c));var _0x3db1=function(_0x29539e,_0x30240a){_0x29539e=_0x29539e-0x0;var _0x49f3c7=_0xdb13[_0x29539e];return _0x49f3c7;};'use strict';var _=require('lodash');var util=require(_0x3db1('0x0'));var moment=require(_0x3db1('0x1'));var BPromise=require(_0x3db1('0x2'));var rs=require(_0x3db1('0x3'));var fs=require('fs');var Redis=require(_0x3db1('0x4'));var db=require(_0x3db1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3db1('0x6'))(_0x3db1('0x7'));var config=require(_0x3db1('0x8'));var jayson=require(_0x3db1('0x9'));var client=jayson[_0x3db1('0xa')]['http']({'port':0x232a});config[_0x3db1('0xb')]=_[_0x3db1('0xc')](config[_0x3db1('0xb')],{'host':_0x3db1('0xd'),'port':0x18eb});var socket=require(_0x3db1('0xe'))(new Redis(config[_0x3db1('0xb')]));require(_0x3db1('0xf'))[_0x3db1('0x10')](socket);function respondWithRpcPromise(_0x2261bb,_0xe67f4b,_0x46f340){return new BPromise(function(_0xfd358f,_0x51d421){return client[_0x3db1('0x11')](_0x2261bb,_0x46f340)[_0x3db1('0x12')](function(_0x2bab87){logger[_0x3db1('0x13')]('ChatGroup,\x20%s,\x20%s',_0xe67f4b,'request\x20sent');logger[_0x3db1('0x14')](_0x3db1('0x15'),_0xe67f4b,_0x3db1('0x16'),JSON[_0x3db1('0x17')](_0x2bab87));if(_0x2bab87[_0x3db1('0x18')]){if(_0x2bab87['error']['code']===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0xe67f4b,_0x2bab87[_0x3db1('0x18')][_0x3db1('0x19')]);return _0x51d421(_0x2bab87[_0x3db1('0x18')][_0x3db1('0x19')]);}logger[_0x3db1('0x18')](_0x3db1('0x1a'),_0xe67f4b,_0x2bab87['error'][_0x3db1('0x19')]);return _0xfd358f(_0x2bab87[_0x3db1('0x18')]['message']);}else{logger[_0x3db1('0x13')](_0x3db1('0x1a'),_0xe67f4b,'request\x20sent');_0xfd358f(_0x2bab87[_0x3db1('0x1b')]['message']);}})[_0x3db1('0x1c')](function(_0x475208){logger[_0x3db1('0x18')](_0x3db1('0x1a'),_0xe67f4b,_0x475208);_0x51d421(_0x475208);});});}
\ No newline at end of file
+var _0x4756=['moment','bluebird','../../mysqldb','client','http','redis','localhost','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x1d6960,_0x11a48a){var _0x278934=function(_0x36dd3d){while(--_0x36dd3d){_0x1d6960['push'](_0x1d6960['shift']());}};_0x278934(++_0x11a48a);}(_0x4756,0xa6));var _0x6475=function(_0x2c57d4,_0x132261){_0x2c57d4=_0x2c57d4-0x0;var _0x5e8b6f=_0x4756[_0x2c57d4];return _0x5e8b6f;};'use strict';var _=require(_0x6475('0x0'));var util=require(_0x6475('0x1'));var moment=require(_0x6475('0x2'));var BPromise=require(_0x6475('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6475('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6475('0x5')][_0x6475('0x6')]({'port':0x232a});config[_0x6475('0x7')]=_['defaults'](config[_0x6475('0x7')],{'host':_0x6475('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6475('0x9'))[_0x6475('0xa')](socket);function respondWithRpcPromise(_0x34c510,_0x263fc5,_0x276fcd){return new BPromise(function(_0x8eced8,_0x3e9391){return client[_0x6475('0xb')](_0x34c510,_0x276fcd)['then'](function(_0x5cbbc3){logger[_0x6475('0xc')](_0x6475('0xd'),_0x263fc5,'request\x20sent');logger['debug'](_0x6475('0xe'),_0x263fc5,_0x6475('0xf'),JSON[_0x6475('0x10')](_0x5cbbc3));if(_0x5cbbc3[_0x6475('0x11')]){if(_0x5cbbc3[_0x6475('0x11')][_0x6475('0x12')]===0x1f4){logger['error'](_0x6475('0xd'),_0x263fc5,_0x5cbbc3[_0x6475('0x11')][_0x6475('0x13')]);return _0x3e9391(_0x5cbbc3[_0x6475('0x11')][_0x6475('0x13')]);}logger[_0x6475('0x11')](_0x6475('0xd'),_0x263fc5,_0x5cbbc3[_0x6475('0x11')][_0x6475('0x13')]);return _0x8eced8(_0x5cbbc3[_0x6475('0x11')][_0x6475('0x13')]);}else{logger[_0x6475('0xc')](_0x6475('0xd'),_0x263fc5,_0x6475('0xf'));_0x8eced8(_0x5cbbc3[_0x6475('0x14')][_0x6475('0x13')]);}})['catch'](function(_0x340356){logger[_0x6475('0x11')](_0x6475('0xd'),_0x263fc5,_0x340356);_0x3e9391(_0x340356);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 5394824..aa76710 100644
--- a/server/api/chatGroup/chatGroup.socket.js
+++ b/server/api/chatGroup/chatGroup.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9cdf=['chatGroup:','./chatGroup.events','remove','update','emit','register'];(function(_0xa5e22f,_0x5c90ed){var _0x417561=function(_0xd8d76){while(--_0xd8d76){_0xa5e22f['push'](_0xa5e22f['shift']());}};_0x417561(++_0x5c90ed);}(_0x9cdf,0x1a5));var _0xf9cd=function(_0x252e47,_0x488d2f){_0x252e47=_0x252e47-0x0;var _0x1fbd86=_0x9cdf[_0x252e47];return _0x1fbd86;};'use strict';var ChatGroupEvents=require(_0xf9cd('0x0'));var events=['save',_0xf9cd('0x1'),_0xf9cd('0x2')];function createListener(_0x853dd9,_0x4d11ab){return function(_0x121078){_0x4d11ab[_0xf9cd('0x3')](_0x853dd9,_0x121078);};}function removeListener(_0x3d3b5c,_0x55b41c){return function(){ChatGroupEvents['removeListener'](_0x3d3b5c,_0x55b41c);};}exports[_0xf9cd('0x4')]=function(_0x4c106c){for(var _0x37a08b=0x0,_0x1c5f3f=events['length'];_0x37a08b<_0x1c5f3f;_0x37a08b++){var _0x1ddc47=events[_0x37a08b];var _0x22d3ee=createListener(_0xf9cd('0x5')+_0x1ddc47,_0x4c106c);ChatGroupEvents['on'](_0x1ddc47,_0x22d3ee);}};
\ No newline at end of file
+var _0x4f61=['length','chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener','register'];(function(_0x55c9a0,_0x18286f){var _0x51fe89=function(_0x3bc6fe){while(--_0x3bc6fe){_0x55c9a0['push'](_0x55c9a0['shift']());}};_0x51fe89(++_0x18286f);}(_0x4f61,0x16a));var _0x14f6=function(_0x594368,_0x3c7c54){_0x594368=_0x594368-0x0;var _0x5cafbe=_0x4f61[_0x594368];return _0x5cafbe;};'use strict';var ChatGroupEvents=require(_0x14f6('0x0'));var events=[_0x14f6('0x1'),_0x14f6('0x2'),_0x14f6('0x3')];function createListener(_0x303d65,_0x3a7417){return function(_0x14925a){_0x3a7417[_0x14f6('0x4')](_0x303d65,_0x14925a);};}function removeListener(_0x5d17a9,_0xfbc052){return function(){ChatGroupEvents[_0x14f6('0x5')](_0x5d17a9,_0xfbc052);};}exports[_0x14f6('0x6')]=function(_0x1de980){for(var _0x34499d=0x0,_0x200d91=events[_0x14f6('0x7')];_0x34499d<_0x200d91;_0x34499d++){var _0x238ca1=events[_0x34499d];var _0xb18da1=createListener(_0x14f6('0x8')+_0x238ca1,_0x1de980);ChatGroupEvents['on'](_0x238ca1,_0xb18da1);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 4e0629b..3ef22e6 100644
--- a/server/api/chatGroup/index.js
+++ b/server/api/chatGroup/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfa9a=['/describe','/:id','show','/:id/unread','getMembers','/:id/messages','getMessages','create','addMembers','post','addMessage','put','/:id/members','removeMembers','exports','multer','util','path','express','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index'];(function(_0x5e1b91,_0x236f17){var _0x59b52f=function(_0x5c05ed){while(--_0x5c05ed){_0x5e1b91['push'](_0x5e1b91['shift']());}};_0x59b52f(++_0x236f17);}(_0xfa9a,0x1a7));var _0xafa9=function(_0x243e8c,_0x5f0894){_0x243e8c=_0x243e8c-0x0;var _0x713314=_0xfa9a[_0x243e8c];return _0x713314;};'use strict';var multer=require(_0xafa9('0x0'));var util=require(_0xafa9('0x1'));var path=require(_0xafa9('0x2'));var timeout=require('connect-timeout');var express=require(_0xafa9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xafa9('0x4'));var config=require('../../config/environment');var controller=require(_0xafa9('0x5'));router[_0xafa9('0x6')]('/',auth[_0xafa9('0x7')](),controller[_0xafa9('0x8')]);router[_0xafa9('0x6')](_0xafa9('0x9'),auth[_0xafa9('0x7')](),controller['describe']);router[_0xafa9('0x6')](_0xafa9('0xa'),auth[_0xafa9('0x7')](),controller[_0xafa9('0xb')]);router[_0xafa9('0x6')](_0xafa9('0xc'),auth[_0xafa9('0x7')](),controller['getUnread']);router[_0xafa9('0x6')]('/:id/members',auth[_0xafa9('0x7')](),controller[_0xafa9('0xd')]);router[_0xafa9('0x6')](_0xafa9('0xe'),auth['isAuthenticated'](),controller[_0xafa9('0xf')]);router['post']('/',auth[_0xafa9('0x7')](),controller[_0xafa9('0x10')]);router['post']('/:id/members',auth['isAuthenticated'](),controller[_0xafa9('0x11')]);router[_0xafa9('0x12')](_0xafa9('0xe'),auth[_0xafa9('0x7')](),controller[_0xafa9('0x13')]);router[_0xafa9('0x14')](_0xafa9('0xa'),auth[_0xafa9('0x7')](),controller['update']);router['delete'](_0xafa9('0xa'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xafa9('0x15'),auth['isAuthenticated'](),controller[_0xafa9('0x16')]);module[_0xafa9('0x17')]=router;
\ No newline at end of file
+var _0xd843=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','/:id/messages','post','create','/:id/members','addMembers','put','destroy','exports'];(function(_0x4261c4,_0x47c1f3){var _0x525e7c=function(_0x285a92){while(--_0x285a92){_0x4261c4['push'](_0x4261c4['shift']());}};_0x525e7c(++_0x47c1f3);}(_0xd843,0x1ee));var _0x3d84=function(_0xe8e91,_0x401ca3){_0xe8e91=_0xe8e91-0x0;var _0x1258fe=_0xd843[_0xe8e91];return _0x1258fe;};'use strict';var multer=require(_0x3d84('0x0'));var util=require(_0x3d84('0x1'));var path=require(_0x3d84('0x2'));var timeout=require(_0x3d84('0x3'));var express=require(_0x3d84('0x4'));var router=express[_0x3d84('0x5')]();var fs_extra=require(_0x3d84('0x6'));var auth=require(_0x3d84('0x7'));var interaction=require(_0x3d84('0x8'));var config=require(_0x3d84('0x9'));var controller=require(_0x3d84('0xa'));router[_0x3d84('0xb')]('/',auth[_0x3d84('0xc')](),controller[_0x3d84('0xd')]);router[_0x3d84('0xb')](_0x3d84('0xe'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x3d84('0xf'),auth['isAuthenticated'](),controller[_0x3d84('0x10')]);router['get'](_0x3d84('0x11'),auth[_0x3d84('0xc')](),controller['getUnread']);router[_0x3d84('0xb')]('/:id/members',auth[_0x3d84('0xc')](),controller['getMembers']);router[_0x3d84('0xb')](_0x3d84('0x12'),auth[_0x3d84('0xc')](),controller['getMessages']);router[_0x3d84('0x13')]('/',auth['isAuthenticated'](),controller[_0x3d84('0x14')]);router['post'](_0x3d84('0x15'),auth[_0x3d84('0xc')](),controller[_0x3d84('0x16')]);router[_0x3d84('0x13')](_0x3d84('0x12'),auth[_0x3d84('0xc')](),controller['addMessage']);router[_0x3d84('0x17')]('/:id',auth[_0x3d84('0xc')](),controller['update']);router['delete'](_0x3d84('0xf'),auth[_0x3d84('0xc')](),controller[_0x3d84('0x18')]);router['delete'](_0x3d84('0x15'),auth[_0x3d84('0xc')](),controller['removeMembers']);module[_0x3d84('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 8815cbe..4f30bca 100644
--- a/server/api/chatInteraction/chatInteraction.attributes.js
+++ b/server/api/chatInteraction/chatInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x282b=['TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x282b,0xec));var _0xb282=function(_0x19d0c0,_0xaa15af){_0x19d0c0=_0x19d0c0-0x0;var _0x5551b7=_0x282b[_0x19d0c0];return _0x5551b7;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'closed':{'type':Sequelize[_0xb282('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb282('0x3')]},'ratingType':{'type':Sequelize[_0xb282('0x4')]('star','thumb'),'defaultValue':_0xb282('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xb282('0x6')]},'mailTranscript':{'type':Sequelize[_0xb282('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xb282('0x8')]},'disposition':{'type':Sequelize[_0xb282('0x7')]},'secondDisposition':{'type':Sequelize[_0xb282('0x7')]},'thirdDisposition':{'type':Sequelize[_0xb282('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xb282('0x7')]},'osName':{'type':Sequelize[_0xb282('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xb282('0x7')]},'deviceVendor':{'type':Sequelize[_0xb282('0x7')]},'deviceType':{'type':Sequelize[_0xb282('0x7')]},'referer':{'type':Sequelize[_0xb282('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xb282('0x9'))},'read1stAt':{'type':Sequelize[_0xb282('0x8')]},'lastMsgAt':{'type':Sequelize[_0xb282('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xb282('0x4')]('in',_0xb282('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xb282('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xb282('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x38c9=['long','out','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x10b253,_0x5acad5){var _0x5c08fb=function(_0x443704){while(--_0x443704){_0x10b253['push'](_0x10b253['shift']());}};_0x5c08fb(++_0x5acad5);}(_0x38c9,0x199));var _0x938c=function(_0x14363e,_0x4f0e0d){_0x14363e=_0x14363e-0x0;var _0x17c56d=_0x38c9[_0x14363e];return _0x17c56d;};'use strict';var Sequelize=require(_0x938c('0x0'));module[_0x938c('0x1')]={'closed':{'type':Sequelize[_0x938c('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x938c('0x3')](_0x938c('0x4'),_0x938c('0x5')),'defaultValue':_0x938c('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x938c('0x6')]},'mailTranscript':{'type':Sequelize[_0x938c('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x938c('0x8')]},'disposition':{'type':Sequelize[_0x938c('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x938c('0x7')]},'note':{'type':Sequelize[_0x938c('0x7')]},'browserName':{'type':Sequelize[_0x938c('0x7')]},'browserVersion':{'type':Sequelize[_0x938c('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x938c('0x7')]},'deviceVendor':{'type':Sequelize[_0x938c('0x7')]},'deviceType':{'type':Sequelize[_0x938c('0x7')]},'referer':{'type':Sequelize[_0x938c('0x6')]},'customerIp':{'type':Sequelize[_0x938c('0x7')]},'formData':{'type':Sequelize[_0x938c('0x6')](_0x938c('0x9'))},'read1stAt':{'type':Sequelize[_0x938c('0x8')]},'lastMsgAt':{'type':Sequelize[_0x938c('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x938c('0x3')]('in',_0x938c('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x938c('0x7')]},'customerPort':{'type':Sequelize[_0x938c('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x938c('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x938c('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index b1ddbac..1b7db01 100644
--- a/server/api/chatInteraction/chatInteraction.controller.js
+++ b/server/api/chatInteraction/chatInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4665=['defaults','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','offset','limit','undefined','count','apply','reject','save','update','destroy','name','send','render','merge','body','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','waiting','answered','unmanaged','abandoned','UserId','closed','talking','disposition','index','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','having','operator','$substring','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','text','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','fields','a.key','Account.key','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','show','params','includeAll','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooNote','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','close','server/files/chat/upload/','transcript-%s.txt','ChatMessage','User','format','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','getMyMessages','includeAgent','setTags','omit','spread','emit','removeTags','download','unix','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','Chat','closedAt','browserName','customerPort','N.A.','Messages','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','sendStatus','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x197c01,_0x469b71){var _0x56fbc0=function(_0x5dcc07){while(--_0x5dcc07){_0x197c01['push'](_0x197c01['shift']());}};_0x56fbc0(++_0x469b71);}(_0x4665,0x122));var _0x5466=function(_0x20a0b7,_0x5becdd){_0x20a0b7=_0x20a0b7-0x0;var _0x455b53=_0x4665[_0x20a0b7];return _0x455b53;};'use strict';var emlformat=require(_0x5466('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5466('0x1'));var jsonpatch=require(_0x5466('0x2'));var rp=require(_0x5466('0x3'));var moment=require(_0x5466('0x4'));var BPromise=require(_0x5466('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5466('0x6'));var sox=require(_0x5466('0x7'));var csv=require(_0x5466('0x8'));var ejs=require(_0x5466('0x9'));var fs=require('fs');var fs_extra=require(_0x5466('0xa'));var _=require(_0x5466('0xb'));var squel=require(_0x5466('0xc'));var crypto=require('crypto');var jsforce=require(_0x5466('0xd'));var deskjs=require(_0x5466('0xe'));var toCsv=require(_0x5466('0x8'));var querystring=require(_0x5466('0xf'));var Papa=require(_0x5466('0x10'));var Redis=require(_0x5466('0x11'));var authService=require(_0x5466('0x12'));var qs=require(_0x5466('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5466('0x14'))(_0x5466('0x15'));var utils=require(_0x5466('0x16'));var config=require(_0x5466('0x17'));var licenseUtil=require(_0x5466('0x18'));var db=require(_0x5466('0x19'))['db'];config[_0x5466('0x1a')]=_[_0x5466('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5466('0x1a')]));require('./chatInteraction.socket')[_0x5466('0x1c')](socket);var jayson=require(_0x5466('0x1d'));var client=jayson[_0x5466('0x1e')][_0x5466('0x1f')]({'port':0x232b});var client9004=jayson[_0x5466('0x1e')][_0x5466('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x61ecf2,_0xeda703,_0x4ca0c6,_0xc80850){return new BPromise(function(_0x329331,_0x5752e3){var _0x3049b4=_0xc80850||client;return _0x3049b4[_0x5466('0x20')](_0x61ecf2,_0x4ca0c6)[_0x5466('0x21')](function(_0x4cee58){logger[_0x5466('0x22')](_0x5466('0x23'),_0xeda703,_0x5466('0x24'));logger['debug'](_0x5466('0x25'),_0xeda703,_0x5466('0x24'),JSON[_0x5466('0x26')](_0x4cee58));if(_0x4cee58[_0x5466('0x27')]){if(_0x4cee58[_0x5466('0x27')][_0x5466('0x28')]===0x1f4){logger[_0x5466('0x27')]('ChatInteraction,\x20%s,\x20%s',_0xeda703,_0x4cee58[_0x5466('0x27')][_0x5466('0x29')]);return _0x5752e3(_0x4cee58[_0x5466('0x27')][_0x5466('0x29')]);}logger[_0x5466('0x27')](_0x5466('0x23'),_0xeda703,_0x4cee58[_0x5466('0x27')][_0x5466('0x29')]);return _0x329331(_0x4cee58['error'][_0x5466('0x29')]);}else{logger[_0x5466('0x22')](_0x5466('0x23'),_0xeda703,_0x5466('0x24'));_0x329331(_0x4cee58[_0x5466('0x2a')][_0x5466('0x29')]);}})[_0x5466('0x2b')](function(_0x543578){logger[_0x5466('0x27')](_0x5466('0x23'),_0xeda703,_0x543578);_0x5752e3(_0x543578);});});}function respondWithStatusCode(_0x4a4d92,_0x53d9fe){_0x53d9fe=_0x53d9fe||0xcc;return function(_0x49b8ba){if(_0x49b8ba){return _0x4a4d92['sendStatus'](_0x53d9fe);}return _0x4a4d92['status'](_0x53d9fe)[_0x5466('0x2c')]();};}function respondWithResult(_0x2f7872,_0x5116da){_0x5116da=_0x5116da||0xc8;return function(_0x549d8e){if(_0x549d8e){return _0x2f7872[_0x5466('0x2d')](_0x5116da)[_0x5466('0x2e')](_0x549d8e);}};}function respondWithFilteredResult(_0x4d4841,_0x35c1bf){return function(_0x3c5939){if(_0x3c5939){var _0x4932f1=typeof _0x35c1bf[_0x5466('0x2f')]==='undefined'&&typeof _0x35c1bf[_0x5466('0x30')]===_0x5466('0x31');var _0x1c621c=_0x3c5939[_0x5466('0x32')];var _0x265f39=_0x4932f1?0x0:_0x35c1bf[_0x5466('0x2f')];var _0x2114b4=_0x4932f1?_0x3c5939[_0x5466('0x32')]:_0x35c1bf[_0x5466('0x2f')]+_0x35c1bf[_0x5466('0x30')];var _0x22faf8;if(_0x2114b4>=_0x1c621c){_0x2114b4=_0x1c621c;_0x22faf8=0xc8;}else{_0x22faf8=0xce;}_0x4d4841[_0x5466('0x2d')](_0x22faf8);return _0x4d4841['set']('Content-Range',_0x265f39+'-'+_0x2114b4+'/'+_0x1c621c)[_0x5466('0x2e')](_0x3c5939);}return null;};}function patchUpdates(_0x4d8ea8){return function(_0xeb5a2e){try{jsonpatch[_0x5466('0x33')](_0xeb5a2e,_0x4d8ea8,!![]);}catch(_0x5b8fa6){return BPromise[_0x5466('0x34')](_0x5b8fa6);}return _0xeb5a2e[_0x5466('0x35')]();};}function saveUpdates(_0x121f78,_0x24be84){return function(_0x2a2995){if(_0x2a2995){return _0x2a2995[_0x5466('0x36')](_0x121f78)[_0x5466('0x21')](function(_0x2008a1){return _0x2008a1;});}return null;};}function removeEntity(_0x5502ad,_0x19fa34){return function(_0x3e033a){if(_0x3e033a){return _0x3e033a[_0x5466('0x37')]()[_0x5466('0x21')](function(){_0x5502ad[_0x5466('0x2d')](0xcc)[_0x5466('0x2c')]();});}};}function handleEntityNotFound(_0xfa8196,_0x276ade){return function(_0x254852){if(!_0x254852){_0xfa8196['sendStatus'](0x194);}return _0x254852;};}function handleError(_0x55c5b5,_0x1eb245){_0x1eb245=_0x1eb245||0x1f4;return function(_0x1d62e9){logger[_0x5466('0x27')](_0x1d62e9['stack']);if(_0x1d62e9[_0x5466('0x38')]){delete _0x1d62e9[_0x5466('0x38')];}_0x55c5b5[_0x5466('0x2d')](_0x1eb245)[_0x5466('0x39')](_0x1d62e9);};}function getMustacheRender(_0x319343,_0x4347a4){return Mustache[_0x5466('0x3a')](_0x319343,_[_0x5466('0x3b')](_0x4347a4[_0x5466('0x3c')],{'contact':_0x4347a4['contact'],'message':_0x4347a4['message'],'agent':_0x4347a4[_0x5466('0x3d')],'interaction':_0x4347a4[_0x5466('0x3e')],'account':_0x4347a4[_0x5466('0x3f')]}))||'';}function getInteractionUsers(_0x4ce5cb,_0x1b213b){return new BPromise(function(_0x4d22fc,_0x119c11){try{if(_0x1b213b[_0x4ce5cb['id']]){_0x4ce5cb[_0x5466('0x40')]=_[_0x5466('0x41')](_0x1b213b[_0x4ce5cb['id']],function(_0x555272){return{'id':_0x555272['id'],'fullname':_0x555272[_0x5466('0x42')]};});}}catch(_0x3c7efd){_0x119c11(_0x3c7efd);}_0x4d22fc(_0x4ce5cb);});}function getInteractionTags(_0x4607be,_0x178d41){return new BPromise(function(_0x484bda,_0x1a498b){try{if(_0x4607be[_0x5466('0x43')]){_0x4607be[_0x5466('0x44')]=[];_0x4607be['TagIds'][_0x5466('0x45')](',')[_0x5466('0x46')](function(_0x34f80e){_0x4607be[_0x5466('0x44')][_0x5466('0x47')](_0x178d41[_0x34f80e]);});}delete _0x4607be['TagIds'];}catch(_0x13d85b){_0x1a498b(_0x13d85b);}_0x484bda(_0x4607be);});}function updateChatInteraction(_0x1b6257,_0x9e34cf,_0x4eecac){return new BPromise(function(_0x1da86c,_0x55d1fb){return getInteractionUsers(_0x1b6257,_0x4eecac)['then'](function(_0x509e9b){return getInteractionTags(_0x509e9b,_0x9e34cf);})[_0x5466('0x21')](function(_0x2ee9d2){return getStateInteraction(_0x2ee9d2);})['then'](function(_0x4e0b0c){_0x1da86c(_0x4e0b0c);})['catch'](function(_0x25a744){_0x55d1fb(_0x25a744);});});}function getStateInteraction(_0x5de7cd){return new BPromise(function(_0x9ff76b){_0x5de7cd[_0x5466('0x48')]=0x0;_0x5de7cd['talking']=0x0;_0x5de7cd[_0x5466('0x49')]=0x0;_0x5de7cd[_0x5466('0x4a')]=0x0;_0x5de7cd[_0x5466('0x4b')]=0x0;_0x5de7cd['total']=0x0;if(!_0x5de7cd['closed']&&!_0x5de7cd[_0x5466('0x4c')]){_0x5de7cd[_0x5466('0x48')]+=0x1;}if(!_0x5de7cd[_0x5466('0x4d')]&&_0x5de7cd['UserId']){_0x5de7cd[_0x5466('0x4e')]+=0x1;if(_0x5de7cd[_0x5466('0x48')]){_0x5de7cd[_0x5466('0x48')]-=0x1;}}if(_0x5de7cd[_0x5466('0x4d')]&&_0x5de7cd['disposition']===_0x5466('0x4b')){_0x5de7cd[_0x5466('0x4b')]+=0x1;if(_0x5de7cd[_0x5466('0x48')]){_0x5de7cd['waiting']-=0x1;}}else if(_0x5de7cd[_0x5466('0x4d')]&&!_0x5de7cd[_0x5466('0x4c')]&&_0x5de7cd[_0x5466('0x4f')]){_0x5de7cd[_0x5466('0x4a')]+=0x1;if(_0x5de7cd[_0x5466('0x48')]){_0x5de7cd['waiting']-=0x1;}}else if(_0x5de7cd[_0x5466('0x4d')]&&_0x5de7cd[_0x5466('0x4c')]){_0x5de7cd[_0x5466('0x49')]+=0x1;if(_0x5de7cd[_0x5466('0x4e')]){_0x5de7cd[_0x5466('0x4e')]-=0x1;}}_0x5de7cd['total']+=0x1;_0x9ff76b(_0x5de7cd);});}exports[_0x5466('0x50')]=function(_0x5d35cb,_0x42e8cf){var _0x2ae9cb={},_0x2d77a1={},_0x3a2fca={'count':0x0,'rows':[]};var _0x7833d4=_[_0x5466('0x41')](db[_0x5466('0x51')][_0x5466('0x52')],function(_0x121cf3){return{'name':_0x121cf3[_0x5466('0x53')],'type':_0x121cf3['type'][_0x5466('0x54')]};});_0x2d77a1[_0x5466('0x55')]=_[_0x5466('0x41')](_0x7833d4,_0x5466('0x38'));_0x2d77a1[_0x5466('0x56')]=_[_0x5466('0x57')](_0x5d35cb[_0x5466('0x56')]);_0x2d77a1['filters']=_[_0x5466('0x58')](_0x2d77a1[_0x5466('0x55')],_0x2d77a1[_0x5466('0x56')]);_0x2ae9cb[_0x5466('0x59')]=_['intersection'](_0x2d77a1[_0x5466('0x55')],qs['fields'](_0x5d35cb['query']['fields']));_0x2ae9cb[_0x5466('0x59')]=_0x2ae9cb[_0x5466('0x59')][_0x5466('0x5a')]?_0x2ae9cb[_0x5466('0x59')]:_0x2d77a1['model'];if(!_0x5d35cb[_0x5466('0x56')][_0x5466('0x5b')](_0x5466('0x5c'))){_0x2ae9cb[_0x5466('0x30')]=qs['limit'](_0x5d35cb[_0x5466('0x56')][_0x5466('0x30')]);_0x2ae9cb['offset']=qs['offset'](_0x5d35cb[_0x5466('0x56')][_0x5466('0x2f')]);}_0x2ae9cb[_0x5466('0x5d')]=qs[_0x5466('0x5e')](_0x5d35cb[_0x5466('0x56')][_0x5466('0x5e')]);_0x2ae9cb[_0x5466('0x5f')]=qs[_0x5466('0x60')](_['pick'](_0x5d35cb[_0x5466('0x56')],_0x2d77a1[_0x5466('0x60')]),_0x7833d4);var _0x5e9eb0=[];var _0x4f262a=squel[_0x5466('0x61')]()[_0x5466('0x62')]('id')[_0x5466('0x62')]('name')[_0x5466('0x62')](_0x5466('0x63'))[_0x5466('0x64')](_0x5466('0x65'));var _0x3bf705=squel[_0x5466('0x61')]()[_0x5466('0x62')](_0x5466('0x66'))['field']('u.fullname')[_0x5466('0x62')]('ui.ChatInteractionId')[_0x5466('0x64')](_0x5466('0x67'),'ui')['left_join'](_0x5466('0x68'),'u',_0x5466('0x69'));var _0x1fff78=squel[_0x5466('0x61')]()['from'](_0x5466('0x6a'),'i')['left_join']('cm_contacts','c',_0x5466('0x6b'))[_0x5466('0x6c')]('users','o','o.id\x20=\x20i.UserId')[_0x5466('0x6c')](_0x5466('0x6d'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x5466('0x6c')](_0x5466('0x6e'),'me',_0x5466('0x6f'))[_0x5466('0x6c')]('chat_interaction_has_tags','it',_0x5466('0x70'))[_0x5466('0x6c')](_0x5466('0x65'),'t','t.id\x20=\x20it.TagId');var _0x59adb1=squel[_0x5466('0x71')]();var _0x46330f=[];var _0x1c95f8=squel[_0x5466('0x71')]();var _0x342a62;if(_0x5d35cb[_0x5466('0x56')]['search']){_0x342a62=as[_0x5466('0x72')](_0x5d35cb[_0x5466('0x56')][_0x5466('0x73')]);var _0x5897f2=_0x342a62[_0x5466('0x74')];for(var _0x126518=0x0;_0x126518<_0x342a62[_0x5466('0x75')][_0x5466('0x5a')];_0x126518++){var _0x142e78=_0x342a62['conditions'][_0x126518];var _0x33a9e5='i';var _0xf5b805=_[_0x5466('0x76')](_0x7833d4,['name',_0x142e78['field']]);if(!_0xf5b805){switch(_0x142e78['field']){case _0x5466('0x77'):if(_0x142e78['value']==0x1){_0x1fff78[_0x5466('0x78')]('`'+_0x142e78[_0x5466('0x62')]+'`\x20=\x200');}else{_0x1fff78[_0x5466('0x78')]('`'+_0x142e78[_0x5466('0x62')]+'`\x20>\x200');}break;case'Contact':if(_0x142e78[_0x5466('0x79')]===_0x5466('0x7a')){if(_0x142e78['value'][_0x5466('0x45')]('\x20')['length']>0x1){_0x59adb1[_0x5897f2]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5466('0x7b')](_0x142e78[_0x5466('0x7c')]),null);}else{var _0x10c03e='%'+_0x142e78['value']+'%';_0x59adb1[_0x5897f2](_0x5466('0x7d'),_0x10c03e,_0x10c03e,_0x10c03e);}}else{_0xf5b805=_['find'](_0x7833d4,[_0x5466('0x38'),_0x5466('0x7e')]);_0x142e78[_0x5466('0x62')]=_0x5466('0x7e');_0x53ce86=as[_0x5466('0x7f')](_0x33a9e5,_0xf5b805['type'],_0x142e78);_0x59adb1[_0x5897f2](_0x53ce86['text'],_0x53ce86['value'][_0x5466('0x80')],_0x53ce86[_0x5466('0x7c')]['end']);}break;case'Tag':var _0x222eae=_0x142e78[_0x5466('0x7c')][_0x5466('0x45')](',')['map'](function(_0x4a7520){return Number(_0x4a7520);});_0x222eae[_0x5466('0x46')](function(_0x3ad76c){_0x1c95f8['or'](_0x5466('0x81'),'%,'+_0x3ad76c+',%');});_0x46330f=_[_0x5466('0x82')](_0x46330f,_0x222eae);break;case'User':if(_0x142e78[_0x5466('0x79')]==='$substring'){_0x59adb1[_0x5897f2](_0x5466('0x83'),'%'+_0x142e78[_0x5466('0x7c')]+'%',null);}else{_0xf5b805=_[_0x5466('0x76')](_0x7833d4,['name',_0x5466('0x4c')]);_0x142e78[_0x5466('0x62')]='UserId';_0x53ce86=as[_0x5466('0x7f')](_0x33a9e5,_0xf5b805[_0x5466('0x84')],_0x142e78);_0x59adb1[_0x5897f2](_0x53ce86['text'],_0x53ce86[_0x5466('0x7c')][_0x5466('0x80')],_0x53ce86['value'][_0x5466('0x2c')]);}break;case _0x5466('0x3c'):_0x53ce86=as['buildExpression']('me',null,_0x142e78);_0x59adb1[_0x5897f2](_0x53ce86[_0x5466('0x85')],_0x53ce86[_0x5466('0x7c')][_0x5466('0x80')],_0x53ce86[_0x5466('0x7c')][_0x5466('0x2c')]);break;}}else{var _0x53ce86=as['buildExpression'](_0x33a9e5,_0xf5b805[_0x5466('0x84')],_0x142e78);_0x59adb1[_0x5897f2](_0x53ce86[_0x5466('0x85')],_0x53ce86['value']['start'],_0x53ce86['value'][_0x5466('0x2c')]);}}}else{var _0x93bdb9=_(_0x5d35cb[_0x5466('0x56')])[_0x5466('0x57')]()[_0x5466('0x41')](function(_0x4999f3){return _[_0x5466('0x86')](_0x7833d4,[_0x5466('0x38'),_0x4999f3])?_0x4999f3:undefined;})[_0x5466('0x87')]()['value']();if(!_[_0x5466('0x88')](_0x93bdb9)){_0x93bdb9[_0x5466('0x46')](function(_0x370d1c){if(_0x370d1c===_0x5466('0x89')){_0x1fff78[_0x5466('0x5f')](_0x5466('0x8a'),[][_0x5466('0x8b')](_0x5d35cb[_0x5466('0x56')][_0x370d1c]));}else if(_0x370d1c===_0x5466('0x8c')){var _0x2889b9=JSON[_0x5466('0x8d')](_0x5d35cb[_0x5466('0x56')][_0x370d1c])[_0x5466('0x8e')];var _0x49ca7=JSON['parse'](_0x5d35cb[_0x5466('0x56')][_0x370d1c])[_0x5466('0x8f')];_0x1fff78['where'](_0x5466('0x90'),_0x2889b9,_0x49ca7);}else{if(_0x5d35cb[_0x5466('0x56')][_0x370d1c]===_0x5466('0x91')){_0x1fff78[_0x5466('0x5f')]('i.'+_0x370d1c+'\x20IS\x20NULL');}else{_0x1fff78[_0x5466('0x5f')]('i.'+_0x370d1c+_0x5466('0x92'),_0x5d35cb[_0x5466('0x56')][_0x370d1c]);}}});}if(_0x5d35cb[_0x5466('0x56')]['read']){if(_0x5d35cb[_0x5466('0x56')][_0x5466('0x93')]==0x1){_0x1fff78[_0x5466('0x78')]('`unreadMessages`\x20=\x200');}else{_0x1fff78['having'](_0x5466('0x94'));}}if(_0x5d35cb[_0x5466('0x56')][_0x5466('0x95')]){_0x46330f=_[_0x5466('0x96')](_0x5d35cb[_0x5466('0x56')][_0x5466('0x95')])?_0x5d35cb[_0x5466('0x56')][_0x5466('0x95')]:new Array(_0x5d35cb[_0x5466('0x56')][_0x5466('0x95')]);_0x46330f[_0x5466('0x46')](function(_0x53f70f){_0x1c95f8['or'](_0x5466('0x81'),'%,'+_0x53f70f+',%');});}if(_0x5d35cb[_0x5466('0x56')][_0x5466('0x97')]){var _0x38a1fd=_0x5d35cb[_0x5466('0x56')][_0x5466('0x97')]['replace']('\x5c','\x5c\x5c')[_0x5466('0x98')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x38a1fd)){_0x59adb1['or'](_0x5466('0x99'),_0x38a1fd+'%');}else{_0x59adb1['or'](_0x5466('0x9a'),qs[_0x5466('0x7b')](_0x38a1fd))['or'](_0x5466('0x9b'),_0x38a1fd+'%');}}}_0x1fff78[_0x5466('0x5f')](_0x59adb1);_0x1fff78[_0x5466('0x9c')]('i.id');var _0x47fb12={'type':db[_0x5466('0x9d')][_0x5466('0x9e')][_0x5466('0x9f')],'raw':!![]};var _0xe6b78f=_0x1fff78[_0x5466('0xa0')]();_0xe6b78f[_0x5466('0x62')]('i.id');_0xe6b78f['field'](_0x5466('0xa1'),_0x5466('0x77'));if(_0x2ae9cb['order']){_0x2ae9cb[_0x5466('0x5d')]['forEach'](function(_0x20e045){var _0x3d0231=_0x20e045[0x0]===_0x5466('0xa2')?_0x20e045[0x0]:'i.'+_0x20e045[0x0];_0x1fff78[_0x5466('0x5d')](_0x3d0231,_0x20e045[0x1]===_0x5466('0xa3')?![]:!![]);});}if(!_['isEmpty'](_0x46330f)){_0x1fff78[_0x5466('0x78')](_0x1c95f8);_0xe6b78f[_0x5466('0x5f')]('t.id\x20IN\x20?',_0x46330f);}BPromise['resolve']()['then'](function(){if(!_0x342a62){if(_0x5d35cb[_0x5466('0x56')][_0x5466('0x89')])return;_0xe6b78f[_0x5466('0x5f')](_0x5466('0xa4'));_0x1fff78[_0x5466('0x5f')](_0x5466('0xa4'));return;}if(_0x5d35cb[_0x5466('0xa5')][_0x5466('0xa6')]!==_0x5466('0x3d'))return;return _0x5d35cb[_0x5466('0xa5')][_0x5466('0xa7')]({'attributes':['id'],'raw':!![]})[_0x5466('0x21')](function(_0x4f7ae8){if(_[_0x5466('0x88')](_0x4f7ae8)){_0xe6b78f['where'](_0x5466('0xa8'));_0x1fff78[_0x5466('0x5f')](_0x5466('0xa8'));}else{_0xe6b78f['where'](_0x5466('0x8a'),_[_0x5466('0x41')](_0x4f7ae8,'id'));_0x1fff78[_0x5466('0x5f')]('i.ChatWebsiteId\x20IN\x20?',_[_0x5466('0x41')](_0x4f7ae8,'id'));}});})[_0x5466('0x21')](function(){if(_0x5d35cb['user']['role']===_0x5466('0x3d')&&!_0x342a62&&!_0x5d35cb['query'][_0x5466('0x89')])return[];return db[_0x5466('0xa9')][_0x5466('0x56')](_0xe6b78f[_0x5466('0xaa')](),_0x47fb12);})['then'](function(_0x1c16f4){_0x3a2fca[_0x5466('0x32')]=_0x1c16f4[_0x5466('0x5a')];if(_0x3a2fca['count']===0x0)return[];return db[_0x5466('0xa9')][_0x5466('0x56')](_0x4f262a[_0x5466('0xaa')](),_0x47fb12)[_0x5466('0x21')](function(_0x90070){_0x5e9eb0=_['keyBy'](_0x90070,'id');_0x47fb12=_['merge'](_0x47fb12,{'model':db[_0x5466('0x51')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d35cb['query'][_0x5466('0xab')]){_0x2ae9cb[_0x5466('0x59')][_0x5466('0x46')](function(_0x1beb22){_0x1fff78[_0x5466('0x62')]('i.'+_0x1beb22);});}else{_0x1fff78[_0x5466('0x62')](_0x5466('0xa1'),_0x5466('0x77'));_0x1fff78[_0x5466('0x62')](_0x5466('0xac'),_0x5466('0xad'));_0x1fff78['field']('a.mandatoryDisposition',_0x5466('0xae'));_0x1fff78[_0x5466('0x62')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x5466('0xa2'));_0x1fff78['field']('i.*');_0x1fff78[_0x5466('0x62')](_0x5466('0xaf'),_0x5466('0xb0'));_0x1fff78[_0x5466('0x62')](_0x5466('0xb1'),_0x5466('0xb2'));_0x1fff78[_0x5466('0x62')](_0x5466('0xb3'),'Contact.email');_0x1fff78['field']('c.phone',_0x5466('0xb4'));_0x1fff78[_0x5466('0x62')]('c.mobile','Contact.mobile');_0x1fff78[_0x5466('0x62')](_0x5466('0xb5'),'Contact.fax');_0x1fff78['field'](_0x5466('0xb6'),_0x5466('0xb7'));_0x1fff78[_0x5466('0x62')]('o.internal',_0x5466('0xb8'));_0x1fff78[_0x5466('0x62')](_0x5466('0xb9'),_0x5466('0x43'));}if(_0x2ae9cb[_0x5466('0x30')])_0x1fff78[_0x5466('0x30')](_0x2ae9cb[_0x5466('0x30')]);if(_0x2ae9cb['offset'])_0x1fff78[_0x5466('0x2f')](_0x2ae9cb['offset']);return db[_0x5466('0xa9')][_0x5466('0x56')](_0x1fff78[_0x5466('0xaa')](),_0x47fb12);})[_0x5466('0x21')](function(_0xfc6734){if(_0xfc6734[_0x5466('0x5a')]>0x0)_0x3bf705[_0x5466('0x5f')](_0x5466('0xba'),_[_0x5466('0x41')](_0xfc6734,'id'));return db[_0x5466('0xa9')][_0x5466('0x56')](_0x3bf705[_0x5466('0xaa')](),_0x47fb12)['then'](function(_0x11850c){var _0x51197d=_[_0x5466('0xbb')](_0x11850c,_0x5466('0xbc'));var _0x1aa972=[];_0xfc6734['forEach'](function(_0x4f3a2d){_0x1aa972[_0x5466('0x47')](updateChatInteraction(_0x4f3a2d,_0x5e9eb0,_0x51197d));});return BPromise[_0x5466('0xbd')](_0x1aa972);});});})['then'](function(_0xe7411c){_0x3a2fca['rows']=_0xe7411c;return _0x3a2fca;})[_0x5466('0x21')](respondWithFilteredResult(_0x42e8cf,_0x2ae9cb))['catch'](handleError(_0x42e8cf,null));};exports[_0x5466('0xbe')]=function(_0x1773a6,_0x2a0507){var _0x465d68={'raw':![],'where':{'id':_0x1773a6[_0x5466('0xbf')]['id']}},_0x27b7ec={};_0x27b7ec[_0x5466('0x55')]=_[_0x5466('0x57')](db['ChatInteraction'][_0x5466('0x52')]);_0x27b7ec[_0x5466('0x56')]=_[_0x5466('0x57')](_0x1773a6['query']);_0x27b7ec['filters']=_[_0x5466('0x58')](_0x27b7ec['model'],_0x27b7ec[_0x5466('0x56')]);_0x465d68[_0x5466('0x59')]=_[_0x5466('0x58')](_0x27b7ec['model'],qs[_0x5466('0xab')](_0x1773a6[_0x5466('0x56')][_0x5466('0xab')]));_0x465d68['attributes']=_0x465d68[_0x5466('0x59')]['length']?_0x465d68[_0x5466('0x59')]:_0x27b7ec[_0x5466('0x55')];if(_0x1773a6['query'][_0x5466('0xc0')]){_0x465d68['include']=[{'all':!![]}];}_0x465d68=_[_0x5466('0x3b')]({},_0x465d68,_0x1773a6[_0x5466('0xc1')]);return db[_0x5466('0x51')]['find'](_0x465d68)['then'](handleEntityNotFound(_0x2a0507,null))[_0x5466('0x21')](respondWithResult(_0x2a0507,null))['catch'](handleError(_0x2a0507,null));};exports[_0x5466('0xc2')]=function(_0x1df4ff,_0x560d07){return db[_0x5466('0x51')][_0x5466('0xc2')](_0x1df4ff['body'],{})['then'](respondWithResult(_0x560d07,0xc9))[_0x5466('0x2b')](handleError(_0x560d07,null));};exports['update']=function(_0x5e22c9,_0x5be413){if(_0x5e22c9[_0x5466('0x3c')]['id']){delete _0x5e22c9[_0x5466('0x3c')]['id'];}return db[_0x5466('0x51')][_0x5466('0x76')]({'where':{'id':_0x5e22c9[_0x5466('0xbf')]['id']}})['then'](handleEntityNotFound(_0x5be413,null))['then'](saveUpdates(_0x5e22c9[_0x5466('0x3c')],null))[_0x5466('0x21')](respondWithResult(_0x5be413,null))[_0x5466('0x2b')](handleError(_0x5be413,null));};exports[_0x5466('0x37')]=function(_0x378e5e,_0x106aae){return db[_0x5466('0x51')][_0x5466('0x76')]({'where':{'id':_0x378e5e[_0x5466('0xbf')]['id']}})['then'](handleEntityNotFound(_0x106aae,null))[_0x5466('0x21')](removeEntity(_0x106aae,null))[_0x5466('0x2b')](handleError(_0x106aae,null));};exports[_0x5466('0xc3')]=function(_0x21ea78,_0x54aabd){return db[_0x5466('0x51')][_0x5466('0xc3')]()[_0x5466('0x21')](respondWithResult(_0x54aabd,null))['catch'](handleError(_0x54aabd,null));};exports[_0x5466('0xc4')]=function(_0x158080,_0x2dda3e){var _0x205f2d=_0x158080[_0x5466('0xbf')]['id'];var _0x3dad05;var _0x8eda1a;var _0x4080af;return db['ChatInteraction'][_0x5466('0xc5')]({'where':{'id':_0x205f2d}})[_0x5466('0x21')](function(_0x2d57f1){_0x3dad05=_0x2d57f1;return db[_0x5466('0xc6')]['findOne']({'where':{'id':_0x2d57f1[_0x5466('0x89')]},'attributes':['id',_0x5466('0xc7'),_0x5466('0xc8'),_0x5466('0xc9'),'vidaooNote',_0x5466('0xca')],'raw':!![]});})[_0x5466('0x21')](function(_0x449c11){if(_0x449c11&&_0x449c11['vidaooApiKey']&&_0x449c11[_0x5466('0xc8')]){_0x8eda1a=_0x449c11;var _0x52c4e3={'interaction':{'id':_0x205f2d},'agent':{'id':_0x158080[_0x5466('0xa5')]['id'],'name':_0x158080['user']['name'],'fullname':_0x158080[_0x5466('0xa5')][_0x5466('0x42')],'email':_0x158080['user']['email']},'contact':_0x158080[_0x5466('0x3c')]['contact'],'account':_0x158080[_0x5466('0x3c')]['account']};var _0x36cba0={'rejectUnauthorized':![],'method':'POST','url':_0x5466('0xcb'),'headers':{'X-APIKEY':_0x449c11[_0x5466('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x158080[_0x5466('0xa5')][_0x5466('0xcc')]],'buttons':null,'topic':_0x8eda1a[_0x5466('0xc9')],'note':_['isNull'](_0x8eda1a['vidaooNote'])?null:getMustacheRender(_0x8eda1a[_0x5466('0xcd')],_0x52c4e3),'metadata':null},'redirect':_0x5466('0xce'),'json':!![]};try{if(!_['isNull'](_0x8eda1a['vidaooMetadata'])){var _0x3cfa53=getMustacheRender(_0x8eda1a[_0x5466('0xca')],_0x52c4e3);var _0x339ee6=JSON['parse'](_0x3cfa53);_0x36cba0[_0x5466('0x3c')][_0x5466('0xcf')]=_0x339ee6;}}catch(_0x2c85f6){throw new db[(_0x5466('0x9d'))][(_0x5466('0xd0'))](_0x5466('0xd1'));}return rp(_0x36cba0);}else{throw new db[(_0x5466('0x9d'))]['ValidationError'](_0x5466('0xd2'));}})['then'](function(_0x658c4c){_0x4080af=_0x658c4c;if(_0x4080af['id']){var _0x2bdfe7={'body':_0x4080af[_0x5466('0xd3')],'ChatWebsiteId':_0x8eda1a['id'],'ChatInteractionId':_0x3dad05['id'],'direction':'out','UserId':_0x158080[_0x5466('0xa5')]['id']};return db['ChatMessage'][_0x5466('0xc2')](_0x2bdfe7,{});}else{throw new db[(_0x5466('0x9d'))][(_0x5466('0xd0'))](_0x5466('0xd4'));}})['then'](function(){return _0x3dad05[_0x5466('0xd5')]({'vidaooSessionId':_0x4080af['id']});})[_0x5466('0x21')](respondWithResult(_0x2dda3e,null))['catch'](handleError(_0x2dda3e,null));};exports['customUpdate']=function(_0x5406a3,_0x216165){if(_0x5406a3[_0x5466('0x3c')]['id']){delete _0x5406a3[_0x5466('0x3c')]['id'];}return db[_0x5466('0x51')][_0x5466('0x76')]({'where':{'id':_0x5406a3[_0x5466('0xbf')]['id']},'include':[{'model':db[_0x5466('0xd6')],'as':_0x5466('0xd7')}]})[_0x5466('0x21')](handleEntityNotFound(_0x216165,null))[_0x5466('0x21')](saveUpdates(_0x5406a3[_0x5466('0x3c')],null))['then'](respondWithResult(_0x216165,null))[_0x5466('0x2b')](handleError(_0x216165,null));};exports['abandon']=function(_0x3bd049,_0x815b91,_0x4ac906){if(_0x3bd049[_0x5466('0x3c')]['id']){delete _0x3bd049['body']['id'];}return db[_0x5466('0x51')]['find']({'where':{'id':_0x3bd049[_0x5466('0xbf')]['id']}})[_0x5466('0x21')](function(_0x1d55b4){if(!_0x1d55b4){logger[_0x5466('0x27')](_0x5466('0xd8'),_0x5466('0xd9'),0x194,_0x5466('0xda'));_0x815b91['sendStatus'](0x194);}else{if(_0x1d55b4['UserId']){throw new db[(_0x5466('0x9d'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x1d55b4;})[_0x5466('0x21')](function(_0x240de8){if(_0x240de8){return _0x240de8['update']({'closed':_0x3bd049[_0x5466('0x3c')][_0x5466('0x4d')],'disposition':_0x3bd049['body'][_0x5466('0x4f')]})[_0x5466('0x21')](function(_0x27c68a){return _0x27c68a;});}})[_0x5466('0x21')](function(_0x1cf443){return respondWithRpcPromise(_0x5466('0xdb'),_0x5466('0xd9'),_0x3bd049['body'],client9004);})[_0x5466('0x21')](respondWithResult(_0x815b91,null))[_0x5466('0x2b')](handleError(_0x815b91,null));};exports[_0x5466('0xdc')]=function(_0x1533d6,_0x4f54d4,_0x1a1802){_0x1533d6[_0x5466('0x3c')][_0x5466('0x38')]=_0x1533d6[_0x5466('0xdd')][_0x5466('0xde')];_0x1533d6[_0x5466('0x3c')][_0x5466('0xdf')]=_0x1533d6['file'][_0x5466('0xe0')];_0x1533d6[_0x5466('0x3c')][_0x5466('0x84')]=_0x1533d6[_0x5466('0xdd')][_0x5466('0xe1')];return db[_0x5466('0xe2')]['create'](_0x1533d6[_0x5466('0x3c')])[_0x5466('0x21')](respondWithResult(_0x4f54d4,0xc9))[_0x5466('0x2b')](handleError(_0x4f54d4,null));};exports[_0x5466('0xe3')]=function(_0x55a126,_0x8f2641,_0x585d72){return db[_0x5466('0x51')][_0x5466('0xc5')]({'where':{'id':_0x55a126[_0x5466('0xbf')]['id']},'raw':!![]})[_0x5466('0x21')](handleEntityNotFound(_0x8f2641,null))['then'](function(_0x17f2ca){if(_0x17f2ca){if(_0x17f2ca[_0x5466('0x4d')]){return _0x8f2641['status'](0x193)[_0x5466('0x2e')]({'status':0x193,'message':_0x5466('0xe4')});}return db[_0x5466('0xe2')][_0x5466('0xc5')]({'where':{'id':_0x55a126[_0x5466('0x56')]['attachId']},'raw':!![]})[_0x5466('0x21')](handleEntityNotFound(_0x8f2641,null));}})[_0x5466('0x21')](function(_0x37598f){if(_0x37598f){var _0x237263=_0x37598f[_0x5466('0xe5')]!==null;var _0x50cbb8=path[_0x5466('0xe6')](config[_0x5466('0xe7')],_0x5466('0xe8'));if(_0x237263){_0x50cbb8=path['join'](_0x50cbb8,_0x5466('0xe9'));}var _0x527a9d=path[_0x5466('0xe6')](_0x50cbb8,_0x37598f[_0x5466('0xdf')]);return _0x8f2641['download'](_0x527a9d);}})[_0x5466('0x2b')](handleError(_0x8f2641,null));};exports[_0x5466('0xea')]=function(_0x5d264d,_0x1199b4){var _0x1bdd89=null;var _0x2996ca=null;var _0x4a2cd8=null;var _0x1e082b=null;if(_0x5d264d[_0x5466('0x3c')]['id']){delete _0x5d264d[_0x5466('0x3c')]['id'];}if(_0x5d264d[_0x5466('0x3c')]['mailTranscript']){_0x1e082b=path[_0x5466('0xe6')](config[_0x5466('0xe7')],_0x5466('0xeb'),util['format'](_0x5466('0xec'),Date['now']()));_0x5d264d[_0x5466('0x3c')]['pathTranscript']=_0x1e082b;}return db[_0x5466('0x51')]['find']({'where':{'id':_0x5d264d[_0x5466('0xbf')]['id']},'include':[{'model':db[_0x5466('0xed')],'as':'Messages','include':[{'model':db[_0x5466('0xee')],'as':_0x5466('0xee')}]}]})[_0x5466('0x21')](handleEntityNotFound(_0x1199b4,null))[_0x5466('0x21')](saveUpdates(_0x5d264d[_0x5466('0x3c')],null))['then'](function(_0x15b51f){if(_0x15b51f){_0x1bdd89=_0x15b51f;return db[_0x5466('0xc6')][_0x5466('0x76')]({'where':{'id':_0x1bdd89[_0x5466('0x89')]}});}})[_0x5466('0x21')](function(_0x3b231c){if(_0x3b231c){_0x4a2cd8=_0x3b231c;return db[_0x5466('0xd6')][_0x5466('0x76')]({'where':{'id':_0x1bdd89[_0x5466('0x7e')]}});}})[_0x5466('0x21')](function(_0x5c5f98){if(_0x5c5f98){_0x2996ca=_0x5c5f98;if(_0x1e082b){var _0x5a086f=null;for(var _0x2804cc=0x1;_0x2804cc<_0x1bdd89['Messages'][_0x5466('0x5a')];++_0x2804cc){_0x5a086f=_0x1bdd89['Messages'][_0x2804cc];var _0x245a4b=_0x5a086f[_0x5466('0x4c')]?util[_0x5466('0xef')](_0x5466('0xf0'),_0x4a2cd8[_0x5466('0xf1')],_0x5a086f['UserId']):_0x5466('0xf2');var _0x24cefe=_0x5d264d[_0x5466('0x3c')][_0x5466('0xf3')]||util[_0x5466('0xef')](_0x5466('0xf0'),'Visitor',_0x5a086f['ContactId']);switch(_0x4a2cd8[_0x5466('0xf4')]){case _0x5466('0xf5'):_0x245a4b=_0x5a086f['UserId']?util['format'](_0x5466('0xf0'),_0x4a2cd8[_0x5466('0xf1')],_0x5a086f[_0x5466('0x4c')]):'System';break;case _0x5466('0xf6'):_0x245a4b=_0x5a086f[_0x5466('0x4c')]?_0x5a086f[_0x5466('0xee')][_0x5466('0xf7')]||_0x5a086f['User'][_0x5466('0x42')]:_0x5466('0xf2');break;case'agent_fullname':_0x245a4b=_0x5a086f[_0x5466('0x4c')]?_0x5a086f['User'][_0x5466('0x42')]:_0x5466('0xf2');break;default:_0x245a4b=_0x5a086f['UserId']?util[_0x5466('0xef')](_0x5466('0xf0'),_0x4a2cd8[_0x5466('0xf1')],_0x5a086f[_0x5466('0x4c')]):_0x5466('0xf2');}var _0x3d90d4=util[_0x5466('0xef')](_0x5466('0xf8'),moment(_0x5a086f['createdAt'])[_0x5466('0xef')](_0x5466('0xf9')),_0x5a086f[_0x5466('0xfa')]==='in'?_0x24cefe:_0x245a4b,_0x5a086f['body']);if(!_0x5a086f[_0x5466('0xfb')]){fs[_0x5466('0xfc')](_0x1e082b,_0x3d90d4);}}return db[_0x5466('0xfd')][_0x5466('0xc5')]({'where':{'service':!![]},'include':[{'model':db[_0x5466('0xfe')],'as':_0x5466('0xff'),'raw':!![]}]});}}})[_0x5466('0x21')](function(_0x2a6e4e){if(_0x2a6e4e&&_0x2a6e4e[_0x5466('0xff')]&&_0x5d264d['body']){var _0x20b80b={'tls':{'rejectUnauthorized':![]}};if(_0x2a6e4e[_0x5466('0xff')][_0x5466('0x100')]){_0x20b80b['service']=_0x2a6e4e[_0x5466('0xff')][_0x5466('0x100')];}else{_0x20b80b[_0x5466('0x101')]=_0x2a6e4e[_0x5466('0xff')][_0x5466('0x101')];_0x20b80b[_0x5466('0x102')]=_0x2a6e4e[_0x5466('0xff')]['port'];_0x20b80b[_0x5466('0x103')]=_0x2a6e4e[_0x5466('0xff')][_0x5466('0x103')];}if(_0x2a6e4e['Smtp']['authentication']){_0x20b80b[_0x5466('0x104')]={'user':_0x2a6e4e[_0x5466('0xff')][_0x5466('0xa5')],'pass':_0x2a6e4e[_0x5466('0xff')][_0x5466('0x105')]};}return respondWithRpcPromise(_0x5466('0x106'),_0x5466('0x107'),{'account':_0x20b80b,'message':{'from':util[_0x5466('0xef')](_0x5466('0x108'),_0x2a6e4e[_0x5466('0x38')],_0x2a6e4e[_0x5466('0xcc')]||_0x2a6e4e[_0x5466('0xff')][_0x5466('0xa5')]),'to':_0x5d264d[_0x5466('0x3c')][_0x5466('0x109')],'subject':_0x5466('0x10a'),'text':util[_0x5466('0xef')](_0x5466('0x10b'),_0x5d264d['body'][_0x5466('0x109')]),'attachments':[{'path':_0x1e082b}]}})[_0x5466('0x21')](function(){return _0x1bdd89;})[_0x5466('0x2b')](function(_0x2cc583){console[_0x5466('0x27')](_0x2cc583);});}else{return _0x1bdd89;}})['then'](respondWithStatusCode(_0x1199b4,0xc8))[_0x5466('0x2b')](handleError(_0x1199b4,null));};exports[_0x5466('0x10c')]=function(_0x5939b5,_0x40fddc,_0x2f3672){return db[_0x5466('0xed')][_0x5466('0x76')]({'where':{'id':_0x5939b5[_0x5466('0xbf')]['id']}})[_0x5466('0x21')](handleEntityNotFound(_0x40fddc,null))[_0x5466('0x21')](function(_0x70cace){if(_0x70cace){return _0x70cace[_0x5466('0x10c')](_0x5939b5[_0x5466('0x3c')]['ids'],_['omit'](_0x5939b5[_0x5466('0x3c')],[_0x5466('0x10d'),'id'])||{});}})[_0x5466('0x21')](respondWithResult(_0x40fddc,null))[_0x5466('0x2b')](handleError(_0x40fddc,null));};exports[_0x5466('0x10e')]=function(_0x13181e,_0x3fe4ef,_0x4b8a30){var _0x246223={'raw':![],'where':{}};var _0x419f76={};var _0x17640b={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5466('0xc5')]({'where':{'id':_0x13181e[_0x5466('0xbf')]['id']}})['then'](handleEntityNotFound(_0x3fe4ef,null))['then'](function(_0x481ad2){if(_0x481ad2){_0x419f76['model']=_[_0x5466('0x57')](db[_0x5466('0xed')][_0x5466('0x52')]);_0x419f76['query']=_[_0x5466('0x57')](_0x13181e[_0x5466('0x56')]);_0x419f76[_0x5466('0x60')]=_[_0x5466('0x58')](_0x419f76['model'],_0x419f76[_0x5466('0x56')]);_0x246223[_0x5466('0x59')]=_[_0x5466('0x58')](_0x419f76[_0x5466('0x55')],qs[_0x5466('0xab')](_0x13181e[_0x5466('0x56')][_0x5466('0xab')]));_0x246223[_0x5466('0x59')]=_0x246223[_0x5466('0x59')]['length']?_0x246223[_0x5466('0x59')]:_0x419f76[_0x5466('0x55')];if(!_0x13181e[_0x5466('0x56')][_0x5466('0x5b')](_0x5466('0x5c'))){_0x246223[_0x5466('0x30')]=qs[_0x5466('0x30')](_0x13181e[_0x5466('0x56')]['limit']);_0x246223[_0x5466('0x2f')]=qs[_0x5466('0x2f')](_0x13181e[_0x5466('0x56')][_0x5466('0x2f')]);}_0x246223[_0x5466('0x5d')]=qs[_0x5466('0x5e')](_0x13181e[_0x5466('0x56')][_0x5466('0x5e')]);_0x246223['where']=qs[_0x5466('0x60')](_[_0x5466('0x10f')](_0x13181e[_0x5466('0x56')],_0x419f76[_0x5466('0x60')]));_0x246223[_0x5466('0x5f')][_0x5466('0xbc')]=_0x481ad2['id'];if(_0x13181e[_0x5466('0x56')]['filter']){_0x246223[_0x5466('0x5f')]=_[_0x5466('0x3b')](_0x246223['where'],{'$or':_[_0x5466('0x41')](_0x246223[_0x5466('0x59')],function(_0x5c23c5){var _0x274e19={};_0x274e19[_0x5c23c5]={'$like':'%'+_0x13181e['query']['filter']+'%'};return _0x274e19;})});}if(_0x13181e[_0x5466('0x56')][_0x5466('0x8e')]){var _0x57eab7=_0x13181e[_0x5466('0x56')][_0x5466('0x8e')][_0x5466('0x45')](',');var _0x45113a={};_0x45113a[_0x57eab7[0x0]]={'$gte':moment(_0x57eab7[0x1])['format'](_0x5466('0x110'))};_0x246223[_0x5466('0x5f')]=_['merge'](_0x246223[_0x5466('0x5f')],_0x45113a);}_0x246223=_[_0x5466('0x3b')]({},_0x246223,_0x13181e[_0x5466('0xc1')]);return db['ChatMessage'][_0x5466('0x32')]({'where':_0x246223['where']})[_0x5466('0x21')](function(_0x373497){_0x17640b[_0x5466('0x32')]=_0x373497;if(_0x13181e['query'][_0x5466('0xc0')]){_0x246223[_0x5466('0x111')]=[{'all':!![]}];}return db['ChatMessage'][_0x5466('0x112')](_0x246223);})[_0x5466('0x21')](function(_0x54c907){_0x17640b[_0x5466('0x113')]=_0x54c907;return _0x17640b;});}})[_0x5466('0x21')](respondWithFilteredResult(_0x3fe4ef,_0x246223))[_0x5466('0x2b')](handleError(_0x3fe4ef,null));};exports[_0x5466('0x114')]=function(_0x59dff3,_0xced3f2,_0x59e5d4){var _0x222ad8={'where':{}},_0x1a86c8={},_0x2109c6={'count':0x0,'rows':[]};return db[_0x5466('0x51')][_0x5466('0xc5')]({'where':{'id':_0x59dff3[_0x5466('0xbf')]['id']}})[_0x5466('0x21')](handleEntityNotFound(_0xced3f2,null))[_0x5466('0x21')](function(_0x589b01){if(_0x589b01){_0x1a86c8[_0x5466('0x55')]=_['keys'](db[_0x5466('0xed')][_0x5466('0x52')]);_0x1a86c8[_0x5466('0x56')]=_[_0x5466('0x57')](_0x59dff3[_0x5466('0x56')]);_0x1a86c8[_0x5466('0x60')]=_[_0x5466('0x58')](_0x1a86c8[_0x5466('0x55')],_0x1a86c8['query']);_0x222ad8[_0x5466('0x59')]=_[_0x5466('0x58')](_0x1a86c8[_0x5466('0x55')],qs[_0x5466('0xab')](_0x59dff3[_0x5466('0x56')][_0x5466('0xab')]));_0x222ad8[_0x5466('0x59')]=_0x222ad8[_0x5466('0x59')]['length']?_0x222ad8[_0x5466('0x59')]:_0x1a86c8['model'];if(!_0x59dff3[_0x5466('0x56')][_0x5466('0x5b')]('nolimit')){_0x222ad8[_0x5466('0x30')]=qs[_0x5466('0x30')](_0x59dff3['query']['limit']);_0x222ad8[_0x5466('0x2f')]=qs[_0x5466('0x2f')](_0x59dff3[_0x5466('0x56')][_0x5466('0x2f')]);}_0x222ad8['order']=qs[_0x5466('0x5e')](_0x59dff3[_0x5466('0x56')]['sort']);_0x222ad8['where']=qs[_0x5466('0x60')](_[_0x5466('0x10f')](_0x59dff3[_0x5466('0x56')],_0x1a86c8[_0x5466('0x60')]));_0x222ad8[_0x5466('0x5f')][_0x5466('0xbc')]=_0x589b01['id'];if(_0x59dff3[_0x5466('0x56')][_0x5466('0x97')]){_0x222ad8['where']=_[_0x5466('0x3b')](_0x222ad8[_0x5466('0x5f')],{'$or':_[_0x5466('0x41')](_0x222ad8[_0x5466('0x59')],function(_0x3616a1){var _0x4e7bd8={};_0x4e7bd8[_0x3616a1]={'$like':'%'+_0x59dff3[_0x5466('0x56')][_0x5466('0x97')]+'%'};return _0x4e7bd8;})});}_0x222ad8[_0x5466('0x5f')][_0x5466('0xfb')]=![];if(_0x59dff3[_0x5466('0x56')]['id']){_0x222ad8[_0x5466('0x5f')]['id']={'$gt':_0x59dff3['query']['id']};}_0x222ad8=_[_0x5466('0x3b')]({},_0x222ad8,_0x59dff3[_0x5466('0xc1')]);return db[_0x5466('0xed')][_0x5466('0x32')]({'where':_0x222ad8[_0x5466('0x5f')]})[_0x5466('0x21')](function(_0x6c108c){_0x2109c6[_0x5466('0x32')]=_0x6c108c;_0x222ad8[_0x5466('0x111')]=[];if(_0x59dff3[_0x5466('0x56')][_0x5466('0x115')]){_0x222ad8['include']['push']({'model':db[_0x5466('0xee')],'as':_0x5466('0xee'),'attributes':['id','fullname',_0x5466('0xf7')]});}if(_0x59dff3[_0x5466('0x56')][_0x5466('0xc0')]){_0x222ad8[_0x5466('0x111')]=[{'all':!![]}];}return db['ChatMessage'][_0x5466('0x112')](_0x222ad8);})[_0x5466('0x21')](function(_0x2998f2){_0x2109c6[_0x5466('0x113')]=_0x2998f2;return _0x2109c6;});}})[_0x5466('0x21')](respondWithFilteredResult(_0xced3f2,_0x222ad8))[_0x5466('0x2b')](handleError(_0xced3f2,null));};exports['addTags']=function(_0x1c9a50,_0x2f4e1c,_0x24b849){return db[_0x5466('0x51')]['find']({'where':{'id':_0x1c9a50[_0x5466('0xbf')]['id']}})[_0x5466('0x21')](handleEntityNotFound(_0x2f4e1c,null))[_0x5466('0x21')](function(_0x47f521){if(_0x47f521){return _0x47f521[_0x5466('0x116')](_0x1c9a50['body'][_0x5466('0x10d')],_[_0x5466('0x117')](_0x1c9a50['body'],[_0x5466('0x10d'),'id'])||{})[_0x5466('0x118')](function(){return db['Tag'][_0x5466('0x112')]({'attributes':['id',_0x5466('0x38'),_0x5466('0x63')],'where':{'id':_0x1c9a50[_0x5466('0x3c')][_0x5466('0x10d')]}});})[_0x5466('0x21')](function(_0x107ba3){socket[_0x5466('0x119')]('chatInteractionTags:save',{'id':Number(_0x1c9a50[_0x5466('0xbf')]['id']),'tags':_0x107ba3||[]});return{'id':Number(_0x1c9a50[_0x5466('0xbf')]['id']),'tags':_0x107ba3||[]};});}})[_0x5466('0x21')](respondWithResult(_0x2f4e1c,null))[_0x5466('0x2b')](handleError(_0x2f4e1c,null));};exports['removeTags']=function(_0x3e0dd4,_0x45a7e2,_0x11ea6b){return db['ChatInteraction'][_0x5466('0x76')]({'where':{'id':_0x3e0dd4[_0x5466('0xbf')]['id']}})['then'](handleEntityNotFound(_0x45a7e2,null))[_0x5466('0x21')](function(_0x408ac7){if(_0x408ac7){return _0x408ac7[_0x5466('0x11a')](_0x3e0dd4[_0x5466('0x56')][_0x5466('0x10d')]);}})[_0x5466('0x21')](respondWithStatusCode(_0x45a7e2,null))[_0x5466('0x2b')](handleError(_0x45a7e2,null));};exports[_0x5466('0x11b')]=function(_0x2921e2,_0x2ef53d){var _0x4a59eb=moment()[_0x5466('0x11c')]()[_0x5466('0xaa')]();var _0x5ec641=path[_0x5466('0xe6')](config[_0x5466('0xe7')],'server',_0x5466('0x11d'),_0x5466('0x11e'));var _0x1fd3b0=path[_0x5466('0xe6')](config[_0x5466('0xe7')],_0x5466('0x11f'),'files',_0x5466('0x120'));var _0x21dfaf=path[_0x5466('0xe6')](_0x5ec641,_0x4a59eb);var _0x48592a=util[_0x5466('0xef')](_0x5466('0x121'),_0x2921e2['params']['id'],_0x4a59eb);var _0x966d56=path[_0x5466('0xe6')](_0x5ec641,_0x48592a);var _0x4ef839=[];_0x4ef839[_0x5466('0x47')]({'model':db[_0x5466('0xee')],'as':_0x5466('0xee'),'attributes':['id',_0x5466('0x42')],'raw':!![]});_0x4ef839['push']({'model':db[_0x5466('0xd6')],'as':_0x5466('0xd7'),'attributes':['id',_0x5466('0x122'),_0x5466('0x123')],'raw':!![]});if(_0x2921e2[_0x5466('0x56')]['attachments']){_0x4ef839[_0x5466('0x47')]({'model':db['Attachment'],'as':_0x5466('0xe2'),'raw':!![]});}var _0x79707e=[{'model':db[_0x5466('0xed')],'as':'Messages','attributes':['id',_0x5466('0x3c'),'createdAt',_0x5466('0xfa'),'secret',_0x5466('0x93')],'include':_0x4ef839}];_0x79707e[_0x5466('0x47')]({'model':db[_0x5466('0xc6')],'as':_0x5466('0x124'),'attributes':['id',_0x5466('0x38')]});_0x79707e[_0x5466('0x47')]({'model':db['User'],'as':_0x5466('0x125'),'attributes':['id',_0x5466('0x42')]});return db[_0x5466('0x51')][_0x5466('0x76')]({'where':{'id':_0x2921e2[_0x5466('0xbf')]['id']},'include':_0x79707e})[_0x5466('0x21')](handleEntityNotFound(_0x2ef53d,null))[_0x5466('0x21')](function(_0x49e429){if(_0x49e429){var _0x3bae1d=_0x49e429[_0x5466('0x126')]({'plain':!![]});fs['mkdirSync'](_0x21dfaf);var _0x3af2ab={'channel':_0x5466('0x127'),'account':_0x3bae1d[_0x5466('0x124')][_0x5466('0x38')],'agent':_0x3bae1d[_0x5466('0x125')]?_0x3bae1d[_0x5466('0x125')][_0x5466('0x42')]:'N.A.','createdAt':moment(_0x3bae1d[_0x5466('0x8c')])[_0x5466('0xef')](_0x5466('0x110'))[_0x5466('0xaa')](),'closedAt':_0x3bae1d[_0x5466('0x4d')]?moment(_0x3bae1d[_0x5466('0x128')])[_0x5466('0xef')](_0x5466('0x110'))['toString']():'','disposition':_0x3bae1d['disposition'],'chatInfo':{'browser':_0x3bae1d[_0x5466('0x129')],'os':_0x3bae1d['osName'],'referer':_0x3bae1d['referer'],'customerIp':_0x3bae1d['customerIp'],'customerPort':_0x3bae1d['customerPort']?_0x3bae1d[_0x5466('0x12a')]:_0x5466('0x12b')},'messages':_(_0x3bae1d[_0x5466('0x12c')])[_0x5466('0x12d')]()[_0x5466('0x97')]({'secret':![]})[_0x5466('0x41')](function(_0x50f966){if(_0x50f966[_0x5466('0xe2')]){var _0x434bb2=path[_0x5466('0xe6')](_0x1fd3b0,_0x50f966['Attachment'][_0x5466('0xdf')]);if(fs[_0x5466('0x12e')](_0x434bb2)){fs[_0x5466('0x12f')](_0x434bb2)[_0x5466('0x130')](fs[_0x5466('0x131')](path['join'](_0x21dfaf,_0x50f966[_0x5466('0xe2')][_0x5466('0xdf')])));}}return{'date':moment(_0x50f966[_0x5466('0x8c')])[_0x5466('0xef')](_0x5466('0x110'))[_0x5466('0xaa')](),'sender':_0x50f966[_0x5466('0xfa')]===_0x5466('0x132')?_0x50f966[_0x5466('0xee')]?_0x50f966[_0x5466('0xee')][_0x5466('0x42')]:_0x5466('0xf2'):_0x50f966['Contact'][_0x5466('0x122')]+(_0x50f966[_0x5466('0xd7')][_0x5466('0x123')]?'\x20'+_0x50f966[_0x5466('0xd7')][_0x5466('0x123')]:''),'body':_0x50f966[_0x5466('0xe2')]?_0x50f966[_0x5466('0xe2')][_0x5466('0xdf')]:_0x50f966[_0x5466('0x3c')],'direction':_0x50f966[_0x5466('0xfa')]==='out'?'A':'C','secret':_0x50f966[_0x5466('0xfb')],'read':_0x50f966[_0x5466('0x93')],'attachment':_0x50f966[_0x5466('0xe2')]};})['value']()};return ejs[_0x5466('0x133')](path[_0x5466('0xe6')](config[_0x5466('0xe7')],_0x5466('0x11f'),_0x5466('0x134'),_0x5466('0x135')),{'interaction':_0x3af2ab})[_0x5466('0x21')](function(_0x3e3e7b){var _0x56018b=path[_0x5466('0xe6')](_0x21dfaf,_0x5466('0x136')+_0x3bae1d['id']+'-'+_0x4a59eb+_0x5466('0x137'));var _0x50f1e7={'path':_0x56018b,'channel':_0x5466('0x127'),'interactionId':_0x3bae1d['id']};return pdf[_0x5466('0x138')](_0x3e3e7b,_0x50f1e7);})[_0x5466('0x21')](function(){return new BPromise(function(_0x562da7,_0x82554b){zipdir(_0x21dfaf,{'saveTo':_0x966d56},function(_0x47aa4f,_0x19c49a){if(_0x47aa4f)return _0x82554b(_0x47aa4f);return _0x562da7(_0x19c49a);});})[_0x5466('0x21')](function(){return new BPromise(function(_0x50d2e7,_0x3b2f76){rimraf(_0x21dfaf,function(_0x292541){if(_0x292541)_0x3b2f76(_0x292541);return _0x50d2e7();});});})[_0x5466('0x21')](function(){return _0x2ef53d[_0x5466('0x11b')](_0x966d56,_0x48592a,function(_0x20d74c){if(_0x20d74c){console[_0x5466('0x139')](_0x5466('0x13a'),_0x20d74c);}else{fs[_0x5466('0x13b')](_0x966d56);}});});});}else{return _0x2ef53d[_0x5466('0x13c')](0xc8);}})[_0x5466('0x2b')](handleError(_0x2ef53d,null));};
\ No newline at end of file
+var _0x5098=['website_alias','agent_alias','User','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','ids','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','omit','Tag','color','emit','chatInteractionTags:save','removeTags','unix','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','get','mkdirSync','Chat','Owner','closedAt','browserName','osName','referer','customerIp','N.A.','existsSync','pipe','secret','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','Users','map','fullname','TagIds','Tags','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','UserId','closed','disposition','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','select','field','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','Contact','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','user','role','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','params','ChatInteraction','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','basename','file','filename','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','now','pathTranscript','Messages','format','%s%d','agentAlias','System','customer'];(function(_0x4f2be1,_0x23ed0e){var _0x1b8fa3=function(_0x3ee239){while(--_0x3ee239){_0x4f2be1['push'](_0x4f2be1['shift']());}};_0x1b8fa3(++_0x23ed0e);}(_0x5098,0x188));var _0x8509=function(_0x28ecdc,_0x2f4a98){_0x28ecdc=_0x28ecdc-0x0;var _0x3dbdd2=_0x5098[_0x28ecdc];return _0x3dbdd2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8509('0x0'));var zipdir=require(_0x8509('0x1'));var jsonpatch=require(_0x8509('0x2'));var rp=require(_0x8509('0x3'));var moment=require(_0x8509('0x4'));var BPromise=require(_0x8509('0x5'));var Mustache=require(_0x8509('0x6'));var util=require(_0x8509('0x7'));var path=require(_0x8509('0x8'));var sox=require(_0x8509('0x9'));var csv=require(_0x8509('0xa'));var ejs=require(_0x8509('0xb'));var fs=require('fs');var fs_extra=require(_0x8509('0xc'));var _=require(_0x8509('0xd'));var squel=require(_0x8509('0xe'));var crypto=require(_0x8509('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8509('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8509('0x11'));var Redis=require(_0x8509('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8509('0x13'));var as=require(_0x8509('0x14'));var pdf=require(_0x8509('0x15'));var hardwareService=require(_0x8509('0x16'));var logger=require(_0x8509('0x17'))(_0x8509('0x18'));var utils=require(_0x8509('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8509('0x1a'));var db=require(_0x8509('0x1b'))['db'];config[_0x8509('0x1c')]=_[_0x8509('0x1d')](config[_0x8509('0x1c')],{'host':_0x8509('0x1e'),'port':0x18eb});var socket=require(_0x8509('0x1f'))(new Redis(config[_0x8509('0x1c')]));require('./chatInteraction.socket')[_0x8509('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8509('0x21')][_0x8509('0x22')]({'port':0x232b});var client9004=jayson[_0x8509('0x21')][_0x8509('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x286a12,_0x1e2bd0,_0x4c9f3a,_0x1498c4){return new BPromise(function(_0xc4cd99,_0x583b60){var _0x272a58=_0x1498c4||client;return _0x272a58[_0x8509('0x23')](_0x286a12,_0x4c9f3a)[_0x8509('0x24')](function(_0x572851){logger['info'](_0x8509('0x25'),_0x1e2bd0,_0x8509('0x26'));logger[_0x8509('0x27')](_0x8509('0x28'),_0x1e2bd0,_0x8509('0x26'),JSON[_0x8509('0x29')](_0x572851));if(_0x572851[_0x8509('0x2a')]){if(_0x572851['error'][_0x8509('0x2b')]===0x1f4){logger[_0x8509('0x2a')](_0x8509('0x25'),_0x1e2bd0,_0x572851[_0x8509('0x2a')][_0x8509('0x2c')]);return _0x583b60(_0x572851[_0x8509('0x2a')]['message']);}logger[_0x8509('0x2a')](_0x8509('0x25'),_0x1e2bd0,_0x572851[_0x8509('0x2a')]['message']);return _0xc4cd99(_0x572851[_0x8509('0x2a')][_0x8509('0x2c')]);}else{logger[_0x8509('0x2d')](_0x8509('0x25'),_0x1e2bd0,_0x8509('0x26'));_0xc4cd99(_0x572851[_0x8509('0x2e')]['message']);}})[_0x8509('0x2f')](function(_0x1569fb){logger[_0x8509('0x2a')](_0x8509('0x25'),_0x1e2bd0,_0x1569fb);_0x583b60(_0x1569fb);});});}function respondWithStatusCode(_0x374c8f,_0x1eb6a3){_0x1eb6a3=_0x1eb6a3||0xcc;return function(_0x3bec19){if(_0x3bec19){return _0x374c8f[_0x8509('0x30')](_0x1eb6a3);}return _0x374c8f[_0x8509('0x31')](_0x1eb6a3)[_0x8509('0x32')]();};}function respondWithResult(_0x2fb1a6,_0x100e3c){_0x100e3c=_0x100e3c||0xc8;return function(_0x5c2512){if(_0x5c2512){return _0x2fb1a6[_0x8509('0x31')](_0x100e3c)[_0x8509('0x33')](_0x5c2512);}};}function respondWithFilteredResult(_0x3546d4,_0x42c0cc){return function(_0x16d386){if(_0x16d386){var _0x475318=typeof _0x42c0cc['offset']===_0x8509('0x34')&&typeof _0x42c0cc[_0x8509('0x35')]===_0x8509('0x34');var _0x3621bb=_0x16d386[_0x8509('0x36')];var _0x3f3a67=_0x475318?0x0:_0x42c0cc[_0x8509('0x37')];var _0x3b5d4c=_0x475318?_0x16d386[_0x8509('0x36')]:_0x42c0cc[_0x8509('0x37')]+_0x42c0cc['limit'];var _0x5d183f;if(_0x3b5d4c>=_0x3621bb){_0x3b5d4c=_0x3621bb;_0x5d183f=0xc8;}else{_0x5d183f=0xce;}_0x3546d4['status'](_0x5d183f);return _0x3546d4[_0x8509('0x38')](_0x8509('0x39'),_0x3f3a67+'-'+_0x3b5d4c+'/'+_0x3621bb)[_0x8509('0x33')](_0x16d386);}return null;};}function patchUpdates(_0x1416d1){return function(_0x2f52fb){try{jsonpatch[_0x8509('0x3a')](_0x2f52fb,_0x1416d1,!![]);}catch(_0x509284){return BPromise['reject'](_0x509284);}return _0x2f52fb[_0x8509('0x3b')]();};}function saveUpdates(_0x444bb5,_0x40a072){return function(_0x592472){if(_0x592472){return _0x592472[_0x8509('0x3c')](_0x444bb5)[_0x8509('0x24')](function(_0x252e12){return _0x252e12;});}return null;};}function removeEntity(_0x117fcd,_0xcce101){return function(_0x42298f){if(_0x42298f){return _0x42298f[_0x8509('0x3d')]()[_0x8509('0x24')](function(){_0x117fcd[_0x8509('0x31')](0xcc)[_0x8509('0x32')]();});}};}function handleEntityNotFound(_0x2ee116,_0x5ddf33){return function(_0x2e8e64){if(!_0x2e8e64){_0x2ee116['sendStatus'](0x194);}return _0x2e8e64;};}function handleError(_0x366f7d,_0x1db6c0){_0x1db6c0=_0x1db6c0||0x1f4;return function(_0x237307){logger['error'](_0x237307[_0x8509('0x3e')]);if(_0x237307['name']){delete _0x237307[_0x8509('0x3f')];}_0x366f7d[_0x8509('0x31')](_0x1db6c0)[_0x8509('0x40')](_0x237307);};}function getMustacheRender(_0x24f37f,_0x167f7a){return Mustache[_0x8509('0x41')](_0x24f37f,_[_0x8509('0x42')](_0x167f7a[_0x8509('0x43')],{'contact':_0x167f7a[_0x8509('0x44')],'message':_0x167f7a[_0x8509('0x2c')],'agent':_0x167f7a[_0x8509('0x45')],'interaction':_0x167f7a[_0x8509('0x46')],'account':_0x167f7a['account']}))||'';}function getInteractionUsers(_0x32c80e,_0x570cfd){return new BPromise(function(_0x1d87e9,_0x3f548d){try{if(_0x570cfd[_0x32c80e['id']]){_0x32c80e[_0x8509('0x47')]=_[_0x8509('0x48')](_0x570cfd[_0x32c80e['id']],function(_0x16ec31){return{'id':_0x16ec31['id'],'fullname':_0x16ec31[_0x8509('0x49')]};});}}catch(_0x55af2e){_0x3f548d(_0x55af2e);}_0x1d87e9(_0x32c80e);});}function getInteractionTags(_0x7bb1fc,_0x395b64){return new BPromise(function(_0x45c06d,_0x2b5608){try{if(_0x7bb1fc[_0x8509('0x4a')]){_0x7bb1fc[_0x8509('0x4b')]=[];_0x7bb1fc[_0x8509('0x4a')][_0x8509('0x4c')](',')[_0x8509('0x4d')](function(_0x3a2c69){_0x7bb1fc['Tags'][_0x8509('0x4e')](_0x395b64[_0x3a2c69]);});}delete _0x7bb1fc[_0x8509('0x4a')];}catch(_0x27c43e){_0x2b5608(_0x27c43e);}_0x45c06d(_0x7bb1fc);});}function updateChatInteraction(_0x320545,_0x37af2e,_0x5d21d7){return new BPromise(function(_0x2f0336,_0x8c8f56){return getInteractionUsers(_0x320545,_0x5d21d7)[_0x8509('0x24')](function(_0x4e091c){return getInteractionTags(_0x4e091c,_0x37af2e);})[_0x8509('0x24')](function(_0x2a55da){return getStateInteraction(_0x2a55da);})['then'](function(_0x183e59){_0x2f0336(_0x183e59);})[_0x8509('0x2f')](function(_0x1a0742){_0x8c8f56(_0x1a0742);});});}function getStateInteraction(_0x328dc3){return new BPromise(function(_0x579859){_0x328dc3[_0x8509('0x4f')]=0x0;_0x328dc3[_0x8509('0x50')]=0x0;_0x328dc3[_0x8509('0x51')]=0x0;_0x328dc3[_0x8509('0x52')]=0x0;_0x328dc3[_0x8509('0x53')]=0x0;_0x328dc3[_0x8509('0x54')]=0x0;if(!_0x328dc3['closed']&&!_0x328dc3[_0x8509('0x55')]){_0x328dc3['waiting']+=0x1;}if(!_0x328dc3[_0x8509('0x56')]&&_0x328dc3['UserId']){_0x328dc3[_0x8509('0x50')]+=0x1;if(_0x328dc3[_0x8509('0x4f')]){_0x328dc3[_0x8509('0x4f')]-=0x1;}}if(_0x328dc3[_0x8509('0x56')]&&_0x328dc3[_0x8509('0x57')]===_0x8509('0x53')){_0x328dc3[_0x8509('0x53')]+=0x1;if(_0x328dc3['waiting']){_0x328dc3[_0x8509('0x4f')]-=0x1;}}else if(_0x328dc3[_0x8509('0x56')]&&!_0x328dc3['UserId']&&_0x328dc3[_0x8509('0x57')]){_0x328dc3['unmanaged']+=0x1;if(_0x328dc3[_0x8509('0x4f')]){_0x328dc3[_0x8509('0x4f')]-=0x1;}}else if(_0x328dc3[_0x8509('0x56')]&&_0x328dc3['UserId']){_0x328dc3[_0x8509('0x51')]+=0x1;if(_0x328dc3[_0x8509('0x50')]){_0x328dc3[_0x8509('0x50')]-=0x1;}}_0x328dc3[_0x8509('0x54')]+=0x1;_0x579859(_0x328dc3);});}exports[_0x8509('0x58')]=function(_0x31ab8b,_0x53a905){var _0x1b4a7f={},_0x379c69={},_0x266a60={'count':0x0,'rows':[]};var _0x52e58c=_[_0x8509('0x48')](db['ChatInteraction'][_0x8509('0x59')],function(_0x221d0f){return{'name':_0x221d0f[_0x8509('0x5a')],'type':_0x221d0f[_0x8509('0x5b')][_0x8509('0x5c')]};});_0x379c69[_0x8509('0x5d')]=_[_0x8509('0x48')](_0x52e58c,'name');_0x379c69[_0x8509('0x5e')]=_[_0x8509('0x5f')](_0x31ab8b[_0x8509('0x5e')]);_0x379c69[_0x8509('0x60')]=_[_0x8509('0x61')](_0x379c69['model'],_0x379c69[_0x8509('0x5e')]);_0x1b4a7f[_0x8509('0x62')]=_['intersection'](_0x379c69['model'],qs[_0x8509('0x63')](_0x31ab8b[_0x8509('0x5e')][_0x8509('0x63')]));_0x1b4a7f[_0x8509('0x62')]=_0x1b4a7f[_0x8509('0x62')]['length']?_0x1b4a7f['attributes']:_0x379c69['model'];if(!_0x31ab8b[_0x8509('0x5e')][_0x8509('0x64')](_0x8509('0x65'))){_0x1b4a7f[_0x8509('0x35')]=qs[_0x8509('0x35')](_0x31ab8b[_0x8509('0x5e')][_0x8509('0x35')]);_0x1b4a7f[_0x8509('0x37')]=qs[_0x8509('0x37')](_0x31ab8b[_0x8509('0x5e')][_0x8509('0x37')]);}_0x1b4a7f[_0x8509('0x66')]=qs['sort'](_0x31ab8b[_0x8509('0x5e')][_0x8509('0x67')]);_0x1b4a7f[_0x8509('0x68')]=qs['filters'](_['pick'](_0x31ab8b[_0x8509('0x5e')],_0x379c69[_0x8509('0x60')]),_0x52e58c);var _0x36dee6=[];var _0x46eb32=squel[_0x8509('0x69')]()['field']('id')[_0x8509('0x6a')](_0x8509('0x3f'))[_0x8509('0x6a')]('color')['from']('tools_tags');var _0x3e79cc=squel[_0x8509('0x69')]()[_0x8509('0x6a')]('u.id')[_0x8509('0x6a')](_0x8509('0x6b'))['field'](_0x8509('0x6c'))[_0x8509('0x6d')](_0x8509('0x6e'),'ui')[_0x8509('0x6f')](_0x8509('0x70'),'u',_0x8509('0x71'));var _0x38906d=squel['select']()['from'](_0x8509('0x72'),'i')[_0x8509('0x6f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x8509('0x6f')](_0x8509('0x70'),'o','o.id\x20=\x20i.UserId')[_0x8509('0x6f')](_0x8509('0x73'),'a',_0x8509('0x74'))['left_join'](_0x8509('0x75'),'me',_0x8509('0x76'))['left_join']('chat_interaction_has_tags','it',_0x8509('0x77'))['left_join'](_0x8509('0x78'),'t',_0x8509('0x79'));var _0x4a61d2=squel[_0x8509('0x7a')]();var _0x36765f=[];var _0x230879=squel['expr']();var _0x2ed705;if(_0x31ab8b[_0x8509('0x5e')][_0x8509('0x7b')]){_0x2ed705=as[_0x8509('0x7c')](_0x31ab8b[_0x8509('0x5e')]['search']);var _0x23e1e2=_0x2ed705[_0x8509('0x7d')];for(var _0x5772c4=0x0;_0x5772c4<_0x2ed705[_0x8509('0x7e')][_0x8509('0x7f')];_0x5772c4++){var _0xff7c03=_0x2ed705[_0x8509('0x7e')][_0x5772c4];var _0x5e0370='i';var _0x4e4e7b=_[_0x8509('0x80')](_0x52e58c,[_0x8509('0x3f'),_0xff7c03['field']]);if(!_0x4e4e7b){switch(_0xff7c03[_0x8509('0x6a')]){case _0x8509('0x81'):if(_0xff7c03[_0x8509('0x82')]==0x1){_0x38906d['having']('`'+_0xff7c03[_0x8509('0x6a')]+'`\x20=\x200');}else{_0x38906d[_0x8509('0x83')]('`'+_0xff7c03[_0x8509('0x6a')]+'`\x20>\x200');}break;case _0x8509('0x84'):if(_0xff7c03['operator']===_0x8509('0x85')){if(_0xff7c03[_0x8509('0x82')]['split']('\x20')['length']>0x1){_0x4a61d2[_0x23e1e2]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8509('0x86')](_0xff7c03[_0x8509('0x82')]),null);}else{var _0x2580c8='%'+_0xff7c03[_0x8509('0x82')]+'%';_0x4a61d2[_0x23e1e2](_0x8509('0x87'),_0x2580c8,_0x2580c8,_0x2580c8);}}else{_0x4e4e7b=_[_0x8509('0x80')](_0x52e58c,[_0x8509('0x3f'),'ContactId']);_0xff7c03['field']=_0x8509('0x88');_0xa2c964=as['buildExpression'](_0x5e0370,_0x4e4e7b[_0x8509('0x5b')],_0xff7c03);_0x4a61d2[_0x23e1e2](_0xa2c964[_0x8509('0x89')],_0xa2c964[_0x8509('0x82')]['start'],_0xa2c964[_0x8509('0x82')][_0x8509('0x32')]);}break;case'Tag':var _0x1edde8=_0xff7c03[_0x8509('0x82')][_0x8509('0x4c')](',')[_0x8509('0x48')](function(_0x8d3bd7){return Number(_0x8d3bd7);});_0x1edde8[_0x8509('0x4d')](function(_0xb39de8){_0x230879['or'](_0x8509('0x8a'),'%,'+_0xb39de8+',%');});_0x36765f=_[_0x8509('0x8b')](_0x36765f,_0x1edde8);break;case'User':if(_0xff7c03[_0x8509('0x8c')]==='$substring'){_0x4a61d2[_0x23e1e2](_0x8509('0x8d'),'%'+_0xff7c03['value']+'%',null);}else{_0x4e4e7b=_[_0x8509('0x80')](_0x52e58c,[_0x8509('0x3f'),'UserId']);_0xff7c03['field']=_0x8509('0x55');_0xa2c964=as[_0x8509('0x8e')](_0x5e0370,_0x4e4e7b[_0x8509('0x5b')],_0xff7c03);_0x4a61d2[_0x23e1e2](_0xa2c964[_0x8509('0x89')],_0xa2c964[_0x8509('0x82')]['start'],_0xa2c964['value'][_0x8509('0x32')]);}break;case _0x8509('0x43'):_0xa2c964=as['buildExpression']('me',null,_0xff7c03);_0x4a61d2[_0x23e1e2](_0xa2c964[_0x8509('0x89')],_0xa2c964['value'][_0x8509('0x8f')],_0xa2c964[_0x8509('0x82')][_0x8509('0x32')]);break;}}else{var _0xa2c964=as[_0x8509('0x8e')](_0x5e0370,_0x4e4e7b[_0x8509('0x5b')],_0xff7c03);_0x4a61d2[_0x23e1e2](_0xa2c964[_0x8509('0x89')],_0xa2c964[_0x8509('0x82')][_0x8509('0x8f')],_0xa2c964[_0x8509('0x82')][_0x8509('0x32')]);}}}else{var _0x3a3f27=_(_0x31ab8b[_0x8509('0x5e')])['keys']()[_0x8509('0x48')](function(_0x4dd5c9){return _[_0x8509('0x90')](_0x52e58c,[_0x8509('0x3f'),_0x4dd5c9])?_0x4dd5c9:undefined;})[_0x8509('0x91')]()[_0x8509('0x82')]();if(!_[_0x8509('0x92')](_0x3a3f27)){_0x3a3f27[_0x8509('0x4d')](function(_0x5d12db){if(_0x5d12db===_0x8509('0x93')){_0x38906d[_0x8509('0x68')](_0x8509('0x94'),[][_0x8509('0x95')](_0x31ab8b['query'][_0x5d12db]));}else if(_0x5d12db===_0x8509('0x96')){var _0x35a61f=JSON[_0x8509('0x97')](_0x31ab8b[_0x8509('0x5e')][_0x5d12db])[_0x8509('0x98')];var _0x40b27d=JSON[_0x8509('0x97')](_0x31ab8b[_0x8509('0x5e')][_0x5d12db])['$lte'];_0x38906d[_0x8509('0x68')](_0x8509('0x99'),_0x35a61f,_0x40b27d);}else{if(_0x31ab8b[_0x8509('0x5e')][_0x5d12db]===_0x8509('0x9a')){_0x38906d['where']('i.'+_0x5d12db+_0x8509('0x9b'));}else{_0x38906d[_0x8509('0x68')]('i.'+_0x5d12db+'\x20=\x20?',_0x31ab8b['query'][_0x5d12db]);}}});}if(_0x31ab8b[_0x8509('0x5e')][_0x8509('0x9c')]){if(_0x31ab8b[_0x8509('0x5e')][_0x8509('0x9c')]==0x1){_0x38906d[_0x8509('0x83')]('`unreadMessages`\x20=\x200');}else{_0x38906d[_0x8509('0x83')](_0x8509('0x9d'));}}if(_0x31ab8b[_0x8509('0x5e')]['tag']){_0x36765f=_[_0x8509('0x9e')](_0x31ab8b['query'][_0x8509('0x9f')])?_0x31ab8b['query'][_0x8509('0x9f')]:new Array(_0x31ab8b[_0x8509('0x5e')]['tag']);_0x36765f[_0x8509('0x4d')](function(_0x409c90){_0x230879['or'](_0x8509('0x8a'),'%,'+_0x409c90+',%');});}if(_0x31ab8b[_0x8509('0x5e')][_0x8509('0xa0')]){var _0x1dae05=_0x31ab8b['query'][_0x8509('0xa0')][_0x8509('0xa1')]('\x5c','\x5c\x5c')[_0x8509('0xa1')](/'/g,'\x27\x27');if(qs[_0x8509('0xa2')](_0x1dae05)){_0x4a61d2['or'](_0x8509('0xa3'),_0x1dae05+'%');}else{_0x4a61d2['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8509('0x86')](_0x1dae05))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1dae05+'%');}}}_0x38906d[_0x8509('0x68')](_0x4a61d2);_0x38906d[_0x8509('0xa4')]('i.id');var _0x226fa3={'type':db[_0x8509('0xa5')][_0x8509('0xa6')][_0x8509('0xa7')],'raw':!![]};var _0x57b2df=_0x38906d[_0x8509('0xa8')]();_0x57b2df[_0x8509('0x6a')](_0x8509('0xa9'));_0x57b2df['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x1b4a7f[_0x8509('0x66')]){_0x1b4a7f[_0x8509('0x66')][_0x8509('0x4d')](function(_0x1b307f){var _0x2428ff=_0x1b307f[0x0]===_0x8509('0xaa')?_0x1b307f[0x0]:'i.'+_0x1b307f[0x0];_0x38906d[_0x8509('0x66')](_0x2428ff,_0x1b307f[0x1]==='DESC'?![]:!![]);});}if(!_[_0x8509('0x92')](_0x36765f)){_0x38906d[_0x8509('0x83')](_0x230879);_0x57b2df[_0x8509('0x68')](_0x8509('0xab'),_0x36765f);}BPromise['resolve']()[_0x8509('0x24')](function(){if(!_0x2ed705){if(_0x31ab8b['query'][_0x8509('0x93')])return;_0x57b2df['where'](_0x8509('0xac'));_0x38906d[_0x8509('0x68')](_0x8509('0xac'));return;}if(_0x31ab8b['user']['role']!==_0x8509('0x45'))return;return _0x31ab8b['user'][_0x8509('0xad')]({'attributes':['id'],'raw':!![]})[_0x8509('0x24')](function(_0x56e81b){if(_[_0x8509('0x92')](_0x56e81b)){_0x57b2df['where'](_0x8509('0xae'));_0x38906d[_0x8509('0x68')](_0x8509('0xae'));}else{_0x57b2df[_0x8509('0x68')](_0x8509('0x94'),_[_0x8509('0x48')](_0x56e81b,'id'));_0x38906d[_0x8509('0x68')](_0x8509('0x94'),_[_0x8509('0x48')](_0x56e81b,'id'));}});})[_0x8509('0x24')](function(){if(_0x31ab8b[_0x8509('0xaf')][_0x8509('0xb0')]===_0x8509('0x45')&&!_0x2ed705&&!_0x31ab8b[_0x8509('0x5e')][_0x8509('0x93')])return[];return db[_0x8509('0xb1')][_0x8509('0x5e')](_0x57b2df['toString'](),_0x226fa3);})[_0x8509('0x24')](function(_0x5352fc){_0x266a60[_0x8509('0x36')]=_0x5352fc[_0x8509('0x7f')];if(_0x266a60['count']===0x0)return[];return db[_0x8509('0xb1')][_0x8509('0x5e')](_0x46eb32[_0x8509('0xb2')](),_0x226fa3)[_0x8509('0x24')](function(_0x3e86d7){_0x36dee6=_[_0x8509('0xb3')](_0x3e86d7,'id');_0x226fa3=_['merge'](_0x226fa3,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x31ab8b[_0x8509('0x5e')][_0x8509('0x63')]){_0x1b4a7f[_0x8509('0x62')][_0x8509('0x4d')](function(_0x59c109){_0x38906d[_0x8509('0x6a')]('i.'+_0x59c109);});}else{_0x38906d[_0x8509('0x6a')](_0x8509('0xb4'),_0x8509('0x81'));_0x38906d['field'](_0x8509('0xb5'),_0x8509('0xb6'));_0x38906d['field'](_0x8509('0xb7'),_0x8509('0xb8'));_0x38906d['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x38906d[_0x8509('0x6a')](_0x8509('0xb9'));_0x38906d[_0x8509('0x6a')](_0x8509('0xba'),_0x8509('0xbb'));_0x38906d[_0x8509('0x6a')](_0x8509('0xbc'),_0x8509('0xbd'));_0x38906d[_0x8509('0x6a')](_0x8509('0xbe'),_0x8509('0xbf'));_0x38906d[_0x8509('0x6a')](_0x8509('0xc0'),'Contact.phone');_0x38906d[_0x8509('0x6a')](_0x8509('0xc1'),_0x8509('0xc2'));_0x38906d[_0x8509('0x6a')](_0x8509('0xc3'),_0x8509('0xc4'));_0x38906d[_0x8509('0x6a')](_0x8509('0xc5'),_0x8509('0xc6'));_0x38906d[_0x8509('0x6a')](_0x8509('0xc7'),_0x8509('0xc8'));_0x38906d[_0x8509('0x6a')](_0x8509('0xc9'),'TagIds');}if(_0x1b4a7f[_0x8509('0x35')])_0x38906d[_0x8509('0x35')](_0x1b4a7f[_0x8509('0x35')]);if(_0x1b4a7f['offset'])_0x38906d[_0x8509('0x37')](_0x1b4a7f[_0x8509('0x37')]);return db[_0x8509('0xb1')][_0x8509('0x5e')](_0x38906d[_0x8509('0xb2')](),_0x226fa3);})[_0x8509('0x24')](function(_0x547b6e){if(_0x547b6e['length']>0x0)_0x3e79cc[_0x8509('0x68')](_0x8509('0xca'),_[_0x8509('0x48')](_0x547b6e,'id'));return db[_0x8509('0xb1')]['query'](_0x3e79cc[_0x8509('0xb2')](),_0x226fa3)[_0x8509('0x24')](function(_0x5d0d88){var _0xe502d=_[_0x8509('0xcb')](_0x5d0d88,_0x8509('0xcc'));var _0x3c5faf=[];_0x547b6e[_0x8509('0x4d')](function(_0x1558bc){_0x3c5faf[_0x8509('0x4e')](updateChatInteraction(_0x1558bc,_0x36dee6,_0xe502d));});return BPromise['all'](_0x3c5faf);});});})[_0x8509('0x24')](function(_0x65998){_0x266a60[_0x8509('0xcd')]=_0x65998;return _0x266a60;})[_0x8509('0x24')](respondWithFilteredResult(_0x53a905,_0x1b4a7f))[_0x8509('0x2f')](handleError(_0x53a905,null));};exports[_0x8509('0xce')]=function(_0x19004d,_0x4463ac){var _0x22b106={'raw':![],'where':{'id':_0x19004d[_0x8509('0xcf')]['id']}},_0x1966c3={};_0x1966c3['model']=_['keys'](db[_0x8509('0xd0')][_0x8509('0x59')]);_0x1966c3[_0x8509('0x5e')]=_[_0x8509('0x5f')](_0x19004d['query']);_0x1966c3['filters']=_[_0x8509('0x61')](_0x1966c3['model'],_0x1966c3[_0x8509('0x5e')]);_0x22b106[_0x8509('0x62')]=_[_0x8509('0x61')](_0x1966c3[_0x8509('0x5d')],qs[_0x8509('0x63')](_0x19004d[_0x8509('0x5e')][_0x8509('0x63')]));_0x22b106[_0x8509('0x62')]=_0x22b106[_0x8509('0x62')][_0x8509('0x7f')]?_0x22b106['attributes']:_0x1966c3[_0x8509('0x5d')];if(_0x19004d[_0x8509('0x5e')][_0x8509('0xd1')]){_0x22b106[_0x8509('0xd2')]=[{'all':!![]}];}_0x22b106=_[_0x8509('0x42')]({},_0x22b106,_0x19004d[_0x8509('0xd3')]);return db[_0x8509('0xd0')]['find'](_0x22b106)[_0x8509('0x24')](handleEntityNotFound(_0x4463ac,null))[_0x8509('0x24')](respondWithResult(_0x4463ac,null))[_0x8509('0x2f')](handleError(_0x4463ac,null));};exports[_0x8509('0xd4')]=function(_0xb196b9,_0x4600e6){return db[_0x8509('0xd0')]['create'](_0xb196b9[_0x8509('0x43')],{})[_0x8509('0x24')](respondWithResult(_0x4600e6,0xc9))[_0x8509('0x2f')](handleError(_0x4600e6,null));};exports[_0x8509('0x3c')]=function(_0x398928,_0x4c5175){if(_0x398928[_0x8509('0x43')]['id']){delete _0x398928[_0x8509('0x43')]['id'];}return db['ChatInteraction'][_0x8509('0x80')]({'where':{'id':_0x398928[_0x8509('0xcf')]['id']}})[_0x8509('0x24')](handleEntityNotFound(_0x4c5175,null))[_0x8509('0x24')](saveUpdates(_0x398928['body'],null))[_0x8509('0x24')](respondWithResult(_0x4c5175,null))[_0x8509('0x2f')](handleError(_0x4c5175,null));};exports[_0x8509('0x3d')]=function(_0x387c94,_0x5119f9){return db['ChatInteraction'][_0x8509('0x80')]({'where':{'id':_0x387c94['params']['id']}})['then'](handleEntityNotFound(_0x5119f9,null))[_0x8509('0x24')](removeEntity(_0x5119f9,null))[_0x8509('0x2f')](handleError(_0x5119f9,null));};exports['describe']=function(_0x2767ef,_0x55c0a2){return db[_0x8509('0xd0')][_0x8509('0xd5')]()['then'](respondWithResult(_0x55c0a2,null))['catch'](handleError(_0x55c0a2,null));};exports[_0x8509('0xd6')]=function(_0x4a9359,_0x43b9dd){var _0x309bf4=_0x4a9359['params']['id'];var _0x36e41f;var _0x43f7a9;var _0x478a71;return db[_0x8509('0xd0')][_0x8509('0xd7')]({'where':{'id':_0x309bf4}})['then'](function(_0x58cf2a){_0x36e41f=_0x58cf2a;return db[_0x8509('0xd8')][_0x8509('0xd7')]({'where':{'id':_0x58cf2a['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x8509('0xd9'),_0x8509('0xda'),_0x8509('0xdb'),'vidaooMetadata'],'raw':!![]});})[_0x8509('0x24')](function(_0x455218){if(_0x455218&&_0x455218[_0x8509('0xdc')]&&_0x455218[_0x8509('0xd9')]){_0x43f7a9=_0x455218;var _0x4e5535={'interaction':{'id':_0x309bf4},'agent':{'id':_0x4a9359['user']['id'],'name':_0x4a9359[_0x8509('0xaf')][_0x8509('0x3f')],'fullname':_0x4a9359[_0x8509('0xaf')][_0x8509('0x49')],'email':_0x4a9359['user']['email']},'contact':_0x4a9359[_0x8509('0x43')][_0x8509('0x44')],'account':_0x4a9359[_0x8509('0x43')][_0x8509('0xdd')]};var _0x4e05bc={'rejectUnauthorized':![],'method':_0x8509('0xde'),'url':_0x8509('0xdf'),'headers':{'X-APIKEY':_0x455218[_0x8509('0xdc')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4a9359[_0x8509('0xaf')][_0x8509('0xe0')]],'buttons':null,'topic':_0x43f7a9[_0x8509('0xda')],'note':_[_0x8509('0xe1')](_0x43f7a9[_0x8509('0xdb')])?null:getMustacheRender(_0x43f7a9[_0x8509('0xdb')],_0x4e5535),'metadata':null},'redirect':_0x8509('0xe2'),'json':!![]};try{if(!_[_0x8509('0xe1')](_0x43f7a9[_0x8509('0xe3')])){var _0x2afcd0=getMustacheRender(_0x43f7a9['vidaooMetadata'],_0x4e5535);var _0x18749f=JSON[_0x8509('0x97')](_0x2afcd0);_0x4e05bc['body']['metadata']=_0x18749f;}}catch(_0xac5b08){throw new db[(_0x8509('0xa5'))][(_0x8509('0xe4'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x4e05bc);}else{throw new db[(_0x8509('0xa5'))][(_0x8509('0xe4'))](_0x8509('0xe5'));}})[_0x8509('0x24')](function(_0x5c1838){_0x478a71=_0x5c1838;if(_0x478a71['id']){var _0x4db160={'body':_0x478a71[_0x8509('0xe6')],'ChatWebsiteId':_0x43f7a9['id'],'ChatInteractionId':_0x36e41f['id'],'direction':_0x8509('0xe7'),'UserId':_0x4a9359[_0x8509('0xaf')]['id']};return db['ChatMessage'][_0x8509('0xd4')](_0x4db160,{});}else{throw new db[(_0x8509('0xa5'))][(_0x8509('0xe4'))](_0x8509('0xe8'));}})[_0x8509('0x24')](function(){return _0x36e41f[_0x8509('0xe9')]({'vidaooSessionId':_0x478a71['id']});})[_0x8509('0x24')](respondWithResult(_0x43b9dd,null))[_0x8509('0x2f')](handleError(_0x43b9dd,null));};exports[_0x8509('0xea')]=function(_0xdb9cb0,_0x1d8538){if(_0xdb9cb0['body']['id']){delete _0xdb9cb0[_0x8509('0x43')]['id'];}return db[_0x8509('0xd0')][_0x8509('0x80')]({'where':{'id':_0xdb9cb0[_0x8509('0xcf')]['id']},'include':[{'model':db[_0x8509('0xeb')],'as':'Contact'}]})[_0x8509('0x24')](handleEntityNotFound(_0x1d8538,null))[_0x8509('0x24')](saveUpdates(_0xdb9cb0[_0x8509('0x43')],null))[_0x8509('0x24')](respondWithResult(_0x1d8538,null))[_0x8509('0x2f')](handleError(_0x1d8538,null));};exports[_0x8509('0xec')]=function(_0x5a8011,_0x5f03c3,_0x11601d){if(_0x5a8011[_0x8509('0x43')]['id']){delete _0x5a8011[_0x8509('0x43')]['id'];}return db[_0x8509('0xd0')][_0x8509('0x80')]({'where':{'id':_0x5a8011[_0x8509('0xcf')]['id']}})[_0x8509('0x24')](function(_0x235224){if(!_0x235224){logger[_0x8509('0x2a')](_0x8509('0xed'),'abandon',0x194,_0x8509('0xee'));_0x5f03c3['sendStatus'](0x194);}else{if(_0x235224['UserId']){throw new db[(_0x8509('0xa5'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x235224;})[_0x8509('0x24')](function(_0xb78606){if(_0xb78606){return _0xb78606[_0x8509('0x3c')]({'closed':_0x5a8011[_0x8509('0x43')][_0x8509('0x56')],'disposition':_0x5a8011[_0x8509('0x43')][_0x8509('0x57')]})[_0x8509('0x24')](function(_0x14c524){return _0x14c524;});}})[_0x8509('0x24')](function(_0x4f4faf){return respondWithRpcPromise('AbandonInteraction','abandon',_0x5a8011[_0x8509('0x43')],client9004);})[_0x8509('0x24')](respondWithResult(_0x5f03c3,null))['catch'](handleError(_0x5f03c3,null));};exports['attachmentUpload']=function(_0xb73aab,_0x153c79,_0x5252c0){_0xb73aab[_0x8509('0x43')][_0x8509('0x3f')]=_0xb73aab['file']['originalname'];_0xb73aab['body'][_0x8509('0xef')]=_0xb73aab[_0x8509('0xf0')][_0x8509('0xf1')];_0xb73aab[_0x8509('0x43')][_0x8509('0x5b')]=_0xb73aab['file']['mimetype'];return db[_0x8509('0xf2')][_0x8509('0xd4')](_0xb73aab[_0x8509('0x43')])[_0x8509('0x24')](respondWithResult(_0x153c79,0xc9))[_0x8509('0x2f')](handleError(_0x153c79,null));};exports[_0x8509('0xf3')]=function(_0x3c8f00,_0x5d125a,_0x2a9fc9){return db[_0x8509('0xd0')][_0x8509('0xd7')]({'where':{'id':_0x3c8f00[_0x8509('0xcf')]['id']},'raw':!![]})[_0x8509('0x24')](handleEntityNotFound(_0x5d125a,null))[_0x8509('0x24')](function(_0x344c9e){if(_0x344c9e){if(_0x344c9e[_0x8509('0x56')]){return _0x5d125a[_0x8509('0x31')](0x193)[_0x8509('0x33')]({'status':0x193,'message':_0x8509('0xf4')});}return db[_0x8509('0xf2')]['findOne']({'where':{'id':_0x3c8f00[_0x8509('0x5e')][_0x8509('0xf5')]},'raw':!![]})[_0x8509('0x24')](handleEntityNotFound(_0x5d125a,null));}})[_0x8509('0x24')](function(_0x559399){if(_0x559399){var _0xce28f3=_0x559399['ChatOfflineMessageId']!==null;var _0x34cc0d=path[_0x8509('0xf6')](config[_0x8509('0xf7')],_0x8509('0xf8'));if(_0xce28f3){_0x34cc0d=path[_0x8509('0xf6')](_0x34cc0d,_0x8509('0xf9'));}var _0xc65ecb=path['join'](_0x34cc0d,_0x559399[_0x8509('0xef')]);return _0x5d125a[_0x8509('0xfa')](_0xc65ecb);}})[_0x8509('0x2f')](handleError(_0x5d125a,null));};exports[_0x8509('0xfb')]=function(_0x38ccee,_0x1573dd){var _0x376d37=null;var _0x342039=null;var _0x3258b0=null;var _0x3f2e8c=null;if(_0x38ccee[_0x8509('0x43')]['id']){delete _0x38ccee[_0x8509('0x43')]['id'];}if(_0x38ccee['body'][_0x8509('0xfc')]){_0x3f2e8c=path[_0x8509('0xf6')](config[_0x8509('0xf7')],_0x8509('0xfd'),util['format']('transcript-%s.txt',Date[_0x8509('0xfe')]()));_0x38ccee['body'][_0x8509('0xff')]=_0x3f2e8c;}return db[_0x8509('0xd0')]['find']({'where':{'id':_0x38ccee[_0x8509('0xcf')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x8509('0x100'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x8509('0x24')](handleEntityNotFound(_0x1573dd,null))[_0x8509('0x24')](saveUpdates(_0x38ccee[_0x8509('0x43')],null))[_0x8509('0x24')](function(_0x39c7b8){if(_0x39c7b8){_0x376d37=_0x39c7b8;return db[_0x8509('0xd8')][_0x8509('0x80')]({'where':{'id':_0x376d37[_0x8509('0x93')]}});}})[_0x8509('0x24')](function(_0x136b16){if(_0x136b16){_0x3258b0=_0x136b16;return db['CmContact']['find']({'where':{'id':_0x376d37[_0x8509('0x88')]}});}})['then'](function(_0x24c7bf){if(_0x24c7bf){_0x342039=_0x24c7bf;if(_0x3f2e8c){var _0x4fa393=null;for(var _0x3205ac=0x1;_0x3205ac<_0x376d37[_0x8509('0x100')][_0x8509('0x7f')];++_0x3205ac){_0x4fa393=_0x376d37['Messages'][_0x3205ac];var _0x4b7f10=_0x4fa393['UserId']?util[_0x8509('0x101')](_0x8509('0x102'),_0x3258b0[_0x8509('0x103')],_0x4fa393[_0x8509('0x55')]):_0x8509('0x104');var _0x47d959=_0x38ccee[_0x8509('0x43')][_0x8509('0x105')]||util[_0x8509('0x101')](_0x8509('0x102'),'Visitor',_0x4fa393[_0x8509('0x88')]);switch(_0x3258b0['agentIdentifier']){case _0x8509('0x106'):_0x4b7f10=_0x4fa393[_0x8509('0x55')]?util[_0x8509('0x101')](_0x8509('0x102'),_0x3258b0['agentAlias'],_0x4fa393['UserId']):_0x8509('0x104');break;case _0x8509('0x107'):_0x4b7f10=_0x4fa393['UserId']?_0x4fa393[_0x8509('0x108')][_0x8509('0x109')]||_0x4fa393['User']['fullname']:_0x8509('0x104');break;case _0x8509('0x10a'):_0x4b7f10=_0x4fa393['UserId']?_0x4fa393[_0x8509('0x108')][_0x8509('0x49')]:_0x8509('0x104');break;default:_0x4b7f10=_0x4fa393[_0x8509('0x55')]?util[_0x8509('0x101')](_0x8509('0x102'),_0x3258b0[_0x8509('0x103')],_0x4fa393[_0x8509('0x55')]):_0x8509('0x104');}var _0x212244=util[_0x8509('0x101')](_0x8509('0x10b'),moment(_0x4fa393[_0x8509('0x96')])[_0x8509('0x101')](_0x8509('0x10c')),_0x4fa393['direction']==='in'?_0x47d959:_0x4b7f10,_0x4fa393[_0x8509('0x43')]);if(!_0x4fa393['secret']){fs[_0x8509('0x10d')](_0x3f2e8c,_0x212244);}}return db[_0x8509('0x10e')][_0x8509('0xd7')]({'where':{'service':!![]},'include':[{'model':db[_0x8509('0x10f')],'as':_0x8509('0x110'),'raw':!![]}]});}}})['then'](function(_0x2df184){if(_0x2df184&&_0x2df184['Smtp']&&_0x38ccee['body']){var _0x571dc7={'tls':{'rejectUnauthorized':![]}};if(_0x2df184[_0x8509('0x110')][_0x8509('0x111')]){_0x571dc7[_0x8509('0x111')]=_0x2df184['Smtp'][_0x8509('0x111')];}else{_0x571dc7['host']=_0x2df184['Smtp'][_0x8509('0x112')];_0x571dc7['port']=_0x2df184[_0x8509('0x110')][_0x8509('0x113')];_0x571dc7['secure']=_0x2df184['Smtp'][_0x8509('0x114')];}if(_0x2df184[_0x8509('0x110')][_0x8509('0x115')]){_0x571dc7['auth']={'user':_0x2df184['Smtp'][_0x8509('0xaf')],'pass':_0x2df184[_0x8509('0x110')]['pass']};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x571dc7,'message':{'from':util[_0x8509('0x101')](_0x8509('0x116'),_0x2df184[_0x8509('0x3f')],_0x2df184['email']||_0x2df184['Smtp'][_0x8509('0xaf')]),'to':_0x38ccee[_0x8509('0x43')][_0x8509('0xfc')],'subject':_0x8509('0x117'),'text':util['format'](_0x8509('0x118'),_0x38ccee['body'][_0x8509('0xfc')]),'attachments':[{'path':_0x3f2e8c}]}})[_0x8509('0x24')](function(){return _0x376d37;})[_0x8509('0x2f')](function(_0x317361){console['error'](_0x317361);});}else{return _0x376d37;}})[_0x8509('0x24')](respondWithStatusCode(_0x1573dd,0xc8))[_0x8509('0x2f')](handleError(_0x1573dd,null));};exports[_0x8509('0x119')]=function(_0xd43254,_0x22d46c,_0x4dafec){return db[_0x8509('0x11a')][_0x8509('0x80')]({'where':{'id':_0xd43254['params']['id']}})[_0x8509('0x24')](handleEntityNotFound(_0x22d46c,null))[_0x8509('0x24')](function(_0x4e8509){if(_0x4e8509){return _0x4e8509['addMessage'](_0xd43254[_0x8509('0x43')][_0x8509('0x11b')],_['omit'](_0xd43254[_0x8509('0x43')],['ids','id'])||{});}})[_0x8509('0x24')](respondWithResult(_0x22d46c,null))[_0x8509('0x2f')](handleError(_0x22d46c,null));};exports[_0x8509('0x11c')]=function(_0x136daf,_0x55e183,_0x1b3d8f){var _0x1f59b9={'raw':![],'where':{}};var _0x54bb7b={};var _0x43fab1={'count':0x0,'rows':[]};return db[_0x8509('0xd0')][_0x8509('0xd7')]({'where':{'id':_0x136daf[_0x8509('0xcf')]['id']}})[_0x8509('0x24')](handleEntityNotFound(_0x55e183,null))[_0x8509('0x24')](function(_0x1bd65e){if(_0x1bd65e){_0x54bb7b[_0x8509('0x5d')]=_[_0x8509('0x5f')](db[_0x8509('0x11a')][_0x8509('0x59')]);_0x54bb7b[_0x8509('0x5e')]=_[_0x8509('0x5f')](_0x136daf['query']);_0x54bb7b[_0x8509('0x60')]=_['intersection'](_0x54bb7b[_0x8509('0x5d')],_0x54bb7b[_0x8509('0x5e')]);_0x1f59b9[_0x8509('0x62')]=_[_0x8509('0x61')](_0x54bb7b['model'],qs[_0x8509('0x63')](_0x136daf[_0x8509('0x5e')][_0x8509('0x63')]));_0x1f59b9[_0x8509('0x62')]=_0x1f59b9[_0x8509('0x62')][_0x8509('0x7f')]?_0x1f59b9[_0x8509('0x62')]:_0x54bb7b[_0x8509('0x5d')];if(!_0x136daf['query'][_0x8509('0x64')](_0x8509('0x65'))){_0x1f59b9['limit']=qs[_0x8509('0x35')](_0x136daf['query'][_0x8509('0x35')]);_0x1f59b9[_0x8509('0x37')]=qs[_0x8509('0x37')](_0x136daf[_0x8509('0x5e')]['offset']);}_0x1f59b9[_0x8509('0x66')]=qs[_0x8509('0x67')](_0x136daf[_0x8509('0x5e')]['sort']);_0x1f59b9[_0x8509('0x68')]=qs[_0x8509('0x60')](_[_0x8509('0x11d')](_0x136daf[_0x8509('0x5e')],_0x54bb7b[_0x8509('0x60')]));_0x1f59b9[_0x8509('0x68')][_0x8509('0xcc')]=_0x1bd65e['id'];if(_0x136daf[_0x8509('0x5e')][_0x8509('0xa0')]){_0x1f59b9[_0x8509('0x68')]=_[_0x8509('0x42')](_0x1f59b9['where'],{'$or':_[_0x8509('0x48')](_0x1f59b9[_0x8509('0x62')],function(_0x3fd211){var _0x3ecfb={};_0x3ecfb[_0x3fd211]={'$like':'%'+_0x136daf[_0x8509('0x5e')][_0x8509('0xa0')]+'%'};return _0x3ecfb;})});}if(_0x136daf['query'][_0x8509('0x98')]){var _0x227e53=_0x136daf[_0x8509('0x5e')][_0x8509('0x98')][_0x8509('0x4c')](',');var _0x179476={};_0x179476[_0x227e53[0x0]]={'$gte':moment(_0x227e53[0x1])[_0x8509('0x101')](_0x8509('0x11e'))};_0x1f59b9[_0x8509('0x68')]=_[_0x8509('0x42')](_0x1f59b9[_0x8509('0x68')],_0x179476);}_0x1f59b9=_[_0x8509('0x42')]({},_0x1f59b9,_0x136daf[_0x8509('0xd3')]);return db[_0x8509('0x11a')][_0x8509('0x36')]({'where':_0x1f59b9[_0x8509('0x68')]})[_0x8509('0x24')](function(_0x362986){_0x43fab1[_0x8509('0x36')]=_0x362986;if(_0x136daf[_0x8509('0x5e')][_0x8509('0xd1')]){_0x1f59b9[_0x8509('0xd2')]=[{'all':!![]}];}return db['ChatMessage'][_0x8509('0x11f')](_0x1f59b9);})[_0x8509('0x24')](function(_0xfabfe7){_0x43fab1[_0x8509('0xcd')]=_0xfabfe7;return _0x43fab1;});}})[_0x8509('0x24')](respondWithFilteredResult(_0x55e183,_0x1f59b9))['catch'](handleError(_0x55e183,null));};exports[_0x8509('0x120')]=function(_0x30e414,_0xf596c7,_0xfcab37){var _0x10247c={'where':{}},_0x38e3ab={},_0x46f1d1={'count':0x0,'rows':[]};return db[_0x8509('0xd0')][_0x8509('0xd7')]({'where':{'id':_0x30e414[_0x8509('0xcf')]['id']}})[_0x8509('0x24')](handleEntityNotFound(_0xf596c7,null))[_0x8509('0x24')](function(_0x3437e1){if(_0x3437e1){_0x38e3ab[_0x8509('0x5d')]=_[_0x8509('0x5f')](db[_0x8509('0x11a')]['rawAttributes']);_0x38e3ab[_0x8509('0x5e')]=_[_0x8509('0x5f')](_0x30e414['query']);_0x38e3ab[_0x8509('0x60')]=_[_0x8509('0x61')](_0x38e3ab[_0x8509('0x5d')],_0x38e3ab[_0x8509('0x5e')]);_0x10247c['attributes']=_[_0x8509('0x61')](_0x38e3ab[_0x8509('0x5d')],qs[_0x8509('0x63')](_0x30e414[_0x8509('0x5e')][_0x8509('0x63')]));_0x10247c[_0x8509('0x62')]=_0x10247c[_0x8509('0x62')][_0x8509('0x7f')]?_0x10247c[_0x8509('0x62')]:_0x38e3ab[_0x8509('0x5d')];if(!_0x30e414[_0x8509('0x5e')][_0x8509('0x64')]('nolimit')){_0x10247c[_0x8509('0x35')]=qs[_0x8509('0x35')](_0x30e414[_0x8509('0x5e')][_0x8509('0x35')]);_0x10247c[_0x8509('0x37')]=qs['offset'](_0x30e414[_0x8509('0x5e')][_0x8509('0x37')]);}_0x10247c[_0x8509('0x66')]=qs[_0x8509('0x67')](_0x30e414[_0x8509('0x5e')][_0x8509('0x67')]);_0x10247c['where']=qs['filters'](_[_0x8509('0x11d')](_0x30e414[_0x8509('0x5e')],_0x38e3ab[_0x8509('0x60')]));_0x10247c[_0x8509('0x68')][_0x8509('0xcc')]=_0x3437e1['id'];if(_0x30e414[_0x8509('0x5e')][_0x8509('0xa0')]){_0x10247c[_0x8509('0x68')]=_[_0x8509('0x42')](_0x10247c[_0x8509('0x68')],{'$or':_[_0x8509('0x48')](_0x10247c[_0x8509('0x62')],function(_0x535c6f){var _0x533e5c={};_0x533e5c[_0x535c6f]={'$like':'%'+_0x30e414[_0x8509('0x5e')][_0x8509('0xa0')]+'%'};return _0x533e5c;})});}_0x10247c[_0x8509('0x68')]['secret']=![];if(_0x30e414[_0x8509('0x5e')]['id']){_0x10247c[_0x8509('0x68')]['id']={'$gt':_0x30e414['query']['id']};}_0x10247c=_[_0x8509('0x42')]({},_0x10247c,_0x30e414[_0x8509('0xd3')]);return db[_0x8509('0x11a')][_0x8509('0x36')]({'where':_0x10247c[_0x8509('0x68')]})[_0x8509('0x24')](function(_0x3c343a){_0x46f1d1[_0x8509('0x36')]=_0x3c343a;_0x10247c[_0x8509('0xd2')]=[];if(_0x30e414[_0x8509('0x5e')][_0x8509('0x121')]){_0x10247c[_0x8509('0xd2')][_0x8509('0x4e')]({'model':db[_0x8509('0x108')],'as':_0x8509('0x108'),'attributes':['id',_0x8509('0x49'),_0x8509('0x109')]});}if(_0x30e414[_0x8509('0x5e')]['includeAll']){_0x10247c[_0x8509('0xd2')]=[{'all':!![]}];}return db[_0x8509('0x11a')][_0x8509('0x11f')](_0x10247c);})[_0x8509('0x24')](function(_0x561554){_0x46f1d1['rows']=_0x561554;return _0x46f1d1;});}})[_0x8509('0x24')](respondWithFilteredResult(_0xf596c7,_0x10247c))['catch'](handleError(_0xf596c7,null));};exports['addTags']=function(_0x1d0374,_0x51a546,_0x306133){return db['ChatInteraction']['find']({'where':{'id':_0x1d0374[_0x8509('0xcf')]['id']}})[_0x8509('0x24')](handleEntityNotFound(_0x51a546,null))[_0x8509('0x24')](function(_0x4cabbf){if(_0x4cabbf){return _0x4cabbf[_0x8509('0x122')](_0x1d0374[_0x8509('0x43')][_0x8509('0x11b')],_[_0x8509('0x123')](_0x1d0374[_0x8509('0x43')],[_0x8509('0x11b'),'id'])||{})['spread'](function(){return db[_0x8509('0x124')][_0x8509('0x11f')]({'attributes':['id','name',_0x8509('0x125')],'where':{'id':_0x1d0374[_0x8509('0x43')]['ids']}});})[_0x8509('0x24')](function(_0x55ae6c){socket[_0x8509('0x126')](_0x8509('0x127'),{'id':Number(_0x1d0374[_0x8509('0xcf')]['id']),'tags':_0x55ae6c||[]});return{'id':Number(_0x1d0374['params']['id']),'tags':_0x55ae6c||[]};});}})['then'](respondWithResult(_0x51a546,null))[_0x8509('0x2f')](handleError(_0x51a546,null));};exports['removeTags']=function(_0x533bf4,_0xe40474,_0x5c207b){return db[_0x8509('0xd0')][_0x8509('0x80')]({'where':{'id':_0x533bf4[_0x8509('0xcf')]['id']}})[_0x8509('0x24')](handleEntityNotFound(_0xe40474,null))[_0x8509('0x24')](function(_0x5dee05){if(_0x5dee05){return _0x5dee05[_0x8509('0x128')](_0x533bf4[_0x8509('0x5e')][_0x8509('0x11b')]);}})[_0x8509('0x24')](respondWithStatusCode(_0xe40474,null))[_0x8509('0x2f')](handleError(_0xe40474,null));};exports[_0x8509('0xfa')]=function(_0x54b197,_0x48cc5e){var _0x450cbd=moment()[_0x8509('0x129')]()[_0x8509('0xb2')]();var _0x3636a6=path[_0x8509('0xf6')](config[_0x8509('0xf7')],'server',_0x8509('0x12a'),_0x8509('0x12b'));var _0x47022b=path[_0x8509('0xf6')](config['root'],_0x8509('0x12c'),_0x8509('0x12a'),_0x8509('0x12d'));var _0x34ae40=path[_0x8509('0xf6')](_0x3636a6,_0x450cbd);var _0x1a9986=util[_0x8509('0x101')](_0x8509('0x12e'),_0x54b197[_0x8509('0xcf')]['id'],_0x450cbd);var _0x4e75b7=path[_0x8509('0xf6')](_0x3636a6,_0x1a9986);var _0xda7864=[];_0xda7864[_0x8509('0x4e')]({'model':db[_0x8509('0x108')],'as':_0x8509('0x108'),'attributes':['id',_0x8509('0x49')],'raw':!![]});_0xda7864[_0x8509('0x4e')]({'model':db['CmContact'],'as':_0x8509('0x84'),'attributes':['id',_0x8509('0x12f'),_0x8509('0x130')],'raw':!![]});if(_0x54b197[_0x8509('0x5e')][_0x8509('0x12d')]){_0xda7864[_0x8509('0x4e')]({'model':db[_0x8509('0xf2')],'as':_0x8509('0xf2'),'raw':!![]});}var _0x1220a2=[{'model':db[_0x8509('0x11a')],'as':_0x8509('0x100'),'attributes':['id','body',_0x8509('0x96'),_0x8509('0x131'),'secret','read'],'include':_0xda7864}];_0x1220a2['push']({'model':db[_0x8509('0xd8')],'as':_0x8509('0x132'),'attributes':['id',_0x8509('0x3f')]});_0x1220a2['push']({'model':db[_0x8509('0x108')],'as':'Owner','attributes':['id',_0x8509('0x49')]});return db[_0x8509('0xd0')][_0x8509('0x80')]({'where':{'id':_0x54b197[_0x8509('0xcf')]['id']},'include':_0x1220a2})['then'](handleEntityNotFound(_0x48cc5e,null))[_0x8509('0x24')](function(_0x36fc9b){if(_0x36fc9b){var _0x57264c=_0x36fc9b[_0x8509('0x133')]({'plain':!![]});fs[_0x8509('0x134')](_0x34ae40);var _0x1295fd={'channel':_0x8509('0x135'),'account':_0x57264c[_0x8509('0x132')][_0x8509('0x3f')],'agent':_0x57264c[_0x8509('0x136')]?_0x57264c[_0x8509('0x136')]['fullname']:'N.A.','createdAt':moment(_0x57264c[_0x8509('0x96')])[_0x8509('0x101')](_0x8509('0x11e'))[_0x8509('0xb2')](),'closedAt':_0x57264c[_0x8509('0x56')]?moment(_0x57264c[_0x8509('0x137')])[_0x8509('0x101')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8509('0xb2')]():'','disposition':_0x57264c[_0x8509('0x57')],'chatInfo':{'browser':_0x57264c[_0x8509('0x138')],'os':_0x57264c[_0x8509('0x139')],'referer':_0x57264c[_0x8509('0x13a')],'customerIp':_0x57264c[_0x8509('0x13b')],'customerPort':_0x57264c['customerPort']?_0x57264c['customerPort']:_0x8509('0x13c')},'messages':_(_0x57264c['Messages'])['tail']()['filter']({'secret':![]})['map'](function(_0x287394){if(_0x287394['Attachment']){var _0x2057ce=path[_0x8509('0xf6')](_0x47022b,_0x287394[_0x8509('0xf2')][_0x8509('0xef')]);if(fs[_0x8509('0x13d')](_0x2057ce)){fs['createReadStream'](_0x2057ce)[_0x8509('0x13e')](fs['createWriteStream'](path[_0x8509('0xf6')](_0x34ae40,_0x287394['Attachment'][_0x8509('0xef')])));}}return{'date':moment(_0x287394[_0x8509('0x96')])[_0x8509('0x101')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8509('0xb2')](),'sender':_0x287394[_0x8509('0x131')]==='out'?_0x287394[_0x8509('0x108')]?_0x287394[_0x8509('0x108')][_0x8509('0x49')]:_0x8509('0x104'):_0x287394['Contact']['firstName']+(_0x287394[_0x8509('0x84')][_0x8509('0x130')]?'\x20'+_0x287394[_0x8509('0x84')]['lastName']:''),'body':_0x287394[_0x8509('0xf2')]?_0x287394[_0x8509('0xf2')][_0x8509('0xef')]:_0x287394['body'],'direction':_0x287394[_0x8509('0x131')]===_0x8509('0xe7')?'A':'C','secret':_0x287394[_0x8509('0x13f')],'read':_0x287394[_0x8509('0x9c')],'attachment':_0x287394[_0x8509('0xf2')]};})[_0x8509('0x82')]()};return ejs[_0x8509('0x140')](path[_0x8509('0xf6')](config[_0x8509('0xf7')],_0x8509('0x12c'),_0x8509('0x141'),'downloadInteraction.ejs'),{'interaction':_0x1295fd})[_0x8509('0x24')](function(_0x531879){var _0xcf66ed=path[_0x8509('0xf6')](_0x34ae40,_0x8509('0x142')+_0x57264c['id']+'-'+_0x450cbd+_0x8509('0x143'));var _0x521215={'path':_0xcf66ed,'channel':_0x8509('0x135'),'interactionId':_0x57264c['id']};return pdf[_0x8509('0x144')](_0x531879,_0x521215);})[_0x8509('0x24')](function(){return new BPromise(function(_0x1591fe,_0x3521d5){zipdir(_0x34ae40,{'saveTo':_0x4e75b7},function(_0x4ace75,_0x543262){if(_0x4ace75)return _0x3521d5(_0x4ace75);return _0x1591fe(_0x543262);});})[_0x8509('0x24')](function(){return new BPromise(function(_0x4f3b9f,_0x563abb){rimraf(_0x34ae40,function(_0x4ae528){if(_0x4ae528)_0x563abb(_0x4ae528);return _0x4f3b9f();});});})[_0x8509('0x24')](function(){return _0x48cc5e['download'](_0x4e75b7,_0x1a9986,function(_0x462dbe){if(_0x462dbe){console[_0x8509('0x145')]('err',_0x462dbe);}else{fs[_0x8509('0x146')](_0x4e75b7);}});});});}else{return _0x48cc5e[_0x8509('0x30')](0xc8);}})['catch'](handleError(_0x48cc5e,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 30f55ba..e95d92b 100644
--- a/server/api/chatInteraction/chatInteraction.events.js
+++ b/server/api/chatInteraction/chatInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa359=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','getUsers','setDataValue','map','findAll','unreadMessages','emit'];(function(_0x162415,_0x252d65){var _0x1c01d9=function(_0x55a444){while(--_0x55a444){_0x162415['push'](_0x162415['shift']());}};_0x1c01d9(++_0x252d65);}(_0xa359,0x6a));var _0x9a35=function(_0x4591fb,_0x578ce3){_0x4591fb=_0x4591fb-0x0;var _0x282347=_0xa359[_0x4591fb];return _0x282347;};'use strict';var EventEmitter=require(_0x9a35('0x0'));var ChatInteraction=require(_0x9a35('0x1'))['db'][_0x9a35('0x2')];var ChatMessage=require(_0x9a35('0x1'))['db'][_0x9a35('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9a35('0x4'),'afterUpdate':_0x9a35('0x5'),'afterDestroy':_0x9a35('0x6')};function emitEvent(_0x21883f){return function(_0x5b57b4,_0x2818cf,_0x37520f){_0x5b57b4[_0x9a35('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x8dde62){_0x5b57b4[_0x9a35('0x8')]('Users',_0x8dde62[_0x9a35('0x9')](function(_0x3071a8){return{'id':_0x3071a8['id']};}));return ChatMessage[_0x9a35('0xa')]({'where':{'ChatInteractionId':_0x5b57b4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x350133){_0x5b57b4[_0x9a35('0x8')](_0x9a35('0xb'),_0x350133['length']);ChatInteractionEvents[_0x9a35('0xc')](_0x21883f+':'+_0x5b57b4['id'],_0x5b57b4);ChatInteractionEvents[_0x9a35('0xc')](_0x21883f,_0x5b57b4);_0x37520f(null);})[_0x9a35('0xd')](_0x37520f(null));};}for(var e in events){if(events[_0x9a35('0xe')](e)){var event=events[e];ChatInteraction[_0x9a35('0xf')](e,emitEvent(event));}}module[_0x9a35('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xb16e=['exports','events','../../mysqldb','ChatInteraction','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook'];(function(_0x32add3,_0x251520){var _0x1fea76=function(_0x3f3994){while(--_0x3f3994){_0x32add3['push'](_0x32add3['shift']());}};_0x1fea76(++_0x251520);}(_0xb16e,0x1d5));var _0xeb16=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xb16e[_0x46f1a6];return _0x38429a;};'use strict';var EventEmitter=require(_0xeb16('0x0'));var ChatInteraction=require(_0xeb16('0x1'))['db'][_0xeb16('0x2')];var ChatMessage=require(_0xeb16('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb16('0x3'),'afterUpdate':_0xeb16('0x4'),'afterDestroy':_0xeb16('0x5')};function emitEvent(_0x2803c3){return function(_0x151576,_0x31536a,_0x5a2777){_0x151576[_0xeb16('0x6')]({'attributes':['id'],'raw':!![]})[_0xeb16('0x7')](function(_0x4c1845){_0x151576['setDataValue'](_0xeb16('0x8'),_0x4c1845[_0xeb16('0x9')](function(_0x921cb4){return{'id':_0x921cb4['id']};}));return ChatMessage[_0xeb16('0xa')]({'where':{'ChatInteractionId':_0x151576['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeb16('0x7')](function(_0x463845){_0x151576[_0xeb16('0xb')](_0xeb16('0xc'),_0x463845[_0xeb16('0xd')]);ChatInteractionEvents[_0xeb16('0xe')](_0x2803c3+':'+_0x151576['id'],_0x151576);ChatInteractionEvents[_0xeb16('0xe')](_0x2803c3,_0x151576);_0x5a2777(null);})['catch'](_0x5a2777(null));};}for(var e in events){if(events[_0xeb16('0xf')](e)){var event=events[e];ChatInteraction[_0xeb16('0x10')](e,emitEvent(event));}}module[_0xeb16('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 27925fe..cba6abd 100644
--- a/server/api/chatInteraction/chatInteraction.model.js
+++ b/server/api/chatInteraction/chatInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9e57=['./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x1cc59b,_0x2bc730){var _0x739cbd=function(_0x57beee){while(--_0x57beee){_0x1cc59b['push'](_0x1cc59b['shift']());}};_0x739cbd(++_0x2bc730);}(_0x9e57,0xe3));var _0x79e5=function(_0xb5809,_0x103b91){_0xb5809=_0xb5809-0x0;var _0x57b30b=_0x9e57[_0xb5809];return _0x57b30b;};'use strict';var _=require(_0x79e5('0x0'));var util=require('util');var logger=require(_0x79e5('0x1'))(_0x79e5('0x2'));var moment=require('moment');var BPromise=require(_0x79e5('0x3'));var rp=require(_0x79e5('0x4'));var fs=require('fs');var path=require(_0x79e5('0x5'));var rimraf=require('rimraf');var config=require(_0x79e5('0x6'));var attributes=require(_0x79e5('0x7'));module[_0x79e5('0x8')]=function(_0x2e68fb,_0x34cbb5){return _0x2e68fb[_0x79e5('0x9')](_0x79e5('0xa'),attributes,{'tableName':_0x79e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46ef62,_0x220ee4,_0x45b996){if(_0x46ef62[_0x79e5('0xc')](_0x79e5('0xd'))){_0x46ef62['closedAt']=moment()[_0x79e5('0xe')](_0x79e5('0xf'));}_0x45b996(null,_0x46ef62);}},'charset':_0x79e5('0x10'),'collate':_0x79e5('0x11')});};
\ No newline at end of file
+var _0x1730=['ChatInteraction','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','../../config/environment','exports','define'];(function(_0x490885,_0x50c24d){var _0x135689=function(_0x47e581){while(--_0x47e581){_0x490885['push'](_0x490885['shift']());}};_0x135689(++_0x50c24d);}(_0x1730,0xa1));var _0x0173=function(_0x5191ee,_0x4c65f1){_0x5191ee=_0x5191ee-0x0;var _0x242b20=_0x1730[_0x5191ee];return _0x242b20;};'use strict';var _=require(_0x0173('0x0'));var util=require(_0x0173('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0173('0x2'));var BPromise=require(_0x0173('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0173('0x4'));var attributes=require('./chatInteraction.attributes');module[_0x0173('0x5')]=function(_0x136a83,_0x11ae14){return _0x136a83[_0x0173('0x6')](_0x0173('0x7'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x139095,_0x51923c,_0x3eb856){if(_0x139095[_0x0173('0x8')](_0x0173('0x9'))){_0x139095[_0x0173('0xa')]=moment()[_0x0173('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3eb856(null,_0x139095);}},'charset':_0x0173('0xc'),'collate':_0x0173('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 5733c29..67951cf 100644
--- a/server/api/chatInteraction/chatInteraction.rpc.js
+++ b/server/api/chatInteraction/chatInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x76c5=['find','where','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','UpdateChatInteraction','update','body','options','raw','attributes','limit','catch','ChatInteraction'];(function(_0x355488,_0x2424b9){var _0x400a57=function(_0x511a6b){while(--_0x511a6b){_0x355488['push'](_0x355488['shift']());}};_0x400a57(++_0x2424b9);}(_0x76c5,0x166));var _0x576c=function(_0x2d1971,_0x20b764){_0x2d1971=_0x2d1971-0x0;var _0x4d7759=_0x76c5[_0x2d1971];return _0x4d7759;};'use strict';var _=require(_0x576c('0x0'));var util=require('util');var moment=require(_0x576c('0x1'));var BPromise=require(_0x576c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x576c('0x3'))(_0x576c('0x4'));var config=require('../../config/environment');var jayson=require(_0x576c('0x5'));var client=jayson[_0x576c('0x6')]['http']({'port':0x232a});config['redis']=_[_0x576c('0x7')](config[_0x576c('0x8')],{'host':_0x576c('0x9'),'port':0x18eb});var socket=require(_0x576c('0xa'))(new Redis(config[_0x576c('0x8')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x505b08,_0x69d697,_0x391ea4){return new BPromise(function(_0x4b439d,_0x46896e){return client[_0x576c('0xb')](_0x505b08,_0x391ea4)[_0x576c('0xc')](function(_0x44ea24){logger[_0x576c('0xd')]('ChatInteraction,\x20%s,\x20%s',_0x69d697,_0x576c('0xe'));logger[_0x576c('0xf')](_0x576c('0x10'),_0x69d697,'request\x20sent',JSON[_0x576c('0x11')](_0x44ea24));if(_0x44ea24['error']){if(_0x44ea24[_0x576c('0x12')][_0x576c('0x13')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x69d697,_0x44ea24[_0x576c('0x12')][_0x576c('0x14')]);return _0x46896e(_0x44ea24[_0x576c('0x12')][_0x576c('0x14')]);}logger[_0x576c('0x12')](_0x576c('0x15'),_0x69d697,_0x44ea24[_0x576c('0x12')][_0x576c('0x14')]);return _0x4b439d(_0x44ea24[_0x576c('0x12')]['message']);}else{logger[_0x576c('0xd')](_0x576c('0x15'),_0x69d697,_0x576c('0xe'));_0x4b439d(_0x44ea24[_0x576c('0x16')][_0x576c('0x14')]);}})['catch'](function(_0x2ab2b4){logger[_0x576c('0x12')](_0x576c('0x15'),_0x69d697,_0x2ab2b4);_0x46896e(_0x2ab2b4);});});}exports[_0x576c('0x17')]=function(_0x4bbfe6){var _0x5646c9=this;return new Promise(function(_0x46d123,_0x46e297){return db['ChatInteraction'][_0x576c('0x18')](_0x4bbfe6[_0x576c('0x19')],{'raw':_0x4bbfe6[_0x576c('0x1a')]?_0x4bbfe6[_0x576c('0x1a')][_0x576c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bbfe6[_0x576c('0x1a')]?_0x4bbfe6[_0x576c('0x1a')]['where']||null:null,'attributes':_0x4bbfe6[_0x576c('0x1a')]?_0x4bbfe6['options'][_0x576c('0x1c')]||null:null,'limit':_0x4bbfe6[_0x576c('0x1a')]?_0x4bbfe6[_0x576c('0x1a')][_0x576c('0x1d')]||null:null})[_0x576c('0xc')](function(_0x3d4268){logger[_0x576c('0xd')](_0x576c('0x17'),_0x4bbfe6);logger[_0x576c('0xf')](_0x576c('0x17'),_0x4bbfe6,JSON['stringify'](_0x3d4268));_0x46d123(_0x3d4268);})[_0x576c('0x1e')](function(_0x2ae570){logger[_0x576c('0x12')](_0x576c('0x17'),_0x2ae570['message'],_0x4bbfe6);_0x46e297(_0x5646c9['error'](0x1f4,_0x2ae570[_0x576c('0x14')]));});});};exports['AddTagsToChatInteraction']=function(_0x13c3c5){return new Promise(function(_0x553bfc,_0x535c5e){return db[_0x576c('0x1f')][_0x576c('0x20')]({'where':_0x13c3c5[_0x576c('0x1a')]?_0x13c3c5['options'][_0x576c('0x21')]||null:null})['then'](function(_0x3e708b){if(_0x3e708b){return _0x3e708b[_0x576c('0x22')](_0x13c3c5[_0x576c('0x19')][_0x576c('0x23')],_[_0x576c('0x24')](_0x13c3c5['body'],['ids','id'])||{});}})[_0x576c('0x25')](function(_0x20a499){logger[_0x576c('0xd')](_0x576c('0x26'),_0x13c3c5);logger[_0x576c('0xf')](_0x576c('0x26'),_0x13c3c5,JSON[_0x576c('0x11')](_0x20a499));_0x553bfc(_0x20a499);})[_0x576c('0x1e')](function(_0x4d49ea){logger[_0x576c('0x12')](_0x576c('0x26'),_0x4d49ea[_0x576c('0x14')],_0x13c3c5);_0x535c5e(_this[_0x576c('0x12')](0x1f4,_0x4d49ea[_0x576c('0x14')]));});});};
\ No newline at end of file
+var _0xb01f=['defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','UpdateChatInteraction','ChatInteraction','update','body','options','attributes','limit','then','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis'];(function(_0x7870a5,_0x61cb8f){var _0x1e6b33=function(_0x23d075){while(--_0x23d075){_0x7870a5['push'](_0x7870a5['shift']());}};_0x1e6b33(++_0x61cb8f);}(_0xb01f,0x9d));var _0xfb01=function(_0x1d2d6a,_0x556e3e){_0x1d2d6a=_0x1d2d6a-0x0;var _0x4ce5d2=_0xb01f[_0x1d2d6a];return _0x4ce5d2;};'use strict';var _=require('lodash');var util=require(_0xfb01('0x0'));var moment=require(_0xfb01('0x1'));var BPromise=require(_0xfb01('0x2'));var rs=require(_0xfb01('0x3'));var fs=require('fs');var Redis=require(_0xfb01('0x4'));var db=require(_0xfb01('0x5'))['db'];var utils=require(_0xfb01('0x6'));var logger=require('../../config/logger')(_0xfb01('0x7'));var config=require(_0xfb01('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfb01('0x9')]['http']({'port':0x232a});config[_0xfb01('0xa')]=_[_0xfb01('0xb')](config[_0xfb01('0xa')],{'host':_0xfb01('0xc'),'port':0x18eb});var socket=require(_0xfb01('0xd'))(new Redis(config['redis']));require(_0xfb01('0xe'))[_0xfb01('0xf')](socket);function respondWithRpcPromise(_0x253cc0,_0x1e5bc7,_0x5d9cfe){return new BPromise(function(_0x114de4,_0x30d3bc){return client[_0xfb01('0x10')](_0x253cc0,_0x5d9cfe)['then'](function(_0x3b102d){logger['info'](_0xfb01('0x11'),_0x1e5bc7,_0xfb01('0x12'));logger[_0xfb01('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1e5bc7,_0xfb01('0x12'),JSON[_0xfb01('0x14')](_0x3b102d));if(_0x3b102d[_0xfb01('0x15')]){if(_0x3b102d[_0xfb01('0x15')][_0xfb01('0x16')]===0x1f4){logger[_0xfb01('0x15')](_0xfb01('0x11'),_0x1e5bc7,_0x3b102d[_0xfb01('0x15')][_0xfb01('0x17')]);return _0x30d3bc(_0x3b102d['error'][_0xfb01('0x17')]);}logger[_0xfb01('0x15')](_0xfb01('0x11'),_0x1e5bc7,_0x3b102d['error']['message']);return _0x114de4(_0x3b102d[_0xfb01('0x15')]['message']);}else{logger[_0xfb01('0x18')](_0xfb01('0x11'),_0x1e5bc7,'request\x20sent');_0x114de4(_0x3b102d['result'][_0xfb01('0x17')]);}})[_0xfb01('0x19')](function(_0x3b2f66){logger[_0xfb01('0x15')](_0xfb01('0x11'),_0x1e5bc7,_0x3b2f66);_0x30d3bc(_0x3b2f66);});});}exports[_0xfb01('0x1a')]=function(_0x4a559c){var _0x6f17f3=this;return new Promise(function(_0x4e58b4,_0x26bef8){return db[_0xfb01('0x1b')][_0xfb01('0x1c')](_0x4a559c[_0xfb01('0x1d')],{'raw':_0x4a559c['options']?_0x4a559c[_0xfb01('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a559c[_0xfb01('0x1e')]?_0x4a559c['options']['where']||null:null,'attributes':_0x4a559c['options']?_0x4a559c[_0xfb01('0x1e')][_0xfb01('0x1f')]||null:null,'limit':_0x4a559c[_0xfb01('0x1e')]?_0x4a559c[_0xfb01('0x1e')][_0xfb01('0x20')]||null:null})[_0xfb01('0x21')](function(_0x211cdf){logger[_0xfb01('0x18')](_0xfb01('0x1a'),_0x4a559c);logger['debug'](_0xfb01('0x1a'),_0x4a559c,JSON[_0xfb01('0x14')](_0x211cdf));_0x4e58b4(_0x211cdf);})[_0xfb01('0x19')](function(_0x407a20){logger['error']('UpdateChatInteraction',_0x407a20[_0xfb01('0x17')],_0x4a559c);_0x26bef8(_0x6f17f3['error'](0x1f4,_0x407a20['message']));});});};exports[_0xfb01('0x22')]=function(_0x56ce14){return new Promise(function(_0x4a0ece,_0x2bb6cc){return db[_0xfb01('0x1b')][_0xfb01('0x23')]({'where':_0x56ce14['options']?_0x56ce14[_0xfb01('0x1e')][_0xfb01('0x24')]||null:null})['then'](function(_0x45e59a){if(_0x45e59a){return _0x45e59a[_0xfb01('0x25')](_0x56ce14[_0xfb01('0x1d')][_0xfb01('0x26')],_[_0xfb01('0x27')](_0x56ce14[_0xfb01('0x1d')],[_0xfb01('0x26'),'id'])||{});}})[_0xfb01('0x28')](function(_0x456538){logger[_0xfb01('0x18')](_0xfb01('0x29'),_0x56ce14);logger[_0xfb01('0x13')](_0xfb01('0x29'),_0x56ce14,JSON['stringify'](_0x456538));_0x4a0ece(_0x456538);})[_0xfb01('0x19')](function(_0x4a71da){logger[_0xfb01('0x15')](_0xfb01('0x29'),_0x4a71da['message'],_0x56ce14);_0x2bb6cc(_this[_0xfb01('0x15')](0x1f4,_0x4a71da['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 059cf66..308985d 100644
--- a/server/api/chatInteraction/chatInteraction.socket.js
+++ b/server/api/chatInteraction/chatInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6dbb=['register','./chatInteraction.events','emit','removeListener'];(function(_0x10b933,_0x20c508){var _0x464a11=function(_0x26367a){while(--_0x26367a){_0x10b933['push'](_0x10b933['shift']());}};_0x464a11(++_0x20c508);}(_0x6dbb,0x1b5));var _0xb6db=function(_0x1e070f,_0x39661f){_0x1e070f=_0x1e070f-0x0;var _0x38569f=_0x6dbb[_0x1e070f];return _0x38569f;};'use strict';var ChatInteractionEvents=require(_0xb6db('0x0'));var events=['save','remove','update'];function createListener(_0x142a8f,_0x2439f3){return function(_0xee45f6){_0x2439f3[_0xb6db('0x1')](_0x142a8f,_0xee45f6);};}function removeListener(_0x1eae89,_0x24ee75){return function(){ChatInteractionEvents[_0xb6db('0x2')](_0x1eae89,_0x24ee75);};}exports[_0xb6db('0x3')]=function(_0x4473b1){for(var _0x1f2f97=0x0,_0x213839=events['length'];_0x1f2f97<_0x213839;_0x1f2f97++){var _0x49f2b6=events[_0x1f2f97];var _0xfd7e03=createListener('chatInteraction:'+_0x49f2b6,_0x4473b1);ChatInteractionEvents['on'](_0x49f2b6,_0xfd7e03);}};
\ No newline at end of file
+var _0xabe6=['save','remove','update','removeListener','register','length','./chatInteraction.events'];(function(_0x636f31,_0x51acfc){var _0x3a394d=function(_0x1a6bf5){while(--_0x1a6bf5){_0x636f31['push'](_0x636f31['shift']());}};_0x3a394d(++_0x51acfc);}(_0xabe6,0x84));var _0x6abe=function(_0xe88d61,_0x56fd65){_0xe88d61=_0xe88d61-0x0;var _0x4f67b3=_0xabe6[_0xe88d61];return _0x4f67b3;};'use strict';var ChatInteractionEvents=require(_0x6abe('0x0'));var events=[_0x6abe('0x1'),_0x6abe('0x2'),_0x6abe('0x3')];function createListener(_0x4726f2,_0x50e90a){return function(_0x4ae16f){_0x50e90a['emit'](_0x4726f2,_0x4ae16f);};}function removeListener(_0x2fa073,_0xf0b0a2){return function(){ChatInteractionEvents[_0x6abe('0x4')](_0x2fa073,_0xf0b0a2);};}exports[_0x6abe('0x5')]=function(_0x4c8755){for(var _0x2f50b8=0x0,_0x3c5b79=events[_0x6abe('0x6')];_0x2f50b8<_0x3c5b79;_0x2f50b8++){var _0x4ae157=events[_0x2f50b8];var _0x1ae025=createListener('chatInteraction:'+_0x4ae157,_0x4c8755);ChatInteractionEvents['on'](_0x4ae157,_0x1ae025);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 8a55c79..f6ba991 100644
--- a/server/api/chatInteraction/index.js
+++ b/server/api/chatInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdf7c=['/:id/attachment_download','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','diskStorage','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','isChatInteractionAuthorized','show'];(function(_0x3ead6c,_0x52f38c){var _0x211fe8=function(_0x4741ff){while(--_0x4741ff){_0x3ead6c['push'](_0x3ead6c['shift']());}};_0x211fe8(++_0x52f38c);}(_0xdf7c,0xf0));var _0xcdf7=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0xdf7c[_0xcfeda9];return _0x4826c7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcdf7('0x0'));var timeout=require(_0xcdf7('0x1'));var express=require(_0xcdf7('0x2'));var router=express[_0xcdf7('0x3')]();var fs_extra=require(_0xcdf7('0x4'));var auth=require(_0xcdf7('0x5'));var interaction=require(_0xcdf7('0x6'));var config=require(_0xcdf7('0x7'));var controller=require(_0xcdf7('0x8'));router[_0xcdf7('0x9')]('/',auth[_0xcdf7('0xa')](),controller[_0xcdf7('0xb')]);router[_0xcdf7('0x9')](_0xcdf7('0xc'),auth[_0xcdf7('0xa')](),controller['describe']);router[_0xcdf7('0x9')]('/:id',auth[_0xcdf7('0xd')](),controller[_0xcdf7('0xe')]);router[_0xcdf7('0x9')](_0xcdf7('0xf'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xcdf7('0x9')](_0xcdf7('0x10'),auth['isAuthenticated'](),controller['getMessages']);router[_0xcdf7('0x9')](_0xcdf7('0x11'),auth[_0xcdf7('0xd')](),controller[_0xcdf7('0x12')]);router[_0xcdf7('0x9')](_0xcdf7('0x13'),auth[_0xcdf7('0xa')](),controller[_0xcdf7('0x14')]);router['post']('/',auth[_0xcdf7('0xa')](),controller[_0xcdf7('0x15')]);router[_0xcdf7('0x16')]('/:id/vidaoo',auth[_0xcdf7('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xcdf7('0x17')]({'destination':function(_0x3a3de5,_0x5661cf,_0x19bcce){_0x19bcce(null,path['join'](config[_0xcdf7('0x18')],_0xcdf7('0x19')));},'filename':function(_0x12a3ff,_0x13a9de,_0x2327d5){_0x2327d5(null,util[_0xcdf7('0x1a')]('%s-%s',Date[_0xcdf7('0x1b')](),_0x13a9de[_0xcdf7('0x1c')][_0xcdf7('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xcdf7('0x16')](_0xcdf7('0x1e'),upload[_0xcdf7('0x1f')](_0xcdf7('0x20')),controller[_0xcdf7('0x21')]);router['post']('/:id/messages',auth[_0xcdf7('0xd')](),controller[_0xcdf7('0x22')]);router[_0xcdf7('0x16')]('/:id/tags',auth[_0xcdf7('0xa')](),interaction[_0xcdf7('0x23')](_0xcdf7('0x24'),_0xcdf7('0x25')),controller['addTags']);router[_0xcdf7('0x26')]('/:id',auth[_0xcdf7('0xa')](),interaction[_0xcdf7('0x23')]('chat',_0xcdf7('0x27')),controller[_0xcdf7('0x28')]);router['put'](_0xcdf7('0x29'),controller['customUpdate']);router[_0xcdf7('0x26')](_0xcdf7('0x2a'),auth[_0xcdf7('0xd')](),controller[_0xcdf7('0x2b')]);router[_0xcdf7('0x26')](_0xcdf7('0x2c'),controller[_0xcdf7('0x2d')]);router[_0xcdf7('0x2e')]('/:id',auth['isAuthenticated'](),interaction[_0xcdf7('0x23')]('chat',_0xcdf7('0x2f')),controller[_0xcdf7('0x30')]);router[_0xcdf7('0x2e')](_0xcdf7('0x31'),auth['isAuthenticated'](),controller[_0xcdf7('0x32')]);module['exports']=router;
\ No newline at end of file
+var _0x347d=['delete','chatinteraction:destroy','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','describe','/:id','show','attachmentDownload','/:id/messages','isAuthenticated','getMessages','isChatInteractionAuthorized','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','now','originalname','single','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','chat','chatinteraction:update','update','/:id/custom_update','put','/:id/abandon','/:id/close'];(function(_0x17e1f5,_0x1fbee8){var _0x2e4b8a=function(_0x39dbaa){while(--_0x39dbaa){_0x17e1f5['push'](_0x17e1f5['shift']());}};_0x2e4b8a(++_0x1fbee8);}(_0x347d,0x162));var _0xd347=function(_0x22c217,_0x1099b2){_0x22c217=_0x22c217-0x0;var _0x5e3ef1=_0x347d[_0x22c217];return _0x5e3ef1;};'use strict';var multer=require(_0xd347('0x0'));var util=require(_0xd347('0x1'));var path=require(_0xd347('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd347('0x3')]();var fs_extra=require(_0xd347('0x4'));var auth=require(_0xd347('0x5'));var interaction=require(_0xd347('0x6'));var config=require(_0xd347('0x7'));var controller=require(_0xd347('0x8'));router[_0xd347('0x9')]('/',auth['isAuthenticated'](),controller[_0xd347('0xa')]);router[_0xd347('0x9')](_0xd347('0xb'),auth['isAuthenticated'](),controller[_0xd347('0xc')]);router[_0xd347('0x9')](_0xd347('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xd347('0xe')]);router[_0xd347('0x9')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0xd347('0xf')]);router[_0xd347('0x9')](_0xd347('0x10'),auth[_0xd347('0x11')](),controller[_0xd347('0x12')]);router['get']('/:id/my_messages',auth[_0xd347('0x13')](),controller['getMyMessages']);router[_0xd347('0x9')](_0xd347('0x14'),auth['isAuthenticated'](),controller[_0xd347('0x15')]);router[_0xd347('0x16')]('/',auth['isAuthenticated'](),controller[_0xd347('0x17')]);router[_0xd347('0x16')](_0xd347('0x18'),auth[_0xd347('0x11')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xd347('0x19')]({'destination':function(_0x1c89f5,_0x4c5324,_0x33dd80){_0x33dd80(null,path[_0xd347('0x1a')](config[_0xd347('0x1b')],_0xd347('0x1c')));},'filename':function(_0x4de946,_0x2fe5ce,_0x2a3df2){_0x2a3df2(null,util[_0xd347('0x1d')]('%s-%s',Date[_0xd347('0x1e')](),_0x2fe5ce[_0xd347('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd347('0x16')]('/:id/attachment_upload',upload[_0xd347('0x20')]('file'),controller[_0xd347('0x21')]);router[_0xd347('0x16')](_0xd347('0x10'),auth[_0xd347('0x13')](),controller[_0xd347('0x22')]);router[_0xd347('0x16')](_0xd347('0x23'),auth['isAuthenticated'](),interaction[_0xd347('0x24')]('chat',_0xd347('0x25')),controller[_0xd347('0x26')]);router['put'](_0xd347('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0xd347('0x27'),_0xd347('0x28')),controller[_0xd347('0x29')]);router['put'](_0xd347('0x2a'),controller['customUpdate']);router[_0xd347('0x2b')](_0xd347('0x2c'),auth[_0xd347('0x13')](),controller['abandon']);router[_0xd347('0x2b')](_0xd347('0x2d'),controller['close']);router[_0xd347('0x2e')](_0xd347('0xd'),auth[_0xd347('0x11')](),interaction[_0xd347('0x24')]('chat',_0xd347('0x2f')),controller[_0xd347('0x30')]);router['delete'](_0xd347('0x23'),auth[_0xd347('0x11')](),controller['removeTags']);module[_0xd347('0x31')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 034e006..2557504 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdf7e=['sequelize','exports','TEXT','BOOLEAN'];(function(_0x3d4995,_0x3bd75d){var _0x263a2c=function(_0x3ff5e5){while(--_0x3ff5e5){_0x3d4995['push'](_0x3d4995['shift']());}};_0x263a2c(++_0x3bd75d);}(_0xdf7e,0x130));var _0xedf7=function(_0x131b54,_0x2e4c2e){_0x131b54=_0x131b54-0x0;var _0x3e7b7b=_0xdf7e[_0x131b54];return _0x3e7b7b;};'use strict';var Sequelize=require(_0xedf7('0x0'));module[_0xedf7('0x1')]={'body':{'type':Sequelize[_0xedf7('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xedf7('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x5e07=['BOOLEAN','sequelize','exports','medium'];(function(_0xa78cbb,_0x1dbfe9){var _0x148223=function(_0x301e36){while(--_0x301e36){_0xa78cbb['push'](_0xa78cbb['shift']());}};_0x148223(++_0x1dbfe9);}(_0x5e07,0xa5));var _0x75e0=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5e07[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0x75e0('0x0'));module[_0x75e0('0x1')]={'body':{'type':Sequelize['TEXT'](_0x75e0('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x75e0('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 1d9cecb..c822ace 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.controller.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf717=['set','Content-Range','apply','reject','save','then','destroy','name','send','index','fieldName','type','key','query','filters','model','attributes','intersection','fields','nolimit','sort','pick','filter','where','merge','map','VIRTUAL','ChatInternalMessage','includeAll','findAll','params','keys','rawAttributes','length','options','find','catch','create','body','update','describe','get','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','role','internal','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','resourceId','push','createdAt','FromId','ToId','read','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x256ffb,_0x19f08f){var _0x3c9a19=function(_0x58771c){while(--_0x58771c){_0x256ffb['push'](_0x256ffb['shift']());}};_0x3c9a19(++_0x19f08f);}(_0xf717,0x17f));var _0x7f71=function(_0x5b0e77,_0x233e4a){_0x5b0e77=_0x5b0e77-0x0;var _0x4ab639=_0xf717[_0x5b0e77];return _0x4ab639;};'use strict';var emlformat=require(_0x7f71('0x0'));var rimraf=require(_0x7f71('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7f71('0x2'));var moment=require(_0x7f71('0x3'));var BPromise=require(_0x7f71('0x4'));var Mustache=require('mustache');var util=require(_0x7f71('0x5'));var path=require(_0x7f71('0x6'));var sox=require(_0x7f71('0x7'));var csv=require(_0x7f71('0x8'));var ejs=require(_0x7f71('0x9'));var fs=require('fs');var fs_extra=require(_0x7f71('0xa'));var _=require(_0x7f71('0xb'));var squel=require(_0x7f71('0xc'));var crypto=require(_0x7f71('0xd'));var jsforce=require(_0x7f71('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7f71('0xf'));var Papa=require(_0x7f71('0x10'));var Redis=require(_0x7f71('0x11'));var authService=require(_0x7f71('0x12'));var qs=require(_0x7f71('0x13'));var as=require(_0x7f71('0x14'));var hardwareService=require(_0x7f71('0x15'));var logger=require('../../config/logger')(_0x7f71('0x16'));var utils=require('../../config/utils');var config=require(_0x7f71('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f71('0x18'))['db'];config[_0x7f71('0x19')]=_['defaults'](config[_0x7f71('0x19')],{'host':_0x7f71('0x1a'),'port':0x18eb});var socket=require(_0x7f71('0x1b'))(new Redis(config[_0x7f71('0x19')]));require(_0x7f71('0x1c'))['register'](socket);function respondWithStatusCode(_0x1edba8,_0x24a77b){_0x24a77b=_0x24a77b||0xcc;return function(_0x58c599){if(_0x58c599){return _0x1edba8[_0x7f71('0x1d')](_0x24a77b);}return _0x1edba8[_0x7f71('0x1e')](_0x24a77b)[_0x7f71('0x1f')]();};}function respondWithResult(_0x41aeb0,_0x27db1a){_0x27db1a=_0x27db1a||0xc8;return function(_0x3592e3){if(_0x3592e3){return _0x41aeb0[_0x7f71('0x1e')](_0x27db1a)[_0x7f71('0x20')](_0x3592e3);}};}function respondWithFilteredResult(_0x7a9f9f,_0x508994){return function(_0x28d3ad){if(_0x28d3ad){var _0x2fab7a=typeof _0x508994[_0x7f71('0x21')]===_0x7f71('0x22')&&typeof _0x508994[_0x7f71('0x23')]===_0x7f71('0x22');var _0x23d996=_0x28d3ad[_0x7f71('0x24')];var _0x27cf31=_0x2fab7a?0x0:_0x508994['offset'];var _0x345d5b=_0x2fab7a?_0x28d3ad[_0x7f71('0x24')]:_0x508994['offset']+_0x508994['limit'];var _0x465f83;if(_0x345d5b>=_0x23d996){_0x345d5b=_0x23d996;_0x465f83=0xc8;}else{_0x465f83=0xce;}_0x7a9f9f['status'](_0x465f83);return _0x7a9f9f[_0x7f71('0x25')](_0x7f71('0x26'),_0x27cf31+'-'+_0x345d5b+'/'+_0x23d996)[_0x7f71('0x20')](_0x28d3ad);}return null;};}function patchUpdates(_0x32a419){return function(_0x3cd2ad){try{jsonpatch[_0x7f71('0x27')](_0x3cd2ad,_0x32a419,!![]);}catch(_0x4c1c5b){return BPromise[_0x7f71('0x28')](_0x4c1c5b);}return _0x3cd2ad[_0x7f71('0x29')]();};}function saveUpdates(_0x5c413d,_0xcd9a72){return function(_0x103a29){if(_0x103a29){return _0x103a29['update'](_0x5c413d)[_0x7f71('0x2a')](function(_0x3482c6){return _0x3482c6;});}return null;};}function removeEntity(_0x5cffc2,_0x2b2f5a){return function(_0x24e00b){if(_0x24e00b){return _0x24e00b[_0x7f71('0x2b')]()[_0x7f71('0x2a')](function(){_0x5cffc2[_0x7f71('0x1e')](0xcc)[_0x7f71('0x1f')]();});}};}function handleEntityNotFound(_0x18c753,_0x510437){return function(_0x4682ef){if(!_0x4682ef){_0x18c753[_0x7f71('0x1d')](0x194);}return _0x4682ef;};}function handleError(_0x243497,_0x383de6){_0x383de6=_0x383de6||0x1f4;return function(_0x2ae04b){logger['error'](_0x2ae04b['stack']);if(_0x2ae04b[_0x7f71('0x2c')]){delete _0x2ae04b[_0x7f71('0x2c')];}_0x243497[_0x7f71('0x1e')](_0x383de6)[_0x7f71('0x2d')](_0x2ae04b);};}exports[_0x7f71('0x2e')]=function(_0x37ed1b,_0x1a51ed){var _0xe91919={},_0x17256b={},_0x2af56e={'count':0x0,'rows':[]};var _0x1b0eeb=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0x260d58){return{'name':_0x260d58[_0x7f71('0x2f')],'type':_0x260d58[_0x7f71('0x30')][_0x7f71('0x31')]};});_0x17256b['model']=_['map'](_0x1b0eeb,_0x7f71('0x2c'));_0x17256b[_0x7f71('0x32')]=_['keys'](_0x37ed1b[_0x7f71('0x32')]);_0x17256b[_0x7f71('0x33')]=_['intersection'](_0x17256b[_0x7f71('0x34')],_0x17256b[_0x7f71('0x32')]);_0xe91919[_0x7f71('0x35')]=_[_0x7f71('0x36')](_0x17256b[_0x7f71('0x34')],qs[_0x7f71('0x37')](_0x37ed1b[_0x7f71('0x32')][_0x7f71('0x37')]));_0xe91919[_0x7f71('0x35')]=_0xe91919[_0x7f71('0x35')]['length']?_0xe91919[_0x7f71('0x35')]:_0x17256b[_0x7f71('0x34')];if(!_0x37ed1b[_0x7f71('0x32')]['hasOwnProperty'](_0x7f71('0x38'))){_0xe91919[_0x7f71('0x23')]=qs[_0x7f71('0x23')](_0x37ed1b[_0x7f71('0x32')][_0x7f71('0x23')]);_0xe91919[_0x7f71('0x21')]=qs[_0x7f71('0x21')](_0x37ed1b[_0x7f71('0x32')]['offset']);}_0xe91919['order']=qs[_0x7f71('0x39')](_0x37ed1b[_0x7f71('0x32')][_0x7f71('0x39')]);_0xe91919['where']=qs['filters'](_[_0x7f71('0x3a')](_0x37ed1b[_0x7f71('0x32')],_0x17256b[_0x7f71('0x33')]),_0x1b0eeb);if(_0x37ed1b['query'][_0x7f71('0x3b')]){_0xe91919[_0x7f71('0x3c')]=_[_0x7f71('0x3d')](_0xe91919[_0x7f71('0x3c')],{'$or':_[_0x7f71('0x3e')](_0x1b0eeb,function(_0x3bfa8d){if(_0x3bfa8d[_0x7f71('0x30')]!==_0x7f71('0x3f')){var _0x23497d={};_0x23497d[_0x3bfa8d[_0x7f71('0x2c')]]={'$like':'%'+_0x37ed1b['query']['filter']+'%'};return _0x23497d;}})});}_0xe91919=_[_0x7f71('0x3d')]({},_0xe91919,_0x37ed1b['options']);var _0x40d2c4={'where':_0xe91919['where']};return db[_0x7f71('0x40')]['count'](_0x40d2c4)[_0x7f71('0x2a')](function(_0x28849b){_0x2af56e[_0x7f71('0x24')]=_0x28849b;if(_0x37ed1b['query'][_0x7f71('0x41')]){_0xe91919['include']=[{'all':!![]}];}return db[_0x7f71('0x40')][_0x7f71('0x42')](_0xe91919);})[_0x7f71('0x2a')](function(_0x375fca){_0x2af56e['rows']=_0x375fca;return _0x2af56e;})[_0x7f71('0x2a')](respondWithFilteredResult(_0x1a51ed,_0xe91919))['catch'](handleError(_0x1a51ed,null));};exports['show']=function(_0x560c44,_0x1c5ab3){var _0x135c99={'raw':!![],'where':{'id':_0x560c44[_0x7f71('0x43')]['id']}},_0x519c42={};_0x519c42[_0x7f71('0x34')]=_[_0x7f71('0x44')](db[_0x7f71('0x40')][_0x7f71('0x45')]);_0x519c42[_0x7f71('0x32')]=_['keys'](_0x560c44[_0x7f71('0x32')]);_0x519c42[_0x7f71('0x33')]=_[_0x7f71('0x36')](_0x519c42[_0x7f71('0x34')],_0x519c42[_0x7f71('0x32')]);_0x135c99[_0x7f71('0x35')]=_[_0x7f71('0x36')](_0x519c42[_0x7f71('0x34')],qs['fields'](_0x560c44[_0x7f71('0x32')][_0x7f71('0x37')]));_0x135c99[_0x7f71('0x35')]=_0x135c99[_0x7f71('0x35')][_0x7f71('0x46')]?_0x135c99[_0x7f71('0x35')]:_0x519c42[_0x7f71('0x34')];if(_0x560c44['query']['includeAll']){_0x135c99['include']=[{'all':!![]}];}_0x135c99=_[_0x7f71('0x3d')]({},_0x135c99,_0x560c44[_0x7f71('0x47')]);return db[_0x7f71('0x40')][_0x7f71('0x48')](_0x135c99)[_0x7f71('0x2a')](handleEntityNotFound(_0x1c5ab3,null))[_0x7f71('0x2a')](respondWithResult(_0x1c5ab3,null))[_0x7f71('0x49')](handleError(_0x1c5ab3,null));};exports[_0x7f71('0x4a')]=function(_0xab1299,_0x4e414a){return db['ChatInternalMessage'][_0x7f71('0x4a')](_0xab1299[_0x7f71('0x4b')],{})[_0x7f71('0x2a')](respondWithResult(_0x4e414a,0xc9))['catch'](handleError(_0x4e414a,null));};exports[_0x7f71('0x4c')]=function(_0x487a0c,_0x4506b2){if(_0x487a0c['body']['id']){delete _0x487a0c['body']['id'];}return db['ChatInternalMessage'][_0x7f71('0x48')]({'where':{'id':_0x487a0c['params']['id']}})['then'](handleEntityNotFound(_0x4506b2,null))[_0x7f71('0x2a')](saveUpdates(_0x487a0c['body'],null))['then'](respondWithResult(_0x4506b2,null))[_0x7f71('0x49')](handleError(_0x4506b2,null));};exports['destroy']=function(_0x5ae970,_0xad1d0a){return db[_0x7f71('0x40')][_0x7f71('0x48')]({'where':{'id':_0x5ae970['params']['id']}})[_0x7f71('0x2a')](handleEntityNotFound(_0xad1d0a,null))[_0x7f71('0x2a')](removeEntity(_0xad1d0a,null))[_0x7f71('0x49')](handleError(_0xad1d0a,null));};exports[_0x7f71('0x4d')]=function(_0x57d8f8,_0x245de5){return db[_0x7f71('0x40')][_0x7f71('0x4d')]()[_0x7f71('0x2a')](respondWithResult(_0x245de5,null))['catch'](handleError(_0x245de5,null));};function wrapUser(_0x1e3f40){return function(_0x100e15){var _0x497b87=_0x1e3f40[_0x7f71('0x4e')]({'plain':!![]});_0x497b87[_0x7f71('0x4f')]=[];if(_0x100e15){_0x497b87[_0x7f71('0x50')]=_0x100e15['createdAt'];_0x497b87['lastMessage']=_0x100e15;}else{_0x497b87[_0x7f71('0x50')]=moment(0x0)[_0x7f71('0x51')](_0x7f71('0x52'));_0x497b87['lastMessage']={};}return _0x497b87;};}exports[_0x7f71('0x53')]=function(_0xd6bba8,_0x4c5e9a,_0x30c43c){var _0xde13a2=[];return db[_0x7f71('0x54')][_0x7f71('0x42')]({'where':{'role':[_0x7f71('0x55'),'admin',_0x7f71('0x56')]},'attributes':['id',_0x7f71('0x57'),_0x7f71('0x2c'),_0x7f71('0x58'),'userpic',_0x7f71('0x59'),'online',_0x7f71('0x5a'),'allowmessenger',_0x7f71('0x5b')],'order':qs['sort'](_0x7f71('0x5c')),'include':[{'model':db[_0x7f71('0x5d')],'as':_0x7f71('0x5e'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x7f71('0x2a')](function(_0xc0ac54){if(_0xc0ac54){var _0x640b38=_0xd6bba8[_0x7f71('0x56')][_0x7f71('0x4e')]({'plain':!![]});if(!_0x640b38)throw new Error(_0x7f71('0x5f'));if(_0x640b38[_0x7f71('0x58')]==='user'){return db[_0x7f71('0x60')][_0x7f71('0x48')]({'where':{'name':_0x7f71('0x61'),'userProfileId':_0x640b38['userProfileId']},'raw':!![]})[_0x7f71('0x2a')](function(_0x251b70){if(_0x251b70){if(_0x251b70[_0x7f71('0x62')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x251b70['id']},'raw':!![]})[_0x7f71('0x2a')](function(_0x5c75df){var _0x7f8f6f=[];if(_['isEmpty'](_0x5c75df)){_0x7f8f6f=_[_0x7f71('0x3b')](_0xc0ac54,function(_0x2e3842){if(_0x2e3842[_0x7f71('0x58')]!=='agent'){return _0x2e3842;}});return _0x7f8f6f;}else{for(var _0x115598=0x0;_0x115598<_0xc0ac54[_0x7f71('0x46')];_0x115598++){var _0x30ea55=_0xc0ac54[_0x115598];if(_0x30ea55['role']===_0x7f71('0x55')){var _0x706da1=_[_0x7f71('0x48')](_0x5c75df,function(_0x32dcf1){return _0x32dcf1[_0x7f71('0x63')]===_0x30ea55['id'];});if(_0x706da1)_0x7f8f6f[_0x7f71('0x64')](_0x30ea55);}else{_0x7f8f6f[_0x7f71('0x64')](_0x30ea55);}}return _0x7f8f6f;}});}else{return _0xc0ac54;}}else{var _0x22fffc=_[_0x7f71('0x3b')](_0xc0ac54,function(_0x59f16c){if(_0x59f16c[_0x7f71('0x58')]!==_0x7f71('0x55')){return _0x59f16c;}});return _0x22fffc;}});}else{return _0xc0ac54;}}})[_0x7f71('0x2a')](function(_0x29a26a){var _0x5e95dd=[];if(_0x29a26a){_0xde13a2=_0x29a26a;for(var _0x328913=0x0;_0x328913<_0x29a26a[_0x7f71('0x46')];_0x328913+=0x1){_0xde13a2[_0x328913][_0x7f71('0x4f')]=[];_0x5e95dd['push'](db[_0x7f71('0x40')][_0x7f71('0x48')]({'where':{'FromId':[_0xd6bba8[_0x7f71('0x56')]['id'],_0x29a26a[_0x328913]['id']],'ToId':[_0xd6bba8['user']['id'],_0x29a26a[_0x328913]['id']],'ChatGroupId':null},'attributes':['id',_0x7f71('0x65'),_0x7f71('0x66'),_0x7f71('0x67'),_0x7f71('0x68'),'body'],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7f71('0x2a')](wrapUser(_0x29a26a[_0x328913])));}return BPromise['all'](_0x5e95dd);}return[];})[_0x7f71('0x2a')](function(_0x599845){return{'rows':_0x599845,'count':_0x599845[_0x7f71('0x46')]};})[_0x7f71('0x2a')](respondWithResult(_0x4c5e9a,null))[_0x7f71('0x49')](handleError(_0x4c5e9a,null));};
\ No newline at end of file
+var _0xeaf2=['online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','ToId','read','-createdAt','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','ChatInternalMessage','rawAttributes','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','role','internal'];(function(_0x45a2c2,_0x1e6d9a){var _0x3a8dc2=function(_0x497d5e){while(--_0x497d5e){_0x45a2c2['push'](_0x45a2c2['shift']());}};_0x3a8dc2(++_0x1e6d9a);}(_0xeaf2,0xf2));var _0x2eaf=function(_0x1979d8,_0x10d8f2){_0x1979d8=_0x1979d8-0x0;var _0x1d5bb3=_0xeaf2[_0x1979d8];return _0x1d5bb3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2eaf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2eaf('0x1'));var rp=require(_0x2eaf('0x2'));var moment=require(_0x2eaf('0x3'));var BPromise=require(_0x2eaf('0x4'));var Mustache=require('mustache');var util=require(_0x2eaf('0x5'));var path=require(_0x2eaf('0x6'));var sox=require(_0x2eaf('0x7'));var csv=require(_0x2eaf('0x8'));var ejs=require(_0x2eaf('0x9'));var fs=require('fs');var fs_extra=require(_0x2eaf('0xa'));var _=require(_0x2eaf('0xb'));var squel=require('squel');var crypto=require(_0x2eaf('0xc'));var jsforce=require(_0x2eaf('0xd'));var deskjs=require(_0x2eaf('0xe'));var toCsv=require(_0x2eaf('0x8'));var querystring=require(_0x2eaf('0xf'));var Papa=require(_0x2eaf('0x10'));var Redis=require(_0x2eaf('0x11'));var authService=require(_0x2eaf('0x12'));var qs=require(_0x2eaf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2eaf('0x14'));var logger=require(_0x2eaf('0x15'))(_0x2eaf('0x16'));var utils=require(_0x2eaf('0x17'));var config=require(_0x2eaf('0x18'));var licenseUtil=require(_0x2eaf('0x19'));var db=require(_0x2eaf('0x1a'))['db'];config[_0x2eaf('0x1b')]=_[_0x2eaf('0x1c')](config['redis'],{'host':_0x2eaf('0x1d'),'port':0x18eb});var socket=require(_0x2eaf('0x1e'))(new Redis(config[_0x2eaf('0x1b')]));require(_0x2eaf('0x1f'))[_0x2eaf('0x20')](socket);function respondWithStatusCode(_0xcd161f,_0x42336a){_0x42336a=_0x42336a||0xcc;return function(_0x30b235){if(_0x30b235){return _0xcd161f[_0x2eaf('0x21')](_0x42336a);}return _0xcd161f['status'](_0x42336a)[_0x2eaf('0x22')]();};}function respondWithResult(_0x253842,_0x5df7e4){_0x5df7e4=_0x5df7e4||0xc8;return function(_0x5fec83){if(_0x5fec83){return _0x253842[_0x2eaf('0x23')](_0x5df7e4)[_0x2eaf('0x24')](_0x5fec83);}};}function respondWithFilteredResult(_0x5f4e1c,_0x33df17){return function(_0x2c313f){if(_0x2c313f){var _0x3f60d4=typeof _0x33df17[_0x2eaf('0x25')]==='undefined'&&typeof _0x33df17[_0x2eaf('0x26')]===_0x2eaf('0x27');var _0x2957ed=_0x2c313f[_0x2eaf('0x28')];var _0x4c82d2=_0x3f60d4?0x0:_0x33df17[_0x2eaf('0x25')];var _0x40ce0e=_0x3f60d4?_0x2c313f[_0x2eaf('0x28')]:_0x33df17[_0x2eaf('0x25')]+_0x33df17[_0x2eaf('0x26')];var _0x3bba7f;if(_0x40ce0e>=_0x2957ed){_0x40ce0e=_0x2957ed;_0x3bba7f=0xc8;}else{_0x3bba7f=0xce;}_0x5f4e1c[_0x2eaf('0x23')](_0x3bba7f);return _0x5f4e1c[_0x2eaf('0x29')](_0x2eaf('0x2a'),_0x4c82d2+'-'+_0x40ce0e+'/'+_0x2957ed)[_0x2eaf('0x24')](_0x2c313f);}return null;};}function patchUpdates(_0x4b0475){return function(_0x54f3a9){try{jsonpatch['apply'](_0x54f3a9,_0x4b0475,!![]);}catch(_0x4f07f5){return BPromise[_0x2eaf('0x2b')](_0x4f07f5);}return _0x54f3a9[_0x2eaf('0x2c')]();};}function saveUpdates(_0x4a9fbd,_0x18676d){return function(_0x30a772){if(_0x30a772){return _0x30a772[_0x2eaf('0x2d')](_0x4a9fbd)[_0x2eaf('0x2e')](function(_0x51348d){return _0x51348d;});}return null;};}function removeEntity(_0x4ef8f9,_0x16733f){return function(_0x2e8432){if(_0x2e8432){return _0x2e8432[_0x2eaf('0x2f')]()['then'](function(){_0x4ef8f9[_0x2eaf('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5eced6,_0x427e64){return function(_0x40c56a){if(!_0x40c56a){_0x5eced6['sendStatus'](0x194);}return _0x40c56a;};}function handleError(_0x55dc4a,_0x1dd647){_0x1dd647=_0x1dd647||0x1f4;return function(_0x1d3007){logger[_0x2eaf('0x30')](_0x1d3007['stack']);if(_0x1d3007[_0x2eaf('0x31')]){delete _0x1d3007[_0x2eaf('0x31')];}_0x55dc4a['status'](_0x1dd647)[_0x2eaf('0x32')](_0x1d3007);};}exports['index']=function(_0x43e2e5,_0x2af7a5){var _0x1e309d={},_0x5acf81={},_0x27f2d5={'count':0x0,'rows':[]};var _0x13ce06=_['map'](db[_0x2eaf('0x33')][_0x2eaf('0x34')],function(_0x2d0141){return{'name':_0x2d0141['fieldName'],'type':_0x2d0141['type']['key']};});_0x5acf81['model']=_[_0x2eaf('0x35')](_0x13ce06,'name');_0x5acf81[_0x2eaf('0x36')]=_[_0x2eaf('0x37')](_0x43e2e5['query']);_0x5acf81[_0x2eaf('0x38')]=_[_0x2eaf('0x39')](_0x5acf81['model'],_0x5acf81[_0x2eaf('0x36')]);_0x1e309d['attributes']=_[_0x2eaf('0x39')](_0x5acf81[_0x2eaf('0x3a')],qs[_0x2eaf('0x3b')](_0x43e2e5['query'][_0x2eaf('0x3b')]));_0x1e309d[_0x2eaf('0x3c')]=_0x1e309d['attributes']['length']?_0x1e309d[_0x2eaf('0x3c')]:_0x5acf81[_0x2eaf('0x3a')];if(!_0x43e2e5[_0x2eaf('0x36')][_0x2eaf('0x3d')]('nolimit')){_0x1e309d[_0x2eaf('0x26')]=qs[_0x2eaf('0x26')](_0x43e2e5[_0x2eaf('0x36')]['limit']);_0x1e309d[_0x2eaf('0x25')]=qs['offset'](_0x43e2e5[_0x2eaf('0x36')][_0x2eaf('0x25')]);}_0x1e309d['order']=qs[_0x2eaf('0x3e')](_0x43e2e5[_0x2eaf('0x36')][_0x2eaf('0x3e')]);_0x1e309d[_0x2eaf('0x3f')]=qs['filters'](_[_0x2eaf('0x40')](_0x43e2e5[_0x2eaf('0x36')],_0x5acf81[_0x2eaf('0x38')]),_0x13ce06);if(_0x43e2e5[_0x2eaf('0x36')][_0x2eaf('0x41')]){_0x1e309d[_0x2eaf('0x3f')]=_['merge'](_0x1e309d['where'],{'$or':_['map'](_0x13ce06,function(_0x43c2e5){if(_0x43c2e5[_0x2eaf('0x42')]!=='VIRTUAL'){var _0x4a3907={};_0x4a3907[_0x43c2e5[_0x2eaf('0x31')]]={'$like':'%'+_0x43e2e5['query'][_0x2eaf('0x41')]+'%'};return _0x4a3907;}})});}_0x1e309d=_[_0x2eaf('0x43')]({},_0x1e309d,_0x43e2e5[_0x2eaf('0x44')]);var _0x50fdfe={'where':_0x1e309d[_0x2eaf('0x3f')]};return db['ChatInternalMessage'][_0x2eaf('0x28')](_0x50fdfe)[_0x2eaf('0x2e')](function(_0x420af0){_0x27f2d5[_0x2eaf('0x28')]=_0x420af0;if(_0x43e2e5[_0x2eaf('0x36')][_0x2eaf('0x45')]){_0x1e309d[_0x2eaf('0x46')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x2eaf('0x47')](_0x1e309d);})[_0x2eaf('0x2e')](function(_0x1509fe){_0x27f2d5[_0x2eaf('0x48')]=_0x1509fe;return _0x27f2d5;})[_0x2eaf('0x2e')](respondWithFilteredResult(_0x2af7a5,_0x1e309d))[_0x2eaf('0x49')](handleError(_0x2af7a5,null));};exports[_0x2eaf('0x4a')]=function(_0x225130,_0x5f19b1){var _0x23efd={'raw':!![],'where':{'id':_0x225130[_0x2eaf('0x4b')]['id']}},_0xb579d7={};_0xb579d7[_0x2eaf('0x3a')]=_[_0x2eaf('0x37')](db[_0x2eaf('0x33')][_0x2eaf('0x34')]);_0xb579d7[_0x2eaf('0x36')]=_[_0x2eaf('0x37')](_0x225130[_0x2eaf('0x36')]);_0xb579d7[_0x2eaf('0x38')]=_['intersection'](_0xb579d7[_0x2eaf('0x3a')],_0xb579d7[_0x2eaf('0x36')]);_0x23efd[_0x2eaf('0x3c')]=_[_0x2eaf('0x39')](_0xb579d7[_0x2eaf('0x3a')],qs[_0x2eaf('0x3b')](_0x225130['query'][_0x2eaf('0x3b')]));_0x23efd[_0x2eaf('0x3c')]=_0x23efd[_0x2eaf('0x3c')][_0x2eaf('0x4c')]?_0x23efd[_0x2eaf('0x3c')]:_0xb579d7[_0x2eaf('0x3a')];if(_0x225130[_0x2eaf('0x36')]['includeAll']){_0x23efd[_0x2eaf('0x46')]=[{'all':!![]}];}_0x23efd=_['merge']({},_0x23efd,_0x225130[_0x2eaf('0x44')]);return db[_0x2eaf('0x33')][_0x2eaf('0x4d')](_0x23efd)['then'](handleEntityNotFound(_0x5f19b1,null))[_0x2eaf('0x2e')](respondWithResult(_0x5f19b1,null))[_0x2eaf('0x49')](handleError(_0x5f19b1,null));};exports['create']=function(_0x25007d,_0x43468c){return db['ChatInternalMessage'][_0x2eaf('0x4e')](_0x25007d[_0x2eaf('0x4f')],{})[_0x2eaf('0x2e')](respondWithResult(_0x43468c,0xc9))['catch'](handleError(_0x43468c,null));};exports['update']=function(_0x46a577,_0x343f3e){if(_0x46a577[_0x2eaf('0x4f')]['id']){delete _0x46a577[_0x2eaf('0x4f')]['id'];}return db[_0x2eaf('0x33')][_0x2eaf('0x4d')]({'where':{'id':_0x46a577[_0x2eaf('0x4b')]['id']}})[_0x2eaf('0x2e')](handleEntityNotFound(_0x343f3e,null))[_0x2eaf('0x2e')](saveUpdates(_0x46a577['body'],null))['then'](respondWithResult(_0x343f3e,null))['catch'](handleError(_0x343f3e,null));};exports[_0x2eaf('0x2f')]=function(_0x8a38dd,_0x1959d3){return db['ChatInternalMessage'][_0x2eaf('0x4d')]({'where':{'id':_0x8a38dd[_0x2eaf('0x4b')]['id']}})[_0x2eaf('0x2e')](handleEntityNotFound(_0x1959d3,null))[_0x2eaf('0x2e')](removeEntity(_0x1959d3,null))[_0x2eaf('0x49')](handleError(_0x1959d3,null));};exports['describe']=function(_0x50e72c,_0x3a62d1){return db['ChatInternalMessage']['describe']()[_0x2eaf('0x2e')](respondWithResult(_0x3a62d1,null))[_0x2eaf('0x49')](handleError(_0x3a62d1,null));};function wrapUser(_0x40501e){return function(_0x502ed1){var _0x35a8d8=_0x40501e[_0x2eaf('0x50')]({'plain':!![]});_0x35a8d8[_0x2eaf('0x51')]=[];if(_0x502ed1){_0x35a8d8[_0x2eaf('0x52')]=_0x502ed1[_0x2eaf('0x53')];_0x35a8d8[_0x2eaf('0x54')]=_0x502ed1;}else{_0x35a8d8[_0x2eaf('0x52')]=moment(0x0)[_0x2eaf('0x55')](_0x2eaf('0x56'));_0x35a8d8[_0x2eaf('0x54')]={};}return _0x35a8d8;};}exports[_0x2eaf('0x57')]=function(_0x416ec,_0x41ebe5,_0x3fa240){var _0x17300f=[];return db[_0x2eaf('0x58')][_0x2eaf('0x47')]({'where':{'role':[_0x2eaf('0x59'),'admin',_0x2eaf('0x5a')]},'attributes':['id',_0x2eaf('0x5b'),_0x2eaf('0x31'),_0x2eaf('0x5c'),'userpic',_0x2eaf('0x5d'),_0x2eaf('0x5e'),_0x2eaf('0x5f'),_0x2eaf('0x60'),_0x2eaf('0x61')],'order':qs[_0x2eaf('0x3e')]('-online'),'include':[{'model':db[_0x2eaf('0x62')],'as':_0x2eaf('0x63'),'attributes':['id',_0x2eaf('0x31'),_0x2eaf('0x42')],'through':{'attributes':[]}}]})[_0x2eaf('0x2e')](function(_0xbec00b){if(_0xbec00b){var _0xefc718=_0x416ec[_0x2eaf('0x5a')]['get']({'plain':!![]});if(!_0xefc718)throw new Error(_0x2eaf('0x64'));if(_0xefc718[_0x2eaf('0x5c')]==='user'){return db[_0x2eaf('0x65')]['find']({'where':{'name':_0x2eaf('0x66'),'userProfileId':_0xefc718[_0x2eaf('0x67')]},'raw':!![]})[_0x2eaf('0x2e')](function(_0xe98d84){if(_0xe98d84){if(_0xe98d84[_0x2eaf('0x68')]===0x0){return db[_0x2eaf('0x69')][_0x2eaf('0x47')]({'where':{'sectionId':_0xe98d84['id']},'raw':!![]})[_0x2eaf('0x2e')](function(_0x2df95c){var _0x5cb16d=[];if(_[_0x2eaf('0x6a')](_0x2df95c)){_0x5cb16d=_[_0x2eaf('0x41')](_0xbec00b,function(_0x51811a){if(_0x51811a['role']!=='agent'){return _0x51811a;}});return _0x5cb16d;}else{for(var _0x4bb66d=0x0;_0x4bb66d<_0xbec00b['length'];_0x4bb66d++){var _0x242aed=_0xbec00b[_0x4bb66d];if(_0x242aed['role']===_0x2eaf('0x59')){var _0x3b94d0=_[_0x2eaf('0x4d')](_0x2df95c,function(_0x18c0ba){return _0x18c0ba[_0x2eaf('0x6b')]===_0x242aed['id'];});if(_0x3b94d0)_0x5cb16d['push'](_0x242aed);}else{_0x5cb16d[_0x2eaf('0x6c')](_0x242aed);}}return _0x5cb16d;}});}else{return _0xbec00b;}}else{var _0x3e5617=_[_0x2eaf('0x41')](_0xbec00b,function(_0x26ea05){if(_0x26ea05[_0x2eaf('0x5c')]!==_0x2eaf('0x59')){return _0x26ea05;}});return _0x3e5617;}});}else{return _0xbec00b;}}})[_0x2eaf('0x2e')](function(_0x28ed5e){var _0x1036b0=[];if(_0x28ed5e){_0x17300f=_0x28ed5e;for(var _0x4fa545=0x0;_0x4fa545<_0x28ed5e[_0x2eaf('0x4c')];_0x4fa545+=0x1){_0x17300f[_0x4fa545][_0x2eaf('0x51')]=[];_0x1036b0[_0x2eaf('0x6c')](db[_0x2eaf('0x33')]['find']({'where':{'FromId':[_0x416ec[_0x2eaf('0x5a')]['id'],_0x28ed5e[_0x4fa545]['id']],'ToId':[_0x416ec['user']['id'],_0x28ed5e[_0x4fa545]['id']],'ChatGroupId':null},'attributes':['id',_0x2eaf('0x53'),'FromId',_0x2eaf('0x6d'),_0x2eaf('0x6e'),_0x2eaf('0x4f')],'order':qs[_0x2eaf('0x3e')](_0x2eaf('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2eaf('0x2e')](wrapUser(_0x28ed5e[_0x4fa545])));}return BPromise['all'](_0x1036b0);}return[];})[_0x2eaf('0x2e')](function(_0x2f1570){return{'rows':_0x2f1570,'count':_0x2f1570[_0x2eaf('0x4c')]};})[_0x2eaf('0x2e')](respondWithResult(_0x41ebe5,null))[_0x2eaf('0x49')](handleError(_0x41ebe5,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 4978cd8..72e24dc 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.events.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70eb=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x5a93a6,_0x570cbc){var _0x327dc8=function(_0x19c4a2){while(--_0x19c4a2){_0x5a93a6['push'](_0x5a93a6['shift']());}};_0x327dc8(++_0x570cbc);}(_0x70eb,0xba));var _0xb70e=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x70eb[_0x3b0731];return _0x4204d7;};'use strict';var EventEmitter=require(_0xb70e('0x0'));var ChatInternalMessage=require(_0xb70e('0x1'))['db'][_0xb70e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb70e('0x3')](0x0);var events={'afterCreate':_0xb70e('0x4'),'afterUpdate':_0xb70e('0x5'),'afterDestroy':_0xb70e('0x6')};function emitEvent(_0x1096c6){return function(_0x3f1b13,_0x3bef7a,_0x20c28b){ChatInternalMessageEvents[_0xb70e('0x7')](_0x1096c6+':'+_0x3f1b13['id'],_0x3f1b13);ChatInternalMessageEvents[_0xb70e('0x7')](_0x1096c6,_0x3f1b13);_0x20c28b(null);};}for(var e in events){if(events[_0xb70e('0x8')](e)){var event=events[e];ChatInternalMessage[_0xb70e('0x9')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xd903=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x421340,_0xa5c387){var _0x3228d8=function(_0x5240ac){while(--_0x5240ac){_0x421340['push'](_0x421340['shift']());}};_0x3228d8(++_0xa5c387);}(_0xd903,0x198));var _0x3d90=function(_0x56a840,_0x117a56){_0x56a840=_0x56a840-0x0;var _0x1ea14d=_0xd903[_0x56a840];return _0x1ea14d;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x3d90('0x0'))['db'][_0x3d90('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3d90('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d90('0x3'),'afterDestroy':'remove'};function emitEvent(_0x373e78){return function(_0x50bcb6,_0x122e28,_0x1b8088){ChatInternalMessageEvents[_0x3d90('0x4')](_0x373e78+':'+_0x50bcb6['id'],_0x50bcb6);ChatInternalMessageEvents['emit'](_0x373e78,_0x50bcb6);_0x1b8088(null);};}for(var e in events){if(events[_0x3d90('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 0631b02..04d05b9 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.model.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x68bc=['utf8mb4','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages'];(function(_0x2f16b2,_0x4a3ad2){var _0x1ae44c=function(_0x2b6691){while(--_0x2b6691){_0x2f16b2['push'](_0x2f16b2['shift']());}};_0x1ae44c(++_0x4a3ad2);}(_0x68bc,0x85));var _0xc68b=function(_0x349827,_0x299de2){_0x349827=_0x349827-0x0;var _0x10a623=_0x68bc[_0x349827];return _0x10a623;};'use strict';var _=require('lodash');var util=require(_0xc68b('0x0'));var logger=require('../../config/logger')(_0xc68b('0x1'));var moment=require(_0xc68b('0x2'));var BPromise=require(_0xc68b('0x3'));var rp=require(_0xc68b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc68b('0x5'));var config=require(_0xc68b('0x6'));var attributes=require(_0xc68b('0x7'));module['exports']=function(_0x38ca4c,_0x2ffb69){return _0x38ca4c[_0xc68b('0x8')](_0xc68b('0x9'),attributes,{'tableName':_0xc68b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc68b('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc008=['../../config/environment','./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','path'];(function(_0x414fd2,_0x465216){var _0x1bb94f=function(_0x90b667){while(--_0x90b667){_0x414fd2['push'](_0x414fd2['shift']());}};_0x1bb94f(++_0x465216);}(_0xc008,0x17e));var _0x8c00=function(_0x9330f1,_0x397692){_0x9330f1=_0x9330f1-0x0;var _0x489e32=_0xc008[_0x9330f1];return _0x489e32;};'use strict';var _=require(_0x8c00('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c00('0x1'));var rimraf=require('rimraf');var config=require(_0x8c00('0x2'));var attributes=require(_0x8c00('0x3'));module[_0x8c00('0x4')]=function(_0x2acc22,_0x4a4246){return _0x2acc22[_0x8c00('0x5')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c00('0x6'),'collate':_0x8c00('0x7')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 98e327b..63d23eb 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadeb=['code','message','ChatInternalMessage,\x20%s,\x20%s','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','redis','./chatInternalMessage.socket','request','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xee1455,_0x24b625){var _0x395717=function(_0x3362cd){while(--_0x3362cd){_0xee1455['push'](_0xee1455['shift']());}};_0x395717(++_0x24b625);}(_0xadeb,0x1bd));var _0xbade=function(_0x2f6ec3,_0x35762a){_0x2f6ec3=_0x2f6ec3-0x0;var _0x3a7365=_0xadeb[_0x2f6ec3];return _0x3a7365;};'use strict';var _=require('lodash');var util=require(_0xbade('0x0'));var moment=require('moment');var BPromise=require(_0xbade('0x1'));var rs=require(_0xbade('0x2'));var fs=require('fs');var Redis=require(_0xbade('0x3'));var db=require(_0xbade('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbade('0x5'))(_0xbade('0x6'));var config=require('../../config/environment');var jayson=require(_0xbade('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xbade('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbade('0x8')]));require(_0xbade('0x9'))['register'](socket);function respondWithRpcPromise(_0x4e0c02,_0x831550,_0x4ec92e){return new BPromise(function(_0x1f7889,_0x31a8c6){return client[_0xbade('0xa')](_0x4e0c02,_0x4ec92e)[_0xbade('0xb')](function(_0x4640c4){logger[_0xbade('0xc')]('ChatInternalMessage,\x20%s,\x20%s',_0x831550,_0xbade('0xd'));logger['debug'](_0xbade('0xe'),_0x831550,'request\x20sent',JSON[_0xbade('0xf')](_0x4640c4));if(_0x4640c4['error']){if(_0x4640c4[_0xbade('0x10')][_0xbade('0x11')]===0x1f4){logger[_0xbade('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x831550,_0x4640c4['error'][_0xbade('0x12')]);return _0x31a8c6(_0x4640c4['error'][_0xbade('0x12')]);}logger[_0xbade('0x10')](_0xbade('0x13'),_0x831550,_0x4640c4[_0xbade('0x10')][_0xbade('0x12')]);return _0x1f7889(_0x4640c4[_0xbade('0x10')][_0xbade('0x12')]);}else{logger[_0xbade('0xc')](_0xbade('0x13'),_0x831550,_0xbade('0xd'));_0x1f7889(_0x4640c4[_0xbade('0x14')]['message']);}})['catch'](function(_0x29aee5){logger['error'](_0xbade('0x13'),_0x831550,_0x29aee5);_0x31a8c6(_0x29aee5);});});}
\ No newline at end of file
+var _0x94b6=['register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x94b6,0x143));var _0x694b=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x94b6[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x694b('0x0'));var util=require(_0x694b('0x1'));var moment=require('moment');var BPromise=require(_0x694b('0x2'));var rs=require(_0x694b('0x3'));var fs=require('fs');var Redis=require(_0x694b('0x4'));var db=require(_0x694b('0x5'))['db'];var utils=require(_0x694b('0x6'));var logger=require(_0x694b('0x7'))(_0x694b('0x8'));var config=require('../../config/environment');var jayson=require(_0x694b('0x9'));var client=jayson[_0x694b('0xa')][_0x694b('0xb')]({'port':0x232a});config[_0x694b('0xc')]=_[_0x694b('0xd')](config[_0x694b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x694b('0xe'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x694b('0xf')](socket);function respondWithRpcPromise(_0x34120d,_0x1f64f4,_0x3b519a){return new BPromise(function(_0x2517d0,_0x4586e8){return client[_0x694b('0x10')](_0x34120d,_0x3b519a)['then'](function(_0x2b86d2){logger[_0x694b('0x11')](_0x694b('0x12'),_0x1f64f4,_0x694b('0x13'));logger[_0x694b('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1f64f4,_0x694b('0x13'),JSON[_0x694b('0x15')](_0x2b86d2));if(_0x2b86d2[_0x694b('0x16')]){if(_0x2b86d2[_0x694b('0x16')][_0x694b('0x17')]===0x1f4){logger[_0x694b('0x16')](_0x694b('0x12'),_0x1f64f4,_0x2b86d2[_0x694b('0x16')][_0x694b('0x18')]);return _0x4586e8(_0x2b86d2[_0x694b('0x16')][_0x694b('0x18')]);}logger[_0x694b('0x16')](_0x694b('0x12'),_0x1f64f4,_0x2b86d2['error']['message']);return _0x2517d0(_0x2b86d2[_0x694b('0x16')][_0x694b('0x18')]);}else{logger[_0x694b('0x11')](_0x694b('0x12'),_0x1f64f4,_0x694b('0x13'));_0x2517d0(_0x2b86d2[_0x694b('0x19')][_0x694b('0x18')]);}})['catch'](function(_0x32dd43){logger['error'](_0x694b('0x12'),_0x1f64f4,_0x32dd43);_0x4586e8(_0x32dd43);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index e9448a1..0d8ad12 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.socket.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x81e0=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit'];(function(_0xce181e,_0x358eba){var _0x531fa7=function(_0xa4bd75){while(--_0xa4bd75){_0xce181e['push'](_0xce181e['shift']());}};_0x531fa7(++_0x358eba);}(_0x81e0,0xc4));var _0x081e=function(_0x575463,_0x3bb893){_0x575463=_0x575463-0x0;var _0x46dc25=_0x81e0[_0x575463];return _0x46dc25;};'use strict';var ChatInternalMessageEvents=require(_0x081e('0x0'));var events=[_0x081e('0x1'),'remove',_0x081e('0x2')];function createListener(_0x4a710c,_0x491a85){return function(_0x1da8f4){_0x491a85[_0x081e('0x3')](_0x4a710c,_0x1da8f4);};}function removeListener(_0x2bb6af,_0xee79c2){return function(){ChatInternalMessageEvents[_0x081e('0x4')](_0x2bb6af,_0xee79c2);};}exports[_0x081e('0x5')]=function(_0x22ba82){for(var _0x432f00=0x0,_0x4c30a8=events[_0x081e('0x6')];_0x432f00<_0x4c30a8;_0x432f00++){var _0x23bf20=events[_0x432f00];var _0x27a6e9=createListener(_0x081e('0x7')+_0x23bf20,_0x22ba82);ChatInternalMessageEvents['on'](_0x23bf20,_0x27a6e9);}};
\ No newline at end of file
+var _0xa60b=['removeListener','register','length','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x21de41,_0x313d59){var _0x29c769=function(_0x210130){while(--_0x210130){_0x21de41['push'](_0x21de41['shift']());}};_0x29c769(++_0x313d59);}(_0xa60b,0x103));var _0xba60=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa60b[_0x17d9e3];return _0x14192d;};'use strict';var ChatInternalMessageEvents=require(_0xba60('0x0'));var events=[_0xba60('0x1'),_0xba60('0x2'),_0xba60('0x3')];function createListener(_0xbc0842,_0x3ec10c){return function(_0x55ebca){_0x3ec10c[_0xba60('0x4')](_0xbc0842,_0x55ebca);};}function removeListener(_0x14cf94,_0x390ed8){return function(){ChatInternalMessageEvents[_0xba60('0x5')](_0x14cf94,_0x390ed8);};}exports[_0xba60('0x6')]=function(_0x1f73db){for(var _0x52e679=0x0,_0x50f5f8=events[_0xba60('0x7')];_0x52e679<_0x50f5f8;_0x52e679++){var _0x459fce=events[_0x52e679];var _0x4d3971=createListener('chatInternalMessage:'+_0x459fce,_0x1f73db);ChatInternalMessageEvents['on'](_0x459fce,_0x4d3971);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 0610c62..295cf8b 100644
--- a/server/api/chatInternalMessage/index.js
+++ b/server/api/chatInternalMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda0d=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','get','/describe','describe','/users','getUsers','/:id','show','create','put','update','delete','destroy','exports','util'];(function(_0x1004a0,_0x110d0b){var _0x4fa90a=function(_0x243f6b){while(--_0x243f6b){_0x1004a0['push'](_0x1004a0['shift']());}};_0x4fa90a(++_0x110d0b);}(_0xda0d,0xf1));var _0xdda0=function(_0x2e5142,_0x487271){_0x2e5142=_0x2e5142-0x0;var _0x2e29b9=_0xda0d[_0x2e5142];return _0x2e29b9;};'use strict';var multer=require('multer');var util=require(_0xdda0('0x0'));var path=require(_0xdda0('0x1'));var timeout=require('connect-timeout');var express=require(_0xdda0('0x2'));var router=express[_0xdda0('0x3')]();var fs_extra=require(_0xdda0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdda0('0x5'));var config=require(_0xdda0('0x6'));var controller=require(_0xdda0('0x7'));router['get']('/',auth[_0xdda0('0x8')](),controller['index']);router[_0xdda0('0x9')](_0xdda0('0xa'),auth['isAuthenticated'](),controller[_0xdda0('0xb')]);router[_0xdda0('0x9')](_0xdda0('0xc'),auth[_0xdda0('0x8')](),controller[_0xdda0('0xd')]);router[_0xdda0('0x9')](_0xdda0('0xe'),auth[_0xdda0('0x8')](),controller[_0xdda0('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdda0('0x10')]);router[_0xdda0('0x11')]('/:id',controller[_0xdda0('0x12')]);router[_0xdda0('0x13')](_0xdda0('0xe'),auth['isAuthenticated'](),controller[_0xdda0('0x14')]);module[_0xdda0('0x15')]=router;
\ No newline at end of file
+var _0xfa71=['../../components/interaction/service','./chatInternalMessage.controller','isAuthenticated','get','/users','getUsers','/:id','show','create','update','destroy','exports','path','connect-timeout','express','fs-extra'];(function(_0x39453b,_0x8fa092){var _0x4ad5d3=function(_0x594ffb){while(--_0x594ffb){_0x39453b['push'](_0x39453b['shift']());}};_0x4ad5d3(++_0x8fa092);}(_0xfa71,0x13c));var _0x1fa7=function(_0x4f738c,_0x2059f7){_0x4f738c=_0x4f738c-0x0;var _0x5f0f2f=_0xfa71[_0x4f738c];return _0x5f0f2f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1fa7('0x0'));var timeout=require(_0x1fa7('0x1'));var express=require(_0x1fa7('0x2'));var router=express['Router']();var fs_extra=require(_0x1fa7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1fa7('0x4'));var config=require('../../config/environment');var controller=require(_0x1fa7('0x5'));router['get']('/',auth[_0x1fa7('0x6')](),controller['index']);router[_0x1fa7('0x7')]('/describe',auth[_0x1fa7('0x6')](),controller['describe']);router[_0x1fa7('0x7')](_0x1fa7('0x8'),auth[_0x1fa7('0x6')](),controller[_0x1fa7('0x9')]);router[_0x1fa7('0x7')](_0x1fa7('0xa'),auth[_0x1fa7('0x6')](),controller[_0x1fa7('0xb')]);router['post']('/',auth[_0x1fa7('0x6')](),controller[_0x1fa7('0xc')]);router['put'](_0x1fa7('0xa'),controller[_0x1fa7('0xd')]);router['delete'](_0x1fa7('0xa'),auth[_0x1fa7('0x6')](),controller[_0x1fa7('0xe')]);module[_0x1fa7('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index d09cc48..9ed9a4e 100644
--- a/server/api/chatMessage/chatMessage.attributes.js
+++ b/server/api/chatMessage/chatMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb8a0=['STRING','TEXT','medium','BOOLEAN'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x39d7a3,_0x5b78df){_0x39d7a3=_0x39d7a3-0x0;var _0x3b71da=_0xb8a0[_0x39d7a3];return _0x3b71da;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x0b8a('0x0')](_0x0b8a('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x0b8a('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x0b8a('0x3')]},'providerResponse':{'type':Sequelize[_0x0b8a('0x0')]}};
\ No newline at end of file
+var _0x3c8b=['DATE','STRING','TEXT','exports','medium','BOOLEAN','out'];(function(_0x59ae8f,_0x148344){var _0x3900b5=function(_0x63af51){while(--_0x63af51){_0x59ae8f['push'](_0x59ae8f['shift']());}};_0x3900b5(++_0x148344);}(_0x3c8b,0x18b));var _0xb3c8=function(_0x59c8ee,_0x1390b3){_0x59c8ee=_0x59c8ee-0x0;var _0x3704b4=_0x3c8b[_0x59c8ee];return _0x3704b4;};'use strict';var Sequelize=require('sequelize');module[_0xb3c8('0x0')]={'body':{'type':Sequelize['TEXT'](_0xb3c8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb3c8('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb3c8('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb3c8('0x3')),'defaultValue':_0xb3c8('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb3c8('0x4')]},'providerName':{'type':Sequelize[_0xb3c8('0x5')]},'providerResponse':{'type':Sequelize[_0xb3c8('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 3909c27..9353217 100644
--- a/server/api/chatMessage/chatMessage.controller.js
+++ b/server/api/chatMessage/chatMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xebd1=['../../config/license/util','../../mysqldb','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','status','stack','name','send','index','map','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','options','ChatMessage','includeAll','rows','catch','show','params','rawAttributes','keys','include','merge','find','body','describe','../../config/logger','chat-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','manual','SIP/%s','channel','motionChannel','event','EventManager','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','fullname','interface','parse','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x5957dd,_0xecdef9){var _0x5e828e=function(_0x3921a9){while(--_0x3921a9){_0x5957dd['push'](_0x5957dd['shift']());}};_0x5e828e(++_0xecdef9);}(_0xebd1,0x6b));var _0x1ebd=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0xebd1[_0xb0de07];return _0x4633d8;};'use strict';var emlformat=require(_0x1ebd('0x0'));var rimraf=require(_0x1ebd('0x1'));var zipdir=require(_0x1ebd('0x2'));var jsonpatch=require(_0x1ebd('0x3'));var rp=require(_0x1ebd('0x4'));var moment=require(_0x1ebd('0x5'));var BPromise=require(_0x1ebd('0x6'));var Mustache=require('mustache');var util=require(_0x1ebd('0x7'));var path=require('path');var sox=require(_0x1ebd('0x8'));var csv=require(_0x1ebd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ebd('0xa'));var _=require('lodash');var squel=require(_0x1ebd('0xb'));var crypto=require(_0x1ebd('0xc'));var jsforce=require(_0x1ebd('0xd'));var deskjs=require(_0x1ebd('0xe'));var toCsv=require(_0x1ebd('0x9'));var querystring=require(_0x1ebd('0xf'));var Papa=require('papaparse');var Redis=require(_0x1ebd('0x10'));var authService=require(_0x1ebd('0x11'));var qs=require(_0x1ebd('0x12'));var as=require(_0x1ebd('0x13'));var hardwareService=require(_0x1ebd('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1ebd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1ebd('0x16'));var db=require(_0x1ebd('0x17'))['db'];config[_0x1ebd('0x18')]=_['defaults'](config['redis'],{'host':_0x1ebd('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1ebd('0x1a'))[_0x1ebd('0x1b')](socket);var jayson=require(_0x1ebd('0x1c'));var client=jayson[_0x1ebd('0x1d')][_0x1ebd('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x1ebd('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x415fad,_0x4de51a,_0x231dd4,_0xa05858){return new BPromise(function(_0x5d896e,_0x2891f6){var _0x5d4653=_0xa05858||client;return _0x5d4653['request'](_0x415fad,_0x231dd4)[_0x1ebd('0x1f')](function(_0x3b0aef){logger[_0x1ebd('0x20')](_0x1ebd('0x21'),_0x4de51a,_0x1ebd('0x22'));logger['debug'](_0x1ebd('0x23'),_0x4de51a,_0x1ebd('0x22'),JSON[_0x1ebd('0x24')](_0x3b0aef));if(_0x3b0aef['error']){if(_0x3b0aef[_0x1ebd('0x25')]['code']===0x1f4){logger['error'](_0x1ebd('0x21'),_0x4de51a,_0x3b0aef[_0x1ebd('0x25')][_0x1ebd('0x26')]);return _0x2891f6(_0x3b0aef['error']['message']);}logger[_0x1ebd('0x25')](_0x1ebd('0x21'),_0x4de51a,_0x3b0aef['error'][_0x1ebd('0x26')]);return _0x5d896e(_0x3b0aef[_0x1ebd('0x25')][_0x1ebd('0x26')]);}else{logger['info'](_0x1ebd('0x21'),_0x4de51a,_0x1ebd('0x22'));_0x5d896e(_0x3b0aef[_0x1ebd('0x27')]['message']);}})['catch'](function(_0x4b1c3f){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4de51a,_0x4b1c3f);_0x2891f6(_0x4b1c3f);});});}function respondWithStatusCode(_0x52b4c0,_0x331573){_0x331573=_0x331573||0xcc;return function(_0x2b7cff){if(_0x2b7cff){return _0x52b4c0[_0x1ebd('0x28')](_0x331573);}return _0x52b4c0['status'](_0x331573)[_0x1ebd('0x29')]();};}function respondWithResult(_0x373d2a,_0x3625bd){_0x3625bd=_0x3625bd||0xc8;return function(_0x578e0f){if(_0x578e0f){return _0x373d2a['status'](_0x3625bd)[_0x1ebd('0x2a')](_0x578e0f);}};}function respondWithFilteredResult(_0x11700b,_0xb34755){return function(_0x1d5d9d){if(_0x1d5d9d){var _0x57498f=typeof _0xb34755[_0x1ebd('0x2b')]==='undefined'&&typeof _0xb34755[_0x1ebd('0x2c')]===_0x1ebd('0x2d');var _0x27af71=_0x1d5d9d[_0x1ebd('0x2e')];var _0x3e5b13=_0x57498f?0x0:_0xb34755[_0x1ebd('0x2b')];var _0x362410=_0x57498f?_0x1d5d9d[_0x1ebd('0x2e')]:_0xb34755[_0x1ebd('0x2b')]+_0xb34755['limit'];var _0x930012;if(_0x362410>=_0x27af71){_0x362410=_0x27af71;_0x930012=0xc8;}else{_0x930012=0xce;}_0x11700b['status'](_0x930012);return _0x11700b[_0x1ebd('0x2f')](_0x1ebd('0x30'),_0x3e5b13+'-'+_0x362410+'/'+_0x27af71)[_0x1ebd('0x2a')](_0x1d5d9d);}return null;};}function patchUpdates(_0x513578){return function(_0x57d724){try{jsonpatch[_0x1ebd('0x31')](_0x57d724,_0x513578,!![]);}catch(_0x4ef6d1){return BPromise[_0x1ebd('0x32')](_0x4ef6d1);}return _0x57d724[_0x1ebd('0x33')]();};}function saveUpdates(_0x1f30c0,_0x5ee7ce){return function(_0x2f2099){if(_0x2f2099){return _0x2f2099[_0x1ebd('0x34')](_0x1f30c0)[_0x1ebd('0x1f')](function(_0xdca08b){return _0xdca08b;});}return null;};}function removeEntity(_0x1fca12,_0x58b425){return function(_0x5d1d80){if(_0x5d1d80){return _0x5d1d80[_0x1ebd('0x35')]()[_0x1ebd('0x1f')](function(){_0x1fca12[_0x1ebd('0x36')](0xcc)[_0x1ebd('0x29')]();});}};}function handleEntityNotFound(_0x5c5d11,_0x21f59e){return function(_0x987167){if(!_0x987167){_0x5c5d11['sendStatus'](0x194);}return _0x987167;};}function handleError(_0x3cd0ac,_0x19100f){_0x19100f=_0x19100f||0x1f4;return function(_0x2e3ead){logger[_0x1ebd('0x25')](_0x2e3ead[_0x1ebd('0x37')]);if(_0x2e3ead[_0x1ebd('0x38')]){delete _0x2e3ead[_0x1ebd('0x38')];}_0x3cd0ac['status'](_0x19100f)[_0x1ebd('0x39')](_0x2e3ead);};}exports[_0x1ebd('0x3a')]=function(_0x367417,_0x128652){var _0x1faa69={},_0x56bf4d={},_0x37fe25={'count':0x0,'rows':[]};var _0x1cdf1b=_[_0x1ebd('0x3b')](db['ChatMessage']['rawAttributes'],function(_0x16e48e){return{'name':_0x16e48e['fieldName'],'type':_0x16e48e[_0x1ebd('0x3c')][_0x1ebd('0x3d')]};});_0x56bf4d[_0x1ebd('0x3e')]=_[_0x1ebd('0x3b')](_0x1cdf1b,_0x1ebd('0x38'));_0x56bf4d[_0x1ebd('0x3f')]=_['keys'](_0x367417[_0x1ebd('0x3f')]);_0x56bf4d[_0x1ebd('0x40')]=_[_0x1ebd('0x41')](_0x56bf4d[_0x1ebd('0x3e')],_0x56bf4d[_0x1ebd('0x3f')]);_0x1faa69[_0x1ebd('0x42')]=_[_0x1ebd('0x41')](_0x56bf4d[_0x1ebd('0x3e')],qs[_0x1ebd('0x43')](_0x367417['query'][_0x1ebd('0x43')]));_0x1faa69[_0x1ebd('0x42')]=_0x1faa69['attributes'][_0x1ebd('0x44')]?_0x1faa69[_0x1ebd('0x42')]:_0x56bf4d['model'];if(!_0x367417[_0x1ebd('0x3f')][_0x1ebd('0x45')](_0x1ebd('0x46'))){_0x1faa69['limit']=qs[_0x1ebd('0x2c')](_0x367417['query'][_0x1ebd('0x2c')]);_0x1faa69[_0x1ebd('0x2b')]=qs[_0x1ebd('0x2b')](_0x367417[_0x1ebd('0x3f')]['offset']);}_0x1faa69[_0x1ebd('0x47')]=qs[_0x1ebd('0x48')](_0x367417[_0x1ebd('0x3f')][_0x1ebd('0x48')]);_0x1faa69['where']=qs[_0x1ebd('0x40')](_[_0x1ebd('0x49')](_0x367417[_0x1ebd('0x3f')],_0x56bf4d[_0x1ebd('0x40')]),_0x1cdf1b);if(_0x367417[_0x1ebd('0x3f')][_0x1ebd('0x4a')]){_0x1faa69[_0x1ebd('0x4b')]=_['merge'](_0x1faa69[_0x1ebd('0x4b')],{'$or':_[_0x1ebd('0x3b')](_0x1cdf1b,function(_0x49b085){if(_0x49b085[_0x1ebd('0x3c')]!=='VIRTUAL'){var _0x1e2333={};_0x1e2333[_0x49b085[_0x1ebd('0x38')]]={'$like':'%'+_0x367417['query'][_0x1ebd('0x4a')]+'%'};return _0x1e2333;}})});}_0x1faa69=_['merge']({},_0x1faa69,_0x367417[_0x1ebd('0x4c')]);var _0x5668ae={'where':_0x1faa69['where']};return db[_0x1ebd('0x4d')][_0x1ebd('0x2e')](_0x5668ae)[_0x1ebd('0x1f')](function(_0x39b48e){_0x37fe25[_0x1ebd('0x2e')]=_0x39b48e;if(_0x367417[_0x1ebd('0x3f')][_0x1ebd('0x4e')]){_0x1faa69['include']=[{'all':!![]}];}return db[_0x1ebd('0x4d')]['findAll'](_0x1faa69);})[_0x1ebd('0x1f')](function(_0x88cd37){_0x37fe25[_0x1ebd('0x4f')]=_0x88cd37;return _0x37fe25;})[_0x1ebd('0x1f')](respondWithFilteredResult(_0x128652,_0x1faa69))[_0x1ebd('0x50')](handleError(_0x128652,null));};exports[_0x1ebd('0x51')]=function(_0x257e5d,_0xfd14a2){var _0x12dac2={'raw':!![],'where':{'id':_0x257e5d[_0x1ebd('0x52')]['id']}},_0x2995b7={};_0x2995b7[_0x1ebd('0x3e')]=_['keys'](db[_0x1ebd('0x4d')][_0x1ebd('0x53')]);_0x2995b7['query']=_[_0x1ebd('0x54')](_0x257e5d['query']);_0x2995b7[_0x1ebd('0x40')]=_[_0x1ebd('0x41')](_0x2995b7[_0x1ebd('0x3e')],_0x2995b7[_0x1ebd('0x3f')]);_0x12dac2[_0x1ebd('0x42')]=_[_0x1ebd('0x41')](_0x2995b7[_0x1ebd('0x3e')],qs[_0x1ebd('0x43')](_0x257e5d[_0x1ebd('0x3f')][_0x1ebd('0x43')]));_0x12dac2[_0x1ebd('0x42')]=_0x12dac2[_0x1ebd('0x42')][_0x1ebd('0x44')]?_0x12dac2[_0x1ebd('0x42')]:_0x2995b7[_0x1ebd('0x3e')];if(_0x257e5d[_0x1ebd('0x3f')][_0x1ebd('0x4e')]){_0x12dac2[_0x1ebd('0x55')]=[{'all':!![]}];}_0x12dac2=_[_0x1ebd('0x56')]({},_0x12dac2,_0x257e5d[_0x1ebd('0x4c')]);return db[_0x1ebd('0x4d')][_0x1ebd('0x57')](_0x12dac2)[_0x1ebd('0x1f')](handleEntityNotFound(_0xfd14a2,null))[_0x1ebd('0x1f')](respondWithResult(_0xfd14a2,null))[_0x1ebd('0x50')](handleError(_0xfd14a2,null));};exports['create']=function(_0x41911c,_0x1be425){return db['ChatMessage']['create'](_0x41911c[_0x1ebd('0x58')],{})[_0x1ebd('0x1f')](respondWithResult(_0x1be425,0xc9))['catch'](handleError(_0x1be425,null));};exports[_0x1ebd('0x34')]=function(_0x52fcce,_0x5a9a71){if(_0x52fcce[_0x1ebd('0x58')]['id']){delete _0x52fcce[_0x1ebd('0x58')]['id'];}return db[_0x1ebd('0x4d')][_0x1ebd('0x57')]({'where':{'id':_0x52fcce[_0x1ebd('0x52')]['id']}})['then'](handleEntityNotFound(_0x5a9a71,null))[_0x1ebd('0x1f')](saveUpdates(_0x52fcce[_0x1ebd('0x58')],null))[_0x1ebd('0x1f')](respondWithResult(_0x5a9a71,null))[_0x1ebd('0x50')](handleError(_0x5a9a71,null));};exports[_0x1ebd('0x35')]=function(_0x5c4d67,_0x4459b1){return db[_0x1ebd('0x4d')][_0x1ebd('0x57')]({'where':{'id':_0x5c4d67[_0x1ebd('0x52')]['id']}})[_0x1ebd('0x1f')](handleEntityNotFound(_0x4459b1,null))[_0x1ebd('0x1f')](removeEntity(_0x4459b1,null))[_0x1ebd('0x50')](handleError(_0x4459b1,null));};exports[_0x1ebd('0x59')]=function(_0xa67472,_0x5cdf07){return db[_0x1ebd('0x4d')][_0x1ebd('0x59')]()['then'](respondWithResult(_0x5cdf07,null))[_0x1ebd('0x50')](handleError(_0x5cdf07,null));};var interaction_log=require(_0x1ebd('0x5a'))(_0x1ebd('0x5b'));exports[_0x1ebd('0x5c')]=function(_0x2a9d2a,_0x1989d4,_0x373725){var _0x34e83b={'agent':{},'channel':'chat'};if(_0x2a9d2a[_0x1ebd('0x58')]['id']){delete _0x2a9d2a[_0x1ebd('0x58')]['id'];}_0x2a9d2a['body'][_0x1ebd('0x5d')]=!![];_0x2a9d2a[_0x1ebd('0x58')][_0x1ebd('0x5e')]=moment()['format'](_0x1ebd('0x5f'));_0x2a9d2a['body'][_0x1ebd('0x60')]=_0x2a9d2a[_0x1ebd('0x58')][_0x1ebd('0x60')]||_0x2a9d2a[_0x1ebd('0x61')]['id'];_0x34e83b[_0x1ebd('0x62')]['id']=_0x2a9d2a[_0x1ebd('0x58')][_0x1ebd('0x60')];return db[_0x1ebd('0x4d')][_0x1ebd('0x57')]({'where':{'id':_0x2a9d2a[_0x1ebd('0x52')]['id'],'UserId':null}})[_0x1ebd('0x1f')](handleEntityNotFound(_0x1989d4,null))[_0x1ebd('0x1f')](saveUpdates(_0x2a9d2a[_0x1ebd('0x58')],null))[_0x1ebd('0x1f')](function(_0x19d095){if(_0x19d095){_0x34e83b[_0x1ebd('0x26')]=_0x19d095[_0x1ebd('0x63')]({'plain':!![]});return db['ChatInteraction'][_0x1ebd('0x57')]({'where':{'id':_0x19d095[_0x1ebd('0x64')]}});}return null;})[_0x1ebd('0x1f')](handleEntityNotFound(_0x1989d4,null))['then'](function(_0x2aca80){if(_0x2aca80){return _0x2aca80[_0x1ebd('0x34')]({'UserId':_0x2a9d2a[_0x1ebd('0x58')]['UserId'],'read1stAt':_['isNil'](_0x2aca80[_0x1ebd('0x65')])?moment()[_0x1ebd('0x66')](_0x1ebd('0x5f')):undefined});}return null;})[_0x1ebd('0x1f')](function(_0x1c6b34){if(_0x1c6b34){_0x34e83b[_0x1ebd('0x67')]=_0x1c6b34[_0x1ebd('0x63')]({'plain':!![]});interaction_log[_0x1ebd('0x20')](_0x1ebd('0x68'),_0x2a9d2a[_0x1ebd('0x61')]['id'],_0x2a9d2a['user']['name'],_0x2a9d2a[_0x1ebd('0x61')][_0x1ebd('0x69')],_0x34e83b[_0x1ebd('0x67')]['id'],_0x2a9d2a[_0x1ebd('0x58')]?JSON[_0x1ebd('0x24')](_0x2a9d2a[_0x1ebd('0x58')]):_0x1ebd('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x1ebd('0x6b'),_0x34e83b);}return null;})[_0x1ebd('0x1f')](function(_0x880145){var _0x583430=_0x1ebd('0x6c')+_0x880145[_0x1ebd('0x26')][_0x1ebd('0x6d')];return db[_0x1ebd('0x6e')][_0x1ebd('0x3f')](_0x583430,{'type':db[_0x1ebd('0x6f')][_0x1ebd('0x70')][_0x1ebd('0x71')],'raw':!![]})[_0x1ebd('0x1f')](function(_0x1eb0a3){return _0x1eb0a3;});})[_0x1ebd('0x1f')](function(_0x40a6d4){if(_0x40a6d4){_0x34e83b['message'][_0x1ebd('0x72')]=_0x40a6d4[0x0];if(!_0x2a9d2a[_0x1ebd('0x58')][_0x1ebd('0x60')])return;return db[_0x1ebd('0x73')][_0x1ebd('0x57')]({'where':{'id':_0x2a9d2a[_0x1ebd('0x58')]['UserId'],'role':_0x1ebd('0x62')},'attributes':['id',_0x1ebd('0x38'),'fullname',_0x1ebd('0x74'),'internal'],'raw':!![]});}return null;})[_0x1ebd('0x1f')](function(_0x2a23aa){if(!_0x2a23aa)return null;_0x34e83b[_0x1ebd('0x26')][_0x1ebd('0x62')]=_0x2a23aa;return _0x34e83b;})[_0x1ebd('0x1f')](function(_0x501b2a){if(_0x501b2a){if(_0x2a9d2a['body'][_0x1ebd('0x75')]){_0x34e83b['message']['interface']=util[_0x1ebd('0x66')](_0x1ebd('0x76'),_0x2a9d2a[_0x1ebd('0x61')]['name']);_0x34e83b[_0x1ebd('0x26')][_0x1ebd('0x77')]=_0x34e83b[_0x1ebd('0x77')];_0x34e83b[_0x1ebd('0x26')][_0x1ebd('0x78')]=_0x34e83b['channel'];_0x34e83b[_0x1ebd('0x26')][_0x1ebd('0x79')]=_0x1ebd('0x5c');return respondWithRpcPromise(_0x1ebd('0x7a'),_0x1ebd('0x7a'),{'event':'acceptmessage','message':_[_0x1ebd('0x56')](_0x34e83b[_0x1ebd('0x26')],JSON['parse'](_0x34e83b[_0x1ebd('0x67')]['formData']))},client9002)[_0x1ebd('0x1f')](function(){return _0x34e83b;});}return _0x34e83b;}return null;})[_0x1ebd('0x1f')](respondWithResult(_0x1989d4,null))[_0x1ebd('0x50')](handleError(_0x1989d4,null));};var interaction_log=require(_0x1ebd('0x5a'))(_0x1ebd('0x5b'));exports['reject']=function(_0x1d69f4,_0x3fb4cd,_0x4c3c7f){var _0x279a4e={'agent':{},'channel':_0x1ebd('0x7b')};if(_0x1d69f4[_0x1ebd('0x58')]['id']){delete _0x1d69f4[_0x1ebd('0x58')]['id'];}_0x1d69f4['body'][_0x1ebd('0x60')]=_0x1d69f4[_0x1ebd('0x58')][_0x1ebd('0x60')]||_0x1d69f4[_0x1ebd('0x61')]['id'];_0x279a4e[_0x1ebd('0x62')]['id']=_0x1d69f4[_0x1ebd('0x58')][_0x1ebd('0x60')];return db[_0x1ebd('0x4d')][_0x1ebd('0x57')]({'where':{'id':_0x1d69f4[_0x1ebd('0x52')]['id'],'UserId':null}})[_0x1ebd('0x1f')](handleEntityNotFound(_0x3fb4cd,null))[_0x1ebd('0x1f')](function(_0x124f92){if(_0x124f92){_0x279a4e[_0x1ebd('0x26')]=_0x124f92[_0x1ebd('0x63')]({'plain':!![]});return db['ChatInteraction'][_0x1ebd('0x57')]({'where':{'id':_0x124f92[_0x1ebd('0x64')]}});}return null;})[_0x1ebd('0x1f')](handleEntityNotFound(_0x3fb4cd,null))[_0x1ebd('0x1f')](function(_0x2d5b75){if(_0x2d5b75){_0x279a4e[_0x1ebd('0x67')]=_0x2d5b75[_0x1ebd('0x63')]({'plain':!![]});interaction_log[_0x1ebd('0x20')](_0x1ebd('0x7c'),_0x1d69f4['user']['id'],_0x1d69f4[_0x1ebd('0x61')]['name'],_0x1d69f4[_0x1ebd('0x61')][_0x1ebd('0x69')],_0x279a4e[_0x1ebd('0x67')]['id'],_0x1d69f4[_0x1ebd('0x58')]?JSON[_0x1ebd('0x24')](_0x1d69f4[_0x1ebd('0x58')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x279a4e);}return null;})[_0x1ebd('0x1f')](function(_0x2d94ac){var _0x942617=_0x1ebd('0x6c')+_0x2d94ac[_0x1ebd('0x26')]['ContactId'];return db[_0x1ebd('0x6e')][_0x1ebd('0x3f')](_0x942617,{'type':db[_0x1ebd('0x6f')][_0x1ebd('0x70')][_0x1ebd('0x71')],'raw':!![]})[_0x1ebd('0x1f')](function(_0x2c9fa2){return _0x2c9fa2;});})['then'](function(_0x50987c){if(_0x50987c){_0x279a4e['message'][_0x1ebd('0x72')]=_0x50987c[0x0];if(!_0x1d69f4[_0x1ebd('0x58')][_0x1ebd('0x60')])return;return db['User'][_0x1ebd('0x57')]({'where':{'id':_0x1d69f4['body'][_0x1ebd('0x60')],'role':_0x1ebd('0x62')},'attributes':['id',_0x1ebd('0x38'),_0x1ebd('0x7d'),_0x1ebd('0x74'),'internal'],'raw':!![]});}return null;})[_0x1ebd('0x1f')](function(_0xe7b938){if(!_0xe7b938)return null;_0x279a4e[_0x1ebd('0x26')][_0x1ebd('0x62')]=_0xe7b938;return _0x279a4e;})[_0x1ebd('0x1f')](function(_0x18914c){if(_0x18914c){_0x18914c[_0x1ebd('0x26')][_0x1ebd('0x7e')]=util[_0x1ebd('0x66')](_0x1ebd('0x76'),_0x1d69f4[_0x1ebd('0x61')][_0x1ebd('0x38')]);_0x18914c[_0x1ebd('0x26')][_0x1ebd('0x77')]=_0x279a4e['channel'];_0x18914c[_0x1ebd('0x26')][_0x1ebd('0x78')]=_0x279a4e['channel'];_0x18914c[_0x1ebd('0x26')]['event']='reject';respondWithRpcPromise(_0x1ebd('0x7a'),_0x1ebd('0x7a'),{'event':'rejectmessage','message':_[_0x1ebd('0x56')](_0x279a4e[_0x1ebd('0x26')],JSON[_0x1ebd('0x7f')](_0x279a4e['interaction'][_0x1ebd('0x80')]))},client9002);return _0x279a4e;}return null;})[_0x1ebd('0x1f')](respondWithResult(_0x3fb4cd,null))['catch'](handleError(_0x3fb4cd,null));};
\ No newline at end of file
+var _0xab26=['client','http','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','query','keys','intersection','model','fields','attributes','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','then','rows','show','params','length','find','body','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xab26,0x174));var _0x6ab2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xab26[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x6ab2('0x0'));var rimraf=require(_0x6ab2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ab2('0x2'));var rp=require(_0x6ab2('0x3'));var moment=require(_0x6ab2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6ab2('0x5'));var path=require(_0x6ab2('0x6'));var sox=require(_0x6ab2('0x7'));var csv=require(_0x6ab2('0x8'));var ejs=require(_0x6ab2('0x9'));var fs=require('fs');var fs_extra=require(_0x6ab2('0xa'));var _=require(_0x6ab2('0xb'));var squel=require(_0x6ab2('0xc'));var crypto=require('crypto');var jsforce=require(_0x6ab2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6ab2('0x8'));var querystring=require(_0x6ab2('0xe'));var Papa=require(_0x6ab2('0xf'));var Redis=require('ioredis');var authService=require(_0x6ab2('0x10'));var qs=require(_0x6ab2('0x11'));var as=require(_0x6ab2('0x12'));var hardwareService=require(_0x6ab2('0x13'));var logger=require(_0x6ab2('0x14'))(_0x6ab2('0x15'));var utils=require(_0x6ab2('0x16'));var config=require(_0x6ab2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ab2('0x18'))['db'];config['redis']=_[_0x6ab2('0x19')](config['redis'],{'host':_0x6ab2('0x1a'),'port':0x18eb});var socket=require(_0x6ab2('0x1b'))(new Redis(config['redis']));require(_0x6ab2('0x1c'))[_0x6ab2('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6ab2('0x1e')][_0x6ab2('0x1f')]({'port':0x232c});var client9002=jayson[_0x6ab2('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c28d9,_0x5a4ba9,_0xc74f0,_0x507d18){return new BPromise(function(_0x1d0618,_0x2104db){var _0x14fc08=_0x507d18||client;return _0x14fc08[_0x6ab2('0x20')](_0x2c28d9,_0xc74f0)['then'](function(_0x215b5e){logger[_0x6ab2('0x21')](_0x6ab2('0x22'),_0x5a4ba9,'request\x20sent');logger[_0x6ab2('0x23')](_0x6ab2('0x24'),_0x5a4ba9,_0x6ab2('0x25'),JSON[_0x6ab2('0x26')](_0x215b5e));if(_0x215b5e[_0x6ab2('0x27')]){if(_0x215b5e[_0x6ab2('0x27')]['code']===0x1f4){logger['error'](_0x6ab2('0x22'),_0x5a4ba9,_0x215b5e[_0x6ab2('0x27')][_0x6ab2('0x28')]);return _0x2104db(_0x215b5e[_0x6ab2('0x27')]['message']);}logger[_0x6ab2('0x27')](_0x6ab2('0x22'),_0x5a4ba9,_0x215b5e[_0x6ab2('0x27')][_0x6ab2('0x28')]);return _0x1d0618(_0x215b5e['error'][_0x6ab2('0x28')]);}else{logger['info'](_0x6ab2('0x22'),_0x5a4ba9,_0x6ab2('0x25'));_0x1d0618(_0x215b5e['result'][_0x6ab2('0x28')]);}})[_0x6ab2('0x29')](function(_0x5709be){logger[_0x6ab2('0x27')](_0x6ab2('0x22'),_0x5a4ba9,_0x5709be);_0x2104db(_0x5709be);});});}function respondWithStatusCode(_0x468921,_0x2fc40e){_0x2fc40e=_0x2fc40e||0xcc;return function(_0xd704df){if(_0xd704df){return _0x468921['sendStatus'](_0x2fc40e);}return _0x468921[_0x6ab2('0x2a')](_0x2fc40e)['end']();};}function respondWithResult(_0x4ebdef,_0x1af8df){_0x1af8df=_0x1af8df||0xc8;return function(_0x2ccbad){if(_0x2ccbad){return _0x4ebdef[_0x6ab2('0x2a')](_0x1af8df)[_0x6ab2('0x2b')](_0x2ccbad);}};}function respondWithFilteredResult(_0x2f6325,_0x13fc04){return function(_0x4b47d7){if(_0x4b47d7){var _0x4e8c8e=typeof _0x13fc04[_0x6ab2('0x2c')]===_0x6ab2('0x2d')&&typeof _0x13fc04[_0x6ab2('0x2e')]==='undefined';var _0x83fc1f=_0x4b47d7[_0x6ab2('0x2f')];var _0x502d2a=_0x4e8c8e?0x0:_0x13fc04[_0x6ab2('0x2c')];var _0x3740bc=_0x4e8c8e?_0x4b47d7[_0x6ab2('0x2f')]:_0x13fc04[_0x6ab2('0x2c')]+_0x13fc04[_0x6ab2('0x2e')];var _0xa3c627;if(_0x3740bc>=_0x83fc1f){_0x3740bc=_0x83fc1f;_0xa3c627=0xc8;}else{_0xa3c627=0xce;}_0x2f6325[_0x6ab2('0x2a')](_0xa3c627);return _0x2f6325[_0x6ab2('0x30')](_0x6ab2('0x31'),_0x502d2a+'-'+_0x3740bc+'/'+_0x83fc1f)['json'](_0x4b47d7);}return null;};}function patchUpdates(_0x28f815){return function(_0x7646c4){try{jsonpatch['apply'](_0x7646c4,_0x28f815,!![]);}catch(_0x59a399){return BPromise[_0x6ab2('0x32')](_0x59a399);}return _0x7646c4[_0x6ab2('0x33')]();};}function saveUpdates(_0x400a53,_0x222b0e){return function(_0x1f2024){if(_0x1f2024){return _0x1f2024[_0x6ab2('0x34')](_0x400a53)['then'](function(_0x2f91d2){return _0x2f91d2;});}return null;};}function removeEntity(_0x3baffe,_0xf723f9){return function(_0x212562){if(_0x212562){return _0x212562[_0x6ab2('0x35')]()['then'](function(){_0x3baffe[_0x6ab2('0x2a')](0xcc)[_0x6ab2('0x36')]();});}};}function handleEntityNotFound(_0x4346a7,_0x127fe4){return function(_0x4348c7){if(!_0x4348c7){_0x4346a7[_0x6ab2('0x37')](0x194);}return _0x4348c7;};}function handleError(_0x183fad,_0x5bb548){_0x5bb548=_0x5bb548||0x1f4;return function(_0x29c24e){logger['error'](_0x29c24e[_0x6ab2('0x38')]);if(_0x29c24e[_0x6ab2('0x39')]){delete _0x29c24e[_0x6ab2('0x39')];}_0x183fad[_0x6ab2('0x2a')](_0x5bb548)[_0x6ab2('0x3a')](_0x29c24e);};}exports[_0x6ab2('0x3b')]=function(_0x320e0a,_0x27524b){var _0x2c1768={},_0x1b500e={},_0x1fe318={'count':0x0,'rows':[]};var _0x4988dd=_[_0x6ab2('0x3c')](db[_0x6ab2('0x3d')][_0x6ab2('0x3e')],function(_0x584c4b){return{'name':_0x584c4b[_0x6ab2('0x3f')],'type':_0x584c4b['type']['key']};});_0x1b500e['model']=_[_0x6ab2('0x3c')](_0x4988dd,'name');_0x1b500e[_0x6ab2('0x40')]=_[_0x6ab2('0x41')](_0x320e0a[_0x6ab2('0x40')]);_0x1b500e['filters']=_[_0x6ab2('0x42')](_0x1b500e[_0x6ab2('0x43')],_0x1b500e[_0x6ab2('0x40')]);_0x2c1768['attributes']=_[_0x6ab2('0x42')](_0x1b500e[_0x6ab2('0x43')],qs[_0x6ab2('0x44')](_0x320e0a[_0x6ab2('0x40')]['fields']));_0x2c1768[_0x6ab2('0x45')]=_0x2c1768[_0x6ab2('0x45')]['length']?_0x2c1768[_0x6ab2('0x45')]:_0x1b500e[_0x6ab2('0x43')];if(!_0x320e0a[_0x6ab2('0x40')]['hasOwnProperty'](_0x6ab2('0x46'))){_0x2c1768[_0x6ab2('0x2e')]=qs['limit'](_0x320e0a['query'][_0x6ab2('0x2e')]);_0x2c1768[_0x6ab2('0x2c')]=qs[_0x6ab2('0x2c')](_0x320e0a[_0x6ab2('0x40')][_0x6ab2('0x2c')]);}_0x2c1768[_0x6ab2('0x47')]=qs[_0x6ab2('0x48')](_0x320e0a['query'][_0x6ab2('0x48')]);_0x2c1768[_0x6ab2('0x49')]=qs[_0x6ab2('0x4a')](_[_0x6ab2('0x4b')](_0x320e0a[_0x6ab2('0x40')],_0x1b500e['filters']),_0x4988dd);if(_0x320e0a[_0x6ab2('0x40')]['filter']){_0x2c1768[_0x6ab2('0x49')]=_[_0x6ab2('0x4c')](_0x2c1768[_0x6ab2('0x49')],{'$or':_['map'](_0x4988dd,function(_0x203f5f){if(_0x203f5f[_0x6ab2('0x4d')]!==_0x6ab2('0x4e')){var _0x3afae0={};_0x3afae0[_0x203f5f[_0x6ab2('0x39')]]={'$like':'%'+_0x320e0a['query']['filter']+'%'};return _0x3afae0;}})});}_0x2c1768=_[_0x6ab2('0x4c')]({},_0x2c1768,_0x320e0a[_0x6ab2('0x4f')]);var _0x325512={'where':_0x2c1768[_0x6ab2('0x49')]};return db[_0x6ab2('0x3d')]['count'](_0x325512)['then'](function(_0x123f3d){_0x1fe318[_0x6ab2('0x2f')]=_0x123f3d;if(_0x320e0a[_0x6ab2('0x40')][_0x6ab2('0x50')]){_0x2c1768[_0x6ab2('0x51')]=[{'all':!![]}];}return db[_0x6ab2('0x3d')][_0x6ab2('0x52')](_0x2c1768);})[_0x6ab2('0x53')](function(_0x452fe2){_0x1fe318[_0x6ab2('0x54')]=_0x452fe2;return _0x1fe318;})[_0x6ab2('0x53')](respondWithFilteredResult(_0x27524b,_0x2c1768))[_0x6ab2('0x29')](handleError(_0x27524b,null));};exports[_0x6ab2('0x55')]=function(_0x309c2e,_0x3cebca){var _0x19d90c={'raw':!![],'where':{'id':_0x309c2e[_0x6ab2('0x56')]['id']}},_0x3d049d={};_0x3d049d[_0x6ab2('0x43')]=_[_0x6ab2('0x41')](db[_0x6ab2('0x3d')][_0x6ab2('0x3e')]);_0x3d049d['query']=_[_0x6ab2('0x41')](_0x309c2e[_0x6ab2('0x40')]);_0x3d049d[_0x6ab2('0x4a')]=_[_0x6ab2('0x42')](_0x3d049d[_0x6ab2('0x43')],_0x3d049d[_0x6ab2('0x40')]);_0x19d90c[_0x6ab2('0x45')]=_[_0x6ab2('0x42')](_0x3d049d[_0x6ab2('0x43')],qs[_0x6ab2('0x44')](_0x309c2e[_0x6ab2('0x40')][_0x6ab2('0x44')]));_0x19d90c[_0x6ab2('0x45')]=_0x19d90c[_0x6ab2('0x45')][_0x6ab2('0x57')]?_0x19d90c[_0x6ab2('0x45')]:_0x3d049d[_0x6ab2('0x43')];if(_0x309c2e[_0x6ab2('0x40')][_0x6ab2('0x50')]){_0x19d90c[_0x6ab2('0x51')]=[{'all':!![]}];}_0x19d90c=_[_0x6ab2('0x4c')]({},_0x19d90c,_0x309c2e[_0x6ab2('0x4f')]);return db[_0x6ab2('0x3d')][_0x6ab2('0x58')](_0x19d90c)[_0x6ab2('0x53')](handleEntityNotFound(_0x3cebca,null))[_0x6ab2('0x53')](respondWithResult(_0x3cebca,null))[_0x6ab2('0x29')](handleError(_0x3cebca,null));};exports['create']=function(_0x11a348,_0x3a1a74){return db[_0x6ab2('0x3d')]['create'](_0x11a348[_0x6ab2('0x59')],{})['then'](respondWithResult(_0x3a1a74,0xc9))[_0x6ab2('0x29')](handleError(_0x3a1a74,null));};exports['update']=function(_0xfc55cd,_0x4c1c1b){if(_0xfc55cd[_0x6ab2('0x59')]['id']){delete _0xfc55cd[_0x6ab2('0x59')]['id'];}return db[_0x6ab2('0x3d')]['find']({'where':{'id':_0xfc55cd[_0x6ab2('0x56')]['id']}})[_0x6ab2('0x53')](handleEntityNotFound(_0x4c1c1b,null))[_0x6ab2('0x53')](saveUpdates(_0xfc55cd[_0x6ab2('0x59')],null))[_0x6ab2('0x53')](respondWithResult(_0x4c1c1b,null))[_0x6ab2('0x29')](handleError(_0x4c1c1b,null));};exports[_0x6ab2('0x35')]=function(_0x3f249f,_0x494599){return db[_0x6ab2('0x3d')][_0x6ab2('0x58')]({'where':{'id':_0x3f249f[_0x6ab2('0x56')]['id']}})[_0x6ab2('0x53')](handleEntityNotFound(_0x494599,null))[_0x6ab2('0x53')](removeEntity(_0x494599,null))['catch'](handleError(_0x494599,null));};exports['describe']=function(_0xa2e360,_0x3094cc){return db[_0x6ab2('0x3d')][_0x6ab2('0x5a')]()['then'](respondWithResult(_0x3094cc,null))['catch'](handleError(_0x3094cc,null));};var interaction_log=require(_0x6ab2('0x14'))(_0x6ab2('0x5b'));exports['accept']=function(_0xe1b095,_0x30338a,_0x23387f){var _0x44f2eb={'agent':{},'channel':_0x6ab2('0x5c')};if(_0xe1b095[_0x6ab2('0x59')]['id']){delete _0xe1b095[_0x6ab2('0x59')]['id'];}_0xe1b095[_0x6ab2('0x59')][_0x6ab2('0x5d')]=!![];_0xe1b095[_0x6ab2('0x59')][_0x6ab2('0x5e')]=moment()[_0x6ab2('0x5f')](_0x6ab2('0x60'));_0xe1b095['body'][_0x6ab2('0x61')]=_0xe1b095[_0x6ab2('0x59')][_0x6ab2('0x61')]||_0xe1b095['user']['id'];_0x44f2eb[_0x6ab2('0x62')]['id']=_0xe1b095[_0x6ab2('0x59')][_0x6ab2('0x61')];return db[_0x6ab2('0x3d')][_0x6ab2('0x58')]({'where':{'id':_0xe1b095[_0x6ab2('0x56')]['id'],'UserId':null}})[_0x6ab2('0x53')](handleEntityNotFound(_0x30338a,null))[_0x6ab2('0x53')](saveUpdates(_0xe1b095[_0x6ab2('0x59')],null))[_0x6ab2('0x53')](function(_0x182f88){if(_0x182f88){_0x44f2eb['message']=_0x182f88[_0x6ab2('0x63')]({'plain':!![]});return db[_0x6ab2('0x64')]['find']({'where':{'id':_0x182f88[_0x6ab2('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x30338a,null))[_0x6ab2('0x53')](function(_0x4a0616){if(_0x4a0616){return _0x4a0616[_0x6ab2('0x34')]({'UserId':_0xe1b095[_0x6ab2('0x59')][_0x6ab2('0x61')],'read1stAt':_[_0x6ab2('0x66')](_0x4a0616[_0x6ab2('0x67')])?moment()['format'](_0x6ab2('0x60')):undefined});}return null;})[_0x6ab2('0x53')](function(_0x23f7c6){if(_0x23f7c6){_0x44f2eb[_0x6ab2('0x68')]=_0x23f7c6['get']({'plain':!![]});interaction_log[_0x6ab2('0x21')](_0x6ab2('0x69'),_0xe1b095[_0x6ab2('0x6a')]['id'],_0xe1b095[_0x6ab2('0x6a')][_0x6ab2('0x39')],_0xe1b095[_0x6ab2('0x6a')]['role'],_0x44f2eb['interaction']['id'],_0xe1b095[_0x6ab2('0x59')]?JSON[_0x6ab2('0x26')](_0xe1b095[_0x6ab2('0x59')]):_0x6ab2('0x6b'));return respondWithRpcPromise(_0x6ab2('0x6c'),'acceptMessage',_0x44f2eb);}return null;})[_0x6ab2('0x53')](function(_0x361c1d){var _0x26f231=_0x6ab2('0x6d')+_0x361c1d[_0x6ab2('0x28')][_0x6ab2('0x6e')];return db[_0x6ab2('0x6f')][_0x6ab2('0x40')](_0x26f231,{'type':db[_0x6ab2('0x70')][_0x6ab2('0x71')][_0x6ab2('0x72')],'raw':!![]})[_0x6ab2('0x53')](function(_0x228c73){return _0x228c73;});})[_0x6ab2('0x53')](function(_0x16db7b){if(_0x16db7b){_0x44f2eb['message'][_0x6ab2('0x73')]=_0x16db7b[0x0];if(!_0xe1b095[_0x6ab2('0x59')]['UserId'])return;return db[_0x6ab2('0x74')][_0x6ab2('0x58')]({'where':{'id':_0xe1b095[_0x6ab2('0x59')][_0x6ab2('0x61')],'role':_0x6ab2('0x62')},'attributes':['id',_0x6ab2('0x39'),_0x6ab2('0x75'),_0x6ab2('0x76'),'internal'],'raw':!![]});}return null;})['then'](function(_0x239a02){if(!_0x239a02)return null;_0x44f2eb[_0x6ab2('0x28')][_0x6ab2('0x62')]=_0x239a02;return _0x44f2eb;})[_0x6ab2('0x53')](function(_0x2a0fc5){if(_0x2a0fc5){if(_0xe1b095['body'][_0x6ab2('0x77')]){_0x44f2eb[_0x6ab2('0x28')][_0x6ab2('0x78')]=util[_0x6ab2('0x5f')](_0x6ab2('0x79'),_0xe1b095['user']['name']);_0x44f2eb[_0x6ab2('0x28')]['channel']=_0x44f2eb[_0x6ab2('0x7a')];_0x44f2eb[_0x6ab2('0x28')][_0x6ab2('0x7b')]=_0x44f2eb['channel'];_0x44f2eb[_0x6ab2('0x28')][_0x6ab2('0x7c')]=_0x6ab2('0x7d');return respondWithRpcPromise(_0x6ab2('0x7e'),'EventManager',{'event':_0x6ab2('0x7f'),'message':_[_0x6ab2('0x4c')](_0x44f2eb[_0x6ab2('0x28')],JSON[_0x6ab2('0x80')](_0x44f2eb[_0x6ab2('0x68')][_0x6ab2('0x81')]))},client9002)[_0x6ab2('0x53')](function(){return _0x44f2eb;});}return _0x44f2eb;}return null;})[_0x6ab2('0x53')](respondWithResult(_0x30338a,null))['catch'](handleError(_0x30338a,null));};var interaction_log=require(_0x6ab2('0x14'))(_0x6ab2('0x5b'));exports[_0x6ab2('0x32')]=function(_0x556e6d,_0x23f662,_0x56bf18){var _0x5af1d6={'agent':{},'channel':_0x6ab2('0x5c')};if(_0x556e6d[_0x6ab2('0x59')]['id']){delete _0x556e6d[_0x6ab2('0x59')]['id'];}_0x556e6d['body'][_0x6ab2('0x61')]=_0x556e6d[_0x6ab2('0x59')][_0x6ab2('0x61')]||_0x556e6d[_0x6ab2('0x6a')]['id'];_0x5af1d6[_0x6ab2('0x62')]['id']=_0x556e6d['body'][_0x6ab2('0x61')];return db[_0x6ab2('0x3d')][_0x6ab2('0x58')]({'where':{'id':_0x556e6d[_0x6ab2('0x56')]['id'],'UserId':null}})[_0x6ab2('0x53')](handleEntityNotFound(_0x23f662,null))['then'](function(_0x15367d){if(_0x15367d){_0x5af1d6[_0x6ab2('0x28')]=_0x15367d['get']({'plain':!![]});return db[_0x6ab2('0x64')][_0x6ab2('0x58')]({'where':{'id':_0x15367d['ChatInteractionId']}});}return null;})[_0x6ab2('0x53')](handleEntityNotFound(_0x23f662,null))[_0x6ab2('0x53')](function(_0x135524){if(_0x135524){_0x5af1d6[_0x6ab2('0x68')]=_0x135524[_0x6ab2('0x63')]({'plain':!![]});interaction_log['info'](_0x6ab2('0x82'),_0x556e6d[_0x6ab2('0x6a')]['id'],_0x556e6d[_0x6ab2('0x6a')]['name'],_0x556e6d[_0x6ab2('0x6a')][_0x6ab2('0x83')],_0x5af1d6[_0x6ab2('0x68')]['id'],_0x556e6d[_0x6ab2('0x59')]?JSON['stringify'](_0x556e6d[_0x6ab2('0x59')]):_0x6ab2('0x6b'));return respondWithRpcPromise(_0x6ab2('0x84'),'rejectMessage',_0x5af1d6);}return null;})[_0x6ab2('0x53')](function(_0x12e844){var _0x329852='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x12e844[_0x6ab2('0x28')][_0x6ab2('0x6e')];return db[_0x6ab2('0x6f')][_0x6ab2('0x40')](_0x329852,{'type':db[_0x6ab2('0x70')][_0x6ab2('0x71')][_0x6ab2('0x72')],'raw':!![]})[_0x6ab2('0x53')](function(_0x4c6764){return _0x4c6764;});})[_0x6ab2('0x53')](function(_0x10abbd){if(_0x10abbd){_0x5af1d6[_0x6ab2('0x28')][_0x6ab2('0x73')]=_0x10abbd[0x0];if(!_0x556e6d[_0x6ab2('0x59')][_0x6ab2('0x61')])return;return db['User'][_0x6ab2('0x58')]({'where':{'id':_0x556e6d[_0x6ab2('0x59')][_0x6ab2('0x61')],'role':_0x6ab2('0x62')},'attributes':['id','name',_0x6ab2('0x75'),'email','internal'],'raw':!![]});}return null;})[_0x6ab2('0x53')](function(_0x380ae9){if(!_0x380ae9)return null;_0x5af1d6[_0x6ab2('0x28')]['agent']=_0x380ae9;return _0x5af1d6;})['then'](function(_0x42fbbc){if(_0x42fbbc){_0x42fbbc[_0x6ab2('0x28')]['interface']=util[_0x6ab2('0x5f')](_0x6ab2('0x79'),_0x556e6d[_0x6ab2('0x6a')][_0x6ab2('0x39')]);_0x42fbbc['message']['channel']=_0x5af1d6[_0x6ab2('0x7a')];_0x42fbbc[_0x6ab2('0x28')][_0x6ab2('0x7b')]=_0x5af1d6[_0x6ab2('0x7a')];_0x42fbbc[_0x6ab2('0x28')][_0x6ab2('0x7c')]='reject';respondWithRpcPromise(_0x6ab2('0x7e'),_0x6ab2('0x7e'),{'event':_0x6ab2('0x85'),'message':_[_0x6ab2('0x4c')](_0x5af1d6['message'],JSON[_0x6ab2('0x80')](_0x5af1d6[_0x6ab2('0x68')][_0x6ab2('0x81')]))},client9002);return _0x5af1d6;}return null;})[_0x6ab2('0x53')](respondWithResult(_0x23f662,null))[_0x6ab2('0x29')](handleError(_0x23f662,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 963be79..c6f203e 100644
--- a/server/api/chatMessage/chatMessage.events.js
+++ b/server/api/chatMessage/chatMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc0b9=['ChatMessage','save','update','remove','emit','hook','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc0b9,0xfc));var _0x9c0b=function(_0x4f570c,_0xca2743){_0x4f570c=_0x4f570c-0x0;var _0x73ac01=_0xc0b9[_0x4f570c];return _0x73ac01;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x9c0b('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9c0b('0x1'),'afterUpdate':_0x9c0b('0x2'),'afterDestroy':_0x9c0b('0x3')};function emitEvent(_0x2f76a4){return function(_0x4e9db8,_0x46933e,_0x48a10c){ChatMessageEvents[_0x9c0b('0x4')](_0x2f76a4+':'+_0x4e9db8['id'],_0x4e9db8);ChatMessageEvents[_0x9c0b('0x4')](_0x2f76a4,_0x4e9db8);_0x48a10c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x9c0b('0x5')](e,emitEvent(event));}}module[_0x9c0b('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x5473=['../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x521e8d,_0x23a290){var _0x518bbd=function(_0x4241eb){while(--_0x4241eb){_0x521e8d['push'](_0x521e8d['shift']());}};_0x518bbd(++_0x23a290);}(_0x5473,0x1ad));var _0x3547=function(_0x39b316,_0x3def1e){_0x39b316=_0x39b316-0x0;var _0x182ab1=_0x5473[_0x39b316];return _0x182ab1;};'use strict';var EventEmitter=require(_0x3547('0x0'));var ChatMessage=require(_0x3547('0x1'))['db'][_0x3547('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3547('0x3')](0x0);var events={'afterCreate':_0x3547('0x4'),'afterUpdate':_0x3547('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4fbb04){return function(_0x3d1aaf,_0xe225b9,_0x2d038a){ChatMessageEvents[_0x3547('0x6')](_0x4fbb04+':'+_0x3d1aaf['id'],_0x3d1aaf);ChatMessageEvents['emit'](_0x4fbb04,_0x3d1aaf);_0x2d038a(null);};}for(var e in events){if(events[_0x3547('0x7')](e)){var event=events[e];ChatMessage[_0x3547('0x8')](e,emitEvent(event));}}module[_0x3547('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index da580bb..4a48b98 100644
--- a/server/api/chatMessage/chatMessage.model.js
+++ b/server/api/chatMessage/chatMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x86c9=['findOne','update','createdAt','catch','error','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','isNil','ChatInteraction'];(function(_0x144ef5,_0x2246b5){var _0x587f9d=function(_0x4e95cc){while(--_0x4e95cc){_0x144ef5['push'](_0x144ef5['shift']());}};_0x587f9d(++_0x2246b5);}(_0x86c9,0x100));var _0x986c=function(_0x2c9089,_0x11d04b){_0x2c9089=_0x2c9089-0x0;var _0x4e006b=_0x86c9[_0x2c9089];return _0x4e006b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x986c('0x0'))(_0x986c('0x1'));var moment=require(_0x986c('0x2'));var BPromise=require(_0x986c('0x3'));var rp=require(_0x986c('0x4'));var fs=require('fs');var path=require(_0x986c('0x5'));var rimraf=require('rimraf');var config=require(_0x986c('0x6'));var attributes=require(_0x986c('0x7'));module['exports']=function(_0x12ff24,_0x307654){return _0x12ff24['define'](_0x986c('0x8'),attributes,{'tableName':_0x986c('0x9'),'paranoid':![],'indexes':[{'name':_0x986c('0xa'),'fields':[_0x986c('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ef5b3,_0x442b34,_0x1e3e3f){var _0x82e6ee=_0x12ff24[_0x986c('0xc')];var _0x81984c=_0x1ef5b3[_0x986c('0xd')]({'plain':!![]});if(_0x81984c[_0x986c('0xe')]['toLowerCase']()==='in'||_0x81984c[_0x986c('0xe')][_0x986c('0xf')]()===_0x986c('0x10')&&!_0x81984c['secret']&&!_[_0x986c('0x11')](_0x81984c['UserId'])){_0x82e6ee[_0x986c('0x12')][_0x986c('0x13')]({'where':{'id':_0x81984c['ChatInteractionId']}})['then'](function(_0x4832cd){if(_0x4832cd){_0x4832cd[_0x986c('0x14')]({'lastMsgAt':_0x81984c[_0x986c('0x15')],'lastMsgDirection':_0x81984c[_0x986c('0xe')][_0x986c('0xf')]()});}})[_0x986c('0x16')](function(_0x4326c8){console[_0x986c('0x17')](_0x4326c8);});}_0x1e3e3f();}},'charset':'utf8mb4','collate':_0x986c('0x18')});};
\ No newline at end of file
+var _0xdc25=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','body','models','direction','toLowerCase','out','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xdc25,0x135));var _0x5dc2=function(_0x3b58b9,_0x486630){_0x3b58b9=_0x3b58b9-0x0;var _0x667ba4=_0xdc25[_0x3b58b9];return _0x667ba4;};'use strict';var _=require(_0x5dc2('0x0'));var util=require('util');var logger=require(_0x5dc2('0x1'))(_0x5dc2('0x2'));var moment=require(_0x5dc2('0x3'));var BPromise=require(_0x5dc2('0x4'));var rp=require(_0x5dc2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5dc2('0x6'));var config=require(_0x5dc2('0x7'));var attributes=require('./chatMessage.attributes');module[_0x5dc2('0x8')]=function(_0x256670,_0x1bac4f){return _0x256670['define'](_0x5dc2('0x9'),attributes,{'tableName':_0x5dc2('0xa'),'paranoid':![],'indexes':[{'name':_0x5dc2('0xb'),'fields':[_0x5dc2('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a1590,_0x433717,_0x375356){var _0x352cc2=_0x256670[_0x5dc2('0xd')];var _0x4aa490=_0x3a1590['get']({'plain':!![]});if(_0x4aa490[_0x5dc2('0xe')][_0x5dc2('0xf')]()==='in'||_0x4aa490[_0x5dc2('0xe')]['toLowerCase']()===_0x5dc2('0x10')&&!_0x4aa490['secret']&&!_[_0x5dc2('0x11')](_0x4aa490[_0x5dc2('0x12')])){_0x352cc2['ChatInteraction'][_0x5dc2('0x13')]({'where':{'id':_0x4aa490[_0x5dc2('0x14')]}})[_0x5dc2('0x15')](function(_0x4fd9d7){if(_0x4fd9d7){_0x4fd9d7[_0x5dc2('0x16')]({'lastMsgAt':_0x4aa490[_0x5dc2('0x17')],'lastMsgDirection':_0x4aa490[_0x5dc2('0xe')][_0x5dc2('0xf')]()});}})[_0x5dc2('0x18')](function(_0x2e2d47){console['error'](_0x2e2d47);});}_0x375356();}},'charset':'utf8mb4','collate':_0x5dc2('0x19')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 456eb3a..31b16f9 100644
--- a/server/api/chatMessage/chatMessage.rpc.js
+++ b/server/api/chatMessage/chatMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf011=['raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','then','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','options'];(function(_0x98e896,_0x2292a7){var _0x2448a9=function(_0x26ecbb){while(--_0x26ecbb){_0x98e896['push'](_0x98e896['shift']());}};_0x2448a9(++_0x2292a7);}(_0xf011,0x1ae));var _0x1f01=function(_0x31066b,_0x4d515d){_0x31066b=_0x31066b-0x0;var _0x52e02d=_0xf011[_0x31066b];return _0x52e02d;};'use strict';var _=require(_0x1f01('0x0'));var util=require(_0x1f01('0x1'));var moment=require(_0x1f01('0x2'));var BPromise=require(_0x1f01('0x3'));var rs=require(_0x1f01('0x4'));var fs=require('fs');var Redis=require(_0x1f01('0x5'));var db=require(_0x1f01('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1f01('0x7'));var config=require(_0x1f01('0x8'));var jayson=require(_0x1f01('0x9'));var client=jayson[_0x1f01('0xa')][_0x1f01('0xb')]({'port':0x232a});config[_0x1f01('0xc')]=_[_0x1f01('0xd')](config[_0x1f01('0xc')],{'host':_0x1f01('0xe'),'port':0x18eb});var socket=require(_0x1f01('0xf'))(new Redis(config[_0x1f01('0xc')]));require(_0x1f01('0x10'))['register'](socket);function respondWithRpcPromise(_0x3a4e23,_0x4e630d,_0x46cadb){return new BPromise(function(_0x544ae1,_0x2f3f3c){return client['request'](_0x3a4e23,_0x46cadb)[_0x1f01('0x11')](function(_0x4a8d9f){logger['info'](_0x1f01('0x12'),_0x4e630d,'request\x20sent');logger[_0x1f01('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4e630d,_0x1f01('0x14'),JSON[_0x1f01('0x15')](_0x4a8d9f));if(_0x4a8d9f['error']){if(_0x4a8d9f[_0x1f01('0x16')][_0x1f01('0x17')]===0x1f4){logger[_0x1f01('0x16')](_0x1f01('0x12'),_0x4e630d,_0x4a8d9f['error']['message']);return _0x2f3f3c(_0x4a8d9f[_0x1f01('0x16')]['message']);}logger[_0x1f01('0x16')](_0x1f01('0x12'),_0x4e630d,_0x4a8d9f[_0x1f01('0x16')][_0x1f01('0x18')]);return _0x544ae1(_0x4a8d9f[_0x1f01('0x16')][_0x1f01('0x18')]);}else{logger[_0x1f01('0x19')]('ChatMessage,\x20%s,\x20%s',_0x4e630d,_0x1f01('0x14'));_0x544ae1(_0x4a8d9f[_0x1f01('0x1a')][_0x1f01('0x18')]);}})[_0x1f01('0x1b')](function(_0x1b4af8){logger[_0x1f01('0x16')](_0x1f01('0x12'),_0x4e630d,_0x1b4af8);_0x2f3f3c(_0x1b4af8);});});}exports[_0x1f01('0x1c')]=function(_0x384805){var _0x1b7228=this;return new Promise(function(_0x28bb0d,_0x398be7){return db[_0x1f01('0x1d')][_0x1f01('0x1e')](_0x384805['body'],{'raw':_0x384805[_0x1f01('0x1f')]?_0x384805[_0x1f01('0x1f')][_0x1f01('0x20')]===undefined?!![]:![]:!![]})[_0x1f01('0x11')](function(_0x4e70fa){logger[_0x1f01('0x19')]('CreateChatMessage',_0x384805);logger[_0x1f01('0x13')]('CreateChatMessage',_0x384805,JSON['stringify'](_0x4e70fa));_0x28bb0d(_0x4e70fa);})['catch'](function(_0x757cce){logger['error'](_0x1f01('0x1c'),_0x757cce[_0x1f01('0x18')],_0x384805);_0x398be7(_0x1b7228[_0x1f01('0x16')](0x1f4,_0x757cce[_0x1f01('0x18')]));});});};
\ No newline at end of file
+var _0xb754=['result','ChatMessage','create','body','options','raw','CreateChatMessage','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xb754,0x1f2));var _0x4b75=function(_0x2e748c,_0x55ec8e){_0x2e748c=_0x2e748c-0x0;var _0x37e219=_0xb754[_0x2e748c];return _0x37e219;};'use strict';var _=require(_0x4b75('0x0'));var util=require(_0x4b75('0x1'));var moment=require(_0x4b75('0x2'));var BPromise=require(_0x4b75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b75('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b75('0x5'));var logger=require(_0x4b75('0x6'))(_0x4b75('0x7'));var config=require(_0x4b75('0x8'));var jayson=require(_0x4b75('0x9'));var client=jayson[_0x4b75('0xa')]['http']({'port':0x232a});config[_0x4b75('0xb')]=_[_0x4b75('0xc')](config[_0x4b75('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b75('0xd'))(new Redis(config[_0x4b75('0xb')]));require(_0x4b75('0xe'))[_0x4b75('0xf')](socket);function respondWithRpcPromise(_0xd3b609,_0x475745,_0x2b5014){return new BPromise(function(_0x56a253,_0x157598){return client[_0x4b75('0x10')](_0xd3b609,_0x2b5014)[_0x4b75('0x11')](function(_0x455745){logger[_0x4b75('0x12')](_0x4b75('0x13'),_0x475745,_0x4b75('0x14'));logger[_0x4b75('0x15')](_0x4b75('0x16'),_0x475745,_0x4b75('0x14'),JSON[_0x4b75('0x17')](_0x455745));if(_0x455745['error']){if(_0x455745[_0x4b75('0x18')][_0x4b75('0x19')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x475745,_0x455745[_0x4b75('0x18')][_0x4b75('0x1a')]);return _0x157598(_0x455745[_0x4b75('0x18')][_0x4b75('0x1a')]);}logger[_0x4b75('0x18')](_0x4b75('0x13'),_0x475745,_0x455745[_0x4b75('0x18')][_0x4b75('0x1a')]);return _0x56a253(_0x455745['error'][_0x4b75('0x1a')]);}else{logger[_0x4b75('0x12')](_0x4b75('0x13'),_0x475745,'request\x20sent');_0x56a253(_0x455745[_0x4b75('0x1b')]['message']);}})['catch'](function(_0x528680){logger[_0x4b75('0x18')](_0x4b75('0x13'),_0x475745,_0x528680);_0x157598(_0x528680);});});}exports['CreateChatMessage']=function(_0x1ca56b){var _0x542814=this;return new Promise(function(_0x154f90,_0x2d3d17){return db[_0x4b75('0x1c')][_0x4b75('0x1d')](_0x1ca56b[_0x4b75('0x1e')],{'raw':_0x1ca56b[_0x4b75('0x1f')]?_0x1ca56b[_0x4b75('0x1f')][_0x4b75('0x20')]===undefined?!![]:![]:!![]})[_0x4b75('0x11')](function(_0x42377e){logger[_0x4b75('0x12')](_0x4b75('0x21'),_0x1ca56b);logger['debug'](_0x4b75('0x21'),_0x1ca56b,JSON[_0x4b75('0x17')](_0x42377e));_0x154f90(_0x42377e);})[_0x4b75('0x22')](function(_0x5f08e6){logger[_0x4b75('0x18')](_0x4b75('0x21'),_0x5f08e6['message'],_0x1ca56b);_0x2d3d17(_0x542814[_0x4b75('0x18')](0x1f4,_0x5f08e6[_0x4b75('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 5919015..74d0a46 100644
--- a/server/api/chatMessage/chatMessage.socket.js
+++ b/server/api/chatMessage/chatMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xecb2=['chatMessage:','./chatMessage.events','update','emit','removeListener','register','length'];(function(_0x389933,_0x4fbee9){var _0x3f18a8=function(_0x2e7473){while(--_0x2e7473){_0x389933['push'](_0x389933['shift']());}};_0x3f18a8(++_0x4fbee9);}(_0xecb2,0xf6));var _0x2ecb=function(_0x28d19e,_0x4e20a6){_0x28d19e=_0x28d19e-0x0;var _0x1a94c5=_0xecb2[_0x28d19e];return _0x1a94c5;};'use strict';var ChatMessageEvents=require(_0x2ecb('0x0'));var events=['save','remove',_0x2ecb('0x1')];function createListener(_0x548b3c,_0x59d894){return function(_0x1bb230){_0x59d894[_0x2ecb('0x2')](_0x548b3c,_0x1bb230);};}function removeListener(_0x393e7c,_0x2a4fe5){return function(){ChatMessageEvents[_0x2ecb('0x3')](_0x393e7c,_0x2a4fe5);};}exports[_0x2ecb('0x4')]=function(_0x4c169f){for(var _0x51b28c=0x0,_0x49de99=events[_0x2ecb('0x5')];_0x51b28c<_0x49de99;_0x51b28c++){var _0x3df4a0=events[_0x51b28c];var _0x15a959=createListener(_0x2ecb('0x6')+_0x3df4a0,_0x4c169f);ChatMessageEvents['on'](_0x3df4a0,_0x15a959);}};
\ No newline at end of file
+var _0x99c9=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x2026cd,_0x2ab9fe){var _0x3ed4b1=function(_0x51e11c){while(--_0x51e11c){_0x2026cd['push'](_0x2026cd['shift']());}};_0x3ed4b1(++_0x2ab9fe);}(_0x99c9,0x13c));var _0x999c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x99c9[_0x57b54c];return _0x59cc19;};'use strict';var ChatMessageEvents=require(_0x999c('0x0'));var events=[_0x999c('0x1'),_0x999c('0x2'),_0x999c('0x3')];function createListener(_0x2bb83d,_0x16a7a3){return function(_0x31e9b1){_0x16a7a3['emit'](_0x2bb83d,_0x31e9b1);};}function removeListener(_0x2a4e06,_0x140cd5){return function(){ChatMessageEvents[_0x999c('0x4')](_0x2a4e06,_0x140cd5);};}exports[_0x999c('0x5')]=function(_0x2bdd73){for(var _0x14df32=0x0,_0x34f100=events[_0x999c('0x6')];_0x14df32<_0x34f100;_0x14df32++){var _0xc8a6b5=events[_0x14df32];var _0xb88ec1=createListener(_0x999c('0x7')+_0xc8a6b5,_0x2bdd73);ChatMessageEvents['on'](_0xc8a6b5,_0xb88ec1);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 61cd0f6..e46c3ae 100644
--- a/server/api/chatMessage/index.js
+++ b/server/api/chatMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x480d=['reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x480d,0x148));var _0xd480=function(_0x48f376,_0x206737){_0x48f376=_0x48f376-0x0;var _0x2c176d=_0x480d[_0x48f376];return _0x2c176d;};'use strict';var multer=require(_0xd480('0x0'));var util=require(_0xd480('0x1'));var path=require(_0xd480('0x2'));var timeout=require(_0xd480('0x3'));var express=require(_0xd480('0x4'));var router=express[_0xd480('0x5')]();var fs_extra=require(_0xd480('0x6'));var auth=require(_0xd480('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd480('0x8'));var controller=require(_0xd480('0x9'));router[_0xd480('0xa')]('/',auth[_0xd480('0xb')](),controller['index']);router[_0xd480('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xd480('0xc')]);router[_0xd480('0xa')](_0xd480('0xd'),auth[_0xd480('0xb')](),controller[_0xd480('0xe')]);router[_0xd480('0xf')]('/',auth[_0xd480('0xb')](),interaction['tracked'](_0xd480('0x10'),_0xd480('0x11')),controller['create']);router[_0xd480('0x12')](_0xd480('0xd'),controller[_0xd480('0x13')]);router[_0xd480('0x12')](_0xd480('0x14'),auth[_0xd480('0xb')](),controller[_0xd480('0x15')]);router[_0xd480('0x12')](_0xd480('0x16'),auth[_0xd480('0xb')](),controller[_0xd480('0x17')]);router[_0xd480('0x18')](_0xd480('0xd'),auth[_0xd480('0xb')](),controller[_0xd480('0x19')]);module[_0xd480('0x1a')]=router;
\ No newline at end of file
+var _0xe515=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','tracked','chatmessage:create','put','update','/:id/accept','accept','reject','destroy','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe515,0xa8));var _0x5e51=function(_0x257ebc,_0x1980f8){_0x257ebc=_0x257ebc-0x0;var _0x357853=_0xe515[_0x257ebc];return _0x357853;};'use strict';var multer=require(_0x5e51('0x0'));var util=require(_0x5e51('0x1'));var path=require(_0x5e51('0x2'));var timeout=require('connect-timeout');var express=require(_0x5e51('0x3'));var router=express[_0x5e51('0x4')]();var fs_extra=require(_0x5e51('0x5'));var auth=require(_0x5e51('0x6'));var interaction=require(_0x5e51('0x7'));var config=require(_0x5e51('0x8'));var controller=require('./chatMessage.controller');router[_0x5e51('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5e51('0x9')](_0x5e51('0xa'),auth[_0x5e51('0xb')](),controller[_0x5e51('0xc')]);router[_0x5e51('0x9')](_0x5e51('0xd'),auth['isAuthenticated'](),controller[_0x5e51('0xe')]);router['post']('/',auth[_0x5e51('0xb')](),interaction[_0x5e51('0xf')]('chat',_0x5e51('0x10')),controller['create']);router[_0x5e51('0x11')](_0x5e51('0xd'),controller[_0x5e51('0x12')]);router[_0x5e51('0x11')](_0x5e51('0x13'),auth[_0x5e51('0xb')](),controller[_0x5e51('0x14')]);router[_0x5e51('0x11')]('/:id/reject',auth[_0x5e51('0xb')](),controller[_0x5e51('0x15')]);router['delete'](_0x5e51('0xd'),auth[_0x5e51('0xb')](),controller[_0x5e51('0x16')]);module[_0x5e51('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index a2a8025..e1b7d95 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4fac=['sequelize','TEXT','medium'];(function(_0x15c43f,_0x27fb5a){var _0x2e39a7=function(_0x39e507){while(--_0x39e507){_0x15c43f['push'](_0x15c43f['shift']());}};_0x2e39a7(++_0x27fb5a);}(_0x4fac,0xed));var _0xc4fa=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4fac[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc4fa('0x0'));module['exports']={'body':{'type':Sequelize[_0xc4fa('0x1')](_0xc4fa('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xa547=['exports','medium'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa547,0xb0));var _0x7a54=function(_0x50eca6,_0x12503d){_0x50eca6=_0x50eca6-0x0;var _0x590de9=_0xa547[_0x50eca6];return _0x590de9;};'use strict';var Sequelize=require('sequelize');module[_0x7a54('0x0')]={'body':{'type':Sequelize['TEXT'](_0x7a54('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 7af67a8..ca5d223 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x7a54,0x106));var _0x47a5=function(_0x43adf0,_0x5821aa){_0x43adf0=_0x43adf0-0x0;var _0x3a3ee4=_0x7a54[_0x43adf0];return _0x3a3ee4;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x20edab,_0xa37335){var _0x3f761d=function(_0x39a846){while(--_0x39a846){_0x20edab['push'](_0x20edab['shift']());}};_0x3f761d(++_0xa37335);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index f33a4fe..4cf8a8e 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3ae6=['../../config/environment','exports','chat_offline_messages','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1250f1,_0x275ba5){var _0x590580=function(_0x545b73){while(--_0x545b73){_0x1250f1['push'](_0x1250f1['shift']());}};_0x590580(++_0x275ba5);}(_0x3ae6,0x159));var _0x63ae=function(_0x38f106,_0x25bd5b){_0x38f106=_0x38f106-0x0;var _0x3cb829=_0x3ae6[_0x38f106];return _0x3cb829;};'use strict';var _=require(_0x63ae('0x0'));var util=require(_0x63ae('0x1'));var logger=require(_0x63ae('0x2'))('api');var moment=require('moment');var BPromise=require(_0x63ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63ae('0x4'));var rimraf=require(_0x63ae('0x5'));var config=require(_0x63ae('0x6'));var attributes=require('./chatOfflineMessage.attributes');module[_0x63ae('0x7')]=function(_0x3d341c,_0x2cadad){return _0x3d341c['define']('ChatOfflineMessage',attributes,{'tableName':_0x63ae('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x20c5=['../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x17f716,_0x4a06c7){var _0x31f0de=function(_0x5476e4){while(--_0x5476e4){_0x17f716['push'](_0x17f716['shift']());}};_0x31f0de(++_0x4a06c7);}(_0x20c5,0xd7));var _0x520c=function(_0x14f8ef,_0x1b1107){_0x14f8ef=_0x14f8ef-0x0;var _0x3b97f6=_0x20c5[_0x14f8ef];return _0x3b97f6;};'use strict';var _=require(_0x520c('0x0'));var util=require(_0x520c('0x1'));var logger=require(_0x520c('0x2'))(_0x520c('0x3'));var moment=require(_0x520c('0x4'));var BPromise=require(_0x520c('0x5'));var rp=require(_0x520c('0x6'));var fs=require('fs');var path=require(_0x520c('0x7'));var rimraf=require(_0x520c('0x8'));var config=require(_0x520c('0x9'));var attributes=require(_0x520c('0xa'));module[_0x520c('0xb')]=function(_0xe079cb,_0x3e175f){return _0xe079cb[_0x520c('0xc')](_0x520c('0xd'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x520c('0xe'),'collate':_0x520c('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 39c1825..d9fb94b 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa5e3=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa5e3,0x86));var _0x3a5e=function(_0x5c63c7,_0xa34f6){_0x5c63c7=_0x5c63c7-0x0;var _0x43943e=_0xa5e3[_0x5c63c7];return _0x43943e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3a5e('0x0'));var BPromise=require(_0x3a5e('0x1'));var rs=require(_0x3a5e('0x2'));var fs=require('fs');var Redis=require(_0x3a5e('0x3'));var db=require(_0x3a5e('0x4'))['db'];var utils=require(_0x3a5e('0x5'));var logger=require(_0x3a5e('0x6'))('rpc');var config=require(_0x3a5e('0x7'));var jayson=require(_0x3a5e('0x8'));var client=jayson[_0x3a5e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34fa64,_0x5ddc7b,_0x4b0e8c){return new BPromise(function(_0x261d14,_0x2da184){return client[_0x3a5e('0xa')](_0x34fa64,_0x4b0e8c)[_0x3a5e('0xb')](function(_0x534bf2){logger[_0x3a5e('0xc')](_0x3a5e('0xd'),_0x5ddc7b,_0x3a5e('0xe'));logger[_0x3a5e('0xf')](_0x3a5e('0x10'),_0x5ddc7b,_0x3a5e('0xe'),JSON['stringify'](_0x534bf2));if(_0x534bf2[_0x3a5e('0x11')]){if(_0x534bf2[_0x3a5e('0x11')][_0x3a5e('0x12')]===0x1f4){logger['error'](_0x3a5e('0xd'),_0x5ddc7b,_0x534bf2['error']['message']);return _0x2da184(_0x534bf2[_0x3a5e('0x11')][_0x3a5e('0x13')]);}logger[_0x3a5e('0x11')](_0x3a5e('0xd'),_0x5ddc7b,_0x534bf2[_0x3a5e('0x11')][_0x3a5e('0x13')]);return _0x261d14(_0x534bf2[_0x3a5e('0x11')][_0x3a5e('0x13')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5ddc7b,_0x3a5e('0xe'));_0x261d14(_0x534bf2[_0x3a5e('0x14')][_0x3a5e('0x13')]);}})[_0x3a5e('0x15')](function(_0x5c975a){logger[_0x3a5e('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5ddc7b,_0x5c975a);_0x2da184(_0x5c975a);});});}
\ No newline at end of file
+var _0xbd15=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x5213be,_0x431d8d){var _0x2efdfe=function(_0x8048db){while(--_0x8048db){_0x5213be['push'](_0x5213be['shift']());}};_0x2efdfe(++_0x431d8d);}(_0xbd15,0x102));var _0x5bd1=function(_0x32cd29,_0x29f6bb){_0x32cd29=_0x32cd29-0x0;var _0x2f7e6e=_0xbd15[_0x32cd29];return _0x2f7e6e;};'use strict';var _=require(_0x5bd1('0x0'));var util=require(_0x5bd1('0x1'));var moment=require(_0x5bd1('0x2'));var BPromise=require(_0x5bd1('0x3'));var rs=require(_0x5bd1('0x4'));var fs=require('fs');var Redis=require(_0x5bd1('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5bd1('0x6'))(_0x5bd1('0x7'));var config=require(_0x5bd1('0x8'));var jayson=require(_0x5bd1('0x9'));var client=jayson[_0x5bd1('0xa')][_0x5bd1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c437a,_0x447896,_0x219439){return new BPromise(function(_0x2450e2,_0x3ed881){return client[_0x5bd1('0xc')](_0x2c437a,_0x219439)[_0x5bd1('0xd')](function(_0x2a8df3){logger[_0x5bd1('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x447896,_0x5bd1('0xf'));logger[_0x5bd1('0x10')](_0x5bd1('0x11'),_0x447896,_0x5bd1('0xf'),JSON[_0x5bd1('0x12')](_0x2a8df3));if(_0x2a8df3[_0x5bd1('0x13')]){if(_0x2a8df3['error'][_0x5bd1('0x14')]===0x1f4){logger[_0x5bd1('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x447896,_0x2a8df3[_0x5bd1('0x13')]['message']);return _0x3ed881(_0x2a8df3[_0x5bd1('0x13')][_0x5bd1('0x15')]);}logger[_0x5bd1('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x447896,_0x2a8df3['error']['message']);return _0x2450e2(_0x2a8df3[_0x5bd1('0x13')][_0x5bd1('0x15')]);}else{logger[_0x5bd1('0xe')](_0x5bd1('0x16'),_0x447896,_0x5bd1('0xf'));_0x2450e2(_0x2a8df3[_0x5bd1('0x17')]['message']);}})[_0x5bd1('0x18')](function(_0x170d27){logger['error'](_0x5bd1('0x16'),_0x447896,_0x170d27);_0x3ed881(_0x170d27);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 06a3680..3dc2864 100644
--- a/server/api/chatOfflineMessage/index.js
+++ b/server/api/chatOfflineMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x524e=['create','delete','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','show'];(function(_0x51601a,_0x47be4e){var _0x35b255=function(_0x44ef4c){while(--_0x44ef4c){_0x51601a['push'](_0x51601a['shift']());}};_0x35b255(++_0x47be4e);}(_0x524e,0x10e));var _0xe524=function(_0x2b059a,_0x289bba){_0x2b059a=_0x2b059a-0x0;var _0x40f05c=_0x524e[_0x2b059a];return _0x40f05c;};'use strict';var multer=require(_0xe524('0x0'));var util=require(_0xe524('0x1'));var path=require(_0xe524('0x2'));var timeout=require('connect-timeout');var express=require(_0xe524('0x3'));var router=express[_0xe524('0x4')]();var fs_extra=require(_0xe524('0x5'));var auth=require(_0xe524('0x6'));var interaction=require(_0xe524('0x7'));var config=require(_0xe524('0x8'));var controller=require(_0xe524('0x9'));router[_0xe524('0xa')]('/',auth[_0xe524('0xb')](),controller[_0xe524('0xc')]);router[_0xe524('0xa')](_0xe524('0xd'),auth[_0xe524('0xb')](),controller['describe']);router[_0xe524('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe524('0xe')]);router['post']('/',auth[_0xe524('0xb')](),controller[_0xe524('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe524('0x10')](_0xe524('0x11'),auth[_0xe524('0xb')](),controller['destroy']);module[_0xe524('0x12')]=router;
\ No newline at end of file
+var _0x0aed=['./chatOfflineMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','create','put','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x29da7f,_0xf8b1d9){var _0x4f0911=function(_0x4f80ec){while(--_0x4f80ec){_0x29da7f['push'](_0x29da7f['shift']());}};_0x4f0911(++_0xf8b1d9);}(_0x0aed,0x85));var _0xd0ae=function(_0x5296ee,_0x1c060f){_0x5296ee=_0x5296ee-0x0;var _0x374767=_0x0aed[_0x5296ee];return _0x374767;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd0ae('0x0'));var express=require(_0xd0ae('0x1'));var router=express[_0xd0ae('0x2')]();var fs_extra=require(_0xd0ae('0x3'));var auth=require(_0xd0ae('0x4'));var interaction=require(_0xd0ae('0x5'));var config=require(_0xd0ae('0x6'));var controller=require(_0xd0ae('0x7'));router[_0xd0ae('0x8')]('/',auth['isAuthenticated'](),controller[_0xd0ae('0x9')]);router['get'](_0xd0ae('0xa'),auth['isAuthenticated'](),controller[_0xd0ae('0xb')]);router['get'](_0xd0ae('0xc'),auth[_0xd0ae('0xd')](),controller[_0xd0ae('0xe')]);router['post']('/',auth[_0xd0ae('0xd')](),controller[_0xd0ae('0xf')]);router[_0xd0ae('0x10')](_0xd0ae('0xc'),auth[_0xd0ae('0xd')](),controller['update']);router[_0xd0ae('0x11')](_0xd0ae('0xc'),auth[_0xd0ae('0xd')](),controller[_0xd0ae('0x12')]);module[_0xd0ae('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 060552d..375b7d7 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3eea=['timeout','INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x504fb4,_0x3a0bd4){var _0x288e7d=function(_0x31c591){while(--_0x31c591){_0x504fb4['push'](_0x504fb4['shift']());}};_0x288e7d(++_0x3a0bd4);}(_0x3eea,0x152));var _0xa3ee=function(_0x19795,_0x4a2c3f){_0x19795=_0x19795-0x0;var _0x8bfde=_0x3eea[_0x19795];return _0x8bfde;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module[_0xa3ee('0x1')]={'name':{'type':Sequelize[_0xa3ee('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa3ee('0x3'),_0xa3ee('0x4')),'defaultValue':_0xa3ee('0x3')},'selector':{'type':Sequelize[_0xa3ee('0x2')]},'timeout':{'type':Sequelize[_0xa3ee('0x5')]}};
\ No newline at end of file
+var _0x3450=['mouseOver','timeout','INTEGER','sequelize','STRING','ENUM'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3450,0xe1));var _0x0345=function(_0x4ec0f7,_0xa1106f){_0x4ec0f7=_0x4ec0f7-0x0;var _0x34c64b=_0x3450[_0x4ec0f7];return _0x34c64b;};'use strict';var Sequelize=require(_0x0345('0x0'));module['exports']={'name':{'type':Sequelize[_0x0345('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0345('0x2')](_0x0345('0x3'),_0x0345('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0345('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 7d26e3d..fd22e2f 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.controller.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf675=['length','includeAll','include','options','ChatProactiveAction','find','catch','create','body','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','show','model','keys','rawAttributes','query','filters','attributes','fields'];(function(_0x2234ed,_0x50c353){var _0x5df5b7=function(_0x5d0865){while(--_0x5d0865){_0x2234ed['push'](_0x2234ed['shift']());}};_0x5df5b7(++_0x50c353);}(_0xf675,0x199));var _0x5f67=function(_0x503cd5,_0x57774a){_0x503cd5=_0x503cd5-0x0;var _0x1fdf1e=_0xf675[_0x503cd5];return _0x1fdf1e;};'use strict';var emlformat=require(_0x5f67('0x0'));var rimraf=require(_0x5f67('0x1'));var zipdir=require(_0x5f67('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f67('0x3'));var moment=require('moment');var BPromise=require(_0x5f67('0x4'));var Mustache=require(_0x5f67('0x5'));var util=require(_0x5f67('0x6'));var path=require('path');var sox=require(_0x5f67('0x7'));var csv=require(_0x5f67('0x8'));var ejs=require(_0x5f67('0x9'));var fs=require('fs');var fs_extra=require(_0x5f67('0xa'));var _=require('lodash');var squel=require(_0x5f67('0xb'));var crypto=require(_0x5f67('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5f67('0x8'));var querystring=require(_0x5f67('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5f67('0xe'));var qs=require(_0x5f67('0xf'));var as=require(_0x5f67('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5f67('0x11'));var config=require(_0x5f67('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f67('0x13'))['db'];function respondWithStatusCode(_0x534d67,_0x4653c7){_0x4653c7=_0x4653c7||0xcc;return function(_0x49e27f){if(_0x49e27f){return _0x534d67[_0x5f67('0x14')](_0x4653c7);}return _0x534d67[_0x5f67('0x15')](_0x4653c7)[_0x5f67('0x16')]();};}function respondWithResult(_0x4ef1c6,_0x121c72){_0x121c72=_0x121c72||0xc8;return function(_0x59b8c6){if(_0x59b8c6){return _0x4ef1c6[_0x5f67('0x15')](_0x121c72)['json'](_0x59b8c6);}};}function respondWithFilteredResult(_0xfe718e,_0x50a146){return function(_0x1d1b15){if(_0x1d1b15){var _0x2ea6ad=typeof _0x50a146[_0x5f67('0x17')]===_0x5f67('0x18')&&typeof _0x50a146[_0x5f67('0x19')]===_0x5f67('0x18');var _0x3e3e2e=_0x1d1b15[_0x5f67('0x1a')];var _0xc539c6=_0x2ea6ad?0x0:_0x50a146[_0x5f67('0x17')];var _0x5275d6=_0x2ea6ad?_0x1d1b15['count']:_0x50a146[_0x5f67('0x17')]+_0x50a146[_0x5f67('0x19')];var _0x4fe826;if(_0x5275d6>=_0x3e3e2e){_0x5275d6=_0x3e3e2e;_0x4fe826=0xc8;}else{_0x4fe826=0xce;}_0xfe718e[_0x5f67('0x15')](_0x4fe826);return _0xfe718e[_0x5f67('0x1b')](_0x5f67('0x1c'),_0xc539c6+'-'+_0x5275d6+'/'+_0x3e3e2e)[_0x5f67('0x1d')](_0x1d1b15);}return null;};}function patchUpdates(_0x3261af){return function(_0x3d487b){try{jsonpatch[_0x5f67('0x1e')](_0x3d487b,_0x3261af,!![]);}catch(_0x3ca7d6){return BPromise[_0x5f67('0x1f')](_0x3ca7d6);}return _0x3d487b[_0x5f67('0x20')]();};}function saveUpdates(_0x412a41,_0x8d876e){return function(_0x531f2e){if(_0x531f2e){return _0x531f2e[_0x5f67('0x21')](_0x412a41)[_0x5f67('0x22')](function(_0x3e1930){return _0x3e1930;});}return null;};}function removeEntity(_0x5bb1de,_0x537b39){return function(_0x217cf9){if(_0x217cf9){return _0x217cf9[_0x5f67('0x23')]()['then'](function(){_0x5bb1de[_0x5f67('0x15')](0xcc)[_0x5f67('0x16')]();});}};}function handleEntityNotFound(_0x241d17,_0x2dc788){return function(_0x4b24de){if(!_0x4b24de){_0x241d17[_0x5f67('0x14')](0x194);}return _0x4b24de;};}function handleError(_0x4fad07,_0x31b02e){_0x31b02e=_0x31b02e||0x1f4;return function(_0x167601){logger['error'](_0x167601[_0x5f67('0x24')]);if(_0x167601[_0x5f67('0x25')]){delete _0x167601['name'];}_0x4fad07['status'](_0x31b02e)[_0x5f67('0x26')](_0x167601);};}exports[_0x5f67('0x27')]=function(_0x32830d,_0x5dd8d7){var _0x3491b0={'raw':!![],'where':{'id':_0x32830d['params']['id']}},_0xd36b79={};_0xd36b79[_0x5f67('0x28')]=_[_0x5f67('0x29')](db['ChatProactiveAction'][_0x5f67('0x2a')]);_0xd36b79['query']=_[_0x5f67('0x29')](_0x32830d[_0x5f67('0x2b')]);_0xd36b79[_0x5f67('0x2c')]=_['intersection'](_0xd36b79['model'],_0xd36b79['query']);_0x3491b0[_0x5f67('0x2d')]=_['intersection'](_0xd36b79[_0x5f67('0x28')],qs[_0x5f67('0x2e')](_0x32830d[_0x5f67('0x2b')][_0x5f67('0x2e')]));_0x3491b0['attributes']=_0x3491b0['attributes'][_0x5f67('0x2f')]?_0x3491b0[_0x5f67('0x2d')]:_0xd36b79[_0x5f67('0x28')];if(_0x32830d[_0x5f67('0x2b')][_0x5f67('0x30')]){_0x3491b0[_0x5f67('0x31')]=[{'all':!![]}];}_0x3491b0=_['merge']({},_0x3491b0,_0x32830d[_0x5f67('0x32')]);return db[_0x5f67('0x33')][_0x5f67('0x34')](_0x3491b0)[_0x5f67('0x22')](handleEntityNotFound(_0x5dd8d7,null))[_0x5f67('0x22')](respondWithResult(_0x5dd8d7,null))[_0x5f67('0x35')](handleError(_0x5dd8d7,null));};exports['create']=function(_0x3fbcc9,_0xdfdb8b){return db['ChatProactiveAction'][_0x5f67('0x36')](_0x3fbcc9[_0x5f67('0x37')],{})[_0x5f67('0x22')](respondWithResult(_0xdfdb8b,0xc9))[_0x5f67('0x35')](handleError(_0xdfdb8b,null));};exports[_0x5f67('0x21')]=function(_0x314d14,_0x2fa4ad){if(_0x314d14[_0x5f67('0x37')]['id']){delete _0x314d14[_0x5f67('0x37')]['id'];}return db[_0x5f67('0x33')][_0x5f67('0x34')]({'where':{'id':_0x314d14['params']['id']}})[_0x5f67('0x22')](handleEntityNotFound(_0x2fa4ad,null))[_0x5f67('0x22')](saveUpdates(_0x314d14[_0x5f67('0x37')],null))['then'](respondWithResult(_0x2fa4ad,null))[_0x5f67('0x35')](handleError(_0x2fa4ad,null));};exports[_0x5f67('0x23')]=function(_0x1404d1,_0x2ad244){return db[_0x5f67('0x33')][_0x5f67('0x34')]({'where':{'id':_0x1404d1[_0x5f67('0x38')]['id']}})[_0x5f67('0x22')](handleEntityNotFound(_0x2ad244,null))[_0x5f67('0x22')](removeEntity(_0x2ad244,null))['catch'](handleError(_0x2ad244,null));};
\ No newline at end of file
+var _0xf873=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','show','params','model','keys','ChatProactiveAction','query','filters','attributes','intersection','fields','length','includeAll','include','merge','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2bb276,_0x2a28f1){var _0x1ea21c=function(_0x1153ba){while(--_0x1153ba){_0x2bb276['push'](_0x2bb276['shift']());}};_0x1ea21c(++_0x2a28f1);}(_0xf873,0xb2));var _0x3f87=function(_0x5cc5d7,_0x5da756){_0x5cc5d7=_0x5cc5d7-0x0;var _0x47633f=_0xf873[_0x5cc5d7];return _0x47633f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f87('0x0'));var zipdir=require(_0x3f87('0x1'));var jsonpatch=require(_0x3f87('0x2'));var rp=require(_0x3f87('0x3'));var moment=require(_0x3f87('0x4'));var BPromise=require(_0x3f87('0x5'));var Mustache=require(_0x3f87('0x6'));var util=require(_0x3f87('0x7'));var path=require(_0x3f87('0x8'));var sox=require('sox');var csv=require(_0x3f87('0x9'));var ejs=require(_0x3f87('0xa'));var fs=require('fs');var fs_extra=require(_0x3f87('0xb'));var _=require('lodash');var squel=require(_0x3f87('0xc'));var crypto=require(_0x3f87('0xd'));var jsforce=require(_0x3f87('0xe'));var deskjs=require(_0x3f87('0xf'));var toCsv=require(_0x3f87('0x9'));var querystring=require(_0x3f87('0x10'));var Papa=require('papaparse');var Redis=require(_0x3f87('0x11'));var authService=require(_0x3f87('0x12'));var qs=require(_0x3f87('0x13'));var as=require(_0x3f87('0x14'));var hardwareService=require(_0x3f87('0x15'));var logger=require(_0x3f87('0x16'))(_0x3f87('0x17'));var utils=require(_0x3f87('0x18'));var config=require(_0x3f87('0x19'));var licenseUtil=require(_0x3f87('0x1a'));var db=require(_0x3f87('0x1b'))['db'];function respondWithStatusCode(_0x593e9,_0xfd5b65){_0xfd5b65=_0xfd5b65||0xcc;return function(_0x160861){if(_0x160861){return _0x593e9['sendStatus'](_0xfd5b65);}return _0x593e9[_0x3f87('0x1c')](_0xfd5b65)[_0x3f87('0x1d')]();};}function respondWithResult(_0x4ea5c1,_0x1cfba3){_0x1cfba3=_0x1cfba3||0xc8;return function(_0x14324f){if(_0x14324f){return _0x4ea5c1[_0x3f87('0x1c')](_0x1cfba3)[_0x3f87('0x1e')](_0x14324f);}};}function respondWithFilteredResult(_0x3f192a,_0x1c8fb0){return function(_0xd6df66){if(_0xd6df66){var _0x2ccf4d=typeof _0x1c8fb0['offset']===_0x3f87('0x1f')&&typeof _0x1c8fb0[_0x3f87('0x20')]===_0x3f87('0x1f');var _0x4e1df8=_0xd6df66[_0x3f87('0x21')];var _0x56d79e=_0x2ccf4d?0x0:_0x1c8fb0[_0x3f87('0x22')];var _0x13550c=_0x2ccf4d?_0xd6df66[_0x3f87('0x21')]:_0x1c8fb0[_0x3f87('0x22')]+_0x1c8fb0[_0x3f87('0x20')];var _0x4fe75c;if(_0x13550c>=_0x4e1df8){_0x13550c=_0x4e1df8;_0x4fe75c=0xc8;}else{_0x4fe75c=0xce;}_0x3f192a[_0x3f87('0x1c')](_0x4fe75c);return _0x3f192a[_0x3f87('0x23')](_0x3f87('0x24'),_0x56d79e+'-'+_0x13550c+'/'+_0x4e1df8)[_0x3f87('0x1e')](_0xd6df66);}return null;};}function patchUpdates(_0x57f7c5){return function(_0x4acd30){try{jsonpatch['apply'](_0x4acd30,_0x57f7c5,!![]);}catch(_0x73aba6){return BPromise[_0x3f87('0x25')](_0x73aba6);}return _0x4acd30[_0x3f87('0x26')]();};}function saveUpdates(_0x5ed5f1,_0x17e411){return function(_0xb01673){if(_0xb01673){return _0xb01673[_0x3f87('0x27')](_0x5ed5f1)[_0x3f87('0x28')](function(_0x15fad7){return _0x15fad7;});}return null;};}function removeEntity(_0x46d773,_0x30b061){return function(_0xea7dda){if(_0xea7dda){return _0xea7dda[_0x3f87('0x29')]()[_0x3f87('0x28')](function(){_0x46d773[_0x3f87('0x1c')](0xcc)[_0x3f87('0x1d')]();});}};}function handleEntityNotFound(_0x5ca13a,_0x3d03d7){return function(_0x9ed827){if(!_0x9ed827){_0x5ca13a[_0x3f87('0x2a')](0x194);}return _0x9ed827;};}function handleError(_0x5922e9,_0x49674f){_0x49674f=_0x49674f||0x1f4;return function(_0x41f9e9){logger[_0x3f87('0x2b')](_0x41f9e9[_0x3f87('0x2c')]);if(_0x41f9e9[_0x3f87('0x2d')]){delete _0x41f9e9[_0x3f87('0x2d')];}_0x5922e9[_0x3f87('0x1c')](_0x49674f)[_0x3f87('0x2e')](_0x41f9e9);};}exports[_0x3f87('0x2f')]=function(_0x113e40,_0x2e18cb){var _0x43576d={'raw':!![],'where':{'id':_0x113e40[_0x3f87('0x30')]['id']}},_0x407828={};_0x407828[_0x3f87('0x31')]=_[_0x3f87('0x32')](db[_0x3f87('0x33')]['rawAttributes']);_0x407828[_0x3f87('0x34')]=_[_0x3f87('0x32')](_0x113e40[_0x3f87('0x34')]);_0x407828[_0x3f87('0x35')]=_['intersection'](_0x407828['model'],_0x407828['query']);_0x43576d[_0x3f87('0x36')]=_[_0x3f87('0x37')](_0x407828[_0x3f87('0x31')],qs[_0x3f87('0x38')](_0x113e40[_0x3f87('0x34')]['fields']));_0x43576d[_0x3f87('0x36')]=_0x43576d['attributes'][_0x3f87('0x39')]?_0x43576d[_0x3f87('0x36')]:_0x407828[_0x3f87('0x31')];if(_0x113e40[_0x3f87('0x34')][_0x3f87('0x3a')]){_0x43576d[_0x3f87('0x3b')]=[{'all':!![]}];}_0x43576d=_[_0x3f87('0x3c')]({},_0x43576d,_0x113e40['options']);return db['ChatProactiveAction'][_0x3f87('0x3d')](_0x43576d)[_0x3f87('0x28')](handleEntityNotFound(_0x2e18cb,null))[_0x3f87('0x28')](respondWithResult(_0x2e18cb,null))[_0x3f87('0x3e')](handleError(_0x2e18cb,null));};exports[_0x3f87('0x3f')]=function(_0x1068c4,_0x24bd09){return db['ChatProactiveAction'][_0x3f87('0x3f')](_0x1068c4['body'],{})[_0x3f87('0x28')](respondWithResult(_0x24bd09,0xc9))[_0x3f87('0x3e')](handleError(_0x24bd09,null));};exports[_0x3f87('0x27')]=function(_0x2d8399,_0x51a33d){if(_0x2d8399[_0x3f87('0x40')]['id']){delete _0x2d8399['body']['id'];}return db[_0x3f87('0x33')][_0x3f87('0x3d')]({'where':{'id':_0x2d8399[_0x3f87('0x30')]['id']}})[_0x3f87('0x28')](handleEntityNotFound(_0x51a33d,null))[_0x3f87('0x28')](saveUpdates(_0x2d8399['body'],null))['then'](respondWithResult(_0x51a33d,null))['catch'](handleError(_0x51a33d,null));};exports[_0x3f87('0x29')]=function(_0x1ca9be,_0x33c9f5){return db[_0x3f87('0x33')][_0x3f87('0x3d')]({'where':{'id':_0x1ca9be[_0x3f87('0x30')]['id']}})['then'](handleEntityNotFound(_0x33c9f5,null))[_0x3f87('0x28')](removeEntity(_0x33c9f5,null))['catch'](handleError(_0x33c9f5,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 7ab5820..c93a8e2 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.model.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9c10=['ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x27638d,_0x4094db){var _0x35da35=function(_0x538095){while(--_0x538095){_0x27638d['push'](_0x27638d['shift']());}};_0x35da35(++_0x4094db);}(_0x9c10,0x86));var _0x09c1=function(_0x6a6e6b,_0x2b90fc){_0x6a6e6b=_0x6a6e6b-0x0;var _0x5156a0=_0x9c10[_0x6a6e6b];return _0x5156a0;};'use strict';var _=require('lodash');var util=require(_0x09c1('0x0'));var logger=require(_0x09c1('0x1'))(_0x09c1('0x2'));var moment=require(_0x09c1('0x3'));var BPromise=require(_0x09c1('0x4'));var rp=require(_0x09c1('0x5'));var fs=require('fs');var path=require(_0x09c1('0x6'));var rimraf=require('rimraf');var config=require(_0x09c1('0x7'));var attributes=require(_0x09c1('0x8'));module[_0x09c1('0x9')]=function(_0xac3486,_0x437da9){return _0xac3486['define'](_0x09c1('0xa'),attributes,{'tableName':_0x09c1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb026=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x5b0809,_0x1fda75){var _0x9ad03f=function(_0x1fb3a6){while(--_0x1fb3a6){_0x5b0809['push'](_0x5b0809['shift']());}};_0x9ad03f(++_0x1fda75);}(_0xb026,0xc4));var _0x6b02=function(_0x295bc0,_0x1903af){_0x295bc0=_0x295bc0-0x0;var _0x300115=_0xb026[_0x295bc0];return _0x300115;};'use strict';var _=require(_0x6b02('0x0'));var util=require(_0x6b02('0x1'));var logger=require('../../config/logger')(_0x6b02('0x2'));var moment=require(_0x6b02('0x3'));var BPromise=require(_0x6b02('0x4'));var rp=require(_0x6b02('0x5'));var fs=require('fs');var path=require(_0x6b02('0x6'));var rimraf=require(_0x6b02('0x7'));var config=require(_0x6b02('0x8'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x3c9e58,_0x37adf8){return _0x3c9e58['define'](_0x6b02('0x9'),attributes,{'tableName':_0x6b02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index f6bae02..e1c983f 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e05=['then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x3e05,0xe4));var _0x53e0=function(_0x4d3c56,_0x271236){_0x4d3c56=_0x4d3c56-0x0;var _0x18774d=_0x3e05[_0x4d3c56];return _0x18774d;};'use strict';var _=require(_0x53e0('0x0'));var util=require(_0x53e0('0x1'));var moment=require(_0x53e0('0x2'));var BPromise=require(_0x53e0('0x3'));var rs=require(_0x53e0('0x4'));var fs=require('fs');var Redis=require(_0x53e0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x53e0('0x6'));var logger=require(_0x53e0('0x7'))(_0x53e0('0x8'));var config=require('../../config/environment');var jayson=require(_0x53e0('0x9'));var client=jayson[_0x53e0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36747,_0x2cf940,_0x2d9c45){return new BPromise(function(_0x5e2b2f,_0x18822e){return client[_0x53e0('0xb')](_0x36747,_0x2d9c45)[_0x53e0('0xc')](function(_0x548a21){logger['info'](_0x53e0('0xd'),_0x2cf940,_0x53e0('0xe'));logger[_0x53e0('0xf')](_0x53e0('0x10'),_0x2cf940,'request\x20sent',JSON[_0x53e0('0x11')](_0x548a21));if(_0x548a21[_0x53e0('0x12')]){if(_0x548a21[_0x53e0('0x12')][_0x53e0('0x13')]===0x1f4){logger['error'](_0x53e0('0xd'),_0x2cf940,_0x548a21[_0x53e0('0x12')][_0x53e0('0x14')]);return _0x18822e(_0x548a21[_0x53e0('0x12')][_0x53e0('0x14')]);}logger[_0x53e0('0x12')](_0x53e0('0xd'),_0x2cf940,_0x548a21[_0x53e0('0x12')]['message']);return _0x5e2b2f(_0x548a21[_0x53e0('0x12')][_0x53e0('0x14')]);}else{logger[_0x53e0('0x15')](_0x53e0('0xd'),_0x2cf940,_0x53e0('0xe'));_0x5e2b2f(_0x548a21[_0x53e0('0x16')][_0x53e0('0x14')]);}})[_0x53e0('0x17')](function(_0x2a670f){logger[_0x53e0('0x12')](_0x53e0('0xd'),_0x2cf940,_0x2a670f);_0x18822e(_0x2a670f);});});}
\ No newline at end of file
+var _0x7d53=['error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3d674e,_0xd9d99d){var _0x176e07=function(_0x5cdd85){while(--_0x5cdd85){_0x3d674e['push'](_0x3d674e['shift']());}};_0x176e07(++_0xd9d99d);}(_0x7d53,0x11d));var _0x37d5=function(_0x64e142,_0x65a222){_0x64e142=_0x64e142-0x0;var _0x604964=_0x7d53[_0x64e142];return _0x604964;};'use strict';var _=require('lodash');var util=require(_0x37d5('0x0'));var moment=require('moment');var BPromise=require(_0x37d5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37d5('0x2'));var db=require(_0x37d5('0x3'))['db'];var utils=require(_0x37d5('0x4'));var logger=require(_0x37d5('0x5'))('rpc');var config=require(_0x37d5('0x6'));var jayson=require(_0x37d5('0x7'));var client=jayson[_0x37d5('0x8')][_0x37d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x202fec,_0x29f52e,_0x4fa898){return new BPromise(function(_0x3b103d,_0x471181){return client['request'](_0x202fec,_0x4fa898)['then'](function(_0x248f00){logger[_0x37d5('0xa')](_0x37d5('0xb'),_0x29f52e,_0x37d5('0xc'));logger['debug'](_0x37d5('0xd'),_0x29f52e,'request\x20sent',JSON[_0x37d5('0xe')](_0x248f00));if(_0x248f00['error']){if(_0x248f00[_0x37d5('0xf')][_0x37d5('0x10')]===0x1f4){logger[_0x37d5('0xf')](_0x37d5('0xb'),_0x29f52e,_0x248f00['error']['message']);return _0x471181(_0x248f00['error']['message']);}logger[_0x37d5('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x29f52e,_0x248f00[_0x37d5('0xf')][_0x37d5('0x11')]);return _0x3b103d(_0x248f00[_0x37d5('0xf')]['message']);}else{logger['info'](_0x37d5('0xb'),_0x29f52e,_0x37d5('0xc'));_0x3b103d(_0x248f00[_0x37d5('0x12')][_0x37d5('0x11')]);}})[_0x37d5('0x13')](function(_0x353995){logger[_0x37d5('0xf')](_0x37d5('0xb'),_0x29f52e,_0x353995);_0x471181(_0x353995);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 29dbac7..e4917f7 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6f47=['show','post','create','put','/:id','update','destroy','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated'];(function(_0x53f7e3,_0x2da312){var _0x278b2e=function(_0x3bca21){while(--_0x3bca21){_0x53f7e3['push'](_0x53f7e3['shift']());}};_0x278b2e(++_0x2da312);}(_0x6f47,0xc7));var _0x76f4=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x6f47[_0x9fd887];return _0x1a54ab;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0x9')]);router[_0x76f4('0xa')]('/',auth['isAuthenticated'](),controller[_0x76f4('0xb')]);router[_0x76f4('0xc')](_0x76f4('0xd'),auth[_0x76f4('0x8')](),controller[_0x76f4('0xe')]);router['delete']('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x7dfd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x479ab3,_0x764ba){var _0x4e00c3=function(_0x3e3796){while(--_0x3e3796){_0x479ab3['push'](_0x479ab3['shift']());}};_0x4e00c3(++_0x764ba);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0xe')]);router[_0xd7df('0xf')]('/',auth[_0xd7df('0xd')](),controller['create']);router[_0xd7df('0x10')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0x11')]);router['delete'](_0xd7df('0xc'),auth['isAuthenticated'](),controller[_0xd7df('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index ee71f6c..ba8420c 100644
--- a/server/api/chatQueue/chatQueue.attributes.js
+++ b/server/api/chatQueue/chatQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xce90=['sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xce90,0xcf));var _0x0ce9=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xce90[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0x0ce9('0x0'));module[_0x0ce9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0ce9('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0ce9('0x3')]},'timeout':{'type':Sequelize[_0x0ce9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0ce9('0x5')](_0x0ce9('0x6'),_0x0ce9('0x7'),_0x0ce9('0x8'))}};
\ No newline at end of file
+var _0x4a3e=['rrmemory','roundrobin','exports','STRING','INTEGER'];(function(_0xf7b88a,_0x12c26c){var _0x286494=function(_0x22c311){while(--_0x22c311){_0xf7b88a['push'](_0xf7b88a['shift']());}};_0x286494(++_0x12c26c);}(_0x4a3e,0x1ba));var _0xe4a3=function(_0x156aef,_0x5a1d12){_0x156aef=_0x156aef-0x0;var _0x27e9d8=_0x4a3e[_0x156aef];return _0x27e9d8;};'use strict';var Sequelize=require('sequelize');module[_0xe4a3('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe4a3('0x1')]},'timeout':{'type':Sequelize[_0xe4a3('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe4a3('0x3'),'beepall',_0xe4a3('0x4'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index df06592..c2ab6a4 100644
--- a/server/api/chatQueue/chatQueue.controller.js
+++ b/server/api/chatQueue/chatQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf44b=['sendStatus','status','json','offset','limit','count','set','apply','save','then','destroy','get','ChatQueues','UserProfileResource','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ChatQueue','findAll','rows','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','hasOwnProperty','nolimit','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','removeAgents','addAgents','omit','spread','userChatQueue:save','isArray','userChatQueue:remove','order','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4cf21f,_0x23fb62){var _0x4f9b6=function(_0x5534c7){while(--_0x5534c7){_0x4cf21f['push'](_0x4cf21f['shift']());}};_0x4f9b6(++_0x23fb62);}(_0xf44b,0x196));var _0xbf44=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf44b[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xbf44('0x0'));var rimraf=require(_0xbf44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf44('0x2'));var rp=require(_0xbf44('0x3'));var moment=require(_0xbf44('0x4'));var BPromise=require(_0xbf44('0x5'));var Mustache=require(_0xbf44('0x6'));var util=require('util');var path=require(_0xbf44('0x7'));var sox=require(_0xbf44('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf44('0x9'));var _=require(_0xbf44('0xa'));var squel=require(_0xbf44('0xb'));var crypto=require(_0xbf44('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbf44('0xd'));var Redis=require(_0xbf44('0xe'));var authService=require(_0xbf44('0xf'));var qs=require(_0xbf44('0x10'));var as=require(_0xbf44('0x11'));var hardwareService=require(_0xbf44('0x12'));var logger=require(_0xbf44('0x13'))(_0xbf44('0x14'));var utils=require(_0xbf44('0x15'));var config=require(_0xbf44('0x16'));var licenseUtil=require(_0xbf44('0x17'));var db=require(_0xbf44('0x18'))['db'];config[_0xbf44('0x19')]=_[_0xbf44('0x1a')](config[_0xbf44('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xbf44('0x1b'))(new Redis(config['redis']));require(_0xbf44('0x1c'))['register'](socket);var jayson=require(_0xbf44('0x1d'));var client=jayson[_0xbf44('0x1e')][_0xbf44('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3c61c7,_0x2b5706,_0x190410,_0x3f6590){return new BPromise(function(_0x40474a,_0x53a9cd){var _0x5b58cc=_0x3f6590||client;return _0x5b58cc[_0xbf44('0x20')](_0x3c61c7,_0x190410)['then'](function(_0x31d8e4){logger[_0xbf44('0x21')](_0xbf44('0x22'),_0x2b5706,'request\x20sent');logger[_0xbf44('0x23')](_0xbf44('0x24'),_0x2b5706,_0xbf44('0x25'),JSON[_0xbf44('0x26')](_0x31d8e4));if(_0x31d8e4['error']){if(_0x31d8e4[_0xbf44('0x27')][_0xbf44('0x28')]===0x1f4){logger[_0xbf44('0x27')]('ChatQueue,\x20%s,\x20%s',_0x2b5706,_0x31d8e4[_0xbf44('0x27')][_0xbf44('0x29')]);return _0x53a9cd(_0x31d8e4['error'][_0xbf44('0x29')]);}logger[_0xbf44('0x27')](_0xbf44('0x22'),_0x2b5706,_0x31d8e4[_0xbf44('0x27')][_0xbf44('0x29')]);return _0x40474a(_0x31d8e4[_0xbf44('0x27')][_0xbf44('0x29')]);}else{logger[_0xbf44('0x21')](_0xbf44('0x22'),_0x2b5706,_0xbf44('0x25'));_0x40474a(_0x31d8e4[_0xbf44('0x2a')]['message']);}})[_0xbf44('0x2b')](function(_0xb2f366){logger[_0xbf44('0x27')](_0xbf44('0x22'),_0x2b5706,_0xb2f366);_0x53a9cd(_0xb2f366);});});}function respondWithStatusCode(_0x1b8798,_0x302a46){_0x302a46=_0x302a46||0xcc;return function(_0x2ca476){if(_0x2ca476){return _0x1b8798[_0xbf44('0x2c')](_0x302a46);}return _0x1b8798['status'](_0x302a46)['end']();};}function respondWithResult(_0x590b1e,_0x1c907e){_0x1c907e=_0x1c907e||0xc8;return function(_0x34f9fd){if(_0x34f9fd){return _0x590b1e[_0xbf44('0x2d')](_0x1c907e)[_0xbf44('0x2e')](_0x34f9fd);}};}function respondWithFilteredResult(_0x40d7cb,_0x36c111){return function(_0x7996aa){if(_0x7996aa){var _0x4f6b6c=typeof _0x36c111[_0xbf44('0x2f')]==='undefined'&&typeof _0x36c111[_0xbf44('0x30')]==='undefined';var _0x4fadf5=_0x7996aa[_0xbf44('0x31')];var _0x2e02c3=_0x4f6b6c?0x0:_0x36c111[_0xbf44('0x2f')];var _0x5839d9=_0x4f6b6c?_0x7996aa[_0xbf44('0x31')]:_0x36c111[_0xbf44('0x2f')]+_0x36c111['limit'];var _0x52de24;if(_0x5839d9>=_0x4fadf5){_0x5839d9=_0x4fadf5;_0x52de24=0xc8;}else{_0x52de24=0xce;}_0x40d7cb[_0xbf44('0x2d')](_0x52de24);return _0x40d7cb[_0xbf44('0x32')]('Content-Range',_0x2e02c3+'-'+_0x5839d9+'/'+_0x4fadf5)[_0xbf44('0x2e')](_0x7996aa);}return null;};}function patchUpdates(_0x3943a5){return function(_0x285827){try{jsonpatch[_0xbf44('0x33')](_0x285827,_0x3943a5,!![]);}catch(_0x3e2ee4){return BPromise['reject'](_0x3e2ee4);}return _0x285827[_0xbf44('0x34')]();};}function saveUpdates(_0x298821,_0x5d5258){return function(_0x700c0a){if(_0x700c0a){return _0x700c0a['update'](_0x298821)[_0xbf44('0x35')](function(_0x47e524){return _0x47e524;});}return null;};}function removeEntity(_0x5c32d9,_0x541907){return function(_0x453153){if(_0x453153){return _0x453153[_0xbf44('0x36')]()[_0xbf44('0x35')](function(){var _0xcbf3d7=_0x453153[_0xbf44('0x37')]({'plain':!![]});var _0x2f4722=_0xbf44('0x38');return db[_0xbf44('0x39')][_0xbf44('0x36')]({'where':{'type':_0x2f4722,'resourceId':_0xcbf3d7['id']}})[_0xbf44('0x35')](function(){return _0x453153;});})[_0xbf44('0x35')](function(){_0x5c32d9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26f939,_0x181742){return function(_0x376cfb){if(!_0x376cfb){_0x26f939['sendStatus'](0x194);}return _0x376cfb;};}function handleError(_0x2af59a,_0xb0631f){_0xb0631f=_0xb0631f||0x1f4;return function(_0x2b8bb3){logger['error'](_0x2b8bb3[_0xbf44('0x3a')]);if(_0x2b8bb3[_0xbf44('0x3b')]){delete _0x2b8bb3['name'];}_0x2af59a['status'](_0xb0631f)['send'](_0x2b8bb3);};}exports['index']=function(_0x3be2d3,_0x351b70){var _0x342de9={},_0x51d8f5={},_0x23cba8={'count':0x0,'rows':[]};var _0x483e9e=_[_0xbf44('0x3c')](db['ChatQueue'][_0xbf44('0x3d')],function(_0x3a86f7){return{'name':_0x3a86f7[_0xbf44('0x3e')],'type':_0x3a86f7[_0xbf44('0x3f')][_0xbf44('0x40')]};});_0x51d8f5['model']=_[_0xbf44('0x3c')](_0x483e9e,_0xbf44('0x3b'));_0x51d8f5[_0xbf44('0x41')]=_[_0xbf44('0x42')](_0x3be2d3[_0xbf44('0x41')]);_0x51d8f5[_0xbf44('0x43')]=_[_0xbf44('0x44')](_0x51d8f5[_0xbf44('0x45')],_0x51d8f5[_0xbf44('0x41')]);_0x342de9[_0xbf44('0x46')]=_[_0xbf44('0x44')](_0x51d8f5['model'],qs[_0xbf44('0x47')](_0x3be2d3[_0xbf44('0x41')][_0xbf44('0x47')]));_0x342de9[_0xbf44('0x46')]=_0x342de9['attributes'][_0xbf44('0x48')]?_0x342de9['attributes']:_0x51d8f5[_0xbf44('0x45')];if(!_0x3be2d3['query']['hasOwnProperty']('nolimit')){_0x342de9['limit']=qs[_0xbf44('0x30')](_0x3be2d3['query']['limit']);_0x342de9[_0xbf44('0x2f')]=qs[_0xbf44('0x2f')](_0x3be2d3[_0xbf44('0x41')]['offset']);}_0x342de9['order']=qs['sort'](_0x3be2d3[_0xbf44('0x41')][_0xbf44('0x49')]);_0x342de9[_0xbf44('0x4a')]=qs['filters'](_[_0xbf44('0x4b')](_0x3be2d3[_0xbf44('0x41')],_0x51d8f5[_0xbf44('0x43')]),_0x483e9e);if(_0x3be2d3[_0xbf44('0x41')][_0xbf44('0x4c')]){_0x342de9[_0xbf44('0x4a')]=_[_0xbf44('0x4d')](_0x342de9[_0xbf44('0x4a')],{'$or':_['map'](_0x483e9e,function(_0x452b87){if(_0x452b87[_0xbf44('0x3f')]!==_0xbf44('0x4e')){var _0x32b6e3={};_0x32b6e3[_0x452b87['name']]={'$like':'%'+_0x3be2d3[_0xbf44('0x41')]['filter']+'%'};return _0x32b6e3;}})});}_0x342de9=_[_0xbf44('0x4d')]({},_0x342de9,_0x3be2d3[_0xbf44('0x4f')]);var _0xb7842e={'where':_0x342de9[_0xbf44('0x4a')]};return db['ChatQueue'][_0xbf44('0x31')](_0xb7842e)[_0xbf44('0x35')](function(_0x39db69){_0x23cba8['count']=_0x39db69;if(_0x3be2d3['query'][_0xbf44('0x50')]){_0x342de9[_0xbf44('0x51')]=[{'all':!![]}];}return db[_0xbf44('0x52')][_0xbf44('0x53')](_0x342de9);})[_0xbf44('0x35')](function(_0x4ce3b7){_0x23cba8[_0xbf44('0x54')]=_0x4ce3b7;return _0x23cba8;})[_0xbf44('0x35')](respondWithFilteredResult(_0x351b70,_0x342de9))[_0xbf44('0x2b')](handleError(_0x351b70,null));};exports[_0xbf44('0x55')]=function(_0x33e696,_0x34ba1c){var _0x3b71da={'raw':!![],'where':{'id':_0x33e696[_0xbf44('0x56')]['id']}},_0x40d571={};_0x40d571[_0xbf44('0x45')]=_[_0xbf44('0x42')](db[_0xbf44('0x52')][_0xbf44('0x3d')]);_0x40d571[_0xbf44('0x41')]=_[_0xbf44('0x42')](_0x33e696[_0xbf44('0x41')]);_0x40d571[_0xbf44('0x43')]=_[_0xbf44('0x44')](_0x40d571['model'],_0x40d571[_0xbf44('0x41')]);_0x3b71da['attributes']=_[_0xbf44('0x44')](_0x40d571[_0xbf44('0x45')],qs['fields'](_0x33e696['query'][_0xbf44('0x47')]));_0x3b71da['attributes']=_0x3b71da['attributes']['length']?_0x3b71da[_0xbf44('0x46')]:_0x40d571['model'];if(_0x33e696[_0xbf44('0x41')]['includeAll']){_0x3b71da[_0xbf44('0x51')]=[{'all':!![]}];}_0x3b71da=_[_0xbf44('0x4d')]({},_0x3b71da,_0x33e696['options']);return db[_0xbf44('0x52')][_0xbf44('0x57')](_0x3b71da)['then'](handleEntityNotFound(_0x34ba1c,null))[_0xbf44('0x35')](respondWithResult(_0x34ba1c,null))[_0xbf44('0x2b')](handleError(_0x34ba1c,null));};exports['create']=function(_0x26526a,_0x44958a){return db[_0xbf44('0x52')]['create'](_0x26526a[_0xbf44('0x58')],{})[_0xbf44('0x35')](function(_0x2668c3){var _0x24034b=_0x26526a[_0xbf44('0x59')]['get']({'plain':!![]});if(!_0x24034b)throw new Error(_0xbf44('0x5a'));if(_0x24034b[_0xbf44('0x5b')]==='user'){var _0x281bfa=_0x2668c3[_0xbf44('0x37')]({'plain':!![]});var _0x1e1a61='ChatQueues';return db[_0xbf44('0x5c')][_0xbf44('0x57')]({'where':{'name':_0x1e1a61,'userProfileId':_0x24034b[_0xbf44('0x5d')]},'raw':!![]})['then'](function(_0xb06181){if(_0xb06181&&_0xb06181['autoAssociation']===0x0){return db[_0xbf44('0x39')]['create']({'name':_0x281bfa[_0xbf44('0x3b')],'resourceId':_0x281bfa['id'],'type':_0xb06181['name'],'sectionId':_0xb06181['id']},{})['then'](function(){return _0x2668c3;});}else{return _0x2668c3;}})[_0xbf44('0x2b')](function(_0x1b9a25){logger[_0xbf44('0x27')](_0xbf44('0x5e'),_0x1b9a25);throw _0x1b9a25;});}return _0x2668c3;})[_0xbf44('0x35')](respondWithResult(_0x44958a,0xc9))['catch'](handleError(_0x44958a,null));};exports[_0xbf44('0x5f')]=function(_0x1b1159,_0x37ad9a){if(_0x1b1159['body']['id']){delete _0x1b1159['body']['id'];}return db[_0xbf44('0x52')]['find']({'where':{'id':_0x1b1159[_0xbf44('0x56')]['id']}})[_0xbf44('0x35')](handleEntityNotFound(_0x37ad9a,null))[_0xbf44('0x35')](saveUpdates(_0x1b1159['body'],null))[_0xbf44('0x35')](respondWithResult(_0x37ad9a,null))[_0xbf44('0x2b')](handleError(_0x37ad9a,null));};exports[_0xbf44('0x36')]=function(_0x438dd1,_0x35e6d3){return db[_0xbf44('0x52')][_0xbf44('0x57')]({'where':{'id':_0x438dd1['params']['id']}})[_0xbf44('0x35')](handleEntityNotFound(_0x35e6d3,null))[_0xbf44('0x35')](removeEntity(_0x35e6d3,null))[_0xbf44('0x2b')](handleError(_0x35e6d3,null));};exports[_0xbf44('0x60')]=function(_0x34d5d5,_0x360edb){return db[_0xbf44('0x52')][_0xbf44('0x60')]()[_0xbf44('0x35')](respondWithResult(_0x360edb,null))['catch'](handleError(_0x360edb,null));};exports['getMembers']=function(_0x23362d,_0x33520f,_0x8f9904){var _0x59d402={'raw':!![],'where':{}},_0x143c16={},_0x3328b2;return db[_0xbf44('0x52')][_0xbf44('0x61')]({'where':{'id':_0x23362d['params']['id']}})['then'](handleEntityNotFound(_0x33520f,null))[_0xbf44('0x35')](function(_0x5440d5){if(_0x5440d5){_0x3328b2=_0x5440d5['get']({'plain':!![]});_0x143c16[_0xbf44('0x45')]=_[_0xbf44('0x42')](db[_0xbf44('0x62')][_0xbf44('0x3d')]);_0x143c16[_0xbf44('0x41')]=_['keys'](_0x23362d[_0xbf44('0x41')]);_0x143c16[_0xbf44('0x43')]=_[_0xbf44('0x44')](_0x143c16[_0xbf44('0x45')],_0x143c16['query']);_0x59d402[_0xbf44('0x46')]=_[_0xbf44('0x44')](_0x143c16['model'],qs[_0xbf44('0x47')](_0x23362d['query'][_0xbf44('0x47')]));_0x59d402['attributes']=_0x59d402[_0xbf44('0x46')]['length']?_0x59d402[_0xbf44('0x46')]:_0x143c16[_0xbf44('0x45')];if(!_0x23362d[_0xbf44('0x41')][_0xbf44('0x63')](_0xbf44('0x64'))){_0x59d402[_0xbf44('0x30')]=qs[_0xbf44('0x30')](_0x23362d[_0xbf44('0x41')]['limit']);_0x59d402[_0xbf44('0x2f')]=qs['offset'](_0x23362d[_0xbf44('0x41')][_0xbf44('0x2f')]);}_0x59d402['order']=qs[_0xbf44('0x49')](_0x23362d[_0xbf44('0x41')][_0xbf44('0x49')]);_0x59d402[_0xbf44('0x4a')]=qs[_0xbf44('0x43')](_['pick'](_0x23362d[_0xbf44('0x41')],_0x143c16[_0xbf44('0x43')]));_0x59d402[_0xbf44('0x4a')]['ChatQueueId']=_0x5440d5['id'];if(_0x23362d[_0xbf44('0x41')][_0xbf44('0x4c')]){_0x59d402['where']=_[_0xbf44('0x4d')](_0x59d402[_0xbf44('0x4a')],{'$or':_[_0xbf44('0x3c')](_0x59d402[_0xbf44('0x46')],function(_0x1427c5){var _0x31c6e7={};_0x31c6e7[_0x1427c5]={'$like':'%'+_0x23362d['query'][_0xbf44('0x4c')]+'%'};return _0x31c6e7;})});}_0x59d402=_[_0xbf44('0x4d')]({},_0x59d402,_0x23362d[_0xbf44('0x4f')]);return db['UserChatQueue']['findAll'](_0x59d402);}})['then'](function(_0x4635aa){if(_0x4635aa){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x4635aa,_0xbf44('0x65')),'role':'agent'},'attributes':['id',_0xbf44('0x3b'),_0xbf44('0x66'),_0xbf44('0x67'),_0xbf44('0x68')]});}})['then'](function(_0x396215){if(_0x396215){return{'count':_0x396215[_0xbf44('0x31')],'rows':_['map'](_0x396215[_0xbf44('0x54')],function(_0x882f18){return{'membername':_0x882f18['name'],'UserId':_0x882f18['id'],'queue_name':_0x3328b2['name'],'ChatQueueId':_0x3328b2['id'],'interface':util[_0xbf44('0x69')](_0xbf44('0x6a'),_0xbf44('0x6b'),_0x882f18[_0xbf44('0x3b')]),'penalty':0x0,'paused':_0x882f18['chatPause'],'createdAt':_0x882f18['createdAt'],'updatedAt':_0x882f18[_0xbf44('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x33520f,_0x59d402))[_0xbf44('0x2b')](handleError(_0x33520f,null));};exports[_0xbf44('0x6c')]=function(_0x37a24d,_0x3cb32f,_0x3d289e){var _0x260f92={};var _0x32eb35={};var _0x1eac4f;var _0x4f13dc;return db[_0xbf44('0x52')]['findOne']({'where':{'id':_0x37a24d[_0xbf44('0x56')]['id']}})[_0xbf44('0x35')](handleEntityNotFound(_0x3cb32f,null))['then'](function(_0x36ca43){if(_0x36ca43){_0x1eac4f=_0x36ca43;_0x32eb35['model']=_['keys'](db[_0xbf44('0x6d')]['rawAttributes']);_0x32eb35[_0xbf44('0x41')]=_[_0xbf44('0x42')](_0x37a24d[_0xbf44('0x41')]);_0x32eb35[_0xbf44('0x43')]=_[_0xbf44('0x44')](_0x32eb35['model'],_0x32eb35[_0xbf44('0x41')]);_0x260f92[_0xbf44('0x46')]=_['intersection'](_0x32eb35['model'],qs[_0xbf44('0x47')](_0x37a24d[_0xbf44('0x41')][_0xbf44('0x47')]));_0x260f92[_0xbf44('0x46')]=_0x260f92[_0xbf44('0x46')][_0xbf44('0x48')]?_0x260f92['attributes']:_0x32eb35[_0xbf44('0x45')];_0x260f92['order']=qs['sort'](_0x37a24d[_0xbf44('0x41')][_0xbf44('0x49')]);_0x260f92[_0xbf44('0x4a')]=qs['filters'](_[_0xbf44('0x4b')](_0x37a24d[_0xbf44('0x41')],_0x32eb35[_0xbf44('0x43')]));if(_0x37a24d['query'][_0xbf44('0x4c')]){_0x260f92['where']=_[_0xbf44('0x4d')](_0x260f92['where'],{'$or':_[_0xbf44('0x3c')](_0x260f92[_0xbf44('0x46')],function(_0x39a4b9){var _0x39f5a0={};_0x39f5a0[_0x39a4b9]={'$like':'%'+_0x37a24d[_0xbf44('0x41')][_0xbf44('0x4c')]+'%'};return _0x39f5a0;})});}_0x260f92=_['merge']({},_0x260f92,_0x37a24d[_0xbf44('0x4f')]);return _0x1eac4f['getTeams'](_0x260f92);}})[_0xbf44('0x35')](function(_0x53d7ba){if(_0x53d7ba){_0x4f13dc=_0x53d7ba[_0xbf44('0x48')];if(!_0x37a24d[_0xbf44('0x41')][_0xbf44('0x63')](_0xbf44('0x64'))){_0x260f92['limit']=qs[_0xbf44('0x30')](_0x37a24d[_0xbf44('0x41')]['limit']);_0x260f92[_0xbf44('0x2f')]=qs[_0xbf44('0x2f')](_0x37a24d[_0xbf44('0x41')][_0xbf44('0x2f')]);}return _0x1eac4f[_0xbf44('0x6c')](_0x260f92);}})[_0xbf44('0x35')](function(_0x568908){if(_0x568908){return _0x568908?{'count':_0x4f13dc,'rows':_0x568908}:null;}})['then'](respondWithResult(_0x3cb32f,null))[_0xbf44('0x2b')](handleError(_0x3cb32f,null));};exports[_0xbf44('0x6e')]=function(_0x332d87,_0x4f1fcf,_0x3e19de){var _0x365579=_0x332d87[_0xbf44('0x58')][_0xbf44('0x6f')];return db[_0xbf44('0x6d')][_0xbf44('0x53')]({'where':{'id':_0x365579},'attributes':['id'],'include':[{'model':db[_0xbf44('0x70')],'as':'Agents','attributes':['id',_0xbf44('0x3b'),'online',_0xbf44('0x71'),_0xbf44('0x72')],'raw':!![]}]})[_0xbf44('0x35')](function(_0x50d361){if(_0x50d361){var _0x177c53=_[_0xbf44('0x73')](_0x50d361,function(_0x189619){var _0x5ed467=_0x189619['get']({'plain':!![]});return _0x5ed467[_0xbf44('0x74')];});return db[_0xbf44('0x52')]['find']({'where':{'id':_0x332d87[_0xbf44('0x56')]['id']}})[_0xbf44('0x35')](function(_0x47fa77){return db['sequelize'][_0xbf44('0x75')](function(_0x3c5d15){return _0x47fa77[_0xbf44('0x6e')](_0x365579,{'transaction':_0x3c5d15})[_0xbf44('0x35')](function(){return BPromise[_0xbf44('0x76')](_0x177c53,function(_0x23e209){return db[_0xbf44('0x62')][_0xbf44('0x77')]({'where':{'UserId':_0x23e209['id'],'ChatQueueId':_0x332d87['params']['id']},'transaction':_0x3c5d15});});})[_0xbf44('0x35')](function(){_0x177c53[_0xbf44('0x78')](function(_0x1c3d95){socket[_0xbf44('0x79')]('userChatQueue:save',{'UserId':_0x1c3d95['id'],'ChatQueueId':_0x47fa77['id']});});});});});}})[_0xbf44('0x35')](respondWithStatusCode(_0x4f1fcf,null))[_0xbf44('0x2b')](handleError(_0x4f1fcf,null));};exports[_0xbf44('0x7a')]=function(_0x580597,_0x6970e4,_0x2eb31d){return db[_0xbf44('0x6d')][_0xbf44('0x53')]({'where':{'id':_0x580597[_0xbf44('0x41')][_0xbf44('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xbf44('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x6970e4,null))[_0xbf44('0x35')](function(_0x3c855b){var _0x29fd73=_['map'](_0x3c855b,'id');var _0xa7b205=[];var _0x3348fd=[];var _0x46952a=squel[_0xbf44('0x7b')]();_0x46952a[_0xbf44('0x7c')](_0xbf44('0x7d'))[_0xbf44('0x7e')](_0xbf44('0x7f'),'tq')[_0xbf44('0x80')](_0xbf44('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbf44('0x4a')](_0xbf44('0x82'),_0x580597[_0xbf44('0x56')]['id']);for(var _0x4900e1=0x0;_0x4900e1<_0x3c855b['length'];_0x4900e1+=0x1){let _0x2bb580=_0x3c855b[_0x4900e1];for(var _0x1e1e34=0x0;_0x1e1e34<_0x2bb580[_0xbf44('0x74')][_0xbf44('0x48')];_0x1e1e34+=0x1){let _0xb42d7d=_0x2bb580['Agents'][_0x1e1e34];var _0x4afa2a=_0x46952a[_0xbf44('0x83')]();_0x4afa2a[_0xbf44('0x4a')](_0xbf44('0x84'),_0xb42d7d['id']);_0x3348fd['push'](db['sequelize'][_0xbf44('0x41')](_0x4afa2a[_0xbf44('0x85')](),{'type':db[_0xbf44('0x86')][_0xbf44('0x87')][_0xbf44('0x88')]})['then'](function(_0x550d6d){if(_0x550d6d[_0xbf44('0x48')]===0x1){return _0xb42d7d['id'];}else{var _0xfdaa26=_['every'](_[_0xbf44('0x3c')](_0x550d6d,_0xbf44('0x89')),function(_0x80f1e5){return _[_0xbf44('0x8a')](_0x29fd73,_0x80f1e5);});if(_0xfdaa26){return _0xb42d7d['id'];}}}));}}return BPromise[_0xbf44('0x8b')](_0x3348fd)['then'](function(_0x11d9b3){_0xa7b205=_(_0xa7b205)[_0xbf44('0x8c')](_0x11d9b3)['compact']()['value']();return db[_0xbf44('0x52')][_0xbf44('0x57')]({'where':{'id':_0x580597['params']['id']}})[_0xbf44('0x35')](function(_0x25c621){return db['sequelize']['transaction'](function(_0x178baf){return _0x25c621[_0xbf44('0x7a')](_0x580597['query'][_0xbf44('0x6f')],{'transaction':_0x178baf})['then'](function(){if(!_['isEmpty'](_0xa7b205)){return _0x25c621[_0xbf44('0x8d')](_0xa7b205,{'transaction':_0x178baf});}})[_0xbf44('0x35')](function(){_0xa7b205[_0xbf44('0x78')](function(_0xea056c){socket['emit']('userChatQueue:remove',{'UserId':_0xea056c,'ChatQueueId':_0x25c621['id']});});});});});});})[_0xbf44('0x35')](respondWithStatusCode(_0x6970e4,null))[_0xbf44('0x2b')](handleError(_0x6970e4,null));};exports[_0xbf44('0x8e')]=function(_0x17ef4b,_0x739938,_0x493fd4){return db[_0xbf44('0x52')][_0xbf44('0x57')]({'where':{'id':_0x17ef4b[_0xbf44('0x56')]['id']}})[_0xbf44('0x35')](handleEntityNotFound(_0x739938,null))[_0xbf44('0x35')](function(_0x38932d){if(_0x38932d){return _0x38932d[_0xbf44('0x8e')](_0x17ef4b['body'][_0xbf44('0x6f')],_[_0xbf44('0x8f')](_0x17ef4b[_0xbf44('0x58')],[_0xbf44('0x6f'),'id'])||{})[_0xbf44('0x90')](function(_0x1c131b){for(var _0x278d35=0x0;_0x278d35<_0x17ef4b[_0xbf44('0x58')][_0xbf44('0x6f')][_0xbf44('0x48')];_0x278d35+=0x1){socket[_0xbf44('0x79')](_0xbf44('0x91'),{'UserId':Number(_0x17ef4b[_0xbf44('0x58')]['ids'][_0x278d35]),'ChatQueueId':Number(_0x17ef4b[_0xbf44('0x56')]['id'])});}return _0x1c131b;});}})['then'](respondWithResult(_0x739938,null))[_0xbf44('0x2b')](handleError(_0x739938,null));};exports[_0xbf44('0x8d')]=function(_0x310b78,_0x596c74,_0x1e8aca){return db[_0xbf44('0x52')]['find']({'where':{'id':_0x310b78[_0xbf44('0x56')]['id']}})[_0xbf44('0x35')](handleEntityNotFound(_0x596c74,null))[_0xbf44('0x35')](function(_0x4770ad){if(_0x4770ad){return _0x4770ad[_0xbf44('0x8d')](_0x310b78[_0xbf44('0x41')][_0xbf44('0x6f')])[_0xbf44('0x35')](function(){if(_[_0xbf44('0x92')](_0x310b78[_0xbf44('0x41')][_0xbf44('0x6f')])){for(var _0x3450c0=0x0;_0x3450c0<_0x310b78[_0xbf44('0x41')]['ids']['length'];_0x3450c0+=0x1){socket[_0xbf44('0x79')](_0xbf44('0x93'),{'UserId':Number(_0x310b78[_0xbf44('0x41')]['ids'][_0x3450c0]),'ChatQueueId':Number(_0x310b78[_0xbf44('0x56')]['id'])});}}else{socket[_0xbf44('0x79')](_0xbf44('0x93'),{'UserId':Number(_0x310b78[_0xbf44('0x41')][_0xbf44('0x6f')]),'ChatQueueId':Number(_0x310b78[_0xbf44('0x56')]['id'])});}});}})[_0xbf44('0x35')](respondWithStatusCode(_0x596c74,null))[_0xbf44('0x2b')](handleError(_0x596c74,null));};exports['getAgents']=function(_0x384e99,_0x123f3a,_0x683219){var _0x16d5cf={};var _0xd40453={};var _0x1a56ce;var _0x53b700;return db[_0xbf44('0x52')]['findOne']({'where':{'id':_0x384e99[_0xbf44('0x56')]['id']}})[_0xbf44('0x35')](handleEntityNotFound(_0x123f3a,null))['then'](function(_0x19617e){if(_0x19617e){_0x1a56ce=_0x19617e;_0xd40453[_0xbf44('0x45')]=_[_0xbf44('0x42')](db[_0xbf44('0x70')][_0xbf44('0x3d')]);_0xd40453['query']=_[_0xbf44('0x42')](_0x384e99[_0xbf44('0x41')]);_0xd40453[_0xbf44('0x43')]=_[_0xbf44('0x44')](_0xd40453[_0xbf44('0x45')],_0xd40453[_0xbf44('0x41')]);_0x16d5cf[_0xbf44('0x46')]=_[_0xbf44('0x44')](_0xd40453[_0xbf44('0x45')],qs[_0xbf44('0x47')](_0x384e99['query'][_0xbf44('0x47')]));_0x16d5cf[_0xbf44('0x46')]=_0x16d5cf[_0xbf44('0x46')][_0xbf44('0x48')]?_0x16d5cf[_0xbf44('0x46')]:_0xd40453[_0xbf44('0x45')];_0x16d5cf[_0xbf44('0x94')]=qs[_0xbf44('0x49')](_0x384e99[_0xbf44('0x41')][_0xbf44('0x49')]);_0x16d5cf[_0xbf44('0x4a')]=qs['filters'](_[_0xbf44('0x4b')](_0x384e99[_0xbf44('0x41')],_0xd40453['filters']));if(_0x384e99[_0xbf44('0x41')][_0xbf44('0x4c')]){_0x16d5cf[_0xbf44('0x4a')]=_['merge'](_0x16d5cf[_0xbf44('0x4a')],{'$or':_[_0xbf44('0x3c')](_0x16d5cf['attributes'],function(_0x59fbbb){var _0x4b5484={};_0x4b5484[_0x59fbbb]={'$like':'%'+_0x384e99[_0xbf44('0x41')][_0xbf44('0x4c')]+'%'};return _0x4b5484;})});}_0x16d5cf=_[_0xbf44('0x4d')]({},_0x16d5cf,_0x384e99[_0xbf44('0x4f')]);return _0x1a56ce['getAgents'](_0x16d5cf);}})[_0xbf44('0x35')](function(_0x25c755){if(_0x25c755){_0x53b700=_0x25c755['length'];if(!_0x384e99[_0xbf44('0x41')]['hasOwnProperty'](_0xbf44('0x64'))){_0x16d5cf[_0xbf44('0x30')]=qs[_0xbf44('0x30')](_0x384e99[_0xbf44('0x41')][_0xbf44('0x30')]);_0x16d5cf['offset']=qs[_0xbf44('0x2f')](_0x384e99['query'][_0xbf44('0x2f')]);}return _0x1a56ce[_0xbf44('0x95')](_0x16d5cf);}})[_0xbf44('0x35')](function(_0x51f3b8){if(_0x51f3b8){return _0x51f3b8?{'count':_0x53b700,'rows':_0x51f3b8}:null;}})[_0xbf44('0x35')](respondWithResult(_0x123f3a,null))[_0xbf44('0x2b')](handleError(_0x123f3a,null));};
\ No newline at end of file
+var _0x88f8=['omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','pick','ChatQueueId','User','findAndCountAll','agent','chatPause','format','%s/%s','createdAt','updatedAt','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userChatQueue:remove'];(function(_0x115683,_0x4a1c36){var _0x5715b0=function(_0x17a343){while(--_0x17a343){_0x115683['push'](_0x115683['shift']());}};_0x5715b0(++_0x4a1c36);}(_0x88f8,0x9d));var _0x888f=function(_0x7afd09,_0x5cd2e1){_0x7afd09=_0x7afd09-0x0;var _0x394a32=_0x88f8[_0x7afd09];return _0x394a32;};'use strict';var emlformat=require(_0x888f('0x0'));var rimraf=require(_0x888f('0x1'));var zipdir=require(_0x888f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x888f('0x3'));var moment=require(_0x888f('0x4'));var BPromise=require(_0x888f('0x5'));var Mustache=require(_0x888f('0x6'));var util=require(_0x888f('0x7'));var path=require(_0x888f('0x8'));var sox=require('sox');var csv=require(_0x888f('0x9'));var ejs=require(_0x888f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x888f('0xb'));var squel=require(_0x888f('0xc'));var crypto=require(_0x888f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x888f('0xe'));var toCsv=require(_0x888f('0x9'));var querystring=require(_0x888f('0xf'));var Papa=require(_0x888f('0x10'));var Redis=require('ioredis');var authService=require(_0x888f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x888f('0x12'));var hardwareService=require(_0x888f('0x13'));var logger=require(_0x888f('0x14'))('api');var utils=require(_0x888f('0x15'));var config=require(_0x888f('0x16'));var licenseUtil=require(_0x888f('0x17'));var db=require(_0x888f('0x18'))['db'];config[_0x888f('0x19')]=_['defaults'](config['redis'],{'host':_0x888f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x888f('0x19')]));require(_0x888f('0x1b'))[_0x888f('0x1c')](socket);var jayson=require(_0x888f('0x1d'));var client=jayson[_0x888f('0x1e')][_0x888f('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x525959,_0x1f38fc,_0xae9f18,_0x585b47){return new BPromise(function(_0x483704,_0x4f8baf){var _0x44bc09=_0x585b47||client;return _0x44bc09[_0x888f('0x20')](_0x525959,_0xae9f18)[_0x888f('0x21')](function(_0x28e0f9){logger['info'](_0x888f('0x22'),_0x1f38fc,_0x888f('0x23'));logger['debug'](_0x888f('0x24'),_0x1f38fc,_0x888f('0x23'),JSON[_0x888f('0x25')](_0x28e0f9));if(_0x28e0f9['error']){if(_0x28e0f9[_0x888f('0x26')][_0x888f('0x27')]===0x1f4){logger[_0x888f('0x26')](_0x888f('0x22'),_0x1f38fc,_0x28e0f9[_0x888f('0x26')][_0x888f('0x28')]);return _0x4f8baf(_0x28e0f9[_0x888f('0x26')]['message']);}logger[_0x888f('0x26')](_0x888f('0x22'),_0x1f38fc,_0x28e0f9[_0x888f('0x26')][_0x888f('0x28')]);return _0x483704(_0x28e0f9[_0x888f('0x26')]['message']);}else{logger['info'](_0x888f('0x22'),_0x1f38fc,_0x888f('0x23'));_0x483704(_0x28e0f9[_0x888f('0x29')]['message']);}})['catch'](function(_0x324855){logger[_0x888f('0x26')](_0x888f('0x22'),_0x1f38fc,_0x324855);_0x4f8baf(_0x324855);});});}function respondWithStatusCode(_0x59d377,_0xa86372){_0xa86372=_0xa86372||0xcc;return function(_0x25c9f1){if(_0x25c9f1){return _0x59d377[_0x888f('0x2a')](_0xa86372);}return _0x59d377[_0x888f('0x2b')](_0xa86372)[_0x888f('0x2c')]();};}function respondWithResult(_0x5348fa,_0x1de0f1){_0x1de0f1=_0x1de0f1||0xc8;return function(_0x37e2fb){if(_0x37e2fb){return _0x5348fa[_0x888f('0x2b')](_0x1de0f1)[_0x888f('0x2d')](_0x37e2fb);}};}function respondWithFilteredResult(_0x277128,_0xcb011f){return function(_0x319078){if(_0x319078){var _0x19c693=typeof _0xcb011f[_0x888f('0x2e')]===_0x888f('0x2f')&&typeof _0xcb011f[_0x888f('0x30')]==='undefined';var _0x570b9e=_0x319078[_0x888f('0x31')];var _0x2af6e9=_0x19c693?0x0:_0xcb011f[_0x888f('0x2e')];var _0x2cb774=_0x19c693?_0x319078[_0x888f('0x31')]:_0xcb011f[_0x888f('0x2e')]+_0xcb011f[_0x888f('0x30')];var _0x2b47bd;if(_0x2cb774>=_0x570b9e){_0x2cb774=_0x570b9e;_0x2b47bd=0xc8;}else{_0x2b47bd=0xce;}_0x277128[_0x888f('0x2b')](_0x2b47bd);return _0x277128[_0x888f('0x32')](_0x888f('0x33'),_0x2af6e9+'-'+_0x2cb774+'/'+_0x570b9e)[_0x888f('0x2d')](_0x319078);}return null;};}function patchUpdates(_0x537d72){return function(_0x4fbfe0){try{jsonpatch['apply'](_0x4fbfe0,_0x537d72,!![]);}catch(_0x5b35dd){return BPromise[_0x888f('0x34')](_0x5b35dd);}return _0x4fbfe0[_0x888f('0x35')]();};}function saveUpdates(_0x18bfc6,_0x4c774c){return function(_0x2409c9){if(_0x2409c9){return _0x2409c9[_0x888f('0x36')](_0x18bfc6)[_0x888f('0x21')](function(_0x226f8a){return _0x226f8a;});}return null;};}function removeEntity(_0x6332aa,_0x3d62e4){return function(_0x288f5d){if(_0x288f5d){return _0x288f5d[_0x888f('0x37')]()[_0x888f('0x21')](function(){var _0x58ad1d=_0x288f5d[_0x888f('0x38')]({'plain':!![]});var _0x449ddd=_0x888f('0x39');return db[_0x888f('0x3a')][_0x888f('0x37')]({'where':{'type':_0x449ddd,'resourceId':_0x58ad1d['id']}})[_0x888f('0x21')](function(){return _0x288f5d;});})[_0x888f('0x21')](function(){_0x6332aa[_0x888f('0x2b')](0xcc)[_0x888f('0x2c')]();});}};}function handleEntityNotFound(_0x21f931,_0x3fba76){return function(_0x4b4253){if(!_0x4b4253){_0x21f931['sendStatus'](0x194);}return _0x4b4253;};}function handleError(_0x4b228e,_0x1db45a){_0x1db45a=_0x1db45a||0x1f4;return function(_0x32ec82){logger[_0x888f('0x26')](_0x32ec82[_0x888f('0x3b')]);if(_0x32ec82[_0x888f('0x3c')]){delete _0x32ec82[_0x888f('0x3c')];}_0x4b228e[_0x888f('0x2b')](_0x1db45a)[_0x888f('0x3d')](_0x32ec82);};}exports['index']=function(_0x49fb90,_0x3429cd){var _0x463ee6={},_0x41e127={},_0x568e51={'count':0x0,'rows':[]};var _0x465c17=_[_0x888f('0x3e')](db[_0x888f('0x3f')][_0x888f('0x40')],function(_0x21bbe4){return{'name':_0x21bbe4['fieldName'],'type':_0x21bbe4[_0x888f('0x41')]['key']};});_0x41e127[_0x888f('0x42')]=_[_0x888f('0x3e')](_0x465c17,_0x888f('0x3c'));_0x41e127[_0x888f('0x43')]=_['keys'](_0x49fb90[_0x888f('0x43')]);_0x41e127[_0x888f('0x44')]=_[_0x888f('0x45')](_0x41e127[_0x888f('0x42')],_0x41e127[_0x888f('0x43')]);_0x463ee6[_0x888f('0x46')]=_['intersection'](_0x41e127[_0x888f('0x42')],qs[_0x888f('0x47')](_0x49fb90['query'][_0x888f('0x47')]));_0x463ee6[_0x888f('0x46')]=_0x463ee6[_0x888f('0x46')][_0x888f('0x48')]?_0x463ee6['attributes']:_0x41e127[_0x888f('0x42')];if(!_0x49fb90[_0x888f('0x43')][_0x888f('0x49')](_0x888f('0x4a'))){_0x463ee6[_0x888f('0x30')]=qs[_0x888f('0x30')](_0x49fb90[_0x888f('0x43')][_0x888f('0x30')]);_0x463ee6['offset']=qs['offset'](_0x49fb90[_0x888f('0x43')][_0x888f('0x2e')]);}_0x463ee6[_0x888f('0x4b')]=qs[_0x888f('0x4c')](_0x49fb90['query'][_0x888f('0x4c')]);_0x463ee6[_0x888f('0x4d')]=qs['filters'](_['pick'](_0x49fb90[_0x888f('0x43')],_0x41e127[_0x888f('0x44')]),_0x465c17);if(_0x49fb90[_0x888f('0x43')][_0x888f('0x4e')]){_0x463ee6[_0x888f('0x4d')]=_[_0x888f('0x4f')](_0x463ee6[_0x888f('0x4d')],{'$or':_['map'](_0x465c17,function(_0xc2bad1){if(_0xc2bad1[_0x888f('0x41')]!==_0x888f('0x50')){var _0x3b7ce8={};_0x3b7ce8[_0xc2bad1[_0x888f('0x3c')]]={'$like':'%'+_0x49fb90[_0x888f('0x43')][_0x888f('0x4e')]+'%'};return _0x3b7ce8;}})});}_0x463ee6=_[_0x888f('0x4f')]({},_0x463ee6,_0x49fb90[_0x888f('0x51')]);var _0x5387da={'where':_0x463ee6[_0x888f('0x4d')]};return db['ChatQueue']['count'](_0x5387da)['then'](function(_0x1b3e8f){_0x568e51[_0x888f('0x31')]=_0x1b3e8f;if(_0x49fb90['query']['includeAll']){_0x463ee6['include']=[{'all':!![]}];}return db[_0x888f('0x3f')][_0x888f('0x52')](_0x463ee6);})['then'](function(_0x40578e){_0x568e51[_0x888f('0x53')]=_0x40578e;return _0x568e51;})[_0x888f('0x21')](respondWithFilteredResult(_0x3429cd,_0x463ee6))[_0x888f('0x54')](handleError(_0x3429cd,null));};exports['show']=function(_0x46c8e0,_0x2ad8ef){var _0x37c7a7={'raw':!![],'where':{'id':_0x46c8e0[_0x888f('0x55')]['id']}},_0x1eab34={};_0x1eab34[_0x888f('0x42')]=_[_0x888f('0x56')](db[_0x888f('0x3f')][_0x888f('0x40')]);_0x1eab34[_0x888f('0x43')]=_['keys'](_0x46c8e0[_0x888f('0x43')]);_0x1eab34[_0x888f('0x44')]=_[_0x888f('0x45')](_0x1eab34[_0x888f('0x42')],_0x1eab34[_0x888f('0x43')]);_0x37c7a7[_0x888f('0x46')]=_[_0x888f('0x45')](_0x1eab34['model'],qs[_0x888f('0x47')](_0x46c8e0[_0x888f('0x43')]['fields']));_0x37c7a7[_0x888f('0x46')]=_0x37c7a7[_0x888f('0x46')][_0x888f('0x48')]?_0x37c7a7['attributes']:_0x1eab34[_0x888f('0x42')];if(_0x46c8e0[_0x888f('0x43')]['includeAll']){_0x37c7a7[_0x888f('0x57')]=[{'all':!![]}];}_0x37c7a7=_[_0x888f('0x4f')]({},_0x37c7a7,_0x46c8e0['options']);return db[_0x888f('0x3f')][_0x888f('0x58')](_0x37c7a7)['then'](handleEntityNotFound(_0x2ad8ef,null))[_0x888f('0x21')](respondWithResult(_0x2ad8ef,null))[_0x888f('0x54')](handleError(_0x2ad8ef,null));};exports[_0x888f('0x59')]=function(_0x21d194,_0x52003b){return db[_0x888f('0x3f')][_0x888f('0x59')](_0x21d194[_0x888f('0x5a')],{})[_0x888f('0x21')](function(_0x5d327f){var _0x59f627=_0x21d194[_0x888f('0x5b')][_0x888f('0x38')]({'plain':!![]});if(!_0x59f627)throw new Error(_0x888f('0x5c'));if(_0x59f627[_0x888f('0x5d')]==='user'){var _0x497230=_0x5d327f[_0x888f('0x38')]({'plain':!![]});var _0x2a5287='ChatQueues';return db['UserProfileSection'][_0x888f('0x58')]({'where':{'name':_0x2a5287,'userProfileId':_0x59f627[_0x888f('0x5e')]},'raw':!![]})[_0x888f('0x21')](function(_0x5378c6){if(_0x5378c6&&_0x5378c6[_0x888f('0x5f')]===0x0){return db[_0x888f('0x3a')][_0x888f('0x59')]({'name':_0x497230[_0x888f('0x3c')],'resourceId':_0x497230['id'],'type':_0x5378c6[_0x888f('0x3c')],'sectionId':_0x5378c6['id']},{})['then'](function(){return _0x5d327f;});}else{return _0x5d327f;}})[_0x888f('0x54')](function(_0x2ff6ab){logger[_0x888f('0x26')](_0x888f('0x60'),_0x2ff6ab);throw _0x2ff6ab;});}return _0x5d327f;})['then'](respondWithResult(_0x52003b,0xc9))[_0x888f('0x54')](handleError(_0x52003b,null));};exports['update']=function(_0x2f7210,_0x469bee){if(_0x2f7210[_0x888f('0x5a')]['id']){delete _0x2f7210[_0x888f('0x5a')]['id'];}return db['ChatQueue'][_0x888f('0x58')]({'where':{'id':_0x2f7210[_0x888f('0x55')]['id']}})['then'](handleEntityNotFound(_0x469bee,null))[_0x888f('0x21')](saveUpdates(_0x2f7210[_0x888f('0x5a')],null))[_0x888f('0x21')](respondWithResult(_0x469bee,null))['catch'](handleError(_0x469bee,null));};exports['destroy']=function(_0x154fd3,_0x434932){return db[_0x888f('0x3f')][_0x888f('0x58')]({'where':{'id':_0x154fd3[_0x888f('0x55')]['id']}})[_0x888f('0x21')](handleEntityNotFound(_0x434932,null))[_0x888f('0x21')](removeEntity(_0x434932,null))[_0x888f('0x54')](handleError(_0x434932,null));};exports[_0x888f('0x61')]=function(_0x341252,_0x12971d){return db[_0x888f('0x3f')][_0x888f('0x61')]()[_0x888f('0x21')](respondWithResult(_0x12971d,null))[_0x888f('0x54')](handleError(_0x12971d,null));};exports[_0x888f('0x62')]=function(_0x344c50,_0x4390fc,_0x4f25d9){var _0x56197f={'raw':!![],'where':{}},_0x14bd02={},_0x10f41d;return db[_0x888f('0x3f')][_0x888f('0x63')]({'where':{'id':_0x344c50[_0x888f('0x55')]['id']}})['then'](handleEntityNotFound(_0x4390fc,null))['then'](function(_0x3bcf3c){if(_0x3bcf3c){_0x10f41d=_0x3bcf3c[_0x888f('0x38')]({'plain':!![]});_0x14bd02['model']=_[_0x888f('0x56')](db[_0x888f('0x64')]['rawAttributes']);_0x14bd02[_0x888f('0x43')]=_['keys'](_0x344c50[_0x888f('0x43')]);_0x14bd02[_0x888f('0x44')]=_[_0x888f('0x45')](_0x14bd02['model'],_0x14bd02[_0x888f('0x43')]);_0x56197f[_0x888f('0x46')]=_['intersection'](_0x14bd02[_0x888f('0x42')],qs[_0x888f('0x47')](_0x344c50[_0x888f('0x43')]['fields']));_0x56197f[_0x888f('0x46')]=_0x56197f[_0x888f('0x46')][_0x888f('0x48')]?_0x56197f['attributes']:_0x14bd02[_0x888f('0x42')];if(!_0x344c50[_0x888f('0x43')]['hasOwnProperty'](_0x888f('0x4a'))){_0x56197f[_0x888f('0x30')]=qs[_0x888f('0x30')](_0x344c50['query'][_0x888f('0x30')]);_0x56197f['offset']=qs['offset'](_0x344c50['query'][_0x888f('0x2e')]);}_0x56197f[_0x888f('0x4b')]=qs['sort'](_0x344c50[_0x888f('0x43')]['sort']);_0x56197f['where']=qs['filters'](_[_0x888f('0x65')](_0x344c50[_0x888f('0x43')],_0x14bd02[_0x888f('0x44')]));_0x56197f['where'][_0x888f('0x66')]=_0x3bcf3c['id'];if(_0x344c50[_0x888f('0x43')][_0x888f('0x4e')]){_0x56197f['where']=_['merge'](_0x56197f[_0x888f('0x4d')],{'$or':_['map'](_0x56197f[_0x888f('0x46')],function(_0x13efb8){var _0x1bda91={};_0x1bda91[_0x13efb8]={'$like':'%'+_0x344c50['query'][_0x888f('0x4e')]+'%'};return _0x1bda91;})});}_0x56197f=_['merge']({},_0x56197f,_0x344c50['options']);return db[_0x888f('0x64')]['findAll'](_0x56197f);}})[_0x888f('0x21')](function(_0x34b490){if(_0x34b490){return db[_0x888f('0x67')][_0x888f('0x68')]({'where':{'id':_[_0x888f('0x3e')](_0x34b490,'UserId'),'role':_0x888f('0x69')},'attributes':['id',_0x888f('0x3c'),_0x888f('0x6a'),'updatedAt','createdAt']});}})[_0x888f('0x21')](function(_0x4a2280){if(_0x4a2280){return{'count':_0x4a2280[_0x888f('0x31')],'rows':_[_0x888f('0x3e')](_0x4a2280[_0x888f('0x53')],function(_0x53138a){return{'membername':_0x53138a[_0x888f('0x3c')],'UserId':_0x53138a['id'],'queue_name':_0x10f41d[_0x888f('0x3c')],'ChatQueueId':_0x10f41d['id'],'interface':util[_0x888f('0x6b')](_0x888f('0x6c'),'SIP',_0x53138a[_0x888f('0x3c')]),'penalty':0x0,'paused':_0x53138a[_0x888f('0x6a')],'createdAt':_0x53138a[_0x888f('0x6d')],'updatedAt':_0x53138a[_0x888f('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x888f('0x21')](respondWithFilteredResult(_0x4390fc,_0x56197f))[_0x888f('0x54')](handleError(_0x4390fc,null));};exports[_0x888f('0x6f')]=function(_0x2e484c,_0x1d68ab,_0x259676){var _0x16e2f7={};var _0x140b4d={};var _0xf8d411;var _0x49fe2a;return db[_0x888f('0x3f')][_0x888f('0x63')]({'where':{'id':_0x2e484c[_0x888f('0x55')]['id']}})[_0x888f('0x21')](handleEntityNotFound(_0x1d68ab,null))[_0x888f('0x21')](function(_0x26d0db){if(_0x26d0db){_0xf8d411=_0x26d0db;_0x140b4d['model']=_[_0x888f('0x56')](db[_0x888f('0x70')][_0x888f('0x40')]);_0x140b4d[_0x888f('0x43')]=_[_0x888f('0x56')](_0x2e484c['query']);_0x140b4d[_0x888f('0x44')]=_['intersection'](_0x140b4d[_0x888f('0x42')],_0x140b4d[_0x888f('0x43')]);_0x16e2f7[_0x888f('0x46')]=_[_0x888f('0x45')](_0x140b4d[_0x888f('0x42')],qs[_0x888f('0x47')](_0x2e484c['query'][_0x888f('0x47')]));_0x16e2f7[_0x888f('0x46')]=_0x16e2f7[_0x888f('0x46')][_0x888f('0x48')]?_0x16e2f7['attributes']:_0x140b4d['model'];_0x16e2f7[_0x888f('0x4b')]=qs[_0x888f('0x4c')](_0x2e484c[_0x888f('0x43')][_0x888f('0x4c')]);_0x16e2f7['where']=qs[_0x888f('0x44')](_[_0x888f('0x65')](_0x2e484c[_0x888f('0x43')],_0x140b4d['filters']));if(_0x2e484c['query'][_0x888f('0x4e')]){_0x16e2f7[_0x888f('0x4d')]=_[_0x888f('0x4f')](_0x16e2f7['where'],{'$or':_[_0x888f('0x3e')](_0x16e2f7[_0x888f('0x46')],function(_0x988a2e){var _0x5293e6={};_0x5293e6[_0x988a2e]={'$like':'%'+_0x2e484c[_0x888f('0x43')][_0x888f('0x4e')]+'%'};return _0x5293e6;})});}_0x16e2f7=_['merge']({},_0x16e2f7,_0x2e484c[_0x888f('0x51')]);return _0xf8d411['getTeams'](_0x16e2f7);}})[_0x888f('0x21')](function(_0x406bf8){if(_0x406bf8){_0x49fe2a=_0x406bf8[_0x888f('0x48')];if(!_0x2e484c[_0x888f('0x43')][_0x888f('0x49')]('nolimit')){_0x16e2f7[_0x888f('0x30')]=qs['limit'](_0x2e484c[_0x888f('0x43')][_0x888f('0x30')]);_0x16e2f7[_0x888f('0x2e')]=qs[_0x888f('0x2e')](_0x2e484c[_0x888f('0x43')][_0x888f('0x2e')]);}return _0xf8d411[_0x888f('0x6f')](_0x16e2f7);}})[_0x888f('0x21')](function(_0x4377fe){if(_0x4377fe){return _0x4377fe?{'count':_0x49fe2a,'rows':_0x4377fe}:null;}})['then'](respondWithResult(_0x1d68ab,null))[_0x888f('0x54')](handleError(_0x1d68ab,null));};exports[_0x888f('0x71')]=function(_0x3d8382,_0x5da014,_0x29ceff){var _0x4014a9=_0x3d8382['body'][_0x888f('0x72')];return db['Team'][_0x888f('0x52')]({'where':{'id':_0x4014a9},'attributes':['id'],'include':[{'model':db[_0x888f('0x67')],'as':'Agents','attributes':['id',_0x888f('0x3c'),_0x888f('0x73'),_0x888f('0x74'),_0x888f('0x75')],'raw':!![]}]})[_0x888f('0x21')](function(_0x150dc5){if(_0x150dc5){var _0x54675a=_[_0x888f('0x76')](_0x150dc5,function(_0x3e580a){var _0x5d6ad8=_0x3e580a[_0x888f('0x38')]({'plain':!![]});return _0x5d6ad8[_0x888f('0x77')];});return db['ChatQueue'][_0x888f('0x58')]({'where':{'id':_0x3d8382[_0x888f('0x55')]['id']}})[_0x888f('0x21')](function(_0x57aea7){return db[_0x888f('0x78')][_0x888f('0x79')](function(_0x2ef194){return _0x57aea7[_0x888f('0x71')](_0x4014a9,{'transaction':_0x2ef194})[_0x888f('0x21')](function(){return BPromise[_0x888f('0x7a')](_0x54675a,function(_0x57f719){return db[_0x888f('0x64')][_0x888f('0x7b')]({'where':{'UserId':_0x57f719['id'],'ChatQueueId':_0x3d8382[_0x888f('0x55')]['id']},'transaction':_0x2ef194});});})[_0x888f('0x21')](function(){_0x54675a[_0x888f('0x7c')](function(_0x235cda){socket[_0x888f('0x7d')](_0x888f('0x7e'),{'UserId':_0x235cda['id'],'ChatQueueId':_0x57aea7['id']});});});});});}})[_0x888f('0x21')](respondWithStatusCode(_0x5da014,null))[_0x888f('0x54')](handleError(_0x5da014,null));};exports[_0x888f('0x7f')]=function(_0x5c6bc4,_0x4f7039,_0x1cc6c8){return db[_0x888f('0x70')][_0x888f('0x52')]({'where':{'id':_0x5c6bc4[_0x888f('0x43')][_0x888f('0x72')]},'attributes':['id'],'include':[{'model':db[_0x888f('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x888f('0x21')](handleEntityNotFound(_0x4f7039,null))['then'](function(_0x5022d8){var _0x376427=_[_0x888f('0x3e')](_0x5022d8,'id');var _0x5c4259=[];var _0x2d5966=[];var _0x1d223f=squel[_0x888f('0x80')]();_0x1d223f[_0x888f('0x81')](_0x888f('0x82'))[_0x888f('0x83')](_0x888f('0x84'),'tq')[_0x888f('0x85')](_0x888f('0x86'),'ut',_0x888f('0x87'))[_0x888f('0x4d')]('ChatQueueId\x20=\x20?',_0x5c6bc4[_0x888f('0x55')]['id']);for(var _0x4ad190=0x0;_0x4ad190<_0x5022d8[_0x888f('0x48')];_0x4ad190+=0x1){let _0x54a04e=_0x5022d8[_0x4ad190];for(var _0x10be8e=0x0;_0x10be8e<_0x54a04e[_0x888f('0x77')][_0x888f('0x48')];_0x10be8e+=0x1){let _0x39145d=_0x54a04e[_0x888f('0x77')][_0x10be8e];var _0x548da5=_0x1d223f[_0x888f('0x88')]();_0x548da5[_0x888f('0x4d')](_0x888f('0x89'),_0x39145d['id']);_0x2d5966['push'](db[_0x888f('0x78')][_0x888f('0x43')](_0x548da5[_0x888f('0x8a')](),{'type':db[_0x888f('0x78')]['QueryTypes'][_0x888f('0x8b')]})[_0x888f('0x21')](function(_0x33e080){if(_0x33e080[_0x888f('0x48')]===0x1){return _0x39145d['id'];}else{var _0x5a88c2=_[_0x888f('0x8c')](_[_0x888f('0x3e')](_0x33e080,_0x888f('0x8d')),function(_0x21191d){return _[_0x888f('0x8e')](_0x376427,_0x21191d);});if(_0x5a88c2){return _0x39145d['id'];}}}));}}return BPromise[_0x888f('0x8f')](_0x2d5966)[_0x888f('0x21')](function(_0xab2c08){_0x5c4259=_(_0x5c4259)[_0x888f('0x90')](_0xab2c08)['compact']()[_0x888f('0x91')]();return db[_0x888f('0x3f')]['find']({'where':{'id':_0x5c6bc4[_0x888f('0x55')]['id']}})[_0x888f('0x21')](function(_0x3f154a){return db[_0x888f('0x78')][_0x888f('0x79')](function(_0xac67e9){return _0x3f154a['removeTeams'](_0x5c6bc4[_0x888f('0x43')][_0x888f('0x72')],{'transaction':_0xac67e9})[_0x888f('0x21')](function(){if(!_[_0x888f('0x92')](_0x5c4259)){return _0x3f154a[_0x888f('0x93')](_0x5c4259,{'transaction':_0xac67e9});}})[_0x888f('0x21')](function(){_0x5c4259[_0x888f('0x7c')](function(_0x5d7678){socket[_0x888f('0x7d')](_0x888f('0x94'),{'UserId':_0x5d7678,'ChatQueueId':_0x3f154a['id']});});});});});});})[_0x888f('0x21')](respondWithStatusCode(_0x4f7039,null))[_0x888f('0x54')](handleError(_0x4f7039,null));};exports['addAgents']=function(_0x307fe6,_0x24c0cb,_0x46ef84){return db[_0x888f('0x3f')][_0x888f('0x58')]({'where':{'id':_0x307fe6[_0x888f('0x55')]['id']}})[_0x888f('0x21')](handleEntityNotFound(_0x24c0cb,null))['then'](function(_0x936fa8){if(_0x936fa8){return _0x936fa8['addAgents'](_0x307fe6[_0x888f('0x5a')]['ids'],_[_0x888f('0x95')](_0x307fe6[_0x888f('0x5a')],[_0x888f('0x72'),'id'])||{})[_0x888f('0x96')](function(_0x52b551){for(var _0x30c107=0x0;_0x30c107<_0x307fe6['body']['ids'][_0x888f('0x48')];_0x30c107+=0x1){socket[_0x888f('0x7d')](_0x888f('0x7e'),{'UserId':Number(_0x307fe6[_0x888f('0x5a')][_0x888f('0x72')][_0x30c107]),'ChatQueueId':Number(_0x307fe6[_0x888f('0x55')]['id'])});}return _0x52b551;});}})[_0x888f('0x21')](respondWithResult(_0x24c0cb,null))['catch'](handleError(_0x24c0cb,null));};exports['removeAgents']=function(_0x41e0db,_0x1de3f7,_0x285669){return db['ChatQueue'][_0x888f('0x58')]({'where':{'id':_0x41e0db[_0x888f('0x55')]['id']}})[_0x888f('0x21')](handleEntityNotFound(_0x1de3f7,null))['then'](function(_0x1a3770){if(_0x1a3770){return _0x1a3770[_0x888f('0x93')](_0x41e0db[_0x888f('0x43')][_0x888f('0x72')])['then'](function(){if(_[_0x888f('0x97')](_0x41e0db[_0x888f('0x43')][_0x888f('0x72')])){for(var _0x117566=0x0;_0x117566<_0x41e0db['query'][_0x888f('0x72')][_0x888f('0x48')];_0x117566+=0x1){socket[_0x888f('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x41e0db[_0x888f('0x43')][_0x888f('0x72')][_0x117566]),'ChatQueueId':Number(_0x41e0db['params']['id'])});}}else{socket['emit'](_0x888f('0x94'),{'UserId':Number(_0x41e0db['query'][_0x888f('0x72')]),'ChatQueueId':Number(_0x41e0db[_0x888f('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x1de3f7,null))[_0x888f('0x54')](handleError(_0x1de3f7,null));};exports['getAgents']=function(_0x53f3ea,_0x3e9998,_0x1eb665){var _0x51a47={};var _0x57f934={};var _0x148bdd;var _0x50bb58;return db[_0x888f('0x3f')]['findOne']({'where':{'id':_0x53f3ea['params']['id']}})[_0x888f('0x21')](handleEntityNotFound(_0x3e9998,null))[_0x888f('0x21')](function(_0x5cb28b){if(_0x5cb28b){_0x148bdd=_0x5cb28b;_0x57f934[_0x888f('0x42')]=_[_0x888f('0x56')](db[_0x888f('0x67')][_0x888f('0x40')]);_0x57f934[_0x888f('0x43')]=_[_0x888f('0x56')](_0x53f3ea[_0x888f('0x43')]);_0x57f934[_0x888f('0x44')]=_['intersection'](_0x57f934[_0x888f('0x42')],_0x57f934['query']);_0x51a47['attributes']=_[_0x888f('0x45')](_0x57f934[_0x888f('0x42')],qs[_0x888f('0x47')](_0x53f3ea['query'][_0x888f('0x47')]));_0x51a47[_0x888f('0x46')]=_0x51a47['attributes'][_0x888f('0x48')]?_0x51a47[_0x888f('0x46')]:_0x57f934[_0x888f('0x42')];_0x51a47[_0x888f('0x4b')]=qs['sort'](_0x53f3ea[_0x888f('0x43')][_0x888f('0x4c')]);_0x51a47[_0x888f('0x4d')]=qs['filters'](_[_0x888f('0x65')](_0x53f3ea['query'],_0x57f934[_0x888f('0x44')]));if(_0x53f3ea[_0x888f('0x43')][_0x888f('0x4e')]){_0x51a47[_0x888f('0x4d')]=_[_0x888f('0x4f')](_0x51a47['where'],{'$or':_['map'](_0x51a47[_0x888f('0x46')],function(_0x268d15){var _0x1ac909={};_0x1ac909[_0x268d15]={'$like':'%'+_0x53f3ea[_0x888f('0x43')]['filter']+'%'};return _0x1ac909;})});}_0x51a47=_[_0x888f('0x4f')]({},_0x51a47,_0x53f3ea[_0x888f('0x51')]);return _0x148bdd[_0x888f('0x98')](_0x51a47);}})['then'](function(_0x4db185){if(_0x4db185){_0x50bb58=_0x4db185['length'];if(!_0x53f3ea['query'][_0x888f('0x49')](_0x888f('0x4a'))){_0x51a47[_0x888f('0x30')]=qs[_0x888f('0x30')](_0x53f3ea[_0x888f('0x43')][_0x888f('0x30')]);_0x51a47[_0x888f('0x2e')]=qs[_0x888f('0x2e')](_0x53f3ea[_0x888f('0x43')][_0x888f('0x2e')]);}return _0x148bdd[_0x888f('0x98')](_0x51a47);}})[_0x888f('0x21')](function(_0x4dad68){if(_0x4dad68){return _0x4dad68?{'count':_0x50bb58,'rows':_0x4dad68}:null;}})[_0x888f('0x21')](respondWithResult(_0x3e9998,null))[_0x888f('0x54')](handleError(_0x3e9998,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 96a69f7..71561ef 100644
--- a/server/api/chatQueue/chatQueue.events.js
+++ b/server/api/chatQueue/chatQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4625=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x318fe4,_0x4a75ed){var _0x349083=function(_0x35aba6){while(--_0x35aba6){_0x318fe4['push'](_0x318fe4['shift']());}};_0x349083(++_0x4a75ed);}(_0x4625,0x1c9));var _0x5462=function(_0x1207fb,_0x58d284){_0x1207fb=_0x1207fb-0x0;var _0x4d3333=_0x4625[_0x1207fb];return _0x4d3333;};'use strict';var EventEmitter=require(_0x5462('0x0'));var ChatQueue=require(_0x5462('0x1'))['db'][_0x5462('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5462('0x3')](0x0);var events={'afterCreate':_0x5462('0x4'),'afterUpdate':'update','afterDestroy':_0x5462('0x5')};function emitEvent(_0x47d4a6){return function(_0x3c1db3,_0x5bdfc4,_0x1bc84b){ChatQueueEvents[_0x5462('0x6')](_0x47d4a6+':'+_0x3c1db3['id'],_0x3c1db3);ChatQueueEvents[_0x5462('0x6')](_0x47d4a6,_0x3c1db3);_0x1bc84b(null);};}for(var e in events){if(events[_0x5462('0x7')](e)){var event=events[e];ChatQueue[_0x5462('0x8')](e,emitEvent(event));}}module[_0x5462('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0xf15d=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xf15d,0x1a9));var _0xdf15=function(_0x4286f2,_0x3b4190){_0x4286f2=_0x4286f2-0x0;var _0x41be11=_0xf15d[_0x4286f2];return _0x41be11;};'use strict';var EventEmitter=require(_0xdf15('0x0'));var ChatQueue=require(_0xdf15('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xdf15('0x2')](0x0);var events={'afterCreate':_0xdf15('0x3'),'afterUpdate':_0xdf15('0x4'),'afterDestroy':_0xdf15('0x5')};function emitEvent(_0x170e0c){return function(_0x1e3fd2,_0x57f3eb,_0x4f14d7){ChatQueueEvents[_0xdf15('0x6')](_0x170e0c+':'+_0x1e3fd2['id'],_0x1e3fd2);ChatQueueEvents['emit'](_0x170e0c,_0x1e3fd2);_0x4f14d7(null);};}for(var e in events){if(events[_0xdf15('0x7')](e)){var event=events[e];ChatQueue[_0xdf15('0x8')](e,emitEvent(event));}}module[_0xdf15('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 0435c77..f5a4b7e 100644
--- a/server/api/chatQueue/chatQueue.model.js
+++ b/server/api/chatQueue/chatQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3d23=['request-promise','../../config/environment','./chatQueue.attributes','exports','chat_queues','lodash','util','../../config/logger','bluebird'];(function(_0x1be7cb,_0xf14d33){var _0xda7d7c=function(_0x3ec086){while(--_0x3ec086){_0x1be7cb['push'](_0x1be7cb['shift']());}};_0xda7d7c(++_0xf14d33);}(_0x3d23,0x83));var _0x33d2=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x3d23[_0x754ab4];return _0x34079a;};'use strict';var _=require(_0x33d2('0x0'));var util=require(_0x33d2('0x1'));var logger=require(_0x33d2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x33d2('0x3'));var rp=require(_0x33d2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x33d2('0x5'));var attributes=require(_0x33d2('0x6'));module[_0x33d2('0x7')]=function(_0x376e52,_0x5aacde){return _0x376e52['define']('ChatQueue',attributes,{'tableName':_0x33d2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6ae4=['./chatQueue.attributes','define','ChatQueue','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3184f5,_0x52b9d4){var _0x462835=function(_0x1d8604){while(--_0x1d8604){_0x3184f5['push'](_0x3184f5['shift']());}};_0x462835(++_0x52b9d4);}(_0x6ae4,0x184));var _0x46ae=function(_0x4cae20,_0x14e79a){_0x4cae20=_0x4cae20-0x0;var _0x22cddd=_0x6ae4[_0x4cae20];return _0x22cddd;};'use strict';var _=require('lodash');var util=require(_0x46ae('0x0'));var logger=require(_0x46ae('0x1'))(_0x46ae('0x2'));var moment=require('moment');var BPromise=require(_0x46ae('0x3'));var rp=require(_0x46ae('0x4'));var fs=require('fs');var path=require(_0x46ae('0x5'));var rimraf=require(_0x46ae('0x6'));var config=require(_0x46ae('0x7'));var attributes=require(_0x46ae('0x8'));module['exports']=function(_0x11fd5b,_0x3ef0db){return _0x11fd5b[_0x46ae('0x9')](_0x46ae('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 4806012..326d10d 100644
--- a/server/api/chatQueue/chatQueue.rpc.js
+++ b/server/api/chatQueue/chatQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9458=['debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowChatQueue','raw','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','ChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x29c261,_0x3af39a){var _0x1a9335=function(_0x40d1e8){while(--_0x40d1e8){_0x29c261['push'](_0x29c261['shift']());}};_0x1a9335(++_0x3af39a);}(_0x9458,0x1b8));var _0x8945=function(_0x26b581,_0x24b7c8){_0x26b581=_0x26b581-0x0;var _0x456ebb=_0x9458[_0x26b581];return _0x456ebb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8945('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8945('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x8945('0x2'));var logger=require(_0x8945('0x3'))(_0x8945('0x4'));var config=require(_0x8945('0x5'));var jayson=require(_0x8945('0x6'));var client=jayson[_0x8945('0x7')][_0x8945('0x8')]({'port':0x232a});config[_0x8945('0x9')]=_[_0x8945('0xa')](config[_0x8945('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8945('0xb'))(new Redis(config[_0x8945('0x9')]));require(_0x8945('0xc'))[_0x8945('0xd')](socket);function respondWithRpcPromise(_0x30b9c9,_0xf8f04e,_0x5e2319){return new BPromise(function(_0xdef672,_0x27396c){return client['request'](_0x30b9c9,_0x5e2319)['then'](function(_0xd0fcbf){logger['info'](_0x8945('0xe'),_0xf8f04e,_0x8945('0xf'));logger[_0x8945('0x10')](_0x8945('0x11'),_0xf8f04e,_0x8945('0xf'),JSON[_0x8945('0x12')](_0xd0fcbf));if(_0xd0fcbf['error']){if(_0xd0fcbf[_0x8945('0x13')][_0x8945('0x14')]===0x1f4){logger['error'](_0x8945('0xe'),_0xf8f04e,_0xd0fcbf[_0x8945('0x13')][_0x8945('0x15')]);return _0x27396c(_0xd0fcbf[_0x8945('0x13')][_0x8945('0x15')]);}logger[_0x8945('0x13')]('ChatQueue,\x20%s,\x20%s',_0xf8f04e,_0xd0fcbf['error'][_0x8945('0x15')]);return _0xdef672(_0xd0fcbf['error']['message']);}else{logger[_0x8945('0x16')]('ChatQueue,\x20%s,\x20%s',_0xf8f04e,'request\x20sent');_0xdef672(_0xd0fcbf[_0x8945('0x17')][_0x8945('0x15')]);}})[_0x8945('0x18')](function(_0x3b0c40){logger[_0x8945('0x13')](_0x8945('0xe'),_0xf8f04e,_0x3b0c40);_0x27396c(_0x3b0c40);});});}exports[_0x8945('0x19')]=function(_0x1baf28){var _0x323b44=this;return new Promise(function(_0x9174f4,_0x1738e1){return db[_0x8945('0x1a')][_0x8945('0x1b')]({'raw':_0x1baf28[_0x8945('0x1c')]?_0x1baf28['options']['raw']===undefined?!![]:![]:!![],'where':_0x1baf28['options']?_0x1baf28['options'][_0x8945('0x1d')]||null:null,'attributes':_0x1baf28[_0x8945('0x1c')]?_0x1baf28[_0x8945('0x1c')][_0x8945('0x1e')]||null:null,'limit':_0x1baf28[_0x8945('0x1c')]?_0x1baf28[_0x8945('0x1c')][_0x8945('0x1f')]||null:null,'include':_0x1baf28['options']?_0x1baf28[_0x8945('0x1c')][_0x8945('0x20')]?_[_0x8945('0x21')](_0x1baf28[_0x8945('0x1c')][_0x8945('0x20')],function(_0x5a5f0b){return{'model':db[_0x5a5f0b[_0x8945('0x22')]],'as':_0x5a5f0b['as'],'attributes':_0x5a5f0b[_0x8945('0x1e')],'include':_0x5a5f0b[_0x8945('0x20')]?_[_0x8945('0x21')](_0x5a5f0b[_0x8945('0x20')],function(_0x3ff1d6){return{'model':db[_0x3ff1d6['model']],'as':_0x3ff1d6['as'],'attributes':_0x3ff1d6[_0x8945('0x1e')],'include':_0x3ff1d6['include']?_[_0x8945('0x21')](_0x3ff1d6['include'],function(_0xd5f709){return{'model':db[_0xd5f709[_0x8945('0x22')]],'as':_0xd5f709['as'],'attributes':_0xd5f709[_0x8945('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8945('0x23')](function(_0x4cf946){logger[_0x8945('0x16')](_0x8945('0x19'),_0x1baf28);logger[_0x8945('0x10')](_0x8945('0x19'),_0x1baf28,JSON[_0x8945('0x12')](_0x4cf946));_0x9174f4(_0x4cf946);})[_0x8945('0x18')](function(_0x28fe7f){logger[_0x8945('0x13')](_0x8945('0x19'),_0x28fe7f[_0x8945('0x15')],_0x1baf28);_0x1738e1(_0x323b44[_0x8945('0x13')](0x1f4,_0x28fe7f[_0x8945('0x15')]));});});};exports[_0x8945('0x24')]=function(_0x4bf762){var _0x5dc86d=this;return new Promise(function(_0x522e52,_0x1779ee){return db['ChatQueue']['find']({'raw':_0x4bf762[_0x8945('0x1c')]?_0x4bf762[_0x8945('0x1c')][_0x8945('0x25')]===undefined?!![]:![]:!![],'where':_0x4bf762['options']?_0x4bf762[_0x8945('0x1c')][_0x8945('0x1d')]||null:null,'attributes':_0x4bf762['options']?_0x4bf762[_0x8945('0x1c')][_0x8945('0x1e')]||null:null,'include':_0x4bf762[_0x8945('0x1c')]?_0x4bf762['options']['include']?_['map'](_0x4bf762[_0x8945('0x1c')]['include'],function(_0xadcde6){return{'model':db[_0xadcde6[_0x8945('0x22')]],'as':_0xadcde6['as'],'attributes':_0xadcde6[_0x8945('0x1e')],'include':_0xadcde6[_0x8945('0x20')]?_[_0x8945('0x21')](_0xadcde6['include'],function(_0x5fa31){return{'model':db[_0x5fa31['model']],'as':_0x5fa31['as'],'attributes':_0x5fa31[_0x8945('0x1e')],'include':_0x5fa31[_0x8945('0x20')]?_[_0x8945('0x21')](_0x5fa31[_0x8945('0x20')],function(_0x5657d4){return{'model':db[_0x5657d4[_0x8945('0x22')]],'as':_0x5657d4['as'],'attributes':_0x5657d4[_0x8945('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8945('0x23')](function(_0x3da787){logger[_0x8945('0x16')](_0x8945('0x24'),_0x4bf762);logger[_0x8945('0x10')](_0x8945('0x24'),_0x4bf762,JSON[_0x8945('0x12')](_0x3da787));_0x522e52(_0x3da787);})[_0x8945('0x18')](function(_0x6509da){logger[_0x8945('0x13')](_0x8945('0x24'),_0x6509da[_0x8945('0x15')],_0x4bf762);_0x1779ee(_0x5dc86d[_0x8945('0x13')](0x1f4,_0x6509da[_0x8945('0x15')]));});});};
\ No newline at end of file
+var _0x0f97=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','./chatQueue.socket','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','GetChatQueue','ChatQueue','findAll','options','where','limit','include','map','model','attributes','find','raw','ShowChatQueue','catch','lodash','util','moment','bluebird'];(function(_0x5bf28c,_0x5e3610){var _0x40a3ab=function(_0x146ad1){while(--_0x146ad1){_0x5bf28c['push'](_0x5bf28c['shift']());}};_0x40a3ab(++_0x5e3610);}(_0x0f97,0x196));var _0x70f9=function(_0x2b305c,_0x5ae303){_0x2b305c=_0x2b305c-0x0;var _0x5d8c85=_0x0f97[_0x2b305c];return _0x5d8c85;};'use strict';var _=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var moment=require(_0x70f9('0x2'));var BPromise=require(_0x70f9('0x3'));var rs=require(_0x70f9('0x4'));var fs=require('fs');var Redis=require(_0x70f9('0x5'));var db=require(_0x70f9('0x6'))['db'];var utils=require(_0x70f9('0x7'));var logger=require(_0x70f9('0x8'))(_0x70f9('0x9'));var config=require(_0x70f9('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x70f9('0xb')]({'port':0x232a});config[_0x70f9('0xc')]=_[_0x70f9('0xd')](config[_0x70f9('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70f9('0xc')]));require(_0x70f9('0xe'))[_0x70f9('0xf')](socket);function respondWithRpcPromise(_0xa97b2,_0x481fc2,_0x4c8cb4){return new BPromise(function(_0x5de133,_0x50f052){return client[_0x70f9('0x10')](_0xa97b2,_0x4c8cb4)[_0x70f9('0x11')](function(_0x5951be){logger[_0x70f9('0x12')]('ChatQueue,\x20%s,\x20%s',_0x481fc2,_0x70f9('0x13'));logger[_0x70f9('0x14')](_0x70f9('0x15'),_0x481fc2,_0x70f9('0x13'),JSON[_0x70f9('0x16')](_0x5951be));if(_0x5951be['error']){if(_0x5951be[_0x70f9('0x17')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x481fc2,_0x5951be['error'][_0x70f9('0x18')]);return _0x50f052(_0x5951be['error'][_0x70f9('0x18')]);}logger[_0x70f9('0x17')](_0x70f9('0x19'),_0x481fc2,_0x5951be[_0x70f9('0x17')][_0x70f9('0x18')]);return _0x5de133(_0x5951be[_0x70f9('0x17')][_0x70f9('0x18')]);}else{logger[_0x70f9('0x12')](_0x70f9('0x19'),_0x481fc2,'request\x20sent');_0x5de133(_0x5951be[_0x70f9('0x1a')][_0x70f9('0x18')]);}})['catch'](function(_0x35ba0b){logger[_0x70f9('0x17')](_0x70f9('0x19'),_0x481fc2,_0x35ba0b);_0x50f052(_0x35ba0b);});});}exports[_0x70f9('0x1b')]=function(_0x4e7cce){var _0x57caca=this;return new Promise(function(_0x14de5c,_0x24a7f1){return db[_0x70f9('0x1c')][_0x70f9('0x1d')]({'raw':_0x4e7cce['options']?_0x4e7cce[_0x70f9('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4e7cce[_0x70f9('0x1e')]?_0x4e7cce[_0x70f9('0x1e')][_0x70f9('0x1f')]||null:null,'attributes':_0x4e7cce[_0x70f9('0x1e')]?_0x4e7cce[_0x70f9('0x1e')]['attributes']||null:null,'limit':_0x4e7cce[_0x70f9('0x1e')]?_0x4e7cce[_0x70f9('0x1e')][_0x70f9('0x20')]||null:null,'include':_0x4e7cce['options']?_0x4e7cce[_0x70f9('0x1e')][_0x70f9('0x21')]?_[_0x70f9('0x22')](_0x4e7cce[_0x70f9('0x1e')][_0x70f9('0x21')],function(_0x49337a){return{'model':db[_0x49337a[_0x70f9('0x23')]],'as':_0x49337a['as'],'attributes':_0x49337a[_0x70f9('0x24')],'include':_0x49337a[_0x70f9('0x21')]?_[_0x70f9('0x22')](_0x49337a[_0x70f9('0x21')],function(_0xfe324e){return{'model':db[_0xfe324e['model']],'as':_0xfe324e['as'],'attributes':_0xfe324e[_0x70f9('0x24')],'include':_0xfe324e[_0x70f9('0x21')]?_[_0x70f9('0x22')](_0xfe324e[_0x70f9('0x21')],function(_0x35d452){return{'model':db[_0x35d452[_0x70f9('0x23')]],'as':_0x35d452['as'],'attributes':_0x35d452[_0x70f9('0x24')]};}):[]};}):[]};}):[]:[]})[_0x70f9('0x11')](function(_0x562b72){logger['info'](_0x70f9('0x1b'),_0x4e7cce);logger[_0x70f9('0x14')](_0x70f9('0x1b'),_0x4e7cce,JSON['stringify'](_0x562b72));_0x14de5c(_0x562b72);})['catch'](function(_0x40496a){logger[_0x70f9('0x17')]('GetChatQueue',_0x40496a['message'],_0x4e7cce);_0x24a7f1(_0x57caca[_0x70f9('0x17')](0x1f4,_0x40496a[_0x70f9('0x18')]));});});};exports['ShowChatQueue']=function(_0x2a8cc9){var _0x227845=this;return new Promise(function(_0x47a7d7,_0x8bc855){return db[_0x70f9('0x1c')][_0x70f9('0x25')]({'raw':_0x2a8cc9['options']?_0x2a8cc9[_0x70f9('0x1e')][_0x70f9('0x26')]===undefined?!![]:![]:!![],'where':_0x2a8cc9['options']?_0x2a8cc9[_0x70f9('0x1e')][_0x70f9('0x1f')]||null:null,'attributes':_0x2a8cc9['options']?_0x2a8cc9[_0x70f9('0x1e')][_0x70f9('0x24')]||null:null,'include':_0x2a8cc9[_0x70f9('0x1e')]?_0x2a8cc9[_0x70f9('0x1e')][_0x70f9('0x21')]?_[_0x70f9('0x22')](_0x2a8cc9[_0x70f9('0x1e')]['include'],function(_0x3a7e9e){return{'model':db[_0x3a7e9e[_0x70f9('0x23')]],'as':_0x3a7e9e['as'],'attributes':_0x3a7e9e[_0x70f9('0x24')],'include':_0x3a7e9e[_0x70f9('0x21')]?_[_0x70f9('0x22')](_0x3a7e9e[_0x70f9('0x21')],function(_0x5adf6e){return{'model':db[_0x5adf6e[_0x70f9('0x23')]],'as':_0x5adf6e['as'],'attributes':_0x5adf6e[_0x70f9('0x24')],'include':_0x5adf6e['include']?_[_0x70f9('0x22')](_0x5adf6e['include'],function(_0x375d84){return{'model':db[_0x375d84['model']],'as':_0x375d84['as'],'attributes':_0x375d84[_0x70f9('0x24')]};}):[]};}):[]};}):[]:[]})[_0x70f9('0x11')](function(_0x38e305){logger[_0x70f9('0x12')](_0x70f9('0x27'),_0x2a8cc9);logger[_0x70f9('0x14')](_0x70f9('0x27'),_0x2a8cc9,JSON[_0x70f9('0x16')](_0x38e305));_0x47a7d7(_0x38e305);})[_0x70f9('0x28')](function(_0x16c40c){logger['error'](_0x70f9('0x27'),_0x16c40c[_0x70f9('0x18')],_0x2a8cc9);_0x8bc855(_0x227845[_0x70f9('0x17')](0x1f4,_0x16c40c[_0x70f9('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index f8e3a2f..1b5299c 100644
--- a/server/api/chatQueue/chatQueue.socket.js
+++ b/server/api/chatQueue/chatQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb821=['remove','removeListener','register','length','chatQueue:','save'];(function(_0x32a2ed,_0x3294ac){var _0x48a283=function(_0x1f85e0){while(--_0x1f85e0){_0x32a2ed['push'](_0x32a2ed['shift']());}};_0x48a283(++_0x3294ac);}(_0xb821,0xa7));var _0x1b82=function(_0x34a584,_0x5b98bb){_0x34a584=_0x34a584-0x0;var _0x2420df=_0xb821[_0x34a584];return _0x2420df;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x1b82('0x0'),_0x1b82('0x1'),'update'];function createListener(_0x4a4f81,_0xbab478){return function(_0x578a10){_0xbab478['emit'](_0x4a4f81,_0x578a10);};}function removeListener(_0x3b1d14,_0x1403ab){return function(){ChatQueueEvents[_0x1b82('0x2')](_0x3b1d14,_0x1403ab);};}exports[_0x1b82('0x3')]=function(_0x597ca7){for(var _0x3e27c4=0x0,_0x192434=events[_0x1b82('0x4')];_0x3e27c4<_0x192434;_0x3e27c4++){var _0x3632dd=events[_0x3e27c4];var _0x18f45f=createListener(_0x1b82('0x5')+_0x3632dd,_0x597ca7);ChatQueueEvents['on'](_0x3632dd,_0x18f45f);}};
\ No newline at end of file
+var _0x4fdb=['removeListener','length','./chatQueue.events','save','remove','update','emit'];(function(_0x57c029,_0x302ebd){var _0x6b7d44=function(_0x13396a){while(--_0x13396a){_0x57c029['push'](_0x57c029['shift']());}};_0x6b7d44(++_0x302ebd);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x210c1e,_0xf9d47c){_0x210c1e=_0x210c1e-0x0;var _0x252ffd=_0x4fdb[_0x210c1e];return _0x252ffd;};'use strict';var ChatQueueEvents=require(_0xb4fd('0x0'));var events=[_0xb4fd('0x1'),_0xb4fd('0x2'),_0xb4fd('0x3')];function createListener(_0x3b399e,_0xafe34b){return function(_0x260a35){_0xafe34b[_0xb4fd('0x4')](_0x3b399e,_0x260a35);};}function removeListener(_0x1c0b08,_0x5b73bb){return function(){ChatQueueEvents[_0xb4fd('0x5')](_0x1c0b08,_0x5b73bb);};}exports['register']=function(_0x14052b){for(var _0x5d8b39=0x0,_0x53273f=events[_0xb4fd('0x6')];_0x5d8b39<_0x53273f;_0x5d8b39++){var _0x3af8e3=events[_0x5d8b39];var _0x1151b5=createListener('chatQueue:'+_0x3af8e3,_0x14052b);ChatQueueEvents['on'](_0x3af8e3,_0x1151b5);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index e7523a8..a9fedff 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x456fdf,_0x21483e){var _0x27d958=function(_0x36be7a){while(--_0x36be7a){_0x456fdf['push'](_0x456fdf['shift']());}};_0x27d958(++_0x21483e);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e74,0x175));var _0x43e7=function(_0x401a77,_0x489e10){_0x401a77=_0x401a77-0x0;var _0x3b5456=_0x3e74[_0x401a77];return _0x3b5456;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 191b4d6..e005c0a 100644
--- a/server/api/chatQueueReport/chatQueueReport.attributes.js
+++ b/server/api/chatQueueReport/chatQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7f58=['STRING','DATE','sequelize'];(function(_0x391866,_0x50a8c9){var _0x37b7eb=function(_0x960d38){while(--_0x960d38){_0x391866['push'](_0x391866['shift']());}};_0x37b7eb(++_0x50a8c9);}(_0x7f58,0x1ee));var _0x87f5=function(_0x2081c1,_0x25f8d2){_0x2081c1=_0x2081c1-0x0;var _0x5a8693=_0x7f58[_0x2081c1];return _0x5a8693;};'use strict';var moment=require('moment');var Sequelize=require(_0x87f5('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x87f5('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x87f5('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x87f5('0x2')]},'acceptAt':{'type':Sequelize[_0x87f5('0x2')]},'exitAt':{'type':Sequelize[_0x87f5('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x550f=['DATE','STRING'];(function(_0x56b63b,_0x161748){var _0x3f0d77=function(_0x236afb){while(--_0x236afb){_0x56b63b['push'](_0x56b63b['shift']());}};_0x3f0d77(++_0x161748);}(_0x550f,0x6d));var _0xf550=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x550f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xf550('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0xf550('0x0')]},'joinAt':{'type':Sequelize[_0xf550('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf550('0x0')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 12d0d6a..2161d15 100644
--- a/server/api/chatQueueReport/chatQueueReport.controller.js
+++ b/server/api/chatQueueReport/chatQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb145=['includeAll','findAll','rows','catch','show','params','include','options','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','end','error','stack','name','send','index','ChatQueueReport','rawAttributes','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x58a823,_0x147dfa){var _0x3967a7=function(_0x4b7534){while(--_0x4b7534){_0x58a823['push'](_0x58a823['shift']());}};_0x3967a7(++_0x147dfa);}(_0xb145,0xa3));var _0x5b14=function(_0x519eec,_0x5d8844){_0x519eec=_0x519eec-0x0;var _0x4e3980=_0xb145[_0x519eec];return _0x4e3980;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b14('0x0'));var zipdir=require(_0x5b14('0x1'));var jsonpatch=require(_0x5b14('0x2'));var rp=require(_0x5b14('0x3'));var moment=require(_0x5b14('0x4'));var BPromise=require(_0x5b14('0x5'));var Mustache=require(_0x5b14('0x6'));var util=require(_0x5b14('0x7'));var path=require('path');var sox=require(_0x5b14('0x8'));var csv=require(_0x5b14('0x9'));var ejs=require(_0x5b14('0xa'));var fs=require('fs');var fs_extra=require(_0x5b14('0xb'));var _=require('lodash');var squel=require(_0x5b14('0xc'));var crypto=require(_0x5b14('0xd'));var jsforce=require(_0x5b14('0xe'));var deskjs=require(_0x5b14('0xf'));var toCsv=require(_0x5b14('0x9'));var querystring=require('querystring');var Papa=require(_0x5b14('0x10'));var Redis=require(_0x5b14('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5b14('0x12'));var as=require(_0x5b14('0x13'));var hardwareService=require(_0x5b14('0x14'));var logger=require(_0x5b14('0x15'))(_0x5b14('0x16'));var utils=require('../../config/utils');var config=require(_0x5b14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b14('0x18'))['db'];function respondWithStatusCode(_0x1903a5,_0xc33723){_0xc33723=_0xc33723||0xcc;return function(_0x1cb56b){if(_0x1cb56b){return _0x1903a5[_0x5b14('0x19')](_0xc33723);}return _0x1903a5[_0x5b14('0x1a')](_0xc33723)['end']();};}function respondWithResult(_0x27b34b,_0x16f2a1){_0x16f2a1=_0x16f2a1||0xc8;return function(_0x35fb8b){if(_0x35fb8b){return _0x27b34b[_0x5b14('0x1a')](_0x16f2a1)[_0x5b14('0x1b')](_0x35fb8b);}};}function respondWithFilteredResult(_0x2a8fe5,_0x68f695){return function(_0xe5af75){if(_0xe5af75){var _0x183b0a=typeof _0x68f695[_0x5b14('0x1c')]===_0x5b14('0x1d')&&typeof _0x68f695[_0x5b14('0x1e')]==='undefined';var _0x24cfd0=_0xe5af75['count'];var _0x48d395=_0x183b0a?0x0:_0x68f695['offset'];var _0x3f397d=_0x183b0a?_0xe5af75[_0x5b14('0x1f')]:_0x68f695[_0x5b14('0x1c')]+_0x68f695[_0x5b14('0x1e')];var _0x3786f7;if(_0x3f397d>=_0x24cfd0){_0x3f397d=_0x24cfd0;_0x3786f7=0xc8;}else{_0x3786f7=0xce;}_0x2a8fe5[_0x5b14('0x1a')](_0x3786f7);return _0x2a8fe5[_0x5b14('0x20')]('Content-Range',_0x48d395+'-'+_0x3f397d+'/'+_0x24cfd0)['json'](_0xe5af75);}return null;};}function patchUpdates(_0x4fa079){return function(_0x4f4717){try{jsonpatch[_0x5b14('0x21')](_0x4f4717,_0x4fa079,!![]);}catch(_0x9a9495){return BPromise[_0x5b14('0x22')](_0x9a9495);}return _0x4f4717['save']();};}function saveUpdates(_0x1018d9,_0x1577f7){return function(_0x4857c7){if(_0x4857c7){return _0x4857c7[_0x5b14('0x23')](_0x1018d9)[_0x5b14('0x24')](function(_0x50951f){return _0x50951f;});}return null;};}function removeEntity(_0x33a293,_0x54073f){return function(_0x59282c){if(_0x59282c){return _0x59282c['destroy']()['then'](function(){_0x33a293[_0x5b14('0x1a')](0xcc)[_0x5b14('0x25')]();});}};}function handleEntityNotFound(_0x153a25,_0x5da505){return function(_0x46f86a){if(!_0x46f86a){_0x153a25[_0x5b14('0x19')](0x194);}return _0x46f86a;};}function handleError(_0x2ac7b0,_0x143648){_0x143648=_0x143648||0x1f4;return function(_0xe6851b){logger[_0x5b14('0x26')](_0xe6851b[_0x5b14('0x27')]);if(_0xe6851b[_0x5b14('0x28')]){delete _0xe6851b[_0x5b14('0x28')];}_0x2ac7b0[_0x5b14('0x1a')](_0x143648)[_0x5b14('0x29')](_0xe6851b);};}exports[_0x5b14('0x2a')]=function(_0x1c3c52,_0x266bbe){var _0x4cfd66={},_0x370fcd={},_0x18a76d={'count':0x0,'rows':[]};var _0x53b13d=_['map'](db[_0x5b14('0x2b')][_0x5b14('0x2c')],function(_0x5dca4f){return{'name':_0x5dca4f['fieldName'],'type':_0x5dca4f[_0x5b14('0x2d')]['key']};});_0x370fcd[_0x5b14('0x2e')]=_[_0x5b14('0x2f')](_0x53b13d,'name');_0x370fcd['query']=_[_0x5b14('0x30')](_0x1c3c52[_0x5b14('0x31')]);_0x370fcd[_0x5b14('0x32')]=_['intersection'](_0x370fcd[_0x5b14('0x2e')],_0x370fcd['query']);_0x4cfd66[_0x5b14('0x33')]=_[_0x5b14('0x34')](_0x370fcd[_0x5b14('0x2e')],qs[_0x5b14('0x35')](_0x1c3c52['query'][_0x5b14('0x35')]));_0x4cfd66[_0x5b14('0x33')]=_0x4cfd66[_0x5b14('0x33')][_0x5b14('0x36')]?_0x4cfd66['attributes']:_0x370fcd[_0x5b14('0x2e')];if(!_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x37')]('nolimit')){_0x4cfd66[_0x5b14('0x1e')]=qs['limit'](_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x1e')]);_0x4cfd66['offset']=qs[_0x5b14('0x1c')](_0x1c3c52[_0x5b14('0x31')]['offset']);}_0x4cfd66[_0x5b14('0x38')]=qs['sort'](_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x39')]);_0x4cfd66[_0x5b14('0x3a')]=qs[_0x5b14('0x32')](_['pick'](_0x1c3c52[_0x5b14('0x31')],_0x370fcd[_0x5b14('0x32')]),_0x53b13d);if(_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3b')]){_0x4cfd66[_0x5b14('0x3a')]=_[_0x5b14('0x3c')](_0x4cfd66[_0x5b14('0x3a')],{'$or':_[_0x5b14('0x2f')](_0x53b13d,function(_0x4f647c){if(_0x4f647c[_0x5b14('0x2d')]!==_0x5b14('0x3d')){var _0x3f9d1d={};_0x3f9d1d[_0x4f647c[_0x5b14('0x28')]]={'$like':'%'+_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3b')]+'%'};return _0x3f9d1d;}})});}_0x4cfd66=_[_0x5b14('0x3c')]({},_0x4cfd66,_0x1c3c52['options']);var _0x2ebaa8={'where':_0x4cfd66['where']};return db[_0x5b14('0x2b')][_0x5b14('0x1f')](_0x2ebaa8)['then'](function(_0x4c05ac){_0x18a76d['count']=_0x4c05ac;if(_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3e')]){_0x4cfd66['include']=[{'all':!![]}];}return db[_0x5b14('0x2b')][_0x5b14('0x3f')](_0x4cfd66);})[_0x5b14('0x24')](function(_0x3d0369){_0x18a76d[_0x5b14('0x40')]=_0x3d0369;return _0x18a76d;})['then'](respondWithFilteredResult(_0x266bbe,_0x4cfd66))[_0x5b14('0x41')](handleError(_0x266bbe,null));};exports[_0x5b14('0x42')]=function(_0x4fb46e,_0x996aee){var _0x985e69={'raw':!![],'where':{'id':_0x4fb46e[_0x5b14('0x43')]['id']}},_0x5cc257={};_0x5cc257['model']=_[_0x5b14('0x30')](db[_0x5b14('0x2b')][_0x5b14('0x2c')]);_0x5cc257[_0x5b14('0x31')]=_['keys'](_0x4fb46e[_0x5b14('0x31')]);_0x5cc257[_0x5b14('0x32')]=_[_0x5b14('0x34')](_0x5cc257[_0x5b14('0x2e')],_0x5cc257['query']);_0x985e69['attributes']=_[_0x5b14('0x34')](_0x5cc257[_0x5b14('0x2e')],qs['fields'](_0x4fb46e[_0x5b14('0x31')]['fields']));_0x985e69[_0x5b14('0x33')]=_0x985e69[_0x5b14('0x33')][_0x5b14('0x36')]?_0x985e69[_0x5b14('0x33')]:_0x5cc257[_0x5b14('0x2e')];if(_0x4fb46e['query'][_0x5b14('0x3e')]){_0x985e69[_0x5b14('0x44')]=[{'all':!![]}];}_0x985e69=_[_0x5b14('0x3c')]({},_0x985e69,_0x4fb46e[_0x5b14('0x45')]);return db[_0x5b14('0x2b')]['find'](_0x985e69)['then'](handleEntityNotFound(_0x996aee,null))[_0x5b14('0x24')](respondWithResult(_0x996aee,null))['catch'](handleError(_0x996aee,null));};exports['create']=function(_0x4825b4,_0x35d00d){return db[_0x5b14('0x2b')][_0x5b14('0x46')](_0x4825b4[_0x5b14('0x47')],{})[_0x5b14('0x24')](respondWithResult(_0x35d00d,0xc9))[_0x5b14('0x41')](handleError(_0x35d00d,null));};exports[_0x5b14('0x23')]=function(_0x4d2bee,_0x548e1c){if(_0x4d2bee['body']['id']){delete _0x4d2bee['body']['id'];}return db['ChatQueueReport'][_0x5b14('0x48')]({'where':{'id':_0x4d2bee[_0x5b14('0x43')]['id']}})[_0x5b14('0x24')](handleEntityNotFound(_0x548e1c,null))[_0x5b14('0x24')](saveUpdates(_0x4d2bee[_0x5b14('0x47')],null))['then'](respondWithResult(_0x548e1c,null))['catch'](handleError(_0x548e1c,null));};exports[_0x5b14('0x49')]=function(_0xd6ea50,_0x58b18e){return db[_0x5b14('0x2b')][_0x5b14('0x48')]({'where':{'id':_0xd6ea50['params']['id']}})['then'](handleEntityNotFound(_0x58b18e,null))[_0x5b14('0x24')](removeEntity(_0x58b18e,null))[_0x5b14('0x41')](handleError(_0x58b18e,null));};exports[_0x5b14('0x4a')]=function(_0x5d3782,_0x1a51d5){return db[_0x5b14('0x2b')][_0x5b14('0x4a')]()[_0x5b14('0x24')](respondWithResult(_0x1a51d5,null))[_0x5b14('0x41')](handleError(_0x1a51d5,null));};
\ No newline at end of file
+var _0xe6e9=['where','merge','VIRTUAL','includeAll','include','ChatQueueReport','findAll','catch','show','keys','options','create','body','find','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','type','model','query','intersection','attributes','fields','length','order','filters','pick','filter'];(function(_0x103314,_0x319d36){var _0x2f0601=function(_0x209a87){while(--_0x209a87){_0x103314['push'](_0x103314['shift']());}};_0x2f0601(++_0x319d36);}(_0xe6e9,0x182));var _0x9e6e=function(_0x15b492,_0x859298){_0x15b492=_0x15b492-0x0;var _0x16a45f=_0xe6e9[_0x15b492];return _0x16a45f;};'use strict';var emlformat=require(_0x9e6e('0x0'));var rimraf=require(_0x9e6e('0x1'));var zipdir=require(_0x9e6e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e6e('0x3'));var moment=require(_0x9e6e('0x4'));var BPromise=require(_0x9e6e('0x5'));var Mustache=require(_0x9e6e('0x6'));var util=require(_0x9e6e('0x7'));var path=require('path');var sox=require(_0x9e6e('0x8'));var csv=require(_0x9e6e('0x9'));var ejs=require(_0x9e6e('0xa'));var fs=require('fs');var fs_extra=require(_0x9e6e('0xb'));var _=require(_0x9e6e('0xc'));var squel=require('squel');var crypto=require(_0x9e6e('0xd'));var jsforce=require(_0x9e6e('0xe'));var deskjs=require(_0x9e6e('0xf'));var toCsv=require(_0x9e6e('0x9'));var querystring=require(_0x9e6e('0x10'));var Papa=require(_0x9e6e('0x11'));var Redis=require('ioredis');var authService=require(_0x9e6e('0x12'));var qs=require(_0x9e6e('0x13'));var as=require(_0x9e6e('0x14'));var hardwareService=require(_0x9e6e('0x15'));var logger=require('../../config/logger')(_0x9e6e('0x16'));var utils=require(_0x9e6e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9e6e('0x18'));var db=require(_0x9e6e('0x19'))['db'];function respondWithStatusCode(_0x1b85f1,_0x363f0c){_0x363f0c=_0x363f0c||0xcc;return function(_0x5a2cf9){if(_0x5a2cf9){return _0x1b85f1[_0x9e6e('0x1a')](_0x363f0c);}return _0x1b85f1[_0x9e6e('0x1b')](_0x363f0c)[_0x9e6e('0x1c')]();};}function respondWithResult(_0x2981d0,_0x3ade25){_0x3ade25=_0x3ade25||0xc8;return function(_0x38f89c){if(_0x38f89c){return _0x2981d0[_0x9e6e('0x1b')](_0x3ade25)[_0x9e6e('0x1d')](_0x38f89c);}};}function respondWithFilteredResult(_0x3080b1,_0x2dbdba){return function(_0x1941da){if(_0x1941da){var _0x236850=typeof _0x2dbdba[_0x9e6e('0x1e')]===_0x9e6e('0x1f')&&typeof _0x2dbdba[_0x9e6e('0x20')]===_0x9e6e('0x1f');var _0x592ba=_0x1941da[_0x9e6e('0x21')];var _0xfd921e=_0x236850?0x0:_0x2dbdba[_0x9e6e('0x1e')];var _0x2c5876=_0x236850?_0x1941da['count']:_0x2dbdba['offset']+_0x2dbdba['limit'];var _0x14acbd;if(_0x2c5876>=_0x592ba){_0x2c5876=_0x592ba;_0x14acbd=0xc8;}else{_0x14acbd=0xce;}_0x3080b1[_0x9e6e('0x1b')](_0x14acbd);return _0x3080b1[_0x9e6e('0x22')](_0x9e6e('0x23'),_0xfd921e+'-'+_0x2c5876+'/'+_0x592ba)[_0x9e6e('0x1d')](_0x1941da);}return null;};}function patchUpdates(_0x3b9299){return function(_0x195727){try{jsonpatch[_0x9e6e('0x24')](_0x195727,_0x3b9299,!![]);}catch(_0x4e66e3){return BPromise[_0x9e6e('0x25')](_0x4e66e3);}return _0x195727[_0x9e6e('0x26')]();};}function saveUpdates(_0x3b3527,_0x28ae35){return function(_0x1e97c3){if(_0x1e97c3){return _0x1e97c3[_0x9e6e('0x27')](_0x3b3527)[_0x9e6e('0x28')](function(_0x59e00e){return _0x59e00e;});}return null;};}function removeEntity(_0x223fd4,_0x4202cd){return function(_0x3aee5c){if(_0x3aee5c){return _0x3aee5c[_0x9e6e('0x29')]()['then'](function(){_0x223fd4['status'](0xcc)[_0x9e6e('0x1c')]();});}};}function handleEntityNotFound(_0xb7b794,_0x26e0be){return function(_0x4e17b7){if(!_0x4e17b7){_0xb7b794['sendStatus'](0x194);}return _0x4e17b7;};}function handleError(_0x383656,_0x36fef5){_0x36fef5=_0x36fef5||0x1f4;return function(_0x200f78){logger[_0x9e6e('0x2a')](_0x200f78['stack']);if(_0x200f78['name']){delete _0x200f78[_0x9e6e('0x2b')];}_0x383656['status'](_0x36fef5)[_0x9e6e('0x2c')](_0x200f78);};}exports['index']=function(_0x43b1bf,_0x3130b8){var _0x4a0c94={},_0x2511f7={},_0x16f6f7={'count':0x0,'rows':[]};var _0x34f5ff=_[_0x9e6e('0x2d')](db['ChatQueueReport'][_0x9e6e('0x2e')],function(_0x59e4a5){return{'name':_0x59e4a5['fieldName'],'type':_0x59e4a5[_0x9e6e('0x2f')]['key']};});_0x2511f7[_0x9e6e('0x30')]=_[_0x9e6e('0x2d')](_0x34f5ff,_0x9e6e('0x2b'));_0x2511f7[_0x9e6e('0x31')]=_['keys'](_0x43b1bf[_0x9e6e('0x31')]);_0x2511f7['filters']=_[_0x9e6e('0x32')](_0x2511f7['model'],_0x2511f7['query']);_0x4a0c94[_0x9e6e('0x33')]=_[_0x9e6e('0x32')](_0x2511f7[_0x9e6e('0x30')],qs['fields'](_0x43b1bf[_0x9e6e('0x31')][_0x9e6e('0x34')]));_0x4a0c94[_0x9e6e('0x33')]=_0x4a0c94['attributes'][_0x9e6e('0x35')]?_0x4a0c94[_0x9e6e('0x33')]:_0x2511f7[_0x9e6e('0x30')];if(!_0x43b1bf['query']['hasOwnProperty']('nolimit')){_0x4a0c94[_0x9e6e('0x20')]=qs[_0x9e6e('0x20')](_0x43b1bf['query'][_0x9e6e('0x20')]);_0x4a0c94['offset']=qs['offset'](_0x43b1bf[_0x9e6e('0x31')][_0x9e6e('0x1e')]);}_0x4a0c94[_0x9e6e('0x36')]=qs['sort'](_0x43b1bf[_0x9e6e('0x31')]['sort']);_0x4a0c94['where']=qs[_0x9e6e('0x37')](_[_0x9e6e('0x38')](_0x43b1bf[_0x9e6e('0x31')],_0x2511f7['filters']),_0x34f5ff);if(_0x43b1bf[_0x9e6e('0x31')][_0x9e6e('0x39')]){_0x4a0c94[_0x9e6e('0x3a')]=_[_0x9e6e('0x3b')](_0x4a0c94[_0x9e6e('0x3a')],{'$or':_[_0x9e6e('0x2d')](_0x34f5ff,function(_0x511df4){if(_0x511df4[_0x9e6e('0x2f')]!==_0x9e6e('0x3c')){var _0x479318={};_0x479318[_0x511df4[_0x9e6e('0x2b')]]={'$like':'%'+_0x43b1bf[_0x9e6e('0x31')][_0x9e6e('0x39')]+'%'};return _0x479318;}})});}_0x4a0c94=_[_0x9e6e('0x3b')]({},_0x4a0c94,_0x43b1bf['options']);var _0x4d045d={'where':_0x4a0c94[_0x9e6e('0x3a')]};return db['ChatQueueReport']['count'](_0x4d045d)['then'](function(_0x4ebb41){_0x16f6f7['count']=_0x4ebb41;if(_0x43b1bf['query'][_0x9e6e('0x3d')]){_0x4a0c94[_0x9e6e('0x3e')]=[{'all':!![]}];}return db[_0x9e6e('0x3f')][_0x9e6e('0x40')](_0x4a0c94);})[_0x9e6e('0x28')](function(_0x272461){_0x16f6f7['rows']=_0x272461;return _0x16f6f7;})[_0x9e6e('0x28')](respondWithFilteredResult(_0x3130b8,_0x4a0c94))[_0x9e6e('0x41')](handleError(_0x3130b8,null));};exports[_0x9e6e('0x42')]=function(_0x324d1c,_0xbda0d2){var _0x5a7f55={'raw':!![],'where':{'id':_0x324d1c['params']['id']}},_0x5e7bc4={};_0x5e7bc4[_0x9e6e('0x30')]=_[_0x9e6e('0x43')](db[_0x9e6e('0x3f')][_0x9e6e('0x2e')]);_0x5e7bc4[_0x9e6e('0x31')]=_[_0x9e6e('0x43')](_0x324d1c[_0x9e6e('0x31')]);_0x5e7bc4['filters']=_[_0x9e6e('0x32')](_0x5e7bc4[_0x9e6e('0x30')],_0x5e7bc4['query']);_0x5a7f55[_0x9e6e('0x33')]=_[_0x9e6e('0x32')](_0x5e7bc4['model'],qs['fields'](_0x324d1c[_0x9e6e('0x31')][_0x9e6e('0x34')]));_0x5a7f55[_0x9e6e('0x33')]=_0x5a7f55['attributes'][_0x9e6e('0x35')]?_0x5a7f55[_0x9e6e('0x33')]:_0x5e7bc4[_0x9e6e('0x30')];if(_0x324d1c[_0x9e6e('0x31')][_0x9e6e('0x3d')]){_0x5a7f55['include']=[{'all':!![]}];}_0x5a7f55=_['merge']({},_0x5a7f55,_0x324d1c[_0x9e6e('0x44')]);return db[_0x9e6e('0x3f')]['find'](_0x5a7f55)['then'](handleEntityNotFound(_0xbda0d2,null))[_0x9e6e('0x28')](respondWithResult(_0xbda0d2,null))[_0x9e6e('0x41')](handleError(_0xbda0d2,null));};exports['create']=function(_0x22f916,_0x44a54f){return db[_0x9e6e('0x3f')][_0x9e6e('0x45')](_0x22f916[_0x9e6e('0x46')],{})[_0x9e6e('0x28')](respondWithResult(_0x44a54f,0xc9))[_0x9e6e('0x41')](handleError(_0x44a54f,null));};exports[_0x9e6e('0x27')]=function(_0x7d8b61,_0x2c202b){if(_0x7d8b61[_0x9e6e('0x46')]['id']){delete _0x7d8b61[_0x9e6e('0x46')]['id'];}return db[_0x9e6e('0x3f')][_0x9e6e('0x47')]({'where':{'id':_0x7d8b61[_0x9e6e('0x48')]['id']}})[_0x9e6e('0x28')](handleEntityNotFound(_0x2c202b,null))[_0x9e6e('0x28')](saveUpdates(_0x7d8b61[_0x9e6e('0x46')],null))['then'](respondWithResult(_0x2c202b,null))[_0x9e6e('0x41')](handleError(_0x2c202b,null));};exports['destroy']=function(_0x52049c,_0x3c2cb7){return db['ChatQueueReport']['find']({'where':{'id':_0x52049c[_0x9e6e('0x48')]['id']}})[_0x9e6e('0x28')](handleEntityNotFound(_0x3c2cb7,null))[_0x9e6e('0x28')](removeEntity(_0x3c2cb7,null))['catch'](handleError(_0x3c2cb7,null));};exports[_0x9e6e('0x49')]=function(_0x58b478,_0x2391f9){return db['ChatQueueReport'][_0x9e6e('0x49')]()[_0x9e6e('0x28')](respondWithResult(_0x2391f9,null))[_0x9e6e('0x41')](handleError(_0x2391f9,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 73f52b3..73a2f93 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x47295c,_0x5e82a6){var _0x4b5d81=function(_0x56aef4){while(--_0x56aef4){_0x47295c['push'](_0x47295c['shift']());}};_0x4b5d81(++_0x5e82a6);}(_0x757a,0xde));var _0xa757=function(_0x1114af,_0x5c0913){_0x1114af=_0x1114af-0x0;var _0x314bb6=_0x757a[_0x1114af];return _0x314bb6;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index c749343..08c16a4 100644
--- a/server/api/chatQueueReport/chatQueueReport.rpc.js
+++ b/server/api/chatQueueReport/chatQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2b22=['CreateChatQueueReport','create','body','options','raw','debug','catch','ChatQueueReport','update','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result'];(function(_0x1aa3fe,_0x27c5fa){var _0x163cee=function(_0x2a1505){while(--_0x2a1505){_0x1aa3fe['push'](_0x1aa3fe['shift']());}};_0x163cee(++_0x27c5fa);}(_0x2b22,0xf4));var _0x22b2=function(_0x415644,_0x1a1f29){_0x415644=_0x415644-0x0;var _0x435868=_0x2b22[_0x415644];return _0x435868;};'use strict';var _=require(_0x22b2('0x0'));var util=require(_0x22b2('0x1'));var moment=require(_0x22b2('0x2'));var BPromise=require(_0x22b2('0x3'));var rs=require(_0x22b2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22b2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22b2('0x6'))('rpc');var config=require(_0x22b2('0x7'));var jayson=require(_0x22b2('0x8'));var client=jayson[_0x22b2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3adb9a,_0x131f2b,_0xad3eed){return new BPromise(function(_0xc2a90b,_0x2ccc96){return client[_0x22b2('0xa')](_0x3adb9a,_0xad3eed)[_0x22b2('0xb')](function(_0x30db3c){logger[_0x22b2('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x131f2b,_0x22b2('0xd'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x131f2b,_0x22b2('0xd'),JSON[_0x22b2('0xe')](_0x30db3c));if(_0x30db3c[_0x22b2('0xf')]){if(_0x30db3c['error'][_0x22b2('0x10')]===0x1f4){logger['error'](_0x22b2('0x11'),_0x131f2b,_0x30db3c[_0x22b2('0xf')]['message']);return _0x2ccc96(_0x30db3c[_0x22b2('0xf')][_0x22b2('0x12')]);}logger[_0x22b2('0xf')](_0x22b2('0x11'),_0x131f2b,_0x30db3c[_0x22b2('0xf')][_0x22b2('0x12')]);return _0xc2a90b(_0x30db3c['error'][_0x22b2('0x12')]);}else{logger[_0x22b2('0xc')](_0x22b2('0x11'),_0x131f2b,_0x22b2('0xd'));_0xc2a90b(_0x30db3c[_0x22b2('0x13')][_0x22b2('0x12')]);}})['catch'](function(_0x2418e6){logger[_0x22b2('0xf')](_0x22b2('0x11'),_0x131f2b,_0x2418e6);_0x2ccc96(_0x2418e6);});});}exports[_0x22b2('0x14')]=function(_0x4f1c65){var _0x5792e8=this;return new Promise(function(_0x57bd92,_0x25c211){return db['ChatQueueReport'][_0x22b2('0x15')](_0x4f1c65[_0x22b2('0x16')],{'raw':_0x4f1c65['options']?_0x4f1c65[_0x22b2('0x17')][_0x22b2('0x18')]===undefined?!![]:![]:!![]})[_0x22b2('0xb')](function(_0x57d092){logger[_0x22b2('0xc')](_0x22b2('0x14'),_0x4f1c65);logger[_0x22b2('0x19')](_0x22b2('0x14'),_0x4f1c65,JSON[_0x22b2('0xe')](_0x57d092));_0x57bd92(_0x57d092);})[_0x22b2('0x1a')](function(_0x54beed){logger[_0x22b2('0xf')](_0x22b2('0x14'),_0x54beed[_0x22b2('0x12')],_0x4f1c65);_0x25c211(_0x5792e8[_0x22b2('0xf')](0x1f4,_0x54beed[_0x22b2('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x353e5f){var _0x831a52=this;return new Promise(function(_0x2464b8,_0x11ff04){return db[_0x22b2('0x1b')][_0x22b2('0x1c')](_0x353e5f['body'],{'raw':_0x353e5f['options']?_0x353e5f[_0x22b2('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x353e5f[_0x22b2('0x17')]?_0x353e5f[_0x22b2('0x17')][_0x22b2('0x1d')]||null:null,'attributes':_0x353e5f[_0x22b2('0x17')]?_0x353e5f['options'][_0x22b2('0x1e')]||null:null,'limit':_0x353e5f[_0x22b2('0x17')]?_0x353e5f[_0x22b2('0x17')][_0x22b2('0x1f')]||null:null})['then'](function(_0x1f38a4){logger[_0x22b2('0xc')](_0x22b2('0x20'),_0x353e5f);logger['debug'](_0x22b2('0x20'),_0x353e5f,JSON['stringify'](_0x1f38a4));_0x2464b8(_0x1f38a4);})['catch'](function(_0x530f26){logger[_0x22b2('0xf')](_0x22b2('0x20'),_0x530f26[_0x22b2('0x12')],_0x353e5f);_0x11ff04(_0x831a52[_0x22b2('0xf')](0x1f4,_0x530f26['message']));});});};
\ No newline at end of file
+var _0x93d3=['result','catch','CreateChatQueueReport','ChatQueueReport','create','options','UpdateChatQueueReport','update','raw','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x595a21,_0x24790f){var _0x50df84=function(_0x3c7188){while(--_0x3c7188){_0x595a21['push'](_0x595a21['shift']());}};_0x50df84(++_0x24790f);}(_0x93d3,0x1ec));var _0x393d=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x93d3[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x393d('0x0'));var util=require(_0x393d('0x1'));var moment=require(_0x393d('0x2'));var BPromise=require(_0x393d('0x3'));var rs=require(_0x393d('0x4'));var fs=require('fs');var Redis=require(_0x393d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x393d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x393d('0x7'));var jayson=require(_0x393d('0x8'));var client=jayson[_0x393d('0x9')][_0x393d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5267ac,_0x114d22,_0x5b75ea){return new BPromise(function(_0x53f6a4,_0x38825e){return client[_0x393d('0xb')](_0x5267ac,_0x5b75ea)[_0x393d('0xc')](function(_0x56ea95){logger[_0x393d('0xd')](_0x393d('0xe'),_0x114d22,'request\x20sent');logger[_0x393d('0xf')](_0x393d('0x10'),_0x114d22,_0x393d('0x11'),JSON['stringify'](_0x56ea95));if(_0x56ea95[_0x393d('0x12')]){if(_0x56ea95[_0x393d('0x12')]['code']===0x1f4){logger['error'](_0x393d('0xe'),_0x114d22,_0x56ea95[_0x393d('0x12')][_0x393d('0x13')]);return _0x38825e(_0x56ea95['error']['message']);}logger['error'](_0x393d('0xe'),_0x114d22,_0x56ea95['error']['message']);return _0x53f6a4(_0x56ea95['error'][_0x393d('0x13')]);}else{logger[_0x393d('0xd')](_0x393d('0xe'),_0x114d22,_0x393d('0x11'));_0x53f6a4(_0x56ea95[_0x393d('0x14')][_0x393d('0x13')]);}})[_0x393d('0x15')](function(_0x34ce28){logger[_0x393d('0x12')](_0x393d('0xe'),_0x114d22,_0x34ce28);_0x38825e(_0x34ce28);});});}exports[_0x393d('0x16')]=function(_0x2d4ae5){var _0x1e16cb=this;return new Promise(function(_0x2f3f87,_0x4327fa){return db[_0x393d('0x17')][_0x393d('0x18')](_0x2d4ae5['body'],{'raw':_0x2d4ae5['options']?_0x2d4ae5[_0x393d('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x28fb9d){logger[_0x393d('0xd')](_0x393d('0x16'),_0x2d4ae5);logger[_0x393d('0xf')](_0x393d('0x16'),_0x2d4ae5,JSON['stringify'](_0x28fb9d));_0x2f3f87(_0x28fb9d);})[_0x393d('0x15')](function(_0x496f54){logger[_0x393d('0x12')](_0x393d('0x16'),_0x496f54[_0x393d('0x13')],_0x2d4ae5);_0x4327fa(_0x1e16cb[_0x393d('0x12')](0x1f4,_0x496f54[_0x393d('0x13')]));});});};exports[_0x393d('0x1a')]=function(_0x564030){var _0x271ec6=this;return new Promise(function(_0x2cfdee,_0x5b01b7){return db['ChatQueueReport'][_0x393d('0x1b')](_0x564030['body'],{'raw':_0x564030['options']?_0x564030['options'][_0x393d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x564030[_0x393d('0x19')]?_0x564030[_0x393d('0x19')]['where']||null:null,'attributes':_0x564030[_0x393d('0x19')]?_0x564030[_0x393d('0x19')][_0x393d('0x1d')]||null:null,'limit':_0x564030[_0x393d('0x19')]?_0x564030[_0x393d('0x19')][_0x393d('0x1e')]||null:null})['then'](function(_0x2b24dc){logger['info'](_0x393d('0x1a'),_0x564030);logger['debug'](_0x393d('0x1a'),_0x564030,JSON[_0x393d('0x1f')](_0x2b24dc));_0x2cfdee(_0x2b24dc);})[_0x393d('0x15')](function(_0x366ef4){logger['error'](_0x393d('0x1a'),_0x366ef4[_0x393d('0x13')],_0x564030);_0x5b01b7(_0x271ec6[_0x393d('0x12')](0x1f4,_0x366ef4[_0x393d('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 255ae25..95ab337 100644
--- a/server/api/chatQueueReport/index.js
+++ b/server/api/chatQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1bcf=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x265003,_0xf0f023){var _0x33c743=function(_0x326a5d){while(--_0x326a5d){_0x265003['push'](_0x265003['shift']());}};_0x33c743(++_0xf0f023);}(_0x1bcf,0x121));var _0xf1bc=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0x1bcf[_0x80d733];return _0x435868;};'use strict';var multer=require(_0xf1bc('0x0'));var util=require(_0xf1bc('0x1'));var path=require('path');var timeout=require(_0xf1bc('0x2'));var express=require('express');var router=express[_0xf1bc('0x3')]();var fs_extra=require(_0xf1bc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf1bc('0x5'));var config=require(_0xf1bc('0x6'));var controller=require(_0xf1bc('0x7'));router[_0xf1bc('0x8')]('/',auth[_0xf1bc('0x9')](),controller[_0xf1bc('0xa')]);router[_0xf1bc('0x8')](_0xf1bc('0xb'),auth[_0xf1bc('0x9')](),controller[_0xf1bc('0xc')]);router[_0xf1bc('0x8')](_0xf1bc('0xd'),auth[_0xf1bc('0x9')](),controller[_0xf1bc('0xe')]);router[_0xf1bc('0xf')]('/',auth[_0xf1bc('0x9')](),controller[_0xf1bc('0x10')]);router['put'](_0xf1bc('0xd'),auth['isAuthenticated'](),controller[_0xf1bc('0x11')]);router[_0xf1bc('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf1bc('0x13')]);module[_0xf1bc('0x14')]=router;
\ No newline at end of file
+var _0x7a1f=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','index','/describe','describe','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x11f780,_0x460e0d){var _0x25fe60=function(_0x4c886c){while(--_0x4c886c){_0x11f780['push'](_0x11f780['shift']());}};_0x25fe60(++_0x460e0d);}(_0x7a1f,0x1e1));var _0xf7a1=function(_0x2e3dfc,_0x454d6c){_0x2e3dfc=_0x2e3dfc-0x0;var _0x4b1245=_0x7a1f[_0x2e3dfc];return _0x4b1245;};'use strict';var multer=require(_0xf7a1('0x0'));var util=require(_0xf7a1('0x1'));var path=require(_0xf7a1('0x2'));var timeout=require(_0xf7a1('0x3'));var express=require(_0xf7a1('0x4'));var router=express[_0xf7a1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf7a1('0x6'));var interaction=require(_0xf7a1('0x7'));var config=require('../../config/environment');var controller=require(_0xf7a1('0x8'));router[_0xf7a1('0x9')]('/',auth['isAuthenticated'](),controller[_0xf7a1('0xa')]);router[_0xf7a1('0x9')](_0xf7a1('0xb'),auth['isAuthenticated'](),controller[_0xf7a1('0xc')]);router[_0xf7a1('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf7a1('0xd')]('/',auth[_0xf7a1('0xe')](),controller[_0xf7a1('0xf')]);router[_0xf7a1('0x10')](_0xf7a1('0x11'),auth[_0xf7a1('0xe')](),controller[_0xf7a1('0x12')]);router[_0xf7a1('0x13')](_0xf7a1('0x11'),auth[_0xf7a1('0xe')](),controller[_0xf7a1('0x14')]);module[_0xf7a1('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 09f87f4..9b0e8a6 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x37f979,_0x4e2e14){var _0x1f7f9d=function(_0x18277f){while(--_0x18277f){_0x37f979['push'](_0x37f979['shift']());}};_0x1f7f9d(++_0x4e2e14);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2ffc46,_0x35ce3c){_0x2ffc46=_0x2ffc46-0x0;var _0x1eda8f=_0x4b84[_0x2ffc46];return _0x1eda8f;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x25ba6a,_0x4422d6){var _0x1be09a=function(_0x308e7b){while(--_0x308e7b){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x1be09a(++_0x4422d6);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index de33c11..fa69cf1 100644
--- a/server/api/chatTransferReport/chatTransferReport.controller.js
+++ b/server/api/chatTransferReport/chatTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9068=['intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','ChatTransferReport','includeAll','rows','catch','show','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','name','rawAttributes','type','key','map','keys','filters'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x9068,0xa4));var _0x8906=function(_0x5e9f84,_0x576552){_0x5e9f84=_0x5e9f84-0x0;var _0x3325ee=_0x9068[_0x5e9f84];return _0x3325ee;};'use strict';var emlformat=require(_0x8906('0x0'));var rimraf=require(_0x8906('0x1'));var zipdir=require(_0x8906('0x2'));var jsonpatch=require(_0x8906('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8906('0x4'));var Mustache=require(_0x8906('0x5'));var util=require('util');var path=require(_0x8906('0x6'));var sox=require(_0x8906('0x7'));var csv=require(_0x8906('0x8'));var ejs=require(_0x8906('0x9'));var fs=require('fs');var fs_extra=require(_0x8906('0xa'));var _=require(_0x8906('0xb'));var squel=require('squel');var crypto=require(_0x8906('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8906('0xd'));var toCsv=require(_0x8906('0x8'));var querystring=require(_0x8906('0xe'));var Papa=require(_0x8906('0xf'));var Redis=require(_0x8906('0x10'));var authService=require(_0x8906('0x11'));var qs=require(_0x8906('0x12'));var as=require(_0x8906('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8906('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8906('0x15'))['db'];function respondWithStatusCode(_0x3c380b,_0x2b5882){_0x2b5882=_0x2b5882||0xcc;return function(_0x672364){if(_0x672364){return _0x3c380b[_0x8906('0x16')](_0x2b5882);}return _0x3c380b[_0x8906('0x17')](_0x2b5882)['end']();};}function respondWithResult(_0x46ab0a,_0x4b02b6){_0x4b02b6=_0x4b02b6||0xc8;return function(_0x212408){if(_0x212408){return _0x46ab0a[_0x8906('0x17')](_0x4b02b6)[_0x8906('0x18')](_0x212408);}};}function respondWithFilteredResult(_0x576b57,_0x2aa690){return function(_0x39886c){if(_0x39886c){var _0x257b11=typeof _0x2aa690[_0x8906('0x19')]==='undefined'&&typeof _0x2aa690[_0x8906('0x1a')]===_0x8906('0x1b');var _0x3d40f6=_0x39886c[_0x8906('0x1c')];var _0xa97320=_0x257b11?0x0:_0x2aa690[_0x8906('0x19')];var _0x5a3d80=_0x257b11?_0x39886c[_0x8906('0x1c')]:_0x2aa690['offset']+_0x2aa690[_0x8906('0x1a')];var _0x286ff2;if(_0x5a3d80>=_0x3d40f6){_0x5a3d80=_0x3d40f6;_0x286ff2=0xc8;}else{_0x286ff2=0xce;}_0x576b57['status'](_0x286ff2);return _0x576b57['set'](_0x8906('0x1d'),_0xa97320+'-'+_0x5a3d80+'/'+_0x3d40f6)[_0x8906('0x18')](_0x39886c);}return null;};}function patchUpdates(_0x314d57){return function(_0x2584ff){try{jsonpatch[_0x8906('0x1e')](_0x2584ff,_0x314d57,!![]);}catch(_0x419242){return BPromise[_0x8906('0x1f')](_0x419242);}return _0x2584ff[_0x8906('0x20')]();};}function saveUpdates(_0x1efc87,_0x2f3b46){return function(_0x5f03c5){if(_0x5f03c5){return _0x5f03c5[_0x8906('0x21')](_0x1efc87)['then'](function(_0x256c79){return _0x256c79;});}return null;};}function removeEntity(_0x3155db,_0x4e37a8){return function(_0x2a35d8){if(_0x2a35d8){return _0x2a35d8['destroy']()[_0x8906('0x22')](function(){_0x3155db[_0x8906('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x340d00,_0x51ab61){return function(_0x60fd2a){if(!_0x60fd2a){_0x340d00[_0x8906('0x16')](0x194);}return _0x60fd2a;};}function handleError(_0x22efb8,_0x245325){_0x245325=_0x245325||0x1f4;return function(_0x40263c){logger[_0x8906('0x23')](_0x40263c['stack']);if(_0x40263c['name']){delete _0x40263c[_0x8906('0x24')];}_0x22efb8[_0x8906('0x17')](_0x245325)['send'](_0x40263c);};}exports['index']=function(_0x1d7ad8,_0x1988e8){var _0x58fbfe={},_0x180b7b={},_0x2903e={'count':0x0,'rows':[]};var _0x3892fd=_['map'](db['ChatTransferReport'][_0x8906('0x25')],function(_0x48e572){return{'name':_0x48e572['fieldName'],'type':_0x48e572[_0x8906('0x26')][_0x8906('0x27')]};});_0x180b7b['model']=_[_0x8906('0x28')](_0x3892fd,_0x8906('0x24'));_0x180b7b['query']=_[_0x8906('0x29')](_0x1d7ad8['query']);_0x180b7b[_0x8906('0x2a')]=_[_0x8906('0x2b')](_0x180b7b['model'],_0x180b7b[_0x8906('0x2c')]);_0x58fbfe[_0x8906('0x2d')]=_[_0x8906('0x2b')](_0x180b7b[_0x8906('0x2e')],qs['fields'](_0x1d7ad8[_0x8906('0x2c')][_0x8906('0x2f')]));_0x58fbfe['attributes']=_0x58fbfe[_0x8906('0x2d')][_0x8906('0x30')]?_0x58fbfe[_0x8906('0x2d')]:_0x180b7b[_0x8906('0x2e')];if(!_0x1d7ad8['query'][_0x8906('0x31')](_0x8906('0x32'))){_0x58fbfe['limit']=qs[_0x8906('0x1a')](_0x1d7ad8['query'][_0x8906('0x1a')]);_0x58fbfe['offset']=qs[_0x8906('0x19')](_0x1d7ad8['query'][_0x8906('0x19')]);}_0x58fbfe[_0x8906('0x33')]=qs[_0x8906('0x34')](_0x1d7ad8[_0x8906('0x2c')]['sort']);_0x58fbfe[_0x8906('0x35')]=qs['filters'](_['pick'](_0x1d7ad8['query'],_0x180b7b['filters']),_0x3892fd);if(_0x1d7ad8[_0x8906('0x2c')][_0x8906('0x36')]){_0x58fbfe[_0x8906('0x35')]=_['merge'](_0x58fbfe['where'],{'$or':_[_0x8906('0x28')](_0x3892fd,function(_0xf6a939){if(_0xf6a939['type']!==_0x8906('0x37')){var _0x23c3ce={};_0x23c3ce[_0xf6a939[_0x8906('0x24')]]={'$like':'%'+_0x1d7ad8[_0x8906('0x2c')][_0x8906('0x36')]+'%'};return _0x23c3ce;}})});}_0x58fbfe=_[_0x8906('0x38')]({},_0x58fbfe,_0x1d7ad8[_0x8906('0x39')]);var _0x5a10ed={'where':_0x58fbfe[_0x8906('0x35')]};return db[_0x8906('0x3a')][_0x8906('0x1c')](_0x5a10ed)[_0x8906('0x22')](function(_0x5508c5){_0x2903e['count']=_0x5508c5;if(_0x1d7ad8['query'][_0x8906('0x3b')]){_0x58fbfe['include']=[{'all':!![]}];}return db[_0x8906('0x3a')]['findAll'](_0x58fbfe);})[_0x8906('0x22')](function(_0x4bbeaf){_0x2903e[_0x8906('0x3c')]=_0x4bbeaf;return _0x2903e;})[_0x8906('0x22')](respondWithFilteredResult(_0x1988e8,_0x58fbfe))[_0x8906('0x3d')](handleError(_0x1988e8,null));};exports[_0x8906('0x3e')]=function(_0xa91b02,_0x377cca){var _0x545a5e={'raw':!![],'where':{'id':_0xa91b02['params']['id']}},_0x343ef3={};_0x343ef3[_0x8906('0x2e')]=_[_0x8906('0x29')](db['ChatTransferReport'][_0x8906('0x25')]);_0x343ef3[_0x8906('0x2c')]=_[_0x8906('0x29')](_0xa91b02[_0x8906('0x2c')]);_0x343ef3[_0x8906('0x2a')]=_[_0x8906('0x2b')](_0x343ef3[_0x8906('0x2e')],_0x343ef3[_0x8906('0x2c')]);_0x545a5e[_0x8906('0x2d')]=_[_0x8906('0x2b')](_0x343ef3[_0x8906('0x2e')],qs[_0x8906('0x2f')](_0xa91b02['query'][_0x8906('0x2f')]));_0x545a5e[_0x8906('0x2d')]=_0x545a5e['attributes'][_0x8906('0x30')]?_0x545a5e[_0x8906('0x2d')]:_0x343ef3['model'];if(_0xa91b02['query'][_0x8906('0x3b')]){_0x545a5e['include']=[{'all':!![]}];}_0x545a5e=_[_0x8906('0x38')]({},_0x545a5e,_0xa91b02[_0x8906('0x39')]);return db[_0x8906('0x3a')][_0x8906('0x3f')](_0x545a5e)[_0x8906('0x22')](handleEntityNotFound(_0x377cca,null))['then'](respondWithResult(_0x377cca,null))[_0x8906('0x3d')](handleError(_0x377cca,null));};exports[_0x8906('0x40')]=function(_0x5ac226,_0x13e10c){return db[_0x8906('0x3a')][_0x8906('0x40')](_0x5ac226[_0x8906('0x41')],{})[_0x8906('0x22')](respondWithResult(_0x13e10c,0xc9))['catch'](handleError(_0x13e10c,null));};exports[_0x8906('0x21')]=function(_0x53c734,_0x1549a9){if(_0x53c734[_0x8906('0x41')]['id']){delete _0x53c734['body']['id'];}return db[_0x8906('0x3a')][_0x8906('0x3f')]({'where':{'id':_0x53c734[_0x8906('0x42')]['id']}})['then'](handleEntityNotFound(_0x1549a9,null))[_0x8906('0x22')](saveUpdates(_0x53c734[_0x8906('0x41')],null))[_0x8906('0x22')](respondWithResult(_0x1549a9,null))['catch'](handleError(_0x1549a9,null));};exports[_0x8906('0x43')]=function(_0x115421,_0x47059c){return db[_0x8906('0x3a')]['find']({'where':{'id':_0x115421[_0x8906('0x42')]['id']}})[_0x8906('0x22')](handleEntityNotFound(_0x47059c,null))[_0x8906('0x22')](removeEntity(_0x47059c,null))[_0x8906('0x3d')](handleError(_0x47059c,null));};exports['describe']=function(_0x1678cb,_0x396f4e){return db[_0x8906('0x3a')][_0x8906('0x44')]()[_0x8906('0x22')](respondWithResult(_0x396f4e,null))[_0x8906('0x3d')](handleError(_0x396f4e,null));};
\ No newline at end of file
+var _0x63d9=['show','params','keys','fields','then','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','filter','options','include','findAll','rows','catch'];(function(_0x357b63,_0x16c0e2){var _0x46b0cd=function(_0x4c1c1b){while(--_0x4c1c1b){_0x357b63['push'](_0x357b63['shift']());}};_0x46b0cd(++_0x16c0e2);}(_0x63d9,0xef));var _0x963d=function(_0x10fc8d,_0x34a157){_0x10fc8d=_0x10fc8d-0x0;var _0x5add3d=_0x63d9[_0x10fc8d];return _0x5add3d;};'use strict';var emlformat=require(_0x963d('0x0'));var rimraf=require(_0x963d('0x1'));var zipdir=require(_0x963d('0x2'));var jsonpatch=require(_0x963d('0x3'));var rp=require(_0x963d('0x4'));var moment=require(_0x963d('0x5'));var BPromise=require(_0x963d('0x6'));var Mustache=require(_0x963d('0x7'));var util=require(_0x963d('0x8'));var path=require(_0x963d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x963d('0xa'));var fs=require('fs');var fs_extra=require(_0x963d('0xb'));var _=require(_0x963d('0xc'));var squel=require(_0x963d('0xd'));var crypto=require(_0x963d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x963d('0xf'));var toCsv=require(_0x963d('0x10'));var querystring=require('querystring');var Papa=require(_0x963d('0x11'));var Redis=require('ioredis');var authService=require(_0x963d('0x12'));var qs=require(_0x963d('0x13'));var as=require(_0x963d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x963d('0x15'))(_0x963d('0x16'));var utils=require(_0x963d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x963d('0x18'));var db=require(_0x963d('0x19'))['db'];function respondWithStatusCode(_0x3a681c,_0x407380){_0x407380=_0x407380||0xcc;return function(_0x29d1fc){if(_0x29d1fc){return _0x3a681c[_0x963d('0x1a')](_0x407380);}return _0x3a681c[_0x963d('0x1b')](_0x407380)[_0x963d('0x1c')]();};}function respondWithResult(_0x2fd1bf,_0x48a860){_0x48a860=_0x48a860||0xc8;return function(_0x189ee5){if(_0x189ee5){return _0x2fd1bf[_0x963d('0x1b')](_0x48a860)[_0x963d('0x1d')](_0x189ee5);}};}function respondWithFilteredResult(_0x56477e,_0x4f37dc){return function(_0x53b1cd){if(_0x53b1cd){var _0x22f78c=typeof _0x4f37dc['offset']==='undefined'&&typeof _0x4f37dc['limit']===_0x963d('0x1e');var _0x3ea1aa=_0x53b1cd[_0x963d('0x1f')];var _0xd48742=_0x22f78c?0x0:_0x4f37dc['offset'];var _0x3b82eb=_0x22f78c?_0x53b1cd[_0x963d('0x1f')]:_0x4f37dc[_0x963d('0x20')]+_0x4f37dc[_0x963d('0x21')];var _0x3f4730;if(_0x3b82eb>=_0x3ea1aa){_0x3b82eb=_0x3ea1aa;_0x3f4730=0xc8;}else{_0x3f4730=0xce;}_0x56477e['status'](_0x3f4730);return _0x56477e[_0x963d('0x22')](_0x963d('0x23'),_0xd48742+'-'+_0x3b82eb+'/'+_0x3ea1aa)[_0x963d('0x1d')](_0x53b1cd);}return null;};}function patchUpdates(_0x5ea50b){return function(_0x278856){try{jsonpatch[_0x963d('0x24')](_0x278856,_0x5ea50b,!![]);}catch(_0x41d8d2){return BPromise[_0x963d('0x25')](_0x41d8d2);}return _0x278856[_0x963d('0x26')]();};}function saveUpdates(_0x1f115a,_0x196e8e){return function(_0x4989fc){if(_0x4989fc){return _0x4989fc[_0x963d('0x27')](_0x1f115a)['then'](function(_0x5c97ac){return _0x5c97ac;});}return null;};}function removeEntity(_0x479630,_0x4be04a){return function(_0x37da84){if(_0x37da84){return _0x37da84[_0x963d('0x28')]()['then'](function(){_0x479630['status'](0xcc)[_0x963d('0x1c')]();});}};}function handleEntityNotFound(_0x57d0c3,_0x44438f){return function(_0x126d7c){if(!_0x126d7c){_0x57d0c3[_0x963d('0x1a')](0x194);}return _0x126d7c;};}function handleError(_0x1297a0,_0x1a61b1){_0x1a61b1=_0x1a61b1||0x1f4;return function(_0x2b65d1){logger[_0x963d('0x29')](_0x2b65d1[_0x963d('0x2a')]);if(_0x2b65d1[_0x963d('0x2b')]){delete _0x2b65d1['name'];}_0x1297a0[_0x963d('0x1b')](_0x1a61b1)[_0x963d('0x2c')](_0x2b65d1);};}exports['index']=function(_0x15780f,_0x392e90){var _0x10586b={},_0x374068={},_0x5b7b16={'count':0x0,'rows':[]};var _0x4dbfa0=_[_0x963d('0x2d')](db[_0x963d('0x2e')][_0x963d('0x2f')],function(_0x740a6e){return{'name':_0x740a6e[_0x963d('0x30')],'type':_0x740a6e['type'][_0x963d('0x31')]};});_0x374068[_0x963d('0x32')]=_[_0x963d('0x2d')](_0x4dbfa0,_0x963d('0x2b'));_0x374068[_0x963d('0x33')]=_['keys'](_0x15780f['query']);_0x374068['filters']=_[_0x963d('0x34')](_0x374068[_0x963d('0x32')],_0x374068[_0x963d('0x33')]);_0x10586b[_0x963d('0x35')]=_[_0x963d('0x34')](_0x374068[_0x963d('0x32')],qs['fields'](_0x15780f[_0x963d('0x33')]['fields']));_0x10586b[_0x963d('0x35')]=_0x10586b[_0x963d('0x35')][_0x963d('0x36')]?_0x10586b[_0x963d('0x35')]:_0x374068[_0x963d('0x32')];if(!_0x15780f[_0x963d('0x33')][_0x963d('0x37')](_0x963d('0x38'))){_0x10586b[_0x963d('0x21')]=qs['limit'](_0x15780f[_0x963d('0x33')]['limit']);_0x10586b['offset']=qs[_0x963d('0x20')](_0x15780f[_0x963d('0x33')][_0x963d('0x20')]);}_0x10586b[_0x963d('0x39')]=qs[_0x963d('0x3a')](_0x15780f[_0x963d('0x33')][_0x963d('0x3a')]);_0x10586b[_0x963d('0x3b')]=qs['filters'](_[_0x963d('0x3c')](_0x15780f[_0x963d('0x33')],_0x374068[_0x963d('0x3d')]),_0x4dbfa0);if(_0x15780f['query']['filter']){_0x10586b[_0x963d('0x3b')]=_[_0x963d('0x3e')](_0x10586b[_0x963d('0x3b')],{'$or':_['map'](_0x4dbfa0,function(_0x34d0b4){if(_0x34d0b4['type']!=='VIRTUAL'){var _0x9febd={};_0x9febd[_0x34d0b4['name']]={'$like':'%'+_0x15780f[_0x963d('0x33')][_0x963d('0x3f')]+'%'};return _0x9febd;}})});}_0x10586b=_[_0x963d('0x3e')]({},_0x10586b,_0x15780f[_0x963d('0x40')]);var _0x4d6e08={'where':_0x10586b['where']};return db[_0x963d('0x2e')][_0x963d('0x1f')](_0x4d6e08)['then'](function(_0x279545){_0x5b7b16[_0x963d('0x1f')]=_0x279545;if(_0x15780f['query']['includeAll']){_0x10586b[_0x963d('0x41')]=[{'all':!![]}];}return db[_0x963d('0x2e')][_0x963d('0x42')](_0x10586b);})['then'](function(_0x4dc018){_0x5b7b16[_0x963d('0x43')]=_0x4dc018;return _0x5b7b16;})['then'](respondWithFilteredResult(_0x392e90,_0x10586b))[_0x963d('0x44')](handleError(_0x392e90,null));};exports[_0x963d('0x45')]=function(_0xbac0de,_0x5506f4){var _0x490b70={'raw':!![],'where':{'id':_0xbac0de[_0x963d('0x46')]['id']}},_0x115eba={};_0x115eba[_0x963d('0x32')]=_['keys'](db[_0x963d('0x2e')][_0x963d('0x2f')]);_0x115eba[_0x963d('0x33')]=_[_0x963d('0x47')](_0xbac0de[_0x963d('0x33')]);_0x115eba[_0x963d('0x3d')]=_[_0x963d('0x34')](_0x115eba[_0x963d('0x32')],_0x115eba['query']);_0x490b70[_0x963d('0x35')]=_[_0x963d('0x34')](_0x115eba['model'],qs[_0x963d('0x48')](_0xbac0de[_0x963d('0x33')][_0x963d('0x48')]));_0x490b70['attributes']=_0x490b70[_0x963d('0x35')][_0x963d('0x36')]?_0x490b70[_0x963d('0x35')]:_0x115eba[_0x963d('0x32')];if(_0xbac0de[_0x963d('0x33')]['includeAll']){_0x490b70['include']=[{'all':!![]}];}_0x490b70=_[_0x963d('0x3e')]({},_0x490b70,_0xbac0de[_0x963d('0x40')]);return db[_0x963d('0x2e')]['find'](_0x490b70)[_0x963d('0x49')](handleEntityNotFound(_0x5506f4,null))[_0x963d('0x49')](respondWithResult(_0x5506f4,null))[_0x963d('0x44')](handleError(_0x5506f4,null));};exports[_0x963d('0x4a')]=function(_0x8171b5,_0x2ead98){return db['ChatTransferReport'][_0x963d('0x4a')](_0x8171b5[_0x963d('0x4b')],{})[_0x963d('0x49')](respondWithResult(_0x2ead98,0xc9))[_0x963d('0x44')](handleError(_0x2ead98,null));};exports['update']=function(_0x53af9b,_0x5b2d0e){if(_0x53af9b[_0x963d('0x4b')]['id']){delete _0x53af9b[_0x963d('0x4b')]['id'];}return db[_0x963d('0x2e')]['find']({'where':{'id':_0x53af9b[_0x963d('0x46')]['id']}})[_0x963d('0x49')](handleEntityNotFound(_0x5b2d0e,null))[_0x963d('0x49')](saveUpdates(_0x53af9b[_0x963d('0x4b')],null))[_0x963d('0x49')](respondWithResult(_0x5b2d0e,null))[_0x963d('0x44')](handleError(_0x5b2d0e,null));};exports[_0x963d('0x28')]=function(_0x5c11a0,_0x221ee7){return db['ChatTransferReport']['find']({'where':{'id':_0x5c11a0[_0x963d('0x46')]['id']}})[_0x963d('0x49')](handleEntityNotFound(_0x221ee7,null))['then'](removeEntity(_0x221ee7,null))['catch'](handleError(_0x221ee7,null));};exports[_0x963d('0x4c')]=function(_0x179a31,_0x2f4a86){return db[_0x963d('0x2e')][_0x963d('0x4c')]()[_0x963d('0x49')](respondWithResult(_0x2f4a86,null))[_0x963d('0x44')](handleError(_0x2f4a86,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 7ba7807..b76fb69 100644
--- a/server/api/chatTransferReport/chatTransferReport.model.js
+++ b/server/api/chatTransferReport/chatTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3186=['uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer'];(function(_0x2cc44a,_0x456aff){var _0x4d1e91=function(_0x55071c){while(--_0x55071c){_0x2cc44a['push'](_0x2cc44a['shift']());}};_0x4d1e91(++_0x456aff);}(_0x3186,0x91));var _0x6318=function(_0x1e901f,_0x22b283){_0x1e901f=_0x1e901f-0x0;var _0x1f6449=_0x3186[_0x1e901f];return _0x1f6449;};'use strict';var _=require('lodash');var util=require(_0x6318('0x0'));var logger=require(_0x6318('0x1'))(_0x6318('0x2'));var moment=require('moment');var BPromise=require(_0x6318('0x3'));var rp=require(_0x6318('0x4'));var fs=require('fs');var path=require(_0x6318('0x5'));var rimraf=require(_0x6318('0x6'));var config=require(_0x6318('0x7'));var attributes=require(_0x6318('0x8'));module['exports']=function(_0x53d17f,_0x270fe9){return _0x53d17f['define'](_0x6318('0x9'),attributes,{'tableName':_0x6318('0xa'),'paranoid':![],'indexes':[{'name':_0x6318('0xb'),'fields':[_0x6318('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9990=['../../config/environment','./chatTransferReport.attributes','exports','define','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9990,0x13d));var _0x0999=function(_0x5b79d0,_0x2f0867){_0x5b79d0=_0x5b79d0-0x0;var _0x1950b2=_0x9990[_0x5b79d0];return _0x1950b2;};'use strict';var _=require('lodash');var util=require(_0x0999('0x0'));var logger=require(_0x0999('0x1'))('api');var moment=require(_0x0999('0x2'));var BPromise=require(_0x0999('0x3'));var rp=require(_0x0999('0x4'));var fs=require('fs');var path=require(_0x0999('0x5'));var rimraf=require(_0x0999('0x6'));var config=require(_0x0999('0x7'));var attributes=require(_0x0999('0x8'));module[_0x0999('0x9')]=function(_0x1851a2,_0x5a24b8){return _0x1851a2[_0x0999('0xa')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x0999('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index e19e34c..36953d2 100644
--- a/server/api/chatTransferReport/chatTransferReport.rpc.js
+++ b/server/api/chatTransferReport/chatTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7fbd=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1297d8,_0x4f7fdb){var _0x1f24b7=function(_0x5245cc){while(--_0x5245cc){_0x1297d8['push'](_0x1297d8['shift']());}};_0x1f24b7(++_0x4f7fdb);}(_0x7fbd,0x194));var _0xd7fb=function(_0x1bd7b7,_0x18e7c4){_0x1bd7b7=_0x1bd7b7-0x0;var _0x46a408=_0x7fbd[_0x1bd7b7];return _0x46a408;};'use strict';var _=require(_0xd7fb('0x0'));var util=require('util');var moment=require(_0xd7fb('0x1'));var BPromise=require(_0xd7fb('0x2'));var rs=require(_0xd7fb('0x3'));var fs=require('fs');var Redis=require(_0xd7fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd7fb('0x5'))(_0xd7fb('0x6'));var config=require(_0xd7fb('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd7fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46f340,_0x4bae14,_0x21eff5){return new BPromise(function(_0x491c7f,_0x27bb72){return client[_0xd7fb('0x9')](_0x46f340,_0x21eff5)[_0xd7fb('0xa')](function(_0x716a77){logger[_0xd7fb('0xb')](_0xd7fb('0xc'),_0x4bae14,_0xd7fb('0xd'));logger[_0xd7fb('0xe')](_0xd7fb('0xf'),_0x4bae14,'request\x20sent',JSON[_0xd7fb('0x10')](_0x716a77));if(_0x716a77['error']){if(_0x716a77[_0xd7fb('0x11')][_0xd7fb('0x12')]===0x1f4){logger[_0xd7fb('0x11')](_0xd7fb('0xc'),_0x4bae14,_0x716a77[_0xd7fb('0x11')][_0xd7fb('0x13')]);return _0x27bb72(_0x716a77[_0xd7fb('0x11')][_0xd7fb('0x13')]);}logger[_0xd7fb('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4bae14,_0x716a77[_0xd7fb('0x11')][_0xd7fb('0x13')]);return _0x491c7f(_0x716a77[_0xd7fb('0x11')][_0xd7fb('0x13')]);}else{logger['info'](_0xd7fb('0xc'),_0x4bae14,_0xd7fb('0xd'));_0x491c7f(_0x716a77[_0xd7fb('0x14')][_0xd7fb('0x13')]);}})[_0xd7fb('0x15')](function(_0x509971){logger[_0xd7fb('0x11')](_0xd7fb('0xc'),_0x4bae14,_0x509971);_0x27bb72(_0x509971);});});}
\ No newline at end of file
+var _0xfdec=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','lodash','util'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0xfdec,0x1a0));var _0xcfde=function(_0x4f8ef6,_0x31607b){_0x4f8ef6=_0x4f8ef6-0x0;var _0x4f6880=_0xfdec[_0x4f8ef6];return _0x4f6880;};'use strict';var _=require(_0xcfde('0x0'));var util=require(_0xcfde('0x1'));var moment=require('moment');var BPromise=require(_0xcfde('0x2'));var rs=require(_0xcfde('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfde('0x4'))['db'];var utils=require(_0xcfde('0x5'));var logger=require(_0xcfde('0x6'))('rpc');var config=require(_0xcfde('0x7'));var jayson=require(_0xcfde('0x8'));var client=jayson[_0xcfde('0x9')][_0xcfde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x160a69,_0x2f91ae,_0x57ca30){return new BPromise(function(_0x480733,_0x399dd7){return client[_0xcfde('0xb')](_0x160a69,_0x57ca30)[_0xcfde('0xc')](function(_0xec5dd){logger['info'](_0xcfde('0xd'),_0x2f91ae,'request\x20sent');logger[_0xcfde('0xe')](_0xcfde('0xf'),_0x2f91ae,_0xcfde('0x10'),JSON[_0xcfde('0x11')](_0xec5dd));if(_0xec5dd['error']){if(_0xec5dd['error'][_0xcfde('0x12')]===0x1f4){logger[_0xcfde('0x13')](_0xcfde('0xd'),_0x2f91ae,_0xec5dd[_0xcfde('0x13')][_0xcfde('0x14')]);return _0x399dd7(_0xec5dd[_0xcfde('0x13')][_0xcfde('0x14')]);}logger['error'](_0xcfde('0xd'),_0x2f91ae,_0xec5dd[_0xcfde('0x13')]['message']);return _0x480733(_0xec5dd[_0xcfde('0x13')]['message']);}else{logger[_0xcfde('0x15')](_0xcfde('0xd'),_0x2f91ae,_0xcfde('0x10'));_0x480733(_0xec5dd['result']['message']);}})['catch'](function(_0x399fe3){logger['error'](_0xcfde('0xd'),_0x2f91ae,_0x399fe3);_0x399dd7(_0x399fe3);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 5fc0341..69268a2 100644
--- a/server/api/chatTransferReport/index.js
+++ b/server/api/chatTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3656=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x34b96a,_0x1a79c7){var _0x11e387=function(_0xe2ec77){while(--_0xe2ec77){_0x34b96a['push'](_0x34b96a['shift']());}};_0x11e387(++_0x1a79c7);}(_0x3656,0x119));var _0x6365=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3656[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x6365('0x0'));var util=require(_0x6365('0x1'));var path=require(_0x6365('0x2'));var timeout=require(_0x6365('0x3'));var express=require(_0x6365('0x4'));var router=express[_0x6365('0x5')]();var fs_extra=require(_0x6365('0x6'));var auth=require(_0x6365('0x7'));var interaction=require(_0x6365('0x8'));var config=require(_0x6365('0x9'));var controller=require(_0x6365('0xa'));router[_0x6365('0xb')]('/',auth[_0x6365('0xc')](),controller[_0x6365('0xd')]);router[_0x6365('0xb')](_0x6365('0xe'),auth['isAuthenticated'](),controller[_0x6365('0xf')]);router['get'](_0x6365('0x10'),auth['isAuthenticated'](),controller[_0x6365('0x11')]);router['post']('/',auth[_0x6365('0xc')](),controller[_0x6365('0x12')]);router['put']('/:id',auth[_0x6365('0xc')](),controller[_0x6365('0x13')]);router[_0x6365('0x14')]('/:id',auth[_0x6365('0xc')](),controller[_0x6365('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xffb0=['index','/describe','describe','/:id','post','create','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x2002d0,_0x391eed){var _0x7bfe39=function(_0x1cf20e){while(--_0x1cf20e){_0x2002d0['push'](_0x2002d0['shift']());}};_0x7bfe39(++_0x391eed);}(_0xffb0,0x1d5));var _0x0ffb=function(_0x2073a8,_0x308660){_0x2073a8=_0x2073a8-0x0;var _0x3a8432=_0xffb0[_0x2073a8];return _0x3a8432;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0ffb('0x0'));var timeout=require('connect-timeout');var express=require(_0x0ffb('0x1'));var router=express[_0x0ffb('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0ffb('0x3'));var interaction=require(_0x0ffb('0x4'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x0ffb('0x5')]('/',auth[_0x0ffb('0x6')](),controller[_0x0ffb('0x7')]);router[_0x0ffb('0x5')](_0x0ffb('0x8'),auth['isAuthenticated'](),controller[_0x0ffb('0x9')]);router[_0x0ffb('0x5')](_0x0ffb('0xa'),auth[_0x0ffb('0x6')](),controller['show']);router[_0x0ffb('0xb')]('/',auth[_0x0ffb('0x6')](),controller[_0x0ffb('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0ffb('0xd')]);router[_0x0ffb('0xe')](_0x0ffb('0xa'),auth[_0x0ffb('0x6')](),controller[_0x0ffb('0xf')]);module[_0x0ffb('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index bfd3026..0c982cc 100644
--- a/server/api/chatWebsite/chatWebsite.attributes.js
+++ b/server/api/chatWebsite/chatWebsite.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3d91=['Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x55dd60,_0x479fb7){var _0x505abb=function(_0x5429c9){while(--_0x5429c9){_0x55dd60['push'](_0x55dd60['shift']());}};_0x505abb(++_0x479fb7);}(_0x3d91,0x1a8));var _0x13d9=function(_0x56b04e,_0x471ebc){_0x56b04e=_0x56b04e-0x0;var _0x4149b9=_0x3d91[_0x56b04e];return _0x4149b9;};'use strict';var Sequelize=require(_0x13d9('0x0'));var rs=require('randomstring');module[_0x13d9('0x1')]={'name':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x13d9('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0x4')},'mapKeyOffline':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x4')},'key':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x5')},'customerAlias':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![],'defaultValue':_0x13d9('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![],'defaultValue':_0x13d9('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![],'defaultValue':_0x13d9('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x13d9('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x13d9('0xa')](_0x13d9('0xb'),_0x13d9('0xc')),'defaultValue':_0x13d9('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0xd')},'start_chat_button':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0xf')},'header_offline':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x13d9('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x11')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x13d9('0x12')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0x13')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x14')},'noteTitle':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0x16')},'closingMessage':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0xf')},'skipMessageButton':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x18')},'conditionAgreement':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x19')},'ratingType':{'type':Sequelize[_0x13d9('0xa')](_0x13d9('0x1a'),_0x13d9('0x1b')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x13d9('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x13d9('0x12')],'defaultValue':function(){return JSON[_0x13d9('0x1c')]({'items':[{'type':_0x13d9('0x1d'),'variable':null,'config':{'placeholder':_0x13d9('0x1e'),'type':_0x13d9('0x1f'),'required':!![]},'props':{'title':_0x13d9('0x1e'),'helpText':''}},{'type':_0x13d9('0x1d'),'props':{'title':_0x13d9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x13d9('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x13d9('0x20')](_0x13d9('0x21'))?JSON[_0x13d9('0x22')](this[_0x13d9('0x20')](_0x13d9('0x21'))):{};},'set':function(_0x59bd8b){return this[_0x13d9('0x23')](_0x13d9('0x21'),JSON['stringify'](_0x59bd8b));}},'offlineForm':{'type':Sequelize[_0x13d9('0x12')],'defaultValue':function(){return JSON[_0x13d9('0x1c')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x13d9('0x4'),'type':_0x13d9('0x4')},'variable':null},{'type':_0x13d9('0x24'),'config':{'placeholder':'Comments'},'props':{'title':_0x13d9('0x25'),'helpText':_0x13d9('0x26')}}],'fromKey':0x0});},'get':function(){return this[_0x13d9('0x20')](_0x13d9('0x27'))?JSON[_0x13d9('0x22')](this[_0x13d9('0x20')]('offlineForm')):{};},'set':function(_0x344b0a){return this[_0x13d9('0x23')](_0x13d9('0x27'),JSON[_0x13d9('0x1c')](_0x344b0a));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x13d9('0x28')]();}},'autoclose':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x13d9('0x2')]},'forwardOffline':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x13d9('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0x29')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x2a')},'offlineMessageBody':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x2b')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x2c')},'skipUnmanaged':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x18')},'sendUnmanaged':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x13d9('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x13d9('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x13d9('0x2d');}},'notificationSound':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x2e')},'waitForTheAssignedAgent':{'type':Sequelize[_0x13d9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0x2f')},'verticalAlignment':{'type':Sequelize[_0x13d9('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x30')},'messagesAlignment':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x31')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x13d9('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x13d9('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![],'defaultValue':_0x13d9('0x32'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x13d9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0x33')},'systemAvatar':{'type':Sequelize[_0x13d9('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x13d9('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![],'comment':_0x13d9('0x34'),'set':function(_0x333bce){if(!_0x333bce)this[_0x13d9('0x23')](_0x13d9('0x35'),null);this[_0x13d9('0x23')](_0x13d9('0x36'),_0x333bce);}},'vidaooEscalation':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x13d9('0x37');}},'vidaooMetadata':{'type':Sequelize[_0x13d9('0x12')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x13d9('0x12')]}};
\ No newline at end of file
+var _0xf616=['mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Skip','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x31f20a,_0x22c8d9){var _0x5acf6d=function(_0x2e25a3){while(--_0x2e25a3){_0x31f20a['push'](_0x31f20a['shift']());}};_0x5acf6d(++_0x22c8d9);}(_0xf616,0x17a));var _0x6f61=function(_0x4a0139,_0x298519){_0x4a0139=_0x4a0139-0x0;var _0x4fa1fb=_0xf616[_0x4a0139];return _0x4fa1fb;};'use strict';var Sequelize=require(_0x6f61('0x0'));var rs=require(_0x6f61('0x1'));module[_0x6f61('0x2')]={'name':{'type':Sequelize[_0x6f61('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x6f61('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x6f61('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x6f61('0x4')},'mapKeyOffline':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x5')},'customerAlias':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6f61('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6f61('0x3')],'allowNull':![],'defaultValue':_0x6f61('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6f61('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6f61('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6f61('0x3')]},'animation':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6f61('0xa')](_0x6f61('0xb'),_0x6f61('0xc')),'defaultValue':_0x6f61('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x6f61('0xd')},'start_chat_button':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x6f61('0xf')},'header_offline':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6f61('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6f61('0x12')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x6f61('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x14')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6f61('0x15')},'noteTitle':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0xf')},'skipMessageButton':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x6f61('0xa')](_0x6f61('0x17'),_0x6f61('0x18')),'defaultValue':_0x6f61('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x6f61('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6f61('0x12')],'defaultValue':function(){return JSON[_0x6f61('0x19')]({'items':[{'type':_0x6f61('0x1a'),'variable':null,'config':{'placeholder':_0x6f61('0x1b'),'type':_0x6f61('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x6f61('0x1a'),'props':{'title':_0x6f61('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x6f61('0x4'),'type':_0x6f61('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6f61('0x1d')](_0x6f61('0x1e'))?JSON[_0x6f61('0x1f')](this['getDataValue'](_0x6f61('0x1e'))):{};},'set':function(_0x1e3b47){return this[_0x6f61('0x20')](_0x6f61('0x1e'),JSON['stringify'](_0x1e3b47));}},'offlineForm':{'type':Sequelize[_0x6f61('0x12')],'defaultValue':function(){return JSON[_0x6f61('0x19')]({'items':[{'type':_0x6f61('0x1a'),'props':{'title':_0x6f61('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6f61('0x4')},'variable':null},{'type':_0x6f61('0x21'),'config':{'placeholder':'Comments'},'props':{'title':_0x6f61('0x22'),'helpText':_0x6f61('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x6f61('0x1f')](this[_0x6f61('0x1d')](_0x6f61('0x24'))):{};},'set':function(_0x2afe8b){return this['setDataValue'](_0x6f61('0x24'),JSON[_0x6f61('0x19')](_0x2afe8b));}},'token':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6f61('0x3')]},'waitingTitle':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x25')},'skipUnmanaged':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x16')},'sendUnmanaged':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6f61('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6f61('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6f61('0x12')],'defaultValue':function(){return _0x6f61('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6f61('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x28')},'verticalAlignment':{'type':Sequelize[_0x6f61('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x29')},'messagesAlignment':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x2a')},'defaultTitle':{'type':Sequelize[_0x6f61('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6f61('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6f61('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6f61('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6f61('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6f61('0x2b')},'systemAvatar':{'type':Sequelize[_0x6f61('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6f61('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6f61('0x2c'),'set':function(_0x320e63){if(!_0x320e63)this[_0x6f61('0x20')]('mandatoryDispositionPauseId',null);this[_0x6f61('0x20')](_0x6f61('0x2d'),_0x320e63);}},'vidaooEscalation':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6f61('0x3')]},'vidaooTopic':{'type':Sequelize[_0x6f61('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':function(){return _0x6f61('0x2e');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6f61('0x12')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index b8f91c3..781715b 100644
--- a/server/api/chatWebsite/chatWebsite.controller.js
+++ b/server/api/chatWebsite/chatWebsite.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9b0d=['online','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','info','catch','sendStatus','status','offset','undefined','count','set','json','update','destroy','get','ChatWebsites','end','stack','name','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','VIRTUAL','ChatWebsite','findAll','rows','show','params','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','pick','include','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','addSystemAvatar','getLogo','root','../../config/license/util','getLicense','custom','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','isNil','getSystemAvatar','systemAvatar','user-agent-parser','setUA','user-agent','getResult','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','list','orderBy','applications','priority','asc','contact','customerIp','headers','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','forcedOwnership','Start','startRouting','notify','offline','files','no\x20available\x20attributes','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','offlineMessageBody','mimetype','attachments','offline-chat','openNewInteraction','sequelize','Attachment','bulkCreate','Smtp','forwardOffline','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','forwardOfflineAddress','MailAccountId','originalname','subjectOffline','toPairsIn','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','connection','remoteAddress','virtual','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','transaction','Transaction','READ_COMMITTED','findAndCountAll','finally','addProactiveActions','getFields'];(function(_0x25d2fa,_0x1d35c6){var _0x42d4aa=function(_0x590383){while(--_0x590383){_0x25d2fa['push'](_0x25d2fa['shift']());}};_0x42d4aa(++_0x1d35c6);}(_0x9b0d,0x139));var _0xd9b0=function(_0x2909ad,_0x57ced8){_0x2909ad=_0x2909ad-0x0;var _0x35aa71=_0x9b0d[_0x2909ad];return _0x35aa71;};'use strict';var BPromise=require(_0xd9b0('0x0'));var Mustache=require(_0xd9b0('0x1'));var util=require(_0xd9b0('0x2'));var path=require(_0xd9b0('0x3'));var ejs=require(_0xd9b0('0x4'));var fs=require('fs');var fs_extra=require(_0xd9b0('0x5'));var _=require('lodash');var querystring=require(_0xd9b0('0x6'));var Redis=require(_0xd9b0('0x7'));var qs=require(_0xd9b0('0x8'));var logger=require(_0xd9b0('0x9'))(_0xd9b0('0xa'));var config=require('../../config/environment');var db=require(_0xd9b0('0xb'))['db'];config[_0xd9b0('0xc')]=_['defaults'](config['redis'],{'host':_0xd9b0('0xd'),'port':0x18eb});var socket=require(_0xd9b0('0xe'))(new Redis(config[_0xd9b0('0xc')]));require('./chatWebsite.socket')[_0xd9b0('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd9b0('0x10')][_0xd9b0('0x11')]({'port':0x232c});var client9002=jayson['client'][_0xd9b0('0x11')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xd9b0('0x10')][_0xd9b0('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x49cb95,_0x4646b3,_0x5c5b64,_0x297b56){return new BPromise(function(_0x48b923,_0x351b42){var _0x2fa5da=_0x297b56||client;return _0x2fa5da['request'](_0x49cb95,_0x5c5b64)[_0xd9b0('0x12')](function(_0x5a5657){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4646b3,_0xd9b0('0x13'));logger[_0xd9b0('0x14')](_0xd9b0('0x15'),_0x4646b3,_0xd9b0('0x13'),JSON[_0xd9b0('0x16')](_0x5a5657));if(_0x5a5657[_0xd9b0('0x17')]){if(_0x5a5657[_0xd9b0('0x17')]['code']===0x1f4){logger[_0xd9b0('0x17')](_0xd9b0('0x18'),_0x4646b3,_0x5a5657[_0xd9b0('0x17')]['message']);return _0x351b42(_0x5a5657['error']['message']);}logger[_0xd9b0('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x4646b3,_0x5a5657['error'][_0xd9b0('0x19')]);return _0x48b923(_0x5a5657[_0xd9b0('0x17')][_0xd9b0('0x19')]);}else{logger[_0xd9b0('0x1a')](_0xd9b0('0x18'),_0x4646b3,_0xd9b0('0x13'));_0x48b923(_0x5a5657['result']['message']);}})[_0xd9b0('0x1b')](function(_0x39b02e){logger['error'](_0xd9b0('0x18'),_0x4646b3,_0x39b02e);_0x351b42(_0x39b02e);});});}function respondWithStatusCode(_0x4f6ceb,_0x370b09){_0x370b09=_0x370b09||0xcc;return function(_0x5a1071){if(_0x5a1071){return _0x4f6ceb[_0xd9b0('0x1c')](_0x370b09);}return _0x4f6ceb[_0xd9b0('0x1d')](_0x370b09)['end']();};}function respondWithResult(_0x5b99d3,_0x272207){_0x272207=_0x272207||0xc8;return function(_0x545a8f){if(_0x545a8f){return _0x5b99d3[_0xd9b0('0x1d')](_0x272207)['json'](_0x545a8f);}};}function respondWithFilteredResult(_0xed6c2c,_0x223e0d){return function(_0x58cdbe){if(_0x58cdbe){var _0x430732=typeof _0x223e0d[_0xd9b0('0x1e')]===_0xd9b0('0x1f')&&typeof _0x223e0d['limit']===_0xd9b0('0x1f');var _0x4c8237=_0x58cdbe[_0xd9b0('0x20')];var _0x2095d2=_0x430732?0x0:_0x223e0d[_0xd9b0('0x1e')];var _0x16fa45=_0x430732?_0x58cdbe[_0xd9b0('0x20')]:_0x223e0d[_0xd9b0('0x1e')]+_0x223e0d['limit'];var _0x311d96;if(_0x16fa45>=_0x4c8237){_0x16fa45=_0x4c8237;_0x311d96=0xc8;}else{_0x311d96=0xce;}_0xed6c2c[_0xd9b0('0x1d')](_0x311d96);return _0xed6c2c[_0xd9b0('0x21')]('Content-Range',_0x2095d2+'-'+_0x16fa45+'/'+_0x4c8237)[_0xd9b0('0x22')](_0x58cdbe);}return null;};}function saveUpdates(_0xf67095){return function(_0x5badc2){if(_0x5badc2){return _0x5badc2[_0xd9b0('0x23')](_0xf67095)[_0xd9b0('0x12')](function(_0x3d4758){return _0x3d4758;});}return null;};}function removeEntity(_0x10dba4){return function(_0x1c7161){if(_0x1c7161){return _0x1c7161[_0xd9b0('0x24')]()['then'](function(){var _0xc44b13=_0x1c7161[_0xd9b0('0x25')]({'plain':!![]});var _0x4581cc=_0xd9b0('0x26');return db['UserProfileResource'][_0xd9b0('0x24')]({'where':{'type':_0x4581cc,'resourceId':_0xc44b13['id']}})[_0xd9b0('0x12')](function(){return _0x1c7161;});})[_0xd9b0('0x12')](function(){_0x10dba4[_0xd9b0('0x1d')](0xcc)[_0xd9b0('0x27')]();});}};}function handleEntityNotFound(_0x576427){return function(_0x542fb5){if(!_0x542fb5){_0x576427['sendStatus'](0x194);}return _0x542fb5;};}function handleError(_0x220390,_0x22f1be){_0x22f1be=_0x22f1be||0x1f4;return function(_0x51b13c){logger[_0xd9b0('0x17')](_0x51b13c[_0xd9b0('0x28')]);if(_0x51b13c[_0xd9b0('0x29')]){delete _0x51b13c[_0xd9b0('0x29')];}_0x220390[_0xd9b0('0x1d')](_0x22f1be)['send'](_0x51b13c);};}exports['index']=function(_0x9ae8b4,_0x3b899b){var _0x5aee34={'include':[{'model':db[_0xd9b0('0x2a')],'as':_0xd9b0('0x2b')}]},_0x4db1fc={},_0x154715={'count':0x0,'rows':[]};var _0x49dddf=_[_0xd9b0('0x2c')](db['ChatWebsite'][_0xd9b0('0x2d')],function(_0x3d30ca){return{'name':_0x3d30ca[_0xd9b0('0x2e')],'type':_0x3d30ca[_0xd9b0('0x2f')]['key']};});_0x4db1fc[_0xd9b0('0x30')]=_[_0xd9b0('0x2c')](_0x49dddf,_0xd9b0('0x29'));_0x4db1fc[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x9ae8b4[_0xd9b0('0x31')]);_0x4db1fc['filters']=_[_0xd9b0('0x33')](_0x4db1fc[_0xd9b0('0x30')],_0x4db1fc[_0xd9b0('0x31')]);_0x5aee34[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0x4db1fc['model'],qs[_0xd9b0('0x35')](_0x9ae8b4['query'][_0xd9b0('0x35')]));_0x5aee34[_0xd9b0('0x34')]=_0x5aee34[_0xd9b0('0x34')][_0xd9b0('0x36')]?_0x5aee34[_0xd9b0('0x34')]:_0x4db1fc[_0xd9b0('0x30')];if(!_0x9ae8b4[_0xd9b0('0x31')][_0xd9b0('0x37')](_0xd9b0('0x38'))){_0x5aee34[_0xd9b0('0x39')]=qs['limit'](_0x9ae8b4[_0xd9b0('0x31')][_0xd9b0('0x39')]);_0x5aee34[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x9ae8b4['query'][_0xd9b0('0x1e')]);}_0x5aee34[_0xd9b0('0x3a')]=qs[_0xd9b0('0x3b')](_0x9ae8b4[_0xd9b0('0x31')][_0xd9b0('0x3b')]);_0x5aee34[_0xd9b0('0x3c')]=qs[_0xd9b0('0x3d')](_['pick'](_0x9ae8b4[_0xd9b0('0x31')],_0x4db1fc[_0xd9b0('0x3d')]),_0x49dddf);if(_0x9ae8b4['query'][_0xd9b0('0x3e')]){_0x5aee34[_0xd9b0('0x3c')]=_['merge'](_0x5aee34[_0xd9b0('0x3c')],{'$or':_['map'](_0x49dddf,function(_0x2ed6c5){if(_0x2ed6c5[_0xd9b0('0x2f')]!==_0xd9b0('0x3f')){var _0x422d98={};_0x422d98[_0x2ed6c5['name']]={'$like':'%'+_0x9ae8b4[_0xd9b0('0x31')][_0xd9b0('0x3e')]+'%'};return _0x422d98;}})});}_0x5aee34=_['merge']({},_0x5aee34,_0x9ae8b4['options']);var _0x47998a={'where':_0x5aee34['where']};return db[_0xd9b0('0x40')][_0xd9b0('0x20')](_0x47998a)['then'](function(_0x1d6818){_0x154715[_0xd9b0('0x20')]=_0x1d6818;if(_0x9ae8b4[_0xd9b0('0x31')]['includeAll']){_0x5aee34['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xd9b0('0x41')](_0x5aee34);})[_0xd9b0('0x12')](function(_0x2a2a41){_0x154715[_0xd9b0('0x42')]=_0x2a2a41;return _0x154715;})[_0xd9b0('0x12')](respondWithFilteredResult(_0x3b899b,_0x5aee34))['catch'](handleError(_0x3b899b,null));};exports[_0xd9b0('0x43')]=function(_0x461146,_0x10a6f9){var _0x3baa59={'raw':![],'where':{'id':_0x461146[_0xd9b0('0x44')]['id']},'include':[{'model':db[_0xd9b0('0x2a')],'as':_0xd9b0('0x2b')}]},_0x4ab5be={};_0x4ab5be[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db[_0xd9b0('0x40')][_0xd9b0('0x2d')]);_0x4ab5be['query']=_[_0xd9b0('0x32')](_0x461146[_0xd9b0('0x31')]);_0x4ab5be[_0xd9b0('0x3d')]=_[_0xd9b0('0x33')](_0x4ab5be['model'],_0x4ab5be['query']);_0x3baa59[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0x4ab5be[_0xd9b0('0x30')],qs[_0xd9b0('0x35')](_0x461146[_0xd9b0('0x31')]['fields']));_0x3baa59['attributes']=_0x3baa59[_0xd9b0('0x34')][_0xd9b0('0x36')]?_0x3baa59[_0xd9b0('0x34')]:_0x4ab5be[_0xd9b0('0x30')];if(_0x461146[_0xd9b0('0x31')][_0xd9b0('0x45')]){_0x3baa59['include']=[{'all':!![]}];}_0x3baa59=_[_0xd9b0('0x46')]({},_0x3baa59,_0x461146[_0xd9b0('0x47')]);return db[_0xd9b0('0x40')][_0xd9b0('0x48')](_0x3baa59)[_0xd9b0('0x12')](handleEntityNotFound(_0x10a6f9,null))[_0xd9b0('0x12')](respondWithResult(_0x10a6f9,null))[_0xd9b0('0x1b')](handleError(_0x10a6f9,null));};exports[_0xd9b0('0x49')]=function(_0x4f8242,_0x32b981){return db[_0xd9b0('0x40')][_0xd9b0('0x49')](_0x4f8242[_0xd9b0('0x4a')],{})['then'](function(_0x289b0d){var _0x30eda8=_0x4f8242[_0xd9b0('0x4b')][_0xd9b0('0x25')]({'plain':!![]});if(!_0x30eda8)throw new Error(_0xd9b0('0x4c'));if(_0x30eda8[_0xd9b0('0x4d')]===_0xd9b0('0x4b')){var _0x20ddbc=_0x289b0d['get']({'plain':!![]});var _0x3ef40a=_0xd9b0('0x26');return db[_0xd9b0('0x4e')]['find']({'where':{'name':_0x3ef40a,'userProfileId':_0x30eda8[_0xd9b0('0x4f')]},'raw':!![]})[_0xd9b0('0x12')](function(_0x4d70b5){if(_0x4d70b5&&_0x4d70b5[_0xd9b0('0x50')]===0x0){return db[_0xd9b0('0x51')][_0xd9b0('0x49')]({'name':_0x20ddbc['name'],'resourceId':_0x20ddbc['id'],'type':_0x4d70b5[_0xd9b0('0x29')],'sectionId':_0x4d70b5['id']},{})['then'](function(){return _0x289b0d;});}else{return _0x289b0d;}})[_0xd9b0('0x1b')](function(_0x4ee578){logger[_0xd9b0('0x17')](_0xd9b0('0x52'),_0x4ee578);throw _0x4ee578;});}return _0x289b0d;})[_0xd9b0('0x12')](respondWithResult(_0x32b981,0xc9))[_0xd9b0('0x1b')](handleError(_0x32b981,null));};exports[_0xd9b0('0x23')]=function(_0x50832c,_0x5689b6){if(_0x50832c[_0xd9b0('0x4a')]['id']){delete _0x50832c[_0xd9b0('0x4a')]['id'];}return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'where':{'id':_0x50832c[_0xd9b0('0x44')]['id']},'include':[{'model':db['Pause'],'as':_0xd9b0('0x2b')}]})[_0xd9b0('0x12')](handleEntityNotFound(_0x5689b6,null))[_0xd9b0('0x12')](saveUpdates(_0x50832c[_0xd9b0('0x4a')],null))[_0xd9b0('0x12')](respondWithResult(_0x5689b6,null))['catch'](handleError(_0x5689b6,null));};exports[_0xd9b0('0x24')]=function(_0x522a41,_0x317afa){return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'where':{'id':_0x522a41[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x317afa,null))[_0xd9b0('0x12')](removeEntity(_0x317afa,null))['catch'](handleError(_0x317afa,null));};exports[_0xd9b0('0x53')]=function(_0x1c17f6,_0x103f2f){return db[_0xd9b0('0x40')]['describe']()[_0xd9b0('0x12')](respondWithResult(_0x103f2f,null))['catch'](handleError(_0x103f2f,null));};exports[_0xd9b0('0x54')]=function(_0x3af0ab,_0x1e4abc){if(_0x3af0ab['body']['id']){delete _0x3af0ab['body']['id'];}return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x3af0ab[_0xd9b0('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e4abc,null))['then'](function(_0x2cc7e3){if(_0x2cc7e3){_0x3af0ab['body'][_0xd9b0('0x55')]=_0x2cc7e3['id'];return db['Disposition'][_0xd9b0('0x49')](_0x3af0ab[_0xd9b0('0x4a')]);}})['then'](respondWithResult(_0x1e4abc,null))['catch'](handleError(_0x1e4abc,null));};exports[_0xd9b0('0x56')]=function(_0x1052b5,_0x356996){var _0x295156={'raw':![],'where':{}};var _0x1f09b4={};var _0xce6acc={'count':0x0,'rows':[]};return db[_0xd9b0('0x40')][_0xd9b0('0x57')]({'where':{'id':_0x1052b5[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x356996,null))['then'](function(_0x998c67){if(_0x998c67){_0x1f09b4[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db[_0xd9b0('0x58')][_0xd9b0('0x2d')]);_0x1f09b4[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x1052b5[_0xd9b0('0x31')]);_0x1f09b4[_0xd9b0('0x3d')]=_[_0xd9b0('0x33')](_0x1f09b4[_0xd9b0('0x30')],_0x1f09b4['query']);_0x295156['attributes']=_[_0xd9b0('0x33')](_0x1f09b4[_0xd9b0('0x30')],qs[_0xd9b0('0x35')](_0x1052b5['query'][_0xd9b0('0x35')]));_0x295156[_0xd9b0('0x34')]=_0x295156[_0xd9b0('0x34')][_0xd9b0('0x36')]?_0x295156[_0xd9b0('0x34')]:_0x1f09b4[_0xd9b0('0x30')];if(!_0x1052b5[_0xd9b0('0x31')][_0xd9b0('0x37')](_0xd9b0('0x38'))){_0x295156['limit']=qs[_0xd9b0('0x39')](_0x1052b5[_0xd9b0('0x31')][_0xd9b0('0x39')]);_0x295156[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x1052b5[_0xd9b0('0x31')][_0xd9b0('0x1e')]);}_0x295156[_0xd9b0('0x3a')]=qs[_0xd9b0('0x3b')](_0x1052b5[_0xd9b0('0x31')][_0xd9b0('0x3b')]);_0x295156[_0xd9b0('0x3c')]=qs['filters'](_[_0xd9b0('0x59')](_0x1052b5[_0xd9b0('0x31')],_0x1f09b4[_0xd9b0('0x3d')]));_0x295156['where'][_0xd9b0('0x55')]=_0x998c67['id'];if(_0x1052b5[_0xd9b0('0x31')][_0xd9b0('0x3e')]){_0x295156[_0xd9b0('0x3c')]=_[_0xd9b0('0x46')](_0x295156[_0xd9b0('0x3c')],{'$or':_['map'](_0x295156[_0xd9b0('0x34')],function(_0x190dd4){var _0x1f7b3e={};_0x1f7b3e[_0x190dd4]={'$like':'%'+_0x1052b5['query'][_0xd9b0('0x3e')]+'%'};return _0x1f7b3e;})});}_0x295156=_[_0xd9b0('0x46')]({},_0x295156,_0x1052b5[_0xd9b0('0x47')]);return db['Disposition'][_0xd9b0('0x20')]({'where':_0x295156[_0xd9b0('0x3c')]})[_0xd9b0('0x12')](function(_0x38028a){_0xce6acc[_0xd9b0('0x20')]=_0x38028a;if(_0x1052b5[_0xd9b0('0x31')][_0xd9b0('0x45')]){_0x295156[_0xd9b0('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0xd9b0('0x41')](_0x295156);})[_0xd9b0('0x12')](function(_0x558e9e){_0xce6acc['rows']=_0x558e9e;return _0xce6acc;});}})[_0xd9b0('0x12')](respondWithFilteredResult(_0x356996,_0x295156))[_0xd9b0('0x1b')](handleError(_0x356996,null));};exports[_0xd9b0('0x5b')]=function(_0x1fc379,_0x1c6cdf){return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'where':{'id':_0x1fc379['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x1c6cdf,null))['then'](function(_0x1bb167){if(_0x1bb167){return _0x1bb167[_0xd9b0('0x5b')](_0x1fc379[_0xd9b0('0x31')][_0xd9b0('0x5c')]);}})[_0xd9b0('0x12')](respondWithStatusCode(_0x1c6cdf,null))[_0xd9b0('0x1b')](handleError(_0x1c6cdf,null));};exports[_0xd9b0('0x5d')]=function(_0x125f3f,_0xdac3d8){if(_0x125f3f[_0xd9b0('0x4a')]['id']){delete _0x125f3f[_0xd9b0('0x4a')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x125f3f['params']['id']}})['then'](handleEntityNotFound(_0xdac3d8,null))['then'](function(_0x1446d7){if(_0x1446d7){_0x125f3f[_0xd9b0('0x4a')][_0xd9b0('0x55')]=_0x1446d7['id'];return db[_0xd9b0('0x5e')][_0xd9b0('0x49')](_0x125f3f['body']);}})[_0xd9b0('0x12')](respondWithResult(_0xdac3d8,null))['catch'](handleError(_0xdac3d8,null));};exports['getAnswers']=function(_0x44afa1,_0x239686){var _0x49ceeb={'raw':![],'where':{}};var _0x5ab6f8={};var _0x180724={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd9b0('0x57')]({'where':{'id':_0x44afa1[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x239686,null))[_0xd9b0('0x12')](function(_0x232726){if(_0x232726){_0x5ab6f8[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db['CannedAnswer']['rawAttributes']);_0x5ab6f8[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x44afa1['query']);_0x5ab6f8['filters']=_[_0xd9b0('0x33')](_0x5ab6f8[_0xd9b0('0x30')],_0x5ab6f8[_0xd9b0('0x31')]);_0x49ceeb[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0x5ab6f8[_0xd9b0('0x30')],qs[_0xd9b0('0x35')](_0x44afa1[_0xd9b0('0x31')][_0xd9b0('0x35')]));_0x49ceeb[_0xd9b0('0x34')]=_0x49ceeb['attributes'][_0xd9b0('0x36')]?_0x49ceeb['attributes']:_0x5ab6f8[_0xd9b0('0x30')];if(!_0x44afa1[_0xd9b0('0x31')]['hasOwnProperty']('nolimit')){_0x49ceeb['limit']=qs['limit'](_0x44afa1[_0xd9b0('0x31')][_0xd9b0('0x39')]);_0x49ceeb[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x44afa1['query']['offset']);}_0x49ceeb['order']=qs[_0xd9b0('0x3b')](_0x44afa1[_0xd9b0('0x31')][_0xd9b0('0x3b')]);_0x49ceeb[_0xd9b0('0x3c')]=qs[_0xd9b0('0x3d')](_[_0xd9b0('0x59')](_0x44afa1[_0xd9b0('0x31')],_0x5ab6f8['filters']));_0x49ceeb[_0xd9b0('0x3c')][_0xd9b0('0x55')]=_0x232726['id'];if(_0x44afa1['query'][_0xd9b0('0x3e')]){_0x49ceeb[_0xd9b0('0x3c')]=_[_0xd9b0('0x46')](_0x49ceeb[_0xd9b0('0x3c')],{'$or':_[_0xd9b0('0x2c')](_0x49ceeb[_0xd9b0('0x34')],function(_0x57d1fc){var _0x1abfcd={};_0x1abfcd[_0x57d1fc]={'$like':'%'+_0x44afa1[_0xd9b0('0x31')][_0xd9b0('0x3e')]+'%'};return _0x1abfcd;})});}_0x49ceeb=_[_0xd9b0('0x46')]({},_0x49ceeb,_0x44afa1[_0xd9b0('0x47')]);return db['CannedAnswer'][_0xd9b0('0x20')]({'where':_0x49ceeb[_0xd9b0('0x3c')]})[_0xd9b0('0x12')](function(_0x26d249){_0x180724[_0xd9b0('0x20')]=_0x26d249;if(_0x44afa1[_0xd9b0('0x31')][_0xd9b0('0x45')]){_0x49ceeb['include']=[{'all':!![]}];}return db[_0xd9b0('0x5e')][_0xd9b0('0x41')](_0x49ceeb);})[_0xd9b0('0x12')](function(_0x8cbf03){_0x180724[_0xd9b0('0x42')]=_0x8cbf03;return _0x180724;});}})[_0xd9b0('0x12')](respondWithFilteredResult(_0x239686,_0x49ceeb))[_0xd9b0('0x1b')](handleError(_0x239686,null));};exports[_0xd9b0('0x5f')]=function(_0x540618,_0x5097c0){return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'where':{'id':_0x540618['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x5097c0,null))['then'](function(_0x2a1c3a){if(_0x2a1c3a){return _0x2a1c3a['removeAnswers'](_0x540618[_0xd9b0('0x31')][_0xd9b0('0x5c')]);}})['then'](respondWithStatusCode(_0x5097c0,null))['catch'](handleError(_0x5097c0,null));};exports[_0xd9b0('0x60')]=function(_0x348b05,_0xa081de){_0x348b05[_0xd9b0('0x4a')][_0xd9b0('0x61')]=_0x348b05[_0xd9b0('0x62')][_0xd9b0('0x63')];return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x348b05[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0xa081de,null))[_0xd9b0('0x12')](saveUpdates(_0x348b05[_0xd9b0('0x4a')],null))[_0xd9b0('0x12')](respondWithResult(_0xa081de,null))[_0xd9b0('0x1b')](handleError(_0xa081de,null));};exports[_0xd9b0('0x64')]=function(_0x6603eb,_0x42ee6b){_0x6603eb['body']['agentAvatar']=_0x6603eb[_0xd9b0('0x62')][_0xd9b0('0x63')];return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x6603eb[_0xd9b0('0x44')]['id']}})['then'](handleEntityNotFound(_0x42ee6b,null))[_0xd9b0('0x12')](saveUpdates(_0x6603eb[_0xd9b0('0x4a')],null))[_0xd9b0('0x12')](respondWithResult(_0x42ee6b,null))[_0xd9b0('0x1b')](handleError(_0x42ee6b,null));};exports[_0xd9b0('0x65')]=function(_0x1672e2,_0x185a65){_0x1672e2[_0xd9b0('0x4a')]['customerAvatar']=_0x1672e2['file'][_0xd9b0('0x63')];return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x1672e2[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x185a65,null))['then'](saveUpdates(_0x1672e2[_0xd9b0('0x4a')],null))[_0xd9b0('0x12')](respondWithResult(_0x185a65,null))[_0xd9b0('0x1b')](handleError(_0x185a65,null));};exports[_0xd9b0('0x66')]=function(_0x244133,_0x481886){_0x244133[_0xd9b0('0x4a')]['systemAvatar']=_0x244133['file']['filename'];return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x244133[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x481886,null))[_0xd9b0('0x12')](saveUpdates(_0x244133[_0xd9b0('0x4a')],null))[_0xd9b0('0x12')](respondWithResult(_0x481886,null))[_0xd9b0('0x1b')](handleError(_0x481886,null));};exports[_0xd9b0('0x67')]=function(_0x501c31,_0x62f74c){var _0x2364ec=path['join'](config[_0xd9b0('0x68')],'server/files/images/logos/default_logo.svg');var _0x5896a6={'where':{'id':_0x501c31[_0xd9b0('0x44')]['id']},'attributes':['id',_0xd9b0('0x61')],'raw':!![]};var _0x36ddfc=![];return require(_0xd9b0('0x69'))[_0xd9b0('0x6a')]()[_0xd9b0('0x12')](function(_0x1e70a2){if(_0x1e70a2){_0x36ddfc=_0x1e70a2[_0xd9b0('0x6b')];}})[_0xd9b0('0x12')](function(){return db[_0xd9b0('0x40')][_0xd9b0('0x48')](_0x5896a6);})[_0xd9b0('0x12')](handleEntityNotFound(_0x62f74c,null))[_0xd9b0('0x12')](function(_0x1d1a3a){if(_0x1d1a3a){if(!_['isNil'](_0x1d1a3a[_0xd9b0('0x61')])){if(fs[_0xd9b0('0x6c')](path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x6e'),_0x1d1a3a[_0xd9b0('0x61')]))&&_0x36ddfc){_0x2364ec=path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x6e'),_0x1d1a3a[_0xd9b0('0x61')]);}}return _0x62f74c[_0xd9b0('0x6f')](_0x2364ec);}})['catch'](handleError(_0x62f74c,null));};exports['getAvatar']=function(_0x69db20,_0x17c30d){var _0x34d64c=path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x70'));var _0x51e563={'where':{'id':_0x69db20[_0xd9b0('0x44')]['id']},'attributes':['id',_0xd9b0('0x71')],'raw':!![]};return db[_0xd9b0('0x40')][_0xd9b0('0x48')](_0x51e563)['then'](handleEntityNotFound(_0x17c30d,null))[_0xd9b0('0x12')](function(_0x20992b){if(_0x20992b){if(!_['isNil'](_0x20992b[_0xd9b0('0x71')])){if(fs[_0xd9b0('0x6c')](path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x72'),_0x20992b[_0xd9b0('0x71')]))){_0x34d64c=path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],'server/files/images/avatars/',_0x20992b['agentAvatar']);}}return _0x17c30d[_0xd9b0('0x6f')](_0x34d64c);}})[_0xd9b0('0x1b')](handleError(_0x17c30d,null));};exports[_0xd9b0('0x73')]=function(_0x56a79e,_0x12eee4){var _0x1bd39d=path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x74'));var _0x4044dc={'where':{'id':_0x56a79e[_0xd9b0('0x44')]['id']},'attributes':['id',_0xd9b0('0x75'),_0xd9b0('0x76')],'raw':!![]};return db[_0xd9b0('0x40')]['find'](_0x4044dc)[_0xd9b0('0x12')](handleEntityNotFound(_0x12eee4,null))[_0xd9b0('0x12')](function(_0x50fd2d){if(_0x50fd2d){if(!_[_0xd9b0('0x77')](_0x50fd2d[_0xd9b0('0x75')])){if(fs[_0xd9b0('0x6c')](path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x72'),_0x50fd2d[_0xd9b0('0x75')]))&&_0x50fd2d[_0xd9b0('0x76')]){_0x1bd39d=path[_0xd9b0('0x6d')](config['root'],_0xd9b0('0x72'),_0x50fd2d[_0xd9b0('0x75')]);}}return _0x12eee4['download'](_0x1bd39d);}})[_0xd9b0('0x1b')](handleError(_0x12eee4,null));};exports[_0xd9b0('0x78')]=function(_0x4eb6b4,_0x2bb5e7){var _0x1137d0=path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],'server/files/images/avatars/system_avatar.png');var _0x388b49={'where':{'id':_0x4eb6b4[_0xd9b0('0x44')]['id']},'attributes':['id',_0xd9b0('0x79')],'raw':!![]};return db[_0xd9b0('0x40')][_0xd9b0('0x48')](_0x388b49)[_0xd9b0('0x12')](handleEntityNotFound(_0x2bb5e7,null))['then'](function(_0x49362b){if(_0x49362b){if(!_['isNil'](_0x49362b[_0xd9b0('0x79')])){if(fs[_0xd9b0('0x6c')](path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],'server/files/images/avatars/',_0x49362b[_0xd9b0('0x79')]))){_0x1137d0=path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x72'),_0x49362b[_0xd9b0('0x79')]);}}return _0x2bb5e7['download'](_0x1137d0);}})['catch'](handleError(_0x2bb5e7,null));};exports['notify']=function(_0x4a67e1,_0x107a67){var _0x3af375=require(_0xd9b0('0x7a'));var _0x2acb78=new _0x3af375();var _0x357040=_0x2acb78[_0xd9b0('0x7b')](_0x4a67e1['headers'][_0xd9b0('0x7c')])[_0xd9b0('0x7d')]();var _0x59dad7={'body':_0x4a67e1[_0xd9b0('0x4a')],'channel':'chat'};var _0x3e1951=[];var _0x25a8db=[];var _0x27baa6={};var _0x2ea8c3=![];return db[_0xd9b0('0x7e')][_0xd9b0('0x53')]()['then'](function(_0x544a69){if(!_0x544a69){throw new db[(_0xd9b0('0x7f'))]['ValidationError']('no\x20available\x20attributes');}_0x3e1951=_[_0xd9b0('0x80')](_[_0xd9b0('0x32')](_0x544a69),[_0xd9b0('0x81'),'updatedAt']);_0x25a8db=_['difference'](_[_0xd9b0('0x32')](_0x544a69),[_0xd9b0('0x81'),_0xd9b0('0x82'),_0xd9b0('0x83'),_0xd9b0('0x84')]);if(_0x4a67e1['body']['id']){delete _0x4a67e1['body']['id'];}if(_[_0xd9b0('0x77')](_0x4a67e1['body'][_0xd9b0('0x85')])){throw new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0x87'));}if(_[_0xd9b0('0x77')](_0x4a67e1['body'][_0xd9b0('0x4a')])||_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x4a')]===''){throw new db[(_0xd9b0('0x7f'))]['ValidationError'](_0xd9b0('0x88'));}if(_[_0xd9b0('0x77')](_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x89')])){throw new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0x8a')+_0x25a8db);}if(!_[_0xd9b0('0x8b')](_0x25a8db,_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x89')])){throw new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0x8c')+_0x25a8db);}_0x27baa6[_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x89')]]=_0x4a67e1['body'][_0xd9b0('0x85')];})[_0xd9b0('0x12')](function(){return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'where':{'id':_0x4a67e1[_0xd9b0('0x44')]['id']},'include':[{'model':db[_0xd9b0('0x8d')],'as':_0xd9b0('0x8e'),'include':[{'model':db[_0xd9b0('0x7e')],'as':_0xd9b0('0x8f'),'where':_0x27baa6,'limit':0x1,'order':[[_0xd9b0('0x82'),_0xd9b0('0x90')]]}]},{'model':db[_0xd9b0('0x91')],'as':_0xd9b0('0x92')}]});})[_0xd9b0('0x12')](handleEntityNotFound(_0x107a67,null))['then'](function(_0x1122ad){if(_0x1122ad&&_0x1122ad[_0xd9b0('0x8e')]){_0x59dad7[_0xd9b0('0x93')]=_0x1122ad;_0x59dad7['applications']=_0x1122ad[_0xd9b0('0x92')];_0x59dad7[_0xd9b0('0x94')]=_0x1122ad[_0xd9b0('0x8e')];_0x59dad7['applications']=_[_0xd9b0('0x95')](_0x59dad7[_0xd9b0('0x96')],[_0xd9b0('0x97')],[_0xd9b0('0x98')]);if(_0x59dad7[_0xd9b0('0x93')]['Applications']){delete _0x59dad7[_0xd9b0('0x93')][_0xd9b0('0x92')];}if(_0x59dad7[_0xd9b0('0x93')][_0xd9b0('0x8e')]&&_0x59dad7[_0xd9b0('0x93')][_0xd9b0('0x8e')][_0xd9b0('0x8f')]['length']){return _0x59dad7[_0xd9b0('0x93')][_0xd9b0('0x8e')][_0xd9b0('0x8f')][0x0];}var _0x90d219=_['defaults'](_0x4a67e1[_0xd9b0('0x4a')],{'firstName':_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x85')],'ListId':_0x1122ad[_0xd9b0('0x84')]});_0x90d219[_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x89')]]=_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x85')];return db[_0xd9b0('0x7e')][_0xd9b0('0x49')](_0x90d219,{'fields':_0x3e1951,'raw':!![]});}})[_0xd9b0('0x12')](handleEntityNotFound(_0x107a67,null))[_0xd9b0('0x12')](function(_0x1c949d){_0x59dad7[_0xd9b0('0x99')]=_0x1c949d;var _0x40b567=_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x9a')];if(_0x4a67e1[_0xd9b0('0x9b')]['cf-connecting-ip']){_0x40b567=_0x4a67e1[_0xd9b0('0x9b')]['cf-connecting-ip'];}else if(_0x4a67e1['headers']['x-forwarded-for']){_0x40b567=_['first'](_0x4a67e1[_0xd9b0('0x9b')][_0xd9b0('0x9c')][_0xd9b0('0x9d')](','));}if(_0x1c949d){var _0x4b2b07={'ContactId':_0x1c949d['id'],'ChatWebsiteId':_0x4a67e1['params']['id'],'from':(_0x1c949d[_0xd9b0('0x9e')]||'')+'\x20'+(_0x1c949d[_0xd9b0('0x9f')]||''),'customerIp':_0x40b567,'customerPort':_0x4a67e1[_0xd9b0('0x9b')][_0xd9b0('0xa0')]?_0x4a67e1[_0xd9b0('0x9b')]['x-real-port']:null,'referer':_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xa1')],'browserName':_0x357040['browser'][_0xd9b0('0x29')]&&_0x357040[_0xd9b0('0xa2')][_0xd9b0('0xa3')]?util[_0xd9b0('0xa4')](_0xd9b0('0xa5'),_0x357040[_0xd9b0('0xa2')]['name'],_0x357040[_0xd9b0('0xa2')][_0xd9b0('0xa3')]):'unknown','browserVersion':_0x357040[_0xd9b0('0xa2')][_0xd9b0('0xa3')]||_0xd9b0('0xa6'),'osName':util[_0xd9b0('0xa4')](_0xd9b0('0xa5'),_0x357040['os']['name'],_0x357040['os'][_0xd9b0('0xa3')]),'osVersion':_0x357040['os'][_0xd9b0('0xa3')],'deviceModel':_0x357040[_0xd9b0('0xa7')][_0xd9b0('0x30')]&&_0x357040[_0xd9b0('0xa7')][_0xd9b0('0xa8')]?util[_0xd9b0('0xa4')](_0xd9b0('0xa9'),_0x357040[_0xd9b0('0xa7')][_0xd9b0('0x30')],_0x357040['device']['vendor'],_0x357040['device'][_0xd9b0('0x2f')]):null,'deviceVendor':_0x357040['device'][_0xd9b0('0xa8')],'deviceType':_0x357040[_0xd9b0('0xa7')][_0xd9b0('0x2f')],'formData':JSON[_0xd9b0('0x16')](_0x4a67e1[_0xd9b0('0x4a')])};var _0x5aecdc={'ChatWebsiteId':_0x4a67e1[_0xd9b0('0x44')]['id'],'closed':![]};if(_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xaa')]){_0x5aecdc[_0xd9b0('0xaa')]=_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xaa')];return db[_0xd9b0('0xab')][_0xd9b0('0x48')]({'where':_0x5aecdc})[_0xd9b0('0x12')](function(_0x2bc667){if(_0x2bc667){return[_0x2bc667,![]];}_0x4b2b07['threadId']=_0x4a67e1[_0xd9b0('0x4a')]['threadId'];_0x4b2b07[_0xd9b0('0xac')]=_0x4a67e1['body'][_0xd9b0('0xac')];return db[_0xd9b0('0xab')][_0xd9b0('0x49')](_0x4b2b07)[_0xd9b0('0x12')](function(_0x26c4c4){return[_0x26c4c4,!![]];});});}_0x5aecdc[_0xd9b0('0xad')]=_0x1c949d['id'];if(_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xae')]&&_0x4a67e1[_0xd9b0('0x4a')]['interaction']['id']){_0x5aecdc['id']=_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xae')]['id'];return db['ChatInteraction']['find']({'where':_0x5aecdc})['then'](function(_0x2bd308){if(_0x2bd308){return[_0x2bd308,![]];}return db[_0xd9b0('0xab')]['create'](_0x4b2b07)[_0xd9b0('0x12')](function(_0x5967a5){return[_0x5967a5,!![]];});});}return db[_0xd9b0('0xab')][_0xd9b0('0x49')](_0x4b2b07)[_0xd9b0('0x12')](function(_0x218e3b){return[_0x218e3b,!![]];});}})[_0xd9b0('0xaf')](function(_0x4f7cf2,_0x4f2586){if(_0x4f7cf2){_0x2ea8c3=_0x4f2586;if(!_0x4f2586){var _0x4ed891={'from':(_0x59dad7[_0xd9b0('0x99')]['firstName']||'')+'\x20'+(_0x59dad7[_0xd9b0('0x99')][_0xd9b0('0x9f')]||'')};if(_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xaa')]&&_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xb0')]&&_0x4a67e1[_0xd9b0('0x4a')]['threadId']!=_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xb0')]){_0x4ed891['threadId']=_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xb0')];}return _0x4f7cf2[_0xd9b0('0x23')](_0x4ed891);}else{return _0x4f7cf2;}}})[_0xd9b0('0x12')](function(_0x2cf9c2){_0x59dad7['interaction']=_0x2cf9c2['get']({'plain':!![]});_0x59dad7['interaction'][_0xd9b0('0xb1')]=_0x2ea8c3;if(_0x59dad7[_0xd9b0('0xae')][_0xd9b0('0xb1')]){if(_0x59dad7[_0xd9b0('0x93')][_0xd9b0('0xb2')]){_0x59dad7[_0xd9b0('0x96')][_0xd9b0('0xb3')]({'id':0x0,'priority':_0x59dad7['applications'][_0xd9b0('0x36')]+0x1,'app':_0xd9b0('0xb4'),'appdata':_0xd9b0('0xb5'),'interval':_0xd9b0('0xb6')});}}return db['ChatMessage'][_0xd9b0('0x49')]({'body':_0x4a67e1[_0xd9b0('0x4a')]['body'],'ChatWebsiteId':_0x4a67e1['params']['id'],'ChatInteractionId':_0x2cf9c2['id'],'direction':'in','ContactId':_0x59dad7[_0xd9b0('0x99')]['id'],'AttachmentId':_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xb7')]});})[_0xd9b0('0x12')](function(_0x513cf1){_0x59dad7['message']=_0x513cf1;if(_0x59dad7[_0xd9b0('0xae')][_0xd9b0('0xb8')]){return db['User'][_0xd9b0('0x48')]({'attributes':['id','name'],'where':{'id':_0x59dad7[_0xd9b0('0xae')]['UserId']}})['then'](function(_0x9dc1ac){if(_0x9dc1ac){_0x59dad7[_0xd9b0('0x96')][_0xd9b0('0xb9')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x9dc1ac[_0xd9b0('0x29')]+','+(_0x59dad7[_0xd9b0('0x93')]['waitForTheAssignedAgent']||0xa),'interval':_0xd9b0('0xb6')});_0x59dad7[_0xd9b0('0xba')]=!![];}return respondWithRpcPromise(_0xd9b0('0xbb'),_0xd9b0('0xbc'),_0x59dad7);});}return respondWithRpcPromise(_0xd9b0('0xbb'),_0xd9b0('0xbc'),_0x59dad7);})[_0xd9b0('0x12')](function(_0x5c7ccc){respondWithRpcPromise('EventManager','EventManager',{'event':_0xd9b0('0xbd'),'message':_0x5c7ccc},client9002);return _0x5c7ccc;})[_0xd9b0('0x12')](respondWithResult(_0x107a67,null))[_0xd9b0('0x1b')](handleError(_0x107a67,null));};exports[_0xd9b0('0xbe')]=function(_0x524866,_0x561c5c){var _0x5b29b7,_0x258141,_0x3807a3;var _0xb3f6fb=[];var _0x2cc125={};var _0x2f1324=_0x524866[_0xd9b0('0xbf')]||[];var _0x32441a=[];var _0x4027d0;return db['CmContact'][_0xd9b0('0x53')]()[_0xd9b0('0x12')](function(_0x36c94b){if(!_0x36c94b){throw new db['Sequelize']['ValidationError'](_0xd9b0('0xc0'));}_0xb3f6fb=_[_0xd9b0('0x80')](_[_0xd9b0('0x32')](_0x36c94b),[_0xd9b0('0x81'),'updatedAt',_0xd9b0('0x83'),_0xd9b0('0x84')]);if(_0x524866['body']['id']){delete _0x524866['body']['id'];}if(_['isNil'](_0x524866[_0xd9b0('0x4a')][_0xd9b0('0x85')])){throw _0x561c5c[_0xd9b0('0x1d')](0x1f4)[_0xd9b0('0xc1')](new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0x87')));}if(_[_0xd9b0('0x77')](_0x524866['body']['body'])||_0x524866[_0xd9b0('0x4a')]['body']===''){throw _0x561c5c[_0xd9b0('0x1d')](0x1f4)[_0xd9b0('0xc1')](new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0x88')));}if(_[_0xd9b0('0x77')](_0x524866[_0xd9b0('0x4a')]['mapKeyOffline'])){throw _0x561c5c[_0xd9b0('0x1d')](0x1f4)[_0xd9b0('0xc1')](new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0xc2')+_0xb3f6fb));}if(!_[_0xd9b0('0x8b')](_0xb3f6fb,_0x524866[_0xd9b0('0x4a')][_0xd9b0('0xc3')])){throw _0x561c5c[_0xd9b0('0x1d')](0x1f4)[_0xd9b0('0xc1')](new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0xc4')+_0xb3f6fb));}_0x2cc125[_0x524866[_0xd9b0('0x4a')][_0xd9b0('0xc3')]]=_0x524866[_0xd9b0('0x4a')][_0xd9b0('0x85')];})[_0xd9b0('0x12')](function(){return db['ChatWebsite'][_0xd9b0('0x48')]({'where':{'id':_0x524866[_0xd9b0('0x44')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db['MailAccount'],'as':_0xd9b0('0xc5')}]});})[_0xd9b0('0x12')](handleEntityNotFound(_0x561c5c,null))[_0xd9b0('0x12')](function(_0x11cace){if(_0x11cace&&_0x11cace[_0xd9b0('0x8e')]){_0x258141=_0x11cace;var _0x48dea5=_['defaults'](_0x524866['body'],{'firstName':_0x524866[_0xd9b0('0x4a')][_0xd9b0('0x85')],'phone':_0x524866[_0xd9b0('0x4a')][_0xd9b0('0x85')],'ListId':_0x11cace[_0xd9b0('0x84')]});_0x48dea5[_0x524866[_0xd9b0('0x4a')]['mapKeyOffline']]=_0x524866[_0xd9b0('0x4a')][_0xd9b0('0x85')];return db[_0xd9b0('0x7e')][_0xd9b0('0xc6')]({'where':_0x2cc125,'defaults':_0x48dea5});}})[_0xd9b0('0xaf')](function(_0xbc4c0f){if(_0xbc4c0f){_0x3807a3=_0xbc4c0f;var _0x58500b=fs[_0xd9b0('0xc7')](path[_0xd9b0('0x6d')](config['root'],_0xd9b0('0xc8')),'utf8');var _0x537d10=ejs['render'](_0x58500b,{'body':_['toPairs'](_0x524866['body']['body']),'bodyTitle':_0x258141[_0xd9b0('0xc9')]});return db['ChatOfflineMessage'][_0xd9b0('0x49')]({'body':_0x537d10,'ContactId':_0xbc4c0f['id'],'ChatWebsiteId':_0x258141['id']});}})[_0xd9b0('0x12')](function(_0x4f4bad){_0x4027d0=_0x4f4bad;if(_0x2f1324[_0xd9b0('0x36')]){var _0x4848e0=_0x2f1324[_0xd9b0('0x2c')](function(_0x2094b7){return{'name':_0x2094b7['originalname'],'basename':_0x2094b7[_0xd9b0('0x63')],'type':_0x2094b7[_0xd9b0('0xca')],'ChatOfflineMessageId':_0x4f4bad['id']};});_0x32441a=_0x4848e0[_0xd9b0('0x2c')](_0x16bf8b=>{var _0x12c21d={'filename':_0x16bf8b[_0xd9b0('0x29')],'path':path['join'](config[_0xd9b0('0x68')],'server',_0xd9b0('0xbf'),_0xd9b0('0xcb'),_0xd9b0('0xcc'),_0x16bf8b['basename'])};return _0x12c21d;});if(!_0x258141[_0xd9b0('0xcd')]){return db[_0xd9b0('0xce')]['transaction'](function(_0x23badb){return db[_0xd9b0('0xcf')][_0xd9b0('0xd0')](_0x4848e0,{'transaction':_0x23badb});});}}})['then'](function(){if(_0x4027d0){_0x5b29b7=_0x4027d0;return db[_0xd9b0('0xc5')][_0xd9b0('0x57')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9b0('0xd1'),'raw':!![]}]});}})[_0xd9b0('0x12')](function(_0x26e944){if(_0x26e944&&_0x26e944[_0xd9b0('0xd1')]&&_0x258141[_0xd9b0('0xd2')]&&_0x258141['forwardOfflineAddress']){var _0x2b328f={'tls':{'rejectUnauthorized':![]}};if(_0x26e944[_0xd9b0('0xd1')]['service']){_0x2b328f['service']=_0x26e944[_0xd9b0('0xd1')][_0xd9b0('0xd3')];}else{_0x2b328f['host']=_0x26e944[_0xd9b0('0xd1')][_0xd9b0('0xd4')];_0x2b328f[_0xd9b0('0xd5')]=_0x26e944[_0xd9b0('0xd1')]['port'];_0x2b328f[_0xd9b0('0xd6')]=_0x26e944[_0xd9b0('0xd1')]['secure'];}if(_0x26e944[_0xd9b0('0xd1')][_0xd9b0('0xd7')]){_0x2b328f[_0xd9b0('0xd8')]={'user':_0x26e944[_0xd9b0('0xd1')][_0xd9b0('0x4b')],'pass':_0x26e944[_0xd9b0('0xd1')][_0xd9b0('0xd9')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x2b328f,'message':{'from':util[_0xd9b0('0xa4')](_0xd9b0('0xda'),_0x26e944['name'],_0x26e944['email']||_0x26e944[_0xd9b0('0xd1')][_0xd9b0('0x4b')]),'to':_0x258141[_0xd9b0('0xdb')],'subject':_0x258141['offlineMessageSubject'],'html':_0x5b29b7[_0xd9b0('0x4a')],'attachments':_0x32441a}},client9003)[_0xd9b0('0x12')](function(){return _0x5b29b7;})[_0xd9b0('0x1b')](function(_0x17c888){console['error'](_0x17c888);});}})[_0xd9b0('0x12')](function(){if(_0x258141&&_0x258141['openNewInteraction']&&_0x258141[_0xd9b0('0xdc')]){var _0x40defb=[];if(_0x2f1324['length']){_0x40defb=_0x2f1324[_0xd9b0('0x2c')](function(_0x310f11){return{'name':_0x310f11[_0xd9b0('0xdd')],'basename':_0x310f11[_0xd9b0('0x63')],'type':_0x310f11[_0xd9b0('0xca')],'ChatOfflineMessageId':_0x4027d0['id']};});}var _0x40742e;if(!_[_0xd9b0('0x77')](_0x258141[_0xd9b0('0xde')])){var _0xda81c8=_[_0xd9b0('0x2c')](_0x524866['body'],function(_0x461796){return _0x461796;});var _0x5f0f94=_[_0xd9b0('0xdf')](_0xda81c8)[0x0];var _0x33ace1=_['mapValues'](_0x5f0f94,function(_0xb54216){return _0xb54216;});_0x40742e=_0x33ace1[0x1][_0x258141[_0xd9b0('0xde')]];}var _0x472094={'from':_0x3807a3[_0xd9b0('0xe0')],'firstName':_0x3807a3['firstName'],'lastName':_0x3807a3[_0xd9b0('0x9f')],'mapKey':'email','message':{'from':_0x3807a3[_0xd9b0('0xe0')],'to':_0x258141[_0xd9b0('0xc5')]['email'],'cc':'','subject':_[_0xd9b0('0x77')](_0x40742e)?_0x258141[_0xd9b0('0xe1')]:_0x40742e,'messageId':'','sentAt':new Date(),'attach':_0x40defb[_0xd9b0('0x36')],'attachments':_0x40defb,'originChannel':_0xd9b0('0xe2'),'ChatWebsiteId':_0x258141['id'],'ChatOfflineMessageId':_0x5b29b7['id'],'originTo':_0x258141[_0xd9b0('0xc5')]['email']},'body':_0x5b29b7['body']};var _0x167034={'account':{'id':_0x258141[_0xd9b0('0xdc')]},'body':_0x472094,'log':_0xd9b0('0xe3')};return respondWithRpcPromise(_0xd9b0('0xe3'),_0xd9b0('0xe4'),_0x167034,client9001)[_0xd9b0('0x12')](function(){return _0x5b29b7;})[_0xd9b0('0x1b')](function(_0x408aa9){console[_0xd9b0('0x17')](_0x408aa9);});}return;})[_0xd9b0('0x12')](function(){if(_0x5b29b7){return _0x5b29b7;}})[_0xd9b0('0x12')](respondWithResult(_0x561c5c,null))[_0xd9b0('0x1b')](function(_0x51a84a){console['error'](_0xd9b0('0x1b'),_0x51a84a);for(var _0x16a4e0 of _0x2f1324){var _0x486263=path['join'](config[_0xd9b0('0x68')],'server',_0xd9b0('0xbf'),_0xd9b0('0xcb'),_0xd9b0('0xcc'),_0x16a4e0[_0xd9b0('0x63')]);fs_extra[_0xd9b0('0xe5')](_0x486263)[_0xd9b0('0x1b')](function(_0x46d0f6){console[_0xd9b0('0x17')](_0xd9b0('0xe6'),_0x486263,_0x46d0f6);});}});};exports[_0xd9b0('0xe7')]=function(_0x253576,_0x22b178){return db[_0xd9b0('0xab')][_0xd9b0('0x48')]({'where':{'id':_0x253576['params']['id']}})['then'](handleEntityNotFound(_0x22b178,null))[_0xd9b0('0x12')](function(_0x3c811d){if(_0x3c811d){return _0x3c811d[_0xd9b0('0xe7')](_0x253576['body'][_0xd9b0('0x5c')],_[_0xd9b0('0xe8')](_0x253576[_0xd9b0('0x4a')],[_0xd9b0('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x22b178,null))['catch'](handleError(_0x22b178,null));};exports[_0xd9b0('0xe9')]=function(_0x128525,_0x50762e){var _0x1c4409={'raw':![],'where':{}};var _0x30bd20={};var _0x20deca={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd9b0('0x57')]({'where':{'id':_0x128525[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x50762e,null))[_0xd9b0('0x12')](function(_0x55369d){if(_0x55369d){_0x30bd20[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db[_0xd9b0('0xab')]['rawAttributes']);_0x30bd20[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x128525[_0xd9b0('0x31')]);_0x30bd20[_0xd9b0('0x3d')]=_[_0xd9b0('0x33')](_0x30bd20['model'],_0x30bd20[_0xd9b0('0x31')]);_0x1c4409[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0x30bd20[_0xd9b0('0x30')],qs[_0xd9b0('0x35')](_0x128525[_0xd9b0('0x31')]['fields']));_0x1c4409[_0xd9b0('0x34')]=_0x1c4409[_0xd9b0('0x34')][_0xd9b0('0x36')]?_0x1c4409[_0xd9b0('0x34')]:_0x30bd20[_0xd9b0('0x30')];if(!_0x128525[_0xd9b0('0x31')][_0xd9b0('0x37')](_0xd9b0('0x38'))){_0x1c4409[_0xd9b0('0x39')]=qs[_0xd9b0('0x39')](_0x128525[_0xd9b0('0x31')]['limit']);_0x1c4409[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x128525[_0xd9b0('0x31')][_0xd9b0('0x1e')]);}_0x1c4409[_0xd9b0('0x3a')]=qs[_0xd9b0('0x3b')](_0x128525['query'][_0xd9b0('0x3b')]);_0x1c4409[_0xd9b0('0x3c')]=qs['filters'](_[_0xd9b0('0x59')](_0x128525[_0xd9b0('0x31')],_0x30bd20[_0xd9b0('0x3d')]));_0x1c4409['where'][_0xd9b0('0x55')]=_0x55369d['id'];if(_0x128525[_0xd9b0('0x31')][_0xd9b0('0x3e')]){_0x1c4409[_0xd9b0('0x3c')]=_[_0xd9b0('0x46')](_0x1c4409['where'],{'$or':_[_0xd9b0('0x2c')](_0x1c4409['attributes'],function(_0x304d4a){var _0x1301e9={};_0x1301e9[_0x304d4a]={'$like':'%'+_0x128525[_0xd9b0('0x31')][_0xd9b0('0x3e')]+'%'};return _0x1301e9;})});}_0x1c4409=_[_0xd9b0('0x46')]({},_0x1c4409,_0x128525['options']);return db[_0xd9b0('0xab')][_0xd9b0('0x20')]({'where':_0x1c4409['where']})[_0xd9b0('0x12')](function(_0x35fb72){_0x20deca[_0xd9b0('0x20')]=_0x35fb72;if(_0x128525[_0xd9b0('0x31')][_0xd9b0('0x45')]){_0x1c4409['include']=[{'model':db['CmContact'],'as':_0xd9b0('0xea'),'required':![]},{'model':db[_0xd9b0('0xeb')],'as':_0xd9b0('0xec'),'attributes':['name',_0xd9b0('0xed'),_0xd9b0('0xee')],'required':![]},{'model':db[_0xd9b0('0xef')],'as':_0xd9b0('0xf0'),'attributes':['id','name',_0xd9b0('0xf1')],'where':_0x128525[_0xd9b0('0x31')][_0xd9b0('0xf2')]?{'id':_0x128525['query'][_0xd9b0('0xf2')]}:undefined,'required':_0x128525[_0xd9b0('0x31')][_0xd9b0('0xf2')]?!![]:![]}];}return db[_0xd9b0('0xab')][_0xd9b0('0x41')](_0x1c4409);})[_0xd9b0('0x12')](function(_0x1bf80f){_0x20deca[_0xd9b0('0x42')]=_0x1bf80f;return _0x20deca;});}})['then'](respondWithFilteredResult(_0x50762e,_0x1c4409))[_0xd9b0('0x1b')](handleError(_0x50762e,null));};function iftimePromise(_0xe20a4e,_0x5cf61f){return respondWithRpcPromise(_0xd9b0('0xf3'),_0xd9b0('0xf4'),{'command':_0x5cf61f[_0xd9b0('0xf5')]?util[_0xd9b0('0xa4')](_0xd9b0('0xf6'),_0xe20a4e[_0xd9b0('0xf7')],_0x5cf61f[_0xd9b0('0xf5')]):util[_0xd9b0('0xa4')](_0xd9b0('0xf8'),_0xe20a4e[_0xd9b0('0xf7')])},client9002)[_0xd9b0('0x12')](function(_0x109de3){var _0x4ad6f9=_0x109de3&&_0x109de3[_0xd9b0('0xf9')](_0xd9b0('0xfa'))>=0x0?!![]:![];logger[_0xd9b0('0x1a')](_0xd9b0('0xfb'),_0x5cf61f['id'],_0xe20a4e['id'],_0xe20a4e[_0xd9b0('0xf7')],_0x4ad6f9?'ONLINE':_0xd9b0('0xfc'),_0x5cf61f[_0xd9b0('0xf5')]?_0x5cf61f[_0xd9b0('0xf5')]:_0xd9b0('0xfd'));return _0x4ad6f9;})[_0xd9b0('0x1b')](function(_0x3098a8){logger[_0xd9b0('0x17')](_0xd9b0('0xfb'),_0x5cf61f['id'],_0xe20a4e['id'],_0xe20a4e['interval'],util[_0xd9b0('0xfe')](_0x3098a8,{'showHidden':![],'depth':null}),_0x5cf61f['timezone']?_0x5cf61f['timezone']:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x8e1ef0,_0x271f45){var _0xc0a90a=0x0;var _0x58d8e7=0x0;var _0x245767=![];var _0x404c4f;var _0x41a4aa;return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x8e1ef0[_0xd9b0('0x44')]['id']},'include':[{'model':db[_0xd9b0('0xff')],'as':_0xd9b0('0xff'),'include':[{'model':db['Interval'],'as':_0xd9b0('0x100'),'attributes':['id',_0xd9b0('0xf7')],'raw':!![]}]}]})[_0xd9b0('0x12')](handleEntityNotFound(_0x271f45,null))['then'](function(_0x5d9a3e){if(_0x5d9a3e){_0x404c4f=_0x5d9a3e;return _0x5d9a3e[_0xd9b0('0x101')]({'raw':!![]});}})[_0xd9b0('0x12')](function(_0x1a0d4a){if(_0x404c4f){if(_0x1a0d4a){_0x41a4aa=_0x1a0d4a;}}return require(_0xd9b0('0x69'))['getLicense']();})[_0xd9b0('0x12')](function(_0x1aa541){if(_0x1aa541){_0x58d8e7=_0x1aa541['virtual'];_0x245767=_0x1aa541[_0xd9b0('0x6b')];}})[_0xd9b0('0x12')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0x111909){_0xc0a90a=_0x111909;if(_0x58d8e7&&_0x111909>_0x58d8e7){return db[_0xd9b0('0x102')][_0xd9b0('0x57')]({'where':{'id':0x1}})[_0xd9b0('0x12')](function(_0x448a3c){if(_0x448a3c){_0x448a3c[_0xd9b0('0x103')](_0xd9b0('0x104'));}});}})['then'](function(){if(_0x404c4f['Interval']&&_0x404c4f[_0xd9b0('0xff')][_0xd9b0('0x100')]){var _0x25afab=[];for(var _0x286c19=0x0;_0x286c19<_0x404c4f[_0xd9b0('0xff')][_0xd9b0('0x100')][_0xd9b0('0x36')];_0x286c19++){var _0x312962=_0x404c4f[_0xd9b0('0xff')][_0xd9b0('0x100')][_0x286c19][_0xd9b0('0x25')]({'plain':!![]});_0x25afab[_0xd9b0('0xb3')](iftimePromise(_0x312962,_0x404c4f));}return BPromise[_0xd9b0('0x105')](_0x25afab)[_0xd9b0('0x12')](function(_0x46652d){return _[_0xd9b0('0x106')](_0x46652d);});}else{return!![];}})[_0xd9b0('0x12')](function(_0x2ace15){var _0x566e2c=fs[_0xd9b0('0xc7')](path['join'](config[_0xd9b0('0x68')],_0xd9b0('0x107')),_0xd9b0('0x108'));var _0x262054={'remote':_0x404c4f[_0xd9b0('0x109')],'query':querystring['stringify'](_[_0xd9b0('0x46')](_0x404c4f[_0xd9b0('0x25')]({'plain':!![]}),{'customerIp':_0x8e1ef0[_0xd9b0('0x9b')][_0xd9b0('0x9c')]||_0x8e1ef0[_0xd9b0('0x9b')][_0xd9b0('0x10a')]||_0x8e1ef0[_0xd9b0('0x10b')][_0xd9b0('0x10c')]||_0x8e1ef0['ip'],'referer':_0x8e1ef0[_0xd9b0('0x9b')][_0xd9b0('0xa1')],'openedInteractions':_0xc0a90a,'maxInteractions':_0x58d8e7,'virtual':_0x245767[_0xd9b0('0x10d')],'online':_0x2ace15,'custom':_0x245767}))[_0xd9b0('0x10e')](/'/g,'\x5c\x27')};_0x271f45[_0xd9b0('0xc1')](ejs[_0xd9b0('0x10f')](Mustache[_0xd9b0('0x10f')](_0x566e2c,_0x262054),{'proactiveActions':_0x41a4aa,'alignment':_0x404c4f[_0xd9b0('0x110')],'verticalAlignment':_0x404c4f[_0xd9b0('0x111')],'div_color':_0x404c4f[_0xd9b0('0xf1')],'labelText':_0x404c4f['labelText'],'text_color':_0x404c4f[_0xd9b0('0x112')],'button_color':_0x404c4f[_0xd9b0('0x113')],'background_color':_0x404c4f[_0xd9b0('0x114')]}));})['catch'](handleError(_0x271f45,null));};exports[_0xd9b0('0x115')]=function(_0x21d4d0,_0x3611b2){var _0x332616=_0x21d4d0[_0xd9b0('0x44')]['id'];var _0x53fd8e=_0x21d4d0['body'];var _0x3edd36=0xc8;var _0x40a24e=null;return db[_0xd9b0('0xce')][_0xd9b0('0x116')]({'isolationLevel':db[_0xd9b0('0xce')][_0xd9b0('0x117')]['ISOLATION_LEVELS'][_0xd9b0('0x118')]},function(_0x2e57ab){return db['ChatWebsite'][_0xd9b0('0x57')]({'where':{'id':_0x332616},'transaction':_0x2e57ab})[_0xd9b0('0x12')](function(_0x2b7804){if(_0x2b7804){return db[_0xd9b0('0x91')][_0xd9b0('0x24')]({'where':{'ChatWebsiteId':_0x332616},'transaction':_0x2e57ab})['then'](function(){var _0x38d97d=_[_0xd9b0('0x2c')](_0x53fd8e,function(_0x54a750){_0x54a750[_0xd9b0('0x55')]=_0x332616;return _0x54a750;});return db[_0xd9b0('0x91')][_0xd9b0('0xd0')](_0x38d97d,{'transaction':_0x2e57ab});});}else{_0x3edd36=0x194;_0x40a24e=[];}});})[_0xd9b0('0x12')](function(){if(_0x3edd36!==0x194){return db['ChatApplication'][_0xd9b0('0x119')]({'where':{'ChatWebsiteId':_0x332616},'order':'priority'})[_0xd9b0('0x12')](function(_0x1efc54){_0x40a24e=_0x1efc54;});}})[_0xd9b0('0x1b')](function(_0x405f8a){_0x3edd36=0x1f4;logger[_0xd9b0('0x17')](_0x405f8a[_0xd9b0('0x28')]);if(_0x405f8a[_0xd9b0('0x29')]){delete _0x405f8a[_0xd9b0('0x29')];}_0x40a24e=_0x405f8a;})[_0xd9b0('0x11a')](function(){if(_0x40a24e===null){_0x3611b2['sendStatus'](_0x3edd36);}else{if(_0x3edd36===0x1f4){_0x3611b2[_0xd9b0('0x1d')](_0x3edd36)[_0xd9b0('0xc1')](_0x40a24e);}else{_0x3611b2[_0xd9b0('0x1d')](_0x3edd36)[_0xd9b0('0x22')](_0x40a24e);}}});};exports['getApplications']=function(_0xa2b32e,_0x5e9d74){var _0x50d291={};var _0x3a5f00={};var _0xdc57e1;var _0x115657;return db[_0xd9b0('0x40')][_0xd9b0('0x57')]({'where':{'id':_0xa2b32e['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x5e9d74,null))['then'](function(_0x5db610){if(_0x5db610){_0xdc57e1=_0x5db610;_0x3a5f00[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db[_0xd9b0('0x91')]['rawAttributes']);_0x3a5f00[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0xa2b32e[_0xd9b0('0x31')]);_0x3a5f00[_0xd9b0('0x3d')]=_[_0xd9b0('0x33')](_0x3a5f00[_0xd9b0('0x30')],_0x3a5f00['query']);_0x50d291[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0x3a5f00[_0xd9b0('0x30')],qs[_0xd9b0('0x35')](_0xa2b32e[_0xd9b0('0x31')][_0xd9b0('0x35')]));_0x50d291[_0xd9b0('0x34')]=_0x50d291[_0xd9b0('0x34')]['length']?_0x50d291[_0xd9b0('0x34')]:_0x3a5f00[_0xd9b0('0x30')];_0x50d291[_0xd9b0('0x3a')]=qs['sort'](_0xa2b32e[_0xd9b0('0x31')][_0xd9b0('0x3b')]);_0x50d291['where']=qs['filters'](_[_0xd9b0('0x59')](_0xa2b32e[_0xd9b0('0x31')],_0x3a5f00['filters']));if(_0xa2b32e[_0xd9b0('0x31')][_0xd9b0('0x3e')]){_0x50d291[_0xd9b0('0x3c')]=_[_0xd9b0('0x46')](_0x50d291['where'],{'$or':_[_0xd9b0('0x2c')](_0x50d291[_0xd9b0('0x34')],function(_0x46194a){var _0x2cc634={};_0x2cc634[_0x46194a]={'$like':'%'+_0xa2b32e['query']['filter']+'%'};return _0x2cc634;})});}_0x50d291=_[_0xd9b0('0x46')]({},_0x50d291,_0xa2b32e[_0xd9b0('0x47')]);return _0xdc57e1['getApplications'](_0x50d291);}})[_0xd9b0('0x12')](function(_0x53c036){if(_0x53c036){_0x115657=_0x53c036[_0xd9b0('0x36')];if(!_0xa2b32e[_0xd9b0('0x31')]['hasOwnProperty'](_0xd9b0('0x38'))){_0x50d291[_0xd9b0('0x39')]=qs['limit'](_0xa2b32e[_0xd9b0('0x31')][_0xd9b0('0x39')]);_0x50d291['offset']=qs[_0xd9b0('0x1e')](_0xa2b32e[_0xd9b0('0x31')][_0xd9b0('0x1e')]);}return _0xdc57e1['getApplications'](_0x50d291);}})[_0xd9b0('0x12')](function(_0x44c4f5){if(_0x44c4f5){return _0x44c4f5?{'count':_0x115657,'rows':_0x44c4f5}:null;}})[_0xd9b0('0x12')](respondWithResult(_0x5e9d74,null))[_0xd9b0('0x1b')](handleError(_0x5e9d74,null));};exports[_0xd9b0('0x11b')]=function(_0x2d673b,_0x556731){return db['chatProactiveAction']['find']({'where':{'id':_0x2d673b[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x556731,null))['then'](function(_0x35abe4){if(_0x35abe4){return _0x35abe4[_0xd9b0('0x11b')](_0x2d673b[_0xd9b0('0x4a')][_0xd9b0('0x5c')],_['omit'](_0x2d673b[_0xd9b0('0x4a')],[_0xd9b0('0x5c'),'id'])||{});}})[_0xd9b0('0x12')](respondWithResult(_0x556731,null))[_0xd9b0('0x1b')](handleError(_0x556731,null));};exports['getProactiveActions']=function(_0x3727db,_0x3dcb0f){var _0x14fdf7={};var _0x18d430={};var _0x26a2e8;var _0x23c12e;return db['ChatWebsite'][_0xd9b0('0x57')]({'where':{'id':_0x3727db['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x3dcb0f,null))[_0xd9b0('0x12')](function(_0x40e164){if(_0x40e164){_0x26a2e8=_0x40e164;_0x18d430['model']=_[_0xd9b0('0x32')](db['ChatProactiveAction'][_0xd9b0('0x2d')]);_0x18d430[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x3727db[_0xd9b0('0x31')]);_0x18d430[_0xd9b0('0x3d')]=_[_0xd9b0('0x33')](_0x18d430['model'],_0x18d430[_0xd9b0('0x31')]);_0x14fdf7[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0x18d430[_0xd9b0('0x30')],qs['fields'](_0x3727db['query'][_0xd9b0('0x35')]));_0x14fdf7[_0xd9b0('0x34')]=_0x14fdf7['attributes'][_0xd9b0('0x36')]?_0x14fdf7[_0xd9b0('0x34')]:_0x18d430[_0xd9b0('0x30')];_0x14fdf7[_0xd9b0('0x3a')]=qs['sort'](_0x3727db[_0xd9b0('0x31')]['sort']);_0x14fdf7[_0xd9b0('0x3c')]=qs[_0xd9b0('0x3d')](_[_0xd9b0('0x59')](_0x3727db[_0xd9b0('0x31')],_0x18d430[_0xd9b0('0x3d')]));if(_0x3727db[_0xd9b0('0x31')][_0xd9b0('0x3e')]){_0x14fdf7[_0xd9b0('0x3c')]=_[_0xd9b0('0x46')](_0x14fdf7[_0xd9b0('0x3c')],{'$or':_['map'](_0x14fdf7[_0xd9b0('0x34')],function(_0x4c5226){var _0x136dcd={};_0x136dcd[_0x4c5226]={'$like':'%'+_0x3727db[_0xd9b0('0x31')][_0xd9b0('0x3e')]+'%'};return _0x136dcd;})});}_0x14fdf7=_[_0xd9b0('0x46')]({},_0x14fdf7,_0x3727db['options']);return _0x26a2e8[_0xd9b0('0x101')](_0x14fdf7);}})['then'](function(_0x10bf50){if(_0x10bf50){_0x23c12e=_0x10bf50[_0xd9b0('0x36')];if(!_0x3727db[_0xd9b0('0x31')][_0xd9b0('0x37')](_0xd9b0('0x38'))){_0x14fdf7[_0xd9b0('0x39')]=qs[_0xd9b0('0x39')](_0x3727db['query'][_0xd9b0('0x39')]);_0x14fdf7[_0xd9b0('0x1e')]=qs['offset'](_0x3727db[_0xd9b0('0x31')][_0xd9b0('0x1e')]);}return _0x26a2e8['getProactiveActions'](_0x14fdf7);}})[_0xd9b0('0x12')](function(_0x56c0c1){if(_0x56c0c1){return _0x56c0c1?{'count':_0x23c12e,'rows':_0x56c0c1}:null;}})[_0xd9b0('0x12')](respondWithResult(_0x3dcb0f,null))[_0xd9b0('0x1b')](handleError(_0x3dcb0f,null));};exports[_0xd9b0('0x11c')]=function(_0x2f1899,_0x27645f){var _0x13e9d9=_0x2f1899[_0xd9b0('0x31')][_0xd9b0('0x11d')]==='false'?_0xd9b0('0x11e'):'onlineForm';return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'attributes':['id',_0x13e9d9],'where':{'id':_0x2f1899[_0xd9b0('0x44')]['id']}})['then'](handleEntityNotFound(_0x27645f,null))[_0xd9b0('0x12')](function(_0x9401f4){if(_0x9401f4){var _0x197905=_0x9401f4[_0x13e9d9];var _0x35b482=_0x197905&&_0x197905['items']?_0x197905[_0xd9b0('0x11f')]:[];_0x27645f['send']({'fromKey':_['isNil'](_0x197905[_0xd9b0('0x120')])?undefined:_0x197905['fromKey'],'count':_0x35b482['length'],'rows':_0x35b482});}})['catch'](handleError(_0x27645f,null));};exports[_0xd9b0('0x121')]=function(_0x3503de,_0x4bf108){var _0x13fc32={'raw':![],'where':{}};var _0xab88e8={};var _0x5d7e9f={'count':0x0,'rows':[]};return db[_0xd9b0('0x40')]['findOne']({'where':{'id':_0x3503de['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x4bf108,null))[_0xd9b0('0x12')](function(_0x245222){if(_0x245222){_0xab88e8[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db['ChatOfflineMessage']['rawAttributes']);_0xab88e8[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x3503de[_0xd9b0('0x31')]);_0xab88e8[_0xd9b0('0x3d')]=_[_0xd9b0('0x33')](_0xab88e8[_0xd9b0('0x30')],_0xab88e8[_0xd9b0('0x31')]);_0x13fc32[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0xab88e8['model'],qs[_0xd9b0('0x35')](_0x3503de['query'][_0xd9b0('0x35')]));_0x13fc32[_0xd9b0('0x34')]=_0x13fc32[_0xd9b0('0x34')][_0xd9b0('0x36')]?_0x13fc32[_0xd9b0('0x34')]:_0xab88e8[_0xd9b0('0x30')];if(!_0x3503de['query'][_0xd9b0('0x37')]('nolimit')){_0x13fc32[_0xd9b0('0x39')]=qs[_0xd9b0('0x39')](_0x3503de[_0xd9b0('0x31')]['limit']);_0x13fc32[_0xd9b0('0x1e')]=qs['offset'](_0x3503de['query'][_0xd9b0('0x1e')]);}_0x13fc32[_0xd9b0('0x3a')]=qs[_0xd9b0('0x3b')](_0x3503de[_0xd9b0('0x31')][_0xd9b0('0x3b')]);_0x13fc32[_0xd9b0('0x3c')]=qs[_0xd9b0('0x3d')](_[_0xd9b0('0x59')](_0x3503de[_0xd9b0('0x31')],_0xab88e8['filters']));_0x13fc32['where'][_0xd9b0('0x55')]=_0x245222['id'];if(_0x3503de[_0xd9b0('0x31')][_0xd9b0('0x3e')]){_0x13fc32[_0xd9b0('0x3c')]=_['merge'](_0x13fc32[_0xd9b0('0x3c')],{'$or':_[_0xd9b0('0x2c')](_0x13fc32[_0xd9b0('0x34')],function(_0xc76c71){var _0x1eb07c={};_0x1eb07c[_0xc76c71]={'$like':'%'+_0x3503de[_0xd9b0('0x31')][_0xd9b0('0x3e')]+'%'};return _0x1eb07c;})});}_0x13fc32=_[_0xd9b0('0x46')]({},_0x13fc32,_0x3503de[_0xd9b0('0x47')]);return db[_0xd9b0('0x122')][_0xd9b0('0x20')]({'where':_0x13fc32[_0xd9b0('0x3c')]})[_0xd9b0('0x12')](function(_0x52508b){_0x5d7e9f[_0xd9b0('0x20')]=_0x52508b;if(_0x3503de['query'][_0xd9b0('0x45')]){_0x13fc32['include']=[{'all':!![]}];}else{_0x13fc32[_0xd9b0('0x5a')]=[{'model':db[_0xd9b0('0x7e')],'as':'Contact','required':![]},{'model':db[_0xd9b0('0xcf')],'as':_0xd9b0('0x123'),'required':![]}];}return db[_0xd9b0('0x122')][_0xd9b0('0x41')](_0x13fc32);})[_0xd9b0('0x12')](function(_0x49e33c){_0x5d7e9f[_0xd9b0('0x42')]=_0x49e33c;return _0x5d7e9f;});}})['then'](respondWithFilteredResult(_0x4bf108,_0x13fc32))[_0xd9b0('0x1b')](handleError(_0x4bf108,null));};exports[_0xd9b0('0x124')]=function(_0x1be486,_0x1933db){return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x1be486['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x1933db,null))[_0xd9b0('0x12')](function(_0x6e29ce){if(_0x6e29ce){return _0x6e29ce[_0xd9b0('0x124')](_0x1be486[_0xd9b0('0x4a')][_0xd9b0('0x5c')],_['omit'](_0x1be486[_0xd9b0('0x4a')],[_0xd9b0('0x5c'),'id'])||{})[_0xd9b0('0xaf')](function(_0x370abd){for(var _0x4fa29e=0x0;_0x4fa29e<_0x1be486['body'][_0xd9b0('0x5c')][_0xd9b0('0x36')];_0x4fa29e+=0x1){socket[_0xd9b0('0x125')](_0xd9b0('0x126'),{'UserId':Number(_0x1be486[_0xd9b0('0x4a')][_0xd9b0('0x5c')][_0x4fa29e]),'ChatWebsiteId':Number(_0x1be486[_0xd9b0('0x44')]['id'])});}return _0x370abd;});}})[_0xd9b0('0x12')](respondWithResult(_0x1933db,null))['catch'](handleError(_0x1933db,null));};exports[_0xd9b0('0x127')]=function(_0x539426,_0x45da2c){return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'where':{'id':_0x539426['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x45da2c,null))[_0xd9b0('0x12')](function(_0x2d0401){if(_0x2d0401){return _0x2d0401[_0xd9b0('0x127')](_0x539426[_0xd9b0('0x31')][_0xd9b0('0x5c')])[_0xd9b0('0x12')](function(){if(_[_0xd9b0('0x128')](_0x539426['query'][_0xd9b0('0x5c')])){for(var _0x1953fd=0x0;_0x1953fd<_0x539426['query'][_0xd9b0('0x5c')][_0xd9b0('0x36')];_0x1953fd+=0x1){socket[_0xd9b0('0x125')](_0xd9b0('0x129'),{'UserId':Number(_0x539426[_0xd9b0('0x31')][_0xd9b0('0x5c')][_0x1953fd]),'ChatWebsiteId':Number(_0x539426['params']['id'])});}}else{socket[_0xd9b0('0x125')](_0xd9b0('0x129'),{'UserId':Number(_0x539426[_0xd9b0('0x31')][_0xd9b0('0x5c')]),'ChatWebsiteId':Number(_0x539426[_0xd9b0('0x44')]['id'])});}});}})[_0xd9b0('0x12')](respondWithStatusCode(_0x45da2c,null))[_0xd9b0('0x1b')](handleError(_0x45da2c,null));};exports[_0xd9b0('0x12a')]=function(_0x3afe41,_0x1e9466){var _0x45fc56={};var _0x5f0e05={};var _0x37d2df;var _0x586c6b;return db[_0xd9b0('0x40')]['findOne']({'where':{'id':_0x3afe41[_0xd9b0('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e9466,null))[_0xd9b0('0x12')](function(_0x3f2aa1){if(_0x3f2aa1){_0x37d2df=_0x3f2aa1;_0x5f0e05[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db['User']['rawAttributes']);_0x5f0e05[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x3afe41[_0xd9b0('0x31')]);_0x5f0e05['filters']=_[_0xd9b0('0x33')](_0x5f0e05['model'],_0x5f0e05[_0xd9b0('0x31')]);_0x45fc56[_0xd9b0('0x34')]=_['intersection'](_0x5f0e05[_0xd9b0('0x30')],qs[_0xd9b0('0x35')](_0x3afe41[_0xd9b0('0x31')]['fields']));_0x45fc56[_0xd9b0('0x34')]=_0x45fc56[_0xd9b0('0x34')][_0xd9b0('0x36')]?_0x45fc56[_0xd9b0('0x34')]:_0x5f0e05[_0xd9b0('0x30')];_0x45fc56[_0xd9b0('0x3a')]=qs['sort'](_0x3afe41[_0xd9b0('0x31')]['sort']);_0x45fc56[_0xd9b0('0x3c')]=qs[_0xd9b0('0x3d')](_[_0xd9b0('0x59')](_0x3afe41[_0xd9b0('0x31')],_0x5f0e05[_0xd9b0('0x3d')]));if(_0x3afe41[_0xd9b0('0x31')][_0xd9b0('0x3e')]){_0x45fc56[_0xd9b0('0x3c')]=_[_0xd9b0('0x46')](_0x45fc56[_0xd9b0('0x3c')],{'$or':_[_0xd9b0('0x2c')](_0x45fc56[_0xd9b0('0x34')],function(_0x596fcc){var _0x4b15e6={};_0x4b15e6[_0x596fcc]={'$like':'%'+_0x3afe41['query'][_0xd9b0('0x3e')]+'%'};return _0x4b15e6;})});}_0x45fc56=_['merge']({},_0x45fc56,_0x3afe41[_0xd9b0('0x47')]);return _0x37d2df[_0xd9b0('0x12a')](_0x45fc56);}})[_0xd9b0('0x12')](function(_0x225983){if(_0x225983){_0x586c6b=_0x225983[_0xd9b0('0x36')];if(!_0x3afe41[_0xd9b0('0x31')][_0xd9b0('0x37')](_0xd9b0('0x38'))){_0x45fc56[_0xd9b0('0x39')]=qs[_0xd9b0('0x39')](_0x3afe41[_0xd9b0('0x31')][_0xd9b0('0x39')]);_0x45fc56[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x3afe41[_0xd9b0('0x31')][_0xd9b0('0x1e')]);}return _0x37d2df[_0xd9b0('0x12a')](_0x45fc56);}})[_0xd9b0('0x12')](function(_0x3703f8){if(_0x3703f8){return _0x3703f8?{'count':_0x586c6b,'rows':_0x3703f8}:null;}})[_0xd9b0('0x12')](respondWithResult(_0x1e9466,null))[_0xd9b0('0x1b')](handleError(_0x1e9466,null));};
\ No newline at end of file
+var _0x8626=['userProfileId','autoAssociation','UserProfileResource','params','describe','addDisposition','Disposition','getDispositions','findAll','removeDispositions','addAnswer','ChatWebsiteId','findOne','hasOwnProperty','sort','CannedAnswer','removeAnswers','ids','sitepic','file','addAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','setUA','headers','user-agent','getResult','CmContact','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','asc','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','notify','offline','files','no\x20available\x20attributes','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','originalname','server','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','subjectOffline','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','Command','timezone','iftime\x20%s,%s','iftime\x20%s','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','utf8','x-real-ip','connection','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','sequelize','Transaction','ISOLATION_LEVELS','priority','finally','getApplications','addProactiveActions','omit','getFields','online','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','defaults','redis','socket.io-emitter','register','jayson/promise','client','http','request','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','count','limit','Content-Range','then','destroy','get','ChatWebsites','sendStatus','stack','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','name','query','intersection','attributes','fields','length','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x38a855,_0x22fac5){var _0x107430=function(_0x278696){while(--_0x278696){_0x38a855['push'](_0x38a855['shift']());}};_0x107430(++_0x22fac5);}(_0x8626,0xd9));var _0x6862=function(_0x246689,_0x5d5813){_0x246689=_0x246689-0x0;var _0x52516f=_0x8626[_0x246689];return _0x52516f;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x6862('0x0'));var util=require(_0x6862('0x1'));var path=require(_0x6862('0x2'));var ejs=require(_0x6862('0x3'));var fs=require('fs');var fs_extra=require(_0x6862('0x4'));var _=require(_0x6862('0x5'));var querystring=require(_0x6862('0x6'));var Redis=require(_0x6862('0x7'));var qs=require(_0x6862('0x8'));var logger=require('../../config/logger')(_0x6862('0x9'));var config=require(_0x6862('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6862('0xb')](config[_0x6862('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6862('0xd'))(new Redis(config[_0x6862('0xc')]));require('./chatWebsite.socket')[_0x6862('0xe')](socket);var jayson=require(_0x6862('0xf'));var client=jayson[_0x6862('0x10')][_0x6862('0x11')]({'port':0x232c});var client9002=jayson[_0x6862('0x10')][_0x6862('0x11')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x6862('0x10')][_0x6862('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x552332,_0x540510,_0x3ff5f8,_0x244a1a){return new BPromise(function(_0x3dd79a,_0x133957){var _0x346453=_0x244a1a||client;return _0x346453[_0x6862('0x12')](_0x552332,_0x3ff5f8)['then'](function(_0x33bc5){logger[_0x6862('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x540510,'request\x20sent');logger[_0x6862('0x14')](_0x6862('0x15'),_0x540510,'request\x20sent',JSON[_0x6862('0x16')](_0x33bc5));if(_0x33bc5[_0x6862('0x17')]){if(_0x33bc5[_0x6862('0x17')]['code']===0x1f4){logger[_0x6862('0x17')](_0x6862('0x18'),_0x540510,_0x33bc5['error'][_0x6862('0x19')]);return _0x133957(_0x33bc5[_0x6862('0x17')][_0x6862('0x19')]);}logger[_0x6862('0x17')](_0x6862('0x18'),_0x540510,_0x33bc5[_0x6862('0x17')]['message']);return _0x3dd79a(_0x33bc5[_0x6862('0x17')][_0x6862('0x19')]);}else{logger[_0x6862('0x13')](_0x6862('0x18'),_0x540510,'request\x20sent');_0x3dd79a(_0x33bc5[_0x6862('0x1a')][_0x6862('0x19')]);}})[_0x6862('0x1b')](function(_0x4a2d07){logger['error'](_0x6862('0x18'),_0x540510,_0x4a2d07);_0x133957(_0x4a2d07);});});}function respondWithStatusCode(_0x47d582,_0x45f684){_0x45f684=_0x45f684||0xcc;return function(_0x2dd417){if(_0x2dd417){return _0x47d582['sendStatus'](_0x45f684);}return _0x47d582[_0x6862('0x1c')](_0x45f684)[_0x6862('0x1d')]();};}function respondWithResult(_0x2d6602,_0xa3b0e){_0xa3b0e=_0xa3b0e||0xc8;return function(_0x18005f){if(_0x18005f){return _0x2d6602[_0x6862('0x1c')](_0xa3b0e)[_0x6862('0x1e')](_0x18005f);}};}function respondWithFilteredResult(_0x2e7741,_0xcb6b5d){return function(_0x5ecf0a){if(_0x5ecf0a){var _0x17ee25=typeof _0xcb6b5d[_0x6862('0x1f')]===_0x6862('0x20')&&typeof _0xcb6b5d['limit']===_0x6862('0x20');var _0x4981d5=_0x5ecf0a[_0x6862('0x21')];var _0x341275=_0x17ee25?0x0:_0xcb6b5d[_0x6862('0x1f')];var _0x418217=_0x17ee25?_0x5ecf0a[_0x6862('0x21')]:_0xcb6b5d['offset']+_0xcb6b5d[_0x6862('0x22')];var _0x3f7805;if(_0x418217>=_0x4981d5){_0x418217=_0x4981d5;_0x3f7805=0xc8;}else{_0x3f7805=0xce;}_0x2e7741[_0x6862('0x1c')](_0x3f7805);return _0x2e7741['set'](_0x6862('0x23'),_0x341275+'-'+_0x418217+'/'+_0x4981d5)[_0x6862('0x1e')](_0x5ecf0a);}return null;};}function saveUpdates(_0x3bf113){return function(_0x4eebf3){if(_0x4eebf3){return _0x4eebf3['update'](_0x3bf113)[_0x6862('0x24')](function(_0x4cc5a3){return _0x4cc5a3;});}return null;};}function removeEntity(_0xf2bab){return function(_0x59cb12){if(_0x59cb12){return _0x59cb12[_0x6862('0x25')]()[_0x6862('0x24')](function(){var _0x1cbf9=_0x59cb12[_0x6862('0x26')]({'plain':!![]});var _0x211387=_0x6862('0x27');return db['UserProfileResource'][_0x6862('0x25')]({'where':{'type':_0x211387,'resourceId':_0x1cbf9['id']}})[_0x6862('0x24')](function(){return _0x59cb12;});})[_0x6862('0x24')](function(){_0xf2bab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32e069){return function(_0x522517){if(!_0x522517){_0x32e069[_0x6862('0x28')](0x194);}return _0x522517;};}function handleError(_0x20fc1a,_0x1f5d0c){_0x1f5d0c=_0x1f5d0c||0x1f4;return function(_0x35d6ce){logger['error'](_0x35d6ce[_0x6862('0x29')]);if(_0x35d6ce['name']){delete _0x35d6ce['name'];}_0x20fc1a[_0x6862('0x1c')](_0x1f5d0c)[_0x6862('0x2a')](_0x35d6ce);};}exports['index']=function(_0x3b2abd,_0x46e3dc){var _0x194925={'include':[{'model':db[_0x6862('0x2b')],'as':_0x6862('0x2c')}]},_0x28bacc={},_0x36d603={'count':0x0,'rows':[]};var _0x1fd3df=_['map'](db[_0x6862('0x2d')][_0x6862('0x2e')],function(_0x5cfdb2){return{'name':_0x5cfdb2[_0x6862('0x2f')],'type':_0x5cfdb2[_0x6862('0x30')][_0x6862('0x31')]};});_0x28bacc[_0x6862('0x32')]=_[_0x6862('0x33')](_0x1fd3df,_0x6862('0x34'));_0x28bacc[_0x6862('0x35')]=_['keys'](_0x3b2abd[_0x6862('0x35')]);_0x28bacc['filters']=_[_0x6862('0x36')](_0x28bacc['model'],_0x28bacc['query']);_0x194925[_0x6862('0x37')]=_['intersection'](_0x28bacc[_0x6862('0x32')],qs[_0x6862('0x38')](_0x3b2abd[_0x6862('0x35')][_0x6862('0x38')]));_0x194925['attributes']=_0x194925['attributes'][_0x6862('0x39')]?_0x194925[_0x6862('0x37')]:_0x28bacc[_0x6862('0x32')];if(!_0x3b2abd['query']['hasOwnProperty'](_0x6862('0x3a'))){_0x194925[_0x6862('0x22')]=qs[_0x6862('0x22')](_0x3b2abd[_0x6862('0x35')][_0x6862('0x22')]);_0x194925[_0x6862('0x1f')]=qs[_0x6862('0x1f')](_0x3b2abd[_0x6862('0x35')][_0x6862('0x1f')]);}_0x194925[_0x6862('0x3b')]=qs['sort'](_0x3b2abd[_0x6862('0x35')]['sort']);_0x194925['where']=qs[_0x6862('0x3c')](_[_0x6862('0x3d')](_0x3b2abd[_0x6862('0x35')],_0x28bacc['filters']),_0x1fd3df);if(_0x3b2abd['query'][_0x6862('0x3e')]){_0x194925[_0x6862('0x3f')]=_[_0x6862('0x40')](_0x194925[_0x6862('0x3f')],{'$or':_[_0x6862('0x33')](_0x1fd3df,function(_0x51c12f){if(_0x51c12f['type']!==_0x6862('0x41')){var _0x5d89d6={};_0x5d89d6[_0x51c12f[_0x6862('0x34')]]={'$like':'%'+_0x3b2abd[_0x6862('0x35')][_0x6862('0x3e')]+'%'};return _0x5d89d6;}})});}_0x194925=_[_0x6862('0x40')]({},_0x194925,_0x3b2abd[_0x6862('0x42')]);var _0x11961f={'where':_0x194925[_0x6862('0x3f')]};return db[_0x6862('0x2d')]['count'](_0x11961f)[_0x6862('0x24')](function(_0x40f853){_0x36d603[_0x6862('0x21')]=_0x40f853;if(_0x3b2abd['query'][_0x6862('0x43')]){_0x194925[_0x6862('0x44')]=[{'all':!![]}];}return db[_0x6862('0x2d')]['findAll'](_0x194925);})[_0x6862('0x24')](function(_0x1c7573){_0x36d603[_0x6862('0x45')]=_0x1c7573;return _0x36d603;})[_0x6862('0x24')](respondWithFilteredResult(_0x46e3dc,_0x194925))[_0x6862('0x1b')](handleError(_0x46e3dc,null));};exports[_0x6862('0x46')]=function(_0x3cffb5,_0x436721){var _0x15f32d={'raw':![],'where':{'id':_0x3cffb5['params']['id']},'include':[{'model':db[_0x6862('0x2b')],'as':'mandatoryDispositionPause'}]},_0x2c3b37={};_0x2c3b37[_0x6862('0x32')]=_['keys'](db['ChatWebsite'][_0x6862('0x2e')]);_0x2c3b37[_0x6862('0x35')]=_[_0x6862('0x47')](_0x3cffb5[_0x6862('0x35')]);_0x2c3b37[_0x6862('0x3c')]=_[_0x6862('0x36')](_0x2c3b37[_0x6862('0x32')],_0x2c3b37[_0x6862('0x35')]);_0x15f32d[_0x6862('0x37')]=_[_0x6862('0x36')](_0x2c3b37[_0x6862('0x32')],qs['fields'](_0x3cffb5['query'][_0x6862('0x38')]));_0x15f32d[_0x6862('0x37')]=_0x15f32d[_0x6862('0x37')][_0x6862('0x39')]?_0x15f32d['attributes']:_0x2c3b37[_0x6862('0x32')];if(_0x3cffb5['query'][_0x6862('0x43')]){_0x15f32d[_0x6862('0x44')]=[{'all':!![]}];}_0x15f32d=_['merge']({},_0x15f32d,_0x3cffb5[_0x6862('0x42')]);return db[_0x6862('0x2d')][_0x6862('0x48')](_0x15f32d)[_0x6862('0x24')](handleEntityNotFound(_0x436721,null))[_0x6862('0x24')](respondWithResult(_0x436721,null))[_0x6862('0x1b')](handleError(_0x436721,null));};exports[_0x6862('0x49')]=function(_0x1ac107,_0x931a56){return db[_0x6862('0x2d')][_0x6862('0x49')](_0x1ac107[_0x6862('0x4a')],{})['then'](function(_0x43bc02){var _0x58ad57=_0x1ac107[_0x6862('0x4b')]['get']({'plain':!![]});if(!_0x58ad57)throw new Error(_0x6862('0x4c'));if(_0x58ad57[_0x6862('0x4d')]==='user'){var _0x846590=_0x43bc02[_0x6862('0x26')]({'plain':!![]});var _0x381869=_0x6862('0x27');return db[_0x6862('0x4e')][_0x6862('0x48')]({'where':{'name':_0x381869,'userProfileId':_0x58ad57[_0x6862('0x4f')]},'raw':!![]})['then'](function(_0x73355e){if(_0x73355e&&_0x73355e[_0x6862('0x50')]===0x0){return db[_0x6862('0x51')]['create']({'name':_0x846590[_0x6862('0x34')],'resourceId':_0x846590['id'],'type':_0x73355e['name'],'sectionId':_0x73355e['id']},{})[_0x6862('0x24')](function(){return _0x43bc02;});}else{return _0x43bc02;}})[_0x6862('0x1b')](function(_0xd70dd4){logger[_0x6862('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd70dd4);throw _0xd70dd4;});}return _0x43bc02;})[_0x6862('0x24')](respondWithResult(_0x931a56,0xc9))[_0x6862('0x1b')](handleError(_0x931a56,null));};exports['update']=function(_0x1a4511,_0x2d301e){if(_0x1a4511[_0x6862('0x4a')]['id']){delete _0x1a4511[_0x6862('0x4a')]['id'];}return db['ChatWebsite'][_0x6862('0x48')]({'where':{'id':_0x1a4511[_0x6862('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0x6862('0x2c')}]})[_0x6862('0x24')](handleEntityNotFound(_0x2d301e,null))[_0x6862('0x24')](saveUpdates(_0x1a4511[_0x6862('0x4a')],null))['then'](respondWithResult(_0x2d301e,null))[_0x6862('0x1b')](handleError(_0x2d301e,null));};exports[_0x6862('0x25')]=function(_0x9d948,_0x23b66c){return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x9d948[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x23b66c,null))[_0x6862('0x24')](removeEntity(_0x23b66c,null))[_0x6862('0x1b')](handleError(_0x23b66c,null));};exports[_0x6862('0x53')]=function(_0x13c186,_0x22da2b){return db[_0x6862('0x2d')][_0x6862('0x53')]()[_0x6862('0x24')](respondWithResult(_0x22da2b,null))[_0x6862('0x1b')](handleError(_0x22da2b,null));};exports[_0x6862('0x54')]=function(_0x5001ee,_0x59acc5){if(_0x5001ee[_0x6862('0x4a')]['id']){delete _0x5001ee[_0x6862('0x4a')]['id'];}return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x5001ee['params']['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x59acc5,null))[_0x6862('0x24')](function(_0x722d69){if(_0x722d69){_0x5001ee[_0x6862('0x4a')]['ChatWebsiteId']=_0x722d69['id'];return db[_0x6862('0x55')][_0x6862('0x49')](_0x5001ee['body']);}})[_0x6862('0x24')](respondWithResult(_0x59acc5,null))[_0x6862('0x1b')](handleError(_0x59acc5,null));};exports[_0x6862('0x56')]=function(_0x2dd654,_0x3dd695){var _0x46e6e8={'raw':![],'where':{}};var _0x8aa3b0={};var _0x2a7781={'count':0x0,'rows':[]};return db[_0x6862('0x2d')]['findOne']({'where':{'id':_0x2dd654[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x3dd695,null))[_0x6862('0x24')](function(_0x3bbf40){if(_0x3bbf40){_0x8aa3b0[_0x6862('0x32')]=_[_0x6862('0x47')](db[_0x6862('0x55')][_0x6862('0x2e')]);_0x8aa3b0[_0x6862('0x35')]=_[_0x6862('0x47')](_0x2dd654[_0x6862('0x35')]);_0x8aa3b0['filters']=_[_0x6862('0x36')](_0x8aa3b0[_0x6862('0x32')],_0x8aa3b0[_0x6862('0x35')]);_0x46e6e8[_0x6862('0x37')]=_[_0x6862('0x36')](_0x8aa3b0[_0x6862('0x32')],qs[_0x6862('0x38')](_0x2dd654[_0x6862('0x35')][_0x6862('0x38')]));_0x46e6e8['attributes']=_0x46e6e8[_0x6862('0x37')][_0x6862('0x39')]?_0x46e6e8['attributes']:_0x8aa3b0[_0x6862('0x32')];if(!_0x2dd654[_0x6862('0x35')]['hasOwnProperty'](_0x6862('0x3a'))){_0x46e6e8['limit']=qs[_0x6862('0x22')](_0x2dd654['query'][_0x6862('0x22')]);_0x46e6e8[_0x6862('0x1f')]=qs[_0x6862('0x1f')](_0x2dd654[_0x6862('0x35')][_0x6862('0x1f')]);}_0x46e6e8[_0x6862('0x3b')]=qs['sort'](_0x2dd654[_0x6862('0x35')]['sort']);_0x46e6e8[_0x6862('0x3f')]=qs['filters'](_[_0x6862('0x3d')](_0x2dd654['query'],_0x8aa3b0['filters']));_0x46e6e8[_0x6862('0x3f')]['ChatWebsiteId']=_0x3bbf40['id'];if(_0x2dd654[_0x6862('0x35')][_0x6862('0x3e')]){_0x46e6e8[_0x6862('0x3f')]=_[_0x6862('0x40')](_0x46e6e8[_0x6862('0x3f')],{'$or':_[_0x6862('0x33')](_0x46e6e8[_0x6862('0x37')],function(_0x3fa810){var _0x1852c9={};_0x1852c9[_0x3fa810]={'$like':'%'+_0x2dd654['query'][_0x6862('0x3e')]+'%'};return _0x1852c9;})});}_0x46e6e8=_[_0x6862('0x40')]({},_0x46e6e8,_0x2dd654['options']);return db[_0x6862('0x55')][_0x6862('0x21')]({'where':_0x46e6e8[_0x6862('0x3f')]})['then'](function(_0x3f8c1b){_0x2a7781[_0x6862('0x21')]=_0x3f8c1b;if(_0x2dd654['query'][_0x6862('0x43')]){_0x46e6e8[_0x6862('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x6862('0x57')](_0x46e6e8);})[_0x6862('0x24')](function(_0x48d099){_0x2a7781[_0x6862('0x45')]=_0x48d099;return _0x2a7781;});}})['then'](respondWithFilteredResult(_0x3dd695,_0x46e6e8))[_0x6862('0x1b')](handleError(_0x3dd695,null));};exports[_0x6862('0x58')]=function(_0x2355a9,_0x22502a){return db['ChatWebsite'][_0x6862('0x48')]({'where':{'id':_0x2355a9[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x22502a,null))[_0x6862('0x24')](function(_0x3f05c1){if(_0x3f05c1){return _0x3f05c1[_0x6862('0x58')](_0x2355a9[_0x6862('0x35')]['ids']);}})[_0x6862('0x24')](respondWithStatusCode(_0x22502a,null))[_0x6862('0x1b')](handleError(_0x22502a,null));};exports[_0x6862('0x59')]=function(_0x4639ee,_0x5e4d15){if(_0x4639ee[_0x6862('0x4a')]['id']){delete _0x4639ee['body']['id'];}return db[_0x6862('0x2d')]['find']({'where':{'id':_0x4639ee[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x5e4d15,null))[_0x6862('0x24')](function(_0x30961e){if(_0x30961e){_0x4639ee['body'][_0x6862('0x5a')]=_0x30961e['id'];return db['CannedAnswer'][_0x6862('0x49')](_0x4639ee['body']);}})[_0x6862('0x24')](respondWithResult(_0x5e4d15,null))[_0x6862('0x1b')](handleError(_0x5e4d15,null));};exports['getAnswers']=function(_0x3db504,_0x436cf1){var _0x31c401={'raw':![],'where':{}};var _0x24844c={};var _0xfb168={'count':0x0,'rows':[]};return db[_0x6862('0x2d')][_0x6862('0x5b')]({'where':{'id':_0x3db504[_0x6862('0x52')]['id']}})['then'](handleEntityNotFound(_0x436cf1,null))[_0x6862('0x24')](function(_0x3adab6){if(_0x3adab6){_0x24844c[_0x6862('0x32')]=_[_0x6862('0x47')](db['CannedAnswer'][_0x6862('0x2e')]);_0x24844c[_0x6862('0x35')]=_[_0x6862('0x47')](_0x3db504[_0x6862('0x35')]);_0x24844c['filters']=_[_0x6862('0x36')](_0x24844c[_0x6862('0x32')],_0x24844c[_0x6862('0x35')]);_0x31c401[_0x6862('0x37')]=_[_0x6862('0x36')](_0x24844c['model'],qs['fields'](_0x3db504[_0x6862('0x35')]['fields']));_0x31c401[_0x6862('0x37')]=_0x31c401[_0x6862('0x37')][_0x6862('0x39')]?_0x31c401[_0x6862('0x37')]:_0x24844c['model'];if(!_0x3db504[_0x6862('0x35')][_0x6862('0x5c')](_0x6862('0x3a'))){_0x31c401[_0x6862('0x22')]=qs[_0x6862('0x22')](_0x3db504[_0x6862('0x35')][_0x6862('0x22')]);_0x31c401[_0x6862('0x1f')]=qs[_0x6862('0x1f')](_0x3db504[_0x6862('0x35')][_0x6862('0x1f')]);}_0x31c401[_0x6862('0x3b')]=qs[_0x6862('0x5d')](_0x3db504['query'][_0x6862('0x5d')]);_0x31c401[_0x6862('0x3f')]=qs[_0x6862('0x3c')](_[_0x6862('0x3d')](_0x3db504[_0x6862('0x35')],_0x24844c[_0x6862('0x3c')]));_0x31c401[_0x6862('0x3f')][_0x6862('0x5a')]=_0x3adab6['id'];if(_0x3db504['query']['filter']){_0x31c401[_0x6862('0x3f')]=_[_0x6862('0x40')](_0x31c401['where'],{'$or':_[_0x6862('0x33')](_0x31c401['attributes'],function(_0x107776){var _0x515af9={};_0x515af9[_0x107776]={'$like':'%'+_0x3db504[_0x6862('0x35')][_0x6862('0x3e')]+'%'};return _0x515af9;})});}_0x31c401=_[_0x6862('0x40')]({},_0x31c401,_0x3db504['options']);return db[_0x6862('0x5e')][_0x6862('0x21')]({'where':_0x31c401[_0x6862('0x3f')]})[_0x6862('0x24')](function(_0x4d846f){_0xfb168[_0x6862('0x21')]=_0x4d846f;if(_0x3db504[_0x6862('0x35')][_0x6862('0x43')]){_0x31c401[_0x6862('0x44')]=[{'all':!![]}];}return db[_0x6862('0x5e')][_0x6862('0x57')](_0x31c401);})[_0x6862('0x24')](function(_0x488904){_0xfb168['rows']=_0x488904;return _0xfb168;});}})[_0x6862('0x24')](respondWithFilteredResult(_0x436cf1,_0x31c401))[_0x6862('0x1b')](handleError(_0x436cf1,null));};exports[_0x6862('0x5f')]=function(_0x48939d,_0x1b47ac){return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x48939d['params']['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x1b47ac,null))['then'](function(_0x332e14){if(_0x332e14){return _0x332e14[_0x6862('0x5f')](_0x48939d['query'][_0x6862('0x60')]);}})[_0x6862('0x24')](respondWithStatusCode(_0x1b47ac,null))[_0x6862('0x1b')](handleError(_0x1b47ac,null));};exports['addLogo']=function(_0x5b95e4,_0x538036){_0x5b95e4[_0x6862('0x4a')][_0x6862('0x61')]=_0x5b95e4[_0x6862('0x62')]['filename'];return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x5b95e4[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x538036,null))[_0x6862('0x24')](saveUpdates(_0x5b95e4['body'],null))['then'](respondWithResult(_0x538036,null))[_0x6862('0x1b')](handleError(_0x538036,null));};exports[_0x6862('0x63')]=function(_0x401bb2,_0x152542){_0x401bb2[_0x6862('0x4a')]['agentAvatar']=_0x401bb2[_0x6862('0x62')][_0x6862('0x64')];return db['ChatWebsite'][_0x6862('0x48')]({'where':{'id':_0x401bb2[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x152542,null))[_0x6862('0x24')](saveUpdates(_0x401bb2[_0x6862('0x4a')],null))[_0x6862('0x24')](respondWithResult(_0x152542,null))['catch'](handleError(_0x152542,null));};exports[_0x6862('0x65')]=function(_0xd82c98,_0x1b7038){_0xd82c98[_0x6862('0x4a')][_0x6862('0x66')]=_0xd82c98[_0x6862('0x62')][_0x6862('0x64')];return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0xd82c98[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x1b7038,null))[_0x6862('0x24')](saveUpdates(_0xd82c98[_0x6862('0x4a')],null))[_0x6862('0x24')](respondWithResult(_0x1b7038,null))[_0x6862('0x1b')](handleError(_0x1b7038,null));};exports[_0x6862('0x67')]=function(_0x43d532,_0x3017ae){_0x43d532['body']['systemAvatar']=_0x43d532[_0x6862('0x62')][_0x6862('0x64')];return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x43d532[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x3017ae,null))[_0x6862('0x24')](saveUpdates(_0x43d532[_0x6862('0x4a')],null))['then'](respondWithResult(_0x3017ae,null))[_0x6862('0x1b')](handleError(_0x3017ae,null));};exports['getLogo']=function(_0x3c5402,_0x3e4826){var _0x41a64d=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x6a'));var _0x49487b={'where':{'id':_0x3c5402[_0x6862('0x52')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0xdaf8b1=![];return require(_0x6862('0x6b'))[_0x6862('0x6c')]()['then'](function(_0x59c3e7){if(_0x59c3e7){_0xdaf8b1=_0x59c3e7[_0x6862('0x6d')];}})[_0x6862('0x24')](function(){return db['ChatWebsite'][_0x6862('0x48')](_0x49487b);})[_0x6862('0x24')](handleEntityNotFound(_0x3e4826,null))[_0x6862('0x24')](function(_0x2308e6){if(_0x2308e6){if(!_[_0x6862('0x6e')](_0x2308e6[_0x6862('0x61')])){if(fs[_0x6862('0x6f')](path['join'](config['root'],_0x6862('0x70'),_0x2308e6[_0x6862('0x61')]))&&_0xdaf8b1){_0x41a64d=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x70'),_0x2308e6[_0x6862('0x61')]);}}return _0x3e4826[_0x6862('0x71')](_0x41a64d);}})[_0x6862('0x1b')](handleError(_0x3e4826,null));};exports[_0x6862('0x72')]=function(_0x4da18f,_0x365a5c){var _0x5d6af2=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x73'));var _0x5c26b8={'where':{'id':_0x4da18f['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x6862('0x2d')]['find'](_0x5c26b8)[_0x6862('0x24')](handleEntityNotFound(_0x365a5c,null))[_0x6862('0x24')](function(_0x4d7df7){if(_0x4d7df7){if(!_[_0x6862('0x6e')](_0x4d7df7[_0x6862('0x74')])){if(fs['existsSync'](path['join'](config[_0x6862('0x69')],_0x6862('0x75'),_0x4d7df7[_0x6862('0x74')]))){_0x5d6af2=path[_0x6862('0x68')](config['root'],'server/files/images/avatars/',_0x4d7df7['agentAvatar']);}}return _0x365a5c['download'](_0x5d6af2);}})[_0x6862('0x1b')](handleError(_0x365a5c,null));};exports[_0x6862('0x76')]=function(_0x37647b,_0x591454){var _0x41a5b3=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x77'));var _0x388a76={'where':{'id':_0x37647b[_0x6862('0x52')]['id']},'attributes':['id','customerAvatar',_0x6862('0x78')],'raw':!![]};return db[_0x6862('0x2d')]['find'](_0x388a76)['then'](handleEntityNotFound(_0x591454,null))['then'](function(_0x345553){if(_0x345553){if(!_[_0x6862('0x6e')](_0x345553[_0x6862('0x66')])){if(fs[_0x6862('0x6f')](path['join'](config[_0x6862('0x69')],'server/files/images/avatars/',_0x345553[_0x6862('0x66')]))&&_0x345553['showCustomerAvatar']){_0x41a5b3=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x75'),_0x345553[_0x6862('0x66')]);}}return _0x591454[_0x6862('0x71')](_0x41a5b3);}})[_0x6862('0x1b')](handleError(_0x591454,null));};exports[_0x6862('0x79')]=function(_0x55fe84,_0x1b85ea){var _0x3d61f0=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x7a'));var _0x1a1d45={'where':{'id':_0x55fe84[_0x6862('0x52')]['id']},'attributes':['id',_0x6862('0x7b')],'raw':!![]};return db[_0x6862('0x2d')]['find'](_0x1a1d45)[_0x6862('0x24')](handleEntityNotFound(_0x1b85ea,null))[_0x6862('0x24')](function(_0x4ae753){if(_0x4ae753){if(!_[_0x6862('0x6e')](_0x4ae753['systemAvatar'])){if(fs[_0x6862('0x6f')](path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x75'),_0x4ae753[_0x6862('0x7b')]))){_0x3d61f0=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x75'),_0x4ae753['systemAvatar']);}}return _0x1b85ea[_0x6862('0x71')](_0x3d61f0);}})[_0x6862('0x1b')](handleError(_0x1b85ea,null));};exports['notify']=function(_0x4eafe5,_0x2bbfda){var _0xaa350e=require('user-agent-parser');var _0x569075=new _0xaa350e();var _0x3c8d6b=_0x569075[_0x6862('0x7c')](_0x4eafe5[_0x6862('0x7d')][_0x6862('0x7e')])[_0x6862('0x7f')]();var _0x320a74={'body':_0x4eafe5['body'],'channel':'chat'};var _0x51886c=[];var _0x34541a=[];var _0x49dd59={};var _0x2b27e7=![];return db[_0x6862('0x80')][_0x6862('0x53')]()[_0x6862('0x24')](function(_0x5e697d){if(!_0x5e697d){throw new db['Sequelize'][(_0x6862('0x81'))]('no\x20available\x20attributes');}_0x51886c=_[_0x6862('0x82')](_[_0x6862('0x47')](_0x5e697d),['createdAt',_0x6862('0x83')]);_0x34541a=_[_0x6862('0x82')](_[_0x6862('0x47')](_0x5e697d),[_0x6862('0x84'),_0x6862('0x83'),_0x6862('0x85'),_0x6862('0x86')]);if(_0x4eafe5[_0x6862('0x4a')]['id']){delete _0x4eafe5[_0x6862('0x4a')]['id'];}if(_[_0x6862('0x6e')](_0x4eafe5[_0x6862('0x4a')][_0x6862('0x87')])){throw new db[(_0x6862('0x88'))][(_0x6862('0x81'))]('from\x20is\x20mandatory');}if(_[_0x6862('0x6e')](_0x4eafe5[_0x6862('0x4a')]['body'])||_0x4eafe5['body']['body']===''){throw new db[(_0x6862('0x88'))][(_0x6862('0x81'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6862('0x6e')](_0x4eafe5[_0x6862('0x4a')]['mapKey'])){throw new db['Sequelize'][(_0x6862('0x81'))](_0x6862('0x89')+_0x34541a);}if(!_[_0x6862('0x8a')](_0x34541a,_0x4eafe5[_0x6862('0x4a')][_0x6862('0x8b')])){throw new db[(_0x6862('0x88'))][(_0x6862('0x81'))](_0x6862('0x8c')+_0x34541a);}_0x49dd59[_0x4eafe5['body'][_0x6862('0x8b')]]=_0x4eafe5[_0x6862('0x4a')][_0x6862('0x87')];})[_0x6862('0x24')](function(){return db[_0x6862('0x2d')]['find']({'where':{'id':_0x4eafe5[_0x6862('0x52')]['id']},'include':[{'model':db[_0x6862('0x8d')],'as':_0x6862('0x8e'),'include':[{'model':db[_0x6862('0x80')],'as':_0x6862('0x8f'),'where':_0x49dd59,'limit':0x1,'order':[[_0x6862('0x83'),_0x6862('0x90')]]}]},{'model':db[_0x6862('0x91')],'as':_0x6862('0x92')}]});})[_0x6862('0x24')](handleEntityNotFound(_0x2bbfda,null))[_0x6862('0x24')](function(_0xc1d1ac){if(_0xc1d1ac&&_0xc1d1ac[_0x6862('0x8e')]){_0x320a74[_0x6862('0x93')]=_0xc1d1ac;_0x320a74[_0x6862('0x94')]=_0xc1d1ac[_0x6862('0x92')];_0x320a74['list']=_0xc1d1ac[_0x6862('0x8e')];_0x320a74[_0x6862('0x94')]=_[_0x6862('0x95')](_0x320a74[_0x6862('0x94')],['priority'],[_0x6862('0x96')]);if(_0x320a74[_0x6862('0x93')]['Applications']){delete _0x320a74['account']['Applications'];}if(_0x320a74[_0x6862('0x93')]['List']&&_0x320a74[_0x6862('0x93')][_0x6862('0x8e')][_0x6862('0x8f')]['length']){return _0x320a74['account'][_0x6862('0x8e')][_0x6862('0x8f')][0x0];}var _0x25f4f=_[_0x6862('0xb')](_0x4eafe5[_0x6862('0x4a')],{'firstName':_0x4eafe5[_0x6862('0x4a')]['from'],'ListId':_0xc1d1ac[_0x6862('0x86')]});_0x25f4f[_0x4eafe5[_0x6862('0x4a')][_0x6862('0x8b')]]=_0x4eafe5['body']['from'];return db[_0x6862('0x80')]['create'](_0x25f4f,{'fields':_0x51886c,'raw':!![]});}})[_0x6862('0x24')](handleEntityNotFound(_0x2bbfda,null))[_0x6862('0x24')](function(_0x2ec914){_0x320a74[_0x6862('0x97')]=_0x2ec914;var _0x44ab10=_0x4eafe5[_0x6862('0x4a')][_0x6862('0x98')];if(_0x4eafe5[_0x6862('0x7d')][_0x6862('0x99')]){_0x44ab10=_0x4eafe5['headers'][_0x6862('0x99')];}else if(_0x4eafe5[_0x6862('0x7d')][_0x6862('0x9a')]){_0x44ab10=_['first'](_0x4eafe5['headers'][_0x6862('0x9a')][_0x6862('0x9b')](','));}if(_0x2ec914){var _0x245d4f={'ContactId':_0x2ec914['id'],'ChatWebsiteId':_0x4eafe5[_0x6862('0x52')]['id'],'from':(_0x2ec914[_0x6862('0x9c')]||'')+'\x20'+(_0x2ec914[_0x6862('0x9d')]||''),'customerIp':_0x44ab10,'customerPort':_0x4eafe5['headers'][_0x6862('0x9e')]?_0x4eafe5['headers'][_0x6862('0x9e')]:null,'referer':_0x4eafe5['body'][_0x6862('0x9f')],'browserName':_0x3c8d6b[_0x6862('0xa0')][_0x6862('0x34')]&&_0x3c8d6b[_0x6862('0xa0')][_0x6862('0xa1')]?util[_0x6862('0xa2')]('%s\x20%s',_0x3c8d6b[_0x6862('0xa0')][_0x6862('0x34')],_0x3c8d6b[_0x6862('0xa0')][_0x6862('0xa1')]):_0x6862('0xa3'),'browserVersion':_0x3c8d6b[_0x6862('0xa0')][_0x6862('0xa1')]||_0x6862('0xa3'),'osName':util[_0x6862('0xa2')](_0x6862('0xa4'),_0x3c8d6b['os'][_0x6862('0x34')],_0x3c8d6b['os'][_0x6862('0xa1')]),'osVersion':_0x3c8d6b['os'][_0x6862('0xa1')],'deviceModel':_0x3c8d6b[_0x6862('0xa5')]['model']&&_0x3c8d6b[_0x6862('0xa5')][_0x6862('0xa6')]?util[_0x6862('0xa2')](_0x6862('0xa7'),_0x3c8d6b['device'][_0x6862('0x32')],_0x3c8d6b['device'][_0x6862('0xa6')],_0x3c8d6b['device'][_0x6862('0x30')]):null,'deviceVendor':_0x3c8d6b[_0x6862('0xa5')][_0x6862('0xa6')],'deviceType':_0x3c8d6b[_0x6862('0xa5')]['type'],'formData':JSON[_0x6862('0x16')](_0x4eafe5[_0x6862('0x4a')])};var _0x561f9c={'ChatWebsiteId':_0x4eafe5['params']['id'],'closed':![]};if(_0x4eafe5[_0x6862('0x4a')][_0x6862('0xa8')]){_0x561f9c[_0x6862('0xa8')]=_0x4eafe5['body']['threadId'];return db[_0x6862('0xa9')][_0x6862('0x48')]({'where':_0x561f9c})[_0x6862('0x24')](function(_0x4dcf6e){if(_0x4dcf6e){return[_0x4dcf6e,![]];}_0x245d4f['threadId']=_0x4eafe5['body']['threadId'];_0x245d4f[_0x6862('0xaa')]=_0x4eafe5[_0x6862('0x4a')]['externalUrl'];return db['ChatInteraction']['create'](_0x245d4f)[_0x6862('0x24')](function(_0x3cc4d5){return[_0x3cc4d5,!![]];});});}_0x561f9c['ContactId']=_0x2ec914['id'];if(_0x4eafe5[_0x6862('0x4a')]['interaction']&&_0x4eafe5['body'][_0x6862('0xab')]['id']){_0x561f9c['id']=_0x4eafe5[_0x6862('0x4a')][_0x6862('0xab')]['id'];return db[_0x6862('0xa9')][_0x6862('0x48')]({'where':_0x561f9c})[_0x6862('0x24')](function(_0x414bc2){if(_0x414bc2){return[_0x414bc2,![]];}return db[_0x6862('0xa9')][_0x6862('0x49')](_0x245d4f)[_0x6862('0x24')](function(_0x354671){return[_0x354671,!![]];});});}return db['ChatInteraction'][_0x6862('0x49')](_0x245d4f)[_0x6862('0x24')](function(_0x5f1a93){return[_0x5f1a93,!![]];});}})[_0x6862('0xac')](function(_0x2b9d44,_0x499f95){if(_0x2b9d44){_0x2b27e7=_0x499f95;if(!_0x499f95){var _0x406bfe={'from':(_0x320a74[_0x6862('0x97')]['firstName']||'')+'\x20'+(_0x320a74['contact'][_0x6862('0x9d')]||'')};if(_0x4eafe5[_0x6862('0x4a')][_0x6862('0xa8')]&&_0x4eafe5['body'][_0x6862('0xad')]&&_0x4eafe5[_0x6862('0x4a')][_0x6862('0xa8')]!=_0x4eafe5['body'][_0x6862('0xad')]){_0x406bfe['threadId']=_0x4eafe5[_0x6862('0x4a')][_0x6862('0xad')];}return _0x2b9d44['update'](_0x406bfe);}else{return _0x2b9d44;}}})[_0x6862('0x24')](function(_0x4af3cb){_0x320a74[_0x6862('0xab')]=_0x4af3cb[_0x6862('0x26')]({'plain':!![]});_0x320a74[_0x6862('0xab')]['created']=_0x2b27e7;if(_0x320a74[_0x6862('0xab')][_0x6862('0xae')]){if(_0x320a74['account'][_0x6862('0xaf')]){_0x320a74['applications'][_0x6862('0xb0')]({'id':0x0,'priority':_0x320a74[_0x6862('0x94')][_0x6862('0x39')]+0x1,'app':_0x6862('0xb1'),'appdata':_0x6862('0xb2'),'interval':_0x6862('0xb3')});}}return db[_0x6862('0xb4')][_0x6862('0x49')]({'body':_0x4eafe5['body'][_0x6862('0x4a')],'ChatWebsiteId':_0x4eafe5[_0x6862('0x52')]['id'],'ChatInteractionId':_0x4af3cb['id'],'direction':'in','ContactId':_0x320a74[_0x6862('0x97')]['id'],'AttachmentId':_0x4eafe5[_0x6862('0x4a')][_0x6862('0xb5')]});})[_0x6862('0x24')](function(_0xf2bc45){_0x320a74[_0x6862('0x19')]=_0xf2bc45;if(_0x320a74[_0x6862('0xab')][_0x6862('0xb6')]){return db[_0x6862('0xb7')][_0x6862('0x48')]({'attributes':['id',_0x6862('0x34')],'where':{'id':_0x320a74['interaction']['UserId']}})[_0x6862('0x24')](function(_0x1521f7){if(_0x1521f7){_0x320a74['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x6862('0xb8'),'appdata':_0x1521f7[_0x6862('0x34')]+','+(_0x320a74[_0x6862('0x93')][_0x6862('0xb9')]||0xa),'interval':'*,*,*,*'});_0x320a74['forcedOwnership']=!![];}return respondWithRpcPromise(_0x6862('0xba'),_0x6862('0xbb'),_0x320a74);});}return respondWithRpcPromise(_0x6862('0xba'),_0x6862('0xbb'),_0x320a74);})[_0x6862('0x24')](function(_0x3dd868){respondWithRpcPromise(_0x6862('0xbc'),_0x6862('0xbc'),{'event':_0x6862('0xbd'),'message':_0x3dd868},client9002);return _0x3dd868;})[_0x6862('0x24')](respondWithResult(_0x2bbfda,null))[_0x6862('0x1b')](handleError(_0x2bbfda,null));};exports[_0x6862('0xbe')]=function(_0xa0a51a,_0x2e82fb){var _0x19b0d9,_0x1f6ff5,_0x584640;var _0x270e7c=[];var _0x4006c0={};var _0x3b2c36=_0xa0a51a[_0x6862('0xbf')]||[];var _0x87c3df=[];var _0x69b941;return db[_0x6862('0x80')][_0x6862('0x53')]()['then'](function(_0x3c34cc){if(!_0x3c34cc){throw new db[(_0x6862('0x88'))][(_0x6862('0x81'))](_0x6862('0xc0'));}_0x270e7c=_[_0x6862('0x82')](_[_0x6862('0x47')](_0x3c34cc),[_0x6862('0x84'),_0x6862('0x83'),_0x6862('0x85'),'ListId']);if(_0xa0a51a[_0x6862('0x4a')]['id']){delete _0xa0a51a[_0x6862('0x4a')]['id'];}if(_[_0x6862('0x6e')](_0xa0a51a['body']['from'])){throw _0x2e82fb[_0x6862('0x1c')](0x1f4)[_0x6862('0x2a')](new db[(_0x6862('0x88'))][(_0x6862('0x81'))](_0x6862('0xc1')));}if(_[_0x6862('0x6e')](_0xa0a51a['body'][_0x6862('0x4a')])||_0xa0a51a[_0x6862('0x4a')]['body']===''){throw _0x2e82fb[_0x6862('0x1c')](0x1f4)[_0x6862('0x2a')](new db[(_0x6862('0x88'))][(_0x6862('0x81'))](_0x6862('0xc2')));}if(_['isNil'](_0xa0a51a['body'][_0x6862('0xc3')])){throw _0x2e82fb[_0x6862('0x1c')](0x1f4)[_0x6862('0x2a')](new db[(_0x6862('0x88'))][(_0x6862('0x81'))](_0x6862('0xc4')+_0x270e7c));}if(!_['includes'](_0x270e7c,_0xa0a51a[_0x6862('0x4a')][_0x6862('0xc3')])){throw _0x2e82fb[_0x6862('0x1c')](0x1f4)[_0x6862('0x2a')](new db['Sequelize'][(_0x6862('0x81'))](_0x6862('0xc5')+_0x270e7c));}_0x4006c0[_0xa0a51a['body'][_0x6862('0xc3')]]=_0xa0a51a[_0x6862('0x4a')][_0x6862('0x87')];})[_0x6862('0x24')](function(){return db['ChatWebsite'][_0x6862('0x48')]({'where':{'id':_0xa0a51a[_0x6862('0x52')]['id']},'include':[{'model':db[_0x6862('0x8d')],'as':'List'},{'model':db[_0x6862('0xc6')],'as':_0x6862('0xc6')}]});})[_0x6862('0x24')](handleEntityNotFound(_0x2e82fb,null))[_0x6862('0x24')](function(_0x36633d){if(_0x36633d&&_0x36633d['List']){_0x1f6ff5=_0x36633d;var _0x105b93=_[_0x6862('0xb')](_0xa0a51a[_0x6862('0x4a')],{'firstName':_0xa0a51a[_0x6862('0x4a')][_0x6862('0x87')],'phone':_0xa0a51a[_0x6862('0x4a')][_0x6862('0x87')],'ListId':_0x36633d[_0x6862('0x86')]});_0x105b93[_0xa0a51a[_0x6862('0x4a')][_0x6862('0xc3')]]=_0xa0a51a['body']['from'];return db['CmContact'][_0x6862('0xc7')]({'where':_0x4006c0,'defaults':_0x105b93});}})[_0x6862('0xac')](function(_0x168dd1){if(_0x168dd1){_0x584640=_0x168dd1;var _0x24c10a=fs[_0x6862('0xc8')](path[_0x6862('0x68')](config['root'],_0x6862('0xc9')),'utf8');var _0x101ded=ejs['render'](_0x24c10a,{'body':_[_0x6862('0xca')](_0xa0a51a[_0x6862('0x4a')]['body']),'bodyTitle':_0x1f6ff5[_0x6862('0xcb')]});return db['ChatOfflineMessage']['create']({'body':_0x101ded,'ContactId':_0x168dd1['id'],'ChatWebsiteId':_0x1f6ff5['id']});}})['then'](function(_0x546ed4){_0x69b941=_0x546ed4;if(_0x3b2c36[_0x6862('0x39')]){var _0x453b6d=_0x3b2c36[_0x6862('0x33')](function(_0x5b6431){return{'name':_0x5b6431[_0x6862('0xcc')],'basename':_0x5b6431[_0x6862('0x64')],'type':_0x5b6431['mimetype'],'ChatOfflineMessageId':_0x546ed4['id']};});_0x87c3df=_0x453b6d['map'](_0x91e8ee=>{var _0x439044={'filename':_0x91e8ee[_0x6862('0x34')],'path':path[_0x6862('0x68')](config['root'],_0x6862('0xcd'),_0x6862('0xbf'),_0x6862('0xce'),_0x6862('0xcf'),_0x91e8ee['basename'])};return _0x439044;});if(!_0x1f6ff5[_0x6862('0xd0')]){return db['sequelize'][_0x6862('0xd1')](function(_0x7b2c19){return db[_0x6862('0xd2')][_0x6862('0xd3')](_0x453b6d,{'transaction':_0x7b2c19});});}}})[_0x6862('0x24')](function(){if(_0x69b941){_0x19b0d9=_0x69b941;return db[_0x6862('0xc6')][_0x6862('0x5b')]({'where':{'active':!![]},'include':[{'model':db[_0x6862('0xd4')],'as':_0x6862('0xd5'),'raw':!![]}]});}})[_0x6862('0x24')](function(_0x5a224b){if(_0x5a224b&&_0x5a224b[_0x6862('0xd5')]&&_0x1f6ff5['forwardOffline']&&_0x1f6ff5[_0x6862('0xd6')]){var _0x3234ab={'tls':{'rejectUnauthorized':![]}};if(_0x5a224b['Smtp'][_0x6862('0xd7')]){_0x3234ab['service']=_0x5a224b[_0x6862('0xd5')][_0x6862('0xd7')];}else{_0x3234ab['host']=_0x5a224b[_0x6862('0xd5')][_0x6862('0xd8')];_0x3234ab['port']=_0x5a224b['Smtp'][_0x6862('0xd9')];_0x3234ab[_0x6862('0xda')]=_0x5a224b[_0x6862('0xd5')][_0x6862('0xda')];}if(_0x5a224b[_0x6862('0xd5')][_0x6862('0xdb')]){_0x3234ab[_0x6862('0xdc')]={'user':_0x5a224b[_0x6862('0xd5')][_0x6862('0x4b')],'pass':_0x5a224b['Smtp'][_0x6862('0xdd')]};}return respondWithRpcPromise(_0x6862('0xde'),_0x6862('0xdf'),{'account':_0x3234ab,'message':{'from':util[_0x6862('0xa2')](_0x6862('0xe0'),_0x5a224b['name'],_0x5a224b[_0x6862('0xe1')]||_0x5a224b[_0x6862('0xd5')]['user']),'to':_0x1f6ff5[_0x6862('0xd6')],'subject':_0x1f6ff5[_0x6862('0xe2')],'html':_0x19b0d9[_0x6862('0x4a')],'attachments':_0x87c3df}},client9003)[_0x6862('0x24')](function(){return _0x19b0d9;})[_0x6862('0x1b')](function(_0x1be051){console[_0x6862('0x17')](_0x1be051);});}})[_0x6862('0x24')](function(){if(_0x1f6ff5&&_0x1f6ff5['openNewInteraction']&&_0x1f6ff5[_0x6862('0xe3')]){var _0x5d5690=[];if(_0x3b2c36[_0x6862('0x39')]){_0x5d5690=_0x3b2c36[_0x6862('0x33')](function(_0x3eb71c){return{'name':_0x3eb71c['originalname'],'basename':_0x3eb71c[_0x6862('0x64')],'type':_0x3eb71c['mimetype'],'ChatOfflineMessageId':_0x69b941['id']};});}var _0x42d5d4;if(!_['isNil'](_0x1f6ff5['subjectOffline'])){var _0x43d72e=_['map'](_0xa0a51a[_0x6862('0x4a')],function(_0x431f0b){return _0x431f0b;});var _0x808565=_[_0x6862('0xe4')](_0x43d72e)[0x0];var _0x1e6abb=_['mapValues'](_0x808565,function(_0x1845e8){return _0x1845e8;});_0x42d5d4=_0x1e6abb[0x1][_0x1f6ff5[_0x6862('0xe5')]];}var _0x4c91d4={'from':_0x584640[_0x6862('0xe1')],'firstName':_0x584640[_0x6862('0x9c')],'lastName':_0x584640[_0x6862('0x9d')],'mapKey':_0x6862('0xe1'),'message':{'from':_0x584640[_0x6862('0xe1')],'to':_0x1f6ff5[_0x6862('0xc6')][_0x6862('0xe1')],'cc':'','subject':_[_0x6862('0x6e')](_0x42d5d4)?_0x1f6ff5[_0x6862('0xe2')]:_0x42d5d4,'messageId':'','sentAt':new Date(),'attach':_0x5d5690[_0x6862('0x39')],'attachments':_0x5d5690,'originChannel':_0x6862('0xe6'),'ChatWebsiteId':_0x1f6ff5['id'],'ChatOfflineMessageId':_0x19b0d9['id'],'originTo':_0x1f6ff5[_0x6862('0xc6')][_0x6862('0xe1')]},'body':_0x19b0d9[_0x6862('0x4a')]};var _0x5ea2b9={'account':{'id':_0x1f6ff5['MailAccountId']},'body':_0x4c91d4,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x6862('0xe7'),_0x6862('0xe8'),_0x5ea2b9,client9001)[_0x6862('0x24')](function(){return _0x19b0d9;})['catch'](function(_0x4c307b){console[_0x6862('0x17')](_0x4c307b);});}return;})['then'](function(){if(_0x19b0d9){return _0x19b0d9;}})[_0x6862('0x24')](respondWithResult(_0x2e82fb,null))[_0x6862('0x1b')](function(_0x50c96a){console[_0x6862('0x17')]('catch',_0x50c96a);for(var _0x5c661a of _0x3b2c36){var _0x1ad3b1=path['join'](config[_0x6862('0x69')],_0x6862('0xcd'),_0x6862('0xbf'),_0x6862('0xce'),_0x6862('0xcf'),_0x5c661a[_0x6862('0x64')]);fs_extra[_0x6862('0xe9')](_0x1ad3b1)['catch'](function(_0x1d7da3){console[_0x6862('0x17')](_0x6862('0xea'),_0x1ad3b1,_0x1d7da3);});}});};exports[_0x6862('0xeb')]=function(_0x155c29,_0x202fec){return db[_0x6862('0xa9')][_0x6862('0x48')]({'where':{'id':_0x155c29[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x202fec,null))['then'](function(_0xcd98e7){if(_0xcd98e7){return _0xcd98e7['addInteraction'](_0x155c29['body'][_0x6862('0x60')],_['omit'](_0x155c29[_0x6862('0x4a')],[_0x6862('0x60'),'id'])||{});}})[_0x6862('0x24')](respondWithResult(_0x202fec,null))['catch'](handleError(_0x202fec,null));};exports[_0x6862('0xec')]=function(_0x548036,_0x2732ea){var _0x2a3d9e={'raw':![],'where':{}};var _0x593265={};var _0x555294={'count':0x0,'rows':[]};return db[_0x6862('0x2d')][_0x6862('0x5b')]({'where':{'id':_0x548036[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x2732ea,null))[_0x6862('0x24')](function(_0x46879f){if(_0x46879f){_0x593265[_0x6862('0x32')]=_[_0x6862('0x47')](db['ChatInteraction'][_0x6862('0x2e')]);_0x593265[_0x6862('0x35')]=_[_0x6862('0x47')](_0x548036[_0x6862('0x35')]);_0x593265[_0x6862('0x3c')]=_['intersection'](_0x593265[_0x6862('0x32')],_0x593265['query']);_0x2a3d9e[_0x6862('0x37')]=_['intersection'](_0x593265['model'],qs[_0x6862('0x38')](_0x548036[_0x6862('0x35')][_0x6862('0x38')]));_0x2a3d9e['attributes']=_0x2a3d9e['attributes'][_0x6862('0x39')]?_0x2a3d9e[_0x6862('0x37')]:_0x593265[_0x6862('0x32')];if(!_0x548036[_0x6862('0x35')][_0x6862('0x5c')](_0x6862('0x3a'))){_0x2a3d9e[_0x6862('0x22')]=qs[_0x6862('0x22')](_0x548036[_0x6862('0x35')][_0x6862('0x22')]);_0x2a3d9e[_0x6862('0x1f')]=qs[_0x6862('0x1f')](_0x548036[_0x6862('0x35')][_0x6862('0x1f')]);}_0x2a3d9e['order']=qs['sort'](_0x548036[_0x6862('0x35')][_0x6862('0x5d')]);_0x2a3d9e[_0x6862('0x3f')]=qs['filters'](_[_0x6862('0x3d')](_0x548036[_0x6862('0x35')],_0x593265[_0x6862('0x3c')]));_0x2a3d9e[_0x6862('0x3f')][_0x6862('0x5a')]=_0x46879f['id'];if(_0x548036[_0x6862('0x35')][_0x6862('0x3e')]){_0x2a3d9e[_0x6862('0x3f')]=_['merge'](_0x2a3d9e[_0x6862('0x3f')],{'$or':_[_0x6862('0x33')](_0x2a3d9e['attributes'],function(_0x4d0f8a){var _0x3682fd={};_0x3682fd[_0x4d0f8a]={'$like':'%'+_0x548036[_0x6862('0x35')][_0x6862('0x3e')]+'%'};return _0x3682fd;})});}_0x2a3d9e=_[_0x6862('0x40')]({},_0x2a3d9e,_0x548036['options']);return db[_0x6862('0xa9')][_0x6862('0x21')]({'where':_0x2a3d9e[_0x6862('0x3f')]})['then'](function(_0x3f1656){_0x555294['count']=_0x3f1656;if(_0x548036[_0x6862('0x35')][_0x6862('0x43')]){_0x2a3d9e['include']=[{'model':db[_0x6862('0x80')],'as':_0x6862('0xed'),'required':![]},{'model':db['User'],'as':_0x6862('0xee'),'attributes':[_0x6862('0x34'),_0x6862('0xef'),_0x6862('0xf0')],'required':![]},{'model':db['Tag'],'as':_0x6862('0xf1'),'attributes':['id',_0x6862('0x34'),_0x6862('0xf2')],'where':_0x548036[_0x6862('0x35')][_0x6862('0xf3')]?{'id':_0x548036[_0x6862('0x35')][_0x6862('0xf3')]}:undefined,'required':_0x548036[_0x6862('0x35')][_0x6862('0xf3')]?!![]:![]}];}return db[_0x6862('0xa9')]['findAll'](_0x2a3d9e);})[_0x6862('0x24')](function(_0x5bef90){_0x555294['rows']=_0x5bef90;return _0x555294;});}})['then'](respondWithFilteredResult(_0x2732ea,_0x2a3d9e))[_0x6862('0x1b')](handleError(_0x2732ea,null));};function iftimePromise(_0x3c2ea8,_0x35a440){return respondWithRpcPromise(_0x6862('0xf4'),'getSnippet',{'command':_0x35a440[_0x6862('0xf5')]?util[_0x6862('0xa2')](_0x6862('0xf6'),_0x3c2ea8['interval'],_0x35a440['timezone']):util[_0x6862('0xa2')](_0x6862('0xf7'),_0x3c2ea8[_0x6862('0xf8')])},client9002)[_0x6862('0x24')](function(_0x5641de){var _0x5393f2=_0x5641de&&_0x5641de['indexOf'](_0x6862('0xf9'))>=0x0?!![]:![];logger[_0x6862('0x13')](_0x6862('0xfa'),_0x35a440['id'],_0x3c2ea8['id'],_0x3c2ea8[_0x6862('0xf8')],_0x5393f2?'ONLINE':'OFFLINE',_0x35a440[_0x6862('0xf5')]?_0x35a440[_0x6862('0xf5')]:_0x6862('0xfb'));return _0x5393f2;})[_0x6862('0x1b')](function(_0x5a8b3a){logger[_0x6862('0x17')](_0x6862('0xfa'),_0x35a440['id'],_0x3c2ea8['id'],_0x3c2ea8[_0x6862('0xf8')],util['inspect'](_0x5a8b3a,{'showHidden':![],'depth':null}),_0x35a440[_0x6862('0xf5')]?_0x35a440[_0x6862('0xf5')]:_0x6862('0xfb'));return![];});}exports['getSnippet']=function(_0x1706a1,_0x175354){var _0x25aa2b=0x0;var _0x935373=0x0;var _0x3e3783=![];var _0xa6bb22;var _0x2155ea;return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x1706a1[_0x6862('0x52')]['id']},'include':[{'model':db[_0x6862('0xfc')],'as':'Interval','include':[{'model':db[_0x6862('0xfc')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x6862('0x24')](handleEntityNotFound(_0x175354,null))['then'](function(_0x268830){if(_0x268830){_0xa6bb22=_0x268830;return _0x268830[_0x6862('0xfd')]({'raw':!![]});}})[_0x6862('0x24')](function(_0x432955){if(_0xa6bb22){if(_0x432955){_0x2155ea=_0x432955;}}return require(_0x6862('0x6b'))[_0x6862('0x6c')]();})[_0x6862('0x24')](function(_0x4d222b){if(_0x4d222b){_0x935373=_0x4d222b[_0x6862('0xfe')];_0x3e3783=_0x4d222b[_0x6862('0x6d')];}})[_0x6862('0x24')](function(){return db['ChatInteraction'][_0x6862('0x21')]({'where':{'closed':![]}});})[_0x6862('0x24')](function(_0x424308){_0x25aa2b=_0x424308;if(_0x935373&&_0x424308>_0x935373){return db[_0x6862('0xff')][_0x6862('0x5b')]({'where':{'id':0x1}})[_0x6862('0x24')](function(_0x30d756){if(_0x30d756){_0x30d756[_0x6862('0x100')](_0x6862('0x101'));}});}})['then'](function(){if(_0xa6bb22[_0x6862('0xfc')]&&_0xa6bb22[_0x6862('0xfc')][_0x6862('0x102')]){var _0x478031=[];for(var _0x4c980a=0x0;_0x4c980a<_0xa6bb22[_0x6862('0xfc')]['Intervals'][_0x6862('0x39')];_0x4c980a++){var _0x37ca82=_0xa6bb22[_0x6862('0xfc')][_0x6862('0x102')][_0x4c980a][_0x6862('0x26')]({'plain':!![]});_0x478031[_0x6862('0xb0')](iftimePromise(_0x37ca82,_0xa6bb22));}return BPromise[_0x6862('0x103')](_0x478031)[_0x6862('0x24')](function(_0x588648){return _[_0x6862('0x104')](_0x588648);});}else{return!![];}})[_0x6862('0x24')](function(_0x2c76cf){var _0x2fbc42=fs[_0x6862('0xc8')](path['join'](config[_0x6862('0x69')],_0x6862('0x105')),_0x6862('0x106'));var _0x3c07de={'remote':_0xa6bb22['remote'],'query':querystring['stringify'](_[_0x6862('0x40')](_0xa6bb22[_0x6862('0x26')]({'plain':!![]}),{'customerIp':_0x1706a1[_0x6862('0x7d')]['x-forwarded-for']||_0x1706a1['headers'][_0x6862('0x107')]||_0x1706a1[_0x6862('0x108')]['remoteAddress']||_0x1706a1['ip'],'referer':_0x1706a1[_0x6862('0x7d')][_0x6862('0x9f')],'openedInteractions':_0x25aa2b,'maxInteractions':_0x935373,'virtual':_0x3e3783[_0x6862('0xfe')],'online':_0x2c76cf,'custom':_0x3e3783}))[_0x6862('0x109')](/'/g,'\x5c\x27')};_0x175354['send'](ejs[_0x6862('0x10a')](Mustache[_0x6862('0x10a')](_0x2fbc42,_0x3c07de),{'proactiveActions':_0x2155ea,'alignment':_0xa6bb22[_0x6862('0x10b')],'verticalAlignment':_0xa6bb22[_0x6862('0x10c')],'div_color':_0xa6bb22[_0x6862('0xf2')],'labelText':_0xa6bb22['labelText'],'text_color':_0xa6bb22[_0x6862('0x10d')],'button_color':_0xa6bb22[_0x6862('0x10e')],'background_color':_0xa6bb22[_0x6862('0x10f')]}));})['catch'](handleError(_0x175354,null));};exports[_0x6862('0x110')]=function(_0x4d01de,_0x34e72e){var _0x448fe0=_0x4d01de[_0x6862('0x52')]['id'];var _0x20c696=_0x4d01de[_0x6862('0x4a')];var _0x2cc5f4=0xc8;var _0x56ad86=null;return db[_0x6862('0x111')][_0x6862('0xd1')]({'isolationLevel':db[_0x6862('0x111')][_0x6862('0x112')][_0x6862('0x113')]['READ_COMMITTED']},function(_0x4a2b9e){return db[_0x6862('0x2d')][_0x6862('0x5b')]({'where':{'id':_0x448fe0},'transaction':_0x4a2b9e})[_0x6862('0x24')](function(_0x2500b2){if(_0x2500b2){return db[_0x6862('0x91')]['destroy']({'where':{'ChatWebsiteId':_0x448fe0},'transaction':_0x4a2b9e})['then'](function(){var _0x110892=_[_0x6862('0x33')](_0x20c696,function(_0x30cea9){_0x30cea9[_0x6862('0x5a')]=_0x448fe0;return _0x30cea9;});return db['ChatApplication'][_0x6862('0xd3')](_0x110892,{'transaction':_0x4a2b9e});});}else{_0x2cc5f4=0x194;_0x56ad86=[];}});})[_0x6862('0x24')](function(){if(_0x2cc5f4!==0x194){return db[_0x6862('0x91')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x448fe0},'order':_0x6862('0x114')})['then'](function(_0x4dc624){_0x56ad86=_0x4dc624;});}})[_0x6862('0x1b')](function(_0x3b261b){_0x2cc5f4=0x1f4;logger[_0x6862('0x17')](_0x3b261b[_0x6862('0x29')]);if(_0x3b261b[_0x6862('0x34')]){delete _0x3b261b[_0x6862('0x34')];}_0x56ad86=_0x3b261b;})[_0x6862('0x115')](function(){if(_0x56ad86===null){_0x34e72e[_0x6862('0x28')](_0x2cc5f4);}else{if(_0x2cc5f4===0x1f4){_0x34e72e['status'](_0x2cc5f4)['send'](_0x56ad86);}else{_0x34e72e['status'](_0x2cc5f4)['json'](_0x56ad86);}}});};exports[_0x6862('0x116')]=function(_0x313c15,_0x408442){var _0xffe37f={};var _0x42b194={};var _0x4e76da;var _0x25645b;return db['ChatWebsite'][_0x6862('0x5b')]({'where':{'id':_0x313c15[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x408442,null))[_0x6862('0x24')](function(_0x1c8885){if(_0x1c8885){_0x4e76da=_0x1c8885;_0x42b194[_0x6862('0x32')]=_['keys'](db[_0x6862('0x91')][_0x6862('0x2e')]);_0x42b194[_0x6862('0x35')]=_['keys'](_0x313c15[_0x6862('0x35')]);_0x42b194[_0x6862('0x3c')]=_['intersection'](_0x42b194[_0x6862('0x32')],_0x42b194['query']);_0xffe37f[_0x6862('0x37')]=_[_0x6862('0x36')](_0x42b194[_0x6862('0x32')],qs[_0x6862('0x38')](_0x313c15[_0x6862('0x35')][_0x6862('0x38')]));_0xffe37f['attributes']=_0xffe37f['attributes']['length']?_0xffe37f[_0x6862('0x37')]:_0x42b194[_0x6862('0x32')];_0xffe37f[_0x6862('0x3b')]=qs[_0x6862('0x5d')](_0x313c15[_0x6862('0x35')][_0x6862('0x5d')]);_0xffe37f[_0x6862('0x3f')]=qs[_0x6862('0x3c')](_[_0x6862('0x3d')](_0x313c15[_0x6862('0x35')],_0x42b194[_0x6862('0x3c')]));if(_0x313c15['query']['filter']){_0xffe37f[_0x6862('0x3f')]=_[_0x6862('0x40')](_0xffe37f[_0x6862('0x3f')],{'$or':_['map'](_0xffe37f['attributes'],function(_0x56ac3a){var _0x37ec2b={};_0x37ec2b[_0x56ac3a]={'$like':'%'+_0x313c15[_0x6862('0x35')][_0x6862('0x3e')]+'%'};return _0x37ec2b;})});}_0xffe37f=_[_0x6862('0x40')]({},_0xffe37f,_0x313c15[_0x6862('0x42')]);return _0x4e76da[_0x6862('0x116')](_0xffe37f);}})[_0x6862('0x24')](function(_0x3473c4){if(_0x3473c4){_0x25645b=_0x3473c4['length'];if(!_0x313c15['query']['hasOwnProperty'](_0x6862('0x3a'))){_0xffe37f[_0x6862('0x22')]=qs[_0x6862('0x22')](_0x313c15[_0x6862('0x35')][_0x6862('0x22')]);_0xffe37f[_0x6862('0x1f')]=qs['offset'](_0x313c15[_0x6862('0x35')][_0x6862('0x1f')]);}return _0x4e76da['getApplications'](_0xffe37f);}})[_0x6862('0x24')](function(_0x253011){if(_0x253011){return _0x253011?{'count':_0x25645b,'rows':_0x253011}:null;}})[_0x6862('0x24')](respondWithResult(_0x408442,null))[_0x6862('0x1b')](handleError(_0x408442,null));};exports[_0x6862('0x117')]=function(_0x21ce05,_0x111d3a){return db['chatProactiveAction'][_0x6862('0x48')]({'where':{'id':_0x21ce05['params']['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x111d3a,null))[_0x6862('0x24')](function(_0x393d33){if(_0x393d33){return _0x393d33[_0x6862('0x117')](_0x21ce05[_0x6862('0x4a')][_0x6862('0x60')],_[_0x6862('0x118')](_0x21ce05[_0x6862('0x4a')],['ids','id'])||{});}})['then'](respondWithResult(_0x111d3a,null))[_0x6862('0x1b')](handleError(_0x111d3a,null));};exports['getProactiveActions']=function(_0x6bf7b3,_0x1fc6e0){var _0x42e5ff={};var _0x3c35ee={};var _0x5ca5d5;var _0x3760f0;return db[_0x6862('0x2d')][_0x6862('0x5b')]({'where':{'id':_0x6bf7b3[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x1fc6e0,null))[_0x6862('0x24')](function(_0x4c440b){if(_0x4c440b){_0x5ca5d5=_0x4c440b;_0x3c35ee['model']=_[_0x6862('0x47')](db['ChatProactiveAction']['rawAttributes']);_0x3c35ee[_0x6862('0x35')]=_[_0x6862('0x47')](_0x6bf7b3['query']);_0x3c35ee[_0x6862('0x3c')]=_[_0x6862('0x36')](_0x3c35ee[_0x6862('0x32')],_0x3c35ee[_0x6862('0x35')]);_0x42e5ff[_0x6862('0x37')]=_['intersection'](_0x3c35ee[_0x6862('0x32')],qs['fields'](_0x6bf7b3[_0x6862('0x35')][_0x6862('0x38')]));_0x42e5ff['attributes']=_0x42e5ff[_0x6862('0x37')][_0x6862('0x39')]?_0x42e5ff['attributes']:_0x3c35ee['model'];_0x42e5ff[_0x6862('0x3b')]=qs[_0x6862('0x5d')](_0x6bf7b3['query']['sort']);_0x42e5ff['where']=qs['filters'](_[_0x6862('0x3d')](_0x6bf7b3['query'],_0x3c35ee[_0x6862('0x3c')]));if(_0x6bf7b3['query'][_0x6862('0x3e')]){_0x42e5ff[_0x6862('0x3f')]=_[_0x6862('0x40')](_0x42e5ff[_0x6862('0x3f')],{'$or':_[_0x6862('0x33')](_0x42e5ff[_0x6862('0x37')],function(_0x547398){var _0x39236f={};_0x39236f[_0x547398]={'$like':'%'+_0x6bf7b3[_0x6862('0x35')]['filter']+'%'};return _0x39236f;})});}_0x42e5ff=_['merge']({},_0x42e5ff,_0x6bf7b3['options']);return _0x5ca5d5[_0x6862('0xfd')](_0x42e5ff);}})['then'](function(_0x44d32a){if(_0x44d32a){_0x3760f0=_0x44d32a[_0x6862('0x39')];if(!_0x6bf7b3[_0x6862('0x35')][_0x6862('0x5c')]('nolimit')){_0x42e5ff['limit']=qs[_0x6862('0x22')](_0x6bf7b3[_0x6862('0x35')][_0x6862('0x22')]);_0x42e5ff['offset']=qs[_0x6862('0x1f')](_0x6bf7b3['query'][_0x6862('0x1f')]);}return _0x5ca5d5['getProactiveActions'](_0x42e5ff);}})[_0x6862('0x24')](function(_0x4a3eb9){if(_0x4a3eb9){return _0x4a3eb9?{'count':_0x3760f0,'rows':_0x4a3eb9}:null;}})[_0x6862('0x24')](respondWithResult(_0x1fc6e0,null))[_0x6862('0x1b')](handleError(_0x1fc6e0,null));};exports[_0x6862('0x119')]=function(_0x4433c4,_0x2a9ebd){var _0x3c5077=_0x4433c4[_0x6862('0x35')][_0x6862('0x11a')]==='false'?'offlineForm':_0x6862('0x11b');return db['ChatWebsite'][_0x6862('0x48')]({'attributes':['id',_0x3c5077],'where':{'id':_0x4433c4[_0x6862('0x52')]['id']}})['then'](handleEntityNotFound(_0x2a9ebd,null))[_0x6862('0x24')](function(_0x210d08){if(_0x210d08){var _0x429f59=_0x210d08[_0x3c5077];var _0x1fa179=_0x429f59&&_0x429f59[_0x6862('0x11c')]?_0x429f59[_0x6862('0x11c')]:[];_0x2a9ebd[_0x6862('0x2a')]({'fromKey':_[_0x6862('0x6e')](_0x429f59[_0x6862('0x11d')])?undefined:_0x429f59[_0x6862('0x11d')],'count':_0x1fa179['length'],'rows':_0x1fa179});}})[_0x6862('0x1b')](handleError(_0x2a9ebd,null));};exports[_0x6862('0x11e')]=function(_0x392ea3,_0x4adbd9){var _0xacff4b={'raw':![],'where':{}};var _0x37f297={};var _0x55169a={'count':0x0,'rows':[]};return db[_0x6862('0x2d')][_0x6862('0x5b')]({'where':{'id':_0x392ea3[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x4adbd9,null))[_0x6862('0x24')](function(_0x56228d){if(_0x56228d){_0x37f297[_0x6862('0x32')]=_[_0x6862('0x47')](db[_0x6862('0x11f')][_0x6862('0x2e')]);_0x37f297['query']=_[_0x6862('0x47')](_0x392ea3[_0x6862('0x35')]);_0x37f297[_0x6862('0x3c')]=_[_0x6862('0x36')](_0x37f297[_0x6862('0x32')],_0x37f297['query']);_0xacff4b[_0x6862('0x37')]=_[_0x6862('0x36')](_0x37f297[_0x6862('0x32')],qs['fields'](_0x392ea3[_0x6862('0x35')][_0x6862('0x38')]));_0xacff4b[_0x6862('0x37')]=_0xacff4b[_0x6862('0x37')][_0x6862('0x39')]?_0xacff4b[_0x6862('0x37')]:_0x37f297[_0x6862('0x32')];if(!_0x392ea3[_0x6862('0x35')][_0x6862('0x5c')]('nolimit')){_0xacff4b['limit']=qs[_0x6862('0x22')](_0x392ea3['query']['limit']);_0xacff4b['offset']=qs[_0x6862('0x1f')](_0x392ea3['query'][_0x6862('0x1f')]);}_0xacff4b[_0x6862('0x3b')]=qs[_0x6862('0x5d')](_0x392ea3['query'][_0x6862('0x5d')]);_0xacff4b[_0x6862('0x3f')]=qs[_0x6862('0x3c')](_[_0x6862('0x3d')](_0x392ea3[_0x6862('0x35')],_0x37f297[_0x6862('0x3c')]));_0xacff4b[_0x6862('0x3f')][_0x6862('0x5a')]=_0x56228d['id'];if(_0x392ea3['query'][_0x6862('0x3e')]){_0xacff4b[_0x6862('0x3f')]=_[_0x6862('0x40')](_0xacff4b[_0x6862('0x3f')],{'$or':_['map'](_0xacff4b['attributes'],function(_0x500b9c){var _0x486bf7={};_0x486bf7[_0x500b9c]={'$like':'%'+_0x392ea3[_0x6862('0x35')]['filter']+'%'};return _0x486bf7;})});}_0xacff4b=_['merge']({},_0xacff4b,_0x392ea3[_0x6862('0x42')]);return db[_0x6862('0x11f')]['count']({'where':_0xacff4b[_0x6862('0x3f')]})[_0x6862('0x24')](function(_0x2708f7){_0x55169a[_0x6862('0x21')]=_0x2708f7;if(_0x392ea3['query'][_0x6862('0x43')]){_0xacff4b['include']=[{'all':!![]}];}else{_0xacff4b[_0x6862('0x44')]=[{'model':db[_0x6862('0x80')],'as':_0x6862('0xed'),'required':![]},{'model':db[_0x6862('0xd2')],'as':_0x6862('0x120'),'required':![]}];}return db[_0x6862('0x11f')][_0x6862('0x57')](_0xacff4b);})[_0x6862('0x24')](function(_0x2b61b2){_0x55169a['rows']=_0x2b61b2;return _0x55169a;});}})[_0x6862('0x24')](respondWithFilteredResult(_0x4adbd9,_0xacff4b))[_0x6862('0x1b')](handleError(_0x4adbd9,null));};exports['addAgents']=function(_0x4033d7,_0x40151d){return db[_0x6862('0x2d')]['find']({'where':{'id':_0x4033d7['params']['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x40151d,null))['then'](function(_0x328bab){if(_0x328bab){return _0x328bab[_0x6862('0x121')](_0x4033d7[_0x6862('0x4a')][_0x6862('0x60')],_[_0x6862('0x118')](_0x4033d7['body'],[_0x6862('0x60'),'id'])||{})['spread'](function(_0xd6561){for(var _0xc651aa=0x0;_0xc651aa<_0x4033d7['body'][_0x6862('0x60')][_0x6862('0x39')];_0xc651aa+=0x1){socket[_0x6862('0x122')](_0x6862('0x123'),{'UserId':Number(_0x4033d7[_0x6862('0x4a')][_0x6862('0x60')][_0xc651aa]),'ChatWebsiteId':Number(_0x4033d7[_0x6862('0x52')]['id'])});}return _0xd6561;});}})[_0x6862('0x24')](respondWithResult(_0x40151d,null))[_0x6862('0x1b')](handleError(_0x40151d,null));};exports[_0x6862('0x124')]=function(_0x5efda4,_0x55dd5d){return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x5efda4[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x55dd5d,null))[_0x6862('0x24')](function(_0x3787a9){if(_0x3787a9){return _0x3787a9[_0x6862('0x124')](_0x5efda4[_0x6862('0x35')][_0x6862('0x60')])[_0x6862('0x24')](function(){if(_[_0x6862('0x125')](_0x5efda4[_0x6862('0x35')]['ids'])){for(var _0x3f7122=0x0;_0x3f7122<_0x5efda4[_0x6862('0x35')][_0x6862('0x60')]['length'];_0x3f7122+=0x1){socket[_0x6862('0x122')](_0x6862('0x126'),{'UserId':Number(_0x5efda4[_0x6862('0x35')][_0x6862('0x60')][_0x3f7122]),'ChatWebsiteId':Number(_0x5efda4[_0x6862('0x52')]['id'])});}}else{socket[_0x6862('0x122')]('userChatWebsite:remove',{'UserId':Number(_0x5efda4[_0x6862('0x35')]['ids']),'ChatWebsiteId':Number(_0x5efda4[_0x6862('0x52')]['id'])});}});}})[_0x6862('0x24')](respondWithStatusCode(_0x55dd5d,null))['catch'](handleError(_0x55dd5d,null));};exports['getAgents']=function(_0x7ab4ba,_0x4ed80c){var _0x2cf92c={};var _0x213dd6={};var _0x3f2322;var _0x9b2328;return db[_0x6862('0x2d')][_0x6862('0x5b')]({'where':{'id':_0x7ab4ba[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x4ed80c,null))['then'](function(_0x140c31){if(_0x140c31){_0x3f2322=_0x140c31;_0x213dd6[_0x6862('0x32')]=_[_0x6862('0x47')](db['User'][_0x6862('0x2e')]);_0x213dd6[_0x6862('0x35')]=_[_0x6862('0x47')](_0x7ab4ba[_0x6862('0x35')]);_0x213dd6[_0x6862('0x3c')]=_['intersection'](_0x213dd6[_0x6862('0x32')],_0x213dd6['query']);_0x2cf92c[_0x6862('0x37')]=_[_0x6862('0x36')](_0x213dd6[_0x6862('0x32')],qs[_0x6862('0x38')](_0x7ab4ba[_0x6862('0x35')]['fields']));_0x2cf92c[_0x6862('0x37')]=_0x2cf92c[_0x6862('0x37')]['length']?_0x2cf92c[_0x6862('0x37')]:_0x213dd6[_0x6862('0x32')];_0x2cf92c[_0x6862('0x3b')]=qs[_0x6862('0x5d')](_0x7ab4ba[_0x6862('0x35')]['sort']);_0x2cf92c[_0x6862('0x3f')]=qs[_0x6862('0x3c')](_['pick'](_0x7ab4ba[_0x6862('0x35')],_0x213dd6['filters']));if(_0x7ab4ba[_0x6862('0x35')]['filter']){_0x2cf92c[_0x6862('0x3f')]=_[_0x6862('0x40')](_0x2cf92c[_0x6862('0x3f')],{'$or':_[_0x6862('0x33')](_0x2cf92c[_0x6862('0x37')],function(_0x51729e){var _0x25f678={};_0x25f678[_0x51729e]={'$like':'%'+_0x7ab4ba[_0x6862('0x35')][_0x6862('0x3e')]+'%'};return _0x25f678;})});}_0x2cf92c=_['merge']({},_0x2cf92c,_0x7ab4ba[_0x6862('0x42')]);return _0x3f2322[_0x6862('0x127')](_0x2cf92c);}})[_0x6862('0x24')](function(_0x41c9b4){if(_0x41c9b4){_0x9b2328=_0x41c9b4['length'];if(!_0x7ab4ba[_0x6862('0x35')]['hasOwnProperty'](_0x6862('0x3a'))){_0x2cf92c[_0x6862('0x22')]=qs[_0x6862('0x22')](_0x7ab4ba[_0x6862('0x35')][_0x6862('0x22')]);_0x2cf92c[_0x6862('0x1f')]=qs[_0x6862('0x1f')](_0x7ab4ba['query'][_0x6862('0x1f')]);}return _0x3f2322[_0x6862('0x127')](_0x2cf92c);}})['then'](function(_0x2eb484){if(_0x2eb484){return _0x2eb484?{'count':_0x9b2328,'rows':_0x2eb484}:null;}})[_0x6862('0x24')](respondWithResult(_0x4ed80c,null))[_0x6862('0x1b')](handleError(_0x4ed80c,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 3dc05ea..a1e6825 100644
--- a/server/api/chatWebsite/chatWebsite.events.js
+++ b/server/api/chatWebsite/chatWebsite.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x106f=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x2bd1ec,_0x3fe65f){var _0x2f7577=function(_0x5234fb){while(--_0x5234fb){_0x2bd1ec['push'](_0x2bd1ec['shift']());}};_0x2f7577(++_0x3fe65f);}(_0x106f,0x162));var _0xf106=function(_0x42f44a,_0x2b12e3){_0x42f44a=_0x42f44a-0x0;var _0x578c48=_0x106f[_0x42f44a];return _0x578c48;};'use strict';var EventEmitter=require(_0xf106('0x0'));var ChatWebsite=require(_0xf106('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf106('0x2')](0x0);var events={'afterCreate':_0xf106('0x3'),'afterUpdate':'update','afterDestroy':_0xf106('0x4')};function emitEvent(_0x4ab04f){return function(_0x1236af,_0x370f6a,_0x1f2919){ChatWebsiteEvents[_0xf106('0x5')](_0x4ab04f+':'+_0x1236af['id'],_0x1236af);ChatWebsiteEvents[_0xf106('0x5')](_0x4ab04f,_0x1236af);_0x1f2919(null);};}for(var e in events){if(events[_0xf106('0x6')](e)){var event=events[e];ChatWebsite[_0xf106('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x8d9b=['save','hook','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x358a62,_0x222349){var _0x55f1ae=function(_0x5e8c6b){while(--_0x5e8c6b){_0x358a62['push'](_0x358a62['shift']());}};_0x55f1ae(++_0x222349);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xb8d9('0x0'));var ChatWebsite=require(_0xb8d9('0x1'))['db'][_0xb8d9('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb8d9('0x3')](0x0);var events={'afterCreate':_0xb8d9('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3f763a){return function(_0x47b650,_0x2192ff,_0x3da7ad){ChatWebsiteEvents['emit'](_0x3f763a+':'+_0x47b650['id'],_0x47b650);ChatWebsiteEvents['emit'](_0x3f763a,_0x47b650);_0x3da7ad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xb8d9('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index e814f70..e47fa42 100644
--- a/server/api/chatWebsite/chatWebsite.model.js
+++ b/server/api/chatWebsite/chatWebsite.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf8c1=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf8c1,0x185));var _0x1f8c=function(_0x470922,_0x6c3e76){_0x470922=_0x470922-0x0;var _0x3058c8=_0xf8c1[_0x470922];return _0x3058c8;};'use strict';var _=require(_0x1f8c('0x0'));var util=require(_0x1f8c('0x1'));var logger=require(_0x1f8c('0x2'))(_0x1f8c('0x3'));var moment=require(_0x1f8c('0x4'));var BPromise=require('bluebird');var rp=require(_0x1f8c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f8c('0x6'));var config=require(_0x1f8c('0x7'));var attributes=require(_0x1f8c('0x8'));module[_0x1f8c('0x9')]=function(_0x31a4c9,_0x568686){return _0x31a4c9['define']('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1dbe=['../../config/environment','./chatWebsite.attributes','ChatWebsite','chat_websites','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x1dbe,0x143));var _0xe1db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dbe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe1db('0x0'));var util=require('util');var logger=require(_0xe1db('0x1'))(_0xe1db('0x2'));var moment=require('moment');var BPromise=require(_0xe1db('0x3'));var rp=require(_0xe1db('0x4'));var fs=require('fs');var path=require(_0xe1db('0x5'));var rimraf=require(_0xe1db('0x6'));var config=require(_0xe1db('0x7'));var attributes=require(_0xe1db('0x8'));module['exports']=function(_0x51e6c0,_0xa8d6d5){return _0x51e6c0['define'](_0xe1db('0x9'),attributes,{'tableName':_0xe1db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 40cfa4d..22ea641 100644
--- a/server/api/chatWebsite/chatWebsite.rpc.js
+++ b/server/api/chatWebsite/chatWebsite.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1783=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then'];(function(_0x217141,_0x3a8c3f){var _0x181c7f=function(_0x5e5412){while(--_0x5e5412){_0x217141['push'](_0x217141['shift']());}};_0x181c7f(++_0x3a8c3f);}(_0x1783,0x94));var _0x3178=function(_0xcb0b59,_0x3b157f){_0xcb0b59=_0xcb0b59-0x0;var _0xffe629=_0x1783[_0xcb0b59];return _0xffe629;};'use strict';var _=require('lodash');var util=require(_0x3178('0x0'));var moment=require(_0x3178('0x1'));var BPromise=require(_0x3178('0x2'));var rs=require(_0x3178('0x3'));var fs=require('fs');var Redis=require(_0x3178('0x4'));var db=require(_0x3178('0x5'))['db'];var utils=require(_0x3178('0x6'));var logger=require(_0x3178('0x7'))(_0x3178('0x8'));var config=require(_0x3178('0x9'));var jayson=require(_0x3178('0xa'));var client=jayson[_0x3178('0xb')]['http']({'port':0x232a});config[_0x3178('0xc')]=_[_0x3178('0xd')](config[_0x3178('0xc')],{'host':_0x3178('0xe'),'port':0x18eb});var socket=require(_0x3178('0xf'))(new Redis(config[_0x3178('0xc')]));require(_0x3178('0x10'))[_0x3178('0x11')](socket);function respondWithRpcPromise(_0x3b775c,_0x5dd5b9,_0xa35d1){return new BPromise(function(_0x40e73d,_0x301bd8){return client[_0x3178('0x12')](_0x3b775c,_0xa35d1)[_0x3178('0x13')](function(_0x38f5ca){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5dd5b9,_0x3178('0x14'));logger[_0x3178('0x15')](_0x3178('0x16'),_0x5dd5b9,_0x3178('0x14'),JSON[_0x3178('0x17')](_0x38f5ca));if(_0x38f5ca[_0x3178('0x18')]){if(_0x38f5ca[_0x3178('0x18')][_0x3178('0x19')]===0x1f4){logger[_0x3178('0x18')](_0x3178('0x1a'),_0x5dd5b9,_0x38f5ca[_0x3178('0x18')]['message']);return _0x301bd8(_0x38f5ca['error'][_0x3178('0x1b')]);}logger[_0x3178('0x18')](_0x3178('0x1a'),_0x5dd5b9,_0x38f5ca[_0x3178('0x18')][_0x3178('0x1b')]);return _0x40e73d(_0x38f5ca[_0x3178('0x18')][_0x3178('0x1b')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5dd5b9,_0x3178('0x14'));_0x40e73d(_0x38f5ca['result'][_0x3178('0x1b')]);}})['catch'](function(_0x9c56e8){logger['error'](_0x3178('0x1a'),_0x5dd5b9,_0x9c56e8);_0x301bd8(_0x9c56e8);});});}
\ No newline at end of file
+var _0x498e=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x351192,_0x57a827){var _0x20ee3a=function(_0x1ad066){while(--_0x1ad066){_0x351192['push'](_0x351192['shift']());}};_0x20ee3a(++_0x57a827);}(_0x498e,0x9c));var _0xe498=function(_0x16f18a,_0x3bef4a){_0x16f18a=_0x16f18a-0x0;var _0x49263d=_0x498e[_0x16f18a];return _0x49263d;};'use strict';var _=require(_0xe498('0x0'));var util=require(_0xe498('0x1'));var moment=require(_0xe498('0x2'));var BPromise=require(_0xe498('0x3'));var rs=require(_0xe498('0x4'));var fs=require('fs');var Redis=require(_0xe498('0x5'));var db=require(_0xe498('0x6'))['db'];var utils=require(_0xe498('0x7'));var logger=require('../../config/logger')(_0xe498('0x8'));var config=require('../../config/environment');var jayson=require(_0xe498('0x9'));var client=jayson[_0xe498('0xa')][_0xe498('0xb')]({'port':0x232a});config[_0xe498('0xc')]=_[_0xe498('0xd')](config[_0xe498('0xc')],{'host':_0xe498('0xe'),'port':0x18eb});var socket=require(_0xe498('0xf'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xe498('0x10')](socket);function respondWithRpcPromise(_0x113318,_0x36d34d,_0x4866b1){return new BPromise(function(_0x53ef83,_0x17bd9c){return client[_0xe498('0x11')](_0x113318,_0x4866b1)[_0xe498('0x12')](function(_0x347c50){logger[_0xe498('0x13')](_0xe498('0x14'),_0x36d34d,'request\x20sent');logger['debug'](_0xe498('0x15'),_0x36d34d,_0xe498('0x16'),JSON['stringify'](_0x347c50));if(_0x347c50[_0xe498('0x17')]){if(_0x347c50[_0xe498('0x17')][_0xe498('0x18')]===0x1f4){logger[_0xe498('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x36d34d,_0x347c50['error'][_0xe498('0x19')]);return _0x17bd9c(_0x347c50[_0xe498('0x17')][_0xe498('0x19')]);}logger['error'](_0xe498('0x14'),_0x36d34d,_0x347c50[_0xe498('0x17')][_0xe498('0x19')]);return _0x53ef83(_0x347c50['error'][_0xe498('0x19')]);}else{logger[_0xe498('0x13')](_0xe498('0x14'),_0x36d34d,'request\x20sent');_0x53ef83(_0x347c50[_0xe498('0x1a')][_0xe498('0x19')]);}})[_0xe498('0x1b')](function(_0x4796c6){logger[_0xe498('0x17')](_0xe498('0x14'),_0x36d34d,_0x4796c6);_0x17bd9c(_0x4796c6);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index de0af5a..d26dbca 100644
--- a/server/api/chatWebsite/chatWebsite.socket.js
+++ b/server/api/chatWebsite/chatWebsite.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcbe7=['remove','update','emit','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xcbe7,0x19e));var _0x7cbe=function(_0x4d01c4,_0x4a9db1){_0x4d01c4=_0x4d01c4-0x0;var _0x57219d=_0xcbe7[_0x4d01c4];return _0x57219d;};'use strict';var ChatWebsiteEvents=require(_0x7cbe('0x0'));var events=[_0x7cbe('0x1'),_0x7cbe('0x2'),_0x7cbe('0x3')];function createListener(_0x2589b8,_0x226a2c){return function(_0x2bdd91){_0x226a2c[_0x7cbe('0x4')](_0x2589b8,_0x2bdd91);};}function removeListener(_0x4ee90c,_0x4f9c3b){return function(){ChatWebsiteEvents['removeListener'](_0x4ee90c,_0x4f9c3b);};}exports[_0x7cbe('0x5')]=function(_0x22df24){for(var _0x2d2ee9=0x0,_0x106c2b=events[_0x7cbe('0x6')];_0x2d2ee9<_0x106c2b;_0x2d2ee9++){var _0x25176e=events[_0x2d2ee9];var _0x346837=createListener(_0x7cbe('0x7')+_0x25176e,_0x22df24);ChatWebsiteEvents['on'](_0x25176e,_0x346837);}};
\ No newline at end of file
+var _0x3bd4=['./chatWebsite.events','save','remove','update','emit','removeListener','length'];(function(_0x133c58,_0x5d85f2){var _0x5937d5=function(_0x5d27fc){while(--_0x5d27fc){_0x133c58['push'](_0x133c58['shift']());}};_0x5937d5(++_0x5d85f2);}(_0x3bd4,0x69));var _0x43bd=function(_0x3add10,_0x457d16){_0x3add10=_0x3add10-0x0;var _0x2da348=_0x3bd4[_0x3add10];return _0x2da348;};'use strict';var ChatWebsiteEvents=require(_0x43bd('0x0'));var events=[_0x43bd('0x1'),_0x43bd('0x2'),_0x43bd('0x3')];function createListener(_0x23cc4e,_0x11d2da){return function(_0x2ef4dd){_0x11d2da[_0x43bd('0x4')](_0x23cc4e,_0x2ef4dd);};}function removeListener(_0x17761b,_0x25bafb){return function(){ChatWebsiteEvents[_0x43bd('0x5')](_0x17761b,_0x25bafb);};}exports['register']=function(_0x13e914){for(var _0x31d52d=0x0,_0xe8c338=events[_0x43bd('0x6')];_0x31d52d<_0xe8c338;_0x31d52d++){var _0x288c21=events[_0x31d52d];var _0x1ebf06=createListener('chatWebsite:'+_0x288c21,_0x13e914);ChatWebsiteEvents['on'](_0x288c21,_0x1ebf06);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index e511154..2485078 100644
--- a/server/api/chatWebsite/index.js
+++ b/server/api/chatWebsite/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc2e6=['/:id/logo','single','file','addLogo','root','server/files/images/avatars/','format','addAvatar','join','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','destroy','delete','removeAnswers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','isAuthenticated','index','get','/describe','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','%s-%s','now','originalname'];(function(_0x54c5c4,_0x3259e2){var _0x237b77=function(_0x22228d){while(--_0x22228d){_0x54c5c4['push'](_0x54c5c4['shift']());}};_0x237b77(++_0x3259e2);}(_0xc2e6,0x13e));var _0x6c2e=function(_0x2df0dd,_0x3f4730){_0x2df0dd=_0x2df0dd-0x0;var _0x4f5de5=_0xc2e6[_0x2df0dd];return _0x4f5de5;};'use strict';var multer=require(_0x6c2e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6c2e('0x1'));var express=require(_0x6c2e('0x2'));var router=express[_0x6c2e('0x3')]();var fs_extra=require(_0x6c2e('0x4'));var auth=require(_0x6c2e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6c2e('0x6'));router['get']('/',auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x8')]);router[_0x6c2e('0x9')](_0x6c2e('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x6c2e('0x7')](),controller['show']);router['get']('/:id/dispositions',auth[_0x6c2e('0x7')](),controller[_0x6c2e('0xb')]);router[_0x6c2e('0x9')](_0x6c2e('0xc'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0xd')]);router['get']('/:id/logo',controller[_0x6c2e('0xe')]);router[_0x6c2e('0x9')](_0x6c2e('0xf'),controller[_0x6c2e('0x10')]);router['get'](_0x6c2e('0x11'),controller[_0x6c2e('0x12')]);router['get'](_0x6c2e('0x13'),controller[_0x6c2e('0x14')]);router[_0x6c2e('0x9')]('/:id/interactions',auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x15')]);router[_0x6c2e('0x9')](_0x6c2e('0x16'),controller[_0x6c2e('0x17')]);router[_0x6c2e('0x9')](_0x6c2e('0x18'),auth['isAuthenticated'](),controller[_0x6c2e('0x19')]);router[_0x6c2e('0x9')](_0x6c2e('0x1a'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x1b')]);router['get'](_0x6c2e('0x1c'),controller['getFields']);router['get'](_0x6c2e('0x1d'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x1e')]);router[_0x6c2e('0x9')](_0x6c2e('0x1f'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x20')]);router[_0x6c2e('0x21')]('/',auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x22')]);router[_0x6c2e('0x21')](_0x6c2e('0x23'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x24')]);router[_0x6c2e('0x21')](_0x6c2e('0xc'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x25')]);var upload=multer({'storage':multer[_0x6c2e('0x26')]({'destination':function(_0x2993e0,_0x49e79e,_0x1994b1){_0x1994b1(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x1f6c04,_0x25a657,_0x4a12de){_0x4a12de(null,util['format'](_0x6c2e('0x27'),Date[_0x6c2e('0x28')](),_0x25a657[_0x6c2e('0x29')]));}})});router['post'](_0x6c2e('0x2a'),upload[_0x6c2e('0x2b')](_0x6c2e('0x2c')),controller[_0x6c2e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x684a4,_0x5f06eb,_0x2dd2ed){_0x2dd2ed(null,path['join'](config[_0x6c2e('0x2e')],_0x6c2e('0x2f')));},'filename':function(_0x403744,_0x1d1356,_0x7ff6d8){_0x7ff6d8(null,util[_0x6c2e('0x30')](_0x6c2e('0x27'),Date['now'](),_0x1d1356[_0x6c2e('0x29')]));}})});router[_0x6c2e('0x21')](_0x6c2e('0xf'),upload[_0x6c2e('0x2b')]('file'),controller[_0x6c2e('0x31')]);var upload=multer({'storage':multer[_0x6c2e('0x26')]({'destination':function(_0x101653,_0x27074c,_0x42c01d){_0x42c01d(null,path[_0x6c2e('0x32')](config[_0x6c2e('0x2e')],_0x6c2e('0x2f')));},'filename':function(_0xf66c3b,_0x2550a4,_0x26f6bc){_0x26f6bc(null,util[_0x6c2e('0x30')](_0x6c2e('0x27'),Date[_0x6c2e('0x28')](),_0x2550a4[_0x6c2e('0x29')]));}})});router[_0x6c2e('0x21')](_0x6c2e('0x11'),upload[_0x6c2e('0x2b')](_0x6c2e('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x6c2e('0x26')]({'destination':function(_0x12e85a,_0x123bf9,_0x46db39){_0x46db39(null,path[_0x6c2e('0x32')](config[_0x6c2e('0x2e')],_0x6c2e('0x2f')));},'filename':function(_0x108e4e,_0x8d52cf,_0x812ab6){_0x812ab6(null,util[_0x6c2e('0x30')]('%s-%s',Date[_0x6c2e('0x28')](),_0x8d52cf[_0x6c2e('0x29')]));}})});router[_0x6c2e('0x21')](_0x6c2e('0x13'),upload[_0x6c2e('0x2b')](_0x6c2e('0x2c')),controller['addSystemAvatar']);router[_0x6c2e('0x21')](_0x6c2e('0x33'),controller[_0x6c2e('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x6c2e('0x26')]({'destination':function(_0x456e27,_0x5b4039,_0x546296){const _0xe9219c=path[_0x6c2e('0x32')](config[_0x6c2e('0x2e')],_0x6c2e('0x35'),_0x6c2e('0x36'),'offline-chat');fs_extra[_0x6c2e('0x37')](_0xe9219c,function(){_0x546296(null,_0xe9219c);});},'filename':function(_0x29508c,_0x381604,_0x437677){const _0x2df178=_0x381604['originalname'][_0x6c2e('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x38f282=path[_0x6c2e('0x39')](_0x2df178);const _0xbac1de=Date['now']()+'-'+_0x2df178[_0x6c2e('0x38')](_0x38f282,'')+_0x38f282;_0x437677(null,_0xbac1de);}})});router[_0x6c2e('0x21')](_0x6c2e('0x3a'),offlineUploadMulter[_0x6c2e('0x3b')](),controller[_0x6c2e('0x3c')]);router[_0x6c2e('0x21')]('/:id/interactions',auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x3d')]);router[_0x6c2e('0x21')](_0x6c2e('0x18'),auth['isAuthenticated'](),controller[_0x6c2e('0x3e')]);router[_0x6c2e('0x21')](_0x6c2e('0x1a'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x3f')]);router[_0x6c2e('0x21')](_0x6c2e('0x1f'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x40')]);router[_0x6c2e('0x41')](_0x6c2e('0x42'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x43')]);router['delete'](_0x6c2e('0x42'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x44')]);router[_0x6c2e('0x45')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x6c2e('0x45')](_0x6c2e('0xc'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x46')]);router[_0x6c2e('0x45')](_0x6c2e('0x1f'),auth[_0x6c2e('0x7')](),controller['removeAgents']);module[_0x6c2e('0x47')]=router;
\ No newline at end of file
+var _0xfc7a=['addAvatar','file','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','update','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','server/files/images/avatars/','originalname','single'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc7a,0x129));var _0xafc7=function(_0x289cf5,_0x501dfc){_0x289cf5=_0x289cf5-0x0;var _0x1f316d=_0xfc7a[_0x289cf5];return _0x1f316d;};'use strict';var multer=require(_0xafc7('0x0'));var util=require(_0xafc7('0x1'));var path=require(_0xafc7('0x2'));var timeout=require(_0xafc7('0x3'));var express=require(_0xafc7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xafc7('0x5'));var interaction=require(_0xafc7('0x6'));var config=require(_0xafc7('0x7'));var controller=require(_0xafc7('0x8'));router[_0xafc7('0x9')]('/',auth[_0xafc7('0xa')](),controller[_0xafc7('0xb')]);router[_0xafc7('0x9')](_0xafc7('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xafc7('0x9')](_0xafc7('0xd'),auth[_0xafc7('0xa')](),controller[_0xafc7('0xe')]);router[_0xafc7('0x9')]('/:id/dispositions',auth[_0xafc7('0xa')](),controller[_0xafc7('0xf')]);router[_0xafc7('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xafc7('0x10')]);router[_0xafc7('0x9')](_0xafc7('0x11'),controller[_0xafc7('0x12')]);router['get'](_0xafc7('0x13'),controller[_0xafc7('0x14')]);router[_0xafc7('0x9')](_0xafc7('0x15'),controller[_0xafc7('0x16')]);router[_0xafc7('0x9')](_0xafc7('0x17'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0xafc7('0xa')](),controller[_0xafc7('0x18')]);router[_0xafc7('0x9')]('/:id/snippet',controller[_0xafc7('0x19')]);router[_0xafc7('0x9')]('/:id/applications',auth[_0xafc7('0xa')](),controller['getApplications']);router[_0xafc7('0x9')](_0xafc7('0x1a'),auth[_0xafc7('0xa')](),controller[_0xafc7('0x1b')]);router['get'](_0xafc7('0x1c'),controller[_0xafc7('0x1d')]);router[_0xafc7('0x9')]('/:id/offline_messages',auth[_0xafc7('0xa')](),controller[_0xafc7('0x1e')]);router[_0xafc7('0x9')](_0xafc7('0x1f'),auth['isAuthenticated'](),controller['getAgents']);router[_0xafc7('0x20')]('/',auth[_0xafc7('0xa')](),controller[_0xafc7('0x21')]);router['post'](_0xafc7('0x22'),auth[_0xafc7('0xa')](),controller[_0xafc7('0x23')]);router[_0xafc7('0x20')](_0xafc7('0x24'),auth[_0xafc7('0xa')](),controller[_0xafc7('0x25')]);var upload=multer({'storage':multer[_0xafc7('0x26')]({'destination':function(_0x3e797d,_0x41c9cd,_0x468063){_0x468063(null,path[_0xafc7('0x27')](config[_0xafc7('0x28')],_0xafc7('0x29')));},'filename':function(_0x383e3e,_0x4cb759,_0x3d21d2){_0x3d21d2(null,util[_0xafc7('0x2a')](_0xafc7('0x2b'),Date[_0xafc7('0x2c')](),_0x4cb759['originalname']));}})});router['post'](_0xafc7('0x11'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xafc7('0x26')]({'destination':function(_0xb0347a,_0x5f1dd8,_0x4a7488){_0x4a7488(null,path[_0xafc7('0x27')](config[_0xafc7('0x28')],_0xafc7('0x2d')));},'filename':function(_0xaf59d7,_0x2ca7ba,_0x2635ea){_0x2635ea(null,util['format'](_0xafc7('0x2b'),Date[_0xafc7('0x2c')](),_0x2ca7ba[_0xafc7('0x2e')]));}})});router[_0xafc7('0x20')]('/:id/avatar',upload[_0xafc7('0x2f')]('file'),controller[_0xafc7('0x30')]);var upload=multer({'storage':multer[_0xafc7('0x26')]({'destination':function(_0x18b333,_0x17d2ce,_0x493c72){_0x493c72(null,path['join'](config[_0xafc7('0x28')],_0xafc7('0x2d')));},'filename':function(_0x31bf90,_0x2b2755,_0x51a378){_0x51a378(null,util['format'](_0xafc7('0x2b'),Date[_0xafc7('0x2c')](),_0x2b2755[_0xafc7('0x2e')]));}})});router[_0xafc7('0x20')]('/:id/customer_avatar',upload[_0xafc7('0x2f')](_0xafc7('0x31')),controller[_0xafc7('0x32')]);var upload=multer({'storage':multer[_0xafc7('0x26')]({'destination':function(_0x52e4a2,_0x52a07f,_0x4356fc){_0x4356fc(null,path[_0xafc7('0x27')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x16426d,_0x24b855,_0x44094e){_0x44094e(null,util[_0xafc7('0x2a')](_0xafc7('0x2b'),Date[_0xafc7('0x2c')](),_0x24b855[_0xafc7('0x2e')]));}})});router[_0xafc7('0x20')](_0xafc7('0x17'),upload['single'](_0xafc7('0x31')),controller['addSystemAvatar']);router[_0xafc7('0x20')](_0xafc7('0x33'),controller[_0xafc7('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xafc7('0x26')]({'destination':function(_0x4ca7a8,_0x4d6784,_0x127f8d){const _0x280723=path[_0xafc7('0x27')](config[_0xafc7('0x28')],_0xafc7('0x35'),'attachments',_0xafc7('0x36'));fs_extra[_0xafc7('0x37')](_0x280723,function(){_0x127f8d(null,_0x280723);});},'filename':function(_0xe1abf8,_0x4e0df6,_0x45f2bf){const _0x33d06d=_0x4e0df6[_0xafc7('0x2e')][_0xafc7('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x51fdbf=path[_0xafc7('0x39')](_0x33d06d);const _0x17778c=Date[_0xafc7('0x2c')]()+'-'+_0x33d06d[_0xafc7('0x38')](_0x51fdbf,'')+_0x51fdbf;_0x45f2bf(null,_0x17778c);}})});router[_0xafc7('0x20')]('/:id/offline',offlineUploadMulter[_0xafc7('0x3a')](),controller[_0xafc7('0x3b')]);router['post'](_0xafc7('0x3c'),auth[_0xafc7('0xa')](),controller[_0xafc7('0x3d')]);router[_0xafc7('0x20')]('/:id/applications',auth[_0xafc7('0xa')](),controller[_0xafc7('0x3e')]);router[_0xafc7('0x20')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xafc7('0x3f')]);router['post'](_0xafc7('0x1f'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xafc7('0xd'),auth['isAuthenticated'](),controller[_0xafc7('0x40')]);router['delete'](_0xafc7('0xd'),auth[_0xafc7('0xa')](),controller['destroy']);router[_0xafc7('0x41')](_0xafc7('0x22'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xafc7('0x41')](_0xafc7('0x24'),auth[_0xafc7('0xa')](),controller[_0xafc7('0x42')]);router[_0xafc7('0x41')]('/:id/users',auth[_0xafc7('0xa')](),controller[_0xafc7('0x43')]);module[_0xafc7('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index dbf8599..57a2081 100644
--- a/server/api/cloudProvider/cloudProvider.attributes.js
+++ b/server/api/cloudProvider/cloudProvider.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ed2=['MicrosoftAzure\x20=>\x20tenant','STRING','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','TEXT','sequelize','exports','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4ed2,0x1d7));var _0x24ed=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4ed2[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x24ed('0x0'));module[_0x24ed('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x24ed('0x2')](_0x24ed('0x3'),_0x24ed('0x4'),_0x24ed('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x24ed('0x2')](_0x24ed('0x6'),_0x24ed('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0x24ed('0x8')},'data2':{'type':Sequelize['STRING'],'comment':_0x24ed('0x9')},'data3':{'type':Sequelize[_0x24ed('0xa')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0x24ed('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0x24ed('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0x24ed('0xd')},'data7':{'type':Sequelize[_0x24ed('0xe')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0xb871=['ENUM','Google','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0xb83719,_0x295c63){var _0x2462a5=function(_0x166db2){while(--_0x166db2){_0xb83719['push'](_0xb83719['shift']());}};_0x2462a5(++_0x295c63);}(_0xb871,0x1da));var _0x1b87=function(_0x976826,_0x3a903b){_0x976826=_0x976826-0x0;var _0x5d0be7=_0xb871[_0x976826];return _0x5d0be7;};'use strict';var Sequelize=require(_0x1b87('0x0'));module[_0x1b87('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1b87('0x2')]('AmazonAWS',_0x1b87('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x1b87('0x2')](_0x1b87('0x4'),_0x1b87('0x5'))},'data1':{'type':Sequelize[_0x1b87('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x1b87('0x6')],'comment':_0x1b87('0x7')},'data3':{'type':Sequelize[_0x1b87('0x6')],'comment':_0x1b87('0x8')},'data4':{'type':Sequelize['STRING'],'comment':_0x1b87('0x9')},'data5':{'type':Sequelize[_0x1b87('0xa')],'comment':_0x1b87('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0x1b87('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x1b87('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 659dd71..effd984 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f13=['emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','then','destroy','error','name','send','padEnd','slice','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','create','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','body','join','encryptString','find','findOne','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','state','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','data5','data6','refresh_token','startRefreshInterval'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x2f13,0x11d));var _0x32f1=function(_0x561829,_0x31efa4){_0x561829=_0x561829-0x0;var _0x2ddab5=_0x2f13[_0x561829];return _0x2ddab5;};'use strict';var _=require(_0x32f1('0x0'));var Redis=require(_0x32f1('0x1'));var qs=require(_0x32f1('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x32f1('0x3'));var logger=require(_0x32f1('0x4'))('api');var db=require(_0x32f1('0x5'))['db'];var oauth=require(_0x32f1('0x6'));config[_0x32f1('0x7')]=_[_0x32f1('0x8')](config['redis'],{'host':_0x32f1('0x9'),'port':0x18eb});var socket=require(_0x32f1('0xa'))(new Redis(config[_0x32f1('0x7')]));var redis=new Redis(config[_0x32f1('0x7')]);function respondWithStatusCode(_0xac189d,_0xeb5718){_0xeb5718=_0xeb5718||0xcc;return function(_0x32ade6){if(_0x32ade6){return _0xac189d[_0x32f1('0xb')](_0xeb5718);}return _0xac189d[_0x32f1('0xc')](_0xeb5718)[_0x32f1('0xd')]();};}function respondWithResult(_0xa05598,_0x3b4aa7){_0x3b4aa7=_0x3b4aa7||0xc8;return function(_0x1631fe){if(_0x1631fe){return _0xa05598['status'](_0x3b4aa7)[_0x32f1('0xe')](_0x1631fe);}};}function respondWithFilteredResult(_0x5e11af,_0x9cb642){return function(_0x5dff12){if(_0x5dff12){var _0x31f018=typeof _0x9cb642[_0x32f1('0xf')]===_0x32f1('0x10')&&typeof _0x9cb642['limit']===_0x32f1('0x10');var _0x43f5f5=_0x5dff12[_0x32f1('0x11')];var _0x5c69fe=_0x31f018?0x0:_0x9cb642[_0x32f1('0xf')];var _0xd452d5=_0x31f018?_0x5dff12['count']:_0x9cb642[_0x32f1('0xf')]+_0x9cb642['limit'];var _0x3a8111;if(_0xd452d5>=_0x43f5f5){_0xd452d5=_0x43f5f5;_0x3a8111=0xc8;}else{_0x3a8111=0xce;}_0x5e11af[_0x32f1('0xc')](_0x3a8111);return _0x5e11af[_0x32f1('0x12')](_0x32f1('0x13'),_0x5c69fe+'-'+_0xd452d5+'/'+_0x43f5f5)[_0x32f1('0xe')](_0x5dff12);}return null;};}function saveUpdates(_0x58694f){return function(_0x2b352f){if(_0x2b352f){return _0x2b352f[_0x32f1('0x14')](_0x58694f)[_0x32f1('0x15')](function(_0x3916d1){return _0x3916d1;});}return null;};}function removeEntity(_0x370004){return function(_0x3adb3e){if(_0x3adb3e){return _0x3adb3e[_0x32f1('0x16')]()[_0x32f1('0x15')](function(){_0x370004[_0x32f1('0xc')](0xcc)[_0x32f1('0xd')]();});}};}function handleEntityNotFound(_0x1719dc){return function(_0x13fa74){if(!_0x13fa74){_0x1719dc[_0x32f1('0xb')](0x194);}return _0x13fa74;};}function handleError(_0x18b8ca,_0x76b826){_0x76b826=_0x76b826||0x1f4;return function(_0x51179a){logger[_0x32f1('0x17')](_0x51179a['stack']);if(_0x51179a[_0x32f1('0x18')]){delete _0x51179a[_0x32f1('0x18')];}_0x18b8ca[_0x32f1('0xc')](_0x76b826)[_0x32f1('0x19')](_0x51179a);};}function maskClientSecret(_0x2ee2b7){return _[_0x32f1('0x1a')](_0x2ee2b7[_0x32f1('0x1b')](0x0,0x3),0x14,'*');}exports[_0x32f1('0x1c')]=function(_0x1bc85d,_0xc94d6d){var _0x3fc752={},_0x3f3eaa={},_0x24c0b8={'count':0x0,'rows':[]};var _0x4e8a46=_[_0x32f1('0x1d')](db['CloudProvider'][_0x32f1('0x1e')],function(_0x17113e){return{'name':_0x17113e[_0x32f1('0x1f')],'type':_0x17113e[_0x32f1('0x20')][_0x32f1('0x21')]};});_0x3f3eaa[_0x32f1('0x22')]=_[_0x32f1('0x1d')](_0x4e8a46,_0x32f1('0x18'));_0x3f3eaa['query']=_['keys'](_0x1bc85d[_0x32f1('0x23')]);_0x3f3eaa['filters']=_['intersection'](_0x3f3eaa['model'],_0x3f3eaa[_0x32f1('0x23')]);_0x3fc752['attributes']=_[_0x32f1('0x24')](_0x3f3eaa[_0x32f1('0x22')],qs['fields'](_0x1bc85d[_0x32f1('0x23')][_0x32f1('0x25')]));_0x3fc752[_0x32f1('0x26')]=_0x3fc752[_0x32f1('0x26')][_0x32f1('0x27')]?_0x3fc752['attributes']:_0x3f3eaa[_0x32f1('0x22')];if(!_0x1bc85d['query'][_0x32f1('0x28')](_0x32f1('0x29'))){_0x3fc752[_0x32f1('0x2a')]=qs[_0x32f1('0x2a')](_0x1bc85d[_0x32f1('0x23')][_0x32f1('0x2a')]);_0x3fc752[_0x32f1('0xf')]=qs[_0x32f1('0xf')](_0x1bc85d[_0x32f1('0x23')][_0x32f1('0xf')]);}_0x3fc752['order']=qs[_0x32f1('0x2b')](_0x1bc85d[_0x32f1('0x23')][_0x32f1('0x2b')]);_0x3fc752[_0x32f1('0x2c')]=qs[_0x32f1('0x2d')](_['pick'](_0x1bc85d[_0x32f1('0x23')],_0x3f3eaa[_0x32f1('0x2d')]),_0x4e8a46);if(_0x1bc85d[_0x32f1('0x23')][_0x32f1('0x2e')]){_0x3fc752[_0x32f1('0x2c')]=_[_0x32f1('0x2f')](_0x3fc752['where'],{'$or':_['map'](_0x4e8a46,function(_0x4c08a3){if(_0x4c08a3[_0x32f1('0x20')]!==_0x32f1('0x30')){var _0x8036dd={};_0x8036dd[_0x4c08a3[_0x32f1('0x18')]]={'$like':'%'+_0x1bc85d[_0x32f1('0x23')][_0x32f1('0x2e')]+'%'};return _0x8036dd;}})});}_0x3fc752=_[_0x32f1('0x2f')]({},_0x3fc752,_0x1bc85d[_0x32f1('0x31')]);var _0x5c70b8={'where':_0x3fc752[_0x32f1('0x2c')]};return db[_0x32f1('0x32')]['count'](_0x5c70b8)[_0x32f1('0x15')](function(_0x49cd99){_0x24c0b8[_0x32f1('0x11')]=_0x49cd99;if(_0x1bc85d['query'][_0x32f1('0x33')]){_0x3fc752[_0x32f1('0x34')]=[{'all':!![]}];}return db[_0x32f1('0x32')][_0x32f1('0x35')](_0x3fc752);})[_0x32f1('0x15')](function(_0x1d19cf){_0x24c0b8['rows']=_[_0x32f1('0x1d')](_0x1d19cf,function(_0x1c9387){if(_0x1c9387[_0x32f1('0x36')]===_0x32f1('0x37')){var _0x33bc5c=encryptor[_0x32f1('0x38')](_0x1c9387[_0x32f1('0x39')]);_0x1c9387['data3']=maskClientSecret(_0x33bc5c);}return _0x1c9387;});return _0x24c0b8;})[_0x32f1('0x15')](respondWithFilteredResult(_0xc94d6d,_0x3fc752))[_0x32f1('0x3a')](handleError(_0xc94d6d,null));};exports[_0x32f1('0x3b')]=function(_0x261eef,_0x4f6d38){var _0x1a3b74={'raw':!![],'where':{'id':_0x261eef[_0x32f1('0x3c')]['id']}},_0x3244ef={};_0x3244ef['model']=_[_0x32f1('0x3d')](db[_0x32f1('0x32')][_0x32f1('0x1e')]);_0x3244ef[_0x32f1('0x23')]=_['keys'](_0x261eef[_0x32f1('0x23')]);_0x3244ef[_0x32f1('0x2d')]=_['intersection'](_0x3244ef[_0x32f1('0x22')],_0x3244ef[_0x32f1('0x23')]);_0x1a3b74['attributes']=_[_0x32f1('0x24')](_0x3244ef[_0x32f1('0x22')],qs['fields'](_0x261eef['query'][_0x32f1('0x25')]));_0x1a3b74[_0x32f1('0x26')]=_0x1a3b74[_0x32f1('0x26')][_0x32f1('0x27')]?_0x1a3b74['attributes']:_0x3244ef[_0x32f1('0x22')];if(_0x261eef[_0x32f1('0x23')][_0x32f1('0x33')]){_0x1a3b74[_0x32f1('0x34')]=[{'all':!![]}];}_0x1a3b74=_[_0x32f1('0x2f')]({},_0x1a3b74,_0x261eef[_0x32f1('0x31')]);return db[_0x32f1('0x32')]['find'](_0x1a3b74)[_0x32f1('0x15')](handleEntityNotFound(_0x4f6d38,null))[_0x32f1('0x15')](function(_0x5478ab){if(_0x5478ab[_0x32f1('0x36')]===_0x32f1('0x37')){var _0x4e1bc1=encryptor[_0x32f1('0x38')](_0x5478ab[_0x32f1('0x39')]);_0x5478ab[_0x32f1('0x39')]=maskClientSecret(_0x4e1bc1);}return _0x5478ab;})[_0x32f1('0x15')](respondWithResult(_0x4f6d38,null))[_0x32f1('0x3a')](handleError(_0x4f6d38,null));};exports[_0x32f1('0x3e')]=function(_0x41bc98,_0x5393d1){if(!_0x41bc98['body'][_0x32f1('0x18')])throw new Error(_0x32f1('0x3f'));if(!_0x41bc98['body']['service'])throw new Error(_0x32f1('0x40'));var _0x8de91e=db['CloudProvider'][_0x32f1('0x1e')]['service']['values'];if(!_0x8de91e['includes'](_0x41bc98[_0x32f1('0x41')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x8de91e[_0x32f1('0x42')](',\x20'));if(_0x41bc98[_0x32f1('0x41')][_0x32f1('0x36')]==='MicrosoftAzure'&&_0x41bc98['body'][_0x32f1('0x39')]){_0x41bc98[_0x32f1('0x41')][_0x32f1('0x39')]=encryptor[_0x32f1('0x43')](_0x41bc98[_0x32f1('0x41')][_0x32f1('0x39')]);}return db['CloudProvider']['create'](_0x41bc98['body'],{})[_0x32f1('0x15')](respondWithResult(_0x5393d1,0xc9))[_0x32f1('0x3a')](handleError(_0x5393d1,null));};exports[_0x32f1('0x14')]=function(_0x27714,_0x2ae747){if(_0x27714['body']['id']){delete _0x27714[_0x32f1('0x41')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x27714['params']['id']}})['then'](handleEntityNotFound(_0x2ae747,null))[_0x32f1('0x15')](function(_0x9dd53a){if(_0x9dd53a[_0x32f1('0x36')]===_0x32f1('0x37')&&_0x27714[_0x32f1('0x41')]['data3']){_0x27714[_0x32f1('0x41')]['data3']=encryptor[_0x32f1('0x43')](_0x27714[_0x32f1('0x41')][_0x32f1('0x39')]);}return _0x9dd53a;})[_0x32f1('0x15')](saveUpdates(_0x27714[_0x32f1('0x41')],null))[_0x32f1('0x15')](respondWithResult(_0x2ae747,null))['catch'](handleError(_0x2ae747,null));};exports[_0x32f1('0x16')]=function(_0x31119d,_0xa45e15){return db['CloudProvider'][_0x32f1('0x44')]({'where':{'id':_0x31119d[_0x32f1('0x3c')]['id']}})[_0x32f1('0x15')](handleEntityNotFound(_0xa45e15,null))[_0x32f1('0x15')](removeEntity(_0xa45e15,null))[_0x32f1('0x3a')](handleError(_0xa45e15,null));};exports['oauth2MicrosoftAuthorize']=function(_0x409ca0,_0x3e74f1){return db[_0x32f1('0x32')][_0x32f1('0x45')]({'where':{'id':_0x409ca0['params']['id']},'raw':!![]})[_0x32f1('0x15')](function(_0x180e1c){if(!_0x180e1c)return _0x3e74f1['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x180e1c,_0x409ca0[_0x32f1('0x46')]['id'])};})[_0x32f1('0x15')](respondWithResult(_0x3e74f1,null))[_0x32f1('0x3a')](handleError(_0x3e74f1,null));};exports[_0x32f1('0x47')]=function(_0x3387ac,_0x516119){var _0x6404cc=_0x3387ac[_0x32f1('0x41')];var _0x254e9d;var _0x467777;if(_0x6404cc[_0x32f1('0x17')])throw _0x6404cc;redis[_0x32f1('0x48')](_0x6404cc['state'])[_0x32f1('0x15')](function(_0x615b04){if(!_0x615b04)throw new Error(_0x32f1('0x49'));_0x254e9d=JSON[_0x32f1('0x4a')](_0x615b04);var _0x48fea1=Buffer['from'](_0x6404cc[_0x32f1('0x4b')],_0x32f1('0x4c'))[_0x32f1('0x4d')](_0x32f1('0x4e'));_0x467777=JSON[_0x32f1('0x4a')](_0x48fea1);if(!oauth[_0x32f1('0x4f')](_0x6404cc[_0x32f1('0x50')],_0x254e9d[_0x32f1('0x51')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x32f1('0x52')](_0x6404cc['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x6404cc['code'],_0x254e9d);})[_0x32f1('0x15')](function(_0x2ec9e6){_0x254e9d[_0x32f1('0x53')]=_0x2ec9e6['access_token'];_0x254e9d[_0x32f1('0x54')]=_0x2ec9e6[_0x32f1('0x55')];return db[_0x32f1('0x32')][_0x32f1('0x14')]({'data5':_0x254e9d['data5'],'data6':_0x254e9d[_0x32f1('0x54')]},{'where':{'id':_0x254e9d['id']}});})['then'](function(){oauth[_0x32f1('0x56')](_0x254e9d);socket[_0x32f1('0x57')](_0x32f1('0x58'),{'id':_0x467777['id']});return;})[_0x32f1('0x15')](respondWithStatusCode(_0x516119,null))['catch'](function(_0xc78346){if(_0x467777){socket['emit'](_0x32f1('0x59'),{'id':_0x467777['id']});}if(!_0x254e9d){logger[_0x32f1('0x17')](_0x32f1('0x5a'),_0xc78346);return _0x516119['status'](0x1f4)[_0x32f1('0x19')](_0xc78346[_0x32f1('0x5b')]);}logger[_0x32f1('0x17')](_0x32f1('0x5c'),_0x254e9d['id'],_0xc78346);});};
\ No newline at end of file
+var _0x0250=['set','Content-Range','json','then','destroy','error','stack','name','index','CloudProvider','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','service','decryptString','data3','show','params','find','MicrosoftAzure','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','update','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','from','base64','toString','parse','isValidIdToken','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','refresh_token','data6','microsoftAuthorization:success','emit','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','undefined','count','offset','limit'];(function(_0x7642c,_0x2ec4b0){var _0x5412fd=function(_0xffc8e3){while(--_0xffc8e3){_0x7642c['push'](_0x7642c['shift']());}};_0x5412fd(++_0x2ec4b0);}(_0x0250,0x1bf));var _0x0025=function(_0x2f8540,_0x5e8fb9){_0x2f8540=_0x2f8540-0x0;var _0x4bc2f3=_0x0250[_0x2f8540];return _0x4bc2f3;};'use strict';var _=require(_0x0025('0x0'));var Redis=require(_0x0025('0x1'));var qs=require(_0x0025('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x0025('0x3'));var logger=require(_0x0025('0x4'))(_0x0025('0x5'));var db=require(_0x0025('0x6'))['db'];var oauth=require(_0x0025('0x7'));config['redis']=_[_0x0025('0x8')](config[_0x0025('0x9')],{'host':_0x0025('0xa'),'port':0x18eb});var socket=require(_0x0025('0xb'))(new Redis(config[_0x0025('0x9')]));var redis=new Redis(config[_0x0025('0x9')]);function respondWithStatusCode(_0x179645,_0x7f0b12){_0x7f0b12=_0x7f0b12||0xcc;return function(_0x1a5b16){if(_0x1a5b16){return _0x179645[_0x0025('0xc')](_0x7f0b12);}return _0x179645[_0x0025('0xd')](_0x7f0b12)['end']();};}function respondWithResult(_0x4c91b1,_0x19d767){_0x19d767=_0x19d767||0xc8;return function(_0x78227b){if(_0x78227b){return _0x4c91b1[_0x0025('0xd')](_0x19d767)['json'](_0x78227b);}};}function respondWithFilteredResult(_0x230be7,_0x140351){return function(_0x57c12d){if(_0x57c12d){var _0x43bf58=typeof _0x140351['offset']===_0x0025('0xe')&&typeof _0x140351['limit']===_0x0025('0xe');var _0x3d8a43=_0x57c12d[_0x0025('0xf')];var _0x55431d=_0x43bf58?0x0:_0x140351['offset'];var _0x3213f9=_0x43bf58?_0x57c12d[_0x0025('0xf')]:_0x140351[_0x0025('0x10')]+_0x140351[_0x0025('0x11')];var _0x5591c9;if(_0x3213f9>=_0x3d8a43){_0x3213f9=_0x3d8a43;_0x5591c9=0xc8;}else{_0x5591c9=0xce;}_0x230be7['status'](_0x5591c9);return _0x230be7[_0x0025('0x12')](_0x0025('0x13'),_0x55431d+'-'+_0x3213f9+'/'+_0x3d8a43)[_0x0025('0x14')](_0x57c12d);}return null;};}function saveUpdates(_0x28f68a){return function(_0xfef28c){if(_0xfef28c){return _0xfef28c['update'](_0x28f68a)[_0x0025('0x15')](function(_0x334b83){return _0x334b83;});}return null;};}function removeEntity(_0x4b69be){return function(_0x164d7f){if(_0x164d7f){return _0x164d7f[_0x0025('0x16')]()['then'](function(){_0x4b69be['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x502328){return function(_0x1efda1){if(!_0x1efda1){_0x502328[_0x0025('0xc')](0x194);}return _0x1efda1;};}function handleError(_0x2b28ec,_0x4fc25f){_0x4fc25f=_0x4fc25f||0x1f4;return function(_0x122db5){logger[_0x0025('0x17')](_0x122db5[_0x0025('0x18')]);if(_0x122db5[_0x0025('0x19')]){delete _0x122db5[_0x0025('0x19')];}_0x2b28ec[_0x0025('0xd')](_0x4fc25f)['send'](_0x122db5);};}function maskClientSecret(_0x3603c9){return _['padEnd'](_0x3603c9['slice'](0x0,0x3),0x14,'*');}exports[_0x0025('0x1a')]=function(_0x3fa617,_0x4b5759){var _0x4a5871={},_0x553931={},_0x4710aa={'count':0x0,'rows':[]};var _0x1c28e7=_['map'](db[_0x0025('0x1b')][_0x0025('0x1c')],function(_0x566bed){return{'name':_0x566bed[_0x0025('0x1d')],'type':_0x566bed[_0x0025('0x1e')][_0x0025('0x1f')]};});_0x553931[_0x0025('0x20')]=_[_0x0025('0x21')](_0x1c28e7,_0x0025('0x19'));_0x553931[_0x0025('0x22')]=_[_0x0025('0x23')](_0x3fa617[_0x0025('0x22')]);_0x553931[_0x0025('0x24')]=_[_0x0025('0x25')](_0x553931[_0x0025('0x20')],_0x553931[_0x0025('0x22')]);_0x4a5871['attributes']=_[_0x0025('0x25')](_0x553931[_0x0025('0x20')],qs[_0x0025('0x26')](_0x3fa617[_0x0025('0x22')]['fields']));_0x4a5871['attributes']=_0x4a5871[_0x0025('0x27')][_0x0025('0x28')]?_0x4a5871['attributes']:_0x553931[_0x0025('0x20')];if(!_0x3fa617[_0x0025('0x22')][_0x0025('0x29')](_0x0025('0x2a'))){_0x4a5871[_0x0025('0x11')]=qs[_0x0025('0x11')](_0x3fa617[_0x0025('0x22')]['limit']);_0x4a5871['offset']=qs[_0x0025('0x10')](_0x3fa617[_0x0025('0x22')][_0x0025('0x10')]);}_0x4a5871[_0x0025('0x2b')]=qs[_0x0025('0x2c')](_0x3fa617[_0x0025('0x22')][_0x0025('0x2c')]);_0x4a5871[_0x0025('0x2d')]=qs['filters'](_['pick'](_0x3fa617['query'],_0x553931[_0x0025('0x24')]),_0x1c28e7);if(_0x3fa617[_0x0025('0x22')][_0x0025('0x2e')]){_0x4a5871[_0x0025('0x2d')]=_['merge'](_0x4a5871[_0x0025('0x2d')],{'$or':_[_0x0025('0x21')](_0x1c28e7,function(_0x5ea79b){if(_0x5ea79b[_0x0025('0x1e')]!==_0x0025('0x2f')){var _0x4501f2={};_0x4501f2[_0x5ea79b[_0x0025('0x19')]]={'$like':'%'+_0x3fa617[_0x0025('0x22')][_0x0025('0x2e')]+'%'};return _0x4501f2;}})});}_0x4a5871=_[_0x0025('0x30')]({},_0x4a5871,_0x3fa617[_0x0025('0x31')]);var _0x546729={'where':_0x4a5871[_0x0025('0x2d')]};return db[_0x0025('0x1b')][_0x0025('0xf')](_0x546729)['then'](function(_0x57fd4f){_0x4710aa[_0x0025('0xf')]=_0x57fd4f;if(_0x3fa617[_0x0025('0x22')][_0x0025('0x32')]){_0x4a5871[_0x0025('0x33')]=[{'all':!![]}];}return db[_0x0025('0x1b')]['findAll'](_0x4a5871);})[_0x0025('0x15')](function(_0xc2c664){_0x4710aa[_0x0025('0x34')]=_['map'](_0xc2c664,function(_0x6fb111){if(_0x6fb111[_0x0025('0x35')]==='MicrosoftAzure'){var _0x4bd664=encryptor[_0x0025('0x36')](_0x6fb111[_0x0025('0x37')]);_0x6fb111['data3']=maskClientSecret(_0x4bd664);}return _0x6fb111;});return _0x4710aa;})[_0x0025('0x15')](respondWithFilteredResult(_0x4b5759,_0x4a5871))['catch'](handleError(_0x4b5759,null));};exports[_0x0025('0x38')]=function(_0x5102fb,_0x5ab125){var _0x1bd7a6={'raw':!![],'where':{'id':_0x5102fb[_0x0025('0x39')]['id']}},_0x562226={};_0x562226['model']=_[_0x0025('0x23')](db[_0x0025('0x1b')][_0x0025('0x1c')]);_0x562226['query']=_[_0x0025('0x23')](_0x5102fb[_0x0025('0x22')]);_0x562226['filters']=_['intersection'](_0x562226[_0x0025('0x20')],_0x562226[_0x0025('0x22')]);_0x1bd7a6[_0x0025('0x27')]=_[_0x0025('0x25')](_0x562226[_0x0025('0x20')],qs[_0x0025('0x26')](_0x5102fb[_0x0025('0x22')][_0x0025('0x26')]));_0x1bd7a6['attributes']=_0x1bd7a6[_0x0025('0x27')][_0x0025('0x28')]?_0x1bd7a6[_0x0025('0x27')]:_0x562226[_0x0025('0x20')];if(_0x5102fb[_0x0025('0x22')][_0x0025('0x32')]){_0x1bd7a6['include']=[{'all':!![]}];}_0x1bd7a6=_[_0x0025('0x30')]({},_0x1bd7a6,_0x5102fb['options']);return db['CloudProvider'][_0x0025('0x3a')](_0x1bd7a6)[_0x0025('0x15')](handleEntityNotFound(_0x5ab125,null))[_0x0025('0x15')](function(_0x4594b1){if(_0x4594b1[_0x0025('0x35')]===_0x0025('0x3b')){var _0x5e2fb1=encryptor[_0x0025('0x36')](_0x4594b1[_0x0025('0x37')]);_0x4594b1[_0x0025('0x37')]=maskClientSecret(_0x5e2fb1);}return _0x4594b1;})[_0x0025('0x15')](respondWithResult(_0x5ab125,null))[_0x0025('0x3c')](handleError(_0x5ab125,null));};exports[_0x0025('0x3d')]=function(_0x4bd28b,_0x584f57){if(!_0x4bd28b[_0x0025('0x3e')]['name'])throw new Error(_0x0025('0x3f'));if(!_0x4bd28b[_0x0025('0x3e')][_0x0025('0x35')])throw new Error(_0x0025('0x40'));var _0x1a7d7b=db[_0x0025('0x1b')][_0x0025('0x1c')][_0x0025('0x35')][_0x0025('0x41')];if(!_0x1a7d7b[_0x0025('0x42')](_0x4bd28b['body'][_0x0025('0x35')]))throw new Error(_0x0025('0x43')+_0x1a7d7b['join'](',\x20'));if(_0x4bd28b['body'][_0x0025('0x35')]===_0x0025('0x3b')&&_0x4bd28b[_0x0025('0x3e')][_0x0025('0x37')]){_0x4bd28b[_0x0025('0x3e')][_0x0025('0x37')]=encryptor[_0x0025('0x44')](_0x4bd28b[_0x0025('0x3e')][_0x0025('0x37')]);}return db[_0x0025('0x1b')][_0x0025('0x3d')](_0x4bd28b[_0x0025('0x3e')],{})[_0x0025('0x15')](respondWithResult(_0x584f57,0xc9))['catch'](handleError(_0x584f57,null));};exports[_0x0025('0x45')]=function(_0x561dda,_0x433dc7){if(_0x561dda['body']['id']){delete _0x561dda[_0x0025('0x3e')]['id'];}return db[_0x0025('0x1b')][_0x0025('0x3a')]({'where':{'id':_0x561dda[_0x0025('0x39')]['id']}})['then'](handleEntityNotFound(_0x433dc7,null))[_0x0025('0x15')](function(_0x1ebd69){if(_0x1ebd69[_0x0025('0x35')]===_0x0025('0x3b')&&_0x561dda[_0x0025('0x3e')][_0x0025('0x37')]){_0x561dda[_0x0025('0x3e')]['data3']=encryptor[_0x0025('0x44')](_0x561dda[_0x0025('0x3e')][_0x0025('0x37')]);}return _0x1ebd69;})[_0x0025('0x15')](saveUpdates(_0x561dda[_0x0025('0x3e')],null))[_0x0025('0x15')](respondWithResult(_0x433dc7,null))[_0x0025('0x3c')](handleError(_0x433dc7,null));};exports[_0x0025('0x16')]=function(_0x45e1e6,_0x113fea){return db[_0x0025('0x1b')]['find']({'where':{'id':_0x45e1e6[_0x0025('0x39')]['id']}})['then'](handleEntityNotFound(_0x113fea,null))['then'](removeEntity(_0x113fea,null))[_0x0025('0x3c')](handleError(_0x113fea,null));};exports[_0x0025('0x46')]=function(_0xcaeef4,_0x2772a5){return db['CloudProvider'][_0x0025('0x47')]({'where':{'id':_0xcaeef4['params']['id']},'raw':!![]})['then'](function(_0x375380){if(!_0x375380)return _0x2772a5[_0x0025('0xc')](0x194);return{'url':oauth[_0x0025('0x48')](_0x375380,_0xcaeef4[_0x0025('0x49')]['id'])};})['then'](respondWithResult(_0x2772a5,null))[_0x0025('0x3c')](handleError(_0x2772a5,null));};exports[_0x0025('0x4a')]=function(_0x326222,_0x24eb4f){var _0x14b60c=_0x326222[_0x0025('0x3e')];var _0x2a7c83;var _0x139829;if(_0x14b60c[_0x0025('0x17')])throw _0x14b60c;redis['get'](_0x14b60c[_0x0025('0x4b')])[_0x0025('0x15')](function(_0x444e38){if(!_0x444e38)throw new Error('Invalid\x20state\x20parameter');_0x2a7c83=JSON['parse'](_0x444e38);var _0x33655d=Buffer[_0x0025('0x4c')](_0x14b60c[_0x0025('0x4b')],_0x0025('0x4d'))[_0x0025('0x4e')]('ascii');_0x139829=JSON[_0x0025('0x4f')](_0x33655d);if(!oauth[_0x0025('0x50')](_0x14b60c['id_token'],_0x2a7c83[_0x0025('0x51')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x14b60c[_0x0025('0x4b')]);return oauth[_0x0025('0x52')](_0x14b60c[_0x0025('0x53')],_0x2a7c83);})['then'](function(_0x102c22){_0x2a7c83[_0x0025('0x54')]=_0x102c22['access_token'];_0x2a7c83['data6']=_0x102c22[_0x0025('0x55')];return db[_0x0025('0x1b')][_0x0025('0x45')]({'data5':_0x2a7c83[_0x0025('0x54')],'data6':_0x2a7c83[_0x0025('0x56')]},{'where':{'id':_0x2a7c83['id']}});})[_0x0025('0x15')](function(){oauth['startRefreshInterval'](_0x2a7c83);socket['emit'](_0x0025('0x57'),{'id':_0x139829['id']});return;})['then'](respondWithStatusCode(_0x24eb4f,null))['catch'](function(_0x52426f){if(_0x139829){socket[_0x0025('0x58')]('microsoftAuthorization:error',{'id':_0x139829['id']});}if(!_0x2a7c83){logger[_0x0025('0x17')](_0x0025('0x59'),_0x52426f);return _0x24eb4f[_0x0025('0xd')](0x1f4)[_0x0025('0x5a')](_0x52426f[_0x0025('0x5b')]);}logger[_0x0025('0x17')](_0x0025('0x5c'),_0x2a7c83['id'],_0x52426f);});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 2e3cdcf..3d78596 100644
--- a/server/api/cloudProvider/cloudProvider.model.js
+++ b/server/api/cloudProvider/cloudProvider.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb836=['path','rimraf','../../config/environment','exports','CloudProvider','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3bd751,_0x1e89f7){var _0x2c4eb4=function(_0x506f73){while(--_0x506f73){_0x3bd751['push'](_0x3bd751['shift']());}};_0x2c4eb4(++_0x1e89f7);}(_0xb836,0xb5));var _0x6b83=function(_0x590661,_0x4608f1){_0x590661=_0x590661-0x0;var _0x46efb8=_0xb836[_0x590661];return _0x46efb8;};'use strict';var _=require('lodash');var util=require(_0x6b83('0x0'));var logger=require(_0x6b83('0x1'))(_0x6b83('0x2'));var moment=require(_0x6b83('0x3'));var BPromise=require(_0x6b83('0x4'));var rp=require(_0x6b83('0x5'));var fs=require('fs');var path=require(_0x6b83('0x6'));var rimraf=require(_0x6b83('0x7'));var config=require(_0x6b83('0x8'));var attributes=require('./cloudProvider.attributes');module[_0x6b83('0x9')]=function(_0xcb5385,_0x2682d2){return _0xcb5385['define'](_0x6b83('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x137d=['request-promise','../../config/environment','./cloudProvider.attributes','exports','define','lodash','util','../../config/logger','api','bluebird'];(function(_0x3df186,_0x12592c){var _0x5440fc=function(_0x2a7a70){while(--_0x2a7a70){_0x3df186['push'](_0x3df186['shift']());}};_0x5440fc(++_0x12592c);}(_0x137d,0x73));var _0xd137=function(_0x546895,_0xb414da){_0x546895=_0x546895-0x0;var _0x3b5a09=_0x137d[_0x546895];return _0x3b5a09;};'use strict';var _=require(_0xd137('0x0'));var util=require(_0xd137('0x1'));var logger=require(_0xd137('0x2'))(_0xd137('0x3'));var moment=require('moment');var BPromise=require(_0xd137('0x4'));var rp=require(_0xd137('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd137('0x6'));var attributes=require(_0xd137('0x7'));module[_0xd137('0x8')]=function(_0x573141,_0x109c67){return _0x573141[_0xd137('0x9')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index fe6d177..bd14256 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdd14=['key','value','oauth2Claims','set','stringify','payload','issuer','aud','audience','isAfter','unix','exp','resolve','then','data6','findOne','refresh_token','access_token','CloudProvider','data5','authorization_code','data3','intervals','bind','findAll','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','jsonwebtoken','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','type','data7','/.default','join','Dynamics365','replace','{TENANT_ID}','data2','code','id_token','from','toString','base64','randomBytes','hex','client_id','data1','data4','form_post','nonce','prompt','login','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd14,0xec));var _0x4dd1=function(_0x4cb801,_0x10e577){_0x4cb801=_0x4cb801-0x0;var _0x5ad676=_0xdd14[_0x4cb801];return _0x5ad676;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0x4dd1('0x0'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0x4dd1('0x1'));var util=require(_0x4dd1('0x2'));var config=require(_0x4dd1('0x3'));var logger=require(_0x4dd1('0x4'))(_0x4dd1('0x5'));var schedule=require(_0x4dd1('0x6'));var db=require(_0x4dd1('0x7'))['db'];config['redis']=_[_0x4dd1('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x4dd1('0x9')]);var MICROSOFT_AUTH_URL=_0x4dd1('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x4dd1('0xb'),'profile',_0x4dd1('0xc'),_0x4dd1('0xd'),_0x4dd1('0xe'),_0x4dd1('0xf'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x4dd1('0xb'),_0x4dd1('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0x4dd1('0x10');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4e46fa){var _0x225d0a=_['map'](AZURE_AUTH_SCOPES[_0x4e46fa[_0x4dd1('0x11')]]);if(_0x4e46fa['type']==='Dynamics365')_0x225d0a['push'](_0x4e46fa[_0x4dd1('0x12')]+_0x4dd1('0x13'));return _0x225d0a[_0x4dd1('0x14')]('\x20');}function getAccessTokenScope(_0x72b4e9){if(_0x72b4e9[_0x4dd1('0x11')]==='Outlook365')return _0x4dd1('0xe');if(_0x72b4e9[_0x4dd1('0x11')]===_0x4dd1('0x15'))return _0x72b4e9['data7']+_0x4dd1('0x13');}function generateMicrosoftAuthorizationUrl(_0x4487ca,_0x247c98){var _0x3e0a3b=MICROSOFT_AUTH_URL[_0x4dd1('0x16')](_0x4dd1('0x17'),_0x4487ca[_0x4dd1('0x18')]);var _0x2ab58c=[_0x4dd1('0x19'),_0x4dd1('0x1a')];var _0x328c29=Buffer[_0x4dd1('0x1b')](JSON['stringify']({'id':_0x247c98}))[_0x4dd1('0x1c')](_0x4dd1('0x1d'));var _0x4bf989=crypto[_0x4dd1('0x1e')](0x10)['toString'](_0x4dd1('0x1f'));var _0x377eb4=getAuthorizationScopes(_0x4487ca);var _0x4e6f21=[{'key':_0x4dd1('0x20'),'value':_0x4487ca[_0x4dd1('0x21')]},{'key':'response_type','value':encodeURIComponent(_0x2ab58c[_0x4dd1('0x14')]('\x20'))},{'key':'redirect_uri','value':_0x4487ca[_0x4dd1('0x22')]},{'key':'response_mode','value':_0x4dd1('0x23')},{'key':'scope','value':encodeURIComponent(_0x377eb4)},{'key':'state','value':_0x328c29},{'key':_0x4dd1('0x24'),'value':_0x4bf989},{'key':_0x4dd1('0x25'),'value':_0x4dd1('0x26')}];var _0xd8b01c=_0x3e0a3b+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x4dd1('0x27')](_0x4e6f21,function(_0x8f45fc){return _0x8f45fc[_0x4dd1('0x28')]+'='+_0x8f45fc[_0x4dd1('0x29')];})[_0x4dd1('0x14')]('&');_0x4487ca[_0x4dd1('0x2a')]={'issuer':_0x3e0a3b['replace']('oauth2/',''),'audience':_0x4487ca['data1'],'state':_0x328c29,'nonce':_0x4bf989};redis[_0x4dd1('0x2b')](_0x328c29,JSON[_0x4dd1('0x2c')](_0x4487ca));return _0xd8b01c;}function isValidIdToken(_0xe79a92,_0x5f1056){try{var _0x251d2c=jwt['decode'](_0xe79a92,{'complete':!![]});var _0x6f4ad5=_0x251d2c[_0x4dd1('0x2d')];if(_0x6f4ad5['iss']!==_0x5f1056[_0x4dd1('0x2e')])return![];if(_0x6f4ad5[_0x4dd1('0x2f')]!==_0x5f1056[_0x4dd1('0x30')])return![];if(_0x6f4ad5['nonce']!==_0x5f1056['nonce'])return![];if(moment()[_0x4dd1('0x31')](moment[_0x4dd1('0x32')](_0x6f4ad5[_0x4dd1('0x33')])))return![];return!![];}catch(_0x398353){throw _0x398353;}}function refreshOauth2MicrosoftAccessToken(_0x94e0b0){return Promise[_0x4dd1('0x34')]()[_0x4dd1('0x35')](function(){if(_0x94e0b0[_0x4dd1('0x36')])return _0x94e0b0;return db['CloudProvider'][_0x4dd1('0x37')]({'where':{'id':_0x94e0b0['id']},'raw':!![]});})[_0x4dd1('0x35')](function(_0x19aba7){var _0x2d6e50={'grant_type':_0x4dd1('0x38'),'refresh_token':_0x19aba7['data6'],'scope':getAccessTokenScope(_0x19aba7),'redirect_uri':_0x19aba7[_0x4dd1('0x22')],'client_id':_0x19aba7[_0x4dd1('0x21')],'client_secret':_0x19aba7['data3']};var _0x43108c={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x4dd1('0x17'),_0x19aba7[_0x4dd1('0x18')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2d6e50,'json':!![]};return rp(_0x43108c);})['then'](function(_0x37c098){_0x94e0b0['data5']=_0x37c098[_0x4dd1('0x39')];_0x94e0b0[_0x4dd1('0x36')]=_0x37c098[_0x4dd1('0x38')];return db[_0x4dd1('0x3a')]['update']({'data5':_0x94e0b0[_0x4dd1('0x3b')],'data6':_0x94e0b0[_0x4dd1('0x36')]},{'where':{'id':_0x94e0b0['id']}});})[_0x4dd1('0x35')](function(){return _0x94e0b0;})['catch'](function(_0x1cb14a){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s',_0x94e0b0['id'],_0x1cb14a);});}function getOauth2MicrosoftAccessToken(_0x2b9af7,_0x5337ed){var _0x542ca5={'grant_type':_0x4dd1('0x3c'),'code':_0x2b9af7,'scope':getAccessTokenScope(_0x5337ed),'redirect_uri':_0x5337ed[_0x4dd1('0x22')],'client_id':_0x5337ed['data1'],'client_secret':_0x5337ed[_0x4dd1('0x3d')]};var _0x2da528={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x4dd1('0x16')]('{TENANT_ID}',_0x5337ed['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x542ca5,'json':!![]};return rp(_0x2da528);}function startRefreshInterval(_0x7a799){var _0x4c92a0=schedule[_0x4dd1('0x3e')];if(_0x4c92a0[_0x7a799['id']])clearInterval(_0x4c92a0[_0x7a799['id']]);_0x4c92a0[_0x7a799['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x4dd1('0x3f')](this,{'id':_0x7a799['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x4dd1('0x3e')]=_0x4c92a0;}function startAllRefreshIntervals(){return db[_0x4dd1('0x3a')][_0x4dd1('0x40')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x4dd1('0x35')](function(_0x1c07de){var _0x2afeaf=_0x1c07de[_0x4dd1('0x27')](function(_0x5039ed){return refreshOauth2MicrosoftAccessToken(_0x5039ed)[_0x4dd1('0x35')](function(_0x6a1ef4){startRefreshInterval(_0x6a1ef4);});});return Promise[_0x4dd1('0x41')](_0x2afeaf);})['catch'](function(_0x1cdc16){var _0x4044b6=_0x1cdc16?util['inspect'](_0x1cdc16,{'showHidden':![],'depth':null}):'';logger[_0x4dd1('0x42')](_0x4dd1('0x43'),_0x4044b6);});}module[_0x4dd1('0x44')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xc817=['toString','base64','randomBytes','hex','client_id','data1','redirect_uri','data4','response_mode','scope','state','login','key','oauth2Claims','set','iss','aud','audience','nonce','isAfter','unix','then','data6','CloudProvider','findOne','refresh_token','data3','POST','data2','data5','access_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','decryptString','intervals','bind','findAll','all','inspect','exports','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','code','id_token','stringify'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0xc817,0x75));var _0x7c81=function(_0x4b0b47,_0x25b713){_0x4b0b47=_0x4b0b47-0x0;var _0x371616=_0xc817[_0x4b0b47];return _0x371616;};'use strict';var _=require(_0x7c81('0x0'));var crypto=require(_0x7c81('0x1'));var jwt=require(_0x7c81('0x2'));var moment=require(_0x7c81('0x3'));var Redis=require('ioredis');var rp=require(_0x7c81('0x4'));var util=require(_0x7c81('0x5'));var encryptor=require(_0x7c81('0x6'));var config=require(_0x7c81('0x7'));var logger=require(_0x7c81('0x8'))(_0x7c81('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x7c81('0xa'))['db'];config[_0x7c81('0xb')]=_['defaults'](config[_0x7c81('0xb')],{'host':_0x7c81('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x7c81('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x7c81('0xe'),_0x7c81('0xf'),_0x7c81('0x10'),_0x7c81('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x7c81('0x12'),_0x7c81('0x13')],'Dynamics365':[_0x7c81('0xe'),_0x7c81('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x7c81('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x7c81('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1f8f50){var _0x17f3ad=_[_0x7c81('0x16')](AZURE_AUTH_SCOPES[_0x1f8f50[_0x7c81('0x17')]]);if(_0x1f8f50[_0x7c81('0x17')]===_0x7c81('0x18'))_0x17f3ad[_0x7c81('0x19')](_0x1f8f50[_0x7c81('0x1a')]+_0x7c81('0x1b'));return _0x17f3ad[_0x7c81('0x1c')]('\x20');}function getAccessTokenScope(_0x9362c4){if(_0x9362c4[_0x7c81('0x17')]===_0x7c81('0x1d'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x9362c4[_0x7c81('0x17')]===_0x7c81('0x18'))return _0x9362c4[_0x7c81('0x1a')]+_0x7c81('0x1b');}function generateMicrosoftAuthorizationUrl(_0x3b36c9,_0x11e06f){var _0x46a745=MICROSOFT_AUTH_URL[_0x7c81('0x1e')](_0x7c81('0x1f'),_0x3b36c9['data2']);var _0x14cce5=[_0x7c81('0x20'),_0x7c81('0x21')];var _0x182a2e=Buffer['from'](JSON[_0x7c81('0x22')]({'id':_0x11e06f}))[_0x7c81('0x23')](_0x7c81('0x24'));var _0x2c15fd=crypto[_0x7c81('0x25')](0x10)['toString'](_0x7c81('0x26'));var _0x1a9cee=getAuthorizationScopes(_0x3b36c9);var _0x15fecb=[{'key':_0x7c81('0x27'),'value':_0x3b36c9[_0x7c81('0x28')]},{'key':'response_type','value':encodeURIComponent(_0x14cce5[_0x7c81('0x1c')]('\x20'))},{'key':_0x7c81('0x29'),'value':_0x3b36c9[_0x7c81('0x2a')]},{'key':_0x7c81('0x2b'),'value':'form_post'},{'key':_0x7c81('0x2c'),'value':encodeURIComponent(_0x1a9cee)},{'key':_0x7c81('0x2d'),'value':_0x182a2e},{'key':'nonce','value':_0x2c15fd},{'key':'prompt','value':_0x7c81('0x2e')}];var _0x4d64f6=_0x46a745+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x15fecb,function(_0x587614){return _0x587614[_0x7c81('0x2f')]+'='+_0x587614['value'];})[_0x7c81('0x1c')]('&');_0x3b36c9[_0x7c81('0x30')]={'issuer':_0x46a745[_0x7c81('0x1e')]('oauth2/',''),'audience':_0x3b36c9[_0x7c81('0x28')],'state':_0x182a2e,'nonce':_0x2c15fd};redis[_0x7c81('0x31')](_0x182a2e,JSON[_0x7c81('0x22')](_0x3b36c9));return _0x4d64f6;}function isValidIdToken(_0x26e2bc,_0x1645bf){try{var _0x4131b6=jwt['decode'](_0x26e2bc,{'complete':!![]});var _0x2e6024=_0x4131b6['payload'];if(_0x2e6024[_0x7c81('0x32')]!==_0x1645bf['issuer'])return![];if(_0x2e6024[_0x7c81('0x33')]!==_0x1645bf[_0x7c81('0x34')])return![];if(_0x2e6024[_0x7c81('0x35')]!==_0x1645bf['nonce'])return![];if(moment()[_0x7c81('0x36')](moment[_0x7c81('0x37')](_0x2e6024['exp'])))return![];return!![];}catch(_0x1dba1d){throw _0x1dba1d;}}function refreshOauth2MicrosoftAccessToken(_0x50f6fb){return Promise['resolve']()[_0x7c81('0x38')](function(){if(_0x50f6fb[_0x7c81('0x39')])return _0x50f6fb;return db[_0x7c81('0x3a')][_0x7c81('0x3b')]({'where':{'id':_0x50f6fb['id']},'raw':!![]});})[_0x7c81('0x38')](function(_0x27d86f){var _0x46e553={'grant_type':_0x7c81('0x3c'),'refresh_token':_0x27d86f['data6'],'scope':getAccessTokenScope(_0x27d86f),'redirect_uri':_0x27d86f[_0x7c81('0x2a')],'client_id':_0x27d86f[_0x7c81('0x28')],'client_secret':encryptor['decryptString'](_0x27d86f[_0x7c81('0x3d')])};var _0xde4bdd={'method':_0x7c81('0x3e'),'uri':MICROSOFT_AUTH_URL['replace'](_0x7c81('0x1f'),_0x27d86f[_0x7c81('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x46e553,'json':!![]};return rp(_0xde4bdd);})[_0x7c81('0x38')](function(_0x34ae2e){_0x50f6fb[_0x7c81('0x40')]=_0x34ae2e[_0x7c81('0x41')];_0x50f6fb[_0x7c81('0x39')]=_0x34ae2e[_0x7c81('0x3c')];return db[_0x7c81('0x3a')][_0x7c81('0x42')]({'data5':_0x50f6fb[_0x7c81('0x40')],'data6':_0x50f6fb[_0x7c81('0x39')]},{'where':{'id':_0x50f6fb['id']}});})[_0x7c81('0x38')](function(){return _0x50f6fb;})['catch'](function(_0x33717e){logger[_0x7c81('0x43')](_0x7c81('0x44'),_0x50f6fb['id'],_0x33717e);});}function getOauth2MicrosoftAccessToken(_0x30e121,_0xc4ec93){var _0x4f5599={'grant_type':'authorization_code','code':_0x30e121,'scope':getAccessTokenScope(_0xc4ec93),'redirect_uri':_0xc4ec93[_0x7c81('0x2a')],'client_id':_0xc4ec93[_0x7c81('0x28')],'client_secret':encryptor[_0x7c81('0x45')](_0xc4ec93[_0x7c81('0x3d')])};var _0x8586f5={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x7c81('0x1e')](_0x7c81('0x1f'),_0xc4ec93[_0x7c81('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4f5599,'json':!![]};return rp(_0x8586f5);}function startRefreshInterval(_0x5b2d87){var _0x2266a4=schedule[_0x7c81('0x46')];if(_0x2266a4[_0x5b2d87['id']])clearInterval(_0x2266a4[_0x5b2d87['id']]);_0x2266a4[_0x5b2d87['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7c81('0x47')](this,{'id':_0x5b2d87['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x2266a4;}function startAllRefreshIntervals(){return db[_0x7c81('0x3a')][_0x7c81('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x63f22c){var _0x1b27da=_0x63f22c[_0x7c81('0x16')](function(_0x12873b){return refreshOauth2MicrosoftAccessToken(_0x12873b)['then'](function(_0x21af47){startRefreshInterval(_0x21af47);});});return Promise[_0x7c81('0x49')](_0x1b27da);})['catch'](function(_0x1a10ee){var _0x2cd932=_0x1a10ee?util[_0x7c81('0x4a')](_0x1a10ee,{'showHidden':![],'depth':null}):'';logger['error']('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart',_0x2cd932);});}module[_0x7c81('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 873208e..5ca9add 100644
--- a/server/api/cloudProvider/cloudProvider.rpc.js
+++ b/server/api/cloudProvider/cloudProvider.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1c63=['error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x285824,_0x3da647){var _0x311d7e=function(_0x2f3de0){while(--_0x2f3de0){_0x285824['push'](_0x285824['shift']());}};_0x311d7e(++_0x3da647);}(_0x1c63,0xdc));var _0x31c6=function(_0x10d405,_0x28d136){_0x10d405=_0x10d405-0x0;var _0x12bd98=_0x1c63[_0x10d405];return _0x12bd98;};'use strict';var _=require(_0x31c6('0x0'));var util=require(_0x31c6('0x1'));var moment=require(_0x31c6('0x2'));var BPromise=require(_0x31c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31c6('0x4'));var db=require(_0x31c6('0x5'))['db'];var utils=require(_0x31c6('0x6'));var logger=require('../../config/logger')(_0x31c6('0x7'));var config=require(_0x31c6('0x8'));var jayson=require(_0x31c6('0x9'));var client=jayson[_0x31c6('0xa')][_0x31c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ac1b7,_0x560053,_0x30185e){return new BPromise(function(_0x184d7d,_0x37cc89){return client[_0x31c6('0xc')](_0x4ac1b7,_0x30185e)[_0x31c6('0xd')](function(_0x487e6e){logger[_0x31c6('0xe')](_0x31c6('0xf'),_0x560053,_0x31c6('0x10'));logger[_0x31c6('0x11')](_0x31c6('0x12'),_0x560053,'request\x20sent',JSON[_0x31c6('0x13')](_0x487e6e));if(_0x487e6e['error']){if(_0x487e6e[_0x31c6('0x14')][_0x31c6('0x15')]===0x1f4){logger['error'](_0x31c6('0xf'),_0x560053,_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);return _0x37cc89(_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);}logger[_0x31c6('0x14')]('CloudProvider,\x20%s,\x20%s',_0x560053,_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);return _0x184d7d(_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);}else{logger[_0x31c6('0xe')]('CloudProvider,\x20%s,\x20%s',_0x560053,'request\x20sent');_0x184d7d(_0x487e6e['result']['message']);}})[_0x31c6('0x17')](function(_0x512d53){logger[_0x31c6('0x14')](_0x31c6('0xf'),_0x560053,_0x512d53);_0x37cc89(_0x512d53);});});}
\ No newline at end of file
+var _0xaa56=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1bb7cd,_0x2706f8){var _0x52c493=function(_0xad581b){while(--_0xad581b){_0x1bb7cd['push'](_0x1bb7cd['shift']());}};_0x52c493(++_0x2706f8);}(_0xaa56,0xc6));var _0x6aa5=function(_0x337939,_0x42513b){_0x337939=_0x337939-0x0;var _0x5bcbc1=_0xaa56[_0x337939];return _0x5bcbc1;};'use strict';var _=require('lodash');var util=require(_0x6aa5('0x0'));var moment=require(_0x6aa5('0x1'));var BPromise=require(_0x6aa5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6aa5('0x3'));var db=require(_0x6aa5('0x4'))['db'];var utils=require(_0x6aa5('0x5'));var logger=require(_0x6aa5('0x6'))(_0x6aa5('0x7'));var config=require('../../config/environment');var jayson=require(_0x6aa5('0x8'));var client=jayson['client'][_0x6aa5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20f6ba,_0x5764dc,_0x26fbf5){return new BPromise(function(_0x35dbbc,_0x3a77bb){return client[_0x6aa5('0xa')](_0x20f6ba,_0x26fbf5)[_0x6aa5('0xb')](function(_0x3d50a0){logger[_0x6aa5('0xc')](_0x6aa5('0xd'),_0x5764dc,_0x6aa5('0xe'));logger[_0x6aa5('0xf')](_0x6aa5('0x10'),_0x5764dc,_0x6aa5('0xe'),JSON[_0x6aa5('0x11')](_0x3d50a0));if(_0x3d50a0[_0x6aa5('0x12')]){if(_0x3d50a0['error'][_0x6aa5('0x13')]===0x1f4){logger[_0x6aa5('0x12')](_0x6aa5('0xd'),_0x5764dc,_0x3d50a0[_0x6aa5('0x12')]['message']);return _0x3a77bb(_0x3d50a0['error']['message']);}logger[_0x6aa5('0x12')](_0x6aa5('0xd'),_0x5764dc,_0x3d50a0[_0x6aa5('0x12')]['message']);return _0x35dbbc(_0x3d50a0[_0x6aa5('0x12')][_0x6aa5('0x14')]);}else{logger['info'](_0x6aa5('0xd'),_0x5764dc,_0x6aa5('0xe'));_0x35dbbc(_0x3d50a0[_0x6aa5('0x15')][_0x6aa5('0x14')]);}})['catch'](function(_0x5e5951){logger[_0x6aa5('0x12')]('CloudProvider,\x20%s,\x20%s',_0x5764dc,_0x5e5951);_0x3a77bb(_0x5e5951);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 8f6f383..64d60df 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x32b0de,_0x36ef41){var _0x40553d=function(_0x34091c){while(--_0x34091c){_0x32b0de['push'](_0x32b0de['shift']());}};_0x40553d(++_0x36ef41);}(_0xdb28,0x106));var _0x8db2=function(_0x211693,_0x4790f5){_0x211693=_0x211693-0x0;var _0x5e7603=_0xdb28[_0x211693];return _0x5e7603;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x2784b4,_0x444971){var _0x3390c0=function(_0x176372){while(--_0x176372){_0x2784b4['push'](_0x2784b4['shift']());}};_0x3390c0(++_0x444971);}(_0x2ef3,0xba));var _0x32ef=function(_0x2c850b,_0x38f84a){_0x2c850b=_0x2c850b-0x0;var _0x10fa82=_0x2ef3[_0x2c850b];return _0x10fa82;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 43a9caa..41ce49c 100644
--- a/server/api/cmCompany/cmCompany.attributes.js
+++ b/server/api/cmCompany/cmCompany.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb82a=['STRING','name','sequelize','exports'];(function(_0x23839b,_0x54349c){var _0xa88c41=function(_0x296045){while(--_0x296045){_0x23839b['push'](_0x23839b['shift']());}};_0xa88c41(++_0x54349c);}(_0xb82a,0x82));var _0xab82=function(_0xd8def1,_0x422c53){_0xd8def1=_0xd8def1-0x0;var _0x313c3b=_0xb82a[_0xd8def1];return _0x313c3b;};'use strict';var Sequelize=require(_0xab82('0x0'));module[_0xab82('0x1')]={'name':{'type':Sequelize[_0xab82('0x2')],'unique':_0xab82('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xab82('0x2')]},'phone':{'type':Sequelize[_0xab82('0x2')]},'fax':{'type':Sequelize[_0xab82('0x2')]},'type':{'type':Sequelize[_0xab82('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xab82('0x2')]},'city':{'type':Sequelize[_0xab82('0x2')]},'country':{'type':Sequelize[_0xab82('0x2')]},'email':{'type':Sequelize[_0xab82('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xab82('0x2')]},'sStreet':{'type':Sequelize[_0xab82('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xab82('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa4f9=['exports','name','STRING','sequelize'];(function(_0x366388,_0x4595a6){var _0x41c97e=function(_0x4b9fff){while(--_0x4b9fff){_0x366388['push'](_0x366388['shift']());}};_0x41c97e(++_0x4595a6);}(_0xa4f9,0x1cf));var _0x9a4f=function(_0x509e75,_0x36f68e){_0x509e75=_0x509e75-0x0;var _0x368c1b=_0xa4f9[_0x509e75];return _0x368c1b;};'use strict';var Sequelize=require(_0x9a4f('0x0'));module[_0x9a4f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9a4f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9a4f('0x3')]},'companyId':{'type':Sequelize[_0x9a4f('0x3')]},'website':{'type':Sequelize[_0x9a4f('0x3')]},'phone':{'type':Sequelize[_0x9a4f('0x3')]},'fax':{'type':Sequelize[_0x9a4f('0x3')]},'type':{'type':Sequelize[_0x9a4f('0x3')]},'street':{'type':Sequelize[_0x9a4f('0x3')]},'postalCode':{'type':Sequelize[_0x9a4f('0x3')]},'city':{'type':Sequelize[_0x9a4f('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9a4f('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9a4f('0x3')]},'sStreet':{'type':Sequelize[_0x9a4f('0x3')]},'sPostalCode':{'type':Sequelize[_0x9a4f('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x9a4f('0x3')]},'description':{'type':Sequelize[_0x9a4f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index e83d289..af45544 100644
--- a/server/api/cmCompany/cmCompany.controller.js
+++ b/server/api/cmCompany/cmCompany.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x069b=['path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','get','Companies','end','error','stack','name','CmCompany','describe','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','zip-dir','request-promise','moment','mustache','util'];(function(_0xd48d4f,_0x217178){var _0x59d47b=function(_0x4780b1){while(--_0x4780b1){_0xd48d4f['push'](_0xd48d4f['shift']());}};_0x59d47b(++_0x217178);}(_0x069b,0xf9));var _0xb069=function(_0x24bc0c,_0x57243d){_0x24bc0c=_0x24bc0c-0x0;var _0x363ea1=_0x069b[_0x24bc0c];return _0x363ea1;};'use strict';var emlformat=require(_0xb069('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb069('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb069('0x2'));var moment=require(_0xb069('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb069('0x4'));var util=require(_0xb069('0x5'));var path=require(_0xb069('0x6'));var sox=require(_0xb069('0x7'));var csv=require(_0xb069('0x8'));var ejs=require(_0xb069('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb069('0xa'));var squel=require(_0xb069('0xb'));var crypto=require(_0xb069('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb069('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb069('0xe'));var Papa=require(_0xb069('0xf'));var Redis=require(_0xb069('0x10'));var authService=require(_0xb069('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb069('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb069('0x13'))(_0xb069('0x14'));var utils=require(_0xb069('0x15'));var config=require(_0xb069('0x16'));var licenseUtil=require(_0xb069('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7a345e,_0x2480c1){_0x2480c1=_0x2480c1||0xcc;return function(_0x4691bf){if(_0x4691bf){return _0x7a345e[_0xb069('0x18')](_0x2480c1);}return _0x7a345e['status'](_0x2480c1)['end']();};}function respondWithResult(_0x45d74a,_0x54a4dc){_0x54a4dc=_0x54a4dc||0xc8;return function(_0x55d799){if(_0x55d799){return _0x45d74a[_0xb069('0x19')](_0x54a4dc)[_0xb069('0x1a')](_0x55d799);}};}function respondWithFilteredResult(_0x10a3b6,_0x469422){return function(_0x468a88){if(_0x468a88){var _0x410258=typeof _0x469422[_0xb069('0x1b')]==='undefined'&&typeof _0x469422[_0xb069('0x1c')]===_0xb069('0x1d');var _0x1111d6=_0x468a88['count'];var _0x536b58=_0x410258?0x0:_0x469422['offset'];var _0x3656a9=_0x410258?_0x468a88[_0xb069('0x1e')]:_0x469422[_0xb069('0x1b')]+_0x469422[_0xb069('0x1c')];var _0x2254d7;if(_0x3656a9>=_0x1111d6){_0x3656a9=_0x1111d6;_0x2254d7=0xc8;}else{_0x2254d7=0xce;}_0x10a3b6['status'](_0x2254d7);return _0x10a3b6[_0xb069('0x1f')](_0xb069('0x20'),_0x536b58+'-'+_0x3656a9+'/'+_0x1111d6)[_0xb069('0x1a')](_0x468a88);}return null;};}function patchUpdates(_0x4a3f36){return function(_0x1a5b19){try{jsonpatch[_0xb069('0x21')](_0x1a5b19,_0x4a3f36,!![]);}catch(_0x4cf7c0){return BPromise['reject'](_0x4cf7c0);}return _0x1a5b19['save']();};}function saveUpdates(_0xa996e1,_0x388949){return function(_0x4b6c2e){if(_0x4b6c2e){return _0x4b6c2e[_0xb069('0x22')](_0xa996e1)[_0xb069('0x23')](function(_0x6fa42f){return _0x6fa42f;});}return null;};}function removeEntity(_0x3c3d93,_0x43c8b1){return function(_0x398c69){if(_0x398c69){return _0x398c69[_0xb069('0x24')]()['then'](function(){var _0x3dc845=_0x398c69[_0xb069('0x25')]({'plain':!![]});var _0x56f4da=_0xb069('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x56f4da,'resourceId':_0x3dc845['id']}})[_0xb069('0x23')](function(){return _0x398c69;});})[_0xb069('0x23')](function(){_0x3c3d93[_0xb069('0x19')](0xcc)[_0xb069('0x27')]();});}};}function handleEntityNotFound(_0x5dc713,_0x3384b9){return function(_0x55ae0c){if(!_0x55ae0c){_0x5dc713[_0xb069('0x18')](0x194);}return _0x55ae0c;};}function handleError(_0x49af7a,_0x543678){_0x543678=_0x543678||0x1f4;return function(_0x2a263d){logger[_0xb069('0x28')](_0x2a263d[_0xb069('0x29')]);if(_0x2a263d[_0xb069('0x2a')]){delete _0x2a263d[_0xb069('0x2a')];}_0x49af7a[_0xb069('0x19')](_0x543678)['send'](_0x2a263d);};}exports['index']=function(_0x5a1465,_0x17b7b6){var _0x1057b3={},_0x5cb52a={},_0x26324d={'count':0x0,'rows':[]};return db[_0xb069('0x2b')][_0xb069('0x2c')]()['then'](function(_0x23c453){_0x5cb52a['model']=_[_0xb069('0x2d')](_0x23c453);_0x5cb52a[_0xb069('0x2e')]=_[_0xb069('0x2d')](_0x5a1465[_0xb069('0x2e')]);_0x5cb52a[_0xb069('0x2f')]=_['intersection'](_0x5cb52a[_0xb069('0x30')],_0x5cb52a[_0xb069('0x2e')]);_0x1057b3[_0xb069('0x31')]=_[_0xb069('0x32')](_0x5cb52a['model'],qs['fields'](_0x5a1465[_0xb069('0x2e')][_0xb069('0x33')]));_0x1057b3['attributes']=_0x1057b3['attributes'][_0xb069('0x34')]?_0x1057b3[_0xb069('0x31')]:_0x5cb52a[_0xb069('0x30')];if(!_0x5a1465[_0xb069('0x2e')][_0xb069('0x35')](_0xb069('0x36'))){_0x1057b3['limit']=qs['limit'](_0x5a1465[_0xb069('0x2e')][_0xb069('0x1c')]);_0x1057b3[_0xb069('0x1b')]=qs[_0xb069('0x1b')](_0x5a1465[_0xb069('0x2e')][_0xb069('0x1b')]);}_0x1057b3[_0xb069('0x37')]=qs[_0xb069('0x38')](_0x5a1465[_0xb069('0x2e')][_0xb069('0x38')]);_0x1057b3[_0xb069('0x39')]=qs[_0xb069('0x2f')](_[_0xb069('0x3a')](_0x5a1465[_0xb069('0x2e')],_0x5cb52a[_0xb069('0x2f')]),_0x23c453);if(_0x5a1465[_0xb069('0x2e')][_0xb069('0x3b')]){_0x1057b3['where']=_[_0xb069('0x3c')](_0x1057b3[_0xb069('0x39')],{'$or':_[_0xb069('0x3d')](_0x1057b3[_0xb069('0x31')],function(_0x5c0e67){var _0x41d0b6={};_0x41d0b6[_0x5c0e67]={'$like':'%'+_0x5a1465[_0xb069('0x2e')][_0xb069('0x3b')]+'%'};return _0x41d0b6;})});}_0x1057b3=_['merge']({},_0x1057b3,_0x5a1465[_0xb069('0x3e')]);var _0xe3634d={'where':_0x1057b3['where']};return db[_0xb069('0x2b')][_0xb069('0x1e')](_0xe3634d)[_0xb069('0x23')](function(_0x40bfb0){_0x26324d['count']=_0x40bfb0;if(_0x5a1465[_0xb069('0x2e')][_0xb069('0x3f')]){_0x1057b3[_0xb069('0x40')]=[{'all':!![]}];}return db[_0xb069('0x2b')][_0xb069('0x41')](_0x1057b3);})['then'](function(_0x577546){_0x26324d[_0xb069('0x42')]=_0x577546;return _0x26324d;})['then'](respondWithFilteredResult(_0x17b7b6,_0x1057b3))[_0xb069('0x43')](handleError(_0x17b7b6,null));})[_0xb069('0x43')](handleError(_0x17b7b6,null));};exports[_0xb069('0x44')]=function(_0x53772f,_0x4b89d1){var _0x1872ba={'raw':![],'where':{'id':_0x53772f[_0xb069('0x45')]['id']}},_0x20bfe1={};_0x20bfe1['model']=_[_0xb069('0x2d')](db[_0xb069('0x2b')][_0xb069('0x46')]);_0x20bfe1['query']=_['keys'](_0x53772f['query']);_0x20bfe1[_0xb069('0x2f')]=_[_0xb069('0x32')](_0x20bfe1[_0xb069('0x30')],_0x20bfe1[_0xb069('0x2e')]);_0x1872ba['attributes']=_[_0xb069('0x32')](_0x20bfe1[_0xb069('0x30')],qs[_0xb069('0x33')](_0x53772f[_0xb069('0x2e')][_0xb069('0x33')]));_0x1872ba[_0xb069('0x31')]=_0x1872ba['attributes'][_0xb069('0x34')]?_0x1872ba[_0xb069('0x31')]:_0x20bfe1[_0xb069('0x30')];if(_0x53772f[_0xb069('0x2e')][_0xb069('0x3f')]){_0x1872ba[_0xb069('0x40')]=[{'all':!![]}];}_0x1872ba=_[_0xb069('0x3c')]({},_0x1872ba,_0x53772f['options']);return db[_0xb069('0x2b')][_0xb069('0x47')](_0x1872ba)[_0xb069('0x23')](handleEntityNotFound(_0x4b89d1,null))[_0xb069('0x23')](respondWithResult(_0x4b89d1,null))['catch'](handleError(_0x4b89d1,null));};exports[_0xb069('0x48')]=function(_0x1f6480,_0x391079){return db[_0xb069('0x2b')][_0xb069('0x48')](_0x1f6480[_0xb069('0x49')],{})[_0xb069('0x23')](function(_0x55e4bd){var _0x419ea6=_0x1f6480[_0xb069('0x4a')][_0xb069('0x25')]({'plain':!![]});if(!_0x419ea6)throw new Error(_0xb069('0x4b'));if(_0x419ea6['role']===_0xb069('0x4a')){var _0x289af3=_0x55e4bd[_0xb069('0x25')]({'plain':!![]});var _0xc752e3=_0xb069('0x26');return db[_0xb069('0x4c')][_0xb069('0x47')]({'where':{'name':_0xc752e3,'userProfileId':_0x419ea6[_0xb069('0x4d')]},'raw':!![]})['then'](function(_0x348dbe){if(_0x348dbe&&_0x348dbe[_0xb069('0x4e')]===0x0){return db['UserProfileResource'][_0xb069('0x48')]({'name':_0x289af3[_0xb069('0x2a')],'resourceId':_0x289af3['id'],'type':_0x348dbe['name'],'sectionId':_0x348dbe['id']},{})['then'](function(){return _0x55e4bd;});}else{return _0x55e4bd;}})[_0xb069('0x43')](function(_0x447a00){logger[_0xb069('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x447a00);throw _0x447a00;});}return _0x55e4bd;})['then'](respondWithResult(_0x391079,0xc9))[_0xb069('0x43')](handleError(_0x391079,null));};exports[_0xb069('0x22')]=function(_0x544b4f,_0x9b98e1){if(_0x544b4f[_0xb069('0x49')]['id']){delete _0x544b4f['body']['id'];}return db[_0xb069('0x2b')][_0xb069('0x47')]({'where':{'id':_0x544b4f[_0xb069('0x45')]['id']}})[_0xb069('0x23')](handleEntityNotFound(_0x9b98e1,null))[_0xb069('0x23')](saveUpdates(_0x544b4f['body'],null))['then'](respondWithResult(_0x9b98e1,null))[_0xb069('0x43')](handleError(_0x9b98e1,null));};exports[_0xb069('0x24')]=function(_0x439ce4,_0x1b5cb6){return db[_0xb069('0x2b')][_0xb069('0x47')]({'where':{'id':_0x439ce4['params']['id']}})[_0xb069('0x23')](handleEntityNotFound(_0x1b5cb6,null))[_0xb069('0x23')](removeEntity(_0x1b5cb6,null))[_0xb069('0x43')](handleError(_0x1b5cb6,null));};exports[_0xb069('0x2c')]=function(_0x3df63d,_0xd73d2c){return db[_0xb069('0x2b')][_0xb069('0x2c')]()[_0xb069('0x23')](respondWithResult(_0xd73d2c,null))[_0xb069('0x43')](handleError(_0xd73d2c,null));};exports[_0xb069('0x4f')]=function(_0x236a0d,_0x651ef2,_0x5e9b07){return db[_0xb069('0x50')][_0xb069('0x47')]({'where':{'id':_0x236a0d[_0xb069('0x45')]['id']}})[_0xb069('0x23')](handleEntityNotFound(_0x651ef2,null))[_0xb069('0x23')](function(_0x63d23){if(_0x63d23){return _0x63d23[_0xb069('0x4f')](_0x236a0d[_0xb069('0x49')][_0xb069('0x51')],_[_0xb069('0x52')](_0x236a0d['body'],[_0xb069('0x51'),'id'])||{});}})[_0xb069('0x23')](respondWithResult(_0x651ef2,null))[_0xb069('0x43')](handleError(_0x651ef2,null));};exports[_0xb069('0x53')]=function(_0x2b193a,_0x214681,_0x451ecf){var _0x1562d5={};var _0x32318d={};var _0x4092a3;var _0x3c1b7a;return db[_0xb069('0x2b')][_0xb069('0x54')]({'where':{'id':_0x2b193a[_0xb069('0x45')]['id']}})[_0xb069('0x23')](handleEntityNotFound(_0x214681,null))[_0xb069('0x23')](function(_0x1f44ff){if(_0x1f44ff){_0x4092a3=_0x1f44ff;_0x32318d[_0xb069('0x30')]=_[_0xb069('0x2d')](db[_0xb069('0x50')][_0xb069('0x46')]);_0x32318d[_0xb069('0x2e')]=_['keys'](_0x2b193a[_0xb069('0x2e')]);_0x32318d[_0xb069('0x2f')]=_[_0xb069('0x32')](_0x32318d['model'],_0x32318d['query']);_0x1562d5[_0xb069('0x31')]=_['intersection'](_0x32318d['model'],qs['fields'](_0x2b193a['query'][_0xb069('0x33')]));_0x1562d5['attributes']=_0x1562d5['attributes'][_0xb069('0x34')]?_0x1562d5['attributes']:_0x32318d[_0xb069('0x30')];_0x1562d5['order']=qs[_0xb069('0x38')](_0x2b193a[_0xb069('0x2e')]['sort']);_0x1562d5[_0xb069('0x39')]=qs[_0xb069('0x2f')](_['pick'](_0x2b193a[_0xb069('0x2e')],_0x32318d[_0xb069('0x2f')]));if(_0x2b193a[_0xb069('0x2e')][_0xb069('0x3b')]){_0x1562d5[_0xb069('0x39')]=_[_0xb069('0x3c')](_0x1562d5[_0xb069('0x39')],{'$or':_[_0xb069('0x3d')](_0x1562d5[_0xb069('0x31')],function(_0xf6acc2){var _0x66d2f1={};_0x66d2f1[_0xf6acc2]={'$like':'%'+_0x2b193a['query']['filter']+'%'};return _0x66d2f1;})});}_0x1562d5=_[_0xb069('0x3c')]({},_0x1562d5,_0x2b193a[_0xb069('0x3e')]);return _0x4092a3['getContacts'](_0x1562d5);}})[_0xb069('0x23')](function(_0x28c351){if(_0x28c351){_0x3c1b7a=_0x28c351[_0xb069('0x34')];if(!_0x2b193a[_0xb069('0x2e')][_0xb069('0x35')](_0xb069('0x36'))){_0x1562d5[_0xb069('0x1c')]=qs[_0xb069('0x1c')](_0x2b193a[_0xb069('0x2e')][_0xb069('0x1c')]);_0x1562d5['offset']=qs['offset'](_0x2b193a['query'][_0xb069('0x1b')]);}return _0x4092a3['getContacts'](_0x1562d5);}})['then'](function(_0x104231){if(_0x104231){return _0x104231?{'count':_0x3c1b7a,'rows':_0x104231}:null;}})[_0xb069('0x23')](respondWithResult(_0x214681,null))['catch'](handleError(_0x214681,null));};
\ No newline at end of file
+var _0xa247=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Companies','UserProfileResource','error','stack','name','send','CmCompany','describe','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','merge','where','filter','options','includeAll','show','params','rawAttributes','length','include','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','omit','ids','getContacts','findOne','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x59747e,_0x48e3bb){var _0x1d3285=function(_0x2b68ec){while(--_0x2b68ec){_0x59747e['push'](_0x59747e['shift']());}};_0x1d3285(++_0x48e3bb);}(_0xa247,0x197));var _0x7a24=function(_0x30da0f,_0x356e4d){_0x30da0f=_0x30da0f-0x0;var _0x1234ad=_0xa247[_0x30da0f];return _0x1234ad;};'use strict';var emlformat=require(_0x7a24('0x0'));var rimraf=require(_0x7a24('0x1'));var zipdir=require(_0x7a24('0x2'));var jsonpatch=require(_0x7a24('0x3'));var rp=require('request-promise');var moment=require(_0x7a24('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7a24('0x5'));var util=require('util');var path=require(_0x7a24('0x6'));var sox=require(_0x7a24('0x7'));var csv=require(_0x7a24('0x8'));var ejs=require(_0x7a24('0x9'));var fs=require('fs');var fs_extra=require(_0x7a24('0xa'));var _=require('lodash');var squel=require(_0x7a24('0xb'));var crypto=require(_0x7a24('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7a24('0x8'));var querystring=require(_0x7a24('0xd'));var Papa=require(_0x7a24('0xe'));var Redis=require('ioredis');var authService=require(_0x7a24('0xf'));var qs=require(_0x7a24('0x10'));var as=require(_0x7a24('0x11'));var hardwareService=require(_0x7a24('0x12'));var logger=require(_0x7a24('0x13'))(_0x7a24('0x14'));var utils=require(_0x7a24('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7a24('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b57fb,_0x149311){_0x149311=_0x149311||0xcc;return function(_0x2df9c6){if(_0x2df9c6){return _0x3b57fb[_0x7a24('0x17')](_0x149311);}return _0x3b57fb['status'](_0x149311)[_0x7a24('0x18')]();};}function respondWithResult(_0x4780ad,_0x261cbf){_0x261cbf=_0x261cbf||0xc8;return function(_0x596bbf){if(_0x596bbf){return _0x4780ad[_0x7a24('0x19')](_0x261cbf)['json'](_0x596bbf);}};}function respondWithFilteredResult(_0xed9956,_0x3d2eef){return function(_0x5a0c32){if(_0x5a0c32){var _0x34d5ea=typeof _0x3d2eef[_0x7a24('0x1a')]===_0x7a24('0x1b')&&typeof _0x3d2eef[_0x7a24('0x1c')]===_0x7a24('0x1b');var _0x56fc54=_0x5a0c32[_0x7a24('0x1d')];var _0x311710=_0x34d5ea?0x0:_0x3d2eef['offset'];var _0x5e24b0=_0x34d5ea?_0x5a0c32[_0x7a24('0x1d')]:_0x3d2eef[_0x7a24('0x1a')]+_0x3d2eef[_0x7a24('0x1c')];var _0xd19ba7;if(_0x5e24b0>=_0x56fc54){_0x5e24b0=_0x56fc54;_0xd19ba7=0xc8;}else{_0xd19ba7=0xce;}_0xed9956[_0x7a24('0x19')](_0xd19ba7);return _0xed9956['set'](_0x7a24('0x1e'),_0x311710+'-'+_0x5e24b0+'/'+_0x56fc54)['json'](_0x5a0c32);}return null;};}function patchUpdates(_0x5f5749){return function(_0x46a3ed){try{jsonpatch[_0x7a24('0x1f')](_0x46a3ed,_0x5f5749,!![]);}catch(_0x20e840){return BPromise[_0x7a24('0x20')](_0x20e840);}return _0x46a3ed[_0x7a24('0x21')]();};}function saveUpdates(_0x78dd11,_0x3fa15e){return function(_0x30cd9f){if(_0x30cd9f){return _0x30cd9f[_0x7a24('0x22')](_0x78dd11)[_0x7a24('0x23')](function(_0x29f2e4){return _0x29f2e4;});}return null;};}function removeEntity(_0x40132f,_0x2e72e8){return function(_0x406149){if(_0x406149){return _0x406149[_0x7a24('0x24')]()[_0x7a24('0x23')](function(){var _0x97933a=_0x406149['get']({'plain':!![]});var _0x2e37a5=_0x7a24('0x25');return db[_0x7a24('0x26')][_0x7a24('0x24')]({'where':{'type':_0x2e37a5,'resourceId':_0x97933a['id']}})[_0x7a24('0x23')](function(){return _0x406149;});})[_0x7a24('0x23')](function(){_0x40132f[_0x7a24('0x19')](0xcc)[_0x7a24('0x18')]();});}};}function handleEntityNotFound(_0x1e216a,_0x82a6a0){return function(_0x518820){if(!_0x518820){_0x1e216a[_0x7a24('0x17')](0x194);}return _0x518820;};}function handleError(_0x22e31b,_0x3a630b){_0x3a630b=_0x3a630b||0x1f4;return function(_0x1cd3e2){logger[_0x7a24('0x27')](_0x1cd3e2[_0x7a24('0x28')]);if(_0x1cd3e2[_0x7a24('0x29')]){delete _0x1cd3e2[_0x7a24('0x29')];}_0x22e31b[_0x7a24('0x19')](_0x3a630b)[_0x7a24('0x2a')](_0x1cd3e2);};}exports['index']=function(_0x6ac5c9,_0x578852){var _0x3fc7f6={},_0x173e8e={},_0x3d08ef={'count':0x0,'rows':[]};return db[_0x7a24('0x2b')][_0x7a24('0x2c')]()['then'](function(_0x2d9a2c){_0x173e8e['model']=_[_0x7a24('0x2d')](_0x2d9a2c);_0x173e8e[_0x7a24('0x2e')]=_[_0x7a24('0x2d')](_0x6ac5c9[_0x7a24('0x2e')]);_0x173e8e[_0x7a24('0x2f')]=_[_0x7a24('0x30')](_0x173e8e['model'],_0x173e8e[_0x7a24('0x2e')]);_0x3fc7f6['attributes']=_[_0x7a24('0x30')](_0x173e8e[_0x7a24('0x31')],qs[_0x7a24('0x32')](_0x6ac5c9[_0x7a24('0x2e')][_0x7a24('0x32')]));_0x3fc7f6[_0x7a24('0x33')]=_0x3fc7f6[_0x7a24('0x33')]['length']?_0x3fc7f6['attributes']:_0x173e8e[_0x7a24('0x31')];if(!_0x6ac5c9['query']['hasOwnProperty'](_0x7a24('0x34'))){_0x3fc7f6[_0x7a24('0x1c')]=qs[_0x7a24('0x1c')](_0x6ac5c9[_0x7a24('0x2e')]['limit']);_0x3fc7f6[_0x7a24('0x1a')]=qs['offset'](_0x6ac5c9[_0x7a24('0x2e')]['offset']);}_0x3fc7f6[_0x7a24('0x35')]=qs['sort'](_0x6ac5c9[_0x7a24('0x2e')][_0x7a24('0x36')]);_0x3fc7f6['where']=qs[_0x7a24('0x2f')](_[_0x7a24('0x37')](_0x6ac5c9[_0x7a24('0x2e')],_0x173e8e[_0x7a24('0x2f')]),_0x2d9a2c);if(_0x6ac5c9[_0x7a24('0x2e')]['filter']){_0x3fc7f6['where']=_[_0x7a24('0x38')](_0x3fc7f6[_0x7a24('0x39')],{'$or':_['map'](_0x3fc7f6['attributes'],function(_0x3d3dec){var _0x269bc3={};_0x269bc3[_0x3d3dec]={'$like':'%'+_0x6ac5c9[_0x7a24('0x2e')][_0x7a24('0x3a')]+'%'};return _0x269bc3;})});}_0x3fc7f6=_[_0x7a24('0x38')]({},_0x3fc7f6,_0x6ac5c9[_0x7a24('0x3b')]);var _0x48dccd={'where':_0x3fc7f6[_0x7a24('0x39')]};return db[_0x7a24('0x2b')]['count'](_0x48dccd)['then'](function(_0x46bab5){_0x3d08ef['count']=_0x46bab5;if(_0x6ac5c9[_0x7a24('0x2e')][_0x7a24('0x3c')]){_0x3fc7f6['include']=[{'all':!![]}];}return db[_0x7a24('0x2b')]['findAll'](_0x3fc7f6);})[_0x7a24('0x23')](function(_0xad5e25){_0x3d08ef['rows']=_0xad5e25;return _0x3d08ef;})[_0x7a24('0x23')](respondWithFilteredResult(_0x578852,_0x3fc7f6))['catch'](handleError(_0x578852,null));})['catch'](handleError(_0x578852,null));};exports[_0x7a24('0x3d')]=function(_0x48b954,_0x94ae8){var _0x503739={'raw':![],'where':{'id':_0x48b954[_0x7a24('0x3e')]['id']}},_0xdc901a={};_0xdc901a[_0x7a24('0x31')]=_[_0x7a24('0x2d')](db[_0x7a24('0x2b')][_0x7a24('0x3f')]);_0xdc901a[_0x7a24('0x2e')]=_['keys'](_0x48b954[_0x7a24('0x2e')]);_0xdc901a[_0x7a24('0x2f')]=_[_0x7a24('0x30')](_0xdc901a['model'],_0xdc901a[_0x7a24('0x2e')]);_0x503739[_0x7a24('0x33')]=_[_0x7a24('0x30')](_0xdc901a[_0x7a24('0x31')],qs[_0x7a24('0x32')](_0x48b954['query'][_0x7a24('0x32')]));_0x503739['attributes']=_0x503739[_0x7a24('0x33')][_0x7a24('0x40')]?_0x503739[_0x7a24('0x33')]:_0xdc901a[_0x7a24('0x31')];if(_0x48b954['query']['includeAll']){_0x503739[_0x7a24('0x41')]=[{'all':!![]}];}_0x503739=_[_0x7a24('0x38')]({},_0x503739,_0x48b954['options']);return db[_0x7a24('0x2b')][_0x7a24('0x42')](_0x503739)[_0x7a24('0x23')](handleEntityNotFound(_0x94ae8,null))[_0x7a24('0x23')](respondWithResult(_0x94ae8,null))[_0x7a24('0x43')](handleError(_0x94ae8,null));};exports[_0x7a24('0x44')]=function(_0x2ec89f,_0x359b28){return db['CmCompany'][_0x7a24('0x44')](_0x2ec89f['body'],{})[_0x7a24('0x23')](function(_0x1f69b7){var _0x5d33d3=_0x2ec89f[_0x7a24('0x45')][_0x7a24('0x46')]({'plain':!![]});if(!_0x5d33d3)throw new Error(_0x7a24('0x47'));if(_0x5d33d3[_0x7a24('0x48')]===_0x7a24('0x45')){var _0x3122cc=_0x1f69b7[_0x7a24('0x46')]({'plain':!![]});var _0x178631=_0x7a24('0x25');return db[_0x7a24('0x49')]['find']({'where':{'name':_0x178631,'userProfileId':_0x5d33d3[_0x7a24('0x4a')]},'raw':!![]})[_0x7a24('0x23')](function(_0x489527){if(_0x489527&&_0x489527[_0x7a24('0x4b')]===0x0){return db[_0x7a24('0x26')][_0x7a24('0x44')]({'name':_0x3122cc[_0x7a24('0x29')],'resourceId':_0x3122cc['id'],'type':_0x489527[_0x7a24('0x29')],'sectionId':_0x489527['id']},{})[_0x7a24('0x23')](function(){return _0x1f69b7;});}else{return _0x1f69b7;}})['catch'](function(_0x5468d3){logger['error'](_0x7a24('0x4c'),_0x5468d3);throw _0x5468d3;});}return _0x1f69b7;})['then'](respondWithResult(_0x359b28,0xc9))[_0x7a24('0x43')](handleError(_0x359b28,null));};exports[_0x7a24('0x22')]=function(_0x36624f,_0x3902da){if(_0x36624f[_0x7a24('0x4d')]['id']){delete _0x36624f['body']['id'];}return db[_0x7a24('0x2b')][_0x7a24('0x42')]({'where':{'id':_0x36624f[_0x7a24('0x3e')]['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x3902da,null))['then'](saveUpdates(_0x36624f[_0x7a24('0x4d')],null))[_0x7a24('0x23')](respondWithResult(_0x3902da,null))['catch'](handleError(_0x3902da,null));};exports[_0x7a24('0x24')]=function(_0x28b35a,_0x35d2fb){return db[_0x7a24('0x2b')][_0x7a24('0x42')]({'where':{'id':_0x28b35a[_0x7a24('0x3e')]['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x35d2fb,null))[_0x7a24('0x23')](removeEntity(_0x35d2fb,null))[_0x7a24('0x43')](handleError(_0x35d2fb,null));};exports[_0x7a24('0x2c')]=function(_0x5d3f98,_0x9184a1){return db['CmCompany'][_0x7a24('0x2c')]()[_0x7a24('0x23')](respondWithResult(_0x9184a1,null))[_0x7a24('0x43')](handleError(_0x9184a1,null));};exports[_0x7a24('0x4e')]=function(_0x3d2747,_0x31fb02,_0x40de10){return db[_0x7a24('0x4f')][_0x7a24('0x42')]({'where':{'id':_0x3d2747['params']['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x31fb02,null))[_0x7a24('0x23')](function(_0x3e66a5){if(_0x3e66a5){return _0x3e66a5[_0x7a24('0x4e')](_0x3d2747[_0x7a24('0x4d')]['ids'],_[_0x7a24('0x50')](_0x3d2747[_0x7a24('0x4d')],[_0x7a24('0x51'),'id'])||{});}})[_0x7a24('0x23')](respondWithResult(_0x31fb02,null))[_0x7a24('0x43')](handleError(_0x31fb02,null));};exports[_0x7a24('0x52')]=function(_0x3d6ed9,_0x12f961,_0x17964d){var _0x51a6f0={};var _0x47e172={};var _0x3b66fa;var _0xf4882f;return db['CmCompany'][_0x7a24('0x53')]({'where':{'id':_0x3d6ed9['params']['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x12f961,null))[_0x7a24('0x23')](function(_0x518c7f){if(_0x518c7f){_0x3b66fa=_0x518c7f;_0x47e172[_0x7a24('0x31')]=_[_0x7a24('0x2d')](db['CmContact'][_0x7a24('0x3f')]);_0x47e172[_0x7a24('0x2e')]=_['keys'](_0x3d6ed9[_0x7a24('0x2e')]);_0x47e172[_0x7a24('0x2f')]=_['intersection'](_0x47e172[_0x7a24('0x31')],_0x47e172['query']);_0x51a6f0['attributes']=_[_0x7a24('0x30')](_0x47e172['model'],qs[_0x7a24('0x32')](_0x3d6ed9['query'][_0x7a24('0x32')]));_0x51a6f0[_0x7a24('0x33')]=_0x51a6f0['attributes']['length']?_0x51a6f0[_0x7a24('0x33')]:_0x47e172['model'];_0x51a6f0[_0x7a24('0x35')]=qs['sort'](_0x3d6ed9['query']['sort']);_0x51a6f0[_0x7a24('0x39')]=qs[_0x7a24('0x2f')](_[_0x7a24('0x37')](_0x3d6ed9[_0x7a24('0x2e')],_0x47e172[_0x7a24('0x2f')]));if(_0x3d6ed9[_0x7a24('0x2e')][_0x7a24('0x3a')]){_0x51a6f0[_0x7a24('0x39')]=_[_0x7a24('0x38')](_0x51a6f0[_0x7a24('0x39')],{'$or':_[_0x7a24('0x54')](_0x51a6f0[_0x7a24('0x33')],function(_0x51b26a){var _0x3b773c={};_0x3b773c[_0x51b26a]={'$like':'%'+_0x3d6ed9[_0x7a24('0x2e')][_0x7a24('0x3a')]+'%'};return _0x3b773c;})});}_0x51a6f0=_[_0x7a24('0x38')]({},_0x51a6f0,_0x3d6ed9[_0x7a24('0x3b')]);return _0x3b66fa[_0x7a24('0x52')](_0x51a6f0);}})[_0x7a24('0x23')](function(_0x473aed){if(_0x473aed){_0xf4882f=_0x473aed[_0x7a24('0x40')];if(!_0x3d6ed9[_0x7a24('0x2e')]['hasOwnProperty'](_0x7a24('0x34'))){_0x51a6f0[_0x7a24('0x1c')]=qs['limit'](_0x3d6ed9[_0x7a24('0x2e')][_0x7a24('0x1c')]);_0x51a6f0[_0x7a24('0x1a')]=qs[_0x7a24('0x1a')](_0x3d6ed9[_0x7a24('0x2e')][_0x7a24('0x1a')]);}return _0x3b66fa[_0x7a24('0x52')](_0x51a6f0);}})[_0x7a24('0x23')](function(_0x1bbfb5){if(_0x1bbfb5){return _0x1bbfb5?{'count':_0xf4882f,'rows':_0x1bbfb5}:null;}})[_0x7a24('0x23')](respondWithResult(_0x12f961,null))[_0x7a24('0x43')](handleError(_0x12f961,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index d52961c..8bc7a57 100644
--- a/server/api/cmCompany/cmCompany.model.js
+++ b/server/api/cmCompany/cmCompany.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcfd2=['rimraf','../../config/environment','./cmCompany.attributes','CmCompany','lodash','util','../../config/logger','api','moment'];(function(_0x28edda,_0xbd447a){var _0x21f4a4=function(_0x5ae05e){while(--_0x5ae05e){_0x28edda['push'](_0x28edda['shift']());}};_0x21f4a4(++_0xbd447a);}(_0xcfd2,0xdc));var _0x2cfd=function(_0x5bf111,_0x53a71d){_0x5bf111=_0x5bf111-0x0;var _0x26e73f=_0xcfd2[_0x5bf111];return _0x26e73f;};'use strict';var _=require(_0x2cfd('0x0'));var util=require(_0x2cfd('0x1'));var logger=require(_0x2cfd('0x2'))(_0x2cfd('0x3'));var moment=require(_0x2cfd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2cfd('0x5'));var config=require(_0x2cfd('0x6'));var attributes=require(_0x2cfd('0x7'));module['exports']=function(_0x788f4b,_0x58f0ff){return _0x788f4b['define'](_0x2cfd('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5570=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x78d11b,_0x1c2611){var _0x5f2e27=function(_0x58e6ce){while(--_0x58e6ce){_0x78d11b['push'](_0x78d11b['shift']());}};_0x5f2e27(++_0x1c2611);}(_0x5570,0xf4));var _0x0557=function(_0x27d11f,_0x2c59a8){_0x27d11f=_0x27d11f-0x0;var _0x36c1a5=_0x5570[_0x27d11f];return _0x36c1a5;};'use strict';var _=require(_0x0557('0x0'));var util=require(_0x0557('0x1'));var logger=require(_0x0557('0x2'))(_0x0557('0x3'));var moment=require('moment');var BPromise=require(_0x0557('0x4'));var rp=require(_0x0557('0x5'));var fs=require('fs');var path=require(_0x0557('0x6'));var rimraf=require(_0x0557('0x7'));var config=require(_0x0557('0x8'));var attributes=require(_0x0557('0x9'));module['exports']=function(_0x56f613,_0x42cd9f){return _0x56f613[_0x0557('0xa')](_0x0557('0xb'),attributes,{'tableName':_0x0557('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index dd59e5e..a24edbd 100644
--- a/server/api/cmCompany/cmCompany.rpc.js
+++ b/server/api/cmCompany/cmCompany.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1305=['jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1305,0x142));var _0x5130=function(_0x5f1864,_0x5a2d34){_0x5f1864=_0x5f1864-0x0;var _0x4e92ba=_0x1305[_0x5f1864];return _0x4e92ba;};'use strict';var _=require('lodash');var util=require(_0x5130('0x0'));var moment=require(_0x5130('0x1'));var BPromise=require('bluebird');var rs=require(_0x5130('0x2'));var fs=require('fs');var Redis=require(_0x5130('0x3'));var db=require(_0x5130('0x4'))['db'];var utils=require(_0x5130('0x5'));var logger=require(_0x5130('0x6'))('rpc');var config=require(_0x5130('0x7'));var jayson=require(_0x5130('0x8'));var client=jayson[_0x5130('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15ccf1,_0x350f3d,_0x35f55a){return new BPromise(function(_0x234696,_0x438b48){return client[_0x5130('0xa')](_0x15ccf1,_0x35f55a)[_0x5130('0xb')](function(_0x61cd29){logger[_0x5130('0xc')](_0x5130('0xd'),_0x350f3d,'request\x20sent');logger[_0x5130('0xe')](_0x5130('0xf'),_0x350f3d,_0x5130('0x10'),JSON['stringify'](_0x61cd29));if(_0x61cd29[_0x5130('0x11')]){if(_0x61cd29[_0x5130('0x11')][_0x5130('0x12')]===0x1f4){logger[_0x5130('0x11')](_0x5130('0xd'),_0x350f3d,_0x61cd29[_0x5130('0x11')][_0x5130('0x13')]);return _0x438b48(_0x61cd29['error'][_0x5130('0x13')]);}logger[_0x5130('0x11')](_0x5130('0xd'),_0x350f3d,_0x61cd29['error']['message']);return _0x234696(_0x61cd29[_0x5130('0x11')][_0x5130('0x13')]);}else{logger['info'](_0x5130('0xd'),_0x350f3d,'request\x20sent');_0x234696(_0x61cd29[_0x5130('0x14')]['message']);}})[_0x5130('0x15')](function(_0x43182e){logger[_0x5130('0x11')](_0x5130('0xd'),_0x350f3d,_0x43182e);_0x438b48(_0x43182e);});});}
\ No newline at end of file
+var _0x8420=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x49cf2d,_0x3c3bdd){var _0x5d91eb=function(_0x518aa6){while(--_0x518aa6){_0x49cf2d['push'](_0x49cf2d['shift']());}};_0x5d91eb(++_0x3c3bdd);}(_0x8420,0xd1));var _0x0842=function(_0x4fc0f3,_0x282ba2){_0x4fc0f3=_0x4fc0f3-0x0;var _0x633682=_0x8420[_0x4fc0f3];return _0x633682;};'use strict';var _=require(_0x0842('0x0'));var util=require('util');var moment=require(_0x0842('0x1'));var BPromise=require(_0x0842('0x2'));var rs=require(_0x0842('0x3'));var fs=require('fs');var Redis=require(_0x0842('0x4'));var db=require(_0x0842('0x5'))['db'];var utils=require(_0x0842('0x6'));var logger=require(_0x0842('0x7'))(_0x0842('0x8'));var config=require(_0x0842('0x9'));var jayson=require(_0x0842('0xa'));var client=jayson[_0x0842('0xb')][_0x0842('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c9708,_0x25f395,_0x3faddd){return new BPromise(function(_0x2d20bf,_0x449dec){return client[_0x0842('0xd')](_0x5c9708,_0x3faddd)[_0x0842('0xe')](function(_0x59e71c){logger['info']('CmCompany,\x20%s,\x20%s',_0x25f395,_0x0842('0xf'));logger['debug'](_0x0842('0x10'),_0x25f395,'request\x20sent',JSON[_0x0842('0x11')](_0x59e71c));if(_0x59e71c[_0x0842('0x12')]){if(_0x59e71c[_0x0842('0x12')][_0x0842('0x13')]===0x1f4){logger[_0x0842('0x12')](_0x0842('0x14'),_0x25f395,_0x59e71c[_0x0842('0x12')][_0x0842('0x15')]);return _0x449dec(_0x59e71c['error']['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x25f395,_0x59e71c[_0x0842('0x12')][_0x0842('0x15')]);return _0x2d20bf(_0x59e71c[_0x0842('0x12')][_0x0842('0x15')]);}else{logger['info'](_0x0842('0x14'),_0x25f395,_0x0842('0xf'));_0x2d20bf(_0x59e71c[_0x0842('0x16')]['message']);}})[_0x0842('0x17')](function(_0x2b7142){logger[_0x0842('0x12')](_0x0842('0x14'),_0x25f395,_0x2b7142);_0x449dec(_0x2b7142);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 8eff692..a9f0ac4 100644
--- a/server/api/cmCompany/index.js
+++ b/server/api/cmCompany/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x829a=['../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x829a,0x190));var _0xa829=function(_0x532607,_0x1a44af){_0x532607=_0x532607-0x0;var _0x5093b0=_0x829a[_0x532607];return _0x5093b0;};'use strict';var multer=require(_0xa829('0x0'));var util=require(_0xa829('0x1'));var path=require(_0xa829('0x2'));var timeout=require(_0xa829('0x3'));var express=require(_0xa829('0x4'));var router=express[_0xa829('0x5')]();var fs_extra=require(_0xa829('0x6'));var auth=require(_0xa829('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa829('0x8'));var controller=require('./cmCompany.controller');router[_0xa829('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa829('0x9')](_0xa829('0xa'),auth[_0xa829('0xb')](),controller[_0xa829('0xc')]);router['get'](_0xa829('0xd'),auth[_0xa829('0xb')](),controller[_0xa829('0xe')]);router['get'](_0xa829('0xf'),auth[_0xa829('0xb')](),controller['getContacts']);router[_0xa829('0x10')]('/',auth[_0xa829('0xb')](),controller[_0xa829('0x11')]);router['post'](_0xa829('0xf'),auth[_0xa829('0xb')](),controller[_0xa829('0x12')]);router[_0xa829('0x13')](_0xa829('0xd'),auth[_0xa829('0xb')](),controller[_0xa829('0x14')]);router[_0xa829('0x15')](_0xa829('0xd'),auth[_0xa829('0xb')](),controller[_0xa829('0x16')]);module[_0xa829('0x17')]=router;
\ No newline at end of file
+var _0x0c84=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','create','post','addContacts','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0x0c84,0x185));var _0x40c8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0c84[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x40c8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x40c8('0x1'));var express=require('express');var router=express[_0x40c8('0x2')]();var fs_extra=require(_0x40c8('0x3'));var auth=require(_0x40c8('0x4'));var interaction=require(_0x40c8('0x5'));var config=require(_0x40c8('0x6'));var controller=require('./cmCompany.controller');router[_0x40c8('0x7')]('/',auth['isAuthenticated'](),controller[_0x40c8('0x8')]);router[_0x40c8('0x7')](_0x40c8('0x9'),auth[_0x40c8('0xa')](),controller[_0x40c8('0xb')]);router['get'](_0x40c8('0xc'),auth[_0x40c8('0xa')](),controller[_0x40c8('0xd')]);router[_0x40c8('0x7')](_0x40c8('0xe'),auth[_0x40c8('0xa')](),controller['getContacts']);router['post']('/',auth[_0x40c8('0xa')](),controller[_0x40c8('0xf')]);router[_0x40c8('0x10')](_0x40c8('0xe'),auth[_0x40c8('0xa')](),controller[_0x40c8('0x11')]);router[_0x40c8('0x12')](_0x40c8('0xc'),auth[_0x40c8('0xa')](),controller[_0x40c8('0x13')]);router[_0x40c8('0x14')](_0x40c8('0xc'),auth['isAuthenticated'](),controller[_0x40c8('0x15')]);module[_0x40c8('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 5b332a7..229535e 100644
--- a/server/api/cmContact/cmContact.attributes.js
+++ b/server/api/cmContact/cmContact.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x60e4=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x7c0c77,_0x3cf116){var _0x22a87b=function(_0x37279a){while(--_0x37279a){_0x7c0c77['push'](_0x7c0c77['shift']());}};_0x22a87b(++_0x3cf116);}(_0x60e4,0x17e));var _0x460e=function(_0x319129,_0x500514){_0x319129=_0x319129-0x0;var _0x1ca8a6=_0x60e4[_0x319129];return _0x1ca8a6;};'use strict';var _=require(_0x460e('0x0'));var Sequelize=require(_0x460e('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x460e('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x460e('0x2')]},'street':{'type':Sequelize[_0x460e('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x460e('0x2')]},'country':{'type':Sequelize[_0x460e('0x2')]},'dateOfBirth':{'type':Sequelize[_0x460e('0x2')]},'description':{'type':Sequelize[_0x460e('0x3')]},'phone':{'type':Sequelize[_0x460e('0x2')]},'mobile':{'type':Sequelize[_0x460e('0x2')]},'fax':{'type':Sequelize[_0x460e('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x460e('0x2')]},'facebook':{'type':Sequelize[_0x460e('0x2')]},'fb_data':{'type':Sequelize[_0x460e('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x460e('0x2')]},'teams':{'type':Sequelize[_0x460e('0x2')]},'viber':{'type':Sequelize[_0x460e('0x2')]},'line':{'type':Sequelize[_0x460e('0x2')]},'wechat':{'type':Sequelize[_0x460e('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x460e('0x4')](0x2)[_0x460e('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x460e('0x6')],'defaultValue':Sequelize[_0x460e('0x7')]}};
\ No newline at end of file
+var _0x6463=['lodash','exports','STRING','INTEGER','DATE','NOW'];(function(_0x25a168,_0xde3b74){var _0x1f1485=function(_0x315b68){while(--_0x315b68){_0x25a168['push'](_0x25a168['shift']());}};_0x1f1485(++_0xde3b74);}(_0x6463,0x66));var _0x3646=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6463[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3646('0x0'));var Sequelize=require('sequelize');module[_0x3646('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x3646('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x3646('0x2')]},'city':{'type':Sequelize[_0x3646('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x3646('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x3646('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x3646('0x2')]},'email':{'type':Sequelize[_0x3646('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x3646('0x2')]},'twitter':{'type':Sequelize[_0x3646('0x2')]},'skype':{'type':Sequelize[_0x3646('0x2')]},'teams':{'type':Sequelize[_0x3646('0x2')]},'viber':{'type':Sequelize[_0x3646('0x2')]},'line':{'type':Sequelize[_0x3646('0x2')]},'wechat':{'type':Sequelize[_0x3646('0x2')]},'telegram':{'type':Sequelize[_0x3646('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x3646('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3646('0x4')],'defaultValue':Sequelize[_0x3646('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 1e445e2..e7080ad 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4034=['ContactId','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','createReadStream','parse','meta','import','binding','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','sms','openchannel','whatsapp','voice','resolve','channel','includes','Invalid\x20channel','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','findAndCountAll','chat','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','osName','ratingValue','referer','subject','startCase','Interaction','flatten','sortBy','slice','bluebird','util','path','squel','ioredis','../../components/parsers/qs','../../config/logger','redis','register','status','offset','undefined','limit','count','set','Content-Range','json','destroy','then','sendStatus','error','stack','name','send','index','CmContact','describe','keys','startsWith','push','cf_','fieldType','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','and','value','dateOfBirth','datetime','castTo','buildExpression','type','text','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','SELECT','having','t.id\x20IN\x20?','agent','some','User','user','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','keyBy','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','displayName','analytics','CmCustomField','findAll','alias','custom','values','merge','body','get','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','ChatInteraction','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappQueueReport','create','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','$and','omit','format','cf_%d','table','cm_contacts','id\x20=\x20?','toParam','phone','findOne','options','getTags','setTags','ids','rawAttributes','includeAll','getHopperHistories','include','getHopperFinals','getJscriptySessions','JscriptySessionReport'];(function(_0x578fe0,_0x5556d5){var _0x5167a6=function(_0x50d022){while(--_0x50d022){_0x578fe0['push'](_0x578fe0['shift']());}};_0x5167a6(++_0x5556d5);}(_0x4034,0x166));var _0x4403=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0x4034[_0xfc406a];return _0x395473;};'use strict';var moment=require('moment');var BPromise=require(_0x4403('0x0'));var util=require(_0x4403('0x1'));var path=require(_0x4403('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4403('0x3'));var Papa=require('papaparse');var Redis=require(_0x4403('0x4'));var qs=require(_0x4403('0x5'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x4403('0x6'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4403('0x7')]=_['defaults'](config[_0x4403('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmContact.socket')[_0x4403('0x8')](socket);function respondWithResult(_0x2b91b5,_0x5f3756){_0x5f3756=_0x5f3756||0xc8;return function(_0x3eee9e){if(_0x3eee9e){return _0x2b91b5[_0x4403('0x9')](_0x5f3756)['json'](_0x3eee9e);}};}function respondWithFilteredResult(_0x2544c5,_0x69de2c){return function(_0x39ebca){if(_0x39ebca){var _0x52d84d=typeof _0x69de2c[_0x4403('0xa')]===_0x4403('0xb')&&typeof _0x69de2c[_0x4403('0xc')]===_0x4403('0xb');var _0x1309d8=_0x39ebca['count'];var _0x192dc8=_0x52d84d?0x0:_0x69de2c['offset'];var _0x3b940d=_0x52d84d?_0x39ebca[_0x4403('0xd')]:_0x69de2c['offset']+_0x69de2c[_0x4403('0xc')];var _0x23148e;if(_0x3b940d>=_0x1309d8){_0x3b940d=_0x1309d8;_0x23148e=0xc8;}else{_0x23148e=0xce;}_0x2544c5[_0x4403('0x9')](_0x23148e);return _0x2544c5[_0x4403('0xe')](_0x4403('0xf'),_0x192dc8+'-'+_0x3b940d+'/'+_0x1309d8)[_0x4403('0x10')](_0x39ebca);}return null;};}function saveUpdates(_0x1086fb){return function(_0x1a247b){if(_0x1a247b){return _0x1a247b['update'](_0x1086fb)['then'](function(_0x3e097d){return _0x3e097d;});}return null;};}function removeEntity(_0x475374){return function(_0x5ed2dc){if(_0x5ed2dc){return _0x5ed2dc[_0x4403('0x11')]()[_0x4403('0x12')](function(){_0x475374['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eb151){return function(_0x50aa92){if(!_0x50aa92){_0x1eb151[_0x4403('0x13')](0x194);}return _0x50aa92;};}function handleError(_0x275d33,_0x428c94){_0x428c94=_0x428c94||0x1f4;return function(_0x5f57b6){logger[_0x4403('0x14')](_0x5f57b6[_0x4403('0x15')]);if(_0x5f57b6[_0x4403('0x16')]){delete _0x5f57b6[_0x4403('0x16')];}_0x275d33['status'](_0x428c94)[_0x4403('0x17')](_0x5f57b6);};}exports[_0x4403('0x18')]=function(_0x382ed7,_0x11f975){var _0x2f7809={},_0x22f964={},_0x4da90d={'count':0x0,'rows':[]};return db[_0x4403('0x19')][_0x4403('0x1a')]()[_0x4403('0x12')](function(_0x1c549a){var _0x132cf3=[];for(var _0x3e037d=0x0;_0x3e037d
','Attachments','Data','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','user=','utf-8','toString','base64','lodash','moment','randomstring','path'];(function(_0x2883dd,_0x51643d){var _0x91779b=function(_0x1d1125){while(--_0x1d1125){_0x2883dd['push'](_0x2883dd['shift']());}};_0x91779b(++_0x51643d);}(_0x3a07,0xd4));var _0x73a0=function(_0x1965a8,_0x4f1746){_0x1965a8=_0x1965a8-0x0;var _0x109095=_0x3a07[_0x1965a8];return _0x109095;};'use strict';var _=require(_0x73a0('0x0'));var moment=require(_0x73a0('0x1'));var random=require(_0x73a0('0x2'));var fs=require('fs');var path=require(_0x73a0('0x3'));var util=require(_0x73a0('0x4'));var tnef=require(_0x73a0('0x5'));var logger=require('../../../config/logger')('email');var config=require(_0x73a0('0x6'));function getAddress(_0x201d05){var _0x2f4792=_[_0x73a0('0x7')](_0x201d05[_0x73a0('0x8')]);return _0x2f4792&&_0x2f4792[_0x73a0('0x9')]?_0x2f4792[_0x73a0('0x9')]:_0x73a0('0xa')+random[_0x73a0('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x4cf9a5){var _0x44ea5f=_[_0x73a0('0x7')](_0x4cf9a5[_0x73a0('0x8')]);if(_0x44ea5f&&_0x44ea5f[_0x73a0('0xc')]){if(_0x44ea5f[_0x73a0('0xc')]==_0x44ea5f[_0x73a0('0x9')]){return _0x44ea5f[_0x73a0('0xc')][_0x73a0('0xd')](0x0,_0x44ea5f['name'][_0x73a0('0xe')]('@'));}var _0x3e4905=_0x44ea5f[_0x73a0('0xc')][_0x73a0('0xf')](/\s+/);return _0x3e4905[_0x73a0('0x10')]>0x1?_0x3e4905[_0x73a0('0x11')](0x0,-0x1)[_0x73a0('0x12')]('\x20'):_0x44ea5f[_0x73a0('0xc')];}return'Anonymous';}function getLastName(_0x3ab165){var _0x587c66=_[_0x73a0('0x7')](_0x3ab165['value']);if(_0x587c66&&_0x587c66[_0x73a0('0xc')]){var _0x5a15d8=_0x587c66[_0x73a0('0xc')][_0x73a0('0xf')](/\s+/);return _0x5a15d8[_0x73a0('0x10')]>0x1?_0x5a15d8['pop']():'';}return'';}function getMails(_0x540855,_0x13de37){var _0x313359='';for(var _0x49ad1d=0x0;_0x49ad1d<_0x13de37[_0x73a0('0x8')][_0x73a0('0x10')];_0x49ad1d+=0x1){if(_0x13de37[_0x73a0('0x8')][_0x49ad1d][_0x73a0('0x9')]!==_0x540855){if(!_[_0x73a0('0x13')](_0x313359)){_0x313359+=',';}_0x313359+=_0x13de37[_0x73a0('0x8')][_0x49ad1d]['name']||_0x13de37[_0x73a0('0x8')][_0x49ad1d][_0x73a0('0x9')]||'';_0x313359+='\x20<';_0x313359+=_0x13de37[_0x73a0('0x8')][_0x49ad1d][_0x73a0('0x9')]?_0x13de37[_0x73a0('0x8')][_0x49ad1d][_0x73a0('0x9')]:_0x73a0('0xa')+random[_0x73a0('0xb')](0x6)+'@xcally.com';_0x313359+='>';}}return _0x313359;}function parseEmail(_0x1cc81f,_0x77cd6f,_0xeb84a2){if(_0x77cd6f[_0x73a0('0x14')]){var _0x1c5968=/