From: support
Date: Tue, 14 Feb 2023 09:34:43 +0000 (+0000)
Subject: Built motion from commit 74d9782e.|2.6.30
X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=73d2caa507a0279b0a0de1143122f429df16311d;p=motion2.git
Built motion from commit 74d9782e.|2.6.30
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index a900386..72f5452 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-02-14T08:27:09.575Z",
+ "time": "2023-02-14T09:25:44.676Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index bffab35..6004fb7 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2023-02-14T08:27:09.575Z",
+ "time": "2023-02-14T09:25:44.676Z",
"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 15a80f4..8e5fd28 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 _0x62fb=['action','STRING','contactManager','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[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]','sequelize','VIRTUAL','getDataValue'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x62fb,0x1cd));var _0xb62f=function(_0x4846a7,_0x10fe39){_0x4846a7=_0x4846a7-0x0;var _0x10634e=_0x62fb[_0x4846a7];return _0x10634e;};'use strict';var Sequelize=require(_0xb62f('0x0'));module['exports']={'name':{'type':Sequelize[_0xb62f('0x1')],'get':function(_0x42c7b4){return this[_0xb62f('0x2')](_0xb62f('0x3'));}},'action':{'type':Sequelize[_0xb62f('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb62f('0x5'),_0xb62f('0x6'),_0xb62f('0x7'),_0xb62f('0x8'),'urlForward',_0xb62f('0x9'),_0xb62f('0xa'),_0xb62f('0xb')]],'msg':_0xb62f('0xc')}},'comment':_0xb62f('0xc')},'data1':{'type':Sequelize[_0xb62f('0x4')](0x1000),'comment':_0xb62f('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[_0xb62f('0x4')](0x1000),'comment':_0xb62f('0xe')},'data4':{'type':Sequelize[_0xb62f('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xb62f('0xf')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xa318=['contactManager','motionbar','urlForward','bot','script','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]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING'];(function(_0x53c9f7,_0x5a709f){var _0x4ab248=function(_0x3eee34){while(--_0x3eee34){_0x53c9f7['push'](_0x53c9f7['shift']());}};_0x4ab248(++_0x5a709f);}(_0xa318,0x9c));var _0x8a31=function(_0x3635f7,_0x143c27){_0x3635f7=_0x3635f7-0x0;var _0x5a7f42=_0xa318[_0x3635f7];return _0x5a7f42;};'use strict';var Sequelize=require(_0x8a31('0x0'));module[_0x8a31('0x1')]={'name':{'type':Sequelize[_0x8a31('0x2')],'get':function(_0x581675){return this[_0x8a31('0x3')](_0x8a31('0x4'));}},'action':{'type':Sequelize[_0x8a31('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x8a31('0x6'),'integration',_0x8a31('0x7'),'jscripty',_0x8a31('0x8'),'browser',_0x8a31('0x9'),_0x8a31('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x8a31('0x5')](0x1000),'comment':_0x8a31('0xb')},'data2':{'type':Sequelize[_0x8a31('0x5')](0x1000),'comment':_0x8a31('0xc')},'data3':{'type':Sequelize[_0x8a31('0x5')](0x1000),'comment':_0x8a31('0xd')},'data4':{'type':Sequelize[_0x8a31('0x5')](0x1000),'comments':_0x8a31('0xe')},'data5':{'type':Sequelize[_0x8a31('0x5')](0x1000),'comments':_0x8a31('0xf')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x8a31('0x10')],'comments':_0x8a31('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 64321d2..28a373c 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 _0x7090=['end','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','error','name','send','update','body','Action','find','catch','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x143ce6,_0x46e089){var _0x33ed64=function(_0x5a6856){while(--_0x5a6856){_0x143ce6['push'](_0x143ce6['shift']());}};_0x33ed64(++_0x46e089);}(_0x7090,0x69));var _0x0709=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x7090[_0x20845e];return _0x28cf2b;};'use strict';var emlformat=require(_0x0709('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0709('0x1'));var rp=require(_0x0709('0x2'));var moment=require(_0x0709('0x3'));var BPromise=require(_0x0709('0x4'));var Mustache=require(_0x0709('0x5'));var util=require('util');var path=require(_0x0709('0x6'));var sox=require('sox');var csv=require(_0x0709('0x7'));var ejs=require(_0x0709('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0709('0x9'));var crypto=require(_0x0709('0xa'));var jsforce=require(_0x0709('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0709('0x7'));var querystring=require(_0x0709('0xc'));var Papa=require('papaparse');var Redis=require(_0x0709('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x0709('0xe'));var as=require(_0x0709('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0709('0x10'))(_0x0709('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0709('0x12'));var db=require(_0x0709('0x13'))['db'];function respondWithStatusCode(_0x55e18e,_0x4c6a52){_0x4c6a52=_0x4c6a52||0xcc;return function(_0x3af667){if(_0x3af667){return _0x55e18e[_0x0709('0x14')](_0x4c6a52);}return _0x55e18e['status'](_0x4c6a52)[_0x0709('0x15')]();};}function respondWithResult(_0x44a0f8,_0x217c03){_0x217c03=_0x217c03||0xc8;return function(_0x34b35a){if(_0x34b35a){return _0x44a0f8[_0x0709('0x16')](_0x217c03)[_0x0709('0x17')](_0x34b35a);}};}function respondWithFilteredResult(_0x31e6e6,_0x36deb5){return function(_0x43b9b3){if(_0x43b9b3){var _0x437755=typeof _0x36deb5['offset']===_0x0709('0x18')&&typeof _0x36deb5['limit']===_0x0709('0x18');var _0xefc44c=_0x43b9b3[_0x0709('0x19')];var _0x34b847=_0x437755?0x0:_0x36deb5[_0x0709('0x1a')];var _0x254870=_0x437755?_0x43b9b3[_0x0709('0x19')]:_0x36deb5['offset']+_0x36deb5['limit'];var _0x409566;if(_0x254870>=_0xefc44c){_0x254870=_0xefc44c;_0x409566=0xc8;}else{_0x409566=0xce;}_0x31e6e6[_0x0709('0x16')](_0x409566);return _0x31e6e6[_0x0709('0x1b')](_0x0709('0x1c'),_0x34b847+'-'+_0x254870+'/'+_0xefc44c)[_0x0709('0x17')](_0x43b9b3);}return null;};}function patchUpdates(_0x2bdbae){return function(_0x3626ef){try{jsonpatch[_0x0709('0x1d')](_0x3626ef,_0x2bdbae,!![]);}catch(_0x4b22f3){return BPromise[_0x0709('0x1e')](_0x4b22f3);}return _0x3626ef[_0x0709('0x1f')]();};}function saveUpdates(_0x1a50ab,_0x53eb57){return function(_0x2ac90b){if(_0x2ac90b){return _0x2ac90b['update'](_0x1a50ab)[_0x0709('0x20')](function(_0x10e4fd){return _0x10e4fd;});}return null;};}function removeEntity(_0x37a13a,_0x537bbb){return function(_0x4a8a45){if(_0x4a8a45){return _0x4a8a45['destroy']()[_0x0709('0x20')](function(){_0x37a13a[_0x0709('0x16')](0xcc)[_0x0709('0x15')]();});}};}function handleEntityNotFound(_0x4cbdf3,_0x1ffa65){return function(_0x5b9b81){if(!_0x5b9b81){_0x4cbdf3[_0x0709('0x14')](0x194);}return _0x5b9b81;};}function handleError(_0x1ac7fe,_0x32daeb){_0x32daeb=_0x32daeb||0x1f4;return function(_0x2e680c){logger[_0x0709('0x21')](_0x2e680c['stack']);if(_0x2e680c['name']){delete _0x2e680c[_0x0709('0x22')];}_0x1ac7fe['status'](_0x32daeb)[_0x0709('0x23')](_0x2e680c);};}exports[_0x0709('0x24')]=function(_0x27dd67,_0x15c3b9){if(_0x27dd67['body']['id']){delete _0x27dd67[_0x0709('0x25')]['id'];}return db[_0x0709('0x26')][_0x0709('0x27')]({'where':{'id':_0x27dd67['params']['id']}})['then'](handleEntityNotFound(_0x15c3b9,null))[_0x0709('0x20')](saveUpdates(_0x27dd67['body'],null))[_0x0709('0x20')](respondWithResult(_0x15c3b9,null))[_0x0709('0x28')](handleError(_0x15c3b9,null));};exports[_0x0709('0x29')]=function(_0x5aa065,_0x3b80b7){return db['Action'][_0x0709('0x27')]({'where':{'id':_0x5aa065['params']['id']}})['then'](handleEntityNotFound(_0x3b80b7,null))['then'](removeEntity(_0x3b80b7,null))[_0x0709('0x28')](handleError(_0x3b80b7,null));};
\ No newline at end of file
+var _0xf1f8=['crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','update','then','destroy','error','stack','name','send','body','Action','params','catch','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x56b546,_0x4d5f71){var _0x245a8e=function(_0x3c3060){while(--_0x3c3060){_0x56b546['push'](_0x56b546['shift']());}};_0x245a8e(++_0x4d5f71);}(_0xf1f8,0xd0));var _0x8f1f=function(_0x12d366,_0x737b0){_0x12d366=_0x12d366-0x0;var _0x143aca=_0xf1f8[_0x12d366];return _0x143aca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f1f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8f1f('0x1'));var rp=require(_0x8f1f('0x2'));var moment=require(_0x8f1f('0x3'));var BPromise=require(_0x8f1f('0x4'));var Mustache=require(_0x8f1f('0x5'));var util=require(_0x8f1f('0x6'));var path=require(_0x8f1f('0x7'));var sox=require(_0x8f1f('0x8'));var csv=require(_0x8f1f('0x9'));var ejs=require(_0x8f1f('0xa'));var fs=require('fs');var fs_extra=require(_0x8f1f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8f1f('0xc'));var jsforce=require(_0x8f1f('0xd'));var deskjs=require(_0x8f1f('0xe'));var toCsv=require(_0x8f1f('0x9'));var querystring=require(_0x8f1f('0xf'));var Papa=require('papaparse');var Redis=require(_0x8f1f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8f1f('0x11'));var hardwareService=require(_0x8f1f('0x12'));var logger=require(_0x8f1f('0x13'))('api');var utils=require(_0x8f1f('0x14'));var config=require(_0x8f1f('0x15'));var licenseUtil=require(_0x8f1f('0x16'));var db=require(_0x8f1f('0x17'))['db'];function respondWithStatusCode(_0x46fa9e,_0x571bfe){_0x571bfe=_0x571bfe||0xcc;return function(_0x4aa5ab){if(_0x4aa5ab){return _0x46fa9e['sendStatus'](_0x571bfe);}return _0x46fa9e[_0x8f1f('0x18')](_0x571bfe)[_0x8f1f('0x19')]();};}function respondWithResult(_0xb7b42d,_0xf75ad3){_0xf75ad3=_0xf75ad3||0xc8;return function(_0x3c1ac0){if(_0x3c1ac0){return _0xb7b42d[_0x8f1f('0x18')](_0xf75ad3)[_0x8f1f('0x1a')](_0x3c1ac0);}};}function respondWithFilteredResult(_0x4d2b3f,_0x1c7660){return function(_0x4ed6f5){if(_0x4ed6f5){var _0xba3b46=typeof _0x1c7660[_0x8f1f('0x1b')]==='undefined'&&typeof _0x1c7660[_0x8f1f('0x1c')]===_0x8f1f('0x1d');var _0x1ee918=_0x4ed6f5['count'];var _0x2eb2fb=_0xba3b46?0x0:_0x1c7660[_0x8f1f('0x1b')];var _0x2b0971=_0xba3b46?_0x4ed6f5[_0x8f1f('0x1e')]:_0x1c7660[_0x8f1f('0x1b')]+_0x1c7660[_0x8f1f('0x1c')];var _0x34aa32;if(_0x2b0971>=_0x1ee918){_0x2b0971=_0x1ee918;_0x34aa32=0xc8;}else{_0x34aa32=0xce;}_0x4d2b3f[_0x8f1f('0x18')](_0x34aa32);return _0x4d2b3f[_0x8f1f('0x1f')]('Content-Range',_0x2eb2fb+'-'+_0x2b0971+'/'+_0x1ee918)[_0x8f1f('0x1a')](_0x4ed6f5);}return null;};}function patchUpdates(_0x2b8f14){return function(_0x40429d){try{jsonpatch['apply'](_0x40429d,_0x2b8f14,!![]);}catch(_0x1eda2a){return BPromise['reject'](_0x1eda2a);}return _0x40429d['save']();};}function saveUpdates(_0x8ab211,_0x762946){return function(_0x160e6b){if(_0x160e6b){return _0x160e6b[_0x8f1f('0x20')](_0x8ab211)[_0x8f1f('0x21')](function(_0x48b860){return _0x48b860;});}return null;};}function removeEntity(_0x33d9ea,_0x4619d8){return function(_0x4de9c2){if(_0x4de9c2){return _0x4de9c2[_0x8f1f('0x22')]()[_0x8f1f('0x21')](function(){_0x33d9ea[_0x8f1f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d0be3,_0x501630){return function(_0x5b1b9f){if(!_0x5b1b9f){_0x2d0be3['sendStatus'](0x194);}return _0x5b1b9f;};}function handleError(_0x449225,_0x508b59){_0x508b59=_0x508b59||0x1f4;return function(_0x5b134b){logger[_0x8f1f('0x23')](_0x5b134b[_0x8f1f('0x24')]);if(_0x5b134b[_0x8f1f('0x25')]){delete _0x5b134b[_0x8f1f('0x25')];}_0x449225[_0x8f1f('0x18')](_0x508b59)[_0x8f1f('0x26')](_0x5b134b);};}exports[_0x8f1f('0x20')]=function(_0x535015,_0x5a36b8){if(_0x535015[_0x8f1f('0x27')]['id']){delete _0x535015[_0x8f1f('0x27')]['id'];}return db[_0x8f1f('0x28')]['find']({'where':{'id':_0x535015[_0x8f1f('0x29')]['id']}})['then'](handleEntityNotFound(_0x5a36b8,null))[_0x8f1f('0x21')](saveUpdates(_0x535015['body'],null))[_0x8f1f('0x21')](respondWithResult(_0x5a36b8,null))[_0x8f1f('0x2a')](handleError(_0x5a36b8,null));};exports[_0x8f1f('0x22')]=function(_0x4bd915,_0x4ee2b3){return db['Action'][_0x8f1f('0x2b')]({'where':{'id':_0x4bd915[_0x8f1f('0x29')]['id']}})[_0x8f1f('0x21')](handleEntityNotFound(_0x4ee2b3,null))[_0x8f1f('0x21')](removeEntity(_0x4ee2b3,null))[_0x8f1f('0x2a')](handleError(_0x4ee2b3,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 8a5f01f..7893d30 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 _0xdfaa=['../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x229d5a,_0x6d3d74){var _0x3d0574=function(_0x1ced06){while(--_0x1ced06){_0x229d5a['push'](_0x229d5a['shift']());}};_0x3d0574(++_0x6d3d74);}(_0xdfaa,0x1c6));var _0xadfa=function(_0xd2b9e,_0x410a4d){_0xd2b9e=_0xd2b9e-0x0;var _0x496ed6=_0xdfaa[_0xd2b9e];return _0x496ed6;};'use strict';var _=require(_0xadfa('0x0'));var util=require(_0xadfa('0x1'));var logger=require(_0xadfa('0x2'))('api');var moment=require(_0xadfa('0x3'));var BPromise=require(_0xadfa('0x4'));var rp=require(_0xadfa('0x5'));var fs=require('fs');var path=require(_0xadfa('0x6'));var rimraf=require(_0xadfa('0x7'));var config=require(_0xadfa('0x8'));var attributes=require(_0xadfa('0x9'));module[_0xadfa('0xa')]=function(_0x1c639a,_0x6d86f){return _0x1c639a[_0xadfa('0xb')](_0xadfa('0xc'),attributes,{'tableName':_0xadfa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0c1a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define','tools_actions','lodash','util','../../config/logger'];(function(_0x2649d9,_0x513732){var _0x55c610=function(_0x274f07){while(--_0x274f07){_0x2649d9['push'](_0x2649d9['shift']());}};_0x55c610(++_0x513732);}(_0x0c1a,0x169));var _0xa0c1=function(_0x43af1f,_0x21d836){_0x43af1f=_0x43af1f-0x0;var _0x113ec2=_0x0c1a[_0x43af1f];return _0x113ec2;};'use strict';var _=require(_0xa0c1('0x0'));var util=require(_0xa0c1('0x1'));var logger=require(_0xa0c1('0x2'))(_0xa0c1('0x3'));var moment=require(_0xa0c1('0x4'));var BPromise=require(_0xa0c1('0x5'));var rp=require(_0xa0c1('0x6'));var fs=require('fs');var path=require(_0xa0c1('0x7'));var rimraf=require(_0xa0c1('0x8'));var config=require(_0xa0c1('0x9'));var attributes=require(_0xa0c1('0xa'));module['exports']=function(_0x3be00e,_0x3f194b){return _0x3be00e[_0xa0c1('0xb')]('Action',attributes,{'tableName':_0xa0c1('0xc'),'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 cbcc9ee..42b8eb1 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1b1730,_0x220ccc){var _0x1fad11=function(_0x52a28e){while(--_0x52a28e){_0x1b1730['push'](_0x1b1730['shift']());}};_0x1fad11(++_0x220ccc);}(_0x5fc3,0xa8));var _0x35fc=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0x5fc3[_0x389832];return _0x59429e;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x275803,_0x148216){var _0x33a595=function(_0x16fed9){while(--_0x16fed9){_0x275803['push'](_0x275803['shift']());}};_0x33a595(++_0x148216);}(_0xabce,0x103));var _0xeabc=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xabce[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 7f784f8..412af97 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 _0x2cc7=['/:id','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete'];(function(_0x210f26,_0x1455da){var _0x5a368c=function(_0x8c6c02){while(--_0x8c6c02){_0x210f26['push'](_0x210f26['shift']());}};_0x5a368c(++_0x1455da);}(_0x2cc7,0xa8));var _0x72cc=function(_0x30b40c,_0x1e6324){_0x30b40c=_0x30b40c-0x0;var _0xd6f652=_0x2cc7[_0x30b40c];return _0xd6f652;};'use strict';var multer=require(_0x72cc('0x0'));var util=require('util');var path=require(_0x72cc('0x1'));var timeout=require(_0x72cc('0x2'));var express=require('express');var router=express[_0x72cc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x72cc('0x4'));var interaction=require(_0x72cc('0x5'));var config=require(_0x72cc('0x6'));var controller=require(_0x72cc('0x7'));router[_0x72cc('0x8')]('/:id',auth[_0x72cc('0x9')](),controller[_0x72cc('0xa')]);router[_0x72cc('0xb')](_0x72cc('0xc'),auth[_0x72cc('0x9')](),controller[_0x72cc('0xd')]);module[_0x72cc('0xe')]=router;
\ No newline at end of file
+var _0x0c9a=['destroy','exports','util','path','connect-timeout','Router','../../config/environment','put','/:id','delete','isAuthenticated'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0c9a,0x136));var _0xa0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xa0c9('0x0'));var path=require(_0xa0c9('0x1'));var timeout=require(_0xa0c9('0x2'));var express=require('express');var router=express[_0xa0c9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa0c9('0x4'));var controller=require('./action.controller');router[_0xa0c9('0x5')](_0xa0c9('0x6'),auth['isAuthenticated'](),controller['update']);router[_0xa0c9('0x7')](_0xa0c9('0x6'),auth[_0xa0c9('0x8')](),controller[_0xa0c9('0x9')]);module[_0xa0c9('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index a865871..72ee61f 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 _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x5c37e8,_0x4abedf){var _0x26024d=function(_0x41e396){while(--_0x41e396){_0x5c37e8['push'](_0x5c37e8['shift']());}};_0x26024d(++_0x4abedf);}(_0xeff8,0x186));var _0x8eff=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0xeff8[_0x365be9];return _0x185c12;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}};
\ No newline at end of file
+var _0xee14=['STRING','TEXT'];(function(_0x2135bd,_0x42ad02){var _0x394fec=function(_0x201817){while(--_0x201817){_0x2135bd['push'](_0x2135bd['shift']());}};_0x394fec(++_0x42ad02);}(_0xee14,0x13a));var _0x4ee1=function(_0x284692,_0x2c8094){_0x284692=_0x284692-0x0;var _0x63a287=_0xee14[_0x284692];return _0x63a287;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 7844ba2..5c0e64c 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 _0xbce4=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticCustomReport','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%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)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','field','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','ROUND(%s)','ValidationErrorItem','table','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','fieldName','type'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xbce4,0x76));var _0x4bce=function(_0x21d83c,_0x2901d4){_0x21d83c=_0x21d83c-0x0;var _0x414b48=_0xbce4[_0x21d83c];return _0x414b48;};'use strict';var emlformat=require(_0x4bce('0x0'));var rimraf=require(_0x4bce('0x1'));var zipdir=require(_0x4bce('0x2'));var jsonpatch=require(_0x4bce('0x3'));var rp=require(_0x4bce('0x4'));var moment=require('moment');var BPromise=require(_0x4bce('0x5'));var Mustache=require(_0x4bce('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4bce('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4bce('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4bce('0x9'));var deskjs=require(_0x4bce('0xa'));var toCsv=require(_0x4bce('0xb'));var querystring=require('querystring');var Papa=require(_0x4bce('0xc'));var Redis=require(_0x4bce('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4bce('0xe'));var as=require(_0x4bce('0xf'));var hardwareService=require(_0x4bce('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x4bce('0x11'));var config=require(_0x4bce('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x4bce('0x13')];function respondWithStatusCode(_0x910d5c,_0x50e16c){_0x50e16c=_0x50e16c||0xcc;return function(_0xc448c2){if(_0xc448c2){return _0x910d5c[_0x4bce('0x14')](_0x50e16c);}return _0x910d5c[_0x4bce('0x15')](_0x50e16c)[_0x4bce('0x16')]();};}function respondWithResult(_0x526614,_0x281266){_0x281266=_0x281266||0xc8;return function(_0x2afeb9){if(_0x2afeb9){return _0x526614[_0x4bce('0x15')](_0x281266)[_0x4bce('0x17')](_0x2afeb9);}};}function respondWithFilteredResult(_0x25d0dd,_0x55efa8){return function(_0x4bf792){if(_0x4bf792){var _0x482518=typeof _0x55efa8[_0x4bce('0x18')]===_0x4bce('0x19')&&typeof _0x55efa8[_0x4bce('0x1a')]===_0x4bce('0x19');var _0x7627ef=_0x4bf792[_0x4bce('0x1b')];var _0x332cca=_0x482518?0x0:_0x55efa8[_0x4bce('0x18')];var _0xc04bbd=_0x482518?_0x4bf792['count']:_0x55efa8[_0x4bce('0x18')]+_0x55efa8['limit'];var _0x1a853a;if(_0xc04bbd>=_0x7627ef){_0xc04bbd=_0x7627ef;_0x1a853a=0xc8;}else{_0x1a853a=0xce;}_0x25d0dd['status'](_0x1a853a);return _0x25d0dd[_0x4bce('0x1c')]('Content-Range',_0x332cca+'-'+_0xc04bbd+'/'+_0x7627ef)[_0x4bce('0x17')](_0x4bf792);}return null;};}function patchUpdates(_0x1b72ac){return function(_0x5101d9){try{jsonpatch[_0x4bce('0x1d')](_0x5101d9,_0x1b72ac,!![]);}catch(_0x521eb5){return BPromise[_0x4bce('0x1e')](_0x521eb5);}return _0x5101d9[_0x4bce('0x1f')]();};}function saveUpdates(_0x493386,_0x1b1e63){return function(_0x59a644){if(_0x59a644){return _0x59a644[_0x4bce('0x20')](_0x493386)[_0x4bce('0x21')](function(_0x21675a){return _0x21675a;});}return null;};}function removeEntity(_0x13aab1,_0x50c4cf){return function(_0x294c29){if(_0x294c29){return _0x294c29[_0x4bce('0x22')]()['then'](function(){var _0x3dab68=_0x294c29[_0x4bce('0x23')]({'plain':!![]});var _0x14468f='CustomReports';return db[_0x4bce('0x24')][_0x4bce('0x22')]({'where':{'type':_0x14468f,'resourceId':_0x3dab68['id']}})[_0x4bce('0x21')](function(){return _0x294c29;});})[_0x4bce('0x21')](function(){_0x13aab1[_0x4bce('0x15')](0xcc)[_0x4bce('0x16')]();});}};}function handleEntityNotFound(_0x11c2eb,_0x3b70bf){return function(_0x28b030){if(!_0x28b030){_0x11c2eb[_0x4bce('0x14')](0x194);}return _0x28b030;};}function handleError(_0x1102e0,_0x3a8e18){_0x3a8e18=_0x3a8e18||0x1f4;return function(_0x193e2d){logger[_0x4bce('0x25')](_0x193e2d[_0x4bce('0x26')]);if(_0x193e2d[_0x4bce('0x27')]){delete _0x193e2d['name'];}_0x1102e0[_0x4bce('0x15')](_0x3a8e18)[_0x4bce('0x28')](_0x193e2d);};}exports['index']=function(_0x1c843b,_0x5047ef){var _0x127197={},_0x2e249f={},_0x21b3f={'count':0x0,'rows':[]};var _0x26d2ee=_[_0x4bce('0x29')](db['AnalyticCustomReport']['rawAttributes'],function(_0x3f29f2){return{'name':_0x3f29f2[_0x4bce('0x2a')],'type':_0x3f29f2[_0x4bce('0x2b')][_0x4bce('0x2c')]};});_0x2e249f[_0x4bce('0x2d')]=_[_0x4bce('0x29')](_0x26d2ee,_0x4bce('0x27'));_0x2e249f[_0x4bce('0x2e')]=_[_0x4bce('0x2f')](_0x1c843b[_0x4bce('0x2e')]);_0x2e249f[_0x4bce('0x30')]=_[_0x4bce('0x31')](_0x2e249f[_0x4bce('0x2d')],_0x2e249f[_0x4bce('0x2e')]);_0x127197[_0x4bce('0x32')]=_[_0x4bce('0x31')](_0x2e249f['model'],qs[_0x4bce('0x33')](_0x1c843b[_0x4bce('0x2e')][_0x4bce('0x33')]));_0x127197[_0x4bce('0x32')]=_0x127197[_0x4bce('0x32')][_0x4bce('0x34')]?_0x127197[_0x4bce('0x32')]:_0x2e249f['model'];if(!_0x1c843b[_0x4bce('0x2e')]['hasOwnProperty']('nolimit')){_0x127197['limit']=qs[_0x4bce('0x1a')](_0x1c843b[_0x4bce('0x2e')][_0x4bce('0x1a')]);_0x127197[_0x4bce('0x18')]=qs[_0x4bce('0x18')](_0x1c843b[_0x4bce('0x2e')][_0x4bce('0x18')]);}_0x127197[_0x4bce('0x35')]=qs[_0x4bce('0x36')](_0x1c843b[_0x4bce('0x2e')][_0x4bce('0x36')]);_0x127197[_0x4bce('0x37')]=qs[_0x4bce('0x30')](_[_0x4bce('0x38')](_0x1c843b[_0x4bce('0x2e')],_0x2e249f['filters']),_0x26d2ee);if(_0x1c843b['query']['filter']){_0x127197['where']=_[_0x4bce('0x39')](_0x127197[_0x4bce('0x37')],{'$or':_[_0x4bce('0x29')](_0x26d2ee,function(_0x28b83d){if(_0x28b83d[_0x4bce('0x2b')]!==_0x4bce('0x3a')){var _0x4061cf={};_0x4061cf[_0x28b83d[_0x4bce('0x27')]]={'$like':'%'+_0x1c843b[_0x4bce('0x2e')][_0x4bce('0x3b')]+'%'};return _0x4061cf;}})});}_0x127197=_[_0x4bce('0x39')]({},_0x127197,_0x1c843b[_0x4bce('0x3c')]);var _0x2e0446={'where':_0x127197[_0x4bce('0x37')]};return db[_0x4bce('0x3d')][_0x4bce('0x1b')](_0x2e0446)[_0x4bce('0x21')](function(_0x3bd8dd){_0x21b3f[_0x4bce('0x1b')]=_0x3bd8dd;if(_0x1c843b[_0x4bce('0x2e')][_0x4bce('0x3e')]){_0x127197[_0x4bce('0x3f')]=[{'all':!![]}];}return db[_0x4bce('0x3d')][_0x4bce('0x40')](_0x127197);})[_0x4bce('0x21')](function(_0x37f958){_0x21b3f['rows']=_0x37f958;return _0x21b3f;})['then'](respondWithFilteredResult(_0x5047ef,_0x127197))[_0x4bce('0x41')](handleError(_0x5047ef,null));};exports[_0x4bce('0x42')]=function(_0x570049,_0x2fa25c){var _0x4ec547={'raw':![],'where':{'id':_0x570049[_0x4bce('0x43')]['id']}},_0x2dbe3f={};_0x2dbe3f[_0x4bce('0x2d')]=_[_0x4bce('0x2f')](db[_0x4bce('0x3d')][_0x4bce('0x44')]);_0x2dbe3f['query']=_[_0x4bce('0x2f')](_0x570049[_0x4bce('0x2e')]);_0x2dbe3f[_0x4bce('0x30')]=_[_0x4bce('0x31')](_0x2dbe3f[_0x4bce('0x2d')],_0x2dbe3f[_0x4bce('0x2e')]);_0x4ec547[_0x4bce('0x32')]=_[_0x4bce('0x31')](_0x2dbe3f[_0x4bce('0x2d')],qs[_0x4bce('0x33')](_0x570049[_0x4bce('0x2e')][_0x4bce('0x33')]));_0x4ec547[_0x4bce('0x32')]=_0x4ec547['attributes'][_0x4bce('0x34')]?_0x4ec547[_0x4bce('0x32')]:_0x2dbe3f[_0x4bce('0x2d')];if(_0x570049[_0x4bce('0x2e')][_0x4bce('0x3e')]){_0x4ec547[_0x4bce('0x3f')]=[{'all':!![]}];}_0x4ec547=_['merge']({},_0x4ec547,_0x570049[_0x4bce('0x3c')]);return db['AnalyticCustomReport']['find'](_0x4ec547)[_0x4bce('0x21')](handleEntityNotFound(_0x2fa25c,null))[_0x4bce('0x21')](respondWithResult(_0x2fa25c,null))[_0x4bce('0x41')](handleError(_0x2fa25c,null));};exports[_0x4bce('0x45')]=function(_0x20f25b,_0x40ffcc){return db[_0x4bce('0x3d')][_0x4bce('0x45')](_0x20f25b[_0x4bce('0x46')],{})[_0x4bce('0x21')](function(_0x19075c){var _0x1d4993=_0x20f25b[_0x4bce('0x47')]['get']({'plain':!![]});if(!_0x1d4993)throw new Error(_0x4bce('0x48'));if(_0x1d4993[_0x4bce('0x49')]===_0x4bce('0x47')){var _0x44e206=_0x19075c[_0x4bce('0x23')]({'plain':!![]});var _0x509947=_0x4bce('0x4a');return db[_0x4bce('0x4b')][_0x4bce('0x4c')]({'where':{'name':_0x509947,'userProfileId':_0x1d4993[_0x4bce('0x4d')]},'raw':!![]})[_0x4bce('0x21')](function(_0x8c373f){if(_0x8c373f&&_0x8c373f[_0x4bce('0x4e')]===0x0){return db[_0x4bce('0x24')][_0x4bce('0x45')]({'name':_0x44e206[_0x4bce('0x27')],'resourceId':_0x44e206['id'],'type':_0x4bce('0x4f'),'sectionId':_0x8c373f['id']},{})[_0x4bce('0x21')](function(){return _0x19075c;});}else{return _0x19075c;}})[_0x4bce('0x41')](function(_0x41a05b){logger[_0x4bce('0x25')](_0x4bce('0x50'),_0x41a05b);throw _0x41a05b;});}return _0x19075c;})[_0x4bce('0x21')](respondWithResult(_0x40ffcc,0xc9))[_0x4bce('0x41')](handleError(_0x40ffcc,null));};exports['update']=function(_0x8baed6,_0x1644e9){if(_0x8baed6[_0x4bce('0x46')]['id']){delete _0x8baed6[_0x4bce('0x46')]['id'];}return db[_0x4bce('0x3d')][_0x4bce('0x4c')]({'where':{'id':_0x8baed6[_0x4bce('0x43')]['id']}})[_0x4bce('0x21')](handleEntityNotFound(_0x1644e9,null))[_0x4bce('0x21')](saveUpdates(_0x8baed6[_0x4bce('0x46')],null))[_0x4bce('0x21')](respondWithResult(_0x1644e9,null))['catch'](handleError(_0x1644e9,null));};exports[_0x4bce('0x22')]=function(_0x3ca74d,_0x2a8bb7){return db[_0x4bce('0x3d')][_0x4bce('0x4c')]({'where':{'id':_0x3ca74d[_0x4bce('0x43')]['id']}})[_0x4bce('0x21')](handleEntityNotFound(_0x2a8bb7,null))[_0x4bce('0x21')](removeEntity(_0x2a8bb7,null))[_0x4bce('0x41')](handleError(_0x2a8bb7,null));};exports['preview']=function(_0x5d5e20,_0x5c3cbf){var _0x19a3b3=0xa;var _0x5335af=[_0x4bce('0x51'),_0x4bce('0x52'),_0x4bce('0x53'),_0x4bce('0x54')];var _0x5f336f={'SUM':_0x4bce('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4bce('0x56'),'MAX':_0x4bce('0x57'),'MIN':_0x4bce('0x58'),'AVG':_0x4bce('0x59'),'GROUP_CONCAT':_0x4bce('0x5a'),'GROUP_CONCAT ASC':_0x4bce('0x5b'),'GROUP_CONCAT DESC':_0x4bce('0x5c')};var _0x2e9e3d={'SEC_TO_TIME':_0x4bce('0x5d'),'DATE':_0x4bce('0x5e'),'HOUR':_0x4bce('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4bce('0x60')};var _0x17fb99=function(_0x200113){return!_[_0x4bce('0x61')]([_0x4bce('0x62'),'IS\x20NOT\x20NULL',_0x4bce('0x63'),_0x4bce('0x64')],_0x200113);};var _0xe51977=function(_0x4ac33b){if(!_0x4ac33b||!_0x4ac33b[_0x4bce('0x65')][_0x4bce('0x34')]){return'';}for(var _0x2323ba='(',_0x5e62ae=0x0;_0x5e62ae<_0x4ac33b['rules'][_0x4bce('0x34')];_0x5e62ae+=0x1){_0x5e62ae>0x0&&(_0x2323ba+='\x20'+_0x4ac33b[_0x4bce('0x66')]+'\x20');_0x2323ba+=_0x4ac33b[_0x4bce('0x65')][_0x5e62ae][_0x4bce('0x67')]?_0xe51977(_0x4ac33b[_0x4bce('0x65')][_0x5e62ae]['group']):_0x4ac33b[_0x4bce('0x65')][_0x5e62ae]['field']+'\x20'+_0x4ac33b[_0x4bce('0x65')][_0x5e62ae][_0x4bce('0x68')]+(_0x17fb99(_0x4ac33b['rules'][_0x5e62ae]['condition'])?'\x20'+_0x4ac33b[_0x4bce('0x65')][_0x5e62ae][_0x4bce('0x69')]:'');}return _0x2323ba+')';};var _0x43f496={'where':{'id':_0x5d5e20[_0x4bce('0x43')]['id']}},_0xce4518,_0x1ce19a,_0x1546c5,_0x106920,_0x32f626;_0x43f496=_[_0x4bce('0x39')]({},_0x43f496,_0x5d5e20[_0x4bce('0x3c')]);return db[_0x4bce('0x3d')][_0x4bce('0x4c')](_0x43f496)[_0x4bce('0x21')](function(_0xb8cbcf){if(_0xb8cbcf){_0xce4518=_0xb8cbcf;return _0xb8cbcf[_0x4bce('0x6a')]();}return null;})[_0x4bce('0x21')](function(_0x1dc282){if(_0x1dc282){if(!_0x1dc282['length']){throw new db[(_0x4bce('0x6b'))]['ValidationErrorItem'](_0x4bce('0x6c'),0x193);}_0x1ce19a=_0x1dc282;return db[_0x4bce('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x4bce('0x21')](function(_0x75c1c5){if(_0x75c1c5){_0x1546c5=_[_0x4bce('0x6e')](_0x75c1c5,'id');var _0x5990c9;var _0x2b829d=squel[_0x4bce('0x6f')]();_0x2b829d[_0x4bce('0x70')](_0xce4518['table']);for(var _0x2fd96b=0x0;_0x2fd96b<_0x1ce19a[_0x4bce('0x34')];_0x2fd96b+=0x1){_0x5990c9=_0x1ce19a[_0x2fd96b][_0x4bce('0x71')]?_0x1546c5[_0x1ce19a[_0x2fd96b]['MetricId']][_0x4bce('0x72')]:_0x1ce19a[_0x2fd96b][_0x4bce('0x73')];_0x5990c9=_0x1ce19a[_0x2fd96b]['function']?_['replace'](_0x5f336f[_0x1ce19a[_0x2fd96b][_0x4bce('0x74')]],'%s',_0x5990c9):_0x5990c9;_0x5990c9=_0x1ce19a[_0x2fd96b][_0x4bce('0x75')]?_[_0x4bce('0x76')](_0x2e9e3d[_0x1ce19a[_0x2fd96b]['format']],'%s',_0x5990c9):_0x5990c9;if(_0x1ce19a[_0x2fd96b][_0x4bce('0x77')]){_0x2b829d[_0x4bce('0x67')](_0x5990c9);}_0x1ce19a[_0x2fd96b][_0x4bce('0x78')]&&_0x2b829d[_0x4bce('0x35')](_0x5990c9,_0x1ce19a[_0x2fd96b][_0x4bce('0x78')]===_0x4bce('0x79')?![]:!![]);_0x2b829d['field'](_0x5990c9,_0x1ce19a[_0x2fd96b][_0x4bce('0x7a')]||_0x5990c9);}if(_0xce4518[_0x4bce('0x7b')]){_0xce4518[_0x4bce('0x7b')]=JSON[_0x4bce('0x7c')](_0xce4518['joins']);for(var _0xdb9bff=0x0;_0xdb9bff<_0xce4518[_0x4bce('0x7b')][_0x4bce('0x34')];_0xdb9bff+=0x1){if(_0xce4518[_0x4bce('0x7b')][_0xdb9bff][_0x4bce('0x2b')]&&_['includes'](_0x5335af,_0xce4518[_0x4bce('0x7b')][_0xdb9bff]['type'])&&_0xce4518[_0x4bce('0x7b')][_0xdb9bff][_0x4bce('0x7d')]&&_0xce4518[_0x4bce('0x7b')][_0xdb9bff][_0x4bce('0x7e')]&&_0xce4518[_0x4bce('0x7b')][_0xdb9bff]['foreignKey']){_0x2b829d[_0xce4518[_0x4bce('0x7b')][_0xdb9bff][_0x4bce('0x2b')]](_0xce4518[_0x4bce('0x7b')][_0xdb9bff][_0x4bce('0x7e')],null,util[_0x4bce('0x75')](_0x4bce('0x7f'),_0xce4518['table'],_0xce4518[_0x4bce('0x7b')][_0xdb9bff][_0x4bce('0x7d')],_0xce4518[_0x4bce('0x7b')][_0xdb9bff]['foreignTable'],_0xce4518[_0x4bce('0x7b')][_0xdb9bff][_0x4bce('0x80')]));}}}if(_0xce4518[_0x4bce('0x81')]){_0xce4518['conditions']=JSON[_0x4bce('0x7c')](_0xce4518[_0x4bce('0x81')]);_0x2b829d[_0x4bce('0x37')](_0xe51977(_0xce4518['conditions'][_0x4bce('0x67')]));}_0x32f626=_0x2b829d[_0x4bce('0x82')]();_0x2b829d[_0x4bce('0x1a')](_0x19a3b3);_0x2b829d[_0x4bce('0x18')](0x0);logger['debug'](_0x4bce('0x83'),_0x2b829d[_0x4bce('0x84')]());return dbH[_0x4bce('0x85')][_0x4bce('0x2e')](_0x2b829d['toString'](),{'type':dbH[_0x4bce('0x85')][_0x4bce('0x86')][_0x4bce('0x87')]});}})[_0x4bce('0x21')](respondWithResult(_0x5c3cbf,null))[_0x4bce('0x41')](handleError(_0x5c3cbf,null));};function runReport(_0x5b6985,_0x69f29d,_0x40d8bd){var _0x52c5d3=_0x69f29d['name'];var _0x4a069e=0xa;var _0x57c436=['join',_0x4bce('0x52'),_0x4bce('0x53'),_0x4bce('0x54')];var _0x57fc4c={'SUM':_0x4bce('0x55'),'COUNT':_0x4bce('0x88'),'COUNT DISTINCT':_0x4bce('0x56'),'MAX':_0x4bce('0x57'),'MIN':_0x4bce('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4bce('0x5a'),'GROUP_CONCAT ASC':_0x4bce('0x5b'),'GROUP_CONCAT DESC':_0x4bce('0x5c')};var _0x57db78={'SEC_TO_TIME':_0x4bce('0x5d'),'DATE':_0x4bce('0x5e'),'HOUR':_0x4bce('0x5f'),'ROUND':_0x4bce('0x89'),'UNIX_TIMESTAMP':_0x4bce('0x60')};var _0xaeb4cd=function(_0x3a488f){return!_[_0x4bce('0x61')]([_0x4bce('0x62'),'IS\x20NOT\x20NULL',_0x4bce('0x63'),'IS\x20NOT\x20EMPTY'],_0x3a488f);};var _0x677047=function(_0x3be4a6){if(!_0x3be4a6||!_0x3be4a6['rules'][_0x4bce('0x34')]){return'';}for(var _0x1351cb='(',_0x517ef4=0x0;_0x517ef4<_0x3be4a6[_0x4bce('0x65')][_0x4bce('0x34')];_0x517ef4+=0x1){_0x517ef4>0x0&&(_0x1351cb+='\x20'+_0x3be4a6[_0x4bce('0x66')]+'\x20');_0x1351cb+=_0x3be4a6['rules'][_0x517ef4][_0x4bce('0x67')]?_0x677047(_0x3be4a6[_0x4bce('0x65')][_0x517ef4][_0x4bce('0x67')]):_0x3be4a6[_0x4bce('0x65')][_0x517ef4][_0x4bce('0x73')]+'\x20'+_0x3be4a6[_0x4bce('0x65')][_0x517ef4][_0x4bce('0x68')]+(_0xaeb4cd(_0x3be4a6['rules'][_0x517ef4][_0x4bce('0x68')])?'\x20'+_0x3be4a6['rules'][_0x517ef4][_0x4bce('0x69')]:'');}return _0x1351cb+')';};var _0x2cf8a0={'where':{'id':_0x5b6985['id']}},_0x3bdbd5,_0x3eb645,_0x262525,_0xec6b3a,_0x448a71;_0x2cf8a0=_['merge']({},_0x2cf8a0,_0x40d8bd);return db[_0x4bce('0x3d')][_0x4bce('0x4c')](_0x2cf8a0)[_0x4bce('0x21')](function(_0x67631e){if(_0x67631e){_0x3bdbd5=_0x67631e;return _0x67631e[_0x4bce('0x6a')]();}return null;})['then'](function(_0x379f9e){if(_0x379f9e){if(!_0x379f9e['length']){throw new db['Sequelize'][(_0x4bce('0x8a'))](_0x4bce('0x6c'),0x193);}_0x3eb645=_0x379f9e;return db['AnalyticMetric'][_0x4bce('0x40')]({'raw':!![]});}return null;})[_0x4bce('0x21')](function(_0x17953a){if(_0x17953a){_0x262525=_[_0x4bce('0x6e')](_0x17953a,'id');var _0x5eb332;var _0x2acb14=squel[_0x4bce('0x6f')]();_0x2acb14['from'](_0x3bdbd5[_0x4bce('0x8b')]);for(var _0x14998a=0x0;_0x14998a<_0x3eb645['length'];_0x14998a+=0x1){_0x5eb332=_0x3eb645[_0x14998a][_0x4bce('0x71')]?_0x262525[_0x3eb645[_0x14998a]['MetricId']]['metric']:_0x3eb645[_0x14998a][_0x4bce('0x73')];_0x5eb332=_0x3eb645[_0x14998a][_0x4bce('0x74')]?_['replace'](_0x57fc4c[_0x3eb645[_0x14998a][_0x4bce('0x74')]],'%s',_0x5eb332):_0x5eb332;_0x5eb332=_0x3eb645[_0x14998a][_0x4bce('0x75')]?_[_0x4bce('0x76')](_0x57db78[_0x3eb645[_0x14998a]['format']],'%s',_0x5eb332):_0x5eb332;if(_0x3eb645[_0x14998a][_0x4bce('0x77')]){_0x2acb14[_0x4bce('0x67')](_0x5eb332);}_0x3eb645[_0x14998a][_0x4bce('0x78')]&&_0x2acb14[_0x4bce('0x35')](_0x5eb332,_0x3eb645[_0x14998a][_0x4bce('0x78')]==='DESC'?![]:!![]);_0x2acb14[_0x4bce('0x73')](_0x5eb332,_0x3eb645[_0x14998a]['alias']||_0x5eb332);}if(_0x3bdbd5[_0x4bce('0x7b')]){_0x3bdbd5[_0x4bce('0x7b')]=JSON[_0x4bce('0x7c')](_0x3bdbd5[_0x4bce('0x7b')]);for(var _0x57eab3=0x0;_0x57eab3<_0x3bdbd5[_0x4bce('0x7b')]['length'];_0x57eab3+=0x1){if(_0x3bdbd5[_0x4bce('0x7b')][_0x57eab3][_0x4bce('0x2b')]&&_[_0x4bce('0x61')](_0x57c436,_0x3bdbd5[_0x4bce('0x7b')][_0x57eab3]['type'])&&_0x3bdbd5['joins'][_0x57eab3][_0x4bce('0x7d')]&&_0x3bdbd5['joins'][_0x57eab3]['foreignTable']&&_0x3bdbd5[_0x4bce('0x7b')][_0x57eab3][_0x4bce('0x80')]){_0x2acb14[_0x3bdbd5['joins'][_0x57eab3][_0x4bce('0x2b')]](_0x3bdbd5[_0x4bce('0x7b')][_0x57eab3][_0x4bce('0x7e')],null,util[_0x4bce('0x75')]('%s.%s\x20=\x20%s.%s',_0x3bdbd5['table'],_0x3bdbd5[_0x4bce('0x7b')][_0x57eab3][_0x4bce('0x7d')],_0x3bdbd5[_0x4bce('0x7b')][_0x57eab3][_0x4bce('0x7e')],_0x3bdbd5['joins'][_0x57eab3]['foreignKey']));}}}if(_0x3bdbd5['conditions']){_0x3bdbd5[_0x4bce('0x81')]=JSON[_0x4bce('0x7c')](_0x3bdbd5[_0x4bce('0x81')]);_0x2acb14[_0x4bce('0x37')](_0x677047(_0x3bdbd5['conditions'][_0x4bce('0x67')]));}_0x448a71=_0x2acb14['clone']();_0x2acb14[_0x4bce('0x1a')](_0x4a069e);_0x2acb14[_0x4bce('0x18')](0x0);return;}})[_0x4bce('0x21')](function(){if(_0x69f29d[_0x4bce('0x8c')]==='web'){return null;}var _0x3a275a=_['merge'](_0x69f29d,{'name':_0x69f29d[_0x4bce('0x8d')]||_0x69f29d[_0x4bce('0x27')]||_0x3bdbd5['name'],'basename':_0x52c5d3,'savename':util['format'](_0x4bce('0x8e'),_0x69f29d[_0x4bce('0x27')]||_0x3bdbd5[_0x4bce('0x27')],require(_0x4bce('0x8f'))[_0x4bce('0x90')](0x4),_0x69f29d[_0x4bce('0x8c')]||_0x4bce('0x91')),'reportId':_0x3bdbd5['id'],'reportType':_0x4bce('0x92')});return db[_0x4bce('0x93')]['create'](_0x3a275a,{'raw':!![]});})['then'](function(_0x2f0af8){if(_0x3bdbd5[_0x4bce('0x8b')]===_0x4bce('0x94')){_0x448a71[_0x4bce('0x37')](_0x3bdbd5[_0x4bce('0x8b')]+_0x4bce('0x95'),_0x69f29d[_0x4bce('0x96')],_0x69f29d[_0x4bce('0x97')]);}else{_0x448a71[_0x4bce('0x37')](_0x3bdbd5[_0x4bce('0x8b')]+_0x4bce('0x98'),_0x69f29d[_0x4bce('0x96')],_0x69f29d[_0x4bce('0x97')]);}if(_0x2f0af8){logger[_0x4bce('0x99')]('Run\x20Query:',_0x448a71['toString']());require(_0x4bce('0x9a'))['fork'](path[_0x4bce('0x51')](__dirname,_0x4bce('0x9b'),_0x2f0af8[_0x4bce('0x8c')]),[_0x2f0af8['id'],_0x448a71[_0x4bce('0x84')](),path[_0x4bce('0x51')](__dirname,_0x4bce('0x9c'),_0x2f0af8[_0x4bce('0x9d')]),_0x52c5d3]);return _0x2f0af8;}else{var _0x308979=squel[_0x4bce('0x6f')]();_0x308979[_0x4bce('0x70')]('('+_0x448a71[_0x4bce('0x84')]()+')',_0x4bce('0x9e'));_0x308979[_0x4bce('0x73')](_0x4bce('0x9f'),'count');_0x448a71[_0x4bce('0x1a')](_0x69f29d[_0x4bce('0x1a')]||_0x4a069e);_0x448a71[_0x4bce('0x18')](_0x69f29d[_0x4bce('0x18')]||0x0);return dbH[_0x4bce('0x85')][_0x4bce('0x2e')](_0x308979['toString'](),{'type':dbH[_0x4bce('0x85')][_0x4bce('0x86')]['SELECT']})[_0x4bce('0x21')](function(_0x168b67){if(!_0x168b67[_0x4bce('0x34')]){_0xec6b3a=0x0;}else{_0xec6b3a=_0x168b67[0x0][_0x4bce('0x1b')]||0x0;}return dbH['sequelize'][_0x4bce('0x2e')](_0x448a71[_0x4bce('0x84')](),{'type':dbH['sequelize'][_0x4bce('0x86')][_0x4bce('0x87')]});})[_0x4bce('0x21')](function(_0x589613){return{'rows':_0x589613||[],'count':_0xec6b3a};});}});}exports['run']=function(_0xf590b1,_0x2d94f7){return runReport(_0xf590b1[_0x4bce('0x43')],_0xf590b1['query'],_0xf590b1[_0x4bce('0x3c')])[_0x4bce('0x21')](respondWithResult(_0x2d94f7,null))['catch'](handleError(_0x2d94f7,null));};exports[_0x4bce('0xa0')]=runReport;exports[_0x4bce('0x2e')]=function(_0x43b334,_0x177167){var _0x2f346c=0xa;var _0x3dc540=[_0x4bce('0x51'),'left_join',_0x4bce('0x53'),'cross_join'];var _0x44a957={'SUM':_0x4bce('0x55'),'COUNT':_0x4bce('0x88'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x4bce('0x58'),'AVG':_0x4bce('0x59'),'GROUP_CONCAT':_0x4bce('0x5a'),'GROUP_CONCAT ASC':_0x4bce('0x5b'),'GROUP_CONCAT DESC':_0x4bce('0x5c')};var _0x327c64={'SEC_TO_TIME':_0x4bce('0x5d'),'DATE':_0x4bce('0x5e'),'HOUR':_0x4bce('0x5f'),'ROUND':_0x4bce('0x89'),'UNIX_TIMESTAMP':_0x4bce('0x60')};var _0x64f6de=function(_0x3cfd89){return!_[_0x4bce('0x61')]([_0x4bce('0x62'),_0x4bce('0xa1'),_0x4bce('0x63'),'IS\x20NOT\x20EMPTY'],_0x3cfd89);};var _0x30a83a=function(_0xd3f16){if(!_0xd3f16||!_0xd3f16[_0x4bce('0x65')][_0x4bce('0x34')]){return'';}for(var _0x50d18f='(',_0x290bb9=0x0;_0x290bb9<_0xd3f16['rules'][_0x4bce('0x34')];_0x290bb9+=0x1){_0x290bb9>0x0&&(_0x50d18f+='\x20'+_0xd3f16[_0x4bce('0x66')]+'\x20');_0x50d18f+=_0xd3f16[_0x4bce('0x65')][_0x290bb9]['group']?_0x30a83a(_0xd3f16[_0x4bce('0x65')][_0x290bb9][_0x4bce('0x67')]):_0xd3f16[_0x4bce('0x65')][_0x290bb9]['field']+'\x20'+_0xd3f16[_0x4bce('0x65')][_0x290bb9][_0x4bce('0x68')]+(_0x64f6de(_0xd3f16[_0x4bce('0x65')][_0x290bb9][_0x4bce('0x68')])?'\x20'+_0xd3f16[_0x4bce('0x65')][_0x290bb9]['value']:'');}return _0x50d18f+')';};var _0x4f6211={'where':{'id':_0x43b334['params']['id']}},_0x5ea2a5,_0x30889b,_0x1eb78c,_0x3b9172,_0x3846d1;_0x4f6211=_[_0x4bce('0x39')]({},_0x4f6211,_0x43b334['options']);return db[_0x4bce('0x3d')]['find'](_0x4f6211)[_0x4bce('0x21')](function(_0x84daaf){if(_0x84daaf){_0x5ea2a5=_0x84daaf;return _0x84daaf[_0x4bce('0x6a')]();}return null;})['then'](function(_0x59f827){if(_0x59f827){if(!_0x59f827[_0x4bce('0x34')]){throw new db['Sequelize'][(_0x4bce('0x8a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x30889b=_0x59f827;return db[_0x4bce('0x6d')][_0x4bce('0x40')]({'raw':!![]});}return null;})['then'](function(_0x9f396a){if(_0x9f396a){_0x1eb78c=_[_0x4bce('0x6e')](_0x9f396a,'id');var _0x3a3cd6;var _0x3916a3=squel[_0x4bce('0x6f')]();_0x3916a3['from'](_0x5ea2a5['table']);for(var _0x153dc8=0x0;_0x153dc8<_0x30889b['length'];_0x153dc8+=0x1){_0x3a3cd6=_0x30889b[_0x153dc8][_0x4bce('0x71')]?_0x1eb78c[_0x30889b[_0x153dc8][_0x4bce('0x71')]][_0x4bce('0x72')]:_0x30889b[_0x153dc8][_0x4bce('0x73')];_0x3a3cd6=_0x30889b[_0x153dc8][_0x4bce('0x74')]?_[_0x4bce('0x76')](_0x44a957[_0x30889b[_0x153dc8]['function']],'%s',_0x3a3cd6):_0x3a3cd6;_0x3a3cd6=_0x30889b[_0x153dc8][_0x4bce('0x75')]?_[_0x4bce('0x76')](_0x327c64[_0x30889b[_0x153dc8][_0x4bce('0x75')]],'%s',_0x3a3cd6):_0x3a3cd6;if(_0x30889b[_0x153dc8][_0x4bce('0x77')]){_0x3916a3['group'](_0x3a3cd6);}_0x30889b[_0x153dc8][_0x4bce('0x78')]&&_0x3916a3['order'](_0x3a3cd6,_0x30889b[_0x153dc8]['orderBy']===_0x4bce('0x79')?![]:!![]);_0x3916a3[_0x4bce('0x73')](_0x3a3cd6,_0x30889b[_0x153dc8]['alias']||_0x3a3cd6);}if(_0x5ea2a5['joins']){_0x5ea2a5[_0x4bce('0x7b')]=JSON['parse'](_0x5ea2a5['joins']);for(var _0x5e606b=0x0;_0x5e606b<_0x5ea2a5[_0x4bce('0x7b')]['length'];_0x5e606b+=0x1){if(_0x5ea2a5[_0x4bce('0x7b')][_0x5e606b]['type']&&_[_0x4bce('0x61')](_0x3dc540,_0x5ea2a5[_0x4bce('0x7b')][_0x5e606b][_0x4bce('0x2b')])&&_0x5ea2a5[_0x4bce('0x7b')][_0x5e606b]['parentKey']&&_0x5ea2a5[_0x4bce('0x7b')][_0x5e606b][_0x4bce('0x7e')]&&_0x5ea2a5[_0x4bce('0x7b')][_0x5e606b][_0x4bce('0x80')]){_0x3916a3[_0x5ea2a5[_0x4bce('0x7b')][_0x5e606b][_0x4bce('0x2b')]](_0x5ea2a5[_0x4bce('0x7b')][_0x5e606b][_0x4bce('0x7e')],null,util[_0x4bce('0x75')](_0x4bce('0x7f'),_0x5ea2a5[_0x4bce('0x8b')],_0x5ea2a5[_0x4bce('0x7b')][_0x5e606b][_0x4bce('0x7d')],_0x5ea2a5['joins'][_0x5e606b][_0x4bce('0x7e')],_0x5ea2a5[_0x4bce('0x7b')][_0x5e606b][_0x4bce('0x80')]));}}}if(_0x5ea2a5[_0x4bce('0x81')]){_0x5ea2a5['conditions']=JSON[_0x4bce('0x7c')](_0x5ea2a5[_0x4bce('0x81')]);_0x3916a3[_0x4bce('0x37')](_0x30a83a(_0x5ea2a5[_0x4bce('0x81')][_0x4bce('0x67')]));}_0x3846d1=_0x3916a3[_0x4bce('0x82')]();_0x3916a3[_0x4bce('0x1a')](_0x2f346c);_0x3916a3['offset'](0x0);logger['debug'](_0x4bce('0x83'),_0x3916a3['toString']());return dbH['sequelize']['query'](_0x3916a3[_0x4bce('0x84')](),{'type':dbH[_0x4bce('0x85')][_0x4bce('0x86')][_0x4bce('0x87')]});}})[_0x4bce('0x21')](function(){return{'sql':_0x3846d1[_0x4bce('0x84')]()};})[_0x4bce('0x21')](respondWithResult(_0x177167,null))[_0x4bce('0x41')](handleError(_0x177167,null));};
\ No newline at end of file
+var _0x97e4=['fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','CustomReports','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','pick','filters','VIRTUAL','filter','options','AnalyticCustomReport','includeAll','include','findAll','rows','merge','create','body','get','role','user','Reports','UserProfileSection','find','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','orderBy','alias','joins','parse','includes','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','left_join','cross_join','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','from','groupBy','order','DESC','parentKey','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','COUNT(*)','run','Limited\x20Query:','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x2cadbd,_0x504b02){var _0x56df1a=function(_0x8a225d){while(--_0x8a225d){_0x2cadbd['push'](_0x2cadbd['shift']());}};_0x56df1a(++_0x504b02);}(_0x97e4,0x98));var _0x497e=function(_0x5786f9,_0x59a148){_0x5786f9=_0x5786f9-0x0;var _0x22c3cf=_0x97e4[_0x5786f9];return _0x22c3cf;};'use strict';var emlformat=require(_0x497e('0x0'));var rimraf=require(_0x497e('0x1'));var zipdir=require(_0x497e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x497e('0x3'));var moment=require(_0x497e('0x4'));var BPromise=require(_0x497e('0x5'));var Mustache=require(_0x497e('0x6'));var util=require(_0x497e('0x7'));var path=require(_0x497e('0x8'));var sox=require('sox');var csv=require(_0x497e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x497e('0xa'));var _=require(_0x497e('0xb'));var squel=require(_0x497e('0xc'));var crypto=require('crypto');var jsforce=require(_0x497e('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x497e('0xe'));var Papa=require(_0x497e('0xf'));var Redis=require(_0x497e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x497e('0x11'));var as=require(_0x497e('0x12'));var hardwareService=require(_0x497e('0x13'));var logger=require(_0x497e('0x14'))(_0x497e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x497e('0x16'));var db=require(_0x497e('0x17'))['db'];var dbH=require(_0x497e('0x17'))['dbH'];function respondWithStatusCode(_0x1fa252,_0x2a2687){_0x2a2687=_0x2a2687||0xcc;return function(_0x4fb4d8){if(_0x4fb4d8){return _0x1fa252['sendStatus'](_0x2a2687);}return _0x1fa252[_0x497e('0x18')](_0x2a2687)[_0x497e('0x19')]();};}function respondWithResult(_0x781267,_0x3e779a){_0x3e779a=_0x3e779a||0xc8;return function(_0x18a2e7){if(_0x18a2e7){return _0x781267['status'](_0x3e779a)[_0x497e('0x1a')](_0x18a2e7);}};}function respondWithFilteredResult(_0x5727da,_0x324f6c){return function(_0x447d11){if(_0x447d11){var _0x10c3e9=typeof _0x324f6c[_0x497e('0x1b')]===_0x497e('0x1c')&&typeof _0x324f6c['limit']===_0x497e('0x1c');var _0xb5b0cb=_0x447d11[_0x497e('0x1d')];var _0x2ac36c=_0x10c3e9?0x0:_0x324f6c[_0x497e('0x1b')];var _0x2eac53=_0x10c3e9?_0x447d11[_0x497e('0x1d')]:_0x324f6c[_0x497e('0x1b')]+_0x324f6c[_0x497e('0x1e')];var _0x1ca114;if(_0x2eac53>=_0xb5b0cb){_0x2eac53=_0xb5b0cb;_0x1ca114=0xc8;}else{_0x1ca114=0xce;}_0x5727da['status'](_0x1ca114);return _0x5727da[_0x497e('0x1f')](_0x497e('0x20'),_0x2ac36c+'-'+_0x2eac53+'/'+_0xb5b0cb)[_0x497e('0x1a')](_0x447d11);}return null;};}function patchUpdates(_0x22bea3){return function(_0x387e6e){try{jsonpatch[_0x497e('0x21')](_0x387e6e,_0x22bea3,!![]);}catch(_0x9fca86){return BPromise['reject'](_0x9fca86);}return _0x387e6e[_0x497e('0x22')]();};}function saveUpdates(_0x39a19e,_0x1501a2){return function(_0x1e5ca9){if(_0x1e5ca9){return _0x1e5ca9['update'](_0x39a19e)['then'](function(_0x4408e7){return _0x4408e7;});}return null;};}function removeEntity(_0x5d26a9,_0x4162d7){return function(_0xede98e){if(_0xede98e){return _0xede98e['destroy']()[_0x497e('0x23')](function(){var _0x5b763a=_0xede98e['get']({'plain':!![]});var _0x4a954a=_0x497e('0x24');return db[_0x497e('0x25')][_0x497e('0x26')]({'where':{'type':_0x4a954a,'resourceId':_0x5b763a['id']}})[_0x497e('0x23')](function(){return _0xede98e;});})[_0x497e('0x23')](function(){_0x5d26a9[_0x497e('0x18')](0xcc)[_0x497e('0x19')]();});}};}function handleEntityNotFound(_0x42cbaa,_0x31b075){return function(_0x485d46){if(!_0x485d46){_0x42cbaa[_0x497e('0x27')](0x194);}return _0x485d46;};}function handleError(_0x37f398,_0x54844f){_0x54844f=_0x54844f||0x1f4;return function(_0x391acb){logger['error'](_0x391acb[_0x497e('0x28')]);if(_0x391acb[_0x497e('0x29')]){delete _0x391acb[_0x497e('0x29')];}_0x37f398['status'](_0x54844f)[_0x497e('0x2a')](_0x391acb);};}exports[_0x497e('0x2b')]=function(_0x1c2887,_0x81ffc){var _0x6fb532={},_0xb5eb52={},_0x4656ae={'count':0x0,'rows':[]};var _0x2d8b88=_[_0x497e('0x2c')](db['AnalyticCustomReport'][_0x497e('0x2d')],function(_0x2781cc){return{'name':_0x2781cc[_0x497e('0x2e')],'type':_0x2781cc[_0x497e('0x2f')][_0x497e('0x30')]};});_0xb5eb52[_0x497e('0x31')]=_['map'](_0x2d8b88,_0x497e('0x29'));_0xb5eb52[_0x497e('0x32')]=_[_0x497e('0x33')](_0x1c2887['query']);_0xb5eb52['filters']=_['intersection'](_0xb5eb52[_0x497e('0x31')],_0xb5eb52[_0x497e('0x32')]);_0x6fb532[_0x497e('0x34')]=_[_0x497e('0x35')](_0xb5eb52[_0x497e('0x31')],qs[_0x497e('0x36')](_0x1c2887[_0x497e('0x32')]['fields']));_0x6fb532[_0x497e('0x34')]=_0x6fb532[_0x497e('0x34')][_0x497e('0x37')]?_0x6fb532[_0x497e('0x34')]:_0xb5eb52[_0x497e('0x31')];if(!_0x1c2887[_0x497e('0x32')]['hasOwnProperty'](_0x497e('0x38'))){_0x6fb532[_0x497e('0x1e')]=qs[_0x497e('0x1e')](_0x1c2887[_0x497e('0x32')]['limit']);_0x6fb532['offset']=qs[_0x497e('0x1b')](_0x1c2887[_0x497e('0x32')][_0x497e('0x1b')]);}_0x6fb532['order']=qs['sort'](_0x1c2887[_0x497e('0x32')][_0x497e('0x39')]);_0x6fb532[_0x497e('0x3a')]=qs['filters'](_[_0x497e('0x3b')](_0x1c2887[_0x497e('0x32')],_0xb5eb52[_0x497e('0x3c')]),_0x2d8b88);if(_0x1c2887['query']['filter']){_0x6fb532[_0x497e('0x3a')]=_['merge'](_0x6fb532[_0x497e('0x3a')],{'$or':_[_0x497e('0x2c')](_0x2d8b88,function(_0x1dc903){if(_0x1dc903[_0x497e('0x2f')]!==_0x497e('0x3d')){var _0x2ffef6={};_0x2ffef6[_0x1dc903[_0x497e('0x29')]]={'$like':'%'+_0x1c2887[_0x497e('0x32')][_0x497e('0x3e')]+'%'};return _0x2ffef6;}})});}_0x6fb532=_['merge']({},_0x6fb532,_0x1c2887[_0x497e('0x3f')]);var _0x4d1a99={'where':_0x6fb532['where']};return db[_0x497e('0x40')]['count'](_0x4d1a99)[_0x497e('0x23')](function(_0x4213a1){_0x4656ae[_0x497e('0x1d')]=_0x4213a1;if(_0x1c2887[_0x497e('0x32')][_0x497e('0x41')]){_0x6fb532[_0x497e('0x42')]=[{'all':!![]}];}return db[_0x497e('0x40')][_0x497e('0x43')](_0x6fb532);})['then'](function(_0x46ad99){_0x4656ae[_0x497e('0x44')]=_0x46ad99;return _0x4656ae;})[_0x497e('0x23')](respondWithFilteredResult(_0x81ffc,_0x6fb532))['catch'](handleError(_0x81ffc,null));};exports['show']=function(_0x2900e9,_0x3dc4b9){var _0x517a14={'raw':![],'where':{'id':_0x2900e9['params']['id']}},_0x330ebf={};_0x330ebf[_0x497e('0x31')]=_[_0x497e('0x33')](db[_0x497e('0x40')][_0x497e('0x2d')]);_0x330ebf[_0x497e('0x32')]=_[_0x497e('0x33')](_0x2900e9[_0x497e('0x32')]);_0x330ebf['filters']=_[_0x497e('0x35')](_0x330ebf[_0x497e('0x31')],_0x330ebf['query']);_0x517a14['attributes']=_[_0x497e('0x35')](_0x330ebf[_0x497e('0x31')],qs[_0x497e('0x36')](_0x2900e9[_0x497e('0x32')][_0x497e('0x36')]));_0x517a14['attributes']=_0x517a14[_0x497e('0x34')][_0x497e('0x37')]?_0x517a14[_0x497e('0x34')]:_0x330ebf[_0x497e('0x31')];if(_0x2900e9[_0x497e('0x32')]['includeAll']){_0x517a14['include']=[{'all':!![]}];}_0x517a14=_[_0x497e('0x45')]({},_0x517a14,_0x2900e9[_0x497e('0x3f')]);return db[_0x497e('0x40')]['find'](_0x517a14)[_0x497e('0x23')](handleEntityNotFound(_0x3dc4b9,null))[_0x497e('0x23')](respondWithResult(_0x3dc4b9,null))['catch'](handleError(_0x3dc4b9,null));};exports[_0x497e('0x46')]=function(_0xc81a13,_0x5813b0){return db[_0x497e('0x40')][_0x497e('0x46')](_0xc81a13[_0x497e('0x47')],{})['then'](function(_0x4b574d){var _0x1bd07b=_0xc81a13['user'][_0x497e('0x48')]({'plain':!![]});if(!_0x1bd07b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bd07b[_0x497e('0x49')]===_0x497e('0x4a')){var _0x21b45d=_0x4b574d[_0x497e('0x48')]({'plain':!![]});var _0x402769=_0x497e('0x4b');return db[_0x497e('0x4c')][_0x497e('0x4d')]({'where':{'name':_0x402769,'userProfileId':_0x1bd07b['userProfileId']},'raw':!![]})[_0x497e('0x23')](function(_0xa467ff){if(_0xa467ff&&_0xa467ff['autoAssociation']===0x0){return db[_0x497e('0x25')]['create']({'name':_0x21b45d[_0x497e('0x29')],'resourceId':_0x21b45d['id'],'type':_0x497e('0x24'),'sectionId':_0xa467ff['id']},{})[_0x497e('0x23')](function(){return _0x4b574d;});}else{return _0x4b574d;}})[_0x497e('0x4e')](function(_0x312643){logger[_0x497e('0x4f')](_0x497e('0x50'),_0x312643);throw _0x312643;});}return _0x4b574d;})[_0x497e('0x23')](respondWithResult(_0x5813b0,0xc9))['catch'](handleError(_0x5813b0,null));};exports[_0x497e('0x51')]=function(_0x3d11d9,_0x557ead){if(_0x3d11d9['body']['id']){delete _0x3d11d9[_0x497e('0x47')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x3d11d9[_0x497e('0x52')]['id']}})[_0x497e('0x23')](handleEntityNotFound(_0x557ead,null))[_0x497e('0x23')](saveUpdates(_0x3d11d9[_0x497e('0x47')],null))[_0x497e('0x23')](respondWithResult(_0x557ead,null))['catch'](handleError(_0x557ead,null));};exports[_0x497e('0x26')]=function(_0x1ca283,_0x221249){return db['AnalyticCustomReport'][_0x497e('0x4d')]({'where':{'id':_0x1ca283['params']['id']}})[_0x497e('0x23')](handleEntityNotFound(_0x221249,null))[_0x497e('0x23')](removeEntity(_0x221249,null))[_0x497e('0x4e')](handleError(_0x221249,null));};exports[_0x497e('0x53')]=function(_0x5b88d4,_0x3665a5){var _0x4e5396=0xa;var _0x2944c0=[_0x497e('0x54'),'left_join',_0x497e('0x55'),'cross_join'];var _0x47ed1d={'SUM':_0x497e('0x56'),'COUNT':_0x497e('0x57'),'COUNT DISTINCT':_0x497e('0x58'),'MAX':'MAX(%s)','MIN':_0x497e('0x59'),'AVG':_0x497e('0x5a'),'GROUP_CONCAT':_0x497e('0x5b'),'GROUP_CONCAT ASC':_0x497e('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x37657e={'SEC_TO_TIME':_0x497e('0x5d'),'DATE':_0x497e('0x5e'),'HOUR':_0x497e('0x5f'),'ROUND':_0x497e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1ae513=function(_0x1a3ae4){return!_['includes']([_0x497e('0x61'),_0x497e('0x62'),_0x497e('0x63'),_0x497e('0x64')],_0x1a3ae4);};var _0x3661c6=function(_0x266818){if(!_0x266818||!_0x266818['rules']['length']){return'';}for(var _0x6e9444='(',_0x42f7f7=0x0;_0x42f7f7<_0x266818[_0x497e('0x65')][_0x497e('0x37')];_0x42f7f7+=0x1){_0x42f7f7>0x0&&(_0x6e9444+='\x20'+_0x266818[_0x497e('0x66')]+'\x20');_0x6e9444+=_0x266818[_0x497e('0x65')][_0x42f7f7][_0x497e('0x67')]?_0x3661c6(_0x266818[_0x497e('0x65')][_0x42f7f7][_0x497e('0x67')]):_0x266818[_0x497e('0x65')][_0x42f7f7][_0x497e('0x68')]+'\x20'+_0x266818[_0x497e('0x65')][_0x42f7f7]['condition']+(_0x1ae513(_0x266818[_0x497e('0x65')][_0x42f7f7]['condition'])?'\x20'+_0x266818['rules'][_0x42f7f7][_0x497e('0x69')]:'');}return _0x6e9444+')';};var _0x149ae5={'where':{'id':_0x5b88d4['params']['id']}},_0x26868f,_0x263cf7,_0x89fb89,_0x1ef917,_0x1f5150;_0x149ae5=_['merge']({},_0x149ae5,_0x5b88d4['options']);return db[_0x497e('0x40')][_0x497e('0x4d')](_0x149ae5)[_0x497e('0x23')](function(_0x223bcf){if(_0x223bcf){_0x26868f=_0x223bcf;return _0x223bcf[_0x497e('0x6a')]();}return null;})[_0x497e('0x23')](function(_0x376831){if(_0x376831){if(!_0x376831['length']){throw new db[(_0x497e('0x6b'))][(_0x497e('0x6c'))](_0x497e('0x6d'),0x193);}_0x263cf7=_0x376831;return db[_0x497e('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x497e('0x23')](function(_0x45bbf4){if(_0x45bbf4){_0x89fb89=_[_0x497e('0x6f')](_0x45bbf4,'id');var _0x5a3b38;var _0x93f34f=squel[_0x497e('0x70')]();_0x93f34f['from'](_0x26868f[_0x497e('0x71')]);for(var _0x2e3d1a=0x0;_0x2e3d1a<_0x263cf7[_0x497e('0x37')];_0x2e3d1a+=0x1){_0x5a3b38=_0x263cf7[_0x2e3d1a][_0x497e('0x72')]?_0x89fb89[_0x263cf7[_0x2e3d1a][_0x497e('0x72')]][_0x497e('0x73')]:_0x263cf7[_0x2e3d1a][_0x497e('0x68')];_0x5a3b38=_0x263cf7[_0x2e3d1a][_0x497e('0x74')]?_[_0x497e('0x75')](_0x47ed1d[_0x263cf7[_0x2e3d1a][_0x497e('0x74')]],'%s',_0x5a3b38):_0x5a3b38;_0x5a3b38=_0x263cf7[_0x2e3d1a][_0x497e('0x76')]?_[_0x497e('0x75')](_0x37657e[_0x263cf7[_0x2e3d1a][_0x497e('0x76')]],'%s',_0x5a3b38):_0x5a3b38;if(_0x263cf7[_0x2e3d1a]['groupBy']){_0x93f34f[_0x497e('0x67')](_0x5a3b38);}_0x263cf7[_0x2e3d1a][_0x497e('0x77')]&&_0x93f34f['order'](_0x5a3b38,_0x263cf7[_0x2e3d1a][_0x497e('0x77')]==='DESC'?![]:!![]);_0x93f34f['field'](_0x5a3b38,_0x263cf7[_0x2e3d1a][_0x497e('0x78')]||_0x5a3b38);}if(_0x26868f[_0x497e('0x79')]){_0x26868f[_0x497e('0x79')]=JSON[_0x497e('0x7a')](_0x26868f[_0x497e('0x79')]);for(var _0x39b964=0x0;_0x39b964<_0x26868f[_0x497e('0x79')][_0x497e('0x37')];_0x39b964+=0x1){if(_0x26868f[_0x497e('0x79')][_0x39b964]['type']&&_[_0x497e('0x7b')](_0x2944c0,_0x26868f[_0x497e('0x79')][_0x39b964][_0x497e('0x2f')])&&_0x26868f[_0x497e('0x79')][_0x39b964]['parentKey']&&_0x26868f[_0x497e('0x79')][_0x39b964][_0x497e('0x7c')]&&_0x26868f[_0x497e('0x79')][_0x39b964][_0x497e('0x7d')]){_0x93f34f[_0x26868f[_0x497e('0x79')][_0x39b964][_0x497e('0x2f')]](_0x26868f[_0x497e('0x79')][_0x39b964][_0x497e('0x7c')],null,util[_0x497e('0x76')](_0x497e('0x7e'),_0x26868f['table'],_0x26868f[_0x497e('0x79')][_0x39b964]['parentKey'],_0x26868f['joins'][_0x39b964][_0x497e('0x7c')],_0x26868f[_0x497e('0x79')][_0x39b964][_0x497e('0x7d')]));}}}if(_0x26868f[_0x497e('0x7f')]){_0x26868f[_0x497e('0x7f')]=JSON[_0x497e('0x7a')](_0x26868f['conditions']);_0x93f34f['where'](_0x3661c6(_0x26868f[_0x497e('0x7f')][_0x497e('0x67')]));}_0x1f5150=_0x93f34f[_0x497e('0x80')]();_0x93f34f[_0x497e('0x1e')](_0x4e5396);_0x93f34f[_0x497e('0x1b')](0x0);logger[_0x497e('0x81')]('Limited\x20Query:',_0x93f34f[_0x497e('0x82')]());return dbH[_0x497e('0x83')][_0x497e('0x32')](_0x93f34f[_0x497e('0x82')](),{'type':dbH[_0x497e('0x83')][_0x497e('0x84')][_0x497e('0x85')]});}})[_0x497e('0x23')](respondWithResult(_0x3665a5,null))[_0x497e('0x4e')](handleError(_0x3665a5,null));};function runReport(_0x3f7563,_0x4c2cfa,_0x4e7a8d){var _0x8af9a8=_0x4c2cfa['name'];var _0x1093d9=0xa;var _0x329e86=[_0x497e('0x54'),_0x497e('0x86'),_0x497e('0x55'),_0x497e('0x87')];var _0x3f7c5c={'SUM':_0x497e('0x56'),'COUNT':_0x497e('0x57'),'COUNT DISTINCT':_0x497e('0x58'),'MAX':_0x497e('0x88'),'MIN':'MIN(%s)','AVG':_0x497e('0x5a'),'GROUP_CONCAT':_0x497e('0x5b'),'GROUP_CONCAT ASC':_0x497e('0x5c'),'GROUP_CONCAT DESC':_0x497e('0x89')};var _0x570572={'SEC_TO_TIME':_0x497e('0x5d'),'DATE':_0x497e('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x497e('0x60'),'UNIX_TIMESTAMP':_0x497e('0x8a')};var _0x20a7d1=function(_0x378d58){return!_[_0x497e('0x7b')]([_0x497e('0x61'),_0x497e('0x62'),_0x497e('0x63'),_0x497e('0x64')],_0x378d58);};var _0x11e63d=function(_0x5aa1a1){if(!_0x5aa1a1||!_0x5aa1a1['rules'][_0x497e('0x37')]){return'';}for(var _0x5a5df5='(',_0x35951c=0x0;_0x35951c<_0x5aa1a1[_0x497e('0x65')][_0x497e('0x37')];_0x35951c+=0x1){_0x35951c>0x0&&(_0x5a5df5+='\x20'+_0x5aa1a1[_0x497e('0x66')]+'\x20');_0x5a5df5+=_0x5aa1a1[_0x497e('0x65')][_0x35951c][_0x497e('0x67')]?_0x11e63d(_0x5aa1a1[_0x497e('0x65')][_0x35951c][_0x497e('0x67')]):_0x5aa1a1[_0x497e('0x65')][_0x35951c][_0x497e('0x68')]+'\x20'+_0x5aa1a1[_0x497e('0x65')][_0x35951c]['condition']+(_0x20a7d1(_0x5aa1a1[_0x497e('0x65')][_0x35951c]['condition'])?'\x20'+_0x5aa1a1[_0x497e('0x65')][_0x35951c][_0x497e('0x69')]:'');}return _0x5a5df5+')';};var _0x55c08c={'where':{'id':_0x3f7563['id']}},_0x24dbc4,_0x5c7066,_0x59ebaf,_0x286912,_0x11dca0;_0x55c08c=_[_0x497e('0x45')]({},_0x55c08c,_0x4e7a8d);return db[_0x497e('0x40')][_0x497e('0x4d')](_0x55c08c)[_0x497e('0x23')](function(_0x459c04){if(_0x459c04){_0x24dbc4=_0x459c04;return _0x459c04[_0x497e('0x6a')]();}return null;})[_0x497e('0x23')](function(_0x2868f0){if(_0x2868f0){if(!_0x2868f0[_0x497e('0x37')]){throw new db[(_0x497e('0x6b'))][(_0x497e('0x6c'))](_0x497e('0x6d'),0x193);}_0x5c7066=_0x2868f0;return db[_0x497e('0x6e')][_0x497e('0x43')]({'raw':!![]});}return null;})['then'](function(_0x1d3fef){if(_0x1d3fef){_0x59ebaf=_[_0x497e('0x6f')](_0x1d3fef,'id');var _0x5f3bd8;var _0x191af6=squel[_0x497e('0x70')]();_0x191af6[_0x497e('0x8b')](_0x24dbc4[_0x497e('0x71')]);for(var _0x527310=0x0;_0x527310<_0x5c7066[_0x497e('0x37')];_0x527310+=0x1){_0x5f3bd8=_0x5c7066[_0x527310][_0x497e('0x72')]?_0x59ebaf[_0x5c7066[_0x527310][_0x497e('0x72')]][_0x497e('0x73')]:_0x5c7066[_0x527310]['field'];_0x5f3bd8=_0x5c7066[_0x527310][_0x497e('0x74')]?_[_0x497e('0x75')](_0x3f7c5c[_0x5c7066[_0x527310][_0x497e('0x74')]],'%s',_0x5f3bd8):_0x5f3bd8;_0x5f3bd8=_0x5c7066[_0x527310][_0x497e('0x76')]?_[_0x497e('0x75')](_0x570572[_0x5c7066[_0x527310][_0x497e('0x76')]],'%s',_0x5f3bd8):_0x5f3bd8;if(_0x5c7066[_0x527310][_0x497e('0x8c')]){_0x191af6[_0x497e('0x67')](_0x5f3bd8);}_0x5c7066[_0x527310][_0x497e('0x77')]&&_0x191af6[_0x497e('0x8d')](_0x5f3bd8,_0x5c7066[_0x527310][_0x497e('0x77')]===_0x497e('0x8e')?![]:!![]);_0x191af6[_0x497e('0x68')](_0x5f3bd8,_0x5c7066[_0x527310][_0x497e('0x78')]||_0x5f3bd8);}if(_0x24dbc4[_0x497e('0x79')]){_0x24dbc4[_0x497e('0x79')]=JSON[_0x497e('0x7a')](_0x24dbc4[_0x497e('0x79')]);for(var _0x554fb4=0x0;_0x554fb4<_0x24dbc4[_0x497e('0x79')][_0x497e('0x37')];_0x554fb4+=0x1){if(_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x2f')]&&_[_0x497e('0x7b')](_0x329e86,_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x2f')])&&_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x8f')]&&_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x7c')]&&_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x7d')]){_0x191af6[_0x24dbc4['joins'][_0x554fb4][_0x497e('0x2f')]](_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x7c')],null,util[_0x497e('0x76')]('%s.%s\x20=\x20%s.%s',_0x24dbc4[_0x497e('0x71')],_0x24dbc4['joins'][_0x554fb4][_0x497e('0x8f')],_0x24dbc4[_0x497e('0x79')][_0x554fb4][_0x497e('0x7c')],_0x24dbc4[_0x497e('0x79')][_0x554fb4]['foreignKey']));}}}if(_0x24dbc4[_0x497e('0x7f')]){_0x24dbc4[_0x497e('0x7f')]=JSON['parse'](_0x24dbc4['conditions']);_0x191af6['where'](_0x11e63d(_0x24dbc4[_0x497e('0x7f')][_0x497e('0x67')]));}_0x11dca0=_0x191af6[_0x497e('0x80')]();_0x191af6[_0x497e('0x1e')](_0x1093d9);_0x191af6[_0x497e('0x1b')](0x0);return;}})[_0x497e('0x23')](function(){if(_0x4c2cfa[_0x497e('0x90')]===_0x497e('0x91')){return null;}var _0x52ca94=_[_0x497e('0x45')](_0x4c2cfa,{'name':_0x4c2cfa[_0x497e('0x92')]||_0x4c2cfa[_0x497e('0x29')]||_0x24dbc4['name'],'basename':_0x8af9a8,'savename':util[_0x497e('0x76')](_0x497e('0x93'),_0x4c2cfa[_0x497e('0x29')]||_0x24dbc4[_0x497e('0x29')],require(_0x497e('0x94'))[_0x497e('0x95')](0x4),_0x4c2cfa['output']||_0x497e('0x96')),'reportId':_0x24dbc4['id'],'reportType':'custom'});return db[_0x497e('0x97')][_0x497e('0x46')](_0x52ca94,{'raw':!![]});})[_0x497e('0x23')](function(_0x2d6181){if(_0x24dbc4[_0x497e('0x71')]==='cdr'){_0x11dca0[_0x497e('0x3a')](_0x24dbc4[_0x497e('0x71')]+_0x497e('0x98'),_0x4c2cfa[_0x497e('0x99')],_0x4c2cfa[_0x497e('0x9a')]);}else{_0x11dca0[_0x497e('0x3a')](_0x24dbc4[_0x497e('0x71')]+_0x497e('0x9b'),_0x4c2cfa[_0x497e('0x99')],_0x4c2cfa[_0x497e('0x9a')]);}if(_0x2d6181){logger['info'](_0x497e('0x9c'),_0x11dca0[_0x497e('0x82')]());require('child_process')[_0x497e('0x9d')](path[_0x497e('0x54')](__dirname,_0x497e('0x9e'),_0x2d6181[_0x497e('0x90')]),[_0x2d6181['id'],_0x11dca0[_0x497e('0x82')](),path[_0x497e('0x54')](__dirname,'../../files/reports',_0x2d6181['savename']),_0x8af9a8]);return _0x2d6181;}else{var _0x32b198=squel[_0x497e('0x70')]();_0x32b198['from']('('+_0x11dca0[_0x497e('0x82')]()+')','countTable');_0x32b198[_0x497e('0x68')](_0x497e('0x9f'),_0x497e('0x1d'));_0x11dca0[_0x497e('0x1e')](_0x4c2cfa[_0x497e('0x1e')]||_0x1093d9);_0x11dca0[_0x497e('0x1b')](_0x4c2cfa[_0x497e('0x1b')]||0x0);return dbH[_0x497e('0x83')]['query'](_0x32b198['toString'](),{'type':dbH[_0x497e('0x83')][_0x497e('0x84')][_0x497e('0x85')]})['then'](function(_0x53b586){if(!_0x53b586[_0x497e('0x37')]){_0x286912=0x0;}else{_0x286912=_0x53b586[0x0][_0x497e('0x1d')]||0x0;}return dbH[_0x497e('0x83')][_0x497e('0x32')](_0x11dca0[_0x497e('0x82')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x497e('0x23')](function(_0x3d3397){return{'rows':_0x3d3397||[],'count':_0x286912};});}});}exports[_0x497e('0xa0')]=function(_0x79079a,_0x5d23c1){return runReport(_0x79079a['params'],_0x79079a[_0x497e('0x32')],_0x79079a[_0x497e('0x3f')])[_0x497e('0x23')](respondWithResult(_0x5d23c1,null))['catch'](handleError(_0x5d23c1,null));};exports['runReport']=runReport;exports[_0x497e('0x32')]=function(_0xe9a92,_0x3a3b81){var _0x258291=0xa;var _0x207796=['join',_0x497e('0x86'),'right_join',_0x497e('0x87')];var _0x240723={'SUM':_0x497e('0x56'),'COUNT':_0x497e('0x57'),'COUNT DISTINCT':_0x497e('0x58'),'MAX':_0x497e('0x88'),'MIN':_0x497e('0x59'),'AVG':_0x497e('0x5a'),'GROUP_CONCAT':_0x497e('0x5b'),'GROUP_CONCAT ASC':_0x497e('0x5c'),'GROUP_CONCAT DESC':_0x497e('0x89')};var _0x268673={'SEC_TO_TIME':_0x497e('0x5d'),'DATE':_0x497e('0x5e'),'HOUR':_0x497e('0x5f'),'ROUND':_0x497e('0x60'),'UNIX_TIMESTAMP':_0x497e('0x8a')};var _0x3daecd=function(_0x2173f8){return!_[_0x497e('0x7b')]([_0x497e('0x61'),_0x497e('0x62'),_0x497e('0x63'),_0x497e('0x64')],_0x2173f8);};var _0x50b3ca=function(_0x877883){if(!_0x877883||!_0x877883[_0x497e('0x65')][_0x497e('0x37')]){return'';}for(var _0x177b3d='(',_0x1979aa=0x0;_0x1979aa<_0x877883['rules'][_0x497e('0x37')];_0x1979aa+=0x1){_0x1979aa>0x0&&(_0x177b3d+='\x20'+_0x877883[_0x497e('0x66')]+'\x20');_0x177b3d+=_0x877883[_0x497e('0x65')][_0x1979aa]['group']?_0x50b3ca(_0x877883[_0x497e('0x65')][_0x1979aa]['group']):_0x877883['rules'][_0x1979aa][_0x497e('0x68')]+'\x20'+_0x877883[_0x497e('0x65')][_0x1979aa]['condition']+(_0x3daecd(_0x877883[_0x497e('0x65')][_0x1979aa]['condition'])?'\x20'+_0x877883['rules'][_0x1979aa]['value']:'');}return _0x177b3d+')';};var _0x488a30={'where':{'id':_0xe9a92['params']['id']}},_0x4f9181,_0x2fc5cf,_0x5c3051,_0x33536d,_0x512a20;_0x488a30=_['merge']({},_0x488a30,_0xe9a92['options']);return db[_0x497e('0x40')]['find'](_0x488a30)[_0x497e('0x23')](function(_0x4bfe25){if(_0x4bfe25){_0x4f9181=_0x4bfe25;return _0x4bfe25[_0x497e('0x6a')]();}return null;})['then'](function(_0x2ea56c){if(_0x2ea56c){if(!_0x2ea56c['length']){throw new db[(_0x497e('0x6b'))][(_0x497e('0x6c'))](_0x497e('0x6d'),0x193);}_0x2fc5cf=_0x2ea56c;return db[_0x497e('0x6e')][_0x497e('0x43')]({'raw':!![]});}return null;})['then'](function(_0x335447){if(_0x335447){_0x5c3051=_[_0x497e('0x6f')](_0x335447,'id');var _0x45c8bd;var _0x3acc9f=squel['select']();_0x3acc9f[_0x497e('0x8b')](_0x4f9181[_0x497e('0x71')]);for(var _0x3f9e84=0x0;_0x3f9e84<_0x2fc5cf['length'];_0x3f9e84+=0x1){_0x45c8bd=_0x2fc5cf[_0x3f9e84][_0x497e('0x72')]?_0x5c3051[_0x2fc5cf[_0x3f9e84]['MetricId']][_0x497e('0x73')]:_0x2fc5cf[_0x3f9e84][_0x497e('0x68')];_0x45c8bd=_0x2fc5cf[_0x3f9e84][_0x497e('0x74')]?_[_0x497e('0x75')](_0x240723[_0x2fc5cf[_0x3f9e84][_0x497e('0x74')]],'%s',_0x45c8bd):_0x45c8bd;_0x45c8bd=_0x2fc5cf[_0x3f9e84][_0x497e('0x76')]?_['replace'](_0x268673[_0x2fc5cf[_0x3f9e84][_0x497e('0x76')]],'%s',_0x45c8bd):_0x45c8bd;if(_0x2fc5cf[_0x3f9e84][_0x497e('0x8c')]){_0x3acc9f['group'](_0x45c8bd);}_0x2fc5cf[_0x3f9e84][_0x497e('0x77')]&&_0x3acc9f[_0x497e('0x8d')](_0x45c8bd,_0x2fc5cf[_0x3f9e84]['orderBy']==='DESC'?![]:!![]);_0x3acc9f[_0x497e('0x68')](_0x45c8bd,_0x2fc5cf[_0x3f9e84][_0x497e('0x78')]||_0x45c8bd);}if(_0x4f9181[_0x497e('0x79')]){_0x4f9181[_0x497e('0x79')]=JSON['parse'](_0x4f9181[_0x497e('0x79')]);for(var _0x2bf8be=0x0;_0x2bf8be<_0x4f9181[_0x497e('0x79')][_0x497e('0x37')];_0x2bf8be+=0x1){if(_0x4f9181[_0x497e('0x79')][_0x2bf8be][_0x497e('0x2f')]&&_[_0x497e('0x7b')](_0x207796,_0x4f9181[_0x497e('0x79')][_0x2bf8be][_0x497e('0x2f')])&&_0x4f9181[_0x497e('0x79')][_0x2bf8be]['parentKey']&&_0x4f9181[_0x497e('0x79')][_0x2bf8be][_0x497e('0x7c')]&&_0x4f9181[_0x497e('0x79')][_0x2bf8be]['foreignKey']){_0x3acc9f[_0x4f9181[_0x497e('0x79')][_0x2bf8be][_0x497e('0x2f')]](_0x4f9181['joins'][_0x2bf8be][_0x497e('0x7c')],null,util[_0x497e('0x76')](_0x497e('0x7e'),_0x4f9181['table'],_0x4f9181[_0x497e('0x79')][_0x2bf8be][_0x497e('0x8f')],_0x4f9181['joins'][_0x2bf8be]['foreignTable'],_0x4f9181['joins'][_0x2bf8be]['foreignKey']));}}}if(_0x4f9181['conditions']){_0x4f9181[_0x497e('0x7f')]=JSON[_0x497e('0x7a')](_0x4f9181['conditions']);_0x3acc9f[_0x497e('0x3a')](_0x50b3ca(_0x4f9181['conditions'][_0x497e('0x67')]));}_0x512a20=_0x3acc9f[_0x497e('0x80')]();_0x3acc9f[_0x497e('0x1e')](_0x258291);_0x3acc9f[_0x497e('0x1b')](0x0);logger['debug'](_0x497e('0xa1'),_0x3acc9f[_0x497e('0x82')]());return dbH[_0x497e('0x83')][_0x497e('0x32')](_0x3acc9f['toString'](),{'type':dbH[_0x497e('0x83')][_0x497e('0x84')][_0x497e('0x85')]});}})['then'](function(){return{'sql':_0x512a20[_0x497e('0x82')]()};})['then'](respondWithResult(_0x3a3b81,null))[_0x497e('0x4e')](handleError(_0x3a3b81,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index ec7a78b..e7abd33 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 _0x54e4=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x3c73ad,_0x464b2c){var _0x54cdae=function(_0x22828a){while(--_0x22828a){_0x3c73ad['push'](_0x3c73ad['shift']());}};_0x54cdae(++_0x464b2c);}(_0x54e4,0x148));var _0x454e=function(_0x380f48,_0x141b3d){_0x380f48=_0x380f48-0x0;var _0x5f1056=_0x54e4[_0x380f48];return _0x5f1056;};'use strict';var _=require(_0x454e('0x0'));var util=require(_0x454e('0x1'));var logger=require(_0x454e('0x2'))(_0x454e('0x3'));var moment=require(_0x454e('0x4'));var BPromise=require(_0x454e('0x5'));var rp=require(_0x454e('0x6'));var fs=require('fs');var path=require(_0x454e('0x7'));var rimraf=require(_0x454e('0x8'));var config=require(_0x454e('0x9'));var attributes=require(_0x454e('0xa'));module[_0x454e('0xb')]=function(_0x138a6b,_0x307ef1){return _0x138a6b[_0x454e('0xc')](_0x454e('0xd'),attributes,{'tableName':_0x454e('0xe'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3bf4=['rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0xd81b5b,_0x15f6a7){var _0x52ffd9=function(_0x5571ea){while(--_0x5571ea){_0xd81b5b['push'](_0xd81b5b['shift']());}};_0x52ffd9(++_0x15f6a7);}(_0x3bf4,0xd6));var _0x43bf=function(_0x164331,_0x14b8ec){_0x164331=_0x164331-0x0;var _0x2d6c1f=_0x3bf4[_0x164331];return _0x2d6c1f;};'use strict';var _=require(_0x43bf('0x0'));var util=require(_0x43bf('0x1'));var logger=require(_0x43bf('0x2'))(_0x43bf('0x3'));var moment=require(_0x43bf('0x4'));var BPromise=require('bluebird');var rp=require(_0x43bf('0x5'));var fs=require('fs');var path=require(_0x43bf('0x6'));var rimraf=require(_0x43bf('0x7'));var config=require(_0x43bf('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0x43bf('0x9')]=function(_0x51c582,_0x4c9852){return _0x51c582[_0x43bf('0xa')](_0x43bf('0xb'),attributes,{'tableName':_0x43bf('0xc'),'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 7f55b39..53502c5 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 _0x18f2=['jayson/promise','client','http','request','then','info','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x18f2,0x10d));var _0x218f=function(_0x3b72c3,_0x5194dc){_0x3b72c3=_0x3b72c3-0x0;var _0x103b68=_0x18f2[_0x3b72c3];return _0x103b68;};'use strict';var _=require(_0x218f('0x0'));var util=require(_0x218f('0x1'));var moment=require(_0x218f('0x2'));var BPromise=require('bluebird');var rs=require(_0x218f('0x3'));var fs=require('fs');var Redis=require(_0x218f('0x4'));var db=require(_0x218f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x218f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x218f('0x7'));var client=jayson[_0x218f('0x8')][_0x218f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x572755,_0x1658a4,_0x57119b){return new BPromise(function(_0x5d33e8,_0x2f4ff3){return client[_0x218f('0xa')](_0x572755,_0x57119b)[_0x218f('0xb')](function(_0x59b514){logger[_0x218f('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1658a4,'request\x20sent');logger[_0x218f('0xd')](_0x218f('0xe'),_0x1658a4,_0x218f('0xf'),JSON[_0x218f('0x10')](_0x59b514));if(_0x59b514[_0x218f('0x11')]){if(_0x59b514[_0x218f('0x11')][_0x218f('0x12')]===0x1f4){logger[_0x218f('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1658a4,_0x59b514[_0x218f('0x11')][_0x218f('0x13')]);return _0x2f4ff3(_0x59b514[_0x218f('0x11')]['message']);}logger[_0x218f('0x11')](_0x218f('0x14'),_0x1658a4,_0x59b514[_0x218f('0x11')][_0x218f('0x13')]);return _0x5d33e8(_0x59b514[_0x218f('0x11')][_0x218f('0x13')]);}else{logger[_0x218f('0xc')](_0x218f('0x14'),_0x1658a4,'request\x20sent');_0x5d33e8(_0x59b514[_0x218f('0x15')][_0x218f('0x13')]);}})[_0x218f('0x16')](function(_0x3be502){logger[_0x218f('0x11')](_0x218f('0x14'),_0x1658a4,_0x3be502);_0x2f4ff3(_0x3be502);});});}
\ No newline at end of file
+var _0x9558=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x4d1e0f,_0x1509bc){var _0x5a72f9=function(_0x5486c6){while(--_0x5486c6){_0x4d1e0f['push'](_0x4d1e0f['shift']());}};_0x5a72f9(++_0x1509bc);}(_0x9558,0x134));var _0x8955=function(_0x48cb7d,_0x3135a1){_0x48cb7d=_0x48cb7d-0x0;var _0x417b09=_0x9558[_0x48cb7d];return _0x417b09;};'use strict';var _=require(_0x8955('0x0'));var util=require(_0x8955('0x1'));var moment=require(_0x8955('0x2'));var BPromise=require(_0x8955('0x3'));var rs=require(_0x8955('0x4'));var fs=require('fs');var Redis=require(_0x8955('0x5'));var db=require(_0x8955('0x6'))['db'];var utils=require(_0x8955('0x7'));var logger=require(_0x8955('0x8'))(_0x8955('0x9'));var config=require(_0x8955('0xa'));var jayson=require(_0x8955('0xb'));var client=jayson[_0x8955('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fd501,_0x1ec03f,_0x5ae3d0){return new BPromise(function(_0x5420c5,_0x455baf){return client[_0x8955('0xd')](_0x1fd501,_0x5ae3d0)[_0x8955('0xe')](function(_0x23b9b7){logger[_0x8955('0xf')](_0x8955('0x10'),_0x1ec03f,'request\x20sent');logger[_0x8955('0x11')](_0x8955('0x12'),_0x1ec03f,_0x8955('0x13'),JSON['stringify'](_0x23b9b7));if(_0x23b9b7[_0x8955('0x14')]){if(_0x23b9b7[_0x8955('0x14')][_0x8955('0x15')]===0x1f4){logger[_0x8955('0x14')](_0x8955('0x10'),_0x1ec03f,_0x23b9b7[_0x8955('0x14')][_0x8955('0x16')]);return _0x455baf(_0x23b9b7[_0x8955('0x14')]['message']);}logger[_0x8955('0x14')](_0x8955('0x10'),_0x1ec03f,_0x23b9b7[_0x8955('0x14')][_0x8955('0x16')]);return _0x5420c5(_0x23b9b7['error'][_0x8955('0x16')]);}else{logger[_0x8955('0xf')](_0x8955('0x10'),_0x1ec03f,'request\x20sent');_0x5420c5(_0x23b9b7[_0x8955('0x17')][_0x8955('0x16')]);}})[_0x8955('0x18')](function(_0x2c0d81){logger[_0x8955('0x14')](_0x8955('0x10'),_0x1ec03f,_0x2c0d81);_0x455baf(_0x2c0d81);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 6d02f4c..8e36bc8 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 _0x73ec=['show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id'];(function(_0x4e69d1,_0x437faf){var _0x357689=function(_0xf778a7){while(--_0xf778a7){_0x4e69d1['push'](_0x4e69d1['shift']());}};_0x357689(++_0x437faf);}(_0x73ec,0x1a2));var _0xc73e=function(_0x5af94a,_0x204822){_0x5af94a=_0x5af94a-0x0;var _0x4a5254=_0x73ec[_0x5af94a];return _0x4a5254;};'use strict';var multer=require(_0xc73e('0x0'));var util=require(_0xc73e('0x1'));var path=require(_0xc73e('0x2'));var timeout=require(_0xc73e('0x3'));var express=require(_0xc73e('0x4'));var router=express[_0xc73e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc73e('0x6'));var interaction=require(_0xc73e('0x7'));var config=require(_0xc73e('0x8'));var controller=require(_0xc73e('0x9'));router[_0xc73e('0xa')]('/',auth[_0xc73e('0xb')](),controller[_0xc73e('0xc')]);router['get'](_0xc73e('0xd'),auth['isAuthenticated'](),controller[_0xc73e('0xe')]);router[_0xc73e('0xa')](_0xc73e('0xf'),auth[_0xc73e('0xb')](),controller[_0xc73e('0x10')]);router['get'](_0xc73e('0x11'),auth[_0xc73e('0xb')](),controller[_0xc73e('0x12')]);router[_0xc73e('0xa')](_0xc73e('0x13'),auth[_0xc73e('0xb')](),controller[_0xc73e('0x14')]);router[_0xc73e('0x15')]('/',auth['isAuthenticated'](),controller[_0xc73e('0x16')]);router['put'](_0xc73e('0xd'),auth['isAuthenticated'](),controller[_0xc73e('0x17')]);router[_0xc73e('0x18')](_0xc73e('0xd'),auth[_0xc73e('0xb')](),controller[_0xc73e('0x19')]);module[_0xc73e('0x1a')]=router;
\ No newline at end of file
+var _0x7aa6=['query','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run'];(function(_0x1c2560,_0x1d9304){var _0x2be4de=function(_0x3d6984){while(--_0x3d6984){_0x1c2560['push'](_0x1c2560['shift']());}};_0x2be4de(++_0x1d9304);}(_0x7aa6,0xcc));var _0x67aa=function(_0x10df58,_0x1ae2a4){_0x10df58=_0x10df58-0x0;var _0x4321ec=_0x7aa6[_0x10df58];return _0x4321ec;};'use strict';var multer=require('multer');var util=require(_0x67aa('0x0'));var path=require(_0x67aa('0x1'));var timeout=require(_0x67aa('0x2'));var express=require(_0x67aa('0x3'));var router=express[_0x67aa('0x4')]();var fs_extra=require(_0x67aa('0x5'));var auth=require(_0x67aa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x67aa('0x7'));var controller=require(_0x67aa('0x8'));router[_0x67aa('0x9')]('/',auth[_0x67aa('0xa')](),controller[_0x67aa('0xb')]);router['get'](_0x67aa('0xc'),auth[_0x67aa('0xa')](),controller['show']);router['get'](_0x67aa('0xd'),auth[_0x67aa('0xa')](),controller[_0x67aa('0xe')]);router[_0x67aa('0x9')](_0x67aa('0xf'),auth[_0x67aa('0xa')](),controller['run']);router[_0x67aa('0x9')]('/:id/query',auth[_0x67aa('0xa')](),controller[_0x67aa('0x10')]);router[_0x67aa('0x11')]('/',auth[_0x67aa('0xa')](),controller[_0x67aa('0x12')]);router[_0x67aa('0x13')](_0x67aa('0xc'),auth[_0x67aa('0xa')](),controller['update']);router[_0x67aa('0x14')]('/:id',auth[_0x67aa('0xa')](),controller[_0x67aa('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 7ac020b..4de01b4 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 _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x13af96,_0x229847){var _0x2627b8=function(_0x349826){while(--_0x349826){_0x13af96['push'](_0x13af96['shift']());}};_0x2627b8(++_0x229847);}(_0xe14b,0x93));var _0xbe14=function(_0x4b2d14,_0x198792){_0x4b2d14=_0x4b2d14-0x0;var _0xabf1bf=_0xe14b[_0x4b2d14];return _0xabf1bf;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}};
\ No newline at end of file
+var _0x2675=['sequelize','STRING','TEXT'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x2675,0x75));var _0x5267=function(_0x414bee,_0x1b19a4){_0x414bee=_0x414bee-0x0;var _0x3ab4df=_0x2675[_0x414bee];return _0x3ab4df;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index fe43649..016f5ba 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 _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x45ba0c,_0x58f598){var _0x4db9b1=function(_0x72c1b3){while(--_0x72c1b3){_0x45ba0c['push'](_0x45ba0c['shift']());}};_0x4db9b1(++_0x58f598);}(_0x5fab,0x177));var _0xb5fa=function(_0x56c70f,_0x4e4493){_0x56c70f=_0x56c70f-0x0;var _0x3812ed=_0x5fab[_0x56c70f];return _0x3812ed;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));};
\ No newline at end of file
+var _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x250853,_0x44ae5c){var _0x23732f=function(_0x3b5dca){while(--_0x3b5dca){_0x250853['push'](_0x250853['shift']());}};_0x23732f(++_0x44ae5c);}(_0x31f0,0xb7));var _0x031f=function(_0x5d6f4c,_0x1326b4){_0x5d6f4c=_0x5d6f4c-0x0;var _0x5961ab=_0x31f0[_0x5d6f4c];return _0x5961ab;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index d83d146..cb46fb6 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 _0xce3e=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','bluebird'];(function(_0x19d24c,_0x62bc50){var _0x2fae8d=function(_0x419856){while(--_0x419856){_0x19d24c['push'](_0x19d24c['shift']());}};_0x2fae8d(++_0x62bc50);}(_0xce3e,0xc8));var _0xece3=function(_0x3f1cf2,_0x389edd){_0x3f1cf2=_0x3f1cf2-0x0;var _0x3533d4=_0xce3e[_0x3f1cf2];return _0x3533d4;};'use strict';var _=require(_0xece3('0x0'));var util=require(_0xece3('0x1'));var logger=require('../../config/logger')(_0xece3('0x2'));var moment=require('moment');var BPromise=require(_0xece3('0x3'));var rp=require(_0xece3('0x4'));var fs=require('fs');var path=require(_0xece3('0x5'));var rimraf=require(_0xece3('0x6'));var config=require(_0xece3('0x7'));var attributes=require(_0xece3('0x8'));module[_0xece3('0x9')]=function(_0x10a3fd,_0x3f69d8){return _0x10a3fd['define'](_0xece3('0xa'),attributes,{'tableName':_0xece3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7eab=['request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','api','bluebird'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7eab,0x13f));var _0xb7ea=function(_0x33c315,_0x1fb576){_0x33c315=_0x33c315-0x0;var _0x3bdbc6=_0x7eab[_0x33c315];return _0x3bdbc6;};'use strict';var _=require(_0xb7ea('0x0'));var util=require(_0xb7ea('0x1'));var logger=require(_0xb7ea('0x2'))(_0xb7ea('0x3'));var moment=require('moment');var BPromise=require(_0xb7ea('0x4'));var rp=require(_0xb7ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb7ea('0x6'));var config=require(_0xb7ea('0x7'));var attributes=require(_0xb7ea('0x8'));module[_0xb7ea('0x9')]=function(_0x1d902a,_0x51fd85){return _0x1d902a[_0xb7ea('0xa')](_0xb7ea('0xb'),attributes,{'tableName':'analytics_default_reports','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 a83f532..ad0faa2 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 _0x3b69=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x2c59f4,_0x56ea84){var _0x11a482=function(_0x3560c8){while(--_0x3560c8){_0x2c59f4['push'](_0x2c59f4['shift']());}};_0x11a482(++_0x56ea84);}(_0x3b69,0x94));var _0x93b6=function(_0x5f4cff,_0x3ca7d2){_0x5f4cff=_0x5f4cff-0x0;var _0x55d323=_0x3b69[_0x5f4cff];return _0x55d323;};'use strict';var _=require(_0x93b6('0x0'));var util=require('util');var moment=require(_0x93b6('0x1'));var BPromise=require(_0x93b6('0x2'));var rs=require(_0x93b6('0x3'));var fs=require('fs');var Redis=require(_0x93b6('0x4'));var db=require(_0x93b6('0x5'))['db'];var utils=require(_0x93b6('0x6'));var logger=require(_0x93b6('0x7'))(_0x93b6('0x8'));var config=require(_0x93b6('0x9'));var jayson=require(_0x93b6('0xa'));var client=jayson[_0x93b6('0xb')][_0x93b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a81a4,_0x260df1,_0x30c188){return new BPromise(function(_0x1368d1,_0x67e7df){return client['request'](_0x1a81a4,_0x30c188)[_0x93b6('0xd')](function(_0x482de3){logger[_0x93b6('0xe')](_0x93b6('0xf'),_0x260df1,_0x93b6('0x10'));logger[_0x93b6('0x11')](_0x93b6('0x12'),_0x260df1,'request\x20sent',JSON[_0x93b6('0x13')](_0x482de3));if(_0x482de3[_0x93b6('0x14')]){if(_0x482de3[_0x93b6('0x14')][_0x93b6('0x15')]===0x1f4){logger[_0x93b6('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x260df1,_0x482de3['error'][_0x93b6('0x16')]);return _0x67e7df(_0x482de3[_0x93b6('0x14')][_0x93b6('0x16')]);}logger[_0x93b6('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x260df1,_0x482de3[_0x93b6('0x14')][_0x93b6('0x16')]);return _0x1368d1(_0x482de3[_0x93b6('0x14')][_0x93b6('0x16')]);}else{logger['info'](_0x93b6('0xf'),_0x260df1,'request\x20sent');_0x1368d1(_0x482de3[_0x93b6('0x17')][_0x93b6('0x16')]);}})[_0x93b6('0x18')](function(_0x5f78a2){logger['error'](_0x93b6('0xf'),_0x260df1,_0x5f78a2);_0x67e7df(_0x5f78a2);});});}
\ No newline at end of file
+var _0xce51=['then','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xce51,0x172));var _0x1ce5=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0xce51[_0x5dc03e];return _0x466a07;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1ce5('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ce5('0x1'));var db=require(_0x1ce5('0x2'))['db'];var utils=require(_0x1ce5('0x3'));var logger=require(_0x1ce5('0x4'))(_0x1ce5('0x5'));var config=require(_0x1ce5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1ce5('0x7')][_0x1ce5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x538e65,_0x12375b,_0x914eaa){return new BPromise(function(_0x49e44a,_0xc9f8d7){return client[_0x1ce5('0x9')](_0x538e65,_0x914eaa)[_0x1ce5('0xa')](function(_0x50d8b2){logger['info'](_0x1ce5('0xb'),_0x12375b,'request\x20sent');logger[_0x1ce5('0xc')](_0x1ce5('0xd'),_0x12375b,'request\x20sent',JSON[_0x1ce5('0xe')](_0x50d8b2));if(_0x50d8b2[_0x1ce5('0xf')]){if(_0x50d8b2[_0x1ce5('0xf')][_0x1ce5('0x10')]===0x1f4){logger[_0x1ce5('0xf')](_0x1ce5('0xb'),_0x12375b,_0x50d8b2['error']['message']);return _0xc9f8d7(_0x50d8b2[_0x1ce5('0xf')][_0x1ce5('0x11')]);}logger[_0x1ce5('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x12375b,_0x50d8b2[_0x1ce5('0xf')][_0x1ce5('0x11')]);return _0x49e44a(_0x50d8b2[_0x1ce5('0xf')]['message']);}else{logger[_0x1ce5('0x12')](_0x1ce5('0xb'),_0x12375b,_0x1ce5('0x13'));_0x49e44a(_0x50d8b2['result'][_0x1ce5('0x11')]);}})['catch'](function(_0x34d2c4){logger[_0x1ce5('0xf')](_0x1ce5('0xb'),_0x12375b,_0x34d2c4);_0xc9f8d7(_0x34d2c4);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 9c6b013..1c7344d 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 _0x8fbd=['show','/:id/preview','preview','get','/:id/run','run','/:id/query','query','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','index','isAuthenticated'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x8fbd,0x13b));var _0xd8fb=function(_0x47cbab,_0x27590e){_0x47cbab=_0x47cbab-0x0;var _0x1c7f79=_0x8fbd[_0x47cbab];return _0x1c7f79;};'use strict';var multer=require('multer');var util=require(_0xd8fb('0x0'));var path=require(_0xd8fb('0x1'));var timeout=require(_0xd8fb('0x2'));var express=require(_0xd8fb('0x3'));var router=express[_0xd8fb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd8fb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd8fb('0x6'));var controller=require(_0xd8fb('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd8fb('0x8')]);router['get']('/:id',auth[_0xd8fb('0x9')](),controller[_0xd8fb('0xa')]);router['get'](_0xd8fb('0xb'),auth[_0xd8fb('0x9')](),controller[_0xd8fb('0xc')]);router[_0xd8fb('0xd')](_0xd8fb('0xe'),auth['isAuthenticated'](),controller[_0xd8fb('0xf')]);router['get'](_0xd8fb('0x10'),auth['isAuthenticated'](),controller[_0xd8fb('0x11')]);router['post']('/',auth[_0xd8fb('0x9')](),controller[_0xd8fb('0x12')]);router[_0xd8fb('0x13')](_0xd8fb('0x14'),auth[_0xd8fb('0x9')](),controller[_0xd8fb('0x15')]);router[_0xd8fb('0x16')](_0xd8fb('0x14'),auth['isAuthenticated'](),controller[_0xd8fb('0x17')]);module[_0xd8fb('0x18')]=router;
\ No newline at end of file
+var _0x91c5=['get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','index'];(function(_0x267900,_0x117fa7){var _0x2f95df=function(_0xac178c){while(--_0xac178c){_0x267900['push'](_0x267900['shift']());}};_0x2f95df(++_0x117fa7);}(_0x91c5,0x1c1));var _0x591c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x91c5[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x591c('0x0'));var express=require(_0x591c('0x1'));var router=express[_0x591c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x591c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x591c('0x4'));var controller=require(_0x591c('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x591c('0x6')]);router[_0x591c('0x7')]('/:id',auth[_0x591c('0x8')](),controller[_0x591c('0x9')]);router[_0x591c('0x7')](_0x591c('0xa'),auth[_0x591c('0x8')](),controller[_0x591c('0xb')]);router[_0x591c('0x7')](_0x591c('0xc'),auth['isAuthenticated'](),controller[_0x591c('0xd')]);router[_0x591c('0x7')](_0x591c('0xe'),auth['isAuthenticated'](),controller[_0x591c('0xf')]);router[_0x591c('0x10')]('/',auth[_0x591c('0x8')](),controller[_0x591c('0x11')]);router[_0x591c('0x12')](_0x591c('0x13'),auth['isAuthenticated'](),controller[_0x591c('0x14')]);router[_0x591c('0x15')](_0x591c('0x13'),auth[_0x591c('0x8')](),controller[_0x591c('0x16')]);module[_0x591c('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index ebfba58..66d5209 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 _0x126b=['DATE','manual','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','xlsx'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x126b,0x14d));var _0xb126=function(_0x20b997,_0x3bf796){_0x20b997=_0x20b997-0x0;var _0x5772d1=_0x126b[_0x20b997];return _0x5772d1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb126('0x0'));module[_0xb126('0x1')]={'name':{'type':Sequelize[_0xb126('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xb126('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xb126('0x3')](_0xb126('0x4'),_0xb126('0x5'),_0xb126('0x6')),'allowNull':![],'defaultValue':_0xb126('0x4')},'savename':{'type':Sequelize[_0xb126('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xb126('0x7')]},'endDate':{'type':Sequelize[_0xb126('0x7')]},'status':{'type':Sequelize[_0xb126('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xb126('0x3')](_0xb126('0x8'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xb126('0x9')]},'reportType':{'type':Sequelize[_0xb126('0x2')]}};
\ No newline at end of file
+var _0xe8eb=['pdf','xlsx','DATE','ENUM','manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING','csv'];(function(_0x374521,_0x4703fb){var _0x2120b9=function(_0x3f57b0){while(--_0x3f57b0){_0x374521['push'](_0x374521['shift']());}};_0x2120b9(++_0x4703fb);}(_0xe8eb,0x8b));var _0xbe8e=function(_0x5e9491,_0x129e18){_0x5e9491=_0x5e9491-0x0;var _0x2f6d97=_0xe8eb[_0x5e9491];return _0x2f6d97;};'use strict';var Sequelize=require(_0xbe8e('0x0'));var moment=require(_0xbe8e('0x1'));module[_0xbe8e('0x2')]={'name':{'type':Sequelize[_0xbe8e('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xbe8e('0x4'),_0xbe8e('0x5'),_0xbe8e('0x6')),'allowNull':![],'defaultValue':_0xbe8e('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xbe8e('0x7')]},'status':{'type':Sequelize[_0xbe8e('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xbe8e('0x8')](_0xbe8e('0x9'),_0xbe8e('0xa')),'allowNull':![],'defaultValue':_0xbe8e('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xbe8e('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 8ce1bcf..7fa4d2b 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 _0x163b=['download','savename','output','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','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','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','then','get','ExtractedReports','destroy','error','send','index','map','AnalyticExtractedReport','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','findAll','show','params','rawAttributes','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x163b,0xc3));var _0xb163=function(_0x40d995,_0x32d2ea){_0x40d995=_0x40d995-0x0;var _0x5bff95=_0x163b[_0x40d995];return _0x5bff95;};'use strict';var emlformat=require(_0xb163('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb163('0x1'));var rp=require(_0xb163('0x2'));var moment=require(_0xb163('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb163('0x4'));var path=require(_0xb163('0x5'));var sox=require(_0xb163('0x6'));var csv=require(_0xb163('0x7'));var ejs=require(_0xb163('0x8'));var fs=require('fs');var fs_extra=require(_0xb163('0x9'));var _=require(_0xb163('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb163('0xb'));var deskjs=require(_0xb163('0xc'));var toCsv=require(_0xb163('0x7'));var querystring=require(_0xb163('0xd'));var Papa=require(_0xb163('0xe'));var Redis=require(_0xb163('0xf'));var authService=require(_0xb163('0x10'));var qs=require(_0xb163('0x11'));var as=require(_0xb163('0x12'));var hardwareService=require(_0xb163('0x13'));var logger=require(_0xb163('0x14'))(_0xb163('0x15'));var utils=require(_0xb163('0x16'));var config=require(_0xb163('0x17'));var licenseUtil=require(_0xb163('0x18'));var db=require(_0xb163('0x19'))['db'];function respondWithStatusCode(_0x4e1637,_0x4a25a7){_0x4a25a7=_0x4a25a7||0xcc;return function(_0x5a91e5){if(_0x5a91e5){return _0x4e1637[_0xb163('0x1a')](_0x4a25a7);}return _0x4e1637[_0xb163('0x1b')](_0x4a25a7)[_0xb163('0x1c')]();};}function respondWithResult(_0x46af40,_0x1b3e3f){_0x1b3e3f=_0x1b3e3f||0xc8;return function(_0x354566){if(_0x354566){return _0x46af40['status'](_0x1b3e3f)['json'](_0x354566);}};}function respondWithFilteredResult(_0x1f6e91,_0x25aa3d){return function(_0x46b062){if(_0x46b062){var _0x1a487f=typeof _0x25aa3d['offset']===_0xb163('0x1d')&&typeof _0x25aa3d[_0xb163('0x1e')]===_0xb163('0x1d');var _0x156424=_0x46b062[_0xb163('0x1f')];var _0x3be265=_0x1a487f?0x0:_0x25aa3d[_0xb163('0x20')];var _0x54dc8b=_0x1a487f?_0x46b062['count']:_0x25aa3d[_0xb163('0x20')]+_0x25aa3d[_0xb163('0x1e')];var _0x48de28;if(_0x54dc8b>=_0x156424){_0x54dc8b=_0x156424;_0x48de28=0xc8;}else{_0x48de28=0xce;}_0x1f6e91[_0xb163('0x1b')](_0x48de28);return _0x1f6e91['set'](_0xb163('0x21'),_0x3be265+'-'+_0x54dc8b+'/'+_0x156424)[_0xb163('0x22')](_0x46b062);}return null;};}function patchUpdates(_0x3503c6){return function(_0xea413f){try{jsonpatch['apply'](_0xea413f,_0x3503c6,!![]);}catch(_0x473b47){return BPromise[_0xb163('0x23')](_0x473b47);}return _0xea413f[_0xb163('0x24')]();};}function saveUpdates(_0x2d3572,_0x10f179){return function(_0x3ce51a){if(_0x3ce51a){return _0x3ce51a['update'](_0x2d3572)[_0xb163('0x25')](function(_0x15462d){return _0x15462d;});}return null;};}function removeEntity(_0x5148d9,_0x847112){return function(_0x5e505d){if(_0x5e505d){return _0x5e505d['destroy']()['then'](function(){var _0x3f4e55=_0x5e505d[_0xb163('0x26')]({'plain':!![]});var _0x59464a=_0xb163('0x27');return db['UserProfileResource'][_0xb163('0x28')]({'where':{'type':_0x59464a,'resourceId':_0x3f4e55['id']}})[_0xb163('0x25')](function(){return _0x5e505d;});})[_0xb163('0x25')](function(){_0x5148d9[_0xb163('0x1b')](0xcc)[_0xb163('0x1c')]();});}};}function handleEntityNotFound(_0x17a88c,_0x466f6d){return function(_0x220bb2){if(!_0x220bb2){_0x17a88c[_0xb163('0x1a')](0x194);}return _0x220bb2;};}function handleError(_0x40a96f,_0x37c63f){_0x37c63f=_0x37c63f||0x1f4;return function(_0x1d552f){logger[_0xb163('0x29')](_0x1d552f['stack']);if(_0x1d552f['name']){delete _0x1d552f['name'];}_0x40a96f[_0xb163('0x1b')](_0x37c63f)[_0xb163('0x2a')](_0x1d552f);};}exports[_0xb163('0x2b')]=function(_0x17bfe,_0x3eb442){var _0x1fc517={},_0x545768={},_0x147d3c={'count':0x0,'rows':[]};var _0x4c1a40=_[_0xb163('0x2c')](db[_0xb163('0x2d')]['rawAttributes'],function(_0x1fcaad){return{'name':_0x1fcaad['fieldName'],'type':_0x1fcaad[_0xb163('0x2e')][_0xb163('0x2f')]};});_0x545768[_0xb163('0x30')]=_['map'](_0x4c1a40,_0xb163('0x31'));_0x545768[_0xb163('0x32')]=_[_0xb163('0x33')](_0x17bfe[_0xb163('0x32')]);_0x545768[_0xb163('0x34')]=_[_0xb163('0x35')](_0x545768[_0xb163('0x30')],_0x545768[_0xb163('0x32')]);_0x1fc517[_0xb163('0x36')]=_[_0xb163('0x35')](_0x545768[_0xb163('0x30')],qs[_0xb163('0x37')](_0x17bfe['query'][_0xb163('0x37')]));_0x1fc517[_0xb163('0x36')]=_0x1fc517[_0xb163('0x36')][_0xb163('0x38')]?_0x1fc517[_0xb163('0x36')]:_0x545768[_0xb163('0x30')];if(!_0x17bfe[_0xb163('0x32')][_0xb163('0x39')]('nolimit')){_0x1fc517[_0xb163('0x1e')]=qs[_0xb163('0x1e')](_0x17bfe['query']['limit']);_0x1fc517[_0xb163('0x20')]=qs[_0xb163('0x20')](_0x17bfe[_0xb163('0x32')][_0xb163('0x20')]);}_0x1fc517[_0xb163('0x3a')]=qs[_0xb163('0x3b')](_0x17bfe[_0xb163('0x32')]['sort']);_0x1fc517[_0xb163('0x3c')]=qs[_0xb163('0x34')](_['pick'](_0x17bfe[_0xb163('0x32')],_0x545768[_0xb163('0x34')]),_0x4c1a40);if(_0x17bfe[_0xb163('0x32')][_0xb163('0x3d')]){_0x1fc517['where']=_['merge'](_0x1fc517[_0xb163('0x3c')],{'$or':_['map'](_0x4c1a40,function(_0x9fbe00){if(_0x9fbe00[_0xb163('0x2e')]!==_0xb163('0x3e')){var _0xacc259={};_0xacc259[_0x9fbe00['name']]={'$like':'%'+_0x17bfe[_0xb163('0x32')][_0xb163('0x3d')]+'%'};return _0xacc259;}})});}_0x1fc517=_[_0xb163('0x3f')]({},_0x1fc517,_0x17bfe['options']);var _0x57b861={'where':_0x1fc517[_0xb163('0x3c')]};return db[_0xb163('0x2d')][_0xb163('0x1f')](_0x57b861)[_0xb163('0x25')](function(_0x5dea70){_0x147d3c[_0xb163('0x1f')]=_0x5dea70;if(_0x17bfe[_0xb163('0x32')][_0xb163('0x40')]){_0x1fc517['include']=[{'all':!![]}];}return db[_0xb163('0x2d')][_0xb163('0x41')](_0x1fc517);})[_0xb163('0x25')](function(_0x1e3301){_0x147d3c['rows']=_0x1e3301;return _0x147d3c;})[_0xb163('0x25')](respondWithFilteredResult(_0x3eb442,_0x1fc517))['catch'](handleError(_0x3eb442,null));};exports[_0xb163('0x42')]=function(_0x1409c0,_0x389604){var _0x464234={'raw':!![],'where':{'id':_0x1409c0[_0xb163('0x43')]['id']}},_0x2f2552={};_0x2f2552[_0xb163('0x30')]=_[_0xb163('0x33')](db[_0xb163('0x2d')][_0xb163('0x44')]);_0x2f2552['query']=_[_0xb163('0x33')](_0x1409c0[_0xb163('0x32')]);_0x2f2552[_0xb163('0x34')]=_['intersection'](_0x2f2552['model'],_0x2f2552['query']);_0x464234['attributes']=_[_0xb163('0x35')](_0x2f2552[_0xb163('0x30')],qs[_0xb163('0x37')](_0x1409c0[_0xb163('0x32')][_0xb163('0x37')]));_0x464234[_0xb163('0x36')]=_0x464234[_0xb163('0x36')][_0xb163('0x38')]?_0x464234[_0xb163('0x36')]:_0x2f2552[_0xb163('0x30')];if(_0x1409c0['query'][_0xb163('0x40')]){_0x464234[_0xb163('0x45')]=[{'all':!![]}];}_0x464234=_['merge']({},_0x464234,_0x1409c0['options']);return db['AnalyticExtractedReport'][_0xb163('0x46')](_0x464234)[_0xb163('0x25')](handleEntityNotFound(_0x389604,null))[_0xb163('0x25')](respondWithResult(_0x389604,null))[_0xb163('0x47')](handleError(_0x389604,null));};exports[_0xb163('0x48')]=function(_0x33a20c,_0x186ee1){return db[_0xb163('0x2d')]['create'](_0x33a20c['body'],{})[_0xb163('0x25')](function(_0x44a7da){var _0x2288ea=_0x33a20c[_0xb163('0x49')][_0xb163('0x26')]({'plain':!![]});if(!_0x2288ea)throw new Error(_0xb163('0x4a'));if(_0x2288ea['role']==='user'){var _0x11209e=_0x44a7da['get']({'plain':!![]});var _0x964727=_0xb163('0x27');return db['UserProfileSection'][_0xb163('0x46')]({'where':{'name':_0x964727,'userProfileId':_0x2288ea[_0xb163('0x4b')]},'raw':!![]})['then'](function(_0x94d7e2){if(_0x94d7e2&&_0x94d7e2[_0xb163('0x4c')]===0x0){return db[_0xb163('0x4d')][_0xb163('0x48')]({'name':_0x11209e[_0xb163('0x31')],'resourceId':_0x11209e['id'],'type':_0x94d7e2['name'],'sectionId':_0x94d7e2['id']},{})['then'](function(){return _0x44a7da;});}else{return _0x44a7da;}})['catch'](function(_0x42cdb8){logger[_0xb163('0x29')](_0xb163('0x4e'),_0x42cdb8);throw _0x42cdb8;});}return _0x44a7da;})['then'](respondWithResult(_0x186ee1,0xc9))[_0xb163('0x47')](handleError(_0x186ee1,null));};exports[_0xb163('0x4f')]=function(_0x52750b,_0x23779e){if(_0x52750b[_0xb163('0x50')]['id']){delete _0x52750b[_0xb163('0x50')]['id'];}return db[_0xb163('0x2d')][_0xb163('0x46')]({'where':{'id':_0x52750b[_0xb163('0x43')]['id']}})['then'](handleEntityNotFound(_0x23779e,null))[_0xb163('0x25')](saveUpdates(_0x52750b[_0xb163('0x50')],null))[_0xb163('0x25')](respondWithResult(_0x23779e,null))[_0xb163('0x47')](handleError(_0x23779e,null));};exports['destroy']=function(_0x17e821,_0x45ca23){return db['AnalyticExtractedReport'][_0xb163('0x46')]({'where':{'id':_0x17e821['params']['id']}})[_0xb163('0x25')](handleEntityNotFound(_0x45ca23,null))[_0xb163('0x25')](removeEntity(_0x45ca23,null))[_0xb163('0x47')](handleError(_0x45ca23,null));};exports[_0xb163('0x51')]=function(_0x4526f3,_0x530f69,_0x223660){return db[_0xb163('0x2d')][_0xb163('0x46')]({'where':{'id':_0x4526f3['params']['id']},'attributes':[_0xb163('0x31'),'basename',_0xb163('0x52'),_0xb163('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x530f69,null))['then'](function(_0x3fc51d){if(_0x3fc51d){if(!fs['existsSync'](path[_0xb163('0x54')](config[_0xb163('0x55')],_0xb163('0x56'),_0x3fc51d[_0xb163('0x52')]))){throw new db[(_0xb163('0x57'))]['ValidationError'](_0xb163('0x58'));}if(_0x4526f3[_0xb163('0x32')][_0xb163('0x59')]){return _0x530f69[_0xb163('0x1a')](0xc8);}return _0x530f69[_0xb163('0x51')](path[_0xb163('0x54')](config[_0xb163('0x55')],_0xb163('0x56'),_0x3fc51d['savename']),util['format'](_0xb163('0x5a'),_0x3fc51d['basename']||_0x3fc51d[_0xb163('0x31')],_0x3fc51d[_0xb163('0x53')][_0xb163('0x5b')]()));}})['catch'](handleError(_0x530f69,null));};
\ No newline at end of file
+var _0x36d5=['find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','basename','output','existsSync','root','server/files/reports','savename','Sequelize','ValidationError','download','join','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','count','offset','limit','set','reject','save','then','destroy','get','ExtractedReports','error','stack','name','send','index','map','AnalyticExtractedReport','type','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x36d5,0x187));var _0x536d=function(_0x297dcf,_0x448cf5){_0x297dcf=_0x297dcf-0x0;var _0xe1699b=_0x36d5[_0x297dcf];return _0xe1699b;};'use strict';var emlformat=require(_0x536d('0x0'));var rimraf=require(_0x536d('0x1'));var zipdir=require(_0x536d('0x2'));var jsonpatch=require(_0x536d('0x3'));var rp=require('request-promise');var moment=require(_0x536d('0x4'));var BPromise=require(_0x536d('0x5'));var Mustache=require(_0x536d('0x6'));var util=require(_0x536d('0x7'));var path=require(_0x536d('0x8'));var sox=require(_0x536d('0x9'));var csv=require(_0x536d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x536d('0xb'));var _=require(_0x536d('0xc'));var squel=require(_0x536d('0xd'));var crypto=require(_0x536d('0xe'));var jsforce=require(_0x536d('0xf'));var deskjs=require(_0x536d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x536d('0x11'));var Papa=require('papaparse');var Redis=require(_0x536d('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x536d('0x13'));var hardwareService=require(_0x536d('0x14'));var logger=require(_0x536d('0x15'))(_0x536d('0x16'));var utils=require(_0x536d('0x17'));var config=require(_0x536d('0x18'));var licenseUtil=require(_0x536d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x252b8f,_0x50c62e){_0x50c62e=_0x50c62e||0xcc;return function(_0x3a4bef){if(_0x3a4bef){return _0x252b8f[_0x536d('0x1a')](_0x50c62e);}return _0x252b8f[_0x536d('0x1b')](_0x50c62e)['end']();};}function respondWithResult(_0x3d6b57,_0x138c60){_0x138c60=_0x138c60||0xc8;return function(_0x19df46){if(_0x19df46){return _0x3d6b57['status'](_0x138c60)[_0x536d('0x1c')](_0x19df46);}};}function respondWithFilteredResult(_0x253c8d,_0x48657d){return function(_0x5e2dad){if(_0x5e2dad){var _0x5df25c=typeof _0x48657d['offset']==='undefined'&&typeof _0x48657d['limit']==='undefined';var _0x2d8f57=_0x5e2dad[_0x536d('0x1d')];var _0xa45dde=_0x5df25c?0x0:_0x48657d[_0x536d('0x1e')];var _0x1d5620=_0x5df25c?_0x5e2dad[_0x536d('0x1d')]:_0x48657d[_0x536d('0x1e')]+_0x48657d[_0x536d('0x1f')];var _0x2302f7;if(_0x1d5620>=_0x2d8f57){_0x1d5620=_0x2d8f57;_0x2302f7=0xc8;}else{_0x2302f7=0xce;}_0x253c8d[_0x536d('0x1b')](_0x2302f7);return _0x253c8d[_0x536d('0x20')]('Content-Range',_0xa45dde+'-'+_0x1d5620+'/'+_0x2d8f57)[_0x536d('0x1c')](_0x5e2dad);}return null;};}function patchUpdates(_0x6c0317){return function(_0x1bd090){try{jsonpatch['apply'](_0x1bd090,_0x6c0317,!![]);}catch(_0x330465){return BPromise[_0x536d('0x21')](_0x330465);}return _0x1bd090[_0x536d('0x22')]();};}function saveUpdates(_0x115fab,_0x33570b){return function(_0x477a50){if(_0x477a50){return _0x477a50['update'](_0x115fab)[_0x536d('0x23')](function(_0x191490){return _0x191490;});}return null;};}function removeEntity(_0x32a859,_0x713a60){return function(_0x4a9b32){if(_0x4a9b32){return _0x4a9b32[_0x536d('0x24')]()[_0x536d('0x23')](function(){var _0x1241b0=_0x4a9b32[_0x536d('0x25')]({'plain':!![]});var _0x447d7d=_0x536d('0x26');return db['UserProfileResource'][_0x536d('0x24')]({'where':{'type':_0x447d7d,'resourceId':_0x1241b0['id']}})[_0x536d('0x23')](function(){return _0x4a9b32;});})[_0x536d('0x23')](function(){_0x32a859[_0x536d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x689dc2,_0x3ae27d){return function(_0x1ddebc){if(!_0x1ddebc){_0x689dc2['sendStatus'](0x194);}return _0x1ddebc;};}function handleError(_0x22df44,_0x139e97){_0x139e97=_0x139e97||0x1f4;return function(_0x5575ec){logger[_0x536d('0x27')](_0x5575ec[_0x536d('0x28')]);if(_0x5575ec[_0x536d('0x29')]){delete _0x5575ec[_0x536d('0x29')];}_0x22df44[_0x536d('0x1b')](_0x139e97)[_0x536d('0x2a')](_0x5575ec);};}exports[_0x536d('0x2b')]=function(_0x252079,_0x14c3b6){var _0x5877c4={},_0x1c7b1d={},_0x255bf0={'count':0x0,'rows':[]};var _0x39ad94=_[_0x536d('0x2c')](db[_0x536d('0x2d')]['rawAttributes'],function(_0x22c132){return{'name':_0x22c132['fieldName'],'type':_0x22c132[_0x536d('0x2e')]['key']};});_0x1c7b1d[_0x536d('0x2f')]=_['map'](_0x39ad94,_0x536d('0x29'));_0x1c7b1d[_0x536d('0x30')]=_[_0x536d('0x31')](_0x252079[_0x536d('0x30')]);_0x1c7b1d[_0x536d('0x32')]=_['intersection'](_0x1c7b1d['model'],_0x1c7b1d[_0x536d('0x30')]);_0x5877c4[_0x536d('0x33')]=_[_0x536d('0x34')](_0x1c7b1d[_0x536d('0x2f')],qs[_0x536d('0x35')](_0x252079[_0x536d('0x30')][_0x536d('0x35')]));_0x5877c4['attributes']=_0x5877c4[_0x536d('0x33')][_0x536d('0x36')]?_0x5877c4[_0x536d('0x33')]:_0x1c7b1d[_0x536d('0x2f')];if(!_0x252079[_0x536d('0x30')]['hasOwnProperty']('nolimit')){_0x5877c4['limit']=qs[_0x536d('0x1f')](_0x252079[_0x536d('0x30')][_0x536d('0x1f')]);_0x5877c4['offset']=qs[_0x536d('0x1e')](_0x252079['query']['offset']);}_0x5877c4[_0x536d('0x37')]=qs[_0x536d('0x38')](_0x252079[_0x536d('0x30')][_0x536d('0x38')]);_0x5877c4[_0x536d('0x39')]=qs[_0x536d('0x32')](_[_0x536d('0x3a')](_0x252079[_0x536d('0x30')],_0x1c7b1d[_0x536d('0x32')]),_0x39ad94);if(_0x252079[_0x536d('0x30')][_0x536d('0x3b')]){_0x5877c4[_0x536d('0x39')]=_[_0x536d('0x3c')](_0x5877c4[_0x536d('0x39')],{'$or':_[_0x536d('0x2c')](_0x39ad94,function(_0x1f255){if(_0x1f255[_0x536d('0x2e')]!==_0x536d('0x3d')){var _0x47e866={};_0x47e866[_0x1f255[_0x536d('0x29')]]={'$like':'%'+_0x252079[_0x536d('0x30')][_0x536d('0x3b')]+'%'};return _0x47e866;}})});}_0x5877c4=_[_0x536d('0x3c')]({},_0x5877c4,_0x252079[_0x536d('0x3e')]);var _0x1177c5={'where':_0x5877c4[_0x536d('0x39')]};return db[_0x536d('0x2d')][_0x536d('0x1d')](_0x1177c5)[_0x536d('0x23')](function(_0x529f71){_0x255bf0[_0x536d('0x1d')]=_0x529f71;if(_0x252079[_0x536d('0x30')][_0x536d('0x3f')]){_0x5877c4[_0x536d('0x40')]=[{'all':!![]}];}return db[_0x536d('0x2d')][_0x536d('0x41')](_0x5877c4);})[_0x536d('0x23')](function(_0x554ee6){_0x255bf0['rows']=_0x554ee6;return _0x255bf0;})[_0x536d('0x23')](respondWithFilteredResult(_0x14c3b6,_0x5877c4))[_0x536d('0x42')](handleError(_0x14c3b6,null));};exports[_0x536d('0x43')]=function(_0x277a78,_0x4d920b){var _0x2db727={'raw':!![],'where':{'id':_0x277a78[_0x536d('0x44')]['id']}},_0x37a47f={};_0x37a47f['model']=_[_0x536d('0x31')](db[_0x536d('0x2d')]['rawAttributes']);_0x37a47f[_0x536d('0x30')]=_[_0x536d('0x31')](_0x277a78[_0x536d('0x30')]);_0x37a47f[_0x536d('0x32')]=_[_0x536d('0x34')](_0x37a47f['model'],_0x37a47f['query']);_0x2db727[_0x536d('0x33')]=_[_0x536d('0x34')](_0x37a47f[_0x536d('0x2f')],qs[_0x536d('0x35')](_0x277a78[_0x536d('0x30')][_0x536d('0x35')]));_0x2db727[_0x536d('0x33')]=_0x2db727[_0x536d('0x33')][_0x536d('0x36')]?_0x2db727[_0x536d('0x33')]:_0x37a47f[_0x536d('0x2f')];if(_0x277a78[_0x536d('0x30')][_0x536d('0x3f')]){_0x2db727[_0x536d('0x40')]=[{'all':!![]}];}_0x2db727=_[_0x536d('0x3c')]({},_0x2db727,_0x277a78['options']);return db['AnalyticExtractedReport'][_0x536d('0x45')](_0x2db727)[_0x536d('0x23')](handleEntityNotFound(_0x4d920b,null))[_0x536d('0x23')](respondWithResult(_0x4d920b,null))[_0x536d('0x42')](handleError(_0x4d920b,null));};exports[_0x536d('0x46')]=function(_0x5579f4,_0x38535c){return db[_0x536d('0x2d')]['create'](_0x5579f4[_0x536d('0x47')],{})[_0x536d('0x23')](function(_0x54ab7d){var _0x3ee93d=_0x5579f4['user'][_0x536d('0x25')]({'plain':!![]});if(!_0x3ee93d)throw new Error(_0x536d('0x48'));if(_0x3ee93d[_0x536d('0x49')]===_0x536d('0x4a')){var _0x481961=_0x54ab7d[_0x536d('0x25')]({'plain':!![]});var _0x2567d3=_0x536d('0x26');return db['UserProfileSection'][_0x536d('0x45')]({'where':{'name':_0x2567d3,'userProfileId':_0x3ee93d[_0x536d('0x4b')]},'raw':!![]})[_0x536d('0x23')](function(_0x2daae1){if(_0x2daae1&&_0x2daae1[_0x536d('0x4c')]===0x0){return db['UserProfileResource'][_0x536d('0x46')]({'name':_0x481961[_0x536d('0x29')],'resourceId':_0x481961['id'],'type':_0x2daae1[_0x536d('0x29')],'sectionId':_0x2daae1['id']},{})[_0x536d('0x23')](function(){return _0x54ab7d;});}else{return _0x54ab7d;}})['catch'](function(_0x2dc587){logger['error'](_0x536d('0x4d'),_0x2dc587);throw _0x2dc587;});}return _0x54ab7d;})['then'](respondWithResult(_0x38535c,0xc9))[_0x536d('0x42')](handleError(_0x38535c,null));};exports[_0x536d('0x4e')]=function(_0x508abd,_0x3a476d){if(_0x508abd['body']['id']){delete _0x508abd[_0x536d('0x47')]['id'];}return db['AnalyticExtractedReport'][_0x536d('0x45')]({'where':{'id':_0x508abd[_0x536d('0x44')]['id']}})[_0x536d('0x23')](handleEntityNotFound(_0x3a476d,null))[_0x536d('0x23')](saveUpdates(_0x508abd[_0x536d('0x47')],null))['then'](respondWithResult(_0x3a476d,null))[_0x536d('0x42')](handleError(_0x3a476d,null));};exports[_0x536d('0x24')]=function(_0x404064,_0x5b2048){return db[_0x536d('0x2d')][_0x536d('0x45')]({'where':{'id':_0x404064[_0x536d('0x44')]['id']}})[_0x536d('0x23')](handleEntityNotFound(_0x5b2048,null))[_0x536d('0x23')](removeEntity(_0x5b2048,null))['catch'](handleError(_0x5b2048,null));};exports['download']=function(_0x41ad04,_0x1a33ac,_0x3a7c0d){return db[_0x536d('0x2d')][_0x536d('0x45')]({'where':{'id':_0x41ad04['params']['id']},'attributes':[_0x536d('0x29'),_0x536d('0x4f'),'savename',_0x536d('0x50')],'raw':!![]})[_0x536d('0x23')](handleEntityNotFound(_0x1a33ac,null))[_0x536d('0x23')](function(_0x446bb6){if(_0x446bb6){if(!fs[_0x536d('0x51')](path['join'](config[_0x536d('0x52')],_0x536d('0x53'),_0x446bb6[_0x536d('0x54')]))){throw new db[(_0x536d('0x55'))][(_0x536d('0x56'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x41ad04[_0x536d('0x30')]['exists']){return _0x1a33ac[_0x536d('0x1a')](0xc8);}return _0x1a33ac[_0x536d('0x57')](path[_0x536d('0x58')](config[_0x536d('0x52')],'server/files/reports',_0x446bb6[_0x536d('0x54')]),util[_0x536d('0x59')](_0x536d('0x5a'),_0x446bb6[_0x536d('0x4f')]||_0x446bb6[_0x536d('0x29')],_0x446bb6['output'][_0x536d('0x5b')]()));}})[_0x536d('0x42')](handleError(_0x1a33ac,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 00cb0ce..567917c 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 _0x8279=['request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment'];(function(_0x4bd882,_0x350341){var _0x2f0513=function(_0x1da504){while(--_0x1da504){_0x4bd882['push'](_0x4bd882['shift']());}};_0x2f0513(++_0x350341);}(_0x8279,0x1a8));var _0x9827=function(_0x3e7851,_0x1ae1c1){_0x3e7851=_0x3e7851-0x0;var _0x2266bf=_0x8279[_0x3e7851];return _0x2266bf;};'use strict';var _=require(_0x9827('0x0'));var util=require(_0x9827('0x1'));var logger=require(_0x9827('0x2'))(_0x9827('0x3'));var moment=require(_0x9827('0x4'));var BPromise=require('bluebird');var rp=require(_0x9827('0x5'));var fs=require('fs');var path=require(_0x9827('0x6'));var rimraf=require(_0x9827('0x7'));var config=require(_0x9827('0x8'));var attributes=require(_0x9827('0x9'));module[_0x9827('0xa')]=function(_0x387267,_0x1e4df8){return _0x387267['define'](_0x9827('0xb'),attributes,{'tableName':_0x9827('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f21=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash'];(function(_0x35e327,_0x3cda24){var _0x4f2310=function(_0x2cf292){while(--_0x2cf292){_0x35e327['push'](_0x35e327['shift']());}};_0x4f2310(++_0x3cda24);}(_0x6f21,0xfb));var _0x16f2=function(_0x4faabc,_0x349a1e){_0x4faabc=_0x4faabc-0x0;var _0x42fc45=_0x6f21[_0x4faabc];return _0x42fc45;};'use strict';var _=require(_0x16f2('0x0'));var util=require(_0x16f2('0x1'));var logger=require(_0x16f2('0x2'))(_0x16f2('0x3'));var moment=require(_0x16f2('0x4'));var BPromise=require(_0x16f2('0x5'));var rp=require(_0x16f2('0x6'));var fs=require('fs');var path=require(_0x16f2('0x7'));var rimraf=require(_0x16f2('0x8'));var config=require(_0x16f2('0x9'));var attributes=require(_0x16f2('0xa'));module[_0x16f2('0xb')]=function(_0x193481,_0x120653){return _0x193481[_0x16f2('0xc')](_0x16f2('0xd'),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 f919075..0cb52ef 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 _0x4bf4=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring'];(function(_0x539a0a,_0x379a9e){var _0x181e7c=function(_0x33e594){while(--_0x33e594){_0x539a0a['push'](_0x539a0a['shift']());}};_0x181e7c(++_0x379a9e);}(_0x4bf4,0x187));var _0x44bf=function(_0x504108,_0x51ae00){_0x504108=_0x504108-0x0;var _0x1b779d=_0x4bf4[_0x504108];return _0x1b779d;};'use strict';var _=require(_0x44bf('0x0'));var util=require(_0x44bf('0x1'));var moment=require(_0x44bf('0x2'));var BPromise=require(_0x44bf('0x3'));var rs=require(_0x44bf('0x4'));var fs=require('fs');var Redis=require(_0x44bf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x44bf('0x6'));var logger=require(_0x44bf('0x7'))(_0x44bf('0x8'));var config=require('../../config/environment');var jayson=require(_0x44bf('0x9'));var client=jayson[_0x44bf('0xa')][_0x44bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x294b60,_0x5c91cf,_0x517306){return new BPromise(function(_0x243241,_0x41598e){return client[_0x44bf('0xc')](_0x294b60,_0x517306)['then'](function(_0x440fa3){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5c91cf,_0x44bf('0xd'));logger[_0x44bf('0xe')](_0x44bf('0xf'),_0x5c91cf,_0x44bf('0xd'),JSON['stringify'](_0x440fa3));if(_0x440fa3['error']){if(_0x440fa3[_0x44bf('0x10')][_0x44bf('0x11')]===0x1f4){logger[_0x44bf('0x10')](_0x44bf('0x12'),_0x5c91cf,_0x440fa3[_0x44bf('0x10')][_0x44bf('0x13')]);return _0x41598e(_0x440fa3[_0x44bf('0x10')][_0x44bf('0x13')]);}logger[_0x44bf('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5c91cf,_0x440fa3['error']['message']);return _0x243241(_0x440fa3['error'][_0x44bf('0x13')]);}else{logger[_0x44bf('0x14')](_0x44bf('0x12'),_0x5c91cf,_0x44bf('0xd'));_0x243241(_0x440fa3[_0x44bf('0x15')][_0x44bf('0x13')]);}})['catch'](function(_0x1d2742){logger[_0x44bf('0x10')](_0x44bf('0x12'),_0x5c91cf,_0x1d2742);_0x41598e(_0x1d2742);});});}
\ No newline at end of file
+var _0x10d0=['catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1ab0e6,_0x17ba8d){var _0x248815=function(_0x5d2b40){while(--_0x5d2b40){_0x1ab0e6['push'](_0x1ab0e6['shift']());}};_0x248815(++_0x17ba8d);}(_0x10d0,0x13c));var _0x010d=function(_0xfcf442,_0x374291){_0xfcf442=_0xfcf442-0x0;var _0x5de656=_0x10d0[_0xfcf442];return _0x5de656;};'use strict';var _=require(_0x010d('0x0'));var util=require(_0x010d('0x1'));var moment=require('moment');var BPromise=require(_0x010d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x010d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x010d('0x4'));var logger=require(_0x010d('0x5'))(_0x010d('0x6'));var config=require('../../config/environment');var jayson=require(_0x010d('0x7'));var client=jayson[_0x010d('0x8')][_0x010d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48c7cd,_0x293e9c,_0x19a106){return new BPromise(function(_0x2f9013,_0x2483ca){return client[_0x010d('0xa')](_0x48c7cd,_0x19a106)[_0x010d('0xb')](function(_0x282aad){logger['info'](_0x010d('0xc'),_0x293e9c,'request\x20sent');logger[_0x010d('0xd')](_0x010d('0xe'),_0x293e9c,_0x010d('0xf'),JSON[_0x010d('0x10')](_0x282aad));if(_0x282aad[_0x010d('0x11')]){if(_0x282aad[_0x010d('0x11')][_0x010d('0x12')]===0x1f4){logger['error'](_0x010d('0xc'),_0x293e9c,_0x282aad['error'][_0x010d('0x13')]);return _0x2483ca(_0x282aad[_0x010d('0x11')][_0x010d('0x13')]);}logger[_0x010d('0x11')](_0x010d('0xc'),_0x293e9c,_0x282aad[_0x010d('0x11')]['message']);return _0x2f9013(_0x282aad['error'][_0x010d('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x293e9c,'request\x20sent');_0x2f9013(_0x282aad['result'][_0x010d('0x13')]);}})[_0x010d('0x14')](function(_0x3faa6c){logger[_0x010d('0x11')](_0x010d('0xc'),_0x293e9c,_0x3faa6c);_0x2483ca(_0x3faa6c);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index c7a022e..0d9b333 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 _0x7348=['../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated','show','download','post','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2ad068,_0x379abc){var _0x5babb6=function(_0x43ab8b){while(--_0x43ab8b){_0x2ad068['push'](_0x2ad068['shift']());}};_0x5babb6(++_0x379abc);}(_0x7348,0x64));var _0x8734=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7348[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x8734('0x0'));var util=require(_0x8734('0x1'));var path=require(_0x8734('0x2'));var timeout=require(_0x8734('0x3'));var express=require(_0x8734('0x4'));var router=express[_0x8734('0x5')]();var fs_extra=require(_0x8734('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8734('0x7'));var config=require(_0x8734('0x8'));var controller=require(_0x8734('0x9'));router[_0x8734('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8734('0xa')](_0x8734('0xb'),auth[_0x8734('0xc')](),controller[_0x8734('0xd')]);router[_0x8734('0xa')]('/:id/download',auth[_0x8734('0xc')](),controller[_0x8734('0xe')]);router[_0x8734('0xf')]('/',auth[_0x8734('0xc')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8734('0x10')]);router['delete'](_0x8734('0xb'),auth[_0x8734('0xc')](),controller[_0x8734('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x8771=['delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','put'];(function(_0x10f2dc,_0x3bd93b){var _0x3bbbc6=function(_0x2770dc){while(--_0x2770dc){_0x10f2dc['push'](_0x10f2dc['shift']());}};_0x3bbbc6(++_0x3bd93b);}(_0x8771,0x193));var _0x1877=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0x8771[_0x104e21];return _0x605b37;};'use strict';var multer=require(_0x1877('0x0'));var util=require(_0x1877('0x1'));var path=require(_0x1877('0x2'));var timeout=require('connect-timeout');var express=require(_0x1877('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1877('0x4'));var interaction=require(_0x1877('0x5'));var config=require(_0x1877('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0x1877('0x7')]('/',auth[_0x1877('0x8')](),controller['index']);router[_0x1877('0x7')](_0x1877('0x9'),auth[_0x1877('0x8')](),controller[_0x1877('0xa')]);router[_0x1877('0x7')](_0x1877('0xb'),auth[_0x1877('0x8')](),controller['download']);router['post']('/',auth[_0x1877('0x8')](),controller['create']);router[_0x1877('0xc')](_0x1877('0x9'),auth[_0x1877('0x8')](),controller['update']);router[_0x1877('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x1877('0xe')]);module[_0x1877('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 7ba81e6..bdb80f3 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 _0xecf0=['TEXT','STRING','BOOLEAN'];(function(_0x46085d,_0x20ee72){var _0x499629=function(_0x152721){while(--_0x152721){_0x46085d['push'](_0x46085d['shift']());}};_0x499629(++_0x20ee72);}(_0xecf0,0x96));var _0x0ecf=function(_0x1444c4,_0x1eeefd){_0x1444c4=_0x1444c4-0x0;var _0x33c549=_0xecf0[_0x1444c4];return _0x33c549;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0x0ecf('0x0')]},'alias':{'type':Sequelize[_0x0ecf('0x1')]},'function':{'type':Sequelize[_0x0ecf('0x1')]},'format':{'type':Sequelize[_0x0ecf('0x1')]},'groupBy':{'type':Sequelize[_0x0ecf('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x0ecf('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xbc83=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0xf411cd,_0x2728a5){var _0xad4726=function(_0x124024){while(--_0x124024){_0xf411cd['push'](_0xf411cd['shift']());}};_0xad4726(++_0x2728a5);}(_0xbc83,0x17a));var _0x3bc8=function(_0x1c92a3,_0x4a196a){_0x1c92a3=_0x1c92a3-0x0;var _0xf30104=_0xbc83[_0x1c92a3];return _0xf30104;};'use strict';var Sequelize=require(_0x3bc8('0x0'));module['exports']={'field':{'type':Sequelize[_0x3bc8('0x1')]},'alias':{'type':Sequelize[_0x3bc8('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x3bc8('0x2')]},'groupBy':{'type':Sequelize[_0x3bc8('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3bc8('0x2')]},'custom':{'type':Sequelize[_0x3bc8('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index ae433a3..4ad9a5c 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 _0xf8b9=['query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','options','AnalyticFieldReport','include','rows','catch','show','params','length','includeAll','find','create','body','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','bulkCreate','findAll','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','rawAttributes','type','key','model','map'];(function(_0x123fa1,_0xdc2246){var _0x3cce9c=function(_0x19da16){while(--_0x19da16){_0x123fa1['push'](_0x123fa1['shift']());}};_0x3cce9c(++_0xdc2246);}(_0xf8b9,0x11a));var _0x9f8b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf8b9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9f8b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9f8b('0x1'));var BPromise=require(_0x9f8b('0x2'));var Mustache=require(_0x9f8b('0x3'));var util=require(_0x9f8b('0x4'));var path=require(_0x9f8b('0x5'));var sox=require(_0x9f8b('0x6'));var csv=require(_0x9f8b('0x7'));var ejs=require(_0x9f8b('0x8'));var fs=require('fs');var fs_extra=require(_0x9f8b('0x9'));var _=require(_0x9f8b('0xa'));var squel=require('squel');var crypto=require(_0x9f8b('0xb'));var jsforce=require(_0x9f8b('0xc'));var deskjs=require(_0x9f8b('0xd'));var toCsv=require(_0x9f8b('0x7'));var querystring=require('querystring');var Papa=require(_0x9f8b('0xe'));var Redis=require(_0x9f8b('0xf'));var authService=require(_0x9f8b('0x10'));var qs=require(_0x9f8b('0x11'));var as=require(_0x9f8b('0x12'));var hardwareService=require(_0x9f8b('0x13'));var logger=require(_0x9f8b('0x14'))(_0x9f8b('0x15'));var utils=require(_0x9f8b('0x16'));var config=require(_0x9f8b('0x17'));var licenseUtil=require(_0x9f8b('0x18'));var db=require(_0x9f8b('0x19'))['db'];function respondWithStatusCode(_0x508e14,_0x57dd09){_0x57dd09=_0x57dd09||0xcc;return function(_0x3d978f){if(_0x3d978f){return _0x508e14[_0x9f8b('0x1a')](_0x57dd09);}return _0x508e14[_0x9f8b('0x1b')](_0x57dd09)[_0x9f8b('0x1c')]();};}function respondWithResult(_0x41e8de,_0x266ed6){_0x266ed6=_0x266ed6||0xc8;return function(_0x310aa3){if(_0x310aa3){return _0x41e8de[_0x9f8b('0x1b')](_0x266ed6)[_0x9f8b('0x1d')](_0x310aa3);}};}function respondWithFilteredResult(_0x11fec6,_0x5c6660){return function(_0x502381){if(_0x502381){var _0x135526=typeof _0x5c6660[_0x9f8b('0x1e')]===_0x9f8b('0x1f')&&typeof _0x5c6660[_0x9f8b('0x20')]==='undefined';var _0x3e3bcf=_0x502381['count'];var _0x10a7d0=_0x135526?0x0:_0x5c6660[_0x9f8b('0x1e')];var _0x2a58eb=_0x135526?_0x502381[_0x9f8b('0x21')]:_0x5c6660[_0x9f8b('0x1e')]+_0x5c6660[_0x9f8b('0x20')];var _0x591cc9;if(_0x2a58eb>=_0x3e3bcf){_0x2a58eb=_0x3e3bcf;_0x591cc9=0xc8;}else{_0x591cc9=0xce;}_0x11fec6[_0x9f8b('0x1b')](_0x591cc9);return _0x11fec6[_0x9f8b('0x22')](_0x9f8b('0x23'),_0x10a7d0+'-'+_0x2a58eb+'/'+_0x3e3bcf)['json'](_0x502381);}return null;};}function patchUpdates(_0x382950){return function(_0x217b94){try{jsonpatch[_0x9f8b('0x24')](_0x217b94,_0x382950,!![]);}catch(_0x532c13){return BPromise['reject'](_0x532c13);}return _0x217b94[_0x9f8b('0x25')]();};}function saveUpdates(_0x3ad66e,_0x433418){return function(_0x4d3110){if(_0x4d3110){return _0x4d3110[_0x9f8b('0x26')](_0x3ad66e)[_0x9f8b('0x27')](function(_0x26565f){return _0x26565f;});}return null;};}function removeEntity(_0x54ea91,_0x103396){return function(_0x27c08e){if(_0x27c08e){return _0x27c08e[_0x9f8b('0x28')]()[_0x9f8b('0x27')](function(){_0x54ea91[_0x9f8b('0x1b')](0xcc)[_0x9f8b('0x1c')]();});}};}function handleEntityNotFound(_0x269bc0,_0x503a0d){return function(_0x1cac91){if(!_0x1cac91){_0x269bc0[_0x9f8b('0x1a')](0x194);}return _0x1cac91;};}function handleError(_0x3d959f,_0x503f64){_0x503f64=_0x503f64||0x1f4;return function(_0x4f53b3){logger[_0x9f8b('0x29')](_0x4f53b3['stack']);if(_0x4f53b3[_0x9f8b('0x2a')]){delete _0x4f53b3['name'];}_0x3d959f['status'](_0x503f64)[_0x9f8b('0x2b')](_0x4f53b3);};}exports[_0x9f8b('0x2c')]=function(_0x21be23,_0x94cd8e){var _0x29a8a5={},_0xd10922={},_0x34ad2b={'count':0x0,'rows':[]};var _0xa594f5=_['map'](db['AnalyticFieldReport'][_0x9f8b('0x2d')],function(_0x4c9cad){return{'name':_0x4c9cad['fieldName'],'type':_0x4c9cad[_0x9f8b('0x2e')][_0x9f8b('0x2f')]};});_0xd10922[_0x9f8b('0x30')]=_[_0x9f8b('0x31')](_0xa594f5,_0x9f8b('0x2a'));_0xd10922[_0x9f8b('0x32')]=_[_0x9f8b('0x33')](_0x21be23[_0x9f8b('0x32')]);_0xd10922[_0x9f8b('0x34')]=_[_0x9f8b('0x35')](_0xd10922[_0x9f8b('0x30')],_0xd10922[_0x9f8b('0x32')]);_0x29a8a5['attributes']=_[_0x9f8b('0x35')](_0xd10922[_0x9f8b('0x30')],qs[_0x9f8b('0x36')](_0x21be23[_0x9f8b('0x32')]['fields']));_0x29a8a5['attributes']=_0x29a8a5[_0x9f8b('0x37')]['length']?_0x29a8a5[_0x9f8b('0x37')]:_0xd10922[_0x9f8b('0x30')];if(!_0x21be23[_0x9f8b('0x32')]['hasOwnProperty'](_0x9f8b('0x38'))){_0x29a8a5['limit']=qs['limit'](_0x21be23[_0x9f8b('0x32')][_0x9f8b('0x20')]);_0x29a8a5[_0x9f8b('0x1e')]=qs[_0x9f8b('0x1e')](_0x21be23['query'][_0x9f8b('0x1e')]);}_0x29a8a5[_0x9f8b('0x39')]=qs[_0x9f8b('0x3a')](_0x21be23[_0x9f8b('0x32')][_0x9f8b('0x3a')]);_0x29a8a5[_0x9f8b('0x3b')]=qs[_0x9f8b('0x34')](_['pick'](_0x21be23[_0x9f8b('0x32')],_0xd10922['filters']),_0xa594f5);if(_0x21be23[_0x9f8b('0x32')][_0x9f8b('0x3c')]){_0x29a8a5['where']=_[_0x9f8b('0x3d')](_0x29a8a5[_0x9f8b('0x3b')],{'$or':_[_0x9f8b('0x31')](_0xa594f5,function(_0x74be4f){if(_0x74be4f[_0x9f8b('0x2e')]!==_0x9f8b('0x3e')){var _0x56205c={};_0x56205c[_0x74be4f[_0x9f8b('0x2a')]]={'$like':'%'+_0x21be23[_0x9f8b('0x32')][_0x9f8b('0x3c')]+'%'};return _0x56205c;}})});}_0x29a8a5=_[_0x9f8b('0x3d')]({},_0x29a8a5,_0x21be23[_0x9f8b('0x3f')]);var _0x137eb9={'where':_0x29a8a5['where']};return db[_0x9f8b('0x40')]['count'](_0x137eb9)[_0x9f8b('0x27')](function(_0x2410e5){_0x34ad2b['count']=_0x2410e5;if(_0x21be23[_0x9f8b('0x32')]['includeAll']){_0x29a8a5[_0x9f8b('0x41')]=[{'all':!![]}];}return db[_0x9f8b('0x40')]['findAll'](_0x29a8a5);})[_0x9f8b('0x27')](function(_0x2fed4c){_0x34ad2b[_0x9f8b('0x42')]=_0x2fed4c;return _0x34ad2b;})[_0x9f8b('0x27')](respondWithFilteredResult(_0x94cd8e,_0x29a8a5))[_0x9f8b('0x43')](handleError(_0x94cd8e,null));};exports[_0x9f8b('0x44')]=function(_0x37e0c0,_0x1211c6){var _0x347f22={'raw':![],'where':{'id':_0x37e0c0[_0x9f8b('0x45')]['id']}},_0x430d10={};_0x430d10['model']=_[_0x9f8b('0x33')](db['AnalyticFieldReport'][_0x9f8b('0x2d')]);_0x430d10[_0x9f8b('0x32')]=_[_0x9f8b('0x33')](_0x37e0c0[_0x9f8b('0x32')]);_0x430d10[_0x9f8b('0x34')]=_[_0x9f8b('0x35')](_0x430d10[_0x9f8b('0x30')],_0x430d10[_0x9f8b('0x32')]);_0x347f22[_0x9f8b('0x37')]=_['intersection'](_0x430d10[_0x9f8b('0x30')],qs[_0x9f8b('0x36')](_0x37e0c0[_0x9f8b('0x32')][_0x9f8b('0x36')]));_0x347f22[_0x9f8b('0x37')]=_0x347f22['attributes'][_0x9f8b('0x46')]?_0x347f22[_0x9f8b('0x37')]:_0x430d10[_0x9f8b('0x30')];if(_0x37e0c0[_0x9f8b('0x32')][_0x9f8b('0x47')]){_0x347f22[_0x9f8b('0x41')]=[{'all':!![]}];}_0x347f22=_[_0x9f8b('0x3d')]({},_0x347f22,_0x37e0c0[_0x9f8b('0x3f')]);return db['AnalyticFieldReport'][_0x9f8b('0x48')](_0x347f22)[_0x9f8b('0x27')](handleEntityNotFound(_0x1211c6,null))[_0x9f8b('0x27')](respondWithResult(_0x1211c6,null))[_0x9f8b('0x43')](handleError(_0x1211c6,null));};exports[_0x9f8b('0x49')]=function(_0x3029e3,_0x20c2fd){return db[_0x9f8b('0x40')][_0x9f8b('0x49')](_0x3029e3[_0x9f8b('0x4a')],{})[_0x9f8b('0x27')](respondWithResult(_0x20c2fd,0xc9))[_0x9f8b('0x43')](handleError(_0x20c2fd,null));};exports['bulkCreate']=function(_0x114c59,_0x27b687){return db[_0x9f8b('0x40')]['bulkCreate'](_0x114c59['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x27b687,0xc9))[_0x9f8b('0x43')](handleError(_0x27b687,null));};exports[_0x9f8b('0x26')]=function(_0x2c13cb,_0x385fc2){if(_0x2c13cb[_0x9f8b('0x4a')]['id']){delete _0x2c13cb[_0x9f8b('0x4a')]['id'];}return db[_0x9f8b('0x40')][_0x9f8b('0x48')]({'where':{'id':_0x2c13cb['params']['id']}})[_0x9f8b('0x27')](handleEntityNotFound(_0x385fc2,null))[_0x9f8b('0x27')](saveUpdates(_0x2c13cb['body'],null))[_0x9f8b('0x27')](respondWithResult(_0x385fc2,null))[_0x9f8b('0x43')](handleError(_0x385fc2,null));};exports[_0x9f8b('0x28')]=function(_0x4e1e6c,_0x32072d){return db[_0x9f8b('0x40')]['find']({'where':{'id':_0x4e1e6c[_0x9f8b('0x45')]['id']}})[_0x9f8b('0x27')](handleEntityNotFound(_0x32072d,null))[_0x9f8b('0x27')](removeEntity(_0x32072d,null))['catch'](handleError(_0x32072d,null));};exports[_0x9f8b('0x4b')]=function(_0x1e6603,_0x2d313b){return db[_0x9f8b('0x40')]['destroy']({'where':{'id':_0x1e6603['query'][_0x9f8b('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x9f8b('0x27')](respondWithResult(_0x2d313b,0xcc))[_0x9f8b('0x43')](handleError(_0x2d313b,null));};exports[_0x9f8b('0x4d')]=function(_0x3dea1d,_0x1cbb59,_0x4587b9){return db[_0x9f8b('0x4e')]['findOne']({'where':{'id':_0x3dea1d[_0x9f8b('0x45')]['id']}})[_0x9f8b('0x27')](handleEntityNotFound(_0x1cbb59,null))[_0x9f8b('0x27')](function(_0x482cea){if(_0x482cea){return db[_0x9f8b('0x4f')][_0x9f8b('0x50')](function(_0x17f94e){return db[_0x9f8b('0x40')]['destroy']({'where':{'CustomReportId':_0x3dea1d[_0x9f8b('0x45')]['id']},'transaction':_0x17f94e})['then'](function(_0x325d1b){var _0x299c87=_[_0x9f8b('0x31')](_0x3dea1d[_0x9f8b('0x4a')],function(_0x153261){delete _0x153261['id'];_0x153261['CustomReportId']=_0x3dea1d['params']['id'];return _0x153261;});return db[_0x9f8b('0x40')][_0x9f8b('0x51')](_0x299c87,{'transaction':_0x17f94e});});})[_0x9f8b('0x27')](function(){return db[_0x9f8b('0x40')][_0x9f8b('0x52')]({'where':{'CustomReportId':_0x3dea1d['params']['id']}});});}})[_0x9f8b('0x27')](respondWithResult(_0x1cbb59,null))[_0x9f8b('0x43')](handleError(_0x1cbb59,null));};
\ No newline at end of file
+var _0x8540=['squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','save','update','then','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','length','nolimit','limit','order','filters','pick','where','merge','map','VIRTUAL','filter','includeAll','include','findAll','rows','params','options','catch','create','body','bulkCreate','find','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x29bcab,_0x53a015){var _0x2cb492=function(_0x24ee16){while(--_0x24ee16){_0x29bcab['push'](_0x29bcab['shift']());}};_0x2cb492(++_0x53a015);}(_0x8540,0x148));var _0x0854=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0x8540[_0x221ba2];return _0x47d08e;};'use strict';var emlformat=require(_0x0854('0x0'));var rimraf=require(_0x0854('0x1'));var zipdir=require(_0x0854('0x2'));var jsonpatch=require(_0x0854('0x3'));var rp=require(_0x0854('0x4'));var moment=require('moment');var BPromise=require(_0x0854('0x5'));var Mustache=require(_0x0854('0x6'));var util=require(_0x0854('0x7'));var path=require(_0x0854('0x8'));var sox=require(_0x0854('0x9'));var csv=require('to-csv');var ejs=require(_0x0854('0xa'));var fs=require('fs');var fs_extra=require(_0x0854('0xb'));var _=require('lodash');var squel=require(_0x0854('0xc'));var crypto=require('crypto');var jsforce=require(_0x0854('0xd'));var deskjs=require(_0x0854('0xe'));var toCsv=require(_0x0854('0xf'));var querystring=require(_0x0854('0x10'));var Papa=require(_0x0854('0x11'));var Redis=require('ioredis');var authService=require(_0x0854('0x12'));var qs=require(_0x0854('0x13'));var as=require(_0x0854('0x14'));var hardwareService=require(_0x0854('0x15'));var logger=require(_0x0854('0x16'))(_0x0854('0x17'));var utils=require(_0x0854('0x18'));var config=require(_0x0854('0x19'));var licenseUtil=require(_0x0854('0x1a'));var db=require(_0x0854('0x1b'))['db'];function respondWithStatusCode(_0x3a08ce,_0xca0485){_0xca0485=_0xca0485||0xcc;return function(_0x4e05d4){if(_0x4e05d4){return _0x3a08ce[_0x0854('0x1c')](_0xca0485);}return _0x3a08ce[_0x0854('0x1d')](_0xca0485)[_0x0854('0x1e')]();};}function respondWithResult(_0x3f4caf,_0xddea3f){_0xddea3f=_0xddea3f||0xc8;return function(_0x45fc41){if(_0x45fc41){return _0x3f4caf[_0x0854('0x1d')](_0xddea3f)[_0x0854('0x1f')](_0x45fc41);}};}function respondWithFilteredResult(_0x4d9fe6,_0x5d99ea){return function(_0x634fb3){if(_0x634fb3){var _0x24bd93=typeof _0x5d99ea[_0x0854('0x20')]===_0x0854('0x21')&&typeof _0x5d99ea['limit']===_0x0854('0x21');var _0x5d85cb=_0x634fb3['count'];var _0x3c1bd5=_0x24bd93?0x0:_0x5d99ea[_0x0854('0x20')];var _0x16354c=_0x24bd93?_0x634fb3[_0x0854('0x22')]:_0x5d99ea[_0x0854('0x20')]+_0x5d99ea['limit'];var _0x2dde3e;if(_0x16354c>=_0x5d85cb){_0x16354c=_0x5d85cb;_0x2dde3e=0xc8;}else{_0x2dde3e=0xce;}_0x4d9fe6['status'](_0x2dde3e);return _0x4d9fe6['set'](_0x0854('0x23'),_0x3c1bd5+'-'+_0x16354c+'/'+_0x5d85cb)[_0x0854('0x1f')](_0x634fb3);}return null;};}function patchUpdates(_0x4e3c96){return function(_0x26cb1e){try{jsonpatch['apply'](_0x26cb1e,_0x4e3c96,!![]);}catch(_0x3f2965){return BPromise['reject'](_0x3f2965);}return _0x26cb1e[_0x0854('0x24')]();};}function saveUpdates(_0x10d4ae,_0x4d65c9){return function(_0x4e1929){if(_0x4e1929){return _0x4e1929[_0x0854('0x25')](_0x10d4ae)[_0x0854('0x26')](function(_0x580d33){return _0x580d33;});}return null;};}function removeEntity(_0x46c267,_0x43d08c){return function(_0xf5fb95){if(_0xf5fb95){return _0xf5fb95['destroy']()[_0x0854('0x26')](function(){_0x46c267[_0x0854('0x1d')](0xcc)[_0x0854('0x1e')]();});}};}function handleEntityNotFound(_0x1c290e,_0x3b47c1){return function(_0x3f8fce){if(!_0x3f8fce){_0x1c290e['sendStatus'](0x194);}return _0x3f8fce;};}function handleError(_0x57878f,_0x216b90){_0x216b90=_0x216b90||0x1f4;return function(_0x16a363){logger[_0x0854('0x27')](_0x16a363[_0x0854('0x28')]);if(_0x16a363[_0x0854('0x29')]){delete _0x16a363[_0x0854('0x29')];}_0x57878f[_0x0854('0x1d')](_0x216b90)[_0x0854('0x2a')](_0x16a363);};}exports[_0x0854('0x2b')]=function(_0x456acd,_0x4a2798){var _0x3349c1={},_0x4c5629={},_0x28b399={'count':0x0,'rows':[]};var _0x157cee=_['map'](db[_0x0854('0x2c')][_0x0854('0x2d')],function(_0x540500){return{'name':_0x540500['fieldName'],'type':_0x540500[_0x0854('0x2e')][_0x0854('0x2f')]};});_0x4c5629['model']=_['map'](_0x157cee,_0x0854('0x29'));_0x4c5629['query']=_[_0x0854('0x30')](_0x456acd[_0x0854('0x31')]);_0x4c5629['filters']=_[_0x0854('0x32')](_0x4c5629[_0x0854('0x33')],_0x4c5629[_0x0854('0x31')]);_0x3349c1[_0x0854('0x34')]=_[_0x0854('0x32')](_0x4c5629[_0x0854('0x33')],qs[_0x0854('0x35')](_0x456acd[_0x0854('0x31')]['fields']));_0x3349c1['attributes']=_0x3349c1[_0x0854('0x34')][_0x0854('0x36')]?_0x3349c1[_0x0854('0x34')]:_0x4c5629['model'];if(!_0x456acd['query']['hasOwnProperty'](_0x0854('0x37'))){_0x3349c1[_0x0854('0x38')]=qs[_0x0854('0x38')](_0x456acd[_0x0854('0x31')][_0x0854('0x38')]);_0x3349c1[_0x0854('0x20')]=qs[_0x0854('0x20')](_0x456acd[_0x0854('0x31')][_0x0854('0x20')]);}_0x3349c1[_0x0854('0x39')]=qs['sort'](_0x456acd[_0x0854('0x31')]['sort']);_0x3349c1['where']=qs[_0x0854('0x3a')](_[_0x0854('0x3b')](_0x456acd[_0x0854('0x31')],_0x4c5629[_0x0854('0x3a')]),_0x157cee);if(_0x456acd['query']['filter']){_0x3349c1[_0x0854('0x3c')]=_[_0x0854('0x3d')](_0x3349c1[_0x0854('0x3c')],{'$or':_[_0x0854('0x3e')](_0x157cee,function(_0x47c662){if(_0x47c662[_0x0854('0x2e')]!==_0x0854('0x3f')){var _0x33668f={};_0x33668f[_0x47c662[_0x0854('0x29')]]={'$like':'%'+_0x456acd[_0x0854('0x31')][_0x0854('0x40')]+'%'};return _0x33668f;}})});}_0x3349c1=_['merge']({},_0x3349c1,_0x456acd['options']);var _0x2fb73b={'where':_0x3349c1[_0x0854('0x3c')]};return db[_0x0854('0x2c')]['count'](_0x2fb73b)[_0x0854('0x26')](function(_0x3751e0){_0x28b399[_0x0854('0x22')]=_0x3751e0;if(_0x456acd[_0x0854('0x31')][_0x0854('0x41')]){_0x3349c1[_0x0854('0x42')]=[{'all':!![]}];}return db[_0x0854('0x2c')][_0x0854('0x43')](_0x3349c1);})[_0x0854('0x26')](function(_0x1955ba){_0x28b399[_0x0854('0x44')]=_0x1955ba;return _0x28b399;})[_0x0854('0x26')](respondWithFilteredResult(_0x4a2798,_0x3349c1))['catch'](handleError(_0x4a2798,null));};exports['show']=function(_0x22e486,_0x1214a0){var _0x1f2824={'raw':![],'where':{'id':_0x22e486[_0x0854('0x45')]['id']}},_0x7163f={};_0x7163f[_0x0854('0x33')]=_[_0x0854('0x30')](db[_0x0854('0x2c')][_0x0854('0x2d')]);_0x7163f[_0x0854('0x31')]=_[_0x0854('0x30')](_0x22e486[_0x0854('0x31')]);_0x7163f['filters']=_[_0x0854('0x32')](_0x7163f[_0x0854('0x33')],_0x7163f['query']);_0x1f2824[_0x0854('0x34')]=_[_0x0854('0x32')](_0x7163f[_0x0854('0x33')],qs[_0x0854('0x35')](_0x22e486[_0x0854('0x31')][_0x0854('0x35')]));_0x1f2824[_0x0854('0x34')]=_0x1f2824[_0x0854('0x34')]['length']?_0x1f2824['attributes']:_0x7163f[_0x0854('0x33')];if(_0x22e486['query']['includeAll']){_0x1f2824[_0x0854('0x42')]=[{'all':!![]}];}_0x1f2824=_[_0x0854('0x3d')]({},_0x1f2824,_0x22e486[_0x0854('0x46')]);return db['AnalyticFieldReport']['find'](_0x1f2824)['then'](handleEntityNotFound(_0x1214a0,null))[_0x0854('0x26')](respondWithResult(_0x1214a0,null))[_0x0854('0x47')](handleError(_0x1214a0,null));};exports['create']=function(_0x513131,_0x21accf){return db[_0x0854('0x2c')][_0x0854('0x48')](_0x513131[_0x0854('0x49')],{})['then'](respondWithResult(_0x21accf,0xc9))[_0x0854('0x47')](handleError(_0x21accf,null));};exports['bulkCreate']=function(_0x18d65c,_0x53c150){return db[_0x0854('0x2c')][_0x0854('0x4a')](_0x18d65c[_0x0854('0x49')],{'raw':![],'individualHooks':!![]})[_0x0854('0x26')](respondWithResult(_0x53c150,0xc9))[_0x0854('0x47')](handleError(_0x53c150,null));};exports[_0x0854('0x25')]=function(_0x10d2ff,_0x3de010){if(_0x10d2ff[_0x0854('0x49')]['id']){delete _0x10d2ff[_0x0854('0x49')]['id'];}return db[_0x0854('0x2c')][_0x0854('0x4b')]({'where':{'id':_0x10d2ff[_0x0854('0x45')]['id']}})[_0x0854('0x26')](handleEntityNotFound(_0x3de010,null))[_0x0854('0x26')](saveUpdates(_0x10d2ff['body'],null))['then'](respondWithResult(_0x3de010,null))[_0x0854('0x47')](handleError(_0x3de010,null));};exports['destroy']=function(_0x169907,_0x3d193c){return db[_0x0854('0x2c')][_0x0854('0x4b')]({'where':{'id':_0x169907[_0x0854('0x45')]['id']}})['then'](handleEntityNotFound(_0x3d193c,null))[_0x0854('0x26')](removeEntity(_0x3d193c,null))[_0x0854('0x47')](handleError(_0x3d193c,null));};exports[_0x0854('0x4c')]=function(_0x32b0ed,_0x23091e){return db['AnalyticFieldReport'][_0x0854('0x4d')]({'where':{'id':_0x32b0ed['query'][_0x0854('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x0854('0x26')](respondWithResult(_0x23091e,0xcc))['catch'](handleError(_0x23091e,null));};exports[_0x0854('0x4f')]=function(_0x2944dd,_0x4347f7,_0x194919){return db[_0x0854('0x50')][_0x0854('0x51')]({'where':{'id':_0x2944dd[_0x0854('0x45')]['id']}})[_0x0854('0x26')](handleEntityNotFound(_0x4347f7,null))['then'](function(_0x56a843){if(_0x56a843){return db[_0x0854('0x52')][_0x0854('0x53')](function(_0x266cb6){return db[_0x0854('0x2c')]['destroy']({'where':{'CustomReportId':_0x2944dd[_0x0854('0x45')]['id']},'transaction':_0x266cb6})[_0x0854('0x26')](function(_0x52ffb3){var _0x1e11f0=_[_0x0854('0x3e')](_0x2944dd[_0x0854('0x49')],function(_0x19977e){delete _0x19977e['id'];_0x19977e[_0x0854('0x54')]=_0x2944dd[_0x0854('0x45')]['id'];return _0x19977e;});return db[_0x0854('0x2c')][_0x0854('0x4a')](_0x1e11f0,{'transaction':_0x266cb6});});})[_0x0854('0x26')](function(){return db[_0x0854('0x2c')][_0x0854('0x43')]({'where':{'CustomReportId':_0x2944dd[_0x0854('0x45')]['id']}});});}})['then'](respondWithResult(_0x4347f7,null))[_0x0854('0x47')](handleError(_0x4347f7,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index da2a664..7f73850 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 _0xe800=['../../config/logger','moment','bluebird','rimraf','../../config/environment','exports','analytics_report_fields','lodash','util'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xe800,0x193));var _0x0e80=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xe800[_0xa8883];return _0x479426;};'use strict';var _=require(_0x0e80('0x0'));var util=require(_0x0e80('0x1'));var logger=require(_0x0e80('0x2'))('api');var moment=require(_0x0e80('0x3'));var BPromise=require(_0x0e80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0e80('0x5'));var config=require(_0x0e80('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x0e80('0x7')]=function(_0x1a77b4,_0xb89f6f){return _0x1a77b4['define']('AnalyticFieldReport',attributes,{'tableName':_0x0e80('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeb36=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','moment'];(function(_0x16b32f,_0x758d48){var _0xc94c5b=function(_0x21858e){while(--_0x21858e){_0x16b32f['push'](_0x16b32f['shift']());}};_0xc94c5b(++_0x758d48);}(_0xeb36,0x188));var _0x6eb3=function(_0x22fded,_0x52eb9b){_0x22fded=_0x22fded-0x0;var _0x41fa12=_0xeb36[_0x22fded];return _0x41fa12;};'use strict';var _=require(_0x6eb3('0x0'));var util=require(_0x6eb3('0x1'));var logger=require(_0x6eb3('0x2'))('api');var moment=require(_0x6eb3('0x3'));var BPromise=require(_0x6eb3('0x4'));var rp=require(_0x6eb3('0x5'));var fs=require('fs');var path=require(_0x6eb3('0x6'));var rimraf=require(_0x6eb3('0x7'));var config=require(_0x6eb3('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0x6eb3('0x9')]=function(_0x56fcf4,_0x51f707){return _0x56fcf4[_0x6eb3('0xa')](_0x6eb3('0xb'),attributes,{'tableName':'analytics_report_fields','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 961a7cd..70162d8 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 _0x30eb=['request\x20sent','debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x7334fc,_0x56beef){var _0x4c096c=function(_0x4940d1){while(--_0x4940d1){_0x7334fc['push'](_0x7334fc['shift']());}};_0x4c096c(++_0x56beef);}(_0x30eb,0xce));var _0xb30e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x30eb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb30e('0x0'));var util=require(_0xb30e('0x1'));var moment=require(_0xb30e('0x2'));var BPromise=require(_0xb30e('0x3'));var rs=require(_0xb30e('0x4'));var fs=require('fs');var Redis=require(_0xb30e('0x5'));var db=require(_0xb30e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb30e('0x7'))(_0xb30e('0x8'));var config=require(_0xb30e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb30e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x342910,_0x158fa0,_0x49802f){return new BPromise(function(_0x1b769e,_0x1c6bba){return client[_0xb30e('0xb')](_0x342910,_0x49802f)[_0xb30e('0xc')](function(_0xf80c00){logger['info'](_0xb30e('0xd'),_0x158fa0,_0xb30e('0xe'));logger[_0xb30e('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x158fa0,_0xb30e('0xe'),JSON[_0xb30e('0x10')](_0xf80c00));if(_0xf80c00[_0xb30e('0x11')]){if(_0xf80c00[_0xb30e('0x11')][_0xb30e('0x12')]===0x1f4){logger[_0xb30e('0x11')](_0xb30e('0xd'),_0x158fa0,_0xf80c00['error'][_0xb30e('0x13')]);return _0x1c6bba(_0xf80c00[_0xb30e('0x11')][_0xb30e('0x13')]);}logger[_0xb30e('0x11')](_0xb30e('0xd'),_0x158fa0,_0xf80c00[_0xb30e('0x11')][_0xb30e('0x13')]);return _0x1b769e(_0xf80c00[_0xb30e('0x11')]['message']);}else{logger[_0xb30e('0x14')](_0xb30e('0xd'),_0x158fa0,_0xb30e('0xe'));_0x1b769e(_0xf80c00[_0xb30e('0x15')][_0xb30e('0x13')]);}})['catch'](function(_0xc5afe7){logger[_0xb30e('0x11')](_0xb30e('0xd'),_0x158fa0,_0xc5afe7);_0x1c6bba(_0xc5afe7);});});}
\ No newline at end of file
+var _0xb187=['debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x9978d7,_0x118396){var _0x325558=function(_0x1007af){while(--_0x1007af){_0x9978d7['push'](_0x9978d7['shift']());}};_0x325558(++_0x118396);}(_0xb187,0x161));var _0x7b18=function(_0x4b775b,_0x2aadc6){_0x4b775b=_0x4b775b-0x0;var _0xf84d39=_0xb187[_0x4b775b];return _0xf84d39;};'use strict';var _=require(_0x7b18('0x0'));var util=require(_0x7b18('0x1'));var moment=require(_0x7b18('0x2'));var BPromise=require('bluebird');var rs=require(_0x7b18('0x3'));var fs=require('fs');var Redis=require(_0x7b18('0x4'));var db=require(_0x7b18('0x5'))['db'];var utils=require(_0x7b18('0x6'));var logger=require(_0x7b18('0x7'))(_0x7b18('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7b18('0x9')][_0x7b18('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4017a6,_0x28f986,_0x3a11b4){return new BPromise(function(_0x49fce9,_0x2a5ecb){return client[_0x7b18('0xb')](_0x4017a6,_0x3a11b4)[_0x7b18('0xc')](function(_0x2e73c7){logger[_0x7b18('0xd')](_0x7b18('0xe'),_0x28f986,'request\x20sent');logger[_0x7b18('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x28f986,'request\x20sent',JSON[_0x7b18('0x10')](_0x2e73c7));if(_0x2e73c7[_0x7b18('0x11')]){if(_0x2e73c7[_0x7b18('0x11')][_0x7b18('0x12')]===0x1f4){logger['error'](_0x7b18('0xe'),_0x28f986,_0x2e73c7[_0x7b18('0x11')][_0x7b18('0x13')]);return _0x2a5ecb(_0x2e73c7['error'][_0x7b18('0x13')]);}logger['error'](_0x7b18('0xe'),_0x28f986,_0x2e73c7['error'][_0x7b18('0x13')]);return _0x49fce9(_0x2e73c7[_0x7b18('0x11')][_0x7b18('0x13')]);}else{logger[_0x7b18('0xd')](_0x7b18('0xe'),_0x28f986,_0x7b18('0x14'));_0x49fce9(_0x2e73c7[_0x7b18('0x15')][_0x7b18('0x13')]);}})[_0x7b18('0x16')](function(_0x20148e){logger['error'](_0x7b18('0xe'),_0x28f986,_0x20148e);_0x2a5ecb(_0x20148e);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index f7f494a..2d86350 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(_0x2e6840,_0x450b55){var _0x232853=function(_0x75383f){while(--_0x75383f){_0x2e6840['push'](_0x2e6840['shift']());}};_0x232853(++_0x450b55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x51303b,_0x4f7b7e){var _0x5b255f=function(_0x37d89d){while(--_0x37d89d){_0x51303b['push'](_0x51303b['shift']());}};_0x5b255f(++_0x4f7b7e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 303a5e9..5461101 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 _0xc3b7=['exports','STRING','name','TEXT'];(function(_0x2a5f59,_0x5172d1){var _0x31ffb2=function(_0x1a5d81){while(--_0x1a5d81){_0x2a5f59['push'](_0x2a5f59['shift']());}};_0x31ffb2(++_0x5172d1);}(_0xc3b7,0xb4));var _0x7c3b=function(_0x1d21a3,_0x419f71){_0x1d21a3=_0x1d21a3-0x0;var _0x2b6136=_0xc3b7[_0x1d21a3];return _0x2b6136;};'use strict';var Sequelize=require('sequelize');module[_0x7c3b('0x0')]={'name':{'type':Sequelize[_0x7c3b('0x1')],'allowNull':![],'unique':_0x7c3b('0x2')},'table':{'type':Sequelize[_0x7c3b('0x1')]},'metric':{'type':Sequelize[_0x7c3b('0x3')]},'description':{'type':Sequelize[_0x7c3b('0x1')]}};
\ No newline at end of file
+var _0xc5c0=['sequelize','exports','STRING','TEXT'];(function(_0x4533a6,_0x4794c9){var _0x25bffa=function(_0x2cd4f3){while(--_0x2cd4f3){_0x4533a6['push'](_0x4533a6['shift']());}};_0x25bffa(++_0x4794c9);}(_0xc5c0,0x6c));var _0x0c5c=function(_0x4d0bd1,_0x2f6c78){_0x4d0bd1=_0x4d0bd1-0x0;var _0x45abb0=_0xc5c0[_0x4d0bd1];return _0x45abb0;};'use strict';var Sequelize=require(_0x0c5c('0x0'));module[_0x0c5c('0x1')]={'name':{'type':Sequelize[_0x0c5c('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x0c5c('0x3')]},'description':{'type':Sequelize[_0x0c5c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 836b727..2b43bd9 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 _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','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','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x49f56f,_0x2bf8ec){_0x49f56f=_0x49f56f-0x0;var _0x155a01=_0x1cb9[_0x49f56f];return _0x155a01;};'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'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));};
\ No newline at end of file
+var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2e6b16,_0x31c2fb){var _0x185c18=function(_0x52fd7d){while(--_0x52fd7d){_0x2e6b16['push'](_0x2e6b16['shift']());}};_0x185c18(++_0x31c2fb);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x369829,_0x5149ad){_0x369829=_0x369829-0x0;var _0xb9c603=_0x7fbe[_0x369829];return _0xb9c603;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 2237544..6d794ff 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 _0x0272=['request-promise','path','rimraf','exports','lodash','util','api','moment','bluebird'];(function(_0x1ac77b,_0x10ee7a){var _0x161584=function(_0x5a810d){while(--_0x5a810d){_0x1ac77b['push'](_0x1ac77b['shift']());}};_0x161584(++_0x10ee7a);}(_0x0272,0x15a));var _0x2027=function(_0x1b6ae2,_0x4f2f15){_0x1b6ae2=_0x1b6ae2-0x0;var _0xccb53f=_0x0272[_0x1b6ae2];return _0xccb53f;};'use strict';var _=require(_0x2027('0x0'));var util=require(_0x2027('0x1'));var logger=require('../../config/logger')(_0x2027('0x2'));var moment=require(_0x2027('0x3'));var BPromise=require(_0x2027('0x4'));var rp=require(_0x2027('0x5'));var fs=require('fs');var path=require(_0x2027('0x6'));var rimraf=require(_0x2027('0x7'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x2027('0x8')]=function(_0x1ea303,_0x2deefc){return _0x1ea303['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9206=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','AnalyticMetric','analytics_metrics'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9206,0x176));var _0x6920=function(_0x55efaf,_0x17d618){_0x55efaf=_0x55efaf-0x0;var _0x207bd2=_0x9206[_0x55efaf];return _0x207bd2;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var logger=require(_0x6920('0x2'))(_0x6920('0x3'));var moment=require(_0x6920('0x4'));var BPromise=require(_0x6920('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x41c8c4,_0x4d67d7){return _0x41c8c4[_0x6920('0x8')](_0x6920('0x9'),attributes,{'tableName':_0x6920('0xa'),'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 df33abc..046d429 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 _0xce84=['randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3dc1d8,_0x47221a){var _0x33f5fb=function(_0x356b98){while(--_0x356b98){_0x3dc1d8['push'](_0x3dc1d8['shift']());}};_0x33f5fb(++_0x47221a);}(_0xce84,0x1e0));var _0x4ce8=function(_0x895a8,_0x543b1a){_0x895a8=_0x895a8-0x0;var _0x3e6c30=_0xce84[_0x895a8];return _0x3e6c30;};'use strict';var _=require(_0x4ce8('0x0'));var util=require(_0x4ce8('0x1'));var moment=require(_0x4ce8('0x2'));var BPromise=require(_0x4ce8('0x3'));var rs=require(_0x4ce8('0x4'));var fs=require('fs');var Redis=require(_0x4ce8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4ce8('0x6'));var jayson=require(_0x4ce8('0x7'));var client=jayson[_0x4ce8('0x8')][_0x4ce8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ed3d9,_0x586a71,_0x4ff769){return new BPromise(function(_0x1491a1,_0x8c9d28){return client[_0x4ce8('0xa')](_0x3ed3d9,_0x4ff769)[_0x4ce8('0xb')](function(_0x1c7ec5){logger[_0x4ce8('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x586a71,_0x4ce8('0xd'));logger[_0x4ce8('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x586a71,_0x4ce8('0xd'),JSON[_0x4ce8('0xf')](_0x1c7ec5));if(_0x1c7ec5[_0x4ce8('0x10')]){if(_0x1c7ec5[_0x4ce8('0x10')][_0x4ce8('0x11')]===0x1f4){logger['error'](_0x4ce8('0x12'),_0x586a71,_0x1c7ec5[_0x4ce8('0x10')][_0x4ce8('0x13')]);return _0x8c9d28(_0x1c7ec5['error']['message']);}logger[_0x4ce8('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x586a71,_0x1c7ec5[_0x4ce8('0x10')][_0x4ce8('0x13')]);return _0x1491a1(_0x1c7ec5[_0x4ce8('0x10')][_0x4ce8('0x13')]);}else{logger[_0x4ce8('0xc')](_0x4ce8('0x12'),_0x586a71,_0x4ce8('0xd'));_0x1491a1(_0x1c7ec5[_0x4ce8('0x14')][_0x4ce8('0x13')]);}})[_0x4ce8('0x15')](function(_0x12aa0a){logger['error'](_0x4ce8('0x12'),_0x586a71,_0x12aa0a);_0x8c9d28(_0x12aa0a);});});}
\ No newline at end of file
+var _0x05a7=['../../config/logger','rpc','../../config/environment','http','request','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','AnalyticMetric,\x20%s,\x20%s','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x3a723e,_0x59d99a){var _0x3e9c03=function(_0x4a6947){while(--_0x4a6947){_0x3a723e['push'](_0x3a723e['shift']());}};_0x3e9c03(++_0x59d99a);}(_0x05a7,0x113));var _0x705a=function(_0x5cfb92,_0x5797e6){_0x5cfb92=_0x5cfb92-0x0;var _0x1cd7c2=_0x05a7[_0x5cfb92];return _0x1cd7c2;};'use strict';var _=require(_0x705a('0x0'));var util=require('util');var moment=require(_0x705a('0x1'));var BPromise=require(_0x705a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x705a('0x3'))['db'];var utils=require(_0x705a('0x4'));var logger=require(_0x705a('0x5'))(_0x705a('0x6'));var config=require(_0x705a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x705a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x398f75,_0x4a953e,_0x27eb98){return new BPromise(function(_0x5a9bd0,_0x57f622){return client[_0x705a('0x9')](_0x398f75,_0x27eb98)['then'](function(_0x101799){logger[_0x705a('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x4a953e,'request\x20sent');logger[_0x705a('0xb')](_0x705a('0xc'),_0x4a953e,_0x705a('0xd'),JSON[_0x705a('0xe')](_0x101799));if(_0x101799['error']){if(_0x101799['error'][_0x705a('0xf')]===0x1f4){logger[_0x705a('0x10')](_0x705a('0x11'),_0x4a953e,_0x101799[_0x705a('0x10')][_0x705a('0x12')]);return _0x57f622(_0x101799[_0x705a('0x10')][_0x705a('0x12')]);}logger[_0x705a('0x10')](_0x705a('0x11'),_0x4a953e,_0x101799['error'][_0x705a('0x12')]);return _0x5a9bd0(_0x101799[_0x705a('0x10')][_0x705a('0x12')]);}else{logger[_0x705a('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x4a953e,_0x705a('0xd'));_0x5a9bd0(_0x101799[_0x705a('0x13')][_0x705a('0x12')]);}})['catch'](function(_0xa3ec0b){logger[_0x705a('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x4a953e,_0xa3ec0b);_0x57f622(_0xa3ec0b);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index a6d3614..e403636 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 _0xea44=['put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x37c9e,_0x5bb916){var _0x124e0b=function(_0x473869){while(--_0x473869){_0x37c9e['push'](_0x37c9e['shift']());}};_0x124e0b(++_0x5bb916);}(_0xea44,0x1a5));var _0x4ea4=function(_0x3c7b6c,_0x49ff86){_0x3c7b6c=_0x3c7b6c-0x0;var _0x128fe2=_0xea44[_0x3c7b6c];return _0x128fe2;};'use strict';var multer=require(_0x4ea4('0x0'));var util=require(_0x4ea4('0x1'));var path=require(_0x4ea4('0x2'));var timeout=require(_0x4ea4('0x3'));var express=require('express');var router=express[_0x4ea4('0x4')]();var fs_extra=require(_0x4ea4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4ea4('0x6'));var config=require(_0x4ea4('0x7'));var controller=require(_0x4ea4('0x8'));router[_0x4ea4('0x9')]('/',auth['isAuthenticated'](),controller[_0x4ea4('0xa')]);router[_0x4ea4('0x9')](_0x4ea4('0xb'),auth[_0x4ea4('0xc')](),controller[_0x4ea4('0xd')]);router[_0x4ea4('0xe')]('/',auth[_0x4ea4('0xc')](),controller[_0x4ea4('0xf')]);router[_0x4ea4('0x10')]('/:id',auth[_0x4ea4('0xc')](),controller['update']);router['delete'](_0x4ea4('0xb'),auth['isAuthenticated'](),controller[_0x4ea4('0x11')]);module[_0x4ea4('0x12')]=router;
\ No newline at end of file
+var _0x535d=['get','isAuthenticated','/:id','post','create','put','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x1c1815,_0x84870e){var _0x547581=function(_0x16acd9){while(--_0x16acd9){_0x1c1815['push'](_0x1c1815['shift']());}};_0x547581(++_0x84870e);}(_0x535d,0xe8));var _0xd535=function(_0x5da05a,_0x27fe46){_0x5da05a=_0x5da05a-0x0;var _0x1888ab=_0x535d[_0x5da05a];return _0x1888ab;};'use strict';var multer=require(_0xd535('0x0'));var util=require(_0xd535('0x1'));var path=require('path');var timeout=require(_0xd535('0x2'));var express=require(_0xd535('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd535('0x4'));var interaction=require(_0xd535('0x5'));var config=require(_0xd535('0x6'));var controller=require(_0xd535('0x7'));router[_0xd535('0x8')]('/',auth[_0xd535('0x9')](),controller['index']);router['get'](_0xd535('0xa'),auth[_0xd535('0x9')](),controller['show']);router[_0xd535('0xb')]('/',auth['isAuthenticated'](),controller[_0xd535('0xc')]);router[_0xd535('0xd')](_0xd535('0xa'),auth[_0xd535('0x9')](),controller['update']);router[_0xd535('0xe')](_0xd535('0xa'),auth[_0xd535('0x9')](),controller[_0xd535('0xf')]);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 842f1df..3c9b304 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 _0x0e6b=['sequelize','TEXT'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x0e6b,0xf0));var _0xb0e6=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x0e6b[_0x1e2080];return _0x260111;};'use strict';var Sequelize=require(_0xb0e6('0x0'));module['exports']={'tree':{'type':Sequelize[_0xb0e6('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x79d5=['sequelize','TEXT'];(function(_0x2641b0,_0x36b5d0){var _0x54731f=function(_0x55e555){while(--_0x55e555){_0x2641b0['push'](_0x2641b0['shift']());}};_0x54731f(++_0x36b5d0);}(_0x79d5,0xa0));var _0x579d=function(_0x409fb8,_0x5ab3d3){_0x409fb8=_0x409fb8-0x0;var _0x278270=_0x79d5[_0x409fb8];return _0x278270;};'use strict';var Sequelize=require(_0x579d('0x0'));module['exports']={'tree':{'type':Sequelize[_0x579d('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 048449b..5aff35e 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 _0xf9cf=['params','keys','rawAttributes','length','options','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','offset','limit','count','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','map','AnalyticTreeReport','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch'];(function(_0x3afb5c,_0x54e263){var _0x5c4e71=function(_0x40b6e5){while(--_0x40b6e5){_0x3afb5c['push'](_0x3afb5c['shift']());}};_0x5c4e71(++_0x54e263);}(_0xf9cf,0x97));var _0xff9c=function(_0x192877,_0x24e072){_0x192877=_0x192877-0x0;var _0x372899=_0xf9cf[_0x192877];return _0x372899;};'use strict';var emlformat=require(_0xff9c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff9c('0x1'));var jsonpatch=require(_0xff9c('0x2'));var rp=require(_0xff9c('0x3'));var moment=require(_0xff9c('0x4'));var BPromise=require(_0xff9c('0x5'));var Mustache=require(_0xff9c('0x6'));var util=require('util');var path=require(_0xff9c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff9c('0x8'));var _=require(_0xff9c('0x9'));var squel=require(_0xff9c('0xa'));var crypto=require(_0xff9c('0xb'));var jsforce=require(_0xff9c('0xc'));var deskjs=require(_0xff9c('0xd'));var toCsv=require(_0xff9c('0xe'));var querystring=require(_0xff9c('0xf'));var Papa=require('papaparse');var Redis=require(_0xff9c('0x10'));var authService=require(_0xff9c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff9c('0x12'));var logger=require(_0xff9c('0x13'))('api');var utils=require(_0xff9c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xff9c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x571096,_0x3ae66f){_0x3ae66f=_0x3ae66f||0xcc;return function(_0x42bddb){if(_0x42bddb){return _0x571096['sendStatus'](_0x3ae66f);}return _0x571096[_0xff9c('0x16')](_0x3ae66f)[_0xff9c('0x17')]();};}function respondWithResult(_0x58a1f9,_0x4663c8){_0x4663c8=_0x4663c8||0xc8;return function(_0x579145){if(_0x579145){return _0x58a1f9[_0xff9c('0x16')](_0x4663c8)['json'](_0x579145);}};}function respondWithFilteredResult(_0x4ecd40,_0x5e5c6d){return function(_0x3b6337){if(_0x3b6337){var _0x259f48=typeof _0x5e5c6d[_0xff9c('0x18')]==='undefined'&&typeof _0x5e5c6d[_0xff9c('0x19')]==='undefined';var _0x4b5e36=_0x3b6337['count'];var _0x22b6cf=_0x259f48?0x0:_0x5e5c6d[_0xff9c('0x18')];var _0x563a74=_0x259f48?_0x3b6337[_0xff9c('0x1a')]:_0x5e5c6d[_0xff9c('0x18')]+_0x5e5c6d[_0xff9c('0x19')];var _0x374b6c;if(_0x563a74>=_0x4b5e36){_0x563a74=_0x4b5e36;_0x374b6c=0xc8;}else{_0x374b6c=0xce;}_0x4ecd40['status'](_0x374b6c);return _0x4ecd40['set'](_0xff9c('0x1b'),_0x22b6cf+'-'+_0x563a74+'/'+_0x4b5e36)[_0xff9c('0x1c')](_0x3b6337);}return null;};}function patchUpdates(_0x45930c){return function(_0x243c40){try{jsonpatch[_0xff9c('0x1d')](_0x243c40,_0x45930c,!![]);}catch(_0x4e8d51){return BPromise[_0xff9c('0x1e')](_0x4e8d51);}return _0x243c40[_0xff9c('0x1f')]();};}function saveUpdates(_0x32e25c,_0x311552){return function(_0x1e3187){if(_0x1e3187){return _0x1e3187['update'](_0x32e25c)['then'](function(_0x2b621b){return _0x2b621b;});}return null;};}function removeEntity(_0x4b51f3,_0x1356c1){return function(_0x9495e8){if(_0x9495e8){return _0x9495e8['destroy']()[_0xff9c('0x20')](function(){_0x4b51f3[_0xff9c('0x16')](0xcc)[_0xff9c('0x17')]();});}};}function handleEntityNotFound(_0x43f2a4,_0x572b4b){return function(_0x129b63){if(!_0x129b63){_0x43f2a4['sendStatus'](0x194);}return _0x129b63;};}function handleError(_0x4b9ed2,_0x59fe96){_0x59fe96=_0x59fe96||0x1f4;return function(_0x46283e){logger[_0xff9c('0x21')](_0x46283e[_0xff9c('0x22')]);if(_0x46283e[_0xff9c('0x23')]){delete _0x46283e[_0xff9c('0x23')];}_0x4b9ed2['status'](_0x59fe96)[_0xff9c('0x24')](_0x46283e);};}exports[_0xff9c('0x25')]=function(_0x279344,_0x11627e){var _0x28c1d5={},_0x4a1b82={},_0x3a8d62={'count':0x0,'rows':[]};var _0x2eb674=_[_0xff9c('0x26')](db[_0xff9c('0x27')]['rawAttributes'],function(_0x1f2e48){return{'name':_0x1f2e48['fieldName'],'type':_0x1f2e48[_0xff9c('0x28')][_0xff9c('0x29')]};});_0x4a1b82[_0xff9c('0x2a')]=_[_0xff9c('0x26')](_0x2eb674,_0xff9c('0x23'));_0x4a1b82[_0xff9c('0x2b')]=_['keys'](_0x279344[_0xff9c('0x2b')]);_0x4a1b82[_0xff9c('0x2c')]=_[_0xff9c('0x2d')](_0x4a1b82[_0xff9c('0x2a')],_0x4a1b82['query']);_0x28c1d5[_0xff9c('0x2e')]=_[_0xff9c('0x2d')](_0x4a1b82[_0xff9c('0x2a')],qs[_0xff9c('0x2f')](_0x279344[_0xff9c('0x2b')][_0xff9c('0x2f')]));_0x28c1d5[_0xff9c('0x2e')]=_0x28c1d5[_0xff9c('0x2e')]['length']?_0x28c1d5[_0xff9c('0x2e')]:_0x4a1b82[_0xff9c('0x2a')];if(!_0x279344['query'][_0xff9c('0x30')](_0xff9c('0x31'))){_0x28c1d5[_0xff9c('0x19')]=qs[_0xff9c('0x19')](_0x279344[_0xff9c('0x2b')][_0xff9c('0x19')]);_0x28c1d5[_0xff9c('0x18')]=qs[_0xff9c('0x18')](_0x279344['query'][_0xff9c('0x18')]);}_0x28c1d5[_0xff9c('0x32')]=qs[_0xff9c('0x33')](_0x279344[_0xff9c('0x2b')][_0xff9c('0x33')]);_0x28c1d5['where']=qs[_0xff9c('0x2c')](_[_0xff9c('0x34')](_0x279344[_0xff9c('0x2b')],_0x4a1b82[_0xff9c('0x2c')]),_0x2eb674);if(_0x279344['query'][_0xff9c('0x35')]){_0x28c1d5[_0xff9c('0x36')]=_[_0xff9c('0x37')](_0x28c1d5[_0xff9c('0x36')],{'$or':_[_0xff9c('0x26')](_0x2eb674,function(_0x471ecd){if(_0x471ecd['type']!==_0xff9c('0x38')){var _0x54c0bf={};_0x54c0bf[_0x471ecd[_0xff9c('0x23')]]={'$like':'%'+_0x279344[_0xff9c('0x2b')][_0xff9c('0x35')]+'%'};return _0x54c0bf;}})});}_0x28c1d5=_['merge']({},_0x28c1d5,_0x279344['options']);var _0x5ac599={'where':_0x28c1d5['where']};return db[_0xff9c('0x27')]['count'](_0x5ac599)[_0xff9c('0x20')](function(_0x323c98){_0x3a8d62[_0xff9c('0x1a')]=_0x323c98;if(_0x279344[_0xff9c('0x2b')][_0xff9c('0x39')]){_0x28c1d5[_0xff9c('0x3a')]=[{'all':!![]}];}return db[_0xff9c('0x27')][_0xff9c('0x3b')](_0x28c1d5);})[_0xff9c('0x20')](function(_0x4ee004){_0x3a8d62[_0xff9c('0x3c')]=_0x4ee004;return _0x3a8d62;})['then'](respondWithFilteredResult(_0x11627e,_0x28c1d5))[_0xff9c('0x3d')](handleError(_0x11627e,null));};exports['show']=function(_0x32e1d7,_0x2a5312){var _0x51d1f6={'raw':!![],'where':{'id':_0x32e1d7[_0xff9c('0x3e')]['id']}},_0x1365e4={};_0x1365e4[_0xff9c('0x2a')]=_[_0xff9c('0x3f')](db[_0xff9c('0x27')][_0xff9c('0x40')]);_0x1365e4[_0xff9c('0x2b')]=_[_0xff9c('0x3f')](_0x32e1d7[_0xff9c('0x2b')]);_0x1365e4[_0xff9c('0x2c')]=_[_0xff9c('0x2d')](_0x1365e4[_0xff9c('0x2a')],_0x1365e4[_0xff9c('0x2b')]);_0x51d1f6[_0xff9c('0x2e')]=_[_0xff9c('0x2d')](_0x1365e4[_0xff9c('0x2a')],qs[_0xff9c('0x2f')](_0x32e1d7[_0xff9c('0x2b')][_0xff9c('0x2f')]));_0x51d1f6[_0xff9c('0x2e')]=_0x51d1f6[_0xff9c('0x2e')][_0xff9c('0x41')]?_0x51d1f6[_0xff9c('0x2e')]:_0x1365e4[_0xff9c('0x2a')];if(_0x32e1d7[_0xff9c('0x2b')]['includeAll']){_0x51d1f6['include']=[{'all':!![]}];}_0x51d1f6=_[_0xff9c('0x37')]({},_0x51d1f6,_0x32e1d7[_0xff9c('0x42')]);return db['AnalyticTreeReport'][_0xff9c('0x43')](_0x51d1f6)[_0xff9c('0x20')](handleEntityNotFound(_0x2a5312,null))[_0xff9c('0x20')](respondWithResult(_0x2a5312,null))[_0xff9c('0x3d')](handleError(_0x2a5312,null));};exports[_0xff9c('0x44')]=function(_0x375783,_0x726b59){return db[_0xff9c('0x27')]['create'](_0x375783[_0xff9c('0x45')],{})['then'](respondWithResult(_0x726b59,0xc9))[_0xff9c('0x3d')](handleError(_0x726b59,null));};exports['update']=function(_0x54713e,_0x276ea7){if(_0x54713e['body']['id']){delete _0x54713e['body']['id'];}return db[_0xff9c('0x27')]['find']({'where':{'id':_0x54713e[_0xff9c('0x3e')]['id']}})[_0xff9c('0x20')](handleEntityNotFound(_0x276ea7,null))[_0xff9c('0x20')](saveUpdates(_0x54713e[_0xff9c('0x45')],null))[_0xff9c('0x20')](respondWithResult(_0x276ea7,null))[_0xff9c('0x3d')](handleError(_0x276ea7,null));};exports[_0xff9c('0x46')]=function(_0x4dd80b,_0x39e8e6){return db['AnalyticTreeReport']['find']({'where':{'id':_0x4dd80b[_0xff9c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x39e8e6,null))[_0xff9c('0x20')](removeEntity(_0x39e8e6,null))['catch'](handleError(_0x39e8e6,null));};
\ No newline at end of file
+var _0x6d32=['fields','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','length','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','stack','name','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6d32,0xec));var _0x26d3=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x6d32[_0x16b9ed];return _0x66b1f8;};'use strict';var emlformat=require(_0x26d3('0x0'));var rimraf=require(_0x26d3('0x1'));var zipdir=require(_0x26d3('0x2'));var jsonpatch=require(_0x26d3('0x3'));var rp=require(_0x26d3('0x4'));var moment=require('moment');var BPromise=require(_0x26d3('0x5'));var Mustache=require(_0x26d3('0x6'));var util=require(_0x26d3('0x7'));var path=require(_0x26d3('0x8'));var sox=require(_0x26d3('0x9'));var csv=require(_0x26d3('0xa'));var ejs=require(_0x26d3('0xb'));var fs=require('fs');var fs_extra=require(_0x26d3('0xc'));var _=require(_0x26d3('0xd'));var squel=require(_0x26d3('0xe'));var crypto=require(_0x26d3('0xf'));var jsforce=require(_0x26d3('0x10'));var deskjs=require(_0x26d3('0x11'));var toCsv=require(_0x26d3('0xa'));var querystring=require(_0x26d3('0x12'));var Papa=require(_0x26d3('0x13'));var Redis=require(_0x26d3('0x14'));var authService=require(_0x26d3('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x26d3('0x16'));var hardwareService=require(_0x26d3('0x17'));var logger=require(_0x26d3('0x18'))(_0x26d3('0x19'));var utils=require(_0x26d3('0x1a'));var config=require(_0x26d3('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x26d3('0x1c'))['db'];function respondWithStatusCode(_0x499264,_0x3f37bf){_0x3f37bf=_0x3f37bf||0xcc;return function(_0x439723){if(_0x439723){return _0x499264[_0x26d3('0x1d')](_0x3f37bf);}return _0x499264['status'](_0x3f37bf)['end']();};}function respondWithResult(_0x2c0434,_0x95bab0){_0x95bab0=_0x95bab0||0xc8;return function(_0x581f47){if(_0x581f47){return _0x2c0434[_0x26d3('0x1e')](_0x95bab0)[_0x26d3('0x1f')](_0x581f47);}};}function respondWithFilteredResult(_0x52a224,_0x3de04f){return function(_0x47f935){if(_0x47f935){var _0x12e0be=typeof _0x3de04f[_0x26d3('0x20')]===_0x26d3('0x21')&&typeof _0x3de04f[_0x26d3('0x22')]===_0x26d3('0x21');var _0xc26b55=_0x47f935[_0x26d3('0x23')];var _0x5b0caa=_0x12e0be?0x0:_0x3de04f['offset'];var _0x5ec453=_0x12e0be?_0x47f935[_0x26d3('0x23')]:_0x3de04f['offset']+_0x3de04f[_0x26d3('0x22')];var _0x4b281a;if(_0x5ec453>=_0xc26b55){_0x5ec453=_0xc26b55;_0x4b281a=0xc8;}else{_0x4b281a=0xce;}_0x52a224[_0x26d3('0x1e')](_0x4b281a);return _0x52a224[_0x26d3('0x24')](_0x26d3('0x25'),_0x5b0caa+'-'+_0x5ec453+'/'+_0xc26b55)[_0x26d3('0x1f')](_0x47f935);}return null;};}function patchUpdates(_0x266436){return function(_0xb3051e){try{jsonpatch[_0x26d3('0x26')](_0xb3051e,_0x266436,!![]);}catch(_0x4ed25c){return BPromise[_0x26d3('0x27')](_0x4ed25c);}return _0xb3051e['save']();};}function saveUpdates(_0x31ea87,_0x502f41){return function(_0x187785){if(_0x187785){return _0x187785['update'](_0x31ea87)[_0x26d3('0x28')](function(_0x3d2a1a){return _0x3d2a1a;});}return null;};}function removeEntity(_0xe595a9,_0x1e4afd){return function(_0xac1829){if(_0xac1829){return _0xac1829['destroy']()[_0x26d3('0x28')](function(){_0xe595a9[_0x26d3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x161a5c,_0x15625f){return function(_0x44d098){if(!_0x44d098){_0x161a5c[_0x26d3('0x1d')](0x194);}return _0x44d098;};}function handleError(_0x31fddd,_0x4e2e49){_0x4e2e49=_0x4e2e49||0x1f4;return function(_0x58cb70){logger['error'](_0x58cb70[_0x26d3('0x29')]);if(_0x58cb70['name']){delete _0x58cb70[_0x26d3('0x2a')];}_0x31fddd[_0x26d3('0x1e')](_0x4e2e49)['send'](_0x58cb70);};}exports[_0x26d3('0x2b')]=function(_0x3f0633,_0x317f19){var _0x24c3f8={},_0x332ca3={},_0x2e6d34={'count':0x0,'rows':[]};var _0x3163cf=_['map'](db[_0x26d3('0x2c')][_0x26d3('0x2d')],function(_0x10cc47){return{'name':_0x10cc47[_0x26d3('0x2e')],'type':_0x10cc47[_0x26d3('0x2f')][_0x26d3('0x30')]};});_0x332ca3[_0x26d3('0x31')]=_[_0x26d3('0x32')](_0x3163cf,_0x26d3('0x2a'));_0x332ca3[_0x26d3('0x33')]=_[_0x26d3('0x34')](_0x3f0633[_0x26d3('0x33')]);_0x332ca3[_0x26d3('0x35')]=_[_0x26d3('0x36')](_0x332ca3['model'],_0x332ca3[_0x26d3('0x33')]);_0x24c3f8[_0x26d3('0x37')]=_[_0x26d3('0x36')](_0x332ca3['model'],qs[_0x26d3('0x38')](_0x3f0633[_0x26d3('0x33')]['fields']));_0x24c3f8[_0x26d3('0x37')]=_0x24c3f8[_0x26d3('0x37')]['length']?_0x24c3f8[_0x26d3('0x37')]:_0x332ca3[_0x26d3('0x31')];if(!_0x3f0633['query']['hasOwnProperty']('nolimit')){_0x24c3f8[_0x26d3('0x22')]=qs[_0x26d3('0x22')](_0x3f0633[_0x26d3('0x33')][_0x26d3('0x22')]);_0x24c3f8[_0x26d3('0x20')]=qs[_0x26d3('0x20')](_0x3f0633[_0x26d3('0x33')][_0x26d3('0x20')]);}_0x24c3f8['order']=qs['sort'](_0x3f0633['query'][_0x26d3('0x39')]);_0x24c3f8[_0x26d3('0x3a')]=qs[_0x26d3('0x35')](_[_0x26d3('0x3b')](_0x3f0633['query'],_0x332ca3[_0x26d3('0x35')]),_0x3163cf);if(_0x3f0633[_0x26d3('0x33')][_0x26d3('0x3c')]){_0x24c3f8[_0x26d3('0x3a')]=_[_0x26d3('0x3d')](_0x24c3f8['where'],{'$or':_[_0x26d3('0x32')](_0x3163cf,function(_0x4ae517){if(_0x4ae517['type']!==_0x26d3('0x3e')){var _0xca54ae={};_0xca54ae[_0x4ae517[_0x26d3('0x2a')]]={'$like':'%'+_0x3f0633[_0x26d3('0x33')][_0x26d3('0x3c')]+'%'};return _0xca54ae;}})});}_0x24c3f8=_['merge']({},_0x24c3f8,_0x3f0633['options']);var _0x26f36a={'where':_0x24c3f8['where']};return db[_0x26d3('0x2c')]['count'](_0x26f36a)['then'](function(_0x3d2866){_0x2e6d34[_0x26d3('0x23')]=_0x3d2866;if(_0x3f0633[_0x26d3('0x33')][_0x26d3('0x3f')]){_0x24c3f8[_0x26d3('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x24c3f8);})[_0x26d3('0x28')](function(_0x2ecdc6){_0x2e6d34['rows']=_0x2ecdc6;return _0x2e6d34;})['then'](respondWithFilteredResult(_0x317f19,_0x24c3f8))[_0x26d3('0x41')](handleError(_0x317f19,null));};exports[_0x26d3('0x42')]=function(_0x5d0a9b,_0x27be24){var _0x129fe7={'raw':!![],'where':{'id':_0x5d0a9b['params']['id']}},_0x8aa682={};_0x8aa682[_0x26d3('0x31')]=_['keys'](db[_0x26d3('0x2c')]['rawAttributes']);_0x8aa682[_0x26d3('0x33')]=_[_0x26d3('0x34')](_0x5d0a9b[_0x26d3('0x33')]);_0x8aa682[_0x26d3('0x35')]=_[_0x26d3('0x36')](_0x8aa682[_0x26d3('0x31')],_0x8aa682[_0x26d3('0x33')]);_0x129fe7[_0x26d3('0x37')]=_[_0x26d3('0x36')](_0x8aa682[_0x26d3('0x31')],qs[_0x26d3('0x38')](_0x5d0a9b[_0x26d3('0x33')][_0x26d3('0x38')]));_0x129fe7[_0x26d3('0x37')]=_0x129fe7[_0x26d3('0x37')][_0x26d3('0x43')]?_0x129fe7[_0x26d3('0x37')]:_0x8aa682[_0x26d3('0x31')];if(_0x5d0a9b[_0x26d3('0x33')]['includeAll']){_0x129fe7[_0x26d3('0x40')]=[{'all':!![]}];}_0x129fe7=_[_0x26d3('0x3d')]({},_0x129fe7,_0x5d0a9b[_0x26d3('0x44')]);return db['AnalyticTreeReport'][_0x26d3('0x45')](_0x129fe7)[_0x26d3('0x28')](handleEntityNotFound(_0x27be24,null))['then'](respondWithResult(_0x27be24,null))['catch'](handleError(_0x27be24,null));};exports[_0x26d3('0x46')]=function(_0x4b951f,_0x44f0f7){return db[_0x26d3('0x2c')]['create'](_0x4b951f['body'],{})[_0x26d3('0x28')](respondWithResult(_0x44f0f7,0xc9))[_0x26d3('0x41')](handleError(_0x44f0f7,null));};exports['update']=function(_0x547fa4,_0x1e05f3){if(_0x547fa4[_0x26d3('0x47')]['id']){delete _0x547fa4[_0x26d3('0x47')]['id'];}return db[_0x26d3('0x2c')][_0x26d3('0x45')]({'where':{'id':_0x547fa4[_0x26d3('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e05f3,null))[_0x26d3('0x28')](saveUpdates(_0x547fa4[_0x26d3('0x47')],null))['then'](respondWithResult(_0x1e05f3,null))[_0x26d3('0x41')](handleError(_0x1e05f3,null));};exports['destroy']=function(_0x3fcaf0,_0x4784ff){return db[_0x26d3('0x2c')]['find']({'where':{'id':_0x3fcaf0[_0x26d3('0x48')]['id']}})['then'](handleEntityNotFound(_0x4784ff,null))['then'](removeEntity(_0x4784ff,null))[_0x26d3('0x41')](handleError(_0x4784ff,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 676236f..b0cf79f 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 _0xdff9=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x4a6b64,_0xacb69e){var _0x86fbc2=function(_0x63fd46){while(--_0x63fd46){_0x4a6b64['push'](_0x4a6b64['shift']());}};_0x86fbc2(++_0xacb69e);}(_0xdff9,0x161));var _0x9dff=function(_0x2c50e5,_0x1ca730){_0x2c50e5=_0x2c50e5-0x0;var _0x4b03bd=_0xdff9[_0x2c50e5];return _0x4b03bd;};'use strict';var _=require(_0x9dff('0x0'));var util=require(_0x9dff('0x1'));var logger=require(_0x9dff('0x2'))(_0x9dff('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9dff('0x4'));var fs=require('fs');var path=require(_0x9dff('0x5'));var rimraf=require(_0x9dff('0x6'));var config=require(_0x9dff('0x7'));var attributes=require(_0x9dff('0x8'));module[_0x9dff('0x9')]=function(_0x190235,_0x40e14d){return _0x190235[_0x9dff('0xa')](_0x9dff('0xb'),attributes,{'tableName':_0x9dff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa5f5=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','bluebird','path'];(function(_0x2aebb2,_0x21f452){var _0x17406c=function(_0x7ae2df){while(--_0x7ae2df){_0x2aebb2['push'](_0x2aebb2['shift']());}};_0x17406c(++_0x21f452);}(_0xa5f5,0xe2));var _0x5a5f=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xa5f5[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x5a5f('0x0'));var util=require('util');var logger=require(_0x5a5f('0x1'))(_0x5a5f('0x2'));var moment=require('moment');var BPromise=require(_0x5a5f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a5f('0x4'));var rimraf=require(_0x5a5f('0x5'));var config=require(_0x5a5f('0x6'));var attributes=require(_0x5a5f('0x7'));module[_0x5a5f('0x8')]=function(_0x2b6739,_0x457ab1){return _0x2b6739['define'](_0x5a5f('0x9'),attributes,{'tableName':_0x5a5f('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 38cc2c0..c321bb0 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(_0x877d14,_0x2a1398){var _0x4d7bfe=function(_0x46de1f){while(--_0x46de1f){_0x877d14['push'](_0x877d14['shift']());}};_0x4d7bfe(++_0x2a1398);}(_0x5f2f,0x73));var _0xf5f2=function(_0x37e92b,_0x3527c0){_0x37e92b=_0x37e92b-0x0;var _0x390677=_0x5f2f[_0x37e92b];return _0x390677;};'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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x3f0573,_0x4029da){var _0x14e625=function(_0x502f51){while(--_0x502f51){_0x3f0573['push'](_0x3f0573['shift']());}};_0x14e625(++_0x4029da);}(_0xdb28,0x106));var _0x8db2=function(_0x2ae3d0,_0x454037){_0x2ae3d0=_0x2ae3d0-0x0;var _0xbfe1d5=_0xdb28[_0x2ae3d0];return _0xbfe1d5;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index bb418dc..52dee1f 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 _0xff1c=['isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0xbc44f7,_0x49ce4b){var _0x1f42ca=function(_0x594267){while(--_0x594267){_0xbc44f7['push'](_0xbc44f7['shift']());}};_0x1f42ca(++_0x49ce4b);}(_0xff1c,0xa2));var _0xcff1=function(_0xed72a2,_0xdacfed){_0xed72a2=_0xed72a2-0x0;var _0x5b0bd6=_0xff1c[_0xed72a2];return _0x5b0bd6;};'use strict';var multer=require(_0xcff1('0x0'));var util=require(_0xcff1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcff1('0x2')]();var fs_extra=require(_0xcff1('0x3'));var auth=require(_0xcff1('0x4'));var interaction=require(_0xcff1('0x5'));var config=require(_0xcff1('0x6'));var controller=require(_0xcff1('0x7'));router[_0xcff1('0x8')]('/',auth[_0xcff1('0x9')](),controller['index']);router[_0xcff1('0x8')]('/:id',auth[_0xcff1('0x9')](),controller[_0xcff1('0xa')]);router[_0xcff1('0xb')]('/',auth[_0xcff1('0x9')](),controller[_0xcff1('0xc')]);router[_0xcff1('0xd')](_0xcff1('0xe'),auth[_0xcff1('0x9')](),controller[_0xcff1('0xf')]);router[_0xcff1('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xcff1('0x11')]);module[_0xcff1('0x12')]=router;
\ No newline at end of file
+var _0x8319=['put','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x1b7b53,_0x287249){var _0x3a440d=function(_0x23b4e3){while(--_0x23b4e3){_0x1b7b53['push'](_0x1b7b53['shift']());}};_0x3a440d(++_0x287249);}(_0x8319,0x113));var _0x9831=function(_0x21ad00,_0x4bb7ef){_0x21ad00=_0x21ad00-0x0;var _0x157ca2=_0x8319[_0x21ad00];return _0x157ca2;};'use strict';var multer=require('multer');var util=require(_0x9831('0x0'));var path=require(_0x9831('0x1'));var timeout=require(_0x9831('0x2'));var express=require('express');var router=express[_0x9831('0x3')]();var fs_extra=require(_0x9831('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9831('0x5'));var config=require('../../config/environment');var controller=require(_0x9831('0x6'));router[_0x9831('0x7')]('/',auth[_0x9831('0x8')](),controller[_0x9831('0x9')]);router['get'](_0x9831('0xa'),auth[_0x9831('0x8')](),controller[_0x9831('0xb')]);router[_0x9831('0xc')]('/',auth[_0x9831('0x8')](),controller[_0x9831('0xd')]);router[_0x9831('0xe')]('/:id',auth[_0x9831('0x8')](),controller['update']);router['delete'](_0x9831('0xa'),auth[_0x9831('0x8')](),controller[_0x9831('0xf')]);module[_0x9831('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index ccfda7a..c83c93e 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 _0x121d=['sequelize','exports','STRING'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x121d,0xea));var _0xd121=function(_0x1b5c68,_0x56d052){_0x1b5c68=_0x1b5c68-0x0;var _0x2bd7d1=_0x121d[_0x1b5c68];return _0x2bd7d1;};'use strict';var Sequelize=require(_0xd121('0x0'));module[_0xd121('0x1')]={'name':{'type':Sequelize[_0xd121('0x2')]},'basename':{'type':Sequelize[_0xd121('0x2')]},'type':{'type':Sequelize[_0xd121('0x2')]}};
\ No newline at end of file
+var _0xf3cd=['exports','STRING','sequelize'];(function(_0xe9abdb,_0x382970){var _0x56ec13=function(_0x2c1450){while(--_0x2c1450){_0xe9abdb['push'](_0xe9abdb['shift']());}};_0x56ec13(++_0x382970);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x230bb8,_0xa1718){_0x230bb8=_0x230bb8-0x0;var _0x16cb9a=_0xf3cd[_0x230bb8];return _0x16cb9a;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'name':{'type':Sequelize[_0xdf3c('0x2')]},'basename':{'type':Sequelize[_0xdf3c('0x2')]},'type':{'type':Sequelize[_0xdf3c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index fea02ab..6105a36 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 _0x497b=['sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','clone','get','omit','createdAt','updatedAt','body','destroy','create','file','originalname','mimetype','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','name','send','map','Attachment','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order'];(function(_0xe585ca,_0x375ae0){var _0x1917ec=function(_0x45f32f){while(--_0x45f32f){_0xe585ca['push'](_0xe585ca['shift']());}};_0x1917ec(++_0x375ae0);}(_0x497b,0x124));var _0xb497=function(_0x1ccfd1,_0x4c2ff2){_0x1ccfd1=_0x1ccfd1-0x0;var _0x53474f=_0x497b[_0x1ccfd1];return _0x53474f;};'use strict';var emlformat=require(_0xb497('0x0'));var rimraf=require(_0xb497('0x1'));var zipdir=require(_0xb497('0x2'));var jsonpatch=require(_0xb497('0x3'));var rp=require(_0xb497('0x4'));var moment=require(_0xb497('0x5'));var BPromise=require(_0xb497('0x6'));var Mustache=require(_0xb497('0x7'));var util=require(_0xb497('0x8'));var path=require(_0xb497('0x9'));var sox=require(_0xb497('0xa'));var csv=require('to-csv');var ejs=require(_0xb497('0xb'));var fs=require('fs');var fs_extra=require(_0xb497('0xc'));var _=require('lodash');var squel=require(_0xb497('0xd'));var crypto=require(_0xb497('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb497('0xf'));var querystring=require('querystring');var Papa=require(_0xb497('0x10'));var Redis=require(_0xb497('0x11'));var authService=require(_0xb497('0x12'));var qs=require(_0xb497('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb497('0x14'));var logger=require(_0xb497('0x15'))(_0xb497('0x16'));var utils=require(_0xb497('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb497('0x18'));var db=require(_0xb497('0x19'))['db'];function respondWithStatusCode(_0x2a34c1,_0x30d788){_0x30d788=_0x30d788||0xcc;return function(_0x105fb1){if(_0x105fb1){return _0x2a34c1[_0xb497('0x1a')](_0x30d788);}return _0x2a34c1[_0xb497('0x1b')](_0x30d788)[_0xb497('0x1c')]();};}function respondWithResult(_0x2cf884,_0x40082e){_0x40082e=_0x40082e||0xc8;return function(_0x4bbb36){if(_0x4bbb36){return _0x2cf884[_0xb497('0x1b')](_0x40082e)[_0xb497('0x1d')](_0x4bbb36);}};}function respondWithFilteredResult(_0x2e9edf,_0x3b518e){return function(_0x49acde){if(_0x49acde){var _0x47c545=typeof _0x3b518e[_0xb497('0x1e')]==='undefined'&&typeof _0x3b518e[_0xb497('0x1f')]===_0xb497('0x20');var _0x216fb0=_0x49acde[_0xb497('0x21')];var _0x2ae301=_0x47c545?0x0:_0x3b518e[_0xb497('0x1e')];var _0x4d0e0c=_0x47c545?_0x49acde['count']:_0x3b518e['offset']+_0x3b518e[_0xb497('0x1f')];var _0x5a46a;if(_0x4d0e0c>=_0x216fb0){_0x4d0e0c=_0x216fb0;_0x5a46a=0xc8;}else{_0x5a46a=0xce;}_0x2e9edf['status'](_0x5a46a);return _0x2e9edf[_0xb497('0x22')](_0xb497('0x23'),_0x2ae301+'-'+_0x4d0e0c+'/'+_0x216fb0)[_0xb497('0x1d')](_0x49acde);}return null;};}function patchUpdates(_0x34e37a){return function(_0x301a0a){try{jsonpatch['apply'](_0x301a0a,_0x34e37a,!![]);}catch(_0x524bef){return BPromise['reject'](_0x524bef);}return _0x301a0a[_0xb497('0x24')]();};}function saveUpdates(_0x445008,_0x493665){return function(_0x280390){if(_0x280390){return _0x280390[_0xb497('0x25')](_0x445008)[_0xb497('0x26')](function(_0x350d8b){return _0x350d8b;});}return null;};}function removeEntity(_0x53fefb,_0x329bda){return function(_0x21f5cf){if(_0x21f5cf){return _0x21f5cf['destroy']()[_0xb497('0x26')](function(){_0x53fefb[_0xb497('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a85cb,_0x367840){return function(_0x23f525){if(!_0x23f525){_0x1a85cb['sendStatus'](0x194);}return _0x23f525;};}function handleError(_0x2029a7,_0x132736){_0x132736=_0x132736||0x1f4;return function(_0x27301f){logger['error'](_0x27301f['stack']);if(_0x27301f[_0xb497('0x27')]){delete _0x27301f[_0xb497('0x27')];}_0x2029a7[_0xb497('0x1b')](_0x132736)[_0xb497('0x28')](_0x27301f);};}exports['index']=function(_0x1859a1,_0x8883ee){var _0x3a97ba={},_0x288282={},_0x5d181f={'count':0x0,'rows':[]};var _0x1e48cb=_[_0xb497('0x29')](db[_0xb497('0x2a')]['rawAttributes'],function(_0x2b0584){return{'name':_0x2b0584[_0xb497('0x2b')],'type':_0x2b0584[_0xb497('0x2c')][_0xb497('0x2d')]};});_0x288282['model']=_['map'](_0x1e48cb,_0xb497('0x27'));_0x288282[_0xb497('0x2e')]=_[_0xb497('0x2f')](_0x1859a1[_0xb497('0x2e')]);_0x288282[_0xb497('0x30')]=_[_0xb497('0x31')](_0x288282[_0xb497('0x32')],_0x288282[_0xb497('0x2e')]);_0x3a97ba[_0xb497('0x33')]=_['intersection'](_0x288282['model'],qs[_0xb497('0x34')](_0x1859a1[_0xb497('0x2e')][_0xb497('0x34')]));_0x3a97ba[_0xb497('0x33')]=_0x3a97ba[_0xb497('0x33')][_0xb497('0x35')]?_0x3a97ba[_0xb497('0x33')]:_0x288282['model'];if(!_0x1859a1[_0xb497('0x2e')]['hasOwnProperty'](_0xb497('0x36'))){_0x3a97ba['limit']=qs[_0xb497('0x1f')](_0x1859a1['query'][_0xb497('0x1f')]);_0x3a97ba['offset']=qs[_0xb497('0x1e')](_0x1859a1[_0xb497('0x2e')]['offset']);}_0x3a97ba[_0xb497('0x37')]=qs[_0xb497('0x38')](_0x1859a1['query'][_0xb497('0x38')]);_0x3a97ba[_0xb497('0x39')]=qs['filters'](_[_0xb497('0x3a')](_0x1859a1[_0xb497('0x2e')],_0x288282[_0xb497('0x30')]),_0x1e48cb);if(_0x1859a1[_0xb497('0x2e')]['filter']){_0x3a97ba[_0xb497('0x39')]=_[_0xb497('0x3b')](_0x3a97ba[_0xb497('0x39')],{'$or':_[_0xb497('0x29')](_0x1e48cb,function(_0x33692c){if(_0x33692c['type']!=='VIRTUAL'){var _0x1ff649={};_0x1ff649[_0x33692c[_0xb497('0x27')]]={'$like':'%'+_0x1859a1['query'][_0xb497('0x3c')]+'%'};return _0x1ff649;}})});}_0x3a97ba=_[_0xb497('0x3b')]({},_0x3a97ba,_0x1859a1[_0xb497('0x3d')]);var _0x2ed72a={'where':_0x3a97ba['where']};return db[_0xb497('0x2a')][_0xb497('0x21')](_0x2ed72a)['then'](function(_0x4ee727){_0x5d181f[_0xb497('0x21')]=_0x4ee727;if(_0x1859a1['query'][_0xb497('0x3e')]){_0x3a97ba[_0xb497('0x3f')]=[{'all':!![]}];}return db[_0xb497('0x2a')][_0xb497('0x40')](_0x3a97ba);})['then'](function(_0x3f7f1c){_0x5d181f[_0xb497('0x41')]=_0x3f7f1c;return _0x5d181f;})['then'](respondWithFilteredResult(_0x8883ee,_0x3a97ba))[_0xb497('0x42')](handleError(_0x8883ee,null));};exports[_0xb497('0x43')]=function(_0x35b03b,_0x33db60){var _0x344e43={'raw':!![],'where':{'id':_0x35b03b[_0xb497('0x44')]['id']}},_0x1d68d3={};_0x1d68d3[_0xb497('0x32')]=_[_0xb497('0x2f')](db[_0xb497('0x2a')][_0xb497('0x45')]);_0x1d68d3['query']=_['keys'](_0x35b03b[_0xb497('0x2e')]);_0x1d68d3[_0xb497('0x30')]=_[_0xb497('0x31')](_0x1d68d3[_0xb497('0x32')],_0x1d68d3[_0xb497('0x2e')]);_0x344e43['attributes']=_[_0xb497('0x31')](_0x1d68d3[_0xb497('0x32')],qs[_0xb497('0x34')](_0x35b03b[_0xb497('0x2e')][_0xb497('0x34')]));_0x344e43[_0xb497('0x33')]=_0x344e43[_0xb497('0x33')][_0xb497('0x35')]?_0x344e43[_0xb497('0x33')]:_0x1d68d3[_0xb497('0x32')];if(_0x35b03b[_0xb497('0x2e')]['includeAll']){_0x344e43['include']=[{'all':!![]}];}_0x344e43=_['merge']({},_0x344e43,_0x35b03b['options']);return db[_0xb497('0x2a')]['find'](_0x344e43)[_0xb497('0x26')](handleEntityNotFound(_0x33db60,null))['then'](respondWithResult(_0x33db60,null))[_0xb497('0x42')](handleError(_0x33db60,null));};exports[_0xb497('0x46')]=function(_0x1b720f,_0x527f5e){var _0x1edf99={'where':{'id':_0x1b720f[_0xb497('0x44')]['id']}},_0xb4325b={};_0xb4325b[_0xb497('0x32')]=_[_0xb497('0x2f')](db['Attachment'][_0xb497('0x45')]);_0x1edf99[_0xb497('0x33')]=_[_0xb497('0x31')](_0xb4325b[_0xb497('0x32')],qs[_0xb497('0x34')](_0x1b720f[_0xb497('0x2e')][_0xb497('0x34')]));_0x1edf99[_0xb497('0x33')]=_0x1edf99[_0xb497('0x33')][_0xb497('0x35')]?_0x1edf99[_0xb497('0x33')]:_0xb4325b[_0xb497('0x32')];if(_0x1b720f['query']['includeAll']){_0x1edf99[_0xb497('0x3f')]=[{'all':!![]}];}_0x1edf99=_[_0xb497('0x3b')]({},_0x1edf99,_0x1b720f['options']);return db[_0xb497('0x2a')]['find'](_0x1edf99)['then'](handleEntityNotFound(_0x527f5e,null))[_0xb497('0x26')](function(_0x33dd45){if(_0x33dd45){var _0x590ab6=_0x33dd45[_0xb497('0x47')]({'plain':!![]});_0x590ab6=qs[_0xb497('0x48')](_0x590ab6,['id',_0xb497('0x49'),_0xb497('0x4a')]);_0x1b720f[_0xb497('0x4b')]=_[_0xb497('0x48')](_0x1b720f[_0xb497('0x4b')],['id','createdAt','updatedAt']);return db[_0xb497('0x2a')]['create'](_['merge'](_0x590ab6,_0x1b720f[_0xb497('0x4b')]),{'include':_0x1b720f[_0xb497('0x2e')][_0xb497('0x3e')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x527f5e,0xc9))[_0xb497('0x42')](handleError(_0x527f5e,null));};exports[_0xb497('0x25')]=function(_0x4bd5cb,_0x24f8b6){if(_0x4bd5cb[_0xb497('0x4b')]['id']){delete _0x4bd5cb[_0xb497('0x4b')]['id'];}return db[_0xb497('0x2a')]['find']({'where':{'id':_0x4bd5cb[_0xb497('0x44')]['id']}})['then'](handleEntityNotFound(_0x24f8b6,null))['then'](saveUpdates(_0x4bd5cb[_0xb497('0x4b')],null))[_0xb497('0x26')](respondWithResult(_0x24f8b6,null))[_0xb497('0x42')](handleError(_0x24f8b6,null));};exports[_0xb497('0x4c')]=function(_0x2c68e2,_0x49d0b2){return db[_0xb497('0x2a')]['find']({'where':{'id':_0x2c68e2[_0xb497('0x44')]['id']}})[_0xb497('0x26')](handleEntityNotFound(_0x49d0b2,null))[_0xb497('0x26')](removeEntity(_0x49d0b2,null))[_0xb497('0x42')](handleError(_0x49d0b2,null));};exports[_0xb497('0x4d')]=function(_0x3399c3,_0x2d245e,_0x101665){_0x3399c3['body'][_0xb497('0x27')]=_0x3399c3[_0xb497('0x4e')][_0xb497('0x4f')];_0x3399c3['body']['basename']=_0x3399c3[_0xb497('0x4e')]['filename'];_0x3399c3[_0xb497('0x4b')][_0xb497('0x2c')]=_0x3399c3['file'][_0xb497('0x50')];return db[_0xb497('0x2a')][_0xb497('0x4d')](_0x3399c3['body'])['then'](respondWithResult(_0x2d245e,0xc9))['catch'](handleError(_0x2d245e,null));};exports['download']=function(_0x5ef223,_0xf4a8d8,_0x5d2e32){return db[_0xb497('0x2a')][_0xb497('0x51')]({'where':{'id':_0x5ef223[_0xb497('0x44')]['id']},'raw':!![]})[_0xb497('0x26')](handleEntityNotFound(_0xf4a8d8,null))[_0xb497('0x26')](function(_0x5a22bd){if(_0x5a22bd){var _0x2afacb=_0x5a22bd[_0xb497('0x52')]!==null;var _0x20e4a8=path[_0xb497('0x53')](config['root'],_0xb497('0x54'));if(_0x2afacb){_0x20e4a8=path[_0xb497('0x53')](_0x20e4a8,_0xb497('0x55'));}var _0x4e4f96=path['join'](_0x20e4a8,_0x5a22bd[_0xb497('0x56')]);return _0xf4a8d8['download'](_0x4e4f96);}})['catch'](handleError(_0xf4a8d8,null));};
\ No newline at end of file
+var _0xbf29=['count','offset','set','Content-Range','apply','reject','then','destroy','sendStatus','error','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','Attachment','include','rows','catch','show','params','length','includeAll','find','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','ChatOfflineMessageId','join','root','server/files/attachments/','download','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xbf29,0x19d));var _0x9bf2=function(_0x3caa7c,_0x5eab01){_0x3caa7c=_0x3caa7c-0x0;var _0x5e90a3=_0xbf29[_0x3caa7c];return _0x5e90a3;};'use strict';var emlformat=require(_0x9bf2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9bf2('0x1'));var jsonpatch=require(_0x9bf2('0x2'));var rp=require(_0x9bf2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9bf2('0x4'));var util=require(_0x9bf2('0x5'));var path=require(_0x9bf2('0x6'));var sox=require(_0x9bf2('0x7'));var csv=require(_0x9bf2('0x8'));var ejs=require(_0x9bf2('0x9'));var fs=require('fs');var fs_extra=require(_0x9bf2('0xa'));var _=require(_0x9bf2('0xb'));var squel=require(_0x9bf2('0xc'));var crypto=require(_0x9bf2('0xd'));var jsforce=require(_0x9bf2('0xe'));var deskjs=require(_0x9bf2('0xf'));var toCsv=require(_0x9bf2('0x8'));var querystring=require('querystring');var Papa=require(_0x9bf2('0x10'));var Redis=require(_0x9bf2('0x11'));var authService=require(_0x9bf2('0x12'));var qs=require(_0x9bf2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9bf2('0x14'));var logger=require(_0x9bf2('0x15'))(_0x9bf2('0x16'));var utils=require(_0x9bf2('0x17'));var config=require(_0x9bf2('0x18'));var licenseUtil=require(_0x9bf2('0x19'));var db=require(_0x9bf2('0x1a'))['db'];function respondWithStatusCode(_0x839e7,_0x57a874){_0x57a874=_0x57a874||0xcc;return function(_0x98faeb){if(_0x98faeb){return _0x839e7['sendStatus'](_0x57a874);}return _0x839e7[_0x9bf2('0x1b')](_0x57a874)[_0x9bf2('0x1c')]();};}function respondWithResult(_0xd74f3b,_0x1b1c05){_0x1b1c05=_0x1b1c05||0xc8;return function(_0x165c49){if(_0x165c49){return _0xd74f3b[_0x9bf2('0x1b')](_0x1b1c05)[_0x9bf2('0x1d')](_0x165c49);}};}function respondWithFilteredResult(_0x2c0093,_0xdfc53f){return function(_0x430068){if(_0x430068){var _0x33c1f4=typeof _0xdfc53f['offset']===_0x9bf2('0x1e')&&typeof _0xdfc53f[_0x9bf2('0x1f')]===_0x9bf2('0x1e');var _0x2c5ee1=_0x430068[_0x9bf2('0x20')];var _0x172f92=_0x33c1f4?0x0:_0xdfc53f[_0x9bf2('0x21')];var _0x35c9a9=_0x33c1f4?_0x430068[_0x9bf2('0x20')]:_0xdfc53f['offset']+_0xdfc53f[_0x9bf2('0x1f')];var _0xd3ea3e;if(_0x35c9a9>=_0x2c5ee1){_0x35c9a9=_0x2c5ee1;_0xd3ea3e=0xc8;}else{_0xd3ea3e=0xce;}_0x2c0093['status'](_0xd3ea3e);return _0x2c0093[_0x9bf2('0x22')](_0x9bf2('0x23'),_0x172f92+'-'+_0x35c9a9+'/'+_0x2c5ee1)[_0x9bf2('0x1d')](_0x430068);}return null;};}function patchUpdates(_0x181bfc){return function(_0x257f36){try{jsonpatch[_0x9bf2('0x24')](_0x257f36,_0x181bfc,!![]);}catch(_0x17b5b6){return BPromise[_0x9bf2('0x25')](_0x17b5b6);}return _0x257f36['save']();};}function saveUpdates(_0x114e97,_0x5beaf5){return function(_0x29f397){if(_0x29f397){return _0x29f397['update'](_0x114e97)[_0x9bf2('0x26')](function(_0x316d6b){return _0x316d6b;});}return null;};}function removeEntity(_0x5be9ac,_0x3c003f){return function(_0x79a835){if(_0x79a835){return _0x79a835[_0x9bf2('0x27')]()['then'](function(){_0x5be9ac['status'](0xcc)[_0x9bf2('0x1c')]();});}};}function handleEntityNotFound(_0x489192,_0xe8d178){return function(_0x1671eb){if(!_0x1671eb){_0x489192[_0x9bf2('0x28')](0x194);}return _0x1671eb;};}function handleError(_0x227ecc,_0x286c8a){_0x286c8a=_0x286c8a||0x1f4;return function(_0x35974e){logger[_0x9bf2('0x29')](_0x35974e['stack']);if(_0x35974e[_0x9bf2('0x2a')]){delete _0x35974e['name'];}_0x227ecc[_0x9bf2('0x1b')](_0x286c8a)['send'](_0x35974e);};}exports[_0x9bf2('0x2b')]=function(_0xaba6c9,_0x5ee754){var _0x1ff510={},_0x7b434a={},_0x34f706={'count':0x0,'rows':[]};var _0x2bede6=_[_0x9bf2('0x2c')](db['Attachment'][_0x9bf2('0x2d')],function(_0x83ee5a){return{'name':_0x83ee5a[_0x9bf2('0x2e')],'type':_0x83ee5a['type'][_0x9bf2('0x2f')]};});_0x7b434a[_0x9bf2('0x30')]=_['map'](_0x2bede6,_0x9bf2('0x2a'));_0x7b434a[_0x9bf2('0x31')]=_[_0x9bf2('0x32')](_0xaba6c9['query']);_0x7b434a[_0x9bf2('0x33')]=_[_0x9bf2('0x34')](_0x7b434a['model'],_0x7b434a[_0x9bf2('0x31')]);_0x1ff510['attributes']=_[_0x9bf2('0x34')](_0x7b434a['model'],qs[_0x9bf2('0x35')](_0xaba6c9[_0x9bf2('0x31')][_0x9bf2('0x35')]));_0x1ff510[_0x9bf2('0x36')]=_0x1ff510[_0x9bf2('0x36')]['length']?_0x1ff510['attributes']:_0x7b434a[_0x9bf2('0x30')];if(!_0xaba6c9[_0x9bf2('0x31')][_0x9bf2('0x37')](_0x9bf2('0x38'))){_0x1ff510[_0x9bf2('0x1f')]=qs[_0x9bf2('0x1f')](_0xaba6c9[_0x9bf2('0x31')]['limit']);_0x1ff510['offset']=qs[_0x9bf2('0x21')](_0xaba6c9[_0x9bf2('0x31')][_0x9bf2('0x21')]);}_0x1ff510[_0x9bf2('0x39')]=qs[_0x9bf2('0x3a')](_0xaba6c9['query'][_0x9bf2('0x3a')]);_0x1ff510[_0x9bf2('0x3b')]=qs['filters'](_['pick'](_0xaba6c9['query'],_0x7b434a['filters']),_0x2bede6);if(_0xaba6c9[_0x9bf2('0x31')][_0x9bf2('0x3c')]){_0x1ff510[_0x9bf2('0x3b')]=_[_0x9bf2('0x3d')](_0x1ff510['where'],{'$or':_[_0x9bf2('0x2c')](_0x2bede6,function(_0x3ca6b3){if(_0x3ca6b3[_0x9bf2('0x3e')]!==_0x9bf2('0x3f')){var _0x16aa4e={};_0x16aa4e[_0x3ca6b3['name']]={'$like':'%'+_0xaba6c9[_0x9bf2('0x31')]['filter']+'%'};return _0x16aa4e;}})});}_0x1ff510=_['merge']({},_0x1ff510,_0xaba6c9[_0x9bf2('0x40')]);var _0x651cd7={'where':_0x1ff510[_0x9bf2('0x3b')]};return db[_0x9bf2('0x41')][_0x9bf2('0x20')](_0x651cd7)['then'](function(_0x4dc4a7){_0x34f706[_0x9bf2('0x20')]=_0x4dc4a7;if(_0xaba6c9[_0x9bf2('0x31')]['includeAll']){_0x1ff510[_0x9bf2('0x42')]=[{'all':!![]}];}return db[_0x9bf2('0x41')]['findAll'](_0x1ff510);})[_0x9bf2('0x26')](function(_0x282264){_0x34f706[_0x9bf2('0x43')]=_0x282264;return _0x34f706;})[_0x9bf2('0x26')](respondWithFilteredResult(_0x5ee754,_0x1ff510))[_0x9bf2('0x44')](handleError(_0x5ee754,null));};exports[_0x9bf2('0x45')]=function(_0x4c6d4b,_0x3d07b9){var _0x102e9c={'raw':!![],'where':{'id':_0x4c6d4b[_0x9bf2('0x46')]['id']}},_0x372014={};_0x372014[_0x9bf2('0x30')]=_[_0x9bf2('0x32')](db['Attachment'][_0x9bf2('0x2d')]);_0x372014['query']=_['keys'](_0x4c6d4b['query']);_0x372014[_0x9bf2('0x33')]=_['intersection'](_0x372014[_0x9bf2('0x30')],_0x372014[_0x9bf2('0x31')]);_0x102e9c[_0x9bf2('0x36')]=_[_0x9bf2('0x34')](_0x372014['model'],qs['fields'](_0x4c6d4b[_0x9bf2('0x31')][_0x9bf2('0x35')]));_0x102e9c[_0x9bf2('0x36')]=_0x102e9c[_0x9bf2('0x36')][_0x9bf2('0x47')]?_0x102e9c[_0x9bf2('0x36')]:_0x372014[_0x9bf2('0x30')];if(_0x4c6d4b[_0x9bf2('0x31')][_0x9bf2('0x48')]){_0x102e9c[_0x9bf2('0x42')]=[{'all':!![]}];}_0x102e9c=_['merge']({},_0x102e9c,_0x4c6d4b[_0x9bf2('0x40')]);return db[_0x9bf2('0x41')][_0x9bf2('0x49')](_0x102e9c)[_0x9bf2('0x26')](handleEntityNotFound(_0x3d07b9,null))[_0x9bf2('0x26')](respondWithResult(_0x3d07b9,null))[_0x9bf2('0x44')](handleError(_0x3d07b9,null));};exports['clone']=function(_0x51561e,_0x2d7cbd){var _0x4b2a8a={'where':{'id':_0x51561e['params']['id']}},_0x2d7d7d={};_0x2d7d7d[_0x9bf2('0x30')]=_[_0x9bf2('0x32')](db[_0x9bf2('0x41')][_0x9bf2('0x2d')]);_0x4b2a8a[_0x9bf2('0x36')]=_[_0x9bf2('0x34')](_0x2d7d7d[_0x9bf2('0x30')],qs[_0x9bf2('0x35')](_0x51561e[_0x9bf2('0x31')][_0x9bf2('0x35')]));_0x4b2a8a['attributes']=_0x4b2a8a[_0x9bf2('0x36')]['length']?_0x4b2a8a[_0x9bf2('0x36')]:_0x2d7d7d['model'];if(_0x51561e['query'][_0x9bf2('0x48')]){_0x4b2a8a['include']=[{'all':!![]}];}_0x4b2a8a=_['merge']({},_0x4b2a8a,_0x51561e[_0x9bf2('0x40')]);return db['Attachment'][_0x9bf2('0x49')](_0x4b2a8a)[_0x9bf2('0x26')](handleEntityNotFound(_0x2d7cbd,null))[_0x9bf2('0x26')](function(_0x4bfbe3){if(_0x4bfbe3){var _0x3715fe=_0x4bfbe3[_0x9bf2('0x4a')]({'plain':!![]});_0x3715fe=qs['omit'](_0x3715fe,['id',_0x9bf2('0x4b'),_0x9bf2('0x4c')]);_0x51561e[_0x9bf2('0x4d')]=_[_0x9bf2('0x4e')](_0x51561e[_0x9bf2('0x4d')],['id',_0x9bf2('0x4b'),_0x9bf2('0x4c')]);return db['Attachment'][_0x9bf2('0x4f')](_['merge'](_0x3715fe,_0x51561e[_0x9bf2('0x4d')]),{'include':_0x51561e['query'][_0x9bf2('0x48')]?[{'all':!![]}]:undefined});}})[_0x9bf2('0x26')](respondWithResult(_0x2d7cbd,0xc9))[_0x9bf2('0x44')](handleError(_0x2d7cbd,null));};exports['update']=function(_0x28d18c,_0x549eb3){if(_0x28d18c[_0x9bf2('0x4d')]['id']){delete _0x28d18c[_0x9bf2('0x4d')]['id'];}return db[_0x9bf2('0x41')][_0x9bf2('0x49')]({'where':{'id':_0x28d18c[_0x9bf2('0x46')]['id']}})['then'](handleEntityNotFound(_0x549eb3,null))[_0x9bf2('0x26')](saveUpdates(_0x28d18c['body'],null))[_0x9bf2('0x26')](respondWithResult(_0x549eb3,null))[_0x9bf2('0x44')](handleError(_0x549eb3,null));};exports[_0x9bf2('0x27')]=function(_0x9e48d7,_0x4098e7){return db[_0x9bf2('0x41')][_0x9bf2('0x49')]({'where':{'id':_0x9e48d7[_0x9bf2('0x46')]['id']}})[_0x9bf2('0x26')](handleEntityNotFound(_0x4098e7,null))[_0x9bf2('0x26')](removeEntity(_0x4098e7,null))['catch'](handleError(_0x4098e7,null));};exports[_0x9bf2('0x4f')]=function(_0x2c4f25,_0x3faf2f,_0x200b8f){_0x2c4f25['body'][_0x9bf2('0x2a')]=_0x2c4f25[_0x9bf2('0x50')][_0x9bf2('0x51')];_0x2c4f25[_0x9bf2('0x4d')][_0x9bf2('0x52')]=_0x2c4f25['file'][_0x9bf2('0x53')];_0x2c4f25[_0x9bf2('0x4d')][_0x9bf2('0x3e')]=_0x2c4f25[_0x9bf2('0x50')]['mimetype'];return db[_0x9bf2('0x41')][_0x9bf2('0x4f')](_0x2c4f25['body'])['then'](respondWithResult(_0x3faf2f,0xc9))[_0x9bf2('0x44')](handleError(_0x3faf2f,null));};exports['download']=function(_0x261f5a,_0x151302,_0x97b594){return db[_0x9bf2('0x41')]['findOne']({'where':{'id':_0x261f5a[_0x9bf2('0x46')]['id']},'raw':!![]})[_0x9bf2('0x26')](handleEntityNotFound(_0x151302,null))['then'](function(_0x3c7c4c){if(_0x3c7c4c){var _0x22ccf7=_0x3c7c4c[_0x9bf2('0x54')]!==null;var _0x540b55=path[_0x9bf2('0x55')](config[_0x9bf2('0x56')],_0x9bf2('0x57'));if(_0x22ccf7){_0x540b55=path[_0x9bf2('0x55')](_0x540b55,'offline-chat/');}var _0x58cd7f=path[_0x9bf2('0x55')](_0x540b55,_0x3c7c4c[_0x9bf2('0x52')]);return _0x151302[_0x9bf2('0x58')](_0x58cd7f);}})[_0x9bf2('0x44')](handleError(_0x151302,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 4ac053b..cb8bbc4 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 _0xe1c4=['path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','../../config/logger','api','moment','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe1c4,0x1f4));var _0x4e1c=function(_0x1ccf6d,_0x1d7da6){_0x1ccf6d=_0x1ccf6d-0x0;var _0x23722d=_0xe1c4[_0x1ccf6d];return _0x23722d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4e1c('0x0'))(_0x4e1c('0x1'));var moment=require(_0x4e1c('0x2'));var BPromise=require(_0x4e1c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e1c('0x4'));var rimraf=require(_0x4e1c('0x5'));var config=require(_0x4e1c('0x6'));var attributes=require(_0x4e1c('0x7'));module[_0x4e1c('0x8')]=function(_0x45d7e7,_0x14e57c){return _0x45d7e7[_0x4e1c('0x9')](_0x4e1c('0xa'),attributes,{'tableName':_0x4e1c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdf9=['attachments','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./attachment.attributes','exports','Attachment'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xfdf9,0x1ae));var _0x9fdf=function(_0x2c4050,_0x1c56eb){_0x2c4050=_0x2c4050-0x0;var _0x536ef4=_0xfdf9[_0x2c4050];return _0x536ef4;};'use strict';var _=require(_0x9fdf('0x0'));var util=require(_0x9fdf('0x1'));var logger=require(_0x9fdf('0x2'))(_0x9fdf('0x3'));var moment=require('moment');var BPromise=require(_0x9fdf('0x4'));var rp=require(_0x9fdf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9fdf('0x6'));var attributes=require(_0x9fdf('0x7'));module[_0x9fdf('0x8')]=function(_0xdaf153,_0x51ec43){return _0xdaf153['define'](_0x9fdf('0x9'),attributes,{'tableName':_0x9fdf('0xa'),'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 bf0edfd..26f079e 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 _0xa0bc=['options','raw','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateAttachment','create','body'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xca0b('0x0'));var moment=require(_0xca0b('0x1'));var BPromise=require('bluebird');var rs=require(_0xca0b('0x2'));var fs=require('fs');var Redis=require(_0xca0b('0x3'));var db=require(_0xca0b('0x4'))['db'];var utils=require(_0xca0b('0x5'));var logger=require(_0xca0b('0x6'))(_0xca0b('0x7'));var config=require(_0xca0b('0x8'));var jayson=require(_0xca0b('0x9'));var client=jayson[_0xca0b('0xa')][_0xca0b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbe64c7,_0x30202d,_0xa506a4){return new BPromise(function(_0x19acc2,_0x55a1de){return client[_0xca0b('0xc')](_0xbe64c7,_0xa506a4)[_0xca0b('0xd')](function(_0x3e3909){logger[_0xca0b('0xe')](_0xca0b('0xf'),_0x30202d,_0xca0b('0x10'));logger['debug'](_0xca0b('0x11'),_0x30202d,_0xca0b('0x10'),JSON[_0xca0b('0x12')](_0x3e3909));if(_0x3e3909[_0xca0b('0x13')]){if(_0x3e3909[_0xca0b('0x13')][_0xca0b('0x14')]===0x1f4){logger[_0xca0b('0x13')](_0xca0b('0xf'),_0x30202d,_0x3e3909[_0xca0b('0x13')][_0xca0b('0x15')]);return _0x55a1de(_0x3e3909['error'][_0xca0b('0x15')]);}logger[_0xca0b('0x13')](_0xca0b('0xf'),_0x30202d,_0x3e3909['error'][_0xca0b('0x15')]);return _0x19acc2(_0x3e3909[_0xca0b('0x13')][_0xca0b('0x15')]);}else{logger[_0xca0b('0xe')](_0xca0b('0xf'),_0x30202d,_0xca0b('0x10'));_0x19acc2(_0x3e3909['result'][_0xca0b('0x15')]);}})[_0xca0b('0x16')](function(_0x4d9b16){logger[_0xca0b('0x13')]('Attachment,\x20%s,\x20%s',_0x30202d,_0x4d9b16);_0x55a1de(_0x4d9b16);});});}exports[_0xca0b('0x17')]=function(_0x5050b7){var _0x236503=this;return new Promise(function(_0x32eff7,_0x97be82){return db['Attachment'][_0xca0b('0x18')](_0x5050b7[_0xca0b('0x19')],{'raw':_0x5050b7['options']?_0x5050b7[_0xca0b('0x1a')][_0xca0b('0x1b')]===undefined?!![]:![]:!![]})[_0xca0b('0xd')](function(_0x59bda9){logger[_0xca0b('0xe')](_0xca0b('0x17'),_0x5050b7);logger[_0xca0b('0x1c')](_0xca0b('0x17'),_0x5050b7,JSON[_0xca0b('0x12')](_0x59bda9));_0x32eff7(_0x59bda9);})[_0xca0b('0x16')](function(_0x49e695){logger[_0xca0b('0x13')](_0xca0b('0x17'),_0x49e695[_0xca0b('0x15')],_0x5050b7);_0x97be82(_0x236503['error'](0x1f4,_0x49e695['message']));});});};
\ No newline at end of file
+var _0xa1fd=['jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','CreateAttachment','create','body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0xa1fd[_0x21cb7f];return _0x5a079a;};'use strict';var _=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var moment=require(_0xda1f('0x2'));var BPromise=require(_0xda1f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda1f('0x4'));var db=require(_0xda1f('0x5'))['db'];var utils=require(_0xda1f('0x6'));var logger=require(_0xda1f('0x7'))(_0xda1f('0x8'));var config=require('../../config/environment');var jayson=require(_0xda1f('0x9'));var client=jayson[_0xda1f('0xa')][_0xda1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x552ba4,_0x33502e,_0x46a29e){return new BPromise(function(_0x199a8d,_0x338463){return client[_0xda1f('0xc')](_0x552ba4,_0x46a29e)[_0xda1f('0xd')](function(_0x1493f8){logger[_0xda1f('0xe')](_0xda1f('0xf'),_0x33502e,'request\x20sent');logger[_0xda1f('0x10')](_0xda1f('0x11'),_0x33502e,_0xda1f('0x12'),JSON[_0xda1f('0x13')](_0x1493f8));if(_0x1493f8['error']){if(_0x1493f8['error'][_0xda1f('0x14')]===0x1f4){logger[_0xda1f('0x15')](_0xda1f('0xf'),_0x33502e,_0x1493f8[_0xda1f('0x15')][_0xda1f('0x16')]);return _0x338463(_0x1493f8['error'][_0xda1f('0x16')]);}logger[_0xda1f('0x15')](_0xda1f('0xf'),_0x33502e,_0x1493f8[_0xda1f('0x15')][_0xda1f('0x16')]);return _0x199a8d(_0x1493f8[_0xda1f('0x15')]['message']);}else{logger[_0xda1f('0xe')](_0xda1f('0xf'),_0x33502e,_0xda1f('0x12'));_0x199a8d(_0x1493f8[_0xda1f('0x17')]['message']);}})['catch'](function(_0x3020ea){logger['error'](_0xda1f('0xf'),_0x33502e,_0x3020ea);_0x338463(_0x3020ea);});});}exports[_0xda1f('0x18')]=function(_0x1e10af){var _0x59b7bf=this;return new Promise(function(_0xe81fc2,_0xe18a0a){return db['Attachment'][_0xda1f('0x19')](_0x1e10af[_0xda1f('0x1a')],{'raw':_0x1e10af['options']?_0x1e10af[_0xda1f('0x1b')][_0xda1f('0x1c')]===undefined?!![]:![]:!![]})[_0xda1f('0xd')](function(_0xe85e94){logger[_0xda1f('0xe')](_0xda1f('0x18'),_0x1e10af);logger[_0xda1f('0x10')](_0xda1f('0x18'),_0x1e10af,JSON[_0xda1f('0x13')](_0xe85e94));_0xe81fc2(_0xe85e94);})[_0xda1f('0x1d')](function(_0x1d510b){logger[_0xda1f('0x15')]('CreateAttachment',_0x1d510b[_0xda1f('0x16')],_0x1e10af);_0xe18a0a(_0x59b7bf['error'](0x1f4,_0x1d510b[_0xda1f('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index b5a867a..ecf0d64 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0xef81f1,_0x560ecf){var _0x55b993=function(_0x3f2d3f){while(--_0x3f2d3f){_0xef81f1['push'](_0xef81f1['shift']());}};_0x55b993(++_0x560ecf);}(_0xb10b,0x12a));var _0xbb10=function(_0x1cc2a9,_0x2c5885){_0x1cc2a9=_0x1cc2a9-0x0;var _0xdcc257=_0xb10b[_0x1cc2a9];return _0xdcc257;};'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')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x296b2a,_0x4e53b2){var _0x3c9ac0=function(_0x5c38fb){while(--_0x5c38fb){_0x296b2a['push'](_0x296b2a['shift']());}};_0x3c9ac0(++_0x4e53b2);}(_0xb10b,0x12a));var _0xbb10=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0xb10b[_0x5235a6];return _0x1cf37e;};'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')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 8db2dbd..1496e77 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 _0x561d=['url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','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','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','domain','add','minutes','getLicense','catch','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','User','passport','passport-local','Strategy','moment','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN'];(function(_0x444be1,_0x3156e1){var _0x51732b=function(_0x2c37a8){while(--_0x2c37a8){_0x444be1['push'](_0x444be1['shift']());}};_0x51732b(++_0x3156e1);}(_0x561d,0x1f1));var _0xd561=function(_0x27aa68,_0x5dab72){_0x27aa68=_0x27aa68-0x0;var _0x413916=_0x561d[_0x27aa68];return _0x413916;};'use strict';var passport=require(_0xd561('0x0'));var LocalStrategy=require(_0xd561('0x1'))[_0xd561('0x2')];var moment=require(_0xd561('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0xd561('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xd561('0x5'));var utils=require(_0xd561('0x6'));var config=require(_0xd561('0x7'));var logger=require(_0xd561('0x8'))(_0xd561('0x9'));function isActiveDirectoryConfigured(_0x55ae30){var _0x416c2f=![];if(typeof _0x55ae30[_0xd561('0xa')]!==_0xd561('0xb')){_0x416c2f=_0x55ae30[_0xd561('0xa')][_0xd561('0xc')]&&_0x55ae30[_0xd561('0xa')][_0xd561('0xd')]&&_0x55ae30[_0xd561('0xa')]['domain'];}return _0x416c2f;}function adAuthenticate(_0x127fd5,_0x3be1c9,_0x344ddc){return new BPromise(function(_0x46ca60,_0x2de7d7){try{var _0x5efe80=new ActiveDirectory(_0x127fd5);_0x5efe80[_0xd561('0xe')](_0x3be1c9,_0x344ddc,function(_0x1e4c11,_0xba9c38){if(_0x1e4c11){logger[_0xd561('0xf')](_0xd561('0x10'),_0x3be1c9,util[_0xd561('0x11')](_0x1e4c11,{'showHidden':![],'depth':null}));_0x2de7d7(_0xd561('0x12'));}else if(!_0xba9c38){logger['error'](_0xd561('0x13'),_0x3be1c9);_0x2de7d7('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x46ca60(_0xba9c38);}});}catch(_0x5029ce){_0x2de7d7(_0x5029ce);}});}function ActiveDirectoryAuthenticate(_0x2f1e45,_0x590612,_0x3a6fab,_0xd1de65){var _0x3b84eb,_0x303ca1;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xd561('0x14'),_0x590612);return _0xd1de65(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xd561('0x15')][_0xd561('0x16')]({'where':{'id':0x1},'attributes':[_0xd561('0x17'),_0xd561('0x18')],'raw':!![]})[_0xd561('0x19')](function(_0x17a7d3){_0x3b84eb=_0x17a7d3;if(!_0x3b84eb['adSsoEnabled']){logger[_0xd561('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x590612);throw new Error(_0xd561('0x12'));}return _0x2f1e45[_0xd561('0x16')]({'attributes':['id',_0xd561('0x1a'),_0xd561('0x1b'),_0xd561('0x1c'),_0xd561('0x1d'),_0xd561('0x1e'),_0xd561('0x1f'),_0xd561('0x20'),_0xd561('0x21')],'where':{'name':_0x590612,'role':{'$or':[_0xd561('0x22'),'user',_0xd561('0x23')]},'adSsoEnabled':!![]}});})['then'](function(_0x4e6c53){if(!_0x4e6c53||_0x4e6c53&&_0x4e6c53[_0xd561('0x1a')]!==_0x590612){throw new Error(_0xd561('0x12'));}_0x303ca1=_0x4e6c53;var _0x19fc12=_0x303ca1[_0xd561('0x1a')]+'@'+config[_0xd561('0xa')][_0xd561('0x24')];return adAuthenticate(config['activedirectory'],_0x19fc12,_0x3a6fab);})[_0xd561('0x19')](function(_0x1ac6d9){if(_0x303ca1[_0xd561('0x1e')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x3b84eb['blockDuration']>0x0){if(_0x303ca1[_0xd561('0x1f')]){if(moment(_0x303ca1[_0xd561('0x20')])[_0xd561('0x25')](_0x3b84eb[_0xd561('0x18')],_0xd561('0x26'))>moment()){throw new Error(_0xd561('0x12'));}return utils['clearBlockUser'](_0x303ca1,0x0,![],null)[_0xd561('0x19')](function(){return utils[_0xd561('0x27')](_0x303ca1);})[_0xd561('0x19')](function(){return _0xd1de65(null,_0x303ca1);});}else{return utils['getLicense'](_0x303ca1)['then'](function(){return _0xd1de65(null,_0x303ca1);});}}else{return utils['getLicense'](_0x303ca1)[_0xd561('0x19')](function(){return _0xd1de65(null,_0x303ca1);});}})[_0xd561('0x28')](function(_0x450bec){return _0xd1de65(null,![],_0x450bec);});}function handleError(_0x22bc68,_0x4eab84,_0x1c6a2f){return _0x22bc68[_0xd561('0x29')](_0x4eab84||0x1f4)[_0xd561('0x2a')]({'message':_0x1c6a2f?_0x1c6a2f[_0xd561('0x2b')]||_0x1c6a2f:''});}exports[_0xd561('0x2c')]=function(_0x3384bf,_0x1d489c,_0x20212c){passport['authenticate']('ad-login',function(_0x30fc32,_0x71784c,_0x3605a0){var _0x433586=_0x30fc32||_0x3605a0;if(_0x433586){return handleError(_0x1d489c,0x191,_0x433586);}if(!_0x71784c){return handleError(_0x1d489c,0x194,{'message':_0xd561('0x2d')});}else{var _0x45de16={'payload':{'id':_0x71784c['id'],'role':_0x71784c[_0xd561('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0xd561('0x2e')](_0x45de16)['then'](function(_0x541310){_0x1d489c[_0xd561('0x2f')]({'id':_0x71784c['id'],'token':_0x541310,'statusCall':'','isAlreadyLogged':_0x71784c[_0xd561('0x21')]});});}})(_0x3384bf,_0x1d489c,_0x20212c);};passport[_0xd561('0x30')](_0xd561('0x31'),new LocalStrategy({'usernameField':_0xd561('0x1a'),'passwordField':_0xd561('0x1b')},function(_0x26722c,_0x2648e1,_0x16018b){return ActiveDirectoryAuthenticate(db[_0xd561('0x32')],_0x26722c,_0x2648e1,_0x16018b);}));
\ No newline at end of file
+var _0x7beb=['user','blockDuration','blocked','add','minutes','clearBlockUser','getLicense','catch','message','login','ad-login','signToken','json','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blockedAt','online','admin'];(function(_0x4ca9d2,_0x408f4b){var _0x1232eb=function(_0x3a0122){while(--_0x3a0122){_0x4ca9d2['push'](_0x4ca9d2['shift']());}};_0x1232eb(++_0x408f4b);}(_0x7beb,0xc5));var _0xb7be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7beb[_0x3dd15e];return _0x231fd0;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')[_0xb7be('0x0')];var moment=require(_0xb7be('0x1'));var ActiveDirectory=require(_0xb7be('0x2'));var BPromise=require(_0xb7be('0x3'));var util=require(_0xb7be('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xb7be('0x5'));var utils=require(_0xb7be('0x6'));var config=require(_0xb7be('0x7'));var logger=require(_0xb7be('0x8'))(_0xb7be('0x9'));function isActiveDirectoryConfigured(_0x3983ad){var _0x190537=![];if(typeof _0x3983ad['activedirectory']!==_0xb7be('0xa')){_0x190537=_0x3983ad[_0xb7be('0xb')][_0xb7be('0xc')]&&_0x3983ad[_0xb7be('0xb')][_0xb7be('0xd')]&&_0x3983ad[_0xb7be('0xb')][_0xb7be('0xe')];}return _0x190537;}function adAuthenticate(_0x5c6e5c,_0x7b15b0,_0x79a76f){return new BPromise(function(_0x4bfe1f,_0x3908ec){try{var _0xfbf51d=new ActiveDirectory(_0x5c6e5c);_0xfbf51d[_0xb7be('0xf')](_0x7b15b0,_0x79a76f,function(_0x427e87,_0xf967fe){if(_0x427e87){logger[_0xb7be('0x10')](_0xb7be('0x11'),_0x7b15b0,util[_0xb7be('0x12')](_0x427e87,{'showHidden':![],'depth':null}));_0x3908ec(_0xb7be('0x13'));}else if(!_0xf967fe){logger[_0xb7be('0x10')](_0xb7be('0x14'),_0x7b15b0);_0x3908ec('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4bfe1f(_0xf967fe);}});}catch(_0x163045){_0x3908ec(_0x163045);}});}function ActiveDirectoryAuthenticate(_0x3e2472,_0x56ba65,_0xd47629,_0x11a1b3){var _0x56d0b1,_0x43a1fd;if(!isActiveDirectoryConfigured(config)){logger[_0xb7be('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x56ba65);return _0x11a1b3(null,![],{'message':_0xb7be('0x13')});}return db[_0xb7be('0x15')][_0xb7be('0x16')]({'where':{'id':0x1},'attributes':[_0xb7be('0x17'),'blockDuration'],'raw':!![]})[_0xb7be('0x18')](function(_0x3fa0dc){_0x56d0b1=_0x3fa0dc;if(!_0x56d0b1[_0xb7be('0x17')]){logger[_0xb7be('0x10')](_0xb7be('0x19'),_0x56ba65);throw new Error(_0xb7be('0x13'));}return _0x3e2472[_0xb7be('0x16')]({'attributes':['id',_0xb7be('0x1a'),_0xb7be('0x1b'),_0xb7be('0x1c'),_0xb7be('0x1d'),'disabled','blocked',_0xb7be('0x1e'),_0xb7be('0x1f')],'where':{'name':_0x56ba65,'role':{'$or':[_0xb7be('0x20'),_0xb7be('0x21'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x39d22a){if(!_0x39d22a||_0x39d22a&&_0x39d22a[_0xb7be('0x1a')]!==_0x56ba65){throw new Error(_0xb7be('0x13'));}_0x43a1fd=_0x39d22a;var _0x29d3e0=_0x43a1fd['name']+'@'+config['activedirectory'][_0xb7be('0xe')];return adAuthenticate(config[_0xb7be('0xb')],_0x29d3e0,_0xd47629);})[_0xb7be('0x18')](function(_0x15f288){if(_0x43a1fd['disabled']){throw new Error(_0xb7be('0x13'));}if(_0x56d0b1[_0xb7be('0x22')]>0x0){if(_0x43a1fd[_0xb7be('0x23')]){if(moment(_0x43a1fd[_0xb7be('0x1e')])[_0xb7be('0x24')](_0x56d0b1[_0xb7be('0x22')],_0xb7be('0x25'))>moment()){throw new Error(_0xb7be('0x13'));}return utils[_0xb7be('0x26')](_0x43a1fd,0x0,![],null)[_0xb7be('0x18')](function(){return utils[_0xb7be('0x27')](_0x43a1fd);})[_0xb7be('0x18')](function(){return _0x11a1b3(null,_0x43a1fd);});}else{return utils[_0xb7be('0x27')](_0x43a1fd)['then'](function(){return _0x11a1b3(null,_0x43a1fd);});}}else{return utils[_0xb7be('0x27')](_0x43a1fd)[_0xb7be('0x18')](function(){return _0x11a1b3(null,_0x43a1fd);});}})[_0xb7be('0x28')](function(_0x2a7e91){return _0x11a1b3(null,![],_0x2a7e91);});}function handleError(_0x2bb12f,_0x196df7,_0x6e26e5){return _0x2bb12f['status'](_0x196df7||0x1f4)['send']({'message':_0x6e26e5?_0x6e26e5[_0xb7be('0x29')]||_0x6e26e5:''});}exports[_0xb7be('0x2a')]=function(_0x56aa67,_0x30099f,_0x52bb54){passport['authenticate'](_0xb7be('0x2b'),function(_0x5cef3f,_0x4257ab,_0x32a36a){var _0x4c52d9=_0x5cef3f||_0x32a36a;if(_0x4c52d9){return handleError(_0x30099f,0x191,_0x4c52d9);}if(!_0x4257ab){return handleError(_0x30099f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x28c895={'payload':{'id':_0x4257ab['id'],'role':_0x4257ab[_0xb7be('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0xb7be('0x2c')](_0x28c895)[_0xb7be('0x18')](function(_0xbb43cf){_0x30099f[_0xb7be('0x2d')]({'id':_0x4257ab['id'],'token':_0xbb43cf,'statusCall':'','isAlreadyLogged':_0x4257ab['online']});});}})(_0x56aa67,_0x30099f,_0x52bb54);};passport['use'](_0xb7be('0x2b'),new LocalStrategy({'usernameField':_0xb7be('0x1a'),'passwordField':_0xb7be('0x1b')},function(_0x733749,_0x2a2b05,_0x1c30ea){return ActiveDirectoryAuthenticate(db['User'],_0x733749,_0x2a2b05,_0x1c30ea);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 3796de4..f7f31a1 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 _0x9368=['login','Router','./authActiveDirectory.controller','post'];(function(_0x8895d0,_0xbf13d2){var _0x3cf809=function(_0x38bc46){while(--_0x38bc46){_0x8895d0['push'](_0x8895d0['shift']());}};_0x3cf809(++_0xbf13d2);}(_0x9368,0x99));var _0x8936=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x9368[_0x476bf4];return _0x788ffe;};'use strict';var express=require('express');var router=express[_0x8936('0x0')]();var controller=require(_0x8936('0x1'));router[_0x8936('0x2')]('/',controller[_0x8936('0x3')]);module['exports']=router;
\ No newline at end of file
+var _0xb3d9=['post','exports','Router'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0xb3d9,0x18b));var _0x9b3d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3d9[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var router=express[_0x9b3d('0x0')]();var controller=require('./authActiveDirectory.controller');router[_0x9b3d('0x1')]('/',controller['login']);module[_0x9b3d('0x2')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 01e9433..d8a1025 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x36bb8b,_0x34ff2a){var _0x15aba9=function(_0x166e16){while(--_0x166e16){_0x36bb8b['push'](_0x36bb8b['shift']());}};_0x15aba9(++_0x34ff2a);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ 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(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x7a54,0x106));var _0x47a5=function(_0x1c8301,_0xd9504c){_0x1c8301=_0x1c8301-0x0;var _0x4c4f05=_0x7a54[_0x1c8301];return _0x4c4f05;};'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 6f2a490..994837d 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 _0xb41e=['setTokenCookie','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware'];(function(_0x438efa,_0x5818ba){var _0x989dcb=function(_0x2ca6e7){while(--_0x2ca6e7){_0x438efa['push'](_0x438efa['shift']());}};_0x989dcb(++_0x5818ba);}(_0xb41e,0x1f0));var _0xeb41=function(_0x2acbb3,_0x29e1b4){_0x2acbb3=_0x2acbb3-0x0;var _0x5c0cc7=_0xb41e[_0x2acbb3];return _0x5c0cc7;};'use strict';var express=require(_0xeb41('0x0'));var passport=require('passport');var router=express[_0xeb41('0x1')]();var controller=require(_0xeb41('0x2'));var userController=require(_0xeb41('0x3'));var authService=require(_0xeb41('0x4'));router[_0xeb41('0x5')]('/',controller[_0xeb41('0x6')]);router['get'](_0xeb41('0x7'),controller[_0xeb41('0x8')],authService[_0xeb41('0x9')],userController[_0xeb41('0x6')],authService[_0xeb41('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0x6068=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware','setTokenCookie','exports'];(function(_0x30f6c2,_0x4a187a){var _0x1a7f9d=function(_0x227f87){while(--_0x227f87){_0x30f6c2['push'](_0x30f6c2['shift']());}};_0x1a7f9d(++_0x4a187a);}(_0x6068,0x134));var _0x8606=function(_0x53f608,_0x256def){_0x53f608=_0x53f608-0x0;var _0x495b7d=_0x6068[_0x53f608];return _0x495b7d;};'use strict';var express=require('express');var passport=require(_0x8606('0x0'));var router=express[_0x8606('0x1')]();var controller=require(_0x8606('0x2'));var userController=require(_0x8606('0x3'));var authService=require(_0x8606('0x4'));router[_0x8606('0x5')]('/',controller[_0x8606('0x6')]);router[_0x8606('0x5')](_0x8606('0x7'),controller['callback'],authService[_0x8606('0x8')],userController[_0x8606('0x6')],authService[_0x8606('0x9')]);module[_0x8606('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 4e83f76..a15d3d0 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 _0xbe25=['MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','email','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','validatePasswordHistory','previousPasswords','save','Password\x20reset!','util','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','getLicense','catch','MailAccount','find'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0xbe25,0x79));var _0x5be2=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xbe25[_0x3070dc];return _0x431489;};'use strict';var util=require(_0x5be2('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var jayson=require('jayson/promise');var _=require(_0x5be2('0x1'));var rs=require(_0x5be2('0x2'));var moment=require('moment');var db=require(_0x5be2('0x3'))['db'];var authService=require(_0x5be2('0x4'));var utils=require(_0x5be2('0x5'));var client=jayson[_0x5be2('0x6')][_0x5be2('0x7')]({'port':0x232b});function localAuthenticate(_0x1ea416,_0x4b4a38,_0x497412,_0x4eeb7f){var _0x130171,_0x166558;return db[_0x5be2('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0x5be2('0x9'),_0x5be2('0xa')],'raw':!![]})[_0x5be2('0xb')](function(_0x2cbfeb){_0x130171=_0x2cbfeb;return _0x1ea416[_0x5be2('0xc')]({'attributes':['id',_0x5be2('0xd'),'password',_0x5be2('0xe'),_0x5be2('0xf'),_0x5be2('0x10'),_0x5be2('0x11'),_0x5be2('0x12'),_0x5be2('0x13')],'where':{'name':_0x4b4a38,'role':{'$or':[_0x5be2('0x14'),_0x5be2('0x15'),_0x5be2('0x16')]}}});})['then'](function(_0x3b43a6){if(!_0x3b43a6||_0x3b43a6&&_0x3b43a6[_0x5be2('0xd')]!==_0x4b4a38){throw new Error(_0x5be2('0x17'));}else{_0x166558=_0x3b43a6;return _0x166558;}})[_0x5be2('0xb')](function(){_0x166558[_0x5be2('0x18')](_0x497412,function(_0x34a7ca,_0x2aa90c){var _0x1a5f69=_0x166558[_0x5be2('0x13')]+0x1;if(_0x34a7ca){return _0x4eeb7f(_0x34a7ca);}else if(!_0x2aa90c){if(_0x166558[_0x5be2('0x10')]){return _0x4eeb7f(null,![],{'message':_0x5be2('0x17')});}else if(_0x130171[_0x5be2('0x9')]>0x0){if(_0x166558[_0x5be2('0x11')]){if(_0x130171[_0x5be2('0xa')]>0x0){if(moment(_0x166558[_0x5be2('0x12')])['add'](_0x130171[_0x5be2('0xa')],_0x5be2('0x19'))>moment()){return _0x4eeb7f(null,![],{'message':_0x5be2('0x17')});}else{return utils[_0x5be2('0x1a')](_0x166558,_0x1a5f69,![],null)[_0x5be2('0xb')](function(){return _0x4eeb7f(null,![],{'message':_0x5be2('0x17')});});}}else{return _0x4eeb7f(null,![],{'message':_0x5be2('0x17')});}}else{if(_0x1a5f69>=_0x130171[_0x5be2('0x9')]){return utils[_0x5be2('0x1a')](_0x166558,0x0,!![],moment())[_0x5be2('0xb')](function(){return _0x4eeb7f(null,![],{'message':_0x5be2('0x17')});});}else{return utils[_0x5be2('0x1a')](_0x166558,_0x1a5f69,![],null)[_0x5be2('0xb')](function(){return _0x4eeb7f(null,![],{'message':_0x5be2('0x17')});});}}}else{return _0x4eeb7f(null,![],{'message':_0x5be2('0x17')});}}else{if(_0x166558[_0x5be2('0x10')]){return _0x4eeb7f(null,![],{'message':_0x5be2('0x17')});}else if(_0x130171[_0x5be2('0x9')]>0x0){if(_0x166558[_0x5be2('0x11')]){if(_0x130171[_0x5be2('0xa')]>0x0){if(moment(_0x166558[_0x5be2('0x12')])['add'](_0x130171[_0x5be2('0xa')],_0x5be2('0x19'))>moment()){return _0x4eeb7f(null,![],{'message':_0x5be2('0x17')});}else{return utils[_0x5be2('0x1a')](_0x166558,0x0,![],null)[_0x5be2('0xb')](function(){return utils[_0x5be2('0x1b')](_0x166558);})['then'](function(){return _0x4eeb7f(null,_0x166558);});}}else{return _0x4eeb7f(null,![],{'message':_0x5be2('0x17')});}}else{return utils[_0x5be2('0x1a')](_0x166558,0x0,![],null)[_0x5be2('0xb')](function(){return utils[_0x5be2('0x1b')](_0x166558);})['then'](function(){return _0x4eeb7f(null,_0x166558);})[_0x5be2('0x1c')](function(_0x5da0d1){return _0x4eeb7f(null,![],_0x5da0d1);});}}else{if(_0x166558[_0x5be2('0x11')]){return _0x4eeb7f(null,![],{'message':_0x5be2('0x17')});}else{return utils[_0x5be2('0x1b')](_0x166558)[_0x5be2('0xb')](function(){return _0x4eeb7f(null,_0x166558);});}}}});})[_0x5be2('0x1c')](function(_0x2c9ae9){return _0x4eeb7f(null,![],_0x2c9ae9);});}function sendServiceMail(_0x2ebf6b){return db[_0x5be2('0x1d')][_0x5be2('0x1e')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x5be2('0x1f')],'as':'Smtp','include':[{'model':db[_0x5be2('0x20')],'as':'CloudProvider'}]}]})[_0x5be2('0xb')](function(_0x40ccce){if(!_0x40ccce){throw new Error(_0x5be2('0x21'));}var _0x41b7e0=_0x40ccce[_0x5be2('0x22')]();var _0x23d1ca={'account':_0x41b7e0,'message':_['merge']({'from':util[_0x5be2('0x23')](_0x5be2('0x24'),_0x40ccce[_0x5be2('0xd')],_0x40ccce['email']||_0x40ccce['Smtp'][_0x5be2('0x15')])},_0x2ebf6b)};return client[_0x5be2('0x25')](_0x5be2('0x26'),_0x23d1ca);})['then'](function(_0x695d17){if(_0x695d17[_0x5be2('0x27')]){throw new Error(util[_0x5be2('0x23')](_0x5be2('0x28'),_0x695d17[_0x5be2('0x27')][_0x5be2('0x29')]||JSON[_0x5be2('0x2a')](_0x695d17[_0x5be2('0x27')])));}return!![];});}function handleError(_0x1207b5,_0x1fb51f,_0x26eb7f){return _0x1207b5[_0x5be2('0x2b')](_0x1fb51f||0x1f4)['send']({'message':_0x26eb7f?_0x26eb7f[_0x5be2('0x29')]||_0x26eb7f:''});}exports[_0x5be2('0x2c')]=function(_0x4e5c99,_0x2fa0d9,_0x4a004b){passport[_0x5be2('0x18')](_0x5be2('0x2d'),function(_0x1e483d,_0x121e73,_0x2b0efa){var _0x33c516=_0x1e483d||_0x2b0efa;if(_0x33c516){return handleError(_0x2fa0d9,0x191,_0x33c516);}if(!_0x121e73){return handleError(_0x2fa0d9,0x194,{'message':_0x5be2('0x2e')});}else{var _0x26f870={'payload':{'id':_0x121e73['id'],'role':_0x121e73[_0x5be2('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x5be2('0x2f')](_0x26f870)[_0x5be2('0xb')](function(_0x4c667a){_0x2fa0d9[_0x5be2('0x30')]({'id':_0x121e73['id'],'token':_0x4c667a,'statusCall':'','isAlreadyLogged':_0x121e73[_0x5be2('0x31')]});});}})(_0x4e5c99,_0x2fa0d9,_0x4a004b);};exports['forgot']=function(_0x705605,_0xcf0ca){if(!_0x705605['body'][_0x5be2('0x32')]){return handleError(_0xcf0ca,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x21f7c2=rs[_0x5be2('0x33')]();_0x705605[_0x5be2('0x34')][_0x5be2('0x32')]=_0x705605['body'][_0x5be2('0x32')][_0x5be2('0x35')]()[_0x5be2('0x36')]();var _0x1b314e;return db[_0x5be2('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0x5be2('0x9'),_0x5be2('0xa')],'raw':!![]})[_0x5be2('0xb')](function(_0x3b742e){_0x1b314e=_0x3b742e;return db[_0x5be2('0x37')][_0x5be2('0x1e')]({'where':{'email':_0x705605[_0x5be2('0x34')][_0x5be2('0x32')]}});})[_0x5be2('0xb')](function(_0x388142){if(!_0x388142){throw new Error(_0x5be2('0x38'));}if(_0x388142['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x388142[_0x5be2('0x11')]){if(moment(_0x388142[_0x5be2('0x12')])[_0x5be2('0x39')](_0x1b314e[_0x5be2('0xa')],_0x5be2('0x19'))>moment()){throw new Error(_0x5be2('0x3a'));}else{_0x388142[_0x5be2('0x11')]=![];_0x388142[_0x5be2('0x12')]=null;}}_0x388142[_0x5be2('0x3b')]=_0x21f7c2;_0x388142[_0x5be2('0x3c')]=Date[_0x5be2('0x3d')]()+0x36ee80;return _0x388142['save']();})[_0x5be2('0xb')](function(){return sendServiceMail({'to':_0x705605['body'][_0x5be2('0x32')],'subject':_0x5be2('0x3e'),'text':'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://'+_0x705605['headers']['host']+'/reset/'+_0x21f7c2+'\x0a\x0a'+_0x5be2('0x3f')});})[_0x5be2('0xb')](function(){_0xcf0ca[_0x5be2('0x2b')](0xc8)[_0x5be2('0x40')]({'message':'Reset\x20Email\x20sent!'});})[_0x5be2('0x1c')](function(_0x4d16a1){return handleError(_0xcf0ca,0x1f4,_0x4d16a1);});};exports[_0x5be2('0x41')]=function(_0x5b86d1,_0x3cf6fe){return db[_0x5be2('0x37')]['find']({'where':{'resetPasswordToken':_0x5b86d1[_0x5be2('0x42')]['token'],'resetPasswordExpires':{'$gt':Date[_0x5be2('0x3d')]()}}})[_0x5be2('0xb')](function(_0x109361){if(!_0x109361){throw new Error(_0x5be2('0x43'));}return db['Setting'][_0x5be2('0xc')]({'attributes':['id','securePassword',_0x5be2('0x44'),_0x5be2('0x45')]})[_0x5be2('0xb')](function(_0xd0a180){if(_0xd0a180['securePassword'])authService[_0x5be2('0x46')](_0x5b86d1[_0x5be2('0x34')][_0x5be2('0x47')]);if(!_0xd0a180['enforcePasswordHistory']||!_0x109361['previousPasswords'])return _0x109361;authService[_0x5be2('0x48')](_0x5b86d1[_0x5be2('0x34')][_0x5be2('0x47')],_0x109361[_0x5be2('0x49')],_0xd0a180['passwordHistoryLimit']);return _0x109361;})[_0x5be2('0xb')](function(){_0x109361[_0x5be2('0x47')]=_0x5b86d1[_0x5be2('0x34')]['password'];_0x109361[_0x5be2('0x3b')]=null;_0x109361[_0x5be2('0x3c')]=null;return _0x109361[_0x5be2('0x4a')]();});})[_0x5be2('0xb')](function(){_0x3cf6fe[_0x5be2('0x2b')](0xc8)['send']({'message':_0x5be2('0x4b')});})[_0x5be2('0x1c')](function(_0x14efdf){return handleError(_0x3cf6fe,0x1f4,_0x14efdf);});};passport['use'](_0x5be2('0x2d'),new LocalStrategy({'usernameField':_0x5be2('0xd'),'passwordField':_0x5be2('0x47')},function(_0x504b8b,_0x4e009c,_0x1a97e6){return localAuthenticate(db[_0x5be2('0x37')],_0x504b8b,_0x4e009c,_0x1a97e6);}));
\ No newline at end of file
+var _0x66de=['error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','passport','jayson/promise','lodash','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blocked','blockedAt','admin','agent','authenticate','loginAttempts','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','user','SendMail'];(function(_0x1662a7,_0x38e198){var _0x2dab2a=function(_0x56288c){while(--_0x56288c){_0x1662a7['push'](_0x1662a7['shift']());}};_0x2dab2a(++_0x38e198);}(_0x66de,0x169));var _0xe66d=function(_0x47fb54,_0x28698c){_0x47fb54=_0x47fb54-0x0;var _0x1139a7=_0x66de[_0x47fb54];return _0x1139a7;};'use strict';var util=require('util');var passport=require(_0xe66d('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xe66d('0x1'));var _=require(_0xe66d('0x2'));var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xe66d('0x3'));var utils=require(_0xe66d('0x4'));var client=jayson[_0xe66d('0x5')][_0xe66d('0x6')]({'port':0x232b});function localAuthenticate(_0x44ca83,_0xba4e17,_0x36b23c,_0x24bd1d){var _0x251a27,_0x2719ba;return db['Setting'][_0xe66d('0x7')]({'where':{'id':0x1},'attributes':[_0xe66d('0x8'),_0xe66d('0x9')],'raw':!![]})[_0xe66d('0xa')](function(_0x1f68cf){_0x251a27=_0x1f68cf;return _0x44ca83[_0xe66d('0x7')]({'attributes':['id',_0xe66d('0xb'),_0xe66d('0xc'),_0xe66d('0xd'),_0xe66d('0xe'),'disabled',_0xe66d('0xf'),_0xe66d('0x10'),'loginAttempts'],'where':{'name':_0xba4e17,'role':{'$or':[_0xe66d('0x11'),'user',_0xe66d('0x12')]}}});})['then'](function(_0x460e5b){if(!_0x460e5b||_0x460e5b&&_0x460e5b[_0xe66d('0xb')]!==_0xba4e17){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2719ba=_0x460e5b;return _0x2719ba;}})[_0xe66d('0xa')](function(){_0x2719ba[_0xe66d('0x13')](_0x36b23c,function(_0xc26068,_0x1afe92){var _0x2ac2f0=_0x2719ba[_0xe66d('0x14')]+0x1;if(_0xc26068){return _0x24bd1d(_0xc26068);}else if(!_0x1afe92){if(_0x2719ba[_0xe66d('0x15')]){return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});}else if(_0x251a27[_0xe66d('0x8')]>0x0){if(_0x2719ba[_0xe66d('0xf')]){if(_0x251a27[_0xe66d('0x9')]>0x0){if(moment(_0x2719ba[_0xe66d('0x10')])[_0xe66d('0x17')](_0x251a27[_0xe66d('0x9')],_0xe66d('0x18'))>moment()){return _0x24bd1d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xe66d('0x19')](_0x2719ba,_0x2ac2f0,![],null)[_0xe66d('0xa')](function(){return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});});}}else{return _0x24bd1d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2ac2f0>=_0x251a27[_0xe66d('0x8')]){return utils[_0xe66d('0x19')](_0x2719ba,0x0,!![],moment())[_0xe66d('0xa')](function(){return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});});}else{return utils[_0xe66d('0x19')](_0x2719ba,_0x2ac2f0,![],null)[_0xe66d('0xa')](function(){return _0x24bd1d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});}}else{if(_0x2719ba[_0xe66d('0x15')]){return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});}else if(_0x251a27[_0xe66d('0x8')]>0x0){if(_0x2719ba[_0xe66d('0xf')]){if(_0x251a27[_0xe66d('0x9')]>0x0){if(moment(_0x2719ba['blockedAt'])[_0xe66d('0x17')](_0x251a27['blockDuration'],_0xe66d('0x18'))>moment()){return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});}else{return utils[_0xe66d('0x19')](_0x2719ba,0x0,![],null)[_0xe66d('0xa')](function(){return utils['getLicense'](_0x2719ba);})[_0xe66d('0xa')](function(){return _0x24bd1d(null,_0x2719ba);});}}else{return _0x24bd1d(null,![],{'message':_0xe66d('0x16')});}}else{return utils['clearBlockUser'](_0x2719ba,0x0,![],null)[_0xe66d('0xa')](function(){return utils[_0xe66d('0x1a')](_0x2719ba);})[_0xe66d('0xa')](function(){return _0x24bd1d(null,_0x2719ba);})[_0xe66d('0x1b')](function(_0x291824){return _0x24bd1d(null,![],_0x291824);});}}else{if(_0x2719ba[_0xe66d('0xf')]){return _0x24bd1d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xe66d('0x1a')](_0x2719ba)[_0xe66d('0xa')](function(){return _0x24bd1d(null,_0x2719ba);});}}}});})[_0xe66d('0x1b')](function(_0x1eb2cc){return _0x24bd1d(null,![],_0x1eb2cc);});}function sendServiceMail(_0x5ecc75){return db['MailAccount'][_0xe66d('0x1c')]({'where':{'service':!![]},'attributes':['id',_0xe66d('0xb'),_0xe66d('0x1d')],'include':[{'model':db[_0xe66d('0x1e')],'as':_0xe66d('0x1f'),'include':[{'model':db[_0xe66d('0x20')],'as':_0xe66d('0x20')}]}]})[_0xe66d('0xa')](function(_0xda9181){if(!_0xda9181){throw new Error(_0xe66d('0x21'));}var _0x3b1603=_0xda9181['getSmtpOptions']();var _0x32a84d={'account':_0x3b1603,'message':_[_0xe66d('0x22')]({'from':util[_0xe66d('0x23')](_0xe66d('0x24'),_0xda9181['name'],_0xda9181[_0xe66d('0x1d')]||_0xda9181[_0xe66d('0x1f')][_0xe66d('0x25')])},_0x5ecc75)};return client['request'](_0xe66d('0x26'),_0x32a84d);})['then'](function(_0x53b47a){if(_0x53b47a[_0xe66d('0x27')]){throw new Error(util[_0xe66d('0x23')](_0xe66d('0x28'),_0x53b47a[_0xe66d('0x27')]['message']||JSON['stringify'](_0x53b47a['error'])));}return!![];});}function handleError(_0x2dbfca,_0x1b3223,_0x2e3fd2){return _0x2dbfca[_0xe66d('0x29')](_0x1b3223||0x1f4)[_0xe66d('0x2a')]({'message':_0x2e3fd2?_0x2e3fd2[_0xe66d('0x2b')]||_0x2e3fd2:''});}exports[_0xe66d('0x2c')]=function(_0x4bb9e7,_0x2bafd1,_0xa83e64){passport[_0xe66d('0x13')](_0xe66d('0x2d'),function(_0x5b8712,_0x39e3b7,_0x290329){var _0x2fbfd3=_0x5b8712||_0x290329;if(_0x2fbfd3){return handleError(_0x2bafd1,0x191,_0x2fbfd3);}if(!_0x39e3b7){return handleError(_0x2bafd1,0x194,{'message':_0xe66d('0x2e')});}else{var _0x5efe0e={'payload':{'id':_0x39e3b7['id'],'role':_0x39e3b7[_0xe66d('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xe66d('0x2f')](_0x5efe0e)[_0xe66d('0xa')](function(_0x337f1f){_0x2bafd1[_0xe66d('0x30')]({'id':_0x39e3b7['id'],'token':_0x337f1f,'statusCall':'','isAlreadyLogged':_0x39e3b7[_0xe66d('0x31')]});});}})(_0x4bb9e7,_0x2bafd1,_0xa83e64);};exports[_0xe66d('0x32')]=function(_0x4006b2,_0x6908cf){if(!_0x4006b2['body'][_0xe66d('0x1d')]){return handleError(_0x6908cf,0x1f4,{'message':_0xe66d('0x33')});}var _0x9ad157=rs[_0xe66d('0x34')]();_0x4006b2[_0xe66d('0x35')]['email']=_0x4006b2['body'][_0xe66d('0x1d')]['trim']()[_0xe66d('0x36')]();var _0x2fdc0c;return db[_0xe66d('0x37')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe66d('0x9')],'raw':!![]})[_0xe66d('0xa')](function(_0xe9fb4a){_0x2fdc0c=_0xe9fb4a;return db['User'][_0xe66d('0x1c')]({'where':{'email':_0x4006b2[_0xe66d('0x35')][_0xe66d('0x1d')]}});})[_0xe66d('0xa')](function(_0x54f0b6){if(!_0x54f0b6){throw new Error(_0xe66d('0x38'));}if(_0x54f0b6[_0xe66d('0x15')]){throw new Error(_0xe66d('0x39'));}if(_0x54f0b6[_0xe66d('0xf')]){if(moment(_0x54f0b6[_0xe66d('0x10')])[_0xe66d('0x17')](_0x2fdc0c[_0xe66d('0x9')],_0xe66d('0x18'))>moment()){throw new Error(_0xe66d('0x3a'));}else{_0x54f0b6[_0xe66d('0xf')]=![];_0x54f0b6[_0xe66d('0x10')]=null;}}_0x54f0b6[_0xe66d('0x3b')]=_0x9ad157;_0x54f0b6['resetPasswordExpires']=Date[_0xe66d('0x3c')]()+0x36ee80;return _0x54f0b6[_0xe66d('0x3d')]();})[_0xe66d('0xa')](function(){return sendServiceMail({'to':_0x4006b2[_0xe66d('0x35')][_0xe66d('0x1d')],'subject':_0xe66d('0x3e'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xe66d('0x3f')+_0xe66d('0x40')+_0x4006b2['headers']['host']+_0xe66d('0x41')+_0x9ad157+'\x0a\x0a'+_0xe66d('0x42')});})['then'](function(){_0x6908cf[_0xe66d('0x29')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x2eb4cb){return handleError(_0x6908cf,0x1f4,_0x2eb4cb);});};exports[_0xe66d('0x43')]=function(_0xcfb1e4,_0x17338c){return db[_0xe66d('0x44')][_0xe66d('0x1c')]({'where':{'resetPasswordToken':_0xcfb1e4[_0xe66d('0x45')][_0xe66d('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x478405){if(!_0x478405){throw new Error(_0xe66d('0x47'));}return db[_0xe66d('0x37')][_0xe66d('0x7')]({'attributes':['id',_0xe66d('0x48'),_0xe66d('0x49'),_0xe66d('0x4a')]})[_0xe66d('0xa')](function(_0x11b495){if(_0x11b495[_0xe66d('0x48')])authService['validatePasswordPattern'](_0xcfb1e4[_0xe66d('0x35')][_0xe66d('0xc')]);if(!_0x11b495['enforcePasswordHistory']||!_0x478405[_0xe66d('0x4b')])return _0x478405;authService[_0xe66d('0x4c')](_0xcfb1e4['body'][_0xe66d('0xc')],_0x478405[_0xe66d('0x4b')],_0x11b495[_0xe66d('0x4a')]);return _0x478405;})['then'](function(){_0x478405[_0xe66d('0xc')]=_0xcfb1e4[_0xe66d('0x35')][_0xe66d('0xc')];_0x478405['resetPasswordToken']=null;_0x478405[_0xe66d('0x4d')]=null;return _0x478405[_0xe66d('0x3d')]();});})['then'](function(){_0x17338c['status'](0xc8)['send']({'message':_0xe66d('0x4e')});})[_0xe66d('0x1b')](function(_0x1e8e8a){return handleError(_0x17338c,0x1f4,_0x1e8e8a);});};passport[_0xe66d('0x4f')](_0xe66d('0x2d'),new LocalStrategy({'usernameField':_0xe66d('0xb'),'passwordField':_0xe66d('0xc')},function(_0x272aff,_0x29d6a6,_0x3fc92a){return localAuthenticate(db[_0xe66d('0x44')],_0x272aff,_0x29d6a6,_0x3fc92a);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 1c889ef..e2f8114 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 _0xc52e=['/forgot','/reset/:token','reset','exports','express','Router','post'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc52e,0x146));var _0xec52=function(_0x5d93a4,_0x10fca8){_0x5d93a4=_0x5d93a4-0x0;var _0x17b491=_0xc52e[_0x5d93a4];return _0x17b491;};'use strict';var express=require(_0xec52('0x0'));var router=express[_0xec52('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router[_0xec52('0x2')](_0xec52('0x3'),controller['forgot']);router[_0xec52('0x2')](_0xec52('0x4'),controller[_0xec52('0x5')]);module[_0xec52('0x6')]=router;
\ No newline at end of file
+var _0xe29f=['express','Router','post','login','/forgot','forgot','/reset/:token','exports'];(function(_0x532c00,_0xd68e93){var _0x3ae4ed=function(_0x11ec62){while(--_0x11ec62){_0x532c00['push'](_0x532c00['shift']());}};_0x3ae4ed(++_0xd68e93);}(_0xe29f,0x1e8));var _0xfe29=function(_0x3fa78c,_0x18b0f2){_0x3fa78c=_0x3fa78c-0x0;var _0x4cbcc9=_0xe29f[_0x3fa78c];return _0x4cbcc9;};'use strict';var express=require(_0xfe29('0x0'));var router=express[_0xfe29('0x1')]();var controller=require('./authLocal.controller');router[_0xfe29('0x2')]('/',controller[_0xfe29('0x3')]);router[_0xfe29('0x2')](_0xfe29('0x4'),controller[_0xfe29('0x5')]);router[_0xfe29('0x2')](_0xfe29('0x6'),controller['reset']);module[_0xfe29('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 9f1b9ef..3496d51 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 _0x205e=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x211b3c,_0x183a2e){var _0x5effcb=function(_0x359802){while(--_0x359802){_0x211b3c['push'](_0x211b3c['shift']());}};_0x5effcb(++_0x183a2e);}(_0x205e,0x67));var _0xe205=function(_0x553cb2,_0x2e568){_0x553cb2=_0x553cb2-0x0;var _0x2b115d=_0x205e[_0x553cb2];return _0x2b115d;};'use strict';var Sequelize=require(_0xe205('0x0'));module[_0xe205('0x1')]={'name':{'type':Sequelize[_0xe205('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xe205('0x2')]},'description':{'type':Sequelize[_0xe205('0x2')]},'status':{'type':Sequelize[_0xe205('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe205('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xe099=['BOOLEAN','INTEGER','STRING'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0xe099,0x1b2));var _0x9e09=function(_0x40be47,_0x45b591){_0x40be47=_0x40be47-0x0;var _0x468f9f=_0xe099[_0x40be47];return _0x468f9f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9e09('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x9e09('0x0')]},'description':{'type':Sequelize[_0x9e09('0x0')]},'status':{'type':Sequelize[_0x9e09('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9e09('0x2')],'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 3a12e91..ed5ca2a 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 _0x5b91=['ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','json','apply','reject','save','update','destroy','then','end','name','send','index','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','Automation','includeAll','include','findAll','show','params','find','catch','create','body','addConditions','Condition','ids','getConditions','findOne','order','Action','addActions','omit','getActions','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x1be57b,_0x51c1bb){var _0x4a4360=function(_0x228eff){while(--_0x228eff){_0x1be57b['push'](_0x1be57b['shift']());}};_0x4a4360(++_0x51c1bb);}(_0x5b91,0x99));var _0x15b9=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0x5b91[_0x31c19c];return _0x1a87f7;};'use strict';var emlformat=require(_0x15b9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x15b9('0x1'));var moment=require(_0x15b9('0x2'));var BPromise=require(_0x15b9('0x3'));var Mustache=require(_0x15b9('0x4'));var util=require(_0x15b9('0x5'));var path=require(_0x15b9('0x6'));var sox=require(_0x15b9('0x7'));var csv=require(_0x15b9('0x8'));var ejs=require(_0x15b9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15b9('0xa'));var squel=require(_0x15b9('0xb'));var crypto=require(_0x15b9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x15b9('0xd'));var toCsv=require(_0x15b9('0x8'));var querystring=require('querystring');var Papa=require(_0x15b9('0xe'));var Redis=require('ioredis');var authService=require(_0x15b9('0xf'));var qs=require(_0x15b9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15b9('0x11'));var logger=require(_0x15b9('0x12'))('api');var utils=require(_0x15b9('0x13'));var config=require(_0x15b9('0x14'));var licenseUtil=require(_0x15b9('0x15'));var db=require(_0x15b9('0x16'))['db'];function respondWithStatusCode(_0x4e2d4b,_0x53bb65){_0x53bb65=_0x53bb65||0xcc;return function(_0x429700){if(_0x429700){return _0x4e2d4b[_0x15b9('0x17')](_0x53bb65);}return _0x4e2d4b[_0x15b9('0x18')](_0x53bb65)['end']();};}function respondWithResult(_0x46bb61,_0x27ad78){_0x27ad78=_0x27ad78||0xc8;return function(_0x950df7){if(_0x950df7){return _0x46bb61[_0x15b9('0x18')](_0x27ad78)['json'](_0x950df7);}};}function respondWithFilteredResult(_0x720ac5,_0xab229d){return function(_0x239110){if(_0x239110){var _0x28b702=typeof _0xab229d['offset']===_0x15b9('0x19')&&typeof _0xab229d[_0x15b9('0x1a')]===_0x15b9('0x19');var _0x10bf78=_0x239110['count'];var _0x970abb=_0x28b702?0x0:_0xab229d[_0x15b9('0x1b')];var _0x34085c=_0x28b702?_0x239110[_0x15b9('0x1c')]:_0xab229d['offset']+_0xab229d[_0x15b9('0x1a')];var _0x474c6b;if(_0x34085c>=_0x10bf78){_0x34085c=_0x10bf78;_0x474c6b=0xc8;}else{_0x474c6b=0xce;}_0x720ac5['status'](_0x474c6b);return _0x720ac5['set']('Content-Range',_0x970abb+'-'+_0x34085c+'/'+_0x10bf78)[_0x15b9('0x1d')](_0x239110);}return null;};}function patchUpdates(_0x4422ee){return function(_0x577b42){try{jsonpatch[_0x15b9('0x1e')](_0x577b42,_0x4422ee,!![]);}catch(_0x2fa3ad){return BPromise[_0x15b9('0x1f')](_0x2fa3ad);}return _0x577b42[_0x15b9('0x20')]();};}function saveUpdates(_0x3807a4,_0x4d73a8){return function(_0xf08247){if(_0xf08247){return _0xf08247[_0x15b9('0x21')](_0x3807a4)['then'](function(_0x4d430f){return _0x4d430f;});}return null;};}function removeEntity(_0x541eaa,_0x51becc){return function(_0x7561ff){if(_0x7561ff){return _0x7561ff[_0x15b9('0x22')]()[_0x15b9('0x23')](function(){_0x541eaa['status'](0xcc)[_0x15b9('0x24')]();});}};}function handleEntityNotFound(_0x301320,_0x2dec4b){return function(_0x5928c1){if(!_0x5928c1){_0x301320[_0x15b9('0x17')](0x194);}return _0x5928c1;};}function handleError(_0x26face,_0x459be9){_0x459be9=_0x459be9||0x1f4;return function(_0x1bbf6b){logger['error'](_0x1bbf6b['stack']);if(_0x1bbf6b[_0x15b9('0x25')]){delete _0x1bbf6b[_0x15b9('0x25')];}_0x26face[_0x15b9('0x18')](_0x459be9)[_0x15b9('0x26')](_0x1bbf6b);};}exports[_0x15b9('0x27')]=function(_0x52cb0f,_0x4b0628){var _0x234da5={},_0x3411ee={},_0x5c90e3={'count':0x0,'rows':[]};var _0x3c18f2=_[_0x15b9('0x28')](db['Automation'][_0x15b9('0x29')],function(_0x40d88b){return{'name':_0x40d88b['fieldName'],'type':_0x40d88b[_0x15b9('0x2a')][_0x15b9('0x2b')]};});_0x3411ee[_0x15b9('0x2c')]=_['map'](_0x3c18f2,_0x15b9('0x25'));_0x3411ee['query']=_[_0x15b9('0x2d')](_0x52cb0f['query']);_0x3411ee[_0x15b9('0x2e')]=_[_0x15b9('0x2f')](_0x3411ee['model'],_0x3411ee[_0x15b9('0x30')]);_0x234da5[_0x15b9('0x31')]=_[_0x15b9('0x2f')](_0x3411ee[_0x15b9('0x2c')],qs[_0x15b9('0x32')](_0x52cb0f['query'][_0x15b9('0x32')]));_0x234da5['attributes']=_0x234da5[_0x15b9('0x31')][_0x15b9('0x33')]?_0x234da5['attributes']:_0x3411ee[_0x15b9('0x2c')];if(!_0x52cb0f['query'][_0x15b9('0x34')](_0x15b9('0x35'))){_0x234da5[_0x15b9('0x1a')]=qs['limit'](_0x52cb0f['query']['limit']);_0x234da5['offset']=qs[_0x15b9('0x1b')](_0x52cb0f[_0x15b9('0x30')][_0x15b9('0x1b')]);}_0x234da5['order']=qs[_0x15b9('0x36')](_0x52cb0f[_0x15b9('0x30')][_0x15b9('0x36')]);_0x234da5['where']=qs[_0x15b9('0x2e')](_[_0x15b9('0x37')](_0x52cb0f[_0x15b9('0x30')],_0x3411ee[_0x15b9('0x2e')]),_0x3c18f2);if(_0x52cb0f[_0x15b9('0x30')][_0x15b9('0x38')]){_0x234da5[_0x15b9('0x39')]=_[_0x15b9('0x3a')](_0x234da5[_0x15b9('0x39')],{'$or':_[_0x15b9('0x28')](_0x3c18f2,function(_0xd241c1){if(_0xd241c1[_0x15b9('0x2a')]!==_0x15b9('0x3b')){var _0x1f0bed={};_0x1f0bed[_0xd241c1['name']]={'$like':'%'+_0x52cb0f[_0x15b9('0x30')][_0x15b9('0x38')]+'%'};return _0x1f0bed;}})});}_0x234da5=_[_0x15b9('0x3a')]({},_0x234da5,_0x52cb0f[_0x15b9('0x3c')]);var _0x37ca66={'where':_0x234da5['where']};return db[_0x15b9('0x3d')]['count'](_0x37ca66)['then'](function(_0x4aedd7){_0x5c90e3[_0x15b9('0x1c')]=_0x4aedd7;if(_0x52cb0f[_0x15b9('0x30')][_0x15b9('0x3e')]){_0x234da5[_0x15b9('0x3f')]=[{'all':!![]}];}return db[_0x15b9('0x3d')][_0x15b9('0x40')](_0x234da5);})['then'](function(_0x47f84f){_0x5c90e3['rows']=_0x47f84f;return _0x5c90e3;})['then'](respondWithFilteredResult(_0x4b0628,_0x234da5))['catch'](handleError(_0x4b0628,null));};exports[_0x15b9('0x41')]=function(_0x12a434,_0x635bbb){var _0x668e8a={'raw':![],'where':{'id':_0x12a434[_0x15b9('0x42')]['id']}},_0x40e1e0={};_0x40e1e0[_0x15b9('0x2c')]=_[_0x15b9('0x2d')](db[_0x15b9('0x3d')][_0x15b9('0x29')]);_0x40e1e0['query']=_[_0x15b9('0x2d')](_0x12a434[_0x15b9('0x30')]);_0x40e1e0['filters']=_[_0x15b9('0x2f')](_0x40e1e0[_0x15b9('0x2c')],_0x40e1e0[_0x15b9('0x30')]);_0x668e8a[_0x15b9('0x31')]=_[_0x15b9('0x2f')](_0x40e1e0[_0x15b9('0x2c')],qs[_0x15b9('0x32')](_0x12a434[_0x15b9('0x30')]['fields']));_0x668e8a[_0x15b9('0x31')]=_0x668e8a[_0x15b9('0x31')][_0x15b9('0x33')]?_0x668e8a[_0x15b9('0x31')]:_0x40e1e0[_0x15b9('0x2c')];if(_0x12a434[_0x15b9('0x30')][_0x15b9('0x3e')]){_0x668e8a[_0x15b9('0x3f')]=[{'all':!![]}];}_0x668e8a=_[_0x15b9('0x3a')]({},_0x668e8a,_0x12a434[_0x15b9('0x3c')]);return db[_0x15b9('0x3d')][_0x15b9('0x43')](_0x668e8a)[_0x15b9('0x23')](handleEntityNotFound(_0x635bbb,null))['then'](respondWithResult(_0x635bbb,null))[_0x15b9('0x44')](handleError(_0x635bbb,null));};exports[_0x15b9('0x45')]=function(_0x2ca265,_0x5a271a){return db[_0x15b9('0x3d')][_0x15b9('0x45')](_0x2ca265[_0x15b9('0x46')],{})[_0x15b9('0x23')](respondWithResult(_0x5a271a,0xc9))[_0x15b9('0x44')](handleError(_0x5a271a,null));};exports[_0x15b9('0x21')]=function(_0x1d11c2,_0x56fe0f){if(_0x1d11c2[_0x15b9('0x46')]['id']){delete _0x1d11c2[_0x15b9('0x46')]['id'];}return db[_0x15b9('0x3d')][_0x15b9('0x43')]({'where':{'id':_0x1d11c2[_0x15b9('0x42')]['id']}})['then'](handleEntityNotFound(_0x56fe0f,null))['then'](saveUpdates(_0x1d11c2[_0x15b9('0x46')],null))[_0x15b9('0x23')](respondWithResult(_0x56fe0f,null))[_0x15b9('0x44')](handleError(_0x56fe0f,null));};exports['destroy']=function(_0x689f44,_0x3163a9){return db[_0x15b9('0x3d')]['find']({'where':{'id':_0x689f44['params']['id']}})[_0x15b9('0x23')](handleEntityNotFound(_0x3163a9,null))[_0x15b9('0x23')](removeEntity(_0x3163a9,null))[_0x15b9('0x44')](handleError(_0x3163a9,null));};exports[_0x15b9('0x47')]=function(_0x515dda,_0x59cfdc,_0x2a745e){return db[_0x15b9('0x48')]['find']({'where':{'id':_0x515dda[_0x15b9('0x42')]['id']}})['then'](handleEntityNotFound(_0x59cfdc,null))[_0x15b9('0x23')](function(_0x19b72d){if(_0x19b72d){return _0x19b72d[_0x15b9('0x47')](_0x515dda['body'][_0x15b9('0x49')],_['omit'](_0x515dda[_0x15b9('0x46')],[_0x15b9('0x49'),'id'])||{});}})[_0x15b9('0x23')](respondWithResult(_0x59cfdc,null))[_0x15b9('0x44')](handleError(_0x59cfdc,null));};exports[_0x15b9('0x4a')]=function(_0x58250d,_0x5d1f8d,_0x5a7a53){var _0x429d02={};var _0x3b4464={};var _0x2f3e3f;var _0x2707b7;return db[_0x15b9('0x3d')][_0x15b9('0x4b')]({'where':{'id':_0x58250d['params']['id']}})['then'](handleEntityNotFound(_0x5d1f8d,null))[_0x15b9('0x23')](function(_0x3b95f1){if(_0x3b95f1){_0x2f3e3f=_0x3b95f1;_0x3b4464[_0x15b9('0x2c')]=_['keys'](db[_0x15b9('0x48')]['rawAttributes']);_0x3b4464[_0x15b9('0x30')]=_[_0x15b9('0x2d')](_0x58250d['query']);_0x3b4464[_0x15b9('0x2e')]=_[_0x15b9('0x2f')](_0x3b4464[_0x15b9('0x2c')],_0x3b4464['query']);_0x429d02[_0x15b9('0x31')]=_['intersection'](_0x3b4464[_0x15b9('0x2c')],qs[_0x15b9('0x32')](_0x58250d[_0x15b9('0x30')][_0x15b9('0x32')]));_0x429d02['attributes']=_0x429d02['attributes']['length']?_0x429d02['attributes']:_0x3b4464['model'];_0x429d02[_0x15b9('0x4c')]=qs['sort'](_0x58250d[_0x15b9('0x30')][_0x15b9('0x36')]);_0x429d02[_0x15b9('0x39')]=qs[_0x15b9('0x2e')](_[_0x15b9('0x37')](_0x58250d[_0x15b9('0x30')],_0x3b4464['filters']));if(_0x58250d[_0x15b9('0x30')][_0x15b9('0x38')]){_0x429d02[_0x15b9('0x39')]=_[_0x15b9('0x3a')](_0x429d02['where'],{'$or':_['map'](_0x429d02[_0x15b9('0x31')],function(_0x228987){var _0x165352={};_0x165352[_0x228987]={'$like':'%'+_0x58250d[_0x15b9('0x30')][_0x15b9('0x38')]+'%'};return _0x165352;})});}_0x429d02=_[_0x15b9('0x3a')]({},_0x429d02,_0x58250d[_0x15b9('0x3c')]);return _0x2f3e3f[_0x15b9('0x4a')](_0x429d02);}})[_0x15b9('0x23')](function(_0x8a4b03){if(_0x8a4b03){_0x2707b7=_0x8a4b03[_0x15b9('0x33')];if(!_0x58250d[_0x15b9('0x30')][_0x15b9('0x34')]('nolimit')){_0x429d02[_0x15b9('0x1a')]=qs[_0x15b9('0x1a')](_0x58250d[_0x15b9('0x30')]['limit']);_0x429d02[_0x15b9('0x1b')]=qs[_0x15b9('0x1b')](_0x58250d[_0x15b9('0x30')][_0x15b9('0x1b')]);}return _0x2f3e3f[_0x15b9('0x4a')](_0x429d02);}})[_0x15b9('0x23')](function(_0x38dfeb){if(_0x38dfeb){return _0x38dfeb?{'count':_0x2707b7,'rows':_0x38dfeb}:null;}})[_0x15b9('0x23')](respondWithResult(_0x5d1f8d,null))[_0x15b9('0x44')](handleError(_0x5d1f8d,null));};exports['addActions']=function(_0x5843ba,_0x3e8cfc,_0x3a7b5a){return db[_0x15b9('0x4d')][_0x15b9('0x43')]({'where':{'id':_0x5843ba[_0x15b9('0x42')]['id']}})[_0x15b9('0x23')](handleEntityNotFound(_0x3e8cfc,null))[_0x15b9('0x23')](function(_0x2c89f5){if(_0x2c89f5){return _0x2c89f5[_0x15b9('0x4e')](_0x5843ba[_0x15b9('0x46')]['ids'],_[_0x15b9('0x4f')](_0x5843ba[_0x15b9('0x46')],[_0x15b9('0x49'),'id'])||{});}})[_0x15b9('0x23')](respondWithResult(_0x3e8cfc,null))[_0x15b9('0x44')](handleError(_0x3e8cfc,null));};exports[_0x15b9('0x50')]=function(_0x33fadb,_0x350d42,_0x2033e4){var _0x4a95df={};var _0x124622={};var _0x129872;var _0x247f03;return db[_0x15b9('0x3d')][_0x15b9('0x4b')]({'where':{'id':_0x33fadb[_0x15b9('0x42')]['id']}})[_0x15b9('0x23')](handleEntityNotFound(_0x350d42,null))[_0x15b9('0x23')](function(_0x365e60){if(_0x365e60){_0x129872=_0x365e60;_0x124622[_0x15b9('0x2c')]=_['keys'](db[_0x15b9('0x4d')][_0x15b9('0x29')]);_0x124622[_0x15b9('0x30')]=_[_0x15b9('0x2d')](_0x33fadb[_0x15b9('0x30')]);_0x124622['filters']=_['intersection'](_0x124622[_0x15b9('0x2c')],_0x124622['query']);_0x4a95df[_0x15b9('0x31')]=_[_0x15b9('0x2f')](_0x124622['model'],qs[_0x15b9('0x32')](_0x33fadb['query'][_0x15b9('0x32')]));_0x4a95df[_0x15b9('0x31')]=_0x4a95df[_0x15b9('0x31')][_0x15b9('0x33')]?_0x4a95df['attributes']:_0x124622[_0x15b9('0x2c')];_0x4a95df[_0x15b9('0x4c')]=qs['sort'](_0x33fadb[_0x15b9('0x30')][_0x15b9('0x36')]);_0x4a95df[_0x15b9('0x39')]=qs['filters'](_['pick'](_0x33fadb[_0x15b9('0x30')],_0x124622['filters']));if(_0x33fadb['query'][_0x15b9('0x38')]){_0x4a95df['where']=_[_0x15b9('0x3a')](_0x4a95df[_0x15b9('0x39')],{'$or':_[_0x15b9('0x28')](_0x4a95df[_0x15b9('0x31')],function(_0x59776c){var _0x1ae2b6={};_0x1ae2b6[_0x59776c]={'$like':'%'+_0x33fadb['query'][_0x15b9('0x38')]+'%'};return _0x1ae2b6;})});}_0x4a95df=_[_0x15b9('0x3a')]({},_0x4a95df,_0x33fadb[_0x15b9('0x3c')]);return _0x129872[_0x15b9('0x50')](_0x4a95df);}})[_0x15b9('0x23')](function(_0x17d4ee){if(_0x17d4ee){_0x247f03=_0x17d4ee[_0x15b9('0x33')];if(!_0x33fadb['query'][_0x15b9('0x34')]('nolimit')){_0x4a95df[_0x15b9('0x1a')]=qs[_0x15b9('0x1a')](_0x33fadb['query'][_0x15b9('0x1a')]);_0x4a95df[_0x15b9('0x1b')]=qs[_0x15b9('0x1b')](_0x33fadb['query'][_0x15b9('0x1b')]);}return _0x129872[_0x15b9('0x50')](_0x4a95df);}})[_0x15b9('0x23')](function(_0x43dd23){if(_0x43dd23){return _0x43dd23?{'count':_0x247f03,'rows':_0x43dd23}:null;}})[_0x15b9('0x23')](respondWithResult(_0x350d42,null))[_0x15b9('0x44')](handleError(_0x350d42,null));};
\ No newline at end of file
+var _0x1952=['offset','limit','Content-Range','json','apply','reject','save','then','end','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','attributes','fields','length','model','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','intersection','create','body','update','find','addConditions','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','undefined','count'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x1952,0xdd));var _0x2195=function(_0x18ebd4,_0x318045){_0x18ebd4=_0x18ebd4-0x0;var _0x37960f=_0x1952[_0x18ebd4];return _0x37960f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2195('0x0'));var jsonpatch=require(_0x2195('0x1'));var rp=require(_0x2195('0x2'));var moment=require(_0x2195('0x3'));var BPromise=require(_0x2195('0x4'));var Mustache=require(_0x2195('0x5'));var util=require(_0x2195('0x6'));var path=require(_0x2195('0x7'));var sox=require(_0x2195('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2195('0x9'));var _=require(_0x2195('0xa'));var squel=require(_0x2195('0xb'));var crypto=require(_0x2195('0xc'));var jsforce=require(_0x2195('0xd'));var deskjs=require(_0x2195('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2195('0xf'));var Redis=require(_0x2195('0x10'));var authService=require(_0x2195('0x11'));var qs=require(_0x2195('0x12'));var as=require(_0x2195('0x13'));var hardwareService=require(_0x2195('0x14'));var logger=require(_0x2195('0x15'))(_0x2195('0x16'));var utils=require(_0x2195('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x318fa9,_0x40ccfa){_0x40ccfa=_0x40ccfa||0xcc;return function(_0x34e5ef){if(_0x34e5ef){return _0x318fa9[_0x2195('0x18')](_0x40ccfa);}return _0x318fa9[_0x2195('0x19')](_0x40ccfa)['end']();};}function respondWithResult(_0x5b504e,_0x580204){_0x580204=_0x580204||0xc8;return function(_0x230958){if(_0x230958){return _0x5b504e['status'](_0x580204)['json'](_0x230958);}};}function respondWithFilteredResult(_0x516617,_0x441790){return function(_0x4c1e2b){if(_0x4c1e2b){var _0x105a92=typeof _0x441790['offset']===_0x2195('0x1a')&&typeof _0x441790['limit']===_0x2195('0x1a');var _0x2d3e9b=_0x4c1e2b[_0x2195('0x1b')];var _0x390b36=_0x105a92?0x0:_0x441790[_0x2195('0x1c')];var _0x10a213=_0x105a92?_0x4c1e2b[_0x2195('0x1b')]:_0x441790[_0x2195('0x1c')]+_0x441790[_0x2195('0x1d')];var _0x903a0a;if(_0x10a213>=_0x2d3e9b){_0x10a213=_0x2d3e9b;_0x903a0a=0xc8;}else{_0x903a0a=0xce;}_0x516617[_0x2195('0x19')](_0x903a0a);return _0x516617['set'](_0x2195('0x1e'),_0x390b36+'-'+_0x10a213+'/'+_0x2d3e9b)[_0x2195('0x1f')](_0x4c1e2b);}return null;};}function patchUpdates(_0x52b35e){return function(_0x2477d3){try{jsonpatch[_0x2195('0x20')](_0x2477d3,_0x52b35e,!![]);}catch(_0xe99e90){return BPromise[_0x2195('0x21')](_0xe99e90);}return _0x2477d3[_0x2195('0x22')]();};}function saveUpdates(_0x22e39c,_0x2769fd){return function(_0x31be88){if(_0x31be88){return _0x31be88['update'](_0x22e39c)['then'](function(_0x2b1339){return _0x2b1339;});}return null;};}function removeEntity(_0x468c50,_0x1b86aa){return function(_0x321808){if(_0x321808){return _0x321808['destroy']()[_0x2195('0x23')](function(){_0x468c50[_0x2195('0x19')](0xcc)[_0x2195('0x24')]();});}};}function handleEntityNotFound(_0x626274,_0x59d1b3){return function(_0x668bf6){if(!_0x668bf6){_0x626274[_0x2195('0x18')](0x194);}return _0x668bf6;};}function handleError(_0x577647,_0x5d6701){_0x5d6701=_0x5d6701||0x1f4;return function(_0x2f9b4a){logger[_0x2195('0x25')](_0x2f9b4a[_0x2195('0x26')]);if(_0x2f9b4a['name']){delete _0x2f9b4a[_0x2195('0x27')];}_0x577647['status'](_0x5d6701)[_0x2195('0x28')](_0x2f9b4a);};}exports[_0x2195('0x29')]=function(_0x26c40b,_0x13c0e){var _0x4ec88f={},_0x299493={},_0x4e3ad9={'count':0x0,'rows':[]};var _0x14bad2=_['map'](db[_0x2195('0x2a')][_0x2195('0x2b')],function(_0x598990){return{'name':_0x598990[_0x2195('0x2c')],'type':_0x598990[_0x2195('0x2d')][_0x2195('0x2e')]};});_0x299493['model']=_[_0x2195('0x2f')](_0x14bad2,_0x2195('0x27'));_0x299493[_0x2195('0x30')]=_[_0x2195('0x31')](_0x26c40b[_0x2195('0x30')]);_0x299493[_0x2195('0x32')]=_['intersection'](_0x299493['model'],_0x299493[_0x2195('0x30')]);_0x4ec88f[_0x2195('0x33')]=_['intersection'](_0x299493['model'],qs[_0x2195('0x34')](_0x26c40b[_0x2195('0x30')][_0x2195('0x34')]));_0x4ec88f[_0x2195('0x33')]=_0x4ec88f[_0x2195('0x33')][_0x2195('0x35')]?_0x4ec88f['attributes']:_0x299493[_0x2195('0x36')];if(!_0x26c40b[_0x2195('0x30')]['hasOwnProperty'](_0x2195('0x37'))){_0x4ec88f[_0x2195('0x1d')]=qs[_0x2195('0x1d')](_0x26c40b[_0x2195('0x30')][_0x2195('0x1d')]);_0x4ec88f[_0x2195('0x1c')]=qs['offset'](_0x26c40b[_0x2195('0x30')][_0x2195('0x1c')]);}_0x4ec88f[_0x2195('0x38')]=qs[_0x2195('0x39')](_0x26c40b['query'][_0x2195('0x39')]);_0x4ec88f[_0x2195('0x3a')]=qs['filters'](_[_0x2195('0x3b')](_0x26c40b[_0x2195('0x30')],_0x299493['filters']),_0x14bad2);if(_0x26c40b[_0x2195('0x30')][_0x2195('0x3c')]){_0x4ec88f[_0x2195('0x3a')]=_['merge'](_0x4ec88f['where'],{'$or':_[_0x2195('0x2f')](_0x14bad2,function(_0x505a26){if(_0x505a26[_0x2195('0x2d')]!=='VIRTUAL'){var _0x538707={};_0x538707[_0x505a26[_0x2195('0x27')]]={'$like':'%'+_0x26c40b[_0x2195('0x30')][_0x2195('0x3c')]+'%'};return _0x538707;}})});}_0x4ec88f=_[_0x2195('0x3d')]({},_0x4ec88f,_0x26c40b[_0x2195('0x3e')]);var _0x3faaa5={'where':_0x4ec88f['where']};return db['Automation'][_0x2195('0x1b')](_0x3faaa5)['then'](function(_0x293044){_0x4e3ad9[_0x2195('0x1b')]=_0x293044;if(_0x26c40b[_0x2195('0x30')][_0x2195('0x3f')]){_0x4ec88f[_0x2195('0x40')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x4ec88f);})[_0x2195('0x23')](function(_0x543dc8){_0x4e3ad9[_0x2195('0x41')]=_0x543dc8;return _0x4e3ad9;})[_0x2195('0x23')](respondWithFilteredResult(_0x13c0e,_0x4ec88f))[_0x2195('0x42')](handleError(_0x13c0e,null));};exports[_0x2195('0x43')]=function(_0x5f4566,_0x41c41b){var _0x23a7b5={'raw':![],'where':{'id':_0x5f4566[_0x2195('0x44')]['id']}},_0x3131ca={};_0x3131ca[_0x2195('0x36')]=_['keys'](db[_0x2195('0x2a')][_0x2195('0x2b')]);_0x3131ca[_0x2195('0x30')]=_[_0x2195('0x31')](_0x5f4566[_0x2195('0x30')]);_0x3131ca[_0x2195('0x32')]=_[_0x2195('0x45')](_0x3131ca[_0x2195('0x36')],_0x3131ca['query']);_0x23a7b5[_0x2195('0x33')]=_[_0x2195('0x45')](_0x3131ca[_0x2195('0x36')],qs[_0x2195('0x34')](_0x5f4566['query'][_0x2195('0x34')]));_0x23a7b5[_0x2195('0x33')]=_0x23a7b5['attributes'][_0x2195('0x35')]?_0x23a7b5['attributes']:_0x3131ca['model'];if(_0x5f4566[_0x2195('0x30')][_0x2195('0x3f')]){_0x23a7b5[_0x2195('0x40')]=[{'all':!![]}];}_0x23a7b5=_[_0x2195('0x3d')]({},_0x23a7b5,_0x5f4566[_0x2195('0x3e')]);return db[_0x2195('0x2a')]['find'](_0x23a7b5)[_0x2195('0x23')](handleEntityNotFound(_0x41c41b,null))[_0x2195('0x23')](respondWithResult(_0x41c41b,null))[_0x2195('0x42')](handleError(_0x41c41b,null));};exports[_0x2195('0x46')]=function(_0x4994f3,_0x47fc78){return db[_0x2195('0x2a')][_0x2195('0x46')](_0x4994f3[_0x2195('0x47')],{})[_0x2195('0x23')](respondWithResult(_0x47fc78,0xc9))['catch'](handleError(_0x47fc78,null));};exports[_0x2195('0x48')]=function(_0x312cdc,_0x5cacc0){if(_0x312cdc[_0x2195('0x47')]['id']){delete _0x312cdc[_0x2195('0x47')]['id'];}return db['Automation'][_0x2195('0x49')]({'where':{'id':_0x312cdc[_0x2195('0x44')]['id']}})[_0x2195('0x23')](handleEntityNotFound(_0x5cacc0,null))[_0x2195('0x23')](saveUpdates(_0x312cdc[_0x2195('0x47')],null))[_0x2195('0x23')](respondWithResult(_0x5cacc0,null))[_0x2195('0x42')](handleError(_0x5cacc0,null));};exports['destroy']=function(_0x3d1799,_0x17f0fa){return db[_0x2195('0x2a')][_0x2195('0x49')]({'where':{'id':_0x3d1799['params']['id']}})[_0x2195('0x23')](handleEntityNotFound(_0x17f0fa,null))['then'](removeEntity(_0x17f0fa,null))['catch'](handleError(_0x17f0fa,null));};exports['addConditions']=function(_0x31fc1,_0x413c47,_0x5cea91){return db['Condition'][_0x2195('0x49')]({'where':{'id':_0x31fc1['params']['id']}})[_0x2195('0x23')](handleEntityNotFound(_0x413c47,null))[_0x2195('0x23')](function(_0x17396f){if(_0x17396f){return _0x17396f[_0x2195('0x4a')](_0x31fc1[_0x2195('0x47')][_0x2195('0x4b')],_[_0x2195('0x4c')](_0x31fc1[_0x2195('0x47')],['ids','id'])||{});}})[_0x2195('0x23')](respondWithResult(_0x413c47,null))[_0x2195('0x42')](handleError(_0x413c47,null));};exports[_0x2195('0x4d')]=function(_0x5ebeb6,_0x421cd2,_0xe9eff2){var _0xd3d038={};var _0x2f7445={};var _0xd70647;var _0x4ccc38;return db[_0x2195('0x2a')][_0x2195('0x4e')]({'where':{'id':_0x5ebeb6[_0x2195('0x44')]['id']}})[_0x2195('0x23')](handleEntityNotFound(_0x421cd2,null))[_0x2195('0x23')](function(_0x486aa1){if(_0x486aa1){_0xd70647=_0x486aa1;_0x2f7445[_0x2195('0x36')]=_[_0x2195('0x31')](db['Condition']['rawAttributes']);_0x2f7445[_0x2195('0x30')]=_[_0x2195('0x31')](_0x5ebeb6[_0x2195('0x30')]);_0x2f7445[_0x2195('0x32')]=_[_0x2195('0x45')](_0x2f7445[_0x2195('0x36')],_0x2f7445[_0x2195('0x30')]);_0xd3d038['attributes']=_[_0x2195('0x45')](_0x2f7445[_0x2195('0x36')],qs[_0x2195('0x34')](_0x5ebeb6['query'][_0x2195('0x34')]));_0xd3d038[_0x2195('0x33')]=_0xd3d038['attributes'][_0x2195('0x35')]?_0xd3d038[_0x2195('0x33')]:_0x2f7445['model'];_0xd3d038[_0x2195('0x38')]=qs[_0x2195('0x39')](_0x5ebeb6['query'][_0x2195('0x39')]);_0xd3d038[_0x2195('0x3a')]=qs[_0x2195('0x32')](_['pick'](_0x5ebeb6[_0x2195('0x30')],_0x2f7445[_0x2195('0x32')]));if(_0x5ebeb6[_0x2195('0x30')]['filter']){_0xd3d038[_0x2195('0x3a')]=_['merge'](_0xd3d038[_0x2195('0x3a')],{'$or':_[_0x2195('0x2f')](_0xd3d038[_0x2195('0x33')],function(_0x390b89){var _0x571d4e={};_0x571d4e[_0x390b89]={'$like':'%'+_0x5ebeb6[_0x2195('0x30')][_0x2195('0x3c')]+'%'};return _0x571d4e;})});}_0xd3d038=_[_0x2195('0x3d')]({},_0xd3d038,_0x5ebeb6[_0x2195('0x3e')]);return _0xd70647['getConditions'](_0xd3d038);}})[_0x2195('0x23')](function(_0x36f18e){if(_0x36f18e){_0x4ccc38=_0x36f18e[_0x2195('0x35')];if(!_0x5ebeb6[_0x2195('0x30')][_0x2195('0x4f')](_0x2195('0x37'))){_0xd3d038[_0x2195('0x1d')]=qs[_0x2195('0x1d')](_0x5ebeb6[_0x2195('0x30')][_0x2195('0x1d')]);_0xd3d038[_0x2195('0x1c')]=qs['offset'](_0x5ebeb6[_0x2195('0x30')]['offset']);}return _0xd70647[_0x2195('0x4d')](_0xd3d038);}})[_0x2195('0x23')](function(_0x78e3ad){if(_0x78e3ad){return _0x78e3ad?{'count':_0x4ccc38,'rows':_0x78e3ad}:null;}})[_0x2195('0x23')](respondWithResult(_0x421cd2,null))[_0x2195('0x42')](handleError(_0x421cd2,null));};exports[_0x2195('0x50')]=function(_0x4ae862,_0x474a4e,_0x21bf10){return db[_0x2195('0x51')]['find']({'where':{'id':_0x4ae862[_0x2195('0x44')]['id']}})[_0x2195('0x23')](handleEntityNotFound(_0x474a4e,null))['then'](function(_0x381fdb){if(_0x381fdb){return _0x381fdb[_0x2195('0x50')](_0x4ae862[_0x2195('0x47')][_0x2195('0x4b')],_[_0x2195('0x4c')](_0x4ae862[_0x2195('0x47')],[_0x2195('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x474a4e,null))[_0x2195('0x42')](handleError(_0x474a4e,null));};exports['getActions']=function(_0x4f8188,_0x25e5c0,_0x399706){var _0x4b6894={};var _0x1c2d1d={};var _0x3285d4;var _0x40f32d;return db[_0x2195('0x2a')]['findOne']({'where':{'id':_0x4f8188['params']['id']}})[_0x2195('0x23')](handleEntityNotFound(_0x25e5c0,null))[_0x2195('0x23')](function(_0x436a33){if(_0x436a33){_0x3285d4=_0x436a33;_0x1c2d1d[_0x2195('0x36')]=_[_0x2195('0x31')](db[_0x2195('0x51')][_0x2195('0x2b')]);_0x1c2d1d[_0x2195('0x30')]=_[_0x2195('0x31')](_0x4f8188['query']);_0x1c2d1d[_0x2195('0x32')]=_[_0x2195('0x45')](_0x1c2d1d[_0x2195('0x36')],_0x1c2d1d[_0x2195('0x30')]);_0x4b6894[_0x2195('0x33')]=_['intersection'](_0x1c2d1d[_0x2195('0x36')],qs['fields'](_0x4f8188['query'][_0x2195('0x34')]));_0x4b6894[_0x2195('0x33')]=_0x4b6894[_0x2195('0x33')]['length']?_0x4b6894[_0x2195('0x33')]:_0x1c2d1d[_0x2195('0x36')];_0x4b6894['order']=qs[_0x2195('0x39')](_0x4f8188[_0x2195('0x30')][_0x2195('0x39')]);_0x4b6894[_0x2195('0x3a')]=qs[_0x2195('0x32')](_['pick'](_0x4f8188[_0x2195('0x30')],_0x1c2d1d['filters']));if(_0x4f8188['query'][_0x2195('0x3c')]){_0x4b6894[_0x2195('0x3a')]=_[_0x2195('0x3d')](_0x4b6894['where'],{'$or':_[_0x2195('0x2f')](_0x4b6894[_0x2195('0x33')],function(_0x2fc49b){var _0x566c9b={};_0x566c9b[_0x2fc49b]={'$like':'%'+_0x4f8188[_0x2195('0x30')][_0x2195('0x3c')]+'%'};return _0x566c9b;})});}_0x4b6894=_['merge']({},_0x4b6894,_0x4f8188['options']);return _0x3285d4[_0x2195('0x52')](_0x4b6894);}})['then'](function(_0x4dcee9){if(_0x4dcee9){_0x40f32d=_0x4dcee9[_0x2195('0x35')];if(!_0x4f8188['query'][_0x2195('0x4f')](_0x2195('0x37'))){_0x4b6894[_0x2195('0x1d')]=qs[_0x2195('0x1d')](_0x4f8188['query'][_0x2195('0x1d')]);_0x4b6894[_0x2195('0x1c')]=qs[_0x2195('0x1c')](_0x4f8188[_0x2195('0x30')][_0x2195('0x1c')]);}return _0x3285d4[_0x2195('0x52')](_0x4b6894);}})[_0x2195('0x23')](function(_0x374038){if(_0x374038){return _0x374038?{'count':_0x40f32d,'rows':_0x374038}:null;}})['then'](respondWithResult(_0x25e5c0,null))['catch'](handleError(_0x25e5c0,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 2da1d5d..f282717 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 _0xf658=['api','bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation','util','../../config/logger'];(function(_0x11b2ca,_0x5257ab){var _0x4fbdb9=function(_0x21b3e0){while(--_0x21b3e0){_0x11b2ca['push'](_0x11b2ca['shift']());}};_0x4fbdb9(++_0x5257ab);}(_0xf658,0x1ab));var _0x8f65=function(_0x599d9b,_0x554e8c){_0x599d9b=_0x599d9b-0x0;var _0x1e9721=_0xf658[_0x599d9b];return _0x1e9721;};'use strict';var _=require('lodash');var util=require(_0x8f65('0x0'));var logger=require(_0x8f65('0x1'))(_0x8f65('0x2'));var moment=require('moment');var BPromise=require(_0x8f65('0x3'));var rp=require(_0x8f65('0x4'));var fs=require('fs');var path=require(_0x8f65('0x5'));var rimraf=require(_0x8f65('0x6'));var config=require('../../config/environment');var attributes=require(_0x8f65('0x7'));module[_0x8f65('0x8')]=function(_0x1db80e,_0x5074fa){return _0x1db80e[_0x8f65('0x9')](_0x8f65('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e4e=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash'];(function(_0x5e38f9,_0x5db6c4){var _0x4a914f=function(_0x369d29){while(--_0x369d29){_0x5e38f9['push'](_0x5e38f9['shift']());}};_0x4a914f(++_0x5db6c4);}(_0x0e4e,0x15e));var _0xe0e4=function(_0x1b69aa,_0x5aa147){_0x1b69aa=_0x1b69aa-0x0;var _0x42647d=_0x0e4e[_0x1b69aa];return _0x42647d;};'use strict';var _=require(_0xe0e4('0x0'));var util=require(_0xe0e4('0x1'));var logger=require(_0xe0e4('0x2'))('api');var moment=require(_0xe0e4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe0e4('0x4'));var fs=require('fs');var path=require(_0xe0e4('0x5'));var rimraf=require(_0xe0e4('0x6'));var config=require(_0xe0e4('0x7'));var attributes=require(_0xe0e4('0x8'));module[_0xe0e4('0x9')]=function(_0xcbf2cc,_0x454d2e){return _0xcbf2cc[_0xe0e4('0xa')](_0xe0e4('0xb'),attributes,{'tableName':_0xe0e4('0xc'),'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 9900503..953028a 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 _0x726f=['result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s,\x20%s','error','Automation,\x20%s,\x20%s','message'];(function(_0x391dd5,_0x34ebbc){var _0x4dbd93=function(_0x538b34){while(--_0x538b34){_0x391dd5['push'](_0x391dd5['shift']());}};_0x4dbd93(++_0x34ebbc);}(_0x726f,0xa2));var _0xf726=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x726f[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xf726('0x0'));var util=require(_0xf726('0x1'));var moment=require('moment');var BPromise=require(_0xf726('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf726('0x3'))['db'];var utils=require(_0xf726('0x4'));var logger=require(_0xf726('0x5'))(_0xf726('0x6'));var config=require(_0xf726('0x7'));var jayson=require(_0xf726('0x8'));var client=jayson[_0xf726('0x9')][_0xf726('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dd6b8,_0x2ed93b,_0x43449d){return new BPromise(function(_0x3ec084,_0xe56ebc){return client[_0xf726('0xb')](_0x2dd6b8,_0x43449d)[_0xf726('0xc')](function(_0x45c2a3){logger[_0xf726('0xd')]('Automation,\x20%s,\x20%s',_0x2ed93b,'request\x20sent');logger['debug'](_0xf726('0xe'),_0x2ed93b,'request\x20sent',JSON['stringify'](_0x45c2a3));if(_0x45c2a3[_0xf726('0xf')]){if(_0x45c2a3[_0xf726('0xf')]['code']===0x1f4){logger[_0xf726('0xf')](_0xf726('0x10'),_0x2ed93b,_0x45c2a3[_0xf726('0xf')][_0xf726('0x11')]);return _0xe56ebc(_0x45c2a3[_0xf726('0xf')][_0xf726('0x11')]);}logger[_0xf726('0xf')](_0xf726('0x10'),_0x2ed93b,_0x45c2a3['error'][_0xf726('0x11')]);return _0x3ec084(_0x45c2a3['error']['message']);}else{logger[_0xf726('0xd')](_0xf726('0x10'),_0x2ed93b,'request\x20sent');_0x3ec084(_0x45c2a3[_0xf726('0x12')][_0xf726('0x11')]);}})[_0xf726('0x13')](function(_0x545e84){logger[_0xf726('0xf')](_0xf726('0x10'),_0x2ed93b,_0x545e84);_0xe56ebc(_0x545e84);});});}
\ No newline at end of file
+var _0xf9ac=['info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','then'];(function(_0x5dde65,_0x1eb6f7){var _0x1e9245=function(_0x5ce237){while(--_0x5ce237){_0x5dde65['push'](_0x5dde65['shift']());}};_0x1e9245(++_0x1eb6f7);}(_0xf9ac,0x87));var _0xcf9a=function(_0x4eb5a8,_0x35684b){_0x4eb5a8=_0x4eb5a8-0x0;var _0x29b9fb=_0xf9ac[_0x4eb5a8];return _0x29b9fb;};'use strict';var _=require(_0xcf9a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf9a('0x1'));var rs=require(_0xcf9a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf9a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcf9a('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcf9a('0x5'));var client=jayson[_0xcf9a('0x6')][_0xcf9a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x235e47,_0x54ebf6,_0x33a1a6){return new BPromise(function(_0x3d2f54,_0x4c0665){return client['request'](_0x235e47,_0x33a1a6)[_0xcf9a('0x8')](function(_0x579cf9){logger[_0xcf9a('0x9')]('Automation,\x20%s,\x20%s',_0x54ebf6,_0xcf9a('0xa'));logger['debug'](_0xcf9a('0xb'),_0x54ebf6,_0xcf9a('0xa'),JSON[_0xcf9a('0xc')](_0x579cf9));if(_0x579cf9['error']){if(_0x579cf9['error']['code']===0x1f4){logger[_0xcf9a('0xd')](_0xcf9a('0xe'),_0x54ebf6,_0x579cf9['error'][_0xcf9a('0xf')]);return _0x4c0665(_0x579cf9[_0xcf9a('0xd')][_0xcf9a('0xf')]);}logger['error'](_0xcf9a('0xe'),_0x54ebf6,_0x579cf9['error']['message']);return _0x3d2f54(_0x579cf9['error']['message']);}else{logger[_0xcf9a('0x9')](_0xcf9a('0xe'),_0x54ebf6,_0xcf9a('0xa'));_0x3d2f54(_0x579cf9[_0xcf9a('0x10')][_0xcf9a('0xf')]);}})[_0xcf9a('0x11')](function(_0x25dc10){logger['error'](_0xcf9a('0xe'),_0x54ebf6,_0x25dc10);_0x4c0665(_0x25dc10);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index d531e2f..0cf3021 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 _0x34ab=['exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','getConditions','/:id/actions','getActions','create','post','/:id/conditions','addConditions','put','update','delete'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x34ab,0xf1));var _0xb34a=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0x34ab[_0x44afa4];return _0xcad289;};'use strict';var multer=require(_0xb34a('0x0'));var util=require(_0xb34a('0x1'));var path=require(_0xb34a('0x2'));var timeout=require(_0xb34a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb34a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb34a('0x5'));var config=require(_0xb34a('0x6'));var controller=require(_0xb34a('0x7'));router['get']('/',auth[_0xb34a('0x8')](),controller[_0xb34a('0x9')]);router[_0xb34a('0xa')](_0xb34a('0xb'),auth[_0xb34a('0x8')](),controller[_0xb34a('0xc')]);router[_0xb34a('0xa')]('/:id/conditions',auth[_0xb34a('0x8')](),controller[_0xb34a('0xd')]);router['get'](_0xb34a('0xe'),auth[_0xb34a('0x8')](),controller[_0xb34a('0xf')]);router['post']('/',auth[_0xb34a('0x8')](),controller[_0xb34a('0x10')]);router[_0xb34a('0x11')](_0xb34a('0x12'),auth[_0xb34a('0x8')](),controller[_0xb34a('0x13')]);router[_0xb34a('0x11')](_0xb34a('0xe'),auth[_0xb34a('0x8')](),controller['addActions']);router[_0xb34a('0x14')]('/:id',auth[_0xb34a('0x8')](),controller[_0xb34a('0x15')]);router[_0xb34a('0x16')](_0xb34a('0xb'),auth[_0xb34a('0x8')](),controller['destroy']);module[_0xb34a('0x17')]=router;
\ No newline at end of file
+var _0x28aa=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','put','update','delete','destroy','exports','util','path'];(function(_0x472ae7,_0x525a04){var _0x294c08=function(_0x1dc144){while(--_0x1dc144){_0x472ae7['push'](_0x472ae7['shift']());}};_0x294c08(++_0x525a04);}(_0x28aa,0xf8));var _0xa28a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x28aa[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0xa28a('0x0'));var path=require(_0xa28a('0x1'));var timeout=require(_0xa28a('0x2'));var express=require(_0xa28a('0x3'));var router=express[_0xa28a('0x4')]();var fs_extra=require(_0xa28a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa28a('0x6'));var config=require(_0xa28a('0x7'));var controller=require(_0xa28a('0x8'));router[_0xa28a('0x9')]('/',auth['isAuthenticated'](),controller[_0xa28a('0xa')]);router[_0xa28a('0x9')](_0xa28a('0xb'),auth[_0xa28a('0xc')](),controller[_0xa28a('0xd')]);router[_0xa28a('0x9')](_0xa28a('0xe'),auth[_0xa28a('0xc')](),controller[_0xa28a('0xf')]);router[_0xa28a('0x9')](_0xa28a('0x10'),auth[_0xa28a('0xc')](),controller[_0xa28a('0x11')]);router[_0xa28a('0x12')]('/',auth[_0xa28a('0xc')](),controller['create']);router[_0xa28a('0x12')](_0xa28a('0xe'),auth[_0xa28a('0xc')](),controller[_0xa28a('0x13')]);router['post'](_0xa28a('0x10'),auth[_0xa28a('0xc')](),controller['addActions']);router[_0xa28a('0x14')](_0xa28a('0xb'),auth[_0xa28a('0xc')](),controller[_0xa28a('0x15')]);router[_0xa28a('0x16')](_0xa28a('0xb'),auth[_0xa28a('0xc')](),controller[_0xa28a('0x17')]);module[_0xa28a('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 4a4ea1a..e610e95 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 _0x0b4b=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','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\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x4d4677,_0x24cbb0){var _0x3bd054=function(_0x250deb){while(--_0x250deb){_0x4d4677['push'](_0x4d4677['shift']());}};_0x3bd054(++_0x24cbb0);}(_0x0b4b,0x16a));var _0xb0b4=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x0b4b[_0x363ef8];return _0x148822;};'use strict';var Sequelize=require(_0xb0b4('0x0'));module['exports']={'name':{'type':Sequelize[_0xb0b4('0x1')],'unique':_0xb0b4('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xb0b4('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xb0b4('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb0b4('0x4')},'limitCalls':{'type':Sequelize[_0xb0b4('0x5')](0x4)[_0xb0b4('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb0b4('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb0b4('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb0b4('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xb0b4('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb0b4('0xd')},'dialTimezone':{'type':Sequelize[_0xb0b4('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb0b4('0x1')],'defaultValue':_0xb0b4('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xb0b4('0xf')](_0xb0b4('0x10'),_0xb0b4('0x11'),_0xb0b4('0x12')),'defaultValue':_0xb0b4('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xb0b4('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb0b4('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xb0b4('0x5')](0x9)[_0xb0b4('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb0b4('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb0b4('0x5')](0x9)[_0xb0b4('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb0b4('0x5')](0x9)[_0xb0b4('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb0b4('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb0b4('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb0b4('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb0b4('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb0b4('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb0b4('0xf')](_0xb0b4('0x18'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xb0b4('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb0b4('0x19')},'dialCutDigit':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb0b4('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x1d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x23')}};
\ No newline at end of file
+var _0x8251=['exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8251,0x8f));var _0x1825=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8251[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x1825('0x0'));module[_0x1825('0x1')]={'name':{'type':Sequelize[_0x1825('0x2')],'unique':_0x1825('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1825('0x4')](_0x1825('0x5')),'allowNull':![],'defaultValue':_0x1825('0x5')},'description':{'type':Sequelize[_0x1825('0x2')]},'active':{'type':Sequelize[_0x1825('0x6')],'defaultValue':0x0,'comment':_0x1825('0x7')},'limitCalls':{'type':Sequelize[_0x1825('0x8')](0x4)[_0x1825('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1825('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1825('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1825('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1825('0x8')](0x3)[_0x1825('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1825('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1825('0x8')](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)[_0x1825('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1825('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1825('0x8')](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1825('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1825('0x9')],'defaultValue':0x3,'comment':_0x1825('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1825('0x8')](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x1825('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1825('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1825('0xf'),'never',_0x1825('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x1825('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x1825('0x8')](0x9)[_0x1825('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1825('0x11')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1825('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1825('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1825('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1825('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1825('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x1825('0x8')](0x9)[_0x1825('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1825('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1825('0x8')](0x9)[_0x1825('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1825('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1825('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1825('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1825('0x8')](0x5)[_0x1825('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1825('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1825('0x8')](0x9)[_0x1825('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1825('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1825('0x4')](_0x1825('0x19'),_0x1825('0x1a')),'defaultValue':_0x1825('0x19')},'dialPrefix':{'type':Sequelize[_0x1825('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1825('0x8')](0x3)[_0x1825('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1825('0x1b')},'dialCutDigit':{'type':Sequelize[_0x1825('0x8')](0x3)[_0x1825('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1825('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)[_0x1825('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1825('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1825('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1825('0x1d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1825('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1825('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1825('0x8')](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1825('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1825('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1825('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1825('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1825('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1825('0x23')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 358d58f..0c6c455 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 _0x6623=['hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','catch','params','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','role','UserProfileSection','destroy','getHoppers','findOne','CmHopper','nolimit','CampaignId','findAll','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','ListId','select','field','phone','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','insert','scheduledAt','ContactId','NOW()','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','type','key','model','query','keys','intersection','attributes','fields'];(function(_0x5dbc62,_0x33dc1e){var _0x37f5f8=function(_0xde34d7){while(--_0xde34d7){_0x5dbc62['push'](_0x5dbc62['shift']());}};_0x37f5f8(++_0x33dc1e);}(_0x6623,0x189));var _0x3662=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x6623[_0x20c9b2];return _0x2c6030;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3662('0x0'));var zipdir=require(_0x3662('0x1'));var jsonpatch=require(_0x3662('0x2'));var rp=require(_0x3662('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3662('0x4'));var util=require(_0x3662('0x5'));var path=require(_0x3662('0x6'));var sox=require(_0x3662('0x7'));var csv=require(_0x3662('0x8'));var ejs=require(_0x3662('0x9'));var fs=require('fs');var fs_extra=require(_0x3662('0xa'));var _=require(_0x3662('0xb'));var squel=require(_0x3662('0xc'));var crypto=require('crypto');var jsforce=require(_0x3662('0xd'));var deskjs=require(_0x3662('0xe'));var toCsv=require(_0x3662('0x8'));var querystring=require(_0x3662('0xf'));var Papa=require('papaparse');var Redis=require(_0x3662('0x10'));var authService=require(_0x3662('0x11'));var qs=require(_0x3662('0x12'));var as=require(_0x3662('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3662('0x14'))(_0x3662('0x15'));var utils=require(_0x3662('0x16'));var config=require(_0x3662('0x17'));var licenseUtil=require(_0x3662('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x103af7,_0x1cb650){_0x1cb650=_0x1cb650||0xcc;return function(_0x175741){if(_0x175741){return _0x103af7[_0x3662('0x19')](_0x1cb650);}return _0x103af7[_0x3662('0x1a')](_0x1cb650)[_0x3662('0x1b')]();};}function respondWithResult(_0x37df24,_0x260a2f){_0x260a2f=_0x260a2f||0xc8;return function(_0x371002){if(_0x371002){return _0x37df24[_0x3662('0x1a')](_0x260a2f)[_0x3662('0x1c')](_0x371002);}};}function respondWithFilteredResult(_0x55e908,_0x5ee56e){return function(_0x21cf90){if(_0x21cf90){var _0x550f90=typeof _0x5ee56e[_0x3662('0x1d')]===_0x3662('0x1e')&&typeof _0x5ee56e[_0x3662('0x1f')]==='undefined';var _0x315176=_0x21cf90['count'];var _0x2b5cc1=_0x550f90?0x0:_0x5ee56e['offset'];var _0x276d72=_0x550f90?_0x21cf90[_0x3662('0x20')]:_0x5ee56e[_0x3662('0x1d')]+_0x5ee56e[_0x3662('0x1f')];var _0x117c71;if(_0x276d72>=_0x315176){_0x276d72=_0x315176;_0x117c71=0xc8;}else{_0x117c71=0xce;}_0x55e908[_0x3662('0x1a')](_0x117c71);return _0x55e908['set'](_0x3662('0x21'),_0x2b5cc1+'-'+_0x276d72+'/'+_0x315176)[_0x3662('0x1c')](_0x21cf90);}return null;};}function patchUpdates(_0x43eeb6){return function(_0x4e9daf){try{jsonpatch['apply'](_0x4e9daf,_0x43eeb6,!![]);}catch(_0x162e84){return BPromise[_0x3662('0x22')](_0x162e84);}return _0x4e9daf[_0x3662('0x23')]();};}function saveUpdates(_0x3ff917,_0x51dacc){return function(_0x8c8fe8){if(_0x8c8fe8){return _0x8c8fe8[_0x3662('0x24')](_0x3ff917)[_0x3662('0x25')](function(_0x391f85){return _0x391f85;});}return null;};}function removeEntity(_0x72fa0f,_0x5eb0b4){return function(_0x3a82e8){if(_0x3a82e8){return _0x3a82e8['destroy']()[_0x3662('0x25')](function(){var _0x49084a=_0x3a82e8[_0x3662('0x26')]({'plain':!![]});var _0x441cfc=_0x3662('0x27');return db[_0x3662('0x28')]['destroy']({'where':{'type':_0x441cfc,'resourceId':_0x49084a['id']}})[_0x3662('0x25')](function(){return _0x3a82e8;});})[_0x3662('0x25')](function(){_0x72fa0f[_0x3662('0x1a')](0xcc)[_0x3662('0x1b')]();});}};}function handleEntityNotFound(_0x1e690e,_0x37e6d0){return function(_0x866d1e){if(!_0x866d1e){_0x1e690e[_0x3662('0x19')](0x194);}return _0x866d1e;};}function handleError(_0x987f40,_0xd31735){_0xd31735=_0xd31735||0x1f4;return function(_0x5ed766){logger[_0x3662('0x29')](_0x5ed766[_0x3662('0x2a')]);if(_0x5ed766['name']){delete _0x5ed766[_0x3662('0x2b')];}_0x987f40['status'](_0xd31735)[_0x3662('0x2c')](_0x5ed766);};}exports[_0x3662('0x2d')]=function(_0x4e7715,_0x2b6e35){var _0x4b91aa={},_0x3c7fc7={},_0x2eaddb={'count':0x0,'rows':[]};var _0x1f955a=_[_0x3662('0x2e')](db[_0x3662('0x2f')][_0x3662('0x30')],function(_0x1ae64b){return{'name':_0x1ae64b['fieldName'],'type':_0x1ae64b[_0x3662('0x31')][_0x3662('0x32')]};});_0x3c7fc7[_0x3662('0x33')]=_[_0x3662('0x2e')](_0x1f955a,'name');_0x3c7fc7[_0x3662('0x34')]=_[_0x3662('0x35')](_0x4e7715['query']);_0x3c7fc7['filters']=_[_0x3662('0x36')](_0x3c7fc7[_0x3662('0x33')],_0x3c7fc7[_0x3662('0x34')]);_0x4b91aa[_0x3662('0x37')]=_['intersection'](_0x3c7fc7[_0x3662('0x33')],qs[_0x3662('0x38')](_0x4e7715[_0x3662('0x34')]['fields']));_0x4b91aa['attributes']=_0x4b91aa['attributes']['length']?_0x4b91aa['attributes']:_0x3c7fc7[_0x3662('0x33')];if(!_0x4e7715['query'][_0x3662('0x39')]('nolimit')){_0x4b91aa[_0x3662('0x1f')]=qs[_0x3662('0x1f')](_0x4e7715[_0x3662('0x34')][_0x3662('0x1f')]);_0x4b91aa[_0x3662('0x1d')]=qs[_0x3662('0x1d')](_0x4e7715[_0x3662('0x34')][_0x3662('0x1d')]);}_0x4b91aa[_0x3662('0x3a')]=qs[_0x3662('0x3b')](_0x4e7715[_0x3662('0x34')]['sort']);_0x4b91aa[_0x3662('0x3c')]=qs['filters'](_[_0x3662('0x3d')](_0x4e7715[_0x3662('0x34')],_0x3c7fc7[_0x3662('0x3e')]),_0x1f955a);if(_0x4e7715[_0x3662('0x34')][_0x3662('0x3f')]){_0x4b91aa[_0x3662('0x3c')]=_[_0x3662('0x40')](_0x4b91aa['where'],{'$or':_[_0x3662('0x2e')](_0x1f955a,function(_0x35601a){if(_0x35601a[_0x3662('0x31')]!==_0x3662('0x41')){var _0x2a1656={};_0x2a1656[_0x35601a[_0x3662('0x2b')]]={'$like':'%'+_0x4e7715[_0x3662('0x34')][_0x3662('0x3f')]+'%'};return _0x2a1656;}})});}_0x4b91aa=_[_0x3662('0x40')]({},_0x4b91aa,_0x4e7715[_0x3662('0x42')]);var _0x3448c8={'where':_0x4b91aa[_0x3662('0x3c')]};return db[_0x3662('0x2f')][_0x3662('0x20')](_0x3448c8)['then'](function(_0x525cd1){_0x2eaddb[_0x3662('0x20')]=_0x525cd1;if(_0x4e7715[_0x3662('0x34')]['includeAll']){_0x4b91aa[_0x3662('0x43')]=[{'all':!![]}];}return db[_0x3662('0x2f')]['findAll'](_0x4b91aa);})[_0x3662('0x25')](function(_0x3acfeb){_0x2eaddb['rows']=_0x3acfeb;return _0x2eaddb;})[_0x3662('0x25')](respondWithFilteredResult(_0x2b6e35,_0x4b91aa))[_0x3662('0x44')](handleError(_0x2b6e35,null));};exports['show']=function(_0x17cf2a,_0x3cfa42){var _0x4b7a16={'raw':![],'where':{'id':_0x17cf2a[_0x3662('0x45')]['id']}},_0x222b4c={};_0x222b4c['model']=_[_0x3662('0x35')](db['Campaign'][_0x3662('0x30')]);_0x222b4c[_0x3662('0x34')]=_[_0x3662('0x35')](_0x17cf2a[_0x3662('0x34')]);_0x222b4c[_0x3662('0x3e')]=_[_0x3662('0x36')](_0x222b4c[_0x3662('0x33')],_0x222b4c[_0x3662('0x34')]);_0x4b7a16[_0x3662('0x37')]=_['intersection'](_0x222b4c['model'],qs[_0x3662('0x38')](_0x17cf2a[_0x3662('0x34')][_0x3662('0x38')]));_0x4b7a16[_0x3662('0x37')]=_0x4b7a16[_0x3662('0x37')]['length']?_0x4b7a16[_0x3662('0x37')]:_0x222b4c[_0x3662('0x33')];if(_0x17cf2a['query'][_0x3662('0x46')]){_0x4b7a16[_0x3662('0x43')]=[{'all':!![]}];}_0x4b7a16=_[_0x3662('0x40')]({},_0x4b7a16,_0x17cf2a['options']);return db['Campaign'][_0x3662('0x47')](_0x4b7a16)['then'](handleEntityNotFound(_0x3cfa42,null))['then'](respondWithResult(_0x3cfa42,null))[_0x3662('0x44')](handleError(_0x3cfa42,null));};exports['create']=function(_0xd2691,_0x515355){return db[_0x3662('0x2f')]['create'](_0xd2691[_0x3662('0x48')],{})[_0x3662('0x25')](function(_0x2b70ec){var _0x3352ae=_0xd2691[_0x3662('0x49')][_0x3662('0x26')]({'plain':!![]});if(!_0x3352ae)throw new Error(_0x3662('0x4a'));if(_0x3352ae['role']==='user'){var _0x7bada1=_0x2b70ec[_0x3662('0x26')]({'plain':!![]});var _0x4202cc='IvrCampaigns';return db['UserProfileSection'][_0x3662('0x47')]({'where':{'name':_0x4202cc,'userProfileId':_0x3352ae[_0x3662('0x4b')]},'raw':!![]})[_0x3662('0x25')](function(_0x2760a8){if(_0x2760a8&&_0x2760a8[_0x3662('0x4c')]===0x0){return db[_0x3662('0x28')][_0x3662('0x4d')]({'name':_0x7bada1['name'],'resourceId':_0x7bada1['id'],'type':_0x2760a8[_0x3662('0x2b')],'sectionId':_0x2760a8['id']},{})[_0x3662('0x25')](function(){return _0x2b70ec;});}else{return _0x2b70ec;}})['catch'](function(_0x139de3){logger['error'](_0x3662('0x4e'),_0x139de3);throw _0x139de3;});}return _0x2b70ec;})[_0x3662('0x25')](respondWithResult(_0x515355,0xc9))['catch'](handleError(_0x515355,null));};exports[_0x3662('0x4f')]=function(_0x5a13b2,_0x4722ae){var _0x515350={'where':{'id':_0x5a13b2['params']['id']}},_0x1ea570={};_0x1ea570[_0x3662('0x33')]=_['keys'](db[_0x3662('0x2f')][_0x3662('0x30')]);_0x515350['attributes']=_['intersection'](_0x1ea570[_0x3662('0x33')],qs[_0x3662('0x38')](_0x5a13b2['query'][_0x3662('0x38')]));_0x515350[_0x3662('0x37')]=_0x515350[_0x3662('0x37')][_0x3662('0x50')]?_0x515350[_0x3662('0x37')]:_0x1ea570[_0x3662('0x33')];if(_0x5a13b2[_0x3662('0x34')]['includeAll']){_0x515350[_0x3662('0x43')]=[{'all':!![]}];}_0x515350=_[_0x3662('0x40')]({},_0x515350,_0x5a13b2['options']);return db[_0x3662('0x2f')][_0x3662('0x47')](_0x515350)[_0x3662('0x25')](handleEntityNotFound(_0x4722ae,null))[_0x3662('0x25')](function(_0x56f076){if(_0x56f076){var _0x3a60ee=_0x56f076[_0x3662('0x26')]({'plain':!![]});_0x3a60ee=qs[_0x3662('0x51')](_0x3a60ee,['id',_0x3662('0x52'),_0x3662('0x53')]);_0x5a13b2[_0x3662('0x48')]=_['omit'](_0x5a13b2['body'],['id','createdAt',_0x3662('0x53')]);return db[_0x3662('0x2f')]['create'](_[_0x3662('0x40')](_0x3a60ee,_0x5a13b2[_0x3662('0x48')]),{'include':_0x5a13b2[_0x3662('0x34')][_0x3662('0x46')]?[{'all':!![]}]:undefined})[_0x3662('0x25')](function(_0x566c3a){var _0x57a89e=_0x5a13b2['user']['get']({'plain':!![]});if(!_0x57a89e)throw new Error(_0x3662('0x4a'));if(_0x57a89e[_0x3662('0x54')]===_0x3662('0x49')){var _0x41c30a=_0x566c3a[_0x3662('0x26')]({'plain':!![]});var _0xce3f05=_0x3662('0x27');return db[_0x3662('0x55')][_0x3662('0x47')]({'where':{'name':_0xce3f05,'userProfileId':_0x57a89e[_0x3662('0x4b')]},'raw':!![]})[_0x3662('0x25')](function(_0xdff2cb){if(_0xdff2cb&&_0xdff2cb[_0x3662('0x4c')]===0x0){return db[_0x3662('0x28')][_0x3662('0x4d')]({'name':_0x41c30a[_0x3662('0x2b')],'resourceId':_0x41c30a['id'],'type':_0xdff2cb[_0x3662('0x2b')],'sectionId':_0xdff2cb['id']},{})[_0x3662('0x25')](function(){return _0x566c3a;});}else{return _0x566c3a;}})['catch'](function(_0xe1abe3){logger[_0x3662('0x29')](_0x3662('0x4e'),_0xe1abe3);throw _0xe1abe3;});}return _0x566c3a;});}})[_0x3662('0x25')](respondWithResult(_0x4722ae,0xc9))['catch'](handleError(_0x4722ae,null));};exports[_0x3662('0x24')]=function(_0x551c0a,_0x2472b3){if(_0x551c0a[_0x3662('0x48')]['id']){delete _0x551c0a[_0x3662('0x48')]['id'];}return db[_0x3662('0x2f')][_0x3662('0x47')]({'where':{'id':_0x551c0a[_0x3662('0x45')]['id']}})[_0x3662('0x25')](handleEntityNotFound(_0x2472b3,null))[_0x3662('0x25')](saveUpdates(_0x551c0a[_0x3662('0x48')],null))[_0x3662('0x25')](respondWithResult(_0x2472b3,null))[_0x3662('0x44')](handleError(_0x2472b3,null));};exports[_0x3662('0x56')]=function(_0x2e0006,_0x523f9d){return db[_0x3662('0x2f')][_0x3662('0x47')]({'where':{'id':_0x2e0006[_0x3662('0x45')]['id']}})[_0x3662('0x25')](handleEntityNotFound(_0x523f9d,null))[_0x3662('0x25')](removeEntity(_0x523f9d,null))['catch'](handleError(_0x523f9d,null));};exports[_0x3662('0x57')]=function(_0x1e0dcb,_0x5895e6,_0x3feb18){var _0x529842={'raw':!![],'where':{}};var _0x2ee32c={};var _0x10f080={'count':0x0,'rows':[]};return db[_0x3662('0x2f')][_0x3662('0x58')]({'where':{'id':_0x1e0dcb[_0x3662('0x45')]['id']}})['then'](handleEntityNotFound(_0x5895e6,null))[_0x3662('0x25')](function(_0x3101b5){if(_0x3101b5){_0x2ee32c[_0x3662('0x33')]=_['keys'](db[_0x3662('0x59')]['rawAttributes']);_0x2ee32c[_0x3662('0x34')]=_[_0x3662('0x35')](_0x1e0dcb['query']);_0x2ee32c[_0x3662('0x3e')]=_[_0x3662('0x36')](_0x2ee32c[_0x3662('0x33')],_0x2ee32c[_0x3662('0x34')]);_0x529842[_0x3662('0x37')]=_['intersection'](_0x2ee32c[_0x3662('0x33')],qs[_0x3662('0x38')](_0x1e0dcb[_0x3662('0x34')][_0x3662('0x38')]));_0x529842[_0x3662('0x37')]=_0x529842[_0x3662('0x37')][_0x3662('0x50')]?_0x529842[_0x3662('0x37')]:_0x2ee32c[_0x3662('0x33')];if(!_0x1e0dcb['query']['hasOwnProperty'](_0x3662('0x5a'))){_0x529842[_0x3662('0x1f')]=qs[_0x3662('0x1f')](_0x1e0dcb['query'][_0x3662('0x1f')]);_0x529842[_0x3662('0x1d')]=qs[_0x3662('0x1d')](_0x1e0dcb[_0x3662('0x34')][_0x3662('0x1d')]);}_0x529842[_0x3662('0x3a')]=qs['sort'](_0x1e0dcb[_0x3662('0x34')][_0x3662('0x3b')]);_0x529842[_0x3662('0x3c')]=qs[_0x3662('0x3e')](_[_0x3662('0x3d')](_0x1e0dcb[_0x3662('0x34')],_0x2ee32c['filters']));_0x529842['where'][_0x3662('0x5b')]=_0x3101b5['id'];if(_0x1e0dcb[_0x3662('0x34')]['filter']){_0x529842['where']=_[_0x3662('0x40')](_0x529842[_0x3662('0x3c')],{'$or':_[_0x3662('0x2e')](_0x529842['attributes'],function(_0x368c23){var _0x1e4582={};_0x1e4582[_0x368c23]={'$like':'%'+_0x1e0dcb['query'][_0x3662('0x3f')]+'%'};return _0x1e4582;})});}_0x529842=_[_0x3662('0x40')]({},_0x529842,_0x1e0dcb[_0x3662('0x42')]);return db[_0x3662('0x59')][_0x3662('0x20')]({'where':_0x529842[_0x3662('0x3c')]})[_0x3662('0x25')](function(_0x3fb3fe){_0x10f080[_0x3662('0x20')]=_0x3fb3fe;if(_0x1e0dcb[_0x3662('0x34')]['includeAll']){_0x529842[_0x3662('0x43')]=[{'all':!![]}];}return db[_0x3662('0x59')][_0x3662('0x5c')](_0x529842);})[_0x3662('0x25')](function(_0x508a2f){_0x10f080[_0x3662('0x5d')]=_0x508a2f;return _0x10f080;});}})['then'](respondWithFilteredResult(_0x5895e6,_0x529842))[_0x3662('0x44')](handleError(_0x5895e6,null));};exports[_0x3662('0x5e')]=function(_0x1bf6bd,_0x58bb88,_0x5a902f){var _0x2c5e27={'raw':!![],'where':{}};var _0x3e7d6a={};var _0x21a2e5={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x1bf6bd[_0x3662('0x45')]['id']}})[_0x3662('0x25')](handleEntityNotFound(_0x58bb88,null))['then'](function(_0x4b1108){if(_0x4b1108){_0x3e7d6a[_0x3662('0x33')]=_[_0x3662('0x35')](db[_0x3662('0x5f')][_0x3662('0x30')]);_0x3e7d6a[_0x3662('0x34')]=_[_0x3662('0x35')](_0x1bf6bd['query']);_0x3e7d6a[_0x3662('0x3e')]=_[_0x3662('0x36')](_0x3e7d6a['model'],_0x3e7d6a[_0x3662('0x34')]);_0x2c5e27[_0x3662('0x37')]=_[_0x3662('0x36')](_0x3e7d6a[_0x3662('0x33')],qs['fields'](_0x1bf6bd['query'][_0x3662('0x38')]));_0x2c5e27[_0x3662('0x37')]=_0x2c5e27[_0x3662('0x37')][_0x3662('0x50')]?_0x2c5e27[_0x3662('0x37')]:_0x3e7d6a[_0x3662('0x33')];if(!_0x1bf6bd['query'][_0x3662('0x39')](_0x3662('0x5a'))){_0x2c5e27[_0x3662('0x1f')]=qs[_0x3662('0x1f')](_0x1bf6bd[_0x3662('0x34')][_0x3662('0x1f')]);_0x2c5e27[_0x3662('0x1d')]=qs[_0x3662('0x1d')](_0x1bf6bd[_0x3662('0x34')][_0x3662('0x1d')]);}_0x2c5e27[_0x3662('0x3a')]=qs[_0x3662('0x3b')](_0x1bf6bd[_0x3662('0x34')][_0x3662('0x3b')]);_0x2c5e27['where']=qs['filters'](_[_0x3662('0x3d')](_0x1bf6bd['query'],_0x3e7d6a[_0x3662('0x3e')]));_0x2c5e27[_0x3662('0x3c')][_0x3662('0x5b')]=_0x4b1108['id'];if(_0x1bf6bd[_0x3662('0x34')][_0x3662('0x3f')]){_0x2c5e27[_0x3662('0x3c')]=_[_0x3662('0x40')](_0x2c5e27[_0x3662('0x3c')],{'$or':_[_0x3662('0x2e')](_0x2c5e27[_0x3662('0x37')],function(_0x325d04){var _0x13054c={};_0x13054c[_0x325d04]={'$like':'%'+_0x1bf6bd[_0x3662('0x34')][_0x3662('0x3f')]+'%'};return _0x13054c;})});}_0x2c5e27=_[_0x3662('0x40')]({},_0x2c5e27,_0x1bf6bd[_0x3662('0x42')]);return db[_0x3662('0x5f')]['count']({'where':_0x2c5e27[_0x3662('0x3c')]})[_0x3662('0x25')](function(_0x1c50a5){_0x21a2e5[_0x3662('0x20')]=_0x1c50a5;if(_0x1bf6bd[_0x3662('0x34')][_0x3662('0x46')]){_0x2c5e27[_0x3662('0x43')]=[{'all':!![]}];}return db[_0x3662('0x5f')]['findAll'](_0x2c5e27);})[_0x3662('0x25')](function(_0x1131f4){_0x21a2e5[_0x3662('0x5d')]=_0x1131f4;return _0x21a2e5;});}})['then'](respondWithFilteredResult(_0x58bb88,_0x2c5e27))[_0x3662('0x44')](handleError(_0x58bb88,null));};exports['getHopperFinals']=function(_0x29b418,_0x94aea3,_0xa98143){var _0x3bf90d={'raw':!![],'where':{}};var _0x3b5ed4={};var _0x5c1479={'count':0x0,'rows':[]};return db['Campaign'][_0x3662('0x58')]({'where':{'id':_0x29b418['params']['id']}})[_0x3662('0x25')](handleEntityNotFound(_0x94aea3,null))['then'](function(_0x1b32e0){if(_0x1b32e0){_0x3b5ed4[_0x3662('0x33')]=_[_0x3662('0x35')](db[_0x3662('0x60')][_0x3662('0x30')]);_0x3b5ed4[_0x3662('0x34')]=_[_0x3662('0x35')](_0x29b418[_0x3662('0x34')]);_0x3b5ed4[_0x3662('0x3e')]=_[_0x3662('0x36')](_0x3b5ed4[_0x3662('0x33')],_0x3b5ed4[_0x3662('0x34')]);_0x3bf90d[_0x3662('0x37')]=_[_0x3662('0x36')](_0x3b5ed4[_0x3662('0x33')],qs[_0x3662('0x38')](_0x29b418[_0x3662('0x34')]['fields']));_0x3bf90d[_0x3662('0x37')]=_0x3bf90d[_0x3662('0x37')]['length']?_0x3bf90d[_0x3662('0x37')]:_0x3b5ed4[_0x3662('0x33')];if(!_0x29b418[_0x3662('0x34')][_0x3662('0x39')]('nolimit')){_0x3bf90d[_0x3662('0x1f')]=qs[_0x3662('0x1f')](_0x29b418[_0x3662('0x34')][_0x3662('0x1f')]);_0x3bf90d[_0x3662('0x1d')]=qs[_0x3662('0x1d')](_0x29b418[_0x3662('0x34')][_0x3662('0x1d')]);}_0x3bf90d[_0x3662('0x3a')]=qs[_0x3662('0x3b')](_0x29b418[_0x3662('0x34')][_0x3662('0x3b')]);_0x3bf90d['where']=qs[_0x3662('0x3e')](_[_0x3662('0x3d')](_0x29b418['query'],_0x3b5ed4[_0x3662('0x3e')]));_0x3bf90d[_0x3662('0x3c')]['CampaignId']=_0x1b32e0['id'];if(_0x29b418['query'][_0x3662('0x3f')]){_0x3bf90d[_0x3662('0x3c')]=_[_0x3662('0x40')](_0x3bf90d[_0x3662('0x3c')],{'$or':_[_0x3662('0x2e')](_0x3bf90d[_0x3662('0x37')],function(_0x3d7b5a){var _0x4c76a0={};_0x4c76a0[_0x3d7b5a]={'$like':'%'+_0x29b418[_0x3662('0x34')][_0x3662('0x3f')]+'%'};return _0x4c76a0;})});}_0x3bf90d=_[_0x3662('0x40')]({},_0x3bf90d,_0x29b418[_0x3662('0x42')]);return db[_0x3662('0x60')][_0x3662('0x20')]({'where':_0x3bf90d['where']})[_0x3662('0x25')](function(_0x2708db){_0x5c1479[_0x3662('0x20')]=_0x2708db;if(_0x29b418[_0x3662('0x34')]['includeAll']){_0x3bf90d[_0x3662('0x43')]=[{'all':!![]}];}return db[_0x3662('0x60')][_0x3662('0x5c')](_0x3bf90d);})[_0x3662('0x25')](function(_0x2174d6){_0x5c1479['rows']=_0x2174d6;return _0x5c1479;});}})['then'](respondWithFilteredResult(_0x94aea3,_0x3bf90d))[_0x3662('0x44')](handleError(_0x94aea3,null));};exports[_0x3662('0x61')]=function(_0x302c74,_0x1556fb,_0x2ffc11){var _0x4aac66={'raw':!![],'where':{}};var _0xd2e92c={};var _0x1ac8c3={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x302c74[_0x3662('0x45')]['id']}})[_0x3662('0x25')](handleEntityNotFound(_0x1556fb,null))[_0x3662('0x25')](function(_0x25cf5b){if(_0x25cf5b){_0xd2e92c[_0x3662('0x33')]=_[_0x3662('0x35')](db[_0x3662('0x62')][_0x3662('0x30')]);_0xd2e92c['query']=_['keys'](_0x302c74[_0x3662('0x34')]);_0xd2e92c['filters']=_[_0x3662('0x36')](_0xd2e92c[_0x3662('0x33')],_0xd2e92c['query']);_0x4aac66[_0x3662('0x37')]=_[_0x3662('0x36')](_0xd2e92c['model'],qs[_0x3662('0x38')](_0x302c74[_0x3662('0x34')]['fields']));_0x4aac66[_0x3662('0x37')]=_0x4aac66[_0x3662('0x37')][_0x3662('0x50')]?_0x4aac66[_0x3662('0x37')]:_0xd2e92c[_0x3662('0x33')];if(!_0x302c74[_0x3662('0x34')]['hasOwnProperty'](_0x3662('0x5a'))){_0x4aac66[_0x3662('0x1f')]=qs[_0x3662('0x1f')](_0x302c74[_0x3662('0x34')][_0x3662('0x1f')]);_0x4aac66[_0x3662('0x1d')]=qs['offset'](_0x302c74['query'][_0x3662('0x1d')]);}_0x4aac66[_0x3662('0x3a')]=qs['sort'](_0x302c74[_0x3662('0x34')][_0x3662('0x3b')]);_0x4aac66[_0x3662('0x3c')]=qs['filters'](_[_0x3662('0x3d')](_0x302c74[_0x3662('0x34')],_0xd2e92c[_0x3662('0x3e')]));_0x4aac66['where'][_0x3662('0x5b')]=_0x25cf5b['id'];if(_0x302c74[_0x3662('0x34')]['filter']){_0x4aac66[_0x3662('0x3c')]=_[_0x3662('0x40')](_0x4aac66[_0x3662('0x3c')],{'$or':_[_0x3662('0x2e')](_0x4aac66['attributes'],function(_0xec6c7a){var _0x2ec337={};_0x2ec337[_0xec6c7a]={'$like':'%'+_0x302c74[_0x3662('0x34')]['filter']+'%'};return _0x2ec337;})});}_0x4aac66=_[_0x3662('0x40')]({},_0x4aac66,_0x302c74[_0x3662('0x42')]);return db[_0x3662('0x62')][_0x3662('0x20')]({'where':_0x4aac66[_0x3662('0x3c')]})[_0x3662('0x25')](function(_0x1ab78c){_0x1ac8c3[_0x3662('0x20')]=_0x1ab78c;if(_0x302c74[_0x3662('0x34')][_0x3662('0x46')]){_0x4aac66['include']=[{'all':!![]}];}return db[_0x3662('0x62')][_0x3662('0x5c')](_0x4aac66);})['then'](function(_0x1bd24d){_0x1ac8c3[_0x3662('0x5d')]=_0x1bd24d;return _0x1ac8c3;});}})['then'](respondWithFilteredResult(_0x1556fb,_0x4aac66))[_0x3662('0x44')](handleError(_0x1556fb,null));};exports[_0x3662('0x63')]=function(_0xed7bbc,_0x27bb17,_0x42a053){var _0x5e958c={};var _0x58492a={};var _0xc0489;var _0x238cc5;return db[_0x3662('0x2f')][_0x3662('0x58')]({'where':{'id':_0xed7bbc[_0x3662('0x45')]['id']}})[_0x3662('0x25')](handleEntityNotFound(_0x27bb17,null))[_0x3662('0x25')](function(_0x368d1f){if(_0x368d1f){_0xc0489=_0x368d1f;_0x58492a[_0x3662('0x33')]=_[_0x3662('0x35')](db[_0x3662('0x64')]['rawAttributes']);_0x58492a[_0x3662('0x34')]=_[_0x3662('0x35')](_0xed7bbc[_0x3662('0x34')]);_0x58492a[_0x3662('0x3e')]=_[_0x3662('0x36')](_0x58492a[_0x3662('0x33')],_0x58492a['query']);_0x5e958c[_0x3662('0x37')]=_[_0x3662('0x36')](_0x58492a[_0x3662('0x33')],qs[_0x3662('0x38')](_0xed7bbc[_0x3662('0x34')]['fields']));_0x5e958c[_0x3662('0x37')]=_0x5e958c[_0x3662('0x37')]['length']?_0x5e958c['attributes']:_0x58492a['model'];_0x5e958c[_0x3662('0x3a')]=qs[_0x3662('0x3b')](_0xed7bbc[_0x3662('0x34')][_0x3662('0x3b')]);_0x5e958c[_0x3662('0x3c')]=qs[_0x3662('0x3e')](_[_0x3662('0x3d')](_0xed7bbc['query'],_0x58492a[_0x3662('0x3e')]));if(_0xed7bbc['query'][_0x3662('0x3f')]){_0x5e958c['where']=_[_0x3662('0x40')](_0x5e958c[_0x3662('0x3c')],{'$or':_['map'](_0x5e958c[_0x3662('0x37')],function(_0x486e64){var _0x482d6e={};_0x482d6e[_0x486e64]={'$like':'%'+_0xed7bbc[_0x3662('0x34')][_0x3662('0x3f')]+'%'};return _0x482d6e;})});}_0x5e958c=_['merge']({},_0x5e958c,_0xed7bbc[_0x3662('0x42')]);return _0xc0489[_0x3662('0x63')](_0x5e958c);}})['then'](function(_0x1b32bd){if(_0x1b32bd){_0x238cc5=_0x1b32bd[_0x3662('0x50')];if(!_0xed7bbc['query'][_0x3662('0x39')](_0x3662('0x5a'))){_0x5e958c[_0x3662('0x1f')]=qs['limit'](_0xed7bbc[_0x3662('0x34')][_0x3662('0x1f')]);_0x5e958c['offset']=qs[_0x3662('0x1d')](_0xed7bbc[_0x3662('0x34')][_0x3662('0x1d')]);}return _0xc0489[_0x3662('0x63')](_0x5e958c);}})[_0x3662('0x25')](function(_0x268bc9){if(_0x268bc9){return _0x268bc9?{'count':_0x238cc5,'rows':_0x268bc9}:null;}})[_0x3662('0x25')](respondWithResult(_0x27bb17,null))['catch'](handleError(_0x27bb17,null));};exports[_0x3662('0x65')]=function(_0x41aec4,_0x4e1185,_0x278428){var _0x1423e9,_0x5bf91d;var _0x6ff429=[];var _0xa48eab=moment()[_0x3662('0x66')](_0x3662('0x67'));return db[_0x3662('0x2f')][_0x3662('0x47')]({'where':{'id':_0x41aec4['params']['id']}})['then'](handleEntityNotFound(_0x4e1185,null))[_0x3662('0x25')](function(_0x3dfa57){if(_0x3dfa57){_0x5bf91d=_0x3dfa57;return _0x3dfa57[_0x3662('0x65')](_0x41aec4[_0x3662('0x48')][_0x3662('0x68')],_[_0x3662('0x51')](_0x41aec4[_0x3662('0x48')],[_0x3662('0x68'),'id'])||{});}return null;})[_0x3662('0x69')](function(_0x2d9fca){var _0x58b950;var _0x2b3eac;_0x1423e9=_0x2d9fca||[];var _0x49a166=[];if(_0x2d9fca){for(var _0x4e2944=0x0;_0x4e2944<_0x2d9fca[_0x3662('0x50')];_0x4e2944+=0x1){var _0x297a02=_0x2d9fca[_0x4e2944]['get']({'plain':!![]});_0x5bf91d[_0x3662('0x6a')]=_0x41aec4[_0x3662('0x48')][_0x3662('0x6a')]?_0x41aec4[_0x3662('0x48')]['dialCheckDuplicateType']:_0x5bf91d['dialCheckDuplicateType'];switch(_0x5bf91d[_0x3662('0x6a')]){case _0x3662('0x6b'):_0x58b950=squel['insert']()[_0x3662('0x6c')](_0x3662('0x6d'))[_0x3662('0x6e')](['phone','scheduledAt','ContactId',_0x3662('0x6f'),_0x3662('0x5b'),_0x3662('0x52'),'updatedAt'],squel[_0x3662('0x70')]()[_0x3662('0x71')](_0x3662('0x72'),_0x3662('0x72'))[_0x3662('0x71')]('NOW()','scheduledAt')[_0x3662('0x71')]('id','ContactId')[_0x3662('0x71')](_0x297a02[_0x3662('0x73')][_0x3662('0x74')](),_0x3662('0x6f'))['field'](_0x41aec4[_0x3662('0x45')]['id']['toString'](),_0x3662('0x5b'))['field']('\x27'+_0xa48eab+'\x27',_0x3662('0x52'))[_0x3662('0x71')]('\x27'+_0xa48eab+'\x27',_0x3662('0x53'))[_0x3662('0x75')](_0x3662('0x76'))[_0x3662('0x3c')](_0x3662('0x77'))['where'](_0x3662('0x78'),_0x297a02[_0x3662('0x73')]['toString']())[_0x3662('0x3c')](_0x3662('0x79'))[_0x3662('0x3c')](_0x3662('0x7a'),squel[_0x3662('0x70')]()[_0x3662('0x71')](_0x3662('0x7b'))[_0x3662('0x75')](_0x3662('0x7c'))[_0x3662('0x3c')](_0x3662('0x7d'),_0x41aec4[_0x3662('0x45')]['id'][_0x3662('0x74')]()))[_0x3662('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3662('0x70')]()[_0x3662('0x71')]('COALESCE(phone,\x27\x27)')['from'](_0x3662('0x6d'))[_0x3662('0x3c')](_0x3662('0x7d'),_0x41aec4[_0x3662('0x45')]['id'][_0x3662('0x74')]())))['toString']();break;case _0x3662('0x7e'):_0x58b950=squel[_0x3662('0x7f')]()[_0x3662('0x6c')](_0x3662('0x6d'))[_0x3662('0x6e')]([_0x3662('0x72'),_0x3662('0x80'),_0x3662('0x81'),'ListId',_0x3662('0x5b'),'createdAt',_0x3662('0x53')],squel[_0x3662('0x70')]()[_0x3662('0x71')](_0x3662('0x72'),_0x3662('0x72'))[_0x3662('0x71')](_0x3662('0x82'),_0x3662('0x80'))[_0x3662('0x71')]('id',_0x3662('0x81'))[_0x3662('0x71')](_0x297a02['CmListId'][_0x3662('0x74')](),_0x3662('0x6f'))[_0x3662('0x71')](_0x41aec4['params']['id']['toString'](),_0x3662('0x5b'))[_0x3662('0x71')]('\x27'+_0xa48eab+'\x27',_0x3662('0x52'))[_0x3662('0x71')]('\x27'+_0xa48eab+'\x27','updatedAt')[_0x3662('0x75')]('cm_contacts')['where'](_0x3662('0x77'))['where']('ListId\x20=\x20?',_0x297a02[_0x3662('0x73')]['toString']())[_0x3662('0x3c')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x3662('0x70')]()['field']('COALESCE(phone,\x27\x27)')[_0x3662('0x75')](_0x3662('0x6d'))[_0x3662('0x3c')]('CampaignId\x20=\x20?',_0x41aec4['params']['id'][_0x3662('0x74')]())))[_0x3662('0x74')]();break;default:_0x58b950=squel[_0x3662('0x7f')]()['into'](_0x3662('0x6d'))[_0x3662('0x6e')]([_0x3662('0x72'),_0x3662('0x80'),_0x3662('0x81'),_0x3662('0x6f'),_0x3662('0x5b'),_0x3662('0x52'),_0x3662('0x53')],squel['select']()[_0x3662('0x71')](_0x3662('0x72'),'phone')[_0x3662('0x71')](_0x3662('0x82'),_0x3662('0x80'))[_0x3662('0x71')]('id',_0x3662('0x81'))[_0x3662('0x71')](_0x297a02[_0x3662('0x73')][_0x3662('0x74')](),_0x3662('0x6f'))[_0x3662('0x71')](_0x41aec4[_0x3662('0x45')]['id'][_0x3662('0x74')](),_0x3662('0x5b'))[_0x3662('0x71')]('\x27'+_0xa48eab+'\x27',_0x3662('0x52'))[_0x3662('0x71')]('\x27'+_0xa48eab+'\x27','updatedAt')['from'](_0x3662('0x76'))[_0x3662('0x3c')]('deletedAt\x20IS\x20NULL')[_0x3662('0x3c')]('ListId\x20=\x20?',_0x297a02['CmListId'][_0x3662('0x74')]())[_0x3662('0x3c')](_0x3662('0x79')))['toString']();}_0x2b3eac=squel[_0x3662('0x7f')]()[_0x3662('0x6c')](_0x3662('0x83'))[_0x3662('0x6e')]([_0x3662('0x84'),_0x3662('0x80'),_0x3662('0x72'),_0x3662('0x85'),'createdAt',_0x3662('0x53')],squel[_0x3662('0x70')]()[_0x3662('0x71')](_0x3662('0x86'),'id')[_0x3662('0x71')]('NOW()','scheduledAt')['field'](_0x3662('0x87'),_0x3662('0x72'))[_0x3662('0x71')]('ci.OrderBY',_0x3662('0x85'))[_0x3662('0x71')]('\x27'+_0xa48eab+'\x27','createdAt')['field']('\x27'+_0xa48eab+'\x27',_0x3662('0x53'))[_0x3662('0x75')](_0x3662('0x88'),'ci')[_0x3662('0x89')](_0x3662('0x6d'),'h',_0x3662('0x8a'))[_0x3662('0x3c')](_0x3662('0x8b'),_0x297a02[_0x3662('0x73')][_0x3662('0x74')]())['where'](_0x3662('0x8c'),_0x41aec4['params']['id'][_0x3662('0x74')]())[_0x3662('0x3c')](_0x3662('0x8d'),_0xa48eab))[_0x3662('0x74')]();_0x49a166['push'](db['sequelize']['query'](_0x58b950));_0x6ff429[_0x3662('0x8e')](db[_0x3662('0x8f')][_0x3662('0x34')](_0x2b3eac));}return BPromise[_0x3662('0x90')](_0x49a166);}})[_0x3662('0x25')](function(){return BPromise[_0x3662('0x90')](_0x6ff429);})['then'](function(){return _0x1423e9;})['then'](respondWithResult(_0x4e1185,null))[_0x3662('0x44')](handleError(_0x4e1185,null));};exports[_0x3662('0x91')]=function(_0x1b4863,_0x4c6952,_0xc948d8){return db[_0x3662('0x2f')][_0x3662('0x47')]({'where':{'id':_0x1b4863['params']['id']}})[_0x3662('0x25')](handleEntityNotFound(_0x4c6952,null))[_0x3662('0x25')](function(_0x520675){if(_0x520675){return _0x520675[_0x3662('0x91')](_0x1b4863[_0x3662('0x34')][_0x3662('0x68')]);}})[_0x3662('0x25')](function(_0x6fa251){if(_0x6fa251){return db[_0x3662('0x59')][_0x3662('0x56')]({'where':{'ListId':_0x1b4863[_0x3662('0x34')][_0x3662('0x68')],'CampaignId':_0x1b4863[_0x3662('0x45')]['id']}})[_0x3662('0x25')](function(){return _0x6fa251;});}})['then'](respondWithStatusCode(_0x4c6952,null))[_0x3662('0x44')](handleError(_0x4c6952,null));};exports[_0x3662('0x92')]=function(_0x22f444,_0x2109d6,_0x2d92f3){var _0x13fc6c={};var _0x57708a={};var _0x2e80ae;var _0x244193;return db[_0x3662('0x2f')]['findOne']({'where':{'id':_0x22f444[_0x3662('0x45')]['id']}})[_0x3662('0x25')](handleEntityNotFound(_0x2109d6,null))[_0x3662('0x25')](function(_0x1f985c){if(_0x1f985c){_0x2e80ae=_0x1f985c;_0x57708a[_0x3662('0x33')]=_[_0x3662('0x35')](db[_0x3662('0x64')][_0x3662('0x30')]);_0x57708a['query']=_['keys'](_0x22f444[_0x3662('0x34')]);_0x57708a[_0x3662('0x3e')]=_[_0x3662('0x36')](_0x57708a['model'],_0x57708a[_0x3662('0x34')]);_0x13fc6c['attributes']=_['intersection'](_0x57708a[_0x3662('0x33')],qs['fields'](_0x22f444[_0x3662('0x34')]['fields']));_0x13fc6c[_0x3662('0x37')]=_0x13fc6c[_0x3662('0x37')][_0x3662('0x50')]?_0x13fc6c[_0x3662('0x37')]:_0x57708a[_0x3662('0x33')];_0x13fc6c[_0x3662('0x3a')]=qs[_0x3662('0x3b')](_0x22f444[_0x3662('0x34')][_0x3662('0x3b')]);_0x13fc6c[_0x3662('0x3c')]=qs[_0x3662('0x3e')](_[_0x3662('0x3d')](_0x22f444['query'],_0x57708a['filters']));if(_0x22f444[_0x3662('0x34')]['filter']){_0x13fc6c['where']=_[_0x3662('0x40')](_0x13fc6c[_0x3662('0x3c')],{'$or':_[_0x3662('0x2e')](_0x13fc6c[_0x3662('0x37')],function(_0x4d1d23){var _0xc8d041={};_0xc8d041[_0x4d1d23]={'$like':'%'+_0x22f444[_0x3662('0x34')][_0x3662('0x3f')]+'%'};return _0xc8d041;})});}_0x13fc6c=_['merge']({},_0x13fc6c,_0x22f444[_0x3662('0x42')]);return _0x2e80ae['getBlackLists'](_0x13fc6c);}})[_0x3662('0x25')](function(_0x5751b5){if(_0x5751b5){_0x244193=_0x5751b5[_0x3662('0x50')];if(!_0x22f444[_0x3662('0x34')][_0x3662('0x39')](_0x3662('0x5a'))){_0x13fc6c['limit']=qs[_0x3662('0x1f')](_0x22f444[_0x3662('0x34')][_0x3662('0x1f')]);_0x13fc6c[_0x3662('0x1d')]=qs[_0x3662('0x1d')](_0x22f444[_0x3662('0x34')][_0x3662('0x1d')]);}return _0x2e80ae['getBlackLists'](_0x13fc6c);}})[_0x3662('0x25')](function(_0x493512){if(_0x493512){return _0x493512?{'count':_0x244193,'rows':_0x493512}:null;}})[_0x3662('0x25')](respondWithResult(_0x2109d6,null))[_0x3662('0x44')](handleError(_0x2109d6,null));};exports['addBlackLists']=function(_0x1c42b7,_0x3f5cee,_0x70280e){var _0x17c310,_0x14491f;var _0x7e3450=[];var _0x463747=moment()[_0x3662('0x66')](_0x3662('0x67'));return db['Campaign'][_0x3662('0x47')]({'where':{'id':_0x1c42b7['params']['id']}})[_0x3662('0x25')](handleEntityNotFound(_0x3f5cee,null))[_0x3662('0x25')](function(_0x550c78){if(_0x550c78){_0x14491f=_0x550c78;return _0x550c78[_0x3662('0x93')](_0x1c42b7['body']['ids'],_['omit'](_0x1c42b7[_0x3662('0x48')],[_0x3662('0x68'),'id'])||{});}return null;})[_0x3662('0x69')](function(_0x297800){var _0x4d2727;var _0x22151f;_0x17c310=_0x297800||[];var _0x244404=[];if(_0x297800){for(var _0x526ead=0x0;_0x526ead<_0x297800[_0x3662('0x50')];_0x526ead+=0x1){var _0x51fe2b=_0x297800[_0x526ead][_0x3662('0x26')]({'plain':!![]});_0x4d2727=squel[_0x3662('0x7f')]()[_0x3662('0x6c')](_0x3662('0x94'))[_0x3662('0x6e')]([_0x3662('0x72'),_0x3662('0x81'),_0x3662('0x6f'),_0x3662('0x5b'),'createdAt',_0x3662('0x53')],squel[_0x3662('0x70')]()[_0x3662('0x71')](_0x3662('0x72'),_0x3662('0x72'))[_0x3662('0x71')]('id',_0x3662('0x81'))['field'](_0x51fe2b[_0x3662('0x73')]['toString'](),'ListId')[_0x3662('0x71')](_0x1c42b7[_0x3662('0x45')]['id'][_0x3662('0x74')](),_0x3662('0x5b'))[_0x3662('0x71')](_0x3662('0x82'),_0x3662('0x52'))[_0x3662('0x71')](_0x3662('0x82'),'updatedAt')[_0x3662('0x75')](_0x3662('0x76'))['where'](_0x3662('0x77'))[_0x3662('0x3c')](_0x3662('0x78'),_0x51fe2b[_0x3662('0x73')][_0x3662('0x74')]())[_0x3662('0x3c')](_0x3662('0x79')))[_0x3662('0x74')]();_0x244404[_0x3662('0x8e')](db[_0x3662('0x8f')][_0x3662('0x34')](_0x4d2727));}return BPromise['all'](_0x244404);}})[_0x3662('0x25')](function(){return _0x17c310;})[_0x3662('0x25')](respondWithResult(_0x3f5cee,null))[_0x3662('0x44')](handleError(_0x3f5cee,null));};exports[_0x3662('0x95')]=function(_0x248f54,_0x5567a4,_0x1db37d){return db[_0x3662('0x2f')][_0x3662('0x47')]({'where':{'id':_0x248f54['params']['id']}})[_0x3662('0x25')](handleEntityNotFound(_0x5567a4,null))['then'](function(_0x5f5677){if(_0x5f5677){return _0x5f5677[_0x3662('0x95')](_0x248f54['query'][_0x3662('0x68')]);}})[_0x3662('0x25')](function(_0x2451b9){if(_0x2451b9){return db[_0x3662('0x62')][_0x3662('0x56')]({'where':{'ListId':_0x248f54[_0x3662('0x34')][_0x3662('0x68')],'CampaignId':_0x248f54[_0x3662('0x45')]['id']}})[_0x3662('0x25')](function(){return _0x2451b9;});}})['then'](respondWithStatusCode(_0x5567a4,null))[_0x3662('0x44')](handleError(_0x5567a4,null));};
\ No newline at end of file
+var _0x7fce=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','clone','includeAll','omit','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ContactId','select','field','NOW()','scheduledAt','CmListId','toString','ListId','createdAt','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','map','Campaign','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','rows','catch','show','params','rawAttributes','options','find'];(function(_0x16e906,_0x27f2f8){var _0x20d8ed=function(_0x5ac187){while(--_0x5ac187){_0x16e906['push'](_0x16e906['shift']());}};_0x20d8ed(++_0x27f2f8);}(_0x7fce,0xdc));var _0xe7fc=function(_0x1c2dba,_0x563270){_0x1c2dba=_0x1c2dba-0x0;var _0x300d47=_0x7fce[_0x1c2dba];return _0x300d47;};'use strict';var emlformat=require(_0xe7fc('0x0'));var rimraf=require(_0xe7fc('0x1'));var zipdir=require(_0xe7fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7fc('0x3'));var moment=require('moment');var BPromise=require(_0xe7fc('0x4'));var Mustache=require('mustache');var util=require(_0xe7fc('0x5'));var path=require(_0xe7fc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe7fc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7fc('0x8'));var squel=require(_0xe7fc('0x9'));var crypto=require(_0xe7fc('0xa'));var jsforce=require(_0xe7fc('0xb'));var deskjs=require(_0xe7fc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe7fc('0xd'));var Papa=require('papaparse');var Redis=require(_0xe7fc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe7fc('0xf'));var as=require(_0xe7fc('0x10'));var hardwareService=require(_0xe7fc('0x11'));var logger=require(_0xe7fc('0x12'))('api');var utils=require(_0xe7fc('0x13'));var config=require(_0xe7fc('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243600,_0x59da2e){_0x59da2e=_0x59da2e||0xcc;return function(_0x38512a){if(_0x38512a){return _0x243600['sendStatus'](_0x59da2e);}return _0x243600['status'](_0x59da2e)[_0xe7fc('0x15')]();};}function respondWithResult(_0x14fcbf,_0x235692){_0x235692=_0x235692||0xc8;return function(_0x307f58){if(_0x307f58){return _0x14fcbf[_0xe7fc('0x16')](_0x235692)['json'](_0x307f58);}};}function respondWithFilteredResult(_0x272cd5,_0x5ce83f){return function(_0x4da73b){if(_0x4da73b){var _0x1302e5=typeof _0x5ce83f[_0xe7fc('0x17')]===_0xe7fc('0x18')&&typeof _0x5ce83f[_0xe7fc('0x19')]==='undefined';var _0x552429=_0x4da73b['count'];var _0x4aa4f0=_0x1302e5?0x0:_0x5ce83f['offset'];var _0x490a99=_0x1302e5?_0x4da73b[_0xe7fc('0x1a')]:_0x5ce83f['offset']+_0x5ce83f[_0xe7fc('0x19')];var _0xb43fde;if(_0x490a99>=_0x552429){_0x490a99=_0x552429;_0xb43fde=0xc8;}else{_0xb43fde=0xce;}_0x272cd5[_0xe7fc('0x16')](_0xb43fde);return _0x272cd5[_0xe7fc('0x1b')](_0xe7fc('0x1c'),_0x4aa4f0+'-'+_0x490a99+'/'+_0x552429)[_0xe7fc('0x1d')](_0x4da73b);}return null;};}function patchUpdates(_0x329051){return function(_0x763103){try{jsonpatch['apply'](_0x763103,_0x329051,!![]);}catch(_0x39c75a){return BPromise[_0xe7fc('0x1e')](_0x39c75a);}return _0x763103['save']();};}function saveUpdates(_0x587dee,_0x35bb53){return function(_0x3c31e7){if(_0x3c31e7){return _0x3c31e7[_0xe7fc('0x1f')](_0x587dee)[_0xe7fc('0x20')](function(_0x26977a){return _0x26977a;});}return null;};}function removeEntity(_0x11c5a3,_0x3f850f){return function(_0x1731b6){if(_0x1731b6){return _0x1731b6[_0xe7fc('0x21')]()[_0xe7fc('0x20')](function(){var _0x1d1348=_0x1731b6[_0xe7fc('0x22')]({'plain':!![]});var _0x12ebdd='IvrCampaigns';return db[_0xe7fc('0x23')][_0xe7fc('0x21')]({'where':{'type':_0x12ebdd,'resourceId':_0x1d1348['id']}})[_0xe7fc('0x20')](function(){return _0x1731b6;});})[_0xe7fc('0x20')](function(){_0x11c5a3[_0xe7fc('0x16')](0xcc)[_0xe7fc('0x15')]();});}};}function handleEntityNotFound(_0x553ac5,_0x1a82e8){return function(_0x1ceedc){if(!_0x1ceedc){_0x553ac5[_0xe7fc('0x24')](0x194);}return _0x1ceedc;};}function handleError(_0x3e3798,_0x2f1628){_0x2f1628=_0x2f1628||0x1f4;return function(_0x4416b5){logger[_0xe7fc('0x25')](_0x4416b5['stack']);if(_0x4416b5[_0xe7fc('0x26')]){delete _0x4416b5[_0xe7fc('0x26')];}_0x3e3798['status'](_0x2f1628)[_0xe7fc('0x27')](_0x4416b5);};}exports['index']=function(_0x39d908,_0x27255a){var _0x547219={},_0x2b3830={},_0x4fe326={'count':0x0,'rows':[]};var _0x245965=_[_0xe7fc('0x28')](db[_0xe7fc('0x29')]['rawAttributes'],function(_0x36a043){return{'name':_0x36a043['fieldName'],'type':_0x36a043[_0xe7fc('0x2a')][_0xe7fc('0x2b')]};});_0x2b3830['model']=_['map'](_0x245965,'name');_0x2b3830['query']=_[_0xe7fc('0x2c')](_0x39d908[_0xe7fc('0x2d')]);_0x2b3830[_0xe7fc('0x2e')]=_[_0xe7fc('0x2f')](_0x2b3830[_0xe7fc('0x30')],_0x2b3830[_0xe7fc('0x2d')]);_0x547219[_0xe7fc('0x31')]=_[_0xe7fc('0x2f')](_0x2b3830[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x39d908['query'][_0xe7fc('0x32')]));_0x547219[_0xe7fc('0x31')]=_0x547219[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x547219[_0xe7fc('0x31')]:_0x2b3830['model'];if(!_0x39d908[_0xe7fc('0x2d')][_0xe7fc('0x34')](_0xe7fc('0x35'))){_0x547219[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x39d908[_0xe7fc('0x2d')][_0xe7fc('0x19')]);_0x547219[_0xe7fc('0x17')]=qs[_0xe7fc('0x17')](_0x39d908[_0xe7fc('0x2d')][_0xe7fc('0x17')]);}_0x547219[_0xe7fc('0x36')]=qs['sort'](_0x39d908[_0xe7fc('0x2d')][_0xe7fc('0x37')]);_0x547219[_0xe7fc('0x38')]=qs[_0xe7fc('0x2e')](_[_0xe7fc('0x39')](_0x39d908['query'],_0x2b3830[_0xe7fc('0x2e')]),_0x245965);if(_0x39d908[_0xe7fc('0x2d')][_0xe7fc('0x3a')]){_0x547219[_0xe7fc('0x38')]=_[_0xe7fc('0x3b')](_0x547219[_0xe7fc('0x38')],{'$or':_['map'](_0x245965,function(_0x5586d8){if(_0x5586d8['type']!=='VIRTUAL'){var _0x4fd29e={};_0x4fd29e[_0x5586d8[_0xe7fc('0x26')]]={'$like':'%'+_0x39d908[_0xe7fc('0x2d')]['filter']+'%'};return _0x4fd29e;}})});}_0x547219=_[_0xe7fc('0x3b')]({},_0x547219,_0x39d908['options']);var _0x280025={'where':_0x547219[_0xe7fc('0x38')]};return db[_0xe7fc('0x29')][_0xe7fc('0x1a')](_0x280025)[_0xe7fc('0x20')](function(_0x3e35c7){_0x4fe326['count']=_0x3e35c7;if(_0x39d908[_0xe7fc('0x2d')]['includeAll']){_0x547219[_0xe7fc('0x3c')]=[{'all':!![]}];}return db[_0xe7fc('0x29')]['findAll'](_0x547219);})[_0xe7fc('0x20')](function(_0x3ce7ad){_0x4fe326[_0xe7fc('0x3d')]=_0x3ce7ad;return _0x4fe326;})[_0xe7fc('0x20')](respondWithFilteredResult(_0x27255a,_0x547219))[_0xe7fc('0x3e')](handleError(_0x27255a,null));};exports[_0xe7fc('0x3f')]=function(_0x3f47aa,_0xab81b8){var _0x31473a={'raw':![],'where':{'id':_0x3f47aa[_0xe7fc('0x40')]['id']}},_0x118e94={};_0x118e94[_0xe7fc('0x30')]=_[_0xe7fc('0x2c')](db[_0xe7fc('0x29')][_0xe7fc('0x41')]);_0x118e94[_0xe7fc('0x2d')]=_[_0xe7fc('0x2c')](_0x3f47aa['query']);_0x118e94[_0xe7fc('0x2e')]=_[_0xe7fc('0x2f')](_0x118e94[_0xe7fc('0x30')],_0x118e94['query']);_0x31473a[_0xe7fc('0x31')]=_[_0xe7fc('0x2f')](_0x118e94[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x3f47aa[_0xe7fc('0x2d')]['fields']));_0x31473a['attributes']=_0x31473a[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x31473a[_0xe7fc('0x31')]:_0x118e94[_0xe7fc('0x30')];if(_0x3f47aa[_0xe7fc('0x2d')]['includeAll']){_0x31473a[_0xe7fc('0x3c')]=[{'all':!![]}];}_0x31473a=_[_0xe7fc('0x3b')]({},_0x31473a,_0x3f47aa[_0xe7fc('0x42')]);return db[_0xe7fc('0x29')][_0xe7fc('0x43')](_0x31473a)[_0xe7fc('0x20')](handleEntityNotFound(_0xab81b8,null))[_0xe7fc('0x20')](respondWithResult(_0xab81b8,null))[_0xe7fc('0x3e')](handleError(_0xab81b8,null));};exports[_0xe7fc('0x44')]=function(_0x45edbf,_0x533f31){return db[_0xe7fc('0x29')]['create'](_0x45edbf[_0xe7fc('0x45')],{})[_0xe7fc('0x20')](function(_0x1129dd){var _0xc204f7=_0x45edbf[_0xe7fc('0x46')][_0xe7fc('0x22')]({'plain':!![]});if(!_0xc204f7)throw new Error(_0xe7fc('0x47'));if(_0xc204f7[_0xe7fc('0x48')]===_0xe7fc('0x46')){var _0x535afb=_0x1129dd[_0xe7fc('0x22')]({'plain':!![]});var _0xf553c1=_0xe7fc('0x49');return db[_0xe7fc('0x4a')][_0xe7fc('0x43')]({'where':{'name':_0xf553c1,'userProfileId':_0xc204f7[_0xe7fc('0x4b')]},'raw':!![]})['then'](function(_0x1ecaf1){if(_0x1ecaf1&&_0x1ecaf1[_0xe7fc('0x4c')]===0x0){return db[_0xe7fc('0x23')][_0xe7fc('0x44')]({'name':_0x535afb[_0xe7fc('0x26')],'resourceId':_0x535afb['id'],'type':_0x1ecaf1[_0xe7fc('0x26')],'sectionId':_0x1ecaf1['id']},{})['then'](function(){return _0x1129dd;});}else{return _0x1129dd;}})['catch'](function(_0x3d5f19){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d5f19);throw _0x3d5f19;});}return _0x1129dd;})[_0xe7fc('0x20')](respondWithResult(_0x533f31,0xc9))[_0xe7fc('0x3e')](handleError(_0x533f31,null));};exports[_0xe7fc('0x4d')]=function(_0x2cf52f,_0x2246d8){var _0x1fbd9d={'where':{'id':_0x2cf52f[_0xe7fc('0x40')]['id']}},_0x3fab1f={};_0x3fab1f[_0xe7fc('0x30')]=_[_0xe7fc('0x2c')](db[_0xe7fc('0x29')]['rawAttributes']);_0x1fbd9d[_0xe7fc('0x31')]=_['intersection'](_0x3fab1f[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x2cf52f[_0xe7fc('0x2d')][_0xe7fc('0x32')]));_0x1fbd9d[_0xe7fc('0x31')]=_0x1fbd9d[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x1fbd9d[_0xe7fc('0x31')]:_0x3fab1f['model'];if(_0x2cf52f[_0xe7fc('0x2d')][_0xe7fc('0x4e')]){_0x1fbd9d['include']=[{'all':!![]}];}_0x1fbd9d=_[_0xe7fc('0x3b')]({},_0x1fbd9d,_0x2cf52f[_0xe7fc('0x42')]);return db[_0xe7fc('0x29')][_0xe7fc('0x43')](_0x1fbd9d)[_0xe7fc('0x20')](handleEntityNotFound(_0x2246d8,null))['then'](function(_0x1807b2){if(_0x1807b2){var _0x12c4ab=_0x1807b2[_0xe7fc('0x22')]({'plain':!![]});_0x12c4ab=qs[_0xe7fc('0x4f')](_0x12c4ab,['id','createdAt',_0xe7fc('0x50')]);_0x2cf52f[_0xe7fc('0x45')]=_[_0xe7fc('0x4f')](_0x2cf52f['body'],['id','createdAt',_0xe7fc('0x50')]);return db[_0xe7fc('0x29')][_0xe7fc('0x44')](_[_0xe7fc('0x3b')](_0x12c4ab,_0x2cf52f[_0xe7fc('0x45')]),{'include':_0x2cf52f[_0xe7fc('0x2d')]['includeAll']?[{'all':!![]}]:undefined})[_0xe7fc('0x20')](function(_0x4d9a11){var _0x31fbeb=_0x2cf52f[_0xe7fc('0x46')]['get']({'plain':!![]});if(!_0x31fbeb)throw new Error(_0xe7fc('0x47'));if(_0x31fbeb['role']==='user'){var _0x567ab9=_0x4d9a11[_0xe7fc('0x22')]({'plain':!![]});var _0x270505=_0xe7fc('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x270505,'userProfileId':_0x31fbeb['userProfileId']},'raw':!![]})['then'](function(_0x3ea15b){if(_0x3ea15b&&_0x3ea15b[_0xe7fc('0x4c')]===0x0){return db[_0xe7fc('0x23')][_0xe7fc('0x44')]({'name':_0x567ab9[_0xe7fc('0x26')],'resourceId':_0x567ab9['id'],'type':_0x3ea15b[_0xe7fc('0x26')],'sectionId':_0x3ea15b['id']},{})[_0xe7fc('0x20')](function(){return _0x4d9a11;});}else{return _0x4d9a11;}})[_0xe7fc('0x3e')](function(_0x371a7f){logger['error'](_0xe7fc('0x51'),_0x371a7f);throw _0x371a7f;});}return _0x4d9a11;});}})['then'](respondWithResult(_0x2246d8,0xc9))[_0xe7fc('0x3e')](handleError(_0x2246d8,null));};exports[_0xe7fc('0x1f')]=function(_0x30c2e1,_0x561e5a){if(_0x30c2e1[_0xe7fc('0x45')]['id']){delete _0x30c2e1[_0xe7fc('0x45')]['id'];}return db['Campaign'][_0xe7fc('0x43')]({'where':{'id':_0x30c2e1[_0xe7fc('0x40')]['id']}})['then'](handleEntityNotFound(_0x561e5a,null))[_0xe7fc('0x20')](saveUpdates(_0x30c2e1[_0xe7fc('0x45')],null))[_0xe7fc('0x20')](respondWithResult(_0x561e5a,null))['catch'](handleError(_0x561e5a,null));};exports[_0xe7fc('0x21')]=function(_0x5cad9e,_0x51838f){return db[_0xe7fc('0x29')][_0xe7fc('0x43')]({'where':{'id':_0x5cad9e[_0xe7fc('0x40')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x51838f,null))[_0xe7fc('0x20')](removeEntity(_0x51838f,null))[_0xe7fc('0x3e')](handleError(_0x51838f,null));};exports['getHoppers']=function(_0x3f4dea,_0x2dc3db,_0x390a6e){var _0x26a1a4={'raw':!![],'where':{}};var _0x58a981={};var _0x1b9dff={'count':0x0,'rows':[]};return db[_0xe7fc('0x29')][_0xe7fc('0x52')]({'where':{'id':_0x3f4dea['params']['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x2dc3db,null))[_0xe7fc('0x20')](function(_0x59baff){if(_0x59baff){_0x58a981[_0xe7fc('0x30')]=_[_0xe7fc('0x2c')](db[_0xe7fc('0x53')][_0xe7fc('0x41')]);_0x58a981[_0xe7fc('0x2d')]=_[_0xe7fc('0x2c')](_0x3f4dea[_0xe7fc('0x2d')]);_0x58a981[_0xe7fc('0x2e')]=_[_0xe7fc('0x2f')](_0x58a981['model'],_0x58a981['query']);_0x26a1a4['attributes']=_[_0xe7fc('0x2f')](_0x58a981[_0xe7fc('0x30')],qs['fields'](_0x3f4dea[_0xe7fc('0x2d')]['fields']));_0x26a1a4[_0xe7fc('0x31')]=_0x26a1a4['attributes'][_0xe7fc('0x33')]?_0x26a1a4[_0xe7fc('0x31')]:_0x58a981[_0xe7fc('0x30')];if(!_0x3f4dea[_0xe7fc('0x2d')][_0xe7fc('0x34')](_0xe7fc('0x35'))){_0x26a1a4[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x3f4dea[_0xe7fc('0x2d')][_0xe7fc('0x19')]);_0x26a1a4[_0xe7fc('0x17')]=qs['offset'](_0x3f4dea[_0xe7fc('0x2d')][_0xe7fc('0x17')]);}_0x26a1a4[_0xe7fc('0x36')]=qs[_0xe7fc('0x37')](_0x3f4dea['query'][_0xe7fc('0x37')]);_0x26a1a4[_0xe7fc('0x38')]=qs[_0xe7fc('0x2e')](_['pick'](_0x3f4dea[_0xe7fc('0x2d')],_0x58a981[_0xe7fc('0x2e')]));_0x26a1a4[_0xe7fc('0x38')][_0xe7fc('0x54')]=_0x59baff['id'];if(_0x3f4dea[_0xe7fc('0x2d')][_0xe7fc('0x3a')]){_0x26a1a4[_0xe7fc('0x38')]=_[_0xe7fc('0x3b')](_0x26a1a4['where'],{'$or':_[_0xe7fc('0x28')](_0x26a1a4['attributes'],function(_0x2cdd29){var _0xc5621f={};_0xc5621f[_0x2cdd29]={'$like':'%'+_0x3f4dea[_0xe7fc('0x2d')]['filter']+'%'};return _0xc5621f;})});}_0x26a1a4=_[_0xe7fc('0x3b')]({},_0x26a1a4,_0x3f4dea[_0xe7fc('0x42')]);return db[_0xe7fc('0x53')]['count']({'where':_0x26a1a4[_0xe7fc('0x38')]})['then'](function(_0x7cfe41){_0x1b9dff[_0xe7fc('0x1a')]=_0x7cfe41;if(_0x3f4dea[_0xe7fc('0x2d')][_0xe7fc('0x4e')]){_0x26a1a4[_0xe7fc('0x3c')]=[{'all':!![]}];}return db['CmHopper'][_0xe7fc('0x55')](_0x26a1a4);})[_0xe7fc('0x20')](function(_0x9e3d14){_0x1b9dff['rows']=_0x9e3d14;return _0x1b9dff;});}})[_0xe7fc('0x20')](respondWithFilteredResult(_0x2dc3db,_0x26a1a4))['catch'](handleError(_0x2dc3db,null));};exports[_0xe7fc('0x56')]=function(_0x5256ad,_0x55ca6f,_0x195b86){var _0x116702={'raw':!![],'where':{}};var _0x3ca583={};var _0x9445bb={'count':0x0,'rows':[]};return db[_0xe7fc('0x29')][_0xe7fc('0x52')]({'where':{'id':_0x5256ad[_0xe7fc('0x40')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x55ca6f,null))[_0xe7fc('0x20')](function(_0x23a31b){if(_0x23a31b){_0x3ca583[_0xe7fc('0x30')]=_[_0xe7fc('0x2c')](db[_0xe7fc('0x57')]['rawAttributes']);_0x3ca583[_0xe7fc('0x2d')]=_['keys'](_0x5256ad[_0xe7fc('0x2d')]);_0x3ca583[_0xe7fc('0x2e')]=_['intersection'](_0x3ca583['model'],_0x3ca583[_0xe7fc('0x2d')]);_0x116702['attributes']=_[_0xe7fc('0x2f')](_0x3ca583[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x5256ad[_0xe7fc('0x2d')][_0xe7fc('0x32')]));_0x116702[_0xe7fc('0x31')]=_0x116702[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x116702[_0xe7fc('0x31')]:_0x3ca583[_0xe7fc('0x30')];if(!_0x5256ad['query'][_0xe7fc('0x34')](_0xe7fc('0x35'))){_0x116702['limit']=qs[_0xe7fc('0x19')](_0x5256ad[_0xe7fc('0x2d')][_0xe7fc('0x19')]);_0x116702[_0xe7fc('0x17')]=qs[_0xe7fc('0x17')](_0x5256ad[_0xe7fc('0x2d')][_0xe7fc('0x17')]);}_0x116702[_0xe7fc('0x36')]=qs[_0xe7fc('0x37')](_0x5256ad[_0xe7fc('0x2d')][_0xe7fc('0x37')]);_0x116702[_0xe7fc('0x38')]=qs['filters'](_[_0xe7fc('0x39')](_0x5256ad[_0xe7fc('0x2d')],_0x3ca583[_0xe7fc('0x2e')]));_0x116702['where']['CampaignId']=_0x23a31b['id'];if(_0x5256ad[_0xe7fc('0x2d')][_0xe7fc('0x3a')]){_0x116702[_0xe7fc('0x38')]=_['merge'](_0x116702[_0xe7fc('0x38')],{'$or':_[_0xe7fc('0x28')](_0x116702['attributes'],function(_0x9fd013){var _0x4ae3bf={};_0x4ae3bf[_0x9fd013]={'$like':'%'+_0x5256ad[_0xe7fc('0x2d')][_0xe7fc('0x3a')]+'%'};return _0x4ae3bf;})});}_0x116702=_[_0xe7fc('0x3b')]({},_0x116702,_0x5256ad[_0xe7fc('0x42')]);return db[_0xe7fc('0x57')][_0xe7fc('0x1a')]({'where':_0x116702[_0xe7fc('0x38')]})[_0xe7fc('0x20')](function(_0x466296){_0x9445bb[_0xe7fc('0x1a')]=_0x466296;if(_0x5256ad[_0xe7fc('0x2d')]['includeAll']){_0x116702['include']=[{'all':!![]}];}return db[_0xe7fc('0x57')][_0xe7fc('0x55')](_0x116702);})['then'](function(_0x2f501f){_0x9445bb[_0xe7fc('0x3d')]=_0x2f501f;return _0x9445bb;});}})[_0xe7fc('0x20')](respondWithFilteredResult(_0x55ca6f,_0x116702))[_0xe7fc('0x3e')](handleError(_0x55ca6f,null));};exports[_0xe7fc('0x58')]=function(_0x1034fe,_0x3416d6,_0x19b496){var _0x323580={'raw':!![],'where':{}};var _0x269675={};var _0x274a98={'count':0x0,'rows':[]};return db['Campaign'][_0xe7fc('0x52')]({'where':{'id':_0x1034fe[_0xe7fc('0x40')]['id']}})['then'](handleEntityNotFound(_0x3416d6,null))[_0xe7fc('0x20')](function(_0x598e79){if(_0x598e79){_0x269675[_0xe7fc('0x30')]=_['keys'](db['CmHopperFinal'][_0xe7fc('0x41')]);_0x269675[_0xe7fc('0x2d')]=_[_0xe7fc('0x2c')](_0x1034fe['query']);_0x269675['filters']=_[_0xe7fc('0x2f')](_0x269675['model'],_0x269675[_0xe7fc('0x2d')]);_0x323580[_0xe7fc('0x31')]=_[_0xe7fc('0x2f')](_0x269675[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x1034fe['query'][_0xe7fc('0x32')]));_0x323580[_0xe7fc('0x31')]=_0x323580[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x323580[_0xe7fc('0x31')]:_0x269675['model'];if(!_0x1034fe[_0xe7fc('0x2d')][_0xe7fc('0x34')](_0xe7fc('0x35'))){_0x323580[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x1034fe[_0xe7fc('0x2d')][_0xe7fc('0x19')]);_0x323580[_0xe7fc('0x17')]=qs['offset'](_0x1034fe[_0xe7fc('0x2d')][_0xe7fc('0x17')]);}_0x323580[_0xe7fc('0x36')]=qs[_0xe7fc('0x37')](_0x1034fe[_0xe7fc('0x2d')][_0xe7fc('0x37')]);_0x323580[_0xe7fc('0x38')]=qs[_0xe7fc('0x2e')](_['pick'](_0x1034fe[_0xe7fc('0x2d')],_0x269675[_0xe7fc('0x2e')]));_0x323580[_0xe7fc('0x38')]['CampaignId']=_0x598e79['id'];if(_0x1034fe[_0xe7fc('0x2d')]['filter']){_0x323580[_0xe7fc('0x38')]=_['merge'](_0x323580[_0xe7fc('0x38')],{'$or':_[_0xe7fc('0x28')](_0x323580[_0xe7fc('0x31')],function(_0x3df140){var _0x1c6d19={};_0x1c6d19[_0x3df140]={'$like':'%'+_0x1034fe['query']['filter']+'%'};return _0x1c6d19;})});}_0x323580=_[_0xe7fc('0x3b')]({},_0x323580,_0x1034fe[_0xe7fc('0x42')]);return db[_0xe7fc('0x59')][_0xe7fc('0x1a')]({'where':_0x323580['where']})[_0xe7fc('0x20')](function(_0x445332){_0x274a98[_0xe7fc('0x1a')]=_0x445332;if(_0x1034fe[_0xe7fc('0x2d')]['includeAll']){_0x323580[_0xe7fc('0x3c')]=[{'all':!![]}];}return db[_0xe7fc('0x59')][_0xe7fc('0x55')](_0x323580);})[_0xe7fc('0x20')](function(_0x303ba8){_0x274a98[_0xe7fc('0x3d')]=_0x303ba8;return _0x274a98;});}})[_0xe7fc('0x20')](respondWithFilteredResult(_0x3416d6,_0x323580))[_0xe7fc('0x3e')](handleError(_0x3416d6,null));};exports[_0xe7fc('0x5a')]=function(_0x5e4652,_0x234629,_0x18ba9b){var _0x13d64b={'raw':!![],'where':{}};var _0x4a0432={};var _0x3a9f96={'count':0x0,'rows':[]};return db['Campaign'][_0xe7fc('0x52')]({'where':{'id':_0x5e4652['params']['id']}})['then'](handleEntityNotFound(_0x234629,null))[_0xe7fc('0x20')](function(_0x177f8f){if(_0x177f8f){_0x4a0432['model']=_[_0xe7fc('0x2c')](db['CmHopperBlack'][_0xe7fc('0x41')]);_0x4a0432[_0xe7fc('0x2d')]=_[_0xe7fc('0x2c')](_0x5e4652[_0xe7fc('0x2d')]);_0x4a0432['filters']=_[_0xe7fc('0x2f')](_0x4a0432['model'],_0x4a0432['query']);_0x13d64b[_0xe7fc('0x31')]=_[_0xe7fc('0x2f')](_0x4a0432[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x5e4652[_0xe7fc('0x2d')][_0xe7fc('0x32')]));_0x13d64b[_0xe7fc('0x31')]=_0x13d64b[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x13d64b[_0xe7fc('0x31')]:_0x4a0432[_0xe7fc('0x30')];if(!_0x5e4652[_0xe7fc('0x2d')][_0xe7fc('0x34')]('nolimit')){_0x13d64b[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x5e4652['query']['limit']);_0x13d64b[_0xe7fc('0x17')]=qs[_0xe7fc('0x17')](_0x5e4652[_0xe7fc('0x2d')][_0xe7fc('0x17')]);}_0x13d64b[_0xe7fc('0x36')]=qs[_0xe7fc('0x37')](_0x5e4652['query'][_0xe7fc('0x37')]);_0x13d64b[_0xe7fc('0x38')]=qs[_0xe7fc('0x2e')](_[_0xe7fc('0x39')](_0x5e4652[_0xe7fc('0x2d')],_0x4a0432[_0xe7fc('0x2e')]));_0x13d64b[_0xe7fc('0x38')]['CampaignId']=_0x177f8f['id'];if(_0x5e4652['query'][_0xe7fc('0x3a')]){_0x13d64b[_0xe7fc('0x38')]=_[_0xe7fc('0x3b')](_0x13d64b[_0xe7fc('0x38')],{'$or':_[_0xe7fc('0x28')](_0x13d64b[_0xe7fc('0x31')],function(_0x12cb64){var _0x263504={};_0x263504[_0x12cb64]={'$like':'%'+_0x5e4652[_0xe7fc('0x2d')][_0xe7fc('0x3a')]+'%'};return _0x263504;})});}_0x13d64b=_['merge']({},_0x13d64b,_0x5e4652['options']);return db['CmHopperBlack'][_0xe7fc('0x1a')]({'where':_0x13d64b[_0xe7fc('0x38')]})[_0xe7fc('0x20')](function(_0x214c7c){_0x3a9f96[_0xe7fc('0x1a')]=_0x214c7c;if(_0x5e4652[_0xe7fc('0x2d')][_0xe7fc('0x4e')]){_0x13d64b[_0xe7fc('0x3c')]=[{'all':!![]}];}return db[_0xe7fc('0x5b')][_0xe7fc('0x55')](_0x13d64b);})[_0xe7fc('0x20')](function(_0x298849){_0x3a9f96[_0xe7fc('0x3d')]=_0x298849;return _0x3a9f96;});}})[_0xe7fc('0x20')](respondWithFilteredResult(_0x234629,_0x13d64b))[_0xe7fc('0x3e')](handleError(_0x234629,null));};exports[_0xe7fc('0x5c')]=function(_0x3b3017,_0x18f5a4,_0x5cf31b){var _0x415dbe={};var _0x454ec2={};var _0x243105;var _0x2eccd5;return db['Campaign'][_0xe7fc('0x52')]({'where':{'id':_0x3b3017[_0xe7fc('0x40')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x18f5a4,null))[_0xe7fc('0x20')](function(_0x338afb){if(_0x338afb){_0x243105=_0x338afb;_0x454ec2[_0xe7fc('0x30')]=_['keys'](db['CmList'][_0xe7fc('0x41')]);_0x454ec2['query']=_['keys'](_0x3b3017['query']);_0x454ec2[_0xe7fc('0x2e')]=_[_0xe7fc('0x2f')](_0x454ec2[_0xe7fc('0x30')],_0x454ec2[_0xe7fc('0x2d')]);_0x415dbe['attributes']=_['intersection'](_0x454ec2[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x3b3017[_0xe7fc('0x2d')][_0xe7fc('0x32')]));_0x415dbe[_0xe7fc('0x31')]=_0x415dbe[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x415dbe[_0xe7fc('0x31')]:_0x454ec2[_0xe7fc('0x30')];_0x415dbe[_0xe7fc('0x36')]=qs[_0xe7fc('0x37')](_0x3b3017[_0xe7fc('0x2d')][_0xe7fc('0x37')]);_0x415dbe[_0xe7fc('0x38')]=qs['filters'](_[_0xe7fc('0x39')](_0x3b3017[_0xe7fc('0x2d')],_0x454ec2['filters']));if(_0x3b3017[_0xe7fc('0x2d')][_0xe7fc('0x3a')]){_0x415dbe[_0xe7fc('0x38')]=_['merge'](_0x415dbe[_0xe7fc('0x38')],{'$or':_[_0xe7fc('0x28')](_0x415dbe['attributes'],function(_0x4e22e0){var _0x21c42b={};_0x21c42b[_0x4e22e0]={'$like':'%'+_0x3b3017['query'][_0xe7fc('0x3a')]+'%'};return _0x21c42b;})});}_0x415dbe=_[_0xe7fc('0x3b')]({},_0x415dbe,_0x3b3017[_0xe7fc('0x42')]);return _0x243105[_0xe7fc('0x5c')](_0x415dbe);}})[_0xe7fc('0x20')](function(_0x5dae71){if(_0x5dae71){_0x2eccd5=_0x5dae71[_0xe7fc('0x33')];if(!_0x3b3017[_0xe7fc('0x2d')][_0xe7fc('0x34')](_0xe7fc('0x35'))){_0x415dbe[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x3b3017['query'][_0xe7fc('0x19')]);_0x415dbe['offset']=qs[_0xe7fc('0x17')](_0x3b3017['query'][_0xe7fc('0x17')]);}return _0x243105['getLists'](_0x415dbe);}})['then'](function(_0x4521fa){if(_0x4521fa){return _0x4521fa?{'count':_0x2eccd5,'rows':_0x4521fa}:null;}})[_0xe7fc('0x20')](respondWithResult(_0x18f5a4,null))[_0xe7fc('0x3e')](handleError(_0x18f5a4,null));};exports[_0xe7fc('0x5d')]=function(_0x2bb619,_0x3ef536,_0x41206a){var _0x26e587,_0x215532;var _0x237160=[];var _0x2ee092=moment()[_0xe7fc('0x5e')](_0xe7fc('0x5f'));return db[_0xe7fc('0x29')][_0xe7fc('0x43')]({'where':{'id':_0x2bb619['params']['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x3ef536,null))[_0xe7fc('0x20')](function(_0xd37ad){if(_0xd37ad){_0x215532=_0xd37ad;return _0xd37ad[_0xe7fc('0x5d')](_0x2bb619[_0xe7fc('0x45')][_0xe7fc('0x60')],_['omit'](_0x2bb619[_0xe7fc('0x45')],[_0xe7fc('0x60'),'id'])||{});}return null;})[_0xe7fc('0x61')](function(_0x2b120d){var _0xd8b989;var _0x1ea67b;_0x26e587=_0x2b120d||[];var _0x4849a0=[];if(_0x2b120d){for(var _0x2892cb=0x0;_0x2892cb<_0x2b120d[_0xe7fc('0x33')];_0x2892cb+=0x1){var _0x6cef1f=_0x2b120d[_0x2892cb][_0xe7fc('0x22')]({'plain':!![]});_0x215532['dialCheckDuplicateType']=_0x2bb619[_0xe7fc('0x45')][_0xe7fc('0x62')]?_0x2bb619[_0xe7fc('0x45')][_0xe7fc('0x62')]:_0x215532[_0xe7fc('0x62')];switch(_0x215532[_0xe7fc('0x62')]){case _0xe7fc('0x63'):_0xd8b989=squel[_0xe7fc('0x64')]()['into'](_0xe7fc('0x65'))[_0xe7fc('0x66')]([_0xe7fc('0x67'),'scheduledAt',_0xe7fc('0x68'),'ListId','CampaignId','createdAt','updatedAt'],squel[_0xe7fc('0x69')]()[_0xe7fc('0x6a')](_0xe7fc('0x67'),'phone')[_0xe7fc('0x6a')](_0xe7fc('0x6b'),_0xe7fc('0x6c'))[_0xe7fc('0x6a')]('id',_0xe7fc('0x68'))[_0xe7fc('0x6a')](_0x6cef1f[_0xe7fc('0x6d')][_0xe7fc('0x6e')](),_0xe7fc('0x6f'))['field'](_0x2bb619[_0xe7fc('0x40')]['id'][_0xe7fc('0x6e')](),_0xe7fc('0x54'))[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27',_0xe7fc('0x70'))[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27',_0xe7fc('0x50'))[_0xe7fc('0x71')](_0xe7fc('0x72'))[_0xe7fc('0x38')]('deletedAt\x20IS\x20NULL')[_0xe7fc('0x38')](_0xe7fc('0x73'),_0x6cef1f[_0xe7fc('0x6d')][_0xe7fc('0x6e')]())[_0xe7fc('0x38')](_0xe7fc('0x74'))[_0xe7fc('0x38')](_0xe7fc('0x75'),squel[_0xe7fc('0x69')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0xe7fc('0x71')](_0xe7fc('0x76'))['where'](_0xe7fc('0x77'),_0x2bb619[_0xe7fc('0x40')]['id']['toString']()))[_0xe7fc('0x38')](_0xe7fc('0x75'),squel['select']()['field'](_0xe7fc('0x78'))['from'](_0xe7fc('0x65'))[_0xe7fc('0x38')](_0xe7fc('0x77'),_0x2bb619['params']['id'][_0xe7fc('0x6e')]())))['toString']();break;case _0xe7fc('0x79'):_0xd8b989=squel['insert']()[_0xe7fc('0x7a')]('cm_hopper')[_0xe7fc('0x66')]([_0xe7fc('0x67'),_0xe7fc('0x6c'),_0xe7fc('0x68'),_0xe7fc('0x6f'),_0xe7fc('0x54'),_0xe7fc('0x70'),_0xe7fc('0x50')],squel[_0xe7fc('0x69')]()[_0xe7fc('0x6a')](_0xe7fc('0x67'),_0xe7fc('0x67'))[_0xe7fc('0x6a')](_0xe7fc('0x6b'),_0xe7fc('0x6c'))[_0xe7fc('0x6a')]('id','ContactId')[_0xe7fc('0x6a')](_0x6cef1f[_0xe7fc('0x6d')][_0xe7fc('0x6e')](),_0xe7fc('0x6f'))['field'](_0x2bb619['params']['id'][_0xe7fc('0x6e')](),'CampaignId')[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27','createdAt')['field']('\x27'+_0x2ee092+'\x27',_0xe7fc('0x50'))['from'](_0xe7fc('0x72'))['where'](_0xe7fc('0x7b'))[_0xe7fc('0x38')]('ListId\x20=\x20?',_0x6cef1f[_0xe7fc('0x6d')][_0xe7fc('0x6e')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe7fc('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0xe7fc('0x69')]()[_0xe7fc('0x6a')](_0xe7fc('0x78'))[_0xe7fc('0x71')]('cm_hopper')['where'](_0xe7fc('0x77'),_0x2bb619[_0xe7fc('0x40')]['id']['toString']())))['toString']();break;default:_0xd8b989=squel[_0xe7fc('0x64')]()[_0xe7fc('0x7a')]('cm_hopper')[_0xe7fc('0x66')](['phone','scheduledAt',_0xe7fc('0x68'),_0xe7fc('0x6f'),_0xe7fc('0x54'),_0xe7fc('0x70'),_0xe7fc('0x50')],squel[_0xe7fc('0x69')]()[_0xe7fc('0x6a')](_0xe7fc('0x67'),'phone')['field'](_0xe7fc('0x6b'),_0xe7fc('0x6c'))[_0xe7fc('0x6a')]('id',_0xe7fc('0x68'))[_0xe7fc('0x6a')](_0x6cef1f[_0xe7fc('0x6d')][_0xe7fc('0x6e')](),'ListId')[_0xe7fc('0x6a')](_0x2bb619[_0xe7fc('0x40')]['id'][_0xe7fc('0x6e')](),'CampaignId')[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27',_0xe7fc('0x70'))[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27','updatedAt')[_0xe7fc('0x71')](_0xe7fc('0x72'))[_0xe7fc('0x38')]('deletedAt\x20IS\x20NULL')[_0xe7fc('0x38')](_0xe7fc('0x73'),_0x6cef1f[_0xe7fc('0x6d')][_0xe7fc('0x6e')]())[_0xe7fc('0x38')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x1ea67b=squel['insert']()['into'](_0xe7fc('0x7c'))['fromQuery']([_0xe7fc('0x7d'),_0xe7fc('0x6c'),_0xe7fc('0x67'),_0xe7fc('0x7e'),_0xe7fc('0x70'),_0xe7fc('0x50')],squel[_0xe7fc('0x69')]()['field'](_0xe7fc('0x7f'),'id')[_0xe7fc('0x6a')](_0xe7fc('0x6b'),'scheduledAt')[_0xe7fc('0x6a')](_0xe7fc('0x80'),_0xe7fc('0x67'))[_0xe7fc('0x6a')](_0xe7fc('0x81'),_0xe7fc('0x7e'))[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27','createdAt')[_0xe7fc('0x6a')]('\x27'+_0x2ee092+'\x27','updatedAt')[_0xe7fc('0x71')](_0xe7fc('0x82'),'ci')[_0xe7fc('0x83')](_0xe7fc('0x65'),'h',_0xe7fc('0x84'))['where'](_0xe7fc('0x85'),_0x6cef1f['CmListId'][_0xe7fc('0x6e')]())[_0xe7fc('0x38')](_0xe7fc('0x86'),_0x2bb619['params']['id'][_0xe7fc('0x6e')]())[_0xe7fc('0x38')](_0xe7fc('0x87'),_0x2ee092))[_0xe7fc('0x6e')]();_0x4849a0[_0xe7fc('0x88')](db['sequelize'][_0xe7fc('0x2d')](_0xd8b989));_0x237160[_0xe7fc('0x88')](db[_0xe7fc('0x89')][_0xe7fc('0x2d')](_0x1ea67b));}return BPromise[_0xe7fc('0x8a')](_0x4849a0);}})[_0xe7fc('0x20')](function(){return BPromise[_0xe7fc('0x8a')](_0x237160);})[_0xe7fc('0x20')](function(){return _0x26e587;})[_0xe7fc('0x20')](respondWithResult(_0x3ef536,null))['catch'](handleError(_0x3ef536,null));};exports[_0xe7fc('0x8b')]=function(_0x2e8fd6,_0x30c72c,_0x394ca4){return db[_0xe7fc('0x29')][_0xe7fc('0x43')]({'where':{'id':_0x2e8fd6[_0xe7fc('0x40')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x30c72c,null))[_0xe7fc('0x20')](function(_0x442408){if(_0x442408){return _0x442408[_0xe7fc('0x8b')](_0x2e8fd6[_0xe7fc('0x2d')][_0xe7fc('0x60')]);}})[_0xe7fc('0x20')](function(_0x332e1b){if(_0x332e1b){return db[_0xe7fc('0x53')][_0xe7fc('0x21')]({'where':{'ListId':_0x2e8fd6['query'][_0xe7fc('0x60')],'CampaignId':_0x2e8fd6['params']['id']}})['then'](function(){return _0x332e1b;});}})['then'](respondWithStatusCode(_0x30c72c,null))[_0xe7fc('0x3e')](handleError(_0x30c72c,null));};exports[_0xe7fc('0x8c')]=function(_0x3acdb5,_0x464702,_0x5ce4cd){var _0x3fb020={};var _0x41ea88={};var _0x66fa8e;var _0x268f6a;return db[_0xe7fc('0x29')][_0xe7fc('0x52')]({'where':{'id':_0x3acdb5['params']['id']}})['then'](handleEntityNotFound(_0x464702,null))['then'](function(_0x10d59e){if(_0x10d59e){_0x66fa8e=_0x10d59e;_0x41ea88['model']=_['keys'](db[_0xe7fc('0x8d')][_0xe7fc('0x41')]);_0x41ea88[_0xe7fc('0x2d')]=_[_0xe7fc('0x2c')](_0x3acdb5['query']);_0x41ea88[_0xe7fc('0x2e')]=_[_0xe7fc('0x2f')](_0x41ea88[_0xe7fc('0x30')],_0x41ea88[_0xe7fc('0x2d')]);_0x3fb020['attributes']=_['intersection'](_0x41ea88[_0xe7fc('0x30')],qs[_0xe7fc('0x32')](_0x3acdb5[_0xe7fc('0x2d')]['fields']));_0x3fb020[_0xe7fc('0x31')]=_0x3fb020[_0xe7fc('0x31')][_0xe7fc('0x33')]?_0x3fb020['attributes']:_0x41ea88['model'];_0x3fb020[_0xe7fc('0x36')]=qs[_0xe7fc('0x37')](_0x3acdb5[_0xe7fc('0x2d')][_0xe7fc('0x37')]);_0x3fb020['where']=qs[_0xe7fc('0x2e')](_[_0xe7fc('0x39')](_0x3acdb5[_0xe7fc('0x2d')],_0x41ea88['filters']));if(_0x3acdb5[_0xe7fc('0x2d')][_0xe7fc('0x3a')]){_0x3fb020[_0xe7fc('0x38')]=_['merge'](_0x3fb020[_0xe7fc('0x38')],{'$or':_[_0xe7fc('0x28')](_0x3fb020[_0xe7fc('0x31')],function(_0x5921bc){var _0x5024b6={};_0x5024b6[_0x5921bc]={'$like':'%'+_0x3acdb5['query'][_0xe7fc('0x3a')]+'%'};return _0x5024b6;})});}_0x3fb020=_[_0xe7fc('0x3b')]({},_0x3fb020,_0x3acdb5['options']);return _0x66fa8e['getBlackLists'](_0x3fb020);}})[_0xe7fc('0x20')](function(_0x375035){if(_0x375035){_0x268f6a=_0x375035[_0xe7fc('0x33')];if(!_0x3acdb5[_0xe7fc('0x2d')][_0xe7fc('0x34')](_0xe7fc('0x35'))){_0x3fb020[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x3acdb5[_0xe7fc('0x2d')][_0xe7fc('0x19')]);_0x3fb020[_0xe7fc('0x17')]=qs[_0xe7fc('0x17')](_0x3acdb5[_0xe7fc('0x2d')][_0xe7fc('0x17')]);}return _0x66fa8e[_0xe7fc('0x8c')](_0x3fb020);}})[_0xe7fc('0x20')](function(_0x5d3b52){if(_0x5d3b52){return _0x5d3b52?{'count':_0x268f6a,'rows':_0x5d3b52}:null;}})[_0xe7fc('0x20')](respondWithResult(_0x464702,null))[_0xe7fc('0x3e')](handleError(_0x464702,null));};exports[_0xe7fc('0x8e')]=function(_0xfe96fd,_0x4380b1,_0x2ce23f){var _0x18abc3,_0xb0ffa6;var _0x81eabb=[];var _0x7cda06=moment()['format'](_0xe7fc('0x5f'));return db[_0xe7fc('0x29')][_0xe7fc('0x43')]({'where':{'id':_0xfe96fd[_0xe7fc('0x40')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x4380b1,null))[_0xe7fc('0x20')](function(_0x521834){if(_0x521834){_0xb0ffa6=_0x521834;return _0x521834[_0xe7fc('0x8e')](_0xfe96fd[_0xe7fc('0x45')][_0xe7fc('0x60')],_[_0xe7fc('0x4f')](_0xfe96fd['body'],['ids','id'])||{});}return null;})['spread'](function(_0x14444f){var _0x5a0bdb;var _0x62f194;_0x18abc3=_0x14444f||[];var _0x524203=[];if(_0x14444f){for(var _0x129496=0x0;_0x129496<_0x14444f[_0xe7fc('0x33')];_0x129496+=0x1){var _0x1e2aae=_0x14444f[_0x129496]['get']({'plain':!![]});_0x5a0bdb=squel[_0xe7fc('0x64')]()['into']('cm_hopper_black')[_0xe7fc('0x66')](['phone',_0xe7fc('0x68'),_0xe7fc('0x6f'),_0xe7fc('0x54'),'createdAt',_0xe7fc('0x50')],squel[_0xe7fc('0x69')]()[_0xe7fc('0x6a')](_0xe7fc('0x67'),_0xe7fc('0x67'))[_0xe7fc('0x6a')]('id',_0xe7fc('0x68'))['field'](_0x1e2aae[_0xe7fc('0x6d')][_0xe7fc('0x6e')](),'ListId')[_0xe7fc('0x6a')](_0xfe96fd[_0xe7fc('0x40')]['id'][_0xe7fc('0x6e')](),_0xe7fc('0x54'))[_0xe7fc('0x6a')]('NOW()',_0xe7fc('0x70'))[_0xe7fc('0x6a')](_0xe7fc('0x6b'),_0xe7fc('0x50'))[_0xe7fc('0x71')](_0xe7fc('0x72'))['where'](_0xe7fc('0x7b'))[_0xe7fc('0x38')]('ListId\x20=\x20?',_0x1e2aae[_0xe7fc('0x6d')]['toString']())[_0xe7fc('0x38')](_0xe7fc('0x74')))[_0xe7fc('0x6e')]();_0x524203[_0xe7fc('0x88')](db[_0xe7fc('0x89')][_0xe7fc('0x2d')](_0x5a0bdb));}return BPromise[_0xe7fc('0x8a')](_0x524203);}})[_0xe7fc('0x20')](function(){return _0x18abc3;})[_0xe7fc('0x20')](respondWithResult(_0x4380b1,null))[_0xe7fc('0x3e')](handleError(_0x4380b1,null));};exports[_0xe7fc('0x8f')]=function(_0x44c20a,_0x47d3d5,_0x1f6e34){return db[_0xe7fc('0x29')][_0xe7fc('0x43')]({'where':{'id':_0x44c20a[_0xe7fc('0x40')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x47d3d5,null))['then'](function(_0x39b319){if(_0x39b319){return _0x39b319['removeBlackLists'](_0x44c20a[_0xe7fc('0x2d')][_0xe7fc('0x60')]);}})[_0xe7fc('0x20')](function(_0x178888){if(_0x178888){return db[_0xe7fc('0x5b')]['destroy']({'where':{'ListId':_0x44c20a[_0xe7fc('0x2d')][_0xe7fc('0x60')],'CampaignId':_0x44c20a[_0xe7fc('0x40')]['id']}})['then'](function(){return _0x178888;});}})[_0xe7fc('0x20')](respondWithStatusCode(_0x47d3d5,null))[_0xe7fc('0x3e')](handleError(_0x47d3d5,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 35b882a..f022b86 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(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index ad78ae5..b6b4ea1 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 _0x8d97=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include','model','util','moment'];(function(_0x1cc060,_0x1afbdc){var _0x5c7e10=function(_0x15e8d6){while(--_0x15e8d6){_0x1cc060['push'](_0x1cc060['shift']());}};_0x5c7e10(++_0x1afbdc);}(_0x8d97,0x82));var _0x78d9=function(_0x2e44d3,_0x570fed){_0x2e44d3=_0x2e44d3-0x0;var _0x123a84=_0x8d97[_0x2e44d3];return _0x123a84;};'use strict';var _=require('lodash');var util=require(_0x78d9('0x0'));var moment=require(_0x78d9('0x1'));var BPromise=require('bluebird');var rs=require(_0x78d9('0x2'));var fs=require('fs');var Redis=require(_0x78d9('0x3'));var db=require(_0x78d9('0x4'))['db'];var utils=require(_0x78d9('0x5'));var logger=require(_0x78d9('0x6'))('rpc');var config=require(_0x78d9('0x7'));var jayson=require(_0x78d9('0x8'));var client=jayson[_0x78d9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d1934,_0x5b9602,_0x2a2cdb){return new BPromise(function(_0x3b3709,_0x36b8f5){return client[_0x78d9('0xa')](_0x4d1934,_0x2a2cdb)[_0x78d9('0xb')](function(_0x14ca4e){logger['info'](_0x78d9('0xc'),_0x5b9602,_0x78d9('0xd'));logger[_0x78d9('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5b9602,'request\x20sent',JSON[_0x78d9('0xf')](_0x14ca4e));if(_0x14ca4e[_0x78d9('0x10')]){if(_0x14ca4e[_0x78d9('0x10')][_0x78d9('0x11')]===0x1f4){logger[_0x78d9('0x10')](_0x78d9('0xc'),_0x5b9602,_0x14ca4e['error'][_0x78d9('0x12')]);return _0x36b8f5(_0x14ca4e[_0x78d9('0x10')][_0x78d9('0x12')]);}logger[_0x78d9('0x10')](_0x78d9('0xc'),_0x5b9602,_0x14ca4e[_0x78d9('0x10')][_0x78d9('0x12')]);return _0x3b3709(_0x14ca4e[_0x78d9('0x10')][_0x78d9('0x12')]);}else{logger[_0x78d9('0x13')](_0x78d9('0xc'),_0x5b9602,_0x78d9('0xd'));_0x3b3709(_0x14ca4e[_0x78d9('0x14')][_0x78d9('0x12')]);}})[_0x78d9('0x15')](function(_0x156981){logger[_0x78d9('0x10')]('Campaign,\x20%s,\x20%s',_0x5b9602,_0x156981);_0x36b8f5(_0x156981);});});}exports[_0x78d9('0x16')]=function(_0x3b4dde){var _0x36f1e4=this;return new Promise(function(_0x8d0153,_0x43ea59){return db[_0x78d9('0x17')][_0x78d9('0x18')]({'raw':_0x3b4dde[_0x78d9('0x19')]?_0x3b4dde[_0x78d9('0x19')][_0x78d9('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b4dde[_0x78d9('0x19')]?_0x3b4dde[_0x78d9('0x19')][_0x78d9('0x1b')]||null:null,'attributes':_0x3b4dde[_0x78d9('0x19')]?_0x3b4dde[_0x78d9('0x19')][_0x78d9('0x1c')]||null:null,'limit':_0x3b4dde['options']?_0x3b4dde[_0x78d9('0x19')][_0x78d9('0x1d')]||null:null,'include':_0x3b4dde[_0x78d9('0x19')]?_0x3b4dde[_0x78d9('0x19')]['include']?_[_0x78d9('0x1e')](_0x3b4dde[_0x78d9('0x19')][_0x78d9('0x1f')],function(_0x51549d){return{'model':db[_0x51549d['model']],'as':_0x51549d['as'],'attributes':_0x51549d[_0x78d9('0x1c')],'include':_0x51549d['include']?_['map'](_0x51549d['include'],function(_0x28b7e1){return{'model':db[_0x28b7e1[_0x78d9('0x20')]],'as':_0x28b7e1['as'],'attributes':_0x28b7e1[_0x78d9('0x1c')],'include':_0x28b7e1[_0x78d9('0x1f')]?_[_0x78d9('0x1e')](_0x28b7e1[_0x78d9('0x1f')],function(_0x4e87cf){return{'model':db[_0x4e87cf[_0x78d9('0x20')]],'as':_0x4e87cf['as'],'attributes':_0x4e87cf['attributes']};}):[]};}):[]};}):[]:[]})[_0x78d9('0xb')](function(_0x3d9a53){logger[_0x78d9('0x13')]('GetCampaign',_0x3b4dde);logger[_0x78d9('0xe')](_0x78d9('0x16'),_0x3b4dde,JSON['stringify'](_0x3d9a53));_0x8d0153(_0x3d9a53);})['catch'](function(_0x55617c){logger['error'](_0x78d9('0x16'),_0x55617c[_0x78d9('0x12')],_0x3b4dde);_0x43ea59(_0x36f1e4[_0x78d9('0x10')](0x1f4,_0x55617c[_0x78d9('0x12')]));});});};
\ No newline at end of file
+var _0x2121=['request\x20sent','stringify','error','message','GetCampaign','Campaign','options','raw','where','limit','include','map','model','attributes','debug','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s'];(function(_0x135d6d,_0x3fe57e){var _0x14ff9a=function(_0x2a6021){while(--_0x2a6021){_0x135d6d['push'](_0x135d6d['shift']());}};_0x14ff9a(++_0x3fe57e);}(_0x2121,0x1b4));var _0x1212=function(_0x20e21b,_0x456996){_0x20e21b=_0x20e21b-0x0;var _0x3c4627=_0x2121[_0x20e21b];return _0x3c4627;};'use strict';var _=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1212('0x2'));var fs=require('fs');var Redis=require(_0x1212('0x3'));var db=require(_0x1212('0x4'))['db'];var utils=require(_0x1212('0x5'));var logger=require(_0x1212('0x6'))('rpc');var config=require(_0x1212('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1212('0x8')][_0x1212('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20fadc,_0x1b1ef5,_0x233a53){return new BPromise(function(_0x642ed5,_0x4a3d2a){return client[_0x1212('0xa')](_0x20fadc,_0x233a53)[_0x1212('0xb')](function(_0x434d23){logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x1b1ef5,_0x1212('0xe'),JSON[_0x1212('0xf')](_0x434d23));if(_0x434d23[_0x1212('0x10')]){if(_0x434d23[_0x1212('0x10')]['code']===0x1f4){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x4a3d2a(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x642ed5(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}else{logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));_0x642ed5(_0x434d23['result']['message']);}})['catch'](function(_0x3cfe21){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x3cfe21);_0x4a3d2a(_0x3cfe21);});});}exports[_0x1212('0x12')]=function(_0x3cf284){var _0x3face0=this;return new Promise(function(_0xb0dc88,_0x22eefb){return db[_0x1212('0x13')]['findAll']({'raw':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x15')]===undefined?!![]:![]:!![],'where':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x16')]||null:null,'attributes':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')]['attributes']||null:null,'limit':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x17')]||null:null,'include':_0x3cf284[_0x1212('0x14')]?_0x3cf284[_0x1212('0x14')][_0x1212('0x18')]?_[_0x1212('0x19')](_0x3cf284[_0x1212('0x14')]['include'],function(_0x58ab5b){return{'model':db[_0x58ab5b['model']],'as':_0x58ab5b['as'],'attributes':_0x58ab5b['attributes'],'include':_0x58ab5b['include']?_[_0x1212('0x19')](_0x58ab5b[_0x1212('0x18')],function(_0x4c32a7){return{'model':db[_0x4c32a7[_0x1212('0x1a')]],'as':_0x4c32a7['as'],'attributes':_0x4c32a7[_0x1212('0x1b')],'include':_0x4c32a7['include']?_[_0x1212('0x19')](_0x4c32a7[_0x1212('0x18')],function(_0x4630b4){return{'model':db[_0x4630b4[_0x1212('0x1a')]],'as':_0x4630b4['as'],'attributes':_0x4630b4[_0x1212('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1212('0xb')](function(_0x2750b0){logger[_0x1212('0xc')]('GetCampaign',_0x3cf284);logger[_0x1212('0x1c')](_0x1212('0x12'),_0x3cf284,JSON[_0x1212('0xf')](_0x2750b0));_0xb0dc88(_0x2750b0);})[_0x1212('0x1d')](function(_0x17d0f6){logger[_0x1212('0x10')](_0x1212('0x12'),_0x17d0f6[_0x1212('0x11')],_0x3cf284);_0x22eefb(_0x3face0[_0x1212('0x10')](0x1f4,_0x17d0f6[_0x1212('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index f213c4c..5d5ce2c 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 _0x605e=['connect-timeout','express','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','show','get','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addBlackLists','put','/:id','update','delete','destroy','/:id/lists','removeLists','removeBlackLists','exports','multer','util'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x605e,0x1b8));var _0xe605=function(_0x496166,_0x4ec1a0){_0x496166=_0x496166-0x0;var _0x36d05f=_0x605e[_0x496166];return _0x36d05f;};'use strict';var multer=require(_0xe605('0x0'));var util=require(_0xe605('0x1'));var path=require('path');var timeout=require(_0xe605('0x2'));var express=require(_0xe605('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe605('0x4'));var config=require(_0xe605('0x5'));var controller=require(_0xe605('0x6'));router['get']('/',auth[_0xe605('0x7')](),controller[_0xe605('0x8')]);router['get']('/:id',auth[_0xe605('0x7')](),controller[_0xe605('0x9')]);router[_0xe605('0xa')](_0xe605('0xb'),auth[_0xe605('0x7')](),controller['getHoppers']);router[_0xe605('0xa')](_0xe605('0xc'),auth[_0xe605('0x7')](),controller[_0xe605('0xd')]);router[_0xe605('0xa')]('/:id/hopper_finals',auth[_0xe605('0x7')](),controller[_0xe605('0xe')]);router[_0xe605('0xa')](_0xe605('0xf'),auth[_0xe605('0x7')](),controller[_0xe605('0x10')]);router[_0xe605('0xa')]('/:id/lists',auth[_0xe605('0x7')](),controller[_0xe605('0x11')]);router[_0xe605('0xa')](_0xe605('0x12'),auth[_0xe605('0x7')](),controller[_0xe605('0x13')]);router['post']('/',auth[_0xe605('0x7')](),controller[_0xe605('0x14')]);router[_0xe605('0x15')](_0xe605('0x16'),auth[_0xe605('0x7')](),controller[_0xe605('0x17')]);router[_0xe605('0x15')]('/:id/lists',auth[_0xe605('0x7')](),controller['addLists']);router['post']('/:id/blacklists',auth[_0xe605('0x7')](),controller[_0xe605('0x18')]);router[_0xe605('0x19')](_0xe605('0x1a'),auth[_0xe605('0x7')](),controller[_0xe605('0x1b')]);router[_0xe605('0x1c')]('/:id',auth[_0xe605('0x7')](),controller[_0xe605('0x1d')]);router[_0xe605('0x1c')](_0xe605('0x1e'),auth['isAuthenticated'](),controller[_0xe605('0x1f')]);router[_0xe605('0x1c')](_0xe605('0x12'),auth['isAuthenticated'](),controller[_0xe605('0x20')]);module[_0xe605('0x21')]=router;
\ No newline at end of file
+var _0x6e73=['addLists','addBlackLists','put','update','destroy','delete','/:id/blacklists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getBlackLists','post','create','/:id/clone','clone','/:id/lists'];(function(_0x5d2cf3,_0x16bfd2){var _0x45a3fc=function(_0x24e67f){while(--_0x24e67f){_0x5d2cf3['push'](_0x5d2cf3['shift']());}};_0x45a3fc(++_0x16bfd2);}(_0x6e73,0x110));var _0x36e7=function(_0xcf1602,_0x1da275){_0xcf1602=_0xcf1602-0x0;var _0x2bfa18=_0x6e73[_0xcf1602];return _0x2bfa18;};'use strict';var multer=require(_0x36e7('0x0'));var util=require(_0x36e7('0x1'));var path=require(_0x36e7('0x2'));var timeout=require(_0x36e7('0x3'));var express=require(_0x36e7('0x4'));var router=express[_0x36e7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x36e7('0x6'));var interaction=require(_0x36e7('0x7'));var config=require(_0x36e7('0x8'));var controller=require(_0x36e7('0x9'));router[_0x36e7('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x36e7('0xa')](_0x36e7('0xb'),auth[_0x36e7('0xc')](),controller[_0x36e7('0xd')]);router[_0x36e7('0xa')](_0x36e7('0xe'),auth[_0x36e7('0xc')](),controller[_0x36e7('0xf')]);router[_0x36e7('0xa')](_0x36e7('0x10'),auth[_0x36e7('0xc')](),controller[_0x36e7('0x11')]);router[_0x36e7('0xa')](_0x36e7('0x12'),auth[_0x36e7('0xc')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0x36e7('0xc')](),controller['getHopperBlacks']);router[_0x36e7('0xa')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router['get']('/:id/blacklists',auth[_0x36e7('0xc')](),controller[_0x36e7('0x13')]);router[_0x36e7('0x14')]('/',auth[_0x36e7('0xc')](),controller[_0x36e7('0x15')]);router['post'](_0x36e7('0x16'),auth['isAuthenticated'](),controller[_0x36e7('0x17')]);router['post'](_0x36e7('0x18'),auth[_0x36e7('0xc')](),controller[_0x36e7('0x19')]);router[_0x36e7('0x14')]('/:id/blacklists',auth[_0x36e7('0xc')](),controller[_0x36e7('0x1a')]);router[_0x36e7('0x1b')]('/:id',auth[_0x36e7('0xc')](),controller[_0x36e7('0x1c')]);router['delete'](_0x36e7('0xb'),auth[_0x36e7('0xc')](),controller[_0x36e7('0x1d')]);router[_0x36e7('0x1e')](_0x36e7('0x18'),auth[_0x36e7('0xc')](),controller['removeLists']);router[_0x36e7('0x1e')](_0x36e7('0x1f'),auth[_0x36e7('0xc')](),controller['removeBlackLists']);module[_0x36e7('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index ed3bf0c..55d79ae 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 _0x8cb6=['medium','VIRTUAL','getDataValue','sequelize','exports','TEXT'];(function(_0xb74c89,_0x246040){var _0xe4ccef=function(_0x12b652){while(--_0x12b652){_0xb74c89['push'](_0xb74c89['shift']());}};_0xe4ccef(++_0x246040);}(_0x8cb6,0xff));var _0x68cb=function(_0x32aa68,_0x102e89){_0x32aa68=_0x32aa68-0x0;var _0x292133=_0x8cb6[_0x32aa68];return _0x292133;};'use strict';var Sequelize=require(_0x68cb('0x0'));module[_0x68cb('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x68cb('0x2')],'length':_0x68cb('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x68cb('0x4')],'get':function(){return this[_0x68cb('0x5')]('key');}}};
\ No newline at end of file
+var _0xfb09=['sequelize','exports','STRING','VIRTUAL','getDataValue','key'];(function(_0x3f9584,_0x5ab12c){var _0x9d54c=function(_0x2882df){while(--_0x2882df){_0x3f9584['push'](_0x3f9584['shift']());}};_0x9d54c(++_0x5ab12c);}(_0xfb09,0xa8));var _0x9fb0=function(_0x4138ac,_0x300097){_0x4138ac=_0x4138ac-0x0;var _0x66154=_0xfb09[_0x4138ac];return _0x66154;};'use strict';var Sequelize=require(_0x9fb0('0x0'));module[_0x9fb0('0x1')]={'key':{'type':Sequelize[_0x9fb0('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x9fb0('0x2')]},'name':{'type':Sequelize[_0x9fb0('0x3')],'get':function(){return this[_0x9fb0('0x4')](_0x9fb0('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 35116e7..18dc0eb 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 _0x5043=['util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','name','send','map','CannedAnswer','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','rawAttributes','options','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x43e2f6,_0x40d666){var _0x59b26d=function(_0x43360d){while(--_0x43360d){_0x43e2f6['push'](_0x43e2f6['shift']());}};_0x59b26d(++_0x40d666);}(_0x5043,0x108));var _0x3504=function(_0x5e9587,_0xac1c87){_0x5e9587=_0x5e9587-0x0;var _0x1c7d40=_0x5043[_0x5e9587];return _0x1c7d40;};'use strict';var emlformat=require(_0x3504('0x0'));var rimraf=require(_0x3504('0x1'));var zipdir=require(_0x3504('0x2'));var jsonpatch=require(_0x3504('0x3'));var rp=require('request-promise');var moment=require(_0x3504('0x4'));var BPromise=require(_0x3504('0x5'));var Mustache=require('mustache');var util=require(_0x3504('0x6'));var path=require(_0x3504('0x7'));var sox=require(_0x3504('0x8'));var csv=require(_0x3504('0x9'));var ejs=require(_0x3504('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3504('0xb'));var squel=require(_0x3504('0xc'));var crypto=require(_0x3504('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3504('0xe'));var Papa=require('papaparse');var Redis=require(_0x3504('0xf'));var authService=require(_0x3504('0x10'));var qs=require(_0x3504('0x11'));var as=require(_0x3504('0x12'));var hardwareService=require(_0x3504('0x13'));var logger=require(_0x3504('0x14'))(_0x3504('0x15'));var utils=require(_0x3504('0x16'));var config=require(_0x3504('0x17'));var licenseUtil=require(_0x3504('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x236eb7,_0x432730){_0x432730=_0x432730||0xcc;return function(_0xb757ff){if(_0xb757ff){return _0x236eb7[_0x3504('0x19')](_0x432730);}return _0x236eb7[_0x3504('0x1a')](_0x432730)[_0x3504('0x1b')]();};}function respondWithResult(_0x496368,_0x6472a2){_0x6472a2=_0x6472a2||0xc8;return function(_0x356d0e){if(_0x356d0e){return _0x496368['status'](_0x6472a2)[_0x3504('0x1c')](_0x356d0e);}};}function respondWithFilteredResult(_0x39a6eb,_0xc2a402){return function(_0x2b7241){if(_0x2b7241){var _0x15e147=typeof _0xc2a402[_0x3504('0x1d')]===_0x3504('0x1e')&&typeof _0xc2a402[_0x3504('0x1f')]===_0x3504('0x1e');var _0x5e84d8=_0x2b7241[_0x3504('0x20')];var _0x127602=_0x15e147?0x0:_0xc2a402[_0x3504('0x1d')];var _0x15cd0f=_0x15e147?_0x2b7241[_0x3504('0x20')]:_0xc2a402['offset']+_0xc2a402[_0x3504('0x1f')];var _0x1cc5d1;if(_0x15cd0f>=_0x5e84d8){_0x15cd0f=_0x5e84d8;_0x1cc5d1=0xc8;}else{_0x1cc5d1=0xce;}_0x39a6eb[_0x3504('0x1a')](_0x1cc5d1);return _0x39a6eb[_0x3504('0x21')](_0x3504('0x22'),_0x127602+'-'+_0x15cd0f+'/'+_0x5e84d8)['json'](_0x2b7241);}return null;};}function patchUpdates(_0x1d72e3){return function(_0x28dc9a){try{jsonpatch[_0x3504('0x23')](_0x28dc9a,_0x1d72e3,!![]);}catch(_0x51a27b){return BPromise[_0x3504('0x24')](_0x51a27b);}return _0x28dc9a[_0x3504('0x25')]();};}function saveUpdates(_0x153bb5,_0x18a501){return function(_0x19daf2){if(_0x19daf2){return _0x19daf2[_0x3504('0x26')](_0x153bb5)[_0x3504('0x27')](function(_0x5032b5){return _0x5032b5;});}return null;};}function removeEntity(_0x579dbd,_0x49f8a8){return function(_0xa1c06f){if(_0xa1c06f){return _0xa1c06f[_0x3504('0x28')]()[_0x3504('0x27')](function(){var _0x5dbf0b=_0xa1c06f[_0x3504('0x29')]({'plain':!![]});var _0x30f1fc=_0x3504('0x2a');return db[_0x3504('0x2b')]['destroy']({'where':{'type':_0x30f1fc,'resourceId':_0x5dbf0b['id']}})[_0x3504('0x27')](function(){return _0xa1c06f;});})[_0x3504('0x27')](function(){_0x579dbd[_0x3504('0x1a')](0xcc)[_0x3504('0x1b')]();});}};}function handleEntityNotFound(_0x39162e,_0x304790){return function(_0x3bad8e){if(!_0x3bad8e){_0x39162e[_0x3504('0x19')](0x194);}return _0x3bad8e;};}function handleError(_0x35823b,_0x402e02){_0x402e02=_0x402e02||0x1f4;return function(_0x5c058c){logger[_0x3504('0x2c')](_0x5c058c['stack']);if(_0x5c058c[_0x3504('0x2d')]){delete _0x5c058c[_0x3504('0x2d')];}_0x35823b[_0x3504('0x1a')](_0x402e02)[_0x3504('0x2e')](_0x5c058c);};}exports['index']=function(_0x282e0c,_0x58fa48){var _0x5b5119={},_0x279da9={},_0x10b746={'count':0x0,'rows':[]};var _0xe29ac2=_[_0x3504('0x2f')](db[_0x3504('0x30')]['rawAttributes'],function(_0x4d11fd){return{'name':_0x4d11fd['fieldName'],'type':_0x4d11fd[_0x3504('0x31')][_0x3504('0x32')]};});_0x279da9[_0x3504('0x33')]=_[_0x3504('0x2f')](_0xe29ac2,_0x3504('0x2d'));_0x279da9[_0x3504('0x34')]=_[_0x3504('0x35')](_0x282e0c[_0x3504('0x34')]);_0x279da9[_0x3504('0x36')]=_[_0x3504('0x37')](_0x279da9[_0x3504('0x33')],_0x279da9[_0x3504('0x34')]);_0x5b5119['attributes']=_[_0x3504('0x37')](_0x279da9[_0x3504('0x33')],qs['fields'](_0x282e0c['query'][_0x3504('0x38')]));_0x5b5119[_0x3504('0x39')]=_0x5b5119[_0x3504('0x39')][_0x3504('0x3a')]?_0x5b5119[_0x3504('0x39')]:_0x279da9[_0x3504('0x33')];if(!_0x282e0c['query'][_0x3504('0x3b')]('nolimit')){_0x5b5119['limit']=qs[_0x3504('0x1f')](_0x282e0c['query'][_0x3504('0x1f')]);_0x5b5119[_0x3504('0x1d')]=qs['offset'](_0x282e0c['query'][_0x3504('0x1d')]);}_0x5b5119[_0x3504('0x3c')]=qs[_0x3504('0x3d')](_0x282e0c['query'][_0x3504('0x3d')]);_0x5b5119[_0x3504('0x3e')]=qs[_0x3504('0x36')](_[_0x3504('0x3f')](_0x282e0c[_0x3504('0x34')],_0x279da9[_0x3504('0x36')]),_0xe29ac2);if(_0x282e0c[_0x3504('0x34')][_0x3504('0x40')]){_0x5b5119['where']=_[_0x3504('0x41')](_0x5b5119[_0x3504('0x3e')],{'$or':[{'key':{'$like':'%'+_0x282e0c[_0x3504('0x34')][_0x3504('0x40')]+'%'}},{'value':{'$like':'%'+_0x282e0c['query'][_0x3504('0x40')]+'%'}}]});}_0x5b5119=_[_0x3504('0x41')]({},_0x5b5119,_0x282e0c['options']);var _0x1f1bff={'where':_0x5b5119['where']};return db['CannedAnswer'][_0x3504('0x20')](_0x1f1bff)[_0x3504('0x27')](function(_0x3dab4c){_0x10b746['count']=_0x3dab4c;if(_0x282e0c['query'][_0x3504('0x42')]){_0x5b5119[_0x3504('0x43')]=[{'all':!![]}];}return db[_0x3504('0x30')]['findAll'](_0x5b5119);})[_0x3504('0x27')](function(_0x59f1fb){_0x10b746[_0x3504('0x44')]=_0x59f1fb;return _0x10b746;})[_0x3504('0x27')](respondWithFilteredResult(_0x58fa48,_0x5b5119))[_0x3504('0x45')](handleError(_0x58fa48,null));};exports[_0x3504('0x46')]=function(_0x13c04f,_0x53b0bf){var _0x5874fb={'raw':!![],'where':{'id':_0x13c04f['params']['id']}},_0x397cb1={};_0x397cb1[_0x3504('0x33')]=_[_0x3504('0x35')](db[_0x3504('0x30')][_0x3504('0x47')]);_0x397cb1['query']=_[_0x3504('0x35')](_0x13c04f['query']);_0x397cb1['filters']=_['intersection'](_0x397cb1['model'],_0x397cb1[_0x3504('0x34')]);_0x5874fb[_0x3504('0x39')]=_[_0x3504('0x37')](_0x397cb1[_0x3504('0x33')],qs[_0x3504('0x38')](_0x13c04f[_0x3504('0x34')][_0x3504('0x38')]));_0x5874fb[_0x3504('0x39')]=_0x5874fb['attributes'][_0x3504('0x3a')]?_0x5874fb[_0x3504('0x39')]:_0x397cb1[_0x3504('0x33')];if(_0x13c04f[_0x3504('0x34')][_0x3504('0x42')]){_0x5874fb['include']=[{'all':!![]}];}_0x5874fb=_[_0x3504('0x41')]({},_0x5874fb,_0x13c04f[_0x3504('0x48')]);return db[_0x3504('0x30')][_0x3504('0x49')](_0x5874fb)[_0x3504('0x27')](handleEntityNotFound(_0x53b0bf,null))[_0x3504('0x27')](respondWithResult(_0x53b0bf,null))[_0x3504('0x45')](handleError(_0x53b0bf,null));};exports['update']=function(_0x1242cb,_0x2bbfdc){if(_0x1242cb[_0x3504('0x4a')]['id']){delete _0x1242cb[_0x3504('0x4a')]['id'];}return db[_0x3504('0x30')][_0x3504('0x49')]({'where':{'id':_0x1242cb[_0x3504('0x4b')]['id']}})[_0x3504('0x27')](handleEntityNotFound(_0x2bbfdc,null))[_0x3504('0x27')](saveUpdates(_0x1242cb[_0x3504('0x4a')],null))[_0x3504('0x27')](respondWithResult(_0x2bbfdc,null))[_0x3504('0x45')](handleError(_0x2bbfdc,null));};exports[_0x3504('0x28')]=function(_0xdd9ffc,_0x5ef83d){return db[_0x3504('0x30')]['find']({'where':{'id':_0xdd9ffc[_0x3504('0x4b')]['id']}})[_0x3504('0x27')](handleEntityNotFound(_0x5ef83d,null))['then'](removeEntity(_0x5ef83d,null))[_0x3504('0x45')](handleError(_0x5ef83d,null));};exports[_0x3504('0x4c')]=function(_0x4433fc,_0x21cfb7){var _0x5aac1c={'key':_0x4433fc['body'][_0x3504('0x32')]};if(_0x4433fc['body'][_0x3504('0x4d')]){_0x5aac1c[_0x3504('0x4d')]=_0x4433fc[_0x3504('0x4a')][_0x3504('0x4d')];}else if(_0x4433fc[_0x3504('0x4a')][_0x3504('0x4e')]){_0x5aac1c[_0x3504('0x4e')]=_0x4433fc[_0x3504('0x4a')][_0x3504('0x4e')];}else if(_0x4433fc[_0x3504('0x4a')][_0x3504('0x4f')]){_0x5aac1c[_0x3504('0x4f')]=_0x4433fc[_0x3504('0x4a')][_0x3504('0x4f')];}else if(_0x4433fc[_0x3504('0x4a')][_0x3504('0x50')]){_0x5aac1c[_0x3504('0x50')]=_0x4433fc[_0x3504('0x4a')][_0x3504('0x50')];}return db['CannedAnswer']['find']({'where':_0x5aac1c})[_0x3504('0x27')](function(_0x48a8c4){if(_0x48a8c4){throw new db[(_0x3504('0x51'))][(_0x3504('0x52'))](_0x3504('0x53'));}return db[_0x3504('0x30')][_0x3504('0x4c')](_0x4433fc[_0x3504('0x4a')]);})[_0x3504('0x27')](function(_0x2e4fdd){var _0xcfc241=_0x4433fc[_0x3504('0x54')][_0x3504('0x29')]({'plain':!![]});if(!_0xcfc241)throw new Error(_0x3504('0x55'));if(_0xcfc241[_0x3504('0x56')]===_0x3504('0x54')){var _0x46bc47=_0x2e4fdd[_0x3504('0x29')]({'plain':!![]});return db[_0x3504('0x57')][_0x3504('0x49')]({'where':{'name':_0x3504('0x2a'),'userProfileId':_0xcfc241[_0x3504('0x58')]},'raw':!![]})[_0x3504('0x27')](function(_0x2744ec){if(_0x2744ec&&_0x2744ec[_0x3504('0x59')]===0x0){return db[_0x3504('0x2b')][_0x3504('0x4c')]({'name':_0x46bc47[_0x3504('0x2d')],'resourceId':_0x46bc47['id'],'type':_0x2744ec['name'],'sectionId':_0x2744ec['id']},{})[_0x3504('0x27')](function(){return _0x2e4fdd;});}else{return _0x2e4fdd;}})['catch'](function(_0x4cf9d5){logger[_0x3504('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cf9d5);throw _0x4cf9d5;});}return _0x2e4fdd;})['then'](respondWithResult(_0x21cfb7,0xc9))[_0x3504('0x45')](handleError(_0x21cfb7,null));};
\ No newline at end of file
+var _0xb097=['pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','get','CannedAnswers','name','send','index','map','CannedAnswer','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb097,0xcc));var _0x7b09=function(_0x593e4c,_0x5b965b){_0x593e4c=_0x593e4c-0x0;var _0x15171a=_0xb097[_0x593e4c];return _0x15171a;};'use strict';var emlformat=require(_0x7b09('0x0'));var rimraf=require(_0x7b09('0x1'));var zipdir=require(_0x7b09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b09('0x3'));var BPromise=require(_0x7b09('0x4'));var Mustache=require('mustache');var util=require(_0x7b09('0x5'));var path=require(_0x7b09('0x6'));var sox=require('sox');var csv=require(_0x7b09('0x7'));var ejs=require(_0x7b09('0x8'));var fs=require('fs');var fs_extra=require(_0x7b09('0x9'));var _=require(_0x7b09('0xa'));var squel=require(_0x7b09('0xb'));var crypto=require(_0x7b09('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7b09('0xd'));var toCsv=require(_0x7b09('0x7'));var querystring=require(_0x7b09('0xe'));var Papa=require(_0x7b09('0xf'));var Redis=require(_0x7b09('0x10'));var authService=require(_0x7b09('0x11'));var qs=require(_0x7b09('0x12'));var as=require(_0x7b09('0x13'));var hardwareService=require(_0x7b09('0x14'));var logger=require(_0x7b09('0x15'))(_0x7b09('0x16'));var utils=require(_0x7b09('0x17'));var config=require(_0x7b09('0x18'));var licenseUtil=require(_0x7b09('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ebb8f,_0x3391d4){_0x3391d4=_0x3391d4||0xcc;return function(_0x251ad1){if(_0x251ad1){return _0x2ebb8f[_0x7b09('0x1a')](_0x3391d4);}return _0x2ebb8f['status'](_0x3391d4)[_0x7b09('0x1b')]();};}function respondWithResult(_0x52c32b,_0x4f3ec7){_0x4f3ec7=_0x4f3ec7||0xc8;return function(_0x429ddf){if(_0x429ddf){return _0x52c32b[_0x7b09('0x1c')](_0x4f3ec7)[_0x7b09('0x1d')](_0x429ddf);}};}function respondWithFilteredResult(_0x13b632,_0x139480){return function(_0x5eed78){if(_0x5eed78){var _0x3d1157=typeof _0x139480[_0x7b09('0x1e')]===_0x7b09('0x1f')&&typeof _0x139480[_0x7b09('0x20')]===_0x7b09('0x1f');var _0x4637dc=_0x5eed78[_0x7b09('0x21')];var _0x1f73d7=_0x3d1157?0x0:_0x139480[_0x7b09('0x1e')];var _0x420702=_0x3d1157?_0x5eed78['count']:_0x139480['offset']+_0x139480['limit'];var _0xfa03e8;if(_0x420702>=_0x4637dc){_0x420702=_0x4637dc;_0xfa03e8=0xc8;}else{_0xfa03e8=0xce;}_0x13b632[_0x7b09('0x1c')](_0xfa03e8);return _0x13b632[_0x7b09('0x22')]('Content-Range',_0x1f73d7+'-'+_0x420702+'/'+_0x4637dc)['json'](_0x5eed78);}return null;};}function patchUpdates(_0x17b191){return function(_0x1d2d73){try{jsonpatch[_0x7b09('0x23')](_0x1d2d73,_0x17b191,!![]);}catch(_0x5197bd){return BPromise['reject'](_0x5197bd);}return _0x1d2d73[_0x7b09('0x24')]();};}function saveUpdates(_0x26caf7,_0x4af089){return function(_0x2e4175){if(_0x2e4175){return _0x2e4175[_0x7b09('0x25')](_0x26caf7)['then'](function(_0x15ee35){return _0x15ee35;});}return null;};}function removeEntity(_0x38f356,_0x2e58a8){return function(_0x1e08c3){if(_0x1e08c3){return _0x1e08c3[_0x7b09('0x26')]()[_0x7b09('0x27')](function(){var _0xe267ac=_0x1e08c3[_0x7b09('0x28')]({'plain':!![]});var _0x5b0f63=_0x7b09('0x29');return db['UserProfileResource'][_0x7b09('0x26')]({'where':{'type':_0x5b0f63,'resourceId':_0xe267ac['id']}})[_0x7b09('0x27')](function(){return _0x1e08c3;});})[_0x7b09('0x27')](function(){_0x38f356['status'](0xcc)[_0x7b09('0x1b')]();});}};}function handleEntityNotFound(_0x37f319,_0x36faa5){return function(_0x8a849e){if(!_0x8a849e){_0x37f319[_0x7b09('0x1a')](0x194);}return _0x8a849e;};}function handleError(_0x1297c4,_0x24867c){_0x24867c=_0x24867c||0x1f4;return function(_0x4535dd){logger['error'](_0x4535dd['stack']);if(_0x4535dd[_0x7b09('0x2a')]){delete _0x4535dd[_0x7b09('0x2a')];}_0x1297c4['status'](_0x24867c)[_0x7b09('0x2b')](_0x4535dd);};}exports[_0x7b09('0x2c')]=function(_0x5551d6,_0x442c11){var _0x206343={},_0xa3e5ec={},_0x47c016={'count':0x0,'rows':[]};var _0x546bf7=_[_0x7b09('0x2d')](db[_0x7b09('0x2e')]['rawAttributes'],function(_0x225494){return{'name':_0x225494[_0x7b09('0x2f')],'type':_0x225494['type'][_0x7b09('0x30')]};});_0xa3e5ec[_0x7b09('0x31')]=_['map'](_0x546bf7,_0x7b09('0x2a'));_0xa3e5ec[_0x7b09('0x32')]=_[_0x7b09('0x33')](_0x5551d6[_0x7b09('0x32')]);_0xa3e5ec['filters']=_['intersection'](_0xa3e5ec[_0x7b09('0x31')],_0xa3e5ec[_0x7b09('0x32')]);_0x206343[_0x7b09('0x34')]=_[_0x7b09('0x35')](_0xa3e5ec[_0x7b09('0x31')],qs[_0x7b09('0x36')](_0x5551d6[_0x7b09('0x32')]['fields']));_0x206343[_0x7b09('0x34')]=_0x206343['attributes'][_0x7b09('0x37')]?_0x206343[_0x7b09('0x34')]:_0xa3e5ec[_0x7b09('0x31')];if(!_0x5551d6[_0x7b09('0x32')][_0x7b09('0x38')]('nolimit')){_0x206343['limit']=qs[_0x7b09('0x20')](_0x5551d6['query']['limit']);_0x206343[_0x7b09('0x1e')]=qs[_0x7b09('0x1e')](_0x5551d6[_0x7b09('0x32')]['offset']);}_0x206343['order']=qs[_0x7b09('0x39')](_0x5551d6[_0x7b09('0x32')][_0x7b09('0x39')]);_0x206343[_0x7b09('0x3a')]=qs[_0x7b09('0x3b')](_[_0x7b09('0x3c')](_0x5551d6[_0x7b09('0x32')],_0xa3e5ec['filters']),_0x546bf7);if(_0x5551d6[_0x7b09('0x32')][_0x7b09('0x3d')]){_0x206343[_0x7b09('0x3a')]=_[_0x7b09('0x3e')](_0x206343[_0x7b09('0x3a')],{'$or':[{'key':{'$like':'%'+_0x5551d6[_0x7b09('0x32')][_0x7b09('0x3d')]+'%'}},{'value':{'$like':'%'+_0x5551d6['query']['filter']+'%'}}]});}_0x206343=_[_0x7b09('0x3e')]({},_0x206343,_0x5551d6[_0x7b09('0x3f')]);var _0x6fb9a8={'where':_0x206343[_0x7b09('0x3a')]};return db[_0x7b09('0x2e')][_0x7b09('0x21')](_0x6fb9a8)[_0x7b09('0x27')](function(_0x39906d){_0x47c016[_0x7b09('0x21')]=_0x39906d;if(_0x5551d6[_0x7b09('0x32')][_0x7b09('0x40')]){_0x206343[_0x7b09('0x41')]=[{'all':!![]}];}return db[_0x7b09('0x2e')][_0x7b09('0x42')](_0x206343);})['then'](function(_0xcdd95b){_0x47c016[_0x7b09('0x43')]=_0xcdd95b;return _0x47c016;})[_0x7b09('0x27')](respondWithFilteredResult(_0x442c11,_0x206343))[_0x7b09('0x44')](handleError(_0x442c11,null));};exports[_0x7b09('0x45')]=function(_0x47fcb0,_0x108914){var _0x2ff7b6={'raw':!![],'where':{'id':_0x47fcb0[_0x7b09('0x46')]['id']}},_0x4bf86b={};_0x4bf86b[_0x7b09('0x31')]=_[_0x7b09('0x33')](db[_0x7b09('0x2e')]['rawAttributes']);_0x4bf86b[_0x7b09('0x32')]=_['keys'](_0x47fcb0['query']);_0x4bf86b[_0x7b09('0x3b')]=_[_0x7b09('0x35')](_0x4bf86b[_0x7b09('0x31')],_0x4bf86b[_0x7b09('0x32')]);_0x2ff7b6[_0x7b09('0x34')]=_[_0x7b09('0x35')](_0x4bf86b[_0x7b09('0x31')],qs['fields'](_0x47fcb0[_0x7b09('0x32')][_0x7b09('0x36')]));_0x2ff7b6[_0x7b09('0x34')]=_0x2ff7b6[_0x7b09('0x34')][_0x7b09('0x37')]?_0x2ff7b6[_0x7b09('0x34')]:_0x4bf86b[_0x7b09('0x31')];if(_0x47fcb0['query'][_0x7b09('0x40')]){_0x2ff7b6['include']=[{'all':!![]}];}_0x2ff7b6=_[_0x7b09('0x3e')]({},_0x2ff7b6,_0x47fcb0[_0x7b09('0x3f')]);return db[_0x7b09('0x2e')]['find'](_0x2ff7b6)[_0x7b09('0x27')](handleEntityNotFound(_0x108914,null))[_0x7b09('0x27')](respondWithResult(_0x108914,null))[_0x7b09('0x44')](handleError(_0x108914,null));};exports[_0x7b09('0x25')]=function(_0x9b0c8a,_0x4f4a68){if(_0x9b0c8a[_0x7b09('0x47')]['id']){delete _0x9b0c8a[_0x7b09('0x47')]['id'];}return db[_0x7b09('0x2e')][_0x7b09('0x48')]({'where':{'id':_0x9b0c8a[_0x7b09('0x46')]['id']}})[_0x7b09('0x27')](handleEntityNotFound(_0x4f4a68,null))['then'](saveUpdates(_0x9b0c8a[_0x7b09('0x47')],null))['then'](respondWithResult(_0x4f4a68,null))[_0x7b09('0x44')](handleError(_0x4f4a68,null));};exports[_0x7b09('0x26')]=function(_0x4500fd,_0x367536){return db[_0x7b09('0x2e')][_0x7b09('0x48')]({'where':{'id':_0x4500fd['params']['id']}})[_0x7b09('0x27')](handleEntityNotFound(_0x367536,null))[_0x7b09('0x27')](removeEntity(_0x367536,null))[_0x7b09('0x44')](handleError(_0x367536,null));};exports[_0x7b09('0x49')]=function(_0x2bae25,_0x29bb3c){var _0x53cd23={'key':_0x2bae25[_0x7b09('0x47')][_0x7b09('0x30')]};if(_0x2bae25[_0x7b09('0x47')][_0x7b09('0x4a')]){_0x53cd23[_0x7b09('0x4a')]=_0x2bae25['body'][_0x7b09('0x4a')];}else if(_0x2bae25['body'][_0x7b09('0x4b')]){_0x53cd23[_0x7b09('0x4b')]=_0x2bae25[_0x7b09('0x47')][_0x7b09('0x4b')];}else if(_0x2bae25[_0x7b09('0x47')][_0x7b09('0x4c')]){_0x53cd23['OpenchannelAccountId']=_0x2bae25[_0x7b09('0x47')][_0x7b09('0x4c')];}else if(_0x2bae25[_0x7b09('0x47')][_0x7b09('0x4d')]){_0x53cd23['ChatWebsiteId']=_0x2bae25['body'][_0x7b09('0x4d')];}return db['CannedAnswer'][_0x7b09('0x48')]({'where':_0x53cd23})[_0x7b09('0x27')](function(_0x52c1d4){if(_0x52c1d4){throw new db[(_0x7b09('0x4e'))][(_0x7b09('0x4f'))](_0x7b09('0x50'));}return db[_0x7b09('0x2e')][_0x7b09('0x49')](_0x2bae25[_0x7b09('0x47')]);})['then'](function(_0x144d52){var _0x26d41b=_0x2bae25[_0x7b09('0x51')]['get']({'plain':!![]});if(!_0x26d41b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26d41b[_0x7b09('0x52')]===_0x7b09('0x51')){var _0x1466fb=_0x144d52[_0x7b09('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x7b09('0x48')]({'where':{'name':_0x7b09('0x29'),'userProfileId':_0x26d41b[_0x7b09('0x53')]},'raw':!![]})[_0x7b09('0x27')](function(_0x41d08f){if(_0x41d08f&&_0x41d08f[_0x7b09('0x54')]===0x0){return db[_0x7b09('0x55')]['create']({'name':_0x1466fb[_0x7b09('0x2a')],'resourceId':_0x1466fb['id'],'type':_0x41d08f[_0x7b09('0x2a')],'sectionId':_0x41d08f['id']},{})[_0x7b09('0x27')](function(){return _0x144d52;});}else{return _0x144d52;}})[_0x7b09('0x44')](function(_0xab3131){logger[_0x7b09('0x56')](_0x7b09('0x57'),_0xab3131);throw _0xab3131;});}return _0x144d52;})[_0x7b09('0x27')](respondWithResult(_0x29bb3c,0xc9))['catch'](handleError(_0x29bb3c,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 8eede87..f2a6140 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 _0x9058=['../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3948c3,_0x2299eb){var _0x34d877=function(_0x5028bd){while(--_0x5028bd){_0x3948c3['push'](_0x3948c3['shift']());}};_0x34d877(++_0x2299eb);}(_0x9058,0x17e));var _0x8905=function(_0x58a03e,_0x5b3f89){_0x58a03e=_0x58a03e-0x0;var _0x41e782=_0x9058[_0x58a03e];return _0x41e782;};'use strict';var _=require(_0x8905('0x0'));var util=require('util');var logger=require(_0x8905('0x1'))(_0x8905('0x2'));var moment=require(_0x8905('0x3'));var BPromise=require(_0x8905('0x4'));var rp=require(_0x8905('0x5'));var fs=require('fs');var path=require(_0x8905('0x6'));var rimraf=require(_0x8905('0x7'));var config=require(_0x8905('0x8'));var attributes=require(_0x8905('0x9'));module[_0x8905('0xa')]=function(_0x4f16b3,_0x136991){return _0x4f16b3[_0x8905('0xb')](_0x8905('0xc'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8905('0xd'),'collate':_0x8905('0xe')});};
\ No newline at end of file
+var _0x59d0=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x5b6ba1,_0x49f578){var _0x417c60=function(_0x562ffb){while(--_0x562ffb){_0x5b6ba1['push'](_0x5b6ba1['shift']());}};_0x417c60(++_0x49f578);}(_0x59d0,0x129));var _0x059d=function(_0x1448d8,_0x51afba){_0x1448d8=_0x1448d8-0x0;var _0x108f1f=_0x59d0[_0x1448d8];return _0x108f1f;};'use strict';var _=require(_0x059d('0x0'));var util=require('util');var logger=require(_0x059d('0x1'))(_0x059d('0x2'));var moment=require('moment');var BPromise=require(_0x059d('0x3'));var rp=require(_0x059d('0x4'));var fs=require('fs');var path=require(_0x059d('0x5'));var rimraf=require(_0x059d('0x6'));var config=require(_0x059d('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x059d('0x8')]=function(_0x45943d,_0x364db8){return _0x45943d[_0x059d('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x059d('0xa'),'collate':_0x059d('0xb')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 1413831..b64c290 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(_0x2678f0,_0x444b62){var _0x5aec26=function(_0x19dbf7){while(--_0x19dbf7){_0x2678f0['push'](_0x2678f0['shift']());}};_0x5aec26(++_0x444b62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x5bb0ed,_0x21ea31){var _0x541335=function(_0x29dce9){while(--_0x29dce9){_0x5bb0ed['push'](_0x5bb0ed['shift']());}};_0x541335(++_0x21ea31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 81565b7..6a913b8 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 _0x2157=['get','isAuthenticated','/:id','show','post','create','put','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller'];(function(_0x54f048,_0x474311){var _0x249fd8=function(_0x5bf786){while(--_0x5bf786){_0x54f048['push'](_0x54f048['shift']());}};_0x249fd8(++_0x474311);}(_0x2157,0x178));var _0x7215=function(_0x1bac98,_0x576397){_0x1bac98=_0x1bac98-0x0;var _0x2f6fff=_0x2157[_0x1bac98];return _0x2f6fff;};'use strict';var multer=require(_0x7215('0x0'));var util=require(_0x7215('0x1'));var path=require(_0x7215('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7215('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7215('0x4'));var interaction=require(_0x7215('0x5'));var config=require(_0x7215('0x6'));var controller=require(_0x7215('0x7'));router[_0x7215('0x8')]('/',auth[_0x7215('0x9')](),controller['index']);router[_0x7215('0x8')](_0x7215('0xa'),auth[_0x7215('0x9')](),controller[_0x7215('0xb')]);router[_0x7215('0xc')]('/',auth['isAuthenticated'](),controller[_0x7215('0xd')]);router[_0x7215('0xe')](_0x7215('0xa'),auth[_0x7215('0x9')](),controller['update']);router['delete'](_0x7215('0xa'),auth[_0x7215('0x9')](),controller['destroy']);module[_0x7215('0xf')]=router;
\ No newline at end of file
+var _0xb795=['./cannedAnswer.controller','get','index','isAuthenticated','show','put','/:id','update','destroy','multer','path','connect-timeout','express','fs-extra','../../config/environment'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xb795,0x180));var _0x5b79=function(_0x276c8d,_0x437fa6){_0x276c8d=_0x276c8d-0x0;var _0x51c99f=_0xb795[_0x276c8d];return _0x51c99f;};'use strict';var multer=require(_0x5b79('0x0'));var util=require('util');var path=require(_0x5b79('0x1'));var timeout=require(_0x5b79('0x2'));var express=require(_0x5b79('0x3'));var router=express['Router']();var fs_extra=require(_0x5b79('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5b79('0x5'));var controller=require(_0x5b79('0x6'));router[_0x5b79('0x7')]('/',auth['isAuthenticated'](),controller[_0x5b79('0x8')]);router['get']('/:id',auth[_0x5b79('0x9')](),controller[_0x5b79('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5b79('0xb')](_0x5b79('0xc'),auth[_0x5b79('0x9')](),controller[_0x5b79('0xd')]);router['delete'](_0x5b79('0xc'),auth[_0x5b79('0x9')](),controller[_0x5b79('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index e9bcb8e..7adc6be 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 _0xd6fd=['INTEGER','sequelize','exports','STRING'];(function(_0x5afe7b,_0x332fab){var _0x8253c7=function(_0x33bcd1){while(--_0x33bcd1){_0x5afe7b['push'](_0x5afe7b['shift']());}};_0x8253c7(++_0x332fab);}(_0xd6fd,0x7d));var _0xdd6f=function(_0x679fa1,_0x3614fa){_0x679fa1=_0x679fa1-0x0;var _0x3463b9=_0xd6fd[_0x679fa1];return _0x3463b9;};'use strict';var Sequelize=require(_0xdd6f('0x0'));module[_0xdd6f('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xdd6f('0x2')]},'dst':{'type':Sequelize[_0xdd6f('0x2')]},'dcontext':{'type':Sequelize[_0xdd6f('0x2')]},'channel':{'type':Sequelize[_0xdd6f('0x2')]},'dstchannel':{'type':Sequelize[_0xdd6f('0x2')]},'lastapp':{'type':Sequelize[_0xdd6f('0x2')]},'lastdata':{'type':Sequelize[_0xdd6f('0x2')]},'duration':{'type':Sequelize[_0xdd6f('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xdd6f('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xdd6f('0x2')]},'amaflags':{'type':Sequelize[_0xdd6f('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xdd6f('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xdd6f('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xdd6f('0x2')]},'type':{'type':Sequelize[_0xdd6f('0x2')]},'tag':{'type':Sequelize[_0xdd6f('0x2')]}};
\ No newline at end of file
+var _0x1db3=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x58cc27,_0xc4c30b){var _0x40a3ec=function(_0xbb4c7c){while(--_0xbb4c7c){_0x58cc27['push'](_0x58cc27['shift']());}};_0x40a3ec(++_0xc4c30b);}(_0x1db3,0x1e5));var _0x31db=function(_0x163abc,_0x5ae42e){_0x163abc=_0x163abc-0x0;var _0x43ab13=_0x1db3[_0x163abc];return _0x43ab13;};'use strict';var Sequelize=require('sequelize');module[_0x31db('0x0')]={'calldate':{'type':Sequelize[_0x31db('0x1')],'allowNull':![],'defaultValue':_0x31db('0x2')},'clid':{'type':Sequelize[_0x31db('0x3')]},'src':{'type':Sequelize[_0x31db('0x3')]},'dst':{'type':Sequelize[_0x31db('0x3')]},'dcontext':{'type':Sequelize[_0x31db('0x3')]},'channel':{'type':Sequelize[_0x31db('0x3')]},'dstchannel':{'type':Sequelize[_0x31db('0x3')]},'lastapp':{'type':Sequelize[_0x31db('0x3')]},'lastdata':{'type':Sequelize[_0x31db('0x3')]},'duration':{'type':Sequelize[_0x31db('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x31db('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x31db('0x3')]},'amaflags':{'type':Sequelize[_0x31db('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x31db('0x3')]},'userfield':{'type':Sequelize[_0x31db('0x3')]},'uniqueid':{'type':Sequelize[_0x31db('0x3')]},'linkedid':{'type':Sequelize[_0x31db('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x31db('0x3')]},'type':{'type':Sequelize[_0x31db('0x3')]},'tag':{'type':Sequelize[_0x31db('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index ec8d3af..2538496 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 _0x0618=['catch','show','intersection','options','create','body','update','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','end','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','then','rows'];(function(_0x409d51,_0x1f0de6){var _0x13eb4b=function(_0x374388){while(--_0x374388){_0x409d51['push'](_0x409d51['shift']());}};_0x13eb4b(++_0x1f0de6);}(_0x0618,0x1c6));var _0x8061=function(_0x56c445,_0x3b5b87){_0x56c445=_0x56c445-0x0;var _0x5d729a=_0x0618[_0x56c445];return _0x5d729a;};'use strict';var emlformat=require(_0x8061('0x0'));var rimraf=require(_0x8061('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8061('0x2'));var rp=require(_0x8061('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8061('0x4'));var util=require(_0x8061('0x5'));var path=require(_0x8061('0x6'));var sox=require(_0x8061('0x7'));var csv=require(_0x8061('0x8'));var ejs=require(_0x8061('0x9'));var fs=require('fs');var fs_extra=require(_0x8061('0xa'));var _=require(_0x8061('0xb'));var squel=require(_0x8061('0xc'));var crypto=require(_0x8061('0xd'));var jsforce=require(_0x8061('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8061('0x8'));var querystring=require('querystring');var Papa=require(_0x8061('0xf'));var Redis=require(_0x8061('0x10'));var authService=require(_0x8061('0x11'));var qs=require(_0x8061('0x12'));var as=require(_0x8061('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8061('0x14'));var utils=require(_0x8061('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8061('0x16'))['db'];function respondWithStatusCode(_0x141707,_0x724e64){_0x724e64=_0x724e64||0xcc;return function(_0x3537f0){if(_0x3537f0){return _0x141707[_0x8061('0x17')](_0x724e64);}return _0x141707[_0x8061('0x18')](_0x724e64)['end']();};}function respondWithResult(_0x4df59c,_0x19ea89){_0x19ea89=_0x19ea89||0xc8;return function(_0x4da339){if(_0x4da339){return _0x4df59c[_0x8061('0x18')](_0x19ea89)[_0x8061('0x19')](_0x4da339);}};}function respondWithFilteredResult(_0x567988,_0x483af8){return function(_0x460dfd){if(_0x460dfd){var _0x3264ff=typeof _0x483af8[_0x8061('0x1a')]===_0x8061('0x1b')&&typeof _0x483af8[_0x8061('0x1c')]===_0x8061('0x1b');var _0x280f9b=_0x460dfd[_0x8061('0x1d')];var _0x2b0eab=_0x3264ff?0x0:_0x483af8[_0x8061('0x1a')];var _0x14230e=_0x3264ff?_0x460dfd[_0x8061('0x1d')]:_0x483af8[_0x8061('0x1a')]+_0x483af8['limit'];var _0x4d254d;if(_0x14230e>=_0x280f9b){_0x14230e=_0x280f9b;_0x4d254d=0xc8;}else{_0x4d254d=0xce;}_0x567988[_0x8061('0x18')](_0x4d254d);return _0x567988[_0x8061('0x1e')](_0x8061('0x1f'),_0x2b0eab+'-'+_0x14230e+'/'+_0x280f9b)['json'](_0x460dfd);}return null;};}function patchUpdates(_0x53f869){return function(_0x36ccd5){try{jsonpatch[_0x8061('0x20')](_0x36ccd5,_0x53f869,!![]);}catch(_0x2bc509){return BPromise[_0x8061('0x21')](_0x2bc509);}return _0x36ccd5['save']();};}function saveUpdates(_0x49f708,_0x1cd5ed){return function(_0x12e73d){if(_0x12e73d){return _0x12e73d['update'](_0x49f708)['then'](function(_0x3dbaea){return _0x3dbaea;});}return null;};}function removeEntity(_0x554faa,_0x535cc9){return function(_0x37bff0){if(_0x37bff0){return _0x37bff0[_0x8061('0x22')]()['then'](function(){_0x554faa['status'](0xcc)[_0x8061('0x23')]();});}};}function handleEntityNotFound(_0x3f2765,_0x4e0860){return function(_0x1b0ec7){if(!_0x1b0ec7){_0x3f2765[_0x8061('0x17')](0x194);}return _0x1b0ec7;};}function handleError(_0x39fb5c,_0x2f7544){_0x2f7544=_0x2f7544||0x1f4;return function(_0x5f0822){logger['error'](_0x5f0822[_0x8061('0x24')]);if(_0x5f0822[_0x8061('0x25')]){delete _0x5f0822[_0x8061('0x25')];}_0x39fb5c[_0x8061('0x18')](_0x2f7544)[_0x8061('0x26')](_0x5f0822);};}exports['index']=function(_0x4c9202,_0x518700){var _0x59a65d={},_0xfb9138={},_0x38317c={'count':0x0,'rows':[]};var _0x36714f=_[_0x8061('0x27')](db[_0x8061('0x28')][_0x8061('0x29')],function(_0x2d1537){return{'name':_0x2d1537[_0x8061('0x2a')],'type':_0x2d1537[_0x8061('0x2b')][_0x8061('0x2c')]};});_0xfb9138['model']=_['map'](_0x36714f,_0x8061('0x25'));_0xfb9138[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x4c9202[_0x8061('0x2d')]);_0xfb9138[_0x8061('0x2f')]=_['intersection'](_0xfb9138[_0x8061('0x30')],_0xfb9138[_0x8061('0x2d')]);_0x59a65d['attributes']=_['intersection'](_0xfb9138[_0x8061('0x30')],qs[_0x8061('0x31')](_0x4c9202['query'][_0x8061('0x31')]));_0x59a65d[_0x8061('0x32')]=_0x59a65d[_0x8061('0x32')][_0x8061('0x33')]?_0x59a65d[_0x8061('0x32')]:_0xfb9138[_0x8061('0x30')];if(!_0x4c9202[_0x8061('0x2d')][_0x8061('0x34')](_0x8061('0x35'))){_0x59a65d['limit']=qs[_0x8061('0x1c')](_0x4c9202[_0x8061('0x2d')][_0x8061('0x1c')]);_0x59a65d[_0x8061('0x1a')]=qs['offset'](_0x4c9202['query']['offset']);}_0x59a65d['order']=qs['sort'](_0x4c9202[_0x8061('0x2d')]['sort']);_0x59a65d[_0x8061('0x36')]=qs[_0x8061('0x2f')](_[_0x8061('0x37')](_0x4c9202[_0x8061('0x2d')],_0xfb9138[_0x8061('0x2f')]),_0x36714f);if(_0x4c9202['query'][_0x8061('0x38')]){_0x59a65d[_0x8061('0x36')]=_[_0x8061('0x39')](_0x59a65d[_0x8061('0x36')],{'$or':_[_0x8061('0x27')](_0x36714f,function(_0x31ed9d){if(_0x31ed9d[_0x8061('0x2b')]!==_0x8061('0x3a')){var _0x714833={};_0x714833[_0x31ed9d[_0x8061('0x25')]]={'$like':'%'+_0x4c9202[_0x8061('0x2d')][_0x8061('0x38')]+'%'};return _0x714833;}})});}_0x59a65d=_['merge']({},_0x59a65d,_0x4c9202['options']);var _0xb72481={'where':_0x59a65d['where']};return db[_0x8061('0x28')]['count'](_0xb72481)['then'](function(_0x105747){_0x38317c[_0x8061('0x1d')]=_0x105747;if(_0x4c9202[_0x8061('0x2d')][_0x8061('0x3b')]){_0x59a65d[_0x8061('0x3c')]=[{'all':!![]}];}return db[_0x8061('0x28')][_0x8061('0x3d')](_0x59a65d);})[_0x8061('0x3e')](function(_0x1475b1){_0x38317c[_0x8061('0x3f')]=_0x1475b1;return _0x38317c;})['then'](respondWithFilteredResult(_0x518700,_0x59a65d))[_0x8061('0x40')](handleError(_0x518700,null));};exports[_0x8061('0x41')]=function(_0x177ab1,_0x2675e3){var _0x4435b8={'raw':!![],'where':{'id':_0x177ab1['params']['id']}},_0x4ea342={};_0x4ea342[_0x8061('0x30')]=_[_0x8061('0x2e')](db[_0x8061('0x28')][_0x8061('0x29')]);_0x4ea342[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x177ab1[_0x8061('0x2d')]);_0x4ea342['filters']=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],_0x4ea342[_0x8061('0x2d')]);_0x4435b8[_0x8061('0x32')]=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],qs[_0x8061('0x31')](_0x177ab1['query'][_0x8061('0x31')]));_0x4435b8['attributes']=_0x4435b8[_0x8061('0x32')][_0x8061('0x33')]?_0x4435b8[_0x8061('0x32')]:_0x4ea342['model'];if(_0x177ab1['query'][_0x8061('0x3b')]){_0x4435b8[_0x8061('0x3c')]=[{'all':!![]}];}_0x4435b8=_[_0x8061('0x39')]({},_0x4435b8,_0x177ab1[_0x8061('0x43')]);return db[_0x8061('0x28')]['find'](_0x4435b8)['then'](handleEntityNotFound(_0x2675e3,null))[_0x8061('0x3e')](respondWithResult(_0x2675e3,null))['catch'](handleError(_0x2675e3,null));};exports[_0x8061('0x44')]=function(_0x393bc9,_0x54546a){return db[_0x8061('0x28')][_0x8061('0x44')](_0x393bc9[_0x8061('0x45')],{})[_0x8061('0x3e')](respondWithResult(_0x54546a,0xc9))['catch'](handleError(_0x54546a,null));};exports[_0x8061('0x46')]=function(_0xb1cc9d,_0x2eaab6){if(_0xb1cc9d[_0x8061('0x45')]['id']){delete _0xb1cc9d[_0x8061('0x45')]['id'];}return db[_0x8061('0x28')][_0x8061('0x47')]({'where':{'id':_0xb1cc9d[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x2eaab6,null))[_0x8061('0x3e')](saveUpdates(_0xb1cc9d[_0x8061('0x45')],null))[_0x8061('0x3e')](respondWithResult(_0x2eaab6,null))[_0x8061('0x40')](handleError(_0x2eaab6,null));};exports[_0x8061('0x22')]=function(_0x291c8b,_0x30771f){return db[_0x8061('0x28')]['find']({'where':{'id':_0x291c8b[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x30771f,null))[_0x8061('0x3e')](removeEntity(_0x30771f,null))[_0x8061('0x40')](handleError(_0x30771f,null));};exports['describe']=function(_0x2be970,_0xd63f0e){return db[_0x8061('0x28')][_0x8061('0x49')]()[_0x8061('0x3e')](respondWithResult(_0xd63f0e,null))[_0x8061('0x40')](handleError(_0xd63f0e,null));};
\ No newline at end of file
+var _0x7bae=['hasOwnProperty','order','sort','where','filter','type','merge','options','includeAll','include','catch','show','params','keys','find','create','body','destroy','describe','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','error','stack','name','index','map','Cdr','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x7bae,0x13b));var _0xe7ba=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x7bae[_0x3de8a4];return _0x4635cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7ba('0x0'));var jsonpatch=require(_0xe7ba('0x1'));var rp=require('request-promise');var moment=require(_0xe7ba('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe7ba('0x3'));var util=require(_0xe7ba('0x4'));var path=require(_0xe7ba('0x5'));var sox=require(_0xe7ba('0x6'));var csv=require(_0xe7ba('0x7'));var ejs=require(_0xe7ba('0x8'));var fs=require('fs');var fs_extra=require(_0xe7ba('0x9'));var _=require(_0xe7ba('0xa'));var squel=require(_0xe7ba('0xb'));var crypto=require(_0xe7ba('0xc'));var jsforce=require(_0xe7ba('0xd'));var deskjs=require(_0xe7ba('0xe'));var toCsv=require(_0xe7ba('0x7'));var querystring=require(_0xe7ba('0xf'));var Papa=require('papaparse');var Redis=require(_0xe7ba('0x10'));var authService=require(_0xe7ba('0x11'));var qs=require(_0xe7ba('0x12'));var as=require(_0xe7ba('0x13'));var hardwareService=require(_0xe7ba('0x14'));var logger=require(_0xe7ba('0x15'))(_0xe7ba('0x16'));var utils=require(_0xe7ba('0x17'));var config=require(_0xe7ba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7ba('0x19'))['db'];function respondWithStatusCode(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xcc;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0x1a')](_0x602b1);}return _0x588c8b[_0xe7ba('0x1b')](_0x602b1)[_0xe7ba('0x1c')]();};}function respondWithResult(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0xc8;return function(_0x561c48){if(_0x561c48){return _0x41369f[_0xe7ba('0x1b')](_0x561dbb)[_0xe7ba('0x1d')](_0x561c48);}};}function respondWithFilteredResult(_0x359f6f,_0x5d1d03){return function(_0x4390e3){if(_0x4390e3){var _0x4b20fd=typeof _0x5d1d03['offset']==='undefined'&&typeof _0x5d1d03[_0xe7ba('0x1e')]==='undefined';var _0x41a773=_0x4390e3['count'];var _0x4e3021=_0x4b20fd?0x0:_0x5d1d03['offset'];var _0x3f326a=_0x4b20fd?_0x4390e3[_0xe7ba('0x1f')]:_0x5d1d03[_0xe7ba('0x20')]+_0x5d1d03[_0xe7ba('0x1e')];var _0x1c8b5b;if(_0x3f326a>=_0x41a773){_0x3f326a=_0x41a773;_0x1c8b5b=0xc8;}else{_0x1c8b5b=0xce;}_0x359f6f['status'](_0x1c8b5b);return _0x359f6f[_0xe7ba('0x21')](_0xe7ba('0x22'),_0x4e3021+'-'+_0x3f326a+'/'+_0x41a773)[_0xe7ba('0x1d')](_0x4390e3);}return null;};}function patchUpdates(_0x136ec6){return function(_0x4aaf35){try{jsonpatch[_0xe7ba('0x23')](_0x4aaf35,_0x136ec6,!![]);}catch(_0x2936b7){return BPromise['reject'](_0x2936b7);}return _0x4aaf35[_0xe7ba('0x24')]();};}function saveUpdates(_0x4514e8,_0x27c882){return function(_0x7ab9e4){if(_0x7ab9e4){return _0x7ab9e4[_0xe7ba('0x25')](_0x4514e8)[_0xe7ba('0x26')](function(_0x293b14){return _0x293b14;});}return null;};}function removeEntity(_0x2b29f0,_0x41cbd9){return function(_0xa72f1c){if(_0xa72f1c){return _0xa72f1c['destroy']()['then'](function(){_0x2b29f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4363a8,_0x576513){return function(_0x4ecc0d){if(!_0x4ecc0d){_0x4363a8['sendStatus'](0x194);}return _0x4ecc0d;};}function handleError(_0x255def,_0x32cc00){_0x32cc00=_0x32cc00||0x1f4;return function(_0xe32862){logger[_0xe7ba('0x27')](_0xe32862[_0xe7ba('0x28')]);if(_0xe32862[_0xe7ba('0x29')]){delete _0xe32862[_0xe7ba('0x29')];}_0x255def[_0xe7ba('0x1b')](_0x32cc00)['send'](_0xe32862);};}exports[_0xe7ba('0x2a')]=function(_0x48c869,_0x102925){var _0x92fe7={},_0x369451={},_0x4bf5f9={'count':0x0,'rows':[]};var _0x587c7d=_[_0xe7ba('0x2b')](db[_0xe7ba('0x2c')][_0xe7ba('0x2d')],function(_0x20b6cd){return{'name':_0x20b6cd[_0xe7ba('0x2e')],'type':_0x20b6cd['type'][_0xe7ba('0x2f')]};});_0x369451[_0xe7ba('0x30')]=_['map'](_0x587c7d,_0xe7ba('0x29'));_0x369451['query']=_['keys'](_0x48c869[_0xe7ba('0x31')]);_0x369451[_0xe7ba('0x32')]=_[_0xe7ba('0x33')](_0x369451['model'],_0x369451[_0xe7ba('0x31')]);_0x92fe7['attributes']=_[_0xe7ba('0x33')](_0x369451[_0xe7ba('0x30')],qs[_0xe7ba('0x34')](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x34')]));_0x92fe7['attributes']=_0x92fe7[_0xe7ba('0x35')][_0xe7ba('0x36')]?_0x92fe7['attributes']:_0x369451[_0xe7ba('0x30')];if(!_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x37')]('nolimit')){_0x92fe7[_0xe7ba('0x1e')]=qs[_0xe7ba('0x1e')](_0x48c869['query'][_0xe7ba('0x1e')]);_0x92fe7[_0xe7ba('0x20')]=qs[_0xe7ba('0x20')](_0x48c869['query'][_0xe7ba('0x20')]);}_0x92fe7[_0xe7ba('0x38')]=qs['sort'](_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x39')]);_0x92fe7[_0xe7ba('0x3a')]=qs['filters'](_['pick'](_0x48c869[_0xe7ba('0x31')],_0x369451[_0xe7ba('0x32')]),_0x587c7d);if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3b')]){_0x92fe7[_0xe7ba('0x3a')]=_['merge'](_0x92fe7[_0xe7ba('0x3a')],{'$or':_[_0xe7ba('0x2b')](_0x587c7d,function(_0x3139a6){if(_0x3139a6[_0xe7ba('0x3c')]!=='VIRTUAL'){var _0xe67917={};_0xe67917[_0x3139a6[_0xe7ba('0x29')]]={'$like':'%'+_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3b')]+'%'};return _0xe67917;}})});}_0x92fe7=_[_0xe7ba('0x3d')]({},_0x92fe7,_0x48c869[_0xe7ba('0x3e')]);var _0x124cc4={'where':_0x92fe7['where']};return db[_0xe7ba('0x2c')][_0xe7ba('0x1f')](_0x124cc4)[_0xe7ba('0x26')](function(_0x401b0a){_0x4bf5f9[_0xe7ba('0x1f')]=_0x401b0a;if(_0x48c869[_0xe7ba('0x31')][_0xe7ba('0x3f')]){_0x92fe7[_0xe7ba('0x40')]=[{'all':!![]}];}return db[_0xe7ba('0x2c')]['findAll'](_0x92fe7);})[_0xe7ba('0x26')](function(_0x417734){_0x4bf5f9['rows']=_0x417734;return _0x4bf5f9;})['then'](respondWithFilteredResult(_0x102925,_0x92fe7))[_0xe7ba('0x41')](handleError(_0x102925,null));};exports[_0xe7ba('0x42')]=function(_0x368af2,_0x5589c4){var _0x249e1d={'raw':!![],'where':{'id':_0x368af2[_0xe7ba('0x43')]['id']}},_0x82246e={};_0x82246e[_0xe7ba('0x30')]=_[_0xe7ba('0x44')](db['Cdr'][_0xe7ba('0x2d')]);_0x82246e['query']=_[_0xe7ba('0x44')](_0x368af2[_0xe7ba('0x31')]);_0x82246e[_0xe7ba('0x32')]=_[_0xe7ba('0x33')](_0x82246e[_0xe7ba('0x30')],_0x82246e[_0xe7ba('0x31')]);_0x249e1d[_0xe7ba('0x35')]=_[_0xe7ba('0x33')](_0x82246e['model'],qs[_0xe7ba('0x34')](_0x368af2[_0xe7ba('0x31')][_0xe7ba('0x34')]));_0x249e1d[_0xe7ba('0x35')]=_0x249e1d[_0xe7ba('0x35')][_0xe7ba('0x36')]?_0x249e1d[_0xe7ba('0x35')]:_0x82246e[_0xe7ba('0x30')];if(_0x368af2[_0xe7ba('0x31')][_0xe7ba('0x3f')]){_0x249e1d['include']=[{'all':!![]}];}_0x249e1d=_[_0xe7ba('0x3d')]({},_0x249e1d,_0x368af2['options']);return db[_0xe7ba('0x2c')][_0xe7ba('0x45')](_0x249e1d)[_0xe7ba('0x26')](handleEntityNotFound(_0x5589c4,null))[_0xe7ba('0x26')](respondWithResult(_0x5589c4,null))[_0xe7ba('0x41')](handleError(_0x5589c4,null));};exports[_0xe7ba('0x46')]=function(_0x48ae57,_0x271592){return db[_0xe7ba('0x2c')][_0xe7ba('0x46')](_0x48ae57[_0xe7ba('0x47')],{})[_0xe7ba('0x26')](respondWithResult(_0x271592,0xc9))[_0xe7ba('0x41')](handleError(_0x271592,null));};exports[_0xe7ba('0x25')]=function(_0x266ace,_0x272cb9){if(_0x266ace[_0xe7ba('0x47')]['id']){delete _0x266ace[_0xe7ba('0x47')]['id'];}return db['Cdr'][_0xe7ba('0x45')]({'where':{'id':_0x266ace[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0x272cb9,null))[_0xe7ba('0x26')](saveUpdates(_0x266ace[_0xe7ba('0x47')],null))[_0xe7ba('0x26')](respondWithResult(_0x272cb9,null))['catch'](handleError(_0x272cb9,null));};exports[_0xe7ba('0x48')]=function(_0x3ee828,_0x520477){return db[_0xe7ba('0x2c')][_0xe7ba('0x45')]({'where':{'id':_0x3ee828[_0xe7ba('0x43')]['id']}})[_0xe7ba('0x26')](handleEntityNotFound(_0x520477,null))['then'](removeEntity(_0x520477,null))['catch'](handleError(_0x520477,null));};exports[_0xe7ba('0x49')]=function(_0x2cfdc3,_0x285743){return db['Cdr'][_0xe7ba('0x49')]()[_0xe7ba('0x26')](respondWithResult(_0x285743,null))[_0xe7ba('0x41')](handleError(_0x285743,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 3be4d14..2c81da1 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(_0x1635b5,_0x20dc22){var _0x485909=function(_0x527083){while(--_0x527083){_0x1635b5['push'](_0x1635b5['shift']());}};_0x485909(++_0x20dc22);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xd9154f,_0xc8881d){var _0x865cd8=function(_0x296469){while(--_0x296469){_0xd9154f['push'](_0xd9154f['shift']());}};_0x865cd8(++_0xc8881d);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index b6b2935..cbf7b0e 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 _0x6fed=['error','code','message','info','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x46225a,_0x326973){var _0x2d2f1e=function(_0x3e95a9){while(--_0x3e95a9){_0x46225a['push'](_0x46225a['shift']());}};_0x2d2f1e(++_0x326973);}(_0x6fed,0xee));var _0xd6fe=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6fed[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xd6fe('0x0'));var util=require(_0xd6fe('0x1'));var moment=require(_0xd6fe('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6fe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd6fe('0x4'));var logger=require(_0xd6fe('0x5'))(_0xd6fe('0x6'));var config=require(_0xd6fe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd6fe('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f9d4b,_0x1cc761,_0x4a0bc8){return new BPromise(function(_0x2a62c3,_0x8d8fde){return client['request'](_0x1f9d4b,_0x4a0bc8)[_0xd6fe('0x9')](function(_0x48462f){logger['info'](_0xd6fe('0xa'),_0x1cc761,_0xd6fe('0xb'));logger['debug'](_0xd6fe('0xc'),_0x1cc761,'request\x20sent',JSON[_0xd6fe('0xd')](_0x48462f));if(_0x48462f[_0xd6fe('0xe')]){if(_0x48462f[_0xd6fe('0xe')][_0xd6fe('0xf')]===0x1f4){logger[_0xd6fe('0xe')]('Cdr,\x20%s,\x20%s',_0x1cc761,_0x48462f[_0xd6fe('0xe')][_0xd6fe('0x10')]);return _0x8d8fde(_0x48462f[_0xd6fe('0xe')][_0xd6fe('0x10')]);}logger['error'](_0xd6fe('0xa'),_0x1cc761,_0x48462f[_0xd6fe('0xe')][_0xd6fe('0x10')]);return _0x2a62c3(_0x48462f[_0xd6fe('0xe')][_0xd6fe('0x10')]);}else{logger[_0xd6fe('0x11')](_0xd6fe('0xa'),_0x1cc761,_0xd6fe('0xb'));_0x2a62c3(_0x48462f['result'][_0xd6fe('0x10')]);}})['catch'](function(_0x4e1d3a){logger[_0xd6fe('0xe')](_0xd6fe('0xa'),_0x1cc761,_0x4e1d3a);_0x8d8fde(_0x4e1d3a);});});}
\ No newline at end of file
+var _0x170b=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x54c33a,_0x17ad4e){var _0x2590fa=function(_0x8a1afb){while(--_0x8a1afb){_0x54c33a['push'](_0x54c33a['shift']());}};_0x2590fa(++_0x17ad4e);}(_0x170b,0x1e2));var _0xb170=function(_0x26ea61,_0x1b983c){_0x26ea61=_0x26ea61-0x0;var _0x1b89c4=_0x170b[_0x26ea61];return _0x1b89c4;};'use strict';var _=require(_0xb170('0x0'));var util=require(_0xb170('0x1'));var moment=require(_0xb170('0x2'));var BPromise=require(_0xb170('0x3'));var rs=require(_0xb170('0x4'));var fs=require('fs');var Redis=require(_0xb170('0x5'));var db=require(_0xb170('0x6'))['db'];var utils=require(_0xb170('0x7'));var logger=require(_0xb170('0x8'))(_0xb170('0x9'));var config=require(_0xb170('0xa'));var jayson=require(_0xb170('0xb'));var client=jayson[_0xb170('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f1f75,_0x2dc437,_0x1672fc){return new BPromise(function(_0x3e5362,_0x5a2573){return client['request'](_0x2f1f75,_0x1672fc)[_0xb170('0xd')](function(_0x196327){logger['info'](_0xb170('0xe'),_0x2dc437,_0xb170('0xf'));logger[_0xb170('0x10')](_0xb170('0x11'),_0x2dc437,_0xb170('0xf'),JSON[_0xb170('0x12')](_0x196327));if(_0x196327[_0xb170('0x13')]){if(_0x196327[_0xb170('0x13')][_0xb170('0x14')]===0x1f4){logger[_0xb170('0x13')](_0xb170('0xe'),_0x2dc437,_0x196327[_0xb170('0x13')][_0xb170('0x15')]);return _0x5a2573(_0x196327[_0xb170('0x13')]['message']);}logger['error'](_0xb170('0xe'),_0x2dc437,_0x196327[_0xb170('0x13')][_0xb170('0x15')]);return _0x3e5362(_0x196327['error'][_0xb170('0x15')]);}else{logger[_0xb170('0x16')](_0xb170('0xe'),_0x2dc437,_0xb170('0xf'));_0x3e5362(_0x196327[_0xb170('0x17')][_0xb170('0x15')]);}})[_0xb170('0x18')](function(_0x1041d4){logger[_0xb170('0x13')](_0xb170('0xe'),_0x2dc437,_0x1041d4);_0x5a2573(_0x1041d4);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 9e09fad..dc30edb 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 _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(_0x3776b4,_0x19a1e3){var _0x1636d9=function(_0x320ae3){while(--_0x320ae3){_0x3776b4['push'](_0x3776b4['shift']());}};_0x1636d9(++_0x19a1e3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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
+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(_0x4fde9a,_0x5d1eda){var _0x58f321=function(_0x278061){while(--_0x278061){_0x4fde9a['push'](_0x4fde9a['shift']());}};_0x58f321(++_0x5d1eda);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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 a293f4d..0077574 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 _0x7b95=['INTEGER','STRING','noop','TEXT','sequelize','exports'];(function(_0xa3df8a,_0x537752){var _0x5b1996=function(_0x2e974d){while(--_0x2e974d){_0xa3df8a['push'](_0xa3df8a['shift']());}};_0x5b1996(++_0x537752);}(_0x7b95,0x112));var _0x57b9=function(_0x38e66c,_0x385b54){_0x38e66c=_0x38e66c-0x0;var _0x1efa7c=_0x7b95[_0x38e66c];return _0x1efa7c;};'use strict';var Sequelize=require(_0x57b9('0x0'));module[_0x57b9('0x1')]={'priority':{'type':Sequelize[_0x57b9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x57b9('0x3')],'allowNull':![],'defaultValue':_0x57b9('0x4')},'appdata':{'type':Sequelize[_0x57b9('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x57b9('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xa7e0=['sequelize','STRING','noop'];(function(_0x27c8f3,_0x35f6e8){var _0x4b8d62=function(_0x2261ef){while(--_0x2261ef){_0x27c8f3['push'](_0x27c8f3['shift']());}};_0x4b8d62(++_0x35f6e8);}(_0xa7e0,0x1e0));var _0x0a7e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa7e0[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x0a7e('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0a7e('0x1')],'allowNull':![],'defaultValue':_0x0a7e('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0a7e('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 1089f38..56ca651 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 _0xfbac=['length','includeAll','include','merge','options','ChatApplication','find','then','body','catch','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','squel','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','../../config/license/util','status','end','json','offset','undefined','count','limit','apply','reject','update','error','stack','name','send','show','model','rawAttributes','keys','filters','intersection','query','attributes','fields'];(function(_0x41f332,_0x1e0373){var _0x489bef=function(_0x1195e0){while(--_0x1195e0){_0x41f332['push'](_0x41f332['shift']());}};_0x489bef(++_0x1e0373);}(_0xfbac,0x167));var _0xcfba=function(_0x3835fa,_0x55a48e){_0x3835fa=_0x3835fa-0x0;var _0x41d64c=_0xfbac[_0x3835fa];return _0x41d64c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcfba('0x0'));var zipdir=require(_0xcfba('0x1'));var jsonpatch=require(_0xcfba('0x2'));var rp=require(_0xcfba('0x3'));var moment=require(_0xcfba('0x4'));var BPromise=require(_0xcfba('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcfba('0x6'));var sox=require(_0xcfba('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfba('0x8'));var _=require('lodash');var squel=require(_0xcfba('0x9'));var crypto=require('crypto');var jsforce=require(_0xcfba('0xa'));var deskjs=require(_0xcfba('0xb'));var toCsv=require('to-csv');var querystring=require(_0xcfba('0xc'));var Papa=require(_0xcfba('0xd'));var Redis=require(_0xcfba('0xe'));var authService=require(_0xcfba('0xf'));var qs=require(_0xcfba('0x10'));var as=require(_0xcfba('0x11'));var hardwareService=require(_0xcfba('0x12'));var logger=require(_0xcfba('0x13'))(_0xcfba('0x14'));var utils=require(_0xcfba('0x15'));var config=require(_0xcfba('0x16'));var licenseUtil=require(_0xcfba('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48d6f1,_0x1f590b){_0x1f590b=_0x1f590b||0xcc;return function(_0x24168c){if(_0x24168c){return _0x48d6f1['sendStatus'](_0x1f590b);}return _0x48d6f1[_0xcfba('0x18')](_0x1f590b)[_0xcfba('0x19')]();};}function respondWithResult(_0x335bfd,_0x226e89){_0x226e89=_0x226e89||0xc8;return function(_0x2333ee){if(_0x2333ee){return _0x335bfd[_0xcfba('0x18')](_0x226e89)[_0xcfba('0x1a')](_0x2333ee);}};}function respondWithFilteredResult(_0xa0508d,_0x2f497b){return function(_0x18d1d6){if(_0x18d1d6){var _0x231192=typeof _0x2f497b[_0xcfba('0x1b')]===_0xcfba('0x1c')&&typeof _0x2f497b['limit']===_0xcfba('0x1c');var _0x1d7be2=_0x18d1d6[_0xcfba('0x1d')];var _0x30c319=_0x231192?0x0:_0x2f497b[_0xcfba('0x1b')];var _0x778955=_0x231192?_0x18d1d6[_0xcfba('0x1d')]:_0x2f497b['offset']+_0x2f497b[_0xcfba('0x1e')];var _0x35c1e4;if(_0x778955>=_0x1d7be2){_0x778955=_0x1d7be2;_0x35c1e4=0xc8;}else{_0x35c1e4=0xce;}_0xa0508d[_0xcfba('0x18')](_0x35c1e4);return _0xa0508d['set']('Content-Range',_0x30c319+'-'+_0x778955+'/'+_0x1d7be2)[_0xcfba('0x1a')](_0x18d1d6);}return null;};}function patchUpdates(_0x43b745){return function(_0x40a0df){try{jsonpatch[_0xcfba('0x1f')](_0x40a0df,_0x43b745,!![]);}catch(_0x358610){return BPromise[_0xcfba('0x20')](_0x358610);}return _0x40a0df['save']();};}function saveUpdates(_0x1d4d83,_0x5d4c92){return function(_0x286d20){if(_0x286d20){return _0x286d20[_0xcfba('0x21')](_0x1d4d83)['then'](function(_0x25e9ea){return _0x25e9ea;});}return null;};}function removeEntity(_0x42cf58,_0x14850f){return function(_0x3fb061){if(_0x3fb061){return _0x3fb061['destroy']()['then'](function(){_0x42cf58[_0xcfba('0x18')](0xcc)[_0xcfba('0x19')]();});}};}function handleEntityNotFound(_0x200a77,_0x4c9098){return function(_0x1f01a7){if(!_0x1f01a7){_0x200a77['sendStatus'](0x194);}return _0x1f01a7;};}function handleError(_0x3eb614,_0x5e79c7){_0x5e79c7=_0x5e79c7||0x1f4;return function(_0x4ee825){logger[_0xcfba('0x22')](_0x4ee825[_0xcfba('0x23')]);if(_0x4ee825['name']){delete _0x4ee825[_0xcfba('0x24')];}_0x3eb614[_0xcfba('0x18')](_0x5e79c7)[_0xcfba('0x25')](_0x4ee825);};}exports[_0xcfba('0x26')]=function(_0xae6518,_0x1c3343){var _0x2ee85c={'raw':!![],'where':{'id':_0xae6518['params']['id']}},_0x4585ec={};_0x4585ec[_0xcfba('0x27')]=_['keys'](db['ChatApplication'][_0xcfba('0x28')]);_0x4585ec['query']=_[_0xcfba('0x29')](_0xae6518['query']);_0x4585ec[_0xcfba('0x2a')]=_[_0xcfba('0x2b')](_0x4585ec[_0xcfba('0x27')],_0x4585ec[_0xcfba('0x2c')]);_0x2ee85c[_0xcfba('0x2d')]=_[_0xcfba('0x2b')](_0x4585ec[_0xcfba('0x27')],qs[_0xcfba('0x2e')](_0xae6518['query']['fields']));_0x2ee85c['attributes']=_0x2ee85c[_0xcfba('0x2d')][_0xcfba('0x2f')]?_0x2ee85c['attributes']:_0x4585ec[_0xcfba('0x27')];if(_0xae6518['query'][_0xcfba('0x30')]){_0x2ee85c[_0xcfba('0x31')]=[{'all':!![]}];}_0x2ee85c=_[_0xcfba('0x32')]({},_0x2ee85c,_0xae6518[_0xcfba('0x33')]);return db[_0xcfba('0x34')][_0xcfba('0x35')](_0x2ee85c)[_0xcfba('0x36')](handleEntityNotFound(_0x1c3343,null))[_0xcfba('0x36')](respondWithResult(_0x1c3343,null))['catch'](handleError(_0x1c3343,null));};exports[_0xcfba('0x21')]=function(_0x1d23ea,_0x2d0085){if(_0x1d23ea[_0xcfba('0x37')]['id']){delete _0x1d23ea[_0xcfba('0x37')]['id'];}return db[_0xcfba('0x34')][_0xcfba('0x35')]({'where':{'id':_0x1d23ea['params']['id']}})[_0xcfba('0x36')](handleEntityNotFound(_0x2d0085,null))[_0xcfba('0x36')](saveUpdates(_0x1d23ea[_0xcfba('0x37')],null))[_0xcfba('0x36')](respondWithResult(_0x2d0085,null))[_0xcfba('0x38')](handleError(_0x2d0085,null));};exports['destroy']=function(_0x4d94df,_0x62fc63){return db[_0xcfba('0x34')][_0xcfba('0x35')]({'where':{'id':_0x4d94df[_0xcfba('0x39')]['id']}})['then'](handleEntityNotFound(_0x62fc63,null))[_0xcfba('0x36')](removeEntity(_0x62fc63,null))[_0xcfba('0x38')](handleError(_0x62fc63,null));};
\ No newline at end of file
+var _0x0d74=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','save','update','then','destroy','error','stack','name','show','params','model','ChatApplication','rawAttributes','query','keys','intersection','attributes','fields','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','squel','jsforce'];(function(_0x5bf79a,_0x2eaa1d){var _0x3ff10f=function(_0x48523){while(--_0x48523){_0x5bf79a['push'](_0x5bf79a['shift']());}};_0x3ff10f(++_0x2eaa1d);}(_0x0d74,0x146));var _0x40d7=function(_0x9f8eea,_0x4bcf8b){_0x9f8eea=_0x9f8eea-0x0;var _0x3b08b3=_0x0d74[_0x9f8eea];return _0x3b08b3;};'use strict';var emlformat=require(_0x40d7('0x0'));var rimraf=require(_0x40d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x40d7('0x2'));var moment=require(_0x40d7('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x40d7('0x4'));var path=require(_0x40d7('0x5'));var sox=require(_0x40d7('0x6'));var csv=require(_0x40d7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x40d7('0x8'));var crypto=require('crypto');var jsforce=require(_0x40d7('0x9'));var deskjs=require(_0x40d7('0xa'));var toCsv=require('to-csv');var querystring=require(_0x40d7('0xb'));var Papa=require(_0x40d7('0xc'));var Redis=require(_0x40d7('0xd'));var authService=require(_0x40d7('0xe'));var qs=require(_0x40d7('0xf'));var as=require(_0x40d7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40d7('0x11'))(_0x40d7('0x12'));var utils=require(_0x40d7('0x13'));var config=require(_0x40d7('0x14'));var licenseUtil=require(_0x40d7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43f1d8,_0xa08fd6){_0xa08fd6=_0xa08fd6||0xcc;return function(_0x3723a4){if(_0x3723a4){return _0x43f1d8[_0x40d7('0x16')](_0xa08fd6);}return _0x43f1d8['status'](_0xa08fd6)[_0x40d7('0x17')]();};}function respondWithResult(_0x4cb402,_0x14c12b){_0x14c12b=_0x14c12b||0xc8;return function(_0x2acc5b){if(_0x2acc5b){return _0x4cb402[_0x40d7('0x18')](_0x14c12b)[_0x40d7('0x19')](_0x2acc5b);}};}function respondWithFilteredResult(_0x1acc2f,_0x67d691){return function(_0x473fea){if(_0x473fea){var _0x55a7e0=typeof _0x67d691['offset']==='undefined'&&typeof _0x67d691[_0x40d7('0x1a')]===_0x40d7('0x1b');var _0x486d75=_0x473fea['count'];var _0x120964=_0x55a7e0?0x0:_0x67d691['offset'];var _0x4ed97e=_0x55a7e0?_0x473fea[_0x40d7('0x1c')]:_0x67d691[_0x40d7('0x1d')]+_0x67d691[_0x40d7('0x1a')];var _0x44fa91;if(_0x4ed97e>=_0x486d75){_0x4ed97e=_0x486d75;_0x44fa91=0xc8;}else{_0x44fa91=0xce;}_0x1acc2f[_0x40d7('0x18')](_0x44fa91);return _0x1acc2f[_0x40d7('0x1e')](_0x40d7('0x1f'),_0x120964+'-'+_0x4ed97e+'/'+_0x486d75)[_0x40d7('0x19')](_0x473fea);}return null;};}function patchUpdates(_0x5eb3c1){return function(_0x4c47cf){try{jsonpatch['apply'](_0x4c47cf,_0x5eb3c1,!![]);}catch(_0x34ea1d){return BPromise['reject'](_0x34ea1d);}return _0x4c47cf[_0x40d7('0x20')]();};}function saveUpdates(_0x145422,_0x985914){return function(_0x1a441a){if(_0x1a441a){return _0x1a441a[_0x40d7('0x21')](_0x145422)[_0x40d7('0x22')](function(_0xfec685){return _0xfec685;});}return null;};}function removeEntity(_0x3ccae9,_0x51180d){return function(_0x1cb3b2){if(_0x1cb3b2){return _0x1cb3b2[_0x40d7('0x23')]()['then'](function(){_0x3ccae9[_0x40d7('0x18')](0xcc)[_0x40d7('0x17')]();});}};}function handleEntityNotFound(_0x38276c,_0x29c62b){return function(_0x528ab5){if(!_0x528ab5){_0x38276c['sendStatus'](0x194);}return _0x528ab5;};}function handleError(_0x4889df,_0x4e7d84){_0x4e7d84=_0x4e7d84||0x1f4;return function(_0x539985){logger[_0x40d7('0x24')](_0x539985[_0x40d7('0x25')]);if(_0x539985[_0x40d7('0x26')]){delete _0x539985[_0x40d7('0x26')];}_0x4889df['status'](_0x4e7d84)['send'](_0x539985);};}exports[_0x40d7('0x27')]=function(_0x2b5f11,_0x4503cc){var _0x532ed5={'raw':!![],'where':{'id':_0x2b5f11[_0x40d7('0x28')]['id']}},_0x4fdf53={};_0x4fdf53[_0x40d7('0x29')]=_['keys'](db[_0x40d7('0x2a')][_0x40d7('0x2b')]);_0x4fdf53[_0x40d7('0x2c')]=_[_0x40d7('0x2d')](_0x2b5f11['query']);_0x4fdf53['filters']=_[_0x40d7('0x2e')](_0x4fdf53[_0x40d7('0x29')],_0x4fdf53[_0x40d7('0x2c')]);_0x532ed5[_0x40d7('0x2f')]=_[_0x40d7('0x2e')](_0x4fdf53[_0x40d7('0x29')],qs[_0x40d7('0x30')](_0x2b5f11['query'][_0x40d7('0x30')]));_0x532ed5[_0x40d7('0x2f')]=_0x532ed5[_0x40d7('0x2f')]['length']?_0x532ed5[_0x40d7('0x2f')]:_0x4fdf53[_0x40d7('0x29')];if(_0x2b5f11[_0x40d7('0x2c')][_0x40d7('0x31')]){_0x532ed5[_0x40d7('0x32')]=[{'all':!![]}];}_0x532ed5=_[_0x40d7('0x33')]({},_0x532ed5,_0x2b5f11[_0x40d7('0x34')]);return db['ChatApplication'][_0x40d7('0x35')](_0x532ed5)[_0x40d7('0x22')](handleEntityNotFound(_0x4503cc,null))[_0x40d7('0x22')](respondWithResult(_0x4503cc,null))[_0x40d7('0x36')](handleError(_0x4503cc,null));};exports[_0x40d7('0x21')]=function(_0x2d1ee6,_0x1e6f08){if(_0x2d1ee6[_0x40d7('0x37')]['id']){delete _0x2d1ee6['body']['id'];}return db['ChatApplication'][_0x40d7('0x35')]({'where':{'id':_0x2d1ee6[_0x40d7('0x28')]['id']}})['then'](handleEntityNotFound(_0x1e6f08,null))['then'](saveUpdates(_0x2d1ee6['body'],null))[_0x40d7('0x22')](respondWithResult(_0x1e6f08,null))['catch'](handleError(_0x1e6f08,null));};exports[_0x40d7('0x23')]=function(_0x56b17c,_0x798ba7){return db[_0x40d7('0x2a')][_0x40d7('0x35')]({'where':{'id':_0x56b17c[_0x40d7('0x28')]['id']}})[_0x40d7('0x22')](handleEntityNotFound(_0x798ba7,null))['then'](removeEntity(_0x798ba7,null))[_0x40d7('0x36')](handleError(_0x798ba7,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index fbd184b..f0ae709 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 _0x9a0b=['./chatApplication.attributes','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9a0b,0x7c));var _0xb9a0=function(_0x500cf0,_0x1ee8e5){_0x500cf0=_0x500cf0-0x0;var _0x1c55ba=_0x9a0b[_0x500cf0];return _0x1c55ba;};'use strict';var _=require('lodash');var util=require(_0xb9a0('0x0'));var logger=require(_0xb9a0('0x1'))(_0xb9a0('0x2'));var moment=require('moment');var BPromise=require(_0xb9a0('0x3'));var rp=require(_0xb9a0('0x4'));var fs=require('fs');var path=require(_0xb9a0('0x5'));var rimraf=require(_0xb9a0('0x6'));var config=require(_0xb9a0('0x7'));var attributes=require(_0xb9a0('0x8'));module['exports']=function(_0x519362,_0xa18963){return _0x519362['define']('ChatApplication',attributes,{'tableName':_0xb9a0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9a0('0xa'),'collate':_0xb9a0('0xb')});};
\ No newline at end of file
+var _0xf109=['../../config/logger','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf109,0xce));var _0x9f10=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xf109[_0x26f702];return _0x11417d;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9f10('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 0393365..fe66dda 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 _0x7d53=['jayson/promise','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1bc019,_0x3b33ec){var _0x4dc25f=function(_0x18168c){while(--_0x18168c){_0x1bc019['push'](_0x1bc019['shift']());}};_0x4dc25f(++_0x3b33ec);}(_0x7d53,0x134));var _0x37d5=function(_0xf6c23d,_0x2076d7){_0xf6c23d=_0xf6c23d-0x0;var _0x568084=_0x7d53[_0xf6c23d];return _0x568084;};'use strict';var _=require(_0x37d5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37d5('0x1'));var db=require(_0x37d5('0x2'))['db'];var utils=require(_0x37d5('0x3'));var logger=require(_0x37d5('0x4'))(_0x37d5('0x5'));var config=require(_0x37d5('0x6'));var jayson=require(_0x37d5('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5524b9,_0x45e187,_0xde65b9){return new BPromise(function(_0x3aa2e8,_0xe5e7a2){return client[_0x37d5('0x8')](_0x5524b9,_0xde65b9)[_0x37d5('0x9')](function(_0x2bb669){logger[_0x37d5('0xa')]('ChatApplication,\x20%s,\x20%s',_0x45e187,_0x37d5('0xb'));logger[_0x37d5('0xc')](_0x37d5('0xd'),_0x45e187,_0x37d5('0xb'),JSON[_0x37d5('0xe')](_0x2bb669));if(_0x2bb669[_0x37d5('0xf')]){if(_0x2bb669['error'][_0x37d5('0x10')]===0x1f4){logger[_0x37d5('0xf')]('ChatApplication,\x20%s,\x20%s',_0x45e187,_0x2bb669[_0x37d5('0xf')][_0x37d5('0x11')]);return _0xe5e7a2(_0x2bb669[_0x37d5('0xf')][_0x37d5('0x11')]);}logger['error'](_0x37d5('0x12'),_0x45e187,_0x2bb669[_0x37d5('0xf')][_0x37d5('0x11')]);return _0x3aa2e8(_0x2bb669[_0x37d5('0xf')][_0x37d5('0x11')]);}else{logger[_0x37d5('0xa')]('ChatApplication,\x20%s,\x20%s',_0x45e187,_0x37d5('0xb'));_0x3aa2e8(_0x2bb669[_0x37d5('0x13')][_0x37d5('0x11')]);}})[_0x37d5('0x14')](function(_0x3c3532){logger[_0x37d5('0xf')](_0x37d5('0x12'),_0x45e187,_0x3c3532);_0xe5e7a2(_0x3c3532);});});}
\ No newline at end of file
+var _0xd686=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0xd686,0x1cd));var _0x6d68=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0xd686[_0x31b5a5];return _0x364cc9;};'use strict';var _=require('lodash');var util=require(_0x6d68('0x0'));var moment=require(_0x6d68('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d68('0x2'));var db=require(_0x6d68('0x3'))['db'];var utils=require(_0x6d68('0x4'));var logger=require(_0x6d68('0x5'))(_0x6d68('0x6'));var config=require(_0x6d68('0x7'));var jayson=require(_0x6d68('0x8'));var client=jayson[_0x6d68('0x9')][_0x6d68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd86128,_0x2a453f,_0xb71e58){return new BPromise(function(_0x429455,_0x5ae778){return client[_0x6d68('0xb')](_0xd86128,_0xb71e58)[_0x6d68('0xc')](function(_0x5d4daf){logger[_0x6d68('0xd')](_0x6d68('0xe'),_0x2a453f,'request\x20sent');logger[_0x6d68('0xf')](_0x6d68('0x10'),_0x2a453f,'request\x20sent',JSON[_0x6d68('0x11')](_0x5d4daf));if(_0x5d4daf['error']){if(_0x5d4daf[_0x6d68('0x12')]['code']===0x1f4){logger[_0x6d68('0x12')](_0x6d68('0xe'),_0x2a453f,_0x5d4daf[_0x6d68('0x12')][_0x6d68('0x13')]);return _0x5ae778(_0x5d4daf[_0x6d68('0x12')][_0x6d68('0x13')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x2a453f,_0x5d4daf[_0x6d68('0x12')][_0x6d68('0x13')]);return _0x429455(_0x5d4daf[_0x6d68('0x12')][_0x6d68('0x13')]);}else{logger[_0x6d68('0xd')](_0x6d68('0xe'),_0x2a453f,_0x6d68('0x14'));_0x429455(_0x5d4daf[_0x6d68('0x15')][_0x6d68('0x13')]);}})['catch'](function(_0x32c3f0){logger[_0x6d68('0x12')](_0x6d68('0xe'),_0x2a453f,_0x32c3f0);_0x5ae778(_0x32c3f0);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index fda08bb..ef22fe8 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 _0x81d4=['destroy','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x413aac,_0x5e2430){var _0x569b11=function(_0x52e060){while(--_0x52e060){_0x413aac['push'](_0x413aac['shift']());}};_0x569b11(++_0x5e2430);}(_0x81d4,0xb7));var _0x481d=function(_0x846d94,_0xc08ef){_0x846d94=_0x846d94-0x0;var _0xb5f12d=_0x81d4[_0x846d94];return _0xb5f12d;};'use strict';var multer=require(_0x481d('0x0'));var util=require(_0x481d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x481d('0x2'));var auth=require(_0x481d('0x3'));var interaction=require(_0x481d('0x4'));var config=require('../../config/environment');var controller=require(_0x481d('0x5'));router[_0x481d('0x6')](_0x481d('0x7'),auth[_0x481d('0x8')](),controller[_0x481d('0x9')]);router[_0x481d('0xa')](_0x481d('0x7'),auth[_0x481d('0x8')](),controller[_0x481d('0xb')]);router['delete'](_0x481d('0x7'),auth['isAuthenticated'](),controller[_0x481d('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x8f5f=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','put'];(function(_0xe4fa3d,_0x405634){var _0x150d66=function(_0x439ae7){while(--_0x439ae7){_0xe4fa3d['push'](_0xe4fa3d['shift']());}};_0x150d66(++_0x405634);}(_0x8f5f,0xc5));var _0xf8f5=function(_0x46800d,_0x588500){_0x46800d=_0x46800d-0x0;var _0x3824cd=_0x8f5f[_0x46800d];return _0x3824cd;};'use strict';var multer=require(_0xf8f5('0x0'));var util=require(_0xf8f5('0x1'));var path=require(_0xf8f5('0x2'));var timeout=require(_0xf8f5('0x3'));var express=require(_0xf8f5('0x4'));var router=express[_0xf8f5('0x5')]();var fs_extra=require(_0xf8f5('0x6'));var auth=require(_0xf8f5('0x7'));var interaction=require(_0xf8f5('0x8'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xf8f5('0x9')](_0xf8f5('0xa'),auth[_0xf8f5('0xb')](),controller['show']);router[_0xf8f5('0xc')](_0xf8f5('0xa'),auth[_0xf8f5('0xb')](),controller['update']);router[_0xf8f5('0xd')](_0xf8f5('0xa'),auth[_0xf8f5('0xb')](),controller['destroy']);module[_0xf8f5('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 38a5a38..e7a7934 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 _0x8bf4=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x8bf4,0x185));var _0x48bf=function(_0x9d9183,_0x4704df){_0x9d9183=_0x9d9183-0x0;var _0x3bec8e=_0x8bf4[_0x9d9183];return _0x3bec8e;};'use strict';var Sequelize=require(_0x48bf('0x0'));module[_0x48bf('0x1')]={'name':{'type':Sequelize[_0x48bf('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x48bf('0x2')]},'write':{'type':Sequelize[_0x48bf('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xdbce=['STRING','BOOLEAN','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdbce,0x1f1));var _0xedbc=function(_0xdd2bbd,_0xaf1161){_0xdd2bbd=_0xdd2bbd-0x0;var _0x449fc8=_0xdbce[_0xdd2bbd];return _0x449fc8;};'use strict';var Sequelize=require(_0xedbc('0x0'));module['exports']={'name':{'type':Sequelize[_0xedbc('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xedbc('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 211a7b7..e13caa6 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 _0xee89=['pick','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','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','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','ChatGroup','includeAll','include','catch','show','create','body','find','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','length','nolimit','removeMembers','addMessage','ChatGroupId','getMessages'];(function(_0x2b10b6,_0x3e54fa){var _0x28a925=function(_0x21fa59){while(--_0x21fa59){_0x2b10b6['push'](_0x2b10b6['shift']());}};_0x28a925(++_0x3e54fa);}(_0xee89,0x69));var _0x9ee8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xee89[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x9ee8('0x0'));var rimraf=require(_0x9ee8('0x1'));var zipdir=require(_0x9ee8('0x2'));var jsonpatch=require(_0x9ee8('0x3'));var rp=require('request-promise');var moment=require(_0x9ee8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9ee8('0x5'));var util=require(_0x9ee8('0x6'));var path=require(_0x9ee8('0x7'));var sox=require(_0x9ee8('0x8'));var csv=require(_0x9ee8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ee8('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9ee8('0xb'));var deskjs=require(_0x9ee8('0xc'));var toCsv=require(_0x9ee8('0x9'));var querystring=require(_0x9ee8('0xd'));var Papa=require(_0x9ee8('0xe'));var Redis=require(_0x9ee8('0xf'));var authService=require(_0x9ee8('0x10'));var qs=require(_0x9ee8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ee8('0x12'));var logger=require(_0x9ee8('0x13'))(_0x9ee8('0x14'));var utils=require(_0x9ee8('0x15'));var config=require(_0x9ee8('0x16'));var licenseUtil=require(_0x9ee8('0x17'));var db=require(_0x9ee8('0x18'))['db'];config['redis']=_[_0x9ee8('0x19')](config[_0x9ee8('0x1a')],{'host':_0x9ee8('0x1b'),'port':0x18eb});var socket=require(_0x9ee8('0x1c'))(new Redis(config[_0x9ee8('0x1a')]));require(_0x9ee8('0x1d'))['register'](socket);function respondWithStatusCode(_0xc57834,_0x39c3c0){_0x39c3c0=_0x39c3c0||0xcc;return function(_0x3abba0){if(_0x3abba0){return _0xc57834[_0x9ee8('0x1e')](_0x39c3c0);}return _0xc57834[_0x9ee8('0x1f')](_0x39c3c0)['end']();};}function respondWithResult(_0x1d0a40,_0x443a4c){_0x443a4c=_0x443a4c||0xc8;return function(_0x43ba76){if(_0x43ba76){return _0x1d0a40[_0x9ee8('0x1f')](_0x443a4c)[_0x9ee8('0x20')](_0x43ba76);}};}function respondWithFilteredResult(_0x3d621a,_0x33beb3){return function(_0x226700){if(_0x226700){var _0x4cd089=typeof _0x33beb3[_0x9ee8('0x21')]===_0x9ee8('0x22')&&typeof _0x33beb3[_0x9ee8('0x23')]===_0x9ee8('0x22');var _0x1990dc=_0x226700[_0x9ee8('0x24')];var _0x57a20f=_0x4cd089?0x0:_0x33beb3[_0x9ee8('0x21')];var _0x240695=_0x4cd089?_0x226700['count']:_0x33beb3['offset']+_0x33beb3['limit'];var _0x3d5136;if(_0x240695>=_0x1990dc){_0x240695=_0x1990dc;_0x3d5136=0xc8;}else{_0x3d5136=0xce;}_0x3d621a[_0x9ee8('0x1f')](_0x3d5136);return _0x3d621a['set'](_0x9ee8('0x25'),_0x57a20f+'-'+_0x240695+'/'+_0x1990dc)[_0x9ee8('0x20')](_0x226700);}return null;};}function patchUpdates(_0x2b7fb0){return function(_0x2b7de9){try{jsonpatch[_0x9ee8('0x26')](_0x2b7de9,_0x2b7fb0,!![]);}catch(_0x515112){return BPromise[_0x9ee8('0x27')](_0x515112);}return _0x2b7de9[_0x9ee8('0x28')]();};}function saveUpdates(_0x4d55ab,_0x39b44f){return function(_0x6bfea5){if(_0x6bfea5){return _0x6bfea5[_0x9ee8('0x29')](_0x4d55ab)[_0x9ee8('0x2a')](function(_0x157d70){return _0x157d70;});}return null;};}function removeEntity(_0x3904e5,_0xecf2d0){return function(_0x4988d2){if(_0x4988d2){return _0x4988d2[_0x9ee8('0x2b')]()[_0x9ee8('0x2a')](function(){_0x3904e5[_0x9ee8('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x305f9d,_0x35ab9c){return function(_0x5887e6){if(!_0x5887e6){_0x305f9d[_0x9ee8('0x1e')](0x194);}return _0x5887e6;};}function handleError(_0x19b5d2,_0x11581c){_0x11581c=_0x11581c||0x1f4;return function(_0x442e61){logger[_0x9ee8('0x2c')](_0x442e61[_0x9ee8('0x2d')]);if(_0x442e61[_0x9ee8('0x2e')]){delete _0x442e61[_0x9ee8('0x2e')];}_0x19b5d2[_0x9ee8('0x1f')](_0x11581c)[_0x9ee8('0x2f')](_0x442e61);};}exports[_0x9ee8('0x30')]=function(_0xb08761,_0xdd817d){var _0x479e81={},_0x6c3c6a={},_0x1a393a={'count':0x0,'rows':[]};var _0x347b67=_[_0x9ee8('0x31')](db['ChatGroup'][_0x9ee8('0x32')],function(_0x2d609d){return{'name':_0x2d609d[_0x9ee8('0x33')],'type':_0x2d609d[_0x9ee8('0x34')][_0x9ee8('0x35')]};});_0x6c3c6a['model']=_[_0x9ee8('0x31')](_0x347b67,_0x9ee8('0x2e'));_0x6c3c6a[_0x9ee8('0x36')]=_[_0x9ee8('0x37')](_0xb08761[_0x9ee8('0x36')]);_0x6c3c6a[_0x9ee8('0x38')]=_[_0x9ee8('0x39')](_0x6c3c6a['model'],_0x6c3c6a[_0x9ee8('0x36')]);_0x479e81[_0x9ee8('0x3a')]=_['intersection'](_0x6c3c6a[_0x9ee8('0x3b')],qs[_0x9ee8('0x3c')](_0xb08761[_0x9ee8('0x36')]['fields']));_0x479e81[_0x9ee8('0x3a')]=_0x479e81['attributes']['length']?_0x479e81[_0x9ee8('0x3a')]:_0x6c3c6a['model'];if(!_0xb08761['query'][_0x9ee8('0x3d')]('nolimit')){_0x479e81[_0x9ee8('0x23')]=qs[_0x9ee8('0x23')](_0xb08761[_0x9ee8('0x36')][_0x9ee8('0x23')]);_0x479e81[_0x9ee8('0x21')]=qs['offset'](_0xb08761[_0x9ee8('0x36')][_0x9ee8('0x21')]);}_0x479e81[_0x9ee8('0x3e')]=qs['sort'](_0xb08761[_0x9ee8('0x36')][_0x9ee8('0x3f')]);_0x479e81[_0x9ee8('0x40')]=qs[_0x9ee8('0x38')](_['pick'](_0xb08761[_0x9ee8('0x36')],_0x6c3c6a[_0x9ee8('0x38')]),_0x347b67);if(_0xb08761['query']['filter']){_0x479e81['where']=_[_0x9ee8('0x41')](_0x479e81[_0x9ee8('0x40')],{'$or':_[_0x9ee8('0x31')](_0x347b67,function(_0xbd83e3){if(_0xbd83e3[_0x9ee8('0x34')]!==_0x9ee8('0x42')){var _0x219ac5={};_0x219ac5[_0xbd83e3[_0x9ee8('0x2e')]]={'$like':'%'+_0xb08761[_0x9ee8('0x36')][_0x9ee8('0x43')]+'%'};return _0x219ac5;}})});}_0x479e81=_[_0x9ee8('0x41')]({},_0x479e81,_0xb08761[_0x9ee8('0x44')]);var _0x39d648={'where':_0x479e81['where']};return db[_0x9ee8('0x45')][_0x9ee8('0x24')](_0x39d648)[_0x9ee8('0x2a')](function(_0x2fdf06){_0x1a393a[_0x9ee8('0x24')]=_0x2fdf06;if(_0xb08761[_0x9ee8('0x36')][_0x9ee8('0x46')]){_0x479e81[_0x9ee8('0x47')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x479e81);})[_0x9ee8('0x2a')](function(_0x58289b){_0x1a393a['rows']=_0x58289b;return _0x1a393a;})['then'](respondWithFilteredResult(_0xdd817d,_0x479e81))[_0x9ee8('0x48')](handleError(_0xdd817d,null));};exports[_0x9ee8('0x49')]=function(_0x23c334,_0x1c6936){var _0x1f4bbc={'raw':!![],'where':{'id':_0x23c334['params']['id']}},_0x17a285={};_0x17a285[_0x9ee8('0x3b')]=_[_0x9ee8('0x37')](db[_0x9ee8('0x45')][_0x9ee8('0x32')]);_0x17a285[_0x9ee8('0x36')]=_[_0x9ee8('0x37')](_0x23c334['query']);_0x17a285[_0x9ee8('0x38')]=_[_0x9ee8('0x39')](_0x17a285[_0x9ee8('0x3b')],_0x17a285[_0x9ee8('0x36')]);_0x1f4bbc['attributes']=_[_0x9ee8('0x39')](_0x17a285[_0x9ee8('0x3b')],qs[_0x9ee8('0x3c')](_0x23c334[_0x9ee8('0x36')]['fields']));_0x1f4bbc[_0x9ee8('0x3a')]=_0x1f4bbc[_0x9ee8('0x3a')]['length']?_0x1f4bbc[_0x9ee8('0x3a')]:_0x17a285[_0x9ee8('0x3b')];if(_0x23c334[_0x9ee8('0x36')][_0x9ee8('0x46')]){_0x1f4bbc['include']=[{'all':!![]}];}_0x1f4bbc=_[_0x9ee8('0x41')]({},_0x1f4bbc,_0x23c334[_0x9ee8('0x44')]);return db['ChatGroup']['find'](_0x1f4bbc)[_0x9ee8('0x2a')](handleEntityNotFound(_0x1c6936,null))[_0x9ee8('0x2a')](respondWithResult(_0x1c6936,null))[_0x9ee8('0x48')](handleError(_0x1c6936,null));};exports[_0x9ee8('0x4a')]=function(_0xcd46ab,_0x10870e){return db[_0x9ee8('0x45')][_0x9ee8('0x4a')](_0xcd46ab['body'],{})[_0x9ee8('0x2a')](respondWithResult(_0x10870e,0xc9))[_0x9ee8('0x48')](handleError(_0x10870e,null));};exports['update']=function(_0x1a6a02,_0x424937){if(_0x1a6a02[_0x9ee8('0x4b')]['id']){delete _0x1a6a02['body']['id'];}return db[_0x9ee8('0x45')][_0x9ee8('0x4c')]({'where':{'id':_0x1a6a02[_0x9ee8('0x4d')]['id']}})[_0x9ee8('0x2a')](handleEntityNotFound(_0x424937,null))['then'](saveUpdates(_0x1a6a02['body'],null))[_0x9ee8('0x2a')](respondWithResult(_0x424937,null))[_0x9ee8('0x48')](handleError(_0x424937,null));};exports[_0x9ee8('0x2b')]=function(_0x5958b4,_0x2b4b0f){return db[_0x9ee8('0x45')][_0x9ee8('0x4c')]({'where':{'id':_0x5958b4[_0x9ee8('0x4d')]['id']}})[_0x9ee8('0x2a')](handleEntityNotFound(_0x2b4b0f,null))[_0x9ee8('0x2a')](removeEntity(_0x2b4b0f,null))[_0x9ee8('0x48')](handleError(_0x2b4b0f,null));};exports['describe']=function(_0x3f86a4,_0x13b545){return db['ChatGroup'][_0x9ee8('0x4e')]()[_0x9ee8('0x2a')](respondWithResult(_0x13b545,null))[_0x9ee8('0x48')](handleError(_0x13b545,null));};exports[_0x9ee8('0x4f')]=function(_0x41015b,_0x1a128c,_0x3080cf){return db[_0x9ee8('0x50')][_0x9ee8('0x24')]({'where':{'ChatGroupId':_0x41015b[_0x9ee8('0x4d')]['id'],'ToId':_0x41015b[_0x9ee8('0x51')]['id'],'read':![]}})[_0x9ee8('0x2a')](function(_0x2fbccb){return{'id':_[_0x9ee8('0x52')](_0x41015b['params']['id']),'count':_0x2fbccb};})[_0x9ee8('0x2a')](respondWithResult(_0x1a128c,null))[_0x9ee8('0x48')](handleError(_0x1a128c,null));};exports[_0x9ee8('0x53')]=function(_0x3a5a7a,_0x59b8fd,_0x318f15){return db[_0x9ee8('0x45')][_0x9ee8('0x4c')]({'where':{'id':_0x3a5a7a['params']['id']}})['then'](handleEntityNotFound(_0x59b8fd,null))[_0x9ee8('0x2a')](function(_0x5518cd){if(_0x5518cd){return _0x5518cd['addMembers'](_0x3a5a7a[_0x9ee8('0x4b')][_0x9ee8('0x54')],_[_0x9ee8('0x55')](_0x3a5a7a[_0x9ee8('0x4b')],[_0x9ee8('0x54'),'id'])||{});}})['then'](respondWithResult(_0x59b8fd,null))[_0x9ee8('0x48')](handleError(_0x59b8fd,null));};exports[_0x9ee8('0x56')]=function(_0x9a8fa9,_0x56aa3b,_0x29a636){var _0x182e9f={};var _0x941e6={};var _0x21680c;var _0x5b759e;return db[_0x9ee8('0x45')][_0x9ee8('0x57')]({'where':{'id':_0x9a8fa9[_0x9ee8('0x4d')]['id']}})[_0x9ee8('0x2a')](handleEntityNotFound(_0x56aa3b,null))['then'](function(_0x48a92a){if(_0x48a92a){_0x21680c=_0x48a92a;_0x941e6[_0x9ee8('0x3b')]=_[_0x9ee8('0x37')](db[_0x9ee8('0x58')]['rawAttributes']);_0x941e6[_0x9ee8('0x36')]=_[_0x9ee8('0x37')](_0x9a8fa9[_0x9ee8('0x36')]);_0x941e6[_0x9ee8('0x38')]=_[_0x9ee8('0x39')](_0x941e6[_0x9ee8('0x3b')],_0x941e6[_0x9ee8('0x36')]);_0x182e9f['attributes']=_['intersection'](_0x941e6[_0x9ee8('0x3b')],qs[_0x9ee8('0x3c')](_0x9a8fa9['query'][_0x9ee8('0x3c')]));_0x182e9f[_0x9ee8('0x3a')]=_0x182e9f[_0x9ee8('0x3a')][_0x9ee8('0x59')]?_0x182e9f[_0x9ee8('0x3a')]:_0x941e6[_0x9ee8('0x3b')];_0x182e9f[_0x9ee8('0x3e')]=qs[_0x9ee8('0x3f')](_0x9a8fa9['query'][_0x9ee8('0x3f')]);_0x182e9f[_0x9ee8('0x40')]=qs[_0x9ee8('0x38')](_['pick'](_0x9a8fa9[_0x9ee8('0x36')],_0x941e6[_0x9ee8('0x38')]));if(_0x9a8fa9[_0x9ee8('0x36')][_0x9ee8('0x43')]){_0x182e9f[_0x9ee8('0x40')]=_[_0x9ee8('0x41')](_0x182e9f['where'],{'$or':_['map'](_0x182e9f[_0x9ee8('0x3a')],function(_0x83785c){var _0x4fd8f1={};_0x4fd8f1[_0x83785c]={'$like':'%'+_0x9a8fa9[_0x9ee8('0x36')][_0x9ee8('0x43')]+'%'};return _0x4fd8f1;})});}_0x182e9f=_['merge']({},_0x182e9f,_0x9a8fa9[_0x9ee8('0x44')]);return _0x21680c[_0x9ee8('0x56')](_0x182e9f);}})[_0x9ee8('0x2a')](function(_0x472c2e){if(_0x472c2e){_0x5b759e=_0x472c2e[_0x9ee8('0x59')];if(!_0x9a8fa9[_0x9ee8('0x36')]['hasOwnProperty'](_0x9ee8('0x5a'))){_0x182e9f[_0x9ee8('0x23')]=qs['limit'](_0x9a8fa9['query']['limit']);_0x182e9f[_0x9ee8('0x21')]=qs[_0x9ee8('0x21')](_0x9a8fa9[_0x9ee8('0x36')]['offset']);}return _0x21680c[_0x9ee8('0x56')](_0x182e9f);}})[_0x9ee8('0x2a')](function(_0x11df3c){if(_0x11df3c){return _0x11df3c?{'count':_0x5b759e,'rows':_0x11df3c}:null;}})[_0x9ee8('0x2a')](respondWithResult(_0x56aa3b,null))['catch'](handleError(_0x56aa3b,null));};exports[_0x9ee8('0x5b')]=function(_0x2f70d5,_0x1b82f4,_0x167c3c){return db[_0x9ee8('0x45')]['find']({'where':{'id':_0x2f70d5[_0x9ee8('0x4d')]['id']}})[_0x9ee8('0x2a')](handleEntityNotFound(_0x1b82f4,null))[_0x9ee8('0x2a')](function(_0x1f8846){if(_0x1f8846){return _0x1f8846[_0x9ee8('0x5b')](_0x2f70d5[_0x9ee8('0x36')]['ids']);}})[_0x9ee8('0x2a')](respondWithStatusCode(_0x1b82f4,null))['catch'](handleError(_0x1b82f4,null));};exports[_0x9ee8('0x5c')]=function(_0x12cf30,_0xe94f00,_0x183b20){if(_0x12cf30[_0x9ee8('0x4b')]['id']){delete _0x12cf30[_0x9ee8('0x4b')]['id'];}return db[_0x9ee8('0x45')]['find']({'where':{'id':_0x12cf30[_0x9ee8('0x4d')]['id']}})[_0x9ee8('0x2a')](handleEntityNotFound(_0xe94f00,null))[_0x9ee8('0x2a')](function(_0x48b0da){if(_0x48b0da){_0x12cf30['body'][_0x9ee8('0x5d')]=_0x48b0da['id'];return db[_0x9ee8('0x50')][_0x9ee8('0x4a')](_0x12cf30[_0x9ee8('0x4b')]);}})[_0x9ee8('0x2a')](respondWithResult(_0xe94f00,null))[_0x9ee8('0x48')](handleError(_0xe94f00,null));};exports[_0x9ee8('0x5e')]=function(_0x20c4f6,_0xdfe2fb,_0x109665){var _0x32a97a={};var _0x564429={};var _0x154477;var _0x52ce07;return db[_0x9ee8('0x45')][_0x9ee8('0x57')]({'where':{'id':_0x20c4f6[_0x9ee8('0x4d')]['id']}})['then'](handleEntityNotFound(_0xdfe2fb,null))[_0x9ee8('0x2a')](function(_0x475fcd){if(_0x475fcd){_0x154477=_0x475fcd;_0x564429[_0x9ee8('0x3b')]=_[_0x9ee8('0x37')](db[_0x9ee8('0x50')][_0x9ee8('0x32')]);_0x564429[_0x9ee8('0x36')]=_[_0x9ee8('0x37')](_0x20c4f6['query']);_0x564429[_0x9ee8('0x38')]=_[_0x9ee8('0x39')](_0x564429[_0x9ee8('0x3b')],_0x564429[_0x9ee8('0x36')]);_0x32a97a[_0x9ee8('0x3a')]=_['intersection'](_0x564429['model'],qs['fields'](_0x20c4f6[_0x9ee8('0x36')]['fields']));_0x32a97a['attributes']=_0x32a97a[_0x9ee8('0x3a')][_0x9ee8('0x59')]?_0x32a97a['attributes']:_0x564429[_0x9ee8('0x3b')];_0x32a97a['order']=qs['sort'](_0x20c4f6[_0x9ee8('0x36')][_0x9ee8('0x3f')]);_0x32a97a[_0x9ee8('0x40')]=qs[_0x9ee8('0x38')](_[_0x9ee8('0x5f')](_0x20c4f6[_0x9ee8('0x36')],_0x564429['filters']));if(_0x20c4f6[_0x9ee8('0x36')][_0x9ee8('0x43')]){_0x32a97a[_0x9ee8('0x40')]=_[_0x9ee8('0x41')](_0x32a97a[_0x9ee8('0x40')],{'$or':_[_0x9ee8('0x31')](_0x32a97a[_0x9ee8('0x3a')],function(_0x5ae071){var _0x5d908d={};_0x5d908d[_0x5ae071]={'$like':'%'+_0x20c4f6['query'][_0x9ee8('0x43')]+'%'};return _0x5d908d;})});}if(_0x20c4f6[_0x9ee8('0x36')][_0x9ee8('0x60')]){var _0x5f0492=_0x20c4f6[_0x9ee8('0x36')][_0x9ee8('0x60')][_0x9ee8('0x61')](',');var _0x39d1e7={};_0x39d1e7[_0x5f0492[0x0]]={'$gte':moment(_0x5f0492[0x1])[_0x9ee8('0x62')](_0x9ee8('0x63'))};_0x32a97a['where']=_[_0x9ee8('0x41')](_0x32a97a[_0x9ee8('0x40')],_0x39d1e7);}_0x32a97a=_[_0x9ee8('0x41')]({},_0x32a97a,_0x20c4f6[_0x9ee8('0x44')]);return _0x154477[_0x9ee8('0x5e')](_0x32a97a);}})[_0x9ee8('0x2a')](function(_0x1ed94b){if(_0x1ed94b){_0x52ce07=_0x1ed94b[_0x9ee8('0x59')];if(!_0x20c4f6['query'][_0x9ee8('0x3d')]('nolimit')){_0x32a97a[_0x9ee8('0x23')]=qs['limit'](_0x20c4f6[_0x9ee8('0x36')]['limit']);_0x32a97a['offset']=qs[_0x9ee8('0x21')](_0x20c4f6[_0x9ee8('0x36')][_0x9ee8('0x21')]);}return _0x154477[_0x9ee8('0x5e')](_0x32a97a);}})[_0x9ee8('0x2a')](function(_0x4b848b){if(_0x4b848b){return _0x4b848b?{'count':_0x52ce07,'rows':_0x4b848b}:null;}})[_0x9ee8('0x2a')](respondWithResult(_0xdfe2fb,null))['catch'](handleError(_0xdfe2fb,null));};
\ No newline at end of file
+var _0x7363=['body','update','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','options','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','then','destroy','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatGroup','count','includeAll','include','findAll','catch','show','params','intersection','find','create'];(function(_0x34eb1d,_0x116a4d){var _0x53266b=function(_0x2c52aa){while(--_0x2c52aa){_0x34eb1d['push'](_0x34eb1d['shift']());}};_0x53266b(++_0x116a4d);}(_0x7363,0x131));var _0x3736=function(_0x3a8e15,_0x38e90d){_0x3a8e15=_0x3a8e15-0x0;var _0x4de790=_0x7363[_0x3a8e15];return _0x4de790;};'use strict';var emlformat=require(_0x3736('0x0'));var rimraf=require(_0x3736('0x1'));var zipdir=require(_0x3736('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3736('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3736('0x4'));var util=require(_0x3736('0x5'));var path=require(_0x3736('0x6'));var sox=require(_0x3736('0x7'));var csv=require(_0x3736('0x8'));var ejs=require(_0x3736('0x9'));var fs=require('fs');var fs_extra=require(_0x3736('0xa'));var _=require(_0x3736('0xb'));var squel=require(_0x3736('0xc'));var crypto=require(_0x3736('0xd'));var jsforce=require(_0x3736('0xe'));var deskjs=require(_0x3736('0xf'));var toCsv=require(_0x3736('0x8'));var querystring=require(_0x3736('0x10'));var Papa=require(_0x3736('0x11'));var Redis=require(_0x3736('0x12'));var authService=require(_0x3736('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3736('0x14'));var logger=require(_0x3736('0x15'))('api');var utils=require(_0x3736('0x16'));var config=require(_0x3736('0x17'));var licenseUtil=require(_0x3736('0x18'));var db=require(_0x3736('0x19'))['db'];config[_0x3736('0x1a')]=_['defaults'](config[_0x3736('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x3736('0x1b'))(new Redis(config[_0x3736('0x1a')]));require('./chatGroup.socket')[_0x3736('0x1c')](socket);function respondWithStatusCode(_0x7de163,_0x2c2b2b){_0x2c2b2b=_0x2c2b2b||0xcc;return function(_0x2982ef){if(_0x2982ef){return _0x7de163[_0x3736('0x1d')](_0x2c2b2b);}return _0x7de163[_0x3736('0x1e')](_0x2c2b2b)[_0x3736('0x1f')]();};}function respondWithResult(_0x59a0f3,_0x5b6dbf){_0x5b6dbf=_0x5b6dbf||0xc8;return function(_0x35f3c3){if(_0x35f3c3){return _0x59a0f3[_0x3736('0x1e')](_0x5b6dbf)[_0x3736('0x20')](_0x35f3c3);}};}function respondWithFilteredResult(_0x831bf6,_0x3c0403){return function(_0x41890b){if(_0x41890b){var _0x3fb742=typeof _0x3c0403[_0x3736('0x21')]===_0x3736('0x22')&&typeof _0x3c0403[_0x3736('0x23')]===_0x3736('0x22');var _0x3c6a48=_0x41890b['count'];var _0xadb50a=_0x3fb742?0x0:_0x3c0403[_0x3736('0x21')];var _0x3b80b0=_0x3fb742?_0x41890b['count']:_0x3c0403[_0x3736('0x21')]+_0x3c0403['limit'];var _0x48b690;if(_0x3b80b0>=_0x3c6a48){_0x3b80b0=_0x3c6a48;_0x48b690=0xc8;}else{_0x48b690=0xce;}_0x831bf6[_0x3736('0x1e')](_0x48b690);return _0x831bf6[_0x3736('0x24')](_0x3736('0x25'),_0xadb50a+'-'+_0x3b80b0+'/'+_0x3c6a48)[_0x3736('0x20')](_0x41890b);}return null;};}function patchUpdates(_0x19e1e6){return function(_0x8651e4){try{jsonpatch['apply'](_0x8651e4,_0x19e1e6,!![]);}catch(_0x79cb3a){return BPromise[_0x3736('0x26')](_0x79cb3a);}return _0x8651e4['save']();};}function saveUpdates(_0x765ac6,_0xe06804){return function(_0x17b09d){if(_0x17b09d){return _0x17b09d['update'](_0x765ac6)[_0x3736('0x27')](function(_0x541c6f){return _0x541c6f;});}return null;};}function removeEntity(_0x4a9fca,_0x280a6e){return function(_0x54675c){if(_0x54675c){return _0x54675c[_0x3736('0x28')]()[_0x3736('0x27')](function(){_0x4a9fca[_0x3736('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3620aa,_0x3ffea0){return function(_0x5a59cb){if(!_0x5a59cb){_0x3620aa[_0x3736('0x1d')](0x194);}return _0x5a59cb;};}function handleError(_0x3f7b52,_0x4a5be1){_0x4a5be1=_0x4a5be1||0x1f4;return function(_0x5bf4fb){logger['error'](_0x5bf4fb['stack']);if(_0x5bf4fb[_0x3736('0x29')]){delete _0x5bf4fb[_0x3736('0x29')];}_0x3f7b52[_0x3736('0x1e')](_0x4a5be1)[_0x3736('0x2a')](_0x5bf4fb);};}exports['index']=function(_0x3665e9,_0x995f3f){var _0x59c0c6={},_0x3fd5c0={},_0x7a0c7={'count':0x0,'rows':[]};var _0x4c8414=_['map'](db['ChatGroup'][_0x3736('0x2b')],function(_0x2ec704){return{'name':_0x2ec704[_0x3736('0x2c')],'type':_0x2ec704[_0x3736('0x2d')][_0x3736('0x2e')]};});_0x3fd5c0[_0x3736('0x2f')]=_[_0x3736('0x30')](_0x4c8414,'name');_0x3fd5c0['query']=_[_0x3736('0x31')](_0x3665e9[_0x3736('0x32')]);_0x3fd5c0[_0x3736('0x33')]=_['intersection'](_0x3fd5c0[_0x3736('0x2f')],_0x3fd5c0[_0x3736('0x32')]);_0x59c0c6[_0x3736('0x34')]=_['intersection'](_0x3fd5c0[_0x3736('0x2f')],qs[_0x3736('0x35')](_0x3665e9['query']['fields']));_0x59c0c6['attributes']=_0x59c0c6[_0x3736('0x34')][_0x3736('0x36')]?_0x59c0c6[_0x3736('0x34')]:_0x3fd5c0[_0x3736('0x2f')];if(!_0x3665e9[_0x3736('0x32')][_0x3736('0x37')](_0x3736('0x38'))){_0x59c0c6[_0x3736('0x23')]=qs['limit'](_0x3665e9['query'][_0x3736('0x23')]);_0x59c0c6[_0x3736('0x21')]=qs['offset'](_0x3665e9['query']['offset']);}_0x59c0c6[_0x3736('0x39')]=qs['sort'](_0x3665e9[_0x3736('0x32')][_0x3736('0x3a')]);_0x59c0c6[_0x3736('0x3b')]=qs[_0x3736('0x33')](_[_0x3736('0x3c')](_0x3665e9[_0x3736('0x32')],_0x3fd5c0[_0x3736('0x33')]),_0x4c8414);if(_0x3665e9['query'][_0x3736('0x3d')]){_0x59c0c6['where']=_[_0x3736('0x3e')](_0x59c0c6[_0x3736('0x3b')],{'$or':_[_0x3736('0x30')](_0x4c8414,function(_0x4db312){if(_0x4db312[_0x3736('0x2d')]!==_0x3736('0x3f')){var _0x6194da={};_0x6194da[_0x4db312[_0x3736('0x29')]]={'$like':'%'+_0x3665e9[_0x3736('0x32')][_0x3736('0x3d')]+'%'};return _0x6194da;}})});}_0x59c0c6=_[_0x3736('0x3e')]({},_0x59c0c6,_0x3665e9['options']);var _0x4c1053={'where':_0x59c0c6[_0x3736('0x3b')]};return db[_0x3736('0x40')]['count'](_0x4c1053)[_0x3736('0x27')](function(_0x22d192){_0x7a0c7[_0x3736('0x41')]=_0x22d192;if(_0x3665e9['query'][_0x3736('0x42')]){_0x59c0c6[_0x3736('0x43')]=[{'all':!![]}];}return db[_0x3736('0x40')][_0x3736('0x44')](_0x59c0c6);})[_0x3736('0x27')](function(_0x39fff7){_0x7a0c7['rows']=_0x39fff7;return _0x7a0c7;})[_0x3736('0x27')](respondWithFilteredResult(_0x995f3f,_0x59c0c6))[_0x3736('0x45')](handleError(_0x995f3f,null));};exports[_0x3736('0x46')]=function(_0x24bc77,_0x33dec4){var _0x4d031b={'raw':!![],'where':{'id':_0x24bc77[_0x3736('0x47')]['id']}},_0x206f00={};_0x206f00[_0x3736('0x2f')]=_[_0x3736('0x31')](db[_0x3736('0x40')][_0x3736('0x2b')]);_0x206f00[_0x3736('0x32')]=_[_0x3736('0x31')](_0x24bc77['query']);_0x206f00['filters']=_[_0x3736('0x48')](_0x206f00[_0x3736('0x2f')],_0x206f00['query']);_0x4d031b['attributes']=_[_0x3736('0x48')](_0x206f00[_0x3736('0x2f')],qs[_0x3736('0x35')](_0x24bc77['query'][_0x3736('0x35')]));_0x4d031b[_0x3736('0x34')]=_0x4d031b[_0x3736('0x34')][_0x3736('0x36')]?_0x4d031b[_0x3736('0x34')]:_0x206f00[_0x3736('0x2f')];if(_0x24bc77['query'][_0x3736('0x42')]){_0x4d031b[_0x3736('0x43')]=[{'all':!![]}];}_0x4d031b=_['merge']({},_0x4d031b,_0x24bc77['options']);return db[_0x3736('0x40')][_0x3736('0x49')](_0x4d031b)[_0x3736('0x27')](handleEntityNotFound(_0x33dec4,null))[_0x3736('0x27')](respondWithResult(_0x33dec4,null))[_0x3736('0x45')](handleError(_0x33dec4,null));};exports[_0x3736('0x4a')]=function(_0x4e68d2,_0x349239){return db[_0x3736('0x40')][_0x3736('0x4a')](_0x4e68d2[_0x3736('0x4b')],{})['then'](respondWithResult(_0x349239,0xc9))['catch'](handleError(_0x349239,null));};exports[_0x3736('0x4c')]=function(_0x53fc39,_0x85ee83){if(_0x53fc39[_0x3736('0x4b')]['id']){delete _0x53fc39[_0x3736('0x4b')]['id'];}return db[_0x3736('0x40')][_0x3736('0x49')]({'where':{'id':_0x53fc39[_0x3736('0x47')]['id']}})[_0x3736('0x27')](handleEntityNotFound(_0x85ee83,null))[_0x3736('0x27')](saveUpdates(_0x53fc39[_0x3736('0x4b')],null))[_0x3736('0x27')](respondWithResult(_0x85ee83,null))['catch'](handleError(_0x85ee83,null));};exports['destroy']=function(_0xb66f9d,_0x257053){return db['ChatGroup'][_0x3736('0x49')]({'where':{'id':_0xb66f9d['params']['id']}})[_0x3736('0x27')](handleEntityNotFound(_0x257053,null))[_0x3736('0x27')](removeEntity(_0x257053,null))[_0x3736('0x45')](handleError(_0x257053,null));};exports['describe']=function(_0x2f41cb,_0x4dd9e6){return db[_0x3736('0x40')]['describe']()[_0x3736('0x27')](respondWithResult(_0x4dd9e6,null))[_0x3736('0x45')](handleError(_0x4dd9e6,null));};exports[_0x3736('0x4d')]=function(_0x2d4640,_0x31f83f,_0x46cb38){return db[_0x3736('0x4e')][_0x3736('0x41')]({'where':{'ChatGroupId':_0x2d4640[_0x3736('0x47')]['id'],'ToId':_0x2d4640[_0x3736('0x4f')]['id'],'read':![]}})['then'](function(_0x54dcca){return{'id':_[_0x3736('0x50')](_0x2d4640[_0x3736('0x47')]['id']),'count':_0x54dcca};})[_0x3736('0x27')](respondWithResult(_0x31f83f,null))[_0x3736('0x45')](handleError(_0x31f83f,null));};exports[_0x3736('0x51')]=function(_0x2932a3,_0x5a31f7,_0xeeda29){return db[_0x3736('0x40')]['find']({'where':{'id':_0x2932a3[_0x3736('0x47')]['id']}})[_0x3736('0x27')](handleEntityNotFound(_0x5a31f7,null))['then'](function(_0x5de494){if(_0x5de494){return _0x5de494[_0x3736('0x51')](_0x2932a3['body'][_0x3736('0x52')],_[_0x3736('0x53')](_0x2932a3[_0x3736('0x4b')],[_0x3736('0x52'),'id'])||{});}})['then'](respondWithResult(_0x5a31f7,null))[_0x3736('0x45')](handleError(_0x5a31f7,null));};exports[_0x3736('0x54')]=function(_0x4207bb,_0x13de7c,_0x2fe073){var _0x580276={};var _0x45623b={};var _0x3919f6;var _0x55e72f;return db[_0x3736('0x40')][_0x3736('0x55')]({'where':{'id':_0x4207bb[_0x3736('0x47')]['id']}})[_0x3736('0x27')](handleEntityNotFound(_0x13de7c,null))[_0x3736('0x27')](function(_0x48b31a){if(_0x48b31a){_0x3919f6=_0x48b31a;_0x45623b[_0x3736('0x2f')]=_['keys'](db[_0x3736('0x56')]['rawAttributes']);_0x45623b['query']=_['keys'](_0x4207bb['query']);_0x45623b[_0x3736('0x33')]=_['intersection'](_0x45623b['model'],_0x45623b[_0x3736('0x32')]);_0x580276[_0x3736('0x34')]=_[_0x3736('0x48')](_0x45623b[_0x3736('0x2f')],qs['fields'](_0x4207bb[_0x3736('0x32')][_0x3736('0x35')]));_0x580276[_0x3736('0x34')]=_0x580276[_0x3736('0x34')][_0x3736('0x36')]?_0x580276['attributes']:_0x45623b[_0x3736('0x2f')];_0x580276[_0x3736('0x39')]=qs[_0x3736('0x3a')](_0x4207bb[_0x3736('0x32')][_0x3736('0x3a')]);_0x580276['where']=qs[_0x3736('0x33')](_[_0x3736('0x3c')](_0x4207bb[_0x3736('0x32')],_0x45623b[_0x3736('0x33')]));if(_0x4207bb[_0x3736('0x32')]['filter']){_0x580276[_0x3736('0x3b')]=_['merge'](_0x580276[_0x3736('0x3b')],{'$or':_[_0x3736('0x30')](_0x580276[_0x3736('0x34')],function(_0x68afad){var _0xa00949={};_0xa00949[_0x68afad]={'$like':'%'+_0x4207bb[_0x3736('0x32')]['filter']+'%'};return _0xa00949;})});}_0x580276=_[_0x3736('0x3e')]({},_0x580276,_0x4207bb[_0x3736('0x57')]);return _0x3919f6['getMembers'](_0x580276);}})[_0x3736('0x27')](function(_0x35a7f8){if(_0x35a7f8){_0x55e72f=_0x35a7f8[_0x3736('0x36')];if(!_0x4207bb[_0x3736('0x32')]['hasOwnProperty'](_0x3736('0x38'))){_0x580276[_0x3736('0x23')]=qs['limit'](_0x4207bb['query']['limit']);_0x580276[_0x3736('0x21')]=qs[_0x3736('0x21')](_0x4207bb[_0x3736('0x32')][_0x3736('0x21')]);}return _0x3919f6[_0x3736('0x54')](_0x580276);}})[_0x3736('0x27')](function(_0x57b3e7){if(_0x57b3e7){return _0x57b3e7?{'count':_0x55e72f,'rows':_0x57b3e7}:null;}})[_0x3736('0x27')](respondWithResult(_0x13de7c,null))[_0x3736('0x45')](handleError(_0x13de7c,null));};exports[_0x3736('0x58')]=function(_0x33653e,_0x9d8386,_0x3bd747){return db[_0x3736('0x40')][_0x3736('0x49')]({'where':{'id':_0x33653e[_0x3736('0x47')]['id']}})['then'](handleEntityNotFound(_0x9d8386,null))['then'](function(_0x5dc4ae){if(_0x5dc4ae){return _0x5dc4ae[_0x3736('0x58')](_0x33653e['query'][_0x3736('0x52')]);}})[_0x3736('0x27')](respondWithStatusCode(_0x9d8386,null))['catch'](handleError(_0x9d8386,null));};exports[_0x3736('0x59')]=function(_0x520bf9,_0x9d494d,_0x5d3aee){if(_0x520bf9[_0x3736('0x4b')]['id']){delete _0x520bf9['body']['id'];}return db[_0x3736('0x40')][_0x3736('0x49')]({'where':{'id':_0x520bf9[_0x3736('0x47')]['id']}})[_0x3736('0x27')](handleEntityNotFound(_0x9d494d,null))[_0x3736('0x27')](function(_0x1f19de){if(_0x1f19de){_0x520bf9[_0x3736('0x4b')][_0x3736('0x5a')]=_0x1f19de['id'];return db[_0x3736('0x4e')][_0x3736('0x4a')](_0x520bf9['body']);}})['then'](respondWithResult(_0x9d494d,null))['catch'](handleError(_0x9d494d,null));};exports['getMessages']=function(_0xe4d0bf,_0x537243,_0xb4dec){var _0xd1efdb={};var _0x3f833={};var _0x1cca39;var _0x2539a1;return db[_0x3736('0x40')][_0x3736('0x55')]({'where':{'id':_0xe4d0bf[_0x3736('0x47')]['id']}})['then'](handleEntityNotFound(_0x537243,null))[_0x3736('0x27')](function(_0x434815){if(_0x434815){_0x1cca39=_0x434815;_0x3f833[_0x3736('0x2f')]=_[_0x3736('0x31')](db[_0x3736('0x4e')]['rawAttributes']);_0x3f833[_0x3736('0x32')]=_[_0x3736('0x31')](_0xe4d0bf['query']);_0x3f833['filters']=_[_0x3736('0x48')](_0x3f833[_0x3736('0x2f')],_0x3f833['query']);_0xd1efdb['attributes']=_[_0x3736('0x48')](_0x3f833['model'],qs['fields'](_0xe4d0bf[_0x3736('0x32')][_0x3736('0x35')]));_0xd1efdb[_0x3736('0x34')]=_0xd1efdb['attributes'][_0x3736('0x36')]?_0xd1efdb[_0x3736('0x34')]:_0x3f833[_0x3736('0x2f')];_0xd1efdb[_0x3736('0x39')]=qs['sort'](_0xe4d0bf[_0x3736('0x32')]['sort']);_0xd1efdb[_0x3736('0x3b')]=qs[_0x3736('0x33')](_[_0x3736('0x3c')](_0xe4d0bf['query'],_0x3f833[_0x3736('0x33')]));if(_0xe4d0bf['query'][_0x3736('0x3d')]){_0xd1efdb[_0x3736('0x3b')]=_['merge'](_0xd1efdb[_0x3736('0x3b')],{'$or':_['map'](_0xd1efdb[_0x3736('0x34')],function(_0x9faa0b){var _0x1e730f={};_0x1e730f[_0x9faa0b]={'$like':'%'+_0xe4d0bf['query']['filter']+'%'};return _0x1e730f;})});}if(_0xe4d0bf[_0x3736('0x32')]['$gte']){var _0x3d6b77=_0xe4d0bf[_0x3736('0x32')][_0x3736('0x5b')][_0x3736('0x5c')](',');var _0x4bde31={};_0x4bde31[_0x3d6b77[0x0]]={'$gte':moment(_0x3d6b77[0x1])[_0x3736('0x5d')](_0x3736('0x5e'))};_0xd1efdb[_0x3736('0x3b')]=_[_0x3736('0x3e')](_0xd1efdb[_0x3736('0x3b')],_0x4bde31);}_0xd1efdb=_[_0x3736('0x3e')]({},_0xd1efdb,_0xe4d0bf[_0x3736('0x57')]);return _0x1cca39['getMessages'](_0xd1efdb);}})[_0x3736('0x27')](function(_0x1b2269){if(_0x1b2269){_0x2539a1=_0x1b2269[_0x3736('0x36')];if(!_0xe4d0bf[_0x3736('0x32')][_0x3736('0x37')](_0x3736('0x38'))){_0xd1efdb['limit']=qs[_0x3736('0x23')](_0xe4d0bf['query'][_0x3736('0x23')]);_0xd1efdb[_0x3736('0x21')]=qs[_0x3736('0x21')](_0xe4d0bf[_0x3736('0x32')]['offset']);}return _0x1cca39['getMessages'](_0xd1efdb);}})['then'](function(_0x4f6934){if(_0x4f6934){return _0x4f6934?{'count':_0x2539a1,'rows':_0x4f6934}:null;}})[_0x3736('0x27')](respondWithResult(_0x537243,null))[_0x3736('0x45')](handleError(_0x537243,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 80e0460..9f196f0 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 _0xe07e=['emit','hasOwnProperty','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x4b13ce,_0x339cb0){var _0x427d4b=function(_0x26aaad){while(--_0x26aaad){_0x4b13ce['push'](_0x4b13ce['shift']());}};_0x427d4b(++_0x339cb0);}(_0xe07e,0xa3));var _0xee07=function(_0x5ba74f,_0x200bf4){_0x5ba74f=_0x5ba74f-0x0;var _0x534d79=_0xe07e[_0x5ba74f];return _0x534d79;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0xee07('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xee07('0x1')](0x0);var events={'afterCreate':_0xee07('0x2'),'afterUpdate':_0xee07('0x3'),'afterDestroy':_0xee07('0x4')};function emitEvent(_0x45b993){return function(_0x4cf4f5,_0xffcc84,_0xa0306b){ChatGroupEvents[_0xee07('0x5')](_0x45b993+':'+_0x4cf4f5['id'],_0x4cf4f5);ChatGroupEvents[_0xee07('0x5')](_0x45b993,_0x4cf4f5);_0xa0306b(null);};}for(var e in events){if(events[_0xee07('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x5e6e=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5e6e,0x74));var _0xe5e6=function(_0x220d56,_0x153929){_0x220d56=_0x220d56-0x0;var _0xd37143=_0x5e6e[_0x220d56];return _0xd37143;};'use strict';var EventEmitter=require(_0xe5e6('0x0'));var ChatGroup=require(_0xe5e6('0x1'))['db'][_0xe5e6('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe5e6('0x3')](0x0);var events={'afterCreate':_0xe5e6('0x4'),'afterUpdate':_0xe5e6('0x5'),'afterDestroy':_0xe5e6('0x6')};function emitEvent(_0x2df215){return function(_0x5a09a3,_0x301b71,_0x1a8b1c){ChatGroupEvents[_0xe5e6('0x7')](_0x2df215+':'+_0x5a09a3['id'],_0x5a09a3);ChatGroupEvents[_0xe5e6('0x7')](_0x2df215,_0x5a09a3);_0x1a8b1c(null);};}for(var e in events){if(events[_0xe5e6('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xe5e6('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 e7aa58a..259ab90 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 _0xb9f0=['../../config/logger','api','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9f0,0x16b));var _0x0b9f=function(_0x45416d,_0x1f42bf){_0x45416d=_0x45416d-0x0;var _0x4d8666=_0xb9f0[_0x45416d];return _0x4d8666;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0b9f('0x0'))(_0x0b9f('0x1'));var moment=require('moment');var BPromise=require(_0x0b9f('0x2'));var rp=require(_0x0b9f('0x3'));var fs=require('fs');var path=require(_0x0b9f('0x4'));var rimraf=require(_0x0b9f('0x5'));var config=require('../../config/environment');var attributes=require(_0x0b9f('0x6'));module[_0x0b9f('0x7')]=function(_0x435dd3,_0x121156){return _0x435dd3[_0x0b9f('0x8')](_0x0b9f('0x9'),attributes,{'tableName':_0x0b9f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f2f=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','util','moment','bluebird','request-promise','rimraf'];(function(_0x5e4ca8,_0x3e156c){var _0x21ef16=function(_0x43ae45){while(--_0x43ae45){_0x5e4ca8['push'](_0x5e4ca8['shift']());}};_0x21ef16(++_0x3e156c);}(_0x6f2f,0x1ef));var _0xf6f2=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x6f2f[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require(_0xf6f2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf6f2('0x1'));var BPromise=require(_0xf6f2('0x2'));var rp=require(_0xf6f2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf6f2('0x4'));var config=require(_0xf6f2('0x5'));var attributes=require(_0xf6f2('0x6'));module[_0xf6f2('0x7')]=function(_0x1a6a99,_0x209916){return _0x1a6a99[_0xf6f2('0x8')](_0xf6f2('0x9'),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 6779f1d..c1932c5 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 _0x23fe=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','redis','./chatGroup.socket','request','then'];(function(_0x2d65b3,_0x54b6c5){var _0x43589d=function(_0x1c255b){while(--_0x1c255b){_0x2d65b3['push'](_0x2d65b3['shift']());}};_0x43589d(++_0x54b6c5);}(_0x23fe,0x102));var _0xe23f=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x23fe[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0xe23f('0x0'));var util=require(_0xe23f('0x1'));var moment=require('moment');var BPromise=require(_0xe23f('0x2'));var rs=require(_0xe23f('0x3'));var fs=require('fs');var Redis=require(_0xe23f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe23f('0x5'));var logger=require(_0xe23f('0x6'))(_0xe23f('0x7'));var config=require(_0xe23f('0x8'));var jayson=require(_0xe23f('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xe23f('0xa')](config['redis'],{'host':_0xe23f('0xb'),'port':0x18eb});var socket=require(_0xe23f('0xc'))(new Redis(config[_0xe23f('0xd')]));require(_0xe23f('0xe'))['register'](socket);function respondWithRpcPromise(_0x8da3e5,_0x238a64,_0x40cc65){return new BPromise(function(_0x280c21,_0x879441){return client[_0xe23f('0xf')](_0x8da3e5,_0x40cc65)[_0xe23f('0x10')](function(_0x5caeea){logger['info'](_0xe23f('0x11'),_0x238a64,_0xe23f('0x12'));logger[_0xe23f('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x238a64,_0xe23f('0x12'),JSON[_0xe23f('0x14')](_0x5caeea));if(_0x5caeea[_0xe23f('0x15')]){if(_0x5caeea[_0xe23f('0x15')]['code']===0x1f4){logger[_0xe23f('0x15')](_0xe23f('0x11'),_0x238a64,_0x5caeea[_0xe23f('0x15')]['message']);return _0x879441(_0x5caeea[_0xe23f('0x15')]['message']);}logger[_0xe23f('0x15')](_0xe23f('0x11'),_0x238a64,_0x5caeea['error'][_0xe23f('0x16')]);return _0x280c21(_0x5caeea[_0xe23f('0x15')][_0xe23f('0x16')]);}else{logger[_0xe23f('0x17')](_0xe23f('0x11'),_0x238a64,'request\x20sent');_0x280c21(_0x5caeea['result'][_0xe23f('0x16')]);}})[_0xe23f('0x18')](function(_0x5b0c4d){logger[_0xe23f('0x15')](_0xe23f('0x11'),_0x238a64,_0x5b0c4d);_0x879441(_0x5b0c4d);});});}
\ No newline at end of file
+var _0x615a=['error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x32cd7f,_0x3c7b2a){var _0x197196=function(_0x3e0ebd){while(--_0x3e0ebd){_0x32cd7f['push'](_0x32cd7f['shift']());}};_0x197196(++_0x3c7b2a);}(_0x615a,0x119));var _0xa615=function(_0x2059df,_0x367401){_0x2059df=_0x2059df-0x0;var _0xdd848b=_0x615a[_0x2059df];return _0xdd848b;};'use strict';var _=require(_0xa615('0x0'));var util=require('util');var moment=require(_0xa615('0x1'));var BPromise=require('bluebird');var rs=require(_0xa615('0x2'));var fs=require('fs');var Redis=require(_0xa615('0x3'));var db=require(_0xa615('0x4'))['db'];var utils=require(_0xa615('0x5'));var logger=require('../../config/logger')(_0xa615('0x6'));var config=require(_0xa615('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa615('0x8')]['http']({'port':0x232a});config[_0xa615('0x9')]=_[_0xa615('0xa')](config[_0xa615('0x9')],{'host':_0xa615('0xb'),'port':0x18eb});var socket=require(_0xa615('0xc'))(new Redis(config['redis']));require(_0xa615('0xd'))['register'](socket);function respondWithRpcPromise(_0x2b952d,_0x3fbfe1,_0x5a6664){return new BPromise(function(_0x3b1698,_0xf1cbca){return client[_0xa615('0xe')](_0x2b952d,_0x5a6664)[_0xa615('0xf')](function(_0x2530ec){logger['info']('ChatGroup,\x20%s,\x20%s',_0x3fbfe1,_0xa615('0x10'));logger['debug'](_0xa615('0x11'),_0x3fbfe1,_0xa615('0x10'),JSON[_0xa615('0x12')](_0x2530ec));if(_0x2530ec[_0xa615('0x13')]){if(_0x2530ec['error']['code']===0x1f4){logger[_0xa615('0x13')](_0xa615('0x14'),_0x3fbfe1,_0x2530ec[_0xa615('0x13')][_0xa615('0x15')]);return _0xf1cbca(_0x2530ec[_0xa615('0x13')][_0xa615('0x15')]);}logger[_0xa615('0x13')](_0xa615('0x14'),_0x3fbfe1,_0x2530ec[_0xa615('0x13')][_0xa615('0x15')]);return _0x3b1698(_0x2530ec[_0xa615('0x13')][_0xa615('0x15')]);}else{logger[_0xa615('0x16')](_0xa615('0x14'),_0x3fbfe1,_0xa615('0x10'));_0x3b1698(_0x2530ec[_0xa615('0x17')][_0xa615('0x15')]);}})[_0xa615('0x18')](function(_0x1eb384){logger['error'](_0xa615('0x14'),_0x3fbfe1,_0x1eb384);_0xf1cbca(_0x1eb384);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index c3689b5..06c9a82 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 _0x0fc3=['remove','update','emit','removeListener','register','chatGroup:','./chatGroup.events','save'];(function(_0x58a9ad,_0x4429f2){var _0x52694d=function(_0x5b29bd){while(--_0x5b29bd){_0x58a9ad['push'](_0x58a9ad['shift']());}};_0x52694d(++_0x4429f2);}(_0x0fc3,0x1be));var _0x30fc=function(_0x2f3a2e,_0x40d83d){_0x2f3a2e=_0x2f3a2e-0x0;var _0x1d6975=_0x0fc3[_0x2f3a2e];return _0x1d6975;};'use strict';var ChatGroupEvents=require(_0x30fc('0x0'));var events=[_0x30fc('0x1'),_0x30fc('0x2'),_0x30fc('0x3')];function createListener(_0xc8c333,_0x44d5f9){return function(_0x3c0a19){_0x44d5f9[_0x30fc('0x4')](_0xc8c333,_0x3c0a19);};}function removeListener(_0x374799,_0x1eb147){return function(){ChatGroupEvents[_0x30fc('0x5')](_0x374799,_0x1eb147);};}exports[_0x30fc('0x6')]=function(_0x1a5435){for(var _0x27a92c=0x0,_0x2a6384=events['length'];_0x27a92c<_0x2a6384;_0x27a92c++){var _0x25e5f4=events[_0x27a92c];var _0x31aaf1=createListener(_0x30fc('0x7')+_0x25e5f4,_0x1a5435);ChatGroupEvents['on'](_0x25e5f4,_0x31aaf1);}};
\ No newline at end of file
+var _0x6339=['length','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x3ae1cc,_0x2ab3e6){var _0x51a273=function(_0x22761a){while(--_0x22761a){_0x3ae1cc['push'](_0x3ae1cc['shift']());}};_0x51a273(++_0x2ab3e6);}(_0x6339,0x98));var _0x9633=function(_0x5c3bce,_0x6a925c){_0x5c3bce=_0x5c3bce-0x0;var _0x38c996=_0x6339[_0x5c3bce];return _0x38c996;};'use strict';var ChatGroupEvents=require(_0x9633('0x0'));var events=['save',_0x9633('0x1'),_0x9633('0x2')];function createListener(_0x4fac89,_0x4b5440){return function(_0x40cc8c){_0x4b5440[_0x9633('0x3')](_0x4fac89,_0x40cc8c);};}function removeListener(_0x18e084,_0x59387d){return function(){ChatGroupEvents['removeListener'](_0x18e084,_0x59387d);};}exports['register']=function(_0x2faaff){for(var _0x344a8e=0x0,_0x4599e3=events[_0x9633('0x4')];_0x344a8e<_0x4599e3;_0x344a8e++){var _0xeca78d=events[_0x344a8e];var _0x2937d4=createListener(_0x9633('0x5')+_0xeca78d,_0x2faaff);ChatGroupEvents['on'](_0xeca78d,_0x2937d4);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 1882123..f03e11e 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 _0xa8b0=['index','describe','/:id','show','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated'];(function(_0x1f7dd8,_0xe3a542){var _0xda8840=function(_0x2999f6){while(--_0x2999f6){_0x1f7dd8['push'](_0x1f7dd8['shift']());}};_0xda8840(++_0xe3a542);}(_0xa8b0,0x150));var _0x0a8b=function(_0x42d1f8,_0x22e529){_0x42d1f8=_0x42d1f8-0x0;var _0x40d234=_0xa8b0[_0x42d1f8];return _0x40d234;};'use strict';var multer=require(_0x0a8b('0x0'));var util=require(_0x0a8b('0x1'));var path=require('path');var timeout=require(_0x0a8b('0x2'));var express=require(_0x0a8b('0x3'));var router=express[_0x0a8b('0x4')]();var fs_extra=require(_0x0a8b('0x5'));var auth=require(_0x0a8b('0x6'));var interaction=require(_0x0a8b('0x7'));var config=require(_0x0a8b('0x8'));var controller=require(_0x0a8b('0x9'));router[_0x0a8b('0xa')]('/',auth[_0x0a8b('0xb')](),controller[_0x0a8b('0xc')]);router[_0x0a8b('0xa')]('/describe',auth[_0x0a8b('0xb')](),controller[_0x0a8b('0xd')]);router[_0x0a8b('0xa')](_0x0a8b('0xe'),auth[_0x0a8b('0xb')](),controller[_0x0a8b('0xf')]);router[_0x0a8b('0xa')]('/:id/unread',auth[_0x0a8b('0xb')](),controller['getUnread']);router[_0x0a8b('0xa')](_0x0a8b('0x10'),auth[_0x0a8b('0xb')](),controller[_0x0a8b('0x11')]);router[_0x0a8b('0xa')](_0x0a8b('0x12'),auth['isAuthenticated'](),controller[_0x0a8b('0x13')]);router[_0x0a8b('0x14')]('/',auth[_0x0a8b('0xb')](),controller[_0x0a8b('0x15')]);router[_0x0a8b('0x14')](_0x0a8b('0x10'),auth['isAuthenticated'](),controller[_0x0a8b('0x16')]);router[_0x0a8b('0x14')](_0x0a8b('0x12'),auth[_0x0a8b('0xb')](),controller[_0x0a8b('0x17')]);router[_0x0a8b('0x18')]('/:id',auth[_0x0a8b('0xb')](),controller[_0x0a8b('0x19')]);router[_0x0a8b('0x1a')](_0x0a8b('0xe'),auth[_0x0a8b('0xb')](),controller[_0x0a8b('0x1b')]);router[_0x0a8b('0x1a')](_0x0a8b('0x10'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x0a8b('0x1c')]=router;
\ No newline at end of file
+var _0x269d=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','put','delete','removeMembers','exports','express','Router'];(function(_0x4fa489,_0x4cba6b){var _0x41d2ce=function(_0x364060){while(--_0x364060){_0x4fa489['push'](_0x4fa489['shift']());}};_0x41d2ce(++_0x4cba6b);}(_0x269d,0xbe));var _0xd269=function(_0x2f9922,_0x3eea19){_0x2f9922=_0x2f9922-0x0;var _0x963e1c=_0x269d[_0x2f9922];return _0x963e1c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd269('0x0'));var router=express[_0xd269('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xd269('0x2'));var interaction=require(_0xd269('0x3'));var config=require(_0xd269('0x4'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xd269('0x5')](),controller[_0xd269('0x6')]);router[_0xd269('0x7')](_0xd269('0x8'),auth['isAuthenticated'](),controller[_0xd269('0x9')]);router[_0xd269('0x7')](_0xd269('0xa'),auth[_0xd269('0x5')](),controller[_0xd269('0xb')]);router[_0xd269('0x7')]('/:id/unread',auth['isAuthenticated'](),controller[_0xd269('0xc')]);router[_0xd269('0x7')](_0xd269('0xd'),auth['isAuthenticated'](),controller[_0xd269('0xe')]);router[_0xd269('0x7')](_0xd269('0xf'),auth[_0xd269('0x5')](),controller['getMessages']);router[_0xd269('0x10')]('/',auth[_0xd269('0x5')](),controller[_0xd269('0x11')]);router[_0xd269('0x10')](_0xd269('0xd'),auth['isAuthenticated'](),controller[_0xd269('0x12')]);router[_0xd269('0x10')](_0xd269('0xf'),auth['isAuthenticated'](),controller[_0xd269('0x13')]);router[_0xd269('0x14')](_0xd269('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xd269('0x15')](_0xd269('0xd'),auth[_0xd269('0x5')](),controller[_0xd269('0x16')]);module[_0xd269('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index dd84904..7c19fad 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 _0x1228=['sequelize','exports','INTEGER','ENUM','star','TEXT','STRING','long','DATE','BOOLEAN'];(function(_0x2757f8,_0xb3ded1){var _0x36aab9=function(_0x439dbe){while(--_0x439dbe){_0x2757f8['push'](_0x2757f8['shift']());}};_0x36aab9(++_0xb3ded1);}(_0x1228,0x1a4));var _0x8122=function(_0x474cc5,_0x57be85){_0x474cc5=_0x474cc5-0x0;var _0x51e42e=_0x1228[_0x474cc5];return _0x51e42e;};'use strict';var Sequelize=require(_0x8122('0x0'));module[_0x8122('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8122('0x2')]},'ratingType':{'type':Sequelize[_0x8122('0x3')](_0x8122('0x4'),'thumb'),'defaultValue':_0x8122('0x4')},'ratingMessage':{'type':Sequelize[_0x8122('0x5')]},'pathTranscript':{'type':Sequelize[_0x8122('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8122('0x6')]},'secondDisposition':{'type':Sequelize[_0x8122('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x8122('0x6')]},'browserVersion':{'type':Sequelize[_0x8122('0x6')]},'osName':{'type':Sequelize[_0x8122('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x8122('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x8122('0x6')]},'referer':{'type':Sequelize[_0x8122('0x5')]},'customerIp':{'type':Sequelize[_0x8122('0x6')]},'formData':{'type':Sequelize[_0x8122('0x5')](_0x8122('0x7'))},'read1stAt':{'type':Sequelize[_0x8122('0x8')]},'lastMsgAt':{'type':Sequelize[_0x8122('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x8122('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8122('0x6')]},'customerPort':{'type':Sequelize[_0x8122('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x8122('0x9')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x8122('0x2')]}};
\ No newline at end of file
+var _0x60d3=['STRING','DATE','TEXT','long','BOOLEAN','INTEGER','ENUM','star','thumb'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x60d3,0xc1));var _0x360d=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0x60d3[_0x26b622];return _0x58a028;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x360d('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x360d('0x1')]},'ratingType':{'type':Sequelize[_0x360d('0x2')](_0x360d('0x3'),_0x360d('0x4')),'defaultValue':_0x360d('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x360d('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x360d('0x6')]},'disposition':{'type':Sequelize[_0x360d('0x5')]},'secondDisposition':{'type':Sequelize[_0x360d('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x360d('0x5')]},'browserName':{'type':Sequelize[_0x360d('0x5')]},'browserVersion':{'type':Sequelize[_0x360d('0x5')]},'osName':{'type':Sequelize[_0x360d('0x5')]},'osVersion':{'type':Sequelize[_0x360d('0x5')]},'deviceModel':{'type':Sequelize[_0x360d('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x360d('0x5')]},'referer':{'type':Sequelize[_0x360d('0x7')]},'customerIp':{'type':Sequelize[_0x360d('0x5')]},'formData':{'type':Sequelize[_0x360d('0x7')](_0x360d('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x360d('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x360d('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x360d('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x360d('0x0')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 23d0685..90c6e55 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 _0x0138=['attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','toString','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','read','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','mustache','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','destroy','then','stack','name','render','merge','body','contact','interaction','account','index','map','ChatInteraction','rawAttributes','type','key','getOptions','chat','query','show','params','model','keys','filters','attributes','intersection','fields','includeAll','include','options','find','create','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooMetadata','user','fullname','email','POST','vidaooNote','follow','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','mailTranscript','root','format','transcript-%s.txt','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','length','hasOwnProperty','nolimit','sort','where','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','order','pick','ChatInteractionId','includeAgent','push','addTags','omit','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp'];(function(_0x3b48ab,_0x3982d1){var _0x36c993=function(_0x2d0046){while(--_0x2d0046){_0x3b48ab['push'](_0x3b48ab['shift']());}};_0x36c993(++_0x3982d1);}(_0x0138,0xf4));var _0x8013=function(_0x5a12d3,_0x1170aa){_0x5a12d3=_0x5a12d3-0x0;var _0xb282fc=_0x0138[_0x5a12d3];return _0xb282fc;};'use strict';var rimraf=require(_0x8013('0x0'));var zipdir=require(_0x8013('0x1'));var rp=require('request-promise');var moment=require(_0x8013('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8013('0x3'));var util=require(_0x8013('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8013('0x5'));var Redis=require(_0x8013('0x6'));var interaction=require(_0x8013('0x7'));var qs=require(_0x8013('0x8'));var pdf=require(_0x8013('0x9'));var logger=require('../../config/logger')(_0x8013('0xa'));var config=require(_0x8013('0xb'));var db=require('../../mysqldb')['db'];config[_0x8013('0xc')]=_[_0x8013('0xd')](config[_0x8013('0xc')],{'host':_0x8013('0xe'),'port':0x18eb});var socket=require(_0x8013('0xf'))(new Redis(config[_0x8013('0xc')]));require('./chatInteraction.socket')[_0x8013('0x10')](socket);var jayson=require(_0x8013('0x11'));var client=jayson[_0x8013('0x12')]['http']({'port':0x232b});var client9004=jayson[_0x8013('0x12')][_0x8013('0x13')]({'port':0x232c});function respondWithRpcPromise(_0x27e9bd,_0x4172ab,_0x335154,_0x1471ef){return new BPromise(function(_0xa0593d,_0x30d513){var _0x907a73=_0x1471ef||client;return _0x907a73[_0x8013('0x14')](_0x27e9bd,_0x335154)['then'](function(_0x49455f){logger[_0x8013('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x4172ab,_0x8013('0x16'));logger[_0x8013('0x17')](_0x8013('0x18'),_0x4172ab,'request\x20sent',JSON[_0x8013('0x19')](_0x49455f));if(_0x49455f[_0x8013('0x1a')]){if(_0x49455f[_0x8013('0x1a')][_0x8013('0x1b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4172ab,_0x49455f[_0x8013('0x1a')][_0x8013('0x1c')]);return _0x30d513(_0x49455f[_0x8013('0x1a')]['message']);}logger[_0x8013('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x4172ab,_0x49455f[_0x8013('0x1a')]['message']);return _0xa0593d(_0x49455f[_0x8013('0x1a')][_0x8013('0x1c')]);}else{logger[_0x8013('0x15')](_0x8013('0x1d'),_0x4172ab,_0x8013('0x16'));_0xa0593d(_0x49455f[_0x8013('0x1e')][_0x8013('0x1c')]);}})[_0x8013('0x1f')](function(_0xd099c0){logger['error'](_0x8013('0x1d'),_0x4172ab,_0xd099c0);_0x30d513(_0xd099c0);});});}function respondWithStatusCode(_0x1c00bf,_0x2f6684){_0x2f6684=_0x2f6684||0xcc;return function(_0x318b7d){if(_0x318b7d){return _0x1c00bf[_0x8013('0x20')](_0x2f6684);}return _0x1c00bf[_0x8013('0x21')](_0x2f6684)[_0x8013('0x22')]();};}function respondWithResult(_0x4912d8,_0x1ef7eb){_0x1ef7eb=_0x1ef7eb||0xc8;return function(_0x44033d){if(_0x44033d){return _0x4912d8['status'](_0x1ef7eb)['json'](_0x44033d);}};}function respondWithFilteredResult(_0x54ef1f,_0x425170){return function(_0x3c7aed){if(_0x3c7aed){var _0x2d612f=typeof _0x425170[_0x8013('0x23')]===_0x8013('0x24')&&typeof _0x425170['limit']===_0x8013('0x24');var _0x497776=_0x3c7aed[_0x8013('0x25')];var _0x501492=_0x2d612f?0x0:_0x425170[_0x8013('0x23')];var _0x5b5e8e=_0x2d612f?_0x3c7aed[_0x8013('0x25')]:_0x425170[_0x8013('0x23')]+_0x425170[_0x8013('0x26')];var _0xbf6e61;if(_0x5b5e8e>=_0x497776){_0x5b5e8e=_0x497776;_0xbf6e61=0xc8;}else{_0xbf6e61=0xce;}_0x54ef1f[_0x8013('0x21')](_0xbf6e61);return _0x54ef1f[_0x8013('0x27')](_0x8013('0x28'),_0x501492+'-'+_0x5b5e8e+'/'+_0x497776)[_0x8013('0x29')](_0x3c7aed);}return null;};}function saveUpdates(_0x21530f){return function(_0x1cb2bc){if(_0x1cb2bc){return _0x1cb2bc[_0x8013('0x2a')](_0x21530f)['then'](function(_0x116b80){return _0x116b80;});}return null;};}function removeEntity(_0x53b9f){return function(_0x152b85){if(_0x152b85){return _0x152b85[_0x8013('0x2b')]()[_0x8013('0x2c')](function(){_0x53b9f[_0x8013('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cc5b9){return function(_0x5b8371){if(!_0x5b8371){_0x4cc5b9[_0x8013('0x20')](0x194);}return _0x5b8371;};}function handleError(_0x1ece5a,_0x45197f){_0x45197f=_0x45197f||0x1f4;return function(_0xda9521){logger[_0x8013('0x1a')](_0xda9521[_0x8013('0x2d')]);if(_0xda9521[_0x8013('0x2e')]){delete _0xda9521['name'];}_0x1ece5a[_0x8013('0x21')](_0x45197f)['send'](_0xda9521);};}function getMustacheRender(_0xb79fc8,_0x191fb2){return Mustache[_0x8013('0x2f')](_0xb79fc8,_[_0x8013('0x30')](_0x191fb2[_0x8013('0x31')],{'contact':_0x191fb2[_0x8013('0x32')],'message':_0x191fb2[_0x8013('0x1c')],'agent':_0x191fb2['agent'],'interaction':_0x191fb2[_0x8013('0x33')],'account':_0x191fb2[_0x8013('0x34')]}))||'';}exports[_0x8013('0x35')]=function(_0x37b4ba,_0x415b9a){var _0x2c1544={};var _0xb9cb2=_[_0x8013('0x36')](db[_0x8013('0x37')][_0x8013('0x38')],function(_0x4994e3){return{'name':_0x4994e3['fieldName'],'type':_0x4994e3[_0x8013('0x39')][_0x8013('0x3a')]};});_0x2c1544=qs[_0x8013('0x3b')](_0xb9cb2,_0x37b4ba);return interaction['findAll'](_0x8013('0x3c'),_0x37b4ba[_0x8013('0x3d')],_0x37b4ba['user'],_0x2c1544,_0xb9cb2)[_0x8013('0x2c')](respondWithFilteredResult(_0x415b9a,_0x2c1544))[_0x8013('0x1f')](handleError(_0x415b9a,null));};exports[_0x8013('0x3e')]=function(_0x2d7ede,_0x2e12a2){var _0x1d9583={'raw':![],'where':{'id':_0x2d7ede[_0x8013('0x3f')]['id']}},_0x556178={};_0x556178[_0x8013('0x40')]=_[_0x8013('0x41')](db[_0x8013('0x37')][_0x8013('0x38')]);_0x556178[_0x8013('0x3d')]=_[_0x8013('0x41')](_0x2d7ede['query']);_0x556178[_0x8013('0x42')]=_['intersection'](_0x556178[_0x8013('0x40')],_0x556178[_0x8013('0x3d')]);_0x1d9583[_0x8013('0x43')]=_[_0x8013('0x44')](_0x556178[_0x8013('0x40')],qs[_0x8013('0x45')](_0x2d7ede['query'][_0x8013('0x45')]));_0x1d9583[_0x8013('0x43')]=_0x1d9583['attributes']['length']?_0x1d9583[_0x8013('0x43')]:_0x556178[_0x8013('0x40')];if(_0x2d7ede[_0x8013('0x3d')][_0x8013('0x46')]){_0x1d9583[_0x8013('0x47')]=[{'all':!![]}];}_0x1d9583=_['merge']({},_0x1d9583,_0x2d7ede[_0x8013('0x48')]);return db[_0x8013('0x37')][_0x8013('0x49')](_0x1d9583)[_0x8013('0x2c')](handleEntityNotFound(_0x2e12a2,null))['then'](respondWithResult(_0x2e12a2,null))[_0x8013('0x1f')](handleError(_0x2e12a2,null));};exports[_0x8013('0x4a')]=function(_0x7b250c,_0x1aa9f6){return db[_0x8013('0x37')][_0x8013('0x4a')](_0x7b250c['body'],{})[_0x8013('0x2c')](respondWithResult(_0x1aa9f6,0xc9))[_0x8013('0x1f')](handleError(_0x1aa9f6,null));};exports[_0x8013('0x2a')]=function(_0x3ff5ca,_0x2cbd69){if(_0x3ff5ca[_0x8013('0x31')]['id']){delete _0x3ff5ca[_0x8013('0x31')]['id'];}return db['ChatInteraction'][_0x8013('0x49')]({'where':{'id':_0x3ff5ca['params']['id']}})[_0x8013('0x2c')](handleEntityNotFound(_0x2cbd69,null))[_0x8013('0x2c')](saveUpdates(_0x3ff5ca[_0x8013('0x31')],null))[_0x8013('0x2c')](respondWithResult(_0x2cbd69,null))[_0x8013('0x1f')](handleError(_0x2cbd69,null));};exports[_0x8013('0x2b')]=function(_0x2951a9,_0x1d7633){return db[_0x8013('0x37')][_0x8013('0x49')]({'where':{'id':_0x2951a9[_0x8013('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1d7633,null))[_0x8013('0x2c')](removeEntity(_0x1d7633,null))[_0x8013('0x1f')](handleError(_0x1d7633,null));};exports[_0x8013('0x4b')]=function(_0x1231e0,_0x201d67){return db[_0x8013('0x37')]['describe']()[_0x8013('0x2c')](respondWithResult(_0x201d67,null))['catch'](handleError(_0x201d67,null));};exports['createVidaooSession']=function(_0x8ec26b,_0x29cc43){var _0x72b21b=_0x8ec26b[_0x8013('0x3f')]['id'];var _0x164a99;var _0x3ba278;var _0x5662e9;return db[_0x8013('0x37')][_0x8013('0x4c')]({'where':{'id':_0x72b21b}})[_0x8013('0x2c')](function(_0x30a1fa){_0x164a99=_0x30a1fa;return db[_0x8013('0x4d')]['findOne']({'where':{'id':_0x30a1fa[_0x8013('0x4e')]},'attributes':['id',_0x8013('0x4f'),_0x8013('0x50'),'vidaooTopic','vidaooNote',_0x8013('0x51')],'raw':!![]});})[_0x8013('0x2c')](function(_0x194f29){if(_0x194f29&&_0x194f29[_0x8013('0x4f')]&&_0x194f29[_0x8013('0x50')]){_0x3ba278=_0x194f29;var _0x5bb899={'interaction':{'id':_0x72b21b},'agent':{'id':_0x8ec26b['user']['id'],'name':_0x8ec26b[_0x8013('0x52')]['name'],'fullname':_0x8ec26b[_0x8013('0x52')][_0x8013('0x53')],'email':_0x8ec26b[_0x8013('0x52')][_0x8013('0x54')]},'contact':_0x8ec26b[_0x8013('0x31')][_0x8013('0x32')],'account':_0x8ec26b[_0x8013('0x31')][_0x8013('0x34')]};var _0x8fb350={'rejectUnauthorized':![],'method':_0x8013('0x55'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x194f29[_0x8013('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x8ec26b[_0x8013('0x52')]['email']],'buttons':null,'topic':_0x3ba278['vidaooTopic'],'note':_['isNull'](_0x3ba278['vidaooNote'])?null:getMustacheRender(_0x3ba278[_0x8013('0x56')],_0x5bb899),'metadata':null},'redirect':_0x8013('0x57'),'json':!![]};try{if(!_[_0x8013('0x58')](_0x3ba278[_0x8013('0x51')])){var _0x44621e=getMustacheRender(_0x3ba278[_0x8013('0x51')],_0x5bb899);var _0x13123e=JSON['parse'](_0x44621e);_0x8fb350[_0x8013('0x31')][_0x8013('0x59')]=_0x13123e;}}catch(_0x21bea5){throw new db[(_0x8013('0x5a'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x8fb350);}else{throw new db[(_0x8013('0x5a'))][(_0x8013('0x5b'))](_0x8013('0x5c'));}})[_0x8013('0x2c')](function(_0x2f5f64){_0x5662e9=_0x2f5f64;if(_0x5662e9['id']){var _0x1e8c7b={'body':_0x5662e9[_0x8013('0x5d')],'ChatWebsiteId':_0x3ba278['id'],'ChatInteractionId':_0x164a99['id'],'direction':_0x8013('0x5e'),'UserId':_0x8ec26b[_0x8013('0x52')]['id']};return db[_0x8013('0x5f')][_0x8013('0x4a')](_0x1e8c7b,{});}else{throw new db['Sequelize']['ValidationError'](_0x8013('0x60'));}})[_0x8013('0x2c')](function(){return _0x164a99[_0x8013('0x61')]({'vidaooSessionId':_0x5662e9['id']});})[_0x8013('0x2c')](respondWithResult(_0x29cc43,null))[_0x8013('0x1f')](handleError(_0x29cc43,null));};exports[_0x8013('0x62')]=function(_0x3021fb,_0x3548bf){if(_0x3021fb[_0x8013('0x31')]['id']){delete _0x3021fb[_0x8013('0x31')]['id'];}return db[_0x8013('0x37')][_0x8013('0x49')]({'where':{'id':_0x3021fb['params']['id']},'include':[{'model':db[_0x8013('0x63')],'as':_0x8013('0x64')}]})[_0x8013('0x2c')](handleEntityNotFound(_0x3548bf,null))['then'](saveUpdates(_0x3021fb['body'],null))['then'](respondWithResult(_0x3548bf,null))[_0x8013('0x1f')](handleError(_0x3548bf,null));};exports[_0x8013('0x65')]=function(_0x422bc1,_0x48a10a){if(_0x422bc1[_0x8013('0x31')]['id']){delete _0x422bc1[_0x8013('0x31')]['id'];}return db['ChatInteraction'][_0x8013('0x49')]({'where':{'id':_0x422bc1[_0x8013('0x3f')]['id']}})[_0x8013('0x2c')](function(_0x1e5273){if(!_0x1e5273){logger[_0x8013('0x1a')](_0x8013('0x66'),'abandon',0x194,_0x8013('0x67'));_0x48a10a[_0x8013('0x20')](0x194);}else{if(_0x1e5273[_0x8013('0x68')]){throw new db[(_0x8013('0x5a'))][(_0x8013('0x5b'))](_0x8013('0x69'));}}return _0x1e5273;})[_0x8013('0x2c')](function(_0x14e634){if(_0x14e634){return _0x14e634[_0x8013('0x2a')]({'closed':_0x422bc1[_0x8013('0x31')]['closed'],'disposition':_0x422bc1['body'][_0x8013('0x6a')]})[_0x8013('0x2c')](function(_0x1f9890){return _0x1f9890;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0x8013('0x65'),_0x422bc1[_0x8013('0x31')],client9004);})[_0x8013('0x2c')](respondWithResult(_0x48a10a,null))[_0x8013('0x1f')](handleError(_0x48a10a,null));};exports[_0x8013('0x6b')]=function(_0x2bed1b,_0x5d589a){_0x2bed1b[_0x8013('0x31')]['name']=_0x2bed1b[_0x8013('0x6c')][_0x8013('0x6d')];_0x2bed1b[_0x8013('0x31')][_0x8013('0x6e')]=_0x2bed1b['file'][_0x8013('0x6f')];_0x2bed1b['body'][_0x8013('0x39')]=_0x2bed1b['file'][_0x8013('0x70')];return db[_0x8013('0x71')][_0x8013('0x4a')](_0x2bed1b[_0x8013('0x31')])[_0x8013('0x2c')](respondWithResult(_0x5d589a,0xc9))[_0x8013('0x1f')](handleError(_0x5d589a,null));};exports[_0x8013('0x72')]=function(_0x49f1a5,_0x12d828){return db[_0x8013('0x37')]['findOne']({'where':{'id':_0x49f1a5[_0x8013('0x3f')]['id']},'raw':!![]})[_0x8013('0x2c')](handleEntityNotFound(_0x12d828,null))[_0x8013('0x2c')](function(_0x1a4d98){if(_0x1a4d98){if(_0x1a4d98[_0x8013('0x73')]){return _0x12d828['status'](0x193)['json']({'status':0x193,'message':_0x8013('0x74')});}return db[_0x8013('0x71')][_0x8013('0x4c')]({'where':{'id':_0x49f1a5[_0x8013('0x3d')][_0x8013('0x75')]},'raw':!![]})['then'](handleEntityNotFound(_0x12d828,null));}})[_0x8013('0x2c')](function(_0x58b01d){if(_0x58b01d){var _0x386df1=_0x58b01d[_0x8013('0x76')]!==null;var _0x165165=path[_0x8013('0x77')](config['root'],_0x8013('0x78'));if(_0x386df1){_0x165165=path[_0x8013('0x77')](_0x165165,_0x8013('0x79'));}var _0x2bfad3=path[_0x8013('0x77')](_0x165165,_0x58b01d[_0x8013('0x6e')]);return _0x12d828[_0x8013('0x7a')](_0x2bfad3);}})['catch'](handleError(_0x12d828,null));};exports['close']=function(_0x18ece3,_0x189edf){var _0x5c2adf=null;var _0x45ad1e=null;var _0x491403=null;if(_0x18ece3[_0x8013('0x31')]['id']){delete _0x18ece3[_0x8013('0x31')]['id'];}if(_0x18ece3[_0x8013('0x31')][_0x8013('0x7b')]){_0x491403=path[_0x8013('0x77')](config[_0x8013('0x7c')],'server/files/chat/upload/',util[_0x8013('0x7d')](_0x8013('0x7e'),Date['now']()));_0x18ece3['body'][_0x8013('0x7f')]=_0x491403;}return db['ChatInteraction'][_0x8013('0x49')]({'where':{'id':_0x18ece3['params']['id']},'include':[{'model':db[_0x8013('0x5f')],'as':_0x8013('0x80'),'include':[{'model':db[_0x8013('0x81')],'as':_0x8013('0x81')}]}]})[_0x8013('0x2c')](handleEntityNotFound(_0x189edf,null))[_0x8013('0x2c')](saveUpdates(_0x18ece3[_0x8013('0x31')],null))[_0x8013('0x2c')](function(_0x319083){if(_0x319083){_0x5c2adf=_0x319083;return db[_0x8013('0x4d')]['find']({'where':{'id':_0x5c2adf[_0x8013('0x4e')]}});}})[_0x8013('0x2c')](function(_0x4bbc3d){if(_0x4bbc3d){_0x45ad1e=_0x4bbc3d;return db[_0x8013('0x63')][_0x8013('0x49')]({'where':{'id':_0x5c2adf[_0x8013('0x82')]}});}})['then'](function(_0x268b70){if(_0x268b70){if(_0x491403){var _0x3159b4=null;for(var _0x8126cf=0x1;_0x8126cf<_0x5c2adf[_0x8013('0x80')]['length'];++_0x8126cf){_0x3159b4=_0x5c2adf[_0x8013('0x80')][_0x8126cf];var _0x182509=_0x3159b4[_0x8013('0x68')]?util[_0x8013('0x7d')](_0x8013('0x83'),_0x45ad1e[_0x8013('0x84')],_0x3159b4[_0x8013('0x68')]):'System';var _0x132751=_0x18ece3[_0x8013('0x31')][_0x8013('0x85')]||util['format'](_0x8013('0x83'),_0x8013('0x86'),_0x3159b4['ContactId']);switch(_0x45ad1e[_0x8013('0x87')]){case _0x8013('0x88'):_0x182509=_0x3159b4['UserId']?util['format'](_0x8013('0x83'),_0x45ad1e[_0x8013('0x84')],_0x3159b4['UserId']):_0x8013('0x89');break;case _0x8013('0x8a'):_0x182509=_0x3159b4[_0x8013('0x68')]?_0x3159b4[_0x8013('0x81')][_0x8013('0x8b')]||_0x3159b4[_0x8013('0x81')]['fullname']:_0x8013('0x89');break;case'agent_fullname':_0x182509=_0x3159b4[_0x8013('0x68')]?_0x3159b4['User'][_0x8013('0x53')]:_0x8013('0x89');break;default:_0x182509=_0x3159b4[_0x8013('0x68')]?util['format'](_0x8013('0x83'),_0x45ad1e[_0x8013('0x84')],_0x3159b4[_0x8013('0x68')]):_0x8013('0x89');}var _0x376097=util[_0x8013('0x7d')]('[%s]\x20%s:\x20%s\x0a',moment(_0x3159b4[_0x8013('0x8c')])['format'](_0x8013('0x8d')),_0x3159b4[_0x8013('0x8e')]==='in'?_0x132751:_0x182509,_0x3159b4['body']);if(!_0x3159b4[_0x8013('0x8f')]){fs['appendFileSync'](_0x491403,_0x376097);}}return db['MailAccount'][_0x8013('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0x8013('0x90')],'as':_0x8013('0x91'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x8013('0x92'),'raw':!![]}]}]});}}})[_0x8013('0x2c')](function(_0xdedef){if(!_0xdedef||!_0xdedef[_0x8013('0x91')]||!_0x18ece3[_0x8013('0x31')])return _0x5c2adf;var _0x47d10=_0xdedef[_0x8013('0x93')]();return respondWithRpcPromise('SendMail',_0x8013('0x94'),{'account':_0x47d10,'message':{'from':util[_0x8013('0x7d')](_0x8013('0x95'),_0xdedef[_0x8013('0x2e')],_0xdedef['email']||_0xdedef[_0x8013('0x91')][_0x8013('0x52')]),'to':_0x18ece3[_0x8013('0x31')]['mailTranscript'],'subject':_0x8013('0x96'),'text':util[_0x8013('0x7d')](_0x8013('0x97'),_0x18ece3[_0x8013('0x31')]['mailTranscript']),'attachments':[{'path':_0x491403}]}})[_0x8013('0x2c')](function(){return _0x5c2adf;})['catch'](function(_0x460dab){logger[_0x8013('0x1a')](_0x460dab);});})[_0x8013('0x2c')](respondWithStatusCode(_0x189edf,0xc8))[_0x8013('0x1f')](handleError(_0x189edf,null));};exports[_0x8013('0x98')]=function(_0x147c27,_0x68d845){return db[_0x8013('0x5f')][_0x8013('0x49')]({'where':{'id':_0x147c27['params']['id']}})[_0x8013('0x2c')](handleEntityNotFound(_0x68d845,null))[_0x8013('0x2c')](function(_0x3391ea){if(_0x3391ea){return _0x3391ea['addMessage'](_0x147c27[_0x8013('0x31')]['ids'],_['omit'](_0x147c27[_0x8013('0x31')],[_0x8013('0x99'),'id'])||{});}})[_0x8013('0x2c')](respondWithResult(_0x68d845,null))[_0x8013('0x1f')](handleError(_0x68d845,null));};exports[_0x8013('0x9a')]=function(_0x21c483,_0x2f9229){var _0x370f84={'raw':![],'where':{}};var _0x1e3fce={};var _0x4314d1={'count':0x0,'rows':[]};return db[_0x8013('0x37')][_0x8013('0x4c')]({'where':{'id':_0x21c483[_0x8013('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2f9229,null))[_0x8013('0x2c')](function(_0x351597){if(_0x351597){_0x1e3fce[_0x8013('0x40')]=_[_0x8013('0x41')](db['ChatMessage']['rawAttributes']);_0x1e3fce[_0x8013('0x3d')]=_[_0x8013('0x41')](_0x21c483['query']);_0x1e3fce[_0x8013('0x42')]=_['intersection'](_0x1e3fce['model'],_0x1e3fce[_0x8013('0x3d')]);_0x370f84['attributes']=_[_0x8013('0x44')](_0x1e3fce[_0x8013('0x40')],qs[_0x8013('0x45')](_0x21c483[_0x8013('0x3d')]['fields']));_0x370f84[_0x8013('0x43')]=_0x370f84[_0x8013('0x43')][_0x8013('0x9b')]?_0x370f84[_0x8013('0x43')]:_0x1e3fce[_0x8013('0x40')];if(!_0x21c483[_0x8013('0x3d')][_0x8013('0x9c')](_0x8013('0x9d'))){_0x370f84[_0x8013('0x26')]=qs['limit'](_0x21c483[_0x8013('0x3d')][_0x8013('0x26')]);_0x370f84[_0x8013('0x23')]=qs['offset'](_0x21c483[_0x8013('0x3d')][_0x8013('0x23')]);}_0x370f84['order']=qs[_0x8013('0x9e')](_0x21c483[_0x8013('0x3d')][_0x8013('0x9e')]);_0x370f84[_0x8013('0x9f')]=qs['filters'](_['pick'](_0x21c483[_0x8013('0x3d')],_0x1e3fce[_0x8013('0x42')]));_0x370f84[_0x8013('0x9f')]['ChatInteractionId']=_0x351597['id'];if(_0x21c483[_0x8013('0x3d')][_0x8013('0xa0')]){_0x370f84[_0x8013('0x9f')]=_[_0x8013('0x30')](_0x370f84[_0x8013('0x9f')],{'$or':_[_0x8013('0x36')](_0x370f84[_0x8013('0x43')],function(_0x1218b2){var _0x1c34f0={};_0x1c34f0[_0x1218b2]={'$like':'%'+_0x21c483[_0x8013('0x3d')]['filter']+'%'};return _0x1c34f0;})});}if(_0x21c483['query'][_0x8013('0xa1')]){var _0x5027c6=_0x21c483[_0x8013('0x3d')]['$gte']['split'](',');var _0x3a4878={};_0x3a4878[_0x5027c6[0x0]]={'$gte':moment(_0x5027c6[0x1])[_0x8013('0x7d')](_0x8013('0xa2'))};_0x370f84['where']=_[_0x8013('0x30')](_0x370f84[_0x8013('0x9f')],_0x3a4878);}_0x370f84=_[_0x8013('0x30')]({},_0x370f84,_0x21c483[_0x8013('0x48')]);return db[_0x8013('0x5f')][_0x8013('0x25')]({'where':_0x370f84[_0x8013('0x9f')]})[_0x8013('0x2c')](function(_0x17265d){_0x4314d1['count']=_0x17265d;if(_0x21c483[_0x8013('0x3d')][_0x8013('0x46')]){_0x370f84[_0x8013('0x47')]=[{'all':!![]}];}return db[_0x8013('0x5f')][_0x8013('0xa3')](_0x370f84);})[_0x8013('0x2c')](function(_0x546ddf){_0x4314d1[_0x8013('0xa4')]=_0x546ddf;return _0x4314d1;});}})[_0x8013('0x2c')](respondWithFilteredResult(_0x2f9229,_0x370f84))[_0x8013('0x1f')](handleError(_0x2f9229,null));};exports[_0x8013('0xa5')]=function(_0x1adc56,_0x3f8998){var _0x1b9822={'where':{}},_0x4c4e57={},_0xb99ed={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x8013('0x4c')]({'where':{'id':_0x1adc56[_0x8013('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3f8998,null))[_0x8013('0x2c')](function(_0x9c12af){if(_0x9c12af){_0x4c4e57[_0x8013('0x40')]=_[_0x8013('0x41')](db[_0x8013('0x5f')][_0x8013('0x38')]);_0x4c4e57[_0x8013('0x3d')]=_['keys'](_0x1adc56[_0x8013('0x3d')]);_0x4c4e57[_0x8013('0x42')]=_[_0x8013('0x44')](_0x4c4e57[_0x8013('0x40')],_0x4c4e57[_0x8013('0x3d')]);_0x1b9822['attributes']=_[_0x8013('0x44')](_0x4c4e57[_0x8013('0x40')],qs['fields'](_0x1adc56[_0x8013('0x3d')][_0x8013('0x45')]));_0x1b9822[_0x8013('0x43')]=_0x1b9822[_0x8013('0x43')][_0x8013('0x9b')]?_0x1b9822[_0x8013('0x43')]:_0x4c4e57['model'];if(!_0x1adc56[_0x8013('0x3d')]['hasOwnProperty']('nolimit')){_0x1b9822[_0x8013('0x26')]=qs[_0x8013('0x26')](_0x1adc56[_0x8013('0x3d')][_0x8013('0x26')]);_0x1b9822['offset']=qs[_0x8013('0x23')](_0x1adc56['query'][_0x8013('0x23')]);}_0x1b9822[_0x8013('0xa6')]=qs[_0x8013('0x9e')](_0x1adc56['query']['sort']);_0x1b9822[_0x8013('0x9f')]=qs[_0x8013('0x42')](_[_0x8013('0xa7')](_0x1adc56[_0x8013('0x3d')],_0x4c4e57[_0x8013('0x42')]));_0x1b9822['where'][_0x8013('0xa8')]=_0x9c12af['id'];if(_0x1adc56[_0x8013('0x3d')][_0x8013('0xa0')]){_0x1b9822[_0x8013('0x9f')]=_[_0x8013('0x30')](_0x1b9822[_0x8013('0x9f')],{'$or':_[_0x8013('0x36')](_0x1b9822['attributes'],function(_0xd0aacf){var _0x30a60d={};_0x30a60d[_0xd0aacf]={'$like':'%'+_0x1adc56[_0x8013('0x3d')][_0x8013('0xa0')]+'%'};return _0x30a60d;})});}_0x1b9822['where'][_0x8013('0x8f')]=![];if(_0x1adc56[_0x8013('0x3d')]['id']){_0x1b9822['where']['id']={'$gt':_0x1adc56[_0x8013('0x3d')]['id']};}_0x1b9822=_[_0x8013('0x30')]({},_0x1b9822,_0x1adc56['options']);return db[_0x8013('0x5f')][_0x8013('0x25')]({'where':_0x1b9822['where']})[_0x8013('0x2c')](function(_0xfdc0ec){_0xb99ed[_0x8013('0x25')]=_0xfdc0ec;_0x1b9822['include']=[];if(_0x1adc56[_0x8013('0x3d')][_0x8013('0xa9')]){_0x1b9822[_0x8013('0x47')][_0x8013('0xaa')]({'model':db['User'],'as':'User','attributes':['id',_0x8013('0x53'),'alias']});}if(_0x1adc56[_0x8013('0x3d')][_0x8013('0x46')]){_0x1b9822[_0x8013('0x47')]=[{'all':!![]}];}return db[_0x8013('0x5f')][_0x8013('0xa3')](_0x1b9822);})['then'](function(_0x36896b){_0xb99ed[_0x8013('0xa4')]=_0x36896b;return _0xb99ed;});}})[_0x8013('0x2c')](respondWithFilteredResult(_0x3f8998,_0x1b9822))[_0x8013('0x1f')](handleError(_0x3f8998,null));};exports[_0x8013('0xab')]=function(_0x3355fb,_0xf88343){return db['ChatInteraction'][_0x8013('0x49')]({'where':{'id':_0x3355fb['params']['id']}})[_0x8013('0x2c')](handleEntityNotFound(_0xf88343,null))[_0x8013('0x2c')](function(_0x35f36f){if(_0x35f36f){return _0x35f36f['setTags'](_0x3355fb[_0x8013('0x31')][_0x8013('0x99')],_[_0x8013('0xac')](_0x3355fb['body'],[_0x8013('0x99'),'id'])||{})[_0x8013('0xad')](function(){return db['Tag'][_0x8013('0xa3')]({'attributes':['id',_0x8013('0x2e'),_0x8013('0xae')],'where':{'id':_0x3355fb[_0x8013('0x31')]['ids']}});})['then'](function(_0xd1657d){socket[_0x8013('0xaf')](_0x8013('0xb0'),{'id':Number(_0x3355fb[_0x8013('0x3f')]['id']),'tags':_0xd1657d||[]});return{'id':Number(_0x3355fb['params']['id']),'tags':_0xd1657d||[]};});}})[_0x8013('0x2c')](respondWithResult(_0xf88343,null))['catch'](handleError(_0xf88343,null));};exports[_0x8013('0xb1')]=function(_0xec0146,_0x327c81){return db[_0x8013('0x37')][_0x8013('0x49')]({'where':{'id':_0xec0146[_0x8013('0x3f')]['id']}})[_0x8013('0x2c')](handleEntityNotFound(_0x327c81,null))['then'](function(_0x3b97f3){if(_0x3b97f3){return _0x3b97f3[_0x8013('0xb1')](_0xec0146['query'][_0x8013('0x99')]);}})[_0x8013('0x2c')](respondWithStatusCode(_0x327c81,null))[_0x8013('0x1f')](handleError(_0x327c81,null));};exports[_0x8013('0x7a')]=function(_0x8745a6,_0x21c0ef){var _0x142225=moment()[_0x8013('0xb2')]()['toString']();var _0x5b838b=path['join'](config[_0x8013('0x7c')],_0x8013('0xb3'),_0x8013('0xb4'),_0x8013('0xb5'));var _0x349c79=path[_0x8013('0x77')](config[_0x8013('0x7c')],_0x8013('0xb3'),_0x8013('0xb4'),_0x8013('0xb6'));var _0x152106=path[_0x8013('0x77')](_0x5b838b,_0x142225);var _0x150729=util['format'](_0x8013('0xb7'),_0x8745a6[_0x8013('0x3f')]['id'],_0x142225);var _0x5a6fa1=path[_0x8013('0x77')](_0x5b838b,_0x150729);var _0x398755=[];_0x398755[_0x8013('0xaa')]({'model':db[_0x8013('0x81')],'as':_0x8013('0x81'),'attributes':['id',_0x8013('0x53')],'raw':!![]});_0x398755[_0x8013('0xaa')]({'model':db[_0x8013('0x63')],'as':_0x8013('0x64'),'attributes':['id',_0x8013('0xb8'),_0x8013('0xb9')],'raw':!![]});if(_0x8745a6['query'][_0x8013('0xb6')]){_0x398755[_0x8013('0xaa')]({'model':db[_0x8013('0x71')],'as':_0x8013('0x71'),'raw':!![]});}var _0x32b8b0=[{'model':db[_0x8013('0x5f')],'as':_0x8013('0x80'),'attributes':['id',_0x8013('0x31'),_0x8013('0x8c'),'direction',_0x8013('0x8f'),'read'],'include':_0x398755}];_0x32b8b0['push']({'model':db['ChatWebsite'],'as':_0x8013('0xba'),'attributes':['id',_0x8013('0x2e')]});_0x32b8b0[_0x8013('0xaa')]({'model':db['User'],'as':_0x8013('0xbb'),'attributes':['id','fullname']});return db[_0x8013('0x37')]['find']({'where':{'id':_0x8745a6[_0x8013('0x3f')]['id']},'include':_0x32b8b0})[_0x8013('0x2c')](handleEntityNotFound(_0x21c0ef,null))[_0x8013('0x2c')](function(_0x1e87aa){if(_0x1e87aa){var _0x372acf=_0x1e87aa[_0x8013('0xbc')]({'plain':!![]});fs[_0x8013('0xbd')](_0x152106);var _0x28ea95={'channel':_0x8013('0xbe'),'account':_0x372acf[_0x8013('0xba')]['name'],'agent':_0x372acf[_0x8013('0xbb')]?_0x372acf[_0x8013('0xbb')][_0x8013('0x53')]:_0x8013('0xbf'),'createdAt':moment(_0x372acf[_0x8013('0x8c')])[_0x8013('0x7d')](_0x8013('0xa2'))[_0x8013('0xc0')](),'closedAt':_0x372acf[_0x8013('0x73')]?moment(_0x372acf[_0x8013('0xc1')])[_0x8013('0x7d')](_0x8013('0xa2'))[_0x8013('0xc0')]():'','disposition':_0x372acf[_0x8013('0x6a')],'chatInfo':{'browser':_0x372acf[_0x8013('0xc2')],'os':_0x372acf[_0x8013('0xc3')],'referer':_0x372acf[_0x8013('0xc4')],'customerIp':_0x372acf[_0x8013('0xc5')],'customerPort':_0x372acf[_0x8013('0xc6')]?_0x372acf[_0x8013('0xc6')]:_0x8013('0xbf')},'messages':_(_0x372acf[_0x8013('0x80')])[_0x8013('0xc7')]()[_0x8013('0xa0')]({'secret':![]})[_0x8013('0x36')](function(_0x395112){if(_0x395112[_0x8013('0x71')]){var _0x26c9f6=path[_0x8013('0x77')](_0x349c79,_0x395112[_0x8013('0x71')][_0x8013('0x6e')]);if(fs[_0x8013('0xc8')](_0x26c9f6)){fs[_0x8013('0xc9')](_0x26c9f6)[_0x8013('0xca')](fs[_0x8013('0xcb')](path['join'](_0x152106,_0x395112['Attachment'][_0x8013('0x6e')])));}}return{'date':moment(_0x395112[_0x8013('0x8c')])['format'](_0x8013('0xa2'))[_0x8013('0xc0')](),'sender':_0x395112[_0x8013('0x8e')]==='out'?_0x395112['User']?_0x395112['User'][_0x8013('0x53')]:_0x8013('0x89'):_0x395112['Contact'][_0x8013('0xb8')]+(_0x395112[_0x8013('0x64')]['lastName']?'\x20'+_0x395112[_0x8013('0x64')]['lastName']:''),'body':_0x395112[_0x8013('0x71')]?_0x395112['Attachment'][_0x8013('0x6e')]:_0x395112[_0x8013('0x31')],'direction':_0x395112[_0x8013('0x8e')]===_0x8013('0x5e')?'A':'C','secret':_0x395112[_0x8013('0x8f')],'read':_0x395112[_0x8013('0xcc')],'attachment':_0x395112[_0x8013('0x71')]};})[_0x8013('0xcd')]()};return ejs[_0x8013('0xce')](path['join'](config[_0x8013('0x7c')],_0x8013('0xb3'),_0x8013('0xcf'),_0x8013('0xd0')),{'interaction':_0x28ea95})[_0x8013('0x2c')](function(_0x5c4e7d){var _0x5ebbc4=path[_0x8013('0x77')](_0x152106,_0x8013('0xd1')+_0x372acf['id']+'-'+_0x142225+'.pdf');var _0x1a8635={'path':_0x5ebbc4,'channel':_0x8013('0xbe'),'interactionId':_0x372acf['id']};return pdf[_0x8013('0xd2')](_0x5c4e7d,_0x1a8635);})['then'](function(){return new Promise(function(_0x26a3af,_0x25317f){zipdir(_0x152106,{'saveTo':_0x5a6fa1},function(_0x42ea44,_0x49312e){if(_0x42ea44)return _0x25317f(_0x42ea44);return _0x26a3af(_0x49312e);});})[_0x8013('0x2c')](function(){return new BPromise(function(_0x42d8da,_0x28b611){rimraf(_0x152106,function(_0xd032ea){if(_0xd032ea)_0x28b611(_0xd032ea);return _0x42d8da();});});})[_0x8013('0x2c')](function(){return _0x21c0ef[_0x8013('0x7a')](_0x5a6fa1,_0x150729,function(_0x2091c4){if(_0x2091c4){logger[_0x8013('0x1a')](_0x8013('0xd3'),_0x2091c4);}else{fs[_0x8013('0xd4')](_0x5a6fa1);}});});});}else{return _0x21c0ef[_0x8013('0x20')](0xc8);}})['catch'](handleError(_0x21c0ef,null));};
\ No newline at end of file
+var _0xc812=['downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','bluebird','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','jayson/promise','http','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','end','json','offset','limit','undefined','count','status','destroy','stack','name','send','render','body','contact','agent','interaction','account','index','map','rawAttributes','fieldName','type','findAll','catch','show','params','model','keys','query','intersection','fields','attributes','length','includeAll','include','merge','options','ChatInteraction','find','create','update','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ChatWebsiteId','ContactId','agentAlias','System','customer','format','Visitor','agentIdentifier','agent_alias','alias','%s%d','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','hasOwnProperty','nolimit','order','sort','where','pick','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','ChatInteractionId','filter','push','addTags','spread','Tag','color','emit','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','toString','browserName','osName','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views'];(function(_0x5cac67,_0x1837d3){var _0x27ce41=function(_0x17910f){while(--_0x17910f){_0x5cac67['push'](_0x5cac67['shift']());}};_0x27ce41(++_0x1837d3);}(_0xc812,0x1b2));var _0x2c81=function(_0x13ddc6,_0x4d5530){_0x13ddc6=_0x13ddc6-0x0;var _0x4202fd=_0xc812[_0x13ddc6];return _0x4202fd;};'use strict';var rimraf=require(_0x2c81('0x0'));var zipdir=require(_0x2c81('0x1'));var rp=require(_0x2c81('0x2'));var moment=require('moment');var BPromise=require(_0x2c81('0x3'));var Mustache=require('mustache');var util=require(_0x2c81('0x4'));var path=require(_0x2c81('0x5'));var ejs=require(_0x2c81('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x2c81('0x7'));var interaction=require(_0x2c81('0x8'));var qs=require(_0x2c81('0x9'));var pdf=require(_0x2c81('0xa'));var logger=require(_0x2c81('0xb'))(_0x2c81('0xc'));var config=require(_0x2c81('0xd'));var db=require(_0x2c81('0xe'))['db'];config['redis']=_[_0x2c81('0xf')](config[_0x2c81('0x10')],{'host':_0x2c81('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c81('0x10')]));require(_0x2c81('0x12'))[_0x2c81('0x13')](socket);var jayson=require(_0x2c81('0x14'));var client=jayson['client'][_0x2c81('0x15')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x354fae,_0x50d103,_0x49704f,_0x1292d6){return new BPromise(function(_0x582c03,_0x4c6610){var _0x2909f4=_0x1292d6||client;return _0x2909f4[_0x2c81('0x16')](_0x354fae,_0x49704f)[_0x2c81('0x17')](function(_0x229249){logger[_0x2c81('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x50d103,_0x2c81('0x19'));logger['debug'](_0x2c81('0x1a'),_0x50d103,_0x2c81('0x19'),JSON[_0x2c81('0x1b')](_0x229249));if(_0x229249[_0x2c81('0x1c')]){if(_0x229249['error'][_0x2c81('0x1d')]===0x1f4){logger[_0x2c81('0x1c')](_0x2c81('0x1e'),_0x50d103,_0x229249[_0x2c81('0x1c')]['message']);return _0x4c6610(_0x229249[_0x2c81('0x1c')][_0x2c81('0x1f')]);}logger[_0x2c81('0x1c')](_0x2c81('0x1e'),_0x50d103,_0x229249['error'][_0x2c81('0x1f')]);return _0x582c03(_0x229249[_0x2c81('0x1c')]['message']);}else{logger[_0x2c81('0x18')](_0x2c81('0x1e'),_0x50d103,_0x2c81('0x19'));_0x582c03(_0x229249[_0x2c81('0x20')][_0x2c81('0x1f')]);}})['catch'](function(_0x17ee0c){logger['error'](_0x2c81('0x1e'),_0x50d103,_0x17ee0c);_0x4c6610(_0x17ee0c);});});}function respondWithStatusCode(_0x12f92d,_0x12f892){_0x12f892=_0x12f892||0xcc;return function(_0x5b2b76){if(_0x5b2b76){return _0x12f92d[_0x2c81('0x21')](_0x12f892);}return _0x12f92d['status'](_0x12f892)[_0x2c81('0x22')]();};}function respondWithResult(_0x1dcfff,_0x363562){_0x363562=_0x363562||0xc8;return function(_0xdf6d50){if(_0xdf6d50){return _0x1dcfff['status'](_0x363562)[_0x2c81('0x23')](_0xdf6d50);}};}function respondWithFilteredResult(_0x56bfb9,_0x25f8d0){return function(_0x2cdeb1){if(_0x2cdeb1){var _0x45865b=typeof _0x25f8d0[_0x2c81('0x24')]==='undefined'&&typeof _0x25f8d0[_0x2c81('0x25')]===_0x2c81('0x26');var _0x48d812=_0x2cdeb1[_0x2c81('0x27')];var _0x2e6825=_0x45865b?0x0:_0x25f8d0[_0x2c81('0x24')];var _0x2c98b1=_0x45865b?_0x2cdeb1[_0x2c81('0x27')]:_0x25f8d0[_0x2c81('0x24')]+_0x25f8d0[_0x2c81('0x25')];var _0x53b7d4;if(_0x2c98b1>=_0x48d812){_0x2c98b1=_0x48d812;_0x53b7d4=0xc8;}else{_0x53b7d4=0xce;}_0x56bfb9[_0x2c81('0x28')](_0x53b7d4);return _0x56bfb9['set']('Content-Range',_0x2e6825+'-'+_0x2c98b1+'/'+_0x48d812)[_0x2c81('0x23')](_0x2cdeb1);}return null;};}function saveUpdates(_0x191c8c){return function(_0x290594){if(_0x290594){return _0x290594['update'](_0x191c8c)[_0x2c81('0x17')](function(_0x5dfc53){return _0x5dfc53;});}return null;};}function removeEntity(_0x3a5a8f){return function(_0x402bee){if(_0x402bee){return _0x402bee[_0x2c81('0x29')]()['then'](function(){_0x3a5a8f[_0x2c81('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30d624){return function(_0x1e5f3d){if(!_0x1e5f3d){_0x30d624[_0x2c81('0x21')](0x194);}return _0x1e5f3d;};}function handleError(_0x3f8a38,_0x51cb52){_0x51cb52=_0x51cb52||0x1f4;return function(_0x5ac1ab){logger['error'](_0x5ac1ab[_0x2c81('0x2a')]);if(_0x5ac1ab[_0x2c81('0x2b')]){delete _0x5ac1ab[_0x2c81('0x2b')];}_0x3f8a38[_0x2c81('0x28')](_0x51cb52)[_0x2c81('0x2c')](_0x5ac1ab);};}function getMustacheRender(_0x4ce07e,_0x422f35){return Mustache[_0x2c81('0x2d')](_0x4ce07e,_['merge'](_0x422f35[_0x2c81('0x2e')],{'contact':_0x422f35[_0x2c81('0x2f')],'message':_0x422f35[_0x2c81('0x1f')],'agent':_0x422f35[_0x2c81('0x30')],'interaction':_0x422f35[_0x2c81('0x31')],'account':_0x422f35[_0x2c81('0x32')]}))||'';}exports[_0x2c81('0x33')]=function(_0x38816c,_0xd2f725){var _0x33149e={};var _0x5f302d=_[_0x2c81('0x34')](db['ChatInteraction'][_0x2c81('0x35')],function(_0x252403){return{'name':_0x252403[_0x2c81('0x36')],'type':_0x252403[_0x2c81('0x37')]['key']};});_0x33149e=qs['getOptions'](_0x5f302d,_0x38816c);return interaction[_0x2c81('0x38')]('chat',_0x38816c['query'],_0x38816c['user'],_0x33149e,_0x5f302d)[_0x2c81('0x17')](respondWithFilteredResult(_0xd2f725,_0x33149e))[_0x2c81('0x39')](handleError(_0xd2f725,null));};exports[_0x2c81('0x3a')]=function(_0x136a52,_0xf1af4b){var _0x358442={'raw':![],'where':{'id':_0x136a52[_0x2c81('0x3b')]['id']}},_0x290680={};_0x290680[_0x2c81('0x3c')]=_[_0x2c81('0x3d')](db['ChatInteraction'][_0x2c81('0x35')]);_0x290680[_0x2c81('0x3e')]=_['keys'](_0x136a52['query']);_0x290680['filters']=_['intersection'](_0x290680['model'],_0x290680[_0x2c81('0x3e')]);_0x358442['attributes']=_[_0x2c81('0x3f')](_0x290680['model'],qs[_0x2c81('0x40')](_0x136a52[_0x2c81('0x3e')][_0x2c81('0x40')]));_0x358442[_0x2c81('0x41')]=_0x358442['attributes'][_0x2c81('0x42')]?_0x358442[_0x2c81('0x41')]:_0x290680[_0x2c81('0x3c')];if(_0x136a52[_0x2c81('0x3e')][_0x2c81('0x43')]){_0x358442[_0x2c81('0x44')]=[{'all':!![]}];}_0x358442=_[_0x2c81('0x45')]({},_0x358442,_0x136a52[_0x2c81('0x46')]);return db[_0x2c81('0x47')][_0x2c81('0x48')](_0x358442)[_0x2c81('0x17')](handleEntityNotFound(_0xf1af4b,null))[_0x2c81('0x17')](respondWithResult(_0xf1af4b,null))[_0x2c81('0x39')](handleError(_0xf1af4b,null));};exports['create']=function(_0x23c689,_0x684d0e){return db[_0x2c81('0x47')][_0x2c81('0x49')](_0x23c689[_0x2c81('0x2e')],{})[_0x2c81('0x17')](respondWithResult(_0x684d0e,0xc9))[_0x2c81('0x39')](handleError(_0x684d0e,null));};exports[_0x2c81('0x4a')]=function(_0x44f5ae,_0xfa20a5){if(_0x44f5ae[_0x2c81('0x2e')]['id']){delete _0x44f5ae[_0x2c81('0x2e')]['id'];}return db[_0x2c81('0x47')][_0x2c81('0x48')]({'where':{'id':_0x44f5ae[_0x2c81('0x3b')]['id']}})[_0x2c81('0x17')](handleEntityNotFound(_0xfa20a5,null))[_0x2c81('0x17')](saveUpdates(_0x44f5ae[_0x2c81('0x2e')],null))[_0x2c81('0x17')](respondWithResult(_0xfa20a5,null))['catch'](handleError(_0xfa20a5,null));};exports[_0x2c81('0x29')]=function(_0x5a9de6,_0x497373){return db[_0x2c81('0x47')][_0x2c81('0x48')]({'where':{'id':_0x5a9de6[_0x2c81('0x3b')]['id']}})['then'](handleEntityNotFound(_0x497373,null))[_0x2c81('0x17')](removeEntity(_0x497373,null))['catch'](handleError(_0x497373,null));};exports[_0x2c81('0x4b')]=function(_0x11ab98,_0x3f91c3){return db['ChatInteraction']['describe']()[_0x2c81('0x17')](respondWithResult(_0x3f91c3,null))[_0x2c81('0x39')](handleError(_0x3f91c3,null));};exports[_0x2c81('0x4c')]=function(_0x481dda,_0x487505){var _0x371514=_0x481dda['params']['id'];var _0x2f5fbd;var _0x328d0b;var _0x2e3be8;return db[_0x2c81('0x47')]['findOne']({'where':{'id':_0x371514}})[_0x2c81('0x17')](function(_0x53fd80){_0x2f5fbd=_0x53fd80;return db[_0x2c81('0x4d')][_0x2c81('0x4e')]({'where':{'id':_0x53fd80['ChatWebsiteId']},'attributes':['id',_0x2c81('0x4f'),_0x2c81('0x50'),_0x2c81('0x51'),'vidaooNote',_0x2c81('0x52')],'raw':!![]});})['then'](function(_0x4e1302){if(_0x4e1302&&_0x4e1302[_0x2c81('0x4f')]&&_0x4e1302[_0x2c81('0x50')]){_0x328d0b=_0x4e1302;var _0x554b49={'interaction':{'id':_0x371514},'agent':{'id':_0x481dda[_0x2c81('0x53')]['id'],'name':_0x481dda['user'][_0x2c81('0x2b')],'fullname':_0x481dda[_0x2c81('0x53')][_0x2c81('0x54')],'email':_0x481dda[_0x2c81('0x53')][_0x2c81('0x55')]},'contact':_0x481dda[_0x2c81('0x2e')][_0x2c81('0x2f')],'account':_0x481dda[_0x2c81('0x2e')][_0x2c81('0x32')]};var _0x545151={'rejectUnauthorized':![],'method':_0x2c81('0x56'),'url':_0x2c81('0x57'),'headers':{'X-APIKEY':_0x4e1302[_0x2c81('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x481dda[_0x2c81('0x53')]['email']],'buttons':null,'topic':_0x328d0b['vidaooTopic'],'note':_[_0x2c81('0x58')](_0x328d0b[_0x2c81('0x59')])?null:getMustacheRender(_0x328d0b[_0x2c81('0x59')],_0x554b49),'metadata':null},'redirect':_0x2c81('0x5a'),'json':!![]};try{if(!_['isNull'](_0x328d0b[_0x2c81('0x52')])){var _0x8898d2=getMustacheRender(_0x328d0b[_0x2c81('0x52')],_0x554b49);var _0x4c394b=JSON[_0x2c81('0x5b')](_0x8898d2);_0x545151[_0x2c81('0x2e')][_0x2c81('0x5c')]=_0x4c394b;}}catch(_0x4e405a){throw new db[(_0x2c81('0x5d'))]['ValidationError'](_0x2c81('0x5e'));}return rp(_0x545151);}else{throw new db[(_0x2c81('0x5d'))][(_0x2c81('0x5f'))](_0x2c81('0x60'));}})['then'](function(_0x5eb9d3){_0x2e3be8=_0x5eb9d3;if(_0x2e3be8['id']){var _0x166601={'body':_0x2e3be8['join_url'],'ChatWebsiteId':_0x328d0b['id'],'ChatInteractionId':_0x2f5fbd['id'],'direction':_0x2c81('0x61'),'UserId':_0x481dda[_0x2c81('0x53')]['id']};return db['ChatMessage'][_0x2c81('0x49')](_0x166601,{});}else{throw new db[(_0x2c81('0x5d'))]['ValidationError'](_0x2c81('0x62'));}})[_0x2c81('0x17')](function(){return _0x2f5fbd[_0x2c81('0x63')]({'vidaooSessionId':_0x2e3be8['id']});})[_0x2c81('0x17')](respondWithResult(_0x487505,null))[_0x2c81('0x39')](handleError(_0x487505,null));};exports[_0x2c81('0x64')]=function(_0x44024b,_0xe068ca){if(_0x44024b[_0x2c81('0x2e')]['id']){delete _0x44024b[_0x2c81('0x2e')]['id'];}return db[_0x2c81('0x47')][_0x2c81('0x48')]({'where':{'id':_0x44024b['params']['id']},'include':[{'model':db[_0x2c81('0x65')],'as':'Contact'}]})[_0x2c81('0x17')](handleEntityNotFound(_0xe068ca,null))[_0x2c81('0x17')](saveUpdates(_0x44024b['body'],null))[_0x2c81('0x17')](respondWithResult(_0xe068ca,null))[_0x2c81('0x39')](handleError(_0xe068ca,null));};exports[_0x2c81('0x66')]=function(_0x26cafa,_0x43c331){if(_0x26cafa['body']['id']){delete _0x26cafa[_0x2c81('0x2e')]['id'];}return db[_0x2c81('0x47')]['find']({'where':{'id':_0x26cafa[_0x2c81('0x3b')]['id']}})[_0x2c81('0x17')](function(_0x13ce38){if(!_0x13ce38){logger['error'](_0x2c81('0x67'),_0x2c81('0x66'),0x194,'entity\x20not\x20found');_0x43c331['sendStatus'](0x194);}else{if(_0x13ce38[_0x2c81('0x68')]){throw new db[(_0x2c81('0x5d'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x13ce38;})[_0x2c81('0x17')](function(_0x2889bc){if(_0x2889bc){return _0x2889bc[_0x2c81('0x4a')]({'closed':_0x26cafa['body'][_0x2c81('0x69')],'disposition':_0x26cafa[_0x2c81('0x2e')][_0x2c81('0x6a')]})[_0x2c81('0x17')](function(_0x2d18d7){return _0x2d18d7;});}})[_0x2c81('0x17')](function(){return respondWithRpcPromise(_0x2c81('0x6b'),_0x2c81('0x66'),_0x26cafa[_0x2c81('0x2e')],client9004);})[_0x2c81('0x17')](respondWithResult(_0x43c331,null))[_0x2c81('0x39')](handleError(_0x43c331,null));};exports[_0x2c81('0x6c')]=function(_0x32b606,_0x445f9f){_0x32b606['body'][_0x2c81('0x2b')]=_0x32b606[_0x2c81('0x6d')][_0x2c81('0x6e')];_0x32b606[_0x2c81('0x2e')][_0x2c81('0x6f')]=_0x32b606[_0x2c81('0x6d')][_0x2c81('0x70')];_0x32b606[_0x2c81('0x2e')][_0x2c81('0x37')]=_0x32b606[_0x2c81('0x6d')][_0x2c81('0x71')];return db[_0x2c81('0x72')][_0x2c81('0x49')](_0x32b606[_0x2c81('0x2e')])[_0x2c81('0x17')](respondWithResult(_0x445f9f,0xc9))[_0x2c81('0x39')](handleError(_0x445f9f,null));};exports[_0x2c81('0x73')]=function(_0x1294bd,_0x3338de){return db['ChatInteraction'][_0x2c81('0x4e')]({'where':{'id':_0x1294bd[_0x2c81('0x3b')]['id']},'raw':!![]})[_0x2c81('0x17')](handleEntityNotFound(_0x3338de,null))['then'](function(_0x57544b){if(_0x57544b){if(_0x57544b[_0x2c81('0x69')]){return _0x3338de[_0x2c81('0x28')](0x193)[_0x2c81('0x23')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x2c81('0x4e')]({'where':{'id':_0x1294bd['query'][_0x2c81('0x74')]},'raw':!![]})[_0x2c81('0x17')](handleEntityNotFound(_0x3338de,null));}})[_0x2c81('0x17')](function(_0x1c2896){if(_0x1c2896){var _0x16423e=_0x1c2896[_0x2c81('0x75')]!==null;var _0x58b1f9=path['join'](config[_0x2c81('0x76')],_0x2c81('0x77'));if(_0x16423e){_0x58b1f9=path['join'](_0x58b1f9,_0x2c81('0x78'));}var _0x1446fe=path[_0x2c81('0x79')](_0x58b1f9,_0x1c2896[_0x2c81('0x6f')]);return _0x3338de[_0x2c81('0x7a')](_0x1446fe);}})['catch'](handleError(_0x3338de,null));};exports[_0x2c81('0x7b')]=function(_0xfa17b2,_0x3e9d65){var _0x29116a=null;var _0x829364=null;var _0xec56f7=null;if(_0xfa17b2[_0x2c81('0x2e')]['id']){delete _0xfa17b2[_0x2c81('0x2e')]['id'];}if(_0xfa17b2[_0x2c81('0x2e')][_0x2c81('0x7c')]){_0xec56f7=path[_0x2c81('0x79')](config[_0x2c81('0x76')],_0x2c81('0x7d'),util['format'](_0x2c81('0x7e'),Date[_0x2c81('0x7f')]()));_0xfa17b2['body'][_0x2c81('0x80')]=_0xec56f7;}return db['ChatInteraction']['find']({'where':{'id':_0xfa17b2[_0x2c81('0x3b')]['id']},'include':[{'model':db[_0x2c81('0x81')],'as':_0x2c81('0x82'),'include':[{'model':db[_0x2c81('0x83')],'as':_0x2c81('0x83')}]}]})[_0x2c81('0x17')](handleEntityNotFound(_0x3e9d65,null))[_0x2c81('0x17')](saveUpdates(_0xfa17b2['body'],null))[_0x2c81('0x17')](function(_0x31034e){if(_0x31034e){_0x29116a=_0x31034e;return db[_0x2c81('0x4d')][_0x2c81('0x48')]({'where':{'id':_0x29116a[_0x2c81('0x84')]}});}})[_0x2c81('0x17')](function(_0x3b98af){if(_0x3b98af){_0x829364=_0x3b98af;return db[_0x2c81('0x65')][_0x2c81('0x48')]({'where':{'id':_0x29116a[_0x2c81('0x85')]}});}})['then'](function(_0xb46680){if(_0xb46680){if(_0xec56f7){var _0x2b71a1=null;for(var _0xca4b1e=0x1;_0xca4b1e<_0x29116a[_0x2c81('0x82')][_0x2c81('0x42')];++_0xca4b1e){_0x2b71a1=_0x29116a[_0x2c81('0x82')][_0xca4b1e];var _0x5eed35=_0x2b71a1[_0x2c81('0x68')]?util['format']('%s%d',_0x829364[_0x2c81('0x86')],_0x2b71a1[_0x2c81('0x68')]):_0x2c81('0x87');var _0x9d8ec9=_0xfa17b2[_0x2c81('0x2e')][_0x2c81('0x88')]||util[_0x2c81('0x89')]('%s%d',_0x2c81('0x8a'),_0x2b71a1[_0x2c81('0x85')]);switch(_0x829364[_0x2c81('0x8b')]){case'website_alias':_0x5eed35=_0x2b71a1[_0x2c81('0x68')]?util[_0x2c81('0x89')]('%s%d',_0x829364[_0x2c81('0x86')],_0x2b71a1['UserId']):_0x2c81('0x87');break;case _0x2c81('0x8c'):_0x5eed35=_0x2b71a1[_0x2c81('0x68')]?_0x2b71a1[_0x2c81('0x83')][_0x2c81('0x8d')]||_0x2b71a1[_0x2c81('0x83')][_0x2c81('0x54')]:_0x2c81('0x87');break;case'agent_fullname':_0x5eed35=_0x2b71a1[_0x2c81('0x68')]?_0x2b71a1[_0x2c81('0x83')][_0x2c81('0x54')]:'System';break;default:_0x5eed35=_0x2b71a1[_0x2c81('0x68')]?util['format'](_0x2c81('0x8e'),_0x829364[_0x2c81('0x86')],_0x2b71a1[_0x2c81('0x68')]):_0x2c81('0x87');}var _0x14eb14=util[_0x2c81('0x89')](_0x2c81('0x8f'),moment(_0x2b71a1[_0x2c81('0x90')])[_0x2c81('0x89')](_0x2c81('0x91')),_0x2b71a1['direction']==='in'?_0x9d8ec9:_0x5eed35,_0x2b71a1['body']);if(!_0x2b71a1[_0x2c81('0x92')]){fs['appendFileSync'](_0xec56f7,_0x14eb14);}}return db['MailAccount'][_0x2c81('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x2c81('0x93')],'as':_0x2c81('0x94'),'raw':!![],'include':[{'model':db[_0x2c81('0x95')],'as':_0x2c81('0x95'),'raw':!![]}]}]});}}})['then'](function(_0x27eb0f){if(!_0x27eb0f||!_0x27eb0f['Smtp']||!_0xfa17b2[_0x2c81('0x2e')])return _0x29116a;var _0x6ea3ae=_0x27eb0f[_0x2c81('0x96')]();return respondWithRpcPromise('SendMail',_0x2c81('0x97'),{'account':_0x6ea3ae,'message':{'from':util[_0x2c81('0x89')](_0x2c81('0x98'),_0x27eb0f['name'],_0x27eb0f[_0x2c81('0x55')]||_0x27eb0f[_0x2c81('0x94')][_0x2c81('0x53')]),'to':_0xfa17b2[_0x2c81('0x2e')][_0x2c81('0x7c')],'subject':_0x2c81('0x99'),'text':util[_0x2c81('0x89')](_0x2c81('0x9a'),_0xfa17b2[_0x2c81('0x2e')][_0x2c81('0x7c')]),'attachments':[{'path':_0xec56f7}]}})[_0x2c81('0x17')](function(){return _0x29116a;})['catch'](function(_0x5a5c62){logger[_0x2c81('0x1c')](_0x5a5c62);});})[_0x2c81('0x17')](respondWithStatusCode(_0x3e9d65,0xc8))[_0x2c81('0x39')](handleError(_0x3e9d65,null));};exports['addMessage']=function(_0x17aa03,_0x31debf){return db[_0x2c81('0x81')]['find']({'where':{'id':_0x17aa03[_0x2c81('0x3b')]['id']}})[_0x2c81('0x17')](handleEntityNotFound(_0x31debf,null))[_0x2c81('0x17')](function(_0x46e63a){if(_0x46e63a){return _0x46e63a[_0x2c81('0x9b')](_0x17aa03[_0x2c81('0x2e')][_0x2c81('0x9c')],_[_0x2c81('0x9d')](_0x17aa03[_0x2c81('0x2e')],[_0x2c81('0x9c'),'id'])||{});}})['then'](respondWithResult(_0x31debf,null))[_0x2c81('0x39')](handleError(_0x31debf,null));};exports[_0x2c81('0x9e')]=function(_0x449854,_0xbf2fba){var _0x59e407={'raw':![],'where':{}};var _0x4459ec={};var _0x43486b={'count':0x0,'rows':[]};return db[_0x2c81('0x47')]['findOne']({'where':{'id':_0x449854[_0x2c81('0x3b')]['id']}})[_0x2c81('0x17')](handleEntityNotFound(_0xbf2fba,null))[_0x2c81('0x17')](function(_0x3f7df9){if(_0x3f7df9){_0x4459ec['model']=_[_0x2c81('0x3d')](db[_0x2c81('0x81')]['rawAttributes']);_0x4459ec['query']=_[_0x2c81('0x3d')](_0x449854[_0x2c81('0x3e')]);_0x4459ec[_0x2c81('0x9f')]=_['intersection'](_0x4459ec[_0x2c81('0x3c')],_0x4459ec[_0x2c81('0x3e')]);_0x59e407['attributes']=_[_0x2c81('0x3f')](_0x4459ec[_0x2c81('0x3c')],qs[_0x2c81('0x40')](_0x449854[_0x2c81('0x3e')]['fields']));_0x59e407[_0x2c81('0x41')]=_0x59e407[_0x2c81('0x41')][_0x2c81('0x42')]?_0x59e407['attributes']:_0x4459ec[_0x2c81('0x3c')];if(!_0x449854[_0x2c81('0x3e')][_0x2c81('0xa0')](_0x2c81('0xa1'))){_0x59e407['limit']=qs[_0x2c81('0x25')](_0x449854[_0x2c81('0x3e')][_0x2c81('0x25')]);_0x59e407[_0x2c81('0x24')]=qs[_0x2c81('0x24')](_0x449854[_0x2c81('0x3e')][_0x2c81('0x24')]);}_0x59e407[_0x2c81('0xa2')]=qs['sort'](_0x449854[_0x2c81('0x3e')][_0x2c81('0xa3')]);_0x59e407[_0x2c81('0xa4')]=qs[_0x2c81('0x9f')](_[_0x2c81('0xa5')](_0x449854['query'],_0x4459ec['filters']));_0x59e407[_0x2c81('0xa4')]['ChatInteractionId']=_0x3f7df9['id'];if(_0x449854['query']['filter']){_0x59e407[_0x2c81('0xa4')]=_['merge'](_0x59e407[_0x2c81('0xa4')],{'$or':_[_0x2c81('0x34')](_0x59e407[_0x2c81('0x41')],function(_0x5a674a){var _0x150a9b={};_0x150a9b[_0x5a674a]={'$like':'%'+_0x449854['query']['filter']+'%'};return _0x150a9b;})});}if(_0x449854['query'][_0x2c81('0xa6')]){var _0x197530=_0x449854['query'][_0x2c81('0xa6')][_0x2c81('0xa7')](',');var _0x2ba35b={};_0x2ba35b[_0x197530[0x0]]={'$gte':moment(_0x197530[0x1])['format'](_0x2c81('0xa8'))};_0x59e407[_0x2c81('0xa4')]=_[_0x2c81('0x45')](_0x59e407[_0x2c81('0xa4')],_0x2ba35b);}_0x59e407=_[_0x2c81('0x45')]({},_0x59e407,_0x449854[_0x2c81('0x46')]);return db['ChatMessage'][_0x2c81('0x27')]({'where':_0x59e407[_0x2c81('0xa4')]})[_0x2c81('0x17')](function(_0x3bffcf){_0x43486b[_0x2c81('0x27')]=_0x3bffcf;if(_0x449854[_0x2c81('0x3e')]['includeAll']){_0x59e407['include']=[{'all':!![]}];}return db[_0x2c81('0x81')]['findAll'](_0x59e407);})[_0x2c81('0x17')](function(_0x22205a){_0x43486b[_0x2c81('0xa9')]=_0x22205a;return _0x43486b;});}})['then'](respondWithFilteredResult(_0xbf2fba,_0x59e407))[_0x2c81('0x39')](handleError(_0xbf2fba,null));};exports[_0x2c81('0xaa')]=function(_0xd884d8,_0x1edb89){var _0x4b5059={'where':{}},_0x2bbfb6={},_0x470780={'count':0x0,'rows':[]};return db[_0x2c81('0x47')]['findOne']({'where':{'id':_0xd884d8[_0x2c81('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1edb89,null))[_0x2c81('0x17')](function(_0x2e24ca){if(_0x2e24ca){_0x2bbfb6['model']=_[_0x2c81('0x3d')](db['ChatMessage']['rawAttributes']);_0x2bbfb6[_0x2c81('0x3e')]=_[_0x2c81('0x3d')](_0xd884d8[_0x2c81('0x3e')]);_0x2bbfb6[_0x2c81('0x9f')]=_[_0x2c81('0x3f')](_0x2bbfb6[_0x2c81('0x3c')],_0x2bbfb6[_0x2c81('0x3e')]);_0x4b5059[_0x2c81('0x41')]=_[_0x2c81('0x3f')](_0x2bbfb6[_0x2c81('0x3c')],qs[_0x2c81('0x40')](_0xd884d8[_0x2c81('0x3e')][_0x2c81('0x40')]));_0x4b5059['attributes']=_0x4b5059[_0x2c81('0x41')][_0x2c81('0x42')]?_0x4b5059['attributes']:_0x2bbfb6[_0x2c81('0x3c')];if(!_0xd884d8[_0x2c81('0x3e')][_0x2c81('0xa0')]('nolimit')){_0x4b5059[_0x2c81('0x25')]=qs[_0x2c81('0x25')](_0xd884d8[_0x2c81('0x3e')][_0x2c81('0x25')]);_0x4b5059[_0x2c81('0x24')]=qs[_0x2c81('0x24')](_0xd884d8[_0x2c81('0x3e')][_0x2c81('0x24')]);}_0x4b5059[_0x2c81('0xa2')]=qs[_0x2c81('0xa3')](_0xd884d8[_0x2c81('0x3e')]['sort']);_0x4b5059['where']=qs[_0x2c81('0x9f')](_[_0x2c81('0xa5')](_0xd884d8[_0x2c81('0x3e')],_0x2bbfb6[_0x2c81('0x9f')]));_0x4b5059[_0x2c81('0xa4')][_0x2c81('0xab')]=_0x2e24ca['id'];if(_0xd884d8[_0x2c81('0x3e')][_0x2c81('0xac')]){_0x4b5059[_0x2c81('0xa4')]=_['merge'](_0x4b5059['where'],{'$or':_[_0x2c81('0x34')](_0x4b5059[_0x2c81('0x41')],function(_0x2c6e39){var _0x40c65b={};_0x40c65b[_0x2c6e39]={'$like':'%'+_0xd884d8[_0x2c81('0x3e')][_0x2c81('0xac')]+'%'};return _0x40c65b;})});}_0x4b5059[_0x2c81('0xa4')][_0x2c81('0x92')]=![];if(_0xd884d8[_0x2c81('0x3e')]['id']){_0x4b5059[_0x2c81('0xa4')]['id']={'$gt':_0xd884d8[_0x2c81('0x3e')]['id']};}_0x4b5059=_[_0x2c81('0x45')]({},_0x4b5059,_0xd884d8[_0x2c81('0x46')]);return db[_0x2c81('0x81')][_0x2c81('0x27')]({'where':_0x4b5059['where']})[_0x2c81('0x17')](function(_0x43a4f8){_0x470780[_0x2c81('0x27')]=_0x43a4f8;_0x4b5059[_0x2c81('0x44')]=[];if(_0xd884d8[_0x2c81('0x3e')]['includeAgent']){_0x4b5059[_0x2c81('0x44')][_0x2c81('0xad')]({'model':db['User'],'as':_0x2c81('0x83'),'attributes':['id',_0x2c81('0x54'),_0x2c81('0x8d')]});}if(_0xd884d8[_0x2c81('0x3e')]['includeAll']){_0x4b5059[_0x2c81('0x44')]=[{'all':!![]}];}return db[_0x2c81('0x81')][_0x2c81('0x38')](_0x4b5059);})['then'](function(_0x16eafb){_0x470780[_0x2c81('0xa9')]=_0x16eafb;return _0x470780;});}})['then'](respondWithFilteredResult(_0x1edb89,_0x4b5059))['catch'](handleError(_0x1edb89,null));};exports[_0x2c81('0xae')]=function(_0x536d8d,_0x337919){return db[_0x2c81('0x47')]['find']({'where':{'id':_0x536d8d[_0x2c81('0x3b')]['id']}})[_0x2c81('0x17')](handleEntityNotFound(_0x337919,null))['then'](function(_0x6e391){if(_0x6e391){return _0x6e391['setTags'](_0x536d8d[_0x2c81('0x2e')][_0x2c81('0x9c')],_['omit'](_0x536d8d[_0x2c81('0x2e')],[_0x2c81('0x9c'),'id'])||{})[_0x2c81('0xaf')](function(){return db[_0x2c81('0xb0')][_0x2c81('0x38')]({'attributes':['id',_0x2c81('0x2b'),_0x2c81('0xb1')],'where':{'id':_0x536d8d[_0x2c81('0x2e')][_0x2c81('0x9c')]}});})[_0x2c81('0x17')](function(_0x55b2a9){socket[_0x2c81('0xb2')]('chatInteractionTags:save',{'id':Number(_0x536d8d[_0x2c81('0x3b')]['id']),'tags':_0x55b2a9||[]});return{'id':Number(_0x536d8d[_0x2c81('0x3b')]['id']),'tags':_0x55b2a9||[]};});}})[_0x2c81('0x17')](respondWithResult(_0x337919,null))[_0x2c81('0x39')](handleError(_0x337919,null));};exports[_0x2c81('0xb3')]=function(_0x1a19ed,_0x16cf24){return db['ChatInteraction'][_0x2c81('0x48')]({'where':{'id':_0x1a19ed[_0x2c81('0x3b')]['id']}})[_0x2c81('0x17')](handleEntityNotFound(_0x16cf24,null))[_0x2c81('0x17')](function(_0x4fdfdd){if(_0x4fdfdd){return _0x4fdfdd['removeTags'](_0x1a19ed['query'][_0x2c81('0x9c')]);}})[_0x2c81('0x17')](respondWithStatusCode(_0x16cf24,null))[_0x2c81('0x39')](handleError(_0x16cf24,null));};exports[_0x2c81('0x7a')]=function(_0x2c22e7,_0xf23ba9){var _0x3d3418=moment()['unix']()['toString']();var _0x43ec1e=path[_0x2c81('0x79')](config['root'],_0x2c81('0xb4'),_0x2c81('0xb5'),_0x2c81('0xb6'));var _0x48f479=path[_0x2c81('0x79')](config[_0x2c81('0x76')],_0x2c81('0xb4'),_0x2c81('0xb5'),_0x2c81('0xb7'));var _0x75f8a7=path[_0x2c81('0x79')](_0x43ec1e,_0x3d3418);var _0x8a873b=util[_0x2c81('0x89')](_0x2c81('0xb8'),_0x2c22e7[_0x2c81('0x3b')]['id'],_0x3d3418);var _0x5b2dba=path[_0x2c81('0x79')](_0x43ec1e,_0x8a873b);var _0x5ed7bc=[];_0x5ed7bc[_0x2c81('0xad')]({'model':db['User'],'as':'User','attributes':['id',_0x2c81('0x54')],'raw':!![]});_0x5ed7bc['push']({'model':db[_0x2c81('0x65')],'as':_0x2c81('0xb9'),'attributes':['id',_0x2c81('0xba'),_0x2c81('0xbb')],'raw':!![]});if(_0x2c22e7[_0x2c81('0x3e')][_0x2c81('0xb7')]){_0x5ed7bc[_0x2c81('0xad')]({'model':db[_0x2c81('0x72')],'as':_0x2c81('0x72'),'raw':!![]});}var _0x3f1bda=[{'model':db['ChatMessage'],'as':_0x2c81('0x82'),'attributes':['id',_0x2c81('0x2e'),'createdAt',_0x2c81('0xbc'),'secret','read'],'include':_0x5ed7bc}];_0x3f1bda['push']({'model':db[_0x2c81('0x4d')],'as':_0x2c81('0xbd'),'attributes':['id',_0x2c81('0x2b')]});_0x3f1bda[_0x2c81('0xad')]({'model':db['User'],'as':_0x2c81('0xbe'),'attributes':['id','fullname']});return db[_0x2c81('0x47')][_0x2c81('0x48')]({'where':{'id':_0x2c22e7[_0x2c81('0x3b')]['id']},'include':_0x3f1bda})['then'](handleEntityNotFound(_0xf23ba9,null))[_0x2c81('0x17')](function(_0x336018){if(_0x336018){var _0x162646=_0x336018[_0x2c81('0xbf')]({'plain':!![]});fs[_0x2c81('0xc0')](_0x75f8a7);var _0x4ca785={'channel':_0x2c81('0xc1'),'account':_0x162646[_0x2c81('0xbd')]['name'],'agent':_0x162646['Owner']?_0x162646['Owner'][_0x2c81('0x54')]:_0x2c81('0xc2'),'createdAt':moment(_0x162646[_0x2c81('0x90')])[_0x2c81('0x89')](_0x2c81('0xa8'))['toString'](),'closedAt':_0x162646[_0x2c81('0x69')]?moment(_0x162646[_0x2c81('0xc3')])['format'](_0x2c81('0xa8'))[_0x2c81('0xc4')]():'','disposition':_0x162646[_0x2c81('0x6a')],'chatInfo':{'browser':_0x162646[_0x2c81('0xc5')],'os':_0x162646[_0x2c81('0xc6')],'referer':_0x162646['referer'],'customerIp':_0x162646['customerIp'],'customerPort':_0x162646[_0x2c81('0xc7')]?_0x162646[_0x2c81('0xc7')]:'N.A.'},'messages':_(_0x162646[_0x2c81('0x82')])[_0x2c81('0xc8')]()[_0x2c81('0xac')]({'secret':![]})[_0x2c81('0x34')](function(_0x5e1b23){if(_0x5e1b23[_0x2c81('0x72')]){var _0x7fdfe6=path['join'](_0x48f479,_0x5e1b23['Attachment'][_0x2c81('0x6f')]);if(fs[_0x2c81('0xc9')](_0x7fdfe6)){fs[_0x2c81('0xca')](_0x7fdfe6)[_0x2c81('0xcb')](fs[_0x2c81('0xcc')](path[_0x2c81('0x79')](_0x75f8a7,_0x5e1b23[_0x2c81('0x72')][_0x2c81('0x6f')])));}}return{'date':moment(_0x5e1b23['createdAt'])[_0x2c81('0x89')](_0x2c81('0xa8'))[_0x2c81('0xc4')](),'sender':_0x5e1b23[_0x2c81('0xbc')]===_0x2c81('0x61')?_0x5e1b23['User']?_0x5e1b23[_0x2c81('0x83')][_0x2c81('0x54')]:_0x2c81('0x87'):_0x5e1b23[_0x2c81('0xb9')][_0x2c81('0xba')]+(_0x5e1b23[_0x2c81('0xb9')]['lastName']?'\x20'+_0x5e1b23['Contact'][_0x2c81('0xbb')]:''),'body':_0x5e1b23[_0x2c81('0x72')]?_0x5e1b23['Attachment'][_0x2c81('0x6f')]:_0x5e1b23[_0x2c81('0x2e')],'direction':_0x5e1b23[_0x2c81('0xbc')]===_0x2c81('0x61')?'A':'C','secret':_0x5e1b23[_0x2c81('0x92')],'read':_0x5e1b23['read'],'attachment':_0x5e1b23['Attachment']};})[_0x2c81('0xcd')]()};return ejs[_0x2c81('0xce')](path['join'](config[_0x2c81('0x76')],_0x2c81('0xb4'),_0x2c81('0xcf'),_0x2c81('0xd0')),{'interaction':_0x4ca785})[_0x2c81('0x17')](function(_0x1c05b2){var _0x20d06d=path[_0x2c81('0x79')](_0x75f8a7,_0x2c81('0xd1')+_0x162646['id']+'-'+_0x3d3418+_0x2c81('0xd2'));var _0xd3637c={'path':_0x20d06d,'channel':_0x2c81('0xc1'),'interactionId':_0x162646['id']};return pdf[_0x2c81('0xd3')](_0x1c05b2,_0xd3637c);})[_0x2c81('0x17')](function(){return new Promise(function(_0x39d415,_0x1dbf95){zipdir(_0x75f8a7,{'saveTo':_0x5b2dba},function(_0x379c7a,_0x3e7be0){if(_0x379c7a)return _0x1dbf95(_0x379c7a);return _0x39d415(_0x3e7be0);});})['then'](function(){return new BPromise(function(_0x322aaa,_0x3ef971){rimraf(_0x75f8a7,function(_0x54af54){if(_0x54af54)_0x3ef971(_0x54af54);return _0x322aaa();});});})[_0x2c81('0x17')](function(){return _0xf23ba9['download'](_0x5b2dba,_0x8a873b,function(_0x4421a3){if(_0x4421a3){logger[_0x2c81('0x1c')](_0x2c81('0xd4'),_0x4421a3);}else{fs[_0x2c81('0xd5')](_0x5b2dba);}});});});}else{return _0xf23ba9['sendStatus'](0xc8);}})[_0x2c81('0x39')](handleError(_0xf23ba9,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index fc9e3c5..7d2a1e8 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 _0xc0d1=['getUsers','then','setDataValue','map','findAll','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','save','update','remove'];(function(_0x4804d7,_0x56ef10){var _0x532259=function(_0x5929e3){while(--_0x5929e3){_0x4804d7['push'](_0x4804d7['shift']());}};_0x532259(++_0x56ef10);}(_0xc0d1,0x15a));var _0x1c0d=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xc0d1[_0x4e676e];return _0x336a3c;};'use strict';var EventEmitter=require(_0x1c0d('0x0'));var ChatInteraction=require(_0x1c0d('0x1'))['db'][_0x1c0d('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1c0d('0x3'),'afterUpdate':_0x1c0d('0x4'),'afterDestroy':_0x1c0d('0x5')};function emitEvent(_0x500df2){return function(_0x3426b0,_0x48e3dc,_0x7431cc){_0x3426b0[_0x1c0d('0x6')]({'attributes':['id'],'raw':!![]})[_0x1c0d('0x7')](function(_0x250c10){_0x3426b0[_0x1c0d('0x8')]('Users',_0x250c10[_0x1c0d('0x9')](function(_0x2533d4){return{'id':_0x2533d4['id']};}));return ChatMessage[_0x1c0d('0xa')]({'where':{'ChatInteractionId':_0x3426b0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1c0d('0x7')](function(_0x2d148e){_0x3426b0[_0x1c0d('0x8')]('unreadMessages',_0x2d148e[_0x1c0d('0xb')]);ChatInteractionEvents[_0x1c0d('0xc')](_0x500df2+':'+_0x3426b0['id'],_0x3426b0);ChatInteractionEvents[_0x1c0d('0xc')](_0x500df2,_0x3426b0);_0x7431cc(null);})[_0x1c0d('0xd')](_0x7431cc(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x1c0d('0xe')](e,emitEvent(event));}}module[_0x1c0d('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xa373=['remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x10a131,_0x3dc92b){var _0x51c8e2=function(_0x4c60a9){while(--_0x4c60a9){_0x10a131['push'](_0x10a131['shift']());}};_0x51c8e2(++_0x3dc92b);}(_0xa373,0xbf));var _0x3a37=function(_0x689537,_0x5ce66b){_0x689537=_0x689537-0x0;var _0xb1b3f0=_0xa373[_0x689537];return _0xb1b3f0;};'use strict';var EventEmitter=require(_0x3a37('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x3a37('0x1')];var ChatMessage=require(_0x3a37('0x2'))['db'][_0x3a37('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3a37('0x4')](0x0);var events={'afterCreate':_0x3a37('0x5'),'afterUpdate':_0x3a37('0x6'),'afterDestroy':_0x3a37('0x7')};function emitEvent(_0x31de69){return function(_0x3869a0,_0x29e23d,_0x4ee072){_0x3869a0[_0x3a37('0x8')]({'attributes':['id'],'raw':!![]})[_0x3a37('0x9')](function(_0x210e5b){_0x3869a0[_0x3a37('0xa')](_0x3a37('0xb'),_0x210e5b[_0x3a37('0xc')](function(_0x24109d){return{'id':_0x24109d['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3869a0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3a37('0x9')](function(_0x950c92){_0x3869a0['setDataValue']('unreadMessages',_0x950c92[_0x3a37('0xd')]);ChatInteractionEvents[_0x3a37('0xe')](_0x31de69+':'+_0x3869a0['id'],_0x3869a0);ChatInteractionEvents[_0x3a37('0xe')](_0x31de69,_0x3869a0);_0x4ee072(null);})[_0x3a37('0xf')](_0x4ee072(null));};}for(var e in events){if(events[_0x3a37('0x10')](e)){var event=events[e];ChatInteraction[_0x3a37('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index d2b24cd..4fcbac7 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 _0xb8e4=['moment','rimraf','../../config/environment','exports','define','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger'];(function(_0x24d88c,_0x485c4d){var _0x49ac8c=function(_0x58f116){while(--_0x58f116){_0x24d88c['push'](_0x24d88c['shift']());}};_0x49ac8c(++_0x485c4d);}(_0xb8e4,0x1de));var _0x4b8e=function(_0x54fd96,_0xdd6498){_0x54fd96=_0x54fd96-0x0;var _0x501cbb=_0xb8e4[_0x54fd96];return _0x501cbb;};'use strict';var _=require('lodash');var util=require(_0x4b8e('0x0'));var logger=require(_0x4b8e('0x1'))('api');var moment=require(_0x4b8e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4b8e('0x3'));var config=require(_0x4b8e('0x4'));var attributes=require('./chatInteraction.attributes');module[_0x4b8e('0x5')]=function(_0xf4a14,_0x15abdc){return _0xf4a14[_0x4b8e('0x6')]('ChatInteraction',attributes,{'tableName':_0x4b8e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x168eec,_0xf7a6e3,_0x1d5ff2){if(_0x168eec[_0x4b8e('0x8')]('closed')){_0x168eec[_0x4b8e('0x9')]=moment()[_0x4b8e('0xa')](_0x4b8e('0xb'));}_0x1d5ff2(null,_0x168eec);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7a8b=['../../config/logger','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x4bebfa,_0x58b358){var _0xb8d6e5=function(_0x52a67d){while(--_0x52a67d){_0x4bebfa['push'](_0x4bebfa['shift']());}};_0xb8d6e5(++_0x58b358);}(_0x7a8b,0x1db));var _0xb7a8=function(_0xcc0214,_0x1a0248){_0xcc0214=_0xcc0214-0x0;var _0x28a82f=_0x7a8b[_0xcc0214];return _0x28a82f;};'use strict';var _=require('lodash');var util=require(_0xb7a8('0x0'));var logger=require(_0xb7a8('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb7a8('0x2'));var rp=require(_0xb7a8('0x3'));var fs=require('fs');var path=require(_0xb7a8('0x4'));var rimraf=require(_0xb7a8('0x5'));var config=require('../../config/environment');var attributes=require(_0xb7a8('0x6'));module[_0xb7a8('0x7')]=function(_0x23d7a2,_0x460fff){return _0x23d7a2[_0xb7a8('0x8')](_0xb7a8('0x9'),attributes,{'tableName':_0xb7a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xf0dcb3,_0x1179d1,_0x13708e){if(_0xf0dcb3[_0xb7a8('0xb')](_0xb7a8('0xc'))){_0xf0dcb3[_0xb7a8('0xd')]=moment()['format'](_0xb7a8('0xe'));}_0x13708e(null,_0xf0dcb3);}},'charset':_0xb7a8('0xf'),'collate':_0xb7a8('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 2253d8c..6e5fa54 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 _0x2592=['then','catch','AddTagsToChatInteraction','find','addTags','ids','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit'];(function(_0x314b4b,_0x2706d9){var _0x3e857b=function(_0x39c7b0){while(--_0x39c7b0){_0x314b4b['push'](_0x314b4b['shift']());}};_0x3e857b(++_0x2706d9);}(_0x2592,0x1e0));var _0x2259=function(_0x21bef5,_0x27b94a){_0x21bef5=_0x21bef5-0x0;var _0x524300=_0x2592[_0x21bef5];return _0x524300;};'use strict';var _=require(_0x2259('0x0'));var util=require('util');var moment=require(_0x2259('0x1'));var BPromise=require(_0x2259('0x2'));var rs=require(_0x2259('0x3'));var fs=require('fs');var Redis=require(_0x2259('0x4'));var db=require(_0x2259('0x5'))['db'];var utils=require(_0x2259('0x6'));var logger=require(_0x2259('0x7'))(_0x2259('0x8'));var config=require('../../config/environment');var jayson=require(_0x2259('0x9'));var client=jayson[_0x2259('0xa')][_0x2259('0xb')]({'port':0x232a});config[_0x2259('0xc')]=_[_0x2259('0xd')](config[_0x2259('0xc')],{'host':_0x2259('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2259('0xc')]));require(_0x2259('0xf'))['register'](socket);function respondWithRpcPromise(_0x3a05cb,_0x441443,_0xdaf957){return new BPromise(function(_0x1a5ae0,_0x31fc64){return client[_0x2259('0x10')](_0x3a05cb,_0xdaf957)['then'](function(_0xfd12a4){logger['info'](_0x2259('0x11'),_0x441443,_0x2259('0x12'));logger[_0x2259('0x13')](_0x2259('0x14'),_0x441443,_0x2259('0x12'),JSON[_0x2259('0x15')](_0xfd12a4));if(_0xfd12a4[_0x2259('0x16')]){if(_0xfd12a4[_0x2259('0x16')][_0x2259('0x17')]===0x1f4){logger[_0x2259('0x16')](_0x2259('0x11'),_0x441443,_0xfd12a4['error'][_0x2259('0x18')]);return _0x31fc64(_0xfd12a4[_0x2259('0x16')][_0x2259('0x18')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x441443,_0xfd12a4['error'][_0x2259('0x18')]);return _0x1a5ae0(_0xfd12a4[_0x2259('0x16')][_0x2259('0x18')]);}else{logger[_0x2259('0x19')](_0x2259('0x11'),_0x441443,_0x2259('0x12'));_0x1a5ae0(_0xfd12a4[_0x2259('0x1a')][_0x2259('0x18')]);}})['catch'](function(_0x57e033){logger['error'](_0x2259('0x11'),_0x441443,_0x57e033);_0x31fc64(_0x57e033);});});}exports[_0x2259('0x1b')]=function(_0x1b117f){var _0x470d08=this;return new Promise(function(_0x5b4903,_0xfd69d5){return db[_0x2259('0x1c')][_0x2259('0x1d')](_0x1b117f[_0x2259('0x1e')],{'raw':_0x1b117f['options']?_0x1b117f[_0x2259('0x1f')][_0x2259('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b117f['options']?_0x1b117f['options'][_0x2259('0x21')]||null:null,'attributes':_0x1b117f['options']?_0x1b117f[_0x2259('0x1f')][_0x2259('0x22')]||null:null,'limit':_0x1b117f[_0x2259('0x1f')]?_0x1b117f['options'][_0x2259('0x23')]||null:null})[_0x2259('0x24')](function(_0xe585c1){logger[_0x2259('0x19')]('UpdateChatInteraction',_0x1b117f);logger[_0x2259('0x13')](_0x2259('0x1b'),_0x1b117f,JSON['stringify'](_0xe585c1));_0x5b4903(_0xe585c1);})[_0x2259('0x25')](function(_0x5b8829){logger[_0x2259('0x16')](_0x2259('0x1b'),_0x5b8829['message'],_0x1b117f);_0xfd69d5(_0x470d08[_0x2259('0x16')](0x1f4,_0x5b8829['message']));});});};exports[_0x2259('0x26')]=function(_0x2ecbe0){return new Promise(function(_0x16fe54,_0x119d6a){return db[_0x2259('0x1c')][_0x2259('0x27')]({'where':_0x2ecbe0[_0x2259('0x1f')]?_0x2ecbe0[_0x2259('0x1f')][_0x2259('0x21')]||null:null})[_0x2259('0x24')](function(_0x1be5d5){if(_0x1be5d5){return _0x1be5d5[_0x2259('0x28')](_0x2ecbe0[_0x2259('0x1e')][_0x2259('0x29')],_['omit'](_0x2ecbe0[_0x2259('0x1e')],[_0x2259('0x29'),'id'])||{});}})['spread'](function(_0x16a4ec){logger[_0x2259('0x19')](_0x2259('0x2a'),_0x2ecbe0);logger[_0x2259('0x13')](_0x2259('0x2a'),_0x2ecbe0,JSON[_0x2259('0x15')](_0x16a4ec));_0x16fe54(_0x16a4ec);})[_0x2259('0x25')](function(_0x4c48b7){logger[_0x2259('0x16')]('AddTags',_0x4c48b7['message'],_0x2ecbe0);_0x119d6a(_this[_0x2259('0x16')](0x1f4,_0x4c48b7[_0x2259('0x18')]));});});};
\ No newline at end of file
+var _0x40d9=['info','ChatInteraction,\x20%s,\x20%s','result','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x40e6e7,_0x187f3d){var _0x1bf123=function(_0x14f24e){while(--_0x14f24e){_0x40e6e7['push'](_0x40e6e7['shift']());}};_0x1bf123(++_0x187f3d);}(_0x40d9,0x1a1));var _0x940d=function(_0x1538d1,_0x3eab18){_0x1538d1=_0x1538d1-0x0;var _0xe84c01=_0x40d9[_0x1538d1];return _0xe84c01;};'use strict';var _=require(_0x940d('0x0'));var util=require(_0x940d('0x1'));var moment=require(_0x940d('0x2'));var BPromise=require(_0x940d('0x3'));var rs=require(_0x940d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x940d('0x5'));var logger=require(_0x940d('0x6'))(_0x940d('0x7'));var config=require('../../config/environment');var jayson=require(_0x940d('0x8'));var client=jayson['client'][_0x940d('0x9')]({'port':0x232a});config[_0x940d('0xa')]=_['defaults'](config['redis'],{'host':_0x940d('0xb'),'port':0x18eb});var socket=require(_0x940d('0xc'))(new Redis(config['redis']));require(_0x940d('0xd'))[_0x940d('0xe')](socket);function respondWithRpcPromise(_0x35b834,_0x3bd710,_0x3b08b6){return new BPromise(function(_0x11ced4,_0x46b3c7){return client[_0x940d('0xf')](_0x35b834,_0x3b08b6)[_0x940d('0x10')](function(_0x1731be){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3bd710,_0x940d('0x11'));logger[_0x940d('0x12')](_0x940d('0x13'),_0x3bd710,_0x940d('0x11'),JSON[_0x940d('0x14')](_0x1731be));if(_0x1731be[_0x940d('0x15')]){if(_0x1731be[_0x940d('0x15')]['code']===0x1f4){logger[_0x940d('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3bd710,_0x1731be['error'][_0x940d('0x16')]);return _0x46b3c7(_0x1731be[_0x940d('0x15')]['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3bd710,_0x1731be[_0x940d('0x15')][_0x940d('0x16')]);return _0x11ced4(_0x1731be[_0x940d('0x15')]['message']);}else{logger[_0x940d('0x17')](_0x940d('0x18'),_0x3bd710,'request\x20sent');_0x11ced4(_0x1731be[_0x940d('0x19')][_0x940d('0x16')]);}})[_0x940d('0x1a')](function(_0x1e5e19){logger[_0x940d('0x15')](_0x940d('0x18'),_0x3bd710,_0x1e5e19);_0x46b3c7(_0x1e5e19);});});}exports[_0x940d('0x1b')]=function(_0x3302af){var _0x5bed7d=this;return new Promise(function(_0x55c243,_0x561122){return db['ChatInteraction'][_0x940d('0x1c')](_0x3302af[_0x940d('0x1d')],{'raw':_0x3302af[_0x940d('0x1e')]?_0x3302af[_0x940d('0x1e')][_0x940d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3302af[_0x940d('0x1e')]?_0x3302af['options'][_0x940d('0x20')]||null:null,'attributes':_0x3302af[_0x940d('0x1e')]?_0x3302af['options'][_0x940d('0x21')]||null:null,'limit':_0x3302af[_0x940d('0x1e')]?_0x3302af[_0x940d('0x1e')]['limit']||null:null})['then'](function(_0x14141d){logger[_0x940d('0x17')](_0x940d('0x1b'),_0x3302af);logger[_0x940d('0x12')]('UpdateChatInteraction',_0x3302af,JSON['stringify'](_0x14141d));_0x55c243(_0x14141d);})[_0x940d('0x1a')](function(_0x220122){logger[_0x940d('0x15')](_0x940d('0x1b'),_0x220122['message'],_0x3302af);_0x561122(_0x5bed7d[_0x940d('0x15')](0x1f4,_0x220122[_0x940d('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x735ca0){return new Promise(function(_0x24731c,_0x226358){return db['ChatInteraction'][_0x940d('0x22')]({'where':_0x735ca0[_0x940d('0x1e')]?_0x735ca0[_0x940d('0x1e')][_0x940d('0x20')]||null:null})[_0x940d('0x10')](function(_0x54ffa3){if(_0x54ffa3){return _0x54ffa3[_0x940d('0x23')](_0x735ca0[_0x940d('0x1d')][_0x940d('0x24')],_[_0x940d('0x25')](_0x735ca0[_0x940d('0x1d')],[_0x940d('0x24'),'id'])||{});}})[_0x940d('0x26')](function(_0x5be2a2){logger['info'](_0x940d('0x27'),_0x735ca0);logger[_0x940d('0x12')](_0x940d('0x27'),_0x735ca0,JSON[_0x940d('0x14')](_0x5be2a2));_0x24731c(_0x5be2a2);})[_0x940d('0x1a')](function(_0x59f68f){logger[_0x940d('0x15')](_0x940d('0x27'),_0x59f68f['message'],_0x735ca0);_0x226358(_this[_0x940d('0x15')](0x1f4,_0x59f68f[_0x940d('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 6a7b36d..378dd16 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 _0x8e00=['removeListener','register','length','./chatInteraction.events','remove','emit'];(function(_0x4d3ef1,_0x5a6a7c){var _0xc229a9=function(_0x2f9c03){while(--_0x2f9c03){_0x4d3ef1['push'](_0x4d3ef1['shift']());}};_0xc229a9(++_0x5a6a7c);}(_0x8e00,0x159));var _0x08e0=function(_0x382ea9,_0x4019fa){_0x382ea9=_0x382ea9-0x0;var _0x282c0d=_0x8e00[_0x382ea9];return _0x282c0d;};'use strict';var ChatInteractionEvents=require(_0x08e0('0x0'));var events=['save',_0x08e0('0x1'),'update'];function createListener(_0x526a86,_0x598f62){return function(_0x27a07f){_0x598f62[_0x08e0('0x2')](_0x526a86,_0x27a07f);};}function removeListener(_0xa05c08,_0x4cc584){return function(){ChatInteractionEvents[_0x08e0('0x3')](_0xa05c08,_0x4cc584);};}exports[_0x08e0('0x4')]=function(_0x4e73c1){for(var _0x131223=0x0,_0x1b3f69=events[_0x08e0('0x5')];_0x131223<_0x1b3f69;_0x131223++){var _0x3a9bf9=events[_0x131223];var _0x5a253f=createListener('chatInteraction:'+_0x3a9bf9,_0x4e73c1);ChatInteractionEvents['on'](_0x3a9bf9,_0x5a253f);}};
\ No newline at end of file
+var _0x3bef=['update','emit','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3bef,0x185));var _0xf3be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3bef[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0xf3be('0x0'));var events=[_0xf3be('0x1'),_0xf3be('0x2'),_0xf3be('0x3')];function createListener(_0x432a61,_0x2e37d1){return function(_0xdc837){_0x2e37d1[_0xf3be('0x4')](_0x432a61,_0xdc837);};}function removeListener(_0x34c0a3,_0x1098df){return function(){ChatInteractionEvents['removeListener'](_0x34c0a3,_0x1098df);};}exports[_0xf3be('0x5')]=function(_0x83a255){for(var _0x30494e=0x0,_0x1835bf=events[_0xf3be('0x6')];_0x30494e<_0x1835bf;_0x30494e++){var _0x48e92c=events[_0x30494e];var _0x363b33=createListener(_0xf3be('0x7')+_0x48e92c,_0x83a255);ChatInteractionEvents['on'](_0x48e92c,_0x363b33);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index bd06788..bea3f80 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 _0xe864=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','createVidaooSession','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chat','update','/:id/custom_update','customUpdate','abandon','delete','chatinteraction:destroy','destroy','multer','util','path','connect-timeout','express'];(function(_0x5d4e2b,_0x417755){var _0x4520f9=function(_0x2840ed){while(--_0x2840ed){_0x5d4e2b['push'](_0x5d4e2b['shift']());}};_0x4520f9(++_0x417755);}(_0xe864,0x1db));var _0x4e86=function(_0x1e6cee,_0x2346ec){_0x1e6cee=_0x1e6cee-0x0;var _0x549528=_0xe864[_0x1e6cee];return _0x549528;};'use strict';var multer=require(_0x4e86('0x0'));var util=require(_0x4e86('0x1'));var path=require(_0x4e86('0x2'));var timeout=require(_0x4e86('0x3'));var express=require(_0x4e86('0x4'));var router=express[_0x4e86('0x5')]();var fs_extra=require(_0x4e86('0x6'));var auth=require(_0x4e86('0x7'));var interaction=require(_0x4e86('0x8'));var config=require(_0x4e86('0x9'));var controller=require(_0x4e86('0xa'));router[_0x4e86('0xb')]('/',auth[_0x4e86('0xc')](),controller[_0x4e86('0xd')]);router[_0x4e86('0xb')](_0x4e86('0xe'),auth[_0x4e86('0xc')](),controller[_0x4e86('0xf')]);router[_0x4e86('0xb')]('/:id',auth[_0x4e86('0x10')](),controller[_0x4e86('0x11')]);router['get']('/:id/attachment_download',auth[_0x4e86('0x10')](),controller['attachmentDownload']);router[_0x4e86('0xb')](_0x4e86('0x12'),auth[_0x4e86('0xc')](),controller[_0x4e86('0x13')]);router[_0x4e86('0xb')]('/:id/my_messages',auth[_0x4e86('0x10')](),controller[_0x4e86('0x14')]);router[_0x4e86('0xb')](_0x4e86('0x15'),auth['isAuthenticated'](),controller[_0x4e86('0x16')]);router[_0x4e86('0x17')]('/',auth[_0x4e86('0xc')](),controller[_0x4e86('0x18')]);router[_0x4e86('0x17')]('/:id/vidaoo',auth[_0x4e86('0xc')](),controller[_0x4e86('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2edc1f,_0x38f57d,_0x4e5845){_0x4e5845(null,path[_0x4e86('0x1a')](config[_0x4e86('0x1b')],_0x4e86('0x1c')));},'filename':function(_0x50c35f,_0x4d0a6e,_0x35af73){_0x35af73(null,util[_0x4e86('0x1d')]('%s-%s',Date[_0x4e86('0x1e')](),_0x4d0a6e[_0x4e86('0x1f')][_0x4e86('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4e86('0x17')](_0x4e86('0x21'),upload['single']('file'),controller['attachmentUpload']);router[_0x4e86('0x17')](_0x4e86('0x12'),auth[_0x4e86('0x10')](),controller[_0x4e86('0x22')]);router[_0x4e86('0x17')](_0x4e86('0x23'),auth[_0x4e86('0xc')](),interaction[_0x4e86('0x24')]('chat',_0x4e86('0x25')),controller[_0x4e86('0x26')]);router[_0x4e86('0x27')]('/:id',auth[_0x4e86('0xc')](),interaction[_0x4e86('0x24')](_0x4e86('0x28'),'chatinteraction:update'),controller[_0x4e86('0x29')]);router[_0x4e86('0x27')](_0x4e86('0x2a'),controller[_0x4e86('0x2b')]);router[_0x4e86('0x27')]('/:id/abandon',auth[_0x4e86('0x10')](),controller[_0x4e86('0x2c')]);router['put']('/:id/close',controller['close']);router[_0x4e86('0x2d')]('/:id',auth[_0x4e86('0xc')](),interaction['tracked']('chat',_0x4e86('0x2e')),controller[_0x4e86('0x2f')]);router['delete'](_0x4e86('0x23'),auth[_0x4e86('0xc')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0xa0ce=['fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','create','post','/:id/vidaoo','createVidaooSession','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','path','express','Router'];(function(_0x24a82,_0x836580){var _0x37095d=function(_0x5bb2fc){while(--_0x5bb2fc){_0x24a82['push'](_0x24a82['shift']());}};_0x37095d(++_0x836580);}(_0xa0ce,0x128));var _0xea0c=function(_0xb97296,_0x12205e){_0xb97296=_0xb97296-0x0;var _0x22ab83=_0xa0ce[_0xb97296];return _0x22ab83;};'use strict';var multer=require(_0xea0c('0x0'));var util=require('util');var path=require(_0xea0c('0x1'));var timeout=require('connect-timeout');var express=require(_0xea0c('0x2'));var router=express[_0xea0c('0x3')]();var fs_extra=require(_0xea0c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xea0c('0x5'));var config=require(_0xea0c('0x6'));var controller=require(_0xea0c('0x7'));router[_0xea0c('0x8')]('/',auth[_0xea0c('0x9')](),controller[_0xea0c('0xa')]);router[_0xea0c('0x8')]('/describe',auth[_0xea0c('0x9')](),controller[_0xea0c('0xb')]);router['get']('/:id',auth[_0xea0c('0xc')](),controller[_0xea0c('0xd')]);router['get'](_0xea0c('0xe'),auth[_0xea0c('0xc')](),controller[_0xea0c('0xf')]);router['get'](_0xea0c('0x10'),auth[_0xea0c('0x9')](),controller[_0xea0c('0x11')]);router[_0xea0c('0x8')]('/:id/my_messages',auth[_0xea0c('0xc')](),controller[_0xea0c('0x12')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xea0c('0x9')](),controller[_0xea0c('0x13')]);router[_0xea0c('0x14')](_0xea0c('0x15'),auth['isAuthenticated'](),controller[_0xea0c('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x36846e,_0x43f65b,_0x51573b){_0x51573b(null,path['join'](config[_0xea0c('0x17')],_0xea0c('0x18')));},'filename':function(_0x21c28f,_0x1fc0ac,_0xcedbd6){_0xcedbd6(null,util['format'](_0xea0c('0x19'),Date[_0xea0c('0x1a')](),_0x1fc0ac[_0xea0c('0x1b')][_0xea0c('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xea0c('0x14')](_0xea0c('0x1d'),upload[_0xea0c('0x1e')](_0xea0c('0x1f')),controller[_0xea0c('0x20')]);router[_0xea0c('0x14')](_0xea0c('0x10'),auth[_0xea0c('0xc')](),controller[_0xea0c('0x21')]);router[_0xea0c('0x14')](_0xea0c('0x22'),auth['isAuthenticated'](),interaction[_0xea0c('0x23')](_0xea0c('0x24'),_0xea0c('0x25')),controller[_0xea0c('0x26')]);router[_0xea0c('0x27')](_0xea0c('0x28'),auth[_0xea0c('0x9')](),interaction[_0xea0c('0x23')](_0xea0c('0x24'),'chatinteraction:update'),controller['update']);router[_0xea0c('0x27')]('/:id/custom_update',controller['customUpdate']);router[_0xea0c('0x27')](_0xea0c('0x29'),auth[_0xea0c('0xc')](),controller[_0xea0c('0x2a')]);router[_0xea0c('0x27')](_0xea0c('0x2b'),controller[_0xea0c('0x2c')]);router[_0xea0c('0x2d')](_0xea0c('0x28'),auth[_0xea0c('0x9')](),interaction[_0xea0c('0x23')](_0xea0c('0x24'),_0xea0c('0x2e')),controller[_0xea0c('0x2f')]);router[_0xea0c('0x2d')](_0xea0c('0x22'),auth[_0xea0c('0x9')](),controller[_0xea0c('0x30')]);module[_0xea0c('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 1d1a1fc..c5fddfa 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 _0x6fcf=['sequelize','exports','TEXT','BOOLEAN','INTEGER'];(function(_0xeefb3d,_0x51a865){var _0x4fd222=function(_0x11aa14){while(--_0x11aa14){_0xeefb3d['push'](_0xeefb3d['shift']());}};_0x4fd222(++_0x51a865);}(_0x6fcf,0x1f4));var _0xf6fc=function(_0x1055d3,_0x5dce87){_0x1055d3=_0x1055d3-0x0;var _0x55b24a=_0x6fcf[_0x1055d3];return _0x55b24a;};'use strict';var Sequelize=require(_0xf6fc('0x0'));module[_0xf6fc('0x1')]={'body':{'type':Sequelize[_0xf6fc('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf6fc('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf6fc('0x4')]}};
\ No newline at end of file
+var _0xf151=['TEXT','medium','BOOLEAN','sequelize','exports'];(function(_0x27c63a,_0x443297){var _0x1018ca=function(_0x1902d0){while(--_0x1902d0){_0x27c63a['push'](_0x27c63a['shift']());}};_0x1018ca(++_0x443297);}(_0xf151,0x6c));var _0x1f15=function(_0x3faf6f,_0x389fde){_0x3faf6f=_0x3faf6f-0x0;var _0x402a53=_0xf151[_0x3faf6f];return _0x402a53;};'use strict';var Sequelize=require(_0x1f15('0x0'));module[_0x1f15('0x1')]={'body':{'type':Sequelize[_0x1f15('0x2')](_0x1f15('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1f15('0x4')],'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 96842fa..9fc2bc2 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 _0x59b1=['filter','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x4c2665,_0x5623e0){var _0x3a4fa5=function(_0x1785f8){while(--_0x1785f8){_0x4c2665['push'](_0x4c2665['shift']());}};_0x3a4fa5(++_0x5623e0);}(_0x59b1,0x10e));var _0x159b=function(_0x2ade90,_0xf704df){_0x2ade90=_0x2ade90-0x0;var _0x2cbfa6=_0x59b1[_0x2ade90];return _0x2cbfa6;};'use strict';var emlformat=require(_0x159b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x159b('0x1'));var jsonpatch=require(_0x159b('0x2'));var rp=require(_0x159b('0x3'));var moment=require(_0x159b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x159b('0x5'));var util=require(_0x159b('0x6'));var path=require('path');var sox=require(_0x159b('0x7'));var csv=require(_0x159b('0x8'));var ejs=require(_0x159b('0x9'));var fs=require('fs');var fs_extra=require(_0x159b('0xa'));var _=require(_0x159b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x159b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x159b('0x8'));var querystring=require(_0x159b('0xd'));var Papa=require(_0x159b('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x159b('0xf'));var as=require(_0x159b('0x10'));var hardwareService=require(_0x159b('0x11'));var logger=require(_0x159b('0x12'))(_0x159b('0x13'));var utils=require(_0x159b('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x159b('0x15'))['db'];config[_0x159b('0x16')]=_[_0x159b('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x159b('0x18'))(new Redis(config[_0x159b('0x16')]));require(_0x159b('0x19'))['register'](socket);function respondWithStatusCode(_0x1d0c46,_0x1ac06c){_0x1ac06c=_0x1ac06c||0xcc;return function(_0x172282){if(_0x172282){return _0x1d0c46[_0x159b('0x1a')](_0x1ac06c);}return _0x1d0c46['status'](_0x1ac06c)[_0x159b('0x1b')]();};}function respondWithResult(_0x3156d4,_0x516936){_0x516936=_0x516936||0xc8;return function(_0x248937){if(_0x248937){return _0x3156d4[_0x159b('0x1c')](_0x516936)[_0x159b('0x1d')](_0x248937);}};}function respondWithFilteredResult(_0x479418,_0x4d4e35){return function(_0x2d15c6){if(_0x2d15c6){var _0xde2f9e=typeof _0x4d4e35['offset']===_0x159b('0x1e')&&typeof _0x4d4e35['limit']===_0x159b('0x1e');var _0xf57353=_0x2d15c6['count'];var _0xb65eb5=_0xde2f9e?0x0:_0x4d4e35[_0x159b('0x1f')];var _0x3ac268=_0xde2f9e?_0x2d15c6[_0x159b('0x20')]:_0x4d4e35['offset']+_0x4d4e35[_0x159b('0x21')];var _0x491475;if(_0x3ac268>=_0xf57353){_0x3ac268=_0xf57353;_0x491475=0xc8;}else{_0x491475=0xce;}_0x479418['status'](_0x491475);return _0x479418[_0x159b('0x22')](_0x159b('0x23'),_0xb65eb5+'-'+_0x3ac268+'/'+_0xf57353)['json'](_0x2d15c6);}return null;};}function patchUpdates(_0x23775a){return function(_0x46e67f){try{jsonpatch[_0x159b('0x24')](_0x46e67f,_0x23775a,!![]);}catch(_0x4e4a56){return BPromise[_0x159b('0x25')](_0x4e4a56);}return _0x46e67f[_0x159b('0x26')]();};}function saveUpdates(_0xa36e62,_0x42b548){return function(_0x28cfe5){if(_0x28cfe5){return _0x28cfe5[_0x159b('0x27')](_0xa36e62)[_0x159b('0x28')](function(_0x14165b){return _0x14165b;});}return null;};}function removeEntity(_0x4d7cab,_0x10079a){return function(_0x36d687){if(_0x36d687){return _0x36d687['destroy']()[_0x159b('0x28')](function(){_0x4d7cab[_0x159b('0x1c')](0xcc)[_0x159b('0x1b')]();});}};}function handleEntityNotFound(_0x2f9ec9,_0x345ee2){return function(_0x235a8e){if(!_0x235a8e){_0x2f9ec9[_0x159b('0x1a')](0x194);}return _0x235a8e;};}function handleError(_0x1ab787,_0x502944){_0x502944=_0x502944||0x1f4;return function(_0x1c4c33){logger[_0x159b('0x29')](_0x1c4c33[_0x159b('0x2a')]);if(_0x1c4c33[_0x159b('0x2b')]){delete _0x1c4c33[_0x159b('0x2b')];}_0x1ab787[_0x159b('0x1c')](_0x502944)[_0x159b('0x2c')](_0x1c4c33);};}exports[_0x159b('0x2d')]=function(_0x3ce2d2,_0x53175c){var _0x3145cc={},_0x3005cb={},_0x2f5031={'count':0x0,'rows':[]};var _0x2139a6=_['map'](db['ChatInternalMessage'][_0x159b('0x2e')],function(_0x5aac4c){return{'name':_0x5aac4c['fieldName'],'type':_0x5aac4c[_0x159b('0x2f')][_0x159b('0x30')]};});_0x3005cb[_0x159b('0x31')]=_[_0x159b('0x32')](_0x2139a6,'name');_0x3005cb[_0x159b('0x33')]=_[_0x159b('0x34')](_0x3ce2d2['query']);_0x3005cb[_0x159b('0x35')]=_['intersection'](_0x3005cb[_0x159b('0x31')],_0x3005cb[_0x159b('0x33')]);_0x3145cc[_0x159b('0x36')]=_[_0x159b('0x37')](_0x3005cb[_0x159b('0x31')],qs[_0x159b('0x38')](_0x3ce2d2['query'][_0x159b('0x38')]));_0x3145cc[_0x159b('0x36')]=_0x3145cc[_0x159b('0x36')][_0x159b('0x39')]?_0x3145cc[_0x159b('0x36')]:_0x3005cb[_0x159b('0x31')];if(!_0x3ce2d2[_0x159b('0x33')][_0x159b('0x3a')](_0x159b('0x3b'))){_0x3145cc[_0x159b('0x21')]=qs['limit'](_0x3ce2d2[_0x159b('0x33')][_0x159b('0x21')]);_0x3145cc[_0x159b('0x1f')]=qs[_0x159b('0x1f')](_0x3ce2d2[_0x159b('0x33')]['offset']);}_0x3145cc['order']=qs[_0x159b('0x3c')](_0x3ce2d2[_0x159b('0x33')]['sort']);_0x3145cc[_0x159b('0x3d')]=qs[_0x159b('0x35')](_[_0x159b('0x3e')](_0x3ce2d2[_0x159b('0x33')],_0x3005cb[_0x159b('0x35')]),_0x2139a6);if(_0x3ce2d2[_0x159b('0x33')][_0x159b('0x3f')]){_0x3145cc[_0x159b('0x3d')]=_['merge'](_0x3145cc[_0x159b('0x3d')],{'$or':_[_0x159b('0x32')](_0x2139a6,function(_0x129fc9){if(_0x129fc9['type']!==_0x159b('0x40')){var _0x1a1e86={};_0x1a1e86[_0x129fc9[_0x159b('0x2b')]]={'$like':'%'+_0x3ce2d2[_0x159b('0x33')]['filter']+'%'};return _0x1a1e86;}})});}_0x3145cc=_['merge']({},_0x3145cc,_0x3ce2d2[_0x159b('0x41')]);var _0x4416f5={'where':_0x3145cc['where']};return db[_0x159b('0x42')][_0x159b('0x20')](_0x4416f5)['then'](function(_0x3cb0b0){_0x2f5031[_0x159b('0x20')]=_0x3cb0b0;if(_0x3ce2d2[_0x159b('0x33')][_0x159b('0x43')]){_0x3145cc[_0x159b('0x44')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x159b('0x45')](_0x3145cc);})['then'](function(_0x536a0d){_0x2f5031[_0x159b('0x46')]=_0x536a0d;return _0x2f5031;})['then'](respondWithFilteredResult(_0x53175c,_0x3145cc))[_0x159b('0x47')](handleError(_0x53175c,null));};exports[_0x159b('0x48')]=function(_0x17830f,_0x35872a){var _0x44f806={'raw':!![],'where':{'id':_0x17830f[_0x159b('0x49')]['id']}},_0x65920d={};_0x65920d[_0x159b('0x31')]=_[_0x159b('0x34')](db[_0x159b('0x42')][_0x159b('0x2e')]);_0x65920d['query']=_[_0x159b('0x34')](_0x17830f[_0x159b('0x33')]);_0x65920d['filters']=_['intersection'](_0x65920d[_0x159b('0x31')],_0x65920d[_0x159b('0x33')]);_0x44f806['attributes']=_[_0x159b('0x37')](_0x65920d['model'],qs['fields'](_0x17830f[_0x159b('0x33')][_0x159b('0x38')]));_0x44f806[_0x159b('0x36')]=_0x44f806[_0x159b('0x36')]['length']?_0x44f806[_0x159b('0x36')]:_0x65920d[_0x159b('0x31')];if(_0x17830f['query']['includeAll']){_0x44f806['include']=[{'all':!![]}];}_0x44f806=_['merge']({},_0x44f806,_0x17830f['options']);return db[_0x159b('0x42')]['find'](_0x44f806)[_0x159b('0x28')](handleEntityNotFound(_0x35872a,null))[_0x159b('0x28')](respondWithResult(_0x35872a,null))[_0x159b('0x47')](handleError(_0x35872a,null));};exports['create']=function(_0x2cb45f,_0x6cd8d8){return db[_0x159b('0x42')][_0x159b('0x4a')](_0x2cb45f['body'],{})['then'](respondWithResult(_0x6cd8d8,0xc9))['catch'](handleError(_0x6cd8d8,null));};exports['update']=function(_0x4bc879,_0x24cb69){if(_0x4bc879[_0x159b('0x4b')]['id']){delete _0x4bc879[_0x159b('0x4b')]['id'];}return db[_0x159b('0x42')][_0x159b('0x4c')]({'where':{'id':_0x4bc879['params']['id']}})[_0x159b('0x28')](handleEntityNotFound(_0x24cb69,null))[_0x159b('0x28')](saveUpdates(_0x4bc879[_0x159b('0x4b')],null))[_0x159b('0x28')](respondWithResult(_0x24cb69,null))[_0x159b('0x47')](handleError(_0x24cb69,null));};exports[_0x159b('0x4d')]=function(_0xcd62a5,_0x32f1e9){return db['ChatInternalMessage'][_0x159b('0x4c')]({'where':{'id':_0xcd62a5[_0x159b('0x49')]['id']}})[_0x159b('0x28')](handleEntityNotFound(_0x32f1e9,null))[_0x159b('0x28')](removeEntity(_0x32f1e9,null))[_0x159b('0x47')](handleError(_0x32f1e9,null));};exports[_0x159b('0x4e')]=function(_0x45f453,_0x557e00){return db[_0x159b('0x42')]['describe']()[_0x159b('0x28')](respondWithResult(_0x557e00,null))[_0x159b('0x47')](handleError(_0x557e00,null));};function wrapUser(_0x17c18e){return function(_0x440d91){var _0x484f87=_0x17c18e['get']({'plain':!![]});_0x484f87[_0x159b('0x4f')]=[];if(_0x440d91){_0x484f87[_0x159b('0x50')]=_0x440d91[_0x159b('0x51')];_0x484f87[_0x159b('0x52')]=_0x440d91;}else{_0x484f87[_0x159b('0x50')]=moment(0x0)[_0x159b('0x53')](_0x159b('0x54'));_0x484f87[_0x159b('0x52')]={};}return _0x484f87;};}exports[_0x159b('0x55')]=function(_0xe01a3c,_0x5f0740,_0x4a312d){var _0x46bd38=[];return db[_0x159b('0x56')][_0x159b('0x45')]({'where':{'role':[_0x159b('0x57'),_0x159b('0x58'),_0x159b('0x59')]},'attributes':['id',_0x159b('0x5a'),_0x159b('0x2b'),_0x159b('0x5b'),_0x159b('0x5c'),_0x159b('0x5d'),'online','lastLoginAt',_0x159b('0x5e'),_0x159b('0x5f')],'order':qs[_0x159b('0x3c')](_0x159b('0x60')),'include':[{'model':db['VoiceQueue'],'as':_0x159b('0x61'),'attributes':['id','name',_0x159b('0x2f')],'through':{'attributes':[]}}]})[_0x159b('0x28')](function(_0xf2974e){if(_0xf2974e){var _0x239cfa=_0xe01a3c['user']['get']({'plain':!![]});if(!_0x239cfa)throw new Error(_0x159b('0x62'));if(_0x239cfa[_0x159b('0x5b')]===_0x159b('0x59')){return db[_0x159b('0x63')][_0x159b('0x4c')]({'where':{'name':_0x159b('0x64'),'userProfileId':_0x239cfa[_0x159b('0x65')]},'raw':!![]})[_0x159b('0x28')](function(_0x18802d){if(_0x18802d){if(_0x18802d[_0x159b('0x66')]===0x0){return db[_0x159b('0x67')]['findAll']({'where':{'sectionId':_0x18802d['id']},'raw':!![]})[_0x159b('0x28')](function(_0x2fa9dc){var _0x393bcc=[];if(_['isEmpty'](_0x2fa9dc)){_0x393bcc=_['filter'](_0xf2974e,function(_0x353334){if(_0x353334[_0x159b('0x5b')]!==_0x159b('0x57')){return _0x353334;}});return _0x393bcc;}else{for(var _0xc2b290=0x0;_0xc2b290<_0xf2974e[_0x159b('0x39')];_0xc2b290++){var _0x2563b8=_0xf2974e[_0xc2b290];if(_0x2563b8[_0x159b('0x5b')]==='agent'){var _0x5ac5cd=_[_0x159b('0x4c')](_0x2fa9dc,function(_0x442a5a){return _0x442a5a[_0x159b('0x68')]===_0x2563b8['id'];});if(_0x5ac5cd)_0x393bcc[_0x159b('0x69')](_0x2563b8);}else{_0x393bcc[_0x159b('0x69')](_0x2563b8);}}return _0x393bcc;}});}else{return _0xf2974e;}}else{var _0x172e02=_[_0x159b('0x3f')](_0xf2974e,function(_0x176b7b){if(_0x176b7b[_0x159b('0x5b')]!==_0x159b('0x57')){return _0x176b7b;}});return _0x172e02;}});}else{return _0xf2974e;}}})[_0x159b('0x28')](function(_0x276329){var _0x1f9351=[];if(_0x276329){_0x46bd38=_0x276329;for(var _0x48efe1=0x0;_0x48efe1<_0x276329[_0x159b('0x39')];_0x48efe1+=0x1){_0x46bd38[_0x48efe1][_0x159b('0x4f')]=[];_0x1f9351['push'](db[_0x159b('0x42')][_0x159b('0x4c')]({'where':{'FromId':[_0xe01a3c[_0x159b('0x59')]['id'],_0x276329[_0x48efe1]['id']],'ToId':[_0xe01a3c['user']['id'],_0x276329[_0x48efe1]['id']],'ChatGroupId':null},'attributes':['id',_0x159b('0x51'),_0x159b('0x6a'),_0x159b('0x6b'),_0x159b('0x6c'),'body'],'order':qs['sort'](_0x159b('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x159b('0x28')](wrapUser(_0x276329[_0x48efe1])));}return BPromise[_0x159b('0x6e')](_0x1f9351);}return[];})[_0x159b('0x28')](function(_0x53f63d){return{'rows':_0x53f63d,'count':_0x53f63d['length']};})[_0x159b('0x28')](respondWithResult(_0x5f0740,null))[_0x159b('0x47')](handleError(_0x5f0740,null));};
\ No newline at end of file
+var _0xeac0=['findAll','rows','catch','show','params','includeAll','create','body','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','merge','type','VIRTUAL','options','ChatInternalMessage','include'];(function(_0x308e4f,_0x134e25){var _0x17ab35=function(_0x2cfcd9){while(--_0x2cfcd9){_0x308e4f['push'](_0x308e4f['shift']());}};_0x17ab35(++_0x134e25);}(_0xeac0,0x1db));var _0x0eac=function(_0x406ade,_0x1eccbd){_0x406ade=_0x406ade-0x0;var _0x13962e=_0xeac0[_0x406ade];return _0x13962e;};'use strict';var emlformat=require(_0x0eac('0x0'));var rimraf=require(_0x0eac('0x1'));var zipdir=require(_0x0eac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0eac('0x3'));var moment=require(_0x0eac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0eac('0x5'));var util=require(_0x0eac('0x6'));var path=require(_0x0eac('0x7'));var sox=require(_0x0eac('0x8'));var csv=require(_0x0eac('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0eac('0xa'));var crypto=require('crypto');var jsforce=require(_0x0eac('0xb'));var deskjs=require(_0x0eac('0xc'));var toCsv=require(_0x0eac('0x9'));var querystring=require(_0x0eac('0xd'));var Papa=require(_0x0eac('0xe'));var Redis=require(_0x0eac('0xf'));var authService=require(_0x0eac('0x10'));var qs=require(_0x0eac('0x11'));var as=require(_0x0eac('0x12'));var hardwareService=require(_0x0eac('0x13'));var logger=require(_0x0eac('0x14'))(_0x0eac('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0eac('0x16'))['db'];config[_0x0eac('0x17')]=_[_0x0eac('0x18')](config[_0x0eac('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x0eac('0x19'))(new Redis(config[_0x0eac('0x17')]));require('./chatInternalMessage.socket')[_0x0eac('0x1a')](socket);function respondWithStatusCode(_0x41d172,_0x1f4ffc){_0x1f4ffc=_0x1f4ffc||0xcc;return function(_0x11c9be){if(_0x11c9be){return _0x41d172[_0x0eac('0x1b')](_0x1f4ffc);}return _0x41d172[_0x0eac('0x1c')](_0x1f4ffc)[_0x0eac('0x1d')]();};}function respondWithResult(_0x4d2835,_0x1ce6a1){_0x1ce6a1=_0x1ce6a1||0xc8;return function(_0xdbf5f8){if(_0xdbf5f8){return _0x4d2835[_0x0eac('0x1c')](_0x1ce6a1)[_0x0eac('0x1e')](_0xdbf5f8);}};}function respondWithFilteredResult(_0x33be07,_0x5612b4){return function(_0x521ed1){if(_0x521ed1){var _0x2cc53e=typeof _0x5612b4['offset']===_0x0eac('0x1f')&&typeof _0x5612b4[_0x0eac('0x20')]===_0x0eac('0x1f');var _0x4f9f2d=_0x521ed1[_0x0eac('0x21')];var _0x15fce4=_0x2cc53e?0x0:_0x5612b4[_0x0eac('0x22')];var _0x3725db=_0x2cc53e?_0x521ed1['count']:_0x5612b4[_0x0eac('0x22')]+_0x5612b4[_0x0eac('0x20')];var _0x262536;if(_0x3725db>=_0x4f9f2d){_0x3725db=_0x4f9f2d;_0x262536=0xc8;}else{_0x262536=0xce;}_0x33be07['status'](_0x262536);return _0x33be07[_0x0eac('0x23')](_0x0eac('0x24'),_0x15fce4+'-'+_0x3725db+'/'+_0x4f9f2d)[_0x0eac('0x1e')](_0x521ed1);}return null;};}function patchUpdates(_0x5bcfbf){return function(_0xb7ea8c){try{jsonpatch['apply'](_0xb7ea8c,_0x5bcfbf,!![]);}catch(_0x106aff){return BPromise[_0x0eac('0x25')](_0x106aff);}return _0xb7ea8c[_0x0eac('0x26')]();};}function saveUpdates(_0xcc7764,_0x15ef0f){return function(_0x2bac22){if(_0x2bac22){return _0x2bac22[_0x0eac('0x27')](_0xcc7764)[_0x0eac('0x28')](function(_0x364e22){return _0x364e22;});}return null;};}function removeEntity(_0x43c5c7,_0x2dbf19){return function(_0x3139ff){if(_0x3139ff){return _0x3139ff[_0x0eac('0x29')]()['then'](function(){_0x43c5c7[_0x0eac('0x1c')](0xcc)[_0x0eac('0x1d')]();});}};}function handleEntityNotFound(_0x456d6f,_0x435bd3){return function(_0x5912e0){if(!_0x5912e0){_0x456d6f[_0x0eac('0x1b')](0x194);}return _0x5912e0;};}function handleError(_0x21b5ad,_0x2c4a55){_0x2c4a55=_0x2c4a55||0x1f4;return function(_0x2721b4){logger['error'](_0x2721b4['stack']);if(_0x2721b4[_0x0eac('0x2a')]){delete _0x2721b4[_0x0eac('0x2a')];}_0x21b5ad[_0x0eac('0x1c')](_0x2c4a55)[_0x0eac('0x2b')](_0x2721b4);};}exports[_0x0eac('0x2c')]=function(_0x275684,_0x5f5ba1){var _0x122080={},_0x1ec46e={},_0x5fc801={'count':0x0,'rows':[]};var _0x537a9a=_[_0x0eac('0x2d')](db['ChatInternalMessage'][_0x0eac('0x2e')],function(_0x1ac506){return{'name':_0x1ac506[_0x0eac('0x2f')],'type':_0x1ac506['type']['key']};});_0x1ec46e[_0x0eac('0x30')]=_[_0x0eac('0x2d')](_0x537a9a,_0x0eac('0x2a'));_0x1ec46e[_0x0eac('0x31')]=_[_0x0eac('0x32')](_0x275684[_0x0eac('0x31')]);_0x1ec46e[_0x0eac('0x33')]=_[_0x0eac('0x34')](_0x1ec46e[_0x0eac('0x30')],_0x1ec46e[_0x0eac('0x31')]);_0x122080[_0x0eac('0x35')]=_[_0x0eac('0x34')](_0x1ec46e[_0x0eac('0x30')],qs['fields'](_0x275684[_0x0eac('0x31')][_0x0eac('0x36')]));_0x122080[_0x0eac('0x35')]=_0x122080[_0x0eac('0x35')][_0x0eac('0x37')]?_0x122080[_0x0eac('0x35')]:_0x1ec46e['model'];if(!_0x275684[_0x0eac('0x31')]['hasOwnProperty']('nolimit')){_0x122080[_0x0eac('0x20')]=qs['limit'](_0x275684[_0x0eac('0x31')]['limit']);_0x122080[_0x0eac('0x22')]=qs[_0x0eac('0x22')](_0x275684[_0x0eac('0x31')][_0x0eac('0x22')]);}_0x122080[_0x0eac('0x38')]=qs[_0x0eac('0x39')](_0x275684[_0x0eac('0x31')]['sort']);_0x122080['where']=qs[_0x0eac('0x33')](_['pick'](_0x275684['query'],_0x1ec46e[_0x0eac('0x33')]),_0x537a9a);if(_0x275684[_0x0eac('0x31')][_0x0eac('0x3a')]){_0x122080['where']=_[_0x0eac('0x3b')](_0x122080['where'],{'$or':_[_0x0eac('0x2d')](_0x537a9a,function(_0x2c3d3e){if(_0x2c3d3e[_0x0eac('0x3c')]!==_0x0eac('0x3d')){var _0x21e6e0={};_0x21e6e0[_0x2c3d3e[_0x0eac('0x2a')]]={'$like':'%'+_0x275684[_0x0eac('0x31')]['filter']+'%'};return _0x21e6e0;}})});}_0x122080=_[_0x0eac('0x3b')]({},_0x122080,_0x275684[_0x0eac('0x3e')]);var _0x342945={'where':_0x122080['where']};return db[_0x0eac('0x3f')]['count'](_0x342945)[_0x0eac('0x28')](function(_0x30806b){_0x5fc801['count']=_0x30806b;if(_0x275684[_0x0eac('0x31')]['includeAll']){_0x122080[_0x0eac('0x40')]=[{'all':!![]}];}return db[_0x0eac('0x3f')][_0x0eac('0x41')](_0x122080);})[_0x0eac('0x28')](function(_0x2da445){_0x5fc801[_0x0eac('0x42')]=_0x2da445;return _0x5fc801;})['then'](respondWithFilteredResult(_0x5f5ba1,_0x122080))[_0x0eac('0x43')](handleError(_0x5f5ba1,null));};exports[_0x0eac('0x44')]=function(_0x24719f,_0x335cb1){var _0x37fec8={'raw':!![],'where':{'id':_0x24719f[_0x0eac('0x45')]['id']}},_0x1e8438={};_0x1e8438[_0x0eac('0x30')]=_[_0x0eac('0x32')](db['ChatInternalMessage'][_0x0eac('0x2e')]);_0x1e8438[_0x0eac('0x31')]=_[_0x0eac('0x32')](_0x24719f[_0x0eac('0x31')]);_0x1e8438['filters']=_[_0x0eac('0x34')](_0x1e8438[_0x0eac('0x30')],_0x1e8438['query']);_0x37fec8[_0x0eac('0x35')]=_[_0x0eac('0x34')](_0x1e8438[_0x0eac('0x30')],qs[_0x0eac('0x36')](_0x24719f[_0x0eac('0x31')][_0x0eac('0x36')]));_0x37fec8[_0x0eac('0x35')]=_0x37fec8[_0x0eac('0x35')][_0x0eac('0x37')]?_0x37fec8['attributes']:_0x1e8438[_0x0eac('0x30')];if(_0x24719f[_0x0eac('0x31')][_0x0eac('0x46')]){_0x37fec8[_0x0eac('0x40')]=[{'all':!![]}];}_0x37fec8=_['merge']({},_0x37fec8,_0x24719f[_0x0eac('0x3e')]);return db[_0x0eac('0x3f')]['find'](_0x37fec8)['then'](handleEntityNotFound(_0x335cb1,null))['then'](respondWithResult(_0x335cb1,null))[_0x0eac('0x43')](handleError(_0x335cb1,null));};exports['create']=function(_0x19adea,_0x34789e){return db[_0x0eac('0x3f')][_0x0eac('0x47')](_0x19adea['body'],{})[_0x0eac('0x28')](respondWithResult(_0x34789e,0xc9))[_0x0eac('0x43')](handleError(_0x34789e,null));};exports[_0x0eac('0x27')]=function(_0x493f5c,_0x4bff78){if(_0x493f5c[_0x0eac('0x48')]['id']){delete _0x493f5c[_0x0eac('0x48')]['id'];}return db['ChatInternalMessage'][_0x0eac('0x49')]({'where':{'id':_0x493f5c['params']['id']}})[_0x0eac('0x28')](handleEntityNotFound(_0x4bff78,null))[_0x0eac('0x28')](saveUpdates(_0x493f5c[_0x0eac('0x48')],null))[_0x0eac('0x28')](respondWithResult(_0x4bff78,null))['catch'](handleError(_0x4bff78,null));};exports['destroy']=function(_0x161cd7,_0x78b013){return db['ChatInternalMessage']['find']({'where':{'id':_0x161cd7['params']['id']}})[_0x0eac('0x28')](handleEntityNotFound(_0x78b013,null))[_0x0eac('0x28')](removeEntity(_0x78b013,null))[_0x0eac('0x43')](handleError(_0x78b013,null));};exports[_0x0eac('0x4a')]=function(_0x56a26d,_0x586f4e){return db[_0x0eac('0x3f')][_0x0eac('0x4a')]()[_0x0eac('0x28')](respondWithResult(_0x586f4e,null))[_0x0eac('0x43')](handleError(_0x586f4e,null));};function wrapUser(_0x22fc83){return function(_0x5b0fa3){var _0xa4101f=_0x22fc83[_0x0eac('0x4b')]({'plain':!![]});_0xa4101f[_0x0eac('0x4c')]=[];if(_0x5b0fa3){_0xa4101f[_0x0eac('0x4d')]=_0x5b0fa3[_0x0eac('0x4e')];_0xa4101f[_0x0eac('0x4f')]=_0x5b0fa3;}else{_0xa4101f[_0x0eac('0x4d')]=moment(0x0)[_0x0eac('0x50')](_0x0eac('0x51'));_0xa4101f[_0x0eac('0x4f')]={};}return _0xa4101f;};}exports[_0x0eac('0x52')]=function(_0x439c07,_0x510cbc,_0x1521d3){var _0x4939b4=[];return db['User'][_0x0eac('0x41')]({'where':{'role':[_0x0eac('0x53'),_0x0eac('0x54'),_0x0eac('0x55')]},'attributes':['id','fullname','name','role','userpic','internal',_0x0eac('0x56'),_0x0eac('0x57'),_0x0eac('0x58'),_0x0eac('0x59')],'order':qs[_0x0eac('0x39')](_0x0eac('0x5a')),'include':[{'model':db[_0x0eac('0x5b')],'as':_0x0eac('0x5c'),'attributes':['id',_0x0eac('0x2a'),'type'],'through':{'attributes':[]}}]})[_0x0eac('0x28')](function(_0x47ed43){if(_0x47ed43){var _0x49bde6=_0x439c07[_0x0eac('0x55')][_0x0eac('0x4b')]({'plain':!![]});if(!_0x49bde6)throw new Error(_0x0eac('0x5d'));if(_0x49bde6[_0x0eac('0x5e')]==='user'){return db[_0x0eac('0x5f')][_0x0eac('0x49')]({'where':{'name':_0x0eac('0x60'),'userProfileId':_0x49bde6[_0x0eac('0x61')]},'raw':!![]})[_0x0eac('0x28')](function(_0x50ce63){if(_0x50ce63){if(_0x50ce63[_0x0eac('0x62')]===0x0){return db[_0x0eac('0x63')][_0x0eac('0x41')]({'where':{'sectionId':_0x50ce63['id']},'raw':!![]})['then'](function(_0x469413){var _0x282d5c=[];if(_[_0x0eac('0x64')](_0x469413)){_0x282d5c=_['filter'](_0x47ed43,function(_0x42290c){if(_0x42290c[_0x0eac('0x5e')]!==_0x0eac('0x53')){return _0x42290c;}});return _0x282d5c;}else{for(var _0x37c4de=0x0;_0x37c4de<_0x47ed43['length'];_0x37c4de++){var _0x4f230e=_0x47ed43[_0x37c4de];if(_0x4f230e[_0x0eac('0x5e')]===_0x0eac('0x53')){var _0x475ccc=_[_0x0eac('0x49')](_0x469413,function(_0x27d709){return _0x27d709[_0x0eac('0x65')]===_0x4f230e['id'];});if(_0x475ccc)_0x282d5c[_0x0eac('0x66')](_0x4f230e);}else{_0x282d5c['push'](_0x4f230e);}}return _0x282d5c;}});}else{return _0x47ed43;}}else{var _0x28e61f=_[_0x0eac('0x3a')](_0x47ed43,function(_0x2b8a44){if(_0x2b8a44[_0x0eac('0x5e')]!==_0x0eac('0x53')){return _0x2b8a44;}});return _0x28e61f;}});}else{return _0x47ed43;}}})['then'](function(_0x4f2616){var _0x2fcb9d=[];if(_0x4f2616){_0x4939b4=_0x4f2616;for(var _0xea141=0x0;_0xea141<_0x4f2616[_0x0eac('0x37')];_0xea141+=0x1){_0x4939b4[_0xea141]['messages']=[];_0x2fcb9d[_0x0eac('0x66')](db[_0x0eac('0x3f')][_0x0eac('0x49')]({'where':{'FromId':[_0x439c07[_0x0eac('0x55')]['id'],_0x4f2616[_0xea141]['id']],'ToId':[_0x439c07[_0x0eac('0x55')]['id'],_0x4f2616[_0xea141]['id']],'ChatGroupId':null},'attributes':['id',_0x0eac('0x4e'),_0x0eac('0x67'),_0x0eac('0x68'),_0x0eac('0x69'),_0x0eac('0x48')],'order':qs['sort'](_0x0eac('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x0eac('0x28')](wrapUser(_0x4f2616[_0xea141])));}return BPromise[_0x0eac('0x6b')](_0x2fcb9d);}return[];})[_0x0eac('0x28')](function(_0x4c8133){return{'rows':_0x4c8133,'count':_0x4c8133[_0x0eac('0x37')]};})[_0x0eac('0x28')](respondWithResult(_0x510cbc,null))['catch'](handleError(_0x510cbc,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index ebdb855..f22d372 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 _0x2c64=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x3891ce,_0x312c49){var _0xdf2765=function(_0x5afd39){while(--_0x5afd39){_0x3891ce['push'](_0x3891ce['shift']());}};_0xdf2765(++_0x312c49);}(_0x2c64,0x181));var _0x42c6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x2c64[_0x173441];return _0x2423a8;};'use strict';var EventEmitter=require(_0x42c6('0x0'));var ChatInternalMessage=require(_0x42c6('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x42c6('0x2')](0x0);var events={'afterCreate':_0x42c6('0x3'),'afterUpdate':_0x42c6('0x4'),'afterDestroy':_0x42c6('0x5')};function emitEvent(_0x4c5b95){return function(_0x5a6d74,_0x427ee2,_0x41e211){ChatInternalMessageEvents[_0x42c6('0x6')](_0x4c5b95+':'+_0x5a6d74['id'],_0x5a6d74);ChatInternalMessageEvents['emit'](_0x4c5b95,_0x5a6d74);_0x41e211(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x42c6('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x8074=['save','update','remove','emit','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x5c6244,_0x112ab8){var _0x5800ce=function(_0x304e3d){while(--_0x304e3d){_0x5c6244['push'](_0x5c6244['shift']());}};_0x5800ce(++_0x112ab8);}(_0x8074,0x175));var _0x4807=function(_0x4dd37d,_0xfa992f){_0x4dd37d=_0x4dd37d-0x0;var _0x59e3e4=_0x8074[_0x4dd37d];return _0x59e3e4;};'use strict';var EventEmitter=require(_0x4807('0x0'));var ChatInternalMessage=require(_0x4807('0x1'))['db'][_0x4807('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4807('0x3'),'afterUpdate':_0x4807('0x4'),'afterDestroy':_0x4807('0x5')};function emitEvent(_0x52ee5e){return function(_0x53ce14,_0x1d05e7,_0x268da1){ChatInternalMessageEvents[_0x4807('0x6')](_0x52ee5e+':'+_0x53ce14['id'],_0x53ce14);ChatInternalMessageEvents[_0x4807('0x6')](_0x52ee5e,_0x53ce14);_0x268da1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x4807('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index cbd11c0..3b5a2a4 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 _0x9118=['utf8mb4','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage'];(function(_0x48df88,_0xf92cd9){var _0x131496=function(_0x1b75fe){while(--_0x1b75fe){_0x48df88['push'](_0x48df88['shift']());}};_0x131496(++_0xf92cd9);}(_0x9118,0x114));var _0x8911=function(_0xcbd776,_0x302fe8){_0xcbd776=_0xcbd776-0x0;var _0x13d4b4=_0x9118[_0xcbd776];return _0x13d4b4;};'use strict';var _=require(_0x8911('0x0'));var util=require('util');var logger=require(_0x8911('0x1'))(_0x8911('0x2'));var moment=require('moment');var BPromise=require(_0x8911('0x3'));var rp=require(_0x8911('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8911('0x5'));var config=require(_0x8911('0x6'));var attributes=require(_0x8911('0x7'));module[_0x8911('0x8')]=function(_0x203e31,_0xa67e6c){return _0x203e31['define'](_0x8911('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8911('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8f77=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x4c1e63,_0x296a91){var _0x45d095=function(_0x351b45){while(--_0x351b45){_0x4c1e63['push'](_0x4c1e63['shift']());}};_0x45d095(++_0x296a91);}(_0x8f77,0x168));var _0x78f7=function(_0x317894,_0x592674){_0x317894=_0x317894-0x0;var _0x3aacf7=_0x8f77[_0x317894];return _0x3aacf7;};'use strict';var _=require(_0x78f7('0x0'));var util=require(_0x78f7('0x1'));var logger=require('../../config/logger')(_0x78f7('0x2'));var moment=require(_0x78f7('0x3'));var BPromise=require(_0x78f7('0x4'));var rp=require(_0x78f7('0x5'));var fs=require('fs');var path=require(_0x78f7('0x6'));var rimraf=require(_0x78f7('0x7'));var config=require(_0x78f7('0x8'));var attributes=require(_0x78f7('0x9'));module['exports']=function(_0x5adb2c,_0x30ec96){return _0x5adb2c[_0x78f7('0xa')](_0x78f7('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x78f7('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 6c38fdc..1ac3c35 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 _0x6367=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','info'];(function(_0x137078,_0x53da8b){var _0x713920=function(_0x57ddc8){while(--_0x57ddc8){_0x137078['push'](_0x137078['shift']());}};_0x713920(++_0x53da8b);}(_0x6367,0x1d5));var _0x7636=function(_0xd21fe7,_0x225a39){_0xd21fe7=_0xd21fe7-0x0;var _0x14d570=_0x6367[_0xd21fe7];return _0x14d570;};'use strict';var _=require('lodash');var util=require(_0x7636('0x0'));var moment=require('moment');var BPromise=require(_0x7636('0x1'));var rs=require(_0x7636('0x2'));var fs=require('fs');var Redis=require(_0x7636('0x3'));var db=require(_0x7636('0x4'))['db'];var utils=require(_0x7636('0x5'));var logger=require('../../config/logger')(_0x7636('0x6'));var config=require(_0x7636('0x7'));var jayson=require(_0x7636('0x8'));var client=jayson[_0x7636('0x9')]['http']({'port':0x232a});config[_0x7636('0xa')]=_['defaults'](config['redis'],{'host':_0x7636('0xb'),'port':0x18eb});var socket=require(_0x7636('0xc'))(new Redis(config[_0x7636('0xa')]));require('./chatInternalMessage.socket')[_0x7636('0xd')](socket);function respondWithRpcPromise(_0x4cc5a6,_0x140d97,_0x3f2e3b){return new BPromise(function(_0x51bb02,_0x20fc59){return client[_0x7636('0xe')](_0x4cc5a6,_0x3f2e3b)[_0x7636('0xf')](function(_0x2f7e28){logger[_0x7636('0x10')](_0x7636('0x11'),_0x140d97,_0x7636('0x12'));logger[_0x7636('0x13')](_0x7636('0x14'),_0x140d97,'request\x20sent',JSON[_0x7636('0x15')](_0x2f7e28));if(_0x2f7e28[_0x7636('0x16')]){if(_0x2f7e28['error'][_0x7636('0x17')]===0x1f4){logger[_0x7636('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x140d97,_0x2f7e28[_0x7636('0x16')][_0x7636('0x18')]);return _0x20fc59(_0x2f7e28[_0x7636('0x16')]['message']);}logger[_0x7636('0x16')](_0x7636('0x11'),_0x140d97,_0x2f7e28[_0x7636('0x16')][_0x7636('0x18')]);return _0x51bb02(_0x2f7e28['error'][_0x7636('0x18')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x140d97,_0x7636('0x12'));_0x51bb02(_0x2f7e28[_0x7636('0x19')][_0x7636('0x18')]);}})[_0x7636('0x1a')](function(_0x357a84){logger[_0x7636('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x140d97,_0x357a84);_0x20fc59(_0x357a84);});});}
\ No newline at end of file
+var _0xda7f=['redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4529c2,_0x18370a){var _0x173e80=function(_0x4e7fa3){while(--_0x4e7fa3){_0x4529c2['push'](_0x4529c2['shift']());}};_0x173e80(++_0x18370a);}(_0xda7f,0xc6));var _0xfda7=function(_0x2d3ba8,_0x168519){_0x2d3ba8=_0x2d3ba8-0x0;var _0x41b210=_0xda7f[_0x2d3ba8];return _0x41b210;};'use strict';var _=require(_0xfda7('0x0'));var util=require('util');var moment=require(_0xfda7('0x1'));var BPromise=require(_0xfda7('0x2'));var rs=require(_0xfda7('0x3'));var fs=require('fs');var Redis=require(_0xfda7('0x4'));var db=require(_0xfda7('0x5'))['db'];var utils=require(_0xfda7('0x6'));var logger=require(_0xfda7('0x7'))(_0xfda7('0x8'));var config=require('../../config/environment');var jayson=require(_0xfda7('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xfda7('0xa')]=_[_0xfda7('0xb')](config[_0xfda7('0xa')],{'host':_0xfda7('0xc'),'port':0x18eb});var socket=require(_0xfda7('0xd'))(new Redis(config[_0xfda7('0xa')]));require(_0xfda7('0xe'))[_0xfda7('0xf')](socket);function respondWithRpcPromise(_0x20ffe4,_0x2c812c,_0x147837){return new BPromise(function(_0xddf6d8,_0x24f16e){return client['request'](_0x20ffe4,_0x147837)['then'](function(_0x24363e){logger[_0xfda7('0x10')](_0xfda7('0x11'),_0x2c812c,'request\x20sent');logger[_0xfda7('0x12')](_0xfda7('0x13'),_0x2c812c,_0xfda7('0x14'),JSON['stringify'](_0x24363e));if(_0x24363e[_0xfda7('0x15')]){if(_0x24363e[_0xfda7('0x15')][_0xfda7('0x16')]===0x1f4){logger[_0xfda7('0x15')](_0xfda7('0x11'),_0x2c812c,_0x24363e['error'][_0xfda7('0x17')]);return _0x24f16e(_0x24363e[_0xfda7('0x15')][_0xfda7('0x17')]);}logger[_0xfda7('0x15')](_0xfda7('0x11'),_0x2c812c,_0x24363e[_0xfda7('0x15')][_0xfda7('0x17')]);return _0xddf6d8(_0x24363e[_0xfda7('0x15')]['message']);}else{logger['info'](_0xfda7('0x11'),_0x2c812c,_0xfda7('0x14'));_0xddf6d8(_0x24363e[_0xfda7('0x18')][_0xfda7('0x17')]);}})[_0xfda7('0x19')](function(_0x337cd0){logger[_0xfda7('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x2c812c,_0x337cd0);_0x24f16e(_0x337cd0);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index a96b5a6..34cca02 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 _0x1035=['remove','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x10f34b,_0x2a1872){var _0x4a648f=function(_0x15edc2){while(--_0x15edc2){_0x10f34b['push'](_0x10f34b['shift']());}};_0x4a648f(++_0x2a1872);}(_0x1035,0x18a));var _0x5103=function(_0x586fa2,_0x1a45bc){_0x586fa2=_0x586fa2-0x0;var _0x515be9=_0x1035[_0x586fa2];return _0x515be9;};'use strict';var ChatInternalMessageEvents=require(_0x5103('0x0'));var events=[_0x5103('0x1'),_0x5103('0x2'),_0x5103('0x3')];function createListener(_0x1f68a0,_0x475423){return function(_0x2925c3){_0x475423[_0x5103('0x4')](_0x1f68a0,_0x2925c3);};}function removeListener(_0x592265,_0x2737b6){return function(){ChatInternalMessageEvents[_0x5103('0x5')](_0x592265,_0x2737b6);};}exports[_0x5103('0x6')]=function(_0x31f741){for(var _0x33a264=0x0,_0x58c7a6=events[_0x5103('0x7')];_0x33a264<_0x58c7a6;_0x33a264++){var _0x5f5dfd=events[_0x33a264];var _0x479d02=createListener(_0x5103('0x8')+_0x5f5dfd,_0x31f741);ChatInternalMessageEvents['on'](_0x5f5dfd,_0x479d02);}};
\ No newline at end of file
+var _0xef6d=['./chatInternalMessage.events','remove','update','emit','removeListener','register','length'];(function(_0xa259f8,_0x328468){var _0x1c6122=function(_0x25a2d2){while(--_0x25a2d2){_0xa259f8['push'](_0xa259f8['shift']());}};_0x1c6122(++_0x328468);}(_0xef6d,0x9a));var _0xdef6=function(_0x563b83,_0x127542){_0x563b83=_0x563b83-0x0;var _0x327e62=_0xef6d[_0x563b83];return _0x327e62;};'use strict';var ChatInternalMessageEvents=require(_0xdef6('0x0'));var events=['save',_0xdef6('0x1'),_0xdef6('0x2')];function createListener(_0x3181ab,_0x45611e){return function(_0x21a1ae){_0x45611e[_0xdef6('0x3')](_0x3181ab,_0x21a1ae);};}function removeListener(_0x2333a2,_0x1a0fb1){return function(){ChatInternalMessageEvents[_0xdef6('0x4')](_0x2333a2,_0x1a0fb1);};}exports[_0xdef6('0x5')]=function(_0x102c3f){for(var _0x3cc298=0x0,_0x187faa=events[_0xdef6('0x6')];_0x3cc298<_0x187faa;_0x3cc298++){var _0x4b0e11=events[_0x3cc298];var _0x23af9f=createListener('chatInternalMessage:'+_0x4b0e11,_0x102c3f);ChatInternalMessageEvents['on'](_0x4b0e11,_0x23af9f);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 4c42568..97d5115 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 _0x1503=['index','/describe','describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x2b1ecb,_0x4c900f){var _0x45eced=function(_0x8f19e0){while(--_0x8f19e0){_0x2b1ecb['push'](_0x2b1ecb['shift']());}};_0x45eced(++_0x4c900f);}(_0x1503,0x1e2));var _0x3150=function(_0x23967c,_0x2e4a6e){_0x23967c=_0x23967c-0x0;var _0x151129=_0x1503[_0x23967c];return _0x151129;};'use strict';var multer=require(_0x3150('0x0'));var util=require(_0x3150('0x1'));var path=require(_0x3150('0x2'));var timeout=require(_0x3150('0x3'));var express=require(_0x3150('0x4'));var router=express[_0x3150('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3150('0x6'));var interaction=require(_0x3150('0x7'));var config=require(_0x3150('0x8'));var controller=require(_0x3150('0x9'));router[_0x3150('0xa')]('/',auth[_0x3150('0xb')](),controller[_0x3150('0xc')]);router['get'](_0x3150('0xd'),auth['isAuthenticated'](),controller[_0x3150('0xe')]);router[_0x3150('0xa')](_0x3150('0xf'),auth[_0x3150('0xb')](),controller[_0x3150('0x10')]);router[_0x3150('0xa')](_0x3150('0x11'),auth[_0x3150('0xb')](),controller[_0x3150('0x12')]);router[_0x3150('0x13')]('/',auth[_0x3150('0xb')](),controller[_0x3150('0x14')]);router[_0x3150('0x15')]('/:id',controller[_0x3150('0x16')]);router[_0x3150('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x3150('0x18')]);module[_0x3150('0x19')]=router;
\ No newline at end of file
+var _0xf2b9=['post','create','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','/:id','show'];(function(_0x385567,_0x40550f){var _0x49cf95=function(_0x4d3081){while(--_0x4d3081){_0x385567['push'](_0x385567['shift']());}};_0x49cf95(++_0x40550f);}(_0xf2b9,0x123));var _0x9f2b=function(_0x823d69,_0x2f7e02){_0x823d69=_0x823d69-0x0;var _0x2b2073=_0xf2b9[_0x823d69];return _0x2b2073;};'use strict';var multer=require(_0x9f2b('0x0'));var util=require(_0x9f2b('0x1'));var path=require(_0x9f2b('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f2b('0x3'));var router=express[_0x9f2b('0x4')]();var fs_extra=require(_0x9f2b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9f2b('0x6'));var config=require(_0x9f2b('0x7'));var controller=require(_0x9f2b('0x8'));router[_0x9f2b('0x9')]('/',auth[_0x9f2b('0xa')](),controller[_0x9f2b('0xb')]);router[_0x9f2b('0x9')]('/describe',auth[_0x9f2b('0xa')](),controller[_0x9f2b('0xc')]);router['get'](_0x9f2b('0xd'),auth['isAuthenticated'](),controller[_0x9f2b('0xe')]);router['get'](_0x9f2b('0xf'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x10')]);router[_0x9f2b('0x11')]('/',auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x12')]);router[_0x9f2b('0x13')](_0x9f2b('0xf'),controller[_0x9f2b('0x14')]);router[_0x9f2b('0x15')]('/:id',auth[_0x9f2b('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 6f0d10b..6890532 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 _0x5c00=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x577f3d,_0x43ab79){var _0x3b11f6=function(_0x4f1a61){while(--_0x4f1a61){_0x577f3d['push'](_0x577f3d['shift']());}};_0x3b11f6(++_0x43ab79);}(_0x5c00,0x17e));var _0x05c0=function(_0x328b40,_0x370642){_0x328b40=_0x328b40-0x0;var _0x556a56=_0x5c00[_0x328b40];return _0x556a56;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'body':{'type':Sequelize[_0x05c0('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x05c0('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x05c0('0x4')]('in',_0x05c0('0x5')),'defaultValue':_0x05c0('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x05c0('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x05c0('0x2')]}};
\ No newline at end of file
+var _0x6ae2=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x266a1a,_0x28c25f){_0x266a1a=_0x266a1a-0x0;var _0x245e51=_0x6ae2[_0x266a1a];return _0x245e51;};'use strict';var Sequelize=require(_0x26ae('0x0'));module[_0x26ae('0x1')]={'body':{'type':Sequelize[_0x26ae('0x2')](_0x26ae('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x26ae('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x26ae('0x5')]('in',_0x26ae('0x6')),'defaultValue':_0x26ae('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x26ae('0x7')]},'providerResponse':{'type':Sequelize[_0x26ae('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index aaa7777..8434e8b 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 _0xd8c0=['set','reject','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','params','options','update','body','find','describe','chat-interactions','accept','chat','read','format','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','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','QueryTypes','SELECT','contact','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','fullname','interface','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','client','http','request','then','info','debug','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset'];(function(_0x1c72c2,_0x21a241){var _0x4b9c84=function(_0x302f07){while(--_0x302f07){_0x1c72c2['push'](_0x1c72c2['shift']());}};_0x4b9c84(++_0x21a241);}(_0xd8c0,0x147));var _0x0d8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd8c0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0d8c('0x0'));var zipdir=require(_0x0d8c('0x1'));var jsonpatch=require(_0x0d8c('0x2'));var rp=require('request-promise');var moment=require(_0x0d8c('0x3'));var BPromise=require(_0x0d8c('0x4'));var Mustache=require('mustache');var util=require(_0x0d8c('0x5'));var path=require('path');var sox=require(_0x0d8c('0x6'));var csv=require(_0x0d8c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d8c('0x8'));var _=require(_0x0d8c('0x9'));var squel=require('squel');var crypto=require(_0x0d8c('0xa'));var jsforce=require(_0x0d8c('0xb'));var deskjs=require(_0x0d8c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0d8c('0xd'));var Papa=require(_0x0d8c('0xe'));var Redis=require(_0x0d8c('0xf'));var authService=require(_0x0d8c('0x10'));var qs=require(_0x0d8c('0x11'));var as=require(_0x0d8c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d8c('0x13'))(_0x0d8c('0x14'));var utils=require(_0x0d8c('0x15'));var config=require(_0x0d8c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d8c('0x17'))['db'];config['redis']=_[_0x0d8c('0x18')](config[_0x0d8c('0x19')],{'host':_0x0d8c('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0d8c('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0d8c('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x0d8c('0x1c')][_0x0d8c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1b7b82,_0x5437ab,_0x5d7e32,_0x3ef7d8){return new BPromise(function(_0x574ee8,_0x4fd88e){var _0x16015a=_0x3ef7d8||client;return _0x16015a[_0x0d8c('0x1e')](_0x1b7b82,_0x5d7e32)[_0x0d8c('0x1f')](function(_0x2d339b){logger[_0x0d8c('0x20')]('ChatMessage,\x20%s,\x20%s',_0x5437ab,'request\x20sent');logger[_0x0d8c('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5437ab,'request\x20sent',JSON[_0x0d8c('0x22')](_0x2d339b));if(_0x2d339b[_0x0d8c('0x23')]){if(_0x2d339b['error']['code']===0x1f4){logger[_0x0d8c('0x23')](_0x0d8c('0x24'),_0x5437ab,_0x2d339b[_0x0d8c('0x23')][_0x0d8c('0x25')]);return _0x4fd88e(_0x2d339b[_0x0d8c('0x23')][_0x0d8c('0x25')]);}logger[_0x0d8c('0x23')](_0x0d8c('0x24'),_0x5437ab,_0x2d339b[_0x0d8c('0x23')][_0x0d8c('0x25')]);return _0x574ee8(_0x2d339b[_0x0d8c('0x23')][_0x0d8c('0x25')]);}else{logger[_0x0d8c('0x20')]('ChatMessage,\x20%s,\x20%s',_0x5437ab,'request\x20sent');_0x574ee8(_0x2d339b[_0x0d8c('0x26')]['message']);}})[_0x0d8c('0x27')](function(_0x53c28e){logger[_0x0d8c('0x23')]('ChatMessage,\x20%s,\x20%s',_0x5437ab,_0x53c28e);_0x4fd88e(_0x53c28e);});});}function respondWithStatusCode(_0x490a92,_0xea352f){_0xea352f=_0xea352f||0xcc;return function(_0x53e50a){if(_0x53e50a){return _0x490a92[_0x0d8c('0x28')](_0xea352f);}return _0x490a92['status'](_0xea352f)[_0x0d8c('0x29')]();};}function respondWithResult(_0x573b79,_0xc08209){_0xc08209=_0xc08209||0xc8;return function(_0x361488){if(_0x361488){return _0x573b79[_0x0d8c('0x2a')](_0xc08209)[_0x0d8c('0x2b')](_0x361488);}};}function respondWithFilteredResult(_0x50d32f,_0x24e813){return function(_0x258559){if(_0x258559){var _0x4d39e2=typeof _0x24e813['offset']===_0x0d8c('0x2c')&&typeof _0x24e813[_0x0d8c('0x2d')]===_0x0d8c('0x2c');var _0x55e70a=_0x258559[_0x0d8c('0x2e')];var _0x235bd8=_0x4d39e2?0x0:_0x24e813[_0x0d8c('0x2f')];var _0x7cb51b=_0x4d39e2?_0x258559[_0x0d8c('0x2e')]:_0x24e813[_0x0d8c('0x2f')]+_0x24e813['limit'];var _0x301896;if(_0x7cb51b>=_0x55e70a){_0x7cb51b=_0x55e70a;_0x301896=0xc8;}else{_0x301896=0xce;}_0x50d32f[_0x0d8c('0x2a')](_0x301896);return _0x50d32f[_0x0d8c('0x30')]('Content-Range',_0x235bd8+'-'+_0x7cb51b+'/'+_0x55e70a)[_0x0d8c('0x2b')](_0x258559);}return null;};}function patchUpdates(_0x4f2e6f){return function(_0x3136cc){try{jsonpatch['apply'](_0x3136cc,_0x4f2e6f,!![]);}catch(_0x30742b){return BPromise[_0x0d8c('0x31')](_0x30742b);}return _0x3136cc[_0x0d8c('0x32')]();};}function saveUpdates(_0x3a60b5,_0x22c40e){return function(_0x2bcbda){if(_0x2bcbda){return _0x2bcbda['update'](_0x3a60b5)[_0x0d8c('0x1f')](function(_0x232617){return _0x232617;});}return null;};}function removeEntity(_0x5a9ced,_0x1beb36){return function(_0x1fdb02){if(_0x1fdb02){return _0x1fdb02[_0x0d8c('0x33')]()[_0x0d8c('0x1f')](function(){_0x5a9ced['status'](0xcc)[_0x0d8c('0x29')]();});}};}function handleEntityNotFound(_0x51db29,_0x563abc){return function(_0x82eba6){if(!_0x82eba6){_0x51db29[_0x0d8c('0x28')](0x194);}return _0x82eba6;};}function handleError(_0x34c1fe,_0x2cbb02){_0x2cbb02=_0x2cbb02||0x1f4;return function(_0x2d2d60){logger[_0x0d8c('0x23')](_0x2d2d60[_0x0d8c('0x34')]);if(_0x2d2d60['name']){delete _0x2d2d60[_0x0d8c('0x35')];}_0x34c1fe[_0x0d8c('0x2a')](_0x2cbb02)[_0x0d8c('0x36')](_0x2d2d60);};}exports[_0x0d8c('0x37')]=function(_0x273e59,_0x3ab99a){var _0xdb7f24={},_0x5c2577={},_0x5e7056={'count':0x0,'rows':[]};var _0x917c=_[_0x0d8c('0x38')](db[_0x0d8c('0x39')][_0x0d8c('0x3a')],function(_0x18e465){return{'name':_0x18e465[_0x0d8c('0x3b')],'type':_0x18e465[_0x0d8c('0x3c')]['key']};});_0x5c2577[_0x0d8c('0x3d')]=_[_0x0d8c('0x38')](_0x917c,_0x0d8c('0x35'));_0x5c2577[_0x0d8c('0x3e')]=_[_0x0d8c('0x3f')](_0x273e59[_0x0d8c('0x3e')]);_0x5c2577[_0x0d8c('0x40')]=_[_0x0d8c('0x41')](_0x5c2577[_0x0d8c('0x3d')],_0x5c2577[_0x0d8c('0x3e')]);_0xdb7f24[_0x0d8c('0x42')]=_[_0x0d8c('0x41')](_0x5c2577['model'],qs[_0x0d8c('0x43')](_0x273e59[_0x0d8c('0x3e')][_0x0d8c('0x43')]));_0xdb7f24[_0x0d8c('0x42')]=_0xdb7f24[_0x0d8c('0x42')][_0x0d8c('0x44')]?_0xdb7f24['attributes']:_0x5c2577[_0x0d8c('0x3d')];if(!_0x273e59[_0x0d8c('0x3e')]['hasOwnProperty'](_0x0d8c('0x45'))){_0xdb7f24[_0x0d8c('0x2d')]=qs['limit'](_0x273e59[_0x0d8c('0x3e')][_0x0d8c('0x2d')]);_0xdb7f24[_0x0d8c('0x2f')]=qs[_0x0d8c('0x2f')](_0x273e59[_0x0d8c('0x3e')][_0x0d8c('0x2f')]);}_0xdb7f24[_0x0d8c('0x46')]=qs[_0x0d8c('0x47')](_0x273e59['query'][_0x0d8c('0x47')]);_0xdb7f24['where']=qs[_0x0d8c('0x40')](_[_0x0d8c('0x48')](_0x273e59['query'],_0x5c2577[_0x0d8c('0x40')]),_0x917c);if(_0x273e59[_0x0d8c('0x3e')][_0x0d8c('0x49')]){_0xdb7f24[_0x0d8c('0x4a')]=_[_0x0d8c('0x4b')](_0xdb7f24['where'],{'$or':_['map'](_0x917c,function(_0xa21ea5){if(_0xa21ea5[_0x0d8c('0x3c')]!==_0x0d8c('0x4c')){var _0x39a84f={};_0x39a84f[_0xa21ea5[_0x0d8c('0x35')]]={'$like':'%'+_0x273e59[_0x0d8c('0x3e')][_0x0d8c('0x49')]+'%'};return _0x39a84f;}})});}_0xdb7f24=_[_0x0d8c('0x4b')]({},_0xdb7f24,_0x273e59['options']);var _0x577538={'where':_0xdb7f24[_0x0d8c('0x4a')]};return db[_0x0d8c('0x39')][_0x0d8c('0x2e')](_0x577538)[_0x0d8c('0x1f')](function(_0x27f798){_0x5e7056[_0x0d8c('0x2e')]=_0x27f798;if(_0x273e59[_0x0d8c('0x3e')][_0x0d8c('0x4d')]){_0xdb7f24['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xdb7f24);})['then'](function(_0x42ff26){_0x5e7056[_0x0d8c('0x4e')]=_0x42ff26;return _0x5e7056;})['then'](respondWithFilteredResult(_0x3ab99a,_0xdb7f24))[_0x0d8c('0x27')](handleError(_0x3ab99a,null));};exports['show']=function(_0x486008,_0x33f514){var _0x27699a={'raw':!![],'where':{'id':_0x486008[_0x0d8c('0x4f')]['id']}},_0x21e005={};_0x21e005['model']=_[_0x0d8c('0x3f')](db['ChatMessage']['rawAttributes']);_0x21e005[_0x0d8c('0x3e')]=_['keys'](_0x486008[_0x0d8c('0x3e')]);_0x21e005[_0x0d8c('0x40')]=_[_0x0d8c('0x41')](_0x21e005['model'],_0x21e005[_0x0d8c('0x3e')]);_0x27699a[_0x0d8c('0x42')]=_[_0x0d8c('0x41')](_0x21e005[_0x0d8c('0x3d')],qs['fields'](_0x486008[_0x0d8c('0x3e')][_0x0d8c('0x43')]));_0x27699a[_0x0d8c('0x42')]=_0x27699a[_0x0d8c('0x42')][_0x0d8c('0x44')]?_0x27699a[_0x0d8c('0x42')]:_0x21e005[_0x0d8c('0x3d')];if(_0x486008[_0x0d8c('0x3e')]['includeAll']){_0x27699a['include']=[{'all':!![]}];}_0x27699a=_[_0x0d8c('0x4b')]({},_0x27699a,_0x486008[_0x0d8c('0x50')]);return db[_0x0d8c('0x39')]['find'](_0x27699a)[_0x0d8c('0x1f')](handleEntityNotFound(_0x33f514,null))['then'](respondWithResult(_0x33f514,null))[_0x0d8c('0x27')](handleError(_0x33f514,null));};exports['create']=function(_0xf11721,_0x33f77c){return db['ChatMessage']['create'](_0xf11721['body'],{})[_0x0d8c('0x1f')](respondWithResult(_0x33f77c,0xc9))[_0x0d8c('0x27')](handleError(_0x33f77c,null));};exports[_0x0d8c('0x51')]=function(_0x3d1772,_0x218688){if(_0x3d1772['body']['id']){delete _0x3d1772[_0x0d8c('0x52')]['id'];}return db[_0x0d8c('0x39')]['find']({'where':{'id':_0x3d1772[_0x0d8c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x218688,null))['then'](saveUpdates(_0x3d1772['body'],null))[_0x0d8c('0x1f')](respondWithResult(_0x218688,null))['catch'](handleError(_0x218688,null));};exports[_0x0d8c('0x33')]=function(_0x3f99b6,_0x127f46){return db[_0x0d8c('0x39')][_0x0d8c('0x53')]({'where':{'id':_0x3f99b6[_0x0d8c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x127f46,null))[_0x0d8c('0x1f')](removeEntity(_0x127f46,null))[_0x0d8c('0x27')](handleError(_0x127f46,null));};exports[_0x0d8c('0x54')]=function(_0x2f5976,_0x5b31af){return db[_0x0d8c('0x39')][_0x0d8c('0x54')]()[_0x0d8c('0x1f')](respondWithResult(_0x5b31af,null))['catch'](handleError(_0x5b31af,null));};var interaction_log=require(_0x0d8c('0x13'))(_0x0d8c('0x55'));exports[_0x0d8c('0x56')]=function(_0x2146c1,_0x1ef570,_0x42fcbf){var _0x3e66be={'agent':{},'channel':_0x0d8c('0x57')};if(_0x2146c1[_0x0d8c('0x52')]['id']){delete _0x2146c1[_0x0d8c('0x52')]['id'];}_0x2146c1[_0x0d8c('0x52')][_0x0d8c('0x58')]=!![];_0x2146c1[_0x0d8c('0x52')]['readAt']=moment()[_0x0d8c('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0x2146c1[_0x0d8c('0x52')][_0x0d8c('0x5a')]=_0x2146c1['body'][_0x0d8c('0x5a')]||_0x2146c1[_0x0d8c('0x5b')]['id'];_0x3e66be[_0x0d8c('0x5c')]['id']=_0x2146c1[_0x0d8c('0x52')]['UserId'];return db[_0x0d8c('0x39')][_0x0d8c('0x53')]({'where':{'id':_0x2146c1['params']['id'],'UserId':null}})[_0x0d8c('0x1f')](handleEntityNotFound(_0x1ef570,null))[_0x0d8c('0x1f')](saveUpdates(_0x2146c1[_0x0d8c('0x52')],null))[_0x0d8c('0x1f')](function(_0x40db50){if(_0x40db50){_0x3e66be['message']=_0x40db50[_0x0d8c('0x5d')]({'plain':!![]});return db[_0x0d8c('0x5e')][_0x0d8c('0x53')]({'where':{'id':_0x40db50['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1ef570,null))['then'](function(_0x422995){if(_0x422995){return _0x422995[_0x0d8c('0x51')]({'UserId':_0x2146c1[_0x0d8c('0x52')][_0x0d8c('0x5a')],'read1stAt':_[_0x0d8c('0x5f')](_0x422995[_0x0d8c('0x60')])?moment()[_0x0d8c('0x59')](_0x0d8c('0x61')):undefined});}return null;})['then'](function(_0x22fc29){if(_0x22fc29){_0x3e66be[_0x0d8c('0x62')]=_0x22fc29[_0x0d8c('0x5d')]({'plain':!![]});interaction_log[_0x0d8c('0x20')](_0x0d8c('0x63'),_0x2146c1[_0x0d8c('0x5b')]['id'],_0x2146c1['user'][_0x0d8c('0x35')],_0x2146c1[_0x0d8c('0x5b')][_0x0d8c('0x64')],_0x3e66be['interaction']['id'],_0x2146c1[_0x0d8c('0x52')]?JSON[_0x0d8c('0x22')](_0x2146c1['body']):_0x0d8c('0x65'));return respondWithRpcPromise('AcceptMessage',_0x0d8c('0x66'),_0x3e66be);}return null;})['then'](function(_0x4852ea){var _0x1f2196=_0x0d8c('0x67')+_0x4852ea[_0x0d8c('0x25')][_0x0d8c('0x68')];return db['sequelize']['query'](_0x1f2196,{'type':db[_0x0d8c('0x69')][_0x0d8c('0x6a')][_0x0d8c('0x6b')],'raw':!![]})[_0x0d8c('0x1f')](function(_0x3370ac){return _0x3370ac;});})[_0x0d8c('0x1f')](function(_0x308fcc){if(_0x308fcc){_0x3e66be['message'][_0x0d8c('0x6c')]=_0x308fcc[0x0];if(!_0x2146c1[_0x0d8c('0x52')][_0x0d8c('0x5a')])return;return db['User'][_0x0d8c('0x53')]({'where':{'id':_0x2146c1[_0x0d8c('0x52')][_0x0d8c('0x5a')],'role':'agent'},'attributes':['id','name','fullname',_0x0d8c('0x6d'),_0x0d8c('0x6e')],'raw':!![]});}return null;})[_0x0d8c('0x1f')](function(_0x388bcb){if(!_0x388bcb)return null;_0x3e66be[_0x0d8c('0x25')][_0x0d8c('0x5c')]=_0x388bcb;return _0x3e66be;})[_0x0d8c('0x1f')](function(_0x3c52c2){if(_0x3c52c2){if(_0x2146c1[_0x0d8c('0x52')][_0x0d8c('0x6f')]){_0x3e66be[_0x0d8c('0x25')]['interface']=util[_0x0d8c('0x59')](_0x0d8c('0x70'),_0x2146c1[_0x0d8c('0x5b')][_0x0d8c('0x35')]);_0x3e66be[_0x0d8c('0x25')][_0x0d8c('0x71')]=_0x3e66be['channel'];_0x3e66be[_0x0d8c('0x25')][_0x0d8c('0x72')]=_0x3e66be[_0x0d8c('0x71')];_0x3e66be[_0x0d8c('0x25')][_0x0d8c('0x73')]=_0x0d8c('0x56');return respondWithRpcPromise('EventManager',_0x0d8c('0x74'),{'event':_0x0d8c('0x75'),'message':_['merge'](_0x3e66be[_0x0d8c('0x25')],JSON[_0x0d8c('0x76')](_0x3e66be[_0x0d8c('0x62')]['formData']))},client9002)[_0x0d8c('0x1f')](function(){return _0x3e66be;});}return _0x3e66be;}return null;})[_0x0d8c('0x1f')](respondWithResult(_0x1ef570,null))['catch'](handleError(_0x1ef570,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x0d8c('0x31')]=function(_0x341872,_0x1e4833,_0x2a3c89){var _0x5da4ae={'agent':{},'channel':_0x0d8c('0x57')};if(_0x341872[_0x0d8c('0x52')]['id']){delete _0x341872[_0x0d8c('0x52')]['id'];}_0x341872[_0x0d8c('0x52')][_0x0d8c('0x5a')]=_0x341872['body'][_0x0d8c('0x5a')]||_0x341872['user']['id'];_0x5da4ae[_0x0d8c('0x5c')]['id']=_0x341872[_0x0d8c('0x52')][_0x0d8c('0x5a')];return db[_0x0d8c('0x39')][_0x0d8c('0x53')]({'where':{'id':_0x341872[_0x0d8c('0x4f')]['id'],'UserId':null}})[_0x0d8c('0x1f')](handleEntityNotFound(_0x1e4833,null))[_0x0d8c('0x1f')](function(_0x3cfd07){if(_0x3cfd07){_0x5da4ae[_0x0d8c('0x25')]=_0x3cfd07['get']({'plain':!![]});return db[_0x0d8c('0x5e')][_0x0d8c('0x53')]({'where':{'id':_0x3cfd07['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1e4833,null))[_0x0d8c('0x1f')](function(_0x2564fe){if(_0x2564fe){_0x5da4ae[_0x0d8c('0x62')]=_0x2564fe['get']({'plain':!![]});interaction_log[_0x0d8c('0x20')](_0x0d8c('0x77'),_0x341872[_0x0d8c('0x5b')]['id'],_0x341872[_0x0d8c('0x5b')][_0x0d8c('0x35')],_0x341872['user'][_0x0d8c('0x64')],_0x5da4ae[_0x0d8c('0x62')]['id'],_0x341872['body']?JSON[_0x0d8c('0x22')](_0x341872['body']):_0x0d8c('0x65'));return respondWithRpcPromise(_0x0d8c('0x78'),_0x0d8c('0x79'),_0x5da4ae);}return null;})[_0x0d8c('0x1f')](function(_0x262893){var _0x4b9217=_0x0d8c('0x67')+_0x262893[_0x0d8c('0x25')]['ContactId'];return db[_0x0d8c('0x7a')]['query'](_0x4b9217,{'type':db[_0x0d8c('0x69')][_0x0d8c('0x6a')][_0x0d8c('0x6b')],'raw':!![]})['then'](function(_0x11fd72){return _0x11fd72;});})['then'](function(_0x3e4c97){if(_0x3e4c97){_0x5da4ae[_0x0d8c('0x25')][_0x0d8c('0x6c')]=_0x3e4c97[0x0];if(!_0x341872['body']['UserId'])return;return db['User'][_0x0d8c('0x53')]({'where':{'id':_0x341872['body']['UserId'],'role':_0x0d8c('0x5c')},'attributes':['id',_0x0d8c('0x35'),_0x0d8c('0x7b'),_0x0d8c('0x6d'),_0x0d8c('0x6e')],'raw':!![]});}return null;})[_0x0d8c('0x1f')](function(_0x40b4c5){if(!_0x40b4c5)return null;_0x5da4ae[_0x0d8c('0x25')][_0x0d8c('0x5c')]=_0x40b4c5;return _0x5da4ae;})[_0x0d8c('0x1f')](function(_0x36d79e){if(_0x36d79e){_0x36d79e[_0x0d8c('0x25')][_0x0d8c('0x7c')]=util['format'](_0x0d8c('0x70'),_0x341872[_0x0d8c('0x5b')][_0x0d8c('0x35')]);_0x36d79e[_0x0d8c('0x25')][_0x0d8c('0x71')]=_0x5da4ae[_0x0d8c('0x71')];_0x36d79e[_0x0d8c('0x25')][_0x0d8c('0x72')]=_0x5da4ae[_0x0d8c('0x71')];_0x36d79e[_0x0d8c('0x25')][_0x0d8c('0x73')]=_0x0d8c('0x31');respondWithRpcPromise(_0x0d8c('0x74'),_0x0d8c('0x74'),{'event':'rejectmessage','message':_['merge'](_0x5da4ae[_0x0d8c('0x25')],JSON[_0x0d8c('0x76')](_0x5da4ae['interaction']['formData']))},client9002);return _0x5da4ae;}return null;})[_0x0d8c('0x1f')](respondWithResult(_0x1e4833,null))[_0x0d8c('0x27')](handleError(_0x1e4833,null));};
\ No newline at end of file
+var _0xf5cd=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','update','end','send','index','map','ChatMessage','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','destroy','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','fullname','email','internal','interface','SIP/%s','name','channel','EventManager','acceptmessage','parse','formData','chat-interactions','ChatInteractionId','interaction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','motionChannel','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x31c1af,_0x35051d){var _0x10b974=function(_0x3eaf34){while(--_0x3eaf34){_0x31c1af['push'](_0x31c1af['shift']());}};_0x10b974(++_0x35051d);}(_0xf5cd,0xf5));var _0xdf5c=function(_0x5ce5d6,_0x294bef){_0x5ce5d6=_0x5ce5d6-0x0;var _0x1ae010=_0xf5cd[_0x5ce5d6];return _0x1ae010;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf5c('0x0'));var zipdir=require(_0xdf5c('0x1'));var jsonpatch=require(_0xdf5c('0x2'));var rp=require(_0xdf5c('0x3'));var moment=require(_0xdf5c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf5c('0x5'));var util=require(_0xdf5c('0x6'));var path=require('path');var sox=require(_0xdf5c('0x7'));var csv=require('to-csv');var ejs=require(_0xdf5c('0x8'));var fs=require('fs');var fs_extra=require(_0xdf5c('0x9'));var _=require(_0xdf5c('0xa'));var squel=require('squel');var crypto=require(_0xdf5c('0xb'));var jsforce=require(_0xdf5c('0xc'));var deskjs=require(_0xdf5c('0xd'));var toCsv=require(_0xdf5c('0xe'));var querystring=require(_0xdf5c('0xf'));var Papa=require(_0xdf5c('0x10'));var Redis=require(_0xdf5c('0x11'));var authService=require(_0xdf5c('0x12'));var qs=require(_0xdf5c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf5c('0x14'));var logger=require(_0xdf5c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xdf5c('0x16'));var licenseUtil=require(_0xdf5c('0x17'));var db=require(_0xdf5c('0x18'))['db'];config[_0xdf5c('0x19')]=_['defaults'](config[_0xdf5c('0x19')],{'host':_0xdf5c('0x1a'),'port':0x18eb});var socket=require(_0xdf5c('0x1b'))(new Redis(config[_0xdf5c('0x19')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xdf5c('0x1c')][_0xdf5c('0x1d')]({'port':0x232c});var client9002=jayson[_0xdf5c('0x1c')][_0xdf5c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x58d52b,_0x2c6101,_0x2d5d79,_0x24247d){return new BPromise(function(_0x338818,_0x316a3f){var _0x2d9471=_0x24247d||client;return _0x2d9471[_0xdf5c('0x1e')](_0x58d52b,_0x2d5d79)[_0xdf5c('0x1f')](function(_0x2f58e1){logger['info'](_0xdf5c('0x20'),_0x2c6101,_0xdf5c('0x21'));logger[_0xdf5c('0x22')](_0xdf5c('0x23'),_0x2c6101,'request\x20sent',JSON[_0xdf5c('0x24')](_0x2f58e1));if(_0x2f58e1[_0xdf5c('0x25')]){if(_0x2f58e1[_0xdf5c('0x25')]['code']===0x1f4){logger[_0xdf5c('0x25')]('ChatMessage,\x20%s,\x20%s',_0x2c6101,_0x2f58e1[_0xdf5c('0x25')][_0xdf5c('0x26')]);return _0x316a3f(_0x2f58e1['error']['message']);}logger['error'](_0xdf5c('0x20'),_0x2c6101,_0x2f58e1[_0xdf5c('0x25')][_0xdf5c('0x26')]);return _0x338818(_0x2f58e1['error'][_0xdf5c('0x26')]);}else{logger[_0xdf5c('0x27')](_0xdf5c('0x20'),_0x2c6101,_0xdf5c('0x21'));_0x338818(_0x2f58e1[_0xdf5c('0x28')][_0xdf5c('0x26')]);}})['catch'](function(_0x5ef559){logger['error'](_0xdf5c('0x20'),_0x2c6101,_0x5ef559);_0x316a3f(_0x5ef559);});});}function respondWithStatusCode(_0x926e13,_0x4dd24b){_0x4dd24b=_0x4dd24b||0xcc;return function(_0xe7f220){if(_0xe7f220){return _0x926e13[_0xdf5c('0x29')](_0x4dd24b);}return _0x926e13[_0xdf5c('0x2a')](_0x4dd24b)['end']();};}function respondWithResult(_0x4672fb,_0x5424fa){_0x5424fa=_0x5424fa||0xc8;return function(_0x2ea18b){if(_0x2ea18b){return _0x4672fb[_0xdf5c('0x2a')](_0x5424fa)[_0xdf5c('0x2b')](_0x2ea18b);}};}function respondWithFilteredResult(_0x1de4b7,_0x3f0a98){return function(_0x413cbe){if(_0x413cbe){var _0x2781b7=typeof _0x3f0a98[_0xdf5c('0x2c')]==='undefined'&&typeof _0x3f0a98['limit']===_0xdf5c('0x2d');var _0x15ceef=_0x413cbe['count'];var _0x218b47=_0x2781b7?0x0:_0x3f0a98[_0xdf5c('0x2c')];var _0x2ddfbb=_0x2781b7?_0x413cbe[_0xdf5c('0x2e')]:_0x3f0a98[_0xdf5c('0x2c')]+_0x3f0a98[_0xdf5c('0x2f')];var _0x17c658;if(_0x2ddfbb>=_0x15ceef){_0x2ddfbb=_0x15ceef;_0x17c658=0xc8;}else{_0x17c658=0xce;}_0x1de4b7[_0xdf5c('0x2a')](_0x17c658);return _0x1de4b7[_0xdf5c('0x30')]('Content-Range',_0x218b47+'-'+_0x2ddfbb+'/'+_0x15ceef)[_0xdf5c('0x2b')](_0x413cbe);}return null;};}function patchUpdates(_0x32970f){return function(_0x591927){try{jsonpatch[_0xdf5c('0x31')](_0x591927,_0x32970f,!![]);}catch(_0x56d96c){return BPromise[_0xdf5c('0x32')](_0x56d96c);}return _0x591927['save']();};}function saveUpdates(_0x14bd03,_0xbde3d0){return function(_0x5e54f0){if(_0x5e54f0){return _0x5e54f0[_0xdf5c('0x33')](_0x14bd03)[_0xdf5c('0x1f')](function(_0x19b9a2){return _0x19b9a2;});}return null;};}function removeEntity(_0x5033c0,_0x1c5f46){return function(_0x3b6053){if(_0x3b6053){return _0x3b6053['destroy']()[_0xdf5c('0x1f')](function(){_0x5033c0[_0xdf5c('0x2a')](0xcc)[_0xdf5c('0x34')]();});}};}function handleEntityNotFound(_0x2c9c6a,_0x509d63){return function(_0x1de5c1){if(!_0x1de5c1){_0x2c9c6a[_0xdf5c('0x29')](0x194);}return _0x1de5c1;};}function handleError(_0x508654,_0xe7e9b9){_0xe7e9b9=_0xe7e9b9||0x1f4;return function(_0x2c6f54){logger['error'](_0x2c6f54['stack']);if(_0x2c6f54['name']){delete _0x2c6f54['name'];}_0x508654[_0xdf5c('0x2a')](_0xe7e9b9)[_0xdf5c('0x35')](_0x2c6f54);};}exports[_0xdf5c('0x36')]=function(_0x201cad,_0x18d6db){var _0x115c55={},_0x35f60d={},_0x399243={'count':0x0,'rows':[]};var _0x709921=_[_0xdf5c('0x37')](db[_0xdf5c('0x38')][_0xdf5c('0x39')],function(_0x45a427){return{'name':_0x45a427['fieldName'],'type':_0x45a427[_0xdf5c('0x3a')][_0xdf5c('0x3b')]};});_0x35f60d['model']=_[_0xdf5c('0x37')](_0x709921,'name');_0x35f60d[_0xdf5c('0x3c')]=_[_0xdf5c('0x3d')](_0x201cad[_0xdf5c('0x3c')]);_0x35f60d[_0xdf5c('0x3e')]=_[_0xdf5c('0x3f')](_0x35f60d[_0xdf5c('0x40')],_0x35f60d[_0xdf5c('0x3c')]);_0x115c55[_0xdf5c('0x41')]=_[_0xdf5c('0x3f')](_0x35f60d[_0xdf5c('0x40')],qs[_0xdf5c('0x42')](_0x201cad[_0xdf5c('0x3c')][_0xdf5c('0x42')]));_0x115c55[_0xdf5c('0x41')]=_0x115c55[_0xdf5c('0x41')]['length']?_0x115c55[_0xdf5c('0x41')]:_0x35f60d[_0xdf5c('0x40')];if(!_0x201cad['query']['hasOwnProperty'](_0xdf5c('0x43'))){_0x115c55[_0xdf5c('0x2f')]=qs[_0xdf5c('0x2f')](_0x201cad['query'][_0xdf5c('0x2f')]);_0x115c55[_0xdf5c('0x2c')]=qs['offset'](_0x201cad[_0xdf5c('0x3c')]['offset']);}_0x115c55[_0xdf5c('0x44')]=qs[_0xdf5c('0x45')](_0x201cad[_0xdf5c('0x3c')][_0xdf5c('0x45')]);_0x115c55[_0xdf5c('0x46')]=qs[_0xdf5c('0x3e')](_[_0xdf5c('0x47')](_0x201cad[_0xdf5c('0x3c')],_0x35f60d[_0xdf5c('0x3e')]),_0x709921);if(_0x201cad[_0xdf5c('0x3c')][_0xdf5c('0x48')]){_0x115c55[_0xdf5c('0x46')]=_[_0xdf5c('0x49')](_0x115c55[_0xdf5c('0x46')],{'$or':_[_0xdf5c('0x37')](_0x709921,function(_0x3a17f4){if(_0x3a17f4[_0xdf5c('0x3a')]!=='VIRTUAL'){var _0x56e970={};_0x56e970[_0x3a17f4['name']]={'$like':'%'+_0x201cad[_0xdf5c('0x3c')][_0xdf5c('0x48')]+'%'};return _0x56e970;}})});}_0x115c55=_['merge']({},_0x115c55,_0x201cad['options']);var _0x86211b={'where':_0x115c55[_0xdf5c('0x46')]};return db[_0xdf5c('0x38')][_0xdf5c('0x2e')](_0x86211b)['then'](function(_0x55e954){_0x399243['count']=_0x55e954;if(_0x201cad[_0xdf5c('0x3c')][_0xdf5c('0x4a')]){_0x115c55[_0xdf5c('0x4b')]=[{'all':!![]}];}return db[_0xdf5c('0x38')][_0xdf5c('0x4c')](_0x115c55);})[_0xdf5c('0x1f')](function(_0x2ad430){_0x399243[_0xdf5c('0x4d')]=_0x2ad430;return _0x399243;})['then'](respondWithFilteredResult(_0x18d6db,_0x115c55))[_0xdf5c('0x4e')](handleError(_0x18d6db,null));};exports[_0xdf5c('0x4f')]=function(_0x46034c,_0x5ad0f4){var _0x434e1f={'raw':!![],'where':{'id':_0x46034c[_0xdf5c('0x50')]['id']}},_0x1047c6={};_0x1047c6['model']=_[_0xdf5c('0x3d')](db[_0xdf5c('0x38')][_0xdf5c('0x39')]);_0x1047c6['query']=_[_0xdf5c('0x3d')](_0x46034c['query']);_0x1047c6[_0xdf5c('0x3e')]=_[_0xdf5c('0x3f')](_0x1047c6[_0xdf5c('0x40')],_0x1047c6[_0xdf5c('0x3c')]);_0x434e1f[_0xdf5c('0x41')]=_[_0xdf5c('0x3f')](_0x1047c6['model'],qs[_0xdf5c('0x42')](_0x46034c[_0xdf5c('0x3c')][_0xdf5c('0x42')]));_0x434e1f[_0xdf5c('0x41')]=_0x434e1f[_0xdf5c('0x41')][_0xdf5c('0x51')]?_0x434e1f[_0xdf5c('0x41')]:_0x1047c6[_0xdf5c('0x40')];if(_0x46034c[_0xdf5c('0x3c')][_0xdf5c('0x4a')]){_0x434e1f['include']=[{'all':!![]}];}_0x434e1f=_[_0xdf5c('0x49')]({},_0x434e1f,_0x46034c[_0xdf5c('0x52')]);return db['ChatMessage'][_0xdf5c('0x53')](_0x434e1f)[_0xdf5c('0x1f')](handleEntityNotFound(_0x5ad0f4,null))['then'](respondWithResult(_0x5ad0f4,null))[_0xdf5c('0x4e')](handleError(_0x5ad0f4,null));};exports['create']=function(_0x37ddb8,_0x2ec1b2){return db[_0xdf5c('0x38')]['create'](_0x37ddb8[_0xdf5c('0x54')],{})[_0xdf5c('0x1f')](respondWithResult(_0x2ec1b2,0xc9))[_0xdf5c('0x4e')](handleError(_0x2ec1b2,null));};exports[_0xdf5c('0x33')]=function(_0x34afe7,_0x59a10f){if(_0x34afe7[_0xdf5c('0x54')]['id']){delete _0x34afe7[_0xdf5c('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x34afe7[_0xdf5c('0x50')]['id']}})['then'](handleEntityNotFound(_0x59a10f,null))[_0xdf5c('0x1f')](saveUpdates(_0x34afe7[_0xdf5c('0x54')],null))[_0xdf5c('0x1f')](respondWithResult(_0x59a10f,null))[_0xdf5c('0x4e')](handleError(_0x59a10f,null));};exports[_0xdf5c('0x55')]=function(_0x5222b3,_0x59df16){return db[_0xdf5c('0x38')][_0xdf5c('0x53')]({'where':{'id':_0x5222b3['params']['id']}})[_0xdf5c('0x1f')](handleEntityNotFound(_0x59df16,null))[_0xdf5c('0x1f')](removeEntity(_0x59df16,null))['catch'](handleError(_0x59df16,null));};exports[_0xdf5c('0x56')]=function(_0x1c7e16,_0xd3b694){return db['ChatMessage'][_0xdf5c('0x56')]()[_0xdf5c('0x1f')](respondWithResult(_0xd3b694,null))[_0xdf5c('0x4e')](handleError(_0xd3b694,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xdf5c('0x57')]=function(_0x41ad54,_0xbd1f43,_0x1f34a9){var _0xedc47e={'agent':{},'channel':_0xdf5c('0x58')};if(_0x41ad54[_0xdf5c('0x54')]['id']){delete _0x41ad54['body']['id'];}_0x41ad54[_0xdf5c('0x54')][_0xdf5c('0x59')]=!![];_0x41ad54[_0xdf5c('0x54')][_0xdf5c('0x5a')]=moment()[_0xdf5c('0x5b')](_0xdf5c('0x5c'));_0x41ad54[_0xdf5c('0x54')][_0xdf5c('0x5d')]=_0x41ad54['body']['UserId']||_0x41ad54[_0xdf5c('0x5e')]['id'];_0xedc47e[_0xdf5c('0x5f')]['id']=_0x41ad54['body'][_0xdf5c('0x5d')];return db[_0xdf5c('0x38')][_0xdf5c('0x53')]({'where':{'id':_0x41ad54[_0xdf5c('0x50')]['id'],'UserId':null}})[_0xdf5c('0x1f')](handleEntityNotFound(_0xbd1f43,null))[_0xdf5c('0x1f')](saveUpdates(_0x41ad54[_0xdf5c('0x54')],null))[_0xdf5c('0x1f')](function(_0x96c4b3){if(_0x96c4b3){_0xedc47e[_0xdf5c('0x26')]=_0x96c4b3[_0xdf5c('0x60')]({'plain':!![]});return db[_0xdf5c('0x61')][_0xdf5c('0x53')]({'where':{'id':_0x96c4b3['ChatInteractionId']}});}return null;})[_0xdf5c('0x1f')](handleEntityNotFound(_0xbd1f43,null))['then'](function(_0x4a3c8d){if(_0x4a3c8d){return _0x4a3c8d[_0xdf5c('0x33')]({'UserId':_0x41ad54[_0xdf5c('0x54')][_0xdf5c('0x5d')],'read1stAt':_[_0xdf5c('0x62')](_0x4a3c8d[_0xdf5c('0x63')])?moment()['format'](_0xdf5c('0x5c')):undefined});}return null;})[_0xdf5c('0x1f')](function(_0x265e8f){if(_0x265e8f){_0xedc47e['interaction']=_0x265e8f['get']({'plain':!![]});interaction_log[_0xdf5c('0x27')](_0xdf5c('0x64'),_0x41ad54['user']['id'],_0x41ad54[_0xdf5c('0x5e')]['name'],_0x41ad54[_0xdf5c('0x5e')][_0xdf5c('0x65')],_0xedc47e['interaction']['id'],_0x41ad54[_0xdf5c('0x54')]?JSON[_0xdf5c('0x24')](_0x41ad54['body']):'null');return respondWithRpcPromise(_0xdf5c('0x66'),'acceptMessage',_0xedc47e);}return null;})[_0xdf5c('0x1f')](function(_0x3f53a6){var _0x37dde2=_0xdf5c('0x67')+_0x3f53a6[_0xdf5c('0x26')][_0xdf5c('0x68')];return db['sequelize']['query'](_0x37dde2,{'type':db[_0xdf5c('0x69')][_0xdf5c('0x6a')]['SELECT'],'raw':!![]})[_0xdf5c('0x1f')](function(_0x149705){return _0x149705;});})['then'](function(_0x4b7bbd){if(_0x4b7bbd){_0xedc47e[_0xdf5c('0x26')][_0xdf5c('0x6b')]=_0x4b7bbd[0x0];if(!_0x41ad54[_0xdf5c('0x54')]['UserId'])return;return db[_0xdf5c('0x6c')]['find']({'where':{'id':_0x41ad54[_0xdf5c('0x54')][_0xdf5c('0x5d')],'role':_0xdf5c('0x5f')},'attributes':['id','name',_0xdf5c('0x6d'),_0xdf5c('0x6e'),_0xdf5c('0x6f')],'raw':!![]});}return null;})[_0xdf5c('0x1f')](function(_0x5b6bdf){if(!_0x5b6bdf)return null;_0xedc47e[_0xdf5c('0x26')][_0xdf5c('0x5f')]=_0x5b6bdf;return _0xedc47e;})[_0xdf5c('0x1f')](function(_0x3eb27a){if(_0x3eb27a){if(_0x41ad54[_0xdf5c('0x54')]['manual']){_0xedc47e[_0xdf5c('0x26')][_0xdf5c('0x70')]=util[_0xdf5c('0x5b')](_0xdf5c('0x71'),_0x41ad54[_0xdf5c('0x5e')][_0xdf5c('0x72')]);_0xedc47e[_0xdf5c('0x26')][_0xdf5c('0x73')]=_0xedc47e[_0xdf5c('0x73')];_0xedc47e['message']['motionChannel']=_0xedc47e[_0xdf5c('0x73')];_0xedc47e[_0xdf5c('0x26')]['event']=_0xdf5c('0x57');return respondWithRpcPromise(_0xdf5c('0x74'),_0xdf5c('0x74'),{'event':_0xdf5c('0x75'),'message':_['merge'](_0xedc47e[_0xdf5c('0x26')],JSON[_0xdf5c('0x76')](_0xedc47e['interaction'][_0xdf5c('0x77')]))},client9002)[_0xdf5c('0x1f')](function(){return _0xedc47e;});}return _0xedc47e;}return null;})['then'](respondWithResult(_0xbd1f43,null))[_0xdf5c('0x4e')](handleError(_0xbd1f43,null));};var interaction_log=require(_0xdf5c('0x15'))(_0xdf5c('0x78'));exports[_0xdf5c('0x32')]=function(_0x3bc0fb,_0x4c5f5e,_0x430631){var _0x5682d9={'agent':{},'channel':_0xdf5c('0x58')};if(_0x3bc0fb['body']['id']){delete _0x3bc0fb[_0xdf5c('0x54')]['id'];}_0x3bc0fb[_0xdf5c('0x54')][_0xdf5c('0x5d')]=_0x3bc0fb[_0xdf5c('0x54')][_0xdf5c('0x5d')]||_0x3bc0fb[_0xdf5c('0x5e')]['id'];_0x5682d9[_0xdf5c('0x5f')]['id']=_0x3bc0fb[_0xdf5c('0x54')][_0xdf5c('0x5d')];return db[_0xdf5c('0x38')][_0xdf5c('0x53')]({'where':{'id':_0x3bc0fb[_0xdf5c('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4c5f5e,null))[_0xdf5c('0x1f')](function(_0x2fd0a9){if(_0x2fd0a9){_0x5682d9[_0xdf5c('0x26')]=_0x2fd0a9[_0xdf5c('0x60')]({'plain':!![]});return db[_0xdf5c('0x61')]['find']({'where':{'id':_0x2fd0a9[_0xdf5c('0x79')]}});}return null;})[_0xdf5c('0x1f')](handleEntityNotFound(_0x4c5f5e,null))[_0xdf5c('0x1f')](function(_0x251049){if(_0x251049){_0x5682d9[_0xdf5c('0x7a')]=_0x251049[_0xdf5c('0x60')]({'plain':!![]});interaction_log[_0xdf5c('0x27')](_0xdf5c('0x7b'),_0x3bc0fb[_0xdf5c('0x5e')]['id'],_0x3bc0fb['user'][_0xdf5c('0x72')],_0x3bc0fb[_0xdf5c('0x5e')]['role'],_0x5682d9[_0xdf5c('0x7a')]['id'],_0x3bc0fb['body']?JSON['stringify'](_0x3bc0fb[_0xdf5c('0x54')]):'null');return respondWithRpcPromise(_0xdf5c('0x7c'),_0xdf5c('0x7d'),_0x5682d9);}return null;})['then'](function(_0x2630b4){var _0x19da34=_0xdf5c('0x67')+_0x2630b4[_0xdf5c('0x26')][_0xdf5c('0x68')];return db[_0xdf5c('0x7e')]['query'](_0x19da34,{'type':db[_0xdf5c('0x69')]['QueryTypes']['SELECT'],'raw':!![]})[_0xdf5c('0x1f')](function(_0x535f9e){return _0x535f9e;});})['then'](function(_0x22441a){if(_0x22441a){_0x5682d9[_0xdf5c('0x26')]['contact']=_0x22441a[0x0];if(!_0x3bc0fb[_0xdf5c('0x54')][_0xdf5c('0x5d')])return;return db[_0xdf5c('0x6c')][_0xdf5c('0x53')]({'where':{'id':_0x3bc0fb[_0xdf5c('0x54')]['UserId'],'role':_0xdf5c('0x5f')},'attributes':['id','name',_0xdf5c('0x6d'),_0xdf5c('0x6e'),_0xdf5c('0x6f')],'raw':!![]});}return null;})[_0xdf5c('0x1f')](function(_0x35b2f5){if(!_0x35b2f5)return null;_0x5682d9[_0xdf5c('0x26')][_0xdf5c('0x5f')]=_0x35b2f5;return _0x5682d9;})[_0xdf5c('0x1f')](function(_0x41260c){if(_0x41260c){_0x41260c[_0xdf5c('0x26')][_0xdf5c('0x70')]=util[_0xdf5c('0x5b')]('SIP/%s',_0x3bc0fb[_0xdf5c('0x5e')][_0xdf5c('0x72')]);_0x41260c[_0xdf5c('0x26')][_0xdf5c('0x73')]=_0x5682d9[_0xdf5c('0x73')];_0x41260c['message'][_0xdf5c('0x7f')]=_0x5682d9['channel'];_0x41260c[_0xdf5c('0x26')]['event']=_0xdf5c('0x32');respondWithRpcPromise(_0xdf5c('0x74'),_0xdf5c('0x74'),{'event':_0xdf5c('0x80'),'message':_['merge'](_0x5682d9[_0xdf5c('0x26')],JSON['parse'](_0x5682d9[_0xdf5c('0x7a')]['formData']))},client9002);return _0x5682d9;}return null;})[_0xdf5c('0x1f')](respondWithResult(_0x4c5f5e,null))[_0xdf5c('0x4e')](handleError(_0x4c5f5e,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index b8ad4f3..7f055da 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 _0x2c6a=['hook','exports','events','../../mysqldb','ChatMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x4b6420,_0x126201){var _0x37076f=function(_0x3ee471){while(--_0x3ee471){_0x4b6420['push'](_0x4b6420['shift']());}};_0x37076f(++_0x126201);}(_0x2c6a,0x1a6));var _0xa2c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c6a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xa2c6('0x0'));var ChatMessage=require(_0xa2c6('0x1'))['db'][_0xa2c6('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa2c6('0x3'),'afterUpdate':_0xa2c6('0x4'),'afterDestroy':_0xa2c6('0x5')};function emitEvent(_0x40f80a){return function(_0x1668bf,_0x25939c,_0x1b400f){ChatMessageEvents[_0xa2c6('0x6')](_0x40f80a+':'+_0x1668bf['id'],_0x1668bf);ChatMessageEvents['emit'](_0x40f80a,_0x1668bf);_0x1b400f(null);};}for(var e in events){if(events[_0xa2c6('0x7')](e)){var event=events[e];ChatMessage[_0xa2c6('0x8')](e,emitEvent(event));}}module[_0xa2c6('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xcd23=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x1a3e23,_0xce45e){var _0x5ee0d8=function(_0x4b932f){while(--_0x4b932f){_0x1a3e23['push'](_0x1a3e23['shift']());}};_0x5ee0d8(++_0xce45e);}(_0xcd23,0xf4));var _0x3cd2=function(_0x545dd1,_0x5d6d32){_0x545dd1=_0x545dd1-0x0;var _0xb9692b=_0xcd23[_0x545dd1];return _0xb9692b;};'use strict';var EventEmitter=require(_0x3cd2('0x0'));var ChatMessage=require(_0x3cd2('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3cd2('0x2')](0x0);var events={'afterCreate':_0x3cd2('0x3'),'afterUpdate':_0x3cd2('0x4'),'afterDestroy':_0x3cd2('0x5')};function emitEvent(_0x509114){return function(_0x363b40,_0x3a54a7,_0x4c6d2d){ChatMessageEvents[_0x3cd2('0x6')](_0x509114+':'+_0x363b40['id'],_0x363b40);ChatMessageEvents[_0x3cd2('0x6')](_0x509114,_0x363b40);_0x4c6d2d(null);};}for(var e in events){if(events[_0x3cd2('0x7')](e)){var event=events[e];ChatMessage[_0x3cd2('0x8')](e,emitEvent(event));}}module[_0x3cd2('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 9df1967..cff9f70 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 _0xc39c=['then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc39c,0x13a));var _0xcc39=function(_0x32c247,_0x41b343){_0x32c247=_0x32c247-0x0;var _0x1fae4a=_0xc39c[_0x32c247];return _0x1fae4a;};'use strict';var _=require('lodash');var util=require(_0xcc39('0x0'));var logger=require(_0xcc39('0x1'))('api');var moment=require(_0xcc39('0x2'));var BPromise=require(_0xcc39('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc39('0x4'));var rimraf=require(_0xcc39('0x5'));var config=require(_0xcc39('0x6'));var attributes=require(_0xcc39('0x7'));module['exports']=function(_0x1a4ef5,_0x56182e){return _0x1a4ef5[_0xcc39('0x8')](_0xcc39('0x9'),attributes,{'tableName':_0xcc39('0xa'),'paranoid':![],'indexes':[{'name':_0xcc39('0xb'),'fields':[_0xcc39('0xc')],'type':_0xcc39('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x172f86,_0x484d83,_0xc02a2d){var _0x10231e=_0x1a4ef5['models'];var _0x2fc0fc=_0x172f86['get']({'plain':!![]});if(_0x2fc0fc[_0xcc39('0xe')]['toLowerCase']()==='in'||_0x2fc0fc[_0xcc39('0xe')][_0xcc39('0xf')]()===_0xcc39('0x10')&&!_0x2fc0fc[_0xcc39('0x11')]&&!_[_0xcc39('0x12')](_0x2fc0fc['UserId'])){_0x10231e[_0xcc39('0x13')][_0xcc39('0x14')]({'where':{'id':_0x2fc0fc[_0xcc39('0x15')]}})[_0xcc39('0x16')](function(_0x3bdc9a){if(_0x3bdc9a){_0x3bdc9a[_0xcc39('0x17')]({'lastMsgAt':_0x2fc0fc[_0xcc39('0x18')],'lastMsgDirection':_0x2fc0fc[_0xcc39('0xe')][_0xcc39('0xf')]()});}})['catch'](function(_0x4cbb8f){console[_0xcc39('0x19')](_0x4cbb8f);});}_0xc02a2d();}},'charset':_0xcc39('0x1a'),'collate':_0xcc39('0x1b')});};
\ No newline at end of file
+var _0x0dec=['update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then'];(function(_0x6b488c,_0x1c8ff4){var _0x15b819=function(_0x4d876a){while(--_0x4d876a){_0x6b488c['push'](_0x6b488c['shift']());}};_0x15b819(++_0x1c8ff4);}(_0x0dec,0x11c));var _0xc0de=function(_0x44bbc8,_0x1d350f){_0x44bbc8=_0x44bbc8-0x0;var _0x3d814a=_0x0dec[_0x44bbc8];return _0x3d814a;};'use strict';var _=require(_0xc0de('0x0'));var util=require(_0xc0de('0x1'));var logger=require(_0xc0de('0x2'))(_0xc0de('0x3'));var moment=require('moment');var BPromise=require(_0xc0de('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc0de('0x5'));var config=require(_0xc0de('0x6'));var attributes=require(_0xc0de('0x7'));module[_0xc0de('0x8')]=function(_0xae49db,_0x194937){return _0xae49db[_0xc0de('0x9')](_0xc0de('0xa'),attributes,{'tableName':_0xc0de('0xb'),'paranoid':![],'indexes':[{'name':_0xc0de('0xc'),'fields':[_0xc0de('0xd')],'type':_0xc0de('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7fb69a,_0x46ed3f,_0x3a169a){var _0xd27e9f=_0xae49db[_0xc0de('0xf')];var _0x285146=_0x7fb69a[_0xc0de('0x10')]({'plain':!![]});if(_0x285146[_0xc0de('0x11')][_0xc0de('0x12')]()==='in'||_0x285146[_0xc0de('0x11')][_0xc0de('0x12')]()===_0xc0de('0x13')&&!_0x285146[_0xc0de('0x14')]&&!_['isNil'](_0x285146[_0xc0de('0x15')])){_0xd27e9f[_0xc0de('0x16')][_0xc0de('0x17')]({'where':{'id':_0x285146[_0xc0de('0x18')]}})[_0xc0de('0x19')](function(_0x7fae0c){if(_0x7fae0c){_0x7fae0c[_0xc0de('0x1a')]({'lastMsgAt':_0x285146[_0xc0de('0x1b')],'lastMsgDirection':_0x285146[_0xc0de('0x11')][_0xc0de('0x12')]()});}})[_0xc0de('0x1c')](function(_0x7f1e4d){console['error'](_0x7f1e4d);});}_0x3a169a();}},'charset':_0xc0de('0x1d'),'collate':_0xc0de('0x1e')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 35e7176..9eae1be 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 _0x8bcc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','CreateChatMessage','ChatMessage','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x4cd690,_0x4797cc){var _0x4a74a9=function(_0x4cbbc5){while(--_0x4cbbc5){_0x4cd690['push'](_0x4cd690['shift']());}};_0x4a74a9(++_0x4797cc);}(_0x8bcc,0xaa));var _0xc8bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bcc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8bc('0x0'));var util=require(_0xc8bc('0x1'));var moment=require(_0xc8bc('0x2'));var BPromise=require(_0xc8bc('0x3'));var rs=require(_0xc8bc('0x4'));var fs=require('fs');var Redis=require(_0xc8bc('0x5'));var db=require(_0xc8bc('0x6'))['db'];var utils=require(_0xc8bc('0x7'));var logger=require(_0xc8bc('0x8'))(_0xc8bc('0x9'));var config=require(_0xc8bc('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc8bc('0xb')][_0xc8bc('0xc')]({'port':0x232a});config[_0xc8bc('0xd')]=_[_0xc8bc('0xe')](config[_0xc8bc('0xd')],{'host':_0xc8bc('0xf'),'port':0x18eb});var socket=require(_0xc8bc('0x10'))(new Redis(config[_0xc8bc('0xd')]));require('./chatMessage.socket')[_0xc8bc('0x11')](socket);function respondWithRpcPromise(_0x1dec81,_0x5e1fbb,_0x380322){return new BPromise(function(_0x30b3b1,_0x5f29e8){return client[_0xc8bc('0x12')](_0x1dec81,_0x380322)[_0xc8bc('0x13')](function(_0x2317de){logger['info'](_0xc8bc('0x14'),_0x5e1fbb,'request\x20sent');logger[_0xc8bc('0x15')](_0xc8bc('0x16'),_0x5e1fbb,'request\x20sent',JSON['stringify'](_0x2317de));if(_0x2317de[_0xc8bc('0x17')]){if(_0x2317de['error']['code']===0x1f4){logger[_0xc8bc('0x17')]('ChatMessage,\x20%s,\x20%s',_0x5e1fbb,_0x2317de['error'][_0xc8bc('0x18')]);return _0x5f29e8(_0x2317de[_0xc8bc('0x17')]['message']);}logger[_0xc8bc('0x17')](_0xc8bc('0x14'),_0x5e1fbb,_0x2317de['error'][_0xc8bc('0x18')]);return _0x30b3b1(_0x2317de[_0xc8bc('0x17')][_0xc8bc('0x18')]);}else{logger[_0xc8bc('0x19')](_0xc8bc('0x14'),_0x5e1fbb,_0xc8bc('0x1a'));_0x30b3b1(_0x2317de[_0xc8bc('0x1b')][_0xc8bc('0x18')]);}})[_0xc8bc('0x1c')](function(_0x2435ff){logger[_0xc8bc('0x17')](_0xc8bc('0x14'),_0x5e1fbb,_0x2435ff);_0x5f29e8(_0x2435ff);});});}exports[_0xc8bc('0x1d')]=function(_0xf4a84c){var _0x3a34d4=this;return new Promise(function(_0x391f99,_0x223bff){return db[_0xc8bc('0x1e')][_0xc8bc('0x1f')](_0xf4a84c['body'],{'raw':_0xf4a84c[_0xc8bc('0x20')]?_0xf4a84c[_0xc8bc('0x20')][_0xc8bc('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x4be65f){logger[_0xc8bc('0x19')](_0xc8bc('0x1d'),_0xf4a84c);logger['debug'](_0xc8bc('0x1d'),_0xf4a84c,JSON[_0xc8bc('0x22')](_0x4be65f));_0x391f99(_0x4be65f);})[_0xc8bc('0x1c')](function(_0x468628){logger[_0xc8bc('0x17')](_0xc8bc('0x1d'),_0x468628[_0xc8bc('0x18')],_0xf4a84c);_0x223bff(_0x3a34d4[_0xc8bc('0x17')](0x1f4,_0x468628['message']));});});};
\ No newline at end of file
+var _0x4371=['ChatMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','./chatMessage.socket','register','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage'];(function(_0x2ef141,_0x3be740){var _0x47c2c0=function(_0x3f0a6a){while(--_0x3f0a6a){_0x2ef141['push'](_0x2ef141['shift']());}};_0x47c2c0(++_0x3be740);}(_0x4371,0x192));var _0x1437=function(_0x4dd4a1,_0x5ca922){_0x4dd4a1=_0x4dd4a1-0x0;var _0x168d0f=_0x4371[_0x4dd4a1];return _0x168d0f;};'use strict';var _=require(_0x1437('0x0'));var util=require(_0x1437('0x1'));var moment=require(_0x1437('0x2'));var BPromise=require(_0x1437('0x3'));var rs=require(_0x1437('0x4'));var fs=require('fs');var Redis=require(_0x1437('0x5'));var db=require(_0x1437('0x6'))['db'];var utils=require(_0x1437('0x7'));var logger=require(_0x1437('0x8'))(_0x1437('0x9'));var config=require('../../config/environment');var jayson=require(_0x1437('0xa'));var client=jayson['client'][_0x1437('0xb')]({'port':0x232a});config['redis']=_[_0x1437('0xc')](config[_0x1437('0xd')],{'host':_0x1437('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1437('0xd')]));require(_0x1437('0xf'))[_0x1437('0x10')](socket);function respondWithRpcPromise(_0x2d7aaf,_0x3d63a7,_0x112c80){return new BPromise(function(_0x1bf039,_0x500c90){return client[_0x1437('0x11')](_0x2d7aaf,_0x112c80)[_0x1437('0x12')](function(_0x144db4){logger[_0x1437('0x13')]('ChatMessage,\x20%s,\x20%s',_0x3d63a7,'request\x20sent');logger[_0x1437('0x14')](_0x1437('0x15'),_0x3d63a7,_0x1437('0x16'),JSON[_0x1437('0x17')](_0x144db4));if(_0x144db4[_0x1437('0x18')]){if(_0x144db4['error'][_0x1437('0x19')]===0x1f4){logger[_0x1437('0x18')](_0x1437('0x1a'),_0x3d63a7,_0x144db4[_0x1437('0x18')][_0x1437('0x1b')]);return _0x500c90(_0x144db4['error'][_0x1437('0x1b')]);}logger[_0x1437('0x18')](_0x1437('0x1a'),_0x3d63a7,_0x144db4['error'][_0x1437('0x1b')]);return _0x1bf039(_0x144db4[_0x1437('0x18')][_0x1437('0x1b')]);}else{logger['info'](_0x1437('0x1a'),_0x3d63a7,_0x1437('0x16'));_0x1bf039(_0x144db4[_0x1437('0x1c')][_0x1437('0x1b')]);}})['catch'](function(_0x1a1129){logger[_0x1437('0x18')]('ChatMessage,\x20%s,\x20%s',_0x3d63a7,_0x1a1129);_0x500c90(_0x1a1129);});});}exports[_0x1437('0x1d')]=function(_0x460681){var _0x629873=this;return new Promise(function(_0x3d0998,_0x31306c){return db[_0x1437('0x1e')][_0x1437('0x1f')](_0x460681[_0x1437('0x20')],{'raw':_0x460681[_0x1437('0x21')]?_0x460681[_0x1437('0x21')][_0x1437('0x22')]===undefined?!![]:![]:!![]})[_0x1437('0x12')](function(_0x18d14f){logger['info'](_0x1437('0x1d'),_0x460681);logger[_0x1437('0x14')](_0x1437('0x1d'),_0x460681,JSON[_0x1437('0x17')](_0x18d14f));_0x3d0998(_0x18d14f);})[_0x1437('0x23')](function(_0x940356){logger[_0x1437('0x18')](_0x1437('0x1d'),_0x940356['message'],_0x460681);_0x31306c(_0x629873['error'](0x1f4,_0x940356[_0x1437('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 9a1bfe4..7fede85 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 _0x4491=['remove','emit','register','length','chatMessage:','./chatMessage.events'];(function(_0x382719,_0x91d5cb){var _0x48cff9=function(_0xf539c3){while(--_0xf539c3){_0x382719['push'](_0x382719['shift']());}};_0x48cff9(++_0x91d5cb);}(_0x4491,0x1bb));var _0x1449=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0x4491[_0x506172];return _0x2723c0;};'use strict';var ChatMessageEvents=require(_0x1449('0x0'));var events=['save',_0x1449('0x1'),'update'];function createListener(_0x4273ee,_0x176880){return function(_0x45474c){_0x176880[_0x1449('0x2')](_0x4273ee,_0x45474c);};}function removeListener(_0x1ff47f,_0x1b2870){return function(){ChatMessageEvents['removeListener'](_0x1ff47f,_0x1b2870);};}exports[_0x1449('0x3')]=function(_0x557482){for(var _0x1d45eb=0x0,_0x5dfe4c=events[_0x1449('0x4')];_0x1d45eb<_0x5dfe4c;_0x1d45eb++){var _0x2f4189=events[_0x1d45eb];var _0x10e119=createListener(_0x1449('0x5')+_0x2f4189,_0x557482);ChatMessageEvents['on'](_0x2f4189,_0x10e119);}};
\ No newline at end of file
+var _0x3baf=['save','remove','update','emit','removeListener','register','chatMessage:','./chatMessage.events'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x3baf,0xf7));var _0xf3ba=function(_0x5193cd,_0xcd459f){_0x5193cd=_0x5193cd-0x0;var _0x264954=_0x3baf[_0x5193cd];return _0x264954;};'use strict';var ChatMessageEvents=require(_0xf3ba('0x0'));var events=[_0xf3ba('0x1'),_0xf3ba('0x2'),_0xf3ba('0x3')];function createListener(_0x29bbc2,_0x22f9c0){return function(_0xfce22){_0x22f9c0[_0xf3ba('0x4')](_0x29bbc2,_0xfce22);};}function removeListener(_0x3e6058,_0x1ae6e6){return function(){ChatMessageEvents[_0xf3ba('0x5')](_0x3e6058,_0x1ae6e6);};}exports[_0xf3ba('0x6')]=function(_0x475268){for(var _0x2e6df2=0x0,_0x1284b7=events['length'];_0x2e6df2<_0x1284b7;_0x2e6df2++){var _0x579135=events[_0x2e6df2];var _0x5ab058=createListener(_0xf3ba('0x7')+_0x579135,_0x475268);ChatMessageEvents['on'](_0x579135,_0x5ab058);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 4248ceb..1e9658d 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 _0x3394=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','chat','chatmessage:create','create','put','accept','/:id/reject','reject','delete','destroy'];(function(_0x383494,_0x2070d2){var _0x2485e5=function(_0x37c52e){while(--_0x37c52e){_0x383494['push'](_0x383494['shift']());}};_0x2485e5(++_0x2070d2);}(_0x3394,0x1a1));var _0x4339=function(_0x5b3608,_0x1d1559){_0x5b3608=_0x5b3608-0x0;var _0xa7d861=_0x3394[_0x5b3608];return _0xa7d861;};'use strict';var multer=require(_0x4339('0x0'));var util=require(_0x4339('0x1'));var path=require('path');var timeout=require(_0x4339('0x2'));var express=require(_0x4339('0x3'));var router=express[_0x4339('0x4')]();var fs_extra=require(_0x4339('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4339('0x6'));var config=require(_0x4339('0x7'));var controller=require('./chatMessage.controller');router[_0x4339('0x8')]('/',auth['isAuthenticated'](),controller[_0x4339('0x9')]);router[_0x4339('0x8')](_0x4339('0xa'),auth[_0x4339('0xb')](),controller[_0x4339('0xc')]);router[_0x4339('0x8')](_0x4339('0xd'),auth[_0x4339('0xb')](),controller[_0x4339('0xe')]);router[_0x4339('0xf')]('/',auth[_0x4339('0xb')](),interaction['tracked'](_0x4339('0x10'),_0x4339('0x11')),controller[_0x4339('0x12')]);router[_0x4339('0x13')](_0x4339('0xd'),controller['update']);router[_0x4339('0x13')]('/:id/accept',auth[_0x4339('0xb')](),controller[_0x4339('0x14')]);router[_0x4339('0x13')](_0x4339('0x15'),auth[_0x4339('0xb')](),controller[_0x4339('0x16')]);router[_0x4339('0x17')](_0x4339('0xd'),auth[_0x4339('0xb')](),controller[_0x4339('0x18')]);module[_0x4339('0x19')]=router;
\ No newline at end of file
+var _0x078f=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','tracked','chatmessage:create','create','put','accept','/:id/reject','reject','delete','destroy','exports','util'];(function(_0x23d47a,_0x5550e8){var _0x22d3c0=function(_0x4a550f){while(--_0x4a550f){_0x23d47a['push'](_0x23d47a['shift']());}};_0x22d3c0(++_0x5550e8);}(_0x078f,0xb5));var _0xf078=function(_0x522ae8,_0x3b637e){_0x522ae8=_0x522ae8-0x0;var _0x3189b9=_0x078f[_0x522ae8];return _0x3189b9;};'use strict';var multer=require('multer');var util=require(_0xf078('0x0'));var path=require(_0xf078('0x1'));var timeout=require(_0xf078('0x2'));var express=require('express');var router=express[_0xf078('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf078('0x4'));var interaction=require(_0xf078('0x5'));var config=require(_0xf078('0x6'));var controller=require(_0xf078('0x7'));router[_0xf078('0x8')]('/',auth['isAuthenticated'](),controller[_0xf078('0x9')]);router['get'](_0xf078('0xa'),auth['isAuthenticated'](),controller[_0xf078('0xb')]);router[_0xf078('0x8')](_0xf078('0xc'),auth[_0xf078('0xd')](),controller[_0xf078('0xe')]);router[_0xf078('0xf')]('/',auth['isAuthenticated'](),interaction[_0xf078('0x10')]('chat',_0xf078('0x11')),controller[_0xf078('0x12')]);router[_0xf078('0x13')](_0xf078('0xc'),controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xf078('0x14')]);router[_0xf078('0x13')](_0xf078('0x15'),auth['isAuthenticated'](),controller[_0xf078('0x16')]);router[_0xf078('0x17')]('/:id',auth[_0xf078('0xd')](),controller[_0xf078('0x18')]);module[_0xf078('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 173b7fe..6f0ff8d 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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x0b0e[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f66=['medium','TEXT','exports'];(function(_0x1db288,_0x52f105){var _0x336800=function(_0x1cd1c2){while(--_0x1cd1c2){_0x1db288['push'](_0x1db288['shift']());}};_0x336800(++_0x52f105);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('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 f974a3e..656de18 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(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x7a54,0x106));var _0x47a5=function(_0x1f097c,_0x48f58d){_0x1f097c=_0x1f097c-0x0;var _0x4c608a=_0x7a54[_0x1f097c];return _0x4c608a;};'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 _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(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x7a54,0x106));var _0x47a5=function(_0x5eae06,_0x227bf2){_0x5eae06=_0x5eae06-0x0;var _0x34a70f=_0x7a54[_0x5eae06];return _0x34a70f;};'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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 409557d..268d15d 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x148c=['hook','events','../../mysqldb','ChatOfflineMessage','remove','emit','hasOwnProperty'];(function(_0x35f1de,_0x4dda19){var _0x4b66d6=function(_0x4ff6c5){while(--_0x4ff6c5){_0x35f1de['push'](_0x35f1de['shift']());}};_0x4b66d6(++_0x4dda19);}(_0x148c,0xd3));var _0xc148=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x148c[_0x16d10f];return _0x50c823;};'use strict';var EventEmitter=require(_0xc148('0x0'));var ChatOfflineMessage=require(_0xc148('0x1'))['db'][_0xc148('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc148('0x3')};function emitEvent(_0x16e00b){return function(_0x44e488,_0x3af8ce,_0xabe01a){ChatOfflineMessageEvents[_0xc148('0x4')](_0x16e00b+':'+_0x44e488['id'],_0x44e488);ChatOfflineMessageEvents['emit'](_0x16e00b,_0x44e488);_0xabe01a(null);};}for(var e in events){if(events[_0xc148('0x5')](e)){var event=events[e];ChatOfflineMessage[_0xc148('0x6')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x2ad6=['exports','events','ChatOfflineMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2b8286,_0xe3d644){var _0x14af6c=function(_0x51a015){while(--_0x51a015){_0x2b8286['push'](_0x2b8286['shift']());}};_0x14af6c(++_0xe3d644);}(_0x2ad6,0x1a1));var _0x62ad=function(_0xdeb232,_0x18eb34){_0xdeb232=_0xdeb232-0x0;var _0x2191b0=_0x2ad6[_0xdeb232];return _0x2191b0;};'use strict';var EventEmitter=require(_0x62ad('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x62ad('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x62ad('0x2')](0x0);var events={'afterCreate':_0x62ad('0x3'),'afterUpdate':_0x62ad('0x4'),'afterDestroy':'remove'};function emitEvent(_0x989270){return function(_0x750cc9,_0xd24c4c,_0x1142ee){ChatOfflineMessageEvents[_0x62ad('0x5')](_0x989270+':'+_0x750cc9['id'],_0x750cc9);ChatOfflineMessageEvents['emit'](_0x989270,_0x750cc9);_0x1142ee(null);};}for(var e in events){if(events[_0x62ad('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x62ad('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 58fbc1e..9abad0d 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 _0x94d4=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x55f49c,_0x3d85b1){var _0x29a4f7=function(_0x1fcb14){while(--_0x1fcb14){_0x55f49c['push'](_0x55f49c['shift']());}};_0x29a4f7(++_0x3d85b1);}(_0x94d4,0x104));var _0x494d=function(_0x242ef4,_0x4b3ba8){_0x242ef4=_0x242ef4-0x0;var _0x1c52bb=_0x94d4[_0x242ef4];return _0x1c52bb;};'use strict';var attributes=require(_0x494d('0x0'));module[_0x494d('0x1')]=function(_0xda94ec){return _0xda94ec[_0x494d('0x2')](_0x494d('0x3'),attributes,{'tableName':_0x494d('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x494d('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6b7a=['exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0x6b7a,0x108));var _0xa6b7=function(_0x1ab0e6,_0x17ba8d){_0x1ab0e6=_0x1ab0e6-0x0;var _0x248815=_0x6b7a[_0x1ab0e6];return _0x248815;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xa6b7('0x0')]=function(_0x34d09c){return _0x34d09c[_0xa6b7('0x1')](_0xa6b7('0x2'),attributes,{'tableName':_0xa6b7('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 9dc96c9..51f1e9e 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 _0x16b4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x16b4,0xa9));var _0x416b=function(_0x515bbd,_0x102ffe){_0x515bbd=_0x515bbd-0x0;var _0x472340=_0x16b4[_0x515bbd];return _0x472340;};'use strict';var _=require(_0x416b('0x0'));var util=require(_0x416b('0x1'));var moment=require(_0x416b('0x2'));var BPromise=require(_0x416b('0x3'));var rs=require(_0x416b('0x4'));var fs=require('fs');var Redis=require(_0x416b('0x5'));var db=require(_0x416b('0x6'))['db'];var utils=require(_0x416b('0x7'));var logger=require(_0x416b('0x8'))(_0x416b('0x9'));var config=require(_0x416b('0xa'));var jayson=require(_0x416b('0xb'));var client=jayson[_0x416b('0xc')][_0x416b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2da355,_0x185c7e,_0x458871){return new BPromise(function(_0x40d930,_0x33cdd3){return client[_0x416b('0xe')](_0x2da355,_0x458871)['then'](function(_0x2666a4){logger[_0x416b('0xf')](_0x416b('0x10'),_0x185c7e,_0x416b('0x11'));logger[_0x416b('0x12')](_0x416b('0x13'),_0x185c7e,_0x416b('0x11'),JSON[_0x416b('0x14')](_0x2666a4));if(_0x2666a4[_0x416b('0x15')]){if(_0x2666a4['error'][_0x416b('0x16')]===0x1f4){logger[_0x416b('0x15')](_0x416b('0x10'),_0x185c7e,_0x2666a4[_0x416b('0x15')]['message']);return _0x33cdd3(_0x2666a4[_0x416b('0x15')]['message']);}logger[_0x416b('0x15')](_0x416b('0x10'),_0x185c7e,_0x2666a4[_0x416b('0x15')][_0x416b('0x17')]);return _0x40d930(_0x2666a4[_0x416b('0x15')]['message']);}else{logger['info'](_0x416b('0x10'),_0x185c7e,_0x416b('0x11'));_0x40d930(_0x2666a4[_0x416b('0x18')][_0x416b('0x17')]);}})['catch'](function(_0xa7a3bb){logger[_0x416b('0x15')]('ChatOfflineMessage,\x20%s,\x20%s',_0x185c7e,_0xa7a3bb);_0x33cdd3(_0xa7a3bb);});});}
\ No newline at end of file
+var _0xa2f5=['http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x32e90a,_0x317d6f){var _0x3ad167=function(_0x5ece84){while(--_0x5ece84){_0x32e90a['push'](_0x32e90a['shift']());}};_0x3ad167(++_0x317d6f);}(_0xa2f5,0xf2));var _0x5a2f=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa2f5[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x5a2f('0x0'));var util=require(_0x5a2f('0x1'));var moment=require(_0x5a2f('0x2'));var BPromise=require(_0x5a2f('0x3'));var rs=require(_0x5a2f('0x4'));var fs=require('fs');var Redis=require(_0x5a2f('0x5'));var db=require(_0x5a2f('0x6'))['db'];var utils=require(_0x5a2f('0x7'));var logger=require(_0x5a2f('0x8'))(_0x5a2f('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5a2f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x417d87,_0x5da183,_0x2d6392){return new BPromise(function(_0x1033db,_0x214637){return client[_0x5a2f('0xb')](_0x417d87,_0x2d6392)['then'](function(_0x58e639){logger['info'](_0x5a2f('0xc'),_0x5da183,_0x5a2f('0xd'));logger[_0x5a2f('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5da183,_0x5a2f('0xd'),JSON[_0x5a2f('0xf')](_0x58e639));if(_0x58e639['error']){if(_0x58e639[_0x5a2f('0x10')]['code']===0x1f4){logger['error'](_0x5a2f('0xc'),_0x5da183,_0x58e639[_0x5a2f('0x10')][_0x5a2f('0x11')]);return _0x214637(_0x58e639['error'][_0x5a2f('0x11')]);}logger[_0x5a2f('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5da183,_0x58e639['error'][_0x5a2f('0x11')]);return _0x1033db(_0x58e639[_0x5a2f('0x10')]['message']);}else{logger[_0x5a2f('0x12')](_0x5a2f('0xc'),_0x5da183,_0x5a2f('0xd'));_0x1033db(_0x58e639[_0x5a2f('0x13')][_0x5a2f('0x11')]);}})[_0x5a2f('0x14')](function(_0x566cd0){logger[_0x5a2f('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5da183,_0x566cd0);_0x214637(_0x566cd0);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index e5ce4ea..d6d3c04 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 _0xfade=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xfade,0x14c));var _0xefad=function(_0x28f5ae,_0x3a0190){_0x28f5ae=_0x28f5ae-0x0;var _0x4acc8b=_0xfade[_0x28f5ae];return _0x4acc8b;};'use strict';var multer=require('multer');var util=require(_0xefad('0x0'));var path=require(_0xefad('0x1'));var timeout=require(_0xefad('0x2'));var express=require('express');var router=express[_0xefad('0x3')]();var fs_extra=require(_0xefad('0x4'));var auth=require(_0xefad('0x5'));var interaction=require(_0xefad('0x6'));var config=require('../../config/environment');var controller=require(_0xefad('0x7'));router['get']('/',auth[_0xefad('0x8')](),controller[_0xefad('0x9')]);router[_0xefad('0xa')](_0xefad('0xb'),auth['isAuthenticated'](),controller[_0xefad('0xc')]);router[_0xefad('0xa')](_0xefad('0xd'),auth[_0xefad('0x8')](),controller[_0xefad('0xe')]);router[_0xefad('0xf')]('/',auth[_0xefad('0x8')](),controller[_0xefad('0x10')]);router[_0xefad('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xefad('0x12')]);router[_0xefad('0x13')](_0xefad('0xd'),auth[_0xefad('0x8')](),controller[_0xefad('0x14')]);module[_0xefad('0x15')]=router;
\ No newline at end of file
+var _0xb9d6=['/describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index'];(function(_0x43026b,_0x928d8c){var _0x4a96cd=function(_0x362cbd){while(--_0x362cbd){_0x43026b['push'](_0x43026b['shift']());}};_0x4a96cd(++_0x928d8c);}(_0xb9d6,0x13d));var _0x6b9d=function(_0x1eebe4,_0x27f7b4){_0x1eebe4=_0x1eebe4-0x0;var _0x46f639=_0xb9d6[_0x1eebe4];return _0x46f639;};'use strict';var multer=require(_0x6b9d('0x0'));var util=require(_0x6b9d('0x1'));var path=require(_0x6b9d('0x2'));var timeout=require(_0x6b9d('0x3'));var express=require('express');var router=express[_0x6b9d('0x4')]();var fs_extra=require(_0x6b9d('0x5'));var auth=require(_0x6b9d('0x6'));var interaction=require(_0x6b9d('0x7'));var config=require(_0x6b9d('0x8'));var controller=require(_0x6b9d('0x9'));router[_0x6b9d('0xa')]('/',auth[_0x6b9d('0xb')](),controller[_0x6b9d('0xc')]);router[_0x6b9d('0xa')](_0x6b9d('0xd'),auth[_0x6b9d('0xb')](),controller['describe']);router[_0x6b9d('0xa')](_0x6b9d('0xe'),auth['isAuthenticated'](),controller[_0x6b9d('0xf')]);router[_0x6b9d('0x10')]('/',auth[_0x6b9d('0xb')](),controller['create']);router[_0x6b9d('0x11')](_0x6b9d('0xe'),auth[_0x6b9d('0xb')](),controller[_0x6b9d('0x12')]);router[_0x6b9d('0x13')](_0x6b9d('0xe'),auth[_0x6b9d('0xb')](),controller[_0x6b9d('0x14')]);module[_0x6b9d('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 630b0e5..9552440 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 _0x093e=['mouseOver','timeout','STRING','sequelize','exports','ENUM'];(function(_0x209302,_0x5826ac){var _0x1df8e9=function(_0x16ae49){while(--_0x16ae49){_0x209302['push'](_0x209302['shift']());}};_0x1df8e9(++_0x5826ac);}(_0x093e,0x1ad));var _0xe093=function(_0x23d122,_0x2e3249){_0x23d122=_0x23d122-0x0;var _0x355d6a=_0x093e[_0x23d122];return _0x355d6a;};'use strict';var Sequelize=require(_0xe093('0x0'));module[_0xe093('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe093('0x2')](_0xe093('0x3'),_0xe093('0x4')),'defaultValue':_0xe093('0x3')},'selector':{'type':Sequelize[_0xe093('0x5')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xca8a=['timeout','INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xca8a,0xc6));var _0xaca8=function(_0x5bd922,_0x2a6c2b){_0x5bd922=_0x5bd922-0x0;var _0x90ef93=_0xca8a[_0x5bd922];return _0x90ef93;};'use strict';var Sequelize=require(_0xaca8('0x0'));module[_0xaca8('0x1')]={'name':{'type':Sequelize[_0xaca8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xaca8('0x3')](_0xaca8('0x4'),_0xaca8('0x5')),'defaultValue':_0xaca8('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xaca8('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 0421512..f107bb9 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 _0x7579=['desk.js','to-csv','querystring','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','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0x2bbc07,_0x1e2168){var _0x6879e4=function(_0x290fa1){while(--_0x290fa1){_0x2bbc07['push'](_0x2bbc07['shift']());}};_0x6879e4(++_0x1e2168);}(_0x7579,0x1e2));var _0x9757=function(_0x35a6b3,_0x5c9114){_0x35a6b3=_0x35a6b3-0x0;var _0x1d95bb=_0x7579[_0x35a6b3];return _0x1d95bb;};'use strict';var emlformat=require(_0x9757('0x0'));var rimraf=require(_0x9757('0x1'));var zipdir=require(_0x9757('0x2'));var jsonpatch=require(_0x9757('0x3'));var rp=require(_0x9757('0x4'));var moment=require(_0x9757('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9757('0x6'));var util=require(_0x9757('0x7'));var path=require(_0x9757('0x8'));var sox=require(_0x9757('0x9'));var csv=require('to-csv');var ejs=require(_0x9757('0xa'));var fs=require('fs');var fs_extra=require(_0x9757('0xb'));var _=require(_0x9757('0xc'));var squel=require('squel');var crypto=require(_0x9757('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9757('0xe'));var toCsv=require(_0x9757('0xf'));var querystring=require(_0x9757('0x10'));var Papa=require('papaparse');var Redis=require(_0x9757('0x11'));var authService=require(_0x9757('0x12'));var qs=require(_0x9757('0x13'));var as=require(_0x9757('0x14'));var hardwareService=require(_0x9757('0x15'));var logger=require(_0x9757('0x16'))(_0x9757('0x17'));var utils=require(_0x9757('0x18'));var config=require(_0x9757('0x19'));var licenseUtil=require(_0x9757('0x1a'));var db=require(_0x9757('0x1b'))['db'];function respondWithStatusCode(_0x5c19c9,_0x2f2200){_0x2f2200=_0x2f2200||0xcc;return function(_0x1d32ee){if(_0x1d32ee){return _0x5c19c9[_0x9757('0x1c')](_0x2f2200);}return _0x5c19c9['status'](_0x2f2200)[_0x9757('0x1d')]();};}function respondWithResult(_0x39fa5c,_0x413d55){_0x413d55=_0x413d55||0xc8;return function(_0x14f67c){if(_0x14f67c){return _0x39fa5c[_0x9757('0x1e')](_0x413d55)[_0x9757('0x1f')](_0x14f67c);}};}function respondWithFilteredResult(_0x105e56,_0x4b994d){return function(_0x1fd6f6){if(_0x1fd6f6){var _0x55ded7=typeof _0x4b994d[_0x9757('0x20')]===_0x9757('0x21')&&typeof _0x4b994d[_0x9757('0x22')]===_0x9757('0x21');var _0x3f6be9=_0x1fd6f6[_0x9757('0x23')];var _0x57e309=_0x55ded7?0x0:_0x4b994d[_0x9757('0x20')];var _0x2aa360=_0x55ded7?_0x1fd6f6[_0x9757('0x23')]:_0x4b994d[_0x9757('0x20')]+_0x4b994d[_0x9757('0x22')];var _0xd2306b;if(_0x2aa360>=_0x3f6be9){_0x2aa360=_0x3f6be9;_0xd2306b=0xc8;}else{_0xd2306b=0xce;}_0x105e56[_0x9757('0x1e')](_0xd2306b);return _0x105e56['set'](_0x9757('0x24'),_0x57e309+'-'+_0x2aa360+'/'+_0x3f6be9)['json'](_0x1fd6f6);}return null;};}function patchUpdates(_0x517504){return function(_0x37c889){try{jsonpatch[_0x9757('0x25')](_0x37c889,_0x517504,!![]);}catch(_0x1443a9){return BPromise[_0x9757('0x26')](_0x1443a9);}return _0x37c889['save']();};}function saveUpdates(_0x4ef000,_0x53d21c){return function(_0x73dac4){if(_0x73dac4){return _0x73dac4[_0x9757('0x27')](_0x4ef000)[_0x9757('0x28')](function(_0x21435e){return _0x21435e;});}return null;};}function removeEntity(_0x5dc2fa,_0x11f5ac){return function(_0x160108){if(_0x160108){return _0x160108['destroy']()[_0x9757('0x28')](function(){_0x5dc2fa[_0x9757('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6915,_0x1a7036){return function(_0x172e8c){if(!_0x172e8c){_0x2b6915[_0x9757('0x1c')](0x194);}return _0x172e8c;};}function handleError(_0x115e33,_0x19588f){_0x19588f=_0x19588f||0x1f4;return function(_0x4e6b86){logger[_0x9757('0x29')](_0x4e6b86['stack']);if(_0x4e6b86[_0x9757('0x2a')]){delete _0x4e6b86[_0x9757('0x2a')];}_0x115e33['status'](_0x19588f)['send'](_0x4e6b86);};}exports[_0x9757('0x2b')]=function(_0x21a4bd,_0xc81976){var _0x3aae8b={'raw':!![],'where':{'id':_0x21a4bd[_0x9757('0x2c')]['id']}},_0x4ebdb6={};_0x4ebdb6[_0x9757('0x2d')]=_[_0x9757('0x2e')](db[_0x9757('0x2f')][_0x9757('0x30')]);_0x4ebdb6[_0x9757('0x31')]=_['keys'](_0x21a4bd[_0x9757('0x31')]);_0x4ebdb6[_0x9757('0x32')]=_[_0x9757('0x33')](_0x4ebdb6[_0x9757('0x2d')],_0x4ebdb6[_0x9757('0x31')]);_0x3aae8b[_0x9757('0x34')]=_[_0x9757('0x33')](_0x4ebdb6['model'],qs[_0x9757('0x35')](_0x21a4bd[_0x9757('0x31')][_0x9757('0x35')]));_0x3aae8b[_0x9757('0x34')]=_0x3aae8b[_0x9757('0x34')][_0x9757('0x36')]?_0x3aae8b[_0x9757('0x34')]:_0x4ebdb6[_0x9757('0x2d')];if(_0x21a4bd['query'][_0x9757('0x37')]){_0x3aae8b['include']=[{'all':!![]}];}_0x3aae8b=_[_0x9757('0x38')]({},_0x3aae8b,_0x21a4bd[_0x9757('0x39')]);return db['ChatProactiveAction'][_0x9757('0x3a')](_0x3aae8b)[_0x9757('0x28')](handleEntityNotFound(_0xc81976,null))[_0x9757('0x28')](respondWithResult(_0xc81976,null))[_0x9757('0x3b')](handleError(_0xc81976,null));};exports[_0x9757('0x3c')]=function(_0x2f2688,_0x3c94b2){return db[_0x9757('0x2f')][_0x9757('0x3c')](_0x2f2688[_0x9757('0x3d')],{})['then'](respondWithResult(_0x3c94b2,0xc9))[_0x9757('0x3b')](handleError(_0x3c94b2,null));};exports[_0x9757('0x27')]=function(_0x457d6c,_0x4f2ea4){if(_0x457d6c[_0x9757('0x3d')]['id']){delete _0x457d6c[_0x9757('0x3d')]['id'];}return db[_0x9757('0x2f')][_0x9757('0x3a')]({'where':{'id':_0x457d6c[_0x9757('0x2c')]['id']}})[_0x9757('0x28')](handleEntityNotFound(_0x4f2ea4,null))[_0x9757('0x28')](saveUpdates(_0x457d6c[_0x9757('0x3d')],null))[_0x9757('0x28')](respondWithResult(_0x4f2ea4,null))['catch'](handleError(_0x4f2ea4,null));};exports['destroy']=function(_0x2cf830,_0x2d0a6e){return db[_0x9757('0x2f')][_0x9757('0x3a')]({'where':{'id':_0x2cf830['params']['id']}})[_0x9757('0x28')](handleEntityNotFound(_0x2d0a6e,null))['then'](removeEntity(_0x2d0a6e,null))[_0x9757('0x3b')](handleError(_0x2d0a6e,null));};
\ No newline at end of file
+var _0xfdb3=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','then','destroy','stack','name','send','show','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','model','fields','length','merge','options','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x1f0077,_0x328f99){var _0x353a1d=function(_0x5927fb){while(--_0x5927fb){_0x1f0077['push'](_0x1f0077['shift']());}};_0x353a1d(++_0x328f99);}(_0xfdb3,0x10c));var _0x3fdb=function(_0x5e185b,_0x853f33){_0x5e185b=_0x5e185b-0x0;var _0x19044d=_0xfdb3[_0x5e185b];return _0x19044d;};'use strict';var emlformat=require(_0x3fdb('0x0'));var rimraf=require(_0x3fdb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fdb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3fdb('0x3'));var Mustache=require('mustache');var util=require(_0x3fdb('0x4'));var path=require(_0x3fdb('0x5'));var sox=require(_0x3fdb('0x6'));var csv=require(_0x3fdb('0x7'));var ejs=require(_0x3fdb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3fdb('0x9'));var squel=require(_0x3fdb('0xa'));var crypto=require(_0x3fdb('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3fdb('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3fdb('0xd'));var Papa=require(_0x3fdb('0xe'));var Redis=require(_0x3fdb('0xf'));var authService=require(_0x3fdb('0x10'));var qs=require(_0x3fdb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x3fdb('0x12'));var config=require(_0x3fdb('0x13'));var licenseUtil=require(_0x3fdb('0x14'));var db=require(_0x3fdb('0x15'))['db'];function respondWithStatusCode(_0x3cc79c,_0x41f371){_0x41f371=_0x41f371||0xcc;return function(_0x416962){if(_0x416962){return _0x3cc79c[_0x3fdb('0x16')](_0x41f371);}return _0x3cc79c[_0x3fdb('0x17')](_0x41f371)[_0x3fdb('0x18')]();};}function respondWithResult(_0x4eab69,_0x35a660){_0x35a660=_0x35a660||0xc8;return function(_0x1a5dd8){if(_0x1a5dd8){return _0x4eab69['status'](_0x35a660)[_0x3fdb('0x19')](_0x1a5dd8);}};}function respondWithFilteredResult(_0x31cd0e,_0x182635){return function(_0x39c573){if(_0x39c573){var _0x5a9b95=typeof _0x182635['offset']==='undefined'&&typeof _0x182635[_0x3fdb('0x1a')]===_0x3fdb('0x1b');var _0x11d57d=_0x39c573[_0x3fdb('0x1c')];var _0x212ab6=_0x5a9b95?0x0:_0x182635['offset'];var _0x224035=_0x5a9b95?_0x39c573[_0x3fdb('0x1c')]:_0x182635[_0x3fdb('0x1d')]+_0x182635[_0x3fdb('0x1a')];var _0x370f84;if(_0x224035>=_0x11d57d){_0x224035=_0x11d57d;_0x370f84=0xc8;}else{_0x370f84=0xce;}_0x31cd0e['status'](_0x370f84);return _0x31cd0e[_0x3fdb('0x1e')](_0x3fdb('0x1f'),_0x212ab6+'-'+_0x224035+'/'+_0x11d57d)[_0x3fdb('0x19')](_0x39c573);}return null;};}function patchUpdates(_0x1bbad7){return function(_0x403f48){try{jsonpatch['apply'](_0x403f48,_0x1bbad7,!![]);}catch(_0x76431d){return BPromise['reject'](_0x76431d);}return _0x403f48[_0x3fdb('0x20')]();};}function saveUpdates(_0x490744,_0x516440){return function(_0x48b674){if(_0x48b674){return _0x48b674['update'](_0x490744)[_0x3fdb('0x21')](function(_0x264913){return _0x264913;});}return null;};}function removeEntity(_0xaf7c32,_0xac9aac){return function(_0x111cb8){if(_0x111cb8){return _0x111cb8[_0x3fdb('0x22')]()['then'](function(){_0xaf7c32['status'](0xcc)[_0x3fdb('0x18')]();});}};}function handleEntityNotFound(_0xc0410d,_0x5c30b5){return function(_0xaf7f8f){if(!_0xaf7f8f){_0xc0410d['sendStatus'](0x194);}return _0xaf7f8f;};}function handleError(_0x47d667,_0x1b9c4b){_0x1b9c4b=_0x1b9c4b||0x1f4;return function(_0x24278c){logger['error'](_0x24278c[_0x3fdb('0x23')]);if(_0x24278c['name']){delete _0x24278c[_0x3fdb('0x24')];}_0x47d667[_0x3fdb('0x17')](_0x1b9c4b)[_0x3fdb('0x25')](_0x24278c);};}exports[_0x3fdb('0x26')]=function(_0x3d6fbe,_0x37f3d7){var _0x442dbc={'raw':!![],'where':{'id':_0x3d6fbe['params']['id']}},_0x29be8e={};_0x29be8e['model']=_[_0x3fdb('0x27')](db[_0x3fdb('0x28')][_0x3fdb('0x29')]);_0x29be8e[_0x3fdb('0x2a')]=_[_0x3fdb('0x27')](_0x3d6fbe[_0x3fdb('0x2a')]);_0x29be8e[_0x3fdb('0x2b')]=_[_0x3fdb('0x2c')](_0x29be8e['model'],_0x29be8e[_0x3fdb('0x2a')]);_0x442dbc[_0x3fdb('0x2d')]=_[_0x3fdb('0x2c')](_0x29be8e[_0x3fdb('0x2e')],qs[_0x3fdb('0x2f')](_0x3d6fbe[_0x3fdb('0x2a')][_0x3fdb('0x2f')]));_0x442dbc[_0x3fdb('0x2d')]=_0x442dbc[_0x3fdb('0x2d')][_0x3fdb('0x30')]?_0x442dbc[_0x3fdb('0x2d')]:_0x29be8e[_0x3fdb('0x2e')];if(_0x3d6fbe[_0x3fdb('0x2a')]['includeAll']){_0x442dbc['include']=[{'all':!![]}];}_0x442dbc=_[_0x3fdb('0x31')]({},_0x442dbc,_0x3d6fbe[_0x3fdb('0x32')]);return db[_0x3fdb('0x28')][_0x3fdb('0x33')](_0x442dbc)[_0x3fdb('0x21')](handleEntityNotFound(_0x37f3d7,null))[_0x3fdb('0x21')](respondWithResult(_0x37f3d7,null))[_0x3fdb('0x34')](handleError(_0x37f3d7,null));};exports[_0x3fdb('0x35')]=function(_0xba3e2,_0x530b2a){return db[_0x3fdb('0x28')]['create'](_0xba3e2[_0x3fdb('0x36')],{})[_0x3fdb('0x21')](respondWithResult(_0x530b2a,0xc9))[_0x3fdb('0x34')](handleError(_0x530b2a,null));};exports['update']=function(_0x29cdfa,_0x324037){if(_0x29cdfa['body']['id']){delete _0x29cdfa[_0x3fdb('0x36')]['id'];}return db[_0x3fdb('0x28')][_0x3fdb('0x33')]({'where':{'id':_0x29cdfa[_0x3fdb('0x37')]['id']}})['then'](handleEntityNotFound(_0x324037,null))[_0x3fdb('0x21')](saveUpdates(_0x29cdfa[_0x3fdb('0x36')],null))['then'](respondWithResult(_0x324037,null))[_0x3fdb('0x34')](handleError(_0x324037,null));};exports[_0x3fdb('0x22')]=function(_0x23e574,_0x183db1){return db[_0x3fdb('0x28')][_0x3fdb('0x33')]({'where':{'id':_0x23e574['params']['id']}})[_0x3fdb('0x21')](handleEntityNotFound(_0x183db1,null))['then'](removeEntity(_0x183db1,null))[_0x3fdb('0x34')](handleError(_0x183db1,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index ba9edea..2d03d58 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 _0x34f3=['chat_proactive_actions','lodash','api','bluebird','request-promise','path','../../config/environment','exports','define','ChatProactiveAction'];(function(_0x407ecd,_0x3b833a){var _0xf9bbbf=function(_0x215021){while(--_0x215021){_0x407ecd['push'](_0x407ecd['shift']());}};_0xf9bbbf(++_0x3b833a);}(_0x34f3,0x169));var _0x334f=function(_0x3e25ff,_0x42309d){_0x3e25ff=_0x3e25ff-0x0;var _0x397545=_0x34f3[_0x3e25ff];return _0x397545;};'use strict';var _=require(_0x334f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x334f('0x1'));var moment=require('moment');var BPromise=require(_0x334f('0x2'));var rp=require(_0x334f('0x3'));var fs=require('fs');var path=require(_0x334f('0x4'));var rimraf=require('rimraf');var config=require(_0x334f('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0x334f('0x6')]=function(_0x3c89f9,_0x17fe03){return _0x3c89f9[_0x334f('0x7')](_0x334f('0x8'),attributes,{'tableName':_0x334f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa15=['./chatProactiveAction.attributes','define','ChatProactiveAction','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4f48b2,_0x39af74){var _0x58f40f=function(_0x2d6934){while(--_0x2d6934){_0x4f48b2['push'](_0x4f48b2['shift']());}};_0x58f40f(++_0x39af74);}(_0xaa15,0x107));var _0x5aa1=function(_0x14a72c,_0x3484f0){_0x14a72c=_0x14a72c-0x0;var _0x5de299=_0xaa15[_0x14a72c];return _0x5de299;};'use strict';var _=require(_0x5aa1('0x0'));var util=require('util');var logger=require(_0x5aa1('0x1'))('api');var moment=require(_0x5aa1('0x2'));var BPromise=require(_0x5aa1('0x3'));var rp=require(_0x5aa1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5aa1('0x5'));var config=require(_0x5aa1('0x6'));var attributes=require(_0x5aa1('0x7'));module['exports']=function(_0x2edb8a,_0x2a88d3){return _0x2edb8a[_0x5aa1('0x8')](_0x5aa1('0x9'),attributes,{'tableName':'chat_proactive_actions','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 f915857..6603c6d 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 _0x00cf=['client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x16b396,_0x5dea08){var _0xff7f77=function(_0x3c9682){while(--_0x3c9682){_0x16b396['push'](_0x16b396['shift']());}};_0xff7f77(++_0x5dea08);}(_0x00cf,0xd3));var _0xf00c=function(_0x4e7307,_0x359bb4){_0x4e7307=_0x4e7307-0x0;var _0x44b9d7=_0x00cf[_0x4e7307];return _0x44b9d7;};'use strict';var _=require(_0xf00c('0x0'));var util=require(_0xf00c('0x1'));var moment=require(_0xf00c('0x2'));var BPromise=require(_0xf00c('0x3'));var rs=require(_0xf00c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf00c('0x5'));var logger=require(_0xf00c('0x6'))(_0xf00c('0x7'));var config=require('../../config/environment');var jayson=require(_0xf00c('0x8'));var client=jayson[_0xf00c('0x9')][_0xf00c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xce9b20,_0x3614f6,_0x50d9c8){return new BPromise(function(_0x279df2,_0x13c073){return client['request'](_0xce9b20,_0x50d9c8)[_0xf00c('0xb')](function(_0x1d3278){logger[_0xf00c('0xc')](_0xf00c('0xd'),_0x3614f6,_0xf00c('0xe'));logger[_0xf00c('0xf')](_0xf00c('0x10'),_0x3614f6,_0xf00c('0xe'),JSON['stringify'](_0x1d3278));if(_0x1d3278[_0xf00c('0x11')]){if(_0x1d3278[_0xf00c('0x11')][_0xf00c('0x12')]===0x1f4){logger['error'](_0xf00c('0xd'),_0x3614f6,_0x1d3278['error'][_0xf00c('0x13')]);return _0x13c073(_0x1d3278[_0xf00c('0x11')][_0xf00c('0x13')]);}logger[_0xf00c('0x11')](_0xf00c('0xd'),_0x3614f6,_0x1d3278['error'][_0xf00c('0x13')]);return _0x279df2(_0x1d3278[_0xf00c('0x11')][_0xf00c('0x13')]);}else{logger[_0xf00c('0xc')](_0xf00c('0xd'),_0x3614f6,_0xf00c('0xe'));_0x279df2(_0x1d3278[_0xf00c('0x14')][_0xf00c('0x13')]);}})[_0xf00c('0x15')](function(_0x3372b0){logger[_0xf00c('0x11')](_0xf00c('0xd'),_0x3614f6,_0x3372b0);_0x13c073(_0x3372b0);});});}
\ No newline at end of file
+var _0x8972=['../../config/logger','rpc','../../config/environment','jayson/promise','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x533ef3,_0x42fc7c){var _0x25ceac=function(_0x462932){while(--_0x462932){_0x533ef3['push'](_0x533ef3['shift']());}};_0x25ceac(++_0x42fc7c);}(_0x8972,0x1aa));var _0x2897=function(_0x4ea5eb,_0x31360f){_0x4ea5eb=_0x4ea5eb-0x0;var _0xaf3912=_0x8972[_0x4ea5eb];return _0xaf3912;};'use strict';var _=require(_0x2897('0x0'));var util=require(_0x2897('0x1'));var moment=require(_0x2897('0x2'));var BPromise=require(_0x2897('0x3'));var rs=require(_0x2897('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2897('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2897('0x6'))(_0x2897('0x7'));var config=require(_0x2897('0x8'));var jayson=require(_0x2897('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x560c6e,_0x58058a,_0x522254){return new BPromise(function(_0x26190d,_0x2e847c){return client['request'](_0x560c6e,_0x522254)['then'](function(_0x56fd9e){logger[_0x2897('0xa')](_0x2897('0xb'),_0x58058a,_0x2897('0xc'));logger[_0x2897('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x58058a,_0x2897('0xc'),JSON[_0x2897('0xe')](_0x56fd9e));if(_0x56fd9e[_0x2897('0xf')]){if(_0x56fd9e['error']['code']===0x1f4){logger[_0x2897('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x58058a,_0x56fd9e[_0x2897('0xf')]['message']);return _0x2e847c(_0x56fd9e[_0x2897('0xf')][_0x2897('0x10')]);}logger['error'](_0x2897('0xb'),_0x58058a,_0x56fd9e[_0x2897('0xf')][_0x2897('0x10')]);return _0x26190d(_0x56fd9e[_0x2897('0xf')][_0x2897('0x10')]);}else{logger[_0x2897('0xa')](_0x2897('0xb'),_0x58058a,_0x2897('0xc'));_0x26190d(_0x56fd9e['result'][_0x2897('0x10')]);}})[_0x2897('0x11')](function(_0x1a34da){logger[_0x2897('0xf')](_0x2897('0xb'),_0x58058a,_0x1a34da);_0x2e847c(_0x1a34da);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 9582649..937900c 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 _0xeda8=['get','/:id','isAuthenticated','show','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x1531d5,_0x1cfc23){var _0x124680=function(_0xc27d57){while(--_0xc27d57){_0x1531d5['push'](_0x1531d5['shift']());}};_0x124680(++_0x1cfc23);}(_0xeda8,0x104));var _0x8eda=function(_0x49dc19,_0x50f73f){_0x49dc19=_0x49dc19-0x0;var _0x4f05de=_0xeda8[_0x49dc19];return _0x4f05de;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')](_0x8eda('0xb'),auth[_0x8eda('0xc')](),controller[_0x8eda('0xd')]);router['post']('/',auth[_0x8eda('0xc')](),controller[_0x8eda('0xe')]);router[_0x8eda('0xf')](_0x8eda('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8eda('0xc')](),controller[_0x8eda('0x10')]);module[_0x8eda('0x11')]=router;
\ No newline at end of file
+var _0x6aa7=['/:id','show','post','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x9c4ce,_0x26dfad){var _0x550c42=function(_0x2f2bf5){while(--_0x2f2bf5){_0x9c4ce['push'](_0x9c4ce['shift']());}};_0x550c42(++_0x26dfad);}(_0x6aa7,0x178));var _0x76aa=function(_0x36a20d,_0x12281c){_0x36a20d=_0x36a20d-0x0;var _0x288a39=_0x6aa7[_0x36a20d];return _0x288a39;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0x76aa('0x8'),auth['isAuthenticated'](),controller[_0x76aa('0x9')]);router[_0x76aa('0xa')]('/',auth[_0x76aa('0xb')](),controller['create']);router[_0x76aa('0xc')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller['update']);router[_0x76aa('0xd')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller[_0x76aa('0xe')]);module[_0x76aa('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 29becbb..e83f1ec 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 _0x5234=['beepall','sequelize','STRING','name','ENUM','rrmemory'];(function(_0x22dfb9,_0x2e231c){var _0x51cbb1=function(_0x7dac5a){while(--_0x7dac5a){_0x22dfb9['push'](_0x22dfb9['shift']());}};_0x51cbb1(++_0x2e231c);}(_0x5234,0x1cf));var _0x4523=function(_0x3ffe8a,_0x57de78){_0x3ffe8a=_0x3ffe8a-0x0;var _0x3ae039=_0x5234[_0x3ffe8a];return _0x3ae039;};'use strict';var Sequelize=require(_0x4523('0x0'));module['exports']={'name':{'type':Sequelize[_0x4523('0x1')],'unique':_0x4523('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4523('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4523('0x3')](_0x4523('0x4'),_0x4523('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0xcb7a=['INTEGER','rrmemory','exports','STRING','name'];(function(_0x3420e5,_0x67fec0){var _0x1e9141=function(_0x4babb2){while(--_0x4babb2){_0x3420e5['push'](_0x3420e5['shift']());}};_0x1e9141(++_0x67fec0);}(_0xcb7a,0xf2));var _0xacb7=function(_0x588fad,_0x424bb7){_0x588fad=_0x588fad-0x0;var _0x2ef8a8=_0xcb7a[_0x588fad];return _0x2ef8a8;};'use strict';var Sequelize=require('sequelize');module[_0xacb7('0x0')]={'name':{'type':Sequelize[_0xacb7('0x1')],'unique':_0xacb7('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xacb7('0x1')]},'timeout':{'type':Sequelize[_0xacb7('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xacb7('0x4'),'beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 8691b40..4b6aa3f 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 _0x133c=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','sort','where','pick','ChatQueueId','merge','filter','findAll','findAndCountAll','chatPause','createdAt','format','%s/%s','getTeams','Team','nolimit','addTeams','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','getAgents','bluebird','util','lodash','squel','ioredis','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','offset','set','update','destroy','get','ChatQueues','UserProfileResource','then','sendStatus','stack','name','send','index','map','ChatQueue','fieldName','type','getOptions','include','rows','catch','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','options','find','create','body','user'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x133c,0x130));var _0xc133=function(_0x3778f4,_0x194462){_0x3778f4=_0x3778f4-0x0;var _0x5623df=_0x133c[_0x3778f4];return _0x5623df;};'use strict';var BPromise=require(_0xc133('0x0'));var util=require(_0xc133('0x1'));var _=require(_0xc133('0x2'));var squel=require(_0xc133('0x3'));var Redis=require(_0xc133('0x4'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xc133('0x5'));var config=require(_0xc133('0x6'));var db=require(_0xc133('0x7'))['db'];config[_0xc133('0x8')]=_['defaults'](config['redis'],{'host':_0xc133('0x9'),'port':0x18eb});var socket=require(_0xc133('0xa'))(new Redis(config[_0xc133('0x8')]));require('./chatQueue.socket')[_0xc133('0xb')](socket);function respondWithStatusCode(_0x117354,_0x49b56d){_0x49b56d=_0x49b56d||0xcc;return function(_0x1d4be8){if(_0x1d4be8){return _0x117354['sendStatus'](_0x49b56d);}return _0x117354[_0xc133('0xc')](_0x49b56d)[_0xc133('0xd')]();};}function respondWithResult(_0x2b20da,_0xbaf26d){_0xbaf26d=_0xbaf26d||0xc8;return function(_0x1a8214){if(_0x1a8214){return _0x2b20da[_0xc133('0xc')](_0xbaf26d)[_0xc133('0xe')](_0x1a8214);}};}function respondWithFilteredResult(_0xf8b6d9,_0x58fb4c){return function(_0x365a85){if(_0x365a85){var _0x639799=typeof _0x58fb4c['offset']===_0xc133('0xf')&&typeof _0x58fb4c[_0xc133('0x10')]==='undefined';var _0x436da0=_0x365a85[_0xc133('0x11')];var _0x48d5c2=_0x639799?0x0:_0x58fb4c[_0xc133('0x12')];var _0x465983=_0x639799?_0x365a85[_0xc133('0x11')]:_0x58fb4c['offset']+_0x58fb4c[_0xc133('0x10')];var _0x1d537a;if(_0x465983>=_0x436da0){_0x465983=_0x436da0;_0x1d537a=0xc8;}else{_0x1d537a=0xce;}_0xf8b6d9['status'](_0x1d537a);return _0xf8b6d9[_0xc133('0x13')]('Content-Range',_0x48d5c2+'-'+_0x465983+'/'+_0x436da0)[_0xc133('0xe')](_0x365a85);}return null;};}function saveUpdates(_0xa2d04b){return function(_0x2ac783){if(_0x2ac783){return _0x2ac783[_0xc133('0x14')](_0xa2d04b)['then'](function(_0x13fe6c){return _0x13fe6c;});}return null;};}function removeEntity(_0x11e91b){return function(_0x4e3c68){if(_0x4e3c68){return _0x4e3c68[_0xc133('0x15')]()['then'](function(){var _0x5bc11f=_0x4e3c68[_0xc133('0x16')]({'plain':!![]});var _0x3c5c77=_0xc133('0x17');return db[_0xc133('0x18')]['destroy']({'where':{'type':_0x3c5c77,'resourceId':_0x5bc11f['id']}})[_0xc133('0x19')](function(){return _0x4e3c68;});})[_0xc133('0x19')](function(){_0x11e91b[_0xc133('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ccba9){return function(_0x3949ca){if(!_0x3949ca){_0x3ccba9[_0xc133('0x1a')](0x194);}return _0x3949ca;};}function handleError(_0x2f52ae,_0x1bf182){_0x1bf182=_0x1bf182||0x1f4;return function(_0x4d8786){logger['error'](_0x4d8786[_0xc133('0x1b')]);if(_0x4d8786[_0xc133('0x1c')]){delete _0x4d8786['name'];}_0x2f52ae[_0xc133('0xc')](_0x1bf182)[_0xc133('0x1d')](_0x4d8786);};}exports[_0xc133('0x1e')]=function(_0x31a9b7,_0x4cd406){var _0x4bfe44={};var _0x3808f7={'count':0x0,'rows':[]};var _0x249009=_[_0xc133('0x1f')](db[_0xc133('0x20')]['rawAttributes'],function(_0x4d87d2){return{'name':_0x4d87d2[_0xc133('0x21')],'type':_0x4d87d2[_0xc133('0x22')]['key']};});_0x4bfe44=qs[_0xc133('0x23')](_0x249009,_0x31a9b7);var _0x2b2543={'where':_0x4bfe44['where']};return db[_0xc133('0x20')][_0xc133('0x11')](_0x2b2543)['then'](function(_0x2386a1){_0x3808f7[_0xc133('0x11')]=_0x2386a1;_0x4bfe44['include']=qs[_0xc133('0x24')](_0x31a9b7['query']);return db[_0xc133('0x20')]['findAll'](_0x4bfe44);})[_0xc133('0x19')](function(_0x115722){_0x3808f7[_0xc133('0x25')]=_0x115722;return _0x3808f7;})[_0xc133('0x19')](respondWithFilteredResult(_0x4cd406,_0x4bfe44))[_0xc133('0x26')](handleError(_0x4cd406,null));};exports[_0xc133('0x27')]=function(_0x305551,_0x4ab1b3){var _0x2017fe={'raw':!![],'where':{'id':_0x305551[_0xc133('0x28')]['id']}},_0x43ecd4={};_0x43ecd4[_0xc133('0x29')]=_[_0xc133('0x2a')](db[_0xc133('0x20')][_0xc133('0x2b')]);_0x43ecd4[_0xc133('0x2c')]=_[_0xc133('0x2a')](_0x305551[_0xc133('0x2c')]);_0x43ecd4[_0xc133('0x2d')]=_[_0xc133('0x2e')](_0x43ecd4[_0xc133('0x29')],_0x43ecd4['query']);_0x2017fe[_0xc133('0x2f')]=_[_0xc133('0x2e')](_0x43ecd4['model'],qs[_0xc133('0x30')](_0x305551['query'][_0xc133('0x30')]));_0x2017fe[_0xc133('0x2f')]=_0x2017fe[_0xc133('0x2f')][_0xc133('0x31')]?_0x2017fe['attributes']:_0x43ecd4['model'];if(_0x305551[_0xc133('0x2c')][_0xc133('0x32')]){_0x2017fe[_0xc133('0x24')]=[{'all':!![]}];}_0x2017fe=_['merge']({},_0x2017fe,_0x305551[_0xc133('0x33')]);return db[_0xc133('0x20')][_0xc133('0x34')](_0x2017fe)[_0xc133('0x19')](handleEntityNotFound(_0x4ab1b3,null))[_0xc133('0x19')](respondWithResult(_0x4ab1b3,null))[_0xc133('0x26')](handleError(_0x4ab1b3,null));};exports['create']=function(_0x4e63b2,_0x1288f3){return db[_0xc133('0x20')][_0xc133('0x35')](_0x4e63b2[_0xc133('0x36')],{})[_0xc133('0x19')](function(_0x402802){var _0x47ad47=_0x4e63b2[_0xc133('0x37')]['get']({'plain':!![]});if(!_0x47ad47)throw new Error(_0xc133('0x38'));if(_0x47ad47[_0xc133('0x39')]==='user'){var _0x3e4c9d=_0x402802[_0xc133('0x16')]({'plain':!![]});var _0xc425c7=_0xc133('0x17');return db['UserProfileSection'][_0xc133('0x34')]({'where':{'name':_0xc425c7,'userProfileId':_0x47ad47['userProfileId']},'raw':!![]})['then'](function(_0x154bd6){if(_0x154bd6&&_0x154bd6[_0xc133('0x3a')]===0x0){return db[_0xc133('0x18')][_0xc133('0x35')]({'name':_0x3e4c9d[_0xc133('0x1c')],'resourceId':_0x3e4c9d['id'],'type':_0x154bd6[_0xc133('0x1c')],'sectionId':_0x154bd6['id']},{})['then'](function(){return _0x402802;});}else{return _0x402802;}})['catch'](function(_0x4f81a6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f81a6);throw _0x4f81a6;});}return _0x402802;})[_0xc133('0x19')](respondWithResult(_0x1288f3,0xc9))['catch'](handleError(_0x1288f3,null));};exports['update']=function(_0x29b785,_0x30020e){if(_0x29b785[_0xc133('0x36')]['id']){delete _0x29b785[_0xc133('0x36')]['id'];}return db[_0xc133('0x20')]['find']({'where':{'id':_0x29b785[_0xc133('0x28')]['id']}})[_0xc133('0x19')](handleEntityNotFound(_0x30020e,null))['then'](saveUpdates(_0x29b785[_0xc133('0x36')],null))['then'](respondWithResult(_0x30020e,null))['catch'](handleError(_0x30020e,null));};exports[_0xc133('0x15')]=function(_0x3f0e8e,_0x5d663f){return db[_0xc133('0x20')]['find']({'where':{'id':_0x3f0e8e[_0xc133('0x28')]['id']}})['then'](handleEntityNotFound(_0x5d663f,null))[_0xc133('0x19')](removeEntity(_0x5d663f,null))[_0xc133('0x26')](handleError(_0x5d663f,null));};exports[_0xc133('0x3b')]=function(_0x1b6257,_0x13754b){return db[_0xc133('0x20')]['describe']()['then'](respondWithResult(_0x13754b,null))['catch'](handleError(_0x13754b,null));};exports[_0xc133('0x3c')]=function(_0x3b200a,_0x1e0e2d){var _0x5437e2={'raw':!![],'where':{}},_0x25b64c={},_0x1789c4;return db[_0xc133('0x20')][_0xc133('0x3d')]({'where':{'id':_0x3b200a[_0xc133('0x28')]['id']}})[_0xc133('0x19')](handleEntityNotFound(_0x1e0e2d,null))[_0xc133('0x19')](function(_0x47f59c){if(_0x47f59c){_0x1789c4=_0x47f59c[_0xc133('0x16')]({'plain':!![]});_0x25b64c[_0xc133('0x29')]=_[_0xc133('0x2a')](db[_0xc133('0x3e')][_0xc133('0x2b')]);_0x25b64c[_0xc133('0x2c')]=_[_0xc133('0x2a')](_0x3b200a[_0xc133('0x2c')]);_0x25b64c['filters']=_[_0xc133('0x2e')](_0x25b64c[_0xc133('0x29')],_0x25b64c[_0xc133('0x2c')]);_0x5437e2[_0xc133('0x2f')]=_[_0xc133('0x2e')](_0x25b64c[_0xc133('0x29')],qs[_0xc133('0x30')](_0x3b200a[_0xc133('0x2c')]['fields']));_0x5437e2[_0xc133('0x2f')]=_0x5437e2['attributes']['length']?_0x5437e2[_0xc133('0x2f')]:_0x25b64c[_0xc133('0x29')];if(!_0x3b200a[_0xc133('0x2c')][_0xc133('0x3f')]('nolimit')){_0x5437e2[_0xc133('0x10')]=qs[_0xc133('0x10')](_0x3b200a[_0xc133('0x2c')][_0xc133('0x10')]);_0x5437e2[_0xc133('0x12')]=qs[_0xc133('0x12')](_0x3b200a[_0xc133('0x2c')][_0xc133('0x12')]);}_0x5437e2[_0xc133('0x40')]=qs[_0xc133('0x41')](_0x3b200a[_0xc133('0x2c')][_0xc133('0x41')]);_0x5437e2[_0xc133('0x42')]=qs[_0xc133('0x2d')](_[_0xc133('0x43')](_0x3b200a['query'],_0x25b64c[_0xc133('0x2d')]));_0x5437e2[_0xc133('0x42')][_0xc133('0x44')]=_0x47f59c['id'];if(_0x3b200a[_0xc133('0x2c')]['filter']){_0x5437e2[_0xc133('0x42')]=_[_0xc133('0x45')](_0x5437e2[_0xc133('0x42')],{'$or':_[_0xc133('0x1f')](_0x5437e2[_0xc133('0x2f')],function(_0x4b8b3b){var _0x5749b4={};_0x5749b4[_0x4b8b3b]={'$like':'%'+_0x3b200a[_0xc133('0x2c')][_0xc133('0x46')]+'%'};return _0x5749b4;})});}_0x5437e2=_[_0xc133('0x45')]({},_0x5437e2,_0x3b200a[_0xc133('0x33')]);return db[_0xc133('0x3e')][_0xc133('0x47')](_0x5437e2);}})['then'](function(_0x2bcb54){if(_0x2bcb54){return db['User'][_0xc133('0x48')]({'where':{'id':_[_0xc133('0x1f')](_0x2bcb54,'UserId'),'role':'agent'},'attributes':['id','name',_0xc133('0x49'),'updatedAt',_0xc133('0x4a')]});}})[_0xc133('0x19')](function(_0x18241f){if(_0x18241f){return{'count':_0x18241f[_0xc133('0x11')],'rows':_[_0xc133('0x1f')](_0x18241f[_0xc133('0x25')],function(_0x905a42){return{'membername':_0x905a42['name'],'UserId':_0x905a42['id'],'queue_name':_0x1789c4[_0xc133('0x1c')],'ChatQueueId':_0x1789c4['id'],'interface':util[_0xc133('0x4b')](_0xc133('0x4c'),'SIP',_0x905a42[_0xc133('0x1c')]),'penalty':0x0,'paused':_0x905a42[_0xc133('0x49')],'createdAt':_0x905a42['createdAt'],'updatedAt':_0x905a42['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc133('0x19')](respondWithFilteredResult(_0x1e0e2d,_0x5437e2))[_0xc133('0x26')](handleError(_0x1e0e2d,null));};exports[_0xc133('0x4d')]=function(_0x5107bc,_0x5a11e5){var _0x22b9ed={};var _0x49f9c4={};var _0x419b84;var _0x524142;return db[_0xc133('0x20')][_0xc133('0x3d')]({'where':{'id':_0x5107bc[_0xc133('0x28')]['id']}})['then'](handleEntityNotFound(_0x5a11e5,null))[_0xc133('0x19')](function(_0x38966a){if(_0x38966a){_0x419b84=_0x38966a;_0x49f9c4[_0xc133('0x29')]=_[_0xc133('0x2a')](db[_0xc133('0x4e')][_0xc133('0x2b')]);_0x49f9c4[_0xc133('0x2c')]=_['keys'](_0x5107bc['query']);_0x49f9c4[_0xc133('0x2d')]=_['intersection'](_0x49f9c4[_0xc133('0x29')],_0x49f9c4[_0xc133('0x2c')]);_0x22b9ed['attributes']=_[_0xc133('0x2e')](_0x49f9c4[_0xc133('0x29')],qs[_0xc133('0x30')](_0x5107bc[_0xc133('0x2c')][_0xc133('0x30')]));_0x22b9ed[_0xc133('0x2f')]=_0x22b9ed[_0xc133('0x2f')][_0xc133('0x31')]?_0x22b9ed[_0xc133('0x2f')]:_0x49f9c4[_0xc133('0x29')];_0x22b9ed[_0xc133('0x40')]=qs[_0xc133('0x41')](_0x5107bc[_0xc133('0x2c')][_0xc133('0x41')]);_0x22b9ed[_0xc133('0x42')]=qs['filters'](_[_0xc133('0x43')](_0x5107bc['query'],_0x49f9c4[_0xc133('0x2d')]));if(_0x5107bc[_0xc133('0x2c')][_0xc133('0x46')]){_0x22b9ed[_0xc133('0x42')]=_['merge'](_0x22b9ed[_0xc133('0x42')],{'$or':_[_0xc133('0x1f')](_0x22b9ed[_0xc133('0x2f')],function(_0x47588c){var _0x5f0681={};_0x5f0681[_0x47588c]={'$like':'%'+_0x5107bc[_0xc133('0x2c')]['filter']+'%'};return _0x5f0681;})});}_0x22b9ed=_[_0xc133('0x45')]({},_0x22b9ed,_0x5107bc[_0xc133('0x33')]);return _0x419b84[_0xc133('0x4d')](_0x22b9ed);}})[_0xc133('0x19')](function(_0x16d287){if(_0x16d287){_0x524142=_0x16d287[_0xc133('0x31')];if(!_0x5107bc[_0xc133('0x2c')][_0xc133('0x3f')](_0xc133('0x4f'))){_0x22b9ed['limit']=qs[_0xc133('0x10')](_0x5107bc[_0xc133('0x2c')][_0xc133('0x10')]);_0x22b9ed[_0xc133('0x12')]=qs[_0xc133('0x12')](_0x5107bc['query'][_0xc133('0x12')]);}return _0x419b84['getTeams'](_0x22b9ed);}})[_0xc133('0x19')](function(_0x4ef948){if(_0x4ef948){return _0x4ef948?{'count':_0x524142,'rows':_0x4ef948}:null;}})[_0xc133('0x19')](respondWithResult(_0x5a11e5,null))[_0xc133('0x26')](handleError(_0x5a11e5,null));};exports[_0xc133('0x50')]=function(_0x5144ef,_0x645759){var _0x414cd5=_0x5144ef[_0xc133('0x36')]['ids'];return db[_0xc133('0x4e')][_0xc133('0x47')]({'where':{'id':_0x414cd5},'attributes':['id'],'include':[{'model':db[_0xc133('0x51')],'as':_0xc133('0x52'),'attributes':['id',_0xc133('0x1c'),_0xc133('0x53'),_0xc133('0x54'),_0xc133('0x55')],'raw':!![]}]})[_0xc133('0x19')](function(_0x27e672){if(_0x27e672){var _0x4e485e=_[_0xc133('0x56')](_0x27e672,function(_0x14f3c4){var _0x31760b=_0x14f3c4[_0xc133('0x16')]({'plain':!![]});return _0x31760b[_0xc133('0x52')];});return db[_0xc133('0x20')][_0xc133('0x34')]({'where':{'id':_0x5144ef[_0xc133('0x28')]['id']}})['then'](function(_0x8e9b4a){return db[_0xc133('0x57')][_0xc133('0x58')](function(_0x49be0f){return _0x8e9b4a[_0xc133('0x50')](_0x414cd5,{'transaction':_0x49be0f})['then'](function(){return BPromise[_0xc133('0x59')](_0x4e485e,function(_0x3845b6){return db[_0xc133('0x3e')][_0xc133('0x5a')]({'where':{'UserId':_0x3845b6['id'],'ChatQueueId':_0x5144ef[_0xc133('0x28')]['id']},'transaction':_0x49be0f});});})[_0xc133('0x19')](function(){_0x4e485e[_0xc133('0x5b')](function(_0x176723){socket[_0xc133('0x5c')](_0xc133('0x5d'),{'UserId':_0x176723['id'],'ChatQueueId':_0x8e9b4a['id']});});});});});}})['then'](respondWithStatusCode(_0x645759,null))[_0xc133('0x26')](handleError(_0x645759,null));};exports[_0xc133('0x5e')]=function(_0x21c025,_0x322cf5){return db[_0xc133('0x4e')]['findAll']({'where':{'id':_0x21c025['query'][_0xc133('0x5f')]},'attributes':['id'],'include':[{'model':db[_0xc133('0x51')],'as':_0xc133('0x52'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x322cf5,null))[_0xc133('0x19')](function(_0x174ebf){var _0x31de45=_['map'](_0x174ebf,'id');var _0xba4fa9=[];var _0x4a07e4=[];var _0xa5af46=squel[_0xc133('0x60')]();_0xa5af46[_0xc133('0x61')](_0xc133('0x62'))[_0xc133('0x63')](_0xc133('0x64'),'tq')['join'](_0xc133('0x65'),'ut',_0xc133('0x66'))[_0xc133('0x42')](_0xc133('0x67'),_0x21c025[_0xc133('0x28')]['id']);for(var _0x52d9e9=0x0;_0x52d9e9<_0x174ebf[_0xc133('0x31')];_0x52d9e9+=0x1){let _0x24f988=_0x174ebf[_0x52d9e9];for(var _0x322275=0x0;_0x322275<_0x24f988['Agents']['length'];_0x322275+=0x1){let _0x1ed432=_0x24f988[_0xc133('0x52')][_0x322275];var _0x1d8ed6=_0xa5af46[_0xc133('0x68')]();_0x1d8ed6[_0xc133('0x42')](_0xc133('0x69'),_0x1ed432['id']);_0x4a07e4[_0xc133('0x6a')](db[_0xc133('0x57')][_0xc133('0x2c')](_0x1d8ed6['toString'](),{'type':db['sequelize'][_0xc133('0x6b')][_0xc133('0x6c')]})[_0xc133('0x19')](function(_0x2ab6f9){if(_0x2ab6f9[_0xc133('0x31')]===0x1){return _0x1ed432['id'];}else{var _0x2a5981=_[_0xc133('0x6d')](_[_0xc133('0x1f')](_0x2ab6f9,'TeamId'),function(_0x187a75){return _['includes'](_0x31de45,_0x187a75);});if(_0x2a5981){return _0x1ed432['id'];}}}));}}return BPromise[_0xc133('0x6e')](_0x4a07e4)[_0xc133('0x19')](function(_0x4ed619){_0xba4fa9=_(_0xba4fa9)[_0xc133('0x6f')](_0x4ed619)[_0xc133('0x70')]()[_0xc133('0x71')]();return db[_0xc133('0x20')][_0xc133('0x34')]({'where':{'id':_0x21c025[_0xc133('0x28')]['id']}})[_0xc133('0x19')](function(_0x53a27e){return db['sequelize'][_0xc133('0x58')](function(_0x2d0418){return _0x53a27e[_0xc133('0x5e')](_0x21c025['query'][_0xc133('0x5f')],{'transaction':_0x2d0418})[_0xc133('0x19')](function(){if(!_[_0xc133('0x72')](_0xba4fa9)){return _0x53a27e[_0xc133('0x73')](_0xba4fa9,{'transaction':_0x2d0418});}})[_0xc133('0x19')](function(){_0xba4fa9[_0xc133('0x5b')](function(_0xb6e213){socket[_0xc133('0x5c')](_0xc133('0x74'),{'UserId':_0xb6e213,'ChatQueueId':_0x53a27e['id']});});});});});});})[_0xc133('0x19')](respondWithStatusCode(_0x322cf5,null))[_0xc133('0x26')](handleError(_0x322cf5,null));};exports[_0xc133('0x75')]=function(_0x4d2d78,_0x3a1fb1){return db['ChatQueue'][_0xc133('0x34')]({'where':{'id':_0x4d2d78[_0xc133('0x28')]['id']}})['then'](handleEntityNotFound(_0x3a1fb1,null))[_0xc133('0x19')](function(_0x340522){if(_0x340522){return _0x340522['addAgents'](_0x4d2d78[_0xc133('0x36')]['ids'],_[_0xc133('0x76')](_0x4d2d78['body'],[_0xc133('0x5f'),'id'])||{})['spread'](function(_0x3b6f25){for(var _0x192f93=0x0;_0x192f93<_0x4d2d78[_0xc133('0x36')][_0xc133('0x5f')][_0xc133('0x31')];_0x192f93+=0x1){socket['emit'](_0xc133('0x5d'),{'UserId':Number(_0x4d2d78['body'][_0xc133('0x5f')][_0x192f93]),'ChatQueueId':Number(_0x4d2d78[_0xc133('0x28')]['id'])});}return _0x3b6f25;});}})[_0xc133('0x19')](respondWithResult(_0x3a1fb1,null))[_0xc133('0x26')](handleError(_0x3a1fb1,null));};exports[_0xc133('0x73')]=function(_0xca2572,_0x55abdb){return db[_0xc133('0x20')]['find']({'where':{'id':_0xca2572[_0xc133('0x28')]['id']}})[_0xc133('0x19')](handleEntityNotFound(_0x55abdb,null))[_0xc133('0x19')](function(_0xf57a16){if(_0xf57a16){return _0xf57a16[_0xc133('0x73')](_0xca2572['query'][_0xc133('0x5f')])[_0xc133('0x19')](function(){if(_['isArray'](_0xca2572[_0xc133('0x2c')]['ids'])){for(var _0x12ba59=0x0;_0x12ba59<_0xca2572['query'][_0xc133('0x5f')][_0xc133('0x31')];_0x12ba59+=0x1){socket[_0xc133('0x5c')](_0xc133('0x74'),{'UserId':Number(_0xca2572[_0xc133('0x2c')][_0xc133('0x5f')][_0x12ba59]),'ChatQueueId':Number(_0xca2572[_0xc133('0x28')]['id'])});}}else{socket[_0xc133('0x5c')](_0xc133('0x74'),{'UserId':Number(_0xca2572[_0xc133('0x2c')][_0xc133('0x5f')]),'ChatQueueId':Number(_0xca2572['params']['id'])});}});}})[_0xc133('0x19')](respondWithStatusCode(_0x55abdb,null))[_0xc133('0x26')](handleError(_0x55abdb,null));};exports['getAgents']=function(_0x169e33,_0x3bdf52){var _0x4dc4fd={};var _0x5e98ca={};var _0x47dc0d;var _0x35f865;return db[_0xc133('0x20')]['findOne']({'where':{'id':_0x169e33[_0xc133('0x28')]['id']}})[_0xc133('0x19')](handleEntityNotFound(_0x3bdf52,null))['then'](function(_0x9da301){if(_0x9da301){_0x47dc0d=_0x9da301;_0x5e98ca[_0xc133('0x29')]=_[_0xc133('0x2a')](db[_0xc133('0x51')][_0xc133('0x2b')]);_0x5e98ca[_0xc133('0x2c')]=_[_0xc133('0x2a')](_0x169e33[_0xc133('0x2c')]);_0x5e98ca[_0xc133('0x2d')]=_['intersection'](_0x5e98ca[_0xc133('0x29')],_0x5e98ca[_0xc133('0x2c')]);_0x4dc4fd[_0xc133('0x2f')]=_[_0xc133('0x2e')](_0x5e98ca[_0xc133('0x29')],qs[_0xc133('0x30')](_0x169e33[_0xc133('0x2c')][_0xc133('0x30')]));_0x4dc4fd[_0xc133('0x2f')]=_0x4dc4fd[_0xc133('0x2f')]['length']?_0x4dc4fd['attributes']:_0x5e98ca[_0xc133('0x29')];_0x4dc4fd[_0xc133('0x40')]=qs[_0xc133('0x41')](_0x169e33[_0xc133('0x2c')]['sort']);_0x4dc4fd[_0xc133('0x42')]=qs[_0xc133('0x2d')](_[_0xc133('0x43')](_0x169e33[_0xc133('0x2c')],_0x5e98ca[_0xc133('0x2d')]));if(_0x169e33[_0xc133('0x2c')]['filter']){_0x4dc4fd['where']=_[_0xc133('0x45')](_0x4dc4fd[_0xc133('0x42')],{'$or':_['map'](_0x4dc4fd[_0xc133('0x2f')],function(_0x310431){var _0x2a1d4c={};_0x2a1d4c[_0x310431]={'$like':'%'+_0x169e33[_0xc133('0x2c')][_0xc133('0x46')]+'%'};return _0x2a1d4c;})});}_0x4dc4fd=_[_0xc133('0x45')]({},_0x4dc4fd,_0x169e33[_0xc133('0x33')]);return _0x47dc0d[_0xc133('0x77')](_0x4dc4fd);}})[_0xc133('0x19')](function(_0x40d4b9){if(_0x40d4b9){_0x35f865=_0x40d4b9[_0xc133('0x31')];if(!_0x169e33['query'][_0xc133('0x3f')](_0xc133('0x4f'))){_0x4dc4fd[_0xc133('0x10')]=qs[_0xc133('0x10')](_0x169e33[_0xc133('0x2c')][_0xc133('0x10')]);_0x4dc4fd[_0xc133('0x12')]=qs[_0xc133('0x12')](_0x169e33[_0xc133('0x2c')][_0xc133('0x12')]);}return _0x47dc0d[_0xc133('0x77')](_0x4dc4fd);}})['then'](function(_0x2676b8){if(_0x2676b8){return _0x2676b8?{'count':_0x35f865,'rows':_0x2676b8}:null;}})[_0xc133('0x19')](respondWithResult(_0x3bdf52,null))['catch'](handleError(_0x3bdf52,null));};
\ No newline at end of file
+var _0x6b3a=['push','sequelize','toString','QueryTypes','SELECT','every','includes','all','isEmpty','addAgents','omit','userChatQueue:save','removeAgents','userChatQueue:remove','order','getAgents','hasOwnProperty','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','destroy','ChatQueues','UserProfileResource','then','send','index','ChatQueue','rawAttributes','fieldName','type','getOptions','include','query','findAll','rows','model','keys','filters','attributes','intersection','fields','length','includeAll','merge','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','getMembers','nolimit','sort','where','pick','ChatQueueId','filter','map','UserChatQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','Agents','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?'];(function(_0xd6a1c9,_0x203324){var _0x51ea29=function(_0x165a30){while(--_0x165a30){_0xd6a1c9['push'](_0xd6a1c9['shift']());}};_0x51ea29(++_0x203324);}(_0x6b3a,0x17c));var _0xa6b3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b3a[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xa6b3('0x0'));var util=require(_0xa6b3('0x1'));var _=require(_0xa6b3('0x2'));var squel=require(_0xa6b3('0x3'));var Redis=require(_0xa6b3('0x4'));var qs=require(_0xa6b3('0x5'));var logger=require('../../config/logger')(_0xa6b3('0x6'));var config=require(_0xa6b3('0x7'));var db=require(_0xa6b3('0x8'))['db'];config['redis']=_[_0xa6b3('0x9')](config[_0xa6b3('0xa')],{'host':_0xa6b3('0xb'),'port':0x18eb});var socket=require(_0xa6b3('0xc'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xa6b3('0xd')](socket);function respondWithStatusCode(_0x1d1ef8,_0x1d52a9){_0x1d52a9=_0x1d52a9||0xcc;return function(_0x43c67f){if(_0x43c67f){return _0x1d1ef8[_0xa6b3('0xe')](_0x1d52a9);}return _0x1d1ef8[_0xa6b3('0xf')](_0x1d52a9)[_0xa6b3('0x10')]();};}function respondWithResult(_0x4a6d8c,_0x498bd0){_0x498bd0=_0x498bd0||0xc8;return function(_0x1f8821){if(_0x1f8821){return _0x4a6d8c[_0xa6b3('0xf')](_0x498bd0)[_0xa6b3('0x11')](_0x1f8821);}};}function respondWithFilteredResult(_0x312b62,_0x4dd876){return function(_0x10da06){if(_0x10da06){var _0x20f073=typeof _0x4dd876[_0xa6b3('0x12')]==='undefined'&&typeof _0x4dd876[_0xa6b3('0x13')]===_0xa6b3('0x14');var _0x4413d2=_0x10da06[_0xa6b3('0x15')];var _0x1b37d1=_0x20f073?0x0:_0x4dd876['offset'];var _0x4067d9=_0x20f073?_0x10da06[_0xa6b3('0x15')]:_0x4dd876[_0xa6b3('0x12')]+_0x4dd876[_0xa6b3('0x13')];var _0x3efd35;if(_0x4067d9>=_0x4413d2){_0x4067d9=_0x4413d2;_0x3efd35=0xc8;}else{_0x3efd35=0xce;}_0x312b62[_0xa6b3('0xf')](_0x3efd35);return _0x312b62[_0xa6b3('0x16')](_0xa6b3('0x17'),_0x1b37d1+'-'+_0x4067d9+'/'+_0x4413d2)[_0xa6b3('0x11')](_0x10da06);}return null;};}function saveUpdates(_0x105d01){return function(_0x31bcfd){if(_0x31bcfd){return _0x31bcfd['update'](_0x105d01)['then'](function(_0x1f16cf){return _0x1f16cf;});}return null;};}function removeEntity(_0x42b933){return function(_0x42d924){if(_0x42d924){return _0x42d924[_0xa6b3('0x18')]()['then'](function(){var _0x57f680=_0x42d924['get']({'plain':!![]});var _0x3599eb=_0xa6b3('0x19');return db[_0xa6b3('0x1a')][_0xa6b3('0x18')]({'where':{'type':_0x3599eb,'resourceId':_0x57f680['id']}})[_0xa6b3('0x1b')](function(){return _0x42d924;});})[_0xa6b3('0x1b')](function(){_0x42b933[_0xa6b3('0xf')](0xcc)[_0xa6b3('0x10')]();});}};}function handleEntityNotFound(_0x5234b7){return function(_0x4ce018){if(!_0x4ce018){_0x5234b7[_0xa6b3('0xe')](0x194);}return _0x4ce018;};}function handleError(_0x2388eb,_0x22161b){_0x22161b=_0x22161b||0x1f4;return function(_0x158e02){logger['error'](_0x158e02['stack']);if(_0x158e02['name']){delete _0x158e02['name'];}_0x2388eb[_0xa6b3('0xf')](_0x22161b)[_0xa6b3('0x1c')](_0x158e02);};}exports[_0xa6b3('0x1d')]=function(_0x15e88f,_0xaa7f39){var _0x8e4f6c={};var _0x110565={'count':0x0,'rows':[]};var _0x56dfd3=_['map'](db[_0xa6b3('0x1e')][_0xa6b3('0x1f')],function(_0xca6802){return{'name':_0xca6802[_0xa6b3('0x20')],'type':_0xca6802[_0xa6b3('0x21')]['key']};});_0x8e4f6c=qs[_0xa6b3('0x22')](_0x56dfd3,_0x15e88f);var _0x109c28={'where':_0x8e4f6c['where']};return db[_0xa6b3('0x1e')][_0xa6b3('0x15')](_0x109c28)['then'](function(_0x2e4861){_0x110565[_0xa6b3('0x15')]=_0x2e4861;_0x8e4f6c[_0xa6b3('0x23')]=qs[_0xa6b3('0x23')](_0x15e88f[_0xa6b3('0x24')]);return db['ChatQueue'][_0xa6b3('0x25')](_0x8e4f6c);})[_0xa6b3('0x1b')](function(_0x1a8914){_0x110565[_0xa6b3('0x26')]=_0x1a8914;return _0x110565;})[_0xa6b3('0x1b')](respondWithFilteredResult(_0xaa7f39,_0x8e4f6c))['catch'](handleError(_0xaa7f39,null));};exports['show']=function(_0x4c001b,_0x5eee57){var _0x1762cc={'raw':!![],'where':{'id':_0x4c001b['params']['id']}},_0x60b1e6={};_0x60b1e6[_0xa6b3('0x27')]=_[_0xa6b3('0x28')](db['ChatQueue']['rawAttributes']);_0x60b1e6[_0xa6b3('0x24')]=_[_0xa6b3('0x28')](_0x4c001b[_0xa6b3('0x24')]);_0x60b1e6[_0xa6b3('0x29')]=_['intersection'](_0x60b1e6[_0xa6b3('0x27')],_0x60b1e6['query']);_0x1762cc[_0xa6b3('0x2a')]=_[_0xa6b3('0x2b')](_0x60b1e6[_0xa6b3('0x27')],qs[_0xa6b3('0x2c')](_0x4c001b[_0xa6b3('0x24')][_0xa6b3('0x2c')]));_0x1762cc[_0xa6b3('0x2a')]=_0x1762cc[_0xa6b3('0x2a')][_0xa6b3('0x2d')]?_0x1762cc[_0xa6b3('0x2a')]:_0x60b1e6[_0xa6b3('0x27')];if(_0x4c001b[_0xa6b3('0x24')][_0xa6b3('0x2e')]){_0x1762cc['include']=[{'all':!![]}];}_0x1762cc=_[_0xa6b3('0x2f')]({},_0x1762cc,_0x4c001b[_0xa6b3('0x30')]);return db[_0xa6b3('0x1e')][_0xa6b3('0x31')](_0x1762cc)[_0xa6b3('0x1b')](handleEntityNotFound(_0x5eee57,null))[_0xa6b3('0x1b')](respondWithResult(_0x5eee57,null))[_0xa6b3('0x32')](handleError(_0x5eee57,null));};exports['create']=function(_0x38dd49,_0x1a41d3){return db[_0xa6b3('0x1e')][_0xa6b3('0x33')](_0x38dd49['body'],{})[_0xa6b3('0x1b')](function(_0x169519){var _0x4a090a=_0x38dd49[_0xa6b3('0x34')]['get']({'plain':!![]});if(!_0x4a090a)throw new Error(_0xa6b3('0x35'));if(_0x4a090a['role']===_0xa6b3('0x34')){var _0x2265c1=_0x169519[_0xa6b3('0x36')]({'plain':!![]});var _0x4a9ce4=_0xa6b3('0x19');return db['UserProfileSection'][_0xa6b3('0x31')]({'where':{'name':_0x4a9ce4,'userProfileId':_0x4a090a['userProfileId']},'raw':!![]})['then'](function(_0x3d9c43){if(_0x3d9c43&&_0x3d9c43[_0xa6b3('0x37')]===0x0){return db[_0xa6b3('0x1a')][_0xa6b3('0x33')]({'name':_0x2265c1[_0xa6b3('0x38')],'resourceId':_0x2265c1['id'],'type':_0x3d9c43[_0xa6b3('0x38')],'sectionId':_0x3d9c43['id']},{})[_0xa6b3('0x1b')](function(){return _0x169519;});}else{return _0x169519;}})[_0xa6b3('0x32')](function(_0x12b01d){logger[_0xa6b3('0x39')](_0xa6b3('0x3a'),_0x12b01d);throw _0x12b01d;});}return _0x169519;})[_0xa6b3('0x1b')](respondWithResult(_0x1a41d3,0xc9))[_0xa6b3('0x32')](handleError(_0x1a41d3,null));};exports[_0xa6b3('0x3b')]=function(_0x4265e9,_0xe421a4){if(_0x4265e9[_0xa6b3('0x3c')]['id']){delete _0x4265e9['body']['id'];}return db[_0xa6b3('0x1e')][_0xa6b3('0x31')]({'where':{'id':_0x4265e9[_0xa6b3('0x3d')]['id']}})[_0xa6b3('0x1b')](handleEntityNotFound(_0xe421a4,null))[_0xa6b3('0x1b')](saveUpdates(_0x4265e9[_0xa6b3('0x3c')],null))[_0xa6b3('0x1b')](respondWithResult(_0xe421a4,null))['catch'](handleError(_0xe421a4,null));};exports['destroy']=function(_0x397b3d,_0x59b450){return db[_0xa6b3('0x1e')][_0xa6b3('0x31')]({'where':{'id':_0x397b3d[_0xa6b3('0x3d')]['id']}})[_0xa6b3('0x1b')](handleEntityNotFound(_0x59b450,null))[_0xa6b3('0x1b')](removeEntity(_0x59b450,null))[_0xa6b3('0x32')](handleError(_0x59b450,null));};exports[_0xa6b3('0x3e')]=function(_0xd0957a,_0xe71e15){return db['ChatQueue'][_0xa6b3('0x3e')]()['then'](respondWithResult(_0xe71e15,null))[_0xa6b3('0x32')](handleError(_0xe71e15,null));};exports[_0xa6b3('0x3f')]=function(_0x328207,_0x255886){var _0x2161ca={'raw':!![],'where':{}},_0x18df8e={},_0x5c7394;return db['ChatQueue']['findOne']({'where':{'id':_0x328207[_0xa6b3('0x3d')]['id']}})['then'](handleEntityNotFound(_0x255886,null))['then'](function(_0x37e28b){if(_0x37e28b){_0x5c7394=_0x37e28b['get']({'plain':!![]});_0x18df8e[_0xa6b3('0x27')]=_[_0xa6b3('0x28')](db['UserChatQueue'][_0xa6b3('0x1f')]);_0x18df8e[_0xa6b3('0x24')]=_[_0xa6b3('0x28')](_0x328207[_0xa6b3('0x24')]);_0x18df8e[_0xa6b3('0x29')]=_[_0xa6b3('0x2b')](_0x18df8e['model'],_0x18df8e['query']);_0x2161ca[_0xa6b3('0x2a')]=_[_0xa6b3('0x2b')](_0x18df8e[_0xa6b3('0x27')],qs[_0xa6b3('0x2c')](_0x328207['query']['fields']));_0x2161ca[_0xa6b3('0x2a')]=_0x2161ca['attributes'][_0xa6b3('0x2d')]?_0x2161ca[_0xa6b3('0x2a')]:_0x18df8e[_0xa6b3('0x27')];if(!_0x328207[_0xa6b3('0x24')]['hasOwnProperty'](_0xa6b3('0x40'))){_0x2161ca[_0xa6b3('0x13')]=qs[_0xa6b3('0x13')](_0x328207[_0xa6b3('0x24')]['limit']);_0x2161ca[_0xa6b3('0x12')]=qs[_0xa6b3('0x12')](_0x328207[_0xa6b3('0x24')][_0xa6b3('0x12')]);}_0x2161ca['order']=qs[_0xa6b3('0x41')](_0x328207['query'][_0xa6b3('0x41')]);_0x2161ca[_0xa6b3('0x42')]=qs[_0xa6b3('0x29')](_[_0xa6b3('0x43')](_0x328207[_0xa6b3('0x24')],_0x18df8e['filters']));_0x2161ca['where'][_0xa6b3('0x44')]=_0x37e28b['id'];if(_0x328207[_0xa6b3('0x24')][_0xa6b3('0x45')]){_0x2161ca[_0xa6b3('0x42')]=_[_0xa6b3('0x2f')](_0x2161ca[_0xa6b3('0x42')],{'$or':_[_0xa6b3('0x46')](_0x2161ca[_0xa6b3('0x2a')],function(_0x596647){var _0x3b213d={};_0x3b213d[_0x596647]={'$like':'%'+_0x328207['query'][_0xa6b3('0x45')]+'%'};return _0x3b213d;})});}_0x2161ca=_[_0xa6b3('0x2f')]({},_0x2161ca,_0x328207[_0xa6b3('0x30')]);return db[_0xa6b3('0x47')]['findAll'](_0x2161ca);}})[_0xa6b3('0x1b')](function(_0x5ae544){if(_0x5ae544){return db[_0xa6b3('0x48')][_0xa6b3('0x49')]({'where':{'id':_[_0xa6b3('0x46')](_0x5ae544,_0xa6b3('0x4a')),'role':_0xa6b3('0x4b')},'attributes':['id',_0xa6b3('0x38'),'chatPause',_0xa6b3('0x4c'),_0xa6b3('0x4d')]});}})[_0xa6b3('0x1b')](function(_0x379847){if(_0x379847){return{'count':_0x379847[_0xa6b3('0x15')],'rows':_[_0xa6b3('0x46')](_0x379847[_0xa6b3('0x26')],function(_0x379932){return{'membername':_0x379932[_0xa6b3('0x38')],'UserId':_0x379932['id'],'queue_name':_0x5c7394[_0xa6b3('0x38')],'ChatQueueId':_0x5c7394['id'],'interface':util[_0xa6b3('0x4e')](_0xa6b3('0x4f'),'SIP',_0x379932['name']),'penalty':0x0,'paused':_0x379932['chatPause'],'createdAt':_0x379932[_0xa6b3('0x4d')],'updatedAt':_0x379932['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa6b3('0x1b')](respondWithFilteredResult(_0x255886,_0x2161ca))[_0xa6b3('0x32')](handleError(_0x255886,null));};exports[_0xa6b3('0x50')]=function(_0x183023,_0x5acf69){var _0xcb35e7={};var _0x5e8e5c={};var _0x419cac;var _0x99608;return db[_0xa6b3('0x1e')][_0xa6b3('0x51')]({'where':{'id':_0x183023['params']['id']}})[_0xa6b3('0x1b')](handleEntityNotFound(_0x5acf69,null))[_0xa6b3('0x1b')](function(_0x126ad1){if(_0x126ad1){_0x419cac=_0x126ad1;_0x5e8e5c[_0xa6b3('0x27')]=_['keys'](db[_0xa6b3('0x52')][_0xa6b3('0x1f')]);_0x5e8e5c[_0xa6b3('0x24')]=_['keys'](_0x183023[_0xa6b3('0x24')]);_0x5e8e5c[_0xa6b3('0x29')]=_[_0xa6b3('0x2b')](_0x5e8e5c[_0xa6b3('0x27')],_0x5e8e5c[_0xa6b3('0x24')]);_0xcb35e7[_0xa6b3('0x2a')]=_['intersection'](_0x5e8e5c[_0xa6b3('0x27')],qs[_0xa6b3('0x2c')](_0x183023[_0xa6b3('0x24')][_0xa6b3('0x2c')]));_0xcb35e7[_0xa6b3('0x2a')]=_0xcb35e7[_0xa6b3('0x2a')][_0xa6b3('0x2d')]?_0xcb35e7['attributes']:_0x5e8e5c[_0xa6b3('0x27')];_0xcb35e7['order']=qs[_0xa6b3('0x41')](_0x183023[_0xa6b3('0x24')][_0xa6b3('0x41')]);_0xcb35e7['where']=qs[_0xa6b3('0x29')](_['pick'](_0x183023['query'],_0x5e8e5c[_0xa6b3('0x29')]));if(_0x183023[_0xa6b3('0x24')]['filter']){_0xcb35e7[_0xa6b3('0x42')]=_[_0xa6b3('0x2f')](_0xcb35e7[_0xa6b3('0x42')],{'$or':_['map'](_0xcb35e7[_0xa6b3('0x2a')],function(_0x4fe33a){var _0x486234={};_0x486234[_0x4fe33a]={'$like':'%'+_0x183023[_0xa6b3('0x24')]['filter']+'%'};return _0x486234;})});}_0xcb35e7=_[_0xa6b3('0x2f')]({},_0xcb35e7,_0x183023[_0xa6b3('0x30')]);return _0x419cac[_0xa6b3('0x50')](_0xcb35e7);}})[_0xa6b3('0x1b')](function(_0x5fd978){if(_0x5fd978){_0x99608=_0x5fd978[_0xa6b3('0x2d')];if(!_0x183023[_0xa6b3('0x24')]['hasOwnProperty'](_0xa6b3('0x40'))){_0xcb35e7['limit']=qs['limit'](_0x183023[_0xa6b3('0x24')][_0xa6b3('0x13')]);_0xcb35e7[_0xa6b3('0x12')]=qs['offset'](_0x183023['query'][_0xa6b3('0x12')]);}return _0x419cac[_0xa6b3('0x50')](_0xcb35e7);}})[_0xa6b3('0x1b')](function(_0x4b0394){if(_0x4b0394){return _0x4b0394?{'count':_0x99608,'rows':_0x4b0394}:null;}})[_0xa6b3('0x1b')](respondWithResult(_0x5acf69,null))[_0xa6b3('0x32')](handleError(_0x5acf69,null));};exports[_0xa6b3('0x53')]=function(_0x20e4c5,_0x2a410b){var _0x2a89b9=_0x20e4c5[_0xa6b3('0x3c')][_0xa6b3('0x54')];return db[_0xa6b3('0x52')]['findAll']({'where':{'id':_0x2a89b9},'attributes':['id'],'include':[{'model':db[_0xa6b3('0x48')],'as':'Agents','attributes':['id','name',_0xa6b3('0x55'),_0xa6b3('0x56'),'interface'],'raw':!![]}]})['then'](function(_0x5520c1){if(_0x5520c1){var _0x344ea0=_[_0xa6b3('0x57')](_0x5520c1,function(_0x446542){var _0x5d7a03=_0x446542[_0xa6b3('0x36')]({'plain':!![]});return _0x5d7a03['Agents'];});return db[_0xa6b3('0x1e')][_0xa6b3('0x31')]({'where':{'id':_0x20e4c5[_0xa6b3('0x3d')]['id']}})[_0xa6b3('0x1b')](function(_0x36fdb4){return db['sequelize'][_0xa6b3('0x58')](function(_0x1db2d3){return _0x36fdb4['addTeams'](_0x2a89b9,{'transaction':_0x1db2d3})[_0xa6b3('0x1b')](function(){return BPromise[_0xa6b3('0x59')](_0x344ea0,function(_0x596b24){return db[_0xa6b3('0x47')][_0xa6b3('0x5a')]({'where':{'UserId':_0x596b24['id'],'ChatQueueId':_0x20e4c5[_0xa6b3('0x3d')]['id']},'transaction':_0x1db2d3});});})['then'](function(){_0x344ea0[_0xa6b3('0x5b')](function(_0x5c1ae4){socket[_0xa6b3('0x5c')]('userChatQueue:save',{'UserId':_0x5c1ae4['id'],'ChatQueueId':_0x36fdb4['id']});});});});});}})[_0xa6b3('0x1b')](respondWithStatusCode(_0x2a410b,null))[_0xa6b3('0x32')](handleError(_0x2a410b,null));};exports[_0xa6b3('0x5d')]=function(_0x15f836,_0x591e86){return db[_0xa6b3('0x52')]['findAll']({'where':{'id':_0x15f836[_0xa6b3('0x24')][_0xa6b3('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa6b3('0x5e'),'attributes':['id'],'raw':!![]}]})[_0xa6b3('0x1b')](handleEntityNotFound(_0x591e86,null))[_0xa6b3('0x1b')](function(_0x3929ce){var _0x5ebd47=_[_0xa6b3('0x46')](_0x3929ce,'id');var _0x42998f=[];var _0x4a71d9=[];var _0x5e31b5=squel[_0xa6b3('0x5f')]();_0x5e31b5[_0xa6b3('0x60')](_0xa6b3('0x61'))[_0xa6b3('0x62')](_0xa6b3('0x63'),'tq')[_0xa6b3('0x64')](_0xa6b3('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xa6b3('0x66'),_0x15f836[_0xa6b3('0x3d')]['id']);for(var _0xae2e18=0x0;_0xae2e18<_0x3929ce[_0xa6b3('0x2d')];_0xae2e18+=0x1){let _0x347418=_0x3929ce[_0xae2e18];for(var _0x1ed755=0x0;_0x1ed755<_0x347418[_0xa6b3('0x5e')][_0xa6b3('0x2d')];_0x1ed755+=0x1){let _0x2e5e56=_0x347418[_0xa6b3('0x5e')][_0x1ed755];var _0x49dd5f=_0x5e31b5['clone']();_0x49dd5f[_0xa6b3('0x42')](_0xa6b3('0x67'),_0x2e5e56['id']);_0x4a71d9[_0xa6b3('0x68')](db[_0xa6b3('0x69')][_0xa6b3('0x24')](_0x49dd5f[_0xa6b3('0x6a')](),{'type':db[_0xa6b3('0x69')][_0xa6b3('0x6b')][_0xa6b3('0x6c')]})[_0xa6b3('0x1b')](function(_0x2b99a9){if(_0x2b99a9[_0xa6b3('0x2d')]===0x1){return _0x2e5e56['id'];}else{var _0x3e931f=_[_0xa6b3('0x6d')](_[_0xa6b3('0x46')](_0x2b99a9,'TeamId'),function(_0x18b9c1){return _[_0xa6b3('0x6e')](_0x5ebd47,_0x18b9c1);});if(_0x3e931f){return _0x2e5e56['id'];}}}));}}return BPromise[_0xa6b3('0x6f')](_0x4a71d9)[_0xa6b3('0x1b')](function(_0x48dd84){_0x42998f=_(_0x42998f)['union'](_0x48dd84)['compact']()['value']();return db['ChatQueue'][_0xa6b3('0x31')]({'where':{'id':_0x15f836[_0xa6b3('0x3d')]['id']}})[_0xa6b3('0x1b')](function(_0x20dff5){return db[_0xa6b3('0x69')][_0xa6b3('0x58')](function(_0x8c02e8){return _0x20dff5[_0xa6b3('0x5d')](_0x15f836[_0xa6b3('0x24')]['ids'],{'transaction':_0x8c02e8})['then'](function(){if(!_[_0xa6b3('0x70')](_0x42998f)){return _0x20dff5['removeAgents'](_0x42998f,{'transaction':_0x8c02e8});}})['then'](function(){_0x42998f[_0xa6b3('0x5b')](function(_0x1bb730){socket[_0xa6b3('0x5c')]('userChatQueue:remove',{'UserId':_0x1bb730,'ChatQueueId':_0x20dff5['id']});});});});});});})['then'](respondWithStatusCode(_0x591e86,null))['catch'](handleError(_0x591e86,null));};exports[_0xa6b3('0x71')]=function(_0x3f26c1,_0x3dad4d){return db['ChatQueue']['find']({'where':{'id':_0x3f26c1['params']['id']}})[_0xa6b3('0x1b')](handleEntityNotFound(_0x3dad4d,null))[_0xa6b3('0x1b')](function(_0x1e4c3b){if(_0x1e4c3b){return _0x1e4c3b['addAgents'](_0x3f26c1[_0xa6b3('0x3c')][_0xa6b3('0x54')],_[_0xa6b3('0x72')](_0x3f26c1[_0xa6b3('0x3c')],[_0xa6b3('0x54'),'id'])||{})['spread'](function(_0x5cdda4){for(var _0x30f63d=0x0;_0x30f63d<_0x3f26c1[_0xa6b3('0x3c')][_0xa6b3('0x54')][_0xa6b3('0x2d')];_0x30f63d+=0x1){socket['emit'](_0xa6b3('0x73'),{'UserId':Number(_0x3f26c1[_0xa6b3('0x3c')][_0xa6b3('0x54')][_0x30f63d]),'ChatQueueId':Number(_0x3f26c1['params']['id'])});}return _0x5cdda4;});}})[_0xa6b3('0x1b')](respondWithResult(_0x3dad4d,null))[_0xa6b3('0x32')](handleError(_0x3dad4d,null));};exports[_0xa6b3('0x74')]=function(_0x235e8e,_0x388751){return db[_0xa6b3('0x1e')]['find']({'where':{'id':_0x235e8e[_0xa6b3('0x3d')]['id']}})[_0xa6b3('0x1b')](handleEntityNotFound(_0x388751,null))['then'](function(_0x25d3b0){if(_0x25d3b0){return _0x25d3b0[_0xa6b3('0x74')](_0x235e8e['query']['ids'])[_0xa6b3('0x1b')](function(){if(_['isArray'](_0x235e8e[_0xa6b3('0x24')][_0xa6b3('0x54')])){for(var _0x1bfc4a=0x0;_0x1bfc4a<_0x235e8e[_0xa6b3('0x24')][_0xa6b3('0x54')]['length'];_0x1bfc4a+=0x1){socket[_0xa6b3('0x5c')](_0xa6b3('0x75'),{'UserId':Number(_0x235e8e[_0xa6b3('0x24')][_0xa6b3('0x54')][_0x1bfc4a]),'ChatQueueId':Number(_0x235e8e[_0xa6b3('0x3d')]['id'])});}}else{socket[_0xa6b3('0x5c')](_0xa6b3('0x75'),{'UserId':Number(_0x235e8e[_0xa6b3('0x24')]['ids']),'ChatQueueId':Number(_0x235e8e[_0xa6b3('0x3d')]['id'])});}});}})[_0xa6b3('0x1b')](respondWithStatusCode(_0x388751,null))[_0xa6b3('0x32')](handleError(_0x388751,null));};exports['getAgents']=function(_0x5402cc,_0x35d4fd){var _0x1d8f65={};var _0x512229={};var _0x56519a;var _0x10d3df;return db[_0xa6b3('0x1e')][_0xa6b3('0x51')]({'where':{'id':_0x5402cc[_0xa6b3('0x3d')]['id']}})[_0xa6b3('0x1b')](handleEntityNotFound(_0x35d4fd,null))[_0xa6b3('0x1b')](function(_0x40c2f8){if(_0x40c2f8){_0x56519a=_0x40c2f8;_0x512229['model']=_[_0xa6b3('0x28')](db[_0xa6b3('0x48')][_0xa6b3('0x1f')]);_0x512229[_0xa6b3('0x24')]=_[_0xa6b3('0x28')](_0x5402cc['query']);_0x512229['filters']=_[_0xa6b3('0x2b')](_0x512229[_0xa6b3('0x27')],_0x512229['query']);_0x1d8f65[_0xa6b3('0x2a')]=_[_0xa6b3('0x2b')](_0x512229[_0xa6b3('0x27')],qs[_0xa6b3('0x2c')](_0x5402cc['query'][_0xa6b3('0x2c')]));_0x1d8f65['attributes']=_0x1d8f65[_0xa6b3('0x2a')]['length']?_0x1d8f65[_0xa6b3('0x2a')]:_0x512229[_0xa6b3('0x27')];_0x1d8f65[_0xa6b3('0x76')]=qs[_0xa6b3('0x41')](_0x5402cc[_0xa6b3('0x24')][_0xa6b3('0x41')]);_0x1d8f65[_0xa6b3('0x42')]=qs[_0xa6b3('0x29')](_[_0xa6b3('0x43')](_0x5402cc[_0xa6b3('0x24')],_0x512229[_0xa6b3('0x29')]));if(_0x5402cc[_0xa6b3('0x24')][_0xa6b3('0x45')]){_0x1d8f65[_0xa6b3('0x42')]=_[_0xa6b3('0x2f')](_0x1d8f65['where'],{'$or':_[_0xa6b3('0x46')](_0x1d8f65[_0xa6b3('0x2a')],function(_0x4cb711){var _0x5829c9={};_0x5829c9[_0x4cb711]={'$like':'%'+_0x5402cc['query'][_0xa6b3('0x45')]+'%'};return _0x5829c9;})});}_0x1d8f65=_[_0xa6b3('0x2f')]({},_0x1d8f65,_0x5402cc[_0xa6b3('0x30')]);return _0x56519a[_0xa6b3('0x77')](_0x1d8f65);}})[_0xa6b3('0x1b')](function(_0x2dbd69){if(_0x2dbd69){_0x10d3df=_0x2dbd69[_0xa6b3('0x2d')];if(!_0x5402cc[_0xa6b3('0x24')][_0xa6b3('0x78')](_0xa6b3('0x40'))){_0x1d8f65[_0xa6b3('0x13')]=qs[_0xa6b3('0x13')](_0x5402cc[_0xa6b3('0x24')]['limit']);_0x1d8f65['offset']=qs['offset'](_0x5402cc['query']['offset']);}return _0x56519a[_0xa6b3('0x77')](_0x1d8f65);}})[_0xa6b3('0x1b')](function(_0x25cb41){if(_0x25cb41){return _0x25cb41?{'count':_0x10d3df,'rows':_0x25cb41}:null;}})[_0xa6b3('0x1b')](respondWithResult(_0x35d4fd,null))[_0xa6b3('0x32')](handleError(_0x35d4fd,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 46ec30b..f2aaf39 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 _0x7fc4=['../../mysqldb','ChatQueue','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x5b40e4,_0xd9db24){var _0x59af32=function(_0x1ccf78){while(--_0x1ccf78){_0x5b40e4['push'](_0x5b40e4['shift']());}};_0x59af32(++_0xd9db24);}(_0x7fc4,0x8f));var _0x47fc=function(_0x2c1e30,_0x52d61e){_0x2c1e30=_0x2c1e30-0x0;var _0x891bcc=_0x7fc4[_0x2c1e30];return _0x891bcc;};'use strict';var EventEmitter=require(_0x47fc('0x0'));var ChatQueue=require(_0x47fc('0x1'))['db'][_0x47fc('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x47fc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x47fc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2148f7){return function(_0x3724b6,_0x3bcb71,_0x52f167){ChatQueueEvents[_0x47fc('0x5')](_0x2148f7+':'+_0x3724b6['id'],_0x3724b6);ChatQueueEvents['emit'](_0x2148f7,_0x3724b6);_0x52f167(null);};}for(var e in events){if(events[_0x47fc('0x6')](e)){var event=events[e];ChatQueue[_0x47fc('0x7')](e,emitEvent(event));}}module[_0x47fc('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x6057=['emit','hasOwnProperty','events','../../mysqldb','update','remove'];(function(_0x471969,_0x3397bc){var _0x3ee654=function(_0x147130){while(--_0x147130){_0x471969['push'](_0x471969['shift']());}};_0x3ee654(++_0x3397bc);}(_0x6057,0x8c));var _0x7605=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x6057[_0xf0bc07];return _0x1c50c2;};'use strict';var EventEmitter=require(_0x7605('0x0'));var ChatQueue=require(_0x7605('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7605('0x2'),'afterDestroy':_0x7605('0x3')};function emitEvent(_0x75d1d9){return function(_0x1425ff,_0x222bc7,_0x406c25){ChatQueueEvents[_0x7605('0x4')](_0x75d1d9+':'+_0x1425ff['id'],_0x1425ff);ChatQueueEvents['emit'](_0x75d1d9,_0x1425ff);_0x406c25(null);};}for(var e in events){if(events[_0x7605('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 2af17f6..1fd3d16 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 _0xa157=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','./chatQueue.attributes','exports','define','chat_queues'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0xa157,0x12c));var _0x7a15=function(_0x33d580,_0x177cf2){_0x33d580=_0x33d580-0x0;var _0x4cf904=_0xa157[_0x33d580];return _0x4cf904;};'use strict';var _=require(_0x7a15('0x0'));var util=require('util');var logger=require(_0x7a15('0x1'))(_0x7a15('0x2'));var moment=require('moment');var BPromise=require(_0x7a15('0x3'));var rp=require(_0x7a15('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a15('0x5'));var config=require('../../config/environment');var attributes=require(_0x7a15('0x6'));module[_0x7a15('0x7')]=function(_0x1f62ba,_0x5c45ac){return _0x1f62ba[_0x7a15('0x8')]('ChatQueue',attributes,{'tableName':_0x7a15('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7ca0=['moment','bluebird','request-promise','path','exports','lodash','../../config/logger'];(function(_0x5c5b4d,_0x3b4781){var _0x448a9e=function(_0x44710f){while(--_0x44710f){_0x5c5b4d['push'](_0x5c5b4d['shift']());}};_0x448a9e(++_0x3b4781);}(_0x7ca0,0x1cc));var _0x07ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7ca0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x07ca('0x0'));var util=require('util');var logger=require(_0x07ca('0x1'))('api');var moment=require(_0x07ca('0x2'));var BPromise=require(_0x07ca('0x3'));var rp=require(_0x07ca('0x4'));var fs=require('fs');var path=require(_0x07ca('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x07ca('0x6')]=function(_0x3bf799,_0x129ba1){return _0x3bf799['define']('ChatQueue',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 14b3c2a..c671035 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 _0x2162=['model','GetChatQueue','ShowChatQueue','ChatQueue','find','where','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','findAll','options','raw','limit','map','include','attributes'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x2162,0x110));var _0x2216=function(_0x24c15a,_0x261c48){_0x24c15a=_0x24c15a-0x0;var _0x2a3137=_0x2162[_0x24c15a];return _0x2a3137;};'use strict';var _=require('lodash');var util=require(_0x2216('0x0'));var moment=require('moment');var BPromise=require(_0x2216('0x1'));var rs=require(_0x2216('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2216('0x3'))['db'];var utils=require(_0x2216('0x4'));var logger=require('../../config/logger')(_0x2216('0x5'));var config=require(_0x2216('0x6'));var jayson=require(_0x2216('0x7'));var client=jayson['client'][_0x2216('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2216('0x9')],{'host':_0x2216('0xa'),'port':0x18eb});var socket=require(_0x2216('0xb'))(new Redis(config[_0x2216('0x9')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5ef687,_0x4b16f8,_0x26087b){return new BPromise(function(_0x291559,_0x4bae57){return client[_0x2216('0xc')](_0x5ef687,_0x26087b)[_0x2216('0xd')](function(_0x462180){logger[_0x2216('0xe')]('ChatQueue,\x20%s,\x20%s',_0x4b16f8,_0x2216('0xf'));logger[_0x2216('0x10')](_0x2216('0x11'),_0x4b16f8,_0x2216('0xf'),JSON[_0x2216('0x12')](_0x462180));if(_0x462180[_0x2216('0x13')]){if(_0x462180[_0x2216('0x13')][_0x2216('0x14')]===0x1f4){logger['error'](_0x2216('0x15'),_0x4b16f8,_0x462180[_0x2216('0x13')]['message']);return _0x4bae57(_0x462180[_0x2216('0x13')]['message']);}logger[_0x2216('0x13')](_0x2216('0x15'),_0x4b16f8,_0x462180[_0x2216('0x13')][_0x2216('0x16')]);return _0x291559(_0x462180[_0x2216('0x13')][_0x2216('0x16')]);}else{logger[_0x2216('0xe')](_0x2216('0x15'),_0x4b16f8,_0x2216('0xf'));_0x291559(_0x462180[_0x2216('0x17')][_0x2216('0x16')]);}})[_0x2216('0x18')](function(_0x376a36){logger[_0x2216('0x13')](_0x2216('0x15'),_0x4b16f8,_0x376a36);_0x4bae57(_0x376a36);});});}exports['GetChatQueue']=function(_0x1157f7){var _0x36708c=this;return new Promise(function(_0x41ac4b,_0x230faa){return db['ChatQueue'][_0x2216('0x19')]({'raw':_0x1157f7[_0x2216('0x1a')]?_0x1157f7[_0x2216('0x1a')][_0x2216('0x1b')]===undefined?!![]:![]:!![],'where':_0x1157f7['options']?_0x1157f7['options']['where']||null:null,'attributes':_0x1157f7[_0x2216('0x1a')]?_0x1157f7[_0x2216('0x1a')]['attributes']||null:null,'limit':_0x1157f7[_0x2216('0x1a')]?_0x1157f7[_0x2216('0x1a')][_0x2216('0x1c')]||null:null,'include':_0x1157f7[_0x2216('0x1a')]?_0x1157f7[_0x2216('0x1a')]['include']?_[_0x2216('0x1d')](_0x1157f7[_0x2216('0x1a')][_0x2216('0x1e')],function(_0x15fded){return{'model':db[_0x15fded['model']],'as':_0x15fded['as'],'attributes':_0x15fded[_0x2216('0x1f')],'include':_0x15fded[_0x2216('0x1e')]?_[_0x2216('0x1d')](_0x15fded[_0x2216('0x1e')],function(_0xcb96b6){return{'model':db[_0xcb96b6[_0x2216('0x20')]],'as':_0xcb96b6['as'],'attributes':_0xcb96b6[_0x2216('0x1f')],'include':_0xcb96b6[_0x2216('0x1e')]?_['map'](_0xcb96b6[_0x2216('0x1e')],function(_0x50703e){return{'model':db[_0x50703e['model']],'as':_0x50703e['as'],'attributes':_0x50703e[_0x2216('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d08fd){logger['info'](_0x2216('0x21'),_0x1157f7);logger[_0x2216('0x10')](_0x2216('0x21'),_0x1157f7,JSON[_0x2216('0x12')](_0x2d08fd));_0x41ac4b(_0x2d08fd);})[_0x2216('0x18')](function(_0x2fd7cb){logger[_0x2216('0x13')](_0x2216('0x21'),_0x2fd7cb[_0x2216('0x16')],_0x1157f7);_0x230faa(_0x36708c[_0x2216('0x13')](0x1f4,_0x2fd7cb['message']));});});};exports[_0x2216('0x22')]=function(_0xcb23b0){var _0x22e017=this;return new Promise(function(_0x3fde1f,_0x4861d2){return db[_0x2216('0x23')][_0x2216('0x24')]({'raw':_0xcb23b0[_0x2216('0x1a')]?_0xcb23b0[_0x2216('0x1a')][_0x2216('0x1b')]===undefined?!![]:![]:!![],'where':_0xcb23b0[_0x2216('0x1a')]?_0xcb23b0[_0x2216('0x1a')][_0x2216('0x25')]||null:null,'attributes':_0xcb23b0['options']?_0xcb23b0[_0x2216('0x1a')]['attributes']||null:null,'include':_0xcb23b0[_0x2216('0x1a')]?_0xcb23b0[_0x2216('0x1a')]['include']?_['map'](_0xcb23b0[_0x2216('0x1a')][_0x2216('0x1e')],function(_0x133f0f){return{'model':db[_0x133f0f[_0x2216('0x20')]],'as':_0x133f0f['as'],'attributes':_0x133f0f[_0x2216('0x1f')],'include':_0x133f0f[_0x2216('0x1e')]?_[_0x2216('0x1d')](_0x133f0f[_0x2216('0x1e')],function(_0x4ee42c){return{'model':db[_0x4ee42c['model']],'as':_0x4ee42c['as'],'attributes':_0x4ee42c[_0x2216('0x1f')],'include':_0x4ee42c[_0x2216('0x1e')]?_[_0x2216('0x1d')](_0x4ee42c['include'],function(_0x372df4){return{'model':db[_0x372df4[_0x2216('0x20')]],'as':_0x372df4['as'],'attributes':_0x372df4[_0x2216('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2216('0xd')](function(_0x4eee0a){logger[_0x2216('0xe')](_0x2216('0x22'),_0xcb23b0);logger['debug'](_0x2216('0x22'),_0xcb23b0,JSON[_0x2216('0x12')](_0x4eee0a));_0x3fde1f(_0x4eee0a);})[_0x2216('0x18')](function(_0x52ac76){logger[_0x2216('0x13')](_0x2216('0x22'),_0x52ac76[_0x2216('0x16')],_0xcb23b0);_0x4861d2(_0x22e017['error'](0x1f4,_0x52ac76[_0x2216('0x16')]));});});};
\ No newline at end of file
+var _0xbdbe=['model','attributes','raw','ShowChatQueue','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','findAll','options','where','limit','include','map'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0xbdbe,0x1f3));var _0xebdb=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xbdbe[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xebdb('0x0'));var util=require('util');var moment=require(_0xebdb('0x1'));var BPromise=require('bluebird');var rs=require(_0xebdb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebdb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xebdb('0x4'))('rpc');var config=require(_0xebdb('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xebdb('0x6')][_0xebdb('0x7')]({'port':0x232a});config[_0xebdb('0x8')]=_[_0xebdb('0x9')](config[_0xebdb('0x8')],{'host':_0xebdb('0xa'),'port':0x18eb});var socket=require(_0xebdb('0xb'))(new Redis(config[_0xebdb('0x8')]));require(_0xebdb('0xc'))[_0xebdb('0xd')](socket);function respondWithRpcPromise(_0x3b2730,_0x54a360,_0xcdbd2d){return new BPromise(function(_0x1622d5,_0x557d85){return client[_0xebdb('0xe')](_0x3b2730,_0xcdbd2d)[_0xebdb('0xf')](function(_0x2379d3){logger[_0xebdb('0x10')]('ChatQueue,\x20%s,\x20%s',_0x54a360,'request\x20sent');logger[_0xebdb('0x11')](_0xebdb('0x12'),_0x54a360,_0xebdb('0x13'),JSON[_0xebdb('0x14')](_0x2379d3));if(_0x2379d3['error']){if(_0x2379d3[_0xebdb('0x15')][_0xebdb('0x16')]===0x1f4){logger[_0xebdb('0x15')](_0xebdb('0x17'),_0x54a360,_0x2379d3[_0xebdb('0x15')][_0xebdb('0x18')]);return _0x557d85(_0x2379d3[_0xebdb('0x15')][_0xebdb('0x18')]);}logger[_0xebdb('0x15')](_0xebdb('0x17'),_0x54a360,_0x2379d3['error'][_0xebdb('0x18')]);return _0x1622d5(_0x2379d3['error']['message']);}else{logger[_0xebdb('0x10')](_0xebdb('0x17'),_0x54a360,'request\x20sent');_0x1622d5(_0x2379d3[_0xebdb('0x19')][_0xebdb('0x18')]);}})['catch'](function(_0x2de2f5){logger['error']('ChatQueue,\x20%s,\x20%s',_0x54a360,_0x2de2f5);_0x557d85(_0x2de2f5);});});}exports[_0xebdb('0x1a')]=function(_0x253c65){var _0x28e85b=this;return new Promise(function(_0x5c76cc,_0x38a4dd){return db['ChatQueue'][_0xebdb('0x1b')]({'raw':_0x253c65[_0xebdb('0x1c')]?_0x253c65['options']['raw']===undefined?!![]:![]:!![],'where':_0x253c65[_0xebdb('0x1c')]?_0x253c65['options'][_0xebdb('0x1d')]||null:null,'attributes':_0x253c65[_0xebdb('0x1c')]?_0x253c65[_0xebdb('0x1c')]['attributes']||null:null,'limit':_0x253c65['options']?_0x253c65[_0xebdb('0x1c')][_0xebdb('0x1e')]||null:null,'include':_0x253c65[_0xebdb('0x1c')]?_0x253c65[_0xebdb('0x1c')][_0xebdb('0x1f')]?_[_0xebdb('0x20')](_0x253c65[_0xebdb('0x1c')][_0xebdb('0x1f')],function(_0x5b721f){return{'model':db[_0x5b721f[_0xebdb('0x21')]],'as':_0x5b721f['as'],'attributes':_0x5b721f[_0xebdb('0x22')],'include':_0x5b721f[_0xebdb('0x1f')]?_['map'](_0x5b721f[_0xebdb('0x1f')],function(_0x59d9f7){return{'model':db[_0x59d9f7[_0xebdb('0x21')]],'as':_0x59d9f7['as'],'attributes':_0x59d9f7[_0xebdb('0x22')],'include':_0x59d9f7['include']?_[_0xebdb('0x20')](_0x59d9f7['include'],function(_0x497642){return{'model':db[_0x497642[_0xebdb('0x21')]],'as':_0x497642['as'],'attributes':_0x497642[_0xebdb('0x22')]};}):[]};}):[]};}):[]:[]})[_0xebdb('0xf')](function(_0x5136f2){logger[_0xebdb('0x10')](_0xebdb('0x1a'),_0x253c65);logger[_0xebdb('0x11')](_0xebdb('0x1a'),_0x253c65,JSON[_0xebdb('0x14')](_0x5136f2));_0x5c76cc(_0x5136f2);})['catch'](function(_0x538920){logger[_0xebdb('0x15')](_0xebdb('0x1a'),_0x538920['message'],_0x253c65);_0x38a4dd(_0x28e85b['error'](0x1f4,_0x538920['message']));});});};exports['ShowChatQueue']=function(_0x2ba46e){var _0x5f578a=this;return new Promise(function(_0x38637c,_0xd1843){return db['ChatQueue']['find']({'raw':_0x2ba46e[_0xebdb('0x1c')]?_0x2ba46e[_0xebdb('0x1c')][_0xebdb('0x23')]===undefined?!![]:![]:!![],'where':_0x2ba46e['options']?_0x2ba46e[_0xebdb('0x1c')][_0xebdb('0x1d')]||null:null,'attributes':_0x2ba46e[_0xebdb('0x1c')]?_0x2ba46e[_0xebdb('0x1c')][_0xebdb('0x22')]||null:null,'include':_0x2ba46e[_0xebdb('0x1c')]?_0x2ba46e['options'][_0xebdb('0x1f')]?_[_0xebdb('0x20')](_0x2ba46e[_0xebdb('0x1c')][_0xebdb('0x1f')],function(_0x3dc8d3){return{'model':db[_0x3dc8d3[_0xebdb('0x21')]],'as':_0x3dc8d3['as'],'attributes':_0x3dc8d3[_0xebdb('0x22')],'include':_0x3dc8d3[_0xebdb('0x1f')]?_[_0xebdb('0x20')](_0x3dc8d3['include'],function(_0x4fb00a){return{'model':db[_0x4fb00a['model']],'as':_0x4fb00a['as'],'attributes':_0x4fb00a[_0xebdb('0x22')],'include':_0x4fb00a[_0xebdb('0x1f')]?_['map'](_0x4fb00a[_0xebdb('0x1f')],function(_0x31fb4c){return{'model':db[_0x31fb4c['model']],'as':_0x31fb4c['as'],'attributes':_0x31fb4c[_0xebdb('0x22')]};}):[]};}):[]};}):[]:[]})[_0xebdb('0xf')](function(_0x4dd3c2){logger['info'](_0xebdb('0x24'),_0x2ba46e);logger[_0xebdb('0x11')](_0xebdb('0x24'),_0x2ba46e,JSON['stringify'](_0x4dd3c2));_0x38637c(_0x4dd3c2);})[_0xebdb('0x25')](function(_0x123644){logger[_0xebdb('0x15')](_0xebdb('0x24'),_0x123644[_0xebdb('0x18')],_0x2ba46e);_0xd1843(_0x5f578a[_0xebdb('0x15')](0x1f4,_0x123644[_0xebdb('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 04f186b..fbaae46 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 _0x222f=['./chatQueue.events','save','remove','update','emit','register'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x222f,0x1a4));var _0xf222=function(_0x279755,_0x42ad77){_0x279755=_0x279755-0x0;var _0x138178=_0x222f[_0x279755];return _0x138178;};'use strict';var ChatQueueEvents=require(_0xf222('0x0'));var events=[_0xf222('0x1'),_0xf222('0x2'),_0xf222('0x3')];function createListener(_0x4d09ec,_0x4b4237){return function(_0x195de1){_0x4b4237[_0xf222('0x4')](_0x4d09ec,_0x195de1);};}function removeListener(_0x307791,_0x7b187d){return function(){ChatQueueEvents['removeListener'](_0x307791,_0x7b187d);};}exports[_0xf222('0x5')]=function(_0x54a758){for(var _0x112e6d=0x0,_0x26f129=events['length'];_0x112e6d<_0x26f129;_0x112e6d++){var _0xf5a105=events[_0x112e6d];var _0x302d7a=createListener('chatQueue:'+_0xf5a105,_0x54a758);ChatQueueEvents['on'](_0xf5a105,_0x302d7a);}};
\ No newline at end of file
+var _0x6f0d=['update','emit','removeListener','length','save','remove'];(function(_0x70a8a5,_0x35a384){var _0x2b563b=function(_0x4bbb5b){while(--_0x4bbb5b){_0x70a8a5['push'](_0x70a8a5['shift']());}};_0x2b563b(++_0x35a384);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2e9f87,_0x246ba8){_0x2e9f87=_0x2e9f87-0x0;var _0x43eb1c=_0x6f0d[_0x2e9f87];return _0x43eb1c;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xd6f0('0x0'),_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x107a8c,_0x573473){return function(_0x275230){_0x573473[_0xd6f0('0x3')](_0x107a8c,_0x275230);};}function removeListener(_0x2f78fb,_0x25344b){return function(){ChatQueueEvents[_0xd6f0('0x4')](_0x2f78fb,_0x25344b);};}exports['register']=function(_0x2d2ce6){for(var _0x4a8b0c=0x0,_0xe21ac4=events[_0xd6f0('0x5')];_0x4a8b0c<_0xe21ac4;_0x4a8b0c++){var _0x8b89a9=events[_0x4a8b0c];var _0x1a48a0=createListener('chatQueue:'+_0x8b89a9,_0x2d2ce6);ChatQueueEvents['on'](_0x8b89a9,_0x1a48a0);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index a22d8a2..1864af2 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(_0x48de73,_0x5cb42f){var _0x2ff266=function(_0xa2b9ea){while(--_0xa2b9ea){_0x48de73['push'](_0x48de73['shift']());}};_0x2ff266(++_0x5cb42f);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x5cae73,_0x7deb8f){var _0x2722ce=function(_0x702135){while(--_0x702135){_0x5cae73['push'](_0x5cae73['shift']());}};_0x2722ce(++_0x7deb8f);}(_0x55ca,0x126));var _0xa55c=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0x55ca[_0x143a91];return _0x1906f5;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 1752f0d..518246e 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 _0xf2ad=['STRING','DATE','moment','exports'];(function(_0x3515a0,_0xc6dccf){var _0x560260=function(_0x171b46){while(--_0x171b46){_0x3515a0['push'](_0x3515a0['shift']());}};_0x560260(++_0xc6dccf);}(_0xf2ad,0x1f2));var _0xdf2a=function(_0x25efdf,_0x521462){_0x25efdf=_0x25efdf-0x0;var _0x22c495=_0xf2ad[_0x25efdf];return _0x22c495;};'use strict';var moment=require(_0xdf2a('0x0'));var Sequelize=require('sequelize');module[_0xdf2a('0x1')]={'uniqueid':{'type':Sequelize[_0xdf2a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xdf2a('0x2')]},'joinAt':{'type':Sequelize[_0xdf2a('0x3')]},'leaveAt':{'type':Sequelize[_0xdf2a('0x3')]},'acceptAt':{'type':Sequelize[_0xdf2a('0x3')]},'exitAt':{'type':Sequelize[_0xdf2a('0x3')]},'reason':{'type':Sequelize[_0xdf2a('0x2')]}};
\ No newline at end of file
+var _0xea3a=['sequelize','exports','STRING','DATE','moment'];(function(_0x35df37,_0x927820){var _0x30f707=function(_0x1b0475){while(--_0x1b0475){_0x35df37['push'](_0x35df37['shift']());}};_0x30f707(++_0x927820);}(_0xea3a,0x13f));var _0xaea3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xea3a[_0x4565bf];return _0x5610ba;};'use strict';var moment=require(_0xaea3('0x0'));var Sequelize=require(_0xaea3('0x1'));module[_0xaea3('0x2')]={'uniqueid':{'type':Sequelize[_0xaea3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xaea3('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xaea3('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xaea3('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index f24420e..b8b12f8 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 _0x36f3=['map','includeAll','include','findAll','rows','catch','show','params','filters','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','undefined','limit','offset','count','set','json','apply','reject','save','update','then','destroy','error','name','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','where','pick','merge'];(function(_0x143cfd,_0x1a336e){var _0x2cb5f5=function(_0x1523fa){while(--_0x1523fa){_0x143cfd['push'](_0x143cfd['shift']());}};_0x2cb5f5(++_0x1a336e);}(_0x36f3,0xe6));var _0x336f=function(_0x4099af,_0x1578bf){_0x4099af=_0x4099af-0x0;var _0x46e189=_0x36f3[_0x4099af];return _0x46e189;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x336f('0x0'));var zipdir=require(_0x336f('0x1'));var jsonpatch=require(_0x336f('0x2'));var rp=require(_0x336f('0x3'));var moment=require(_0x336f('0x4'));var BPromise=require(_0x336f('0x5'));var Mustache=require(_0x336f('0x6'));var util=require(_0x336f('0x7'));var path=require(_0x336f('0x8'));var sox=require('sox');var csv=require(_0x336f('0x9'));var ejs=require(_0x336f('0xa'));var fs=require('fs');var fs_extra=require(_0x336f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x336f('0xc'));var jsforce=require(_0x336f('0xd'));var deskjs=require(_0x336f('0xe'));var toCsv=require(_0x336f('0x9'));var querystring=require(_0x336f('0xf'));var Papa=require(_0x336f('0x10'));var Redis=require(_0x336f('0x11'));var authService=require(_0x336f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x336f('0x13'));var hardwareService=require(_0x336f('0x14'));var logger=require(_0x336f('0x15'))(_0x336f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x336f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2edd0c,_0x29f1ff){_0x29f1ff=_0x29f1ff||0xcc;return function(_0x4986ba){if(_0x4986ba){return _0x2edd0c[_0x336f('0x18')](_0x29f1ff);}return _0x2edd0c[_0x336f('0x19')](_0x29f1ff)[_0x336f('0x1a')]();};}function respondWithResult(_0x14f88f,_0x12c5e0){_0x12c5e0=_0x12c5e0||0xc8;return function(_0x1e021b){if(_0x1e021b){return _0x14f88f[_0x336f('0x19')](_0x12c5e0)['json'](_0x1e021b);}};}function respondWithFilteredResult(_0x163061,_0x670ed5){return function(_0x3c7d01){if(_0x3c7d01){var _0x115be9=typeof _0x670ed5['offset']===_0x336f('0x1b')&&typeof _0x670ed5[_0x336f('0x1c')]===_0x336f('0x1b');var _0x724918=_0x3c7d01['count'];var _0xbbe464=_0x115be9?0x0:_0x670ed5[_0x336f('0x1d')];var _0x5d1eec=_0x115be9?_0x3c7d01[_0x336f('0x1e')]:_0x670ed5[_0x336f('0x1d')]+_0x670ed5[_0x336f('0x1c')];var _0x5a7d0d;if(_0x5d1eec>=_0x724918){_0x5d1eec=_0x724918;_0x5a7d0d=0xc8;}else{_0x5a7d0d=0xce;}_0x163061[_0x336f('0x19')](_0x5a7d0d);return _0x163061[_0x336f('0x1f')]('Content-Range',_0xbbe464+'-'+_0x5d1eec+'/'+_0x724918)[_0x336f('0x20')](_0x3c7d01);}return null;};}function patchUpdates(_0x245612){return function(_0x13b12c){try{jsonpatch[_0x336f('0x21')](_0x13b12c,_0x245612,!![]);}catch(_0x4ebd9f){return BPromise[_0x336f('0x22')](_0x4ebd9f);}return _0x13b12c[_0x336f('0x23')]();};}function saveUpdates(_0x183a5d,_0x2031b3){return function(_0x175637){if(_0x175637){return _0x175637[_0x336f('0x24')](_0x183a5d)[_0x336f('0x25')](function(_0x20ee82){return _0x20ee82;});}return null;};}function removeEntity(_0x26de86,_0x149fc){return function(_0x1a6e60){if(_0x1a6e60){return _0x1a6e60[_0x336f('0x26')]()[_0x336f('0x25')](function(){_0x26de86['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x386d6f,_0x377bcd){return function(_0x1aa9c0){if(!_0x1aa9c0){_0x386d6f[_0x336f('0x18')](0x194);}return _0x1aa9c0;};}function handleError(_0x526cc1,_0x1cfba1){_0x1cfba1=_0x1cfba1||0x1f4;return function(_0x282e07){logger[_0x336f('0x27')](_0x282e07['stack']);if(_0x282e07[_0x336f('0x28')]){delete _0x282e07[_0x336f('0x28')];}_0x526cc1[_0x336f('0x19')](_0x1cfba1)['send'](_0x282e07);};}exports[_0x336f('0x29')]=function(_0x1c6bb9,_0x395aad){var _0x1195c1={},_0x19e727={},_0x2978b8={'count':0x0,'rows':[]};var _0x5d5684=_['map'](db[_0x336f('0x2a')][_0x336f('0x2b')],function(_0x390ded){return{'name':_0x390ded[_0x336f('0x2c')],'type':_0x390ded[_0x336f('0x2d')][_0x336f('0x2e')]};});_0x19e727[_0x336f('0x2f')]=_['map'](_0x5d5684,_0x336f('0x28'));_0x19e727[_0x336f('0x30')]=_[_0x336f('0x31')](_0x1c6bb9['query']);_0x19e727['filters']=_[_0x336f('0x32')](_0x19e727[_0x336f('0x2f')],_0x19e727['query']);_0x1195c1[_0x336f('0x33')]=_[_0x336f('0x32')](_0x19e727['model'],qs[_0x336f('0x34')](_0x1c6bb9[_0x336f('0x30')][_0x336f('0x34')]));_0x1195c1[_0x336f('0x33')]=_0x1195c1[_0x336f('0x33')][_0x336f('0x35')]?_0x1195c1['attributes']:_0x19e727['model'];if(!_0x1c6bb9['query'][_0x336f('0x36')]('nolimit')){_0x1195c1[_0x336f('0x1c')]=qs[_0x336f('0x1c')](_0x1c6bb9['query'][_0x336f('0x1c')]);_0x1195c1[_0x336f('0x1d')]=qs[_0x336f('0x1d')](_0x1c6bb9[_0x336f('0x30')]['offset']);}_0x1195c1['order']=qs['sort'](_0x1c6bb9[_0x336f('0x30')]['sort']);_0x1195c1[_0x336f('0x37')]=qs['filters'](_[_0x336f('0x38')](_0x1c6bb9[_0x336f('0x30')],_0x19e727['filters']),_0x5d5684);if(_0x1c6bb9[_0x336f('0x30')]['filter']){_0x1195c1['where']=_[_0x336f('0x39')](_0x1195c1[_0x336f('0x37')],{'$or':_[_0x336f('0x3a')](_0x5d5684,function(_0x5c0cd8){if(_0x5c0cd8['type']!=='VIRTUAL'){var _0x32c243={};_0x32c243[_0x5c0cd8['name']]={'$like':'%'+_0x1c6bb9[_0x336f('0x30')]['filter']+'%'};return _0x32c243;}})});}_0x1195c1=_[_0x336f('0x39')]({},_0x1195c1,_0x1c6bb9['options']);var _0x442dae={'where':_0x1195c1['where']};return db[_0x336f('0x2a')][_0x336f('0x1e')](_0x442dae)[_0x336f('0x25')](function(_0x2dc122){_0x2978b8[_0x336f('0x1e')]=_0x2dc122;if(_0x1c6bb9[_0x336f('0x30')][_0x336f('0x3b')]){_0x1195c1[_0x336f('0x3c')]=[{'all':!![]}];}return db[_0x336f('0x2a')][_0x336f('0x3d')](_0x1195c1);})[_0x336f('0x25')](function(_0x1c4f7c){_0x2978b8[_0x336f('0x3e')]=_0x1c4f7c;return _0x2978b8;})['then'](respondWithFilteredResult(_0x395aad,_0x1195c1))[_0x336f('0x3f')](handleError(_0x395aad,null));};exports[_0x336f('0x40')]=function(_0x2d0708,_0x572315){var _0x7c5f5d={'raw':!![],'where':{'id':_0x2d0708[_0x336f('0x41')]['id']}},_0xe5cbd3={};_0xe5cbd3['model']=_[_0x336f('0x31')](db[_0x336f('0x2a')]['rawAttributes']);_0xe5cbd3[_0x336f('0x30')]=_[_0x336f('0x31')](_0x2d0708[_0x336f('0x30')]);_0xe5cbd3[_0x336f('0x42')]=_[_0x336f('0x32')](_0xe5cbd3[_0x336f('0x2f')],_0xe5cbd3[_0x336f('0x30')]);_0x7c5f5d['attributes']=_[_0x336f('0x32')](_0xe5cbd3['model'],qs[_0x336f('0x34')](_0x2d0708[_0x336f('0x30')]['fields']));_0x7c5f5d[_0x336f('0x33')]=_0x7c5f5d['attributes']['length']?_0x7c5f5d[_0x336f('0x33')]:_0xe5cbd3[_0x336f('0x2f')];if(_0x2d0708[_0x336f('0x30')][_0x336f('0x3b')]){_0x7c5f5d[_0x336f('0x3c')]=[{'all':!![]}];}_0x7c5f5d=_[_0x336f('0x39')]({},_0x7c5f5d,_0x2d0708[_0x336f('0x43')]);return db[_0x336f('0x2a')][_0x336f('0x44')](_0x7c5f5d)['then'](handleEntityNotFound(_0x572315,null))[_0x336f('0x25')](respondWithResult(_0x572315,null))['catch'](handleError(_0x572315,null));};exports['create']=function(_0x1b8802,_0x21c6ee){return db[_0x336f('0x2a')][_0x336f('0x45')](_0x1b8802[_0x336f('0x46')],{})[_0x336f('0x25')](respondWithResult(_0x21c6ee,0xc9))[_0x336f('0x3f')](handleError(_0x21c6ee,null));};exports[_0x336f('0x24')]=function(_0x5809e1,_0xc5bd24){if(_0x5809e1[_0x336f('0x46')]['id']){delete _0x5809e1[_0x336f('0x46')]['id'];}return db[_0x336f('0x2a')][_0x336f('0x44')]({'where':{'id':_0x5809e1['params']['id']}})['then'](handleEntityNotFound(_0xc5bd24,null))[_0x336f('0x25')](saveUpdates(_0x5809e1[_0x336f('0x46')],null))[_0x336f('0x25')](respondWithResult(_0xc5bd24,null))[_0x336f('0x3f')](handleError(_0xc5bd24,null));};exports[_0x336f('0x26')]=function(_0x7a21b2,_0x5ada31){return db['ChatQueueReport']['find']({'where':{'id':_0x7a21b2[_0x336f('0x41')]['id']}})[_0x336f('0x25')](handleEntityNotFound(_0x5ada31,null))[_0x336f('0x25')](removeEntity(_0x5ada31,null))['catch'](handleError(_0x5ada31,null));};exports[_0x336f('0x47')]=function(_0x10345b,_0x10f8b2){return db[_0x336f('0x2a')][_0x336f('0x47')]()['then'](respondWithResult(_0x10f8b2,null))[_0x336f('0x3f')](handleError(_0x10f8b2,null));};
\ No newline at end of file
+var _0x9d56=['end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','name','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','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/license/util','../../mysqldb','status'];(function(_0x2578d1,_0x2990b6){var _0x2567da=function(_0x5be91b){while(--_0x5be91b){_0x2578d1['push'](_0x2578d1['shift']());}};_0x2567da(++_0x2990b6);}(_0x9d56,0x122));var _0x69d5=function(_0x21105e,_0x4a91a7){_0x21105e=_0x21105e-0x0;var _0x15988c=_0x9d56[_0x21105e];return _0x15988c;};'use strict';var emlformat=require(_0x69d5('0x0'));var rimraf=require(_0x69d5('0x1'));var zipdir=require(_0x69d5('0x2'));var jsonpatch=require(_0x69d5('0x3'));var rp=require('request-promise');var moment=require(_0x69d5('0x4'));var BPromise=require(_0x69d5('0x5'));var Mustache=require(_0x69d5('0x6'));var util=require(_0x69d5('0x7'));var path=require(_0x69d5('0x8'));var sox=require('sox');var csv=require(_0x69d5('0x9'));var ejs=require(_0x69d5('0xa'));var fs=require('fs');var fs_extra=require(_0x69d5('0xb'));var _=require(_0x69d5('0xc'));var squel=require(_0x69d5('0xd'));var crypto=require(_0x69d5('0xe'));var jsforce=require(_0x69d5('0xf'));var deskjs=require(_0x69d5('0x10'));var toCsv=require(_0x69d5('0x9'));var querystring=require(_0x69d5('0x11'));var Papa=require(_0x69d5('0x12'));var Redis=require(_0x69d5('0x13'));var authService=require(_0x69d5('0x14'));var qs=require(_0x69d5('0x15'));var as=require(_0x69d5('0x16'));var hardwareService=require(_0x69d5('0x17'));var logger=require(_0x69d5('0x18'))(_0x69d5('0x19'));var utils=require(_0x69d5('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x69d5('0x1b'));var db=require(_0x69d5('0x1c'))['db'];function respondWithStatusCode(_0x2cc733,_0x4641a7){_0x4641a7=_0x4641a7||0xcc;return function(_0x1c34d9){if(_0x1c34d9){return _0x2cc733['sendStatus'](_0x4641a7);}return _0x2cc733[_0x69d5('0x1d')](_0x4641a7)[_0x69d5('0x1e')]();};}function respondWithResult(_0x263954,_0x134e84){_0x134e84=_0x134e84||0xc8;return function(_0x56843c){if(_0x56843c){return _0x263954['status'](_0x134e84)['json'](_0x56843c);}};}function respondWithFilteredResult(_0x279ce5,_0x33cf2e){return function(_0x56bbbc){if(_0x56bbbc){var _0x28492b=typeof _0x33cf2e[_0x69d5('0x1f')]==='undefined'&&typeof _0x33cf2e[_0x69d5('0x20')]===_0x69d5('0x21');var _0x304417=_0x56bbbc[_0x69d5('0x22')];var _0x16e628=_0x28492b?0x0:_0x33cf2e[_0x69d5('0x1f')];var _0x6763ac=_0x28492b?_0x56bbbc[_0x69d5('0x22')]:_0x33cf2e['offset']+_0x33cf2e[_0x69d5('0x20')];var _0x16c02c;if(_0x6763ac>=_0x304417){_0x6763ac=_0x304417;_0x16c02c=0xc8;}else{_0x16c02c=0xce;}_0x279ce5[_0x69d5('0x1d')](_0x16c02c);return _0x279ce5[_0x69d5('0x23')](_0x69d5('0x24'),_0x16e628+'-'+_0x6763ac+'/'+_0x304417)[_0x69d5('0x25')](_0x56bbbc);}return null;};}function patchUpdates(_0x1f9ed7){return function(_0xc557e3){try{jsonpatch[_0x69d5('0x26')](_0xc557e3,_0x1f9ed7,!![]);}catch(_0x497c1a){return BPromise['reject'](_0x497c1a);}return _0xc557e3[_0x69d5('0x27')]();};}function saveUpdates(_0x3fc1a4,_0xa81fe0){return function(_0x1558b6){if(_0x1558b6){return _0x1558b6[_0x69d5('0x28')](_0x3fc1a4)[_0x69d5('0x29')](function(_0x1ec0d3){return _0x1ec0d3;});}return null;};}function removeEntity(_0x22e984,_0x23ee57){return function(_0x49b3f5){if(_0x49b3f5){return _0x49b3f5[_0x69d5('0x2a')]()[_0x69d5('0x29')](function(){_0x22e984[_0x69d5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e1d8d,_0x53ea6e){return function(_0x5e27e7){if(!_0x5e27e7){_0x2e1d8d[_0x69d5('0x2b')](0x194);}return _0x5e27e7;};}function handleError(_0x49b94f,_0x27ffd8){_0x27ffd8=_0x27ffd8||0x1f4;return function(_0x7636f2){logger[_0x69d5('0x2c')](_0x7636f2['stack']);if(_0x7636f2[_0x69d5('0x2d')]){delete _0x7636f2[_0x69d5('0x2d')];}_0x49b94f[_0x69d5('0x1d')](_0x27ffd8)['send'](_0x7636f2);};}exports['index']=function(_0x3f0ced,_0x41173f){var _0x2892a6={},_0x4d8fb={},_0xf4edd9={'count':0x0,'rows':[]};var _0x4d961f=_[_0x69d5('0x2e')](db[_0x69d5('0x2f')][_0x69d5('0x30')],function(_0x252f43){return{'name':_0x252f43[_0x69d5('0x31')],'type':_0x252f43[_0x69d5('0x32')][_0x69d5('0x33')]};});_0x4d8fb[_0x69d5('0x34')]=_['map'](_0x4d961f,_0x69d5('0x2d'));_0x4d8fb[_0x69d5('0x35')]=_['keys'](_0x3f0ced[_0x69d5('0x35')]);_0x4d8fb['filters']=_[_0x69d5('0x36')](_0x4d8fb[_0x69d5('0x34')],_0x4d8fb[_0x69d5('0x35')]);_0x2892a6['attributes']=_[_0x69d5('0x36')](_0x4d8fb[_0x69d5('0x34')],qs['fields'](_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x37')]));_0x2892a6[_0x69d5('0x38')]=_0x2892a6['attributes'][_0x69d5('0x39')]?_0x2892a6[_0x69d5('0x38')]:_0x4d8fb[_0x69d5('0x34')];if(!_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x3a')](_0x69d5('0x3b'))){_0x2892a6[_0x69d5('0x20')]=qs[_0x69d5('0x20')](_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x20')]);_0x2892a6[_0x69d5('0x1f')]=qs[_0x69d5('0x1f')](_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x1f')]);}_0x2892a6[_0x69d5('0x3c')]=qs[_0x69d5('0x3d')](_0x3f0ced[_0x69d5('0x35')]['sort']);_0x2892a6[_0x69d5('0x3e')]=qs[_0x69d5('0x3f')](_[_0x69d5('0x40')](_0x3f0ced['query'],_0x4d8fb[_0x69d5('0x3f')]),_0x4d961f);if(_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x41')]){_0x2892a6['where']=_[_0x69d5('0x42')](_0x2892a6['where'],{'$or':_[_0x69d5('0x2e')](_0x4d961f,function(_0x1ae187){if(_0x1ae187[_0x69d5('0x32')]!=='VIRTUAL'){var _0x45ca18={};_0x45ca18[_0x1ae187[_0x69d5('0x2d')]]={'$like':'%'+_0x3f0ced[_0x69d5('0x35')][_0x69d5('0x41')]+'%'};return _0x45ca18;}})});}_0x2892a6=_['merge']({},_0x2892a6,_0x3f0ced[_0x69d5('0x43')]);var _0x661bca={'where':_0x2892a6[_0x69d5('0x3e')]};return db[_0x69d5('0x2f')][_0x69d5('0x22')](_0x661bca)[_0x69d5('0x29')](function(_0x51a8f1){_0xf4edd9[_0x69d5('0x22')]=_0x51a8f1;if(_0x3f0ced['query']['includeAll']){_0x2892a6[_0x69d5('0x44')]=[{'all':!![]}];}return db[_0x69d5('0x2f')][_0x69d5('0x45')](_0x2892a6);})[_0x69d5('0x29')](function(_0xa93202){_0xf4edd9[_0x69d5('0x46')]=_0xa93202;return _0xf4edd9;})[_0x69d5('0x29')](respondWithFilteredResult(_0x41173f,_0x2892a6))[_0x69d5('0x47')](handleError(_0x41173f,null));};exports[_0x69d5('0x48')]=function(_0x23527b,_0x13075d){var _0x5d2ba2={'raw':!![],'where':{'id':_0x23527b['params']['id']}},_0x4cf243={};_0x4cf243['model']=_[_0x69d5('0x49')](db[_0x69d5('0x2f')][_0x69d5('0x30')]);_0x4cf243[_0x69d5('0x35')]=_[_0x69d5('0x49')](_0x23527b[_0x69d5('0x35')]);_0x4cf243['filters']=_['intersection'](_0x4cf243[_0x69d5('0x34')],_0x4cf243[_0x69d5('0x35')]);_0x5d2ba2[_0x69d5('0x38')]=_[_0x69d5('0x36')](_0x4cf243[_0x69d5('0x34')],qs[_0x69d5('0x37')](_0x23527b[_0x69d5('0x35')][_0x69d5('0x37')]));_0x5d2ba2['attributes']=_0x5d2ba2['attributes'][_0x69d5('0x39')]?_0x5d2ba2[_0x69d5('0x38')]:_0x4cf243[_0x69d5('0x34')];if(_0x23527b[_0x69d5('0x35')][_0x69d5('0x4a')]){_0x5d2ba2[_0x69d5('0x44')]=[{'all':!![]}];}_0x5d2ba2=_['merge']({},_0x5d2ba2,_0x23527b['options']);return db[_0x69d5('0x2f')][_0x69d5('0x4b')](_0x5d2ba2)[_0x69d5('0x29')](handleEntityNotFound(_0x13075d,null))[_0x69d5('0x29')](respondWithResult(_0x13075d,null))[_0x69d5('0x47')](handleError(_0x13075d,null));};exports[_0x69d5('0x4c')]=function(_0x37a47e,_0x173e85){return db[_0x69d5('0x2f')][_0x69d5('0x4c')](_0x37a47e['body'],{})[_0x69d5('0x29')](respondWithResult(_0x173e85,0xc9))[_0x69d5('0x47')](handleError(_0x173e85,null));};exports[_0x69d5('0x28')]=function(_0x4497b4,_0x1a4ed4){if(_0x4497b4['body']['id']){delete _0x4497b4[_0x69d5('0x4d')]['id'];}return db['ChatQueueReport'][_0x69d5('0x4b')]({'where':{'id':_0x4497b4[_0x69d5('0x4e')]['id']}})[_0x69d5('0x29')](handleEntityNotFound(_0x1a4ed4,null))['then'](saveUpdates(_0x4497b4[_0x69d5('0x4d')],null))[_0x69d5('0x29')](respondWithResult(_0x1a4ed4,null))[_0x69d5('0x47')](handleError(_0x1a4ed4,null));};exports[_0x69d5('0x2a')]=function(_0x153ca4,_0x5266ce){return db[_0x69d5('0x2f')][_0x69d5('0x4b')]({'where':{'id':_0x153ca4[_0x69d5('0x4e')]['id']}})[_0x69d5('0x29')](handleEntityNotFound(_0x5266ce,null))[_0x69d5('0x29')](removeEntity(_0x5266ce,null))[_0x69d5('0x47')](handleError(_0x5266ce,null));};exports[_0x69d5('0x4f')]=function(_0xa04ef2,_0x2ef443){return db[_0x69d5('0x2f')][_0x69d5('0x4f')]()[_0x69d5('0x29')](respondWithResult(_0x2ef443,null))[_0x69d5('0x47')](handleError(_0x2ef443,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 3abd2b9..54a1b93 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(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0xbcacfd,_0x5d02ab){var _0x3cba9e=function(_0x5d6b95){while(--_0x5d6b95){_0xbcacfd['push'](_0xbcacfd['shift']());}};_0x3cba9e(++_0x5d02ab);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 3bcd53e..fe69e51 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 _0x6206=['ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','UpdateChatQueueReport','update','body','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x32f1ef,_0x51a021){var _0x2e89d2=function(_0x338da0){while(--_0x338da0){_0x32f1ef['push'](_0x32f1ef['shift']());}};_0x2e89d2(++_0x51a021);}(_0x6206,0x1b4));var _0x6620=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x6206[_0x4b7895];return _0x264180;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6620('0x0'));var BPromise=require(_0x6620('0x1'));var rs=require(_0x6620('0x2'));var fs=require('fs');var Redis=require(_0x6620('0x3'));var db=require(_0x6620('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6620('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6620('0x6'));var client=jayson[_0x6620('0x7')][_0x6620('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x329c79,_0x414470,_0x2f1de0){return new BPromise(function(_0x1f2a98,_0xd1730c){return client[_0x6620('0x9')](_0x329c79,_0x2f1de0)[_0x6620('0xa')](function(_0x359f76){logger[_0x6620('0xb')](_0x6620('0xc'),_0x414470,_0x6620('0xd'));logger['debug'](_0x6620('0xe'),_0x414470,'request\x20sent',JSON[_0x6620('0xf')](_0x359f76));if(_0x359f76['error']){if(_0x359f76[_0x6620('0x10')]['code']===0x1f4){logger[_0x6620('0x10')](_0x6620('0xc'),_0x414470,_0x359f76[_0x6620('0x10')]['message']);return _0xd1730c(_0x359f76[_0x6620('0x10')]['message']);}logger[_0x6620('0x10')](_0x6620('0xc'),_0x414470,_0x359f76[_0x6620('0x10')][_0x6620('0x11')]);return _0x1f2a98(_0x359f76[_0x6620('0x10')][_0x6620('0x11')]);}else{logger[_0x6620('0xb')](_0x6620('0xc'),_0x414470,'request\x20sent');_0x1f2a98(_0x359f76[_0x6620('0x12')][_0x6620('0x11')]);}})[_0x6620('0x13')](function(_0x2512ac){logger[_0x6620('0x10')](_0x6620('0xc'),_0x414470,_0x2512ac);_0xd1730c(_0x2512ac);});});}exports[_0x6620('0x14')]=function(_0x33874d){var _0x2fa1f7=this;return new Promise(function(_0x180e16,_0x557489){return db[_0x6620('0x15')][_0x6620('0x16')](_0x33874d['body'],{'raw':_0x33874d[_0x6620('0x17')]?_0x33874d['options']['raw']===undefined?!![]:![]:!![]})[_0x6620('0xa')](function(_0x2341c5){logger['info'](_0x6620('0x14'),_0x33874d);logger['debug'](_0x6620('0x14'),_0x33874d,JSON[_0x6620('0xf')](_0x2341c5));_0x180e16(_0x2341c5);})[_0x6620('0x13')](function(_0x410008){logger[_0x6620('0x10')](_0x6620('0x14'),_0x410008[_0x6620('0x11')],_0x33874d);_0x557489(_0x2fa1f7[_0x6620('0x10')](0x1f4,_0x410008[_0x6620('0x11')]));});});};exports[_0x6620('0x18')]=function(_0x48ee6d){var _0x2eb9ef=this;return new Promise(function(_0x181a63,_0x1e5cf7){return db[_0x6620('0x15')][_0x6620('0x19')](_0x48ee6d[_0x6620('0x1a')],{'raw':_0x48ee6d[_0x6620('0x17')]?_0x48ee6d[_0x6620('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48ee6d[_0x6620('0x17')]?_0x48ee6d[_0x6620('0x17')][_0x6620('0x1b')]||null:null,'attributes':_0x48ee6d[_0x6620('0x17')]?_0x48ee6d[_0x6620('0x17')][_0x6620('0x1c')]||null:null,'limit':_0x48ee6d[_0x6620('0x17')]?_0x48ee6d[_0x6620('0x17')][_0x6620('0x1d')]||null:null})[_0x6620('0xa')](function(_0x548046){logger[_0x6620('0xb')](_0x6620('0x18'),_0x48ee6d);logger['debug'](_0x6620('0x18'),_0x48ee6d,JSON[_0x6620('0xf')](_0x548046));_0x181a63(_0x548046);})['catch'](function(_0x24b4fd){logger['error'](_0x6620('0x18'),_0x24b4fd['message'],_0x48ee6d);_0x1e5cf7(_0x2eb9ef[_0x6620('0x10')](0x1f4,_0x24b4fd['message']));});});};
\ No newline at end of file
+var _0xa2b6=['then','UpdateChatQueueReport','update','body','where','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0xa2b6,0x1a6));var _0x6a2b=function(_0x5aa4ac,_0x74073a){_0x5aa4ac=_0x5aa4ac-0x0;var _0x31dfb8=_0xa2b6[_0x5aa4ac];return _0x31dfb8;};'use strict';var _=require(_0x6a2b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6a2b('0x1'));var rs=require(_0x6a2b('0x2'));var fs=require('fs');var Redis=require(_0x6a2b('0x3'));var db=require(_0x6a2b('0x4'))['db'];var utils=require(_0x6a2b('0x5'));var logger=require(_0x6a2b('0x6'))(_0x6a2b('0x7'));var config=require('../../config/environment');var jayson=require(_0x6a2b('0x8'));var client=jayson[_0x6a2b('0x9')][_0x6a2b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d6d5e,_0xfbd0c4,_0x17528d){return new BPromise(function(_0x2edd87,_0x5f1260){return client[_0x6a2b('0xb')](_0x4d6d5e,_0x17528d)['then'](function(_0x4c2c8b){logger[_0x6a2b('0xc')](_0x6a2b('0xd'),_0xfbd0c4,_0x6a2b('0xe'));logger['debug'](_0x6a2b('0xf'),_0xfbd0c4,_0x6a2b('0xe'),JSON[_0x6a2b('0x10')](_0x4c2c8b));if(_0x4c2c8b['error']){if(_0x4c2c8b[_0x6a2b('0x11')]['code']===0x1f4){logger[_0x6a2b('0x11')](_0x6a2b('0xd'),_0xfbd0c4,_0x4c2c8b[_0x6a2b('0x11')][_0x6a2b('0x12')]);return _0x5f1260(_0x4c2c8b['error'][_0x6a2b('0x12')]);}logger[_0x6a2b('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0xfbd0c4,_0x4c2c8b[_0x6a2b('0x11')][_0x6a2b('0x12')]);return _0x2edd87(_0x4c2c8b['error']['message']);}else{logger[_0x6a2b('0xc')](_0x6a2b('0xd'),_0xfbd0c4,_0x6a2b('0xe'));_0x2edd87(_0x4c2c8b[_0x6a2b('0x13')][_0x6a2b('0x12')]);}})[_0x6a2b('0x14')](function(_0x237151){logger['error'](_0x6a2b('0xd'),_0xfbd0c4,_0x237151);_0x5f1260(_0x237151);});});}exports[_0x6a2b('0x15')]=function(_0x149b51){var _0x98920=this;return new Promise(function(_0x20ad3a,_0x4db38d){return db[_0x6a2b('0x16')][_0x6a2b('0x17')](_0x149b51['body'],{'raw':_0x149b51[_0x6a2b('0x18')]?_0x149b51[_0x6a2b('0x18')][_0x6a2b('0x19')]===undefined?!![]:![]:!![]})[_0x6a2b('0x1a')](function(_0x2f9642){logger['info'](_0x6a2b('0x15'),_0x149b51);logger['debug']('CreateChatQueueReport',_0x149b51,JSON[_0x6a2b('0x10')](_0x2f9642));_0x20ad3a(_0x2f9642);})[_0x6a2b('0x14')](function(_0x30d78d){logger[_0x6a2b('0x11')](_0x6a2b('0x15'),_0x30d78d[_0x6a2b('0x12')],_0x149b51);_0x4db38d(_0x98920[_0x6a2b('0x11')](0x1f4,_0x30d78d[_0x6a2b('0x12')]));});});};exports[_0x6a2b('0x1b')]=function(_0xda7851){var _0x5e83be=this;return new Promise(function(_0x352949,_0x6389bb){return db[_0x6a2b('0x16')][_0x6a2b('0x1c')](_0xda7851[_0x6a2b('0x1d')],{'raw':_0xda7851[_0x6a2b('0x18')]?_0xda7851[_0x6a2b('0x18')][_0x6a2b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xda7851[_0x6a2b('0x18')]?_0xda7851[_0x6a2b('0x18')][_0x6a2b('0x1e')]||null:null,'attributes':_0xda7851['options']?_0xda7851[_0x6a2b('0x18')]['attributes']||null:null,'limit':_0xda7851[_0x6a2b('0x18')]?_0xda7851[_0x6a2b('0x18')][_0x6a2b('0x1f')]||null:null})[_0x6a2b('0x1a')](function(_0x4d2877){logger[_0x6a2b('0xc')](_0x6a2b('0x1b'),_0xda7851);logger['debug'](_0x6a2b('0x1b'),_0xda7851,JSON['stringify'](_0x4d2877));_0x352949(_0x4d2877);})[_0x6a2b('0x14')](function(_0x3c6f34){logger[_0x6a2b('0x11')](_0x6a2b('0x1b'),_0x3c6f34[_0x6a2b('0x12')],_0xda7851);_0x6389bb(_0x5e83be[_0x6a2b('0x11')](0x1f4,_0x3c6f34[_0x6a2b('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 7e586e3..3a197e7 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 _0x9453=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./chatQueueReport.controller','get','index','/describe','describe','isAuthenticated','show','put','/:id','update'];(function(_0xe6391c,_0x322480){var _0x3f396f=function(_0x13f612){while(--_0x13f612){_0xe6391c['push'](_0xe6391c['shift']());}};_0x3f396f(++_0x322480);}(_0x9453,0x88));var _0x3945=function(_0x393650,_0x7f8f1f){_0x393650=_0x393650-0x0;var _0x18e2db=_0x9453[_0x393650];return _0x18e2db;};'use strict';var multer=require(_0x3945('0x0'));var util=require(_0x3945('0x1'));var path=require(_0x3945('0x2'));var timeout=require(_0x3945('0x3'));var express=require('express');var router=express[_0x3945('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3945('0x5'));var config=require('../../config/environment');var controller=require(_0x3945('0x6'));router[_0x3945('0x7')]('/',auth['isAuthenticated'](),controller[_0x3945('0x8')]);router[_0x3945('0x7')](_0x3945('0x9'),auth['isAuthenticated'](),controller[_0x3945('0xa')]);router['get']('/:id',auth[_0x3945('0xb')](),controller[_0x3945('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3945('0xd')](_0x3945('0xe'),auth[_0x3945('0xb')](),controller[_0x3945('0xf')]);router[_0x3945('0x10')](_0x3945('0xe'),auth[_0x3945('0xb')](),controller[_0x3945('0x11')]);module[_0x3945('0x12')]=router;
\ No newline at end of file
+var _0xf329=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer'];(function(_0x13ea36,_0x2805ad){var _0x312066=function(_0xfbee88){while(--_0xfbee88){_0x13ea36['push'](_0x13ea36['shift']());}};_0x312066(++_0x2805ad);}(_0xf329,0x1a3));var _0x9f32=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf329[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9f32('0x0'));var util=require(_0x9f32('0x1'));var path=require('path');var timeout=require(_0x9f32('0x2'));var express=require(_0x9f32('0x3'));var router=express[_0x9f32('0x4')]();var fs_extra=require(_0x9f32('0x5'));var auth=require(_0x9f32('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9f32('0x7'));var controller=require(_0x9f32('0x8'));router[_0x9f32('0x9')]('/',auth[_0x9f32('0xa')](),controller[_0x9f32('0xb')]);router[_0x9f32('0x9')](_0x9f32('0xc'),auth[_0x9f32('0xa')](),controller[_0x9f32('0xd')]);router[_0x9f32('0x9')](_0x9f32('0xe'),auth['isAuthenticated'](),controller[_0x9f32('0xf')]);router['post']('/',auth[_0x9f32('0xa')](),controller[_0x9f32('0x10')]);router[_0x9f32('0x11')](_0x9f32('0xe'),auth['isAuthenticated'](),controller[_0x9f32('0x12')]);router[_0x9f32('0x13')](_0x9f32('0xe'),auth[_0x9f32('0xa')](),controller['destroy']);module[_0x9f32('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index e9c7814..6370781 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4bb593,_0x272ed0){var _0x2da2d8=function(_0x4b25e9){while(--_0x4b25e9){_0x4bb593['push'](_0x4bb593['shift']());}};_0x2da2d8(++_0x272ed0);}(_0xaa88,0x137));var _0x8aa8=function(_0x3efe87,_0x35ad48){_0x3efe87=_0x3efe87-0x0;var _0x56a4cc=_0xaa88[_0x3efe87];return _0x56a4cc;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5634df,_0x332cf8){var _0x4f2d43=function(_0x5a6a03){while(--_0x5a6a03){_0x5634df['push'](_0x5634df['shift']());}};_0x4f2d43(++_0x332cf8);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5ca74a,_0x3a057c){_0x5ca74a=_0x5ca74a-0x0;var _0x96e793=_0xf4eb[_0x5ca74a];return _0x96e793;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 348dfff..2ef2006 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 _0xae35=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','include','findAll','params','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring'];(function(_0x48a6e7,_0x5e9ecf){var _0x428fa7=function(_0x5e691a){while(--_0x5e691a){_0x48a6e7['push'](_0x48a6e7['shift']());}};_0x428fa7(++_0x5e9ecf);}(_0xae35,0x7b));var _0x5ae3=function(_0x294649,_0x4c0712){_0x294649=_0x294649-0x0;var _0x1225a8=_0xae35[_0x294649];return _0x1225a8;};'use strict';var emlformat=require(_0x5ae3('0x0'));var rimraf=require(_0x5ae3('0x1'));var zipdir=require(_0x5ae3('0x2'));var jsonpatch=require(_0x5ae3('0x3'));var rp=require(_0x5ae3('0x4'));var moment=require(_0x5ae3('0x5'));var BPromise=require(_0x5ae3('0x6'));var Mustache=require(_0x5ae3('0x7'));var util=require(_0x5ae3('0x8'));var path=require(_0x5ae3('0x9'));var sox=require(_0x5ae3('0xa'));var csv=require('to-csv');var ejs=require(_0x5ae3('0xb'));var fs=require('fs');var fs_extra=require(_0x5ae3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5ae3('0xd'));var deskjs=require(_0x5ae3('0xe'));var toCsv=require(_0x5ae3('0xf'));var querystring=require(_0x5ae3('0x10'));var Papa=require(_0x5ae3('0x11'));var Redis=require(_0x5ae3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5ae3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ae3('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5ae3('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f974d,_0x19f66a){_0x19f66a=_0x19f66a||0xcc;return function(_0x5cb990){if(_0x5cb990){return _0x4f974d[_0x5ae3('0x16')](_0x19f66a);}return _0x4f974d['status'](_0x19f66a)['end']();};}function respondWithResult(_0x47b657,_0x3e8907){_0x3e8907=_0x3e8907||0xc8;return function(_0x2b7f95){if(_0x2b7f95){return _0x47b657[_0x5ae3('0x17')](_0x3e8907)[_0x5ae3('0x18')](_0x2b7f95);}};}function respondWithFilteredResult(_0xc8eb21,_0x3b4982){return function(_0x1dd78b){if(_0x1dd78b){var _0x17cf57=typeof _0x3b4982[_0x5ae3('0x19')]===_0x5ae3('0x1a')&&typeof _0x3b4982[_0x5ae3('0x1b')]===_0x5ae3('0x1a');var _0x28d2db=_0x1dd78b[_0x5ae3('0x1c')];var _0x2d88d1=_0x17cf57?0x0:_0x3b4982[_0x5ae3('0x19')];var _0x2083b8=_0x17cf57?_0x1dd78b['count']:_0x3b4982['offset']+_0x3b4982[_0x5ae3('0x1b')];var _0xed1955;if(_0x2083b8>=_0x28d2db){_0x2083b8=_0x28d2db;_0xed1955=0xc8;}else{_0xed1955=0xce;}_0xc8eb21['status'](_0xed1955);return _0xc8eb21[_0x5ae3('0x1d')]('Content-Range',_0x2d88d1+'-'+_0x2083b8+'/'+_0x28d2db)[_0x5ae3('0x18')](_0x1dd78b);}return null;};}function patchUpdates(_0x1e0005){return function(_0x43cc98){try{jsonpatch[_0x5ae3('0x1e')](_0x43cc98,_0x1e0005,!![]);}catch(_0xa9e73){return BPromise['reject'](_0xa9e73);}return _0x43cc98[_0x5ae3('0x1f')]();};}function saveUpdates(_0x3f6c55,_0x4c218c){return function(_0x413a7f){if(_0x413a7f){return _0x413a7f[_0x5ae3('0x20')](_0x3f6c55)[_0x5ae3('0x21')](function(_0x30530b){return _0x30530b;});}return null;};}function removeEntity(_0x494534,_0x22188f){return function(_0x3c8816){if(_0x3c8816){return _0x3c8816['destroy']()['then'](function(){_0x494534['status'](0xcc)[_0x5ae3('0x22')]();});}};}function handleEntityNotFound(_0x1196ff,_0x380521){return function(_0x2f54af){if(!_0x2f54af){_0x1196ff[_0x5ae3('0x16')](0x194);}return _0x2f54af;};}function handleError(_0x28e1ca,_0x20f4b0){_0x20f4b0=_0x20f4b0||0x1f4;return function(_0x3a0fcf){logger[_0x5ae3('0x23')](_0x3a0fcf[_0x5ae3('0x24')]);if(_0x3a0fcf[_0x5ae3('0x25')]){delete _0x3a0fcf[_0x5ae3('0x25')];}_0x28e1ca[_0x5ae3('0x17')](_0x20f4b0)[_0x5ae3('0x26')](_0x3a0fcf);};}exports[_0x5ae3('0x27')]=function(_0x40e6b4,_0x4ad139){var _0x24029c={},_0x591f10={},_0xf29ba8={'count':0x0,'rows':[]};var _0x225c2e=_[_0x5ae3('0x28')](db[_0x5ae3('0x29')][_0x5ae3('0x2a')],function(_0x1bd406){return{'name':_0x1bd406['fieldName'],'type':_0x1bd406[_0x5ae3('0x2b')]['key']};});_0x591f10[_0x5ae3('0x2c')]=_['map'](_0x225c2e,'name');_0x591f10['query']=_[_0x5ae3('0x2d')](_0x40e6b4[_0x5ae3('0x2e')]);_0x591f10['filters']=_[_0x5ae3('0x2f')](_0x591f10[_0x5ae3('0x2c')],_0x591f10[_0x5ae3('0x2e')]);_0x24029c[_0x5ae3('0x30')]=_['intersection'](_0x591f10[_0x5ae3('0x2c')],qs['fields'](_0x40e6b4[_0x5ae3('0x2e')][_0x5ae3('0x31')]));_0x24029c[_0x5ae3('0x30')]=_0x24029c[_0x5ae3('0x30')][_0x5ae3('0x32')]?_0x24029c[_0x5ae3('0x30')]:_0x591f10['model'];if(!_0x40e6b4['query'][_0x5ae3('0x33')](_0x5ae3('0x34'))){_0x24029c[_0x5ae3('0x1b')]=qs['limit'](_0x40e6b4[_0x5ae3('0x2e')][_0x5ae3('0x1b')]);_0x24029c[_0x5ae3('0x19')]=qs[_0x5ae3('0x19')](_0x40e6b4[_0x5ae3('0x2e')][_0x5ae3('0x19')]);}_0x24029c[_0x5ae3('0x35')]=qs[_0x5ae3('0x36')](_0x40e6b4[_0x5ae3('0x2e')][_0x5ae3('0x36')]);_0x24029c['where']=qs[_0x5ae3('0x37')](_[_0x5ae3('0x38')](_0x40e6b4[_0x5ae3('0x2e')],_0x591f10[_0x5ae3('0x37')]),_0x225c2e);if(_0x40e6b4[_0x5ae3('0x2e')][_0x5ae3('0x39')]){_0x24029c['where']=_[_0x5ae3('0x3a')](_0x24029c[_0x5ae3('0x3b')],{'$or':_[_0x5ae3('0x28')](_0x225c2e,function(_0x96f71d){if(_0x96f71d[_0x5ae3('0x2b')]!==_0x5ae3('0x3c')){var _0x5eb838={};_0x5eb838[_0x96f71d[_0x5ae3('0x25')]]={'$like':'%'+_0x40e6b4['query']['filter']+'%'};return _0x5eb838;}})});}_0x24029c=_[_0x5ae3('0x3a')]({},_0x24029c,_0x40e6b4[_0x5ae3('0x3d')]);var _0x4e3af5={'where':_0x24029c[_0x5ae3('0x3b')]};return db[_0x5ae3('0x29')][_0x5ae3('0x1c')](_0x4e3af5)['then'](function(_0x5eac03){_0xf29ba8[_0x5ae3('0x1c')]=_0x5eac03;if(_0x40e6b4[_0x5ae3('0x2e')]['includeAll']){_0x24029c[_0x5ae3('0x3e')]=[{'all':!![]}];}return db[_0x5ae3('0x29')][_0x5ae3('0x3f')](_0x24029c);})[_0x5ae3('0x21')](function(_0x55c05e){_0xf29ba8['rows']=_0x55c05e;return _0xf29ba8;})['then'](respondWithFilteredResult(_0x4ad139,_0x24029c))['catch'](handleError(_0x4ad139,null));};exports['show']=function(_0x320f0f,_0x3ab133){var _0x4e4be3={'raw':!![],'where':{'id':_0x320f0f[_0x5ae3('0x40')]['id']}},_0x23c363={};_0x23c363['model']=_[_0x5ae3('0x2d')](db[_0x5ae3('0x29')]['rawAttributes']);_0x23c363[_0x5ae3('0x2e')]=_[_0x5ae3('0x2d')](_0x320f0f['query']);_0x23c363[_0x5ae3('0x37')]=_[_0x5ae3('0x2f')](_0x23c363[_0x5ae3('0x2c')],_0x23c363[_0x5ae3('0x2e')]);_0x4e4be3[_0x5ae3('0x30')]=_[_0x5ae3('0x2f')](_0x23c363[_0x5ae3('0x2c')],qs[_0x5ae3('0x31')](_0x320f0f[_0x5ae3('0x2e')]['fields']));_0x4e4be3[_0x5ae3('0x30')]=_0x4e4be3[_0x5ae3('0x30')][_0x5ae3('0x32')]?_0x4e4be3[_0x5ae3('0x30')]:_0x23c363[_0x5ae3('0x2c')];if(_0x320f0f[_0x5ae3('0x2e')]['includeAll']){_0x4e4be3['include']=[{'all':!![]}];}_0x4e4be3=_['merge']({},_0x4e4be3,_0x320f0f[_0x5ae3('0x3d')]);return db[_0x5ae3('0x29')]['find'](_0x4e4be3)[_0x5ae3('0x21')](handleEntityNotFound(_0x3ab133,null))[_0x5ae3('0x21')](respondWithResult(_0x3ab133,null))[_0x5ae3('0x41')](handleError(_0x3ab133,null));};exports[_0x5ae3('0x42')]=function(_0x198f03,_0x57be84){return db[_0x5ae3('0x29')][_0x5ae3('0x42')](_0x198f03[_0x5ae3('0x43')],{})['then'](respondWithResult(_0x57be84,0xc9))[_0x5ae3('0x41')](handleError(_0x57be84,null));};exports['update']=function(_0x32b1f7,_0x16019e){if(_0x32b1f7[_0x5ae3('0x43')]['id']){delete _0x32b1f7['body']['id'];}return db[_0x5ae3('0x29')]['find']({'where':{'id':_0x32b1f7[_0x5ae3('0x40')]['id']}})[_0x5ae3('0x21')](handleEntityNotFound(_0x16019e,null))[_0x5ae3('0x21')](saveUpdates(_0x32b1f7[_0x5ae3('0x43')],null))[_0x5ae3('0x21')](respondWithResult(_0x16019e,null))[_0x5ae3('0x41')](handleError(_0x16019e,null));};exports[_0x5ae3('0x44')]=function(_0x482872,_0x573c3e){return db[_0x5ae3('0x29')]['find']({'where':{'id':_0x482872[_0x5ae3('0x40')]['id']}})[_0x5ae3('0x21')](handleEntityNotFound(_0x573c3e,null))[_0x5ae3('0x21')](removeEntity(_0x573c3e,null))[_0x5ae3('0x41')](handleError(_0x573c3e,null));};exports['describe']=function(_0x37c690,_0x344b1f){return db['ChatTransferReport'][_0x5ae3('0x45')]()[_0x5ae3('0x21')](respondWithResult(_0x344b1f,null))['catch'](handleError(_0x344b1f,null));};
\ No newline at end of file
+var _0x8d02=['ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox'];(function(_0x4f0f32,_0x5f4739){var _0x40dcd4=function(_0x40591e){while(--_0x40591e){_0x4f0f32['push'](_0x4f0f32['shift']());}};_0x40dcd4(++_0x5f4739);}(_0x8d02,0xda));var _0x28d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8d02[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x28d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x28d0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28d0('0x2'));var moment=require(_0x28d0('0x3'));var BPromise=require(_0x28d0('0x4'));var Mustache=require(_0x28d0('0x5'));var util=require('util');var path=require('path');var sox=require(_0x28d0('0x6'));var csv=require('to-csv');var ejs=require(_0x28d0('0x7'));var fs=require('fs');var fs_extra=require(_0x28d0('0x8'));var _=require('lodash');var squel=require(_0x28d0('0x9'));var crypto=require(_0x28d0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x28d0('0xb'));var toCsv=require(_0x28d0('0xc'));var querystring=require(_0x28d0('0xd'));var Papa=require(_0x28d0('0xe'));var Redis=require(_0x28d0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x28d0('0x10'));var as=require(_0x28d0('0x11'));var hardwareService=require(_0x28d0('0x12'));var logger=require(_0x28d0('0x13'))(_0x28d0('0x14'));var utils=require(_0x28d0('0x15'));var config=require(_0x28d0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x28d0('0x17'))['db'];function respondWithStatusCode(_0xd3bbf5,_0x39acde){_0x39acde=_0x39acde||0xcc;return function(_0x3dba0f){if(_0x3dba0f){return _0xd3bbf5['sendStatus'](_0x39acde);}return _0xd3bbf5['status'](_0x39acde)[_0x28d0('0x18')]();};}function respondWithResult(_0x38ec12,_0x4e9601){_0x4e9601=_0x4e9601||0xc8;return function(_0x57b769){if(_0x57b769){return _0x38ec12['status'](_0x4e9601)[_0x28d0('0x19')](_0x57b769);}};}function respondWithFilteredResult(_0x30a606,_0x3ef19b){return function(_0x4a950f){if(_0x4a950f){var _0x4ad6d4=typeof _0x3ef19b[_0x28d0('0x1a')]===_0x28d0('0x1b')&&typeof _0x3ef19b[_0x28d0('0x1c')]==='undefined';var _0x1129b8=_0x4a950f[_0x28d0('0x1d')];var _0x4d3ada=_0x4ad6d4?0x0:_0x3ef19b[_0x28d0('0x1a')];var _0x8fd22a=_0x4ad6d4?_0x4a950f[_0x28d0('0x1d')]:_0x3ef19b['offset']+_0x3ef19b[_0x28d0('0x1c')];var _0x3b3bfd;if(_0x8fd22a>=_0x1129b8){_0x8fd22a=_0x1129b8;_0x3b3bfd=0xc8;}else{_0x3b3bfd=0xce;}_0x30a606[_0x28d0('0x1e')](_0x3b3bfd);return _0x30a606['set'](_0x28d0('0x1f'),_0x4d3ada+'-'+_0x8fd22a+'/'+_0x1129b8)['json'](_0x4a950f);}return null;};}function patchUpdates(_0x588a0d){return function(_0x3933ca){try{jsonpatch[_0x28d0('0x20')](_0x3933ca,_0x588a0d,!![]);}catch(_0x53bfaa){return BPromise[_0x28d0('0x21')](_0x53bfaa);}return _0x3933ca[_0x28d0('0x22')]();};}function saveUpdates(_0x48428b,_0x101bc9){return function(_0x556df9){if(_0x556df9){return _0x556df9[_0x28d0('0x23')](_0x48428b)[_0x28d0('0x24')](function(_0x98ee3){return _0x98ee3;});}return null;};}function removeEntity(_0x3b89ca,_0x4f1db7){return function(_0x4f3976){if(_0x4f3976){return _0x4f3976[_0x28d0('0x25')]()[_0x28d0('0x24')](function(){_0x3b89ca[_0x28d0('0x1e')](0xcc)[_0x28d0('0x18')]();});}};}function handleEntityNotFound(_0x42c5cf,_0x8dca0c){return function(_0x35909e){if(!_0x35909e){_0x42c5cf[_0x28d0('0x26')](0x194);}return _0x35909e;};}function handleError(_0x30fbb9,_0x3416c7){_0x3416c7=_0x3416c7||0x1f4;return function(_0x28c6fc){logger[_0x28d0('0x27')](_0x28c6fc[_0x28d0('0x28')]);if(_0x28c6fc[_0x28d0('0x29')]){delete _0x28c6fc[_0x28d0('0x29')];}_0x30fbb9[_0x28d0('0x1e')](_0x3416c7)[_0x28d0('0x2a')](_0x28c6fc);};}exports[_0x28d0('0x2b')]=function(_0x45dca8,_0x2b0229){var _0x1fa18={},_0x2b9659={},_0x44ec2e={'count':0x0,'rows':[]};var _0x13b395=_[_0x28d0('0x2c')](db[_0x28d0('0x2d')][_0x28d0('0x2e')],function(_0x29e546){return{'name':_0x29e546[_0x28d0('0x2f')],'type':_0x29e546[_0x28d0('0x30')][_0x28d0('0x31')]};});_0x2b9659[_0x28d0('0x32')]=_[_0x28d0('0x2c')](_0x13b395,_0x28d0('0x29'));_0x2b9659[_0x28d0('0x33')]=_[_0x28d0('0x34')](_0x45dca8['query']);_0x2b9659[_0x28d0('0x35')]=_[_0x28d0('0x36')](_0x2b9659[_0x28d0('0x32')],_0x2b9659[_0x28d0('0x33')]);_0x1fa18['attributes']=_[_0x28d0('0x36')](_0x2b9659['model'],qs[_0x28d0('0x37')](_0x45dca8[_0x28d0('0x33')]['fields']));_0x1fa18[_0x28d0('0x38')]=_0x1fa18[_0x28d0('0x38')][_0x28d0('0x39')]?_0x1fa18[_0x28d0('0x38')]:_0x2b9659[_0x28d0('0x32')];if(!_0x45dca8[_0x28d0('0x33')]['hasOwnProperty']('nolimit')){_0x1fa18['limit']=qs[_0x28d0('0x1c')](_0x45dca8['query'][_0x28d0('0x1c')]);_0x1fa18[_0x28d0('0x1a')]=qs['offset'](_0x45dca8[_0x28d0('0x33')][_0x28d0('0x1a')]);}_0x1fa18['order']=qs['sort'](_0x45dca8[_0x28d0('0x33')][_0x28d0('0x3a')]);_0x1fa18[_0x28d0('0x3b')]=qs[_0x28d0('0x35')](_[_0x28d0('0x3c')](_0x45dca8[_0x28d0('0x33')],_0x2b9659[_0x28d0('0x35')]),_0x13b395);if(_0x45dca8['query'][_0x28d0('0x3d')]){_0x1fa18['where']=_[_0x28d0('0x3e')](_0x1fa18[_0x28d0('0x3b')],{'$or':_[_0x28d0('0x2c')](_0x13b395,function(_0x29bac6){if(_0x29bac6[_0x28d0('0x30')]!==_0x28d0('0x3f')){var _0x17e1d9={};_0x17e1d9[_0x29bac6[_0x28d0('0x29')]]={'$like':'%'+_0x45dca8[_0x28d0('0x33')][_0x28d0('0x3d')]+'%'};return _0x17e1d9;}})});}_0x1fa18=_[_0x28d0('0x3e')]({},_0x1fa18,_0x45dca8[_0x28d0('0x40')]);var _0xe42ba9={'where':_0x1fa18[_0x28d0('0x3b')]};return db[_0x28d0('0x2d')][_0x28d0('0x1d')](_0xe42ba9)[_0x28d0('0x24')](function(_0x3a3343){_0x44ec2e[_0x28d0('0x1d')]=_0x3a3343;if(_0x45dca8[_0x28d0('0x33')][_0x28d0('0x41')]){_0x1fa18[_0x28d0('0x42')]=[{'all':!![]}];}return db[_0x28d0('0x2d')][_0x28d0('0x43')](_0x1fa18);})['then'](function(_0x4a140b){_0x44ec2e[_0x28d0('0x44')]=_0x4a140b;return _0x44ec2e;})[_0x28d0('0x24')](respondWithFilteredResult(_0x2b0229,_0x1fa18))[_0x28d0('0x45')](handleError(_0x2b0229,null));};exports['show']=function(_0x334d69,_0x2816d3){var _0x536f73={'raw':!![],'where':{'id':_0x334d69[_0x28d0('0x46')]['id']}},_0x43a5f6={};_0x43a5f6[_0x28d0('0x32')]=_[_0x28d0('0x34')](db[_0x28d0('0x2d')][_0x28d0('0x2e')]);_0x43a5f6['query']=_[_0x28d0('0x34')](_0x334d69[_0x28d0('0x33')]);_0x43a5f6[_0x28d0('0x35')]=_[_0x28d0('0x36')](_0x43a5f6[_0x28d0('0x32')],_0x43a5f6['query']);_0x536f73[_0x28d0('0x38')]=_['intersection'](_0x43a5f6['model'],qs[_0x28d0('0x37')](_0x334d69[_0x28d0('0x33')]['fields']));_0x536f73[_0x28d0('0x38')]=_0x536f73['attributes'][_0x28d0('0x39')]?_0x536f73[_0x28d0('0x38')]:_0x43a5f6[_0x28d0('0x32')];if(_0x334d69[_0x28d0('0x33')]['includeAll']){_0x536f73[_0x28d0('0x42')]=[{'all':!![]}];}_0x536f73=_[_0x28d0('0x3e')]({},_0x536f73,_0x334d69[_0x28d0('0x40')]);return db[_0x28d0('0x2d')][_0x28d0('0x47')](_0x536f73)[_0x28d0('0x24')](handleEntityNotFound(_0x2816d3,null))[_0x28d0('0x24')](respondWithResult(_0x2816d3,null))[_0x28d0('0x45')](handleError(_0x2816d3,null));};exports[_0x28d0('0x48')]=function(_0x3b0c55,_0x4d0674){return db['ChatTransferReport'][_0x28d0('0x48')](_0x3b0c55[_0x28d0('0x49')],{})[_0x28d0('0x24')](respondWithResult(_0x4d0674,0xc9))['catch'](handleError(_0x4d0674,null));};exports[_0x28d0('0x23')]=function(_0x4fb803,_0x2d753b){if(_0x4fb803[_0x28d0('0x49')]['id']){delete _0x4fb803[_0x28d0('0x49')]['id'];}return db[_0x28d0('0x2d')][_0x28d0('0x47')]({'where':{'id':_0x4fb803['params']['id']}})[_0x28d0('0x24')](handleEntityNotFound(_0x2d753b,null))[_0x28d0('0x24')](saveUpdates(_0x4fb803[_0x28d0('0x49')],null))[_0x28d0('0x24')](respondWithResult(_0x2d753b,null))[_0x28d0('0x45')](handleError(_0x2d753b,null));};exports[_0x28d0('0x25')]=function(_0x1e946e,_0x3abeeb){return db['ChatTransferReport']['find']({'where':{'id':_0x1e946e['params']['id']}})['then'](handleEntityNotFound(_0x3abeeb,null))[_0x28d0('0x24')](removeEntity(_0x3abeeb,null))[_0x28d0('0x45')](handleError(_0x3abeeb,null));};exports[_0x28d0('0x4a')]=function(_0x514fb6,_0x8f2cb3){return db[_0x28d0('0x2d')]['describe']()['then'](respondWithResult(_0x8f2cb3,null))[_0x28d0('0x45')](handleError(_0x8f2cb3,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index e887951..3e69661 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 _0x7b31=['./chatTransferReport.attributes','exports','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x39899b,_0x5596c6){var _0x3eeb44=function(_0x34b483){while(--_0x34b483){_0x39899b['push'](_0x39899b['shift']());}};_0x3eeb44(++_0x5596c6);}(_0x7b31,0xee));var _0x17b3=function(_0x34fa36,_0x44121c){_0x34fa36=_0x34fa36-0x0;var _0x4acc08=_0x7b31[_0x34fa36];return _0x4acc08;};'use strict';var _=require(_0x17b3('0x0'));var util=require(_0x17b3('0x1'));var logger=require(_0x17b3('0x2'))(_0x17b3('0x3'));var moment=require(_0x17b3('0x4'));var BPromise=require(_0x17b3('0x5'));var rp=require(_0x17b3('0x6'));var fs=require('fs');var path=require(_0x17b3('0x7'));var rimraf=require('rimraf');var config=require(_0x17b3('0x8'));var attributes=require(_0x17b3('0x9'));module[_0x17b3('0xa')]=function(_0x58b47b,_0x2168b6){return _0x58b47b['define']('ChatTransferReport',attributes,{'tableName':_0x17b3('0xb'),'paranoid':![],'indexes':[{'name':_0x17b3('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x347c=['ChatTransferReport','uniqueid','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x2d67b4,_0x4ca8fe){var _0x4cd582=function(_0x21180a){while(--_0x21180a){_0x2d67b4['push'](_0x2d67b4['shift']());}};_0x4cd582(++_0x4ca8fe);}(_0x347c,0x16a));var _0xc347=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x347c[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xc347('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc347('0x1'));var moment=require(_0xc347('0x2'));var BPromise=require('bluebird');var rp=require(_0xc347('0x3'));var fs=require('fs');var path=require(_0xc347('0x4'));var rimraf=require(_0xc347('0x5'));var config=require(_0xc347('0x6'));var attributes=require(_0xc347('0x7'));module[_0xc347('0x8')]=function(_0x423426,_0x503779){return _0x423426[_0xc347('0x9')](_0xc347('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xc347('0xb'),'fields':[_0xc347('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index a87fc23..55bd851 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 _0xbac3=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x3e4f43,_0x224773){var _0x30f56c=function(_0x381a0f){while(--_0x381a0f){_0x3e4f43['push'](_0x3e4f43['shift']());}};_0x30f56c(++_0x224773);}(_0xbac3,0x1ef));var _0x3bac=function(_0x13eaae,_0x11ec0a){_0x13eaae=_0x13eaae-0x0;var _0x4493db=_0xbac3[_0x13eaae];return _0x4493db;};'use strict';var _=require(_0x3bac('0x0'));var util=require('util');var moment=require(_0x3bac('0x1'));var BPromise=require(_0x3bac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3bac('0x3'));var db=require(_0x3bac('0x4'))['db'];var utils=require(_0x3bac('0x5'));var logger=require(_0x3bac('0x6'))(_0x3bac('0x7'));var config=require(_0x3bac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3bac('0x9')][_0x3bac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x157915,_0x828d0f,_0x385dea){return new BPromise(function(_0x196987,_0x5cf8de){return client[_0x3bac('0xb')](_0x157915,_0x385dea)[_0x3bac('0xc')](function(_0x2e96d8){logger[_0x3bac('0xd')](_0x3bac('0xe'),_0x828d0f,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x828d0f,_0x3bac('0xf'),JSON['stringify'](_0x2e96d8));if(_0x2e96d8['error']){if(_0x2e96d8['error']['code']===0x1f4){logger[_0x3bac('0x10')](_0x3bac('0xe'),_0x828d0f,_0x2e96d8[_0x3bac('0x10')][_0x3bac('0x11')]);return _0x5cf8de(_0x2e96d8[_0x3bac('0x10')][_0x3bac('0x11')]);}logger[_0x3bac('0x10')](_0x3bac('0xe'),_0x828d0f,_0x2e96d8[_0x3bac('0x10')][_0x3bac('0x11')]);return _0x196987(_0x2e96d8[_0x3bac('0x10')][_0x3bac('0x11')]);}else{logger[_0x3bac('0xd')](_0x3bac('0xe'),_0x828d0f,_0x3bac('0xf'));_0x196987(_0x2e96d8['result'][_0x3bac('0x11')]);}})[_0x3bac('0x12')](function(_0x222764){logger[_0x3bac('0x10')](_0x3bac('0xe'),_0x828d0f,_0x222764);_0x5cf8de(_0x222764);});});}
\ No newline at end of file
+var _0x6c0f=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x7ad123,_0xeeeef3){var _0x37d073=function(_0x51367b){while(--_0x51367b){_0x7ad123['push'](_0x7ad123['shift']());}};_0x37d073(++_0xeeeef3);}(_0x6c0f,0x15c));var _0xf6c0=function(_0x5d6a08,_0x5f3a16){_0x5d6a08=_0x5d6a08-0x0;var _0x1f9acc=_0x6c0f[_0x5d6a08];return _0x1f9acc;};'use strict';var _=require(_0xf6c0('0x0'));var util=require('util');var moment=require(_0xf6c0('0x1'));var BPromise=require('bluebird');var rs=require(_0xf6c0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6c0('0x3'))['db'];var utils=require(_0xf6c0('0x4'));var logger=require('../../config/logger')(_0xf6c0('0x5'));var config=require(_0xf6c0('0x6'));var jayson=require(_0xf6c0('0x7'));var client=jayson[_0xf6c0('0x8')][_0xf6c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41eef1,_0x4dbf84,_0x156324){return new BPromise(function(_0x4fe409,_0x105926){return client[_0xf6c0('0xa')](_0x41eef1,_0x156324)[_0xf6c0('0xb')](function(_0x30ec9b){logger[_0xf6c0('0xc')](_0xf6c0('0xd'),_0x4dbf84,_0xf6c0('0xe'));logger[_0xf6c0('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4dbf84,_0xf6c0('0xe'),JSON[_0xf6c0('0x10')](_0x30ec9b));if(_0x30ec9b[_0xf6c0('0x11')]){if(_0x30ec9b[_0xf6c0('0x11')]['code']===0x1f4){logger[_0xf6c0('0x11')](_0xf6c0('0xd'),_0x4dbf84,_0x30ec9b['error'][_0xf6c0('0x12')]);return _0x105926(_0x30ec9b[_0xf6c0('0x11')][_0xf6c0('0x12')]);}logger['error'](_0xf6c0('0xd'),_0x4dbf84,_0x30ec9b[_0xf6c0('0x11')][_0xf6c0('0x12')]);return _0x4fe409(_0x30ec9b['error'][_0xf6c0('0x12')]);}else{logger[_0xf6c0('0xc')](_0xf6c0('0xd'),_0x4dbf84,_0xf6c0('0xe'));_0x4fe409(_0x30ec9b[_0xf6c0('0x13')]['message']);}})['catch'](function(_0x518eff){logger['error'](_0xf6c0('0xd'),_0x4dbf84,_0x518eff);_0x105926(_0x518eff);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 0de56ae..53df50e 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 _0x517e=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','post','create'];(function(_0x46ef1d,_0x24926){var _0x49ce69=function(_0x5db4fc){while(--_0x5db4fc){_0x46ef1d['push'](_0x46ef1d['shift']());}};_0x49ce69(++_0x24926);}(_0x517e,0x115));var _0xe517=function(_0x136a67,_0x50cc82){_0x136a67=_0x136a67-0x0;var _0x4d3ed2=_0x517e[_0x136a67];return _0x4d3ed2;};'use strict';var multer=require(_0xe517('0x0'));var util=require(_0xe517('0x1'));var path=require(_0xe517('0x2'));var timeout=require(_0xe517('0x3'));var express=require(_0xe517('0x4'));var router=express[_0xe517('0x5')]();var fs_extra=require(_0xe517('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe517('0x7'));var config=require(_0xe517('0x8'));var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0xe517('0x9')](),controller[_0xe517('0xa')]);router[_0xe517('0xb')](_0xe517('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xe517('0xb')](_0xe517('0xd'),auth[_0xe517('0x9')](),controller[_0xe517('0xe')]);router[_0xe517('0xf')]('/',auth['isAuthenticated'](),controller[_0xe517('0x10')]);router[_0xe517('0x11')](_0xe517('0xd'),auth[_0xe517('0x9')](),controller[_0xe517('0x12')]);router[_0xe517('0x13')](_0xe517('0xd'),auth['isAuthenticated'](),controller[_0xe517('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x502b=['put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x1a5e46,_0x39c459){var _0x2edd08=function(_0x21e7b9){while(--_0x21e7b9){_0x1a5e46['push'](_0x1a5e46['shift']());}};_0x2edd08(++_0x39c459);}(_0x502b,0xdf));var _0xb502=function(_0x1a5946,_0x426991){_0x1a5946=_0x1a5946-0x0;var _0x25e9d5=_0x502b[_0x1a5946];return _0x25e9d5;};'use strict';var multer=require(_0xb502('0x0'));var util=require(_0xb502('0x1'));var path=require(_0xb502('0x2'));var timeout=require(_0xb502('0x3'));var express=require(_0xb502('0x4'));var router=express[_0xb502('0x5')]();var fs_extra=require(_0xb502('0x6'));var auth=require(_0xb502('0x7'));var interaction=require(_0xb502('0x8'));var config=require('../../config/environment');var controller=require(_0xb502('0x9'));router[_0xb502('0xa')]('/',auth['isAuthenticated'](),controller[_0xb502('0xb')]);router[_0xb502('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xb502('0xc'),auth[_0xb502('0xd')](),controller[_0xb502('0xe')]);router[_0xb502('0xf')]('/',auth[_0xb502('0xd')](),controller[_0xb502('0x10')]);router[_0xb502('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb502('0x12')]);router[_0xb502('0x13')](_0xb502('0xc'),auth[_0xb502('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index fa06c2e..8bde91e 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 _0x2943=['New\x20offline\x20message\x20from\x20websiteName','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','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','star','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'];(function(_0x19456a,_0x44ae21){var _0x4c7a95=function(_0x5e49ff){while(--_0x5e49ff){_0x19456a['push'](_0x19456a['shift']());}};_0x4c7a95(++_0x44ae21);}(_0x2943,0xe6));var _0x3294=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0x2943[_0x2bddf9];return _0x3f3ae9;};'use strict';var Sequelize=require(_0x3294('0x0'));var rs=require(_0x3294('0x1'));module[_0x3294('0x2')]={'name':{'type':Sequelize[_0x3294('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3294('0x4')},'description':{'type':Sequelize[_0x3294('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x3294('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3294('0x6')},'customerAlias':{'type':Sequelize[_0x3294('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3294('0x3')],'allowNull':![],'defaultValue':_0x3294('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3294('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3294('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3294('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x3294('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3294('0xa')](_0x3294('0xb'),_0x3294('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0xd')},'start_chat_button':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x3294('0xf')},'header_offline':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0x10')},'download_transcript':{'type':Sequelize[_0x3294('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3294('0x11')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3294('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x3294('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3294('0x12')]},'closingQuestion':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0x14')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3294('0x15')},'noteTitle':{'type':Sequelize[_0x3294('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3294('0x16')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0xf')},'skipMessageButton':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0x17')},'conditionAgreement':{'type':Sequelize[_0x3294('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3294('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0x18')},'ratingType':{'type':Sequelize[_0x3294('0xa')](_0x3294('0x19'),'thumb'),'defaultValue':_0x3294('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x3294('0x11')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3294('0x12')],'defaultValue':function(){return JSON[_0x3294('0x1a')]({'items':[{'type':_0x3294('0x1b'),'variable':null,'config':{'placeholder':_0x3294('0x1c'),'type':_0x3294('0x1d'),'required':!![]},'props':{'title':_0x3294('0x1c'),'helpText':''}},{'type':_0x3294('0x1b'),'props':{'title':_0x3294('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3294('0x5'),'type':_0x3294('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3294('0x1e')](_0x3294('0x1f'))?JSON['parse'](this['getDataValue'](_0x3294('0x1f'))):{};},'set':function(_0x1b904b){return this[_0x3294('0x20')](_0x3294('0x1f'),JSON[_0x3294('0x1a')](_0x1b904b));}},'offlineForm':{'type':Sequelize[_0x3294('0x12')],'defaultValue':function(){return JSON[_0x3294('0x1a')]({'items':[{'type':_0x3294('0x1b'),'props':{'title':_0x3294('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3294('0x5'),'type':_0x3294('0x5')},'variable':null},{'type':_0x3294('0x21'),'config':{'placeholder':_0x3294('0x22')},'props':{'title':'Comments','helpText':_0x3294('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x3294('0x1e')](_0x3294('0x24'))?JSON[_0x3294('0x25')](this[_0x3294('0x1e')](_0x3294('0x24'))):{};},'set':function(_0x4811e5){return this[_0x3294('0x20')](_0x3294('0x24'),JSON[_0x3294('0x1a')](_0x4811e5));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x3294('0x26')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3294('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3294('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3294('0x3')]},'forwardOffline':{'type':Sequelize[_0x3294('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3294('0x3')]},'waitingTitle':{'type':Sequelize[_0x3294('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x3294('0x28')},'offlineMessageBody':{'type':Sequelize[_0x3294('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0x29')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x3294('0x17')},'sendUnmanaged':{'type':Sequelize[_0x3294('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x3294('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3294('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3294('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x3294('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x3294('0x12')],'defaultValue':function(){return _0x3294('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3294('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3294('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x3294('0x2d')},'messagesAlignment':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0x2e')},'defaultTitle':{'type':Sequelize[_0x3294('0x3')]},'customerAvatar':{'type':Sequelize[_0x3294('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0x3294('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3294('0x11')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3294('0x3')],'allowNull':![],'defaultValue':_0x3294('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3294('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3294('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3294('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3294('0x3')],'defaultValue':_0x3294('0x30')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3294('0x11')],'comment':_0x3294('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x3294('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x59e320){if(!_0x59e320)this[_0x3294('0x20')](_0x3294('0x32'),null);this['setDataValue'](_0x3294('0x33'),_0x59e320);}},'vidaooEscalation':{'type':Sequelize[_0x3294('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3294('0x3')]},'vidaooTopic':{'type':Sequelize[_0x3294('0x3')],'allowNull':![],'defaultValue':_0x3294('0x34')},'vidaooNote':{'type':Sequelize[_0x3294('0x3')],'defaultValue':function(){return _0x3294('0x35');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3294('0x12')]}};
\ No newline at end of file
+var _0xddfb=['STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','input','name','getDataValue','parse','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','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','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports'];(function(_0x77fd25,_0x226ea2){var _0xe14528=function(_0x1551d5){while(--_0x1551d5){_0x77fd25['push'](_0x77fd25['shift']());}};_0xe14528(++_0x226ea2);}(_0xddfb,0x101));var _0xbddf=function(_0x4b2d73,_0x57f61f){_0x4b2d73=_0x4b2d73-0x0;var _0x590b2c=_0xddfb[_0x4b2d73];return _0x590b2c;};'use strict';var Sequelize=require(_0xbddf('0x0'));var rs=require(_0xbddf('0x1'));module[_0xbddf('0x2')]={'name':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xbddf('0x3')]},'mapKey':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x4')},'mapKeyOffline':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x5')},'customerAlias':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![],'defaultValue':_0xbddf('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbddf('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbddf('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbddf('0x3')]},'animation':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbddf('0xa')](_0xbddf('0xb'),'squared'),'defaultValue':_0xbddf('0xb')},'header_online':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0xd')},'header_offline':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0xe')},'download_transcript':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbddf('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbddf('0xf')]},'closingQuestion':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x13')},'closingMessage':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x14')},'closingMessageButton':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0xd')},'skipMessageButton':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x15')},'conditionAgreement':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xbddf('0xa')](_0xbddf('0x16'),_0xbddf('0x17')),'defaultValue':_0xbddf('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xbddf('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbddf('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xbddf('0x18'),'variable':null,'config':{'placeholder':_0xbddf('0x19'),'type':'text','required':!![]},'props':{'title':_0xbddf('0x19'),'helpText':''}},{'type':_0xbddf('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xbddf('0x4'),'type':_0xbddf('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbddf('0x1a')]('onlineForm')?JSON[_0xbddf('0x1b')](this['getDataValue'](_0xbddf('0x1c'))):{};},'set':function(_0x267db7){return this[_0xbddf('0x1d')](_0xbddf('0x1c'),JSON[_0xbddf('0x1e')](_0x267db7));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xbddf('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbddf('0x4'),'type':_0xbddf('0x4')},'variable':null},{'type':_0xbddf('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0xbddf('0x20'),'helpText':_0xbddf('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xbddf('0x1a')](_0xbddf('0x22'))?JSON['parse'](this[_0xbddf('0x1a')](_0xbddf('0x22'))):{};},'set':function(_0x7668de){return this[_0xbddf('0x1d')](_0xbddf('0x22'),JSON[_0xbddf('0x1e')](_0x7668de));}},'token':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbddf('0x3')]},'forwardOffline':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbddf('0x3')]},'waitingTitle':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x24')},'offlineMessageSubject':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x25')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x27')},'skipUnmanaged':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x15')},'sendUnmanaged':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbddf('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xbddf('0xf')],'defaultValue':function(){return _0xbddf('0x28');}},'notificationSound':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xbddf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xbddf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x2b')},'messagesAlignment':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':_0xbddf('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbddf('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![],'defaultValue':_0xbddf('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbddf('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xbddf('0x2e')},'systemAvatar':{'type':Sequelize[_0xbddf('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbddf('0x8')],'comment':_0xbddf('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![],'comment':_0xbddf('0x30'),'set':function(_0x5ef7c6){if(!_0x5ef7c6)this[_0xbddf('0x1d')](_0xbddf('0x31'),null);this[_0xbddf('0x1d')](_0xbddf('0x32'),_0x5ef7c6);}},'vidaooEscalation':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xbddf('0x3')]},'vidaooTopic':{'type':Sequelize[_0xbddf('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xbddf('0x3')],'defaultValue':function(){return _0xbddf('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xbddf('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbddf('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index f6760fa..02c4609 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 _0x0fda=['queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','offlineMessageBody','ChatOfflineMessage','server','attachments','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','mimetype','subjectOffline','mapValues','Chat','notifyMail','offline-chat','remove','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','tag','getSnippet','virtual','custom','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.10.1','origin','http://localhost:9000','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','render','alignment','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','../../config/logger','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','./helpers/wildcard-expressions','url','URL','redis','defaults','localhost','socket.io-emitter','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','status','end','json','undefined','limit','count','offset','then','destroy','get','ChatWebsites','sendStatus','stack','name','send','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','model','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','key','query','attributes','intersection','fields','length','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch','show','options','find','create','body','address','split','forEach','testWildcardValidity','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','keys','Disposition','hasOwnProperty','nolimit','order','addAnswer','CannedAnswer','getAnswers','rawAttributes','findAll','ids','addLogo','sitepic','filename','addCustomerAvatar','customerAvatar','file','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','includes','updatedAt','CompanyId','from','CmList','List','ChatApplication','Intervals','interval','account','orderBy','Applications','priority','asc','list','ListId','Contacts','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','ChatMessage','AttachmentId','UserId','applications','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','queueId'];(function(_0x3bf925,_0x4dd8e4){var _0x2128a1=function(_0x4d2049){while(--_0x4d2049){_0x3bf925['push'](_0x3bf925['shift']());}};_0x2128a1(++_0x4dd8e4);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x4c3819,_0x2d4d27){_0x4c3819=_0x4c3819-0x0;var _0xf75525=_0x0fda[_0x4c3819];return _0xf75525;};'use strict';var Mustache=require(_0xa0fd('0x0'));var util=require('util');var path=require(_0xa0fd('0x1'));var ejs=require(_0xa0fd('0x2'));var fs=require('fs');var fs_extra=require(_0xa0fd('0x3'));var _=require(_0xa0fd('0x4'));var querystring=require(_0xa0fd('0x5'));var htmlToText=require(_0xa0fd('0x6'));var Redis=require(_0xa0fd('0x7'));var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require(_0xa0fd('0x8'))('api');var config=require('../../config/environment');var APIBadRequestError=require(_0xa0fd('0x9'))[_0xa0fd('0xa')];var APINotFoundError=require(_0xa0fd('0x9'))[_0xa0fd('0xb')];var APIOutOfIntervalError=require('../../errors/api')[_0xa0fd('0xc')];var APIHandleError=require(_0xa0fd('0x9'))[_0xa0fd('0xd')];var APIConflictError=require(_0xa0fd('0x9'))['APIConflictError'];var wildcardUtils=require(_0xa0fd('0xe'));var URL=require(_0xa0fd('0xf'))[_0xa0fd('0x10')];var db=require('../../mysqldb')['db'];config[_0xa0fd('0x11')]=_[_0xa0fd('0x12')](config[_0xa0fd('0x11')],{'host':_0xa0fd('0x13'),'port':0x18eb});var socket=require(_0xa0fd('0x14'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xa0fd('0x15')](socket);var client=jayson[_0xa0fd('0x16')]['http']({'port':0x232c});var client9002=jayson[_0xa0fd('0x16')][_0xa0fd('0x17')]({'port':0x232a});var client9003=jayson[_0xa0fd('0x16')][_0xa0fd('0x17')]({'port':0x232b});var client9001=jayson[_0xa0fd('0x16')][_0xa0fd('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x2811c0,_0x4fe62c,_0x1c6ffc,_0x326ba8){return new Promise(function(_0x5605ae,_0x50aa6d){var _0x205506=_0x326ba8||client;return _0x205506[_0xa0fd('0x18')](_0x2811c0,_0x1c6ffc)['then'](function(_0x2b8d15){logger[_0xa0fd('0x19')](_0xa0fd('0x1a'),_0x4fe62c,'request\x20sent');logger['debug'](_0xa0fd('0x1b'),_0x4fe62c,'request\x20sent',JSON[_0xa0fd('0x1c')](_0x2b8d15));if(_0x2b8d15[_0xa0fd('0x1d')]){if(_0x2b8d15[_0xa0fd('0x1d')][_0xa0fd('0x1e')]===0x1f4){logger[_0xa0fd('0x1d')](_0xa0fd('0x1a'),_0x4fe62c,_0x2b8d15[_0xa0fd('0x1d')]['message']);return _0x50aa6d(_0x2b8d15[_0xa0fd('0x1d')][_0xa0fd('0x1f')]);}logger[_0xa0fd('0x1d')](_0xa0fd('0x1a'),_0x4fe62c,_0x2b8d15[_0xa0fd('0x1d')][_0xa0fd('0x1f')]);return _0x5605ae(_0x2b8d15[_0xa0fd('0x1d')][_0xa0fd('0x1f')]);}else{logger[_0xa0fd('0x19')](_0xa0fd('0x1a'),_0x4fe62c,_0xa0fd('0x20'));_0x5605ae(_0x2b8d15[_0xa0fd('0x21')][_0xa0fd('0x1f')]);}})['catch'](function(_0x37177b){logger[_0xa0fd('0x1d')]('ChatWebsite,\x20%s,\x20%s',_0x4fe62c,_0x37177b);_0x50aa6d(_0x37177b);});});}function respondWithStatusCode(_0x197ae5,_0x3cd5b0){_0x3cd5b0=_0x3cd5b0||0xcc;return function(_0x4f9258){if(_0x4f9258){return _0x197ae5['sendStatus'](_0x3cd5b0);}return _0x197ae5[_0xa0fd('0x22')](_0x3cd5b0)[_0xa0fd('0x23')]();};}function respondWithResult(_0x4d2c96,_0x5c70fb){_0x5c70fb=_0x5c70fb||0xc8;return function(_0x5b50c0){if(_0x5b50c0){return _0x4d2c96['status'](_0x5c70fb)[_0xa0fd('0x24')](_0x5b50c0);}};}function respondWithFilteredResult(_0x5ef13e,_0x3212d5){return function(_0x1db300){if(_0x1db300){var _0x2f5b0d=typeof _0x3212d5['offset']===_0xa0fd('0x25')&&typeof _0x3212d5[_0xa0fd('0x26')]===_0xa0fd('0x25');var _0x1dd0c4=_0x1db300[_0xa0fd('0x27')];var _0x58ddb3=_0x2f5b0d?0x0:_0x3212d5[_0xa0fd('0x28')];var _0xf69d1c=_0x2f5b0d?_0x1db300[_0xa0fd('0x27')]:_0x3212d5[_0xa0fd('0x28')]+_0x3212d5['limit'];var _0x33785f;if(_0xf69d1c>=_0x1dd0c4){_0xf69d1c=_0x1dd0c4;_0x33785f=0xc8;}else{_0x33785f=0xce;}_0x5ef13e[_0xa0fd('0x22')](_0x33785f);return _0x5ef13e['set']('Content-Range',_0x58ddb3+'-'+_0xf69d1c+'/'+_0x1dd0c4)['json'](_0x1db300);}return null;};}function saveUpdates(_0x1fc249){return function(_0x481271){if(_0x481271){return _0x481271['update'](_0x1fc249)[_0xa0fd('0x29')](function(_0x56f911){return _0x56f911;});}return null;};}function removeEntity(_0xbaa5d2){return function(_0x410246){if(_0x410246){return _0x410246[_0xa0fd('0x2a')]()[_0xa0fd('0x29')](function(){var _0x1f6e72=_0x410246[_0xa0fd('0x2b')]({'plain':!![]});var _0x3d2e32=_0xa0fd('0x2c');return db['UserProfileResource'][_0xa0fd('0x2a')]({'where':{'type':_0x3d2e32,'resourceId':_0x1f6e72['id']}})['then'](function(){return _0x410246;});})[_0xa0fd('0x29')](function(){_0xbaa5d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x33f24b){return function(_0x4bcec1){if(!_0x4bcec1){_0x33f24b[_0xa0fd('0x2d')](0x194);}return _0x4bcec1;};}function handleError(_0x322deb,_0x431d31){_0x431d31=_0x431d31||0x1f4;return function(_0x3c7884){logger['error'](_0x3c7884[_0xa0fd('0x2e')]);if(_0x3c7884[_0xa0fd('0x2f')]){delete _0x3c7884[_0xa0fd('0x2f')];}_0x322deb[_0xa0fd('0x22')](_0x431d31)[_0xa0fd('0x30')](_0x3c7884);};}function createInteractionObject(_0x31f1e2,_0x41feca,_0x5e20ea,_0x5f12ac){var _0x2aa6a8=require(_0xa0fd('0x31'));var _0x283740=new _0x2aa6a8();var _0x155f5=_0x283740['setUA'](_0x5e20ea[_0xa0fd('0x32')])[_0xa0fd('0x33')]();var _0x273511=_0x41feca[_0xa0fd('0x34')];if(_0x5e20ea[_0xa0fd('0x35')]){_0x273511=_0x5e20ea['cf-connecting-ip'];}else if(_0x5e20ea[_0xa0fd('0x36')]){_0x273511=_[_0xa0fd('0x37')](_0x5e20ea['x-forwarded-for']['split'](','));}return{'ContactId':_0x5f12ac['id'],'ChatWebsiteId':_0x31f1e2,'from':(_0x5f12ac[_0xa0fd('0x38')]||'')+'\x20'+(_0x5f12ac[_0xa0fd('0x39')]||''),'customerIp':_0x273511,'customerPort':_0x5e20ea[_0xa0fd('0x3a')]?_0x5e20ea[_0xa0fd('0x3a')]:null,'referer':_0x41feca[_0xa0fd('0x3b')],'browserName':_0x155f5[_0xa0fd('0x3c')][_0xa0fd('0x2f')]&&_0x155f5[_0xa0fd('0x3c')][_0xa0fd('0x3d')]?util[_0xa0fd('0x3e')](_0xa0fd('0x3f'),_0x155f5[_0xa0fd('0x3c')][_0xa0fd('0x2f')],_0x155f5[_0xa0fd('0x3c')][_0xa0fd('0x3d')]):'unknown','browserVersion':_0x155f5['browser']['version']||_0xa0fd('0x40'),'osName':util[_0xa0fd('0x3e')](_0xa0fd('0x3f'),_0x155f5['os']['name'],_0x155f5['os'][_0xa0fd('0x3d')]),'osVersion':_0x155f5['os'][_0xa0fd('0x3d')],'deviceModel':_0x155f5[_0xa0fd('0x41')]['model']&&_0x155f5[_0xa0fd('0x41')][_0xa0fd('0x42')]?util[_0xa0fd('0x3e')](_0xa0fd('0x43'),_0x155f5[_0xa0fd('0x41')][_0xa0fd('0x44')],_0x155f5['device'][_0xa0fd('0x42')],_0x155f5[_0xa0fd('0x41')][_0xa0fd('0x45')]):null,'deviceVendor':_0x155f5[_0xa0fd('0x41')][_0xa0fd('0x42')],'deviceType':_0x155f5[_0xa0fd('0x41')]['type'],'formData':JSON[_0xa0fd('0x1c')](_0x41feca)};}exports[_0xa0fd('0x46')]=function(_0xf1c674,_0x1cc583){var _0x16d0cc={'include':[{'model':db[_0xa0fd('0x47')],'as':_0xa0fd('0x48')}]},_0x508747={},_0x5a6824={'count':0x0,'rows':[]};var _0x3677c1=_[_0xa0fd('0x49')](db[_0xa0fd('0x4a')]['rawAttributes'],function(_0x2d9777){return{'name':_0x2d9777[_0xa0fd('0x4b')],'type':_0x2d9777[_0xa0fd('0x45')][_0xa0fd('0x4c')]};});_0x508747[_0xa0fd('0x44')]=_[_0xa0fd('0x49')](_0x3677c1,'name');_0x508747['query']=_['keys'](_0xf1c674[_0xa0fd('0x4d')]);_0x508747['filters']=_['intersection'](_0x508747[_0xa0fd('0x44')],_0x508747['query']);_0x16d0cc[_0xa0fd('0x4e')]=_[_0xa0fd('0x4f')](_0x508747['model'],qs['fields'](_0xf1c674[_0xa0fd('0x4d')][_0xa0fd('0x50')]));_0x16d0cc[_0xa0fd('0x4e')]=_0x16d0cc[_0xa0fd('0x4e')][_0xa0fd('0x51')]?_0x16d0cc[_0xa0fd('0x4e')]:_0x508747['model'];if(!_0xf1c674['query']['hasOwnProperty']('nolimit')){_0x16d0cc[_0xa0fd('0x26')]=qs[_0xa0fd('0x26')](_0xf1c674[_0xa0fd('0x4d')][_0xa0fd('0x26')]);_0x16d0cc[_0xa0fd('0x28')]=qs['offset'](_0xf1c674['query']['offset']);}_0x16d0cc['order']=qs['sort'](_0xf1c674[_0xa0fd('0x4d')][_0xa0fd('0x52')]);_0x16d0cc[_0xa0fd('0x53')]=qs[_0xa0fd('0x54')](_[_0xa0fd('0x55')](_0xf1c674[_0xa0fd('0x4d')],_0x508747[_0xa0fd('0x54')]),_0x3677c1);if(_0xf1c674[_0xa0fd('0x4d')][_0xa0fd('0x56')]){_0x16d0cc[_0xa0fd('0x53')]=_['merge'](_0x16d0cc['where'],{'$or':_[_0xa0fd('0x49')](_0x3677c1,function(_0x3fbd1a){if(_0x3fbd1a[_0xa0fd('0x45')]!==_0xa0fd('0x57')){var _0x4c4339={};_0x4c4339[_0x3fbd1a[_0xa0fd('0x2f')]]={'$like':'%'+_0xf1c674[_0xa0fd('0x4d')]['filter']+'%'};return _0x4c4339;}})});}_0x16d0cc=_[_0xa0fd('0x58')]({},_0x16d0cc,_0xf1c674['options']);var _0x1df896={'where':_0x16d0cc[_0xa0fd('0x53')]};return db['ChatWebsite'][_0xa0fd('0x27')](_0x1df896)[_0xa0fd('0x29')](function(_0x10d3c3){_0x5a6824[_0xa0fd('0x27')]=_0x10d3c3;if(_0xf1c674[_0xa0fd('0x4d')][_0xa0fd('0x59')]){_0x16d0cc[_0xa0fd('0x5a')]=[{'all':!![]}];}return db[_0xa0fd('0x4a')]['findAll'](_0x16d0cc);})[_0xa0fd('0x29')](function(_0x4f7c12){_0x5a6824[_0xa0fd('0x5b')]=_0x4f7c12;return _0x5a6824;})[_0xa0fd('0x29')](respondWithFilteredResult(_0x1cc583,_0x16d0cc))[_0xa0fd('0x5c')](handleError(_0x1cc583,null));};exports[_0xa0fd('0x5d')]=function(_0xa37ca9,_0x4a7ae4){var _0x31710d={'raw':![],'where':{'id':_0xa37ca9['params']['id']},'include':[{'model':db[_0xa0fd('0x47')],'as':_0xa0fd('0x48')}]},_0xb5941e={};_0xb5941e[_0xa0fd('0x44')]=_['keys'](db[_0xa0fd('0x4a')]['rawAttributes']);_0xb5941e[_0xa0fd('0x4d')]=_['keys'](_0xa37ca9[_0xa0fd('0x4d')]);_0xb5941e['filters']=_[_0xa0fd('0x4f')](_0xb5941e[_0xa0fd('0x44')],_0xb5941e[_0xa0fd('0x4d')]);_0x31710d[_0xa0fd('0x4e')]=_[_0xa0fd('0x4f')](_0xb5941e[_0xa0fd('0x44')],qs[_0xa0fd('0x50')](_0xa37ca9['query'][_0xa0fd('0x50')]));_0x31710d[_0xa0fd('0x4e')]=_0x31710d[_0xa0fd('0x4e')][_0xa0fd('0x51')]?_0x31710d[_0xa0fd('0x4e')]:_0xb5941e['model'];if(_0xa37ca9['query']['includeAll']){_0x31710d[_0xa0fd('0x5a')]=[{'all':!![]}];}_0x31710d=_['merge']({},_0x31710d,_0xa37ca9[_0xa0fd('0x5e')]);return db['ChatWebsite'][_0xa0fd('0x5f')](_0x31710d)[_0xa0fd('0x29')](handleEntityNotFound(_0x4a7ae4,null))[_0xa0fd('0x29')](respondWithResult(_0x4a7ae4,null))[_0xa0fd('0x5c')](handleError(_0x4a7ae4,null));};exports[_0xa0fd('0x60')]=function(_0x5c3efa,_0x471a34){var _0x12cc39=null;_0x5c3efa[_0xa0fd('0x61')][_0xa0fd('0x62')][_0xa0fd('0x63')](',')[_0xa0fd('0x64')](_0x527e93=>{if(_0x527e93['trim']()!==''&&!wildcardUtils[_0xa0fd('0x65')](_0x527e93[_0xa0fd('0x66')]())){_0x12cc39=new APIBadRequestError('\x22'+_0x527e93[_0xa0fd('0x66')]()+_0xa0fd('0x67'));}});if(_0x12cc39){return handleError(_0x471a34,null)(_0x12cc39);}return db[_0xa0fd('0x4a')][_0xa0fd('0x60')](_0x5c3efa[_0xa0fd('0x61')],{})[_0xa0fd('0x29')](function(_0x545f7f){var _0xc69e41=_0x5c3efa[_0xa0fd('0x68')][_0xa0fd('0x2b')]({'plain':!![]});if(!_0xc69e41)throw new Error(_0xa0fd('0x69'));if(_0xc69e41[_0xa0fd('0x6a')]===_0xa0fd('0x68')){var _0x45f7df=_0x545f7f[_0xa0fd('0x2b')]({'plain':!![]});var _0x319e80=_0xa0fd('0x2c');return db[_0xa0fd('0x6b')][_0xa0fd('0x5f')]({'where':{'name':_0x319e80,'userProfileId':_0xc69e41['userProfileId']},'raw':!![]})[_0xa0fd('0x29')](function(_0x3cd5a5){if(_0x3cd5a5&&_0x3cd5a5[_0xa0fd('0x6c')]===0x0){return db[_0xa0fd('0x6d')][_0xa0fd('0x60')]({'name':_0x45f7df[_0xa0fd('0x2f')],'resourceId':_0x45f7df['id'],'type':_0x3cd5a5[_0xa0fd('0x2f')],'sectionId':_0x3cd5a5['id']},{})[_0xa0fd('0x29')](function(){return _0x545f7f;});}else{return _0x545f7f;}})[_0xa0fd('0x5c')](function(_0x4452f0){logger['error'](_0xa0fd('0x6e'),_0x4452f0);throw _0x4452f0;});}return _0x545f7f;})[_0xa0fd('0x29')](respondWithResult(_0x471a34,0xc9))[_0xa0fd('0x5c')](handleError(_0x471a34,null));};exports[_0xa0fd('0x6f')]=function(_0x239243,_0x1196d4){var _0x15c756=null;_0x239243[_0xa0fd('0x61')]['address'][_0xa0fd('0x63')](',')[_0xa0fd('0x64')](_0x5934fa=>{if(_0x5934fa[_0xa0fd('0x66')]()!==''&&!wildcardUtils[_0xa0fd('0x65')](_0x5934fa[_0xa0fd('0x66')]())){_0x15c756=new APIBadRequestError('\x22'+_0x5934fa[_0xa0fd('0x66')]()+_0xa0fd('0x67'));}});if(_0x15c756){return handleError(_0x1196d4,null)(_0x15c756);}if(_0x239243['body']['id']){delete _0x239243[_0xa0fd('0x61')]['id'];}return db[_0xa0fd('0x4a')][_0xa0fd('0x5f')]({'where':{'id':_0x239243[_0xa0fd('0x70')]['id']},'include':[{'model':db[_0xa0fd('0x47')],'as':_0xa0fd('0x48')}]})[_0xa0fd('0x29')](handleEntityNotFound(_0x1196d4,null))[_0xa0fd('0x29')](saveUpdates(_0x239243[_0xa0fd('0x61')],null))[_0xa0fd('0x29')](respondWithResult(_0x1196d4,null))[_0xa0fd('0x5c')](handleError(_0x1196d4,null));};exports[_0xa0fd('0x2a')]=function(_0x36452c,_0x7d5b1d){return db[_0xa0fd('0x4a')][_0xa0fd('0x5f')]({'where':{'id':_0x36452c[_0xa0fd('0x70')]['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0x7d5b1d,null))[_0xa0fd('0x29')](removeEntity(_0x7d5b1d,null))['catch'](handleError(_0x7d5b1d,null));};exports[_0xa0fd('0x71')]=function(_0x36523e,_0x356f36){return db[_0xa0fd('0x4a')]['describe']()[_0xa0fd('0x29')](respondWithResult(_0x356f36,null))[_0xa0fd('0x5c')](handleError(_0x356f36,null));};exports[_0xa0fd('0x72')]=function(_0x495bc1,_0xc2f803){if(_0x495bc1['body']['id']){delete _0x495bc1[_0xa0fd('0x61')]['id'];}return db[_0xa0fd('0x4a')]['find']({'where':{'id':_0x495bc1['params']['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0xc2f803,null))['then'](function(_0x5afbc8){if(_0x5afbc8){_0x495bc1[_0xa0fd('0x61')][_0xa0fd('0x73')]=_0x5afbc8['id'];return db['Disposition'][_0xa0fd('0x60')](_0x495bc1[_0xa0fd('0x61')]);}})[_0xa0fd('0x29')](respondWithResult(_0xc2f803,null))[_0xa0fd('0x5c')](handleError(_0xc2f803,null));};exports[_0xa0fd('0x74')]=function(_0x59ab1e,_0x398455){var _0x6c8da3={'raw':![],'where':{}};var _0x50153f={};var _0x424676={'count':0x0,'rows':[]};return db[_0xa0fd('0x4a')][_0xa0fd('0x75')]({'where':{'id':_0x59ab1e['params']['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0x398455,null))['then'](function(_0x24fa4f){if(_0x24fa4f){_0x50153f[_0xa0fd('0x44')]=_[_0xa0fd('0x76')](db[_0xa0fd('0x77')]['rawAttributes']);_0x50153f[_0xa0fd('0x4d')]=_[_0xa0fd('0x76')](_0x59ab1e[_0xa0fd('0x4d')]);_0x50153f[_0xa0fd('0x54')]=_[_0xa0fd('0x4f')](_0x50153f[_0xa0fd('0x44')],_0x50153f['query']);_0x6c8da3[_0xa0fd('0x4e')]=_[_0xa0fd('0x4f')](_0x50153f[_0xa0fd('0x44')],qs[_0xa0fd('0x50')](_0x59ab1e[_0xa0fd('0x4d')][_0xa0fd('0x50')]));_0x6c8da3['attributes']=_0x6c8da3['attributes'][_0xa0fd('0x51')]?_0x6c8da3[_0xa0fd('0x4e')]:_0x50153f['model'];if(!_0x59ab1e[_0xa0fd('0x4d')][_0xa0fd('0x78')](_0xa0fd('0x79'))){_0x6c8da3[_0xa0fd('0x26')]=qs[_0xa0fd('0x26')](_0x59ab1e[_0xa0fd('0x4d')][_0xa0fd('0x26')]);_0x6c8da3[_0xa0fd('0x28')]=qs[_0xa0fd('0x28')](_0x59ab1e['query'][_0xa0fd('0x28')]);}_0x6c8da3[_0xa0fd('0x7a')]=qs[_0xa0fd('0x52')](_0x59ab1e['query'][_0xa0fd('0x52')]);_0x6c8da3[_0xa0fd('0x53')]=qs['filters'](_['pick'](_0x59ab1e[_0xa0fd('0x4d')],_0x50153f[_0xa0fd('0x54')]));_0x6c8da3[_0xa0fd('0x53')][_0xa0fd('0x73')]=_0x24fa4f['id'];if(_0x59ab1e['query']['filter']){_0x6c8da3[_0xa0fd('0x53')]=_[_0xa0fd('0x58')](_0x6c8da3[_0xa0fd('0x53')],{'$or':_[_0xa0fd('0x49')](_0x6c8da3[_0xa0fd('0x4e')],function(_0x57945d){var _0x56801a={};_0x56801a[_0x57945d]={'$like':'%'+_0x59ab1e[_0xa0fd('0x4d')][_0xa0fd('0x56')]+'%'};return _0x56801a;})});}_0x6c8da3=_[_0xa0fd('0x58')]({},_0x6c8da3,_0x59ab1e[_0xa0fd('0x5e')]);return db[_0xa0fd('0x77')][_0xa0fd('0x27')]({'where':_0x6c8da3[_0xa0fd('0x53')]})[_0xa0fd('0x29')](function(_0x1b3dfa){_0x424676[_0xa0fd('0x27')]=_0x1b3dfa;if(_0x59ab1e[_0xa0fd('0x4d')][_0xa0fd('0x59')]){_0x6c8da3[_0xa0fd('0x5a')]=[{'all':!![]}];}return db[_0xa0fd('0x77')]['findAll'](_0x6c8da3);})[_0xa0fd('0x29')](function(_0x28ddc2){_0x424676[_0xa0fd('0x5b')]=_0x28ddc2;return _0x424676;});}})[_0xa0fd('0x29')](respondWithFilteredResult(_0x398455,_0x6c8da3))['catch'](handleError(_0x398455,null));};exports['removeDispositions']=function(_0x785ba5,_0x49f1a3){return db[_0xa0fd('0x4a')][_0xa0fd('0x5f')]({'where':{'id':_0x785ba5[_0xa0fd('0x70')]['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0x49f1a3,null))['then'](function(_0x537979){if(_0x537979){return _0x537979['removeDispositions'](_0x785ba5['query']['ids']);}})['then'](respondWithStatusCode(_0x49f1a3,null))[_0xa0fd('0x5c')](handleError(_0x49f1a3,null));};exports[_0xa0fd('0x7b')]=function(_0xabf058,_0x51c982){if(_0xabf058[_0xa0fd('0x61')]['id']){delete _0xabf058['body']['id'];}return db[_0xa0fd('0x4a')][_0xa0fd('0x5f')]({'where':{'id':_0xabf058[_0xa0fd('0x70')]['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0x51c982,null))['then'](function(_0xee8c4f){if(_0xee8c4f){_0xabf058[_0xa0fd('0x61')][_0xa0fd('0x73')]=_0xee8c4f['id'];return db[_0xa0fd('0x7c')][_0xa0fd('0x60')](_0xabf058[_0xa0fd('0x61')]);}})['then'](respondWithResult(_0x51c982,null))[_0xa0fd('0x5c')](handleError(_0x51c982,null));};exports[_0xa0fd('0x7d')]=function(_0x91853c,_0x33cfc6){var _0x1091c4={'raw':![],'where':{}};var _0x433a8c={};var _0x2d46f2={'count':0x0,'rows':[]};return db[_0xa0fd('0x4a')]['findOne']({'where':{'id':_0x91853c[_0xa0fd('0x70')]['id']}})['then'](handleEntityNotFound(_0x33cfc6,null))[_0xa0fd('0x29')](function(_0x320a53){if(_0x320a53){_0x433a8c[_0xa0fd('0x44')]=_['keys'](db[_0xa0fd('0x7c')][_0xa0fd('0x7e')]);_0x433a8c[_0xa0fd('0x4d')]=_[_0xa0fd('0x76')](_0x91853c['query']);_0x433a8c['filters']=_[_0xa0fd('0x4f')](_0x433a8c['model'],_0x433a8c[_0xa0fd('0x4d')]);_0x1091c4[_0xa0fd('0x4e')]=_[_0xa0fd('0x4f')](_0x433a8c['model'],qs[_0xa0fd('0x50')](_0x91853c[_0xa0fd('0x4d')]['fields']));_0x1091c4[_0xa0fd('0x4e')]=_0x1091c4['attributes']['length']?_0x1091c4[_0xa0fd('0x4e')]:_0x433a8c[_0xa0fd('0x44')];if(!_0x91853c[_0xa0fd('0x4d')]['hasOwnProperty'](_0xa0fd('0x79'))){_0x1091c4['limit']=qs[_0xa0fd('0x26')](_0x91853c[_0xa0fd('0x4d')][_0xa0fd('0x26')]);_0x1091c4[_0xa0fd('0x28')]=qs[_0xa0fd('0x28')](_0x91853c['query'][_0xa0fd('0x28')]);}_0x1091c4[_0xa0fd('0x7a')]=qs[_0xa0fd('0x52')](_0x91853c[_0xa0fd('0x4d')][_0xa0fd('0x52')]);_0x1091c4[_0xa0fd('0x53')]=qs[_0xa0fd('0x54')](_['pick'](_0x91853c[_0xa0fd('0x4d')],_0x433a8c[_0xa0fd('0x54')]));_0x1091c4[_0xa0fd('0x53')][_0xa0fd('0x73')]=_0x320a53['id'];if(_0x91853c[_0xa0fd('0x4d')]['filter']){_0x1091c4[_0xa0fd('0x53')]=_[_0xa0fd('0x58')](_0x1091c4[_0xa0fd('0x53')],{'$or':_[_0xa0fd('0x49')](_0x1091c4['attributes'],function(_0x550d8c){var _0x3bb845={};_0x3bb845[_0x550d8c]={'$like':'%'+_0x91853c['query'][_0xa0fd('0x56')]+'%'};return _0x3bb845;})});}_0x1091c4=_[_0xa0fd('0x58')]({},_0x1091c4,_0x91853c['options']);return db[_0xa0fd('0x7c')]['count']({'where':_0x1091c4[_0xa0fd('0x53')]})[_0xa0fd('0x29')](function(_0x4e335c){_0x2d46f2['count']=_0x4e335c;if(_0x91853c[_0xa0fd('0x4d')]['includeAll']){_0x1091c4[_0xa0fd('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa0fd('0x7f')](_0x1091c4);})['then'](function(_0x3c8d51){_0x2d46f2[_0xa0fd('0x5b')]=_0x3c8d51;return _0x2d46f2;});}})[_0xa0fd('0x29')](respondWithFilteredResult(_0x33cfc6,_0x1091c4))[_0xa0fd('0x5c')](handleError(_0x33cfc6,null));};exports['removeAnswers']=function(_0x3198ef,_0x29fe97){return db['ChatWebsite'][_0xa0fd('0x5f')]({'where':{'id':_0x3198ef[_0xa0fd('0x70')]['id']}})['then'](handleEntityNotFound(_0x29fe97,null))[_0xa0fd('0x29')](function(_0x69e5c3){if(_0x69e5c3){return _0x69e5c3['removeAnswers'](_0x3198ef[_0xa0fd('0x4d')][_0xa0fd('0x80')]);}})[_0xa0fd('0x29')](respondWithStatusCode(_0x29fe97,null))[_0xa0fd('0x5c')](handleError(_0x29fe97,null));};exports[_0xa0fd('0x81')]=function(_0xf65b43,_0x28546a){_0xf65b43[_0xa0fd('0x61')][_0xa0fd('0x82')]=_0xf65b43['file'][_0xa0fd('0x83')];return db[_0xa0fd('0x4a')]['find']({'where':{'id':_0xf65b43['params']['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0x28546a,null))[_0xa0fd('0x29')](saveUpdates(_0xf65b43[_0xa0fd('0x61')],null))[_0xa0fd('0x29')](respondWithResult(_0x28546a,null))[_0xa0fd('0x5c')](handleError(_0x28546a,null));};exports['addAvatar']=function(_0x2ae0fe,_0x41b201){_0x2ae0fe[_0xa0fd('0x61')]['agentAvatar']=_0x2ae0fe['file'][_0xa0fd('0x83')];return db[_0xa0fd('0x4a')][_0xa0fd('0x5f')]({'where':{'id':_0x2ae0fe[_0xa0fd('0x70')]['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0x41b201,null))['then'](saveUpdates(_0x2ae0fe[_0xa0fd('0x61')],null))[_0xa0fd('0x29')](respondWithResult(_0x41b201,null))[_0xa0fd('0x5c')](handleError(_0x41b201,null));};exports[_0xa0fd('0x84')]=function(_0x7dbcea,_0xf39378){_0x7dbcea['body'][_0xa0fd('0x85')]=_0x7dbcea[_0xa0fd('0x86')][_0xa0fd('0x83')];return db[_0xa0fd('0x4a')][_0xa0fd('0x5f')]({'where':{'id':_0x7dbcea[_0xa0fd('0x70')]['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0xf39378,null))['then'](saveUpdates(_0x7dbcea[_0xa0fd('0x61')],null))['then'](respondWithResult(_0xf39378,null))['catch'](handleError(_0xf39378,null));};exports['addSystemAvatar']=function(_0x52ff09,_0x54b24f){_0x52ff09['body'][_0xa0fd('0x87')]=_0x52ff09[_0xa0fd('0x86')]['filename'];return db[_0xa0fd('0x4a')][_0xa0fd('0x5f')]({'where':{'id':_0x52ff09[_0xa0fd('0x70')]['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0x54b24f,null))['then'](saveUpdates(_0x52ff09[_0xa0fd('0x61')],null))[_0xa0fd('0x29')](respondWithResult(_0x54b24f,null))[_0xa0fd('0x5c')](handleError(_0x54b24f,null));};exports[_0xa0fd('0x88')]=function(_0x16da38,_0x239982){var _0x544d47=path[_0xa0fd('0x89')](config[_0xa0fd('0x8a')],_0xa0fd('0x8b'));var _0x15a37f={'where':{'id':_0x16da38[_0xa0fd('0x70')]['id']},'attributes':['id',_0xa0fd('0x82')],'raw':!![]};var _0x5a038c=![];return require(_0xa0fd('0x8c'))[_0xa0fd('0x8d')]()['then'](function(_0x57c1ce){if(_0x57c1ce){_0x5a038c=_0x57c1ce['custom'];}})[_0xa0fd('0x29')](function(){return db['ChatWebsite']['find'](_0x15a37f);})[_0xa0fd('0x29')](handleEntityNotFound(_0x239982,null))[_0xa0fd('0x29')](function(_0x2647f9){if(_0x2647f9){if(!_[_0xa0fd('0x8e')](_0x2647f9[_0xa0fd('0x82')])){if(fs[_0xa0fd('0x8f')](path[_0xa0fd('0x89')](config['root'],_0xa0fd('0x90'),_0x2647f9['sitepic']))&&_0x5a038c){_0x544d47=path[_0xa0fd('0x89')](config['root'],_0xa0fd('0x90'),_0x2647f9[_0xa0fd('0x82')]);}}return _0x239982[_0xa0fd('0x91')](_0x544d47);}})[_0xa0fd('0x5c')](handleError(_0x239982,null));};exports[_0xa0fd('0x92')]=function(_0x5028a5,_0x3743fa){var _0x5d847d=path[_0xa0fd('0x89')](config['root'],_0xa0fd('0x93'));var _0x520c68={'where':{'id':_0x5028a5[_0xa0fd('0x70')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xa0fd('0x4a')]['find'](_0x520c68)[_0xa0fd('0x29')](handleEntityNotFound(_0x3743fa,null))['then'](function(_0x5b3546){if(_0x5b3546){if(!_[_0xa0fd('0x8e')](_0x5b3546[_0xa0fd('0x94')])){if(fs['existsSync'](path[_0xa0fd('0x89')](config[_0xa0fd('0x8a')],'server/files/images/avatars/',_0x5b3546['agentAvatar']))){_0x5d847d=path[_0xa0fd('0x89')](config['root'],'server/files/images/avatars/',_0x5b3546[_0xa0fd('0x94')]);}}return _0x3743fa['download'](_0x5d847d);}})[_0xa0fd('0x5c')](handleError(_0x3743fa,null));};exports[_0xa0fd('0x95')]=function(_0x2e88cf,_0x575f53){var _0x27c385=path[_0xa0fd('0x89')](config[_0xa0fd('0x8a')],_0xa0fd('0x96'));var _0x3e3f64={'where':{'id':_0x2e88cf[_0xa0fd('0x70')]['id']},'attributes':['id',_0xa0fd('0x85'),_0xa0fd('0x97')],'raw':!![]};return db[_0xa0fd('0x4a')][_0xa0fd('0x5f')](_0x3e3f64)['then'](handleEntityNotFound(_0x575f53,null))[_0xa0fd('0x29')](function(_0x27aa2d){if(_0x27aa2d){if(!_[_0xa0fd('0x8e')](_0x27aa2d['customerAvatar'])){if(fs[_0xa0fd('0x8f')](path['join'](config[_0xa0fd('0x8a')],_0xa0fd('0x98'),_0x27aa2d[_0xa0fd('0x85')]))&&_0x27aa2d[_0xa0fd('0x97')]){_0x27c385=path['join'](config[_0xa0fd('0x8a')],_0xa0fd('0x98'),_0x27aa2d[_0xa0fd('0x85')]);}}return _0x575f53[_0xa0fd('0x91')](_0x27c385);}})['catch'](handleError(_0x575f53,null));};exports[_0xa0fd('0x99')]=function(_0x239c6b,_0xdfc377){var _0x4d58cc=path['join'](config[_0xa0fd('0x8a')],_0xa0fd('0x9a'));var _0x201d04={'where':{'id':_0x239c6b[_0xa0fd('0x70')]['id']},'attributes':['id',_0xa0fd('0x87')],'raw':!![]};return db[_0xa0fd('0x4a')][_0xa0fd('0x5f')](_0x201d04)[_0xa0fd('0x29')](handleEntityNotFound(_0xdfc377,null))[_0xa0fd('0x29')](function(_0x1f73f4){if(_0x1f73f4){if(!_[_0xa0fd('0x8e')](_0x1f73f4[_0xa0fd('0x87')])){if(fs[_0xa0fd('0x8f')](path[_0xa0fd('0x89')](config['root'],_0xa0fd('0x98'),_0x1f73f4[_0xa0fd('0x87')]))){_0x4d58cc=path[_0xa0fd('0x89')](config[_0xa0fd('0x8a')],_0xa0fd('0x98'),_0x1f73f4['systemAvatar']);}}return _0xdfc377[_0xa0fd('0x91')](_0x4d58cc);}})[_0xa0fd('0x5c')](handleError(_0xdfc377,null));};function checkWebsiteInterval(_0x2b6d98){var _0x41d6f5=_0x2b6d98[_0xa0fd('0x9b')];if(!_0x41d6f5){return Promise[_0xa0fd('0x9c')](_0x2b6d98);}var _0x4138e9=_0x2b6d98[_0xa0fd('0x9d')]||undefined;return _0x41d6f5[_0xa0fd('0x9e')](_0x4138e9)[_0xa0fd('0x29')](function(_0x3fab51){if(!_0x3fab51){throw new APIOutOfIntervalError();}return _0x2b6d98;});}exports[_0xa0fd('0x9f')]=function(_0x31776b,_0x3afe1a){var _0x44acb5={'body':_0x31776b['body'],'channel':'chat'};var _0x363262=[];var _0x160b0c=[];var _0x3d5af0={};var _0x4c398f=![];if(_0x31776b['body']['id']){delete _0x31776b['body']['id'];}if(_[_0xa0fd('0x8e')](_0x31776b[_0xa0fd('0x61')]['from'])){throw new APIBadRequestError(_0xa0fd('0xa0'));}if(_[_0xa0fd('0x8e')](_0x31776b[_0xa0fd('0x61')][_0xa0fd('0xa1')])){throw new APIBadRequestError(_0xa0fd('0xa2'));}if(_[_0xa0fd('0xa3')](_0x31776b[_0xa0fd('0x61')][_0xa0fd('0x61')])){throw new APIBadRequestError(_0xa0fd('0xa4'));}var _0x2185d6=_0x31776b[_0xa0fd('0x61')][_0xa0fd('0x34')]&&_0x31776b['body'][_0xa0fd('0x3b')];return db[_0xa0fd('0xa5')][_0xa0fd('0x71')]()[_0xa0fd('0x29')](function(_0xff8796){if(!_0xff8796){throw new Error(_0xa0fd('0xa6'));}_0x363262=Object[_0xa0fd('0x76')](_0xff8796)[_0xa0fd('0x56')](function(_0x37475b){return![_0xa0fd('0xa7'),'updatedAt'][_0xa0fd('0xa8')](_0x37475b);});_0x160b0c=Object['keys'](_0xff8796)['filter'](function(_0x55516f){return![_0xa0fd('0xa7'),_0xa0fd('0xa9'),_0xa0fd('0xaa'),'ListId']['includes'](_0x55516f);});if(!_[_0xa0fd('0xa8')](_0x160b0c,_0x31776b[_0xa0fd('0x61')][_0xa0fd('0xa1')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x160b0c[_0xa0fd('0x89')](',\x20'));}_0x3d5af0[_0x31776b[_0xa0fd('0x61')][_0xa0fd('0xa1')]]=_0x31776b[_0xa0fd('0x61')][_0xa0fd('0xab')];})[_0xa0fd('0x29')](function(){return db[_0xa0fd('0x4a')]['find']({'where':{'id':_0x31776b['params']['id']},'include':[{'model':db[_0xa0fd('0xac')],'as':_0xa0fd('0xad'),'include':[{'model':db[_0xa0fd('0xa5')],'as':'Contacts','where':_0x3d5af0,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xa0fd('0xae')],'as':'Applications'},{'model':db[_0xa0fd('0x9b')],'as':_0xa0fd('0x9b'),'include':[{'model':db['Interval'],'as':_0xa0fd('0xaf'),'attributes':['id',_0xa0fd('0xb0')],'raw':!![]}]}]});})[_0xa0fd('0x29')](function(_0x250863){if(!_0x250863){throw new APINotFoundError(util[_0xa0fd('0x3e')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x31776b[_0xa0fd('0x70')]['id']));}if(_0x2185d6){return checkWebsiteInterval(_0x250863);}return _0x250863;})[_0xa0fd('0x29')](function(_0x2a6825){_0x44acb5[_0xa0fd('0xb1')]=_0x2a6825;_0x44acb5['applications']=_[_0xa0fd('0xb2')](_0x2a6825[_0xa0fd('0xb3')],[_0xa0fd('0xb4')],[_0xa0fd('0xb5')]);if(_0x44acb5[_0xa0fd('0xb1')][_0xa0fd('0xb3')]){delete _0x44acb5['account'][_0xa0fd('0xb3')];}_0x44acb5[_0xa0fd('0xb6')]=_0x2a6825['List']||{'id':_0x2a6825[_0xa0fd('0xb7')]};if(_0x44acb5['list']&&_0x44acb5[_0xa0fd('0xb6')][_0xa0fd('0xb8')][_0xa0fd('0x51')]){return _0x44acb5[_0xa0fd('0xb6')]['Contacts'][0x0];}var _0x38707f=_[_0xa0fd('0x12')](_0x31776b[_0xa0fd('0x61')],{'firstName':_0x31776b[_0xa0fd('0x61')]['from'],'ListId':_0x2a6825['ListId']});_0x38707f[_0x31776b[_0xa0fd('0x61')]['mapKey']]=_0x31776b[_0xa0fd('0x61')][_0xa0fd('0xab')];return db[_0xa0fd('0xa5')][_0xa0fd('0x60')](_0x38707f,{'fields':_0x363262,'raw':!![]});})[_0xa0fd('0x29')](function(_0x389ce9){_0x44acb5[_0xa0fd('0xb9')]=_0x389ce9;var _0x53a8fb=createInteractionObject(_0x31776b[_0xa0fd('0x70')]['id'],_0x31776b[_0xa0fd('0x61')],_0x31776b[_0xa0fd('0xba')],_0x389ce9);var _0x43130a={'ChatWebsiteId':_0x31776b['params']['id']};if(_0x31776b[_0xa0fd('0x61')][_0xa0fd('0xbb')]){_0x43130a[_0xa0fd('0xbb')]=_0x31776b[_0xa0fd('0x61')][_0xa0fd('0xbb')];_0x43130a[_0xa0fd('0xbc')]=![];return db[_0xa0fd('0xbd')][_0xa0fd('0x5f')]({'where':_0x43130a})['then'](function(_0x4195fe){var _0x8f35e4=_0x31776b[_0xa0fd('0x61')][_0xa0fd('0x34')]&&_0x31776b[_0xa0fd('0x61')]['referer'];if(_0x4195fe){_0x4c398f=!![];return _0x4195fe;}else if(!_0x8f35e4&&_0x4195fe&&_0x4195fe[_0xa0fd('0xbc')]){throw new APIConflictError(_0xa0fd('0xbe'));}_0x53a8fb[_0xa0fd('0xbb')]=_0x31776b['body']['threadId'];_0x53a8fb['externalUrl']=_0x31776b[_0xa0fd('0x61')][_0xa0fd('0xbf')];return db[_0xa0fd('0xbd')]['create'](_0x53a8fb);});}_0x43130a[_0xa0fd('0xc0')]=_0x389ce9['id'];if(_0x31776b['body'][_0xa0fd('0xc1')]&&_0x31776b['body']['interaction']['id']){_0x43130a['id']=_0x31776b['body']['interaction']['id'];return db['ChatInteraction'][_0xa0fd('0x5f')]({'where':_0x43130a})[_0xa0fd('0x29')](function(_0x42cd7a){var _0x4e5e6a=_0x31776b[_0xa0fd('0x61')][_0xa0fd('0x34')]&&_0x31776b['body'][_0xa0fd('0x3b')];if(!_0x4e5e6a&&_0x42cd7a&&_0x42cd7a['closed']){throw new APIConflictError(_0xa0fd('0xbe'));}else if(_0x42cd7a){_0x4c398f=!![];return _0x42cd7a;}else{return db['ChatInteraction'][_0xa0fd('0x60')](_0x53a8fb);}});}return db['ChatInteraction'][_0xa0fd('0x60')](_0x53a8fb);})['then'](function(_0xba90df){if(!_0x4c398f){return _0xba90df;}var _0x195fe5={'from':(_0x44acb5[_0xa0fd('0xb9')][_0xa0fd('0x38')]||'')+'\x20'+(_0x44acb5['contact'][_0xa0fd('0x39')]||'')};if(_0x31776b[_0xa0fd('0x61')][_0xa0fd('0xbb')]&&_0x31776b[_0xa0fd('0x61')][_0xa0fd('0xc2')]&&_0x31776b[_0xa0fd('0x61')][_0xa0fd('0xbb')]!=_0x31776b['body'][_0xa0fd('0xc2')]){_0x195fe5[_0xa0fd('0xbb')]=_0x31776b['body'][_0xa0fd('0xc2')];}return _0xba90df[_0xa0fd('0x6f')](_0x195fe5);})[_0xa0fd('0x29')](function(_0xf5dff9){_0x44acb5['interaction']=_0xf5dff9[_0xa0fd('0x2b')]({'plain':!![]});_0x44acb5[_0xa0fd('0xc1')][_0xa0fd('0xc3')]=!_0x4c398f;if(_0x44acb5[_0xa0fd('0xc1')][_0xa0fd('0xc3')]){if(_0x44acb5[_0xa0fd('0xb1')][_0xa0fd('0xc4')]){_0x44acb5['applications'][_0xa0fd('0xc5')]({'id':0x0,'priority':_0x44acb5['applications'][_0xa0fd('0x51')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xa0fd('0xc6')]['create']({'body':_0x31776b[_0xa0fd('0x61')][_0xa0fd('0x61')],'ChatWebsiteId':_0x31776b[_0xa0fd('0x70')]['id'],'ChatInteractionId':_0xf5dff9['id'],'direction':'in','ContactId':_0x44acb5[_0xa0fd('0xb9')]['id'],'AttachmentId':_0x31776b[_0xa0fd('0x61')][_0xa0fd('0xc7')]});})['then'](function(_0x4d2500){_0x44acb5[_0xa0fd('0x1f')]=_0x4d2500;if(!_0x44acb5[_0xa0fd('0xc1')][_0xa0fd('0xc8')]){return;}return db['User'][_0xa0fd('0x5f')]({'attributes':['id','name'],'where':{'id':_0x44acb5[_0xa0fd('0xc1')][_0xa0fd('0xc8')]}});})[_0xa0fd('0x29')](function(_0x259193){if(_0x259193){_0x44acb5[_0xa0fd('0xc9')][_0xa0fd('0xca')]({'id':0x0,'priority':0x0,'app':_0xa0fd('0xcb'),'appdata':_0x259193[_0xa0fd('0x2f')]+','+(_0x44acb5[_0xa0fd('0xb1')][_0xa0fd('0xcc')]||0xa),'interval':_0xa0fd('0xcd')});_0x44acb5[_0xa0fd('0xce')]=!![];}if(!_0x44acb5[_0xa0fd('0xc1')]['queueId']){return;}return db['ChatQueue'][_0xa0fd('0x5f')]({'attributes':['id',_0xa0fd('0x2f')],'where':{'id':_0x44acb5[_0xa0fd('0xc1')][_0xa0fd('0xcf')]}});})[_0xa0fd('0x29')](function(_0x19515b){if(_0x19515b){_0x44acb5['applications'][_0xa0fd('0xca')]({'id':0x0,'priority':0x1,'app':_0xa0fd('0xd0'),'appdata':_0x19515b['name']+','+(_0x44acb5[_0xa0fd('0xb1')][_0xa0fd('0xd1')]||0x12c),'interval':_0xa0fd('0xcd')});}return respondWithRpcPromise(_0xa0fd('0xd2'),_0xa0fd('0xd3'),_0x44acb5);})[_0xa0fd('0x29')](function(_0x235fc2){respondWithRpcPromise(_0xa0fd('0xd4'),_0xa0fd('0xd4'),{'event':_0xa0fd('0x9f'),'message':_0x235fc2},client9002);return _0x235fc2;})[_0xa0fd('0x29')](respondWithResult(_0x3afe1a,null))[_0xa0fd('0x5c')](APIHandleError(_0x3afe1a));};exports[_0xa0fd('0xd5')]=function(_0x214ff2,_0x174406){var _0x4e4153,_0x48e0c0,_0x1807e3;var _0x442e23=[];var _0x42365d={};var _0x32e160=_0x214ff2['files']||[];var _0x49ae73=[];var _0x120fb2;return db[_0xa0fd('0xa5')][_0xa0fd('0x71')]()[_0xa0fd('0x29')](function(_0x4c95e2){if(!_0x4c95e2){throw new db[(_0xa0fd('0xd6'))][(_0xa0fd('0xd7'))](_0xa0fd('0xd8'));}_0x442e23=_[_0xa0fd('0xd9')](_[_0xa0fd('0x76')](_0x4c95e2),['createdAt',_0xa0fd('0xa9'),'CompanyId',_0xa0fd('0xb7')]);if(_0x214ff2['body']['id']){delete _0x214ff2[_0xa0fd('0x61')]['id'];}if(_[_0xa0fd('0x8e')](_0x214ff2[_0xa0fd('0x61')]['from'])){throw _0x174406[_0xa0fd('0x22')](0x1f4)[_0xa0fd('0x30')](new db[(_0xa0fd('0xd6'))][(_0xa0fd('0xd7'))](_0xa0fd('0xda')));}if(_[_0xa0fd('0x8e')](_0x214ff2[_0xa0fd('0x61')][_0xa0fd('0x61')])||_0x214ff2['body'][_0xa0fd('0x61')]===''){throw _0x174406[_0xa0fd('0x22')](0x1f4)['send'](new db[(_0xa0fd('0xd6'))][(_0xa0fd('0xd7'))](_0xa0fd('0xdb')));}if(_[_0xa0fd('0x8e')](_0x214ff2[_0xa0fd('0x61')][_0xa0fd('0xdc')])){throw _0x174406[_0xa0fd('0x22')](0x1f4)[_0xa0fd('0x30')](new db[(_0xa0fd('0xd6'))][(_0xa0fd('0xd7'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x442e23));}if(!_[_0xa0fd('0xa8')](_0x442e23,_0x214ff2[_0xa0fd('0x61')][_0xa0fd('0xdc')])){throw _0x174406[_0xa0fd('0x22')](0x1f4)[_0xa0fd('0x30')](new db[(_0xa0fd('0xd6'))]['ValidationError'](_0xa0fd('0xdd')+_0x442e23));}_0x42365d[_0x214ff2[_0xa0fd('0x61')]['mapKeyOffline']]=_0x214ff2[_0xa0fd('0x61')]['from'];})[_0xa0fd('0x29')](function(){return db[_0xa0fd('0x4a')][_0xa0fd('0x5f')]({'where':{'id':_0x214ff2[_0xa0fd('0x70')]['id']},'include':[{'model':db[_0xa0fd('0xac')],'as':_0xa0fd('0xad')},{'model':db[_0xa0fd('0xde')],'as':_0xa0fd('0xde')}]});})[_0xa0fd('0x29')](handleEntityNotFound(_0x174406,null))[_0xa0fd('0x29')](function(_0x31d06){if(_0x31d06&&_0x31d06[_0xa0fd('0xad')]){_0x48e0c0=_0x31d06;var _0x504f6d=_[_0xa0fd('0x12')](_0x214ff2['body'],{'firstName':_0x214ff2['body'][_0xa0fd('0xab')],'phone':_0x214ff2[_0xa0fd('0x61')][_0xa0fd('0xab')],'ListId':_0x31d06['ListId']});_0x504f6d[_0x214ff2[_0xa0fd('0x61')][_0xa0fd('0xdc')]]=_0x214ff2['body'][_0xa0fd('0xab')];return db['CmContact'][_0xa0fd('0xdf')]({'where':_0x42365d,'defaults':_0x504f6d});}})[_0xa0fd('0xe0')](function(_0x29b790){if(_0x29b790){_0x1807e3=_0x29b790;var _0x13aac3=fs[_0xa0fd('0xe1')](path[_0xa0fd('0x89')](config[_0xa0fd('0x8a')],_0xa0fd('0xe2')),_0xa0fd('0xe3'));var _0x549ac2=ejs['render'](_0x13aac3,{'body':_['toPairs'](_0x214ff2[_0xa0fd('0x61')][_0xa0fd('0x61')]),'bodyTitle':_0x48e0c0[_0xa0fd('0xe4')]});return db[_0xa0fd('0xe5')]['create']({'body':_0x549ac2,'plainBody':htmlToText['fromString'](_0x549ac2),'ContactId':_0x29b790['id'],'ChatWebsiteId':_0x48e0c0['id']});}})['then'](function(_0x36c22d){_0x120fb2=_0x36c22d;if(_0x32e160[_0xa0fd('0x51')]){var _0x12f159=_0x32e160[_0xa0fd('0x49')](function(_0x1fe7b3){return{'name':_0x1fe7b3['originalname'],'basename':_0x1fe7b3[_0xa0fd('0x83')],'type':_0x1fe7b3['mimetype'],'ChatOfflineMessageId':_0x36c22d['id']};});_0x49ae73=_0x12f159[_0xa0fd('0x49')](_0x5b8536=>{var _0x330cf5={'filename':_0x5b8536[_0xa0fd('0x2f')],'path':path[_0xa0fd('0x89')](config['root'],_0xa0fd('0xe6'),'files',_0xa0fd('0xe7'),'offline-chat',_0x5b8536[_0xa0fd('0xe8')])};return _0x330cf5;});if(!_0x48e0c0[_0xa0fd('0xe9')]){return db['sequelize'][_0xa0fd('0xea')](function(_0xf20388){return db[_0xa0fd('0xeb')][_0xa0fd('0xec')](_0x12f159,{'transaction':_0xf20388});});}}})[_0xa0fd('0x29')](function(){if(_0x120fb2){_0x4e4153=_0x120fb2;return db[_0xa0fd('0xde')][_0xa0fd('0x75')]({'where':{'service':!![]},'include':[{'model':db[_0xa0fd('0xed')],'as':_0xa0fd('0xee'),'raw':!![],'include':[{'model':db[_0xa0fd('0xef')],'as':_0xa0fd('0xef'),'raw':!![]}]}]});}})[_0xa0fd('0x29')](function(_0x52e9d5){if(_0x52e9d5&&_0x52e9d5['Smtp']&&_0x48e0c0[_0xa0fd('0xf0')]&&_0x48e0c0[_0xa0fd('0xf1')]){var _0x53e964=_0x52e9d5[_0xa0fd('0xf2')]();return respondWithRpcPromise(_0xa0fd('0xf3'),'sendMail',{'account':_0x53e964,'message':{'from':util[_0xa0fd('0x3e')](_0xa0fd('0xf4'),_0x52e9d5[_0xa0fd('0x2f')],_0x52e9d5[_0xa0fd('0xf5')]||_0x52e9d5[_0xa0fd('0xee')][_0xa0fd('0x68')]),'to':_0x48e0c0[_0xa0fd('0xf1')],'subject':_0x48e0c0[_0xa0fd('0xf6')],'html':_0x4e4153[_0xa0fd('0x61')],'attachments':_0x49ae73}},client9003)[_0xa0fd('0x29')](function(){return _0x4e4153;})[_0xa0fd('0x5c')](function(_0x384fd9){logger[_0xa0fd('0x1d')](_0x384fd9);});}})['then'](function(){if(_0x48e0c0&&_0x48e0c0[_0xa0fd('0xe9')]&&_0x48e0c0[_0xa0fd('0xf7')]){var _0x8e6ad8=[];if(_0x32e160[_0xa0fd('0x51')]){_0x8e6ad8=_0x32e160['map'](function(_0x35ed76){return{'name':_0x35ed76[_0xa0fd('0xf8')],'basename':_0x35ed76[_0xa0fd('0x83')],'type':_0x35ed76[_0xa0fd('0xf9')],'ChatOfflineMessageId':_0x120fb2['id']};});}var _0x548cd1;if(!_['isNil'](_0x48e0c0[_0xa0fd('0xfa')])){var _0x21f169=_['map'](_0x214ff2['body'],function(_0x23826c){return _0x23826c;});var _0x14eed8=_['toPairsIn'](_0x21f169)[0x0];var _0x59a9d6=_[_0xa0fd('0xfb')](_0x14eed8,function(_0x208022){return _0x208022;});_0x548cd1=_0x59a9d6[0x1][_0x48e0c0[_0xa0fd('0xfa')]];}var _0x2cb010={'from':_0x1807e3[_0xa0fd('0xf5')],'firstName':_0x1807e3[_0xa0fd('0x38')],'lastName':_0x1807e3[_0xa0fd('0x39')],'mapKey':_0xa0fd('0xf5'),'message':{'from':_0x1807e3['email'],'to':_0x48e0c0[_0xa0fd('0xde')][_0xa0fd('0xf5')],'cc':'','subject':_[_0xa0fd('0x8e')](_0x548cd1)?_0x48e0c0[_0xa0fd('0xf6')]:_0x548cd1,'messageId':'','sentAt':new Date(),'attach':_0x8e6ad8[_0xa0fd('0x51')],'attachments':_0x8e6ad8,'originChannel':_0xa0fd('0xfc'),'ChatWebsiteId':_0x48e0c0['id'],'ChatOfflineMessageId':_0x4e4153['id'],'originTo':_0x48e0c0['MailAccount'][_0xa0fd('0xf5')]},'body':_0x4e4153[_0xa0fd('0x61')]};var _0x2cbaea={'account':{'id':_0x48e0c0[_0xa0fd('0xf7')]},'body':_0x2cb010,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xa0fd('0xfd'),_0x2cbaea,client9001)[_0xa0fd('0x29')](function(){return _0x4e4153;})['catch'](function(_0x1d6296){logger[_0xa0fd('0x1d')](_0x1d6296);});}return;})[_0xa0fd('0x29')](function(){if(_0x4e4153){return _0x4e4153;}})[_0xa0fd('0x29')](respondWithResult(_0x174406,null))[_0xa0fd('0x5c')](function(){for(var _0x3257c6 of _0x32e160){var _0x1acc84=path[_0xa0fd('0x89')](config[_0xa0fd('0x8a')],_0xa0fd('0xe6'),'files','attachments',_0xa0fd('0xfe'),_0x3257c6[_0xa0fd('0x83')]);fs_extra[_0xa0fd('0xff')](_0x1acc84)[_0xa0fd('0x5c')](function(_0x1aec9d){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x1acc84,_0x1aec9d);});}});};exports[_0xa0fd('0x100')]=function(_0x136591,_0x567244){return db[_0xa0fd('0xbd')][_0xa0fd('0x5f')]({'where':{'id':_0x136591['params']['id']}})['then'](handleEntityNotFound(_0x567244,null))[_0xa0fd('0x29')](function(_0x6ee599){if(_0x6ee599){return _0x6ee599[_0xa0fd('0x100')](_0x136591[_0xa0fd('0x61')]['ids'],_[_0xa0fd('0x101')](_0x136591[_0xa0fd('0x61')],[_0xa0fd('0x80'),'id'])||{});}})[_0xa0fd('0x29')](respondWithResult(_0x567244,null))[_0xa0fd('0x5c')](handleError(_0x567244,null));};exports[_0xa0fd('0x102')]=function(_0x108811,_0x1b5223){var _0x180281={'raw':![],'where':{}};var _0x571ce7={};var _0x7b7808={'count':0x0,'rows':[]};return db[_0xa0fd('0x4a')]['findOne']({'where':{'id':_0x108811[_0xa0fd('0x70')]['id']}})['then'](handleEntityNotFound(_0x1b5223,null))[_0xa0fd('0x29')](function(_0xf5039e){if(_0xf5039e){_0x571ce7['model']=_[_0xa0fd('0x76')](db[_0xa0fd('0xbd')][_0xa0fd('0x7e')]);_0x571ce7[_0xa0fd('0x4d')]=_[_0xa0fd('0x76')](_0x108811['query']);_0x571ce7['filters']=_[_0xa0fd('0x4f')](_0x571ce7[_0xa0fd('0x44')],_0x571ce7[_0xa0fd('0x4d')]);_0x180281[_0xa0fd('0x4e')]=_[_0xa0fd('0x4f')](_0x571ce7[_0xa0fd('0x44')],qs[_0xa0fd('0x50')](_0x108811['query'][_0xa0fd('0x50')]));_0x180281[_0xa0fd('0x4e')]=_0x180281[_0xa0fd('0x4e')][_0xa0fd('0x51')]?_0x180281[_0xa0fd('0x4e')]:_0x571ce7['model'];if(!_0x108811[_0xa0fd('0x4d')][_0xa0fd('0x78')](_0xa0fd('0x79'))){_0x180281[_0xa0fd('0x26')]=qs[_0xa0fd('0x26')](_0x108811[_0xa0fd('0x4d')]['limit']);_0x180281[_0xa0fd('0x28')]=qs['offset'](_0x108811['query'][_0xa0fd('0x28')]);}_0x180281[_0xa0fd('0x7a')]=qs['sort'](_0x108811[_0xa0fd('0x4d')][_0xa0fd('0x52')]);_0x180281[_0xa0fd('0x53')]=qs[_0xa0fd('0x54')](_[_0xa0fd('0x55')](_0x108811[_0xa0fd('0x4d')],_0x571ce7[_0xa0fd('0x54')]));_0x180281[_0xa0fd('0x53')]['ChatWebsiteId']=_0xf5039e['id'];if(_0x108811[_0xa0fd('0x4d')][_0xa0fd('0x56')]){_0x180281[_0xa0fd('0x53')]=_['merge'](_0x180281[_0xa0fd('0x53')],{'$or':_[_0xa0fd('0x49')](_0x180281['attributes'],function(_0x20b71e){var _0xb927a7={};_0xb927a7[_0x20b71e]={'$like':'%'+_0x108811[_0xa0fd('0x4d')]['filter']+'%'};return _0xb927a7;})});}_0x180281=_[_0xa0fd('0x58')]({},_0x180281,_0x108811[_0xa0fd('0x5e')]);return db['ChatInteraction'][_0xa0fd('0x27')]({'where':_0x180281[_0xa0fd('0x53')]})[_0xa0fd('0x29')](function(_0x2094fd){_0x7b7808['count']=_0x2094fd;if(_0x108811['query']['includeAll']){_0x180281['include']=[{'model':db[_0xa0fd('0xa5')],'as':_0xa0fd('0x103'),'required':![]},{'model':db[_0xa0fd('0x104')],'as':_0xa0fd('0x105'),'attributes':[_0xa0fd('0x2f'),_0xa0fd('0x106'),_0xa0fd('0x107')],'required':![]},{'model':db[_0xa0fd('0x108')],'as':_0xa0fd('0x109'),'attributes':['id',_0xa0fd('0x2f'),'color'],'where':_0x108811[_0xa0fd('0x4d')][_0xa0fd('0x10a')]?{'id':_0x108811['query'][_0xa0fd('0x10a')]}:undefined,'required':_0x108811['query'][_0xa0fd('0x10a')]?!![]:![]}];}return db[_0xa0fd('0xbd')]['findAll'](_0x180281);})['then'](function(_0x184747){_0x7b7808[_0xa0fd('0x5b')]=_0x184747;return _0x7b7808;});}})[_0xa0fd('0x29')](respondWithFilteredResult(_0x1b5223,_0x180281))[_0xa0fd('0x5c')](handleError(_0x1b5223,null));};exports[_0xa0fd('0x10b')]=function(_0x1f1f70,_0x34f26d){var _0x2b5339=0x0;var _0x561ee8=0x0;var _0x467828=![];var _0x4410d3;var _0x2dd046;return db[_0xa0fd('0x4a')]['find']({'where':{'id':_0x1f1f70[_0xa0fd('0x70')]['id']},'include':[{'model':db[_0xa0fd('0x9b')],'as':_0xa0fd('0x9b'),'include':[{'model':db['Interval'],'as':_0xa0fd('0xaf'),'attributes':['id',_0xa0fd('0xb0')]}]}]})[_0xa0fd('0x29')](handleEntityNotFound(_0x34f26d,null))[_0xa0fd('0x29')](function(_0x169292){if(_0x169292){_0x4410d3=_0x169292;return _0x169292['getProactiveActions']({'raw':!![]});}})[_0xa0fd('0x29')](function(_0x4f86bd){if(_0x4410d3){if(_0x4f86bd){_0x2dd046=_0x4f86bd;}}return require(_0xa0fd('0x8c'))[_0xa0fd('0x8d')]();})[_0xa0fd('0x29')](function(_0x1540d0){if(_0x1540d0){_0x561ee8=_0x1540d0[_0xa0fd('0x10c')];_0x467828=_0x1540d0[_0xa0fd('0x10d')];}})[_0xa0fd('0x29')](function(){return db[_0xa0fd('0xbd')][_0xa0fd('0x27')]({'where':{'closed':![]}});})[_0xa0fd('0x29')](function(_0x1e8ca9){_0x2b5339=_0x1e8ca9;if(_0x561ee8&&_0x1e8ca9>_0x561ee8){return db[_0xa0fd('0x10e')][_0xa0fd('0x75')]({'where':{'id':0x1}})[_0xa0fd('0x29')](function(_0x2d73c8){if(_0x2d73c8){_0x2d73c8[_0xa0fd('0x10f')](_0xa0fd('0x110'));}});}})['then'](function(){var _0x245bd2=_0x4410d3['Interval'];var _0x8b14b0=_0x4410d3[_0xa0fd('0x9d')]||undefined;return _0x245bd2?_0x245bd2['ifTime'](_0x8b14b0):!![];})['then'](function(_0x393d4d){var _0x34b2b0=fs[_0xa0fd('0xe1')](path[_0xa0fd('0x89')](config[_0xa0fd('0x8a')],_0xa0fd('0x111')),'utf8');var _0x44ccc5=_0xa0fd('0x112');var _0x4ba475=![];var _0x188b93,_0x2ee2d2;if(_0x1f1f70[_0xa0fd('0xba')]['referer']){_0x188b93=new URL(_0x1f1f70[_0xa0fd('0xba')][_0xa0fd('0x3b')])[_0xa0fd('0x113')];}else if(_0x1f1f70['headers'][_0xa0fd('0x113')]){_0x188b93=new URL(_0x1f1f70['headers'][_0xa0fd('0x113')])[_0xa0fd('0x113')];}else{_0x188b93=_0xa0fd('0x114');}_0x2ee2d2=typeof _0x4410d3[_0xa0fd('0x62')][_0xa0fd('0x63')](',')[_0xa0fd('0x5f')](function(_0xe2fb30){return wildcardUtils[_0xa0fd('0x115')](_0xe2fb30,_0x188b93);})!==_0xa0fd('0x25');var _0x2a1b40={'chatVersion':_0x44ccc5,'chatWebsiteAddressOrigin':_0x2ee2d2?_0x188b93:_0x4410d3[_0xa0fd('0x62')],'remote':_0x4410d3[_0xa0fd('0x116')],'query':querystring[_0xa0fd('0x1c')](_[_0xa0fd('0x58')](_0x4410d3['get']({'plain':!![]}),{'customerIp':_0x1f1f70[_0xa0fd('0xba')][_0xa0fd('0x36')]||_0x1f1f70[_0xa0fd('0xba')][_0xa0fd('0x117')]||_0x1f1f70[_0xa0fd('0x118')][_0xa0fd('0x119')]||_0x1f1f70['ip'],'referer':_0x1f1f70[_0xa0fd('0xba')][_0xa0fd('0x3b')],'openedInteractions':_0x2b5339,'maxInteractions':_0x561ee8,'virtual':_0x467828[_0xa0fd('0x10c')],'online':_0x393d4d,'custom':_0x467828,'address':_0x2ee2d2?_0x188b93:null}))['replace'](/'/g,'\x5c\x27')};_0x34f26d[_0xa0fd('0x30')](ejs['render'](Mustache[_0xa0fd('0x11a')](_0x34b2b0,_0x2a1b40),{'proactiveActions':_0x2dd046,'alignment':_0x4410d3[_0xa0fd('0x11b')],'verticalAlignment':_0x4410d3['verticalAlignment'],'div_color':_0x4410d3['color'],'labelText':_0x4410d3['labelText'],'text_color':_0x4410d3[_0xa0fd('0x11c')],'text_button_color':_0x4410d3['textButtonColor'],'button_color':_0x4410d3[_0xa0fd('0x11d')],'background_color':_0x4410d3[_0xa0fd('0x11e')],'hideWhenOffline':_0x4410d3[_0xa0fd('0x11f')],'intervalId':_0x4410d3[_0xa0fd('0x120')],'isDevelopment':_0x4ba475,'chatVersion':_0x44ccc5}));})[_0xa0fd('0x5c')](handleError(_0x34f26d,null));};exports[_0xa0fd('0x121')]=function(_0x3ff43e,_0xada1a0){var _0x1b5abb=_0x3ff43e['params']['id'];var _0x29de9b=_0x3ff43e[_0xa0fd('0x61')];var _0x4d1788=0xc8;var _0x447a6e=null;return db[_0xa0fd('0x122')]['transaction']({'isolationLevel':db[_0xa0fd('0x122')][_0xa0fd('0x123')]['ISOLATION_LEVELS'][_0xa0fd('0x124')]},function(_0x25227b){return db['ChatWebsite'][_0xa0fd('0x75')]({'where':{'id':_0x1b5abb},'transaction':_0x25227b})[_0xa0fd('0x29')](function(_0x139b1b){if(_0x139b1b){return db[_0xa0fd('0xae')][_0xa0fd('0x2a')]({'where':{'ChatWebsiteId':_0x1b5abb},'transaction':_0x25227b})[_0xa0fd('0x29')](function(){var _0x1ee64c=_[_0xa0fd('0x49')](_0x29de9b,function(_0x2583a9){_0x2583a9['ChatWebsiteId']=_0x1b5abb;return _0x2583a9;});return db[_0xa0fd('0xae')][_0xa0fd('0xec')](_0x1ee64c,{'transaction':_0x25227b});});}else{_0x4d1788=0x194;_0x447a6e=[];}});})[_0xa0fd('0x29')](function(){if(_0x4d1788!==0x194){return db[_0xa0fd('0xae')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1b5abb},'order':_0xa0fd('0xb4')})[_0xa0fd('0x29')](function(_0x264a28){_0x447a6e=_0x264a28;});}})[_0xa0fd('0x5c')](function(_0x10ed7d){_0x4d1788=0x1f4;logger[_0xa0fd('0x1d')](_0x10ed7d['stack']);if(_0x10ed7d[_0xa0fd('0x2f')]){delete _0x10ed7d[_0xa0fd('0x2f')];}_0x447a6e=_0x10ed7d;})[_0xa0fd('0x125')](function(){if(_0x447a6e===null){_0xada1a0[_0xa0fd('0x2d')](_0x4d1788);}else{if(_0x4d1788===0x1f4){_0xada1a0[_0xa0fd('0x22')](_0x4d1788)['send'](_0x447a6e);}else{_0xada1a0[_0xa0fd('0x22')](_0x4d1788)[_0xa0fd('0x24')](_0x447a6e);}}});};exports[_0xa0fd('0x126')]=function(_0x44d5a8,_0x4639b9){var _0x588214={};var _0x19a1a9={};var _0x3d212f;var _0x5c9f33;return db[_0xa0fd('0x4a')][_0xa0fd('0x75')]({'where':{'id':_0x44d5a8[_0xa0fd('0x70')]['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0x4639b9,null))[_0xa0fd('0x29')](function(_0x3af596){if(_0x3af596){_0x3d212f=_0x3af596;_0x19a1a9[_0xa0fd('0x44')]=_['keys'](db[_0xa0fd('0xae')][_0xa0fd('0x7e')]);_0x19a1a9[_0xa0fd('0x4d')]=_['keys'](_0x44d5a8[_0xa0fd('0x4d')]);_0x19a1a9[_0xa0fd('0x54')]=_['intersection'](_0x19a1a9[_0xa0fd('0x44')],_0x19a1a9[_0xa0fd('0x4d')]);_0x588214['attributes']=_[_0xa0fd('0x4f')](_0x19a1a9[_0xa0fd('0x44')],qs[_0xa0fd('0x50')](_0x44d5a8[_0xa0fd('0x4d')][_0xa0fd('0x50')]));_0x588214[_0xa0fd('0x4e')]=_0x588214['attributes']['length']?_0x588214[_0xa0fd('0x4e')]:_0x19a1a9['model'];_0x588214[_0xa0fd('0x7a')]=qs[_0xa0fd('0x52')](_0x44d5a8[_0xa0fd('0x4d')][_0xa0fd('0x52')]);_0x588214[_0xa0fd('0x53')]=qs['filters'](_[_0xa0fd('0x55')](_0x44d5a8['query'],_0x19a1a9['filters']));if(_0x44d5a8[_0xa0fd('0x4d')][_0xa0fd('0x56')]){_0x588214['where']=_[_0xa0fd('0x58')](_0x588214['where'],{'$or':_['map'](_0x588214[_0xa0fd('0x4e')],function(_0x14a866){var _0xb5a5bf={};_0xb5a5bf[_0x14a866]={'$like':'%'+_0x44d5a8[_0xa0fd('0x4d')][_0xa0fd('0x56')]+'%'};return _0xb5a5bf;})});}_0x588214=_[_0xa0fd('0x58')]({},_0x588214,_0x44d5a8[_0xa0fd('0x5e')]);return _0x3d212f[_0xa0fd('0x126')](_0x588214);}})[_0xa0fd('0x29')](function(_0x266848){if(_0x266848){_0x5c9f33=_0x266848['length'];if(!_0x44d5a8[_0xa0fd('0x4d')][_0xa0fd('0x78')](_0xa0fd('0x79'))){_0x588214[_0xa0fd('0x26')]=qs[_0xa0fd('0x26')](_0x44d5a8[_0xa0fd('0x4d')][_0xa0fd('0x26')]);_0x588214[_0xa0fd('0x28')]=qs['offset'](_0x44d5a8['query'][_0xa0fd('0x28')]);}return _0x3d212f[_0xa0fd('0x126')](_0x588214);}})[_0xa0fd('0x29')](function(_0x2cf9ed){if(_0x2cf9ed){return _0x2cf9ed?{'count':_0x5c9f33,'rows':_0x2cf9ed}:null;}})[_0xa0fd('0x29')](respondWithResult(_0x4639b9,null))[_0xa0fd('0x5c')](handleError(_0x4639b9,null));};exports[_0xa0fd('0x127')]=function(_0x52d5a9,_0x5918ed){return db[_0xa0fd('0x128')][_0xa0fd('0x5f')]({'where':{'id':_0x52d5a9[_0xa0fd('0x70')]['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0x5918ed,null))[_0xa0fd('0x29')](function(_0x77ab48){if(_0x77ab48){return _0x77ab48['addProactiveActions'](_0x52d5a9['body'][_0xa0fd('0x80')],_['omit'](_0x52d5a9[_0xa0fd('0x61')],['ids','id'])||{});}})[_0xa0fd('0x29')](respondWithResult(_0x5918ed,null))[_0xa0fd('0x5c')](handleError(_0x5918ed,null));};exports[_0xa0fd('0x129')]=function(_0x1bcb40,_0x39b66b){var _0x6d66bf={};var _0x547549={};var _0x7d6fdf;var _0x5bf1a5;return db[_0xa0fd('0x4a')]['findOne']({'where':{'id':_0x1bcb40[_0xa0fd('0x70')]['id']}})['then'](handleEntityNotFound(_0x39b66b,null))[_0xa0fd('0x29')](function(_0x1320bd){if(_0x1320bd){_0x7d6fdf=_0x1320bd;_0x547549[_0xa0fd('0x44')]=_[_0xa0fd('0x76')](db[_0xa0fd('0x12a')]['rawAttributes']);_0x547549[_0xa0fd('0x4d')]=_[_0xa0fd('0x76')](_0x1bcb40[_0xa0fd('0x4d')]);_0x547549[_0xa0fd('0x54')]=_[_0xa0fd('0x4f')](_0x547549[_0xa0fd('0x44')],_0x547549[_0xa0fd('0x4d')]);_0x6d66bf[_0xa0fd('0x4e')]=_[_0xa0fd('0x4f')](_0x547549[_0xa0fd('0x44')],qs[_0xa0fd('0x50')](_0x1bcb40[_0xa0fd('0x4d')]['fields']));_0x6d66bf[_0xa0fd('0x4e')]=_0x6d66bf[_0xa0fd('0x4e')][_0xa0fd('0x51')]?_0x6d66bf['attributes']:_0x547549['model'];_0x6d66bf[_0xa0fd('0x7a')]=qs[_0xa0fd('0x52')](_0x1bcb40[_0xa0fd('0x4d')][_0xa0fd('0x52')]);_0x6d66bf['where']=qs[_0xa0fd('0x54')](_[_0xa0fd('0x55')](_0x1bcb40[_0xa0fd('0x4d')],_0x547549[_0xa0fd('0x54')]));if(_0x1bcb40[_0xa0fd('0x4d')][_0xa0fd('0x56')]){_0x6d66bf['where']=_[_0xa0fd('0x58')](_0x6d66bf[_0xa0fd('0x53')],{'$or':_[_0xa0fd('0x49')](_0x6d66bf[_0xa0fd('0x4e')],function(_0x22014e){var _0x19dfe3={};_0x19dfe3[_0x22014e]={'$like':'%'+_0x1bcb40[_0xa0fd('0x4d')][_0xa0fd('0x56')]+'%'};return _0x19dfe3;})});}_0x6d66bf=_['merge']({},_0x6d66bf,_0x1bcb40['options']);return _0x7d6fdf[_0xa0fd('0x129')](_0x6d66bf);}})['then'](function(_0x1131e3){if(_0x1131e3){_0x5bf1a5=_0x1131e3[_0xa0fd('0x51')];if(!_0x1bcb40['query']['hasOwnProperty'](_0xa0fd('0x79'))){_0x6d66bf[_0xa0fd('0x26')]=qs['limit'](_0x1bcb40[_0xa0fd('0x4d')]['limit']);_0x6d66bf[_0xa0fd('0x28')]=qs[_0xa0fd('0x28')](_0x1bcb40[_0xa0fd('0x4d')]['offset']);}return _0x7d6fdf['getProactiveActions'](_0x6d66bf);}})['then'](function(_0x5a60a9){if(_0x5a60a9){return _0x5a60a9?{'count':_0x5bf1a5,'rows':_0x5a60a9}:null;}})[_0xa0fd('0x29')](respondWithResult(_0x39b66b,null))['catch'](handleError(_0x39b66b,null));};exports[_0xa0fd('0x12b')]=function(_0x3b0925,_0x3ce595){var _0x56628c=_0x3b0925[_0xa0fd('0x4d')][_0xa0fd('0x12c')]==='false'?'offlineForm':_0xa0fd('0x12d');return db[_0xa0fd('0x4a')][_0xa0fd('0x5f')]({'attributes':['id',_0x56628c],'where':{'id':_0x3b0925[_0xa0fd('0x70')]['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0x3ce595,null))[_0xa0fd('0x29')](function(_0x158b1b){if(_0x158b1b){var _0x172b4a=_0x158b1b[_0x56628c];var _0x299209=_0x172b4a&&_0x172b4a[_0xa0fd('0x12e')]?_0x172b4a[_0xa0fd('0x12e')]:[];_0x3ce595[_0xa0fd('0x30')]({'fromKey':_[_0xa0fd('0x8e')](_0x172b4a[_0xa0fd('0x12f')])?undefined:_0x172b4a['fromKey'],'count':_0x299209[_0xa0fd('0x51')],'rows':_0x299209});}})[_0xa0fd('0x5c')](handleError(_0x3ce595,null));};exports[_0xa0fd('0x130')]=function(_0x2d4dc4,_0x2777c0){var _0x3f21a8={'raw':![],'where':{}};var _0x275578={};var _0x11a06a={'count':0x0,'rows':[]};return db[_0xa0fd('0x4a')][_0xa0fd('0x75')]({'where':{'id':_0x2d4dc4[_0xa0fd('0x70')]['id']}})['then'](handleEntityNotFound(_0x2777c0,null))['then'](function(_0x462b31){if(_0x462b31){_0x275578[_0xa0fd('0x44')]=_[_0xa0fd('0x76')](db[_0xa0fd('0xe5')][_0xa0fd('0x7e')]);_0x275578[_0xa0fd('0x4d')]=_['keys'](_0x2d4dc4['query']);_0x275578[_0xa0fd('0x54')]=_[_0xa0fd('0x4f')](_0x275578[_0xa0fd('0x44')],_0x275578['query']);_0x3f21a8[_0xa0fd('0x4e')]=_[_0xa0fd('0x4f')](_0x275578[_0xa0fd('0x44')],qs['fields'](_0x2d4dc4['query'][_0xa0fd('0x50')]));_0x3f21a8[_0xa0fd('0x4e')]=_0x3f21a8[_0xa0fd('0x4e')]['length']?_0x3f21a8[_0xa0fd('0x4e')]:_0x275578[_0xa0fd('0x44')];if(!_0x2d4dc4[_0xa0fd('0x4d')][_0xa0fd('0x78')](_0xa0fd('0x79'))){_0x3f21a8[_0xa0fd('0x26')]=qs[_0xa0fd('0x26')](_0x2d4dc4['query'][_0xa0fd('0x26')]);_0x3f21a8[_0xa0fd('0x28')]=qs['offset'](_0x2d4dc4[_0xa0fd('0x4d')][_0xa0fd('0x28')]);}_0x3f21a8[_0xa0fd('0x7a')]=qs['sort'](_0x2d4dc4[_0xa0fd('0x4d')][_0xa0fd('0x52')]);_0x3f21a8[_0xa0fd('0x53')]=qs['filters'](_[_0xa0fd('0x55')](_0x2d4dc4[_0xa0fd('0x4d')],_0x275578[_0xa0fd('0x54')]));_0x3f21a8[_0xa0fd('0x53')]['ChatWebsiteId']=_0x462b31['id'];if(_0x2d4dc4[_0xa0fd('0x4d')][_0xa0fd('0x56')]){_0x3f21a8[_0xa0fd('0x53')]=_[_0xa0fd('0x58')](_0x3f21a8['where'],{'$or':_[_0xa0fd('0x49')](_0x3f21a8[_0xa0fd('0x4e')],function(_0x147241){var _0x260a93={};_0x260a93[_0x147241]={'$like':'%'+_0x2d4dc4[_0xa0fd('0x4d')][_0xa0fd('0x56')]+'%'};return _0x260a93;})});}_0x3f21a8=_['merge']({},_0x3f21a8,_0x2d4dc4[_0xa0fd('0x5e')]);return db[_0xa0fd('0xe5')]['count']({'where':_0x3f21a8[_0xa0fd('0x53')]})['then'](function(_0x212318){_0x11a06a[_0xa0fd('0x27')]=_0x212318;if(_0x2d4dc4[_0xa0fd('0x4d')][_0xa0fd('0x59')]){_0x3f21a8[_0xa0fd('0x5a')]=[{'all':!![]}];}else{_0x3f21a8[_0xa0fd('0x5a')]=[{'model':db[_0xa0fd('0xa5')],'as':_0xa0fd('0x103'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xa0fd('0xe5')][_0xa0fd('0x7f')](_0x3f21a8);})['then'](function(_0x2eb0d6){_0x11a06a['rows']=_0x2eb0d6;return _0x11a06a;});}})[_0xa0fd('0x29')](respondWithFilteredResult(_0x2777c0,_0x3f21a8))[_0xa0fd('0x5c')](handleError(_0x2777c0,null));};exports[_0xa0fd('0x131')]=function(_0x3a263a,_0x30e2e2){return db[_0xa0fd('0x4a')]['find']({'where':{'id':_0x3a263a[_0xa0fd('0x70')]['id']}})['then'](handleEntityNotFound(_0x30e2e2,null))[_0xa0fd('0x29')](function(_0x4bc35b){if(_0x4bc35b){return _0x4bc35b[_0xa0fd('0x131')](_0x3a263a[_0xa0fd('0x61')]['ids'],_['omit'](_0x3a263a[_0xa0fd('0x61')],[_0xa0fd('0x80'),'id'])||{})[_0xa0fd('0xe0')](function(_0x516ce6){for(var _0xe40db=0x0;_0xe40db<_0x3a263a['body'][_0xa0fd('0x80')][_0xa0fd('0x51')];_0xe40db+=0x1){socket[_0xa0fd('0x132')](_0xa0fd('0x133'),{'UserId':Number(_0x3a263a[_0xa0fd('0x61')][_0xa0fd('0x80')][_0xe40db]),'ChatWebsiteId':Number(_0x3a263a[_0xa0fd('0x70')]['id'])});}return _0x516ce6;});}})[_0xa0fd('0x29')](respondWithResult(_0x30e2e2,null))[_0xa0fd('0x5c')](handleError(_0x30e2e2,null));};exports[_0xa0fd('0x134')]=function(_0x353a7d,_0x4e8d38){return db[_0xa0fd('0x4a')][_0xa0fd('0x5f')]({'where':{'id':_0x353a7d[_0xa0fd('0x70')]['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0x4e8d38,null))['then'](function(_0x4b9d31){if(_0x4b9d31){return _0x4b9d31[_0xa0fd('0x134')](_0x353a7d[_0xa0fd('0x4d')][_0xa0fd('0x80')])[_0xa0fd('0x29')](function(){if(_[_0xa0fd('0x135')](_0x353a7d[_0xa0fd('0x4d')]['ids'])){for(var _0xb1b3ab=0x0;_0xb1b3ab<_0x353a7d[_0xa0fd('0x4d')][_0xa0fd('0x80')]['length'];_0xb1b3ab+=0x1){socket[_0xa0fd('0x132')]('userChatWebsite:remove',{'UserId':Number(_0x353a7d[_0xa0fd('0x4d')][_0xa0fd('0x80')][_0xb1b3ab]),'ChatWebsiteId':Number(_0x353a7d[_0xa0fd('0x70')]['id'])});}}else{socket[_0xa0fd('0x132')](_0xa0fd('0x136'),{'UserId':Number(_0x353a7d[_0xa0fd('0x4d')][_0xa0fd('0x80')]),'ChatWebsiteId':Number(_0x353a7d['params']['id'])});}});}})[_0xa0fd('0x29')](respondWithStatusCode(_0x4e8d38,null))[_0xa0fd('0x5c')](handleError(_0x4e8d38,null));};exports[_0xa0fd('0x137')]=function(_0x562461,_0x1c8a6d){var _0x201a2c={};var _0x3245e6={};var _0x3702c2;var _0x5e205e;return db[_0xa0fd('0x4a')]['findOne']({'where':{'id':_0x562461[_0xa0fd('0x70')]['id']}})[_0xa0fd('0x29')](handleEntityNotFound(_0x1c8a6d,null))[_0xa0fd('0x29')](function(_0xad52df){if(_0xad52df){_0x3702c2=_0xad52df;_0x3245e6[_0xa0fd('0x44')]=_[_0xa0fd('0x76')](db[_0xa0fd('0x104')][_0xa0fd('0x7e')]);_0x3245e6[_0xa0fd('0x4d')]=_[_0xa0fd('0x76')](_0x562461[_0xa0fd('0x4d')]);_0x3245e6['filters']=_[_0xa0fd('0x4f')](_0x3245e6[_0xa0fd('0x44')],_0x3245e6[_0xa0fd('0x4d')]);_0x201a2c[_0xa0fd('0x4e')]=_[_0xa0fd('0x4f')](_0x3245e6[_0xa0fd('0x44')],qs[_0xa0fd('0x50')](_0x562461[_0xa0fd('0x4d')][_0xa0fd('0x50')]));_0x201a2c[_0xa0fd('0x4e')]=_0x201a2c[_0xa0fd('0x4e')][_0xa0fd('0x51')]?_0x201a2c['attributes']:_0x3245e6['model'];_0x201a2c['order']=qs[_0xa0fd('0x52')](_0x562461[_0xa0fd('0x4d')][_0xa0fd('0x52')]);_0x201a2c[_0xa0fd('0x53')]=qs[_0xa0fd('0x54')](_[_0xa0fd('0x55')](_0x562461[_0xa0fd('0x4d')],_0x3245e6[_0xa0fd('0x54')]));if(_0x562461['query']['filter']){_0x201a2c[_0xa0fd('0x53')]=_[_0xa0fd('0x58')](_0x201a2c[_0xa0fd('0x53')],{'$or':_[_0xa0fd('0x49')](_0x201a2c[_0xa0fd('0x4e')],function(_0x5f3479){var _0x17a13f={};_0x17a13f[_0x5f3479]={'$like':'%'+_0x562461['query'][_0xa0fd('0x56')]+'%'};return _0x17a13f;})});}_0x201a2c=_[_0xa0fd('0x58')]({},_0x201a2c,_0x562461[_0xa0fd('0x5e')]);return _0x3702c2[_0xa0fd('0x137')](_0x201a2c);}})[_0xa0fd('0x29')](function(_0x251515){if(_0x251515){_0x5e205e=_0x251515[_0xa0fd('0x51')];if(!_0x562461[_0xa0fd('0x4d')][_0xa0fd('0x78')](_0xa0fd('0x79'))){_0x201a2c[_0xa0fd('0x26')]=qs['limit'](_0x562461[_0xa0fd('0x4d')]['limit']);_0x201a2c['offset']=qs[_0xa0fd('0x28')](_0x562461[_0xa0fd('0x4d')]['offset']);}return _0x3702c2['getAgents'](_0x201a2c);}})[_0xa0fd('0x29')](function(_0x3aae5b){if(_0x3aae5b){return _0x3aae5b?{'count':_0x5e205e,'rows':_0x3aae5b}:null;}})['then'](respondWithResult(_0x1c8a6d,null))[_0xa0fd('0x5c')](handleError(_0x1c8a6d,null));};
\ No newline at end of file
+var _0x2123=['offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','findOne','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','notifyMail','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','getSnippet','getProactiveActions','virtual','License','increment','server/files/chat/iframe.ejs','3.10.1','origin','testWebsiteWithWildcard','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','offlineForm','items','fromKey','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','url','URL','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','debug','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','update','get','ChatWebsites','UserProfileResource','destroy','end','name','send','user-agent-parser','user-agent','getResult','customerIp','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','model','device','vendor','%s\x20%s\x20%s','type','index','mandatoryDispositionPause','map','rawAttributes','fieldName','query','keys','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','show','Pause','intersection','find','create','body','address','forEach','trim','testWildcardValidity','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','params','describe','ChatWebsiteId','Disposition','getDispositions','length','pick','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','root','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','notify','chat','from','MapKey\x20is\x20mandatory','Body\x20is\x20mandatory','createdAt','updatedAt','includes','CompanyId','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','mapKey','CmList','List','CmContact','ChatApplication','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','applications','orderBy','Applications','priority','asc','account','list','Contacts','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','unshift','waitForTheAssignedQueue','Start','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype'];(function(_0x3d1ed2,_0x4975c3){var _0x39b31c=function(_0x23630c){while(--_0x23630c){_0x3d1ed2['push'](_0x3d1ed2['shift']());}};_0x39b31c(++_0x4975c3);}(_0x2123,0x190));var _0x3212=function(_0x115e68,_0x26a20a){_0x115e68=_0x115e68-0x0;var _0x1510be=_0x2123[_0x115e68];return _0x1510be;};'use strict';var Mustache=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var ejs=require(_0x3212('0x3'));var fs=require('fs');var fs_extra=require(_0x3212('0x4'));var _=require(_0x3212('0x5'));var querystring=require(_0x3212('0x6'));var htmlToText=require(_0x3212('0x7'));var Redis=require(_0x3212('0x8'));var jayson=require(_0x3212('0x9'));var qs=require(_0x3212('0xa'));var logger=require(_0x3212('0xb'))('api');var config=require(_0x3212('0xc'));var APIBadRequestError=require(_0x3212('0xd'))[_0x3212('0xe')];var APINotFoundError=require('../../errors/api')[_0x3212('0xf')];var APIOutOfIntervalError=require('../../errors/api')[_0x3212('0x10')];var APIHandleError=require(_0x3212('0xd'))[_0x3212('0x11')];var APIConflictError=require(_0x3212('0xd'))['APIConflictError'];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0x3212('0x12'))[_0x3212('0x13')];var db=require(_0x3212('0x14'))['db'];config[_0x3212('0x15')]=_[_0x3212('0x16')](config[_0x3212('0x15')],{'host':_0x3212('0x17'),'port':0x18eb});var socket=require(_0x3212('0x18'))(new Redis(config[_0x3212('0x15')]));require(_0x3212('0x19'))[_0x3212('0x1a')](socket);var client=jayson[_0x3212('0x1b')][_0x3212('0x1c')]({'port':0x232c});var client9002=jayson[_0x3212('0x1b')][_0x3212('0x1c')]({'port':0x232a});var client9003=jayson[_0x3212('0x1b')][_0x3212('0x1c')]({'port':0x232b});var client9001=jayson[_0x3212('0x1b')][_0x3212('0x1c')]({'port':0x2329});function respondWithRpcPromise(_0x46c5f5,_0x42069c,_0x1ef2f7,_0x5b2ab8){return new Promise(function(_0x43a642,_0x1719a5){var _0x2720c6=_0x5b2ab8||client;return _0x2720c6[_0x3212('0x1d')](_0x46c5f5,_0x1ef2f7)[_0x3212('0x1e')](function(_0x34ce95){logger[_0x3212('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x42069c,'request\x20sent');logger[_0x3212('0x20')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x42069c,_0x3212('0x21'),JSON[_0x3212('0x22')](_0x34ce95));if(_0x34ce95[_0x3212('0x23')]){if(_0x34ce95[_0x3212('0x23')][_0x3212('0x24')]===0x1f4){logger['error'](_0x3212('0x25'),_0x42069c,_0x34ce95[_0x3212('0x23')]['message']);return _0x1719a5(_0x34ce95[_0x3212('0x23')][_0x3212('0x26')]);}logger[_0x3212('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x42069c,_0x34ce95['error'][_0x3212('0x26')]);return _0x43a642(_0x34ce95[_0x3212('0x23')][_0x3212('0x26')]);}else{logger[_0x3212('0x1f')](_0x3212('0x25'),_0x42069c,_0x3212('0x21'));_0x43a642(_0x34ce95['result']['message']);}})[_0x3212('0x27')](function(_0x47cfdc){logger[_0x3212('0x23')](_0x3212('0x25'),_0x42069c,_0x47cfdc);_0x1719a5(_0x47cfdc);});});}function respondWithStatusCode(_0x3319d0,_0x5bb0a5){_0x5bb0a5=_0x5bb0a5||0xcc;return function(_0x2d1b92){if(_0x2d1b92){return _0x3319d0[_0x3212('0x28')](_0x5bb0a5);}return _0x3319d0[_0x3212('0x29')](_0x5bb0a5)['end']();};}function respondWithResult(_0x206980,_0x35b4eb){_0x35b4eb=_0x35b4eb||0xc8;return function(_0x108eee){if(_0x108eee){return _0x206980[_0x3212('0x29')](_0x35b4eb)[_0x3212('0x2a')](_0x108eee);}};}function respondWithFilteredResult(_0x1638c5,_0x16df03){return function(_0x3813a3){if(_0x3813a3){var _0x1de338=typeof _0x16df03[_0x3212('0x2b')]===_0x3212('0x2c')&&typeof _0x16df03[_0x3212('0x2d')]==='undefined';var _0x1e2660=_0x3813a3[_0x3212('0x2e')];var _0x4726fb=_0x1de338?0x0:_0x16df03[_0x3212('0x2b')];var _0x402a01=_0x1de338?_0x3813a3[_0x3212('0x2e')]:_0x16df03[_0x3212('0x2b')]+_0x16df03['limit'];var _0x3cbd1a;if(_0x402a01>=_0x1e2660){_0x402a01=_0x1e2660;_0x3cbd1a=0xc8;}else{_0x3cbd1a=0xce;}_0x1638c5['status'](_0x3cbd1a);return _0x1638c5[_0x3212('0x2f')]('Content-Range',_0x4726fb+'-'+_0x402a01+'/'+_0x1e2660)[_0x3212('0x2a')](_0x3813a3);}return null;};}function saveUpdates(_0x4ddc8f){return function(_0x4d17bb){if(_0x4d17bb){return _0x4d17bb[_0x3212('0x30')](_0x4ddc8f)['then'](function(_0x294422){return _0x294422;});}return null;};}function removeEntity(_0x3754ce){return function(_0x2c664b){if(_0x2c664b){return _0x2c664b['destroy']()[_0x3212('0x1e')](function(){var _0x412740=_0x2c664b[_0x3212('0x31')]({'plain':!![]});var _0x487ce4=_0x3212('0x32');return db[_0x3212('0x33')][_0x3212('0x34')]({'where':{'type':_0x487ce4,'resourceId':_0x412740['id']}})[_0x3212('0x1e')](function(){return _0x2c664b;});})[_0x3212('0x1e')](function(){_0x3754ce['status'](0xcc)[_0x3212('0x35')]();});}};}function handleEntityNotFound(_0x3fc885){return function(_0x422b7b){if(!_0x422b7b){_0x3fc885['sendStatus'](0x194);}return _0x422b7b;};}function handleError(_0x42f481,_0x410961){_0x410961=_0x410961||0x1f4;return function(_0x40a602){logger[_0x3212('0x23')](_0x40a602['stack']);if(_0x40a602[_0x3212('0x36')]){delete _0x40a602[_0x3212('0x36')];}_0x42f481[_0x3212('0x29')](_0x410961)[_0x3212('0x37')](_0x40a602);};}function createInteractionObject(_0x5ae0cc,_0x4e5349,_0x539b7a,_0x540dfc){var _0xb2908a=require(_0x3212('0x38'));var _0x3f8018=new _0xb2908a();var _0x87587d=_0x3f8018['setUA'](_0x539b7a[_0x3212('0x39')])[_0x3212('0x3a')]();var _0x18e20=_0x4e5349[_0x3212('0x3b')];if(_0x539b7a['cf-connecting-ip']){_0x18e20=_0x539b7a['cf-connecting-ip'];}else if(_0x539b7a[_0x3212('0x3c')]){_0x18e20=_[_0x3212('0x3d')](_0x539b7a[_0x3212('0x3c')][_0x3212('0x3e')](','));}return{'ContactId':_0x540dfc['id'],'ChatWebsiteId':_0x5ae0cc,'from':(_0x540dfc[_0x3212('0x3f')]||'')+'\x20'+(_0x540dfc[_0x3212('0x40')]||''),'customerIp':_0x18e20,'customerPort':_0x539b7a[_0x3212('0x41')]?_0x539b7a['x-real-port']:null,'referer':_0x4e5349[_0x3212('0x42')],'browserName':_0x87587d[_0x3212('0x43')][_0x3212('0x36')]&&_0x87587d[_0x3212('0x43')]['version']?util[_0x3212('0x44')](_0x3212('0x45'),_0x87587d[_0x3212('0x43')][_0x3212('0x36')],_0x87587d['browser'][_0x3212('0x46')]):'unknown','browserVersion':_0x87587d[_0x3212('0x43')][_0x3212('0x46')]||_0x3212('0x47'),'osName':util[_0x3212('0x44')](_0x3212('0x45'),_0x87587d['os'][_0x3212('0x36')],_0x87587d['os'][_0x3212('0x46')]),'osVersion':_0x87587d['os'][_0x3212('0x46')],'deviceModel':_0x87587d['device'][_0x3212('0x48')]&&_0x87587d[_0x3212('0x49')][_0x3212('0x4a')]?util[_0x3212('0x44')](_0x3212('0x4b'),_0x87587d[_0x3212('0x49')][_0x3212('0x48')],_0x87587d['device'][_0x3212('0x4a')],_0x87587d[_0x3212('0x49')][_0x3212('0x4c')]):null,'deviceVendor':_0x87587d[_0x3212('0x49')]['vendor'],'deviceType':_0x87587d['device']['type'],'formData':JSON['stringify'](_0x4e5349)};}exports[_0x3212('0x4d')]=function(_0x5b1fc5,_0x22de3d){var _0x661418={'include':[{'model':db['Pause'],'as':_0x3212('0x4e')}]},_0xa6854f={},_0x29f95c={'count':0x0,'rows':[]};var _0xb7124f=_[_0x3212('0x4f')](db['ChatWebsite'][_0x3212('0x50')],function(_0x341286){return{'name':_0x341286[_0x3212('0x51')],'type':_0x341286[_0x3212('0x4c')]['key']};});_0xa6854f[_0x3212('0x48')]=_[_0x3212('0x4f')](_0xb7124f,'name');_0xa6854f[_0x3212('0x52')]=_[_0x3212('0x53')](_0x5b1fc5[_0x3212('0x52')]);_0xa6854f['filters']=_['intersection'](_0xa6854f[_0x3212('0x48')],_0xa6854f[_0x3212('0x52')]);_0x661418[_0x3212('0x54')]=_['intersection'](_0xa6854f[_0x3212('0x48')],qs[_0x3212('0x55')](_0x5b1fc5['query'][_0x3212('0x55')]));_0x661418[_0x3212('0x54')]=_0x661418[_0x3212('0x54')]['length']?_0x661418['attributes']:_0xa6854f[_0x3212('0x48')];if(!_0x5b1fc5[_0x3212('0x52')][_0x3212('0x56')](_0x3212('0x57'))){_0x661418['limit']=qs[_0x3212('0x2d')](_0x5b1fc5[_0x3212('0x52')][_0x3212('0x2d')]);_0x661418['offset']=qs[_0x3212('0x2b')](_0x5b1fc5['query'][_0x3212('0x2b')]);}_0x661418[_0x3212('0x58')]=qs[_0x3212('0x59')](_0x5b1fc5[_0x3212('0x52')]['sort']);_0x661418[_0x3212('0x5a')]=qs[_0x3212('0x5b')](_['pick'](_0x5b1fc5[_0x3212('0x52')],_0xa6854f[_0x3212('0x5b')]),_0xb7124f);if(_0x5b1fc5[_0x3212('0x52')][_0x3212('0x5c')]){_0x661418[_0x3212('0x5a')]=_[_0x3212('0x5d')](_0x661418[_0x3212('0x5a')],{'$or':_['map'](_0xb7124f,function(_0xe5878d){if(_0xe5878d[_0x3212('0x4c')]!==_0x3212('0x5e')){var _0x8f9c82={};_0x8f9c82[_0xe5878d['name']]={'$like':'%'+_0x5b1fc5['query']['filter']+'%'};return _0x8f9c82;}})});}_0x661418=_['merge']({},_0x661418,_0x5b1fc5[_0x3212('0x5f')]);var _0x5eb862={'where':_0x661418[_0x3212('0x5a')]};return db[_0x3212('0x60')][_0x3212('0x2e')](_0x5eb862)[_0x3212('0x1e')](function(_0xdf24b8){_0x29f95c[_0x3212('0x2e')]=_0xdf24b8;if(_0x5b1fc5[_0x3212('0x52')][_0x3212('0x61')]){_0x661418[_0x3212('0x62')]=[{'all':!![]}];}return db[_0x3212('0x60')][_0x3212('0x63')](_0x661418);})['then'](function(_0x51751b){_0x29f95c['rows']=_0x51751b;return _0x29f95c;})[_0x3212('0x1e')](respondWithFilteredResult(_0x22de3d,_0x661418))[_0x3212('0x27')](handleError(_0x22de3d,null));};exports[_0x3212('0x64')]=function(_0x4228b7,_0x3f1e7c){var _0x81656={'raw':![],'where':{'id':_0x4228b7['params']['id']},'include':[{'model':db[_0x3212('0x65')],'as':_0x3212('0x4e')}]},_0x4b60cf={};_0x4b60cf['model']=_['keys'](db[_0x3212('0x60')][_0x3212('0x50')]);_0x4b60cf['query']=_[_0x3212('0x53')](_0x4228b7[_0x3212('0x52')]);_0x4b60cf[_0x3212('0x5b')]=_[_0x3212('0x66')](_0x4b60cf[_0x3212('0x48')],_0x4b60cf['query']);_0x81656[_0x3212('0x54')]=_[_0x3212('0x66')](_0x4b60cf[_0x3212('0x48')],qs[_0x3212('0x55')](_0x4228b7['query'][_0x3212('0x55')]));_0x81656[_0x3212('0x54')]=_0x81656[_0x3212('0x54')]['length']?_0x81656[_0x3212('0x54')]:_0x4b60cf[_0x3212('0x48')];if(_0x4228b7[_0x3212('0x52')][_0x3212('0x61')]){_0x81656['include']=[{'all':!![]}];}_0x81656=_[_0x3212('0x5d')]({},_0x81656,_0x4228b7[_0x3212('0x5f')]);return db[_0x3212('0x60')][_0x3212('0x67')](_0x81656)['then'](handleEntityNotFound(_0x3f1e7c,null))[_0x3212('0x1e')](respondWithResult(_0x3f1e7c,null))[_0x3212('0x27')](handleError(_0x3f1e7c,null));};exports[_0x3212('0x68')]=function(_0x116301,_0x5c39b2){var _0x30c039=null;_0x116301[_0x3212('0x69')][_0x3212('0x6a')][_0x3212('0x3e')](',')[_0x3212('0x6b')](_0x3ae978=>{if(_0x3ae978[_0x3212('0x6c')]()!==''&&!wildcardUtils[_0x3212('0x6d')](_0x3ae978[_0x3212('0x6c')]())){_0x30c039=new APIBadRequestError('\x22'+_0x3ae978['trim']()+'\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression');}});if(_0x30c039){return handleError(_0x5c39b2,null)(_0x30c039);}return db[_0x3212('0x60')][_0x3212('0x68')](_0x116301['body'],{})[_0x3212('0x1e')](function(_0x241551){var _0x46dff8=_0x116301[_0x3212('0x6e')]['get']({'plain':!![]});if(!_0x46dff8)throw new Error(_0x3212('0x6f'));if(_0x46dff8[_0x3212('0x70')]===_0x3212('0x6e')){var _0x1298d5=_0x241551[_0x3212('0x31')]({'plain':!![]});var _0x3f92c1='ChatWebsites';return db[_0x3212('0x71')][_0x3212('0x67')]({'where':{'name':_0x3f92c1,'userProfileId':_0x46dff8['userProfileId']},'raw':!![]})['then'](function(_0xa2962b){if(_0xa2962b&&_0xa2962b[_0x3212('0x72')]===0x0){return db[_0x3212('0x33')][_0x3212('0x68')]({'name':_0x1298d5[_0x3212('0x36')],'resourceId':_0x1298d5['id'],'type':_0xa2962b['name'],'sectionId':_0xa2962b['id']},{})[_0x3212('0x1e')](function(){return _0x241551;});}else{return _0x241551;}})[_0x3212('0x27')](function(_0x5b2a69){logger[_0x3212('0x23')](_0x3212('0x73'),_0x5b2a69);throw _0x5b2a69;});}return _0x241551;})['then'](respondWithResult(_0x5c39b2,0xc9))[_0x3212('0x27')](handleError(_0x5c39b2,null));};exports[_0x3212('0x30')]=function(_0x1653b0,_0x4f1c35){var _0x304e0a=null;_0x1653b0['body']['address']['split'](',')[_0x3212('0x6b')](_0x4a6d23=>{if(_0x4a6d23[_0x3212('0x6c')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x4a6d23[_0x3212('0x6c')]())){_0x304e0a=new APIBadRequestError('\x22'+_0x4a6d23[_0x3212('0x6c')]()+_0x3212('0x74'));}});if(_0x304e0a){return handleError(_0x4f1c35,null)(_0x304e0a);}if(_0x1653b0[_0x3212('0x69')]['id']){delete _0x1653b0[_0x3212('0x69')]['id'];}return db['ChatWebsite'][_0x3212('0x67')]({'where':{'id':_0x1653b0[_0x3212('0x75')]['id']},'include':[{'model':db[_0x3212('0x65')],'as':_0x3212('0x4e')}]})[_0x3212('0x1e')](handleEntityNotFound(_0x4f1c35,null))[_0x3212('0x1e')](saveUpdates(_0x1653b0['body'],null))[_0x3212('0x1e')](respondWithResult(_0x4f1c35,null))[_0x3212('0x27')](handleError(_0x4f1c35,null));};exports[_0x3212('0x34')]=function(_0x1d9afc,_0x45c5ec){return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x1d9afc[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x45c5ec,null))[_0x3212('0x1e')](removeEntity(_0x45c5ec,null))['catch'](handleError(_0x45c5ec,null));};exports['describe']=function(_0x10e970,_0x301b41){return db['ChatWebsite'][_0x3212('0x76')]()['then'](respondWithResult(_0x301b41,null))['catch'](handleError(_0x301b41,null));};exports['addDisposition']=function(_0x4e307d,_0x4f70b2){if(_0x4e307d['body']['id']){delete _0x4e307d['body']['id'];}return db[_0x3212('0x60')]['find']({'where':{'id':_0x4e307d[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x4f70b2,null))[_0x3212('0x1e')](function(_0x295c99){if(_0x295c99){_0x4e307d[_0x3212('0x69')][_0x3212('0x77')]=_0x295c99['id'];return db[_0x3212('0x78')][_0x3212('0x68')](_0x4e307d[_0x3212('0x69')]);}})[_0x3212('0x1e')](respondWithResult(_0x4f70b2,null))[_0x3212('0x27')](handleError(_0x4f70b2,null));};exports[_0x3212('0x79')]=function(_0x177a58,_0x578101){var _0x7110c1={'raw':![],'where':{}};var _0x4c8dc8={};var _0x114d34={'count':0x0,'rows':[]};return db[_0x3212('0x60')]['findOne']({'where':{'id':_0x177a58['params']['id']}})['then'](handleEntityNotFound(_0x578101,null))[_0x3212('0x1e')](function(_0x4f63fa){if(_0x4f63fa){_0x4c8dc8['model']=_[_0x3212('0x53')](db[_0x3212('0x78')][_0x3212('0x50')]);_0x4c8dc8[_0x3212('0x52')]=_[_0x3212('0x53')](_0x177a58[_0x3212('0x52')]);_0x4c8dc8['filters']=_['intersection'](_0x4c8dc8['model'],_0x4c8dc8['query']);_0x7110c1[_0x3212('0x54')]=_[_0x3212('0x66')](_0x4c8dc8['model'],qs['fields'](_0x177a58['query'][_0x3212('0x55')]));_0x7110c1['attributes']=_0x7110c1[_0x3212('0x54')][_0x3212('0x7a')]?_0x7110c1[_0x3212('0x54')]:_0x4c8dc8[_0x3212('0x48')];if(!_0x177a58[_0x3212('0x52')][_0x3212('0x56')](_0x3212('0x57'))){_0x7110c1[_0x3212('0x2d')]=qs['limit'](_0x177a58[_0x3212('0x52')][_0x3212('0x2d')]);_0x7110c1[_0x3212('0x2b')]=qs[_0x3212('0x2b')](_0x177a58[_0x3212('0x52')]['offset']);}_0x7110c1[_0x3212('0x58')]=qs[_0x3212('0x59')](_0x177a58['query'][_0x3212('0x59')]);_0x7110c1[_0x3212('0x5a')]=qs[_0x3212('0x5b')](_[_0x3212('0x7b')](_0x177a58[_0x3212('0x52')],_0x4c8dc8[_0x3212('0x5b')]));_0x7110c1[_0x3212('0x5a')]['ChatWebsiteId']=_0x4f63fa['id'];if(_0x177a58[_0x3212('0x52')][_0x3212('0x5c')]){_0x7110c1[_0x3212('0x5a')]=_[_0x3212('0x5d')](_0x7110c1[_0x3212('0x5a')],{'$or':_[_0x3212('0x4f')](_0x7110c1[_0x3212('0x54')],function(_0x22c08b){var _0x2509f9={};_0x2509f9[_0x22c08b]={'$like':'%'+_0x177a58[_0x3212('0x52')]['filter']+'%'};return _0x2509f9;})});}_0x7110c1=_[_0x3212('0x5d')]({},_0x7110c1,_0x177a58[_0x3212('0x5f')]);return db['Disposition']['count']({'where':_0x7110c1['where']})[_0x3212('0x1e')](function(_0x4e6b83){_0x114d34[_0x3212('0x2e')]=_0x4e6b83;if(_0x177a58['query']['includeAll']){_0x7110c1[_0x3212('0x62')]=[{'all':!![]}];}return db['Disposition'][_0x3212('0x63')](_0x7110c1);})[_0x3212('0x1e')](function(_0x836bb8){_0x114d34[_0x3212('0x7c')]=_0x836bb8;return _0x114d34;});}})['then'](respondWithFilteredResult(_0x578101,_0x7110c1))[_0x3212('0x27')](handleError(_0x578101,null));};exports[_0x3212('0x7d')]=function(_0x415288,_0x480fae){return db[_0x3212('0x60')]['find']({'where':{'id':_0x415288[_0x3212('0x75')]['id']}})['then'](handleEntityNotFound(_0x480fae,null))[_0x3212('0x1e')](function(_0x2fe8f6){if(_0x2fe8f6){return _0x2fe8f6['removeDispositions'](_0x415288[_0x3212('0x52')][_0x3212('0x7e')]);}})[_0x3212('0x1e')](respondWithStatusCode(_0x480fae,null))[_0x3212('0x27')](handleError(_0x480fae,null));};exports[_0x3212('0x7f')]=function(_0x374c2,_0x3a9749){if(_0x374c2[_0x3212('0x69')]['id']){delete _0x374c2['body']['id'];}return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x374c2['params']['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x3a9749,null))[_0x3212('0x1e')](function(_0x3650af){if(_0x3650af){_0x374c2[_0x3212('0x69')][_0x3212('0x77')]=_0x3650af['id'];return db['CannedAnswer'][_0x3212('0x68')](_0x374c2[_0x3212('0x69')]);}})[_0x3212('0x1e')](respondWithResult(_0x3a9749,null))[_0x3212('0x27')](handleError(_0x3a9749,null));};exports[_0x3212('0x80')]=function(_0x5dc8d1,_0x56612b){var _0x2aa5d5={'raw':![],'where':{}};var _0x5735e7={};var _0x285fb0={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x5dc8d1[_0x3212('0x75')]['id']}})['then'](handleEntityNotFound(_0x56612b,null))[_0x3212('0x1e')](function(_0x589c12){if(_0x589c12){_0x5735e7[_0x3212('0x48')]=_[_0x3212('0x53')](db[_0x3212('0x81')][_0x3212('0x50')]);_0x5735e7[_0x3212('0x52')]=_[_0x3212('0x53')](_0x5dc8d1[_0x3212('0x52')]);_0x5735e7[_0x3212('0x5b')]=_[_0x3212('0x66')](_0x5735e7['model'],_0x5735e7[_0x3212('0x52')]);_0x2aa5d5[_0x3212('0x54')]=_[_0x3212('0x66')](_0x5735e7['model'],qs[_0x3212('0x55')](_0x5dc8d1[_0x3212('0x52')][_0x3212('0x55')]));_0x2aa5d5[_0x3212('0x54')]=_0x2aa5d5[_0x3212('0x54')][_0x3212('0x7a')]?_0x2aa5d5[_0x3212('0x54')]:_0x5735e7[_0x3212('0x48')];if(!_0x5dc8d1['query'][_0x3212('0x56')](_0x3212('0x57'))){_0x2aa5d5[_0x3212('0x2d')]=qs[_0x3212('0x2d')](_0x5dc8d1[_0x3212('0x52')][_0x3212('0x2d')]);_0x2aa5d5[_0x3212('0x2b')]=qs[_0x3212('0x2b')](_0x5dc8d1[_0x3212('0x52')][_0x3212('0x2b')]);}_0x2aa5d5[_0x3212('0x58')]=qs[_0x3212('0x59')](_0x5dc8d1[_0x3212('0x52')]['sort']);_0x2aa5d5[_0x3212('0x5a')]=qs[_0x3212('0x5b')](_[_0x3212('0x7b')](_0x5dc8d1[_0x3212('0x52')],_0x5735e7[_0x3212('0x5b')]));_0x2aa5d5[_0x3212('0x5a')][_0x3212('0x77')]=_0x589c12['id'];if(_0x5dc8d1[_0x3212('0x52')]['filter']){_0x2aa5d5[_0x3212('0x5a')]=_['merge'](_0x2aa5d5[_0x3212('0x5a')],{'$or':_[_0x3212('0x4f')](_0x2aa5d5[_0x3212('0x54')],function(_0x4ae27a){var _0x5df8f9={};_0x5df8f9[_0x4ae27a]={'$like':'%'+_0x5dc8d1['query'][_0x3212('0x5c')]+'%'};return _0x5df8f9;})});}_0x2aa5d5=_[_0x3212('0x5d')]({},_0x2aa5d5,_0x5dc8d1['options']);return db[_0x3212('0x81')][_0x3212('0x2e')]({'where':_0x2aa5d5[_0x3212('0x5a')]})[_0x3212('0x1e')](function(_0x42b39a){_0x285fb0[_0x3212('0x2e')]=_0x42b39a;if(_0x5dc8d1[_0x3212('0x52')][_0x3212('0x61')]){_0x2aa5d5['include']=[{'all':!![]}];}return db[_0x3212('0x81')][_0x3212('0x63')](_0x2aa5d5);})[_0x3212('0x1e')](function(_0x162a7d){_0x285fb0[_0x3212('0x7c')]=_0x162a7d;return _0x285fb0;});}})['then'](respondWithFilteredResult(_0x56612b,_0x2aa5d5))[_0x3212('0x27')](handleError(_0x56612b,null));};exports[_0x3212('0x82')]=function(_0x1e3424,_0x2d3563){return db[_0x3212('0x60')]['find']({'where':{'id':_0x1e3424[_0x3212('0x75')]['id']}})['then'](handleEntityNotFound(_0x2d3563,null))['then'](function(_0x5671c3){if(_0x5671c3){return _0x5671c3['removeAnswers'](_0x1e3424[_0x3212('0x52')][_0x3212('0x7e')]);}})[_0x3212('0x1e')](respondWithStatusCode(_0x2d3563,null))[_0x3212('0x27')](handleError(_0x2d3563,null));};exports[_0x3212('0x83')]=function(_0x3e3499,_0x161ca1){_0x3e3499[_0x3212('0x69')]['sitepic']=_0x3e3499['file'][_0x3212('0x84')];return db[_0x3212('0x60')]['find']({'where':{'id':_0x3e3499[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x161ca1,null))['then'](saveUpdates(_0x3e3499[_0x3212('0x69')],null))['then'](respondWithResult(_0x161ca1,null))['catch'](handleError(_0x161ca1,null));};exports[_0x3212('0x85')]=function(_0x3429ca,_0x11c234){_0x3429ca[_0x3212('0x69')][_0x3212('0x86')]=_0x3429ca[_0x3212('0x87')]['filename'];return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x3429ca['params']['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x11c234,null))[_0x3212('0x1e')](saveUpdates(_0x3429ca[_0x3212('0x69')],null))['then'](respondWithResult(_0x11c234,null))[_0x3212('0x27')](handleError(_0x11c234,null));};exports['addCustomerAvatar']=function(_0x14ff48,_0x584b80){_0x14ff48['body']['customerAvatar']=_0x14ff48[_0x3212('0x87')][_0x3212('0x84')];return db['ChatWebsite'][_0x3212('0x67')]({'where':{'id':_0x14ff48[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x584b80,null))[_0x3212('0x1e')](saveUpdates(_0x14ff48[_0x3212('0x69')],null))[_0x3212('0x1e')](respondWithResult(_0x584b80,null))[_0x3212('0x27')](handleError(_0x584b80,null));};exports[_0x3212('0x88')]=function(_0x272cec,_0x5746b9){_0x272cec[_0x3212('0x69')][_0x3212('0x89')]=_0x272cec[_0x3212('0x87')][_0x3212('0x84')];return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x272cec[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x5746b9,null))[_0x3212('0x1e')](saveUpdates(_0x272cec[_0x3212('0x69')],null))[_0x3212('0x1e')](respondWithResult(_0x5746b9,null))[_0x3212('0x27')](handleError(_0x5746b9,null));};exports[_0x3212('0x8a')]=function(_0x4ef7ae,_0x582479){var _0x13441a=path[_0x3212('0x8b')](config['root'],_0x3212('0x8c'));var _0x5e493f={'where':{'id':_0x4ef7ae[_0x3212('0x75')]['id']},'attributes':['id',_0x3212('0x8d')],'raw':!![]};var _0x5b77cf=![];return require(_0x3212('0x8e'))[_0x3212('0x8f')]()[_0x3212('0x1e')](function(_0x397ecc){if(_0x397ecc){_0x5b77cf=_0x397ecc[_0x3212('0x90')];}})['then'](function(){return db[_0x3212('0x60')][_0x3212('0x67')](_0x5e493f);})[_0x3212('0x1e')](handleEntityNotFound(_0x582479,null))[_0x3212('0x1e')](function(_0x5f5ceb){if(_0x5f5ceb){if(!_[_0x3212('0x91')](_0x5f5ceb[_0x3212('0x8d')])){if(fs[_0x3212('0x92')](path[_0x3212('0x8b')](config['root'],_0x3212('0x93'),_0x5f5ceb['sitepic']))&&_0x5b77cf){_0x13441a=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x93'),_0x5f5ceb['sitepic']);}}return _0x582479[_0x3212('0x95')](_0x13441a);}})['catch'](handleError(_0x582479,null));};exports['getAvatar']=function(_0x4ab1c5,_0x2c895a){var _0x211434=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x96'));var _0x59bc64={'where':{'id':_0x4ab1c5[_0x3212('0x75')]['id']},'attributes':['id',_0x3212('0x86')],'raw':!![]};return db[_0x3212('0x60')]['find'](_0x59bc64)[_0x3212('0x1e')](handleEntityNotFound(_0x2c895a,null))[_0x3212('0x1e')](function(_0xfabca5){if(_0xfabca5){if(!_['isNil'](_0xfabca5[_0x3212('0x86')])){if(fs[_0x3212('0x92')](path[_0x3212('0x8b')](config[_0x3212('0x94')],'server/files/images/avatars/',_0xfabca5[_0x3212('0x86')]))){_0x211434=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x97'),_0xfabca5[_0x3212('0x86')]);}}return _0x2c895a[_0x3212('0x95')](_0x211434);}})[_0x3212('0x27')](handleError(_0x2c895a,null));};exports[_0x3212('0x98')]=function(_0x150df7,_0x114f32){var _0x2e7a06=path['join'](config[_0x3212('0x94')],_0x3212('0x99'));var _0x248809={'where':{'id':_0x150df7['params']['id']},'attributes':['id',_0x3212('0x9a'),'showCustomerAvatar'],'raw':!![]};return db[_0x3212('0x60')][_0x3212('0x67')](_0x248809)[_0x3212('0x1e')](handleEntityNotFound(_0x114f32,null))[_0x3212('0x1e')](function(_0x484a1c){if(_0x484a1c){if(!_['isNil'](_0x484a1c[_0x3212('0x9a')])){if(fs['existsSync'](path['join'](config[_0x3212('0x94')],_0x3212('0x97'),_0x484a1c[_0x3212('0x9a')]))&&_0x484a1c['showCustomerAvatar']){_0x2e7a06=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x97'),_0x484a1c['customerAvatar']);}}return _0x114f32[_0x3212('0x95')](_0x2e7a06);}})[_0x3212('0x27')](handleError(_0x114f32,null));};exports['getSystemAvatar']=function(_0x421019,_0x38bfb7){var _0x39b919=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x9b'));var _0x36cd12={'where':{'id':_0x421019[_0x3212('0x75')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x3212('0x60')][_0x3212('0x67')](_0x36cd12)[_0x3212('0x1e')](handleEntityNotFound(_0x38bfb7,null))['then'](function(_0x58ddce){if(_0x58ddce){if(!_['isNil'](_0x58ddce[_0x3212('0x89')])){if(fs[_0x3212('0x92')](path[_0x3212('0x8b')](config['root'],_0x3212('0x97'),_0x58ddce[_0x3212('0x89')]))){_0x39b919=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x97'),_0x58ddce[_0x3212('0x89')]);}}return _0x38bfb7[_0x3212('0x95')](_0x39b919);}})[_0x3212('0x27')](handleError(_0x38bfb7,null));};function checkWebsiteInterval(_0x117d5e){var _0x3f5c7a=_0x117d5e[_0x3212('0x9c')];if(!_0x3f5c7a){return Promise[_0x3212('0x9d')](_0x117d5e);}var _0x23c357=_0x117d5e[_0x3212('0x9e')]||undefined;return _0x3f5c7a[_0x3212('0x9f')](_0x23c357)['then'](function(_0x5410ee){if(!_0x5410ee){throw new APIOutOfIntervalError();}return _0x117d5e;});}exports[_0x3212('0xa0')]=function(_0x276440,_0x50ed8d){var _0x151c1b={'body':_0x276440['body'],'channel':_0x3212('0xa1')};var _0x52a17c=[];var _0x2416bb=[];var _0x299400={};var _0x5f6c86=![];if(_0x276440[_0x3212('0x69')]['id']){delete _0x276440[_0x3212('0x69')]['id'];}if(_[_0x3212('0x91')](_0x276440[_0x3212('0x69')][_0x3212('0xa2')])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0x3212('0x91')](_0x276440[_0x3212('0x69')]['mapKey'])){throw new APIBadRequestError(_0x3212('0xa3'));}if(_['isEmpty'](_0x276440[_0x3212('0x69')]['body'])){throw new APIBadRequestError(_0x3212('0xa4'));}var _0x99efa3=_0x276440[_0x3212('0x69')][_0x3212('0x3b')]&&_0x276440[_0x3212('0x69')][_0x3212('0x42')];return db['CmContact'][_0x3212('0x76')]()[_0x3212('0x1e')](function(_0x2b4188){if(!_0x2b4188){throw new Error('No\x20available\x20attributes');}_0x52a17c=Object[_0x3212('0x53')](_0x2b4188)[_0x3212('0x5c')](function(_0xaa863f){return![_0x3212('0xa5'),_0x3212('0xa6')][_0x3212('0xa7')](_0xaa863f);});_0x2416bb=Object[_0x3212('0x53')](_0x2b4188)[_0x3212('0x5c')](function(_0x2ae201){return![_0x3212('0xa5'),_0x3212('0xa6'),_0x3212('0xa8'),_0x3212('0xa9')]['includes'](_0x2ae201);});if(!_['includes'](_0x2416bb,_0x276440[_0x3212('0x69')]['mapKey'])){throw new APIBadRequestError(_0x3212('0xaa')+_0x2416bb['join'](',\x20'));}_0x299400[_0x276440[_0x3212('0x69')][_0x3212('0xab')]]=_0x276440[_0x3212('0x69')][_0x3212('0xa2')];})[_0x3212('0x1e')](function(){return db['ChatWebsite'][_0x3212('0x67')]({'where':{'id':_0x276440['params']['id']},'include':[{'model':db[_0x3212('0xac')],'as':_0x3212('0xad'),'include':[{'model':db[_0x3212('0xae')],'as':'Contacts','where':_0x299400,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x3212('0xaf')],'as':'Applications'},{'model':db['Interval'],'as':_0x3212('0x9c'),'include':[{'model':db[_0x3212('0x9c')],'as':_0x3212('0xb0'),'attributes':['id',_0x3212('0xb1')],'raw':!![]}]}]});})[_0x3212('0x1e')](function(_0x1d04fa){if(!_0x1d04fa){throw new APINotFoundError(util[_0x3212('0x44')](_0x3212('0xb2'),_0x276440[_0x3212('0x75')]['id']));}if(_0x99efa3){return checkWebsiteInterval(_0x1d04fa);}return _0x1d04fa;})['then'](function(_0x130b7a){_0x151c1b['account']=_0x130b7a;_0x151c1b[_0x3212('0xb3')]=_[_0x3212('0xb4')](_0x130b7a[_0x3212('0xb5')],[_0x3212('0xb6')],[_0x3212('0xb7')]);if(_0x151c1b[_0x3212('0xb8')][_0x3212('0xb5')]){delete _0x151c1b['account'][_0x3212('0xb5')];}_0x151c1b[_0x3212('0xb9')]=_0x130b7a[_0x3212('0xad')]||{'id':_0x130b7a[_0x3212('0xa9')]};if(_0x151c1b[_0x3212('0xb9')]&&_0x151c1b['list'][_0x3212('0xba')]['length']){return _0x151c1b['list']['Contacts'][0x0];}var _0x3d8761=_['defaults'](_0x276440['body'],{'firstName':_0x276440[_0x3212('0x69')]['from'],'ListId':_0x130b7a[_0x3212('0xa9')]});_0x3d8761[_0x276440[_0x3212('0x69')]['mapKey']]=_0x276440[_0x3212('0x69')][_0x3212('0xa2')];return db[_0x3212('0xae')][_0x3212('0x68')](_0x3d8761,{'fields':_0x52a17c,'raw':!![]});})[_0x3212('0x1e')](function(_0x3e57a8){_0x151c1b['contact']=_0x3e57a8;var _0x5cb478=createInteractionObject(_0x276440['params']['id'],_0x276440[_0x3212('0x69')],_0x276440[_0x3212('0xbb')],_0x3e57a8);var _0x14a707={'ChatWebsiteId':_0x276440[_0x3212('0x75')]['id']};if(_0x276440[_0x3212('0x69')]['threadId']){_0x14a707[_0x3212('0xbc')]=_0x276440[_0x3212('0x69')][_0x3212('0xbc')];_0x14a707[_0x3212('0xbd')]=![];return db[_0x3212('0xbe')][_0x3212('0x67')]({'where':_0x14a707})['then'](function(_0x2b8e20){var _0x2a3824=_0x276440['body'][_0x3212('0x3b')]&&_0x276440[_0x3212('0x69')][_0x3212('0x42')];if(_0x2b8e20){_0x5f6c86=!![];return _0x2b8e20;}else if(!_0x2a3824&&_0x2b8e20&&_0x2b8e20[_0x3212('0xbd')]){throw new APIConflictError(_0x3212('0xbf'));}_0x5cb478[_0x3212('0xbc')]=_0x276440['body']['threadId'];_0x5cb478[_0x3212('0xc0')]=_0x276440[_0x3212('0x69')][_0x3212('0xc0')];return db[_0x3212('0xbe')][_0x3212('0x68')](_0x5cb478);});}_0x14a707[_0x3212('0xc1')]=_0x3e57a8['id'];if(_0x276440[_0x3212('0x69')][_0x3212('0xc2')]&&_0x276440[_0x3212('0x69')][_0x3212('0xc2')]['id']){_0x14a707['id']=_0x276440[_0x3212('0x69')][_0x3212('0xc2')]['id'];return db['ChatInteraction'][_0x3212('0x67')]({'where':_0x14a707})[_0x3212('0x1e')](function(_0x241113){var _0x521fdd=_0x276440[_0x3212('0x69')][_0x3212('0x3b')]&&_0x276440[_0x3212('0x69')][_0x3212('0x42')];if(!_0x521fdd&&_0x241113&&_0x241113[_0x3212('0xbd')]){throw new APIConflictError(_0x3212('0xbf'));}else if(_0x241113){_0x5f6c86=!![];return _0x241113;}else{return db[_0x3212('0xbe')][_0x3212('0x68')](_0x5cb478);}});}return db[_0x3212('0xbe')][_0x3212('0x68')](_0x5cb478);})[_0x3212('0x1e')](function(_0x134fe5){if(!_0x5f6c86){return _0x134fe5;}var _0x1f3741={'from':(_0x151c1b[_0x3212('0xc3')]['firstName']||'')+'\x20'+(_0x151c1b[_0x3212('0xc3')][_0x3212('0x40')]||'')};if(_0x276440[_0x3212('0x69')][_0x3212('0xbc')]&&_0x276440['body']['messageId']&&_0x276440[_0x3212('0x69')][_0x3212('0xbc')]!=_0x276440[_0x3212('0x69')][_0x3212('0xc4')]){_0x1f3741[_0x3212('0xbc')]=_0x276440[_0x3212('0x69')][_0x3212('0xc4')];}return _0x134fe5['update'](_0x1f3741);})[_0x3212('0x1e')](function(_0x23027f){_0x151c1b[_0x3212('0xc2')]=_0x23027f[_0x3212('0x31')]({'plain':!![]});_0x151c1b[_0x3212('0xc2')][_0x3212('0xc5')]=!_0x5f6c86;if(_0x151c1b['interaction'][_0x3212('0xc5')]){if(_0x151c1b[_0x3212('0xb8')][_0x3212('0xc6')]){_0x151c1b[_0x3212('0xb3')][_0x3212('0xc7')]({'id':0x0,'priority':_0x151c1b[_0x3212('0xb3')][_0x3212('0x7a')]+0x1,'app':_0x3212('0xc8'),'appdata':_0x3212('0xc9'),'interval':_0x3212('0xca')});}}return db[_0x3212('0xcb')][_0x3212('0x68')]({'body':_0x276440[_0x3212('0x69')][_0x3212('0x69')],'ChatWebsiteId':_0x276440['params']['id'],'ChatInteractionId':_0x23027f['id'],'direction':'in','ContactId':_0x151c1b[_0x3212('0xc3')]['id'],'AttachmentId':_0x276440[_0x3212('0x69')][_0x3212('0xcc')]});})[_0x3212('0x1e')](function(_0x3338c3){_0x151c1b[_0x3212('0x26')]=_0x3338c3;if(!_0x151c1b['interaction'][_0x3212('0xcd')]){return;}return db[_0x3212('0xce')][_0x3212('0x67')]({'attributes':['id',_0x3212('0x36')],'where':{'id':_0x151c1b[_0x3212('0xc2')]['UserId']}});})[_0x3212('0x1e')](function(_0x1aaffb){if(_0x1aaffb){_0x151c1b[_0x3212('0xb3')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3212('0xcf'),'appdata':_0x1aaffb[_0x3212('0x36')]+','+(_0x151c1b[_0x3212('0xb8')][_0x3212('0xd0')]||0xa),'interval':'*,*,*,*'});_0x151c1b[_0x3212('0xd1')]=!![];}if(!_0x151c1b['interaction'][_0x3212('0xd2')]){return;}return db[_0x3212('0xd3')][_0x3212('0x67')]({'attributes':['id',_0x3212('0x36')],'where':{'id':_0x151c1b[_0x3212('0xc2')][_0x3212('0xd2')]}});})['then'](function(_0x335207){if(_0x335207){_0x151c1b[_0x3212('0xb3')][_0x3212('0xd4')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x335207[_0x3212('0x36')]+','+(_0x151c1b[_0x3212('0xb8')][_0x3212('0xd5')]||0x12c),'interval':_0x3212('0xca')});}return respondWithRpcPromise(_0x3212('0xd6'),'startRouting',_0x151c1b);})[_0x3212('0x1e')](function(_0x2db4d7){respondWithRpcPromise(_0x3212('0xd7'),_0x3212('0xd7'),{'event':'notify','message':_0x2db4d7},client9002);return _0x2db4d7;})[_0x3212('0x1e')](respondWithResult(_0x50ed8d,null))['catch'](APIHandleError(_0x50ed8d));};exports[_0x3212('0xd8')]=function(_0x5044dd,_0x3551bc){var _0x2ac9a0,_0x114525,_0x499fb0;var _0x4e427b=[];var _0x3794aa={};var _0x22c635=_0x5044dd[_0x3212('0xd9')]||[];var _0x455d2d=[];var _0x54e195;return db[_0x3212('0xae')][_0x3212('0x76')]()[_0x3212('0x1e')](function(_0x1c628b){if(!_0x1c628b){throw new db[(_0x3212('0xda'))][(_0x3212('0xdb'))](_0x3212('0xdc'));}_0x4e427b=_[_0x3212('0xdd')](_['keys'](_0x1c628b),[_0x3212('0xa5'),_0x3212('0xa6'),'CompanyId',_0x3212('0xa9')]);if(_0x5044dd[_0x3212('0x69')]['id']){delete _0x5044dd[_0x3212('0x69')]['id'];}if(_[_0x3212('0x91')](_0x5044dd[_0x3212('0x69')][_0x3212('0xa2')])){throw _0x3551bc['status'](0x1f4)[_0x3212('0x37')](new db['Sequelize'][(_0x3212('0xdb'))](_0x3212('0xde')));}if(_[_0x3212('0x91')](_0x5044dd['body'][_0x3212('0x69')])||_0x5044dd[_0x3212('0x69')][_0x3212('0x69')]===''){throw _0x3551bc[_0x3212('0x29')](0x1f4)[_0x3212('0x37')](new db[(_0x3212('0xda'))][(_0x3212('0xdb'))](_0x3212('0xdf')));}if(_[_0x3212('0x91')](_0x5044dd['body'][_0x3212('0xe0')])){throw _0x3551bc[_0x3212('0x29')](0x1f4)[_0x3212('0x37')](new db[(_0x3212('0xda'))][(_0x3212('0xdb'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e427b));}if(!_['includes'](_0x4e427b,_0x5044dd[_0x3212('0x69')]['mapKeyOffline'])){throw _0x3551bc[_0x3212('0x29')](0x1f4)['send'](new db[(_0x3212('0xda'))][(_0x3212('0xdb'))](_0x3212('0xe1')+_0x4e427b));}_0x3794aa[_0x5044dd['body'][_0x3212('0xe0')]]=_0x5044dd[_0x3212('0x69')]['from'];})['then'](function(){return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x5044dd[_0x3212('0x75')]['id']},'include':[{'model':db['CmList'],'as':_0x3212('0xad')},{'model':db['MailAccount'],'as':_0x3212('0xe2')}]});})['then'](handleEntityNotFound(_0x3551bc,null))['then'](function(_0x236981){if(_0x236981&&_0x236981[_0x3212('0xad')]){_0x114525=_0x236981;var _0x1ae319=_[_0x3212('0x16')](_0x5044dd[_0x3212('0x69')],{'firstName':_0x5044dd[_0x3212('0x69')]['from'],'phone':_0x5044dd[_0x3212('0x69')][_0x3212('0xa2')],'ListId':_0x236981['ListId']});_0x1ae319[_0x5044dd[_0x3212('0x69')][_0x3212('0xe0')]]=_0x5044dd[_0x3212('0x69')][_0x3212('0xa2')];return db[_0x3212('0xae')][_0x3212('0xe3')]({'where':_0x3794aa,'defaults':_0x1ae319});}})[_0x3212('0xe4')](function(_0xd5ed8a){if(_0xd5ed8a){_0x499fb0=_0xd5ed8a;var _0x57b8b6=fs[_0x3212('0xe5')](path['join'](config['root'],_0x3212('0xe6')),_0x3212('0xe7'));var _0x47ab77=ejs['render'](_0x57b8b6,{'body':_[_0x3212('0xe8')](_0x5044dd[_0x3212('0x69')]['body']),'bodyTitle':_0x114525[_0x3212('0xe9')]});return db[_0x3212('0xea')][_0x3212('0x68')]({'body':_0x47ab77,'plainBody':htmlToText[_0x3212('0xeb')](_0x47ab77),'ContactId':_0xd5ed8a['id'],'ChatWebsiteId':_0x114525['id']});}})['then'](function(_0x22c557){_0x54e195=_0x22c557;if(_0x22c635[_0x3212('0x7a')]){var _0x55621c=_0x22c635['map'](function(_0x452503){return{'name':_0x452503[_0x3212('0xec')],'basename':_0x452503[_0x3212('0x84')],'type':_0x452503[_0x3212('0xed')],'ChatOfflineMessageId':_0x22c557['id']};});_0x455d2d=_0x55621c[_0x3212('0x4f')](_0x13f591=>{var _0x52a99e={'filename':_0x13f591['name'],'path':path[_0x3212('0x8b')](config['root'],'server','files','attachments',_0x3212('0xee'),_0x13f591[_0x3212('0xef')])};return _0x52a99e;});if(!_0x114525[_0x3212('0xf0')]){return db[_0x3212('0xf1')]['transaction'](function(_0x409508){return db[_0x3212('0xf2')][_0x3212('0xf3')](_0x55621c,{'transaction':_0x409508});});}}})[_0x3212('0x1e')](function(){if(_0x54e195){_0x2ac9a0=_0x54e195;return db[_0x3212('0xe2')][_0x3212('0xf4')]({'where':{'service':!![]},'include':[{'model':db[_0x3212('0xf5')],'as':_0x3212('0xf6'),'raw':!![],'include':[{'model':db[_0x3212('0xf7')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x184e57){if(_0x184e57&&_0x184e57[_0x3212('0xf6')]&&_0x114525[_0x3212('0xf8')]&&_0x114525[_0x3212('0xf9')]){var _0x282bcf=_0x184e57[_0x3212('0xfa')]();return respondWithRpcPromise(_0x3212('0xfb'),'sendMail',{'account':_0x282bcf,'message':{'from':util[_0x3212('0x44')](_0x3212('0xfc'),_0x184e57['name'],_0x184e57[_0x3212('0xfd')]||_0x184e57[_0x3212('0xf6')][_0x3212('0x6e')]),'to':_0x114525[_0x3212('0xf9')],'subject':_0x114525['offlineMessageSubject'],'html':_0x2ac9a0[_0x3212('0x69')],'attachments':_0x455d2d}},client9003)[_0x3212('0x1e')](function(){return _0x2ac9a0;})[_0x3212('0x27')](function(_0x562e85){logger[_0x3212('0x23')](_0x562e85);});}})[_0x3212('0x1e')](function(){if(_0x114525&&_0x114525['openNewInteraction']&&_0x114525[_0x3212('0xfe')]){var _0x14fcf7=[];if(_0x22c635[_0x3212('0x7a')]){_0x14fcf7=_0x22c635['map'](function(_0x29b1ab){return{'name':_0x29b1ab[_0x3212('0xec')],'basename':_0x29b1ab[_0x3212('0x84')],'type':_0x29b1ab[_0x3212('0xed')],'ChatOfflineMessageId':_0x54e195['id']};});}var _0x51e780;if(!_[_0x3212('0x91')](_0x114525[_0x3212('0xff')])){var _0x528e3e=_['map'](_0x5044dd[_0x3212('0x69')],function(_0x44988f){return _0x44988f;});var _0x439337=_[_0x3212('0x100')](_0x528e3e)[0x0];var _0x50b201=_[_0x3212('0x101')](_0x439337,function(_0x14c9af){return _0x14c9af;});_0x51e780=_0x50b201[0x1][_0x114525[_0x3212('0xff')]];}var _0x50f128={'from':_0x499fb0[_0x3212('0xfd')],'firstName':_0x499fb0[_0x3212('0x3f')],'lastName':_0x499fb0[_0x3212('0x40')],'mapKey':_0x3212('0xfd'),'message':{'from':_0x499fb0[_0x3212('0xfd')],'to':_0x114525[_0x3212('0xe2')][_0x3212('0xfd')],'cc':'','subject':_['isNil'](_0x51e780)?_0x114525[_0x3212('0x102')]:_0x51e780,'messageId':'','sentAt':new Date(),'attach':_0x14fcf7[_0x3212('0x7a')],'attachments':_0x14fcf7,'originChannel':_0x3212('0x103'),'ChatWebsiteId':_0x114525['id'],'ChatOfflineMessageId':_0x2ac9a0['id'],'originTo':_0x114525[_0x3212('0xe2')]['email']},'body':_0x2ac9a0['body']};var _0x2bedb4={'account':{'id':_0x114525[_0x3212('0xfe')]},'body':_0x50f128,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0x3212('0x104'),_0x2bedb4,client9001)[_0x3212('0x1e')](function(){return _0x2ac9a0;})[_0x3212('0x27')](function(_0x52c52a){logger[_0x3212('0x23')](_0x52c52a);});}return;})[_0x3212('0x1e')](function(){if(_0x2ac9a0){return _0x2ac9a0;}})['then'](respondWithResult(_0x3551bc,null))[_0x3212('0x27')](function(){for(var _0x116961 of _0x22c635){var _0x3e3ab7=path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x105'),_0x3212('0xd9'),_0x3212('0x106'),'offline-chat',_0x116961['filename']);fs_extra[_0x3212('0x107')](_0x3e3ab7)['catch'](function(_0x4e242f){logger[_0x3212('0x23')](_0x3212('0x108'),_0x3e3ab7,_0x4e242f);});}});};exports[_0x3212('0x109')]=function(_0x58b237,_0x234330){return db[_0x3212('0xbe')]['find']({'where':{'id':_0x58b237[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x234330,null))[_0x3212('0x1e')](function(_0x5cba55){if(_0x5cba55){return _0x5cba55[_0x3212('0x109')](_0x58b237['body'][_0x3212('0x7e')],_[_0x3212('0x10a')](_0x58b237[_0x3212('0x69')],[_0x3212('0x7e'),'id'])||{});}})[_0x3212('0x1e')](respondWithResult(_0x234330,null))['catch'](handleError(_0x234330,null));};exports[_0x3212('0x10b')]=function(_0x3c0359,_0x23e662){var _0x134dbc={'raw':![],'where':{}};var _0x2e9a0f={};var _0x1c0adc={'count':0x0,'rows':[]};return db[_0x3212('0x60')][_0x3212('0xf4')]({'where':{'id':_0x3c0359[_0x3212('0x75')]['id']}})['then'](handleEntityNotFound(_0x23e662,null))[_0x3212('0x1e')](function(_0x572101){if(_0x572101){_0x2e9a0f[_0x3212('0x48')]=_[_0x3212('0x53')](db[_0x3212('0xbe')][_0x3212('0x50')]);_0x2e9a0f['query']=_[_0x3212('0x53')](_0x3c0359[_0x3212('0x52')]);_0x2e9a0f['filters']=_['intersection'](_0x2e9a0f[_0x3212('0x48')],_0x2e9a0f[_0x3212('0x52')]);_0x134dbc['attributes']=_[_0x3212('0x66')](_0x2e9a0f[_0x3212('0x48')],qs['fields'](_0x3c0359[_0x3212('0x52')][_0x3212('0x55')]));_0x134dbc[_0x3212('0x54')]=_0x134dbc[_0x3212('0x54')][_0x3212('0x7a')]?_0x134dbc[_0x3212('0x54')]:_0x2e9a0f['model'];if(!_0x3c0359['query'][_0x3212('0x56')](_0x3212('0x57'))){_0x134dbc[_0x3212('0x2d')]=qs['limit'](_0x3c0359[_0x3212('0x52')][_0x3212('0x2d')]);_0x134dbc[_0x3212('0x2b')]=qs['offset'](_0x3c0359[_0x3212('0x52')][_0x3212('0x2b')]);}_0x134dbc['order']=qs[_0x3212('0x59')](_0x3c0359[_0x3212('0x52')]['sort']);_0x134dbc['where']=qs[_0x3212('0x5b')](_['pick'](_0x3c0359[_0x3212('0x52')],_0x2e9a0f['filters']));_0x134dbc['where'][_0x3212('0x77')]=_0x572101['id'];if(_0x3c0359['query'][_0x3212('0x5c')]){_0x134dbc[_0x3212('0x5a')]=_[_0x3212('0x5d')](_0x134dbc['where'],{'$or':_[_0x3212('0x4f')](_0x134dbc['attributes'],function(_0x3348ba){var _0x513862={};_0x513862[_0x3348ba]={'$like':'%'+_0x3c0359[_0x3212('0x52')][_0x3212('0x5c')]+'%'};return _0x513862;})});}_0x134dbc=_[_0x3212('0x5d')]({},_0x134dbc,_0x3c0359[_0x3212('0x5f')]);return db[_0x3212('0xbe')][_0x3212('0x2e')]({'where':_0x134dbc[_0x3212('0x5a')]})[_0x3212('0x1e')](function(_0x481352){_0x1c0adc['count']=_0x481352;if(_0x3c0359[_0x3212('0x52')][_0x3212('0x61')]){_0x134dbc[_0x3212('0x62')]=[{'model':db[_0x3212('0xae')],'as':_0x3212('0x10c'),'required':![]},{'model':db[_0x3212('0xce')],'as':_0x3212('0x10d'),'attributes':[_0x3212('0x36'),'fullname',_0x3212('0x10e')],'required':![]},{'model':db[_0x3212('0x10f')],'as':_0x3212('0x110'),'attributes':['id',_0x3212('0x36'),_0x3212('0x111')],'where':_0x3c0359['query'][_0x3212('0x112')]?{'id':_0x3c0359[_0x3212('0x52')][_0x3212('0x112')]}:undefined,'required':_0x3c0359[_0x3212('0x52')]['tag']?!![]:![]}];}return db['ChatInteraction'][_0x3212('0x63')](_0x134dbc);})[_0x3212('0x1e')](function(_0x1b2e77){_0x1c0adc[_0x3212('0x7c')]=_0x1b2e77;return _0x1c0adc;});}})[_0x3212('0x1e')](respondWithFilteredResult(_0x23e662,_0x134dbc))[_0x3212('0x27')](handleError(_0x23e662,null));};exports[_0x3212('0x113')]=function(_0x4f356c,_0xa129d1){var _0x563b6a=0x0;var _0x1fb2d2=0x0;var _0x5845c6=![];var _0x163030;var _0xf24677;return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x4f356c[_0x3212('0x75')]['id']},'include':[{'model':db[_0x3212('0x9c')],'as':_0x3212('0x9c'),'include':[{'model':db[_0x3212('0x9c')],'as':_0x3212('0xb0'),'attributes':['id',_0x3212('0xb1')]}]}]})[_0x3212('0x1e')](handleEntityNotFound(_0xa129d1,null))[_0x3212('0x1e')](function(_0xcdb3a6){if(_0xcdb3a6){_0x163030=_0xcdb3a6;return _0xcdb3a6[_0x3212('0x114')]({'raw':!![]});}})[_0x3212('0x1e')](function(_0x2c0ae1){if(_0x163030){if(_0x2c0ae1){_0xf24677=_0x2c0ae1;}}return require(_0x3212('0x8e'))['getLicense']();})['then'](function(_0x11a5d6){if(_0x11a5d6){_0x1fb2d2=_0x11a5d6[_0x3212('0x115')];_0x5845c6=_0x11a5d6[_0x3212('0x90')];}})[_0x3212('0x1e')](function(){return db[_0x3212('0xbe')][_0x3212('0x2e')]({'where':{'closed':![]}});})['then'](function(_0x5a2155){_0x563b6a=_0x5a2155;if(_0x1fb2d2&&_0x5a2155>_0x1fb2d2){return db[_0x3212('0x116')]['findOne']({'where':{'id':0x1}})[_0x3212('0x1e')](function(_0x159c64){if(_0x159c64){_0x159c64[_0x3212('0x117')]('chatLicenseExceeded');}});}})[_0x3212('0x1e')](function(){var _0x169102=_0x163030['Interval'];var _0x110441=_0x163030[_0x3212('0x9e')]||undefined;return _0x169102?_0x169102[_0x3212('0x9f')](_0x110441):!![];})[_0x3212('0x1e')](function(_0x2acbd9){var _0x29335d=fs[_0x3212('0xe5')](path[_0x3212('0x8b')](config[_0x3212('0x94')],_0x3212('0x118')),_0x3212('0xe7'));var _0xf36a6f=_0x3212('0x119');var _0x2f4434=![];var _0x522927,_0x5575f2;if(_0x4f356c[_0x3212('0xbb')][_0x3212('0x42')]){_0x522927=new URL(_0x4f356c['headers'][_0x3212('0x42')])[_0x3212('0x11a')];}else if(_0x4f356c[_0x3212('0xbb')][_0x3212('0x11a')]){_0x522927=new URL(_0x4f356c['headers']['origin'])[_0x3212('0x11a')];}else{_0x522927='http://localhost:9000';}_0x5575f2=typeof _0x163030['address'][_0x3212('0x3e')](',')[_0x3212('0x67')](function(_0x1ff53b){return wildcardUtils[_0x3212('0x11b')](_0x1ff53b,_0x522927);})!=='undefined';var _0x48706f={'chatVersion':_0xf36a6f,'chatWebsiteAddressOrigin':_0x5575f2?_0x522927:_0x163030['address'],'remote':_0x163030['remote'],'query':querystring['stringify'](_[_0x3212('0x5d')](_0x163030[_0x3212('0x31')]({'plain':!![]}),{'customerIp':_0x4f356c[_0x3212('0xbb')][_0x3212('0x3c')]||_0x4f356c['headers'][_0x3212('0x11c')]||_0x4f356c[_0x3212('0x11d')][_0x3212('0x11e')]||_0x4f356c['ip'],'referer':_0x4f356c[_0x3212('0xbb')][_0x3212('0x42')],'openedInteractions':_0x563b6a,'maxInteractions':_0x1fb2d2,'virtual':_0x5845c6[_0x3212('0x115')],'online':_0x2acbd9,'custom':_0x5845c6,'address':_0x5575f2?_0x522927:null}))[_0x3212('0x11f')](/'/g,'\x5c\x27')};_0xa129d1[_0x3212('0x37')](ejs[_0x3212('0x120')](Mustache['render'](_0x29335d,_0x48706f),{'proactiveActions':_0xf24677,'alignment':_0x163030[_0x3212('0x121')],'verticalAlignment':_0x163030[_0x3212('0x122')],'div_color':_0x163030[_0x3212('0x111')],'labelText':_0x163030[_0x3212('0x123')],'text_color':_0x163030[_0x3212('0x124')],'text_button_color':_0x163030['textButtonColor'],'button_color':_0x163030[_0x3212('0x125')],'background_color':_0x163030[_0x3212('0x126')],'hideWhenOffline':_0x163030[_0x3212('0x127')],'intervalId':_0x163030[_0x3212('0x128')],'isDevelopment':_0x2f4434,'chatVersion':_0xf36a6f}));})[_0x3212('0x27')](handleError(_0xa129d1,null));};exports['addApplications']=function(_0x544b12,_0x2f043f){var _0x884c93=_0x544b12[_0x3212('0x75')]['id'];var _0x100d6c=_0x544b12[_0x3212('0x69')];var _0x370293=0xc8;var _0x14e5cb=null;return db[_0x3212('0xf1')][_0x3212('0x129')]({'isolationLevel':db[_0x3212('0xf1')][_0x3212('0x12a')][_0x3212('0x12b')][_0x3212('0x12c')]},function(_0x7def32){return db[_0x3212('0x60')][_0x3212('0xf4')]({'where':{'id':_0x884c93},'transaction':_0x7def32})[_0x3212('0x1e')](function(_0x3da674){if(_0x3da674){return db['ChatApplication'][_0x3212('0x34')]({'where':{'ChatWebsiteId':_0x884c93},'transaction':_0x7def32})[_0x3212('0x1e')](function(){var _0x239dd3=_[_0x3212('0x4f')](_0x100d6c,function(_0x4327b0){_0x4327b0[_0x3212('0x77')]=_0x884c93;return _0x4327b0;});return db[_0x3212('0xaf')]['bulkCreate'](_0x239dd3,{'transaction':_0x7def32});});}else{_0x370293=0x194;_0x14e5cb=[];}});})['then'](function(){if(_0x370293!==0x194){return db[_0x3212('0xaf')][_0x3212('0x12d')]({'where':{'ChatWebsiteId':_0x884c93},'order':_0x3212('0xb6')})[_0x3212('0x1e')](function(_0xdea68e){_0x14e5cb=_0xdea68e;});}})[_0x3212('0x27')](function(_0x1af398){_0x370293=0x1f4;logger[_0x3212('0x23')](_0x1af398[_0x3212('0x12e')]);if(_0x1af398[_0x3212('0x36')]){delete _0x1af398[_0x3212('0x36')];}_0x14e5cb=_0x1af398;})[_0x3212('0x12f')](function(){if(_0x14e5cb===null){_0x2f043f['sendStatus'](_0x370293);}else{if(_0x370293===0x1f4){_0x2f043f[_0x3212('0x29')](_0x370293)[_0x3212('0x37')](_0x14e5cb);}else{_0x2f043f['status'](_0x370293)[_0x3212('0x2a')](_0x14e5cb);}}});};exports['getApplications']=function(_0xa585b5,_0x57efa5){var _0x5caf79={};var _0x416d7c={};var _0xd840aa;var _0x3f5771;return db[_0x3212('0x60')][_0x3212('0xf4')]({'where':{'id':_0xa585b5[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x57efa5,null))['then'](function(_0xb75803){if(_0xb75803){_0xd840aa=_0xb75803;_0x416d7c[_0x3212('0x48')]=_[_0x3212('0x53')](db[_0x3212('0xaf')][_0x3212('0x50')]);_0x416d7c[_0x3212('0x52')]=_['keys'](_0xa585b5[_0x3212('0x52')]);_0x416d7c[_0x3212('0x5b')]=_['intersection'](_0x416d7c[_0x3212('0x48')],_0x416d7c[_0x3212('0x52')]);_0x5caf79[_0x3212('0x54')]=_[_0x3212('0x66')](_0x416d7c['model'],qs[_0x3212('0x55')](_0xa585b5['query'][_0x3212('0x55')]));_0x5caf79['attributes']=_0x5caf79['attributes'][_0x3212('0x7a')]?_0x5caf79[_0x3212('0x54')]:_0x416d7c['model'];_0x5caf79[_0x3212('0x58')]=qs['sort'](_0xa585b5[_0x3212('0x52')][_0x3212('0x59')]);_0x5caf79['where']=qs[_0x3212('0x5b')](_[_0x3212('0x7b')](_0xa585b5['query'],_0x416d7c[_0x3212('0x5b')]));if(_0xa585b5[_0x3212('0x52')][_0x3212('0x5c')]){_0x5caf79[_0x3212('0x5a')]=_[_0x3212('0x5d')](_0x5caf79[_0x3212('0x5a')],{'$or':_['map'](_0x5caf79[_0x3212('0x54')],function(_0x592ffc){var _0x4b4e6b={};_0x4b4e6b[_0x592ffc]={'$like':'%'+_0xa585b5[_0x3212('0x52')][_0x3212('0x5c')]+'%'};return _0x4b4e6b;})});}_0x5caf79=_[_0x3212('0x5d')]({},_0x5caf79,_0xa585b5[_0x3212('0x5f')]);return _0xd840aa[_0x3212('0x130')](_0x5caf79);}})[_0x3212('0x1e')](function(_0x19fd6a){if(_0x19fd6a){_0x3f5771=_0x19fd6a[_0x3212('0x7a')];if(!_0xa585b5['query'][_0x3212('0x56')](_0x3212('0x57'))){_0x5caf79['limit']=qs[_0x3212('0x2d')](_0xa585b5[_0x3212('0x52')][_0x3212('0x2d')]);_0x5caf79[_0x3212('0x2b')]=qs[_0x3212('0x2b')](_0xa585b5['query'][_0x3212('0x2b')]);}return _0xd840aa[_0x3212('0x130')](_0x5caf79);}})[_0x3212('0x1e')](function(_0x2dedd9){if(_0x2dedd9){return _0x2dedd9?{'count':_0x3f5771,'rows':_0x2dedd9}:null;}})[_0x3212('0x1e')](respondWithResult(_0x57efa5,null))[_0x3212('0x27')](handleError(_0x57efa5,null));};exports[_0x3212('0x131')]=function(_0x56fe82,_0x787711){return db[_0x3212('0x132')]['find']({'where':{'id':_0x56fe82[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x787711,null))['then'](function(_0x4164ae){if(_0x4164ae){return _0x4164ae['addProactiveActions'](_0x56fe82[_0x3212('0x69')][_0x3212('0x7e')],_[_0x3212('0x10a')](_0x56fe82[_0x3212('0x69')],[_0x3212('0x7e'),'id'])||{});}})[_0x3212('0x1e')](respondWithResult(_0x787711,null))[_0x3212('0x27')](handleError(_0x787711,null));};exports[_0x3212('0x114')]=function(_0x348509,_0x5391c8){var _0x3d287c={};var _0x45cd82={};var _0x3c64a1;var _0x43c895;return db[_0x3212('0x60')][_0x3212('0xf4')]({'where':{'id':_0x348509['params']['id']}})['then'](handleEntityNotFound(_0x5391c8,null))[_0x3212('0x1e')](function(_0xddb1b6){if(_0xddb1b6){_0x3c64a1=_0xddb1b6;_0x45cd82[_0x3212('0x48')]=_[_0x3212('0x53')](db[_0x3212('0x133')][_0x3212('0x50')]);_0x45cd82[_0x3212('0x52')]=_['keys'](_0x348509['query']);_0x45cd82[_0x3212('0x5b')]=_['intersection'](_0x45cd82[_0x3212('0x48')],_0x45cd82['query']);_0x3d287c[_0x3212('0x54')]=_[_0x3212('0x66')](_0x45cd82[_0x3212('0x48')],qs['fields'](_0x348509[_0x3212('0x52')][_0x3212('0x55')]));_0x3d287c[_0x3212('0x54')]=_0x3d287c[_0x3212('0x54')]['length']?_0x3d287c['attributes']:_0x45cd82[_0x3212('0x48')];_0x3d287c['order']=qs['sort'](_0x348509[_0x3212('0x52')]['sort']);_0x3d287c[_0x3212('0x5a')]=qs[_0x3212('0x5b')](_[_0x3212('0x7b')](_0x348509[_0x3212('0x52')],_0x45cd82[_0x3212('0x5b')]));if(_0x348509[_0x3212('0x52')][_0x3212('0x5c')]){_0x3d287c[_0x3212('0x5a')]=_[_0x3212('0x5d')](_0x3d287c[_0x3212('0x5a')],{'$or':_[_0x3212('0x4f')](_0x3d287c[_0x3212('0x54')],function(_0x1bc301){var _0x44d8b0={};_0x44d8b0[_0x1bc301]={'$like':'%'+_0x348509[_0x3212('0x52')][_0x3212('0x5c')]+'%'};return _0x44d8b0;})});}_0x3d287c=_[_0x3212('0x5d')]({},_0x3d287c,_0x348509['options']);return _0x3c64a1[_0x3212('0x114')](_0x3d287c);}})['then'](function(_0x26f991){if(_0x26f991){_0x43c895=_0x26f991[_0x3212('0x7a')];if(!_0x348509['query'][_0x3212('0x56')](_0x3212('0x57'))){_0x3d287c[_0x3212('0x2d')]=qs['limit'](_0x348509[_0x3212('0x52')][_0x3212('0x2d')]);_0x3d287c['offset']=qs[_0x3212('0x2b')](_0x348509['query']['offset']);}return _0x3c64a1['getProactiveActions'](_0x3d287c);}})[_0x3212('0x1e')](function(_0x5c769f){if(_0x5c769f){return _0x5c769f?{'count':_0x43c895,'rows':_0x5c769f}:null;}})[_0x3212('0x1e')](respondWithResult(_0x5391c8,null))['catch'](handleError(_0x5391c8,null));};exports['getFields']=function(_0x2b5b0e,_0x1aa61b){var _0xcb81c7=_0x2b5b0e[_0x3212('0x52')][_0x3212('0x134')]==='false'?_0x3212('0x135'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0xcb81c7],'where':{'id':_0x2b5b0e['params']['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x1aa61b,null))['then'](function(_0x1982c7){if(_0x1982c7){var _0x49df5a=_0x1982c7[_0xcb81c7];var _0x3b88ab=_0x49df5a&&_0x49df5a[_0x3212('0x136')]?_0x49df5a['items']:[];_0x1aa61b[_0x3212('0x37')]({'fromKey':_[_0x3212('0x91')](_0x49df5a[_0x3212('0x137')])?undefined:_0x49df5a[_0x3212('0x137')],'count':_0x3b88ab[_0x3212('0x7a')],'rows':_0x3b88ab});}})[_0x3212('0x27')](handleError(_0x1aa61b,null));};exports['getOfflineMessages']=function(_0x8590d5,_0xa77e1){var _0x885068={'raw':![],'where':{}};var _0x4fedb5={};var _0x2dbb3b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3212('0xf4')]({'where':{'id':_0x8590d5[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0xa77e1,null))[_0x3212('0x1e')](function(_0x322b5e){if(_0x322b5e){_0x4fedb5[_0x3212('0x48')]=_[_0x3212('0x53')](db[_0x3212('0xea')][_0x3212('0x50')]);_0x4fedb5[_0x3212('0x52')]=_[_0x3212('0x53')](_0x8590d5[_0x3212('0x52')]);_0x4fedb5['filters']=_[_0x3212('0x66')](_0x4fedb5['model'],_0x4fedb5[_0x3212('0x52')]);_0x885068[_0x3212('0x54')]=_[_0x3212('0x66')](_0x4fedb5[_0x3212('0x48')],qs[_0x3212('0x55')](_0x8590d5['query'][_0x3212('0x55')]));_0x885068[_0x3212('0x54')]=_0x885068[_0x3212('0x54')][_0x3212('0x7a')]?_0x885068['attributes']:_0x4fedb5['model'];if(!_0x8590d5[_0x3212('0x52')][_0x3212('0x56')](_0x3212('0x57'))){_0x885068[_0x3212('0x2d')]=qs[_0x3212('0x2d')](_0x8590d5[_0x3212('0x52')][_0x3212('0x2d')]);_0x885068[_0x3212('0x2b')]=qs[_0x3212('0x2b')](_0x8590d5[_0x3212('0x52')][_0x3212('0x2b')]);}_0x885068[_0x3212('0x58')]=qs['sort'](_0x8590d5[_0x3212('0x52')][_0x3212('0x59')]);_0x885068['where']=qs[_0x3212('0x5b')](_[_0x3212('0x7b')](_0x8590d5[_0x3212('0x52')],_0x4fedb5[_0x3212('0x5b')]));_0x885068[_0x3212('0x5a')][_0x3212('0x77')]=_0x322b5e['id'];if(_0x8590d5[_0x3212('0x52')][_0x3212('0x5c')]){_0x885068[_0x3212('0x5a')]=_[_0x3212('0x5d')](_0x885068[_0x3212('0x5a')],{'$or':_[_0x3212('0x4f')](_0x885068[_0x3212('0x54')],function(_0x308a46){var _0x3a392d={};_0x3a392d[_0x308a46]={'$like':'%'+_0x8590d5['query'][_0x3212('0x5c')]+'%'};return _0x3a392d;})});}_0x885068=_[_0x3212('0x5d')]({},_0x885068,_0x8590d5[_0x3212('0x5f')]);return db[_0x3212('0xea')]['count']({'where':_0x885068['where']})['then'](function(_0x19ec90){_0x2dbb3b['count']=_0x19ec90;if(_0x8590d5['query'][_0x3212('0x61')]){_0x885068[_0x3212('0x62')]=[{'all':!![]}];}else{_0x885068['include']=[{'model':db[_0x3212('0xae')],'as':_0x3212('0x10c'),'required':![]},{'model':db[_0x3212('0xf2')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x885068);})['then'](function(_0x19bd8b){_0x2dbb3b[_0x3212('0x7c')]=_0x19bd8b;return _0x2dbb3b;});}})[_0x3212('0x1e')](respondWithFilteredResult(_0xa77e1,_0x885068))[_0x3212('0x27')](handleError(_0xa77e1,null));};exports[_0x3212('0x138')]=function(_0x141c16,_0x145dd3){return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x141c16[_0x3212('0x75')]['id']}})['then'](handleEntityNotFound(_0x145dd3,null))[_0x3212('0x1e')](function(_0x15a812){if(_0x15a812){return _0x15a812[_0x3212('0x138')](_0x141c16[_0x3212('0x69')][_0x3212('0x7e')],_[_0x3212('0x10a')](_0x141c16['body'],['ids','id'])||{})['spread'](function(_0x4e3ff3){for(var _0x5dda62=0x0;_0x5dda62<_0x141c16[_0x3212('0x69')][_0x3212('0x7e')][_0x3212('0x7a')];_0x5dda62+=0x1){socket['emit'](_0x3212('0x139'),{'UserId':Number(_0x141c16[_0x3212('0x69')]['ids'][_0x5dda62]),'ChatWebsiteId':Number(_0x141c16['params']['id'])});}return _0x4e3ff3;});}})[_0x3212('0x1e')](respondWithResult(_0x145dd3,null))['catch'](handleError(_0x145dd3,null));};exports[_0x3212('0x13a')]=function(_0x1fb016,_0x230999){return db[_0x3212('0x60')][_0x3212('0x67')]({'where':{'id':_0x1fb016[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x230999,null))[_0x3212('0x1e')](function(_0x4d21b0){if(_0x4d21b0){return _0x4d21b0[_0x3212('0x13a')](_0x1fb016['query'][_0x3212('0x7e')])['then'](function(){if(_[_0x3212('0x13b')](_0x1fb016[_0x3212('0x52')][_0x3212('0x7e')])){for(var _0xee24a7=0x0;_0xee24a7<_0x1fb016[_0x3212('0x52')][_0x3212('0x7e')][_0x3212('0x7a')];_0xee24a7+=0x1){socket[_0x3212('0x13c')](_0x3212('0x13d'),{'UserId':Number(_0x1fb016[_0x3212('0x52')][_0x3212('0x7e')][_0xee24a7]),'ChatWebsiteId':Number(_0x1fb016[_0x3212('0x75')]['id'])});}}else{socket[_0x3212('0x13c')]('userChatWebsite:remove',{'UserId':Number(_0x1fb016['query'][_0x3212('0x7e')]),'ChatWebsiteId':Number(_0x1fb016[_0x3212('0x75')]['id'])});}});}})['then'](respondWithStatusCode(_0x230999,null))[_0x3212('0x27')](handleError(_0x230999,null));};exports['getAgents']=function(_0x5e9fa9,_0x668041){var _0x262d20={};var _0x1561da={};var _0x48c23d;var _0x44cd1;return db[_0x3212('0x60')]['findOne']({'where':{'id':_0x5e9fa9[_0x3212('0x75')]['id']}})[_0x3212('0x1e')](handleEntityNotFound(_0x668041,null))[_0x3212('0x1e')](function(_0xc13e4d){if(_0xc13e4d){_0x48c23d=_0xc13e4d;_0x1561da[_0x3212('0x48')]=_[_0x3212('0x53')](db[_0x3212('0xce')]['rawAttributes']);_0x1561da[_0x3212('0x52')]=_[_0x3212('0x53')](_0x5e9fa9['query']);_0x1561da[_0x3212('0x5b')]=_['intersection'](_0x1561da[_0x3212('0x48')],_0x1561da['query']);_0x262d20[_0x3212('0x54')]=_[_0x3212('0x66')](_0x1561da['model'],qs[_0x3212('0x55')](_0x5e9fa9[_0x3212('0x52')][_0x3212('0x55')]));_0x262d20[_0x3212('0x54')]=_0x262d20[_0x3212('0x54')][_0x3212('0x7a')]?_0x262d20[_0x3212('0x54')]:_0x1561da[_0x3212('0x48')];_0x262d20[_0x3212('0x58')]=qs[_0x3212('0x59')](_0x5e9fa9[_0x3212('0x52')]['sort']);_0x262d20['where']=qs['filters'](_[_0x3212('0x7b')](_0x5e9fa9[_0x3212('0x52')],_0x1561da[_0x3212('0x5b')]));if(_0x5e9fa9[_0x3212('0x52')][_0x3212('0x5c')]){_0x262d20['where']=_[_0x3212('0x5d')](_0x262d20['where'],{'$or':_['map'](_0x262d20[_0x3212('0x54')],function(_0x38d073){var _0xafb9cc={};_0xafb9cc[_0x38d073]={'$like':'%'+_0x5e9fa9['query']['filter']+'%'};return _0xafb9cc;})});}_0x262d20=_['merge']({},_0x262d20,_0x5e9fa9['options']);return _0x48c23d['getAgents'](_0x262d20);}})['then'](function(_0x3e82ec){if(_0x3e82ec){_0x44cd1=_0x3e82ec[_0x3212('0x7a')];if(!_0x5e9fa9[_0x3212('0x52')]['hasOwnProperty'](_0x3212('0x57'))){_0x262d20[_0x3212('0x2d')]=qs[_0x3212('0x2d')](_0x5e9fa9['query'][_0x3212('0x2d')]);_0x262d20[_0x3212('0x2b')]=qs['offset'](_0x5e9fa9[_0x3212('0x52')][_0x3212('0x2b')]);}return _0x48c23d[_0x3212('0x13e')](_0x262d20);}})[_0x3212('0x1e')](function(_0x508579){if(_0x508579){return _0x508579?{'count':_0x44cd1,'rows':_0x508579}:null;}})[_0x3212('0x1e')](respondWithResult(_0x668041,null))[_0x3212('0x27')](handleError(_0x668041,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index a8c1fc3..fb92f78 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 _0xe0c3=['events','ChatWebsite','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x35457b,_0x116ab7){var _0x4f8627=function(_0x2c68b8){while(--_0x2c68b8){_0x35457b['push'](_0x35457b['shift']());}};_0x4f8627(++_0x116ab7);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3e0c('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x3e0c('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3e0c('0x2')](0x0);var events={'afterCreate':_0x3e0c('0x3'),'afterUpdate':_0x3e0c('0x4'),'afterDestroy':_0x3e0c('0x5')};function emitEvent(_0x410ec4){return function(_0x31851c,_0x26c964,_0x1a026f){ChatWebsiteEvents['emit'](_0x410ec4+':'+_0x31851c['id'],_0x31851c);ChatWebsiteEvents['emit'](_0x410ec4,_0x31851c);_0x1a026f(null);};}for(var e in events){if(events[_0x3e0c('0x6')](e)){var event=events[e];ChatWebsite[_0x3e0c('0x7')](e,emitEvent(event));}}module[_0x3e0c('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x581a=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x34a49c,_0x311bf9){var _0x178e9d=function(_0x5dd714){while(--_0x5dd714){_0x34a49c['push'](_0x34a49c['shift']());}};_0x178e9d(++_0x311bf9);}(_0x581a,0x127));var _0xa581=function(_0x5c7e81,_0x10384d){_0x5c7e81=_0x5c7e81-0x0;var _0xf51111=_0x581a[_0x5c7e81];return _0xf51111;};'use strict';var EventEmitter=require(_0xa581('0x0'));var ChatWebsite=require(_0xa581('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa581('0x2')](0x0);var events={'afterCreate':_0xa581('0x3'),'afterUpdate':_0xa581('0x4'),'afterDestroy':_0xa581('0x5')};function emitEvent(_0x3f5c21){return function(_0x4e64cc,_0x4e65d7,_0x198faf){ChatWebsiteEvents['emit'](_0x3f5c21+':'+_0x4e64cc['id'],_0x4e64cc);ChatWebsiteEvents[_0xa581('0x6')](_0x3f5c21,_0x4e64cc);_0x198faf(null);};}for(var e in events){if(events[_0xa581('0x7')](e)){var event=events[e];ChatWebsite[_0xa581('0x8')](e,emitEvent(event));}}module[_0xa581('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 8c24f2d..18c372c 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 _0x2b55=['api','moment','bluebird','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x4c6081,_0x4821a7){var _0x2933be=function(_0x78f29){while(--_0x78f29){_0x4c6081['push'](_0x4c6081['shift']());}};_0x2933be(++_0x4821a7);}(_0x2b55,0x147));var _0x52b5=function(_0x8a4931,_0x5a7a4a){_0x8a4931=_0x8a4931-0x0;var _0x113b99=_0x2b55[_0x8a4931];return _0x113b99;};'use strict';var _=require(_0x52b5('0x0'));var util=require(_0x52b5('0x1'));var logger=require(_0x52b5('0x2'))(_0x52b5('0x3'));var moment=require(_0x52b5('0x4'));var BPromise=require(_0x52b5('0x5'));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(_0x52b5('0x6'));module[_0x52b5('0x7')]=function(_0x4a721d,_0xde1243){return _0x4a721d[_0x52b5('0x8')](_0x52b5('0x9'),attributes,{'tableName':_0x52b5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x84a3=['api','moment','bluebird','path','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util'];(function(_0x59bf3e,_0x3a8e33){var _0x4a2340=function(_0x570a75){while(--_0x570a75){_0x59bf3e['push'](_0x59bf3e['shift']());}};_0x4a2340(++_0x3a8e33);}(_0x84a3,0x1a0));var _0x384a=function(_0x35ea7c,_0x4aa05d){_0x35ea7c=_0x35ea7c-0x0;var _0x56bdfc=_0x84a3[_0x35ea7c];return _0x56bdfc;};'use strict';var _=require(_0x384a('0x0'));var util=require(_0x384a('0x1'));var logger=require('../../config/logger')(_0x384a('0x2'));var moment=require(_0x384a('0x3'));var BPromise=require(_0x384a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x384a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x384a('0x6'));module[_0x384a('0x7')]=function(_0x3a36f4,_0x314d52){return _0x3a36f4[_0x384a('0x8')](_0x384a('0x9'),attributes,{'tableName':_0x384a('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 bf89590..8d5fe54 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 _0xfb7c=['rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3d34da,_0x3abcc1){var _0xcf6af8=function(_0x300a53){while(--_0x300a53){_0x3d34da['push'](_0x3d34da['shift']());}};_0xcf6af8(++_0x3abcc1);}(_0xfb7c,0x1d4));var _0xcfb7=function(_0x6f4696,_0x45e8da){_0x6f4696=_0x6f4696-0x0;var _0x3e9056=_0xfb7c[_0x6f4696];return _0x3e9056;};'use strict';var _=require(_0xcfb7('0x0'));var util=require(_0xcfb7('0x1'));var moment=require(_0xcfb7('0x2'));var BPromise=require(_0xcfb7('0x3'));var rs=require(_0xcfb7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfb7('0x5'))['db'];var utils=require(_0xcfb7('0x6'));var logger=require(_0xcfb7('0x7'))(_0xcfb7('0x8'));var config=require('../../config/environment');var jayson=require(_0xcfb7('0x9'));var client=jayson[_0xcfb7('0xa')][_0xcfb7('0xb')]({'port':0x232a});config[_0xcfb7('0xc')]=_[_0xcfb7('0xd')](config[_0xcfb7('0xc')],{'host':_0xcfb7('0xe'),'port':0x18eb});var socket=require(_0xcfb7('0xf'))(new Redis(config[_0xcfb7('0xc')]));require(_0xcfb7('0x10'))[_0xcfb7('0x11')](socket);function respondWithRpcPromise(_0x3b6390,_0x662830,_0x59d1ed){return new BPromise(function(_0x26c40c,_0x57a5ff){return client['request'](_0x3b6390,_0x59d1ed)[_0xcfb7('0x12')](function(_0x4b9f4c){logger[_0xcfb7('0x13')](_0xcfb7('0x14'),_0x662830,_0xcfb7('0x15'));logger[_0xcfb7('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x662830,_0xcfb7('0x15'),JSON[_0xcfb7('0x17')](_0x4b9f4c));if(_0x4b9f4c[_0xcfb7('0x18')]){if(_0x4b9f4c[_0xcfb7('0x18')][_0xcfb7('0x19')]===0x1f4){logger['error'](_0xcfb7('0x14'),_0x662830,_0x4b9f4c[_0xcfb7('0x18')][_0xcfb7('0x1a')]);return _0x57a5ff(_0x4b9f4c[_0xcfb7('0x18')]['message']);}logger[_0xcfb7('0x18')](_0xcfb7('0x14'),_0x662830,_0x4b9f4c['error'][_0xcfb7('0x1a')]);return _0x26c40c(_0x4b9f4c[_0xcfb7('0x18')]['message']);}else{logger[_0xcfb7('0x13')](_0xcfb7('0x14'),_0x662830,_0xcfb7('0x15'));_0x26c40c(_0x4b9f4c[_0xcfb7('0x1b')]['message']);}})['catch'](function(_0x56d387){logger[_0xcfb7('0x18')](_0xcfb7('0x14'),_0x662830,_0x56d387);_0x57a5ff(_0x56d387);});});}
\ No newline at end of file
+var _0xd105=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xd105,0x194));var _0x5d10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd105[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5d10('0x0'));var util=require(_0x5d10('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5d10('0x2'));var fs=require('fs');var Redis=require(_0x5d10('0x3'));var db=require(_0x5d10('0x4'))['db'];var utils=require(_0x5d10('0x5'));var logger=require(_0x5d10('0x6'))(_0x5d10('0x7'));var config=require('../../config/environment');var jayson=require(_0x5d10('0x8'));var client=jayson['client'][_0x5d10('0x9')]({'port':0x232a});config['redis']=_[_0x5d10('0xa')](config[_0x5d10('0xb')],{'host':_0x5d10('0xc'),'port':0x18eb});var socket=require(_0x5d10('0xd'))(new Redis(config[_0x5d10('0xb')]));require(_0x5d10('0xe'))['register'](socket);function respondWithRpcPromise(_0x3c328f,_0x1b7775,_0x131652){return new BPromise(function(_0x3fe30b,_0x51511d){return client[_0x5d10('0xf')](_0x3c328f,_0x131652)['then'](function(_0x5710c5){logger['info'](_0x5d10('0x10'),_0x1b7775,_0x5d10('0x11'));logger[_0x5d10('0x12')](_0x5d10('0x13'),_0x1b7775,'request\x20sent',JSON[_0x5d10('0x14')](_0x5710c5));if(_0x5710c5[_0x5d10('0x15')]){if(_0x5710c5['error'][_0x5d10('0x16')]===0x1f4){logger['error'](_0x5d10('0x10'),_0x1b7775,_0x5710c5[_0x5d10('0x15')][_0x5d10('0x17')]);return _0x51511d(_0x5710c5['error'][_0x5d10('0x17')]);}logger['error'](_0x5d10('0x10'),_0x1b7775,_0x5710c5[_0x5d10('0x15')][_0x5d10('0x17')]);return _0x3fe30b(_0x5710c5['error'][_0x5d10('0x17')]);}else{logger[_0x5d10('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x1b7775,_0x5d10('0x11'));_0x3fe30b(_0x5710c5[_0x5d10('0x19')]['message']);}})[_0x5d10('0x1a')](function(_0x31b5b7){logger['error'](_0x5d10('0x10'),_0x1b7775,_0x31b5b7);_0x51511d(_0x31b5b7);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 6591f29..2b3969d 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 _0xb9f3=['./chatWebsite.events','save','emit','removeListener','register','length','chatWebsite:'];(function(_0x1a6629,_0x1ab63d){var _0x1eb452=function(_0x46e91c){while(--_0x46e91c){_0x1a6629['push'](_0x1a6629['shift']());}};_0x1eb452(++_0x1ab63d);}(_0xb9f3,0x150));var _0x3b9f=function(_0x223134,_0x323bd3){_0x223134=_0x223134-0x0;var _0x3bcc90=_0xb9f3[_0x223134];return _0x3bcc90;};'use strict';var ChatWebsiteEvents=require(_0x3b9f('0x0'));var events=[_0x3b9f('0x1'),'remove','update'];function createListener(_0x1a29b5,_0x244c0e){return function(_0x106ce8){_0x244c0e[_0x3b9f('0x2')](_0x1a29b5,_0x106ce8);};}function removeListener(_0x532f88,_0x54f159){return function(){ChatWebsiteEvents[_0x3b9f('0x3')](_0x532f88,_0x54f159);};}exports[_0x3b9f('0x4')]=function(_0x3c4882){for(var _0x15ba3a=0x0,_0x3c87e1=events[_0x3b9f('0x5')];_0x15ba3a<_0x3c87e1;_0x15ba3a++){var _0x280ba1=events[_0x15ba3a];var _0x3c5bdf=createListener(_0x3b9f('0x6')+_0x280ba1,_0x3c4882);ChatWebsiteEvents['on'](_0x280ba1,_0x3c5bdf);}};
\ No newline at end of file
+var _0xa686=['register','chatWebsite:','./chatWebsite.events','save','remove','update','removeListener'];(function(_0x3214c7,_0x47e426){var _0x206cb4=function(_0xb9b6be){while(--_0xb9b6be){_0x3214c7['push'](_0x3214c7['shift']());}};_0x206cb4(++_0x47e426);}(_0xa686,0xfe));var _0x6a68=function(_0x534602,_0x548725){_0x534602=_0x534602-0x0;var _0xa1e3f2=_0xa686[_0x534602];return _0xa1e3f2;};'use strict';var ChatWebsiteEvents=require(_0x6a68('0x0'));var events=[_0x6a68('0x1'),_0x6a68('0x2'),_0x6a68('0x3')];function createListener(_0x92f542,_0x467f6d){return function(_0x3361c1){_0x467f6d['emit'](_0x92f542,_0x3361c1);};}function removeListener(_0x46eebb,_0x4122a6){return function(){ChatWebsiteEvents[_0x6a68('0x4')](_0x46eebb,_0x4122a6);};}exports[_0x6a68('0x5')]=function(_0x2568be){for(var _0x2e4d45=0x0,_0x59b056=events['length'];_0x2e4d45<_0x59b056;_0x2e4d45++){var _0x22e3bc=events[_0x2e4d45];var _0x49821c=createListener(_0x6a68('0x6')+_0x22e3bc,_0x2568be);ChatWebsiteEvents['on'](_0x22e3bc,_0x49821c);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js
index ec82565..a72dfa7 100644
--- a/server/api/chatWebsite/helpers/wildcard-expressions.js
+++ b/server/api/chatWebsite/helpers/wildcard-expressions.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x161a=['url','URL','localhost','trim','replace','([\x5cw]+)','test','exports'];(function(_0x5d7b48,_0x1c8eaa){var _0x31bd82=function(_0x3632d5){while(--_0x3632d5){_0x5d7b48['push'](_0x5d7b48['shift']());}};_0x31bd82(++_0x1c8eaa);}(_0x161a,0x140));var _0xa161=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0x161a[_0x10d34b];return _0x92b0bf;};var escapeRegExp=require('../../../utils/misc')['escapeRegExp'];var URL=require(_0xa161('0x0'))[_0xa161('0x1')];function testWildcardValidity(_0x549285){var _0x4ca66c=!![];try{new URL(_0x549285['replace']('*',_0xa161('0x2')));}catch(_0x36340b){_0x4ca66c=![];}return _0x4ca66c&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x549285);}function testWebsiteWithWildcard(_0x551cc8,_0x7fde92){var _0x1705ab;var _0x12d54c=escapeRegExp(_0x551cc8[_0xa161('0x3')]()[_0xa161('0x4')](/\/$/,''))[_0xa161('0x4')]('\x5c*',_0xa161('0x5'));try{new URL(_0x551cc8['replace']('\x5c*',_0xa161('0x2')));_0x1705ab=new RegExp(_0x12d54c)[_0xa161('0x6')](_0x7fde92);}catch(_0x327221){_0x1705ab=![];}return _0x1705ab;}module[_0xa161('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
+var _0xedf1=['trim','([\x5cw]+)','localhost','../../../utils/misc','escapeRegExp','replace','test'];(function(_0x1e3a2e,_0x5131d0){var _0x3e6769=function(_0x3bf600){while(--_0x3bf600){_0x1e3a2e['push'](_0x1e3a2e['shift']());}};_0x3e6769(++_0x5131d0);}(_0xedf1,0xb2));var _0x1edf=function(_0xd69543,_0x5a1041){_0xd69543=_0xd69543-0x0;var _0x3588cb=_0xedf1[_0xd69543];return _0x3588cb;};var escapeRegExp=require(_0x1edf('0x0'))[_0x1edf('0x1')];var URL=require('url')['URL'];function testWildcardValidity(_0xdf58cf){var _0x462fc4=!![];try{new URL(_0xdf58cf[_0x1edf('0x2')]('*','localhost'));}catch(_0x224972){_0x462fc4=![];}return _0x462fc4&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x1edf('0x3')](_0xdf58cf);}function testWebsiteWithWildcard(_0x3a5efd,_0x5ec722){var _0x52238d;var _0x1b84af=escapeRegExp(_0x3a5efd[_0x1edf('0x4')]()[_0x1edf('0x2')](/\/$/,''))[_0x1edf('0x2')]('\x5c*',_0x1edf('0x5'));try{new URL(_0x3a5efd[_0x1edf('0x2')]('\x5c*',_0x1edf('0x6')));_0x52238d=new RegExp(_0x1b84af)[_0x1edf('0x3')](_0x5ec722);}catch(_0x30a13f){_0x52238d=![];}return _0x52238d;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 8dff054..df19ac3 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 _0xc769=['/:id/customer_avatar','single','addCustomerAvatar','/:id/system_avatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','/:id/applications','addApplications','addProactiveActions','update','/:id/dispositions','removeDispositions','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','getSystemAvatar','getInteractions','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','diskStorage','server/files/images/avatars/'];(function(_0x33c2af,_0x163198){var _0x13c04a=function(_0x4de68e){while(--_0x4de68e){_0x33c2af['push'](_0x33c2af['shift']());}};_0x13c04a(++_0x163198);}(_0xc769,0x1f4));var _0x9c76=function(_0x3c3d39,_0xa5e915){_0x3c3d39=_0x3c3d39-0x0;var _0x57015a=_0xc769[_0x3c3d39];return _0x57015a;};'use strict';var multer=require(_0x9c76('0x0'));var util=require('util');var path=require(_0x9c76('0x1'));var timeout=require(_0x9c76('0x2'));var express=require(_0x9c76('0x3'));var router=express['Router']();var fs_extra=require(_0x9c76('0x4'));var auth=require(_0x9c76('0x5'));var interaction=require(_0x9c76('0x6'));var config=require(_0x9c76('0x7'));var controller=require(_0x9c76('0x8'));router[_0x9c76('0x9')]('/',auth[_0x9c76('0xa')](),controller['index']);router['get'](_0x9c76('0xb'),auth['isAuthenticated'](),controller[_0x9c76('0xc')]);router[_0x9c76('0x9')](_0x9c76('0xd'),auth['isAuthenticated'](),controller[_0x9c76('0xe')]);router[_0x9c76('0x9')]('/:id/dispositions',auth[_0x9c76('0xa')](),controller['getDispositions']);router['get'](_0x9c76('0xf'),auth[_0x9c76('0xa')](),controller[_0x9c76('0x10')]);router[_0x9c76('0x9')](_0x9c76('0x11'),controller['getLogo']);router[_0x9c76('0x9')](_0x9c76('0x12'),controller[_0x9c76('0x13')]);router['get']('/:id/customer_avatar',controller['getCustomerAvatar']);router['get']('/:id/system_avatar',controller[_0x9c76('0x14')]);router[_0x9c76('0x9')]('/:id/interactions',auth[_0x9c76('0xa')](),controller[_0x9c76('0x15')]);router['get']('/:id/snippet',controller['getSnippet']);router['get']('/:id/applications',auth[_0x9c76('0xa')](),controller['getApplications']);router[_0x9c76('0x9')](_0x9c76('0x16'),auth[_0x9c76('0xa')](),controller[_0x9c76('0x17')]);router[_0x9c76('0x9')]('/:id/fields',controller[_0x9c76('0x18')]);router[_0x9c76('0x9')](_0x9c76('0x19'),auth['isAuthenticated'](),controller[_0x9c76('0x1a')]);router[_0x9c76('0x9')](_0x9c76('0x1b'),auth['isAuthenticated'](),controller[_0x9c76('0x1c')]);router['post']('/',auth[_0x9c76('0xa')](),controller[_0x9c76('0x1d')]);router[_0x9c76('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x9c76('0x1f')]);router[_0x9c76('0x1e')](_0x9c76('0xf'),auth[_0x9c76('0xa')](),controller[_0x9c76('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4871ba,_0x526e0d,_0x1584a0){_0x1584a0(null,path[_0x9c76('0x21')](config[_0x9c76('0x22')],_0x9c76('0x23')));},'filename':function(_0x3b1e41,_0xda22f2,_0x4fd49){_0x4fd49(null,util[_0x9c76('0x24')](_0x9c76('0x25'),Date[_0x9c76('0x26')](),_0xda22f2[_0x9c76('0x27')]));}})});router['post'](_0x9c76('0x11'),upload['single'](_0x9c76('0x28')),controller[_0x9c76('0x29')]);var upload=multer({'storage':multer[_0x9c76('0x2a')]({'destination':function(_0x52dac4,_0x21510a,_0x16fa0a){_0x16fa0a(null,path[_0x9c76('0x21')](config['root'],_0x9c76('0x2b')));},'filename':function(_0x44eb27,_0x3a2c62,_0x34c12c){_0x34c12c(null,util[_0x9c76('0x24')](_0x9c76('0x25'),Date[_0x9c76('0x26')](),_0x3a2c62[_0x9c76('0x27')]));}})});router[_0x9c76('0x1e')](_0x9c76('0x12'),upload['single'](_0x9c76('0x28')),controller['addAvatar']);var upload=multer({'storage':multer[_0x9c76('0x2a')]({'destination':function(_0x5c7fe7,_0x446257,_0x3831a5){_0x3831a5(null,path[_0x9c76('0x21')](config['root'],_0x9c76('0x2b')));},'filename':function(_0x409d12,_0x448963,_0x47ef73){_0x47ef73(null,util[_0x9c76('0x24')](_0x9c76('0x25'),Date[_0x9c76('0x26')](),_0x448963['originalname']));}})});router[_0x9c76('0x1e')](_0x9c76('0x2c'),upload[_0x9c76('0x2d')](_0x9c76('0x28')),controller[_0x9c76('0x2e')]);var upload=multer({'storage':multer[_0x9c76('0x2a')]({'destination':function(_0x565472,_0x326146,_0x25e7f8){_0x25e7f8(null,path[_0x9c76('0x21')](config[_0x9c76('0x22')],_0x9c76('0x2b')));},'filename':function(_0x2e353d,_0x2f93c2,_0x49e43a){_0x49e43a(null,util[_0x9c76('0x24')]('%s-%s',Date[_0x9c76('0x26')](),_0x2f93c2[_0x9c76('0x27')]));}})});router['post'](_0x9c76('0x2f'),upload[_0x9c76('0x2d')](_0x9c76('0x28')),controller['addSystemAvatar']);router[_0x9c76('0x1e')](_0x9c76('0x30'),controller[_0x9c76('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0x9c76('0x2a')]({'destination':function(_0x100c01,_0x4e0b24,_0x1c5235){const _0x3e8dea=path[_0x9c76('0x21')](config[_0x9c76('0x22')],_0x9c76('0x32'),_0x9c76('0x33'),'offline-chat');fs_extra[_0x9c76('0x34')](_0x3e8dea,function(){_0x1c5235(null,_0x3e8dea);});},'filename':function(_0x18e65e,_0x4a35d7,_0x5b5921){const _0x74e1ce=_0x4a35d7['originalname'][_0x9c76('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x398f0f=path[_0x9c76('0x36')](_0x74e1ce);const _0x4eeb2e=Date[_0x9c76('0x26')]()+'-'+_0x74e1ce['replace'](_0x398f0f,'')+_0x398f0f;_0x5b5921(null,_0x4eeb2e);}})});router[_0x9c76('0x1e')](_0x9c76('0x37'),offlineUploadMulter[_0x9c76('0x38')](),controller[_0x9c76('0x39')]);router[_0x9c76('0x1e')](_0x9c76('0x3a'),auth[_0x9c76('0xa')](),controller[_0x9c76('0x3b')]);router[_0x9c76('0x1e')](_0x9c76('0x3c'),auth[_0x9c76('0xa')](),controller[_0x9c76('0x3d')]);router['post'](_0x9c76('0x16'),auth[_0x9c76('0xa')](),controller[_0x9c76('0x3e')]);router[_0x9c76('0x1e')](_0x9c76('0x1b'),auth[_0x9c76('0xa')](),controller['addAgents']);router['put'](_0x9c76('0xd'),auth[_0x9c76('0xa')](),controller[_0x9c76('0x3f')]);router['delete'](_0x9c76('0xd'),auth[_0x9c76('0xa')](),controller['destroy']);router['delete'](_0x9c76('0x40'),auth[_0x9c76('0xa')](),controller[_0x9c76('0x41')]);router[_0x9c76('0x42')](_0x9c76('0xf'),auth[_0x9c76('0xa')](),controller['removeAnswers']);router[_0x9c76('0x42')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x9c76('0x43')]=router;
\ No newline at end of file
+var _0xa2b3=['single','file','server/files/images/avatars/','%s-%s','addAvatar','addSystemAvatar','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','offline','/:id/interactions','/:id/applications','/:id/users','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','originalname'];(function(_0x19ac90,_0x554f04){var _0x4b9d7d=function(_0x3efc03){while(--_0x3efc03){_0x19ac90['push'](_0x19ac90['shift']());}};_0x4b9d7d(++_0x554f04);}(_0xa2b3,0x162));var _0x3a2b=function(_0x742cb3,_0x43cb32){_0x742cb3=_0x742cb3-0x0;var _0x191a5d=_0xa2b3[_0x742cb3];return _0x191a5d;};'use strict';var multer=require('multer');var util=require(_0x3a2b('0x0'));var path=require(_0x3a2b('0x1'));var timeout=require(_0x3a2b('0x2'));var express=require(_0x3a2b('0x3'));var router=express['Router']();var fs_extra=require(_0x3a2b('0x4'));var auth=require(_0x3a2b('0x5'));var interaction=require(_0x3a2b('0x6'));var config=require(_0x3a2b('0x7'));var controller=require(_0x3a2b('0x8'));router[_0x3a2b('0x9')]('/',auth[_0x3a2b('0xa')](),controller[_0x3a2b('0xb')]);router[_0x3a2b('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x3a2b('0xc')]);router[_0x3a2b('0x9')](_0x3a2b('0xd'),auth[_0x3a2b('0xa')](),controller[_0x3a2b('0xe')]);router[_0x3a2b('0x9')](_0x3a2b('0xf'),auth[_0x3a2b('0xa')](),controller['getDispositions']);router['get'](_0x3a2b('0x10'),auth[_0x3a2b('0xa')](),controller['getAnswers']);router[_0x3a2b('0x9')](_0x3a2b('0x11'),controller['getLogo']);router['get'](_0x3a2b('0x12'),controller[_0x3a2b('0x13')]);router[_0x3a2b('0x9')](_0x3a2b('0x14'),controller[_0x3a2b('0x15')]);router[_0x3a2b('0x9')](_0x3a2b('0x16'),controller[_0x3a2b('0x17')]);router['get']('/:id/interactions',auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x18')]);router[_0x3a2b('0x9')](_0x3a2b('0x19'),controller['getSnippet']);router['get']('/:id/applications',auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x1a')]);router[_0x3a2b('0x9')](_0x3a2b('0x1b'),auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x1c')]);router[_0x3a2b('0x9')](_0x3a2b('0x1d'),controller[_0x3a2b('0x1e')]);router[_0x3a2b('0x9')]('/:id/offline_messages',auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x1f')]);router[_0x3a2b('0x9')]('/:id/users',auth[_0x3a2b('0xa')](),controller['getAgents']);router[_0x3a2b('0x20')]('/',auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x21')]);router['post']('/:id/dispositions',auth[_0x3a2b('0xa')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x22')]);var upload=multer({'storage':multer[_0x3a2b('0x23')]({'destination':function(_0x32e46b,_0x586a03,_0x32fcb7){_0x32fcb7(null,path[_0x3a2b('0x24')](config[_0x3a2b('0x25')],_0x3a2b('0x26')));},'filename':function(_0x40de23,_0x4bf2d0,_0x2d9a67){_0x2d9a67(null,util[_0x3a2b('0x27')]('%s-%s',Date[_0x3a2b('0x28')](),_0x4bf2d0[_0x3a2b('0x29')]));}})});router[_0x3a2b('0x20')](_0x3a2b('0x11'),upload[_0x3a2b('0x2a')](_0x3a2b('0x2b')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22e01e,_0x5779dc,_0xdb2717){_0xdb2717(null,path[_0x3a2b('0x24')](config['root'],_0x3a2b('0x2c')));},'filename':function(_0x478150,_0x5cd491,_0x386de6){_0x386de6(null,util[_0x3a2b('0x27')](_0x3a2b('0x2d'),Date[_0x3a2b('0x28')](),_0x5cd491[_0x3a2b('0x29')]));}})});router['post']('/:id/avatar',upload['single']('file'),controller[_0x3a2b('0x2e')]);var upload=multer({'storage':multer[_0x3a2b('0x23')]({'destination':function(_0x3dbca4,_0x597e81,_0x556ea4){_0x556ea4(null,path['join'](config['root'],_0x3a2b('0x2c')));},'filename':function(_0x5f4a63,_0x4f5650,_0x449ae2){_0x449ae2(null,util[_0x3a2b('0x27')](_0x3a2b('0x2d'),Date[_0x3a2b('0x28')](),_0x4f5650[_0x3a2b('0x29')]));}})});router[_0x3a2b('0x20')](_0x3a2b('0x14'),upload[_0x3a2b('0x2a')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x41491f,_0x56dfca,_0xbb54b3){_0xbb54b3(null,path['join'](config[_0x3a2b('0x25')],_0x3a2b('0x2c')));},'filename':function(_0xc584bb,_0x34465c,_0x1af7c8){_0x1af7c8(null,util[_0x3a2b('0x27')](_0x3a2b('0x2d'),Date['now'](),_0x34465c[_0x3a2b('0x29')]));}})});router[_0x3a2b('0x20')](_0x3a2b('0x16'),upload[_0x3a2b('0x2a')](_0x3a2b('0x2b')),controller[_0x3a2b('0x2f')]);router[_0x3a2b('0x20')]('/:id/notify',controller[_0x3a2b('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x3a2b('0x23')]({'destination':function(_0x59baa1,_0x8deb87,_0x2dde22){const _0xa7aa76=path[_0x3a2b('0x24')](config[_0x3a2b('0x25')],_0x3a2b('0x31'),_0x3a2b('0x32'),'offline-chat');fs_extra[_0x3a2b('0x33')](_0xa7aa76,function(){_0x2dde22(null,_0xa7aa76);});},'filename':function(_0xef8faf,_0x27331a,_0x3bed3d){const _0x20e107=_0x27331a[_0x3a2b('0x29')][_0x3a2b('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x28c512=path[_0x3a2b('0x35')](_0x20e107);const _0x3f9236=Date[_0x3a2b('0x28')]()+'-'+_0x20e107[_0x3a2b('0x34')](_0x28c512,'')+_0x28c512;_0x3bed3d(null,_0x3f9236);}})});router[_0x3a2b('0x20')](_0x3a2b('0x36'),offlineUploadMulter['any'](),controller[_0x3a2b('0x37')]);router[_0x3a2b('0x20')](_0x3a2b('0x38'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x3a2b('0x20')](_0x3a2b('0x39'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x3a2b('0x1b'),auth[_0x3a2b('0xa')](),controller['addProactiveActions']);router['post'](_0x3a2b('0x3a'),auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x3b')]);router['put'](_0x3a2b('0xd'),auth['isAuthenticated'](),controller[_0x3a2b('0x3c')]);router[_0x3a2b('0x3d')](_0x3a2b('0xd'),auth['isAuthenticated'](),controller[_0x3a2b('0x3e')]);router[_0x3a2b('0x3d')](_0x3a2b('0xf'),auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x3f')]);router[_0x3a2b('0x3d')](_0x3a2b('0x10'),auth['isAuthenticated'](),controller[_0x3a2b('0x40')]);router['delete'](_0x3a2b('0x3a'),auth[_0x3a2b('0xa')](),controller[_0x3a2b('0x41')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 0381bc7..db93428 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x29e8=['client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','express','../components/auth/service','Router','env','production','app','get'];(function(_0x5144bd,_0x46e5f0){var _0x3bac80=function(_0x4b6dd2){while(--_0x4b6dd2){_0x5144bd['push'](_0x5144bd['shift']());}};_0x3bac80(++_0x46e5f0);}(_0x29e8,0xdd));var _0x829e=function(_0x64ca36,_0x1863c1){_0x64ca36=_0x64ca36-0x0;var _0x19e5f7=_0x29e8[_0x64ca36];return _0x19e5f7;};var beaverLogger=require('beaver-logger/server');var express=require(_0x829e('0x0'));var auth=require(_0x829e('0x1'));var config=require('../config/environment');var router=express[_0x829e('0x2')]();var isProduction=config[_0x829e('0x3')]===_0x829e('0x4')||![];function clientSideLogs(_0x3f5aaa,_0x25d3ce,_0x12baa2){var _0x23b5ee=_0x3f5aaa[_0x829e('0x5')][_0x829e('0x6')](_0x829e('0x7'));if(!_0x23b5ee){throw new Error(_0x829e('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0x829e('0x9'),'logger':_0x23b5ee,'enableCors':!isProduction})(_0x3f5aaa,_0x25d3ce,_0x12baa2);}router[_0x829e('0xa')](auth[_0x829e('0xb')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x6c18=['Router','env','expressEndpoint','use','beaver-logger/server','express','../components/auth/service'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x6c18,0x1a1));var _0x86c1=function(_0x4c3b80,_0x196af9){_0x4c3b80=_0x4c3b80-0x0;var _0x3290a1=_0x6c18[_0x4c3b80];return _0x3290a1;};var beaverLogger=require(_0x86c1('0x0'));var express=require(_0x86c1('0x1'));var auth=require(_0x86c1('0x2'));var config=require('../config/environment');var router=express[_0x86c1('0x3')]();var isProduction=config[_0x86c1('0x4')]==='production'||![];function clientSideLogs(_0x2fb387,_0xa121ff,_0x3d6b3f){var _0x158b1c=_0x2fb387['app']['get']('client-side-logger');if(!_0x158b1c){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x86c1('0x5')]({'uri':'/client-logs','logger':_0x158b1c,'enableCors':!isProduction})(_0x2fb387,_0xa121ff,_0x3d6b3f);}router[_0x86c1('0x6')](auth['isAuthenticated'](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index a784d15..e4a6d63 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 _0xbff0=['Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','AmazonAWS'];(function(_0x3e0763,_0x3d12be){var _0x351ca2=function(_0x9beae7){while(--_0x9beae7){_0x3e0763['push'](_0x3e0763['shift']());}};_0x351ca2(++_0x3d12be);}(_0xbff0,0xde));var _0x0bff=function(_0x301064,_0x1985aa){_0x301064=_0x301064-0x0;var _0x5bc841=_0xbff0[_0x301064];return _0x5bc841;};'use strict';var Sequelize=require(_0x0bff('0x0'));module[_0x0bff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x0bff('0x2'),_0x0bff('0x3'),_0x0bff('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x0bff('0x5'),_0x0bff('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x0bff('0x7')},'data2':{'type':Sequelize[_0x0bff('0x8')],'comment':_0x0bff('0x9')},'data3':{'type':Sequelize[_0x0bff('0x8')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x0bff('0x8')],'comment':_0x0bff('0xa')},'data5':{'type':Sequelize[_0x0bff('0xb')],'comment':_0x0bff('0xc')},'data6':{'type':Sequelize[_0x0bff('0xb')],'comment':_0x0bff('0xd')},'data7':{'type':Sequelize[_0x0bff('0xb')],'comment':_0x0bff('0xe')}};
\ No newline at end of file
+var _0x7c19=['ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','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','STRING'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x7c19,0x174));var _0x97c1=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x7c19[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0x97c1('0x0'));module[_0x97c1('0x1')]={'name':{'type':Sequelize[_0x97c1('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x97c1('0x3')](_0x97c1('0x4'),_0x97c1('0x5'),_0x97c1('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x97c1('0x3')]('Outlook365',_0x97c1('0x7'))},'data1':{'type':Sequelize[_0x97c1('0x2')],'comment':_0x97c1('0x8')},'data2':{'type':Sequelize[_0x97c1('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x97c1('0x2')],'comment':_0x97c1('0x9')},'data4':{'type':Sequelize[_0x97c1('0x2')],'comment':_0x97c1('0xa')},'data5':{'type':Sequelize[_0x97c1('0xb')],'comment':_0x97c1('0xc')},'data6':{'type':Sequelize[_0x97c1('0xb')],'comment':_0x97c1('0xd')},'data7':{'type':Sequelize[_0x97c1('0xb')],'comment':_0x97c1('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 94ea16d..e78f9d0 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 _0x2741=['data5','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','update','destroy','then','end','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','type','key','query','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','rows','service','decryptString','data3','catch','show','params','keys','intersection','find','MicrosoftAzure','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','from','base64','toString','ascii','parse','isValidIdToken','Unable\x20to\x20validate\x20id_token','state','getOauth2MicrosoftAccessToken','code'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x2741,0x1e9));var _0x1274=function(_0x442d58,_0x192b11){_0x442d58=_0x442d58-0x0;var _0x205c77=_0x2741[_0x442d58];return _0x205c77;};'use strict';var _=require(_0x1274('0x0'));var Redis=require(_0x1274('0x1'));var qs=require(_0x1274('0x2'));var encryptor=require(_0x1274('0x3'));var config=require(_0x1274('0x4'));var logger=require(_0x1274('0x5'))('api');var db=require(_0x1274('0x6'))['db'];var oauth=require(_0x1274('0x7'));config[_0x1274('0x8')]=_[_0x1274('0x9')](config[_0x1274('0x8')],{'host':_0x1274('0xa'),'port':0x18eb});var socket=require(_0x1274('0xb'))(new Redis(config[_0x1274('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x4f42a5,_0x4dfbbc){_0x4dfbbc=_0x4dfbbc||0xcc;return function(_0x93d87){if(_0x93d87){return _0x4f42a5[_0x1274('0xc')](_0x4dfbbc);}return _0x4f42a5[_0x1274('0xd')](_0x4dfbbc)['end']();};}function respondWithResult(_0x1f76a8,_0x30264b){_0x30264b=_0x30264b||0xc8;return function(_0x23b8e3){if(_0x23b8e3){return _0x1f76a8[_0x1274('0xd')](_0x30264b)[_0x1274('0xe')](_0x23b8e3);}};}function respondWithFilteredResult(_0x248096,_0x38de52){return function(_0x33cf48){if(_0x33cf48){var _0x1862bc=typeof _0x38de52[_0x1274('0xf')]===_0x1274('0x10')&&typeof _0x38de52[_0x1274('0x11')]===_0x1274('0x10');var _0x1f573d=_0x33cf48[_0x1274('0x12')];var _0x8278f5=_0x1862bc?0x0:_0x38de52[_0x1274('0xf')];var _0x3b83a5=_0x1862bc?_0x33cf48[_0x1274('0x12')]:_0x38de52[_0x1274('0xf')]+_0x38de52[_0x1274('0x11')];var _0x22104f;if(_0x3b83a5>=_0x1f573d){_0x3b83a5=_0x1f573d;_0x22104f=0xc8;}else{_0x22104f=0xce;}_0x248096[_0x1274('0xd')](_0x22104f);return _0x248096['set']('Content-Range',_0x8278f5+'-'+_0x3b83a5+'/'+_0x1f573d)[_0x1274('0xe')](_0x33cf48);}return null;};}function saveUpdates(_0x5c6cb1){return function(_0x25e434){if(_0x25e434){return _0x25e434[_0x1274('0x13')](_0x5c6cb1)['then'](function(_0x3e6e11){return _0x3e6e11;});}return null;};}function removeEntity(_0x4e9609){return function(_0x84be30){if(_0x84be30){return _0x84be30[_0x1274('0x14')]()[_0x1274('0x15')](function(){_0x4e9609[_0x1274('0xd')](0xcc)[_0x1274('0x16')]();});}};}function handleEntityNotFound(_0x63b519){return function(_0x2c6556){if(!_0x2c6556){_0x63b519[_0x1274('0xc')](0x194);}return _0x2c6556;};}function handleError(_0x30366a,_0x5f79a2){_0x5f79a2=_0x5f79a2||0x1f4;return function(_0x39531f){logger[_0x1274('0x17')](_0x39531f[_0x1274('0x18')]);if(_0x39531f[_0x1274('0x19')]){delete _0x39531f[_0x1274('0x19')];}_0x30366a[_0x1274('0xd')](_0x5f79a2)[_0x1274('0x1a')](_0x39531f);};}function maskClientSecret(_0x5deb32){return _[_0x1274('0x1b')](_0x5deb32[_0x1274('0x1c')](0x0,0x3),0x14,'*');}exports[_0x1274('0x1d')]=function(_0x4d014d,_0x422a54){var _0x1fd8ed={},_0x332ce2={},_0x5e6942={'count':0x0,'rows':[]};var _0x1c8b07=_[_0x1274('0x1e')](db[_0x1274('0x1f')][_0x1274('0x20')],function(_0x27d954){return{'name':_0x27d954['fieldName'],'type':_0x27d954[_0x1274('0x21')][_0x1274('0x22')]};});_0x332ce2['model']=_[_0x1274('0x1e')](_0x1c8b07,_0x1274('0x19'));_0x332ce2[_0x1274('0x23')]=_['keys'](_0x4d014d[_0x1274('0x23')]);_0x332ce2['filters']=_['intersection'](_0x332ce2[_0x1274('0x24')],_0x332ce2['query']);_0x1fd8ed[_0x1274('0x25')]=_['intersection'](_0x332ce2[_0x1274('0x24')],qs[_0x1274('0x26')](_0x4d014d[_0x1274('0x23')][_0x1274('0x26')]));_0x1fd8ed[_0x1274('0x25')]=_0x1fd8ed['attributes'][_0x1274('0x27')]?_0x1fd8ed['attributes']:_0x332ce2[_0x1274('0x24')];if(!_0x4d014d[_0x1274('0x23')][_0x1274('0x28')](_0x1274('0x29'))){_0x1fd8ed[_0x1274('0x11')]=qs[_0x1274('0x11')](_0x4d014d[_0x1274('0x23')]['limit']);_0x1fd8ed[_0x1274('0xf')]=qs[_0x1274('0xf')](_0x4d014d['query']['offset']);}_0x1fd8ed['order']=qs[_0x1274('0x2a')](_0x4d014d[_0x1274('0x23')][_0x1274('0x2a')]);_0x1fd8ed[_0x1274('0x2b')]=qs['filters'](_[_0x1274('0x2c')](_0x4d014d[_0x1274('0x23')],_0x332ce2[_0x1274('0x2d')]),_0x1c8b07);if(_0x4d014d[_0x1274('0x23')][_0x1274('0x2e')]){_0x1fd8ed[_0x1274('0x2b')]=_['merge'](_0x1fd8ed[_0x1274('0x2b')],{'$or':_['map'](_0x1c8b07,function(_0x582d0d){if(_0x582d0d[_0x1274('0x21')]!==_0x1274('0x2f')){var _0x367c0a={};_0x367c0a[_0x582d0d[_0x1274('0x19')]]={'$like':'%'+_0x4d014d[_0x1274('0x23')][_0x1274('0x2e')]+'%'};return _0x367c0a;}})});}_0x1fd8ed=_[_0x1274('0x30')]({},_0x1fd8ed,_0x4d014d[_0x1274('0x31')]);var _0x56a894={'where':_0x1fd8ed[_0x1274('0x2b')]};return db[_0x1274('0x1f')][_0x1274('0x12')](_0x56a894)[_0x1274('0x15')](function(_0x265bf6){_0x5e6942[_0x1274('0x12')]=_0x265bf6;if(_0x4d014d[_0x1274('0x23')][_0x1274('0x32')]){_0x1fd8ed[_0x1274('0x33')]=[{'all':!![]}];}return db[_0x1274('0x1f')]['findAll'](_0x1fd8ed);})['then'](function(_0xccd906){_0x5e6942[_0x1274('0x34')]=_[_0x1274('0x1e')](_0xccd906,function(_0x409288){if(_0x409288[_0x1274('0x35')]==='MicrosoftAzure'){var _0x281339=encryptor[_0x1274('0x36')](_0x409288[_0x1274('0x37')]);_0x409288[_0x1274('0x37')]=maskClientSecret(_0x281339);}return _0x409288;});return _0x5e6942;})[_0x1274('0x15')](respondWithFilteredResult(_0x422a54,_0x1fd8ed))[_0x1274('0x38')](handleError(_0x422a54,null));};exports[_0x1274('0x39')]=function(_0x39701d,_0x55cf0d){var _0x207345={'raw':!![],'where':{'id':_0x39701d[_0x1274('0x3a')]['id']}},_0x1ccb0a={};_0x1ccb0a[_0x1274('0x24')]=_[_0x1274('0x3b')](db[_0x1274('0x1f')]['rawAttributes']);_0x1ccb0a[_0x1274('0x23')]=_['keys'](_0x39701d['query']);_0x1ccb0a[_0x1274('0x2d')]=_[_0x1274('0x3c')](_0x1ccb0a[_0x1274('0x24')],_0x1ccb0a[_0x1274('0x23')]);_0x207345[_0x1274('0x25')]=_['intersection'](_0x1ccb0a[_0x1274('0x24')],qs['fields'](_0x39701d['query']['fields']));_0x207345[_0x1274('0x25')]=_0x207345['attributes']['length']?_0x207345[_0x1274('0x25')]:_0x1ccb0a[_0x1274('0x24')];if(_0x39701d['query'][_0x1274('0x32')]){_0x207345[_0x1274('0x33')]=[{'all':!![]}];}_0x207345=_[_0x1274('0x30')]({},_0x207345,_0x39701d[_0x1274('0x31')]);return db['CloudProvider'][_0x1274('0x3d')](_0x207345)[_0x1274('0x15')](handleEntityNotFound(_0x55cf0d,null))[_0x1274('0x15')](function(_0x46cb0d){if(_0x46cb0d[_0x1274('0x35')]===_0x1274('0x3e')){var _0x24f413=encryptor[_0x1274('0x36')](_0x46cb0d[_0x1274('0x37')]);_0x46cb0d['data3']=maskClientSecret(_0x24f413);}return _0x46cb0d;})['then'](respondWithResult(_0x55cf0d,null))[_0x1274('0x38')](handleError(_0x55cf0d,null));};exports['create']=function(_0x203455,_0x30d757){if(!_0x203455[_0x1274('0x3f')]['name'])throw new Error(_0x1274('0x40'));if(!_0x203455[_0x1274('0x3f')][_0x1274('0x35')])throw new Error(_0x1274('0x41'));var _0x101491=db['CloudProvider'][_0x1274('0x20')][_0x1274('0x35')][_0x1274('0x42')];if(!_0x101491[_0x1274('0x43')](_0x203455[_0x1274('0x3f')][_0x1274('0x35')]))throw new Error(_0x1274('0x44')+_0x101491[_0x1274('0x45')](',\x20'));if(_0x203455[_0x1274('0x3f')][_0x1274('0x35')]===_0x1274('0x3e')&&_0x203455['body'][_0x1274('0x37')]){_0x203455[_0x1274('0x3f')]['data3']=encryptor[_0x1274('0x46')](_0x203455[_0x1274('0x3f')]['data3']);}return db[_0x1274('0x1f')][_0x1274('0x47')](_0x203455['body'],{})[_0x1274('0x15')](respondWithResult(_0x30d757,0xc9))[_0x1274('0x38')](handleError(_0x30d757,null));};exports[_0x1274('0x13')]=function(_0x2dbc6a,_0x363c33){if(_0x2dbc6a[_0x1274('0x3f')]['id']){delete _0x2dbc6a[_0x1274('0x3f')]['id'];}return db[_0x1274('0x1f')]['find']({'where':{'id':_0x2dbc6a[_0x1274('0x3a')]['id']}})[_0x1274('0x15')](handleEntityNotFound(_0x363c33,null))[_0x1274('0x15')](function(_0x221b97){if(_0x221b97['service']==='MicrosoftAzure'&&_0x2dbc6a[_0x1274('0x3f')][_0x1274('0x37')]){_0x2dbc6a[_0x1274('0x3f')]['data3']=encryptor[_0x1274('0x46')](_0x2dbc6a['body'][_0x1274('0x37')]);}return _0x221b97;})['then'](saveUpdates(_0x2dbc6a[_0x1274('0x3f')],null))[_0x1274('0x15')](respondWithResult(_0x363c33,null))[_0x1274('0x38')](handleError(_0x363c33,null));};exports[_0x1274('0x14')]=function(_0x3431b1,_0x459b62){return db['CloudProvider'][_0x1274('0x3d')]({'where':{'id':_0x3431b1[_0x1274('0x3a')]['id']}})[_0x1274('0x15')](handleEntityNotFound(_0x459b62,null))['then'](removeEntity(_0x459b62,null))['catch'](handleError(_0x459b62,null));};exports[_0x1274('0x48')]=function(_0x297fe5,_0x266699){return db[_0x1274('0x1f')][_0x1274('0x49')]({'where':{'id':_0x297fe5[_0x1274('0x3a')]['id']},'raw':!![]})['then'](function(_0x32e382){if(!_0x32e382)return _0x266699['sendStatus'](0x194);return{'url':oauth[_0x1274('0x4a')](_0x32e382,_0x297fe5['user']['id'])};})[_0x1274('0x15')](respondWithResult(_0x266699,null))['catch'](handleError(_0x266699,null));};exports[_0x1274('0x4b')]=function(_0x3acb64,_0x299f8a){var _0x46501f=_0x3acb64['body'];var _0x4d8333;var _0x58e7d6;if(_0x46501f[_0x1274('0x17')])throw _0x46501f;redis[_0x1274('0x4c')](_0x46501f['state'])[_0x1274('0x15')](function(_0x2e5065){if(!_0x2e5065)throw new Error('Invalid\x20state\x20parameter');_0x4d8333=JSON['parse'](_0x2e5065);var _0x188990=Buffer[_0x1274('0x4d')](_0x46501f['state'],_0x1274('0x4e'))[_0x1274('0x4f')](_0x1274('0x50'));_0x58e7d6=JSON[_0x1274('0x51')](_0x188990);if(!oauth[_0x1274('0x52')](_0x46501f['id_token'],_0x4d8333['oauth2Claims']))throw new Error(_0x1274('0x53'));redis['del'](_0x46501f[_0x1274('0x54')]);return oauth[_0x1274('0x55')](_0x46501f[_0x1274('0x56')],_0x4d8333);})[_0x1274('0x15')](function(_0x1cd29a){_0x4d8333[_0x1274('0x57')]=_0x1cd29a['access_token'];_0x4d8333['data6']=_0x1cd29a[_0x1274('0x58')];return db['CloudProvider'][_0x1274('0x13')]({'data5':_0x4d8333[_0x1274('0x57')],'data6':_0x4d8333[_0x1274('0x59')]},{'where':{'id':_0x4d8333['id']}});})[_0x1274('0x15')](function(){oauth[_0x1274('0x5a')](_0x4d8333);socket[_0x1274('0x5b')](_0x1274('0x5c'),{'id':_0x58e7d6['id']});return;})['then'](respondWithStatusCode(_0x299f8a,null))['catch'](function(_0x51e2fa){if(_0x58e7d6){socket[_0x1274('0x5b')](_0x1274('0x5d'),{'id':_0x58e7d6['id']});}if(!_0x4d8333){logger[_0x1274('0x17')]('Invalid\x20authentication\x20state\x20parameter',_0x51e2fa);return _0x299f8a[_0x1274('0xd')](0x1f4)['send'](_0x51e2fa[_0x1274('0x5e')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x4d8333['id'],JSON[_0x1274('0x5f')](_0x51e2fa));});};
\ No newline at end of file
+var _0x1846=['Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','base64','isValidIdToken','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','startRefreshInterval','microsoftAuthorization:error','message','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','./cloudProvider.oauth','redis','defaults','localhost','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','name','send','padEnd','map','CloudProvider','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','rows','service','data3','catch','show','params','MicrosoftAzure','decryptString','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','rawAttributes','values','includes'];(function(_0x420085,_0x4fde85){var _0x617837=function(_0x2c94cc){while(--_0x2c94cc){_0x420085['push'](_0x420085['shift']());}};_0x617837(++_0x4fde85);}(_0x1846,0x179));var _0x6184=function(_0x27c24d,_0x2b50f1){_0x27c24d=_0x27c24d-0x0;var _0x14e722=_0x1846[_0x27c24d];return _0x14e722;};'use strict';var _=require(_0x6184('0x0'));var Redis=require(_0x6184('0x1'));var qs=require(_0x6184('0x2'));var encryptor=require(_0x6184('0x3'));var config=require(_0x6184('0x4'));var logger=require('../../config/logger')(_0x6184('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x6184('0x6'));config[_0x6184('0x7')]=_[_0x6184('0x8')](config['redis'],{'host':_0x6184('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6184('0x7')]));var redis=new Redis(config[_0x6184('0x7')]);function respondWithStatusCode(_0x4c4214,_0x36f382){_0x36f382=_0x36f382||0xcc;return function(_0x4c74e7){if(_0x4c74e7){return _0x4c4214['sendStatus'](_0x36f382);}return _0x4c4214[_0x6184('0xa')](_0x36f382)[_0x6184('0xb')]();};}function respondWithResult(_0x1d5be5,_0x4c65de){_0x4c65de=_0x4c65de||0xc8;return function(_0x2769f6){if(_0x2769f6){return _0x1d5be5['status'](_0x4c65de)[_0x6184('0xc')](_0x2769f6);}};}function respondWithFilteredResult(_0x439ebe,_0x290748){return function(_0x3c5104){if(_0x3c5104){var _0x2d3671=typeof _0x290748[_0x6184('0xd')]===_0x6184('0xe')&&typeof _0x290748[_0x6184('0xf')]==='undefined';var _0x502bb3=_0x3c5104['count'];var _0x360c21=_0x2d3671?0x0:_0x290748[_0x6184('0xd')];var _0x5791a3=_0x2d3671?_0x3c5104[_0x6184('0x10')]:_0x290748[_0x6184('0xd')]+_0x290748['limit'];var _0x5e2c4e;if(_0x5791a3>=_0x502bb3){_0x5791a3=_0x502bb3;_0x5e2c4e=0xc8;}else{_0x5e2c4e=0xce;}_0x439ebe['status'](_0x5e2c4e);return _0x439ebe[_0x6184('0x11')](_0x6184('0x12'),_0x360c21+'-'+_0x5791a3+'/'+_0x502bb3)[_0x6184('0xc')](_0x3c5104);}return null;};}function saveUpdates(_0x51f531){return function(_0x1eb58e){if(_0x1eb58e){return _0x1eb58e[_0x6184('0x13')](_0x51f531)[_0x6184('0x14')](function(_0x16f1cb){return _0x16f1cb;});}return null;};}function removeEntity(_0x46d80b){return function(_0x776a31){if(_0x776a31){return _0x776a31['destroy']()[_0x6184('0x14')](function(){_0x46d80b[_0x6184('0xa')](0xcc)[_0x6184('0xb')]();});}};}function handleEntityNotFound(_0xbc1ab9){return function(_0x47c36e){if(!_0x47c36e){_0xbc1ab9[_0x6184('0x15')](0x194);}return _0x47c36e;};}function handleError(_0x4951a9,_0x1b2894){_0x1b2894=_0x1b2894||0x1f4;return function(_0x33d70a){logger[_0x6184('0x16')](_0x33d70a['stack']);if(_0x33d70a['name']){delete _0x33d70a[_0x6184('0x17')];}_0x4951a9[_0x6184('0xa')](_0x1b2894)[_0x6184('0x18')](_0x33d70a);};}function maskClientSecret(_0x9a2625){return _[_0x6184('0x19')](_0x9a2625['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x1db518,_0x14ad0a){var _0x1d017c={},_0x48259d={},_0x257096={'count':0x0,'rows':[]};var _0x3f96d5=_[_0x6184('0x1a')](db[_0x6184('0x1b')]['rawAttributes'],function(_0x31895b){return{'name':_0x31895b[_0x6184('0x1c')],'type':_0x31895b['type']['key']};});_0x48259d[_0x6184('0x1d')]=_['map'](_0x3f96d5,_0x6184('0x17'));_0x48259d[_0x6184('0x1e')]=_[_0x6184('0x1f')](_0x1db518[_0x6184('0x1e')]);_0x48259d['filters']=_[_0x6184('0x20')](_0x48259d[_0x6184('0x1d')],_0x48259d[_0x6184('0x1e')]);_0x1d017c['attributes']=_['intersection'](_0x48259d[_0x6184('0x1d')],qs[_0x6184('0x21')](_0x1db518['query'][_0x6184('0x21')]));_0x1d017c['attributes']=_0x1d017c[_0x6184('0x22')][_0x6184('0x23')]?_0x1d017c[_0x6184('0x22')]:_0x48259d['model'];if(!_0x1db518['query'][_0x6184('0x24')]('nolimit')){_0x1d017c['limit']=qs[_0x6184('0xf')](_0x1db518['query'][_0x6184('0xf')]);_0x1d017c['offset']=qs[_0x6184('0xd')](_0x1db518[_0x6184('0x1e')]['offset']);}_0x1d017c[_0x6184('0x25')]=qs['sort'](_0x1db518['query'][_0x6184('0x26')]);_0x1d017c[_0x6184('0x27')]=qs[_0x6184('0x28')](_['pick'](_0x1db518[_0x6184('0x1e')],_0x48259d[_0x6184('0x28')]),_0x3f96d5);if(_0x1db518[_0x6184('0x1e')]['filter']){_0x1d017c['where']=_[_0x6184('0x29')](_0x1d017c[_0x6184('0x27')],{'$or':_[_0x6184('0x1a')](_0x3f96d5,function(_0x3ea1af){if(_0x3ea1af[_0x6184('0x2a')]!==_0x6184('0x2b')){var _0x3fb7c6={};_0x3fb7c6[_0x3ea1af[_0x6184('0x17')]]={'$like':'%'+_0x1db518[_0x6184('0x1e')][_0x6184('0x2c')]+'%'};return _0x3fb7c6;}})});}_0x1d017c=_[_0x6184('0x29')]({},_0x1d017c,_0x1db518[_0x6184('0x2d')]);var _0x24dad5={'where':_0x1d017c[_0x6184('0x27')]};return db[_0x6184('0x1b')]['count'](_0x24dad5)[_0x6184('0x14')](function(_0x29e5e9){_0x257096[_0x6184('0x10')]=_0x29e5e9;if(_0x1db518[_0x6184('0x1e')][_0x6184('0x2e')]){_0x1d017c[_0x6184('0x2f')]=[{'all':!![]}];}return db[_0x6184('0x1b')]['findAll'](_0x1d017c);})[_0x6184('0x14')](function(_0x167a8c){_0x257096[_0x6184('0x30')]=_[_0x6184('0x1a')](_0x167a8c,function(_0x2ef894){if(_0x2ef894[_0x6184('0x31')]==='MicrosoftAzure'){var _0x304cb4=encryptor['decryptString'](_0x2ef894[_0x6184('0x32')]);_0x2ef894[_0x6184('0x32')]=maskClientSecret(_0x304cb4);}return _0x2ef894;});return _0x257096;})[_0x6184('0x14')](respondWithFilteredResult(_0x14ad0a,_0x1d017c))[_0x6184('0x33')](handleError(_0x14ad0a,null));};exports[_0x6184('0x34')]=function(_0x479fd5,_0x1ee2ba){var _0x5744ce={'raw':!![],'where':{'id':_0x479fd5[_0x6184('0x35')]['id']}},_0x51bb4c={};_0x51bb4c[_0x6184('0x1d')]=_[_0x6184('0x1f')](db[_0x6184('0x1b')]['rawAttributes']);_0x51bb4c['query']=_[_0x6184('0x1f')](_0x479fd5[_0x6184('0x1e')]);_0x51bb4c['filters']=_[_0x6184('0x20')](_0x51bb4c[_0x6184('0x1d')],_0x51bb4c[_0x6184('0x1e')]);_0x5744ce[_0x6184('0x22')]=_[_0x6184('0x20')](_0x51bb4c[_0x6184('0x1d')],qs[_0x6184('0x21')](_0x479fd5[_0x6184('0x1e')][_0x6184('0x21')]));_0x5744ce[_0x6184('0x22')]=_0x5744ce[_0x6184('0x22')]['length']?_0x5744ce[_0x6184('0x22')]:_0x51bb4c[_0x6184('0x1d')];if(_0x479fd5[_0x6184('0x1e')]['includeAll']){_0x5744ce[_0x6184('0x2f')]=[{'all':!![]}];}_0x5744ce=_[_0x6184('0x29')]({},_0x5744ce,_0x479fd5['options']);return db[_0x6184('0x1b')]['find'](_0x5744ce)['then'](handleEntityNotFound(_0x1ee2ba,null))[_0x6184('0x14')](function(_0x42a4b2){if(_0x42a4b2[_0x6184('0x31')]===_0x6184('0x36')){var _0x344142=encryptor[_0x6184('0x37')](_0x42a4b2[_0x6184('0x32')]);_0x42a4b2[_0x6184('0x32')]=maskClientSecret(_0x344142);}return _0x42a4b2;})['then'](respondWithResult(_0x1ee2ba,null))['catch'](handleError(_0x1ee2ba,null));};exports[_0x6184('0x38')]=function(_0x27e678,_0x38e4d2){if(!_0x27e678[_0x6184('0x39')][_0x6184('0x17')])throw new Error(_0x6184('0x3a'));if(!_0x27e678['body'][_0x6184('0x31')])throw new Error(_0x6184('0x3b'));var _0x1f42b2=db[_0x6184('0x1b')][_0x6184('0x3c')][_0x6184('0x31')][_0x6184('0x3d')];if(!_0x1f42b2[_0x6184('0x3e')](_0x27e678['body'][_0x6184('0x31')]))throw new Error(_0x6184('0x3f')+_0x1f42b2[_0x6184('0x40')](',\x20'));if(_0x27e678['body'][_0x6184('0x31')]===_0x6184('0x36')&&_0x27e678['body'][_0x6184('0x32')]){_0x27e678[_0x6184('0x39')]['data3']=encryptor[_0x6184('0x41')](_0x27e678[_0x6184('0x39')][_0x6184('0x32')]);}return db[_0x6184('0x1b')][_0x6184('0x38')](_0x27e678[_0x6184('0x39')],{})[_0x6184('0x14')](respondWithResult(_0x38e4d2,0xc9))[_0x6184('0x33')](handleError(_0x38e4d2,null));};exports[_0x6184('0x13')]=function(_0x3626d9,_0x5d231b){if(_0x3626d9[_0x6184('0x39')]['id']){delete _0x3626d9[_0x6184('0x39')]['id'];}return db[_0x6184('0x1b')][_0x6184('0x42')]({'where':{'id':_0x3626d9['params']['id']}})[_0x6184('0x14')](handleEntityNotFound(_0x5d231b,null))[_0x6184('0x14')](function(_0xf7e50e){if(_0xf7e50e[_0x6184('0x31')]===_0x6184('0x36')&&_0x3626d9[_0x6184('0x39')]['data3']){_0x3626d9['body'][_0x6184('0x32')]=encryptor[_0x6184('0x41')](_0x3626d9[_0x6184('0x39')]['data3']);}return _0xf7e50e;})[_0x6184('0x14')](saveUpdates(_0x3626d9[_0x6184('0x39')],null))[_0x6184('0x14')](respondWithResult(_0x5d231b,null))[_0x6184('0x33')](handleError(_0x5d231b,null));};exports[_0x6184('0x43')]=function(_0x499b16,_0x3d3641){return db[_0x6184('0x1b')]['find']({'where':{'id':_0x499b16[_0x6184('0x35')]['id']}})[_0x6184('0x14')](handleEntityNotFound(_0x3d3641,null))[_0x6184('0x14')](removeEntity(_0x3d3641,null))[_0x6184('0x33')](handleError(_0x3d3641,null));};exports[_0x6184('0x44')]=function(_0x4a56a3,_0x4d1d7c){return db['CloudProvider'][_0x6184('0x45')]({'where':{'id':_0x4a56a3['params']['id']},'raw':!![]})[_0x6184('0x14')](function(_0x5ed1d4){if(!_0x5ed1d4)return _0x4d1d7c[_0x6184('0x15')](0x194);return{'url':oauth[_0x6184('0x46')](_0x5ed1d4,_0x4a56a3[_0x6184('0x47')]['id'])};})['then'](respondWithResult(_0x4d1d7c,null))[_0x6184('0x33')](handleError(_0x4d1d7c,null));};exports[_0x6184('0x48')]=function(_0xf9554c,_0xb4dd3){var _0x7e08b9=_0xf9554c[_0x6184('0x39')];var _0x74d3a7;var _0x4183d5;if(_0x7e08b9[_0x6184('0x16')])throw _0x7e08b9;redis['get'](_0x7e08b9[_0x6184('0x49')])['then'](function(_0x64fb30){if(!_0x64fb30)throw new Error(_0x6184('0x4a'));_0x74d3a7=JSON['parse'](_0x64fb30);var _0x5ba478=Buffer['from'](_0x7e08b9[_0x6184('0x49')],_0x6184('0x4b'))['toString']('ascii');_0x4183d5=JSON['parse'](_0x5ba478);if(!oauth[_0x6184('0x4c')](_0x7e08b9['id_token'],_0x74d3a7[_0x6184('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x6184('0x4e')](_0x7e08b9[_0x6184('0x49')]);return oauth[_0x6184('0x4f')](_0x7e08b9[_0x6184('0x50')],_0x74d3a7);})[_0x6184('0x14')](function(_0x405061){_0x74d3a7['data5']=_0x405061[_0x6184('0x51')];_0x74d3a7[_0x6184('0x52')]=_0x405061[_0x6184('0x53')];return db[_0x6184('0x1b')][_0x6184('0x13')]({'data5':_0x74d3a7['data5'],'data6':_0x74d3a7['data6']},{'where':{'id':_0x74d3a7['id']}});})['then'](function(){oauth[_0x6184('0x54')](_0x74d3a7);socket['emit']('microsoftAuthorization:success',{'id':_0x4183d5['id']});return;})[_0x6184('0x14')](respondWithStatusCode(_0xb4dd3,null))['catch'](function(_0x222e8a){if(_0x4183d5){socket['emit'](_0x6184('0x55'),{'id':_0x4183d5['id']});}if(!_0x74d3a7){logger[_0x6184('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x222e8a);return _0xb4dd3[_0x6184('0xa')](0x1f4)[_0x6184('0x18')](_0x222e8a[_0x6184('0x56')]);}logger[_0x6184('0x16')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x74d3a7['id'],JSON[_0x6184('0x57')](_0x222e8a));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index cc10bce..ddc1351 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 _0x8bd5=['../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','api','bluebird','request-promise','rimraf'];(function(_0x133199,_0x307e52){var _0x17cfaa=function(_0x59d572){while(--_0x59d572){_0x133199['push'](_0x133199['shift']());}};_0x17cfaa(++_0x307e52);}(_0x8bd5,0x74));var _0x58bd=function(_0x45b9c8,_0x4d6d5a){_0x45b9c8=_0x45b9c8-0x0;var _0x48344f=_0x8bd5[_0x45b9c8];return _0x48344f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x58bd('0x0'));var moment=require('moment');var BPromise=require(_0x58bd('0x1'));var rp=require(_0x58bd('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58bd('0x3'));var config=require(_0x58bd('0x4'));var attributes=require(_0x58bd('0x5'));module[_0x58bd('0x6')]=function(_0x422069,_0x33bee6){return _0x422069[_0x58bd('0x7')](_0x58bd('0x8'),attributes,{'tableName':_0x58bd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x932f=['api','bluebird','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','util','../../config/logger'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x932f,0x103));var _0xf932=function(_0x5e2301,_0x4d8038){_0x5e2301=_0x5e2301-0x0;var _0x370597=_0x932f[_0x5e2301];return _0x370597;};'use strict';var _=require('lodash');var util=require(_0xf932('0x0'));var logger=require(_0xf932('0x1'))(_0xf932('0x2'));var moment=require('moment');var BPromise=require(_0xf932('0x3'));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(_0xf932('0x4'));module[_0xf932('0x5')]=function(_0x24703e,_0x478159){return _0x24703e[_0xf932('0x6')](_0xf932('0x7'),attributes,{'tableName':_0xf932('0x8'),'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 9e2f9b1..d533e4e 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 _0x9703=['refresh_token','data6','data4','POST','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','findAll','inspect','exports','lodash','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','redis','defaults','localhost','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','client_id','data1','redirect_uri','response_mode','form_post','scope','nonce','prompt','login','key','value','oauth2/','payload','issuer','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9703,0x144));var _0x3970=function(_0x21cc4e,_0x24a7ac){_0x21cc4e=_0x21cc4e-0x0;var _0x3b7125=_0x9703[_0x21cc4e];return _0x3b7125;};'use strict';var _=require(_0x3970('0x0'));var crypto=require('crypto');var jwt=require(_0x3970('0x1'));var moment=require(_0x3970('0x2'));var Redis=require(_0x3970('0x3'));var rp=require('request-promise');var util=require(_0x3970('0x4'));var encryptor=require(_0x3970('0x5'));var config=require(_0x3970('0x6'));var logger=require(_0x3970('0x7'))(_0x3970('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0x3970('0x9')]=_[_0x3970('0xa')](config[_0x3970('0x9')],{'host':_0x3970('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x3970('0xc'),_0x3970('0xd'),_0x3970('0xe'),'offline_access',_0x3970('0xf'),_0x3970('0x10'),_0x3970('0x11')],'Dynamics365':[_0x3970('0xc'),_0x3970('0x12')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x3970('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x57477a){var _0x5cdbfc=_[_0x3970('0x14')](AZURE_AUTH_SCOPES[_0x57477a[_0x3970('0x15')]]);if(_0x57477a[_0x3970('0x15')]===_0x3970('0x16'))_0x5cdbfc[_0x3970('0x17')](_0x57477a[_0x3970('0x18')]+_0x3970('0x19'));return _0x5cdbfc[_0x3970('0x1a')]('\x20');}function getAccessTokenScope(_0xe2e0b9){if(_0xe2e0b9[_0x3970('0x15')]===_0x3970('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0xe2e0b9['type']===_0x3970('0x16'))return _0xe2e0b9[_0x3970('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x5520eb,_0x14309f){var _0x36c792=MICROSOFT_AUTH_URL[_0x3970('0x1c')](_0x3970('0x1d'),_0x5520eb[_0x3970('0x1e')]);var _0x264531=[_0x3970('0x1f'),_0x3970('0x20')];var _0x5205a5=Buffer[_0x3970('0x21')](JSON[_0x3970('0x22')]({'id':_0x14309f}))[_0x3970('0x23')](_0x3970('0x24'));var _0x9d6e30=crypto[_0x3970('0x25')](0x10)['toString']('hex');var _0x50593d=getAuthorizationScopes(_0x5520eb);var _0xe6198c=[{'key':_0x3970('0x26'),'value':_0x5520eb[_0x3970('0x27')]},{'key':'response_type','value':encodeURIComponent(_0x264531[_0x3970('0x1a')]('\x20'))},{'key':_0x3970('0x28'),'value':_0x5520eb['data4']},{'key':_0x3970('0x29'),'value':_0x3970('0x2a')},{'key':_0x3970('0x2b'),'value':encodeURIComponent(_0x50593d)},{'key':'state','value':_0x5205a5},{'key':_0x3970('0x2c'),'value':_0x9d6e30},{'key':_0x3970('0x2d'),'value':_0x3970('0x2e')}];var _0x2cf29c=_0x36c792+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0xe6198c,function(_0x425856){return _0x425856[_0x3970('0x2f')]+'='+_0x425856[_0x3970('0x30')];})['join']('&');_0x5520eb['oauth2Claims']={'issuer':_0x36c792[_0x3970('0x1c')](_0x3970('0x31'),''),'audience':_0x5520eb[_0x3970('0x27')],'state':_0x5205a5,'nonce':_0x9d6e30};redis['set'](_0x5205a5,JSON['stringify'](_0x5520eb));return _0x2cf29c;}function isValidIdToken(_0x42f403,_0x538218){try{var _0x5ea8bd=jwt['decode'](_0x42f403,{'complete':!![]});var _0x489346=_0x5ea8bd[_0x3970('0x32')];if(_0x489346['iss']!==_0x538218[_0x3970('0x33')])return![];if(_0x489346['aud']!==_0x538218[_0x3970('0x34')])return![];if(_0x489346[_0x3970('0x2c')]!==_0x538218[_0x3970('0x2c')])return![];if(moment()[_0x3970('0x35')](moment[_0x3970('0x36')](_0x489346[_0x3970('0x37')])))return![];return!![];}catch(_0x2a8c8d){throw _0x2a8c8d;}}function refreshOauth2MicrosoftAccessToken(_0x114671){return Promise[_0x3970('0x38')]()[_0x3970('0x39')](function(){if(_0x114671[_0x3970('0x3a')])return _0x114671;return db[_0x3970('0x3b')][_0x3970('0x3c')]({'where':{'id':_0x114671['id']},'raw':!![]});})[_0x3970('0x39')](function(_0x4b78f6){var _0x125a4b={'grant_type':_0x3970('0x3d'),'refresh_token':_0x4b78f6[_0x3970('0x3e')],'scope':getAccessTokenScope(_0x4b78f6),'redirect_uri':_0x4b78f6[_0x3970('0x3f')],'client_id':_0x4b78f6[_0x3970('0x27')],'client_secret':encryptor['decryptString'](_0x4b78f6['data3'])};var _0x9ba242={'method':_0x3970('0x40'),'uri':MICROSOFT_AUTH_URL[_0x3970('0x1c')](_0x3970('0x1d'),_0x4b78f6[_0x3970('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x125a4b,'json':!![]};return rp(_0x9ba242);})[_0x3970('0x39')](function(_0x119d4e){_0x114671[_0x3970('0x41')]=_0x119d4e['access_token'];_0x114671['data6']=_0x119d4e[_0x3970('0x3d')];return db[_0x3970('0x3b')][_0x3970('0x42')]({'data5':_0x114671[_0x3970('0x41')],'data6':_0x114671['data6']},{'where':{'id':_0x114671['id']}});})[_0x3970('0x39')](function(){return _0x114671;})[_0x3970('0x43')](function(_0x4cb9c4){logger[_0x3970('0x44')](_0x3970('0x45'),_0x114671['id'],_0x4cb9c4);});}function getOauth2MicrosoftAccessToken(_0x5d642d,_0x4da496){var _0x162bf6={'grant_type':_0x3970('0x46'),'code':_0x5d642d,'scope':getAccessTokenScope(_0x4da496),'redirect_uri':_0x4da496[_0x3970('0x3f')],'client_id':_0x4da496[_0x3970('0x27')],'client_secret':encryptor[_0x3970('0x47')](_0x4da496['data3'])};var _0x22eea2={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x3970('0x1c')]('{TENANT_ID}',_0x4da496[_0x3970('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x162bf6,'json':!![]};return rp(_0x22eea2);}function startRefreshInterval(_0x527ea5){var _0x5a5d6c=schedule[_0x3970('0x48')];if(_0x5a5d6c[_0x527ea5['id']])clearInterval(_0x5a5d6c[_0x527ea5['id']]);_0x5a5d6c[_0x527ea5['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x3970('0x49')](this,{'id':_0x527ea5['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3970('0x48')]=_0x5a5d6c;}function startAllRefreshIntervals(){return db[_0x3970('0x3b')][_0x3970('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x2afb85){var _0x5dc8b7=_0x2afb85[_0x3970('0x14')](function(_0x4724e1){return refreshOauth2MicrosoftAccessToken(_0x4724e1)['then'](function(_0xcbaede){startRefreshInterval(_0xcbaede);});});return Promise['all'](_0x5dc8b7);})[_0x3970('0x43')](function(_0x1ce5c5){var _0x16aaba=_0x1ce5c5?util[_0x3970('0x4b')](_0x1ce5c5,{'showHidden':![],'depth':null}):'';logger[_0x3970('0x44')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x16aaba);});}module[_0x3970('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x393a=['openid','profile','email','offline_access','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','data2','id_token','from','toString','base64','randomBytes','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','value','oauth2Claims','oauth2/','data1','set','stringify','decode','payload','issuer','isAfter','unix','exp','resolve','then','data3','refresh_token','data6','data5','CloudProvider','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x393a,0x1c9));var _0xa393=function(_0x514038,_0x450ef3){_0x514038=_0x514038-0x0;var _0x589720=_0x393a[_0x514038];return _0x589720;};'use strict';var _=require(_0xa393('0x0'));var crypto=require(_0xa393('0x1'));var jwt=require(_0xa393('0x2'));var moment=require(_0xa393('0x3'));var Redis=require(_0xa393('0x4'));var rp=require(_0xa393('0x5'));var util=require(_0xa393('0x6'));var encryptor=require(_0xa393('0x7'));var config=require(_0xa393('0x8'));var logger=require(_0xa393('0x9'))(_0xa393('0xa'));var schedule=require(_0xa393('0xb'));var db=require(_0xa393('0xc'))['db'];config[_0xa393('0xd')]=_[_0xa393('0xe')](config[_0xa393('0xd')],{'host':_0xa393('0xf'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xa393('0x10');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa393('0x11'),_0xa393('0x12'),_0xa393('0x13'),_0xa393('0x14'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0xa393('0x15')],'Dynamics365':[_0xa393('0x11'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xa393('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x32f0a7){var _0x1a4edd=_[_0xa393('0x17')](AZURE_AUTH_SCOPES[_0x32f0a7[_0xa393('0x18')]]);if(_0x32f0a7[_0xa393('0x18')]===_0xa393('0x19'))_0x1a4edd[_0xa393('0x1a')](_0x32f0a7[_0xa393('0x1b')]+_0xa393('0x1c'));return _0x1a4edd[_0xa393('0x1d')]('\x20');}function getAccessTokenScope(_0x1108be){if(_0x1108be[_0xa393('0x18')]===_0xa393('0x1e'))return _0xa393('0x1f');if(_0x1108be[_0xa393('0x18')]===_0xa393('0x19'))return _0x1108be[_0xa393('0x1b')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x13977d,_0x236901){var _0x27e7de=MICROSOFT_AUTH_URL[_0xa393('0x20')](_0xa393('0x21'),_0x13977d[_0xa393('0x22')]);var _0x3630a2=['code',_0xa393('0x23')];var _0x242117=Buffer[_0xa393('0x24')](JSON['stringify']({'id':_0x236901}))[_0xa393('0x25')](_0xa393('0x26'));var _0x1dbab6=crypto[_0xa393('0x27')](0x10)['toString'](_0xa393('0x28'));var _0x1ad011=getAuthorizationScopes(_0x13977d);var _0x5b746e=[{'key':_0xa393('0x29'),'value':_0x13977d['data1']},{'key':_0xa393('0x2a'),'value':encodeURIComponent(_0x3630a2[_0xa393('0x1d')]('\x20'))},{'key':_0xa393('0x2b'),'value':_0x13977d[_0xa393('0x2c')]},{'key':_0xa393('0x2d'),'value':_0xa393('0x2e')},{'key':_0xa393('0x2f'),'value':encodeURIComponent(_0x1ad011)},{'key':_0xa393('0x30'),'value':_0x242117},{'key':_0xa393('0x31'),'value':_0x1dbab6},{'key':_0xa393('0x32'),'value':_0xa393('0x33')}];var _0x387025=_0x27e7de+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa393('0x17')](_0x5b746e,function(_0x58909f){return _0x58909f['key']+'='+_0x58909f[_0xa393('0x34')];})[_0xa393('0x1d')]('&');_0x13977d[_0xa393('0x35')]={'issuer':_0x27e7de[_0xa393('0x20')](_0xa393('0x36'),''),'audience':_0x13977d[_0xa393('0x37')],'state':_0x242117,'nonce':_0x1dbab6};redis[_0xa393('0x38')](_0x242117,JSON[_0xa393('0x39')](_0x13977d));return _0x387025;}function isValidIdToken(_0x28645c,_0x1ed17e){try{var _0x480d17=jwt[_0xa393('0x3a')](_0x28645c,{'complete':!![]});var _0x5e2415=_0x480d17[_0xa393('0x3b')];if(_0x5e2415['iss']!==_0x1ed17e[_0xa393('0x3c')])return![];if(_0x5e2415['aud']!==_0x1ed17e['audience'])return![];if(_0x5e2415['nonce']!==_0x1ed17e[_0xa393('0x31')])return![];if(moment()[_0xa393('0x3d')](moment[_0xa393('0x3e')](_0x5e2415[_0xa393('0x3f')])))return![];return!![];}catch(_0x334937){throw _0x334937;}}function refreshOauth2MicrosoftAccessToken(_0x32e6d3){return Promise[_0xa393('0x40')]()[_0xa393('0x41')](function(){if(_0x32e6d3[_0xa393('0x42')])return _0x32e6d3;return db['CloudProvider']['findOne']({'where':{'id':_0x32e6d3['id']},'raw':!![]});})[_0xa393('0x41')](function(_0x1bcfdc){var _0x3ef367={'grant_type':_0xa393('0x43'),'refresh_token':_0x1bcfdc[_0xa393('0x44')],'scope':getAccessTokenScope(_0x1bcfdc),'redirect_uri':_0x1bcfdc['data4'],'client_id':_0x1bcfdc['data1'],'client_secret':encryptor['decryptString'](_0x1bcfdc[_0xa393('0x42')])};var _0x328720={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa393('0x20')](_0xa393('0x21'),_0x1bcfdc['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3ef367,'json':!![]};return rp(_0x328720);})[_0xa393('0x41')](function(_0x4ea550){_0x32e6d3[_0xa393('0x45')]=_0x4ea550['access_token'];_0x32e6d3[_0xa393('0x44')]=_0x4ea550[_0xa393('0x43')];return db[_0xa393('0x46')]['update']({'data5':_0x32e6d3[_0xa393('0x45')],'data6':_0x32e6d3[_0xa393('0x44')]},{'where':{'id':_0x32e6d3['id']}});})['then'](function(){return _0x32e6d3;})['catch'](function(_0x422721){logger[_0xa393('0x47')](_0xa393('0x48'),_0x32e6d3['id'],_0x422721);});}function getOauth2MicrosoftAccessToken(_0x2caad1,_0x1f2854){var _0x9df3c3={'grant_type':_0xa393('0x49'),'code':_0x2caad1,'scope':getAccessTokenScope(_0x1f2854),'redirect_uri':_0x1f2854['data4'],'client_id':_0x1f2854[_0xa393('0x37')],'client_secret':encryptor['decryptString'](_0x1f2854[_0xa393('0x42')])};var _0x4d30dc={'method':_0xa393('0x4a'),'uri':MICROSOFT_AUTH_URL[_0xa393('0x20')](_0xa393('0x21'),_0x1f2854[_0xa393('0x22')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x9df3c3,'json':!![]};return rp(_0x4d30dc);}function startRefreshInterval(_0x58832b){var _0x343430=schedule[_0xa393('0x4b')];if(_0x343430[_0x58832b['id']])clearInterval(_0x343430[_0x58832b['id']]);_0x343430[_0x58832b['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa393('0x4c')](this,{'id':_0x58832b['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xa393('0x4b')]=_0x343430;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa393('0x41')](function(_0x3bd3e5){var _0x804b2c=_0x3bd3e5['map'](function(_0xd11ff8){return refreshOauth2MicrosoftAccessToken(_0xd11ff8)[_0xa393('0x41')](function(_0x155909){startRefreshInterval(_0x155909);});});return Promise['all'](_0x804b2c);})['catch'](function(_0x631962){var _0x213204=_0x631962?util['inspect'](_0x631962,{'showHidden':![],'depth':null}):'';logger['error'](_0xa393('0x4d'),_0x213204);});}module[_0xa393('0x4e')]={'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 a5bcf02..dd452cb 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 _0xd5f9=['../../config/environment','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x41561b,_0x1a4792){var _0x2fa151=function(_0x12bfee){while(--_0x12bfee){_0x41561b['push'](_0x41561b['shift']());}};_0x2fa151(++_0x1a4792);}(_0xd5f9,0x1f1));var _0x9d5f=function(_0x3e10c0,_0x385bdc){_0x3e10c0=_0x3e10c0-0x0;var _0x2fb415=_0xd5f9[_0x3e10c0];return _0x2fb415;};'use strict';var _=require(_0x9d5f('0x0'));var util=require(_0x9d5f('0x1'));var moment=require(_0x9d5f('0x2'));var BPromise=require(_0x9d5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d5f('0x4'));var db=require(_0x9d5f('0x5'))['db'];var utils=require(_0x9d5f('0x6'));var logger=require(_0x9d5f('0x7'))(_0x9d5f('0x8'));var config=require(_0x9d5f('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1dca4b,_0x2e1c4e,_0x4ac60a){return new BPromise(function(_0x402a35,_0x255389){return client['request'](_0x1dca4b,_0x4ac60a)[_0x9d5f('0xa')](function(_0x241166){logger['info'](_0x9d5f('0xb'),_0x2e1c4e,'request\x20sent');logger[_0x9d5f('0xc')](_0x9d5f('0xd'),_0x2e1c4e,_0x9d5f('0xe'),JSON[_0x9d5f('0xf')](_0x241166));if(_0x241166[_0x9d5f('0x10')]){if(_0x241166['error'][_0x9d5f('0x11')]===0x1f4){logger[_0x9d5f('0x10')](_0x9d5f('0xb'),_0x2e1c4e,_0x241166[_0x9d5f('0x10')][_0x9d5f('0x12')]);return _0x255389(_0x241166[_0x9d5f('0x10')][_0x9d5f('0x12')]);}logger[_0x9d5f('0x10')](_0x9d5f('0xb'),_0x2e1c4e,_0x241166['error']['message']);return _0x402a35(_0x241166['error']['message']);}else{logger[_0x9d5f('0x13')](_0x9d5f('0xb'),_0x2e1c4e,'request\x20sent');_0x402a35(_0x241166[_0x9d5f('0x14')][_0x9d5f('0x12')]);}})[_0x9d5f('0x15')](function(_0x3a9220){logger[_0x9d5f('0x10')]('CloudProvider,\x20%s,\x20%s',_0x2e1c4e,_0x3a9220);_0x255389(_0x3a9220);});});}
\ No newline at end of file
+var _0xb19a=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x56801e,_0x1bf4bc){var _0x54e02d=function(_0x4a5a34){while(--_0x4a5a34){_0x56801e['push'](_0x56801e['shift']());}};_0x54e02d(++_0x1bf4bc);}(_0xb19a,0xd0));var _0xab19=function(_0x3612ca,_0x23946f){_0x3612ca=_0x3612ca-0x0;var _0x494fc5=_0xb19a[_0x3612ca];return _0x494fc5;};'use strict';var _=require(_0xab19('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab19('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab19('0x2'))['db'];var utils=require(_0xab19('0x3'));var logger=require(_0xab19('0x4'))(_0xab19('0x5'));var config=require(_0xab19('0x6'));var jayson=require(_0xab19('0x7'));var client=jayson[_0xab19('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9d5c1d,_0x131291,_0x59d282){return new BPromise(function(_0x300038,_0x479d0b){return client[_0xab19('0x9')](_0x9d5c1d,_0x59d282)[_0xab19('0xa')](function(_0x2c6a67){logger[_0xab19('0xb')](_0xab19('0xc'),_0x131291,_0xab19('0xd'));logger[_0xab19('0xe')](_0xab19('0xf'),_0x131291,_0xab19('0xd'),JSON[_0xab19('0x10')](_0x2c6a67));if(_0x2c6a67[_0xab19('0x11')]){if(_0x2c6a67[_0xab19('0x11')]['code']===0x1f4){logger['error'](_0xab19('0xc'),_0x131291,_0x2c6a67['error'][_0xab19('0x12')]);return _0x479d0b(_0x2c6a67[_0xab19('0x11')][_0xab19('0x12')]);}logger[_0xab19('0x11')](_0xab19('0xc'),_0x131291,_0x2c6a67[_0xab19('0x11')][_0xab19('0x12')]);return _0x300038(_0x2c6a67['error'][_0xab19('0x12')]);}else{logger[_0xab19('0xb')]('CloudProvider,\x20%s,\x20%s',_0x131291,_0xab19('0xd'));_0x300038(_0x2c6a67[_0xab19('0x13')]['message']);}})['catch'](function(_0x2284b8){logger[_0xab19('0x11')](_0xab19('0xc'),_0x131291,_0x2284b8);_0x479d0b(_0x2284b8);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 6138f71..c0e2dee 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x7a54,0x106));var _0x47a5=function(_0x39acaa,_0x1028a4){_0x39acaa=_0x39acaa-0x0;var _0x36ae79=_0x7a54[_0x39acaa];return _0x36ae79;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
+var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3c762a,_0x5bef8e){_0x3c762a=_0x3c762a-0x0;var _0x4a3c2a=_0x5f2f[_0x3c762a];return _0x4a3c2a;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 757e78a..22fe1cf 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 _0x54f3=['exports','STRING','name'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x54f3,0x120));var _0x354f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x54f3[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require('sequelize');module[_0x354f('0x0')]={'name':{'type':Sequelize[_0x354f('0x1')],'unique':_0x354f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x354f('0x1')]},'companyId':{'type':Sequelize[_0x354f('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x354f('0x1')]},'type':{'type':Sequelize[_0x354f('0x1')]},'street':{'type':Sequelize[_0x354f('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x354f('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x354f('0x1')]},'sStreet':{'type':Sequelize[_0x354f('0x1')]},'sPostalCode':{'type':Sequelize[_0x354f('0x1')]},'sCity':{'type':Sequelize[_0x354f('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x354f('0x1')]}};
\ No newline at end of file
+var _0x192f=['sequelize','STRING'];(function(_0x3227c2,_0x22390f){var _0x1dc977=function(_0x34c591){while(--_0x34c591){_0x3227c2['push'](_0x3227c2['shift']());}};_0x1dc977(++_0x22390f);}(_0x192f,0xd6));var _0xf192=function(_0x1256d6,_0x5dc965){_0x1256d6=_0x1256d6-0x0;var _0x70d3fb=_0x192f[_0x1256d6];return _0x70d3fb;};'use strict';var Sequelize=require(_0xf192('0x0'));module['exports']={'name':{'type':Sequelize[_0xf192('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf192('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xf192('0x1')]},'fax':{'type':Sequelize[_0xf192('0x1')]},'type':{'type':Sequelize[_0xf192('0x1')]},'street':{'type':Sequelize[_0xf192('0x1')]},'postalCode':{'type':Sequelize[_0xf192('0x1')]},'city':{'type':Sequelize[_0xf192('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf192('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf192('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xf192('0x1')]},'sCity':{'type':Sequelize[_0xf192('0x1')]},'sCountry':{'type':Sequelize[_0xf192('0x1')]},'description':{'type':Sequelize[_0xf192('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 6047e06..3b669ba 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 _0xc8d3=['count','limit','set','Content-Range','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','index','describe','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','filter','options','CmCompany','includeAll','include','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','ids','findOne','map','getContacts','hasOwnProperty','nolimit','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','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','status','end','json','offset','undefined'];(function(_0x2162e0,_0xd18181){var _0x162d05=function(_0x421403){while(--_0x421403){_0x2162e0['push'](_0x2162e0['shift']());}};_0x162d05(++_0xd18181);}(_0xc8d3,0x19c));var _0x3c8d=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0xc8d3[_0x2d89ce];return _0x3fad10;};'use strict';var emlformat=require(_0x3c8d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3c8d('0x1'));var rp=require(_0x3c8d('0x2'));var moment=require(_0x3c8d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3c8d('0x4'));var util=require(_0x3c8d('0x5'));var path=require('path');var sox=require(_0x3c8d('0x6'));var csv=require('to-csv');var ejs=require(_0x3c8d('0x7'));var fs=require('fs');var fs_extra=require(_0x3c8d('0x8'));var _=require(_0x3c8d('0x9'));var squel=require(_0x3c8d('0xa'));var crypto=require(_0x3c8d('0xb'));var jsforce=require(_0x3c8d('0xc'));var deskjs=require(_0x3c8d('0xd'));var toCsv=require(_0x3c8d('0xe'));var querystring=require(_0x3c8d('0xf'));var Papa=require('papaparse');var Redis=require(_0x3c8d('0x10'));var authService=require(_0x3c8d('0x11'));var qs=require(_0x3c8d('0x12'));var as=require(_0x3c8d('0x13'));var hardwareService=require(_0x3c8d('0x14'));var logger=require(_0x3c8d('0x15'))(_0x3c8d('0x16'));var utils=require(_0x3c8d('0x17'));var config=require(_0x3c8d('0x18'));var licenseUtil=require(_0x3c8d('0x19'));var db=require(_0x3c8d('0x1a'))['db'];function respondWithStatusCode(_0x1668be,_0x276da0){_0x276da0=_0x276da0||0xcc;return function(_0x2fb365){if(_0x2fb365){return _0x1668be[_0x3c8d('0x1b')](_0x276da0);}return _0x1668be[_0x3c8d('0x1c')](_0x276da0)[_0x3c8d('0x1d')]();};}function respondWithResult(_0x336afa,_0x5195d7){_0x5195d7=_0x5195d7||0xc8;return function(_0x37ab99){if(_0x37ab99){return _0x336afa[_0x3c8d('0x1c')](_0x5195d7)[_0x3c8d('0x1e')](_0x37ab99);}};}function respondWithFilteredResult(_0x31638e,_0x203a9b){return function(_0x36b170){if(_0x36b170){var _0x2121f1=typeof _0x203a9b[_0x3c8d('0x1f')]===_0x3c8d('0x20')&&typeof _0x203a9b['limit']===_0x3c8d('0x20');var _0xf02acf=_0x36b170[_0x3c8d('0x21')];var _0x21159c=_0x2121f1?0x0:_0x203a9b[_0x3c8d('0x1f')];var _0x234cf5=_0x2121f1?_0x36b170[_0x3c8d('0x21')]:_0x203a9b[_0x3c8d('0x1f')]+_0x203a9b[_0x3c8d('0x22')];var _0x4e0502;if(_0x234cf5>=_0xf02acf){_0x234cf5=_0xf02acf;_0x4e0502=0xc8;}else{_0x4e0502=0xce;}_0x31638e[_0x3c8d('0x1c')](_0x4e0502);return _0x31638e[_0x3c8d('0x23')](_0x3c8d('0x24'),_0x21159c+'-'+_0x234cf5+'/'+_0xf02acf)[_0x3c8d('0x1e')](_0x36b170);}return null;};}function patchUpdates(_0x1f9cc2){return function(_0x4a01e9){try{jsonpatch['apply'](_0x4a01e9,_0x1f9cc2,!![]);}catch(_0x4a510d){return BPromise['reject'](_0x4a510d);}return _0x4a01e9[_0x3c8d('0x25')]();};}function saveUpdates(_0x186e7a,_0x1b6cfc){return function(_0x52e249){if(_0x52e249){return _0x52e249[_0x3c8d('0x26')](_0x186e7a)[_0x3c8d('0x27')](function(_0x833bfb){return _0x833bfb;});}return null;};}function removeEntity(_0x2a71a6,_0x2da356){return function(_0x5330bc){if(_0x5330bc){return _0x5330bc[_0x3c8d('0x28')]()[_0x3c8d('0x27')](function(){var _0x5489d8=_0x5330bc[_0x3c8d('0x29')]({'plain':!![]});var _0x3803c8=_0x3c8d('0x2a');return db[_0x3c8d('0x2b')][_0x3c8d('0x28')]({'where':{'type':_0x3803c8,'resourceId':_0x5489d8['id']}})[_0x3c8d('0x27')](function(){return _0x5330bc;});})[_0x3c8d('0x27')](function(){_0x2a71a6[_0x3c8d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cd0c8,_0x15e539){return function(_0x2bebdf){if(!_0x2bebdf){_0x4cd0c8[_0x3c8d('0x1b')](0x194);}return _0x2bebdf;};}function handleError(_0x5d9596,_0x1b3daf){_0x1b3daf=_0x1b3daf||0x1f4;return function(_0xd31828){logger[_0x3c8d('0x2c')](_0xd31828[_0x3c8d('0x2d')]);if(_0xd31828[_0x3c8d('0x2e')]){delete _0xd31828['name'];}_0x5d9596[_0x3c8d('0x1c')](_0x1b3daf)['send'](_0xd31828);};}exports[_0x3c8d('0x2f')]=function(_0x11d7f,_0x1fd621){var _0x2c0d0a={},_0x40d36b={},_0x25e0bb={'count':0x0,'rows':[]};return db['CmCompany'][_0x3c8d('0x30')]()[_0x3c8d('0x27')](function(_0x64437e){_0x40d36b[_0x3c8d('0x31')]=_[_0x3c8d('0x32')](_0x64437e);_0x40d36b['query']=_[_0x3c8d('0x32')](_0x11d7f[_0x3c8d('0x33')]);_0x40d36b[_0x3c8d('0x34')]=_['intersection'](_0x40d36b[_0x3c8d('0x31')],_0x40d36b[_0x3c8d('0x33')]);_0x2c0d0a['attributes']=_[_0x3c8d('0x35')](_0x40d36b[_0x3c8d('0x31')],qs[_0x3c8d('0x36')](_0x11d7f[_0x3c8d('0x33')][_0x3c8d('0x36')]));_0x2c0d0a[_0x3c8d('0x37')]=_0x2c0d0a[_0x3c8d('0x37')][_0x3c8d('0x38')]?_0x2c0d0a[_0x3c8d('0x37')]:_0x40d36b[_0x3c8d('0x31')];if(!_0x11d7f['query']['hasOwnProperty']('nolimit')){_0x2c0d0a[_0x3c8d('0x22')]=qs['limit'](_0x11d7f['query'][_0x3c8d('0x22')]);_0x2c0d0a['offset']=qs[_0x3c8d('0x1f')](_0x11d7f['query'][_0x3c8d('0x1f')]);}_0x2c0d0a[_0x3c8d('0x39')]=qs[_0x3c8d('0x3a')](_0x11d7f['query'][_0x3c8d('0x3a')]);_0x2c0d0a[_0x3c8d('0x3b')]=qs['filters'](_[_0x3c8d('0x3c')](_0x11d7f['query'],_0x40d36b['filters']),_0x64437e);if(_0x11d7f[_0x3c8d('0x33')]['filter']){_0x2c0d0a[_0x3c8d('0x3b')]=_[_0x3c8d('0x3d')](_0x2c0d0a[_0x3c8d('0x3b')],{'$or':_['map'](_0x2c0d0a[_0x3c8d('0x37')],function(_0x349918){var _0x5952f5={};_0x5952f5[_0x349918]={'$like':'%'+_0x11d7f[_0x3c8d('0x33')][_0x3c8d('0x3e')]+'%'};return _0x5952f5;})});}_0x2c0d0a=_[_0x3c8d('0x3d')]({},_0x2c0d0a,_0x11d7f[_0x3c8d('0x3f')]);var _0x4ee8be={'where':_0x2c0d0a[_0x3c8d('0x3b')]};return db[_0x3c8d('0x40')]['count'](_0x4ee8be)['then'](function(_0x2a80e3){_0x25e0bb[_0x3c8d('0x21')]=_0x2a80e3;if(_0x11d7f[_0x3c8d('0x33')][_0x3c8d('0x41')]){_0x2c0d0a[_0x3c8d('0x42')]=[{'all':!![]}];}return db[_0x3c8d('0x40')]['findAll'](_0x2c0d0a);})['then'](function(_0x528018){_0x25e0bb['rows']=_0x528018;return _0x25e0bb;})['then'](respondWithFilteredResult(_0x1fd621,_0x2c0d0a))[_0x3c8d('0x43')](handleError(_0x1fd621,null));})[_0x3c8d('0x43')](handleError(_0x1fd621,null));};exports[_0x3c8d('0x44')]=function(_0x3320e7,_0x220ecb){var _0x505548={'raw':![],'where':{'id':_0x3320e7[_0x3c8d('0x45')]['id']}},_0x3f5e76={};_0x3f5e76[_0x3c8d('0x31')]=_[_0x3c8d('0x32')](db[_0x3c8d('0x40')][_0x3c8d('0x46')]);_0x3f5e76['query']=_[_0x3c8d('0x32')](_0x3320e7[_0x3c8d('0x33')]);_0x3f5e76[_0x3c8d('0x34')]=_[_0x3c8d('0x35')](_0x3f5e76[_0x3c8d('0x31')],_0x3f5e76['query']);_0x505548[_0x3c8d('0x37')]=_['intersection'](_0x3f5e76['model'],qs['fields'](_0x3320e7[_0x3c8d('0x33')][_0x3c8d('0x36')]));_0x505548[_0x3c8d('0x37')]=_0x505548[_0x3c8d('0x37')]['length']?_0x505548['attributes']:_0x3f5e76['model'];if(_0x3320e7[_0x3c8d('0x33')][_0x3c8d('0x41')]){_0x505548[_0x3c8d('0x42')]=[{'all':!![]}];}_0x505548=_['merge']({},_0x505548,_0x3320e7[_0x3c8d('0x3f')]);return db['CmCompany'][_0x3c8d('0x47')](_0x505548)['then'](handleEntityNotFound(_0x220ecb,null))[_0x3c8d('0x27')](respondWithResult(_0x220ecb,null))[_0x3c8d('0x43')](handleError(_0x220ecb,null));};exports[_0x3c8d('0x48')]=function(_0x54825b,_0x422445){return db[_0x3c8d('0x40')][_0x3c8d('0x48')](_0x54825b[_0x3c8d('0x49')],{})[_0x3c8d('0x27')](function(_0x5830a6){var _0x1305ba=_0x54825b['user'][_0x3c8d('0x29')]({'plain':!![]});if(!_0x1305ba)throw new Error(_0x3c8d('0x4a'));if(_0x1305ba[_0x3c8d('0x4b')]==='user'){var _0xde7bd1=_0x5830a6[_0x3c8d('0x29')]({'plain':!![]});var _0x460f30=_0x3c8d('0x2a');return db[_0x3c8d('0x4c')][_0x3c8d('0x47')]({'where':{'name':_0x460f30,'userProfileId':_0x1305ba[_0x3c8d('0x4d')]},'raw':!![]})[_0x3c8d('0x27')](function(_0x2a1b67){if(_0x2a1b67&&_0x2a1b67[_0x3c8d('0x4e')]===0x0){return db[_0x3c8d('0x2b')][_0x3c8d('0x48')]({'name':_0xde7bd1[_0x3c8d('0x2e')],'resourceId':_0xde7bd1['id'],'type':_0x2a1b67[_0x3c8d('0x2e')],'sectionId':_0x2a1b67['id']},{})[_0x3c8d('0x27')](function(){return _0x5830a6;});}else{return _0x5830a6;}})[_0x3c8d('0x43')](function(_0x26f45a){logger['error'](_0x3c8d('0x4f'),_0x26f45a);throw _0x26f45a;});}return _0x5830a6;})[_0x3c8d('0x27')](respondWithResult(_0x422445,0xc9))['catch'](handleError(_0x422445,null));};exports[_0x3c8d('0x26')]=function(_0x5a3897,_0x4c182f){if(_0x5a3897[_0x3c8d('0x49')]['id']){delete _0x5a3897[_0x3c8d('0x49')]['id'];}return db[_0x3c8d('0x40')][_0x3c8d('0x47')]({'where':{'id':_0x5a3897[_0x3c8d('0x45')]['id']}})[_0x3c8d('0x27')](handleEntityNotFound(_0x4c182f,null))[_0x3c8d('0x27')](saveUpdates(_0x5a3897['body'],null))['then'](respondWithResult(_0x4c182f,null))[_0x3c8d('0x43')](handleError(_0x4c182f,null));};exports[_0x3c8d('0x28')]=function(_0x303bbc,_0x5d8c95){return db['CmCompany'][_0x3c8d('0x47')]({'where':{'id':_0x303bbc[_0x3c8d('0x45')]['id']}})[_0x3c8d('0x27')](handleEntityNotFound(_0x5d8c95,null))[_0x3c8d('0x27')](removeEntity(_0x5d8c95,null))[_0x3c8d('0x43')](handleError(_0x5d8c95,null));};exports[_0x3c8d('0x30')]=function(_0x1df4f2,_0x5764f9){return db[_0x3c8d('0x40')][_0x3c8d('0x30')]()[_0x3c8d('0x27')](respondWithResult(_0x5764f9,null))['catch'](handleError(_0x5764f9,null));};exports[_0x3c8d('0x50')]=function(_0x3e3318,_0xf84863,_0x4ea1ec){return db[_0x3c8d('0x51')]['find']({'where':{'id':_0x3e3318[_0x3c8d('0x45')]['id']}})[_0x3c8d('0x27')](handleEntityNotFound(_0xf84863,null))[_0x3c8d('0x27')](function(_0x1b8fbc){if(_0x1b8fbc){return _0x1b8fbc[_0x3c8d('0x50')](_0x3e3318[_0x3c8d('0x49')]['ids'],_[_0x3c8d('0x52')](_0x3e3318[_0x3c8d('0x49')],[_0x3c8d('0x53'),'id'])||{});}})[_0x3c8d('0x27')](respondWithResult(_0xf84863,null))[_0x3c8d('0x43')](handleError(_0xf84863,null));};exports['getContacts']=function(_0x5e80c9,_0xefad3c,_0x523645){var _0x3f8479={};var _0x171cb4={};var _0x2429cf;var _0x3d8fa2;return db[_0x3c8d('0x40')][_0x3c8d('0x54')]({'where':{'id':_0x5e80c9[_0x3c8d('0x45')]['id']}})[_0x3c8d('0x27')](handleEntityNotFound(_0xefad3c,null))[_0x3c8d('0x27')](function(_0x297b26){if(_0x297b26){_0x2429cf=_0x297b26;_0x171cb4['model']=_[_0x3c8d('0x32')](db[_0x3c8d('0x51')][_0x3c8d('0x46')]);_0x171cb4['query']=_[_0x3c8d('0x32')](_0x5e80c9[_0x3c8d('0x33')]);_0x171cb4['filters']=_['intersection'](_0x171cb4[_0x3c8d('0x31')],_0x171cb4['query']);_0x3f8479[_0x3c8d('0x37')]=_[_0x3c8d('0x35')](_0x171cb4['model'],qs[_0x3c8d('0x36')](_0x5e80c9[_0x3c8d('0x33')][_0x3c8d('0x36')]));_0x3f8479[_0x3c8d('0x37')]=_0x3f8479[_0x3c8d('0x37')]['length']?_0x3f8479[_0x3c8d('0x37')]:_0x171cb4[_0x3c8d('0x31')];_0x3f8479[_0x3c8d('0x39')]=qs[_0x3c8d('0x3a')](_0x5e80c9['query'][_0x3c8d('0x3a')]);_0x3f8479[_0x3c8d('0x3b')]=qs['filters'](_['pick'](_0x5e80c9[_0x3c8d('0x33')],_0x171cb4[_0x3c8d('0x34')]));if(_0x5e80c9[_0x3c8d('0x33')][_0x3c8d('0x3e')]){_0x3f8479[_0x3c8d('0x3b')]=_[_0x3c8d('0x3d')](_0x3f8479[_0x3c8d('0x3b')],{'$or':_[_0x3c8d('0x55')](_0x3f8479[_0x3c8d('0x37')],function(_0x2abc8f){var _0x27f5b8={};_0x27f5b8[_0x2abc8f]={'$like':'%'+_0x5e80c9['query']['filter']+'%'};return _0x27f5b8;})});}_0x3f8479=_[_0x3c8d('0x3d')]({},_0x3f8479,_0x5e80c9[_0x3c8d('0x3f')]);return _0x2429cf[_0x3c8d('0x56')](_0x3f8479);}})[_0x3c8d('0x27')](function(_0x1c90fa){if(_0x1c90fa){_0x3d8fa2=_0x1c90fa[_0x3c8d('0x38')];if(!_0x5e80c9[_0x3c8d('0x33')][_0x3c8d('0x57')](_0x3c8d('0x58'))){_0x3f8479['limit']=qs[_0x3c8d('0x22')](_0x5e80c9[_0x3c8d('0x33')]['limit']);_0x3f8479[_0x3c8d('0x1f')]=qs[_0x3c8d('0x1f')](_0x5e80c9[_0x3c8d('0x33')]['offset']);}return _0x2429cf[_0x3c8d('0x56')](_0x3f8479);}})[_0x3c8d('0x27')](function(_0x5cb35e){if(_0x5cb35e){return _0x5cb35e?{'count':_0x3d8fa2,'rows':_0x5cb35e}:null;}})[_0x3c8d('0x27')](respondWithResult(_0xefad3c,null))['catch'](handleError(_0xefad3c,null));};
\ No newline at end of file
+var _0x3c2a=['save','then','destroy','get','Companies','stack','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','name','error','update','CmContact','ids','omit','getContacts','map','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','apply','reject'];(function(_0x7413e,_0x57af5b){var _0x331148=function(_0x2ce64f){while(--_0x2ce64f){_0x7413e['push'](_0x7413e['shift']());}};_0x331148(++_0x57af5b);}(_0x3c2a,0xd2));var _0xa3c2=function(_0x449afc,_0xc77bc9){_0x449afc=_0x449afc-0x0;var _0x166e11=_0x3c2a[_0x449afc];return _0x166e11;};'use strict';var emlformat=require(_0xa3c2('0x0'));var rimraf=require(_0xa3c2('0x1'));var zipdir=require(_0xa3c2('0x2'));var jsonpatch=require(_0xa3c2('0x3'));var rp=require(_0xa3c2('0x4'));var moment=require(_0xa3c2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa3c2('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa3c2('0x7'));var csv=require(_0xa3c2('0x8'));var ejs=require(_0xa3c2('0x9'));var fs=require('fs');var fs_extra=require(_0xa3c2('0xa'));var _=require('lodash');var squel=require(_0xa3c2('0xb'));var crypto=require(_0xa3c2('0xc'));var jsforce=require(_0xa3c2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa3c2('0xe'));var Papa=require(_0xa3c2('0xf'));var Redis=require(_0xa3c2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa3c2('0x11'));var as=require(_0xa3c2('0x12'));var hardwareService=require(_0xa3c2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa3c2('0x14'));var config=require(_0xa3c2('0x15'));var licenseUtil=require(_0xa3c2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fe760,_0x308f19){_0x308f19=_0x308f19||0xcc;return function(_0x3af865){if(_0x3af865){return _0x4fe760[_0xa3c2('0x17')](_0x308f19);}return _0x4fe760[_0xa3c2('0x18')](_0x308f19)[_0xa3c2('0x19')]();};}function respondWithResult(_0x76d68f,_0x1d19df){_0x1d19df=_0x1d19df||0xc8;return function(_0x1dee63){if(_0x1dee63){return _0x76d68f[_0xa3c2('0x18')](_0x1d19df)[_0xa3c2('0x1a')](_0x1dee63);}};}function respondWithFilteredResult(_0x2adbc5,_0x1c6a8a){return function(_0x200873){if(_0x200873){var _0x204cfa=typeof _0x1c6a8a['offset']===_0xa3c2('0x1b')&&typeof _0x1c6a8a['limit']===_0xa3c2('0x1b');var _0x3b3c8c=_0x200873[_0xa3c2('0x1c')];var _0x34632f=_0x204cfa?0x0:_0x1c6a8a[_0xa3c2('0x1d')];var _0x319a71=_0x204cfa?_0x200873[_0xa3c2('0x1c')]:_0x1c6a8a[_0xa3c2('0x1d')]+_0x1c6a8a[_0xa3c2('0x1e')];var _0x248b00;if(_0x319a71>=_0x3b3c8c){_0x319a71=_0x3b3c8c;_0x248b00=0xc8;}else{_0x248b00=0xce;}_0x2adbc5[_0xa3c2('0x18')](_0x248b00);return _0x2adbc5['set']('Content-Range',_0x34632f+'-'+_0x319a71+'/'+_0x3b3c8c)[_0xa3c2('0x1a')](_0x200873);}return null;};}function patchUpdates(_0x39fd47){return function(_0x2f30d1){try{jsonpatch[_0xa3c2('0x1f')](_0x2f30d1,_0x39fd47,!![]);}catch(_0xad598b){return BPromise[_0xa3c2('0x20')](_0xad598b);}return _0x2f30d1[_0xa3c2('0x21')]();};}function saveUpdates(_0x2d2fcb,_0x51d686){return function(_0x994b3b){if(_0x994b3b){return _0x994b3b['update'](_0x2d2fcb)[_0xa3c2('0x22')](function(_0x57458e){return _0x57458e;});}return null;};}function removeEntity(_0x20b0fa,_0x2809da){return function(_0xcc1f3a){if(_0xcc1f3a){return _0xcc1f3a[_0xa3c2('0x23')]()[_0xa3c2('0x22')](function(){var _0x31bf95=_0xcc1f3a[_0xa3c2('0x24')]({'plain':!![]});var _0x4daa46=_0xa3c2('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x4daa46,'resourceId':_0x31bf95['id']}})[_0xa3c2('0x22')](function(){return _0xcc1f3a;});})[_0xa3c2('0x22')](function(){_0x20b0fa[_0xa3c2('0x18')](0xcc)[_0xa3c2('0x19')]();});}};}function handleEntityNotFound(_0x4281c5,_0x1cce99){return function(_0x53c0dc){if(!_0x53c0dc){_0x4281c5['sendStatus'](0x194);}return _0x53c0dc;};}function handleError(_0x34eed4,_0x10c8c3){_0x10c8c3=_0x10c8c3||0x1f4;return function(_0x5ef712){logger['error'](_0x5ef712[_0xa3c2('0x26')]);if(_0x5ef712['name']){delete _0x5ef712['name'];}_0x34eed4[_0xa3c2('0x18')](_0x10c8c3)[_0xa3c2('0x27')](_0x5ef712);};}exports[_0xa3c2('0x28')]=function(_0x685103,_0x28f3b7){var _0x2d0fa8={},_0x281903={},_0x367a53={'count':0x0,'rows':[]};return db[_0xa3c2('0x29')][_0xa3c2('0x2a')]()['then'](function(_0x2b4274){_0x281903[_0xa3c2('0x2b')]=_[_0xa3c2('0x2c')](_0x2b4274);_0x281903[_0xa3c2('0x2d')]=_[_0xa3c2('0x2c')](_0x685103[_0xa3c2('0x2d')]);_0x281903['filters']=_[_0xa3c2('0x2e')](_0x281903['model'],_0x281903[_0xa3c2('0x2d')]);_0x2d0fa8[_0xa3c2('0x2f')]=_['intersection'](_0x281903[_0xa3c2('0x2b')],qs['fields'](_0x685103[_0xa3c2('0x2d')][_0xa3c2('0x30')]));_0x2d0fa8[_0xa3c2('0x2f')]=_0x2d0fa8['attributes'][_0xa3c2('0x31')]?_0x2d0fa8[_0xa3c2('0x2f')]:_0x281903[_0xa3c2('0x2b')];if(!_0x685103[_0xa3c2('0x2d')]['hasOwnProperty']('nolimit')){_0x2d0fa8[_0xa3c2('0x1e')]=qs[_0xa3c2('0x1e')](_0x685103[_0xa3c2('0x2d')][_0xa3c2('0x1e')]);_0x2d0fa8[_0xa3c2('0x1d')]=qs[_0xa3c2('0x1d')](_0x685103[_0xa3c2('0x2d')][_0xa3c2('0x1d')]);}_0x2d0fa8['order']=qs['sort'](_0x685103['query'][_0xa3c2('0x32')]);_0x2d0fa8[_0xa3c2('0x33')]=qs[_0xa3c2('0x34')](_[_0xa3c2('0x35')](_0x685103[_0xa3c2('0x2d')],_0x281903[_0xa3c2('0x34')]),_0x2b4274);if(_0x685103['query'][_0xa3c2('0x36')]){_0x2d0fa8['where']=_[_0xa3c2('0x37')](_0x2d0fa8[_0xa3c2('0x33')],{'$or':_['map'](_0x2d0fa8[_0xa3c2('0x2f')],function(_0x5eb571){var _0x5a7a59={};_0x5a7a59[_0x5eb571]={'$like':'%'+_0x685103[_0xa3c2('0x2d')][_0xa3c2('0x36')]+'%'};return _0x5a7a59;})});}_0x2d0fa8=_[_0xa3c2('0x37')]({},_0x2d0fa8,_0x685103[_0xa3c2('0x38')]);var _0xe84387={'where':_0x2d0fa8[_0xa3c2('0x33')]};return db[_0xa3c2('0x29')][_0xa3c2('0x1c')](_0xe84387)[_0xa3c2('0x22')](function(_0x3e4ef9){_0x367a53[_0xa3c2('0x1c')]=_0x3e4ef9;if(_0x685103[_0xa3c2('0x2d')][_0xa3c2('0x39')]){_0x2d0fa8[_0xa3c2('0x3a')]=[{'all':!![]}];}return db['CmCompany'][_0xa3c2('0x3b')](_0x2d0fa8);})[_0xa3c2('0x22')](function(_0xc02640){_0x367a53['rows']=_0xc02640;return _0x367a53;})[_0xa3c2('0x22')](respondWithFilteredResult(_0x28f3b7,_0x2d0fa8))['catch'](handleError(_0x28f3b7,null));})['catch'](handleError(_0x28f3b7,null));};exports['show']=function(_0x4312df,_0x3a71ba){var _0x102746={'raw':![],'where':{'id':_0x4312df[_0xa3c2('0x3c')]['id']}},_0x5343a7={};_0x5343a7[_0xa3c2('0x2b')]=_[_0xa3c2('0x2c')](db[_0xa3c2('0x29')][_0xa3c2('0x3d')]);_0x5343a7[_0xa3c2('0x2d')]=_['keys'](_0x4312df[_0xa3c2('0x2d')]);_0x5343a7[_0xa3c2('0x34')]=_[_0xa3c2('0x2e')](_0x5343a7[_0xa3c2('0x2b')],_0x5343a7[_0xa3c2('0x2d')]);_0x102746[_0xa3c2('0x2f')]=_['intersection'](_0x5343a7['model'],qs[_0xa3c2('0x30')](_0x4312df[_0xa3c2('0x2d')][_0xa3c2('0x30')]));_0x102746[_0xa3c2('0x2f')]=_0x102746[_0xa3c2('0x2f')][_0xa3c2('0x31')]?_0x102746['attributes']:_0x5343a7[_0xa3c2('0x2b')];if(_0x4312df[_0xa3c2('0x2d')][_0xa3c2('0x39')]){_0x102746['include']=[{'all':!![]}];}_0x102746=_[_0xa3c2('0x37')]({},_0x102746,_0x4312df[_0xa3c2('0x38')]);return db[_0xa3c2('0x29')][_0xa3c2('0x3e')](_0x102746)[_0xa3c2('0x22')](handleEntityNotFound(_0x3a71ba,null))['then'](respondWithResult(_0x3a71ba,null))[_0xa3c2('0x3f')](handleError(_0x3a71ba,null));};exports[_0xa3c2('0x40')]=function(_0x2ae14c,_0x5b5c42){return db[_0xa3c2('0x29')][_0xa3c2('0x40')](_0x2ae14c[_0xa3c2('0x41')],{})[_0xa3c2('0x22')](function(_0x54c0b0){var _0x132b20=_0x2ae14c[_0xa3c2('0x42')][_0xa3c2('0x24')]({'plain':!![]});if(!_0x132b20)throw new Error(_0xa3c2('0x43'));if(_0x132b20['role']===_0xa3c2('0x42')){var _0x7a5996=_0x54c0b0[_0xa3c2('0x24')]({'plain':!![]});var _0x496589='Companies';return db[_0xa3c2('0x44')][_0xa3c2('0x3e')]({'where':{'name':_0x496589,'userProfileId':_0x132b20[_0xa3c2('0x45')]},'raw':!![]})['then'](function(_0x199817){if(_0x199817&&_0x199817[_0xa3c2('0x46')]===0x0){return db[_0xa3c2('0x47')][_0xa3c2('0x40')]({'name':_0x7a5996[_0xa3c2('0x48')],'resourceId':_0x7a5996['id'],'type':_0x199817[_0xa3c2('0x48')],'sectionId':_0x199817['id']},{})['then'](function(){return _0x54c0b0;});}else{return _0x54c0b0;}})['catch'](function(_0x12f114){logger[_0xa3c2('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12f114);throw _0x12f114;});}return _0x54c0b0;})['then'](respondWithResult(_0x5b5c42,0xc9))[_0xa3c2('0x3f')](handleError(_0x5b5c42,null));};exports[_0xa3c2('0x4a')]=function(_0x5b64cc,_0x3bdb8c){if(_0x5b64cc[_0xa3c2('0x41')]['id']){delete _0x5b64cc[_0xa3c2('0x41')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x5b64cc[_0xa3c2('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3bdb8c,null))['then'](saveUpdates(_0x5b64cc[_0xa3c2('0x41')],null))['then'](respondWithResult(_0x3bdb8c,null))[_0xa3c2('0x3f')](handleError(_0x3bdb8c,null));};exports['destroy']=function(_0x340a2c,_0x459de2){return db[_0xa3c2('0x29')][_0xa3c2('0x3e')]({'where':{'id':_0x340a2c[_0xa3c2('0x3c')]['id']}})[_0xa3c2('0x22')](handleEntityNotFound(_0x459de2,null))[_0xa3c2('0x22')](removeEntity(_0x459de2,null))['catch'](handleError(_0x459de2,null));};exports[_0xa3c2('0x2a')]=function(_0x285fe7,_0x4bc940){return db[_0xa3c2('0x29')][_0xa3c2('0x2a')]()[_0xa3c2('0x22')](respondWithResult(_0x4bc940,null))[_0xa3c2('0x3f')](handleError(_0x4bc940,null));};exports['addContacts']=function(_0x10c0c1,_0x160a97,_0x17fbfb){return db[_0xa3c2('0x4b')][_0xa3c2('0x3e')]({'where':{'id':_0x10c0c1[_0xa3c2('0x3c')]['id']}})[_0xa3c2('0x22')](handleEntityNotFound(_0x160a97,null))['then'](function(_0x4a2094){if(_0x4a2094){return _0x4a2094['addContacts'](_0x10c0c1[_0xa3c2('0x41')][_0xa3c2('0x4c')],_[_0xa3c2('0x4d')](_0x10c0c1[_0xa3c2('0x41')],[_0xa3c2('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x160a97,null))[_0xa3c2('0x3f')](handleError(_0x160a97,null));};exports[_0xa3c2('0x4e')]=function(_0x27cecd,_0x22bba1,_0x7cba83){var _0x21e7a5={};var _0x4ed0dd={};var _0x598894;var _0x48105c;return db[_0xa3c2('0x29')]['findOne']({'where':{'id':_0x27cecd[_0xa3c2('0x3c')]['id']}})[_0xa3c2('0x22')](handleEntityNotFound(_0x22bba1,null))[_0xa3c2('0x22')](function(_0x155971){if(_0x155971){_0x598894=_0x155971;_0x4ed0dd[_0xa3c2('0x2b')]=_[_0xa3c2('0x2c')](db['CmContact'][_0xa3c2('0x3d')]);_0x4ed0dd['query']=_[_0xa3c2('0x2c')](_0x27cecd[_0xa3c2('0x2d')]);_0x4ed0dd[_0xa3c2('0x34')]=_[_0xa3c2('0x2e')](_0x4ed0dd[_0xa3c2('0x2b')],_0x4ed0dd['query']);_0x21e7a5[_0xa3c2('0x2f')]=_['intersection'](_0x4ed0dd[_0xa3c2('0x2b')],qs[_0xa3c2('0x30')](_0x27cecd['query'][_0xa3c2('0x30')]));_0x21e7a5[_0xa3c2('0x2f')]=_0x21e7a5['attributes'][_0xa3c2('0x31')]?_0x21e7a5[_0xa3c2('0x2f')]:_0x4ed0dd[_0xa3c2('0x2b')];_0x21e7a5['order']=qs['sort'](_0x27cecd[_0xa3c2('0x2d')][_0xa3c2('0x32')]);_0x21e7a5[_0xa3c2('0x33')]=qs['filters'](_['pick'](_0x27cecd['query'],_0x4ed0dd[_0xa3c2('0x34')]));if(_0x27cecd['query'][_0xa3c2('0x36')]){_0x21e7a5[_0xa3c2('0x33')]=_[_0xa3c2('0x37')](_0x21e7a5['where'],{'$or':_[_0xa3c2('0x4f')](_0x21e7a5[_0xa3c2('0x2f')],function(_0x258bc6){var _0x93d41f={};_0x93d41f[_0x258bc6]={'$like':'%'+_0x27cecd[_0xa3c2('0x2d')][_0xa3c2('0x36')]+'%'};return _0x93d41f;})});}_0x21e7a5=_[_0xa3c2('0x37')]({},_0x21e7a5,_0x27cecd[_0xa3c2('0x38')]);return _0x598894['getContacts'](_0x21e7a5);}})[_0xa3c2('0x22')](function(_0xe6c1fe){if(_0xe6c1fe){_0x48105c=_0xe6c1fe['length'];if(!_0x27cecd[_0xa3c2('0x2d')]['hasOwnProperty'](_0xa3c2('0x50'))){_0x21e7a5[_0xa3c2('0x1e')]=qs[_0xa3c2('0x1e')](_0x27cecd[_0xa3c2('0x2d')][_0xa3c2('0x1e')]);_0x21e7a5[_0xa3c2('0x1d')]=qs[_0xa3c2('0x1d')](_0x27cecd['query'][_0xa3c2('0x1d')]);}return _0x598894[_0xa3c2('0x4e')](_0x21e7a5);}})['then'](function(_0x6cd16e){if(_0x6cd16e){return _0x6cd16e?{'count':_0x48105c,'rows':_0x6cd16e}:null;}})[_0xa3c2('0x22')](respondWithResult(_0x22bba1,null))['catch'](handleError(_0x22bba1,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 4f30470..58ec5a8 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 _0x9879=['cm_companies','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0xca2360,_0x5d7eb2){var _0xa8b24b=function(_0x5b5381){while(--_0x5b5381){_0xca2360['push'](_0xca2360['shift']());}};_0xa8b24b(++_0x5d7eb2);}(_0x9879,0xa6));var _0x9987=function(_0xcd3673,_0x327208){_0xcd3673=_0xcd3673-0x0;var _0x22a7c4=_0x9879[_0xcd3673];return _0x22a7c4;};'use strict';var _=require('lodash');var util=require(_0x9987('0x0'));var logger=require(_0x9987('0x1'))(_0x9987('0x2'));var moment=require(_0x9987('0x3'));var BPromise=require(_0x9987('0x4'));var rp=require(_0x9987('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9987('0x6'));var attributes=require(_0x9987('0x7'));module[_0x9987('0x8')]=function(_0x1a7b0f,_0x11cfa0){return _0x1a7b0f[_0x9987('0x9')]('CmCompany',attributes,{'tableName':_0x9987('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b4c=['moment','bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2b4c,0x1de));var _0xc2b4=function(_0x1e3c04,_0x5bb966){_0x1e3c04=_0x1e3c04-0x0;var _0x4f89bb=_0x2b4c[_0x1e3c04];return _0x4f89bb;};'use strict';var _=require(_0xc2b4('0x0'));var util=require(_0xc2b4('0x1'));var logger=require('../../config/logger')(_0xc2b4('0x2'));var moment=require(_0xc2b4('0x3'));var BPromise=require(_0xc2b4('0x4'));var rp=require(_0xc2b4('0x5'));var fs=require('fs');var path=require(_0xc2b4('0x6'));var rimraf=require(_0xc2b4('0x7'));var config=require('../../config/environment');var attributes=require(_0xc2b4('0x8'));module[_0xc2b4('0x9')]=function(_0x593beb,_0x49caf8){return _0x593beb[_0xc2b4('0xa')](_0xc2b4('0xb'),attributes,{'tableName':_0xc2b4('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 8621609..42ce9f7 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 _0xe109=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x55e6db,_0x102cbc){var _0x18f2b1=function(_0x29cbd8){while(--_0x29cbd8){_0x55e6db['push'](_0x55e6db['shift']());}};_0x18f2b1(++_0x102cbc);}(_0xe109,0x16b));var _0x9e10=function(_0x102363,_0x158232){_0x102363=_0x102363-0x0;var _0x59c3ed=_0xe109[_0x102363];return _0x59c3ed;};'use strict';var _=require(_0x9e10('0x0'));var util=require(_0x9e10('0x1'));var moment=require(_0x9e10('0x2'));var BPromise=require('bluebird');var rs=require(_0x9e10('0x3'));var fs=require('fs');var Redis=require(_0x9e10('0x4'));var db=require(_0x9e10('0x5'))['db'];var utils=require(_0x9e10('0x6'));var logger=require(_0x9e10('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9e10('0x8'));var client=jayson['client'][_0x9e10('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x286e0f,_0x3453eb,_0x2e0462){return new BPromise(function(_0xd9c360,_0x36ba54){return client['request'](_0x286e0f,_0x2e0462)['then'](function(_0x3ba882){logger[_0x9e10('0xa')](_0x9e10('0xb'),_0x3453eb,_0x9e10('0xc'));logger[_0x9e10('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x3453eb,'request\x20sent',JSON[_0x9e10('0xe')](_0x3ba882));if(_0x3ba882[_0x9e10('0xf')]){if(_0x3ba882['error'][_0x9e10('0x10')]===0x1f4){logger[_0x9e10('0xf')](_0x9e10('0xb'),_0x3453eb,_0x3ba882[_0x9e10('0xf')]['message']);return _0x36ba54(_0x3ba882[_0x9e10('0xf')][_0x9e10('0x11')]);}logger[_0x9e10('0xf')](_0x9e10('0xb'),_0x3453eb,_0x3ba882[_0x9e10('0xf')]['message']);return _0xd9c360(_0x3ba882[_0x9e10('0xf')]['message']);}else{logger['info'](_0x9e10('0xb'),_0x3453eb,_0x9e10('0xc'));_0xd9c360(_0x3ba882[_0x9e10('0x12')][_0x9e10('0x11')]);}})[_0x9e10('0x13')](function(_0x5db0ea){logger[_0x9e10('0xf')](_0x9e10('0xb'),_0x3453eb,_0x5db0ea);_0x36ba54(_0x5db0ea);});});}
\ No newline at end of file
+var _0x4312=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x1e16b9,_0x237d96){var _0x5c59c9=function(_0x5a3301){while(--_0x5a3301){_0x1e16b9['push'](_0x1e16b9['shift']());}};_0x5c59c9(++_0x237d96);}(_0x4312,0x1cb));var _0x2431=function(_0x55fc03,_0x43ce48){_0x55fc03=_0x55fc03-0x0;var _0x5bf429=_0x4312[_0x55fc03];return _0x5bf429;};'use strict';var _=require(_0x2431('0x0'));var util=require(_0x2431('0x1'));var moment=require(_0x2431('0x2'));var BPromise=require(_0x2431('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2431('0x4'));var db=require(_0x2431('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2431('0x6'))(_0x2431('0x7'));var config=require(_0x2431('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2431('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x556ac2,_0x274da8,_0x63d0f0){return new BPromise(function(_0x5da25c,_0x593a7b){return client[_0x2431('0xa')](_0x556ac2,_0x63d0f0)[_0x2431('0xb')](function(_0x34c385){logger[_0x2431('0xc')]('CmCompany,\x20%s,\x20%s',_0x274da8,'request\x20sent');logger[_0x2431('0xd')](_0x2431('0xe'),_0x274da8,'request\x20sent',JSON['stringify'](_0x34c385));if(_0x34c385['error']){if(_0x34c385[_0x2431('0xf')][_0x2431('0x10')]===0x1f4){logger[_0x2431('0xf')](_0x2431('0x11'),_0x274da8,_0x34c385[_0x2431('0xf')][_0x2431('0x12')]);return _0x593a7b(_0x34c385[_0x2431('0xf')][_0x2431('0x12')]);}logger[_0x2431('0xf')](_0x2431('0x11'),_0x274da8,_0x34c385[_0x2431('0xf')][_0x2431('0x12')]);return _0x5da25c(_0x34c385[_0x2431('0xf')][_0x2431('0x12')]);}else{logger['info'](_0x2431('0x11'),_0x274da8,'request\x20sent');_0x5da25c(_0x34c385[_0x2431('0x13')][_0x2431('0x12')]);}})[_0x2431('0x14')](function(_0x1ce8f6){logger[_0x2431('0xf')](_0x2431('0x11'),_0x274da8,_0x1ce8f6);_0x593a7b(_0x1ce8f6);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index cf0b286..b14d298 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 _0x36d2=['express','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','index','/describe','/:id','isAuthenticated','show','/:id/contacts','getContacts','create','post','addContacts','put','delete','exports','util','connect-timeout'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x36d2,0x1b7));var _0x236d=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0x36d2[_0x2cfb48];return _0xc4594f;};'use strict';var multer=require('multer');var util=require(_0x236d('0x0'));var path=require('path');var timeout=require(_0x236d('0x1'));var express=require(_0x236d('0x2'));var router=express['Router']();var fs_extra=require(_0x236d('0x3'));var auth=require(_0x236d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x236d('0x5'));var controller=require(_0x236d('0x6'));router[_0x236d('0x7')]('/',auth['isAuthenticated'](),controller[_0x236d('0x8')]);router[_0x236d('0x7')](_0x236d('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x236d('0xa'),auth[_0x236d('0xb')](),controller[_0x236d('0xc')]);router[_0x236d('0x7')](_0x236d('0xd'),auth[_0x236d('0xb')](),controller[_0x236d('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x236d('0xf')]);router[_0x236d('0x10')](_0x236d('0xd'),auth[_0x236d('0xb')](),controller[_0x236d('0x11')]);router[_0x236d('0x12')](_0x236d('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x236d('0x13')](_0x236d('0xa'),auth[_0x236d('0xb')](),controller['destroy']);module[_0x236d('0x14')]=router;
\ No newline at end of file
+var _0xe608=['show','/:id/contacts','post','create','addContacts','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','describe'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0xe608,0x1cd));var _0x8e60=function(_0x4f3207,_0x264c78){_0x4f3207=_0x4f3207-0x0;var _0x87adb6=_0xe608[_0x4f3207];return _0x87adb6;};'use strict';var multer=require(_0x8e60('0x0'));var util=require(_0x8e60('0x1'));var path=require(_0x8e60('0x2'));var timeout=require(_0x8e60('0x3'));var express=require('express');var router=express[_0x8e60('0x4')]();var fs_extra=require(_0x8e60('0x5'));var auth=require(_0x8e60('0x6'));var interaction=require(_0x8e60('0x7'));var config=require(_0x8e60('0x8'));var controller=require(_0x8e60('0x9'));router['get']('/',auth[_0x8e60('0xa')](),controller[_0x8e60('0xb')]);router[_0x8e60('0xc')]('/describe',auth[_0x8e60('0xa')](),controller[_0x8e60('0xd')]);router[_0x8e60('0xc')]('/:id',auth[_0x8e60('0xa')](),controller[_0x8e60('0xe')]);router[_0x8e60('0xc')](_0x8e60('0xf'),auth[_0x8e60('0xa')](),controller['getContacts']);router[_0x8e60('0x10')]('/',auth['isAuthenticated'](),controller[_0x8e60('0x11')]);router[_0x8e60('0x10')](_0x8e60('0xf'),auth[_0x8e60('0xa')](),controller[_0x8e60('0x12')]);router[_0x8e60('0x13')](_0x8e60('0x14'),auth['isAuthenticated'](),controller[_0x8e60('0x15')]);router[_0x8e60('0x16')](_0x8e60('0x14'),auth[_0x8e60('0xa')](),controller[_0x8e60('0x17')]);module[_0x8e60('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 55c2448..b764316 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 _0x3b91=['INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x6eb833,_0x2bb5e5){var _0xdfc38c=function(_0x13c4a4){while(--_0x13c4a4){_0x6eb833['push'](_0x6eb833['shift']());}};_0xdfc38c(++_0x2bb5e5);}(_0x3b91,0x15a));var _0x13b9=function(_0x475004,_0x33de48){_0x475004=_0x475004-0x0;var _0x2f16fd=_0x3b91[_0x475004];return _0x2f16fd;};'use strict';var _=require(_0x13b9('0x0'));var Sequelize=require(_0x13b9('0x1'));module[_0x13b9('0x2')]={'firstName':{'type':Sequelize[_0x13b9('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x13b9('0x3')]},'street':{'type':Sequelize[_0x13b9('0x3')]},'postalCode':{'type':Sequelize[_0x13b9('0x3')]},'city':{'type':Sequelize[_0x13b9('0x3')]},'country':{'type':Sequelize[_0x13b9('0x3')]},'dateOfBirth':{'type':Sequelize[_0x13b9('0x3')]},'description':{'type':Sequelize[_0x13b9('0x4')]},'phone':{'type':Sequelize[_0x13b9('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x13b9('0x3')]},'email':{'type':Sequelize[_0x13b9('0x3')]},'url':{'type':Sequelize[_0x13b9('0x3')]},'facebook':{'type':Sequelize[_0x13b9('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x13b9('0x3')]},'skype':{'type':Sequelize[_0x13b9('0x3')]},'teams':{'type':Sequelize[_0x13b9('0x3')]},'viber':{'type':Sequelize[_0x13b9('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x13b9('0x3')]},'UserId':{'type':Sequelize[_0x13b9('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x13b9('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x13b9('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x13b9('0x7')],'defaultValue':Sequelize[_0x13b9('0x8')]},'dialTimezone':{'type':Sequelize[_0x13b9('0x3')]},'utcOffset':{'type':Sequelize[_0x13b9('0x5')]}};
\ No newline at end of file
+var _0x7028=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','lodash'];(function(_0xd28119,_0x2a8097){var _0x418b38=function(_0x331d0e){while(--_0x331d0e){_0xd28119['push'](_0xd28119['shift']());}};_0x418b38(++_0x2a8097);}(_0x7028,0xfb));var _0x8702=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0x7028[_0x1fafa5];return _0xcf08c9;};'use strict';var _=require(_0x8702('0x0'));var Sequelize=require('sequelize');module[_0x8702('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x8702('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x8702('0x2')]},'city':{'type':Sequelize[_0x8702('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x8702('0x2')]},'description':{'type':Sequelize[_0x8702('0x3')]},'phone':{'type':Sequelize[_0x8702('0x2')]},'mobile':{'type':Sequelize[_0x8702('0x2')]},'fax':{'type':Sequelize[_0x8702('0x2')]},'email':{'type':Sequelize[_0x8702('0x2')]},'url':{'type':Sequelize[_0x8702('0x2')]},'facebook':{'type':Sequelize[_0x8702('0x2')]},'fb_data':{'type':Sequelize[_0x8702('0x2')]},'twitter':{'type':Sequelize[_0x8702('0x2')]},'skype':{'type':Sequelize[_0x8702('0x2')]},'teams':{'type':Sequelize[_0x8702('0x2')]},'viber':{'type':Sequelize[_0x8702('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x8702('0x2')]},'telegram':{'type':Sequelize[_0x8702('0x2')]},'UserId':{'type':Sequelize[_0x8702('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x8702('0x2')]},'priority':{'type':Sequelize[_0x8702('0x4')](0x2)[_0x8702('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x8702('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x8702('0x2')]},'utcOffset':{'type':Sequelize[_0x8702('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 09d8f57..f0ad13d 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 _0xf2e3=['include','rows','getHopperHistories','ContactId','CmHopperHistory','includeAll','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','binding_keys','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','import','agent','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','importUpdates','User','../../components/import/cm/csvUpdates','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','chat','openchannel','fax','voice','-createdAt','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','callerid','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','UserId','DESC','findAndCountAll','startCase','Website','closed','closedAt','secondDisposition','thirdDisposition','key','Owner','fullname','color','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','sortBy','reverse','bluebird','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','sendStatus','stack','name','send','index','describe','findAll','query','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','length','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','columnName','merge','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','isNil','dialTimezone','timezones','utcOffset','additionalPhones','duplicates','where','$or','push','ListId','findOrCreate','spread','hasOwnProperty','contact','all','Tag','Tags','tag','Phones','ItemType','literal','Phones.OrderBy','format','cf_%d','CmCustomField','omit','pickBy','table','cm_contacts','toParam','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','map','options','nolimit','findOne','setTags','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','ContactItemType','`ItemType`.OrderBy','CmHopperId','item','ItemType.OrderBy','getAdditionalPhones','fromContactId','CmContactId','toContactId','bulkCreate','rescheduleAdditionalPhones','hopperId','getHoppers'];(function(_0xdd22b4,_0x30d40a){var _0x40d550=function(_0x5a9ac6){while(--_0x5a9ac6){_0xdd22b4['push'](_0xdd22b4['shift']());}};_0x40d550(++_0x30d40a);}(_0xf2e3,0x15f));var _0x3f2e=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xf2e3[_0x176329];return _0x31997c;};'use strict';var moment=require('moment');var BPromise=require(_0x3f2e('0x0'));var util=require('util');var path=require(_0x3f2e('0x1'));var fs=require('fs');var _=require(_0x3f2e('0x2'));var squel=require(_0x3f2e('0x3'));var Papa=require(_0x3f2e('0x4'));var Redis=require(_0x3f2e('0x5'));var contacts=require(_0x3f2e('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x3f2e('0x7'))(_0x3f2e('0x8'));var config=require(_0x3f2e('0x9'));var shared=require('../../config/environment/shared');var db=require(_0x3f2e('0xa'))['db'];config[_0x3f2e('0xb')]=_[_0x3f2e('0xc')](config['redis'],{'host':_0x3f2e('0xd'),'port':0x18eb});var socket=require(_0x3f2e('0xe'))(new Redis(config[_0x3f2e('0xb')]));require('./cmContact.socket')[_0x3f2e('0xf')](socket);function respondWithResult(_0x2d34b9,_0x488334){_0x488334=_0x488334||0xc8;return function(_0x52056c){if(_0x52056c){return _0x2d34b9[_0x3f2e('0x10')](_0x488334)[_0x3f2e('0x11')](_0x52056c);}};}function respondWithFilteredResult(_0x2b8fba,_0x2e09da){return function(_0x851f9a){if(_0x851f9a){var _0x303a90=typeof _0x2e09da[_0x3f2e('0x12')]===_0x3f2e('0x13')&&typeof _0x2e09da[_0x3f2e('0x14')]===_0x3f2e('0x13');var _0xe8f0da=_0x851f9a[_0x3f2e('0x15')];var _0x38a156=_0x303a90?0x0:_0x2e09da[_0x3f2e('0x12')];var _0x4e6c66=_0x303a90?_0x851f9a[_0x3f2e('0x15')]:_0x2e09da[_0x3f2e('0x12')]+_0x2e09da[_0x3f2e('0x14')];var _0x2e9a2a;if(_0x4e6c66>=_0xe8f0da){_0x4e6c66=_0xe8f0da;_0x2e9a2a=0xc8;}else{_0x2e9a2a=0xce;}_0x2b8fba['status'](_0x2e9a2a);return _0x2b8fba['set'](_0x3f2e('0x16'),_0x38a156+'-'+_0x4e6c66+'/'+_0xe8f0da)['json'](_0x851f9a);}return null;};}function saveUpdates(_0x6ae745){return function(_0x466ba0){if(_0x466ba0){return _0x466ba0[_0x3f2e('0x17')](_0x6ae745)[_0x3f2e('0x18')](function(_0x2bfba6){return _0x2bfba6;});}return null;};}function removeEntity(_0x15937d){return function(_0x523d90){if(_0x523d90){return _0x523d90[_0x3f2e('0x19')]()[_0x3f2e('0x18')](function(){_0x15937d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38ebe0){return function(_0x5caa14){if(!_0x5caa14){_0x38ebe0[_0x3f2e('0x1a')](0x194);}return _0x5caa14;};}function handleError(_0x104cf2,_0x357655){_0x357655=_0x357655||0x1f4;return function(_0x286736){logger['error'](_0x286736[_0x3f2e('0x1b')]);if(_0x286736[_0x3f2e('0x1c')]){delete _0x286736['name'];}_0x104cf2[_0x3f2e('0x10')](_0x357655)[_0x3f2e('0x1d')](_0x286736);};}exports[_0x3f2e('0x1e')]=function(_0x170b00,_0xe63c83){var _0x3ee968={};return contacts[_0x3f2e('0x1f')]()['then'](function(_0x15a3b4){_0x3ee968=qs['getOptions'](_0x15a3b4,_0x170b00);return contacts[_0x3f2e('0x20')](_0x170b00[_0x3f2e('0x21')],_0x170b00['user'],_0x3ee968,_0x15a3b4);})[_0x3f2e('0x18')](respondWithFilteredResult(_0xe63c83,_0x3ee968))[_0x3f2e('0x22')](handleError(_0xe63c83,null));};exports[_0x3f2e('0x19')]=function(_0x288291,_0x4ff0fb){return db[_0x3f2e('0x23')][_0x3f2e('0x24')]({'where':{'id':_0x288291[_0x3f2e('0x25')]['id']}})['then'](handleEntityNotFound(_0x4ff0fb,null))['then'](removeEntity(_0x4ff0fb,null))[_0x3f2e('0x22')](handleError(_0x4ff0fb,null));};exports['describe']=function(_0x4be7da,_0x103dff){return db[_0x3f2e('0x23')][_0x3f2e('0x1f')]()[_0x3f2e('0x18')](function(_0x14552e){delete _0x14552e[_0x3f2e('0x26')];for(var _0x425f64=0x0;_0x425f64
','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','name'];(function(_0x23e61e,_0x4e9cbb){var _0x734dba=function(_0x7e951d){while(--_0x7e951d){_0x23e61e['push'](_0x23e61e['shift']());}};_0x734dba(++_0x4e9cbb);}(_0xc1c1,0xd4));var _0x1c1c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc1c1[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x1c1c('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0x1c1c('0x1'));var util=require('util');var tnef=require(_0x1c1c('0x2'));var logger=require(_0x1c1c('0x3'))(_0x1c1c('0x4'));var config=require(_0x1c1c('0x5'));function getAddress(_0x1046ca){var _0x2078e1=_[_0x1c1c('0x6')](_0x1046ca[_0x1c1c('0x7')]);return _0x2078e1&&_0x2078e1[_0x1c1c('0x8')]?_0x2078e1[_0x1c1c('0x8')]:'anonymous'+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x216d01){var _0x38e2eb=_['head'](_0x216d01[_0x1c1c('0x7')]);if(_0x38e2eb&&_0x38e2eb[_0x1c1c('0x9')]){if(_0x38e2eb['name']==_0x38e2eb[_0x1c1c('0x8')]){return _0x38e2eb[_0x1c1c('0x9')][_0x1c1c('0xa')](0x0,_0x38e2eb['name']['indexOf']('@'));}var _0x205fb5=_0x38e2eb['name'][_0x1c1c('0xb')](/\s+/);return _0x205fb5[_0x1c1c('0xc')]>0x1?_0x205fb5[_0x1c1c('0xd')](0x0,-0x1)['join']('\x20'):_0x38e2eb[_0x1c1c('0x9')];}return'Anonymous';}function getLastName(_0x1f9fc2){var _0x47d850=_['head'](_0x1f9fc2[_0x1c1c('0x7')]);if(_0x47d850&&_0x47d850['name']){var _0x57d113=_0x47d850[_0x1c1c('0x9')]['split'](/\s+/);return _0x57d113[_0x1c1c('0xc')]>0x1?_0x57d113[_0x1c1c('0xe')]():'';}return'';}function getMails(_0x50aa87,_0x18962d){var _0x5013a0='';for(var _0x10a759=0x0;_0x10a759<_0x18962d['value']['length'];_0x10a759+=0x1){if(_0x18962d['value'][_0x10a759][_0x1c1c('0x8')]!==_0x50aa87){if(!_[_0x1c1c('0xf')](_0x5013a0)){_0x5013a0+=',';}_0x5013a0+=_0x18962d[_0x1c1c('0x7')][_0x10a759][_0x1c1c('0x9')]||_0x18962d[_0x1c1c('0x7')][_0x10a759][_0x1c1c('0x8')]||'';_0x5013a0+='\x20<';_0x5013a0+=_0x18962d[_0x1c1c('0x7')][_0x10a759][_0x1c1c('0x8')]?_0x18962d[_0x1c1c('0x7')][_0x10a759]['address']:'anonymous'+random[_0x1c1c('0x10')](0x6)+'@xcally.com';_0x5013a0+='>';}}return _0x5013a0;}function parseEmail(_0x241c80,_0x1d6028,_0x30624d){if(_0x1d6028[_0x1c1c('0x11')]){var _0x417ccb=/