From: support
Date: Fri, 8 Jul 2022 17:11:40 +0000 (+0000)
Subject: Built motion from commit 6f058f2b.|2.6.12
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22https:/fonts.googleapis.com/icon?a=commitdiff_plain;h=5700004c41767de5192dcf7c263197b4ca1ef510;p=motion2.git
Built motion from commit 6f058f2b.|2.6.12
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 148e498..c84088e 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-08T15:38:16.667Z",
+ "time": "2022-07-08T17:03:09.769Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 76e23cb..7cb2ecb 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-08T15:38:16.667Z",
+ "time": "2022-07-08T17:03:09.769Z",
"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 8ef1884..b7a5330 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 _0x0a30=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','sequelize','VIRTUAL','getDataValue','action','integration','jscripty','urlForward','browser','bot','script'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a30,0xaa));var _0x00a3=function(_0x52eb8f,_0x3fdd3e){_0x52eb8f=_0x52eb8f-0x0;var _0xbeac90=_0x0a30[_0x52eb8f];return _0xbeac90;};'use strict';var Sequelize=require(_0x00a3('0x0'));module['exports']={'name':{'type':Sequelize[_0x00a3('0x1')],'get':function(_0x52f39c){return this[_0x00a3('0x2')](_0x00a3('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x00a3('0x4'),'motionbar',_0x00a3('0x5'),_0x00a3('0x6'),_0x00a3('0x7'),_0x00a3('0x8'),_0x00a3('0x9')]],'msg':_0x00a3('0xa')}},'comment':_0x00a3('0xa')},'data1':{'type':Sequelize[_0x00a3('0xb')](0x1000),'comment':_0x00a3('0xc')},'data2':{'type':Sequelize[_0x00a3('0xb')](0x1000),'comment':_0x00a3('0xd')},'data3':{'type':Sequelize[_0x00a3('0xb')](0x1000),'comment':_0x00a3('0xe')},'data4':{'type':Sequelize[_0x00a3('0xb')](0x1000),'comments':_0x00a3('0xf')},'data5':{'type':Sequelize[_0x00a3('0xb')](0x1000),'comments':_0x00a3('0x10')},'data6':{'type':Sequelize['STRING'],'comments':_0x00a3('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x4143=['VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize'];(function(_0x45f90f,_0x383cf4){var _0x2c5a5f=function(_0x53f5ac){while(--_0x53f5ac){_0x45f90f['push'](_0x45f90f['shift']());}};_0x2c5a5f(++_0x383cf4);}(_0x4143,0x167));var _0x3414=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x4143[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0x3414('0x0'));module['exports']={'name':{'type':Sequelize[_0x3414('0x1')],'get':function(_0xab698d){return this[_0x3414('0x2')](_0x3414('0x3'));}},'action':{'type':Sequelize[_0x3414('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3414('0x5'),_0x3414('0x6'),_0x3414('0x7'),_0x3414('0x8'),_0x3414('0x9'),_0x3414('0xa'),_0x3414('0xb'),_0x3414('0xc')]],'msg':_0x3414('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x3414('0xe')},'data2':{'type':Sequelize[_0x3414('0x4')](0x1000),'comment':_0x3414('0xf')},'data3':{'type':Sequelize[_0x3414('0x4')](0x1000),'comment':_0x3414('0x10')},'data4':{'type':Sequelize[_0x3414('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x3414('0x4')](0x1000),'comments':_0x3414('0x11')},'data6':{'type':Sequelize[_0x3414('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x3414('0x12')],'comments':_0x3414('0x13')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index a53217f..43f81dd 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 _0x34e9=['squel','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','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','body','find','params','catch','destroy','Action','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x34e9,0x167));var _0x934e=function(_0x1a130d,_0x2cb189){_0x1a130d=_0x1a130d-0x0;var _0xab6801=_0x34e9[_0x1a130d];return _0xab6801;};'use strict';var emlformat=require(_0x934e('0x0'));var rimraf=require(_0x934e('0x1'));var zipdir=require(_0x934e('0x2'));var jsonpatch=require(_0x934e('0x3'));var rp=require('request-promise');var moment=require(_0x934e('0x4'));var BPromise=require(_0x934e('0x5'));var Mustache=require(_0x934e('0x6'));var util=require(_0x934e('0x7'));var path=require(_0x934e('0x8'));var sox=require('sox');var csv=require(_0x934e('0x9'));var ejs=require(_0x934e('0xa'));var fs=require('fs');var fs_extra=require(_0x934e('0xb'));var _=require('lodash');var squel=require(_0x934e('0xc'));var crypto=require(_0x934e('0xd'));var jsforce=require(_0x934e('0xe'));var deskjs=require(_0x934e('0xf'));var toCsv=require(_0x934e('0x9'));var querystring=require('querystring');var Papa=require(_0x934e('0x10'));var Redis=require(_0x934e('0x11'));var authService=require(_0x934e('0x12'));var qs=require(_0x934e('0x13'));var as=require(_0x934e('0x14'));var hardwareService=require(_0x934e('0x15'));var logger=require(_0x934e('0x16'))(_0x934e('0x17'));var utils=require(_0x934e('0x18'));var config=require(_0x934e('0x19'));var licenseUtil=require(_0x934e('0x1a'));var db=require(_0x934e('0x1b'))['db'];function respondWithStatusCode(_0x5105be,_0x44b24f){_0x44b24f=_0x44b24f||0xcc;return function(_0x1cb98b){if(_0x1cb98b){return _0x5105be[_0x934e('0x1c')](_0x44b24f);}return _0x5105be['status'](_0x44b24f)[_0x934e('0x1d')]();};}function respondWithResult(_0xaa0389,_0x4d7ea2){_0x4d7ea2=_0x4d7ea2||0xc8;return function(_0x2800f1){if(_0x2800f1){return _0xaa0389[_0x934e('0x1e')](_0x4d7ea2)[_0x934e('0x1f')](_0x2800f1);}};}function respondWithFilteredResult(_0xecd785,_0x35ded2){return function(_0x13ff7a){if(_0x13ff7a){var _0x268fbe=typeof _0x35ded2[_0x934e('0x20')]===_0x934e('0x21')&&typeof _0x35ded2[_0x934e('0x22')]==='undefined';var _0x2e209b=_0x13ff7a[_0x934e('0x23')];var _0x5c1f4f=_0x268fbe?0x0:_0x35ded2[_0x934e('0x20')];var _0x28a4cd=_0x268fbe?_0x13ff7a[_0x934e('0x23')]:_0x35ded2[_0x934e('0x20')]+_0x35ded2[_0x934e('0x22')];var _0x3a79ce;if(_0x28a4cd>=_0x2e209b){_0x28a4cd=_0x2e209b;_0x3a79ce=0xc8;}else{_0x3a79ce=0xce;}_0xecd785[_0x934e('0x1e')](_0x3a79ce);return _0xecd785[_0x934e('0x24')](_0x934e('0x25'),_0x5c1f4f+'-'+_0x28a4cd+'/'+_0x2e209b)['json'](_0x13ff7a);}return null;};}function patchUpdates(_0x30443a){return function(_0x110d75){try{jsonpatch[_0x934e('0x26')](_0x110d75,_0x30443a,!![]);}catch(_0x54628a){return BPromise[_0x934e('0x27')](_0x54628a);}return _0x110d75[_0x934e('0x28')]();};}function saveUpdates(_0x50d966,_0x52cd5c){return function(_0x5cac08){if(_0x5cac08){return _0x5cac08[_0x934e('0x29')](_0x50d966)[_0x934e('0x2a')](function(_0x10f86d){return _0x10f86d;});}return null;};}function removeEntity(_0x4ea607,_0x439f16){return function(_0x5e17dd){if(_0x5e17dd){return _0x5e17dd['destroy']()[_0x934e('0x2a')](function(){_0x4ea607[_0x934e('0x1e')](0xcc)[_0x934e('0x1d')]();});}};}function handleEntityNotFound(_0x7b5a60,_0x58bc7e){return function(_0x14beb1){if(!_0x14beb1){_0x7b5a60[_0x934e('0x1c')](0x194);}return _0x14beb1;};}function handleError(_0x47d46c,_0x3a4622){_0x3a4622=_0x3a4622||0x1f4;return function(_0xc01d53){logger[_0x934e('0x2b')](_0xc01d53[_0x934e('0x2c')]);if(_0xc01d53[_0x934e('0x2d')]){delete _0xc01d53['name'];}_0x47d46c[_0x934e('0x1e')](_0x3a4622)[_0x934e('0x2e')](_0xc01d53);};}exports['update']=function(_0xe9ad0c,_0xe965a){if(_0xe9ad0c[_0x934e('0x2f')]['id']){delete _0xe9ad0c[_0x934e('0x2f')]['id'];}return db['Action'][_0x934e('0x30')]({'where':{'id':_0xe9ad0c[_0x934e('0x31')]['id']}})['then'](handleEntityNotFound(_0xe965a,null))[_0x934e('0x2a')](saveUpdates(_0xe9ad0c[_0x934e('0x2f')],null))[_0x934e('0x2a')](respondWithResult(_0xe965a,null))[_0x934e('0x32')](handleError(_0xe965a,null));};exports[_0x934e('0x33')]=function(_0x4bfb2a,_0x234680){return db[_0x934e('0x34')][_0x934e('0x30')]({'where':{'id':_0x4bfb2a[_0x934e('0x31')]['id']}})['then'](handleEntityNotFound(_0x234680,null))[_0x934e('0x2a')](removeEntity(_0x234680,null))[_0x934e('0x32')](handleError(_0x234680,null));};
\ No newline at end of file
+var _0x386e=['stack','name','send','body','Action','params','catch','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','update','then','destroy','error'];(function(_0x43051f,_0x4a10a0){var _0x358fe1=function(_0x2e1ef9){while(--_0x2e1ef9){_0x43051f['push'](_0x43051f['shift']());}};_0x358fe1(++_0x4a10a0);}(_0x386e,0x128));var _0xe386=function(_0x937379,_0x4688a0){_0x937379=_0x937379-0x0;var _0x465709=_0x386e[_0x937379];return _0x465709;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe386('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe386('0x1'));var rp=require(_0xe386('0x2'));var moment=require(_0xe386('0x3'));var BPromise=require(_0xe386('0x4'));var Mustache=require(_0xe386('0x5'));var util=require(_0xe386('0x6'));var path=require(_0xe386('0x7'));var sox=require(_0xe386('0x8'));var csv=require('to-csv');var ejs=require(_0xe386('0x9'));var fs=require('fs');var fs_extra=require(_0xe386('0xa'));var _=require(_0xe386('0xb'));var squel=require(_0xe386('0xc'));var crypto=require(_0xe386('0xd'));var jsforce=require(_0xe386('0xe'));var deskjs=require(_0xe386('0xf'));var toCsv=require(_0xe386('0x10'));var querystring=require('querystring');var Papa=require(_0xe386('0x11'));var Redis=require(_0xe386('0x12'));var authService=require(_0xe386('0x13'));var qs=require(_0xe386('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe386('0x15'))(_0xe386('0x16'));var utils=require('../../config/utils');var config=require(_0xe386('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe386('0x18'))['db'];function respondWithStatusCode(_0x4fc0b2,_0x47b8aa){_0x47b8aa=_0x47b8aa||0xcc;return function(_0xa9838d){if(_0xa9838d){return _0x4fc0b2[_0xe386('0x19')](_0x47b8aa);}return _0x4fc0b2[_0xe386('0x1a')](_0x47b8aa)[_0xe386('0x1b')]();};}function respondWithResult(_0x4f52c3,_0x334dc7){_0x334dc7=_0x334dc7||0xc8;return function(_0x433a04){if(_0x433a04){return _0x4f52c3[_0xe386('0x1a')](_0x334dc7)['json'](_0x433a04);}};}function respondWithFilteredResult(_0x8614a6,_0x3cd40f){return function(_0x1e0698){if(_0x1e0698){var _0x5d7267=typeof _0x3cd40f['offset']===_0xe386('0x1c')&&typeof _0x3cd40f[_0xe386('0x1d')]===_0xe386('0x1c');var _0x37753f=_0x1e0698['count'];var _0x4d65c5=_0x5d7267?0x0:_0x3cd40f[_0xe386('0x1e')];var _0x13fd3e=_0x5d7267?_0x1e0698[_0xe386('0x1f')]:_0x3cd40f['offset']+_0x3cd40f[_0xe386('0x1d')];var _0x56193b;if(_0x13fd3e>=_0x37753f){_0x13fd3e=_0x37753f;_0x56193b=0xc8;}else{_0x56193b=0xce;}_0x8614a6[_0xe386('0x1a')](_0x56193b);return _0x8614a6[_0xe386('0x20')](_0xe386('0x21'),_0x4d65c5+'-'+_0x13fd3e+'/'+_0x37753f)[_0xe386('0x22')](_0x1e0698);}return null;};}function patchUpdates(_0x457a7f){return function(_0x55d73b){try{jsonpatch[_0xe386('0x23')](_0x55d73b,_0x457a7f,!![]);}catch(_0x231fae){return BPromise['reject'](_0x231fae);}return _0x55d73b['save']();};}function saveUpdates(_0x138443,_0x56b89b){return function(_0x51cbc8){if(_0x51cbc8){return _0x51cbc8[_0xe386('0x24')](_0x138443)[_0xe386('0x25')](function(_0x2ad964){return _0x2ad964;});}return null;};}function removeEntity(_0x15988e,_0x12f6df){return function(_0x49a89c){if(_0x49a89c){return _0x49a89c[_0xe386('0x26')]()[_0xe386('0x25')](function(){_0x15988e[_0xe386('0x1a')](0xcc)[_0xe386('0x1b')]();});}};}function handleEntityNotFound(_0x5488bb,_0x3a7536){return function(_0x4b2ee3){if(!_0x4b2ee3){_0x5488bb['sendStatus'](0x194);}return _0x4b2ee3;};}function handleError(_0xd76430,_0x3c4e9a){_0x3c4e9a=_0x3c4e9a||0x1f4;return function(_0x292351){logger[_0xe386('0x27')](_0x292351[_0xe386('0x28')]);if(_0x292351[_0xe386('0x29')]){delete _0x292351[_0xe386('0x29')];}_0xd76430[_0xe386('0x1a')](_0x3c4e9a)[_0xe386('0x2a')](_0x292351);};}exports[_0xe386('0x24')]=function(_0x32708d,_0x2a49df){if(_0x32708d['body']['id']){delete _0x32708d[_0xe386('0x2b')]['id'];}return db[_0xe386('0x2c')]['find']({'where':{'id':_0x32708d[_0xe386('0x2d')]['id']}})[_0xe386('0x25')](handleEntityNotFound(_0x2a49df,null))[_0xe386('0x25')](saveUpdates(_0x32708d[_0xe386('0x2b')],null))[_0xe386('0x25')](respondWithResult(_0x2a49df,null))[_0xe386('0x2e')](handleError(_0x2a49df,null));};exports['destroy']=function(_0x385b28,_0xc2606e){return db[_0xe386('0x2c')][_0xe386('0x2f')]({'where':{'id':_0x385b28[_0xe386('0x2d')]['id']}})[_0xe386('0x25')](handleEntityNotFound(_0xc2606e,null))['then'](removeEntity(_0xc2606e,null))['catch'](handleError(_0xc2606e,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 39a0f12..b56e03d 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 _0x7f65=['Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./action.attributes','exports','define'];(function(_0x1e9c78,_0xc01460){var _0x2fc4c7=function(_0x58c08b){while(--_0x58c08b){_0x1e9c78['push'](_0x1e9c78['shift']());}};_0x2fc4c7(++_0xc01460);}(_0x7f65,0x91));var _0x57f6=function(_0x52c3de,_0x2b6bb4){_0x52c3de=_0x52c3de-0x0;var _0xed6378=_0x7f65[_0x52c3de];return _0xed6378;};'use strict';var _=require(_0x57f6('0x0'));var util=require(_0x57f6('0x1'));var logger=require(_0x57f6('0x2'))(_0x57f6('0x3'));var moment=require(_0x57f6('0x4'));var BPromise=require(_0x57f6('0x5'));var rp=require(_0x57f6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57f6('0x7'));var config=require('../../config/environment');var attributes=require(_0x57f6('0x8'));module[_0x57f6('0x9')]=function(_0x5ba2bf,_0x2d19ae){return _0x5ba2bf[_0x57f6('0xa')](_0x57f6('0xb'),attributes,{'tableName':_0x57f6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xade0=['exports','Action','tools_actions','lodash','util','../../config/logger','api','request-promise','path','./action.attributes'];(function(_0x3251e3,_0x2c3319){var _0x26af07=function(_0x2b816b){while(--_0x2b816b){_0x3251e3['push'](_0x3251e3['shift']());}};_0x26af07(++_0x2c3319);}(_0xade0,0xe9));var _0x0ade=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0xade0[_0xb833b1];return _0x1ab87a;};'use strict';var _=require(_0x0ade('0x0'));var util=require(_0x0ade('0x1'));var logger=require(_0x0ade('0x2'))(_0x0ade('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0ade('0x4'));var fs=require('fs');var path=require(_0x0ade('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0ade('0x6'));module[_0x0ade('0x7')]=function(_0x36444a,_0x1a0c30){return _0x36444a['define'](_0x0ade('0x8'),attributes,{'tableName':_0x0ade('0x9'),'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 e199ee4..0acdd95 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x53ec,0x192));var _0xc53e=function(_0x17e4ac,_0x315ed6){_0x17e4ac=_0x17e4ac-0x0;var _0x7a9a6a=_0x53ec[_0x17e4ac];return _0x7a9a6a;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
+var _0x7a54=['info','Action,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x55c5de,_0x4d5718){_0x55c5de=_0x55c5de-0x0;var _0x4b8db4=_0x7a54[_0x55c5de];return _0x4b8db4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Action,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 14414be..5fb44cd 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 _0xae41=['/:id','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','update'];(function(_0x440fde,_0x445ce0){var _0x11052c=function(_0x49f547){while(--_0x49f547){_0x440fde['push'](_0x440fde['shift']());}};_0x11052c(++_0x445ce0);}(_0xae41,0xce));var _0x1ae4=function(_0x5bf1b0,_0x4755db){_0x5bf1b0=_0x5bf1b0-0x0;var _0x1fcdbc=_0xae41[_0x5bf1b0];return _0x1fcdbc;};'use strict';var multer=require('multer');var util=require(_0x1ae4('0x0'));var path=require(_0x1ae4('0x1'));var timeout=require(_0x1ae4('0x2'));var express=require(_0x1ae4('0x3'));var router=express['Router']();var fs_extra=require(_0x1ae4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1ae4('0x5'));var config=require(_0x1ae4('0x6'));var controller=require(_0x1ae4('0x7'));router[_0x1ae4('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1ae4('0x9')]);router['delete'](_0x1ae4('0xa'),auth['isAuthenticated'](),controller[_0x1ae4('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0x9eac=['isAuthenticated','destroy','exports','express','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id'];(function(_0x30643a,_0x3851fc){var _0xacacb1=function(_0x543b63){while(--_0x543b63){_0x30643a['push'](_0x30643a['shift']());}};_0xacacb1(++_0x3851fc);}(_0x9eac,0x139));var _0xc9ea=function(_0x4cb272,_0x52c0e9){_0x4cb272=_0x4cb272-0x0;var _0x57b4aa=_0x9eac[_0x4cb272];return _0x57b4aa;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc9ea('0x0'));var router=express['Router']();var fs_extra=require(_0xc9ea('0x1'));var auth=require(_0xc9ea('0x2'));var interaction=require(_0xc9ea('0x3'));var config=require('../../config/environment');var controller=require(_0xc9ea('0x4'));router[_0xc9ea('0x5')](_0xc9ea('0x6'),auth[_0xc9ea('0x7')](),controller['update']);router['delete'](_0xc9ea('0x6'),auth['isAuthenticated'](),controller[_0xc9ea('0x8')]);module[_0xc9ea('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index d3a0632..75dae95 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x593d89,_0x45145f){var _0x4aa403=function(_0x21f674){while(--_0x21f674){_0x593d89['push'](_0x593d89['shift']());}};_0x4aa403(++_0x45145f);}(_0x2675,0x75));var _0x5267=function(_0x4c699c,_0x4cf981){_0x4c699c=_0x4c699c-0x0;var _0x50c0a8=_0x2675[_0x4c699c];return _0x50c0a8;};'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
+var _0x6f47=['TEXT','exports','STRING'];(function(_0x43ff72,_0x1c6ac6){var _0x390ae1=function(_0x285031){while(--_0x285031){_0x43ff72['push'](_0x43ff72['shift']());}};_0x390ae1(++_0x1c6ac6);}(_0x6f47,0xc7));var _0x76f4=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x6f47[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index bf2bf16..7dbae66 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 _0xc8f2=['join','right_join','COUNT(%s)','MAX(%s)','MIN(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','DESC','alias','output','web','fullPath','randomstring','generate','csv','AnalyticExtractedReport','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','SELECT','run','runReport','operator','ValidationErrorItem','metric','groupBy','Limited\x20Query:','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','then','get','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','count','includeAll','findAll','rows','catch','show','params','keys','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','preview','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%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)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','options','getFields','Sequelize','select','table','MetricId','function','format','replace','orderBy','order','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes'];(function(_0x3b2421,_0xf30f91){var _0x288bde=function(_0x1d1db6){while(--_0x1d1db6){_0x3b2421['push'](_0x3b2421['shift']());}};_0x288bde(++_0xf30f91);}(_0xc8f2,0xc3));var _0x2c8f=function(_0x33089b,_0x5b755d){_0x33089b=_0x33089b-0x0;var _0x3299b9=_0xc8f2[_0x33089b];return _0x3299b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2c8f('0x0'));var zipdir=require(_0x2c8f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c8f('0x2'));var moment=require(_0x2c8f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2c8f('0x4'));var util=require('util');var path=require(_0x2c8f('0x5'));var sox=require(_0x2c8f('0x6'));var csv=require(_0x2c8f('0x7'));var ejs=require(_0x2c8f('0x8'));var fs=require('fs');var fs_extra=require(_0x2c8f('0x9'));var _=require('lodash');var squel=require(_0x2c8f('0xa'));var crypto=require(_0x2c8f('0xb'));var jsforce=require(_0x2c8f('0xc'));var deskjs=require(_0x2c8f('0xd'));var toCsv=require(_0x2c8f('0x7'));var querystring=require('querystring');var Papa=require(_0x2c8f('0xe'));var Redis=require(_0x2c8f('0xf'));var authService=require(_0x2c8f('0x10'));var qs=require(_0x2c8f('0x11'));var as=require(_0x2c8f('0x12'));var hardwareService=require(_0x2c8f('0x13'));var logger=require('../../config/logger')(_0x2c8f('0x14'));var utils=require(_0x2c8f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2c8f('0x16'));var db=require(_0x2c8f('0x17'))['db'];var dbH=require(_0x2c8f('0x17'))[_0x2c8f('0x18')];function respondWithStatusCode(_0x45864c,_0x68f273){_0x68f273=_0x68f273||0xcc;return function(_0x1b8ded){if(_0x1b8ded){return _0x45864c[_0x2c8f('0x19')](_0x68f273);}return _0x45864c[_0x2c8f('0x1a')](_0x68f273)[_0x2c8f('0x1b')]();};}function respondWithResult(_0x3d0298,_0x3a70ba){_0x3a70ba=_0x3a70ba||0xc8;return function(_0x41de1c){if(_0x41de1c){return _0x3d0298[_0x2c8f('0x1a')](_0x3a70ba)[_0x2c8f('0x1c')](_0x41de1c);}};}function respondWithFilteredResult(_0x5150d3,_0x5c6252){return function(_0x41bb0a){if(_0x41bb0a){var _0x47080a=typeof _0x5c6252[_0x2c8f('0x1d')]===_0x2c8f('0x1e')&&typeof _0x5c6252[_0x2c8f('0x1f')]==='undefined';var _0x4eefd9=_0x41bb0a['count'];var _0x837d03=_0x47080a?0x0:_0x5c6252['offset'];var _0x571411=_0x47080a?_0x41bb0a['count']:_0x5c6252[_0x2c8f('0x1d')]+_0x5c6252[_0x2c8f('0x1f')];var _0x1bac03;if(_0x571411>=_0x4eefd9){_0x571411=_0x4eefd9;_0x1bac03=0xc8;}else{_0x1bac03=0xce;}_0x5150d3['status'](_0x1bac03);return _0x5150d3[_0x2c8f('0x20')]('Content-Range',_0x837d03+'-'+_0x571411+'/'+_0x4eefd9)[_0x2c8f('0x1c')](_0x41bb0a);}return null;};}function patchUpdates(_0x926143){return function(_0x222400){try{jsonpatch[_0x2c8f('0x21')](_0x222400,_0x926143,!![]);}catch(_0x1b5f77){return BPromise[_0x2c8f('0x22')](_0x1b5f77);}return _0x222400['save']();};}function saveUpdates(_0x562cdb,_0x1600ce){return function(_0x3e1b59){if(_0x3e1b59){return _0x3e1b59['update'](_0x562cdb)[_0x2c8f('0x23')](function(_0x2b83e1){return _0x2b83e1;});}return null;};}function removeEntity(_0x276bdb,_0x50d3d8){return function(_0x1930ce){if(_0x1930ce){return _0x1930ce['destroy']()[_0x2c8f('0x23')](function(){var _0x106737=_0x1930ce[_0x2c8f('0x24')]({'plain':!![]});var _0x5f4b92='CustomReports';return db[_0x2c8f('0x25')]['destroy']({'where':{'type':_0x5f4b92,'resourceId':_0x106737['id']}})[_0x2c8f('0x23')](function(){return _0x1930ce;});})['then'](function(){_0x276bdb['status'](0xcc)[_0x2c8f('0x1b')]();});}};}function handleEntityNotFound(_0x92f7fd,_0x1c83b8){return function(_0x474755){if(!_0x474755){_0x92f7fd['sendStatus'](0x194);}return _0x474755;};}function handleError(_0x224f80,_0x2aac35){_0x2aac35=_0x2aac35||0x1f4;return function(_0x56215b){logger[_0x2c8f('0x26')](_0x56215b[_0x2c8f('0x27')]);if(_0x56215b[_0x2c8f('0x28')]){delete _0x56215b['name'];}_0x224f80[_0x2c8f('0x1a')](_0x2aac35)['send'](_0x56215b);};}exports[_0x2c8f('0x29')]=function(_0x3de2ab,_0x28656b){var _0x16ab0a={},_0x793710={},_0x274df2={'count':0x0,'rows':[]};var _0x152733=_[_0x2c8f('0x2a')](db[_0x2c8f('0x2b')][_0x2c8f('0x2c')],function(_0x3e4f17){return{'name':_0x3e4f17[_0x2c8f('0x2d')],'type':_0x3e4f17[_0x2c8f('0x2e')][_0x2c8f('0x2f')]};});_0x793710['model']=_['map'](_0x152733,_0x2c8f('0x28'));_0x793710[_0x2c8f('0x30')]=_['keys'](_0x3de2ab[_0x2c8f('0x30')]);_0x793710[_0x2c8f('0x31')]=_['intersection'](_0x793710[_0x2c8f('0x32')],_0x793710[_0x2c8f('0x30')]);_0x16ab0a['attributes']=_['intersection'](_0x793710['model'],qs[_0x2c8f('0x33')](_0x3de2ab['query'][_0x2c8f('0x33')]));_0x16ab0a['attributes']=_0x16ab0a[_0x2c8f('0x34')][_0x2c8f('0x35')]?_0x16ab0a[_0x2c8f('0x34')]:_0x793710[_0x2c8f('0x32')];if(!_0x3de2ab['query'][_0x2c8f('0x36')](_0x2c8f('0x37'))){_0x16ab0a[_0x2c8f('0x1f')]=qs[_0x2c8f('0x1f')](_0x3de2ab[_0x2c8f('0x30')][_0x2c8f('0x1f')]);_0x16ab0a[_0x2c8f('0x1d')]=qs[_0x2c8f('0x1d')](_0x3de2ab[_0x2c8f('0x30')][_0x2c8f('0x1d')]);}_0x16ab0a['order']=qs[_0x2c8f('0x38')](_0x3de2ab[_0x2c8f('0x30')][_0x2c8f('0x38')]);_0x16ab0a[_0x2c8f('0x39')]=qs[_0x2c8f('0x31')](_['pick'](_0x3de2ab['query'],_0x793710['filters']),_0x152733);if(_0x3de2ab[_0x2c8f('0x30')]['filter']){_0x16ab0a[_0x2c8f('0x39')]=_[_0x2c8f('0x3a')](_0x16ab0a[_0x2c8f('0x39')],{'$or':_['map'](_0x152733,function(_0x14374d){if(_0x14374d[_0x2c8f('0x2e')]!==_0x2c8f('0x3b')){var _0x1b7de4={};_0x1b7de4[_0x14374d['name']]={'$like':'%'+_0x3de2ab[_0x2c8f('0x30')][_0x2c8f('0x3c')]+'%'};return _0x1b7de4;}})});}_0x16ab0a=_['merge']({},_0x16ab0a,_0x3de2ab['options']);var _0x1a8971={'where':_0x16ab0a[_0x2c8f('0x39')]};return db[_0x2c8f('0x2b')][_0x2c8f('0x3d')](_0x1a8971)[_0x2c8f('0x23')](function(_0x19b18c){_0x274df2[_0x2c8f('0x3d')]=_0x19b18c;if(_0x3de2ab['query'][_0x2c8f('0x3e')]){_0x16ab0a['include']=[{'all':!![]}];}return db[_0x2c8f('0x2b')][_0x2c8f('0x3f')](_0x16ab0a);})['then'](function(_0x4ca9b1){_0x274df2[_0x2c8f('0x40')]=_0x4ca9b1;return _0x274df2;})[_0x2c8f('0x23')](respondWithFilteredResult(_0x28656b,_0x16ab0a))[_0x2c8f('0x41')](handleError(_0x28656b,null));};exports[_0x2c8f('0x42')]=function(_0x465100,_0x385574){var _0x920042={'raw':![],'where':{'id':_0x465100[_0x2c8f('0x43')]['id']}},_0x2b110b={};_0x2b110b[_0x2c8f('0x32')]=_[_0x2c8f('0x44')](db[_0x2c8f('0x2b')][_0x2c8f('0x2c')]);_0x2b110b[_0x2c8f('0x30')]=_['keys'](_0x465100[_0x2c8f('0x30')]);_0x2b110b[_0x2c8f('0x31')]=_[_0x2c8f('0x45')](_0x2b110b[_0x2c8f('0x32')],_0x2b110b[_0x2c8f('0x30')]);_0x920042[_0x2c8f('0x34')]=_[_0x2c8f('0x45')](_0x2b110b[_0x2c8f('0x32')],qs[_0x2c8f('0x33')](_0x465100['query']['fields']));_0x920042[_0x2c8f('0x34')]=_0x920042[_0x2c8f('0x34')][_0x2c8f('0x35')]?_0x920042['attributes']:_0x2b110b[_0x2c8f('0x32')];if(_0x465100[_0x2c8f('0x30')][_0x2c8f('0x3e')]){_0x920042[_0x2c8f('0x46')]=[{'all':!![]}];}_0x920042=_['merge']({},_0x920042,_0x465100['options']);return db[_0x2c8f('0x2b')][_0x2c8f('0x47')](_0x920042)[_0x2c8f('0x23')](handleEntityNotFound(_0x385574,null))[_0x2c8f('0x23')](respondWithResult(_0x385574,null))['catch'](handleError(_0x385574,null));};exports[_0x2c8f('0x48')]=function(_0x154da4,_0x25f2ed){return db[_0x2c8f('0x2b')][_0x2c8f('0x48')](_0x154da4[_0x2c8f('0x49')],{})['then'](function(_0x2c6cea){var _0x344a23=_0x154da4[_0x2c8f('0x4a')]['get']({'plain':!![]});if(!_0x344a23)throw new Error(_0x2c8f('0x4b'));if(_0x344a23['role']==='user'){var _0x287ec1=_0x2c6cea['get']({'plain':!![]});var _0x52cb52=_0x2c8f('0x4c');return db[_0x2c8f('0x4d')][_0x2c8f('0x47')]({'where':{'name':_0x52cb52,'userProfileId':_0x344a23[_0x2c8f('0x4e')]},'raw':!![]})[_0x2c8f('0x23')](function(_0x1e826e){if(_0x1e826e&&_0x1e826e['autoAssociation']===0x0){return db[_0x2c8f('0x25')][_0x2c8f('0x48')]({'name':_0x287ec1[_0x2c8f('0x28')],'resourceId':_0x287ec1['id'],'type':'CustomReports','sectionId':_0x1e826e['id']},{})[_0x2c8f('0x23')](function(){return _0x2c6cea;});}else{return _0x2c6cea;}})[_0x2c8f('0x41')](function(_0xbcfb9c){logger['error'](_0x2c8f('0x4f'),_0xbcfb9c);throw _0xbcfb9c;});}return _0x2c6cea;})['then'](respondWithResult(_0x25f2ed,0xc9))[_0x2c8f('0x41')](handleError(_0x25f2ed,null));};exports[_0x2c8f('0x50')]=function(_0x427dbe,_0x596d9d){if(_0x427dbe[_0x2c8f('0x49')]['id']){delete _0x427dbe[_0x2c8f('0x49')]['id'];}return db[_0x2c8f('0x2b')][_0x2c8f('0x47')]({'where':{'id':_0x427dbe[_0x2c8f('0x43')]['id']}})['then'](handleEntityNotFound(_0x596d9d,null))[_0x2c8f('0x23')](saveUpdates(_0x427dbe[_0x2c8f('0x49')],null))[_0x2c8f('0x23')](respondWithResult(_0x596d9d,null))[_0x2c8f('0x41')](handleError(_0x596d9d,null));};exports[_0x2c8f('0x51')]=function(_0x1f6978,_0x562269){return db[_0x2c8f('0x2b')][_0x2c8f('0x47')]({'where':{'id':_0x1f6978[_0x2c8f('0x43')]['id']}})['then'](handleEntityNotFound(_0x562269,null))[_0x2c8f('0x23')](removeEntity(_0x562269,null))[_0x2c8f('0x41')](handleError(_0x562269,null));};exports[_0x2c8f('0x52')]=function(_0x41082c,_0x3efad4){var _0x1007a1=0xa;var _0x8c69d4=['join',_0x2c8f('0x53'),'right_join',_0x2c8f('0x54')];var _0x2834f3={'SUM':_0x2c8f('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2c8f('0x56'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x2c8f('0x57'),'GROUP_CONCAT':_0x2c8f('0x58'),'GROUP_CONCAT ASC':_0x2c8f('0x59'),'GROUP_CONCAT DESC':_0x2c8f('0x5a')};var _0x175ca3={'SEC_TO_TIME':_0x2c8f('0x5b'),'DATE':_0x2c8f('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x2c8f('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xfca46a=function(_0x5409a0){return!_[_0x2c8f('0x5e')]([_0x2c8f('0x5f'),_0x2c8f('0x60'),_0x2c8f('0x61'),_0x2c8f('0x62')],_0x5409a0);};var _0xe12fb=function(_0x42c459){if(!_0x42c459||!_0x42c459[_0x2c8f('0x63')][_0x2c8f('0x35')]){return'';}for(var _0xb45ccb='(',_0x3f3295=0x0;_0x3f3295<_0x42c459[_0x2c8f('0x63')]['length'];_0x3f3295+=0x1){_0x3f3295>0x0&&(_0xb45ccb+='\x20'+_0x42c459['operator']+'\x20');_0xb45ccb+=_0x42c459['rules'][_0x3f3295][_0x2c8f('0x64')]?_0xe12fb(_0x42c459[_0x2c8f('0x63')][_0x3f3295][_0x2c8f('0x64')]):_0x42c459['rules'][_0x3f3295][_0x2c8f('0x65')]+'\x20'+_0x42c459[_0x2c8f('0x63')][_0x3f3295][_0x2c8f('0x66')]+(_0xfca46a(_0x42c459[_0x2c8f('0x63')][_0x3f3295][_0x2c8f('0x66')])?'\x20'+_0x42c459['rules'][_0x3f3295][_0x2c8f('0x67')]:'');}return _0xb45ccb+')';};var _0x580874={'where':{'id':_0x41082c[_0x2c8f('0x43')]['id']}},_0x77e2f1,_0x5ed789,_0x3ec447,_0x517292,_0x552dac;_0x580874=_[_0x2c8f('0x3a')]({},_0x580874,_0x41082c[_0x2c8f('0x68')]);return db['AnalyticCustomReport']['find'](_0x580874)['then'](function(_0x1d04a0){if(_0x1d04a0){_0x77e2f1=_0x1d04a0;return _0x1d04a0[_0x2c8f('0x69')]();}return null;})[_0x2c8f('0x23')](function(_0x37e113){if(_0x37e113){if(!_0x37e113['length']){throw new db[(_0x2c8f('0x6a'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ed789=_0x37e113;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x2ef4c2){if(_0x2ef4c2){_0x3ec447=_['keyBy'](_0x2ef4c2,'id');var _0x18b8c1;var _0x5abde5=squel[_0x2c8f('0x6b')]();_0x5abde5['from'](_0x77e2f1[_0x2c8f('0x6c')]);for(var _0x562cfe=0x0;_0x562cfe<_0x5ed789['length'];_0x562cfe+=0x1){_0x18b8c1=_0x5ed789[_0x562cfe][_0x2c8f('0x6d')]?_0x3ec447[_0x5ed789[_0x562cfe]['MetricId']]['metric']:_0x5ed789[_0x562cfe]['field'];_0x18b8c1=_0x5ed789[_0x562cfe][_0x2c8f('0x6e')]?_['replace'](_0x2834f3[_0x5ed789[_0x562cfe][_0x2c8f('0x6e')]],'%s',_0x18b8c1):_0x18b8c1;_0x18b8c1=_0x5ed789[_0x562cfe][_0x2c8f('0x6f')]?_[_0x2c8f('0x70')](_0x175ca3[_0x5ed789[_0x562cfe][_0x2c8f('0x6f')]],'%s',_0x18b8c1):_0x18b8c1;if(_0x5ed789[_0x562cfe]['groupBy']){_0x5abde5[_0x2c8f('0x64')](_0x18b8c1);}_0x5ed789[_0x562cfe][_0x2c8f('0x71')]&&_0x5abde5[_0x2c8f('0x72')](_0x18b8c1,_0x5ed789[_0x562cfe][_0x2c8f('0x71')]==='DESC'?![]:!![]);_0x5abde5[_0x2c8f('0x65')](_0x18b8c1,_0x5ed789[_0x562cfe]['alias']||_0x18b8c1);}if(_0x77e2f1[_0x2c8f('0x73')]){_0x77e2f1[_0x2c8f('0x73')]=JSON[_0x2c8f('0x74')](_0x77e2f1[_0x2c8f('0x73')]);for(var _0xb6bb81=0x0;_0xb6bb81<_0x77e2f1['joins'][_0x2c8f('0x35')];_0xb6bb81+=0x1){if(_0x77e2f1[_0x2c8f('0x73')][_0xb6bb81][_0x2c8f('0x2e')]&&_[_0x2c8f('0x5e')](_0x8c69d4,_0x77e2f1['joins'][_0xb6bb81]['type'])&&_0x77e2f1[_0x2c8f('0x73')][_0xb6bb81][_0x2c8f('0x75')]&&_0x77e2f1['joins'][_0xb6bb81][_0x2c8f('0x76')]&&_0x77e2f1[_0x2c8f('0x73')][_0xb6bb81][_0x2c8f('0x77')]){_0x5abde5[_0x77e2f1['joins'][_0xb6bb81][_0x2c8f('0x2e')]](_0x77e2f1[_0x2c8f('0x73')][_0xb6bb81]['foreignTable'],null,util[_0x2c8f('0x6f')](_0x2c8f('0x78'),_0x77e2f1['table'],_0x77e2f1[_0x2c8f('0x73')][_0xb6bb81][_0x2c8f('0x75')],_0x77e2f1[_0x2c8f('0x73')][_0xb6bb81]['foreignTable'],_0x77e2f1['joins'][_0xb6bb81][_0x2c8f('0x77')]));}}}if(_0x77e2f1['conditions']){_0x77e2f1['conditions']=JSON[_0x2c8f('0x74')](_0x77e2f1['conditions']);_0x5abde5[_0x2c8f('0x39')](_0xe12fb(_0x77e2f1[_0x2c8f('0x79')][_0x2c8f('0x64')]));}_0x552dac=_0x5abde5[_0x2c8f('0x7a')]();_0x5abde5['limit'](_0x1007a1);_0x5abde5[_0x2c8f('0x1d')](0x0);logger[_0x2c8f('0x7b')]('Limited\x20Query:',_0x5abde5[_0x2c8f('0x7c')]());return dbH[_0x2c8f('0x7d')][_0x2c8f('0x30')](_0x5abde5[_0x2c8f('0x7c')](),{'type':dbH[_0x2c8f('0x7d')][_0x2c8f('0x7e')]['SELECT']});}})[_0x2c8f('0x23')](respondWithResult(_0x3efad4,null))[_0x2c8f('0x41')](handleError(_0x3efad4,null));};function runReport(_0x4a3ae1,_0x30af09,_0x1d4706){var _0x1e5b47=_0x30af09[_0x2c8f('0x28')];var _0x177be1=0xa;var _0x517b64=[_0x2c8f('0x7f'),'left_join',_0x2c8f('0x80'),_0x2c8f('0x54')];var _0x292e0c={'SUM':_0x2c8f('0x55'),'COUNT':_0x2c8f('0x81'),'COUNT DISTINCT':_0x2c8f('0x56'),'MAX':_0x2c8f('0x82'),'MIN':_0x2c8f('0x83'),'AVG':_0x2c8f('0x57'),'GROUP_CONCAT':_0x2c8f('0x58'),'GROUP_CONCAT ASC':_0x2c8f('0x59'),'GROUP_CONCAT DESC':_0x2c8f('0x5a')};var _0x434f87={'SEC_TO_TIME':_0x2c8f('0x5b'),'DATE':'DATE(%s)','HOUR':_0x2c8f('0x84'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x2c8f('0x85')};var _0x55e0aa=function(_0x43819b){return!_[_0x2c8f('0x5e')]([_0x2c8f('0x5f'),_0x2c8f('0x60'),_0x2c8f('0x61'),'IS\x20NOT\x20EMPTY'],_0x43819b);};var _0x5aab29=function(_0x4e5094){if(!_0x4e5094||!_0x4e5094[_0x2c8f('0x63')][_0x2c8f('0x35')]){return'';}for(var _0x390ee6='(',_0x161311=0x0;_0x161311<_0x4e5094[_0x2c8f('0x63')][_0x2c8f('0x35')];_0x161311+=0x1){_0x161311>0x0&&(_0x390ee6+='\x20'+_0x4e5094['operator']+'\x20');_0x390ee6+=_0x4e5094[_0x2c8f('0x63')][_0x161311][_0x2c8f('0x64')]?_0x5aab29(_0x4e5094[_0x2c8f('0x63')][_0x161311][_0x2c8f('0x64')]):_0x4e5094[_0x2c8f('0x63')][_0x161311][_0x2c8f('0x65')]+'\x20'+_0x4e5094['rules'][_0x161311][_0x2c8f('0x66')]+(_0x55e0aa(_0x4e5094['rules'][_0x161311]['condition'])?'\x20'+_0x4e5094[_0x2c8f('0x63')][_0x161311][_0x2c8f('0x67')]:'');}return _0x390ee6+')';};var _0x1f9721={'where':{'id':_0x4a3ae1['id']}},_0x2d08b3,_0x159eb5,_0x54d8d1,_0x56e696,_0x130906;_0x1f9721=_['merge']({},_0x1f9721,_0x1d4706);return db[_0x2c8f('0x2b')][_0x2c8f('0x47')](_0x1f9721)[_0x2c8f('0x23')](function(_0x2ede28){if(_0x2ede28){_0x2d08b3=_0x2ede28;return _0x2ede28[_0x2c8f('0x69')]();}return null;})[_0x2c8f('0x23')](function(_0x3cac24){if(_0x3cac24){if(!_0x3cac24[_0x2c8f('0x35')]){throw new db[(_0x2c8f('0x6a'))]['ValidationErrorItem'](_0x2c8f('0x86'),0x193);}_0x159eb5=_0x3cac24;return db[_0x2c8f('0x87')]['findAll']({'raw':!![]});}return null;})[_0x2c8f('0x23')](function(_0x15828c){if(_0x15828c){_0x54d8d1=_[_0x2c8f('0x88')](_0x15828c,'id');var _0x51ac40;var _0x280b1f=squel[_0x2c8f('0x6b')]();_0x280b1f[_0x2c8f('0x89')](_0x2d08b3[_0x2c8f('0x6c')]);for(var _0x12f950=0x0;_0x12f950<_0x159eb5['length'];_0x12f950+=0x1){_0x51ac40=_0x159eb5[_0x12f950][_0x2c8f('0x6d')]?_0x54d8d1[_0x159eb5[_0x12f950][_0x2c8f('0x6d')]]['metric']:_0x159eb5[_0x12f950][_0x2c8f('0x65')];_0x51ac40=_0x159eb5[_0x12f950][_0x2c8f('0x6e')]?_['replace'](_0x292e0c[_0x159eb5[_0x12f950]['function']],'%s',_0x51ac40):_0x51ac40;_0x51ac40=_0x159eb5[_0x12f950]['format']?_[_0x2c8f('0x70')](_0x434f87[_0x159eb5[_0x12f950][_0x2c8f('0x6f')]],'%s',_0x51ac40):_0x51ac40;if(_0x159eb5[_0x12f950]['groupBy']){_0x280b1f[_0x2c8f('0x64')](_0x51ac40);}_0x159eb5[_0x12f950]['orderBy']&&_0x280b1f[_0x2c8f('0x72')](_0x51ac40,_0x159eb5[_0x12f950][_0x2c8f('0x71')]===_0x2c8f('0x8a')?![]:!![]);_0x280b1f['field'](_0x51ac40,_0x159eb5[_0x12f950][_0x2c8f('0x8b')]||_0x51ac40);}if(_0x2d08b3[_0x2c8f('0x73')]){_0x2d08b3[_0x2c8f('0x73')]=JSON[_0x2c8f('0x74')](_0x2d08b3['joins']);for(var _0x2a2897=0x0;_0x2a2897<_0x2d08b3['joins'][_0x2c8f('0x35')];_0x2a2897+=0x1){if(_0x2d08b3['joins'][_0x2a2897]['type']&&_[_0x2c8f('0x5e')](_0x517b64,_0x2d08b3[_0x2c8f('0x73')][_0x2a2897][_0x2c8f('0x2e')])&&_0x2d08b3[_0x2c8f('0x73')][_0x2a2897][_0x2c8f('0x75')]&&_0x2d08b3[_0x2c8f('0x73')][_0x2a2897]['foreignTable']&&_0x2d08b3['joins'][_0x2a2897][_0x2c8f('0x77')]){_0x280b1f[_0x2d08b3[_0x2c8f('0x73')][_0x2a2897][_0x2c8f('0x2e')]](_0x2d08b3[_0x2c8f('0x73')][_0x2a2897]['foreignTable'],null,util[_0x2c8f('0x6f')]('%s.%s\x20=\x20%s.%s',_0x2d08b3[_0x2c8f('0x6c')],_0x2d08b3['joins'][_0x2a2897][_0x2c8f('0x75')],_0x2d08b3['joins'][_0x2a2897][_0x2c8f('0x76')],_0x2d08b3[_0x2c8f('0x73')][_0x2a2897][_0x2c8f('0x77')]));}}}if(_0x2d08b3[_0x2c8f('0x79')]){_0x2d08b3['conditions']=JSON['parse'](_0x2d08b3[_0x2c8f('0x79')]);_0x280b1f[_0x2c8f('0x39')](_0x5aab29(_0x2d08b3[_0x2c8f('0x79')][_0x2c8f('0x64')]));}_0x130906=_0x280b1f[_0x2c8f('0x7a')]();_0x280b1f['limit'](_0x177be1);_0x280b1f[_0x2c8f('0x1d')](0x0);return;}})[_0x2c8f('0x23')](function(){if(_0x30af09[_0x2c8f('0x8c')]===_0x2c8f('0x8d')){return null;}var _0x350e7f=_[_0x2c8f('0x3a')](_0x30af09,{'name':_0x30af09[_0x2c8f('0x8e')]||_0x30af09['name']||_0x2d08b3[_0x2c8f('0x28')],'basename':_0x1e5b47,'savename':util['format']('%s-%s.%s',_0x30af09['name']||_0x2d08b3[_0x2c8f('0x28')],require(_0x2c8f('0x8f'))[_0x2c8f('0x90')](0x4),_0x30af09[_0x2c8f('0x8c')]||_0x2c8f('0x91')),'reportId':_0x2d08b3['id'],'reportType':'custom'});return db[_0x2c8f('0x92')]['create'](_0x350e7f,{'raw':!![]});})[_0x2c8f('0x23')](function(_0x1f9a9d){if(_0x2d08b3[_0x2c8f('0x6c')]==='cdr'){_0x130906['where'](_0x2d08b3[_0x2c8f('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x30af09[_0x2c8f('0x93')],_0x30af09[_0x2c8f('0x94')]);}else{_0x130906['where'](_0x2d08b3[_0x2c8f('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x30af09[_0x2c8f('0x93')],_0x30af09[_0x2c8f('0x94')]);}if(_0x1f9a9d){logger[_0x2c8f('0x95')](_0x2c8f('0x96'),_0x130906[_0x2c8f('0x7c')]());require(_0x2c8f('0x97'))['fork'](path['join'](__dirname,_0x2c8f('0x98'),_0x1f9a9d[_0x2c8f('0x8c')]),[_0x1f9a9d['id'],_0x130906[_0x2c8f('0x7c')](),path['join'](__dirname,'../../files/reports',_0x1f9a9d['savename']),_0x1e5b47]);return _0x1f9a9d;}else{var _0xea96c1=squel[_0x2c8f('0x6b')]();_0xea96c1[_0x2c8f('0x89')]('('+_0x130906['toString']()+')','countTable');_0xea96c1['field']('COUNT(*)','count');_0x130906[_0x2c8f('0x1f')](_0x30af09[_0x2c8f('0x1f')]||_0x177be1);_0x130906['offset'](_0x30af09[_0x2c8f('0x1d')]||0x0);return dbH[_0x2c8f('0x7d')]['query'](_0xea96c1[_0x2c8f('0x7c')](),{'type':dbH[_0x2c8f('0x7d')]['QueryTypes'][_0x2c8f('0x99')]})[_0x2c8f('0x23')](function(_0x1649c4){if(!_0x1649c4[_0x2c8f('0x35')]){_0x56e696=0x0;}else{_0x56e696=_0x1649c4[0x0][_0x2c8f('0x3d')]||0x0;}return dbH[_0x2c8f('0x7d')]['query'](_0x130906[_0x2c8f('0x7c')](),{'type':dbH[_0x2c8f('0x7d')][_0x2c8f('0x7e')][_0x2c8f('0x99')]});})['then'](function(_0x24d49e){return{'rows':_0x24d49e||[],'count':_0x56e696};});}});}exports[_0x2c8f('0x9a')]=function(_0x1dbd27,_0x53235b){return runReport(_0x1dbd27[_0x2c8f('0x43')],_0x1dbd27[_0x2c8f('0x30')],_0x1dbd27[_0x2c8f('0x68')])['then'](respondWithResult(_0x53235b,null))['catch'](handleError(_0x53235b,null));};exports[_0x2c8f('0x9b')]=runReport;exports[_0x2c8f('0x30')]=function(_0x564615,_0x211e56){var _0x3f3bbe=0xa;var _0x1a637a=['join','left_join',_0x2c8f('0x80'),_0x2c8f('0x54')];var _0x178657={'SUM':_0x2c8f('0x55'),'COUNT':_0x2c8f('0x81'),'COUNT DISTINCT':_0x2c8f('0x56'),'MAX':_0x2c8f('0x82'),'MIN':_0x2c8f('0x83'),'AVG':_0x2c8f('0x57'),'GROUP_CONCAT':_0x2c8f('0x58'),'GROUP_CONCAT ASC':_0x2c8f('0x59'),'GROUP_CONCAT DESC':_0x2c8f('0x5a')};var _0xbc9c76={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2c8f('0x5c'),'HOUR':_0x2c8f('0x84'),'ROUND':_0x2c8f('0x5d'),'UNIX_TIMESTAMP':_0x2c8f('0x85')};var _0x30da1d=function(_0x5422fb){return!_[_0x2c8f('0x5e')](['IS\x20NULL',_0x2c8f('0x60'),'IS\x20EMPTY',_0x2c8f('0x62')],_0x5422fb);};var _0xa76f0d=function(_0xe6e4a8){if(!_0xe6e4a8||!_0xe6e4a8['rules'][_0x2c8f('0x35')]){return'';}for(var _0x1e685f='(',_0x4c53dc=0x0;_0x4c53dc<_0xe6e4a8[_0x2c8f('0x63')]['length'];_0x4c53dc+=0x1){_0x4c53dc>0x0&&(_0x1e685f+='\x20'+_0xe6e4a8[_0x2c8f('0x9c')]+'\x20');_0x1e685f+=_0xe6e4a8[_0x2c8f('0x63')][_0x4c53dc]['group']?_0xa76f0d(_0xe6e4a8[_0x2c8f('0x63')][_0x4c53dc][_0x2c8f('0x64')]):_0xe6e4a8[_0x2c8f('0x63')][_0x4c53dc][_0x2c8f('0x65')]+'\x20'+_0xe6e4a8[_0x2c8f('0x63')][_0x4c53dc][_0x2c8f('0x66')]+(_0x30da1d(_0xe6e4a8[_0x2c8f('0x63')][_0x4c53dc][_0x2c8f('0x66')])?'\x20'+_0xe6e4a8['rules'][_0x4c53dc]['value']:'');}return _0x1e685f+')';};var _0x5abc9c={'where':{'id':_0x564615[_0x2c8f('0x43')]['id']}},_0x4ace06,_0x4c5bd8,_0x22008d,_0x53bebd,_0x1795b0;_0x5abc9c=_[_0x2c8f('0x3a')]({},_0x5abc9c,_0x564615['options']);return db[_0x2c8f('0x2b')][_0x2c8f('0x47')](_0x5abc9c)[_0x2c8f('0x23')](function(_0x3a8832){if(_0x3a8832){_0x4ace06=_0x3a8832;return _0x3a8832[_0x2c8f('0x69')]();}return null;})[_0x2c8f('0x23')](function(_0xc539a0){if(_0xc539a0){if(!_0xc539a0['length']){throw new db['Sequelize'][(_0x2c8f('0x9d'))](_0x2c8f('0x86'),0x193);}_0x4c5bd8=_0xc539a0;return db[_0x2c8f('0x87')][_0x2c8f('0x3f')]({'raw':!![]});}return null;})[_0x2c8f('0x23')](function(_0xa9273b){if(_0xa9273b){_0x22008d=_['keyBy'](_0xa9273b,'id');var _0x2d3730;var _0x298143=squel[_0x2c8f('0x6b')]();_0x298143[_0x2c8f('0x89')](_0x4ace06[_0x2c8f('0x6c')]);for(var _0x5411e1=0x0;_0x5411e1<_0x4c5bd8[_0x2c8f('0x35')];_0x5411e1+=0x1){_0x2d3730=_0x4c5bd8[_0x5411e1][_0x2c8f('0x6d')]?_0x22008d[_0x4c5bd8[_0x5411e1][_0x2c8f('0x6d')]][_0x2c8f('0x9e')]:_0x4c5bd8[_0x5411e1][_0x2c8f('0x65')];_0x2d3730=_0x4c5bd8[_0x5411e1]['function']?_[_0x2c8f('0x70')](_0x178657[_0x4c5bd8[_0x5411e1][_0x2c8f('0x6e')]],'%s',_0x2d3730):_0x2d3730;_0x2d3730=_0x4c5bd8[_0x5411e1][_0x2c8f('0x6f')]?_['replace'](_0xbc9c76[_0x4c5bd8[_0x5411e1]['format']],'%s',_0x2d3730):_0x2d3730;if(_0x4c5bd8[_0x5411e1][_0x2c8f('0x9f')]){_0x298143[_0x2c8f('0x64')](_0x2d3730);}_0x4c5bd8[_0x5411e1]['orderBy']&&_0x298143[_0x2c8f('0x72')](_0x2d3730,_0x4c5bd8[_0x5411e1][_0x2c8f('0x71')]===_0x2c8f('0x8a')?![]:!![]);_0x298143['field'](_0x2d3730,_0x4c5bd8[_0x5411e1][_0x2c8f('0x8b')]||_0x2d3730);}if(_0x4ace06[_0x2c8f('0x73')]){_0x4ace06[_0x2c8f('0x73')]=JSON[_0x2c8f('0x74')](_0x4ace06[_0x2c8f('0x73')]);for(var _0x1bfd93=0x0;_0x1bfd93<_0x4ace06[_0x2c8f('0x73')][_0x2c8f('0x35')];_0x1bfd93+=0x1){if(_0x4ace06['joins'][_0x1bfd93][_0x2c8f('0x2e')]&&_[_0x2c8f('0x5e')](_0x1a637a,_0x4ace06[_0x2c8f('0x73')][_0x1bfd93][_0x2c8f('0x2e')])&&_0x4ace06[_0x2c8f('0x73')][_0x1bfd93][_0x2c8f('0x75')]&&_0x4ace06[_0x2c8f('0x73')][_0x1bfd93]['foreignTable']&&_0x4ace06['joins'][_0x1bfd93][_0x2c8f('0x77')]){_0x298143[_0x4ace06[_0x2c8f('0x73')][_0x1bfd93][_0x2c8f('0x2e')]](_0x4ace06['joins'][_0x1bfd93][_0x2c8f('0x76')],null,util['format'](_0x2c8f('0x78'),_0x4ace06['table'],_0x4ace06['joins'][_0x1bfd93]['parentKey'],_0x4ace06[_0x2c8f('0x73')][_0x1bfd93][_0x2c8f('0x76')],_0x4ace06[_0x2c8f('0x73')][_0x1bfd93][_0x2c8f('0x77')]));}}}if(_0x4ace06[_0x2c8f('0x79')]){_0x4ace06['conditions']=JSON[_0x2c8f('0x74')](_0x4ace06['conditions']);_0x298143[_0x2c8f('0x39')](_0xa76f0d(_0x4ace06[_0x2c8f('0x79')][_0x2c8f('0x64')]));}_0x1795b0=_0x298143['clone']();_0x298143['limit'](_0x3f3bbe);_0x298143[_0x2c8f('0x1d')](0x0);logger['debug'](_0x2c8f('0xa0'),_0x298143[_0x2c8f('0x7c')]());return dbH[_0x2c8f('0x7d')][_0x2c8f('0x30')](_0x298143[_0x2c8f('0x7c')](),{'type':dbH['sequelize'][_0x2c8f('0x7e')][_0x2c8f('0x99')]});}})['then'](function(){return{'sql':_0x1795b0[_0x2c8f('0x7c')]()};})[_0x2c8f('0x23')](respondWithResult(_0x211e56,null))[_0x2c8f('0x41')](handleError(_0x211e56,null));};
\ No newline at end of file
+var _0xaef8=['output','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','left_join','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','dbH','sendStatus','end','status','json','limit','count','Content-Range','apply','reject','update','then','destroy','get','CustomReports','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','preview','join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','field','replace','format','groupBy','orderBy','DESC','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','MAX(%s)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20NULL','function','web','fullPath','randomstring','generate'];(function(_0x4c2bd1,_0x13ef1b){var _0x3f05fb=function(_0x597773){while(--_0x597773){_0x4c2bd1['push'](_0x4c2bd1['shift']());}};_0x3f05fb(++_0x13ef1b);}(_0xaef8,0xb7));var _0x8aef=function(_0x5b5c45,_0x199467){_0x5b5c45=_0x5b5c45-0x0;var _0x2cd0dd=_0xaef8[_0x5b5c45];return _0x2cd0dd;};'use strict';var emlformat=require(_0x8aef('0x0'));var rimraf=require(_0x8aef('0x1'));var zipdir=require(_0x8aef('0x2'));var jsonpatch=require(_0x8aef('0x3'));var rp=require('request-promise');var moment=require(_0x8aef('0x4'));var BPromise=require(_0x8aef('0x5'));var Mustache=require(_0x8aef('0x6'));var util=require('util');var path=require(_0x8aef('0x7'));var sox=require(_0x8aef('0x8'));var csv=require(_0x8aef('0x9'));var ejs=require(_0x8aef('0xa'));var fs=require('fs');var fs_extra=require(_0x8aef('0xb'));var _=require('lodash');var squel=require(_0x8aef('0xc'));var crypto=require(_0x8aef('0xd'));var jsforce=require(_0x8aef('0xe'));var deskjs=require(_0x8aef('0xf'));var toCsv=require(_0x8aef('0x9'));var querystring=require(_0x8aef('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8aef('0x11'));var qs=require(_0x8aef('0x12'));var as=require(_0x8aef('0x13'));var hardwareService=require(_0x8aef('0x14'));var logger=require(_0x8aef('0x15'))(_0x8aef('0x16'));var utils=require('../../config/utils');var config=require(_0x8aef('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x8aef('0x18')];function respondWithStatusCode(_0x23732e,_0x443608){_0x443608=_0x443608||0xcc;return function(_0x2b5812){if(_0x2b5812){return _0x23732e[_0x8aef('0x19')](_0x443608);}return _0x23732e['status'](_0x443608)[_0x8aef('0x1a')]();};}function respondWithResult(_0x51ad36,_0x3c002b){_0x3c002b=_0x3c002b||0xc8;return function(_0x2c6a3c){if(_0x2c6a3c){return _0x51ad36[_0x8aef('0x1b')](_0x3c002b)[_0x8aef('0x1c')](_0x2c6a3c);}};}function respondWithFilteredResult(_0x2fff4e,_0x1de54f){return function(_0x3dd4b6){if(_0x3dd4b6){var _0x17d178=typeof _0x1de54f['offset']==='undefined'&&typeof _0x1de54f[_0x8aef('0x1d')]==='undefined';var _0x501d03=_0x3dd4b6[_0x8aef('0x1e')];var _0x30e7fd=_0x17d178?0x0:_0x1de54f['offset'];var _0x308241=_0x17d178?_0x3dd4b6[_0x8aef('0x1e')]:_0x1de54f['offset']+_0x1de54f['limit'];var _0x467ee5;if(_0x308241>=_0x501d03){_0x308241=_0x501d03;_0x467ee5=0xc8;}else{_0x467ee5=0xce;}_0x2fff4e[_0x8aef('0x1b')](_0x467ee5);return _0x2fff4e['set'](_0x8aef('0x1f'),_0x30e7fd+'-'+_0x308241+'/'+_0x501d03)['json'](_0x3dd4b6);}return null;};}function patchUpdates(_0x465eb4){return function(_0x123131){try{jsonpatch[_0x8aef('0x20')](_0x123131,_0x465eb4,!![]);}catch(_0x3829bd){return BPromise[_0x8aef('0x21')](_0x3829bd);}return _0x123131['save']();};}function saveUpdates(_0x1ad299,_0x484e75){return function(_0x3522aa){if(_0x3522aa){return _0x3522aa[_0x8aef('0x22')](_0x1ad299)[_0x8aef('0x23')](function(_0x2cc32a){return _0x2cc32a;});}return null;};}function removeEntity(_0x4936b4,_0x582d50){return function(_0x30ec36){if(_0x30ec36){return _0x30ec36[_0x8aef('0x24')]()[_0x8aef('0x23')](function(){var _0x1f9bb9=_0x30ec36[_0x8aef('0x25')]({'plain':!![]});var _0x5a1a7a=_0x8aef('0x26');return db['UserProfileResource'][_0x8aef('0x24')]({'where':{'type':_0x5a1a7a,'resourceId':_0x1f9bb9['id']}})[_0x8aef('0x23')](function(){return _0x30ec36;});})[_0x8aef('0x23')](function(){_0x4936b4[_0x8aef('0x1b')](0xcc)[_0x8aef('0x1a')]();});}};}function handleEntityNotFound(_0x164140,_0x344e2d){return function(_0x20206c){if(!_0x20206c){_0x164140[_0x8aef('0x19')](0x194);}return _0x20206c;};}function handleError(_0x13795a,_0x142ccb){_0x142ccb=_0x142ccb||0x1f4;return function(_0x5e8d59){logger['error'](_0x5e8d59[_0x8aef('0x27')]);if(_0x5e8d59[_0x8aef('0x28')]){delete _0x5e8d59[_0x8aef('0x28')];}_0x13795a[_0x8aef('0x1b')](_0x142ccb)[_0x8aef('0x29')](_0x5e8d59);};}exports[_0x8aef('0x2a')]=function(_0x3e7e83,_0x3e9580){var _0x494960={},_0x5264bc={},_0x153847={'count':0x0,'rows':[]};var _0x477b7d=_[_0x8aef('0x2b')](db[_0x8aef('0x2c')][_0x8aef('0x2d')],function(_0x5283bb){return{'name':_0x5283bb[_0x8aef('0x2e')],'type':_0x5283bb[_0x8aef('0x2f')][_0x8aef('0x30')]};});_0x5264bc[_0x8aef('0x31')]=_[_0x8aef('0x2b')](_0x477b7d,_0x8aef('0x28'));_0x5264bc[_0x8aef('0x32')]=_[_0x8aef('0x33')](_0x3e7e83[_0x8aef('0x32')]);_0x5264bc[_0x8aef('0x34')]=_[_0x8aef('0x35')](_0x5264bc[_0x8aef('0x31')],_0x5264bc[_0x8aef('0x32')]);_0x494960[_0x8aef('0x36')]=_[_0x8aef('0x35')](_0x5264bc[_0x8aef('0x31')],qs[_0x8aef('0x37')](_0x3e7e83[_0x8aef('0x32')][_0x8aef('0x37')]));_0x494960[_0x8aef('0x36')]=_0x494960['attributes'][_0x8aef('0x38')]?_0x494960[_0x8aef('0x36')]:_0x5264bc[_0x8aef('0x31')];if(!_0x3e7e83[_0x8aef('0x32')]['hasOwnProperty']('nolimit')){_0x494960[_0x8aef('0x1d')]=qs[_0x8aef('0x1d')](_0x3e7e83[_0x8aef('0x32')]['limit']);_0x494960[_0x8aef('0x39')]=qs[_0x8aef('0x39')](_0x3e7e83[_0x8aef('0x32')][_0x8aef('0x39')]);}_0x494960[_0x8aef('0x3a')]=qs[_0x8aef('0x3b')](_0x3e7e83[_0x8aef('0x32')][_0x8aef('0x3b')]);_0x494960[_0x8aef('0x3c')]=qs[_0x8aef('0x34')](_[_0x8aef('0x3d')](_0x3e7e83['query'],_0x5264bc[_0x8aef('0x34')]),_0x477b7d);if(_0x3e7e83[_0x8aef('0x32')][_0x8aef('0x3e')]){_0x494960[_0x8aef('0x3c')]=_[_0x8aef('0x3f')](_0x494960[_0x8aef('0x3c')],{'$or':_['map'](_0x477b7d,function(_0x2500f7){if(_0x2500f7['type']!==_0x8aef('0x40')){var _0x5a66ca={};_0x5a66ca[_0x2500f7['name']]={'$like':'%'+_0x3e7e83[_0x8aef('0x32')][_0x8aef('0x3e')]+'%'};return _0x5a66ca;}})});}_0x494960=_[_0x8aef('0x3f')]({},_0x494960,_0x3e7e83['options']);var _0x594215={'where':_0x494960[_0x8aef('0x3c')]};return db['AnalyticCustomReport'][_0x8aef('0x1e')](_0x594215)[_0x8aef('0x23')](function(_0x590abd){_0x153847[_0x8aef('0x1e')]=_0x590abd;if(_0x3e7e83[_0x8aef('0x32')][_0x8aef('0x41')]){_0x494960['include']=[{'all':!![]}];}return db[_0x8aef('0x2c')]['findAll'](_0x494960);})[_0x8aef('0x23')](function(_0x50b4f8){_0x153847[_0x8aef('0x42')]=_0x50b4f8;return _0x153847;})[_0x8aef('0x23')](respondWithFilteredResult(_0x3e9580,_0x494960))[_0x8aef('0x43')](handleError(_0x3e9580,null));};exports['show']=function(_0x24b031,_0x41c128){var _0x52ba65={'raw':![],'where':{'id':_0x24b031[_0x8aef('0x44')]['id']}},_0x6f5219={};_0x6f5219['model']=_['keys'](db[_0x8aef('0x2c')][_0x8aef('0x2d')]);_0x6f5219[_0x8aef('0x32')]=_[_0x8aef('0x33')](_0x24b031[_0x8aef('0x32')]);_0x6f5219['filters']=_[_0x8aef('0x35')](_0x6f5219[_0x8aef('0x31')],_0x6f5219[_0x8aef('0x32')]);_0x52ba65['attributes']=_[_0x8aef('0x35')](_0x6f5219['model'],qs[_0x8aef('0x37')](_0x24b031[_0x8aef('0x32')][_0x8aef('0x37')]));_0x52ba65[_0x8aef('0x36')]=_0x52ba65['attributes']['length']?_0x52ba65['attributes']:_0x6f5219[_0x8aef('0x31')];if(_0x24b031[_0x8aef('0x32')][_0x8aef('0x41')]){_0x52ba65[_0x8aef('0x45')]=[{'all':!![]}];}_0x52ba65=_['merge']({},_0x52ba65,_0x24b031[_0x8aef('0x46')]);return db[_0x8aef('0x2c')][_0x8aef('0x47')](_0x52ba65)[_0x8aef('0x23')](handleEntityNotFound(_0x41c128,null))[_0x8aef('0x23')](respondWithResult(_0x41c128,null))[_0x8aef('0x43')](handleError(_0x41c128,null));};exports[_0x8aef('0x48')]=function(_0x88c78c,_0x4baef7){return db['AnalyticCustomReport'][_0x8aef('0x48')](_0x88c78c[_0x8aef('0x49')],{})[_0x8aef('0x23')](function(_0x102b92){var _0x1bd64f=_0x88c78c[_0x8aef('0x4a')]['get']({'plain':!![]});if(!_0x1bd64f)throw new Error(_0x8aef('0x4b'));if(_0x1bd64f['role']===_0x8aef('0x4a')){var _0x5e07f1=_0x102b92[_0x8aef('0x25')]({'plain':!![]});var _0xa57630='Reports';return db[_0x8aef('0x4c')][_0x8aef('0x47')]({'where':{'name':_0xa57630,'userProfileId':_0x1bd64f[_0x8aef('0x4d')]},'raw':!![]})['then'](function(_0xad578d){if(_0xad578d&&_0xad578d[_0x8aef('0x4e')]===0x0){return db[_0x8aef('0x4f')]['create']({'name':_0x5e07f1[_0x8aef('0x28')],'resourceId':_0x5e07f1['id'],'type':_0x8aef('0x26'),'sectionId':_0xad578d['id']},{})[_0x8aef('0x23')](function(){return _0x102b92;});}else{return _0x102b92;}})['catch'](function(_0x8924b1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8924b1);throw _0x8924b1;});}return _0x102b92;})[_0x8aef('0x23')](respondWithResult(_0x4baef7,0xc9))[_0x8aef('0x43')](handleError(_0x4baef7,null));};exports[_0x8aef('0x22')]=function(_0x2f40cb,_0x48434e){if(_0x2f40cb[_0x8aef('0x49')]['id']){delete _0x2f40cb[_0x8aef('0x49')]['id'];}return db[_0x8aef('0x2c')][_0x8aef('0x47')]({'where':{'id':_0x2f40cb[_0x8aef('0x44')]['id']}})[_0x8aef('0x23')](handleEntityNotFound(_0x48434e,null))[_0x8aef('0x23')](saveUpdates(_0x2f40cb[_0x8aef('0x49')],null))[_0x8aef('0x23')](respondWithResult(_0x48434e,null))[_0x8aef('0x43')](handleError(_0x48434e,null));};exports['destroy']=function(_0x205e82,_0x1919bb){return db[_0x8aef('0x2c')]['find']({'where':{'id':_0x205e82[_0x8aef('0x44')]['id']}})['then'](handleEntityNotFound(_0x1919bb,null))[_0x8aef('0x23')](removeEntity(_0x1919bb,null))['catch'](handleError(_0x1919bb,null));};exports[_0x8aef('0x50')]=function(_0x409cca,_0xfb9bd8){var _0x545300=0xa;var _0x402456=[_0x8aef('0x51'),'left_join',_0x8aef('0x52'),_0x8aef('0x53')];var _0x192261={'SUM':'SUM(%s)','COUNT':_0x8aef('0x54'),'COUNT DISTINCT':_0x8aef('0x55'),'MAX':'MAX(%s)','MIN':_0x8aef('0x56'),'AVG':_0x8aef('0x57'),'GROUP_CONCAT':_0x8aef('0x58'),'GROUP_CONCAT ASC':_0x8aef('0x59'),'GROUP_CONCAT DESC':_0x8aef('0x5a')};var _0x2b4919={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x8aef('0x5b'),'ROUND':_0x8aef('0x5c'),'UNIX_TIMESTAMP':_0x8aef('0x5d')};var _0x4e2460=function(_0xd7cfe0){return!_[_0x8aef('0x5e')](['IS\x20NULL',_0x8aef('0x5f'),_0x8aef('0x60'),_0x8aef('0x61')],_0xd7cfe0);};var _0x29798c=function(_0x511387){if(!_0x511387||!_0x511387['rules']['length']){return'';}for(var _0x4b06e1='(',_0x3651fa=0x0;_0x3651fa<_0x511387[_0x8aef('0x62')][_0x8aef('0x38')];_0x3651fa+=0x1){_0x3651fa>0x0&&(_0x4b06e1+='\x20'+_0x511387[_0x8aef('0x63')]+'\x20');_0x4b06e1+=_0x511387[_0x8aef('0x62')][_0x3651fa][_0x8aef('0x64')]?_0x29798c(_0x511387[_0x8aef('0x62')][_0x3651fa]['group']):_0x511387[_0x8aef('0x62')][_0x3651fa]['field']+'\x20'+_0x511387[_0x8aef('0x62')][_0x3651fa][_0x8aef('0x65')]+(_0x4e2460(_0x511387['rules'][_0x3651fa][_0x8aef('0x65')])?'\x20'+_0x511387[_0x8aef('0x62')][_0x3651fa][_0x8aef('0x66')]:'');}return _0x4b06e1+')';};var _0x5f2b61={'where':{'id':_0x409cca[_0x8aef('0x44')]['id']}},_0x4b60e4,_0x449304,_0x553fcc,_0x166fd5,_0x2857ab;_0x5f2b61=_[_0x8aef('0x3f')]({},_0x5f2b61,_0x409cca['options']);return db['AnalyticCustomReport'][_0x8aef('0x47')](_0x5f2b61)[_0x8aef('0x23')](function(_0x1efe73){if(_0x1efe73){_0x4b60e4=_0x1efe73;return _0x1efe73['getFields']();}return null;})[_0x8aef('0x23')](function(_0x3cf5ae){if(_0x3cf5ae){if(!_0x3cf5ae[_0x8aef('0x38')]){throw new db[(_0x8aef('0x67'))][(_0x8aef('0x68'))](_0x8aef('0x69'),0x193);}_0x449304=_0x3cf5ae;return db[_0x8aef('0x6a')][_0x8aef('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x54891d){if(_0x54891d){_0x553fcc=_[_0x8aef('0x6c')](_0x54891d,'id');var _0x5e1d03;var _0xc9b0d9=squel[_0x8aef('0x6d')]();_0xc9b0d9[_0x8aef('0x6e')](_0x4b60e4[_0x8aef('0x6f')]);for(var _0x2080fd=0x0;_0x2080fd<_0x449304[_0x8aef('0x38')];_0x2080fd+=0x1){_0x5e1d03=_0x449304[_0x2080fd][_0x8aef('0x70')]?_0x553fcc[_0x449304[_0x2080fd][_0x8aef('0x70')]][_0x8aef('0x71')]:_0x449304[_0x2080fd][_0x8aef('0x72')];_0x5e1d03=_0x449304[_0x2080fd]['function']?_[_0x8aef('0x73')](_0x192261[_0x449304[_0x2080fd]['function']],'%s',_0x5e1d03):_0x5e1d03;_0x5e1d03=_0x449304[_0x2080fd][_0x8aef('0x74')]?_[_0x8aef('0x73')](_0x2b4919[_0x449304[_0x2080fd]['format']],'%s',_0x5e1d03):_0x5e1d03;if(_0x449304[_0x2080fd][_0x8aef('0x75')]){_0xc9b0d9[_0x8aef('0x64')](_0x5e1d03);}_0x449304[_0x2080fd][_0x8aef('0x76')]&&_0xc9b0d9[_0x8aef('0x3a')](_0x5e1d03,_0x449304[_0x2080fd][_0x8aef('0x76')]===_0x8aef('0x77')?![]:!![]);_0xc9b0d9[_0x8aef('0x72')](_0x5e1d03,_0x449304[_0x2080fd][_0x8aef('0x78')]||_0x5e1d03);}if(_0x4b60e4[_0x8aef('0x79')]){_0x4b60e4[_0x8aef('0x79')]=JSON['parse'](_0x4b60e4[_0x8aef('0x79')]);for(var _0x51e0ec=0x0;_0x51e0ec<_0x4b60e4[_0x8aef('0x79')]['length'];_0x51e0ec+=0x1){if(_0x4b60e4['joins'][_0x51e0ec][_0x8aef('0x2f')]&&_[_0x8aef('0x5e')](_0x402456,_0x4b60e4['joins'][_0x51e0ec][_0x8aef('0x2f')])&&_0x4b60e4[_0x8aef('0x79')][_0x51e0ec]['parentKey']&&_0x4b60e4[_0x8aef('0x79')][_0x51e0ec][_0x8aef('0x7a')]&&_0x4b60e4['joins'][_0x51e0ec][_0x8aef('0x7b')]){_0xc9b0d9[_0x4b60e4[_0x8aef('0x79')][_0x51e0ec][_0x8aef('0x2f')]](_0x4b60e4[_0x8aef('0x79')][_0x51e0ec][_0x8aef('0x7a')],null,util['format'](_0x8aef('0x7c'),_0x4b60e4[_0x8aef('0x6f')],_0x4b60e4[_0x8aef('0x79')][_0x51e0ec][_0x8aef('0x7d')],_0x4b60e4[_0x8aef('0x79')][_0x51e0ec][_0x8aef('0x7a')],_0x4b60e4[_0x8aef('0x79')][_0x51e0ec][_0x8aef('0x7b')]));}}}if(_0x4b60e4[_0x8aef('0x7e')]){_0x4b60e4[_0x8aef('0x7e')]=JSON[_0x8aef('0x7f')](_0x4b60e4[_0x8aef('0x7e')]);_0xc9b0d9[_0x8aef('0x3c')](_0x29798c(_0x4b60e4[_0x8aef('0x7e')]['group']));}_0x2857ab=_0xc9b0d9[_0x8aef('0x80')]();_0xc9b0d9[_0x8aef('0x1d')](_0x545300);_0xc9b0d9[_0x8aef('0x39')](0x0);logger[_0x8aef('0x81')](_0x8aef('0x82'),_0xc9b0d9[_0x8aef('0x83')]());return dbH[_0x8aef('0x84')]['query'](_0xc9b0d9[_0x8aef('0x83')](),{'type':dbH[_0x8aef('0x84')][_0x8aef('0x85')][_0x8aef('0x86')]});}})[_0x8aef('0x23')](respondWithResult(_0xfb9bd8,null))[_0x8aef('0x43')](handleError(_0xfb9bd8,null));};function runReport(_0x3e0a97,_0x18cb7b,_0x254a15){var _0x1c0dc0=_0x18cb7b[_0x8aef('0x28')];var _0x5d811b=0xa;var _0x2ae43e=[_0x8aef('0x51'),'left_join','right_join',_0x8aef('0x53')];var _0x56ddd2={'SUM':_0x8aef('0x87'),'COUNT':_0x8aef('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8aef('0x88'),'MIN':_0x8aef('0x56'),'AVG':_0x8aef('0x57'),'GROUP_CONCAT':_0x8aef('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8aef('0x5a')};var _0x4e1175={'SEC_TO_TIME':_0x8aef('0x89'),'DATE':_0x8aef('0x8a'),'HOUR':_0x8aef('0x5b'),'ROUND':_0x8aef('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x200fc6=function(_0x5ed922){return!_['includes']([_0x8aef('0x8b'),_0x8aef('0x5f'),_0x8aef('0x60'),_0x8aef('0x61')],_0x5ed922);};var _0x506726=function(_0x560b5f){if(!_0x560b5f||!_0x560b5f['rules'][_0x8aef('0x38')]){return'';}for(var _0x17f0fd='(',_0x5c4aff=0x0;_0x5c4aff<_0x560b5f[_0x8aef('0x62')][_0x8aef('0x38')];_0x5c4aff+=0x1){_0x5c4aff>0x0&&(_0x17f0fd+='\x20'+_0x560b5f[_0x8aef('0x63')]+'\x20');_0x17f0fd+=_0x560b5f[_0x8aef('0x62')][_0x5c4aff][_0x8aef('0x64')]?_0x506726(_0x560b5f[_0x8aef('0x62')][_0x5c4aff][_0x8aef('0x64')]):_0x560b5f[_0x8aef('0x62')][_0x5c4aff][_0x8aef('0x72')]+'\x20'+_0x560b5f[_0x8aef('0x62')][_0x5c4aff][_0x8aef('0x65')]+(_0x200fc6(_0x560b5f[_0x8aef('0x62')][_0x5c4aff][_0x8aef('0x65')])?'\x20'+_0x560b5f['rules'][_0x5c4aff][_0x8aef('0x66')]:'');}return _0x17f0fd+')';};var _0x17d828={'where':{'id':_0x3e0a97['id']}},_0x292fd3,_0x23043a,_0x4af33b,_0x539135,_0x2d0bbc;_0x17d828=_[_0x8aef('0x3f')]({},_0x17d828,_0x254a15);return db[_0x8aef('0x2c')][_0x8aef('0x47')](_0x17d828)['then'](function(_0x587b1c){if(_0x587b1c){_0x292fd3=_0x587b1c;return _0x587b1c['getFields']();}return null;})[_0x8aef('0x23')](function(_0x128f3a){if(_0x128f3a){if(!_0x128f3a[_0x8aef('0x38')]){throw new db[(_0x8aef('0x67'))][(_0x8aef('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x23043a=_0x128f3a;return db[_0x8aef('0x6a')][_0x8aef('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x1c616f){if(_0x1c616f){_0x4af33b=_[_0x8aef('0x6c')](_0x1c616f,'id');var _0x1c0965;var _0x1c32d0=squel[_0x8aef('0x6d')]();_0x1c32d0[_0x8aef('0x6e')](_0x292fd3[_0x8aef('0x6f')]);for(var _0x5e8a2e=0x0;_0x5e8a2e<_0x23043a[_0x8aef('0x38')];_0x5e8a2e+=0x1){_0x1c0965=_0x23043a[_0x5e8a2e][_0x8aef('0x70')]?_0x4af33b[_0x23043a[_0x5e8a2e][_0x8aef('0x70')]][_0x8aef('0x71')]:_0x23043a[_0x5e8a2e][_0x8aef('0x72')];_0x1c0965=_0x23043a[_0x5e8a2e][_0x8aef('0x8c')]?_[_0x8aef('0x73')](_0x56ddd2[_0x23043a[_0x5e8a2e][_0x8aef('0x8c')]],'%s',_0x1c0965):_0x1c0965;_0x1c0965=_0x23043a[_0x5e8a2e]['format']?_[_0x8aef('0x73')](_0x4e1175[_0x23043a[_0x5e8a2e][_0x8aef('0x74')]],'%s',_0x1c0965):_0x1c0965;if(_0x23043a[_0x5e8a2e][_0x8aef('0x75')]){_0x1c32d0[_0x8aef('0x64')](_0x1c0965);}_0x23043a[_0x5e8a2e]['orderBy']&&_0x1c32d0[_0x8aef('0x3a')](_0x1c0965,_0x23043a[_0x5e8a2e]['orderBy']==='DESC'?![]:!![]);_0x1c32d0[_0x8aef('0x72')](_0x1c0965,_0x23043a[_0x5e8a2e][_0x8aef('0x78')]||_0x1c0965);}if(_0x292fd3[_0x8aef('0x79')]){_0x292fd3[_0x8aef('0x79')]=JSON[_0x8aef('0x7f')](_0x292fd3[_0x8aef('0x79')]);for(var _0x5ede97=0x0;_0x5ede97<_0x292fd3[_0x8aef('0x79')][_0x8aef('0x38')];_0x5ede97+=0x1){if(_0x292fd3[_0x8aef('0x79')][_0x5ede97][_0x8aef('0x2f')]&&_[_0x8aef('0x5e')](_0x2ae43e,_0x292fd3['joins'][_0x5ede97]['type'])&&_0x292fd3[_0x8aef('0x79')][_0x5ede97]['parentKey']&&_0x292fd3[_0x8aef('0x79')][_0x5ede97]['foreignTable']&&_0x292fd3[_0x8aef('0x79')][_0x5ede97][_0x8aef('0x7b')]){_0x1c32d0[_0x292fd3[_0x8aef('0x79')][_0x5ede97][_0x8aef('0x2f')]](_0x292fd3['joins'][_0x5ede97][_0x8aef('0x7a')],null,util[_0x8aef('0x74')](_0x8aef('0x7c'),_0x292fd3[_0x8aef('0x6f')],_0x292fd3[_0x8aef('0x79')][_0x5ede97][_0x8aef('0x7d')],_0x292fd3[_0x8aef('0x79')][_0x5ede97][_0x8aef('0x7a')],_0x292fd3[_0x8aef('0x79')][_0x5ede97][_0x8aef('0x7b')]));}}}if(_0x292fd3[_0x8aef('0x7e')]){_0x292fd3[_0x8aef('0x7e')]=JSON[_0x8aef('0x7f')](_0x292fd3[_0x8aef('0x7e')]);_0x1c32d0[_0x8aef('0x3c')](_0x506726(_0x292fd3['conditions'][_0x8aef('0x64')]));}_0x2d0bbc=_0x1c32d0[_0x8aef('0x80')]();_0x1c32d0[_0x8aef('0x1d')](_0x5d811b);_0x1c32d0[_0x8aef('0x39')](0x0);return;}})[_0x8aef('0x23')](function(){if(_0x18cb7b['output']===_0x8aef('0x8d')){return null;}var _0x4ac47d=_['merge'](_0x18cb7b,{'name':_0x18cb7b[_0x8aef('0x8e')]||_0x18cb7b[_0x8aef('0x28')]||_0x292fd3[_0x8aef('0x28')],'basename':_0x1c0dc0,'savename':util[_0x8aef('0x74')]('%s-%s.%s',_0x18cb7b['name']||_0x292fd3[_0x8aef('0x28')],require(_0x8aef('0x8f'))[_0x8aef('0x90')](0x4),_0x18cb7b[_0x8aef('0x91')]||_0x8aef('0x92')),'reportId':_0x292fd3['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x8aef('0x48')](_0x4ac47d,{'raw':!![]});})[_0x8aef('0x23')](function(_0x4fc777){if(_0x292fd3[_0x8aef('0x6f')]===_0x8aef('0x93')){_0x2d0bbc[_0x8aef('0x3c')](_0x292fd3[_0x8aef('0x6f')]+_0x8aef('0x94'),_0x18cb7b[_0x8aef('0x95')],_0x18cb7b['endDate']);}else{_0x2d0bbc[_0x8aef('0x3c')](_0x292fd3[_0x8aef('0x6f')]+_0x8aef('0x96'),_0x18cb7b['startDate'],_0x18cb7b['endDate']);}if(_0x4fc777){logger[_0x8aef('0x97')](_0x8aef('0x98'),_0x2d0bbc[_0x8aef('0x83')]());require(_0x8aef('0x99'))[_0x8aef('0x9a')](path[_0x8aef('0x51')](__dirname,_0x8aef('0x9b'),_0x4fc777[_0x8aef('0x91')]),[_0x4fc777['id'],_0x2d0bbc[_0x8aef('0x83')](),path[_0x8aef('0x51')](__dirname,_0x8aef('0x9c'),_0x4fc777[_0x8aef('0x9d')]),_0x1c0dc0]);return _0x4fc777;}else{var _0x9a020e=squel[_0x8aef('0x6d')]();_0x9a020e['from']('('+_0x2d0bbc[_0x8aef('0x83')]()+')',_0x8aef('0x9e'));_0x9a020e[_0x8aef('0x72')](_0x8aef('0x9f'),_0x8aef('0x1e'));_0x2d0bbc[_0x8aef('0x1d')](_0x18cb7b[_0x8aef('0x1d')]||_0x5d811b);_0x2d0bbc[_0x8aef('0x39')](_0x18cb7b[_0x8aef('0x39')]||0x0);return dbH['sequelize']['query'](_0x9a020e[_0x8aef('0x83')](),{'type':dbH[_0x8aef('0x84')]['QueryTypes'][_0x8aef('0x86')]})[_0x8aef('0x23')](function(_0x4a4af4){if(!_0x4a4af4['length']){_0x539135=0x0;}else{_0x539135=_0x4a4af4[0x0][_0x8aef('0x1e')]||0x0;}return dbH['sequelize'][_0x8aef('0x32')](_0x2d0bbc['toString'](),{'type':dbH[_0x8aef('0x84')][_0x8aef('0x85')][_0x8aef('0x86')]});})[_0x8aef('0x23')](function(_0x5bd96a){return{'rows':_0x5bd96a||[],'count':_0x539135};});}});}exports[_0x8aef('0xa0')]=function(_0x108a65,_0x3a8c3b){return runReport(_0x108a65['params'],_0x108a65['query'],_0x108a65[_0x8aef('0x46')])['then'](respondWithResult(_0x3a8c3b,null))[_0x8aef('0x43')](handleError(_0x3a8c3b,null));};exports[_0x8aef('0xa1')]=runReport;exports[_0x8aef('0x32')]=function(_0xed5028,_0x83e0bf){var _0x1c970b=0xa;var _0x141688=[_0x8aef('0x51'),_0x8aef('0xa2'),'right_join',_0x8aef('0x53')];var _0x2b8c87={'SUM':'SUM(%s)','COUNT':_0x8aef('0x54'),'COUNT DISTINCT':_0x8aef('0x55'),'MAX':_0x8aef('0x88'),'MIN':_0x8aef('0x56'),'AVG':_0x8aef('0x57'),'GROUP_CONCAT':_0x8aef('0x58'),'GROUP_CONCAT ASC':_0x8aef('0x59'),'GROUP_CONCAT DESC':_0x8aef('0x5a')};var _0x1d45bd={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8aef('0x8a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x8aef('0x5d')};var _0x2f2238=function(_0x2ffc71){return!_[_0x8aef('0x5e')](['IS\x20NULL',_0x8aef('0x5f'),_0x8aef('0x60'),_0x8aef('0x61')],_0x2ffc71);};var _0x321430=function(_0x43c3aa){if(!_0x43c3aa||!_0x43c3aa[_0x8aef('0x62')]['length']){return'';}for(var _0x127e7d='(',_0xaf86f0=0x0;_0xaf86f0<_0x43c3aa[_0x8aef('0x62')][_0x8aef('0x38')];_0xaf86f0+=0x1){_0xaf86f0>0x0&&(_0x127e7d+='\x20'+_0x43c3aa[_0x8aef('0x63')]+'\x20');_0x127e7d+=_0x43c3aa[_0x8aef('0x62')][_0xaf86f0][_0x8aef('0x64')]?_0x321430(_0x43c3aa['rules'][_0xaf86f0][_0x8aef('0x64')]):_0x43c3aa[_0x8aef('0x62')][_0xaf86f0][_0x8aef('0x72')]+'\x20'+_0x43c3aa[_0x8aef('0x62')][_0xaf86f0][_0x8aef('0x65')]+(_0x2f2238(_0x43c3aa[_0x8aef('0x62')][_0xaf86f0][_0x8aef('0x65')])?'\x20'+_0x43c3aa[_0x8aef('0x62')][_0xaf86f0][_0x8aef('0x66')]:'');}return _0x127e7d+')';};var _0x25869d={'where':{'id':_0xed5028[_0x8aef('0x44')]['id']}},_0x1da966,_0x49ca45,_0x35115b,_0x2b8859,_0x391b2a;_0x25869d=_[_0x8aef('0x3f')]({},_0x25869d,_0xed5028[_0x8aef('0x46')]);return db[_0x8aef('0x2c')]['find'](_0x25869d)[_0x8aef('0x23')](function(_0x11ae1d){if(_0x11ae1d){_0x1da966=_0x11ae1d;return _0x11ae1d[_0x8aef('0xa3')]();}return null;})['then'](function(_0x3bba50){if(_0x3bba50){if(!_0x3bba50[_0x8aef('0x38')]){throw new db['Sequelize'][(_0x8aef('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x49ca45=_0x3bba50;return db[_0x8aef('0x6a')][_0x8aef('0x6b')]({'raw':!![]});}return null;})[_0x8aef('0x23')](function(_0x27c33a){if(_0x27c33a){_0x35115b=_[_0x8aef('0x6c')](_0x27c33a,'id');var _0x1cc6b7;var _0x2aecf2=squel[_0x8aef('0x6d')]();_0x2aecf2[_0x8aef('0x6e')](_0x1da966['table']);for(var _0x580dff=0x0;_0x580dff<_0x49ca45['length'];_0x580dff+=0x1){_0x1cc6b7=_0x49ca45[_0x580dff]['MetricId']?_0x35115b[_0x49ca45[_0x580dff][_0x8aef('0x70')]][_0x8aef('0x71')]:_0x49ca45[_0x580dff]['field'];_0x1cc6b7=_0x49ca45[_0x580dff]['function']?_[_0x8aef('0x73')](_0x2b8c87[_0x49ca45[_0x580dff][_0x8aef('0x8c')]],'%s',_0x1cc6b7):_0x1cc6b7;_0x1cc6b7=_0x49ca45[_0x580dff][_0x8aef('0x74')]?_['replace'](_0x1d45bd[_0x49ca45[_0x580dff][_0x8aef('0x74')]],'%s',_0x1cc6b7):_0x1cc6b7;if(_0x49ca45[_0x580dff][_0x8aef('0x75')]){_0x2aecf2[_0x8aef('0x64')](_0x1cc6b7);}_0x49ca45[_0x580dff]['orderBy']&&_0x2aecf2[_0x8aef('0x3a')](_0x1cc6b7,_0x49ca45[_0x580dff][_0x8aef('0x76')]===_0x8aef('0x77')?![]:!![]);_0x2aecf2[_0x8aef('0x72')](_0x1cc6b7,_0x49ca45[_0x580dff][_0x8aef('0x78')]||_0x1cc6b7);}if(_0x1da966[_0x8aef('0x79')]){_0x1da966[_0x8aef('0x79')]=JSON[_0x8aef('0x7f')](_0x1da966['joins']);for(var _0x1d25c2=0x0;_0x1d25c2<_0x1da966['joins'][_0x8aef('0x38')];_0x1d25c2+=0x1){if(_0x1da966['joins'][_0x1d25c2][_0x8aef('0x2f')]&&_[_0x8aef('0x5e')](_0x141688,_0x1da966[_0x8aef('0x79')][_0x1d25c2][_0x8aef('0x2f')])&&_0x1da966[_0x8aef('0x79')][_0x1d25c2][_0x8aef('0x7d')]&&_0x1da966[_0x8aef('0x79')][_0x1d25c2][_0x8aef('0x7a')]&&_0x1da966[_0x8aef('0x79')][_0x1d25c2][_0x8aef('0x7b')]){_0x2aecf2[_0x1da966[_0x8aef('0x79')][_0x1d25c2]['type']](_0x1da966[_0x8aef('0x79')][_0x1d25c2]['foreignTable'],null,util['format'](_0x8aef('0x7c'),_0x1da966[_0x8aef('0x6f')],_0x1da966[_0x8aef('0x79')][_0x1d25c2][_0x8aef('0x7d')],_0x1da966[_0x8aef('0x79')][_0x1d25c2][_0x8aef('0x7a')],_0x1da966[_0x8aef('0x79')][_0x1d25c2][_0x8aef('0x7b')]));}}}if(_0x1da966[_0x8aef('0x7e')]){_0x1da966[_0x8aef('0x7e')]=JSON['parse'](_0x1da966['conditions']);_0x2aecf2[_0x8aef('0x3c')](_0x321430(_0x1da966[_0x8aef('0x7e')][_0x8aef('0x64')]));}_0x391b2a=_0x2aecf2[_0x8aef('0x80')]();_0x2aecf2[_0x8aef('0x1d')](_0x1c970b);_0x2aecf2[_0x8aef('0x39')](0x0);logger[_0x8aef('0x81')](_0x8aef('0x82'),_0x2aecf2[_0x8aef('0x83')]());return dbH[_0x8aef('0x84')]['query'](_0x2aecf2[_0x8aef('0x83')](),{'type':dbH['sequelize'][_0x8aef('0x85')]['SELECT']});}})[_0x8aef('0x23')](function(){return{'sql':_0x391b2a[_0x8aef('0x83')]()};})[_0x8aef('0x23')](respondWithResult(_0x83e0bf,null))[_0x8aef('0x43')](handleError(_0x83e0bf,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 5ea529e..aad9831 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 _0xbf6f=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment'];(function(_0x3016ed,_0x4f12d5){var _0x2c146f=function(_0x5f02e5){while(--_0x5f02e5){_0x3016ed['push'](_0x3016ed['shift']());}};_0x2c146f(++_0x4f12d5);}(_0xbf6f,0x15c));var _0xfbf6=function(_0x56a758,_0x381a41){_0x56a758=_0x56a758-0x0;var _0x4252ef=_0xbf6f[_0x56a758];return _0x4252ef;};'use strict';var _=require(_0xfbf6('0x0'));var util=require('util');var logger=require(_0xfbf6('0x1'))('api');var moment=require(_0xfbf6('0x2'));var BPromise=require(_0xfbf6('0x3'));var rp=require(_0xfbf6('0x4'));var fs=require('fs');var path=require(_0xfbf6('0x5'));var rimraf=require(_0xfbf6('0x6'));var config=require(_0xfbf6('0x7'));var attributes=require(_0xfbf6('0x8'));module[_0xfbf6('0x9')]=function(_0x20485f,_0x2973b2){return _0x20485f[_0xfbf6('0xa')](_0xfbf6('0xb'),attributes,{'tableName':_0xfbf6('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb12e=['define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0xb12e,0x8f));var _0xeb12=function(_0x1091c9,_0x4a08e4){_0x1091c9=_0x1091c9-0x0;var _0x2912ef=_0xb12e[_0x1091c9];return _0x2912ef;};'use strict';var _=require(_0xeb12('0x0'));var util=require(_0xeb12('0x1'));var logger=require(_0xeb12('0x2'))('api');var moment=require(_0xeb12('0x3'));var BPromise=require(_0xeb12('0x4'));var rp=require(_0xeb12('0x5'));var fs=require('fs');var path=require(_0xeb12('0x6'));var rimraf=require(_0xeb12('0x7'));var config=require(_0xeb12('0x8'));var attributes=require(_0xeb12('0x9'));module[_0xeb12('0xa')]=function(_0x34aab0,_0x1c49ff){return _0x34aab0[_0xeb12('0xb')](_0xeb12('0xc'),attributes,{'tableName':_0xeb12('0xd'),'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 9a0f43d..7ec85ba 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 _0xbdd8=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd9921a,_0x271e08){var _0x2ef96b=function(_0x466e84){while(--_0x466e84){_0xd9921a['push'](_0xd9921a['shift']());}};_0x2ef96b(++_0x271e08);}(_0xbdd8,0xab));var _0x8bdd=function(_0x5e152a,_0x3ecde7){_0x5e152a=_0x5e152a-0x0;var _0x387327=_0xbdd8[_0x5e152a];return _0x387327;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8bdd('0x0'));var BPromise=require(_0x8bdd('0x1'));var rs=require(_0x8bdd('0x2'));var fs=require('fs');var Redis=require(_0x8bdd('0x3'));var db=require(_0x8bdd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8bdd('0x5'))('rpc');var config=require(_0x8bdd('0x6'));var jayson=require(_0x8bdd('0x7'));var client=jayson[_0x8bdd('0x8')][_0x8bdd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57a5dd,_0xe8d442,_0x4f1b83){return new BPromise(function(_0x1e0660,_0x219883){return client[_0x8bdd('0xa')](_0x57a5dd,_0x4f1b83)[_0x8bdd('0xb')](function(_0x573a22){logger[_0x8bdd('0xc')](_0x8bdd('0xd'),_0xe8d442,_0x8bdd('0xe'));logger['debug'](_0x8bdd('0xf'),_0xe8d442,_0x8bdd('0xe'),JSON[_0x8bdd('0x10')](_0x573a22));if(_0x573a22[_0x8bdd('0x11')]){if(_0x573a22['error'][_0x8bdd('0x12')]===0x1f4){logger['error'](_0x8bdd('0xd'),_0xe8d442,_0x573a22[_0x8bdd('0x11')]['message']);return _0x219883(_0x573a22['error'][_0x8bdd('0x13')]);}logger[_0x8bdd('0x11')](_0x8bdd('0xd'),_0xe8d442,_0x573a22[_0x8bdd('0x11')][_0x8bdd('0x13')]);return _0x1e0660(_0x573a22[_0x8bdd('0x11')][_0x8bdd('0x13')]);}else{logger[_0x8bdd('0xc')](_0x8bdd('0xd'),_0xe8d442,_0x8bdd('0xe'));_0x1e0660(_0x573a22[_0x8bdd('0x14')][_0x8bdd('0x13')]);}})[_0x8bdd('0x15')](function(_0x1fc7e5){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xe8d442,_0x1fc7e5);_0x219883(_0x1fc7e5);});});}
\ No newline at end of file
+var _0xdb60=['request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../config/utils','rpc','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0xdb60,0x112));var _0x0db6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdb60[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0db6('0x0'));var util=require('util');var moment=require(_0x0db6('0x1'));var BPromise=require(_0x0db6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0db6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0db6('0x4'));var logger=require('../../config/logger')(_0x0db6('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0db6('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5efb4d,_0x38cb9d,_0xb002f9){return new BPromise(function(_0x1cb1a2,_0x564115){return client[_0x0db6('0x7')](_0x5efb4d,_0xb002f9)[_0x0db6('0x8')](function(_0x5ad0f0){logger[_0x0db6('0x9')](_0x0db6('0xa'),_0x38cb9d,_0x0db6('0xb'));logger[_0x0db6('0xc')](_0x0db6('0xd'),_0x38cb9d,_0x0db6('0xb'),JSON[_0x0db6('0xe')](_0x5ad0f0));if(_0x5ad0f0['error']){if(_0x5ad0f0[_0x0db6('0xf')][_0x0db6('0x10')]===0x1f4){logger[_0x0db6('0xf')](_0x0db6('0xa'),_0x38cb9d,_0x5ad0f0[_0x0db6('0xf')][_0x0db6('0x11')]);return _0x564115(_0x5ad0f0[_0x0db6('0xf')]['message']);}logger[_0x0db6('0xf')](_0x0db6('0xa'),_0x38cb9d,_0x5ad0f0[_0x0db6('0xf')][_0x0db6('0x11')]);return _0x1cb1a2(_0x5ad0f0[_0x0db6('0xf')][_0x0db6('0x11')]);}else{logger[_0x0db6('0x9')](_0x0db6('0xa'),_0x38cb9d,_0x0db6('0xb'));_0x1cb1a2(_0x5ad0f0[_0x0db6('0x12')][_0x0db6('0x11')]);}})['catch'](function(_0x30bab1){logger[_0x0db6('0xf')](_0x0db6('0xa'),_0x38cb9d,_0x30bab1);_0x564115(_0x30bab1);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 006d41d..e52acb2 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 _0x1444=['update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id/preview','preview','run','/:id/query','query','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1444,0x180));var _0x4144=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x1444[_0x20589d];return _0x422de9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4144('0x0'));var timeout=require(_0x4144('0x1'));var express=require(_0x4144('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4144('0x3'));var interaction=require(_0x4144('0x4'));var config=require(_0x4144('0x5'));var controller=require(_0x4144('0x6'));router[_0x4144('0x7')]('/',auth[_0x4144('0x8')](),controller[_0x4144('0x9')]);router[_0x4144('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x4144('0xa'),auth[_0x4144('0x8')](),controller[_0x4144('0xb')]);router[_0x4144('0x7')]('/:id/run',auth['isAuthenticated'](),controller[_0x4144('0xc')]);router[_0x4144('0x7')](_0x4144('0xd'),auth[_0x4144('0x8')](),controller[_0x4144('0xe')]);router['post']('/',auth[_0x4144('0x8')](),controller['create']);router['put'](_0x4144('0xf'),auth['isAuthenticated'](),controller[_0x4144('0x10')]);router[_0x4144('0x11')]('/:id',auth[_0x4144('0x8')](),controller[_0x4144('0x12')]);module[_0x4144('0x13')]=router;
\ No newline at end of file
+var _0xfd7f=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','preview','run','/:id/query','query','post','create','update','destroy'];(function(_0x36ba7f,_0x9a5b1c){var _0x479c13=function(_0x4ce87b){while(--_0x4ce87b){_0x36ba7f['push'](_0x36ba7f['shift']());}};_0x479c13(++_0x9a5b1c);}(_0xfd7f,0x11e));var _0xffd7=function(_0x35c5be,_0x1ce11d){_0x35c5be=_0x35c5be-0x0;var _0x362b23=_0xfd7f[_0x35c5be];return _0x362b23;};'use strict';var multer=require(_0xffd7('0x0'));var util=require(_0xffd7('0x1'));var path=require(_0xffd7('0x2'));var timeout=require(_0xffd7('0x3'));var express=require('express');var router=express[_0xffd7('0x4')]();var fs_extra=require(_0xffd7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xffd7('0x6'));var config=require(_0xffd7('0x7'));var controller=require(_0xffd7('0x8'));router[_0xffd7('0x9')]('/',auth[_0xffd7('0xa')](),controller[_0xffd7('0xb')]);router['get'](_0xffd7('0xc'),auth[_0xffd7('0xa')](),controller[_0xffd7('0xd')]);router[_0xffd7('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0xffd7('0xe')]);router[_0xffd7('0x9')]('/:id/run',auth[_0xffd7('0xa')](),controller[_0xffd7('0xf')]);router[_0xffd7('0x9')](_0xffd7('0x10'),auth['isAuthenticated'](),controller[_0xffd7('0x11')]);router[_0xffd7('0x12')]('/',auth[_0xffd7('0xa')](),controller[_0xffd7('0x13')]);router['put'](_0xffd7('0xc'),auth[_0xffd7('0xa')](),controller[_0xffd7('0x14')]);router['delete'](_0xffd7('0xc'),auth[_0xffd7('0xa')](),controller[_0xffd7('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 9e9f942..0f31496 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x1f6fda,_0x41513a){var _0x4c0adc=function(_0x31ba03){while(--_0x31ba03){_0x1f6fda['push'](_0x1f6fda['shift']());}};_0x4c0adc(++_0x41513a);}(_0x98a8,0x12c));var _0x898a=function(_0x359ad2,_0x19aa5d){_0x359ad2=_0x359ad2-0x0;var _0x111b54=_0x98a8[_0x359ad2];return _0x111b54;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xbd51=['sequelize','STRING'];(function(_0x40015a,_0x415db5){var _0x42f8a4=function(_0x5685ad){while(--_0x5685ad){_0x40015a['push'](_0x40015a['shift']());}};_0x42f8a4(++_0x415db5);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x270767,_0x527a04){_0x270767=_0x270767-0x0;var _0x3d05a2=_0xbd51[_0x270767];return _0x3d05a2;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index db7f0a8..24f5639 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 _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(_0x10d023,_0x6ad4ad){var _0x31371b=function(_0x210693){while(--_0x210693){_0x10d023['push'](_0x10d023['shift']());}};_0x31371b(++_0x6ad4ad);}(_0x31f0,0xb7));var _0x031f=function(_0x2a9ef6,_0x525920){_0x2a9ef6=_0x2a9ef6-0x0;var _0x557e08=_0x31f0[_0x2a9ef6];return _0x557e08;};'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
+var _0x326f=['order','orderBy','DESC','joins','foreignTable','foreignKey','parentKey','conditions','Limited\x20Query:','toString','sequelize','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','operator','AnalyticMetric','select','from','function','parse','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','join','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','SEC_TO_TIME(%s)','debug','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','apply','update','then','get','DefaultReports','UserProfileResource','destroy','end','error','name','send','index','map','AnalyticDefaultReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','right_join','cross_join','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','table','MetricId','metric','format','replace','groupBy'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x326f,0xd1));var _0xf326=function(_0xbb17fb,_0x1ea0bf){_0xbb17fb=_0xbb17fb-0x0;var _0x42ce6e=_0x326f[_0xbb17fb];return _0x42ce6e;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf326('0x17'))[_0xf326('0x18')];function respondWithStatusCode(_0x4b3966,_0x342fe5){_0x342fe5=_0x342fe5||0xcc;return function(_0x472632){if(_0x472632){return _0x4b3966[_0xf326('0x19')](_0x342fe5);}return _0x4b3966[_0xf326('0x1a')](_0x342fe5)['end']();};}function respondWithResult(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xc8;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1a')](_0x5204ee)[_0xf326('0x1b')](_0x54bd1a);}};}function respondWithFilteredResult(_0x1f2e5a,_0xa63d1a){return function(_0x292f4b){if(_0x292f4b){var _0x287a2a=typeof _0xa63d1a[_0xf326('0x1c')]===_0xf326('0x1d')&&typeof _0xa63d1a['limit']===_0xf326('0x1d');var _0x453100=_0x292f4b[_0xf326('0x1e')];var _0x31ffb9=_0x287a2a?0x0:_0xa63d1a[_0xf326('0x1c')];var _0x311af0=_0x287a2a?_0x292f4b['count']:_0xa63d1a['offset']+_0xa63d1a['limit'];var _0x16e605;if(_0x311af0>=_0x453100){_0x311af0=_0x453100;_0x16e605=0xc8;}else{_0x16e605=0xce;}_0x1f2e5a[_0xf326('0x1a')](_0x16e605);return _0x1f2e5a['set']('Content-Range',_0x31ffb9+'-'+_0x311af0+'/'+_0x453100)[_0xf326('0x1b')](_0x292f4b);}return null;};}function patchUpdates(_0x4dfa76){return function(_0x5b6d3c){try{jsonpatch[_0xf326('0x1f')](_0x5b6d3c,_0x4dfa76,!![]);}catch(_0x18ead3){return BPromise['reject'](_0x18ead3);}return _0x5b6d3c['save']();};}function saveUpdates(_0x19b8ba,_0xb1efcf){return function(_0x5f21a2){if(_0x5f21a2){return _0x5f21a2[_0xf326('0x20')](_0x19b8ba)[_0xf326('0x21')](function(_0x43c53e){return _0x43c53e;});}return null;};}function removeEntity(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['destroy']()['then'](function(){var _0x4f31f6=_0x2049ec[_0xf326('0x22')]({'plain':!![]});var _0x1a2c4e=_0xf326('0x23');return db[_0xf326('0x24')][_0xf326('0x25')]({'where':{'type':_0x1a2c4e,'resourceId':_0x4f31f6['id']}})[_0xf326('0x21')](function(){return _0x2049ec;});})['then'](function(){_0x295752[_0xf326('0x1a')](0xcc)[_0xf326('0x26')]();});}};}function handleEntityNotFound(_0x212d5d,_0x581531){return function(_0x1617d2){if(!_0x1617d2){_0x212d5d['sendStatus'](0x194);}return _0x1617d2;};}function handleError(_0x4a9abf,_0x6a8e89){_0x6a8e89=_0x6a8e89||0x1f4;return function(_0x1ae23a){logger[_0xf326('0x27')](_0x1ae23a['stack']);if(_0x1ae23a[_0xf326('0x28')]){delete _0x1ae23a[_0xf326('0x28')];}_0x4a9abf['status'](_0x6a8e89)[_0xf326('0x29')](_0x1ae23a);};}exports[_0xf326('0x2a')]=function(_0xd77aba,_0x18d110){var _0xa80156={},_0x269be9={},_0x161143={'count':0x0,'rows':[]};var _0x39a1e2=_[_0xf326('0x2b')](db[_0xf326('0x2c')]['rawAttributes'],function(_0x1035ed){return{'name':_0x1035ed[_0xf326('0x2d')],'type':_0x1035ed[_0xf326('0x2e')]['key']};});_0x269be9[_0xf326('0x2f')]=_[_0xf326('0x2b')](_0x39a1e2,_0xf326('0x28'));_0x269be9['query']=_['keys'](_0xd77aba[_0xf326('0x30')]);_0x269be9[_0xf326('0x31')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],_0x269be9[_0xf326('0x30')]);_0xa80156[_0xf326('0x33')]=_[_0xf326('0x32')](_0x269be9[_0xf326('0x2f')],qs['fields'](_0xd77aba[_0xf326('0x30')][_0xf326('0x34')]));_0xa80156['attributes']=_0xa80156[_0xf326('0x33')]['length']?_0xa80156[_0xf326('0x33')]:_0x269be9['model'];if(!_0xd77aba['query'][_0xf326('0x35')]('nolimit')){_0xa80156[_0xf326('0x36')]=qs['limit'](_0xd77aba[_0xf326('0x30')][_0xf326('0x36')]);_0xa80156[_0xf326('0x1c')]=qs['offset'](_0xd77aba[_0xf326('0x30')][_0xf326('0x1c')]);}_0xa80156['order']=qs[_0xf326('0x37')](_0xd77aba[_0xf326('0x30')][_0xf326('0x37')]);_0xa80156[_0xf326('0x38')]=qs['filters'](_[_0xf326('0x39')](_0xd77aba[_0xf326('0x30')],_0x269be9[_0xf326('0x31')]),_0x39a1e2);if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3a')]){_0xa80156['where']=_[_0xf326('0x3b')](_0xa80156[_0xf326('0x38')],{'$or':_['map'](_0x39a1e2,function(_0x4dd361){if(_0x4dd361[_0xf326('0x2e')]!=='VIRTUAL'){var _0x55dfa8={};_0x55dfa8[_0x4dd361[_0xf326('0x28')]]={'$like':'%'+_0xd77aba['query'][_0xf326('0x3a')]+'%'};return _0x55dfa8;}})});}_0xa80156=_[_0xf326('0x3b')]({},_0xa80156,_0xd77aba[_0xf326('0x3c')]);var _0x39611e={'where':_0xa80156['where']};return db[_0xf326('0x2c')][_0xf326('0x1e')](_0x39611e)[_0xf326('0x21')](function(_0x365627){_0x161143[_0xf326('0x1e')]=_0x365627;if(_0xd77aba[_0xf326('0x30')][_0xf326('0x3d')]){_0xa80156[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x2c')][_0xf326('0x3f')](_0xa80156);})[_0xf326('0x21')](function(_0x2bab13){_0x161143['rows']=_0x2bab13;return _0x161143;})[_0xf326('0x21')](respondWithFilteredResult(_0x18d110,_0xa80156))[_0xf326('0x40')](handleError(_0x18d110,null));};exports[_0xf326('0x41')]=function(_0x270288,_0x1dd262){var _0x1a2d0d={'raw':!![],'where':{'id':_0x270288[_0xf326('0x42')]['id']}},_0x4f4c51={};_0x4f4c51[_0xf326('0x2f')]=_['keys'](db[_0xf326('0x2c')][_0xf326('0x43')]);_0x4f4c51[_0xf326('0x30')]=_[_0xf326('0x44')](_0x270288[_0xf326('0x30')]);_0x4f4c51['filters']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],_0x4f4c51[_0xf326('0x30')]);_0x1a2d0d['attributes']=_['intersection'](_0x4f4c51[_0xf326('0x2f')],qs[_0xf326('0x34')](_0x270288[_0xf326('0x30')]['fields']));_0x1a2d0d[_0xf326('0x33')]=_0x1a2d0d[_0xf326('0x33')][_0xf326('0x45')]?_0x1a2d0d[_0xf326('0x33')]:_0x4f4c51[_0xf326('0x2f')];if(_0x270288[_0xf326('0x30')][_0xf326('0x3d')]){_0x1a2d0d[_0xf326('0x3e')]=[{'all':!![]}];}_0x1a2d0d=_[_0xf326('0x3b')]({},_0x1a2d0d,_0x270288[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x1a2d0d)[_0xf326('0x21')](handleEntityNotFound(_0x1dd262,null))[_0xf326('0x21')](respondWithResult(_0x1dd262,null))[_0xf326('0x40')](handleError(_0x1dd262,null));};exports['create']=function(_0x199f8b,_0x1b0e03){return db[_0xf326('0x2c')][_0xf326('0x47')](_0x199f8b['body'],{})[_0xf326('0x21')](function(_0x2f5511){var _0xca88e=_0x199f8b[_0xf326('0x48')]['get']({'plain':!![]});if(!_0xca88e)throw new Error(_0xf326('0x49'));if(_0xca88e[_0xf326('0x4a')]===_0xf326('0x48')){var _0x451ac7=_0x2f5511[_0xf326('0x22')]({'plain':!![]});var _0x4970fb='Reports';return db[_0xf326('0x4b')][_0xf326('0x46')]({'where':{'name':_0x4970fb,'userProfileId':_0xca88e[_0xf326('0x4c')]},'raw':!![]})['then'](function(_0x102fba){if(_0x102fba&&_0x102fba[_0xf326('0x4d')]===0x0){return db[_0xf326('0x24')]['create']({'name':_0x451ac7['name'],'resourceId':_0x451ac7['id'],'type':_0xf326('0x23'),'sectionId':_0x102fba['id']},{})['then'](function(){return _0x2f5511;});}else{return _0x2f5511;}})[_0xf326('0x40')](function(_0x554277){logger[_0xf326('0x27')](_0xf326('0x4e'),_0x554277);throw _0x554277;});}return _0x2f5511;})[_0xf326('0x21')](respondWithResult(_0x1b0e03,0xc9))[_0xf326('0x40')](handleError(_0x1b0e03,null));};exports[_0xf326('0x20')]=function(_0x35d3c8,_0x7f7ece){if(_0x35d3c8['body']['id']){delete _0x35d3c8[_0xf326('0x4f')]['id'];}return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x35d3c8['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x7f7ece,null))[_0xf326('0x21')](saveUpdates(_0x35d3c8[_0xf326('0x4f')],null))[_0xf326('0x21')](respondWithResult(_0x7f7ece,null))[_0xf326('0x40')](handleError(_0x7f7ece,null));};exports['destroy']=function(_0x161fb3,_0x21eac7){return db[_0xf326('0x2c')][_0xf326('0x46')]({'where':{'id':_0x161fb3['params']['id']}})[_0xf326('0x21')](handleEntityNotFound(_0x21eac7,null))[_0xf326('0x21')](removeEntity(_0x21eac7,null))[_0xf326('0x40')](handleError(_0x21eac7,null));};exports[_0xf326('0x50')]=function(_0x4d3b9e,_0x5be2b1){var _0x18b46e=0xa;var _0x44d2ed=['join',_0xf326('0x51'),_0xf326('0x52'),_0xf326('0x53')];var _0x1258d1={'SUM':'SUM(%s)','COUNT':_0xf326('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':_0xf326('0x58')};var _0x4eef49={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':_0xf326('0x5a'),'ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2759d7=function(_0x487020){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x487020);};var _0x18dbfc=function(_0x23a9e8){if(!_0x23a9e8||!_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x33f9dd='(',_0x33ffb8=0x0;_0x33ffb8<_0x23a9e8[_0xf326('0x61')][_0xf326('0x45')];_0x33ffb8+=0x1){_0x33ffb8>0x0&&(_0x33f9dd+='\x20'+_0x23a9e8['operator']+'\x20');_0x33f9dd+=_0x23a9e8[_0xf326('0x61')][_0x33ffb8]['group']?_0x18dbfc(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x62')]):_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x63')]+'\x20'+_0x23a9e8['rules'][_0x33ffb8][_0xf326('0x64')]+(_0x2759d7(_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x64')])?'\x20'+_0x23a9e8[_0xf326('0x61')][_0x33ffb8][_0xf326('0x65')]:'');}return _0x33f9dd+')';};var _0x51ff5e={'where':{'id':_0x4d3b9e[_0xf326('0x42')]['id']}},_0x4ec099,_0x1209ca,_0x32fe3a,_0x15a538,_0x21b3cc;_0x51ff5e=_['merge']({},_0x51ff5e,_0x4d3b9e[_0xf326('0x3c')]);return db[_0xf326('0x2c')]['find'](_0x51ff5e)['then'](function(_0x5b25ca){if(_0x5b25ca){_0x4ec099=_0x5b25ca;return _0x5b25ca[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4150fa){if(_0x4150fa){if(!_0x4150fa[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x1209ca=_0x4150fa;return db['AnalyticMetric'][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x3c3379){if(_0x3c3379){_0x32fe3a=_[_0xf326('0x6a')](_0x3c3379,'id');var _0x58de1e;var _0x3717fe=squel['select']();_0x3717fe['from'](_0x4ec099[_0xf326('0x6b')]);for(var _0x540fa0=0x0;_0x540fa0<_0x1209ca[_0xf326('0x45')];_0x540fa0+=0x1){_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6c')]?_0x32fe3a[_0x1209ca[_0x540fa0][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x1209ca[_0x540fa0][_0xf326('0x63')];_0x58de1e=_0x1209ca[_0x540fa0]['function']?_['replace'](_0x1258d1[_0x1209ca[_0x540fa0]['function']],'%s',_0x58de1e):_0x58de1e;_0x58de1e=_0x1209ca[_0x540fa0][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x4eef49[_0x1209ca[_0x540fa0][_0xf326('0x6e')]],'%s',_0x58de1e):_0x58de1e;if(_0x1209ca[_0x540fa0][_0xf326('0x70')]){_0x3717fe[_0xf326('0x62')](_0x58de1e);}_0x1209ca[_0x540fa0]['orderBy']&&_0x3717fe[_0xf326('0x71')](_0x58de1e,_0x1209ca[_0x540fa0][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x3717fe['field'](_0x58de1e,_0x1209ca[_0x540fa0]['alias']||_0x58de1e);}if(_0x4ec099[_0xf326('0x74')]){_0x4ec099[_0xf326('0x74')]=JSON['parse'](_0x4ec099['joins']);for(var _0x2497fd=0x0;_0x2497fd<_0x4ec099['joins'][_0xf326('0x45')];_0x2497fd+=0x1){if(_0x4ec099['joins'][_0x2497fd]['type']&&_['includes'](_0x44d2ed,_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')])&&_0x4ec099[_0xf326('0x74')][_0x2497fd]['parentKey']&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')]&&_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x76')]){_0x3717fe[_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x2e')]](_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],null,util[_0xf326('0x6e')]('%s.%s\x20=\x20%s.%s',_0x4ec099[_0xf326('0x6b')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x77')],_0x4ec099[_0xf326('0x74')][_0x2497fd][_0xf326('0x75')],_0x4ec099['joins'][_0x2497fd][_0xf326('0x76')]));}}}if(_0x4ec099[_0xf326('0x78')]){_0x4ec099[_0xf326('0x78')]=JSON['parse'](_0x4ec099[_0xf326('0x78')]);_0x3717fe[_0xf326('0x38')](_0x18dbfc(_0x4ec099[_0xf326('0x78')][_0xf326('0x62')]));}_0x21b3cc=_0x3717fe['clone']();_0x3717fe[_0xf326('0x36')](_0x18b46e);_0x3717fe['offset'](0x0);logger['debug'](_0xf326('0x79'),_0x3717fe[_0xf326('0x7a')]());return dbH['sequelize']['query'](_0x3717fe['toString'](),{'type':dbH[_0xf326('0x7b')]['QueryTypes'][_0xf326('0x7c')]});}})[_0xf326('0x21')](respondWithResult(_0x5be2b1,null))[_0xf326('0x40')](handleError(_0x5be2b1,null));};function runReport(_0x2ec314,_0xf76a89,_0x25b56c){var _0x5d23f0=_0xf76a89[_0xf326('0x28')];var _0x323926=0xa;var _0x5f1724=['join',_0xf326('0x51'),'right_join',_0xf326('0x53')];var _0x147d51={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':_0xf326('0x7f'),'MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf326('0x58')};var _0x26bbb1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x14e8c0=function(_0x5814ad){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x5814ad);};var _0x1e50aa=function(_0x148779){if(!_0x148779||!_0x148779[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x38b696='(',_0x384b46=0x0;_0x384b46<_0x148779[_0xf326('0x61')][_0xf326('0x45')];_0x384b46+=0x1){_0x384b46>0x0&&(_0x38b696+='\x20'+_0x148779[_0xf326('0x82')]+'\x20');_0x38b696+=_0x148779[_0xf326('0x61')][_0x384b46]['group']?_0x1e50aa(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x62')]):_0x148779['rules'][_0x384b46][_0xf326('0x63')]+'\x20'+_0x148779[_0xf326('0x61')][_0x384b46]['condition']+(_0x14e8c0(_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x64')])?'\x20'+_0x148779[_0xf326('0x61')][_0x384b46][_0xf326('0x65')]:'');}return _0x38b696+')';};var _0x2ab607={'where':{'id':_0x2ec314['id']}},_0x35c228,_0x1bb7cc,_0x5794d0,_0x15d61e,_0x107c00;_0x2ab607=_[_0xf326('0x3b')]({},_0x2ab607,_0x25b56c);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x2ab607)[_0xf326('0x21')](function(_0x204002){if(_0x204002){_0x35c228=_0x204002;return _0x204002[_0xf326('0x66')]();}return null;})['then'](function(_0xa8e05b){if(_0xa8e05b){if(!_0xa8e05b[_0xf326('0x45')]){throw new db['Sequelize'][(_0xf326('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bb7cc=_0xa8e05b;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x2a0f36){if(_0x2a0f36){_0x5794d0=_[_0xf326('0x6a')](_0x2a0f36,'id');var _0x3097cf;var _0xf66b70=squel[_0xf326('0x84')]();_0xf66b70[_0xf326('0x85')](_0x35c228[_0xf326('0x6b')]);for(var _0x3f073c=0x0;_0x3f073c<_0x1bb7cc[_0xf326('0x45')];_0x3f073c+=0x1){_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]?_0x5794d0[_0x1bb7cc[_0x3f073c][_0xf326('0x6c')]]['metric']:_0x1bb7cc[_0x3f073c][_0xf326('0x63')];_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x147d51[_0x1bb7cc[_0x3f073c][_0xf326('0x86')]],'%s',_0x3097cf):_0x3097cf;_0x3097cf=_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]?_['replace'](_0x26bbb1[_0x1bb7cc[_0x3f073c][_0xf326('0x6e')]],'%s',_0x3097cf):_0x3097cf;if(_0x1bb7cc[_0x3f073c][_0xf326('0x70')]){_0xf66b70[_0xf326('0x62')](_0x3097cf);}_0x1bb7cc[_0x3f073c][_0xf326('0x72')]&&_0xf66b70[_0xf326('0x71')](_0x3097cf,_0x1bb7cc[_0x3f073c]['orderBy']==='DESC'?![]:!![]);_0xf66b70[_0xf326('0x63')](_0x3097cf,_0x1bb7cc[_0x3f073c]['alias']||_0x3097cf);}if(_0x35c228[_0xf326('0x74')]){_0x35c228[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x35c228['joins']);for(var _0x54b023=0x0;_0x54b023<_0x35c228[_0xf326('0x74')][_0xf326('0x45')];_0x54b023+=0x1){if(_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]&&_[_0xf326('0x5c')](_0x5f1724,_0x35c228['joins'][_0x54b023][_0xf326('0x2e')])&&_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x77')]&&_0x35c228['joins'][_0x54b023]['foreignTable']&&_0x35c228['joins'][_0x54b023][_0xf326('0x76')]){_0xf66b70[_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x2e')]](_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x35c228['table'],_0x35c228['joins'][_0x54b023][_0xf326('0x77')],_0x35c228[_0xf326('0x74')][_0x54b023][_0xf326('0x75')],_0x35c228['joins'][_0x54b023][_0xf326('0x76')]));}}}if(_0x35c228[_0xf326('0x78')]){_0x35c228[_0xf326('0x78')]=JSON['parse'](_0x35c228[_0xf326('0x78')]);_0xf66b70[_0xf326('0x38')](_0x1e50aa(_0x35c228[_0xf326('0x78')][_0xf326('0x62')]));}_0x107c00=_0xf66b70['clone']();_0xf66b70['limit'](_0x323926);_0xf66b70['offset'](0x0);return;}})[_0xf326('0x21')](function(){if(_0xf76a89[_0xf326('0x89')]===_0xf326('0x8a')){return null;}var _0x5f0b45=_[_0xf326('0x3b')](_0xf76a89,{'name':_0xf76a89[_0xf326('0x8b')]||_0xf76a89[_0xf326('0x28')]||_0x35c228['name'],'basename':_0x5d23f0,'savename':util[_0xf326('0x6e')](_0xf326('0x8c'),_0xf76a89[_0xf326('0x28')]||_0x35c228[_0xf326('0x28')],require('randomstring')[_0xf326('0x8d')](0x4),_0xf76a89['output']||_0xf326('0x8e')),'reportId':_0x35c228['id'],'reportType':_0xf326('0x8f')});return db[_0xf326('0x90')][_0xf326('0x47')](_0x5f0b45,{'raw':!![]});})['then'](function(_0x2e2f70){if(_0x35c228['table']===_0xf326('0x91')){_0x107c00[_0xf326('0x38')](_0x35c228[_0xf326('0x6b')]+_0xf326('0x92'),_0xf76a89[_0xf326('0x93')],_0xf76a89['endDate']);}else{_0x107c00['where'](_0x35c228[_0xf326('0x6b')]+_0xf326('0x94'),_0xf76a89[_0xf326('0x93')],_0xf76a89[_0xf326('0x95')]);}if(_0x2e2f70){logger['info'](_0xf326('0x96'),_0x107c00['toString']());require(_0xf326('0x97'))[_0xf326('0x98')](path[_0xf326('0x99')](__dirname,'../../components/export/',_0x2e2f70[_0xf326('0x89')]),[_0x2e2f70['id'],_0x107c00[_0xf326('0x7a')](),path[_0xf326('0x99')](__dirname,_0xf326('0x9a'),_0x2e2f70[_0xf326('0x9b')]),_0x5d23f0]);return _0x2e2f70;}else{var _0x4dc4bc=squel[_0xf326('0x84')]();_0x4dc4bc[_0xf326('0x85')]('('+_0x107c00['toString']()+')',_0xf326('0x9c'));_0x4dc4bc[_0xf326('0x63')](_0xf326('0x9d'),_0xf326('0x1e'));_0x107c00['limit'](_0xf76a89['limit']||_0x323926);_0x107c00[_0xf326('0x1c')](_0xf76a89[_0xf326('0x1c')]||0x0);return dbH['sequelize'][_0xf326('0x30')](_0x4dc4bc['toString'](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]})[_0xf326('0x21')](function(_0x37cd6f){if(!_0x37cd6f[_0xf326('0x45')]){_0x15d61e=0x0;}else{_0x15d61e=_0x37cd6f[0x0][_0xf326('0x1e')]||0x0;}return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x107c00[_0xf326('0x7a')](),{'type':dbH['sequelize'][_0xf326('0x9e')][_0xf326('0x7c')]});})[_0xf326('0x21')](function(_0x1c7f81){return{'rows':_0x1c7f81||[],'count':_0x15d61e};});}});}exports['run']=function(_0x3e6a5d,_0x20020c){return runReport(_0x3e6a5d[_0xf326('0x42')],_0x3e6a5d[_0xf326('0x30')],_0x3e6a5d[_0xf326('0x3c')])['then'](respondWithResult(_0x20020c,null))[_0xf326('0x40')](handleError(_0x20020c,null));};exports['runReport']=runReport;exports[_0xf326('0x30')]=function(_0x14d255,_0xffd165){var _0x2bc501=0xa;var _0x4bd216=[_0xf326('0x99'),_0xf326('0x51'),_0xf326('0x52'),'cross_join'];var _0x23451e={'SUM':_0xf326('0x7d'),'COUNT':_0xf326('0x54'),'COUNT DISTINCT':_0xf326('0x7e'),'MAX':'MAX(%s)','MIN':_0xf326('0x55'),'AVG':_0xf326('0x80'),'GROUP_CONCAT':_0xf326('0x56'),'GROUP_CONCAT ASC':_0xf326('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x310223={'SEC_TO_TIME':_0xf326('0x9f'),'DATE':_0xf326('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xf326('0x5b'),'UNIX_TIMESTAMP':_0xf326('0x81')};var _0x539d23=function(_0x171c53){return!_[_0xf326('0x5c')]([_0xf326('0x5d'),_0xf326('0x5e'),_0xf326('0x5f'),_0xf326('0x60')],_0x171c53);};var _0x4c7fc0=function(_0x4ffde1){if(!_0x4ffde1||!_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')]){return'';}for(var _0x4307d9='(',_0x2fa05b=0x0;_0x2fa05b<_0x4ffde1[_0xf326('0x61')][_0xf326('0x45')];_0x2fa05b+=0x1){_0x2fa05b>0x0&&(_0x4307d9+='\x20'+_0x4ffde1['operator']+'\x20');_0x4307d9+=_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]?_0x4c7fc0(_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x62')]):_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x63')]+'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b][_0xf326('0x64')]+(_0x539d23(_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['condition'])?'\x20'+_0x4ffde1[_0xf326('0x61')][_0x2fa05b]['value']:'');}return _0x4307d9+')';};var _0x590dc0={'where':{'id':_0x14d255[_0xf326('0x42')]['id']}},_0x32fc6e,_0x549a1f,_0x1f37f9,_0x3e0918,_0x3398fd;_0x590dc0=_[_0xf326('0x3b')]({},_0x590dc0,_0x14d255[_0xf326('0x3c')]);return db[_0xf326('0x2c')][_0xf326('0x46')](_0x590dc0)[_0xf326('0x21')](function(_0x314442){if(_0x314442){_0x32fc6e=_0x314442;return _0x314442[_0xf326('0x66')]();}return null;})[_0xf326('0x21')](function(_0x4c1fcd){if(_0x4c1fcd){if(!_0x4c1fcd[_0xf326('0x45')]){throw new db[(_0xf326('0x67'))][(_0xf326('0x68'))](_0xf326('0x69'),0x193);}_0x549a1f=_0x4c1fcd;return db[_0xf326('0x83')][_0xf326('0x3f')]({'raw':!![]});}return null;})[_0xf326('0x21')](function(_0x5429a2){if(_0x5429a2){_0x1f37f9=_[_0xf326('0x6a')](_0x5429a2,'id');var _0x15f799;var _0x320ab3=squel[_0xf326('0x84')]();_0x320ab3[_0xf326('0x85')](_0x32fc6e[_0xf326('0x6b')]);for(var _0x2094bf=0x0;_0x2094bf<_0x549a1f['length'];_0x2094bf+=0x1){_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6c')]?_0x1f37f9[_0x549a1f[_0x2094bf][_0xf326('0x6c')]][_0xf326('0x6d')]:_0x549a1f[_0x2094bf][_0xf326('0x63')];_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x86')]?_[_0xf326('0x6f')](_0x23451e[_0x549a1f[_0x2094bf][_0xf326('0x86')]],'%s',_0x15f799):_0x15f799;_0x15f799=_0x549a1f[_0x2094bf][_0xf326('0x6e')]?_[_0xf326('0x6f')](_0x310223[_0x549a1f[_0x2094bf][_0xf326('0x6e')]],'%s',_0x15f799):_0x15f799;if(_0x549a1f[_0x2094bf][_0xf326('0x70')]){_0x320ab3[_0xf326('0x62')](_0x15f799);}_0x549a1f[_0x2094bf]['orderBy']&&_0x320ab3[_0xf326('0x71')](_0x15f799,_0x549a1f[_0x2094bf][_0xf326('0x72')]===_0xf326('0x73')?![]:!![]);_0x320ab3['field'](_0x15f799,_0x549a1f[_0x2094bf]['alias']||_0x15f799);}if(_0x32fc6e[_0xf326('0x74')]){_0x32fc6e[_0xf326('0x74')]=JSON[_0xf326('0x87')](_0x32fc6e[_0xf326('0x74')]);for(var _0x5384a5=0x0;_0x5384a5<_0x32fc6e[_0xf326('0x74')][_0xf326('0x45')];_0x5384a5+=0x1){if(_0x32fc6e[_0xf326('0x74')][_0x5384a5]['type']&&_['includes'](_0x4bd216,_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')])&&_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x75')]&&_0x32fc6e['joins'][_0x5384a5][_0xf326('0x76')]){_0x320ab3[_0x32fc6e['joins'][_0x5384a5][_0xf326('0x2e')]](_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],null,util[_0xf326('0x6e')](_0xf326('0x88'),_0x32fc6e[_0xf326('0x6b')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x77')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x75')],_0x32fc6e[_0xf326('0x74')][_0x5384a5][_0xf326('0x76')]));}}}if(_0x32fc6e[_0xf326('0x78')]){_0x32fc6e[_0xf326('0x78')]=JSON['parse'](_0x32fc6e[_0xf326('0x78')]);_0x320ab3[_0xf326('0x38')](_0x4c7fc0(_0x32fc6e[_0xf326('0x78')]['group']));}_0x3398fd=_0x320ab3['clone']();_0x320ab3['limit'](_0x2bc501);_0x320ab3[_0xf326('0x1c')](0x0);logger[_0xf326('0xa0')](_0xf326('0x79'),_0x320ab3[_0xf326('0x7a')]());return dbH[_0xf326('0x7b')][_0xf326('0x30')](_0x320ab3['toString'](),{'type':dbH[_0xf326('0x7b')][_0xf326('0x9e')][_0xf326('0x7c')]});}})[_0xf326('0x21')](function(){return{'sql':_0x3398fd[_0xf326('0x7a')]()};})['then'](respondWithResult(_0xffd165,null))[_0xf326('0x40')](handleError(_0xffd165,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 6e71cc9..597f075 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 _0x2897=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x5206dd,_0x100a63){var _0x3269bd=function(_0x2f2948){while(--_0x2f2948){_0x5206dd['push'](_0x5206dd['shift']());}};_0x3269bd(++_0x100a63);}(_0x2897,0x1c1));var _0x7289=function(_0x3b22d5,_0x57004e){_0x3b22d5=_0x3b22d5-0x0;var _0x4d9620=_0x2897[_0x3b22d5];return _0x4d9620;};'use strict';var _=require(_0x7289('0x0'));var util=require(_0x7289('0x1'));var logger=require(_0x7289('0x2'))(_0x7289('0x3'));var moment=require('moment');var BPromise=require(_0x7289('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7289('0x5'));var rimraf=require(_0x7289('0x6'));var config=require(_0x7289('0x7'));var attributes=require(_0x7289('0x8'));module[_0x7289('0x9')]=function(_0x102fa6,_0x5c00cb){return _0x102fa6[_0x7289('0xa')](_0x7289('0xb'),attributes,{'tableName':_0x7289('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb3e0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','util'];(function(_0x5e872b,_0x5a9f3c){var _0x1dde74=function(_0x54f2a7){while(--_0x54f2a7){_0x5e872b['push'](_0x5e872b['shift']());}};_0x1dde74(++_0x5a9f3c);}(_0xb3e0,0x1cd));var _0x0b3e=function(_0xdbbb7c,_0x19e8e2){_0xdbbb7c=_0xdbbb7c-0x0;var _0x23643f=_0xb3e0[_0xdbbb7c];return _0x23643f;};'use strict';var _=require('lodash');var util=require(_0x0b3e('0x0'));var logger=require(_0x0b3e('0x1'))(_0x0b3e('0x2'));var moment=require(_0x0b3e('0x3'));var BPromise=require(_0x0b3e('0x4'));var rp=require(_0x0b3e('0x5'));var fs=require('fs');var path=require(_0x0b3e('0x6'));var rimraf=require(_0x0b3e('0x7'));var config=require(_0x0b3e('0x8'));var attributes=require(_0x0b3e('0x9'));module[_0x0b3e('0xa')]=function(_0x33efc0,_0x4cd577){return _0x33efc0['define']('AnalyticDefaultReport',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 c204a38..cfb483c 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 _0x8234=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x9c36e9,_0x5154e6){var _0x5a393f=function(_0x5387cb){while(--_0x5387cb){_0x9c36e9['push'](_0x9c36e9['shift']());}};_0x5a393f(++_0x5154e6);}(_0x8234,0xfb));var _0x4823=function(_0x3b29b7,_0x31831e){_0x3b29b7=_0x3b29b7-0x0;var _0x2b2669=_0x8234[_0x3b29b7];return _0x2b2669;};'use strict';var _=require(_0x4823('0x0'));var util=require(_0x4823('0x1'));var moment=require(_0x4823('0x2'));var BPromise=require(_0x4823('0x3'));var rs=require(_0x4823('0x4'));var fs=require('fs');var Redis=require(_0x4823('0x5'));var db=require(_0x4823('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4823('0x7'))(_0x4823('0x8'));var config=require(_0x4823('0x9'));var jayson=require(_0x4823('0xa'));var client=jayson[_0x4823('0xb')][_0x4823('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x17c455,_0x8cdaa6,_0x1003a2){return new BPromise(function(_0x1c6180,_0x107b64){return client[_0x4823('0xd')](_0x17c455,_0x1003a2)[_0x4823('0xe')](function(_0x54d8d8){logger[_0x4823('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x8cdaa6,_0x4823('0x10'));logger['debug'](_0x4823('0x11'),_0x8cdaa6,_0x4823('0x10'),JSON['stringify'](_0x54d8d8));if(_0x54d8d8[_0x4823('0x12')]){if(_0x54d8d8[_0x4823('0x12')]['code']===0x1f4){logger[_0x4823('0x12')](_0x4823('0x13'),_0x8cdaa6,_0x54d8d8[_0x4823('0x12')][_0x4823('0x14')]);return _0x107b64(_0x54d8d8['error']['message']);}logger[_0x4823('0x12')](_0x4823('0x13'),_0x8cdaa6,_0x54d8d8[_0x4823('0x12')][_0x4823('0x14')]);return _0x1c6180(_0x54d8d8[_0x4823('0x12')][_0x4823('0x14')]);}else{logger[_0x4823('0xf')](_0x4823('0x13'),_0x8cdaa6,_0x4823('0x10'));_0x1c6180(_0x54d8d8[_0x4823('0x15')][_0x4823('0x14')]);}})[_0x4823('0x16')](function(_0x59335a){logger[_0x4823('0x12')](_0x4823('0x13'),_0x8cdaa6,_0x59335a);_0x107b64(_0x59335a);});});}
\ No newline at end of file
+var _0x7aae=['stringify','error','code','message','result','catch','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x4ce663,_0x28f1d7){var _0x318ff3=function(_0x182985){while(--_0x182985){_0x4ce663['push'](_0x4ce663['shift']());}};_0x318ff3(++_0x28f1d7);}(_0x7aae,0x10e));var _0xe7aa=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7aae[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe7aa('0x0'));var rs=require(_0xe7aa('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7aa('0x2'))['db'];var utils=require(_0xe7aa('0x3'));var logger=require(_0xe7aa('0x4'))(_0xe7aa('0x5'));var config=require('../../config/environment');var jayson=require(_0xe7aa('0x6'));var client=jayson[_0xe7aa('0x7')][_0xe7aa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51826f,_0x365217,_0x7cb45c){return new BPromise(function(_0x353f91,_0x1b8c20){return client[_0xe7aa('0x9')](_0x51826f,_0x7cb45c)[_0xe7aa('0xa')](function(_0x49d056){logger[_0xe7aa('0xb')](_0xe7aa('0xc'),_0x365217,_0xe7aa('0xd'));logger[_0xe7aa('0xe')](_0xe7aa('0xf'),_0x365217,'request\x20sent',JSON[_0xe7aa('0x10')](_0x49d056));if(_0x49d056[_0xe7aa('0x11')]){if(_0x49d056[_0xe7aa('0x11')][_0xe7aa('0x12')]===0x1f4){logger[_0xe7aa('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x365217,_0x49d056[_0xe7aa('0x11')][_0xe7aa('0x13')]);return _0x1b8c20(_0x49d056['error']['message']);}logger['error'](_0xe7aa('0xc'),_0x365217,_0x49d056[_0xe7aa('0x11')][_0xe7aa('0x13')]);return _0x353f91(_0x49d056[_0xe7aa('0x11')]['message']);}else{logger[_0xe7aa('0xb')](_0xe7aa('0xc'),_0x365217,'request\x20sent');_0x353f91(_0x49d056[_0xe7aa('0x14')][_0xe7aa('0x13')]);}})[_0xe7aa('0x15')](function(_0x5185b8){logger[_0xe7aa('0x11')](_0xe7aa('0xc'),_0x365217,_0x5185b8);_0x1b8c20(_0x5185b8);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 57e74f8..b27d67a 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 _0x4ac9=['show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','delete','/:id','destroy','util','express','Router','fs-extra','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x2aeb8f,_0x127e59){var _0x2c255e=function(_0x55bc2b){while(--_0x55bc2b){_0x2aeb8f['push'](_0x2aeb8f['shift']());}};_0x2c255e(++_0x127e59);}(_0x4ac9,0xe9));var _0x94ac=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x4ac9[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require(_0x94ac('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x94ac('0x1'));var router=express[_0x94ac('0x2')]();var fs_extra=require(_0x94ac('0x3'));var auth=require(_0x94ac('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x94ac('0x5'));router[_0x94ac('0x6')]('/',auth[_0x94ac('0x7')](),controller[_0x94ac('0x8')]);router[_0x94ac('0x6')]('/:id',auth[_0x94ac('0x7')](),controller[_0x94ac('0x9')]);router['get'](_0x94ac('0xa'),auth[_0x94ac('0x7')](),controller[_0x94ac('0xb')]);router[_0x94ac('0x6')](_0x94ac('0xc'),auth[_0x94ac('0x7')](),controller[_0x94ac('0xd')]);router[_0x94ac('0x6')](_0x94ac('0xe'),auth[_0x94ac('0x7')](),controller[_0x94ac('0xf')]);router['post']('/',auth[_0x94ac('0x7')](),controller[_0x94ac('0x10')]);router[_0x94ac('0x11')]('/:id',auth[_0x94ac('0x7')](),controller[_0x94ac('0x12')]);router[_0x94ac('0x13')](_0x94ac('0x14'),auth[_0x94ac('0x7')](),controller[_0x94ac('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x260e=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','update','delete','exports','multer'];(function(_0x478b69,_0x400e32){var _0x4fee60=function(_0x211b5e){while(--_0x211b5e){_0x478b69['push'](_0x478b69['shift']());}};_0x4fee60(++_0x400e32);}(_0x260e,0x1b9));var _0xe260=function(_0x14bba8,_0x586dde){_0x14bba8=_0x14bba8-0x0;var _0x5b9370=_0x260e[_0x14bba8];return _0x5b9370;};'use strict';var multer=require(_0xe260('0x0'));var util=require(_0xe260('0x1'));var path=require(_0xe260('0x2'));var timeout=require(_0xe260('0x3'));var express=require(_0xe260('0x4'));var router=express[_0xe260('0x5')]();var fs_extra=require(_0xe260('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe260('0x7'));var config=require(_0xe260('0x8'));var controller=require(_0xe260('0x9'));router[_0xe260('0xa')]('/',auth[_0xe260('0xb')](),controller[_0xe260('0xc')]);router[_0xe260('0xa')](_0xe260('0xd'),auth['isAuthenticated'](),controller[_0xe260('0xe')]);router[_0xe260('0xa')](_0xe260('0xf'),auth[_0xe260('0xb')](),controller[_0xe260('0x10')]);router[_0xe260('0xa')]('/:id/run',auth[_0xe260('0xb')](),controller[_0xe260('0x11')]);router[_0xe260('0xa')](_0xe260('0x12'),auth[_0xe260('0xb')](),controller[_0xe260('0x13')]);router[_0xe260('0x14')]('/',auth['isAuthenticated'](),controller[_0xe260('0x15')]);router[_0xe260('0x16')]('/:id',auth[_0xe260('0xb')](),controller[_0xe260('0x17')]);router[_0xe260('0x18')](_0xe260('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xe260('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 1655a67..b2c6058 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 _0xaaf6=['STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','UNSIGNED','moment'];(function(_0xd6dd72,_0x495753){var _0xa712a2=function(_0x43f66f){while(--_0x43f66f){_0xd6dd72['push'](_0xd6dd72['shift']());}};_0xa712a2(++_0x495753);}(_0xaaf6,0x128));var _0x6aaf=function(_0x53b6f0,_0x134603){_0x53b6f0=_0x53b6f0-0x0;var _0xcbc09d=_0xaaf6[_0x53b6f0];return _0xcbc09d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6aaf('0x0'));module['exports']={'name':{'type':Sequelize[_0x6aaf('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x6aaf('0x2')](_0x6aaf('0x3'),_0x6aaf('0x4'),_0x6aaf('0x5')),'allowNull':![],'defaultValue':_0x6aaf('0x3')},'savename':{'type':Sequelize[_0x6aaf('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6aaf('0x6')]},'endDate':{'type':Sequelize[_0x6aaf('0x6')]},'status':{'type':Sequelize[_0x6aaf('0x1')],'defaultValue':_0x6aaf('0x7')},'type':{'type':Sequelize[_0x6aaf('0x2')](_0x6aaf('0x8'),_0x6aaf('0x9')),'allowNull':![],'defaultValue':_0x6aaf('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x6aaf('0xa')]},'reportType':{'type':Sequelize[_0x6aaf('0x1')]}};
\ No newline at end of file
+var _0x9f59=['pdf','xlsx','DATE','Loading','manual','scheduled','sequelize','moment','exports','STRING','ENUM','csv'];(function(_0x447c3c,_0x2b2d9d){var _0x4ee860=function(_0x961a17){while(--_0x961a17){_0x447c3c['push'](_0x447c3c['shift']());}};_0x4ee860(++_0x2b2d9d);}(_0x9f59,0x14a));var _0x99f5=function(_0x105689,_0x2d69f8){_0x105689=_0x105689-0x0;var _0x2bf1ca=_0x9f59[_0x105689];return _0x2bf1ca;};'use strict';var Sequelize=require(_0x99f5('0x0'));var moment=require(_0x99f5('0x1'));module[_0x99f5('0x2')]={'name':{'type':Sequelize[_0x99f5('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x99f5('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x99f5('0x4')](_0x99f5('0x5'),_0x99f5('0x6'),_0x99f5('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x99f5('0x8')]},'endDate':{'type':Sequelize[_0x99f5('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x99f5('0x9')},'type':{'type':Sequelize['ENUM'](_0x99f5('0xa'),_0x99f5('0xb')),'allowNull':![],'defaultValue':_0x99f5('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'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 845c40e..50d80de 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 _0x86ea=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','sendStatus','error','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','AnalyticExtractedReport','findAll','rows','catch','show','params','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','download','basename','output','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis'];(function(_0x30570d,_0x5c2202){var _0x4feb88=function(_0x28d335){while(--_0x28d335){_0x30570d['push'](_0x30570d['shift']());}};_0x4feb88(++_0x5c2202);}(_0x86ea,0x16b));var _0xa86e=function(_0xd031fb,_0x33009d){_0xd031fb=_0xd031fb-0x0;var _0x5c513f=_0x86ea[_0xd031fb];return _0x5c513f;};'use strict';var emlformat=require(_0xa86e('0x0'));var rimraf=require(_0xa86e('0x1'));var zipdir=require(_0xa86e('0x2'));var jsonpatch=require(_0xa86e('0x3'));var rp=require('request-promise');var moment=require(_0xa86e('0x4'));var BPromise=require(_0xa86e('0x5'));var Mustache=require(_0xa86e('0x6'));var util=require(_0xa86e('0x7'));var path=require(_0xa86e('0x8'));var sox=require(_0xa86e('0x9'));var csv=require('to-csv');var ejs=require(_0xa86e('0xa'));var fs=require('fs');var fs_extra=require(_0xa86e('0xb'));var _=require(_0xa86e('0xc'));var squel=require('squel');var crypto=require(_0xa86e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa86e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa86e('0xf'));var Redis=require(_0xa86e('0x10'));var authService=require(_0xa86e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa86e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa86e('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd7f557,_0x2bc30d){_0x2bc30d=_0x2bc30d||0xcc;return function(_0x85b3c){if(_0x85b3c){return _0xd7f557['sendStatus'](_0x2bc30d);}return _0xd7f557[_0xa86e('0x14')](_0x2bc30d)[_0xa86e('0x15')]();};}function respondWithResult(_0x51c791,_0x13065e){_0x13065e=_0x13065e||0xc8;return function(_0x5718d7){if(_0x5718d7){return _0x51c791[_0xa86e('0x14')](_0x13065e)[_0xa86e('0x16')](_0x5718d7);}};}function respondWithFilteredResult(_0x2ad980,_0x17b34e){return function(_0x56ef4b){if(_0x56ef4b){var _0x4790f1=typeof _0x17b34e[_0xa86e('0x17')]==='undefined'&&typeof _0x17b34e[_0xa86e('0x18')]===_0xa86e('0x19');var _0x279a04=_0x56ef4b['count'];var _0xc73d87=_0x4790f1?0x0:_0x17b34e[_0xa86e('0x17')];var _0x3a9931=_0x4790f1?_0x56ef4b['count']:_0x17b34e[_0xa86e('0x17')]+_0x17b34e[_0xa86e('0x18')];var _0x2c3856;if(_0x3a9931>=_0x279a04){_0x3a9931=_0x279a04;_0x2c3856=0xc8;}else{_0x2c3856=0xce;}_0x2ad980['status'](_0x2c3856);return _0x2ad980[_0xa86e('0x1a')](_0xa86e('0x1b'),_0xc73d87+'-'+_0x3a9931+'/'+_0x279a04)[_0xa86e('0x16')](_0x56ef4b);}return null;};}function patchUpdates(_0x2679fc){return function(_0x518e1a){try{jsonpatch[_0xa86e('0x1c')](_0x518e1a,_0x2679fc,!![]);}catch(_0x36e425){return BPromise[_0xa86e('0x1d')](_0x36e425);}return _0x518e1a[_0xa86e('0x1e')]();};}function saveUpdates(_0x244b83,_0x9fa30c){return function(_0x1df386){if(_0x1df386){return _0x1df386['update'](_0x244b83)[_0xa86e('0x1f')](function(_0x93850f){return _0x93850f;});}return null;};}function removeEntity(_0x1bef3c,_0x58392c){return function(_0x1f9902){if(_0x1f9902){return _0x1f9902['destroy']()['then'](function(){var _0xc82683=_0x1f9902[_0xa86e('0x20')]({'plain':!![]});var _0x56c2e9='ExtractedReports';return db[_0xa86e('0x21')][_0xa86e('0x22')]({'where':{'type':_0x56c2e9,'resourceId':_0xc82683['id']}})['then'](function(){return _0x1f9902;});})[_0xa86e('0x1f')](function(){_0x1bef3c[_0xa86e('0x14')](0xcc)[_0xa86e('0x15')]();});}};}function handleEntityNotFound(_0x5d812a,_0x274250){return function(_0x134dce){if(!_0x134dce){_0x5d812a[_0xa86e('0x23')](0x194);}return _0x134dce;};}function handleError(_0x26fd7b,_0xc33c3f){_0xc33c3f=_0xc33c3f||0x1f4;return function(_0x2ead7f){logger[_0xa86e('0x24')](_0x2ead7f['stack']);if(_0x2ead7f[_0xa86e('0x25')]){delete _0x2ead7f[_0xa86e('0x25')];}_0x26fd7b[_0xa86e('0x14')](_0xc33c3f)[_0xa86e('0x26')](_0x2ead7f);};}exports[_0xa86e('0x27')]=function(_0x1b613c,_0x2bff49){var _0x123c8e={},_0x539dec={},_0x1e7af2={'count':0x0,'rows':[]};var _0x38c601=_['map'](db['AnalyticExtractedReport'][_0xa86e('0x28')],function(_0xda05e5){return{'name':_0xda05e5[_0xa86e('0x29')],'type':_0xda05e5['type'][_0xa86e('0x2a')]};});_0x539dec[_0xa86e('0x2b')]=_[_0xa86e('0x2c')](_0x38c601,_0xa86e('0x25'));_0x539dec[_0xa86e('0x2d')]=_[_0xa86e('0x2e')](_0x1b613c[_0xa86e('0x2d')]);_0x539dec[_0xa86e('0x2f')]=_[_0xa86e('0x30')](_0x539dec[_0xa86e('0x2b')],_0x539dec[_0xa86e('0x2d')]);_0x123c8e[_0xa86e('0x31')]=_['intersection'](_0x539dec[_0xa86e('0x2b')],qs[_0xa86e('0x32')](_0x1b613c[_0xa86e('0x2d')][_0xa86e('0x32')]));_0x123c8e[_0xa86e('0x31')]=_0x123c8e[_0xa86e('0x31')][_0xa86e('0x33')]?_0x123c8e[_0xa86e('0x31')]:_0x539dec['model'];if(!_0x1b613c[_0xa86e('0x2d')]['hasOwnProperty'](_0xa86e('0x34'))){_0x123c8e[_0xa86e('0x18')]=qs[_0xa86e('0x18')](_0x1b613c['query']['limit']);_0x123c8e[_0xa86e('0x17')]=qs[_0xa86e('0x17')](_0x1b613c[_0xa86e('0x2d')][_0xa86e('0x17')]);}_0x123c8e[_0xa86e('0x35')]=qs[_0xa86e('0x36')](_0x1b613c[_0xa86e('0x2d')]['sort']);_0x123c8e[_0xa86e('0x37')]=qs[_0xa86e('0x2f')](_[_0xa86e('0x38')](_0x1b613c['query'],_0x539dec[_0xa86e('0x2f')]),_0x38c601);if(_0x1b613c[_0xa86e('0x2d')][_0xa86e('0x39')]){_0x123c8e[_0xa86e('0x37')]=_[_0xa86e('0x3a')](_0x123c8e['where'],{'$or':_[_0xa86e('0x2c')](_0x38c601,function(_0x5cc7a9){if(_0x5cc7a9['type']!==_0xa86e('0x3b')){var _0x5196b0={};_0x5196b0[_0x5cc7a9[_0xa86e('0x25')]]={'$like':'%'+_0x1b613c['query'][_0xa86e('0x39')]+'%'};return _0x5196b0;}})});}_0x123c8e=_[_0xa86e('0x3a')]({},_0x123c8e,_0x1b613c[_0xa86e('0x3c')]);var _0x3d5e7e={'where':_0x123c8e[_0xa86e('0x37')]};return db['AnalyticExtractedReport'][_0xa86e('0x3d')](_0x3d5e7e)['then'](function(_0x433e8f){_0x1e7af2[_0xa86e('0x3d')]=_0x433e8f;if(_0x1b613c[_0xa86e('0x2d')]['includeAll']){_0x123c8e[_0xa86e('0x3e')]=[{'all':!![]}];}return db[_0xa86e('0x3f')][_0xa86e('0x40')](_0x123c8e);})[_0xa86e('0x1f')](function(_0x1c3bde){_0x1e7af2[_0xa86e('0x41')]=_0x1c3bde;return _0x1e7af2;})[_0xa86e('0x1f')](respondWithFilteredResult(_0x2bff49,_0x123c8e))[_0xa86e('0x42')](handleError(_0x2bff49,null));};exports[_0xa86e('0x43')]=function(_0x149633,_0x3aba37){var _0x7c51da={'raw':!![],'where':{'id':_0x149633[_0xa86e('0x44')]['id']}},_0x4fef0f={};_0x4fef0f[_0xa86e('0x2b')]=_[_0xa86e('0x2e')](db['AnalyticExtractedReport'][_0xa86e('0x28')]);_0x4fef0f[_0xa86e('0x2d')]=_['keys'](_0x149633[_0xa86e('0x2d')]);_0x4fef0f[_0xa86e('0x2f')]=_[_0xa86e('0x30')](_0x4fef0f[_0xa86e('0x2b')],_0x4fef0f[_0xa86e('0x2d')]);_0x7c51da[_0xa86e('0x31')]=_['intersection'](_0x4fef0f['model'],qs[_0xa86e('0x32')](_0x149633[_0xa86e('0x2d')][_0xa86e('0x32')]));_0x7c51da[_0xa86e('0x31')]=_0x7c51da[_0xa86e('0x31')][_0xa86e('0x33')]?_0x7c51da['attributes']:_0x4fef0f[_0xa86e('0x2b')];if(_0x149633[_0xa86e('0x2d')][_0xa86e('0x45')]){_0x7c51da[_0xa86e('0x3e')]=[{'all':!![]}];}_0x7c51da=_[_0xa86e('0x3a')]({},_0x7c51da,_0x149633[_0xa86e('0x3c')]);return db['AnalyticExtractedReport'][_0xa86e('0x46')](_0x7c51da)[_0xa86e('0x1f')](handleEntityNotFound(_0x3aba37,null))[_0xa86e('0x1f')](respondWithResult(_0x3aba37,null))[_0xa86e('0x42')](handleError(_0x3aba37,null));};exports[_0xa86e('0x47')]=function(_0x5421c6,_0x3729d6){return db[_0xa86e('0x3f')]['create'](_0x5421c6['body'],{})['then'](function(_0x359d89){var _0x3aaafa=_0x5421c6['user'][_0xa86e('0x20')]({'plain':!![]});if(!_0x3aaafa)throw new Error(_0xa86e('0x48'));if(_0x3aaafa[_0xa86e('0x49')]===_0xa86e('0x4a')){var _0x396403=_0x359d89[_0xa86e('0x20')]({'plain':!![]});var _0xb28e1a=_0xa86e('0x4b');return db[_0xa86e('0x4c')]['find']({'where':{'name':_0xb28e1a,'userProfileId':_0x3aaafa[_0xa86e('0x4d')]},'raw':!![]})[_0xa86e('0x1f')](function(_0x58f871){if(_0x58f871&&_0x58f871[_0xa86e('0x4e')]===0x0){return db[_0xa86e('0x21')][_0xa86e('0x47')]({'name':_0x396403[_0xa86e('0x25')],'resourceId':_0x396403['id'],'type':_0x58f871['name'],'sectionId':_0x58f871['id']},{})[_0xa86e('0x1f')](function(){return _0x359d89;});}else{return _0x359d89;}})['catch'](function(_0xf7b460){logger[_0xa86e('0x24')](_0xa86e('0x4f'),_0xf7b460);throw _0xf7b460;});}return _0x359d89;})['then'](respondWithResult(_0x3729d6,0xc9))['catch'](handleError(_0x3729d6,null));};exports[_0xa86e('0x50')]=function(_0x36dad7,_0x1b0b6c){if(_0x36dad7[_0xa86e('0x51')]['id']){delete _0x36dad7[_0xa86e('0x51')]['id'];}return db['AnalyticExtractedReport'][_0xa86e('0x46')]({'where':{'id':_0x36dad7[_0xa86e('0x44')]['id']}})[_0xa86e('0x1f')](handleEntityNotFound(_0x1b0b6c,null))[_0xa86e('0x1f')](saveUpdates(_0x36dad7[_0xa86e('0x51')],null))[_0xa86e('0x1f')](respondWithResult(_0x1b0b6c,null))[_0xa86e('0x42')](handleError(_0x1b0b6c,null));};exports[_0xa86e('0x22')]=function(_0x25351e,_0x143856){return db[_0xa86e('0x3f')][_0xa86e('0x46')]({'where':{'id':_0x25351e['params']['id']}})[_0xa86e('0x1f')](handleEntityNotFound(_0x143856,null))[_0xa86e('0x1f')](removeEntity(_0x143856,null))[_0xa86e('0x42')](handleError(_0x143856,null));};exports[_0xa86e('0x52')]=function(_0x42c27e,_0x5e5580,_0x38c9c8){return db[_0xa86e('0x3f')][_0xa86e('0x46')]({'where':{'id':_0x42c27e[_0xa86e('0x44')]['id']},'attributes':[_0xa86e('0x25'),_0xa86e('0x53'),'savename',_0xa86e('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x5e5580,null))[_0xa86e('0x1f')](function(_0x425e3d){if(_0x425e3d){if(!fs['existsSync'](path[_0xa86e('0x55')](config[_0xa86e('0x56')],_0xa86e('0x57'),_0x425e3d[_0xa86e('0x58')]))){throw new db[(_0xa86e('0x59'))][(_0xa86e('0x5a'))](_0xa86e('0x5b'));}if(_0x42c27e[_0xa86e('0x2d')][_0xa86e('0x5c')]){return _0x5e5580[_0xa86e('0x23')](0xc8);}return _0x5e5580[_0xa86e('0x52')](path[_0xa86e('0x55')](config[_0xa86e('0x56')],_0xa86e('0x57'),_0x425e3d[_0xa86e('0x58')]),util['format'](_0xa86e('0x5d'),_0x425e3d['basename']||_0x425e3d[_0xa86e('0x25')],_0x425e3d[_0xa86e('0x54')][_0xa86e('0x5e')]()));}})['catch'](handleError(_0x5e5580,null));};
\ No newline at end of file
+var _0x6e1a=['sort','where','filters','pick','filter','merge','options','includeAll','findAll','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','join','root','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','toLowerCase','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','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','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','ExtractedReports','UserProfileResource','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x544d4e,_0x13ccf9){var _0x57ff5a=function(_0x479bc3){while(--_0x479bc3){_0x544d4e['push'](_0x544d4e['shift']());}};_0x57ff5a(++_0x13ccf9);}(_0x6e1a,0x81));var _0xa6e1=function(_0x59902b,_0x348717){_0x59902b=_0x59902b-0x0;var _0x134a72=_0x6e1a[_0x59902b];return _0x134a72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6e1('0x0'));var zipdir=require(_0xa6e1('0x1'));var jsonpatch=require(_0xa6e1('0x2'));var rp=require('request-promise');var moment=require(_0xa6e1('0x3'));var BPromise=require(_0xa6e1('0x4'));var Mustache=require(_0xa6e1('0x5'));var util=require(_0xa6e1('0x6'));var path=require(_0xa6e1('0x7'));var sox=require(_0xa6e1('0x8'));var csv=require(_0xa6e1('0x9'));var ejs=require(_0xa6e1('0xa'));var fs=require('fs');var fs_extra=require(_0xa6e1('0xb'));var _=require(_0xa6e1('0xc'));var squel=require(_0xa6e1('0xd'));var crypto=require(_0xa6e1('0xe'));var jsforce=require(_0xa6e1('0xf'));var deskjs=require(_0xa6e1('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa6e1('0x11'));var Papa=require(_0xa6e1('0x12'));var Redis=require(_0xa6e1('0x13'));var authService=require(_0xa6e1('0x14'));var qs=require(_0xa6e1('0x15'));var as=require(_0xa6e1('0x16'));var hardwareService=require(_0xa6e1('0x17'));var logger=require(_0xa6e1('0x18'))('api');var utils=require(_0xa6e1('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa6e1('0x1a'))['db'];function respondWithStatusCode(_0x30bdc8,_0x5013a5){_0x5013a5=_0x5013a5||0xcc;return function(_0x11283d){if(_0x11283d){return _0x30bdc8[_0xa6e1('0x1b')](_0x5013a5);}return _0x30bdc8[_0xa6e1('0x1c')](_0x5013a5)['end']();};}function respondWithResult(_0x325c1c,_0x442fbe){_0x442fbe=_0x442fbe||0xc8;return function(_0x9c0250){if(_0x9c0250){return _0x325c1c[_0xa6e1('0x1c')](_0x442fbe)[_0xa6e1('0x1d')](_0x9c0250);}};}function respondWithFilteredResult(_0x5150c2,_0x32594d){return function(_0x3d0080){if(_0x3d0080){var _0x243af9=typeof _0x32594d[_0xa6e1('0x1e')]===_0xa6e1('0x1f')&&typeof _0x32594d[_0xa6e1('0x20')]===_0xa6e1('0x1f');var _0x5774e0=_0x3d0080['count'];var _0xe5651d=_0x243af9?0x0:_0x32594d[_0xa6e1('0x1e')];var _0x475281=_0x243af9?_0x3d0080[_0xa6e1('0x21')]:_0x32594d[_0xa6e1('0x1e')]+_0x32594d[_0xa6e1('0x20')];var _0x293811;if(_0x475281>=_0x5774e0){_0x475281=_0x5774e0;_0x293811=0xc8;}else{_0x293811=0xce;}_0x5150c2[_0xa6e1('0x1c')](_0x293811);return _0x5150c2[_0xa6e1('0x22')](_0xa6e1('0x23'),_0xe5651d+'-'+_0x475281+'/'+_0x5774e0)[_0xa6e1('0x1d')](_0x3d0080);}return null;};}function patchUpdates(_0x15d24b){return function(_0x36b830){try{jsonpatch[_0xa6e1('0x24')](_0x36b830,_0x15d24b,!![]);}catch(_0x24d7e8){return BPromise['reject'](_0x24d7e8);}return _0x36b830[_0xa6e1('0x25')]();};}function saveUpdates(_0x27e00e,_0x43965f){return function(_0xff9678){if(_0xff9678){return _0xff9678[_0xa6e1('0x26')](_0x27e00e)['then'](function(_0x20278c){return _0x20278c;});}return null;};}function removeEntity(_0x44c74d,_0x53b5c2){return function(_0x4792bf){if(_0x4792bf){return _0x4792bf[_0xa6e1('0x27')]()[_0xa6e1('0x28')](function(){var _0x4ec178=_0x4792bf['get']({'plain':!![]});var _0x14ee13=_0xa6e1('0x29');return db[_0xa6e1('0x2a')][_0xa6e1('0x27')]({'where':{'type':_0x14ee13,'resourceId':_0x4ec178['id']}})[_0xa6e1('0x28')](function(){return _0x4792bf;});})[_0xa6e1('0x28')](function(){_0x44c74d[_0xa6e1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bbf9d,_0x228ca5){return function(_0x5d8eaf){if(!_0x5d8eaf){_0x4bbf9d[_0xa6e1('0x1b')](0x194);}return _0x5d8eaf;};}function handleError(_0x202751,_0x18cff5){_0x18cff5=_0x18cff5||0x1f4;return function(_0x55aeb2){logger['error'](_0x55aeb2[_0xa6e1('0x2b')]);if(_0x55aeb2[_0xa6e1('0x2c')]){delete _0x55aeb2[_0xa6e1('0x2c')];}_0x202751[_0xa6e1('0x1c')](_0x18cff5)[_0xa6e1('0x2d')](_0x55aeb2);};}exports['index']=function(_0x23372f,_0x22bb35){var _0x2d7c7b={},_0x25bade={},_0x4c838d={'count':0x0,'rows':[]};var _0xdbade5=_['map'](db[_0xa6e1('0x2e')][_0xa6e1('0x2f')],function(_0x325b38){return{'name':_0x325b38[_0xa6e1('0x30')],'type':_0x325b38[_0xa6e1('0x31')]['key']};});_0x25bade[_0xa6e1('0x32')]=_[_0xa6e1('0x33')](_0xdbade5,_0xa6e1('0x2c'));_0x25bade[_0xa6e1('0x34')]=_[_0xa6e1('0x35')](_0x23372f['query']);_0x25bade['filters']=_[_0xa6e1('0x36')](_0x25bade[_0xa6e1('0x32')],_0x25bade['query']);_0x2d7c7b[_0xa6e1('0x37')]=_['intersection'](_0x25bade['model'],qs[_0xa6e1('0x38')](_0x23372f[_0xa6e1('0x34')][_0xa6e1('0x38')]));_0x2d7c7b['attributes']=_0x2d7c7b['attributes'][_0xa6e1('0x39')]?_0x2d7c7b[_0xa6e1('0x37')]:_0x25bade['model'];if(!_0x23372f['query'][_0xa6e1('0x3a')](_0xa6e1('0x3b'))){_0x2d7c7b[_0xa6e1('0x20')]=qs[_0xa6e1('0x20')](_0x23372f[_0xa6e1('0x34')][_0xa6e1('0x20')]);_0x2d7c7b[_0xa6e1('0x1e')]=qs['offset'](_0x23372f[_0xa6e1('0x34')][_0xa6e1('0x1e')]);}_0x2d7c7b[_0xa6e1('0x3c')]=qs[_0xa6e1('0x3d')](_0x23372f[_0xa6e1('0x34')]['sort']);_0x2d7c7b[_0xa6e1('0x3e')]=qs[_0xa6e1('0x3f')](_[_0xa6e1('0x40')](_0x23372f[_0xa6e1('0x34')],_0x25bade[_0xa6e1('0x3f')]),_0xdbade5);if(_0x23372f[_0xa6e1('0x34')][_0xa6e1('0x41')]){_0x2d7c7b[_0xa6e1('0x3e')]=_[_0xa6e1('0x42')](_0x2d7c7b[_0xa6e1('0x3e')],{'$or':_['map'](_0xdbade5,function(_0x400eea){if(_0x400eea[_0xa6e1('0x31')]!=='VIRTUAL'){var _0x1d3895={};_0x1d3895[_0x400eea['name']]={'$like':'%'+_0x23372f[_0xa6e1('0x34')][_0xa6e1('0x41')]+'%'};return _0x1d3895;}})});}_0x2d7c7b=_[_0xa6e1('0x42')]({},_0x2d7c7b,_0x23372f[_0xa6e1('0x43')]);var _0x287ca0={'where':_0x2d7c7b['where']};return db[_0xa6e1('0x2e')][_0xa6e1('0x21')](_0x287ca0)[_0xa6e1('0x28')](function(_0x320b60){_0x4c838d[_0xa6e1('0x21')]=_0x320b60;if(_0x23372f['query'][_0xa6e1('0x44')]){_0x2d7c7b['include']=[{'all':!![]}];}return db[_0xa6e1('0x2e')][_0xa6e1('0x45')](_0x2d7c7b);})[_0xa6e1('0x28')](function(_0x43a4c2){_0x4c838d['rows']=_0x43a4c2;return _0x4c838d;})[_0xa6e1('0x28')](respondWithFilteredResult(_0x22bb35,_0x2d7c7b))[_0xa6e1('0x46')](handleError(_0x22bb35,null));};exports[_0xa6e1('0x47')]=function(_0x309c01,_0x173a00){var _0x16f806={'raw':!![],'where':{'id':_0x309c01[_0xa6e1('0x48')]['id']}},_0x1eabdd={};_0x1eabdd[_0xa6e1('0x32')]=_[_0xa6e1('0x35')](db[_0xa6e1('0x2e')][_0xa6e1('0x2f')]);_0x1eabdd['query']=_['keys'](_0x309c01['query']);_0x1eabdd['filters']=_['intersection'](_0x1eabdd['model'],_0x1eabdd[_0xa6e1('0x34')]);_0x16f806[_0xa6e1('0x37')]=_[_0xa6e1('0x36')](_0x1eabdd[_0xa6e1('0x32')],qs[_0xa6e1('0x38')](_0x309c01[_0xa6e1('0x34')][_0xa6e1('0x38')]));_0x16f806[_0xa6e1('0x37')]=_0x16f806[_0xa6e1('0x37')]['length']?_0x16f806[_0xa6e1('0x37')]:_0x1eabdd[_0xa6e1('0x32')];if(_0x309c01['query'][_0xa6e1('0x44')]){_0x16f806['include']=[{'all':!![]}];}_0x16f806=_[_0xa6e1('0x42')]({},_0x16f806,_0x309c01[_0xa6e1('0x43')]);return db[_0xa6e1('0x2e')][_0xa6e1('0x49')](_0x16f806)['then'](handleEntityNotFound(_0x173a00,null))['then'](respondWithResult(_0x173a00,null))['catch'](handleError(_0x173a00,null));};exports[_0xa6e1('0x4a')]=function(_0x44af34,_0x1daabf){return db[_0xa6e1('0x2e')]['create'](_0x44af34[_0xa6e1('0x4b')],{})[_0xa6e1('0x28')](function(_0xfce86b){var _0x24b6e3=_0x44af34[_0xa6e1('0x4c')][_0xa6e1('0x4d')]({'plain':!![]});if(!_0x24b6e3)throw new Error(_0xa6e1('0x4e'));if(_0x24b6e3[_0xa6e1('0x4f')]===_0xa6e1('0x4c')){var _0x1ba522=_0xfce86b[_0xa6e1('0x4d')]({'plain':!![]});var _0x5c9f1e=_0xa6e1('0x29');return db[_0xa6e1('0x50')][_0xa6e1('0x49')]({'where':{'name':_0x5c9f1e,'userProfileId':_0x24b6e3['userProfileId']},'raw':!![]})[_0xa6e1('0x28')](function(_0x560714){if(_0x560714&&_0x560714['autoAssociation']===0x0){return db['UserProfileResource'][_0xa6e1('0x4a')]({'name':_0x1ba522[_0xa6e1('0x2c')],'resourceId':_0x1ba522['id'],'type':_0x560714['name'],'sectionId':_0x560714['id']},{})[_0xa6e1('0x28')](function(){return _0xfce86b;});}else{return _0xfce86b;}})[_0xa6e1('0x46')](function(_0x381d44){logger[_0xa6e1('0x51')](_0xa6e1('0x52'),_0x381d44);throw _0x381d44;});}return _0xfce86b;})[_0xa6e1('0x28')](respondWithResult(_0x1daabf,0xc9))[_0xa6e1('0x46')](handleError(_0x1daabf,null));};exports[_0xa6e1('0x26')]=function(_0x1e36ae,_0x1d6718){if(_0x1e36ae[_0xa6e1('0x4b')]['id']){delete _0x1e36ae[_0xa6e1('0x4b')]['id'];}return db[_0xa6e1('0x2e')][_0xa6e1('0x49')]({'where':{'id':_0x1e36ae['params']['id']}})['then'](handleEntityNotFound(_0x1d6718,null))[_0xa6e1('0x28')](saveUpdates(_0x1e36ae[_0xa6e1('0x4b')],null))['then'](respondWithResult(_0x1d6718,null))['catch'](handleError(_0x1d6718,null));};exports[_0xa6e1('0x27')]=function(_0x146473,_0x500372){return db[_0xa6e1('0x2e')][_0xa6e1('0x49')]({'where':{'id':_0x146473[_0xa6e1('0x48')]['id']}})['then'](handleEntityNotFound(_0x500372,null))['then'](removeEntity(_0x500372,null))[_0xa6e1('0x46')](handleError(_0x500372,null));};exports[_0xa6e1('0x53')]=function(_0x3327cc,_0x50c146,_0x4ebd33){return db[_0xa6e1('0x2e')][_0xa6e1('0x49')]({'where':{'id':_0x3327cc['params']['id']},'attributes':[_0xa6e1('0x2c'),_0xa6e1('0x54'),_0xa6e1('0x55'),_0xa6e1('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x50c146,null))[_0xa6e1('0x28')](function(_0x34b4ce){if(_0x34b4ce){if(!fs['existsSync'](path[_0xa6e1('0x57')](config[_0xa6e1('0x58')],'server/files/reports',_0x34b4ce[_0xa6e1('0x55')]))){throw new db['Sequelize']['ValidationError'](_0xa6e1('0x59'));}if(_0x3327cc['query'][_0xa6e1('0x5a')]){return _0x50c146['sendStatus'](0xc8);}return _0x50c146[_0xa6e1('0x53')](path[_0xa6e1('0x57')](config['root'],_0xa6e1('0x5b'),_0x34b4ce[_0xa6e1('0x55')]),util[_0xa6e1('0x5c')](_0xa6e1('0x5d'),_0x34b4ce[_0xa6e1('0x54')]||_0x34b4ce[_0xa6e1('0x2c')],_0x34b4ce[_0xa6e1('0x56')][_0xa6e1('0x5e')]()));}})[_0xa6e1('0x46')](handleError(_0x50c146,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 7f69711..1ad1744 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 _0x179a=['api','moment','request-promise','path','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','lodash','util','../../config/logger'];(function(_0x3c789f,_0x9dacd1){var _0x3e8568=function(_0x456552){while(--_0x456552){_0x3c789f['push'](_0x3c789f['shift']());}};_0x3e8568(++_0x9dacd1);}(_0x179a,0x1a1));var _0xa179=function(_0x403f5f,_0x283f67){_0x403f5f=_0x403f5f-0x0;var _0x15b1cd=_0x179a[_0x403f5f];return _0x15b1cd;};'use strict';var _=require(_0xa179('0x0'));var util=require(_0xa179('0x1'));var logger=require(_0xa179('0x2'))(_0xa179('0x3'));var moment=require(_0xa179('0x4'));var BPromise=require('bluebird');var rp=require(_0xa179('0x5'));var fs=require('fs');var path=require(_0xa179('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa179('0x7'));module[_0xa179('0x8')]=function(_0xccaaac,_0x2ccec6){return _0xccaaac['define'](_0xa179('0x9'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0725=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x0725,0xf7));var _0x5072=function(_0x4bd298,_0x501cbb){_0x4bd298=_0x4bd298-0x0;var _0x3e3ed5=_0x0725[_0x4bd298];return _0x3e3ed5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5072('0x0'))(_0x5072('0x1'));var moment=require(_0x5072('0x2'));var BPromise=require(_0x5072('0x3'));var rp=require(_0x5072('0x4'));var fs=require('fs');var path=require(_0x5072('0x5'));var rimraf=require(_0x5072('0x6'));var config=require(_0x5072('0x7'));var attributes=require(_0x5072('0x8'));module[_0x5072('0x9')]=function(_0x120941,_0x206f18){return _0x120941['define'](_0x5072('0xa'),attributes,{'tableName':_0x5072('0xb'),'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 533bc7a..9f6e010 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 _0x79cc=['http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x3632ae,_0x54fb49){var _0x3c0124=function(_0x5ba362){while(--_0x5ba362){_0x3632ae['push'](_0x3632ae['shift']());}};_0x3c0124(++_0x54fb49);}(_0x79cc,0x19a));var _0xc79c=function(_0x5c1850,_0x48bf66){_0x5c1850=_0x5c1850-0x0;var _0x236435=_0x79cc[_0x5c1850];return _0x236435;};'use strict';var _=require(_0xc79c('0x0'));var util=require(_0xc79c('0x1'));var moment=require('moment');var BPromise=require(_0xc79c('0x2'));var rs=require(_0xc79c('0x3'));var fs=require('fs');var Redis=require(_0xc79c('0x4'));var db=require(_0xc79c('0x5'))['db'];var utils=require(_0xc79c('0x6'));var logger=require(_0xc79c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc79c('0x8'));var client=jayson[_0xc79c('0x9')][_0xc79c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x326e60,_0x55a927,_0x7e12b8){return new BPromise(function(_0x23b14c,_0x3de5ff){return client[_0xc79c('0xb')](_0x326e60,_0x7e12b8)[_0xc79c('0xc')](function(_0x1c955a){logger[_0xc79c('0xd')](_0xc79c('0xe'),_0x55a927,_0xc79c('0xf'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x55a927,_0xc79c('0xf'),JSON['stringify'](_0x1c955a));if(_0x1c955a[_0xc79c('0x10')]){if(_0x1c955a[_0xc79c('0x10')][_0xc79c('0x11')]===0x1f4){logger[_0xc79c('0x10')](_0xc79c('0xe'),_0x55a927,_0x1c955a['error']['message']);return _0x3de5ff(_0x1c955a[_0xc79c('0x10')][_0xc79c('0x12')]);}logger[_0xc79c('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x55a927,_0x1c955a[_0xc79c('0x10')]['message']);return _0x23b14c(_0x1c955a[_0xc79c('0x10')]['message']);}else{logger[_0xc79c('0xd')](_0xc79c('0xe'),_0x55a927,_0xc79c('0xf'));_0x23b14c(_0x1c955a[_0xc79c('0x13')][_0xc79c('0x12')]);}})[_0xc79c('0x14')](function(_0x485f82){logger['error'](_0xc79c('0xe'),_0x55a927,_0x485f82);_0x3de5ff(_0x485f82);});});}
\ No newline at end of file
+var _0x02b3=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug'];(function(_0x1f1e0b,_0x2f2895){var _0x5975a6=function(_0x543291){while(--_0x543291){_0x1f1e0b['push'](_0x1f1e0b['shift']());}};_0x5975a6(++_0x2f2895);}(_0x02b3,0x9f));var _0x302b=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0x02b3[_0x1b5aea];return _0x51cae9;};'use strict';var _=require(_0x302b('0x0'));var util=require(_0x302b('0x1'));var moment=require(_0x302b('0x2'));var BPromise=require(_0x302b('0x3'));var rs=require(_0x302b('0x4'));var fs=require('fs');var Redis=require(_0x302b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x302b('0x6'));var logger=require(_0x302b('0x7'))(_0x302b('0x8'));var config=require(_0x302b('0x9'));var jayson=require(_0x302b('0xa'));var client=jayson[_0x302b('0xb')][_0x302b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x389b65,_0x51a748,_0x2d22af){return new BPromise(function(_0x202a8b,_0x5a92b4){return client[_0x302b('0xd')](_0x389b65,_0x2d22af)['then'](function(_0x5bccff){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x51a748,_0x302b('0xe'));logger[_0x302b('0xf')](_0x302b('0x10'),_0x51a748,_0x302b('0xe'),JSON[_0x302b('0x11')](_0x5bccff));if(_0x5bccff[_0x302b('0x12')]){if(_0x5bccff[_0x302b('0x12')][_0x302b('0x13')]===0x1f4){logger['error'](_0x302b('0x14'),_0x51a748,_0x5bccff['error'][_0x302b('0x15')]);return _0x5a92b4(_0x5bccff[_0x302b('0x12')][_0x302b('0x15')]);}logger[_0x302b('0x12')](_0x302b('0x14'),_0x51a748,_0x5bccff[_0x302b('0x12')][_0x302b('0x15')]);return _0x202a8b(_0x5bccff[_0x302b('0x12')][_0x302b('0x15')]);}else{logger[_0x302b('0x16')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x51a748,_0x302b('0xe'));_0x202a8b(_0x5bccff[_0x302b('0x17')][_0x302b('0x15')]);}})[_0x302b('0x18')](function(_0x479cf1){logger['error'](_0x302b('0x14'),_0x51a748,_0x479cf1);_0x5a92b4(_0x479cf1);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 75f920e..6b42dd0 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 _0x20d3=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','isAuthenticated','show','download','post','create','/:id','update'];(function(_0x2d10a6,_0x334b39){var _0x18b66e=function(_0x404a26){while(--_0x404a26){_0x2d10a6['push'](_0x2d10a6['shift']());}};_0x18b66e(++_0x334b39);}(_0x20d3,0xa4));var _0x320d=function(_0x1a4835,_0x546c72){_0x1a4835=_0x1a4835-0x0;var _0x1af593=_0x20d3[_0x1a4835];return _0x1af593;};'use strict';var multer=require(_0x320d('0x0'));var util=require(_0x320d('0x1'));var path=require(_0x320d('0x2'));var timeout=require(_0x320d('0x3'));var express=require(_0x320d('0x4'));var router=express[_0x320d('0x5')]();var fs_extra=require(_0x320d('0x6'));var auth=require(_0x320d('0x7'));var interaction=require(_0x320d('0x8'));var config=require(_0x320d('0x9'));var controller=require(_0x320d('0xa'));router[_0x320d('0xb')]('/',auth['isAuthenticated'](),controller[_0x320d('0xc')]);router[_0x320d('0xb')]('/:id',auth[_0x320d('0xd')](),controller[_0x320d('0xe')]);router[_0x320d('0xb')]('/:id/download',auth[_0x320d('0xd')](),controller[_0x320d('0xf')]);router[_0x320d('0x10')]('/',auth[_0x320d('0xd')](),controller[_0x320d('0x11')]);router['put'](_0x320d('0x12'),auth['isAuthenticated'](),controller[_0x320d('0x13')]);router[_0x320d('0x14')](_0x320d('0x12'),auth['isAuthenticated'](),controller[_0x320d('0x15')]);module[_0x320d('0x16')]=router;
\ No newline at end of file
+var _0x9050=['put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','download','post','create'];(function(_0x196785,_0x15c00e){var _0x4b4b11=function(_0x4418b8){while(--_0x4418b8){_0x196785['push'](_0x196785['shift']());}};_0x4b4b11(++_0x15c00e);}(_0x9050,0x17d));var _0x0905=function(_0x10edfa,_0x584b67){_0x10edfa=_0x10edfa-0x0;var _0x382234=_0x9050[_0x10edfa];return _0x382234;};'use strict';var multer=require(_0x0905('0x0'));var util=require('util');var path=require(_0x0905('0x1'));var timeout=require(_0x0905('0x2'));var express=require(_0x0905('0x3'));var router=express[_0x0905('0x4')]();var fs_extra=require(_0x0905('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0905('0x6'));var config=require(_0x0905('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x0905('0x8')]('/',auth[_0x0905('0x9')](),controller['index']);router[_0x0905('0x8')](_0x0905('0xa'),auth[_0x0905('0x9')](),controller[_0x0905('0xb')]);router[_0x0905('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x0905('0xc')]);router[_0x0905('0xd')]('/',auth[_0x0905('0x9')](),controller[_0x0905('0xe')]);router[_0x0905('0xf')](_0x0905('0xa'),auth[_0x0905('0x9')](),controller['update']);router[_0x0905('0x10')](_0x0905('0xa'),auth[_0x0905('0x9')](),controller['destroy']);module[_0x0905('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index e289264..f9c0383 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 _0xbda4=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x26ab15,_0x5575d6){var _0x574794=function(_0x537c7d){while(--_0x537c7d){_0x26ab15['push'](_0x26ab15['shift']());}};_0x574794(++_0x5575d6);}(_0xbda4,0x88));var _0x4bda=function(_0x233e13,_0x2fa2de){_0x233e13=_0x233e13-0x0;var _0x53b1a2=_0xbda4[_0x233e13];return _0x53b1a2;};'use strict';var Sequelize=require(_0x4bda('0x0'));module['exports']={'field':{'type':Sequelize[_0x4bda('0x1')]},'alias':{'type':Sequelize[_0x4bda('0x2')]},'function':{'type':Sequelize[_0x4bda('0x2')]},'format':{'type':Sequelize[_0x4bda('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x4bda('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xf3ca=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x53594d,_0xb372ae){var _0x3b2544=function(_0x33359f){while(--_0x33359f){_0x53594d['push'](_0x53594d['shift']());}};_0x3b2544(++_0xb372ae);}(_0xf3ca,0x87));var _0xaf3c=function(_0x58f958,_0x393b50){_0x58f958=_0x58f958-0x0;var _0x19276d=_0xf3ca[_0x58f958];return _0x19276d;};'use strict';var Sequelize=require(_0xaf3c('0x0'));module['exports']={'field':{'type':Sequelize[_0xaf3c('0x1')]},'alias':{'type':Sequelize[_0xaf3c('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xaf3c('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xaf3c('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index d074a3f..d7ce2b1 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 _0x0940=['status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticFieldReport','includeAll','findAll','rows','catch','show','params','find','create','body','bulkCreate','update','ids','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus'];(function(_0x5743e3,_0x4a2aab){var _0x24d100=function(_0x10737c){while(--_0x10737c){_0x5743e3['push'](_0x5743e3['shift']());}};_0x24d100(++_0x4a2aab);}(_0x0940,0x84));var _0x0094=function(_0x159849,_0x4ff62b){_0x159849=_0x159849-0x0;var _0x433b4f=_0x0940[_0x159849];return _0x433b4f;};'use strict';var emlformat=require(_0x0094('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0094('0x1'));var jsonpatch=require(_0x0094('0x2'));var rp=require(_0x0094('0x3'));var moment=require(_0x0094('0x4'));var BPromise=require(_0x0094('0x5'));var Mustache=require('mustache');var util=require(_0x0094('0x6'));var path=require(_0x0094('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0094('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0094('0x9'));var squel=require(_0x0094('0xa'));var crypto=require(_0x0094('0xb'));var jsforce=require(_0x0094('0xc'));var deskjs=require(_0x0094('0xd'));var toCsv=require(_0x0094('0xe'));var querystring=require(_0x0094('0xf'));var Papa=require(_0x0094('0x10'));var Redis=require(_0x0094('0x11'));var authService=require(_0x0094('0x12'));var qs=require(_0x0094('0x13'));var as=require(_0x0094('0x14'));var hardwareService=require(_0x0094('0x15'));var logger=require(_0x0094('0x16'))(_0x0094('0x17'));var utils=require('../../config/utils');var config=require(_0x0094('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a7ef9,_0x565be4){_0x565be4=_0x565be4||0xcc;return function(_0xa6dc42){if(_0xa6dc42){return _0x2a7ef9[_0x0094('0x19')](_0x565be4);}return _0x2a7ef9[_0x0094('0x1a')](_0x565be4)[_0x0094('0x1b')]();};}function respondWithResult(_0x5c886c,_0x477887){_0x477887=_0x477887||0xc8;return function(_0x302155){if(_0x302155){return _0x5c886c[_0x0094('0x1a')](_0x477887)[_0x0094('0x1c')](_0x302155);}};}function respondWithFilteredResult(_0x5bb384,_0x52030e){return function(_0x29b60c){if(_0x29b60c){var _0x40dd4f=typeof _0x52030e[_0x0094('0x1d')]===_0x0094('0x1e')&&typeof _0x52030e[_0x0094('0x1f')]==='undefined';var _0x298bd3=_0x29b60c[_0x0094('0x20')];var _0x585e92=_0x40dd4f?0x0:_0x52030e['offset'];var _0x1ea161=_0x40dd4f?_0x29b60c[_0x0094('0x20')]:_0x52030e[_0x0094('0x1d')]+_0x52030e[_0x0094('0x1f')];var _0xb8d6ac;if(_0x1ea161>=_0x298bd3){_0x1ea161=_0x298bd3;_0xb8d6ac=0xc8;}else{_0xb8d6ac=0xce;}_0x5bb384['status'](_0xb8d6ac);return _0x5bb384[_0x0094('0x21')]('Content-Range',_0x585e92+'-'+_0x1ea161+'/'+_0x298bd3)['json'](_0x29b60c);}return null;};}function patchUpdates(_0x23b3ac){return function(_0x4ac754){try{jsonpatch[_0x0094('0x22')](_0x4ac754,_0x23b3ac,!![]);}catch(_0x22ae6d){return BPromise[_0x0094('0x23')](_0x22ae6d);}return _0x4ac754[_0x0094('0x24')]();};}function saveUpdates(_0x469858,_0x312b6a){return function(_0x2336f8){if(_0x2336f8){return _0x2336f8['update'](_0x469858)[_0x0094('0x25')](function(_0x3e93ca){return _0x3e93ca;});}return null;};}function removeEntity(_0x28a34b,_0xe66ba4){return function(_0x278299){if(_0x278299){return _0x278299[_0x0094('0x26')]()[_0x0094('0x25')](function(){_0x28a34b[_0x0094('0x1a')](0xcc)[_0x0094('0x1b')]();});}};}function handleEntityNotFound(_0x99c9b9,_0xe91b52){return function(_0x3d0de5){if(!_0x3d0de5){_0x99c9b9['sendStatus'](0x194);}return _0x3d0de5;};}function handleError(_0x4e2218,_0x23fb9b){_0x23fb9b=_0x23fb9b||0x1f4;return function(_0x18d3ee){logger[_0x0094('0x27')](_0x18d3ee[_0x0094('0x28')]);if(_0x18d3ee[_0x0094('0x29')]){delete _0x18d3ee[_0x0094('0x29')];}_0x4e2218[_0x0094('0x1a')](_0x23fb9b)['send'](_0x18d3ee);};}exports['index']=function(_0x178ebf,_0x2e3198){var _0x3211ff={},_0x51b654={},_0x53e210={'count':0x0,'rows':[]};var _0x2625cf=_[_0x0094('0x2a')](db['AnalyticFieldReport'][_0x0094('0x2b')],function(_0x28c712){return{'name':_0x28c712[_0x0094('0x2c')],'type':_0x28c712[_0x0094('0x2d')][_0x0094('0x2e')]};});_0x51b654[_0x0094('0x2f')]=_[_0x0094('0x2a')](_0x2625cf,_0x0094('0x29'));_0x51b654['query']=_[_0x0094('0x30')](_0x178ebf[_0x0094('0x31')]);_0x51b654[_0x0094('0x32')]=_[_0x0094('0x33')](_0x51b654[_0x0094('0x2f')],_0x51b654['query']);_0x3211ff[_0x0094('0x34')]=_[_0x0094('0x33')](_0x51b654[_0x0094('0x2f')],qs[_0x0094('0x35')](_0x178ebf[_0x0094('0x31')][_0x0094('0x35')]));_0x3211ff['attributes']=_0x3211ff[_0x0094('0x34')][_0x0094('0x36')]?_0x3211ff[_0x0094('0x34')]:_0x51b654[_0x0094('0x2f')];if(!_0x178ebf[_0x0094('0x31')]['hasOwnProperty']('nolimit')){_0x3211ff[_0x0094('0x1f')]=qs[_0x0094('0x1f')](_0x178ebf[_0x0094('0x31')][_0x0094('0x1f')]);_0x3211ff[_0x0094('0x1d')]=qs['offset'](_0x178ebf['query'][_0x0094('0x1d')]);}_0x3211ff[_0x0094('0x37')]=qs[_0x0094('0x38')](_0x178ebf['query'][_0x0094('0x38')]);_0x3211ff[_0x0094('0x39')]=qs['filters'](_[_0x0094('0x3a')](_0x178ebf[_0x0094('0x31')],_0x51b654[_0x0094('0x32')]),_0x2625cf);if(_0x178ebf['query'][_0x0094('0x3b')]){_0x3211ff['where']=_[_0x0094('0x3c')](_0x3211ff[_0x0094('0x39')],{'$or':_['map'](_0x2625cf,function(_0x38f320){if(_0x38f320[_0x0094('0x2d')]!==_0x0094('0x3d')){var _0x19ad2a={};_0x19ad2a[_0x38f320[_0x0094('0x29')]]={'$like':'%'+_0x178ebf[_0x0094('0x31')]['filter']+'%'};return _0x19ad2a;}})});}_0x3211ff=_[_0x0094('0x3c')]({},_0x3211ff,_0x178ebf[_0x0094('0x3e')]);var _0x2af0c8={'where':_0x3211ff['where']};return db[_0x0094('0x3f')][_0x0094('0x20')](_0x2af0c8)[_0x0094('0x25')](function(_0x29d33d){_0x53e210[_0x0094('0x20')]=_0x29d33d;if(_0x178ebf[_0x0094('0x31')][_0x0094('0x40')]){_0x3211ff['include']=[{'all':!![]}];}return db[_0x0094('0x3f')][_0x0094('0x41')](_0x3211ff);})[_0x0094('0x25')](function(_0xbb6ba4){_0x53e210[_0x0094('0x42')]=_0xbb6ba4;return _0x53e210;})[_0x0094('0x25')](respondWithFilteredResult(_0x2e3198,_0x3211ff))[_0x0094('0x43')](handleError(_0x2e3198,null));};exports[_0x0094('0x44')]=function(_0x482e33,_0x8abeb2){var _0x503b8e={'raw':![],'where':{'id':_0x482e33[_0x0094('0x45')]['id']}},_0x4c9da0={};_0x4c9da0[_0x0094('0x2f')]=_[_0x0094('0x30')](db[_0x0094('0x3f')]['rawAttributes']);_0x4c9da0[_0x0094('0x31')]=_['keys'](_0x482e33[_0x0094('0x31')]);_0x4c9da0['filters']=_[_0x0094('0x33')](_0x4c9da0[_0x0094('0x2f')],_0x4c9da0['query']);_0x503b8e[_0x0094('0x34')]=_['intersection'](_0x4c9da0[_0x0094('0x2f')],qs[_0x0094('0x35')](_0x482e33[_0x0094('0x31')][_0x0094('0x35')]));_0x503b8e[_0x0094('0x34')]=_0x503b8e['attributes'][_0x0094('0x36')]?_0x503b8e['attributes']:_0x4c9da0[_0x0094('0x2f')];if(_0x482e33['query'][_0x0094('0x40')]){_0x503b8e['include']=[{'all':!![]}];}_0x503b8e=_[_0x0094('0x3c')]({},_0x503b8e,_0x482e33[_0x0094('0x3e')]);return db[_0x0094('0x3f')][_0x0094('0x46')](_0x503b8e)[_0x0094('0x25')](handleEntityNotFound(_0x8abeb2,null))[_0x0094('0x25')](respondWithResult(_0x8abeb2,null))[_0x0094('0x43')](handleError(_0x8abeb2,null));};exports[_0x0094('0x47')]=function(_0x5cb953,_0x198258){return db[_0x0094('0x3f')][_0x0094('0x47')](_0x5cb953[_0x0094('0x48')],{})[_0x0094('0x25')](respondWithResult(_0x198258,0xc9))['catch'](handleError(_0x198258,null));};exports[_0x0094('0x49')]=function(_0x11d10b,_0x5708ba){return db[_0x0094('0x3f')][_0x0094('0x49')](_0x11d10b[_0x0094('0x48')],{'raw':![],'individualHooks':!![]})[_0x0094('0x25')](respondWithResult(_0x5708ba,0xc9))[_0x0094('0x43')](handleError(_0x5708ba,null));};exports[_0x0094('0x4a')]=function(_0x4c4388,_0xead7eb){if(_0x4c4388['body']['id']){delete _0x4c4388[_0x0094('0x48')]['id'];}return db['AnalyticFieldReport'][_0x0094('0x46')]({'where':{'id':_0x4c4388['params']['id']}})[_0x0094('0x25')](handleEntityNotFound(_0xead7eb,null))[_0x0094('0x25')](saveUpdates(_0x4c4388['body'],null))[_0x0094('0x25')](respondWithResult(_0xead7eb,null))[_0x0094('0x43')](handleError(_0xead7eb,null));};exports[_0x0094('0x26')]=function(_0x42b2a6,_0x2fa047){return db[_0x0094('0x3f')]['find']({'where':{'id':_0x42b2a6[_0x0094('0x45')]['id']}})[_0x0094('0x25')](handleEntityNotFound(_0x2fa047,null))[_0x0094('0x25')](removeEntity(_0x2fa047,null))[_0x0094('0x43')](handleError(_0x2fa047,null));};exports['bulkDestroy']=function(_0x4f8d9d,_0x289936){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x4f8d9d[_0x0094('0x31')][_0x0094('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x0094('0x25')](respondWithResult(_0x289936,0xcc))['catch'](handleError(_0x289936,null));};exports['addFields']=function(_0x390165,_0x11149b,_0x336236){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x390165[_0x0094('0x45')]['id']}})[_0x0094('0x25')](handleEntityNotFound(_0x11149b,null))[_0x0094('0x25')](function(_0x388957){if(_0x388957){return db[_0x0094('0x4c')][_0x0094('0x4d')](function(_0x5c1596){return db['AnalyticFieldReport'][_0x0094('0x26')]({'where':{'CustomReportId':_0x390165[_0x0094('0x45')]['id']},'transaction':_0x5c1596})[_0x0094('0x25')](function(_0x4167ba){var _0x5244d3=_[_0x0094('0x2a')](_0x390165[_0x0094('0x48')],function(_0x212a6f){delete _0x212a6f['id'];_0x212a6f[_0x0094('0x4e')]=_0x390165[_0x0094('0x45')]['id'];return _0x212a6f;});return db[_0x0094('0x3f')]['bulkCreate'](_0x5244d3,{'transaction':_0x5c1596});});})[_0x0094('0x25')](function(){return db['AnalyticFieldReport'][_0x0094('0x41')]({'where':{'CustomReportId':_0x390165[_0x0094('0x45')]['id']}});});}})[_0x0094('0x25')](respondWithResult(_0x11149b,null))[_0x0094('0x43')](handleError(_0x11149b,null));};
\ No newline at end of file
+var _0x6b8f=['order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticFieldReport','includeAll','findAll','rows','catch','show','intersection','include','create','body','bulkCreate','find','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','attributes','model','fields','length','nolimit'];(function(_0x415de4,_0x572875){var _0x1fc00a=function(_0x433c5f){while(--_0x433c5f){_0x415de4['push'](_0x415de4['shift']());}};_0x1fc00a(++_0x572875);}(_0x6b8f,0x160));var _0xf6b8=function(_0x4753b9,_0x3d3b04){_0x4753b9=_0x4753b9-0x0;var _0x427a60=_0x6b8f[_0x4753b9];return _0x427a60;};'use strict';var emlformat=require(_0xf6b8('0x0'));var rimraf=require(_0xf6b8('0x1'));var zipdir=require(_0xf6b8('0x2'));var jsonpatch=require(_0xf6b8('0x3'));var rp=require(_0xf6b8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf6b8('0x5'));var csv=require(_0xf6b8('0x6'));var ejs=require(_0xf6b8('0x7'));var fs=require('fs');var fs_extra=require(_0xf6b8('0x8'));var _=require(_0xf6b8('0x9'));var squel=require(_0xf6b8('0xa'));var crypto=require(_0xf6b8('0xb'));var jsforce=require(_0xf6b8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf6b8('0x6'));var querystring=require(_0xf6b8('0xd'));var Papa=require(_0xf6b8('0xe'));var Redis=require(_0xf6b8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf6b8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6b8('0x11'));var logger=require(_0xf6b8('0x12'))(_0xf6b8('0x13'));var utils=require(_0xf6b8('0x14'));var config=require(_0xf6b8('0x15'));var licenseUtil=require(_0xf6b8('0x16'));var db=require(_0xf6b8('0x17'))['db'];function respondWithStatusCode(_0x469879,_0x5a54e8){_0x5a54e8=_0x5a54e8||0xcc;return function(_0x478efe){if(_0x478efe){return _0x469879[_0xf6b8('0x18')](_0x5a54e8);}return _0x469879[_0xf6b8('0x19')](_0x5a54e8)[_0xf6b8('0x1a')]();};}function respondWithResult(_0x1fa7c7,_0x3e61ac){_0x3e61ac=_0x3e61ac||0xc8;return function(_0x4a6863){if(_0x4a6863){return _0x1fa7c7[_0xf6b8('0x19')](_0x3e61ac)[_0xf6b8('0x1b')](_0x4a6863);}};}function respondWithFilteredResult(_0x352ff7,_0x4c60e2){return function(_0x181b93){if(_0x181b93){var _0x5ba554=typeof _0x4c60e2[_0xf6b8('0x1c')]===_0xf6b8('0x1d')&&typeof _0x4c60e2[_0xf6b8('0x1e')]===_0xf6b8('0x1d');var _0x218984=_0x181b93[_0xf6b8('0x1f')];var _0x57e4b7=_0x5ba554?0x0:_0x4c60e2[_0xf6b8('0x1c')];var _0x1ac421=_0x5ba554?_0x181b93[_0xf6b8('0x1f')]:_0x4c60e2[_0xf6b8('0x1c')]+_0x4c60e2[_0xf6b8('0x1e')];var _0x21af52;if(_0x1ac421>=_0x218984){_0x1ac421=_0x218984;_0x21af52=0xc8;}else{_0x21af52=0xce;}_0x352ff7[_0xf6b8('0x19')](_0x21af52);return _0x352ff7['set'](_0xf6b8('0x20'),_0x57e4b7+'-'+_0x1ac421+'/'+_0x218984)[_0xf6b8('0x1b')](_0x181b93);}return null;};}function patchUpdates(_0x36d7d8){return function(_0x53b69f){try{jsonpatch['apply'](_0x53b69f,_0x36d7d8,!![]);}catch(_0x25dae3){return BPromise[_0xf6b8('0x21')](_0x25dae3);}return _0x53b69f[_0xf6b8('0x22')]();};}function saveUpdates(_0x540f7a,_0xd078b2){return function(_0x26f2a1){if(_0x26f2a1){return _0x26f2a1[_0xf6b8('0x23')](_0x540f7a)[_0xf6b8('0x24')](function(_0x2fb536){return _0x2fb536;});}return null;};}function removeEntity(_0x5b7dc0,_0x2508ff){return function(_0x413f16){if(_0x413f16){return _0x413f16[_0xf6b8('0x25')]()[_0xf6b8('0x24')](function(){_0x5b7dc0[_0xf6b8('0x19')](0xcc)[_0xf6b8('0x1a')]();});}};}function handleEntityNotFound(_0x2d143e,_0x3421a6){return function(_0x58890e){if(!_0x58890e){_0x2d143e['sendStatus'](0x194);}return _0x58890e;};}function handleError(_0x562fe0,_0xd07d71){_0xd07d71=_0xd07d71||0x1f4;return function(_0x282715){logger['error'](_0x282715[_0xf6b8('0x26')]);if(_0x282715[_0xf6b8('0x27')]){delete _0x282715[_0xf6b8('0x27')];}_0x562fe0[_0xf6b8('0x19')](_0xd07d71)[_0xf6b8('0x28')](_0x282715);};}exports['index']=function(_0x1ad1af,_0x585d24){var _0x11f081={},_0x35eac1={},_0x565dd1={'count':0x0,'rows':[]};var _0x26f625=_[_0xf6b8('0x29')](db['AnalyticFieldReport'][_0xf6b8('0x2a')],function(_0x265669){return{'name':_0x265669[_0xf6b8('0x2b')],'type':_0x265669[_0xf6b8('0x2c')]['key']};});_0x35eac1['model']=_[_0xf6b8('0x29')](_0x26f625,_0xf6b8('0x27'));_0x35eac1[_0xf6b8('0x2d')]=_[_0xf6b8('0x2e')](_0x1ad1af[_0xf6b8('0x2d')]);_0x35eac1[_0xf6b8('0x2f')]=_['intersection'](_0x35eac1['model'],_0x35eac1[_0xf6b8('0x2d')]);_0x11f081[_0xf6b8('0x30')]=_['intersection'](_0x35eac1[_0xf6b8('0x31')],qs['fields'](_0x1ad1af['query'][_0xf6b8('0x32')]));_0x11f081[_0xf6b8('0x30')]=_0x11f081['attributes'][_0xf6b8('0x33')]?_0x11f081['attributes']:_0x35eac1[_0xf6b8('0x31')];if(!_0x1ad1af[_0xf6b8('0x2d')]['hasOwnProperty'](_0xf6b8('0x34'))){_0x11f081[_0xf6b8('0x1e')]=qs[_0xf6b8('0x1e')](_0x1ad1af['query']['limit']);_0x11f081['offset']=qs[_0xf6b8('0x1c')](_0x1ad1af['query'][_0xf6b8('0x1c')]);}_0x11f081[_0xf6b8('0x35')]=qs[_0xf6b8('0x36')](_0x1ad1af['query'][_0xf6b8('0x36')]);_0x11f081[_0xf6b8('0x37')]=qs[_0xf6b8('0x2f')](_[_0xf6b8('0x38')](_0x1ad1af[_0xf6b8('0x2d')],_0x35eac1[_0xf6b8('0x2f')]),_0x26f625);if(_0x1ad1af['query'][_0xf6b8('0x39')]){_0x11f081[_0xf6b8('0x37')]=_[_0xf6b8('0x3a')](_0x11f081[_0xf6b8('0x37')],{'$or':_[_0xf6b8('0x29')](_0x26f625,function(_0x545fa0){if(_0x545fa0['type']!==_0xf6b8('0x3b')){var _0x16824c={};_0x16824c[_0x545fa0[_0xf6b8('0x27')]]={'$like':'%'+_0x1ad1af['query'][_0xf6b8('0x39')]+'%'};return _0x16824c;}})});}_0x11f081=_[_0xf6b8('0x3a')]({},_0x11f081,_0x1ad1af[_0xf6b8('0x3c')]);var _0x25f3d7={'where':_0x11f081[_0xf6b8('0x37')]};return db[_0xf6b8('0x3d')][_0xf6b8('0x1f')](_0x25f3d7)[_0xf6b8('0x24')](function(_0x272200){_0x565dd1[_0xf6b8('0x1f')]=_0x272200;if(_0x1ad1af[_0xf6b8('0x2d')][_0xf6b8('0x3e')]){_0x11f081['include']=[{'all':!![]}];}return db[_0xf6b8('0x3d')][_0xf6b8('0x3f')](_0x11f081);})['then'](function(_0x31c02d){_0x565dd1[_0xf6b8('0x40')]=_0x31c02d;return _0x565dd1;})[_0xf6b8('0x24')](respondWithFilteredResult(_0x585d24,_0x11f081))[_0xf6b8('0x41')](handleError(_0x585d24,null));};exports[_0xf6b8('0x42')]=function(_0x43d01f,_0x4f23e5){var _0x4341fb={'raw':![],'where':{'id':_0x43d01f['params']['id']}},_0x5a76df={};_0x5a76df[_0xf6b8('0x31')]=_[_0xf6b8('0x2e')](db['AnalyticFieldReport'][_0xf6b8('0x2a')]);_0x5a76df[_0xf6b8('0x2d')]=_['keys'](_0x43d01f[_0xf6b8('0x2d')]);_0x5a76df['filters']=_['intersection'](_0x5a76df['model'],_0x5a76df[_0xf6b8('0x2d')]);_0x4341fb['attributes']=_[_0xf6b8('0x43')](_0x5a76df[_0xf6b8('0x31')],qs[_0xf6b8('0x32')](_0x43d01f[_0xf6b8('0x2d')][_0xf6b8('0x32')]));_0x4341fb['attributes']=_0x4341fb[_0xf6b8('0x30')][_0xf6b8('0x33')]?_0x4341fb[_0xf6b8('0x30')]:_0x5a76df['model'];if(_0x43d01f[_0xf6b8('0x2d')][_0xf6b8('0x3e')]){_0x4341fb[_0xf6b8('0x44')]=[{'all':!![]}];}_0x4341fb=_[_0xf6b8('0x3a')]({},_0x4341fb,_0x43d01f['options']);return db[_0xf6b8('0x3d')]['find'](_0x4341fb)[_0xf6b8('0x24')](handleEntityNotFound(_0x4f23e5,null))[_0xf6b8('0x24')](respondWithResult(_0x4f23e5,null))[_0xf6b8('0x41')](handleError(_0x4f23e5,null));};exports[_0xf6b8('0x45')]=function(_0x292618,_0x394279){return db[_0xf6b8('0x3d')][_0xf6b8('0x45')](_0x292618[_0xf6b8('0x46')],{})[_0xf6b8('0x24')](respondWithResult(_0x394279,0xc9))[_0xf6b8('0x41')](handleError(_0x394279,null));};exports[_0xf6b8('0x47')]=function(_0x1a69b5,_0x51f15b){return db[_0xf6b8('0x3d')][_0xf6b8('0x47')](_0x1a69b5['body'],{'raw':![],'individualHooks':!![]})[_0xf6b8('0x24')](respondWithResult(_0x51f15b,0xc9))[_0xf6b8('0x41')](handleError(_0x51f15b,null));};exports[_0xf6b8('0x23')]=function(_0xdd6840,_0x5d96b2){if(_0xdd6840['body']['id']){delete _0xdd6840[_0xf6b8('0x46')]['id'];}return db[_0xf6b8('0x3d')][_0xf6b8('0x48')]({'where':{'id':_0xdd6840[_0xf6b8('0x49')]['id']}})['then'](handleEntityNotFound(_0x5d96b2,null))[_0xf6b8('0x24')](saveUpdates(_0xdd6840[_0xf6b8('0x46')],null))[_0xf6b8('0x24')](respondWithResult(_0x5d96b2,null))[_0xf6b8('0x41')](handleError(_0x5d96b2,null));};exports[_0xf6b8('0x25')]=function(_0x2d67ab,_0x10a6f1){return db[_0xf6b8('0x3d')][_0xf6b8('0x48')]({'where':{'id':_0x2d67ab['params']['id']}})[_0xf6b8('0x24')](handleEntityNotFound(_0x10a6f1,null))[_0xf6b8('0x24')](removeEntity(_0x10a6f1,null))[_0xf6b8('0x41')](handleError(_0x10a6f1,null));};exports[_0xf6b8('0x4a')]=function(_0x1db205,_0x7d528e){return db[_0xf6b8('0x3d')]['destroy']({'where':{'id':_0x1db205[_0xf6b8('0x2d')][_0xf6b8('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0xf6b8('0x24')](respondWithResult(_0x7d528e,0xcc))[_0xf6b8('0x41')](handleError(_0x7d528e,null));};exports[_0xf6b8('0x4c')]=function(_0xc2bc6b,_0x5df1c9,_0x1e62d2){return db[_0xf6b8('0x4d')][_0xf6b8('0x4e')]({'where':{'id':_0xc2bc6b[_0xf6b8('0x49')]['id']}})[_0xf6b8('0x24')](handleEntityNotFound(_0x5df1c9,null))[_0xf6b8('0x24')](function(_0x51209b){if(_0x51209b){return db['sequelize'][_0xf6b8('0x4f')](function(_0x3db810){return db[_0xf6b8('0x3d')]['destroy']({'where':{'CustomReportId':_0xc2bc6b['params']['id']},'transaction':_0x3db810})[_0xf6b8('0x24')](function(_0x560b7f){var _0x417367=_[_0xf6b8('0x29')](_0xc2bc6b[_0xf6b8('0x46')],function(_0x3407ab){delete _0x3407ab['id'];_0x3407ab[_0xf6b8('0x50')]=_0xc2bc6b[_0xf6b8('0x49')]['id'];return _0x3407ab;});return db[_0xf6b8('0x3d')]['bulkCreate'](_0x417367,{'transaction':_0x3db810});});})['then'](function(){return db[_0xf6b8('0x3d')][_0xf6b8('0x3f')]({'where':{'CustomReportId':_0xc2bc6b['params']['id']}});});}})[_0xf6b8('0x24')](respondWithResult(_0x5df1c9,null))[_0xf6b8('0x41')](handleError(_0x5df1c9,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index e90cbfb..6aa7a57 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 _0x1569=['define','AnalyticFieldReport','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x1abcd0,_0x448c52){var _0x4e43dd=function(_0x31bd92){while(--_0x31bd92){_0x1abcd0['push'](_0x1abcd0['shift']());}};_0x4e43dd(++_0x448c52);}(_0x1569,0x146));var _0x9156=function(_0x15d6de,_0x5807c6){_0x15d6de=_0x15d6de-0x0;var _0x51e84a=_0x1569[_0x15d6de];return _0x51e84a;};'use strict';var _=require(_0x9156('0x0'));var util=require(_0x9156('0x1'));var logger=require('../../config/logger')(_0x9156('0x2'));var moment=require(_0x9156('0x3'));var BPromise=require(_0x9156('0x4'));var rp=require(_0x9156('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9156('0x6'));var config=require(_0x9156('0x7'));var attributes=require(_0x9156('0x8'));module[_0x9156('0x9')]=function(_0x523a6e,_0x223dce){return _0x523a6e[_0x9156('0xa')](_0x9156('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf266=['api','moment','request-promise','path','rimraf','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x25ac19,_0x563211){var _0x447a74=function(_0x3925ca){while(--_0x3925ca){_0x25ac19['push'](_0x25ac19['shift']());}};_0x447a74(++_0x563211);}(_0xf266,0xda));var _0x6f26=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xf266[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0x6f26('0x0'));var util=require(_0x6f26('0x1'));var logger=require('../../config/logger')(_0x6f26('0x2'));var moment=require(_0x6f26('0x3'));var BPromise=require('bluebird');var rp=require(_0x6f26('0x4'));var fs=require('fs');var path=require(_0x6f26('0x5'));var rimraf=require(_0x6f26('0x6'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x6f26('0x7')]=function(_0x5284a8,_0x32404d){return _0x5284a8[_0x6f26('0x8')](_0x6f26('0x9'),attributes,{'tableName':_0x6f26('0xa'),'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 7b6230b..9d30fdf 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 _0x0306=['error','code','message','AnalyticFieldReport,\x20%s,\x20%s','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','debug','request\x20sent'];(function(_0x5626b,_0x4fd403){var _0x50874e=function(_0x24c81b){while(--_0x24c81b){_0x5626b['push'](_0x5626b['shift']());}};_0x50874e(++_0x4fd403);}(_0x0306,0x1d2));var _0x6030=function(_0x15dc98,_0x3217fa){_0x15dc98=_0x15dc98-0x0;var _0x1d3dc1=_0x0306[_0x15dc98];return _0x1d3dc1;};'use strict';var _=require(_0x6030('0x0'));var util=require(_0x6030('0x1'));var moment=require(_0x6030('0x2'));var BPromise=require(_0x6030('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6030('0x4'));var db=require(_0x6030('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6030('0x6'))('rpc');var config=require(_0x6030('0x7'));var jayson=require(_0x6030('0x8'));var client=jayson[_0x6030('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe33fef,_0xfce43e,_0x30e8b8){return new BPromise(function(_0x4a14e2,_0x207ec6){return client[_0x6030('0xa')](_0xe33fef,_0x30e8b8)[_0x6030('0xb')](function(_0x267b8c){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0xfce43e,'request\x20sent');logger[_0x6030('0xc')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0xfce43e,_0x6030('0xd'),JSON['stringify'](_0x267b8c));if(_0x267b8c['error']){if(_0x267b8c[_0x6030('0xe')][_0x6030('0xf')]===0x1f4){logger[_0x6030('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0xfce43e,_0x267b8c['error'][_0x6030('0x10')]);return _0x207ec6(_0x267b8c[_0x6030('0xe')][_0x6030('0x10')]);}logger[_0x6030('0xe')](_0x6030('0x11'),_0xfce43e,_0x267b8c[_0x6030('0xe')][_0x6030('0x10')]);return _0x4a14e2(_0x267b8c['error']['message']);}else{logger[_0x6030('0x12')](_0x6030('0x11'),_0xfce43e,_0x6030('0xd'));_0x4a14e2(_0x267b8c[_0x6030('0x13')]['message']);}})['catch'](function(_0x2c08f8){logger['error'](_0x6030('0x11'),_0xfce43e,_0x2c08f8);_0x207ec6(_0x2c08f8);});});}
\ No newline at end of file
+var _0x8eda=['rpc','jayson/promise','http','request','then','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','AnalyticFieldReport,\x20%s,\x20%s','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x24b88f,_0x22ea38){var _0x34a652=function(_0xa0fb48){while(--_0xa0fb48){_0x24b88f['push'](_0x24b88f['shift']());}};_0x34a652(++_0x22ea38);}(_0x8eda,0x1c2));var _0xa8ed=function(_0x43ff39,_0x1c03a0){_0x43ff39=_0x43ff39-0x0;var _0x187de3=_0x8eda[_0x43ff39];return _0x187de3;};'use strict';var _=require('lodash');var util=require(_0xa8ed('0x0'));var moment=require(_0xa8ed('0x1'));var BPromise=require(_0xa8ed('0x2'));var rs=require(_0xa8ed('0x3'));var fs=require('fs');var Redis=require(_0xa8ed('0x4'));var db=require(_0xa8ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa8ed('0x6'));var config=require('../../config/environment');var jayson=require(_0xa8ed('0x7'));var client=jayson['client'][_0xa8ed('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20e9a7,_0x165dbb,_0x24620f){return new BPromise(function(_0x39f87b,_0x1262fa){return client[_0xa8ed('0x9')](_0x20e9a7,_0x24620f)[_0xa8ed('0xa')](function(_0x5a1479){logger[_0xa8ed('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x165dbb,_0xa8ed('0xc'));logger['debug'](_0xa8ed('0xd'),_0x165dbb,_0xa8ed('0xc'),JSON[_0xa8ed('0xe')](_0x5a1479));if(_0x5a1479['error']){if(_0x5a1479[_0xa8ed('0xf')]['code']===0x1f4){logger[_0xa8ed('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x165dbb,_0x5a1479[_0xa8ed('0xf')][_0xa8ed('0x10')]);return _0x1262fa(_0x5a1479[_0xa8ed('0xf')][_0xa8ed('0x10')]);}logger[_0xa8ed('0xf')](_0xa8ed('0x11'),_0x165dbb,_0x5a1479[_0xa8ed('0xf')][_0xa8ed('0x10')]);return _0x39f87b(_0x5a1479[_0xa8ed('0xf')][_0xa8ed('0x10')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x165dbb,_0xa8ed('0xc'));_0x39f87b(_0x5a1479['result']['message']);}})[_0xa8ed('0x12')](function(_0x3671fa){logger[_0xa8ed('0xf')](_0xa8ed('0x11'),_0x165dbb,_0x3671fa);_0x1262fa(_0x3671fa);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index e18dc83..2c70cac 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(_0x2e5f54,_0x13dd84){var _0x407d00=function(_0x51f778){while(--_0x51f778){_0x2e5f54['push'](_0x2e5f54['shift']());}};_0x407d00(++_0x13dd84);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x5e37b8,_0x1c1e5c){var _0x52f02b=function(_0xede48d){while(--_0xede48d){_0x5e37b8['push'](_0x5e37b8['shift']());}};_0x52f02b(++_0x1c1e5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 31ad5c0..455e13c 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 _0x4de7=['STRING','name','TEXT','sequelize'];(function(_0x5433e8,_0x419b0b){var _0x43fac2=function(_0x485d83){while(--_0x485d83){_0x5433e8['push'](_0x5433e8['shift']());}};_0x43fac2(++_0x419b0b);}(_0x4de7,0x1f3));var _0x74de=function(_0x442c77,_0x3a95fc){_0x442c77=_0x442c77-0x0;var _0x50aed8=_0x4de7[_0x442c77];return _0x50aed8;};'use strict';var Sequelize=require(_0x74de('0x0'));module['exports']={'name':{'type':Sequelize[_0x74de('0x1')],'allowNull':![],'unique':_0x74de('0x2')},'table':{'type':Sequelize[_0x74de('0x1')]},'metric':{'type':Sequelize[_0x74de('0x3')]},'description':{'type':Sequelize[_0x74de('0x1')]}};
\ No newline at end of file
+var _0x1d90=['sequelize','STRING'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x1d90,0x13e));var _0x01d9=function(_0x4f4693,_0x149780){_0x4f4693=_0x4f4693-0x0;var _0x2ca019=_0x1d90[_0x4f4693];return _0x2ca019;};'use strict';var Sequelize=require(_0x01d9('0x0'));module['exports']={'name':{'type':Sequelize[_0x01d9('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x01d9('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x01d9('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index c2767bb..c90b434 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 _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x25a05b,_0x15616a){var _0x125e2c=function(_0xb3975e){while(--_0xb3975e){_0x25a05b['push'](_0x25a05b['shift']());}};_0x125e2c(++_0x15616a);}(_0xe5b3,0x133));var _0x3e5b=function(_0x3843af,_0x375e94){_0x3843af=_0x3843af-0x0;var _0x20543c=_0xe5b3[_0x3843af];return _0x20543c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));};
\ No newline at end of file
+var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x16e3dc,_0x35770a){var _0x2f1001=function(_0x516ef7){while(--_0x516ef7){_0x16e3dc['push'](_0x16e3dc['shift']());}};_0x2f1001(++_0x35770a);}(_0x55ca,0x126));var _0xa55c=function(_0x5c468f,_0x2e5c25){_0x5c468f=_0x5c468f-0x0;var _0x2136b0=_0x55ca[_0x5c468f];return _0x2136b0;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index c46bdb7..64a6dff 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 _0xdedd=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x1696c2,_0x4edb9e){var _0x378d16=function(_0x409a89){while(--_0x409a89){_0x1696c2['push'](_0x1696c2['shift']());}};_0x378d16(++_0x4edb9e);}(_0xdedd,0x197));var _0xdded=function(_0x28ef7c,_0x33f487){_0x28ef7c=_0x28ef7c-0x0;var _0x4f4eff=_0xdedd[_0x28ef7c];return _0x4f4eff;};'use strict';var _=require(_0xdded('0x0'));var util=require(_0xdded('0x1'));var logger=require(_0xdded('0x2'))(_0xdded('0x3'));var moment=require(_0xdded('0x4'));var BPromise=require('bluebird');var rp=require(_0xdded('0x5'));var fs=require('fs');var path=require(_0xdded('0x6'));var rimraf=require(_0xdded('0x7'));var config=require(_0xdded('0x8'));var attributes=require(_0xdded('0x9'));module[_0xdded('0xa')]=function(_0x2e327c,_0x277fab){return _0x2e327c['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x78e0=['request-promise','path','./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1574c5,_0x107f22){var _0x3cf252=function(_0x3547dc){while(--_0x3547dc){_0x1574c5['push'](_0x1574c5['shift']());}};_0x3cf252(++_0x107f22);}(_0x78e0,0x13e));var _0x078e=function(_0x6171c0,_0x127af3){_0x6171c0=_0x6171c0-0x0;var _0x227390=_0x78e0[_0x6171c0];return _0x227390;};'use strict';var _=require(_0x078e('0x0'));var util=require(_0x078e('0x1'));var logger=require(_0x078e('0x2'))(_0x078e('0x3'));var moment=require(_0x078e('0x4'));var BPromise=require(_0x078e('0x5'));var rp=require(_0x078e('0x6'));var fs=require('fs');var path=require(_0x078e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x078e('0x8'));module[_0x078e('0x9')]=function(_0x8e71c,_0x35578b){return _0x8e71c[_0x078e('0xa')]('AnalyticMetric',attributes,{'tableName':_0x078e('0xb'),'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 a924b43..551bd79 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 _0x4724=['AnalyticMetric,\x20%s,\x20%s,\x20%s','code','error','message','AnalyticMetric,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x3c2303,_0x2c9560){var _0x97a5ed=function(_0x5e97a8){while(--_0x5e97a8){_0x3c2303['push'](_0x3c2303['shift']());}};_0x97a5ed(++_0x2c9560);}(_0x4724,0x187));var _0x4472=function(_0xd343,_0x47ddff){_0xd343=_0xd343-0x0;var _0x4886fa=_0x4724[_0xd343];return _0x4886fa;};'use strict';var _=require(_0x4472('0x0'));var util=require(_0x4472('0x1'));var moment=require(_0x4472('0x2'));var BPromise=require(_0x4472('0x3'));var rs=require(_0x4472('0x4'));var fs=require('fs');var Redis=require(_0x4472('0x5'));var db=require(_0x4472('0x6'))['db'];var utils=require(_0x4472('0x7'));var logger=require('../../config/logger')(_0x4472('0x8'));var config=require(_0x4472('0x9'));var jayson=require(_0x4472('0xa'));var client=jayson[_0x4472('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17dc23,_0x1190ac,_0xd0e0fc){return new BPromise(function(_0x2f9ac6,_0x492d6a){return client[_0x4472('0xc')](_0x17dc23,_0xd0e0fc)[_0x4472('0xd')](function(_0x5ef6c9){logger[_0x4472('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x1190ac,_0x4472('0xf'));logger[_0x4472('0x10')](_0x4472('0x11'),_0x1190ac,_0x4472('0xf'),JSON['stringify'](_0x5ef6c9));if(_0x5ef6c9['error']){if(_0x5ef6c9['error'][_0x4472('0x12')]===0x1f4){logger[_0x4472('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x1190ac,_0x5ef6c9['error'][_0x4472('0x14')]);return _0x492d6a(_0x5ef6c9[_0x4472('0x13')][_0x4472('0x14')]);}logger[_0x4472('0x13')](_0x4472('0x15'),_0x1190ac,_0x5ef6c9[_0x4472('0x13')][_0x4472('0x14')]);return _0x2f9ac6(_0x5ef6c9['error'][_0x4472('0x14')]);}else{logger[_0x4472('0xe')](_0x4472('0x15'),_0x1190ac,'request\x20sent');_0x2f9ac6(_0x5ef6c9[_0x4472('0x16')][_0x4472('0x14')]);}})[_0x4472('0x17')](function(_0x1e6989){logger['error'](_0x4472('0x15'),_0x1190ac,_0x1e6989);_0x492d6a(_0x1e6989);});});}
\ No newline at end of file
+var _0xf9b3=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x14bdfb,_0x7ebb3c){var _0x433477=function(_0x499bf6){while(--_0x499bf6){_0x14bdfb['push'](_0x14bdfb['shift']());}};_0x433477(++_0x7ebb3c);}(_0xf9b3,0x154));var _0x3f9b=function(_0x15b218,_0x1e935a){_0x15b218=_0x15b218-0x0;var _0x54d825=_0xf9b3[_0x15b218];return _0x54d825;};'use strict';var _=require(_0x3f9b('0x0'));var util=require(_0x3f9b('0x1'));var moment=require(_0x3f9b('0x2'));var BPromise=require(_0x3f9b('0x3'));var rs=require(_0x3f9b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f9b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f9b('0x6'))(_0x3f9b('0x7'));var config=require(_0x3f9b('0x8'));var jayson=require(_0x3f9b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1351c3,_0x40c7af,_0x2a0f2f){return new BPromise(function(_0x48d8b4,_0x3aaf0d){return client[_0x3f9b('0xa')](_0x1351c3,_0x2a0f2f)[_0x3f9b('0xb')](function(_0x56b98d){logger['info'](_0x3f9b('0xc'),_0x40c7af,_0x3f9b('0xd'));logger['debug'](_0x3f9b('0xe'),_0x40c7af,'request\x20sent',JSON[_0x3f9b('0xf')](_0x56b98d));if(_0x56b98d[_0x3f9b('0x10')]){if(_0x56b98d['error'][_0x3f9b('0x11')]===0x1f4){logger[_0x3f9b('0x10')](_0x3f9b('0xc'),_0x40c7af,_0x56b98d[_0x3f9b('0x10')]['message']);return _0x3aaf0d(_0x56b98d[_0x3f9b('0x10')]['message']);}logger[_0x3f9b('0x10')](_0x3f9b('0xc'),_0x40c7af,_0x56b98d[_0x3f9b('0x10')][_0x3f9b('0x12')]);return _0x48d8b4(_0x56b98d[_0x3f9b('0x10')]['message']);}else{logger[_0x3f9b('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x40c7af,_0x3f9b('0xd'));_0x48d8b4(_0x56b98d[_0x3f9b('0x14')][_0x3f9b('0x12')]);}})[_0x3f9b('0x15')](function(_0xf21347){logger[_0x3f9b('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x40c7af,_0xf21347);_0x3aaf0d(_0xf21347);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index d58477c..a9a0c77 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 _0x78b7=['create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x487f48,_0x5dd2dc){var _0x3a39f8=function(_0x4afbf4){while(--_0x4afbf4){_0x487f48['push'](_0x487f48['shift']());}};_0x3a39f8(++_0x5dd2dc);}(_0x78b7,0x194));var _0x778b=function(_0x270305,_0x43a385){_0x270305=_0x270305-0x0;var _0x4014e3=_0x78b7[_0x270305];return _0x4014e3;};'use strict';var multer=require(_0x778b('0x0'));var util=require(_0x778b('0x1'));var path=require('path');var timeout=require(_0x778b('0x2'));var express=require(_0x778b('0x3'));var router=express[_0x778b('0x4')]();var fs_extra=require(_0x778b('0x5'));var auth=require(_0x778b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x778b('0x7'));router[_0x778b('0x8')]('/',auth[_0x778b('0x9')](),controller[_0x778b('0xa')]);router[_0x778b('0x8')](_0x778b('0xb'),auth['isAuthenticated'](),controller[_0x778b('0xc')]);router[_0x778b('0xd')]('/',auth[_0x778b('0x9')](),controller[_0x778b('0xe')]);router[_0x778b('0xf')]('/:id',auth[_0x778b('0x9')](),controller[_0x778b('0x10')]);router['delete'](_0x778b('0xb'),auth[_0x778b('0x9')](),controller[_0x778b('0x11')]);module[_0x778b('0x12')]=router;
\ No newline at end of file
+var _0xaa5c=['delete','destroy','multer','util','path','connect-timeout','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x33def6,_0x1cc2bf){var _0x32ac0b=function(_0x2ba1ee){while(--_0x2ba1ee){_0x33def6['push'](_0x33def6['shift']());}};_0x32ac0b(++_0x1cc2bf);}(_0xaa5c,0x1f2));var _0xcaa5=function(_0x4665f6,_0x58851b){_0x4665f6=_0x4665f6-0x0;var _0x4834a0=_0xaa5c[_0x4665f6];return _0x4834a0;};'use strict';var multer=require(_0xcaa5('0x0'));var util=require(_0xcaa5('0x1'));var path=require(_0xcaa5('0x2'));var timeout=require(_0xcaa5('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcaa5('0x4'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0xcaa5('0x5')]('/',auth[_0xcaa5('0x6')](),controller[_0xcaa5('0x7')]);router['get'](_0xcaa5('0x8'),auth[_0xcaa5('0x6')](),controller[_0xcaa5('0x9')]);router[_0xcaa5('0xa')]('/',auth['isAuthenticated'](),controller[_0xcaa5('0xb')]);router[_0xcaa5('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xcaa5('0xd')]);router[_0xcaa5('0xe')](_0xcaa5('0x8'),auth['isAuthenticated'](),controller[_0xcaa5('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 5c7d107..405a328 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 _0xa668=['exports','TEXT'];(function(_0x2cabd5,_0x31dbd){var _0x4c02d7=function(_0x4a908c){while(--_0x4a908c){_0x2cabd5['push'](_0x2cabd5['shift']());}};_0x4c02d7(++_0x31dbd);}(_0xa668,0xe6));var _0x8a66=function(_0x3f6269,_0x3fd5ea){_0x3f6269=_0x3f6269-0x0;var _0x58f14d=_0xa668[_0x3f6269];return _0x58f14d;};'use strict';var Sequelize=require('sequelize');module[_0x8a66('0x0')]={'tree':{'type':Sequelize[_0x8a66('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xb619=['TEXT','sequelize','exports'];(function(_0x3a8db3,_0x4558fc){var _0xcbd53a=function(_0x5957a1){while(--_0x5957a1){_0x3a8db3['push'](_0x3a8db3['shift']());}};_0xcbd53a(++_0x4558fc);}(_0xb619,0x12a));var _0x9b61=function(_0x25c5c6,_0x11fa9a){_0x25c5c6=_0x25c5c6-0x0;var _0x4c7307=_0xb619[_0x25c5c6];return _0x4c7307;};'use strict';var Sequelize=require(_0x9b61('0x0'));module[_0x9b61('0x1')]={'tree':{'type':Sequelize[_0x9b61('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 9e8d6dc..c8dd653 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 _0x13e6=['ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0xcd816,_0x140292){var _0x3a19c3=function(_0x501714){while(--_0x501714){_0xcd816['push'](_0xcd816['shift']());}};_0x3a19c3(++_0x140292);}(_0x13e6,0x136));var _0x613e=function(_0xe7c4c3,_0x1586c9){_0xe7c4c3=_0xe7c4c3-0x0;var _0x5b4d0a=_0x13e6[_0xe7c4c3];return _0x5b4d0a;};'use strict';var emlformat=require(_0x613e('0x0'));var rimraf=require(_0x613e('0x1'));var zipdir=require(_0x613e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x613e('0x3'));var moment=require(_0x613e('0x4'));var BPromise=require(_0x613e('0x5'));var Mustache=require(_0x613e('0x6'));var util=require(_0x613e('0x7'));var path=require(_0x613e('0x8'));var sox=require(_0x613e('0x9'));var csv=require('to-csv');var ejs=require(_0x613e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x613e('0xb'));var squel=require(_0x613e('0xc'));var crypto=require(_0x613e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x613e('0xe'));var toCsv=require(_0x613e('0xf'));var querystring=require(_0x613e('0x10'));var Papa=require(_0x613e('0x11'));var Redis=require(_0x613e('0x12'));var authService=require(_0x613e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x613e('0x14'));var hardwareService=require(_0x613e('0x15'));var logger=require(_0x613e('0x16'))(_0x613e('0x17'));var utils=require(_0x613e('0x18'));var config=require(_0x613e('0x19'));var licenseUtil=require(_0x613e('0x1a'));var db=require(_0x613e('0x1b'))['db'];function respondWithStatusCode(_0x1895c7,_0x5c6f6b){_0x5c6f6b=_0x5c6f6b||0xcc;return function(_0x5f0c76){if(_0x5f0c76){return _0x1895c7[_0x613e('0x1c')](_0x5c6f6b);}return _0x1895c7[_0x613e('0x1d')](_0x5c6f6b)[_0x613e('0x1e')]();};}function respondWithResult(_0x4e2011,_0x5f5d14){_0x5f5d14=_0x5f5d14||0xc8;return function(_0x43fd1f){if(_0x43fd1f){return _0x4e2011[_0x613e('0x1d')](_0x5f5d14)['json'](_0x43fd1f);}};}function respondWithFilteredResult(_0x350b5d,_0x59a20a){return function(_0x106aef){if(_0x106aef){var _0x476cb2=typeof _0x59a20a['offset']===_0x613e('0x1f')&&typeof _0x59a20a[_0x613e('0x20')]===_0x613e('0x1f');var _0x24f757=_0x106aef[_0x613e('0x21')];var _0x2f5e8c=_0x476cb2?0x0:_0x59a20a[_0x613e('0x22')];var _0x526013=_0x476cb2?_0x106aef[_0x613e('0x21')]:_0x59a20a[_0x613e('0x22')]+_0x59a20a['limit'];var _0xede698;if(_0x526013>=_0x24f757){_0x526013=_0x24f757;_0xede698=0xc8;}else{_0xede698=0xce;}_0x350b5d['status'](_0xede698);return _0x350b5d[_0x613e('0x23')]('Content-Range',_0x2f5e8c+'-'+_0x526013+'/'+_0x24f757)[_0x613e('0x24')](_0x106aef);}return null;};}function patchUpdates(_0x4b988e){return function(_0x3d5bdb){try{jsonpatch[_0x613e('0x25')](_0x3d5bdb,_0x4b988e,!![]);}catch(_0x15c59a){return BPromise[_0x613e('0x26')](_0x15c59a);}return _0x3d5bdb[_0x613e('0x27')]();};}function saveUpdates(_0x4bfb00,_0x3c35e0){return function(_0x31b6a3){if(_0x31b6a3){return _0x31b6a3[_0x613e('0x28')](_0x4bfb00)[_0x613e('0x29')](function(_0x16d728){return _0x16d728;});}return null;};}function removeEntity(_0x1bd581,_0x46bdba){return function(_0x4288a5){if(_0x4288a5){return _0x4288a5[_0x613e('0x2a')]()[_0x613e('0x29')](function(){_0x1bd581[_0x613e('0x1d')](0xcc)[_0x613e('0x1e')]();});}};}function handleEntityNotFound(_0x145133,_0x4f5e85){return function(_0x1468ec){if(!_0x1468ec){_0x145133[_0x613e('0x1c')](0x194);}return _0x1468ec;};}function handleError(_0x5e5db2,_0x19ad4c){_0x19ad4c=_0x19ad4c||0x1f4;return function(_0x1e62b7){logger[_0x613e('0x2b')](_0x1e62b7[_0x613e('0x2c')]);if(_0x1e62b7[_0x613e('0x2d')]){delete _0x1e62b7[_0x613e('0x2d')];}_0x5e5db2[_0x613e('0x1d')](_0x19ad4c)[_0x613e('0x2e')](_0x1e62b7);};}exports[_0x613e('0x2f')]=function(_0x340cce,_0x377cab){var _0x13262f={},_0x571365={},_0x28dea6={'count':0x0,'rows':[]};var _0x3a011e=_[_0x613e('0x30')](db[_0x613e('0x31')][_0x613e('0x32')],function(_0x5e6322){return{'name':_0x5e6322['fieldName'],'type':_0x5e6322['type'][_0x613e('0x33')]};});_0x571365[_0x613e('0x34')]=_[_0x613e('0x30')](_0x3a011e,'name');_0x571365[_0x613e('0x35')]=_[_0x613e('0x36')](_0x340cce[_0x613e('0x35')]);_0x571365[_0x613e('0x37')]=_[_0x613e('0x38')](_0x571365[_0x613e('0x34')],_0x571365[_0x613e('0x35')]);_0x13262f['attributes']=_[_0x613e('0x38')](_0x571365[_0x613e('0x34')],qs[_0x613e('0x39')](_0x340cce[_0x613e('0x35')]['fields']));_0x13262f[_0x613e('0x3a')]=_0x13262f[_0x613e('0x3a')]['length']?_0x13262f[_0x613e('0x3a')]:_0x571365[_0x613e('0x34')];if(!_0x340cce[_0x613e('0x35')][_0x613e('0x3b')](_0x613e('0x3c'))){_0x13262f[_0x613e('0x20')]=qs['limit'](_0x340cce[_0x613e('0x35')][_0x613e('0x20')]);_0x13262f[_0x613e('0x22')]=qs[_0x613e('0x22')](_0x340cce[_0x613e('0x35')]['offset']);}_0x13262f[_0x613e('0x3d')]=qs['sort'](_0x340cce[_0x613e('0x35')][_0x613e('0x3e')]);_0x13262f[_0x613e('0x3f')]=qs[_0x613e('0x37')](_[_0x613e('0x40')](_0x340cce[_0x613e('0x35')],_0x571365[_0x613e('0x37')]),_0x3a011e);if(_0x340cce[_0x613e('0x35')]['filter']){_0x13262f[_0x613e('0x3f')]=_[_0x613e('0x41')](_0x13262f['where'],{'$or':_[_0x613e('0x30')](_0x3a011e,function(_0x11d0ea){if(_0x11d0ea[_0x613e('0x42')]!=='VIRTUAL'){var _0x544293={};_0x544293[_0x11d0ea[_0x613e('0x2d')]]={'$like':'%'+_0x340cce[_0x613e('0x35')][_0x613e('0x43')]+'%'};return _0x544293;}})});}_0x13262f=_[_0x613e('0x41')]({},_0x13262f,_0x340cce[_0x613e('0x44')]);var _0x51256c={'where':_0x13262f['where']};return db[_0x613e('0x31')][_0x613e('0x21')](_0x51256c)['then'](function(_0x2b930a){_0x28dea6[_0x613e('0x21')]=_0x2b930a;if(_0x340cce['query'][_0x613e('0x45')]){_0x13262f[_0x613e('0x46')]=[{'all':!![]}];}return db[_0x613e('0x31')][_0x613e('0x47')](_0x13262f);})['then'](function(_0xeedb5a){_0x28dea6[_0x613e('0x48')]=_0xeedb5a;return _0x28dea6;})[_0x613e('0x29')](respondWithFilteredResult(_0x377cab,_0x13262f))[_0x613e('0x49')](handleError(_0x377cab,null));};exports[_0x613e('0x4a')]=function(_0x2fd59f,_0x33ce72){var _0x4f170a={'raw':!![],'where':{'id':_0x2fd59f[_0x613e('0x4b')]['id']}},_0x30b39a={};_0x30b39a['model']=_[_0x613e('0x36')](db[_0x613e('0x31')][_0x613e('0x32')]);_0x30b39a[_0x613e('0x35')]=_['keys'](_0x2fd59f['query']);_0x30b39a[_0x613e('0x37')]=_[_0x613e('0x38')](_0x30b39a[_0x613e('0x34')],_0x30b39a[_0x613e('0x35')]);_0x4f170a['attributes']=_[_0x613e('0x38')](_0x30b39a['model'],qs[_0x613e('0x39')](_0x2fd59f[_0x613e('0x35')][_0x613e('0x39')]));_0x4f170a[_0x613e('0x3a')]=_0x4f170a[_0x613e('0x3a')][_0x613e('0x4c')]?_0x4f170a['attributes']:_0x30b39a['model'];if(_0x2fd59f[_0x613e('0x35')]['includeAll']){_0x4f170a[_0x613e('0x46')]=[{'all':!![]}];}_0x4f170a=_[_0x613e('0x41')]({},_0x4f170a,_0x2fd59f['options']);return db[_0x613e('0x31')]['find'](_0x4f170a)['then'](handleEntityNotFound(_0x33ce72,null))[_0x613e('0x29')](respondWithResult(_0x33ce72,null))[_0x613e('0x49')](handleError(_0x33ce72,null));};exports['create']=function(_0x37a03f,_0x5224db){return db['AnalyticTreeReport'][_0x613e('0x4d')](_0x37a03f[_0x613e('0x4e')],{})[_0x613e('0x29')](respondWithResult(_0x5224db,0xc9))['catch'](handleError(_0x5224db,null));};exports[_0x613e('0x28')]=function(_0x44a715,_0x1991b4){if(_0x44a715[_0x613e('0x4e')]['id']){delete _0x44a715[_0x613e('0x4e')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x44a715[_0x613e('0x4b')]['id']}})[_0x613e('0x29')](handleEntityNotFound(_0x1991b4,null))['then'](saveUpdates(_0x44a715[_0x613e('0x4e')],null))[_0x613e('0x29')](respondWithResult(_0x1991b4,null))['catch'](handleError(_0x1991b4,null));};exports['destroy']=function(_0x223fee,_0x4fd1f4){return db[_0x613e('0x31')][_0x613e('0x4f')]({'where':{'id':_0x223fee[_0x613e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4fd1f4,null))[_0x613e('0x29')](removeEntity(_0x4fd1f4,null))[_0x613e('0x49')](handleError(_0x4fd1f4,null));};
\ No newline at end of file
+var _0x76b8=['undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','rows','show','params','rawAttributes','includeAll','find','create','catch','body','eml-format','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset'];(function(_0x58feb2,_0xcb86a6){var _0x2f5919=function(_0xd743fc){while(--_0xd743fc){_0x58feb2['push'](_0x58feb2['shift']());}};_0x2f5919(++_0xcb86a6);}(_0x76b8,0x150));var _0x876b=function(_0x3cc4c8,_0x114636){_0x3cc4c8=_0x3cc4c8-0x0;var _0xdc0123=_0x76b8[_0x3cc4c8];return _0xdc0123;};'use strict';var emlformat=require(_0x876b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x876b('0x1'));var util=require(_0x876b('0x2'));var path=require(_0x876b('0x3'));var sox=require('sox');var csv=require(_0x876b('0x4'));var ejs=require(_0x876b('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x876b('0x6'));var squel=require(_0x876b('0x7'));var crypto=require('crypto');var jsforce=require(_0x876b('0x8'));var deskjs=require(_0x876b('0x9'));var toCsv=require('to-csv');var querystring=require(_0x876b('0xa'));var Papa=require('papaparse');var Redis=require(_0x876b('0xb'));var authService=require(_0x876b('0xc'));var qs=require(_0x876b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x876b('0xe'));var logger=require(_0x876b('0xf'))(_0x876b('0x10'));var utils=require(_0x876b('0x11'));var config=require(_0x876b('0x12'));var licenseUtil=require(_0x876b('0x13'));var db=require(_0x876b('0x14'))['db'];function respondWithStatusCode(_0x8e5ec,_0x5ac1ec){_0x5ac1ec=_0x5ac1ec||0xcc;return function(_0x2a35c0){if(_0x2a35c0){return _0x8e5ec[_0x876b('0x15')](_0x5ac1ec);}return _0x8e5ec['status'](_0x5ac1ec)['end']();};}function respondWithResult(_0x4ba5c2,_0x292162){_0x292162=_0x292162||0xc8;return function(_0x5128b0){if(_0x5128b0){return _0x4ba5c2[_0x876b('0x16')](_0x292162)['json'](_0x5128b0);}};}function respondWithFilteredResult(_0x42c66d,_0x2b5823){return function(_0x24bb89){if(_0x24bb89){var _0x253347=typeof _0x2b5823[_0x876b('0x17')]===_0x876b('0x18')&&typeof _0x2b5823[_0x876b('0x19')]===_0x876b('0x18');var _0x49bb28=_0x24bb89[_0x876b('0x1a')];var _0x1ff3a4=_0x253347?0x0:_0x2b5823[_0x876b('0x17')];var _0x43c10e=_0x253347?_0x24bb89[_0x876b('0x1a')]:_0x2b5823[_0x876b('0x17')]+_0x2b5823[_0x876b('0x19')];var _0x242b30;if(_0x43c10e>=_0x49bb28){_0x43c10e=_0x49bb28;_0x242b30=0xc8;}else{_0x242b30=0xce;}_0x42c66d[_0x876b('0x16')](_0x242b30);return _0x42c66d[_0x876b('0x1b')](_0x876b('0x1c'),_0x1ff3a4+'-'+_0x43c10e+'/'+_0x49bb28)[_0x876b('0x1d')](_0x24bb89);}return null;};}function patchUpdates(_0x358616){return function(_0x3e47eb){try{jsonpatch[_0x876b('0x1e')](_0x3e47eb,_0x358616,!![]);}catch(_0x578856){return BPromise[_0x876b('0x1f')](_0x578856);}return _0x3e47eb[_0x876b('0x20')]();};}function saveUpdates(_0x255d12,_0xf9cfda){return function(_0x4aae9c){if(_0x4aae9c){return _0x4aae9c[_0x876b('0x21')](_0x255d12)['then'](function(_0x29440b){return _0x29440b;});}return null;};}function removeEntity(_0x131cfa,_0x241d33){return function(_0xf6fa79){if(_0xf6fa79){return _0xf6fa79[_0x876b('0x22')]()['then'](function(){_0x131cfa[_0x876b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x527fdb,_0x272036){return function(_0x4e3bca){if(!_0x4e3bca){_0x527fdb[_0x876b('0x15')](0x194);}return _0x4e3bca;};}function handleError(_0x3d8d11,_0x38ab7c){_0x38ab7c=_0x38ab7c||0x1f4;return function(_0x3bc66e){logger['error'](_0x3bc66e[_0x876b('0x23')]);if(_0x3bc66e['name']){delete _0x3bc66e[_0x876b('0x24')];}_0x3d8d11[_0x876b('0x16')](_0x38ab7c)[_0x876b('0x25')](_0x3bc66e);};}exports[_0x876b('0x26')]=function(_0xdb2321,_0x246462){var _0xbc6141={},_0x5b9a99={},_0x345998={'count':0x0,'rows':[]};var _0x39f6bd=_[_0x876b('0x27')](db[_0x876b('0x28')]['rawAttributes'],function(_0x10db66){return{'name':_0x10db66[_0x876b('0x29')],'type':_0x10db66[_0x876b('0x2a')][_0x876b('0x2b')]};});_0x5b9a99[_0x876b('0x2c')]=_['map'](_0x39f6bd,_0x876b('0x24'));_0x5b9a99['query']=_[_0x876b('0x2d')](_0xdb2321['query']);_0x5b9a99[_0x876b('0x2e')]=_[_0x876b('0x2f')](_0x5b9a99[_0x876b('0x2c')],_0x5b9a99[_0x876b('0x30')]);_0xbc6141[_0x876b('0x31')]=_[_0x876b('0x2f')](_0x5b9a99[_0x876b('0x2c')],qs['fields'](_0xdb2321[_0x876b('0x30')][_0x876b('0x32')]));_0xbc6141['attributes']=_0xbc6141[_0x876b('0x31')][_0x876b('0x33')]?_0xbc6141[_0x876b('0x31')]:_0x5b9a99[_0x876b('0x2c')];if(!_0xdb2321[_0x876b('0x30')][_0x876b('0x34')]('nolimit')){_0xbc6141['limit']=qs[_0x876b('0x19')](_0xdb2321['query'][_0x876b('0x19')]);_0xbc6141[_0x876b('0x17')]=qs[_0x876b('0x17')](_0xdb2321[_0x876b('0x30')][_0x876b('0x17')]);}_0xbc6141[_0x876b('0x35')]=qs[_0x876b('0x36')](_0xdb2321[_0x876b('0x30')][_0x876b('0x36')]);_0xbc6141[_0x876b('0x37')]=qs[_0x876b('0x2e')](_[_0x876b('0x38')](_0xdb2321[_0x876b('0x30')],_0x5b9a99[_0x876b('0x2e')]),_0x39f6bd);if(_0xdb2321['query'][_0x876b('0x39')]){_0xbc6141[_0x876b('0x37')]=_[_0x876b('0x3a')](_0xbc6141['where'],{'$or':_['map'](_0x39f6bd,function(_0x976a0c){if(_0x976a0c[_0x876b('0x2a')]!==_0x876b('0x3b')){var _0x189db7={};_0x189db7[_0x976a0c[_0x876b('0x24')]]={'$like':'%'+_0xdb2321['query'][_0x876b('0x39')]+'%'};return _0x189db7;}})});}_0xbc6141=_[_0x876b('0x3a')]({},_0xbc6141,_0xdb2321[_0x876b('0x3c')]);var _0x13cf46={'where':_0xbc6141[_0x876b('0x37')]};return db['AnalyticTreeReport'][_0x876b('0x1a')](_0x13cf46)[_0x876b('0x3d')](function(_0x4bfbd2){_0x345998[_0x876b('0x1a')]=_0x4bfbd2;if(_0xdb2321[_0x876b('0x30')]['includeAll']){_0xbc6141[_0x876b('0x3e')]=[{'all':!![]}];}return db[_0x876b('0x28')]['findAll'](_0xbc6141);})['then'](function(_0x5a8f68){_0x345998[_0x876b('0x3f')]=_0x5a8f68;return _0x345998;})['then'](respondWithFilteredResult(_0x246462,_0xbc6141))['catch'](handleError(_0x246462,null));};exports[_0x876b('0x40')]=function(_0x2005fe,_0x20ebc5){var _0x3ad1a2={'raw':!![],'where':{'id':_0x2005fe[_0x876b('0x41')]['id']}},_0x49ae50={};_0x49ae50[_0x876b('0x2c')]=_[_0x876b('0x2d')](db[_0x876b('0x28')][_0x876b('0x42')]);_0x49ae50['query']=_['keys'](_0x2005fe[_0x876b('0x30')]);_0x49ae50[_0x876b('0x2e')]=_['intersection'](_0x49ae50[_0x876b('0x2c')],_0x49ae50['query']);_0x3ad1a2[_0x876b('0x31')]=_[_0x876b('0x2f')](_0x49ae50[_0x876b('0x2c')],qs['fields'](_0x2005fe[_0x876b('0x30')][_0x876b('0x32')]));_0x3ad1a2[_0x876b('0x31')]=_0x3ad1a2['attributes'][_0x876b('0x33')]?_0x3ad1a2[_0x876b('0x31')]:_0x49ae50['model'];if(_0x2005fe[_0x876b('0x30')][_0x876b('0x43')]){_0x3ad1a2[_0x876b('0x3e')]=[{'all':!![]}];}_0x3ad1a2=_[_0x876b('0x3a')]({},_0x3ad1a2,_0x2005fe[_0x876b('0x3c')]);return db['AnalyticTreeReport'][_0x876b('0x44')](_0x3ad1a2)[_0x876b('0x3d')](handleEntityNotFound(_0x20ebc5,null))[_0x876b('0x3d')](respondWithResult(_0x20ebc5,null))['catch'](handleError(_0x20ebc5,null));};exports[_0x876b('0x45')]=function(_0x132141,_0x546669){return db['AnalyticTreeReport'][_0x876b('0x45')](_0x132141['body'],{})['then'](respondWithResult(_0x546669,0xc9))[_0x876b('0x46')](handleError(_0x546669,null));};exports['update']=function(_0x47e451,_0x51f023){if(_0x47e451[_0x876b('0x47')]['id']){delete _0x47e451[_0x876b('0x47')]['id'];}return db[_0x876b('0x28')][_0x876b('0x44')]({'where':{'id':_0x47e451['params']['id']}})[_0x876b('0x3d')](handleEntityNotFound(_0x51f023,null))[_0x876b('0x3d')](saveUpdates(_0x47e451[_0x876b('0x47')],null))[_0x876b('0x3d')](respondWithResult(_0x51f023,null))[_0x876b('0x46')](handleError(_0x51f023,null));};exports['destroy']=function(_0x5237f2,_0x2ed546){return db[_0x876b('0x28')][_0x876b('0x44')]({'where':{'id':_0x5237f2['params']['id']}})[_0x876b('0x3d')](handleEntityNotFound(_0x2ed546,null))[_0x876b('0x3d')](removeEntity(_0x2ed546,null))[_0x876b('0x46')](handleError(_0x2ed546,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 0c73d0f..5dc2ebb 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 _0xab03=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x40a58a,_0x1dfcdf){var _0x58106f=function(_0x30b369){while(--_0x30b369){_0x40a58a['push'](_0x40a58a['shift']());}};_0x58106f(++_0x1dfcdf);}(_0xab03,0x196));var _0x3ab0=function(_0x223035,_0xbdad82){_0x223035=_0x223035-0x0;var _0x3d2958=_0xab03[_0x223035];return _0x3d2958;};'use strict';var _=require(_0x3ab0('0x0'));var util=require(_0x3ab0('0x1'));var logger=require('../../config/logger')(_0x3ab0('0x2'));var moment=require(_0x3ab0('0x3'));var BPromise=require(_0x3ab0('0x4'));var rp=require(_0x3ab0('0x5'));var fs=require('fs');var path=require(_0x3ab0('0x6'));var rimraf=require('rimraf');var config=require(_0x3ab0('0x7'));var attributes=require(_0x3ab0('0x8'));module[_0x3ab0('0x9')]=function(_0x2ab3be,_0x241f30){return _0x2ab3be[_0x3ab0('0xa')](_0x3ab0('0xb'),attributes,{'tableName':_0x3ab0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x14b4=['rimraf','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x578887,_0x5b9cb7){var _0x3a61d3=function(_0x1117a2){while(--_0x1117a2){_0x578887['push'](_0x578887['shift']());}};_0x3a61d3(++_0x5b9cb7);}(_0x14b4,0xf5));var _0x414b=function(_0x5d851d,_0x53c51c){_0x5d851d=_0x5d851d-0x0;var _0xbaaa92=_0x14b4[_0x5d851d];return _0xbaaa92;};'use strict';var _=require(_0x414b('0x0'));var util=require(_0x414b('0x1'));var logger=require(_0x414b('0x2'))(_0x414b('0x3'));var moment=require(_0x414b('0x4'));var BPromise=require(_0x414b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x414b('0x6'));var rimraf=require(_0x414b('0x7'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x414b('0x8')]=function(_0x213a71,_0x42387e){return _0x213a71[_0x414b('0x9')](_0x414b('0xa'),attributes,{'tableName':_0x414b('0xb'),'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 ab9d212..3324c6f 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x4da137,_0x5eb38c){var _0x34fa68=function(_0x367529){while(--_0x367529){_0x4da137['push'](_0x4da137['shift']());}};_0x34fa68(++_0x5eb38c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xc4aa[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x33512d,_0xffdcfd){var _0x5803a3=function(_0x2c0423){while(--_0x2c0423){_0x33512d['push'](_0x33512d['shift']());}};_0x5803a3(++_0xffdcfd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index e7c0ae8..ddb7fef 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 _0xce0a=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','update','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x450865,_0x46391a){var _0x4cb11a=function(_0x56dd61){while(--_0x56dd61){_0x450865['push'](_0x450865['shift']());}};_0x4cb11a(++_0x46391a);}(_0xce0a,0x8f));var _0xace0=function(_0x31c27f,_0x40294c){_0x31c27f=_0x31c27f-0x0;var _0x28f9c6=_0xce0a[_0x31c27f];return _0x28f9c6;};'use strict';var multer=require(_0xace0('0x0'));var util=require(_0xace0('0x1'));var path=require(_0xace0('0x2'));var timeout=require(_0xace0('0x3'));var express=require('express');var router=express[_0xace0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xace0('0x5'));var config=require(_0xace0('0x6'));var controller=require(_0xace0('0x7'));router[_0xace0('0x8')]('/',auth[_0xace0('0x9')](),controller[_0xace0('0xa')]);router[_0xace0('0x8')](_0xace0('0xb'),auth[_0xace0('0x9')](),controller[_0xace0('0xc')]);router['post']('/',auth[_0xace0('0x9')](),controller['create']);router['put'](_0xace0('0xb'),auth['isAuthenticated'](),controller[_0xace0('0xd')]);router['delete'](_0xace0('0xb'),auth[_0xace0('0x9')](),controller['destroy']);module[_0xace0('0xe')]=router;
\ No newline at end of file
+var _0x9cd9=['put','update','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create'];(function(_0x4c5e97,_0x28dc00){var _0x45c31e=function(_0x815abb){while(--_0x815abb){_0x4c5e97['push'](_0x4c5e97['shift']());}};_0x45c31e(++_0x28dc00);}(_0x9cd9,0x1b5));var _0x99cd=function(_0xdfbcb0,_0x5242ae){_0xdfbcb0=_0xdfbcb0-0x0;var _0x544e9d=_0x9cd9[_0xdfbcb0];return _0x544e9d;};'use strict';var multer=require('multer');var util=require(_0x99cd('0x0'));var path=require(_0x99cd('0x1'));var timeout=require(_0x99cd('0x2'));var express=require(_0x99cd('0x3'));var router=express['Router']();var fs_extra=require(_0x99cd('0x4'));var auth=require(_0x99cd('0x5'));var interaction=require(_0x99cd('0x6'));var config=require(_0x99cd('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x99cd('0x8')]('/',auth[_0x99cd('0x9')](),controller[_0x99cd('0xa')]);router[_0x99cd('0x8')]('/:id',auth[_0x99cd('0x9')](),controller[_0x99cd('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x99cd('0xc')]);router[_0x99cd('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x99cd('0xe')]);router['delete'](_0x99cd('0xf'),auth[_0x99cd('0x9')](),controller[_0x99cd('0x10')]);module[_0x99cd('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 0b6e875..4d42af9 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 _0xa049=['STRING','sequelize','exports'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xa049,0x1db));var _0x9a04=function(_0x504582,_0x5b3965){_0x504582=_0x504582-0x0;var _0x43c6ce=_0xa049[_0x504582];return _0x43c6ce;};'use strict';var Sequelize=require(_0x9a04('0x0'));module[_0x9a04('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x9a04('0x2')]},'type':{'type':Sequelize[_0x9a04('0x2')]}};
\ No newline at end of file
+var _0x98a7=['exports','STRING','sequelize'];(function(_0x13e7ab,_0x5cc02b){var _0xf7e10=function(_0x1edaeb){while(--_0x1edaeb){_0x13e7ab['push'](_0x13e7ab['shift']());}};_0xf7e10(++_0x5cc02b);}(_0x98a7,0x9e));var _0x798a=function(_0x505e07,_0x4e53e8){_0x505e07=_0x505e07-0x0;var _0x2a948a=_0x98a7[_0x505e07];return _0x2a948a;};'use strict';var Sequelize=require(_0x798a('0x0'));module[_0x798a('0x1')]={'name':{'type':Sequelize[_0x798a('0x2')]},'basename':{'type':Sequelize[_0x798a('0x2')]},'type':{'type':Sequelize[_0x798a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 28375c3..368853b 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 _0x3da9=['undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','type','VIRTUAL','options','Attachment','includeAll','rows','show','params','include','find','catch','clone','merge','get','omit','createdAt','updatedAt','body','create','originalname','file','filename','findOne','root','offline-chat/','basename','download','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x87898f,_0x52c7ac){var _0x3a48f0=function(_0x2fdbe8){while(--_0x2fdbe8){_0x87898f['push'](_0x87898f['shift']());}};_0x3a48f0(++_0x52c7ac);}(_0x3da9,0xeb));var _0x93da=function(_0x37cbcb,_0x11161d){_0x37cbcb=_0x37cbcb-0x0;var _0x4fc549=_0x3da9[_0x37cbcb];return _0x4fc549;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x93da('0x0'));var zipdir=require(_0x93da('0x1'));var jsonpatch=require(_0x93da('0x2'));var rp=require('request-promise');var moment=require(_0x93da('0x3'));var BPromise=require(_0x93da('0x4'));var Mustache=require(_0x93da('0x5'));var util=require(_0x93da('0x6'));var path=require(_0x93da('0x7'));var sox=require(_0x93da('0x8'));var csv=require('to-csv');var ejs=require(_0x93da('0x9'));var fs=require('fs');var fs_extra=require(_0x93da('0xa'));var _=require(_0x93da('0xb'));var squel=require(_0x93da('0xc'));var crypto=require('crypto');var jsforce=require(_0x93da('0xd'));var deskjs=require(_0x93da('0xe'));var toCsv=require(_0x93da('0xf'));var querystring=require(_0x93da('0x10'));var Papa=require(_0x93da('0x11'));var Redis=require(_0x93da('0x12'));var authService=require(_0x93da('0x13'));var qs=require(_0x93da('0x14'));var as=require(_0x93da('0x15'));var hardwareService=require(_0x93da('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x93da('0x17'));var config=require(_0x93da('0x18'));var licenseUtil=require(_0x93da('0x19'));var db=require(_0x93da('0x1a'))['db'];function respondWithStatusCode(_0x5918ad,_0x198e8d){_0x198e8d=_0x198e8d||0xcc;return function(_0x261922){if(_0x261922){return _0x5918ad[_0x93da('0x1b')](_0x198e8d);}return _0x5918ad[_0x93da('0x1c')](_0x198e8d)[_0x93da('0x1d')]();};}function respondWithResult(_0x4cb859,_0x489c6b){_0x489c6b=_0x489c6b||0xc8;return function(_0x1d02b8){if(_0x1d02b8){return _0x4cb859[_0x93da('0x1c')](_0x489c6b)[_0x93da('0x1e')](_0x1d02b8);}};}function respondWithFilteredResult(_0x4b9fb2,_0x8cb76d){return function(_0x28cbb9){if(_0x28cbb9){var _0x23d523=typeof _0x8cb76d[_0x93da('0x1f')]===_0x93da('0x20')&&typeof _0x8cb76d[_0x93da('0x21')]===_0x93da('0x20');var _0x15a7ec=_0x28cbb9[_0x93da('0x22')];var _0x3768e1=_0x23d523?0x0:_0x8cb76d['offset'];var _0x569cdb=_0x23d523?_0x28cbb9['count']:_0x8cb76d[_0x93da('0x1f')]+_0x8cb76d[_0x93da('0x21')];var _0x5b3eb9;if(_0x569cdb>=_0x15a7ec){_0x569cdb=_0x15a7ec;_0x5b3eb9=0xc8;}else{_0x5b3eb9=0xce;}_0x4b9fb2[_0x93da('0x1c')](_0x5b3eb9);return _0x4b9fb2['set'](_0x93da('0x23'),_0x3768e1+'-'+_0x569cdb+'/'+_0x15a7ec)[_0x93da('0x1e')](_0x28cbb9);}return null;};}function patchUpdates(_0x15d6d1){return function(_0x1b3ee1){try{jsonpatch[_0x93da('0x24')](_0x1b3ee1,_0x15d6d1,!![]);}catch(_0x48ffe4){return BPromise[_0x93da('0x25')](_0x48ffe4);}return _0x1b3ee1[_0x93da('0x26')]();};}function saveUpdates(_0x4a28b,_0x56b219){return function(_0x43a153){if(_0x43a153){return _0x43a153[_0x93da('0x27')](_0x4a28b)[_0x93da('0x28')](function(_0x1a6194){return _0x1a6194;});}return null;};}function removeEntity(_0x54ca65,_0x53968b){return function(_0x6486ed){if(_0x6486ed){return _0x6486ed[_0x93da('0x29')]()[_0x93da('0x28')](function(){_0x54ca65[_0x93da('0x1c')](0xcc)[_0x93da('0x1d')]();});}};}function handleEntityNotFound(_0x212289,_0x2dff5d){return function(_0x29187d){if(!_0x29187d){_0x212289['sendStatus'](0x194);}return _0x29187d;};}function handleError(_0x146593,_0x168620){_0x168620=_0x168620||0x1f4;return function(_0xea0e58){logger[_0x93da('0x2a')](_0xea0e58[_0x93da('0x2b')]);if(_0xea0e58[_0x93da('0x2c')]){delete _0xea0e58[_0x93da('0x2c')];}_0x146593['status'](_0x168620)['send'](_0xea0e58);};}exports[_0x93da('0x2d')]=function(_0xae710c,_0x59072f){var _0x31b715={},_0x363545={},_0x2eed8a={'count':0x0,'rows':[]};var _0x503403=_[_0x93da('0x2e')](db['Attachment'][_0x93da('0x2f')],function(_0x42717b){return{'name':_0x42717b['fieldName'],'type':_0x42717b['type'][_0x93da('0x30')]};});_0x363545[_0x93da('0x31')]=_[_0x93da('0x2e')](_0x503403,_0x93da('0x2c'));_0x363545[_0x93da('0x32')]=_[_0x93da('0x33')](_0xae710c['query']);_0x363545[_0x93da('0x34')]=_[_0x93da('0x35')](_0x363545[_0x93da('0x31')],_0x363545['query']);_0x31b715[_0x93da('0x36')]=_[_0x93da('0x35')](_0x363545[_0x93da('0x31')],qs[_0x93da('0x37')](_0xae710c[_0x93da('0x32')][_0x93da('0x37')]));_0x31b715[_0x93da('0x36')]=_0x31b715['attributes'][_0x93da('0x38')]?_0x31b715[_0x93da('0x36')]:_0x363545['model'];if(!_0xae710c[_0x93da('0x32')]['hasOwnProperty'](_0x93da('0x39'))){_0x31b715[_0x93da('0x21')]=qs['limit'](_0xae710c['query'][_0x93da('0x21')]);_0x31b715[_0x93da('0x1f')]=qs[_0x93da('0x1f')](_0xae710c['query'][_0x93da('0x1f')]);}_0x31b715['order']=qs[_0x93da('0x3a')](_0xae710c['query'][_0x93da('0x3a')]);_0x31b715[_0x93da('0x3b')]=qs[_0x93da('0x34')](_[_0x93da('0x3c')](_0xae710c[_0x93da('0x32')],_0x363545['filters']),_0x503403);if(_0xae710c['query'][_0x93da('0x3d')]){_0x31b715[_0x93da('0x3b')]=_['merge'](_0x31b715[_0x93da('0x3b')],{'$or':_[_0x93da('0x2e')](_0x503403,function(_0x167af0){if(_0x167af0[_0x93da('0x3e')]!==_0x93da('0x3f')){var _0x1b76d0={};_0x1b76d0[_0x167af0[_0x93da('0x2c')]]={'$like':'%'+_0xae710c['query']['filter']+'%'};return _0x1b76d0;}})});}_0x31b715=_['merge']({},_0x31b715,_0xae710c[_0x93da('0x40')]);var _0x30494f={'where':_0x31b715['where']};return db[_0x93da('0x41')]['count'](_0x30494f)[_0x93da('0x28')](function(_0x2228e5){_0x2eed8a[_0x93da('0x22')]=_0x2228e5;if(_0xae710c[_0x93da('0x32')][_0x93da('0x42')]){_0x31b715['include']=[{'all':!![]}];}return db[_0x93da('0x41')]['findAll'](_0x31b715);})[_0x93da('0x28')](function(_0x2024fc){_0x2eed8a[_0x93da('0x43')]=_0x2024fc;return _0x2eed8a;})['then'](respondWithFilteredResult(_0x59072f,_0x31b715))['catch'](handleError(_0x59072f,null));};exports[_0x93da('0x44')]=function(_0x1776f6,_0x2b8b2a){var _0x22ac0e={'raw':!![],'where':{'id':_0x1776f6[_0x93da('0x45')]['id']}},_0x32c14a={};_0x32c14a['model']=_[_0x93da('0x33')](db[_0x93da('0x41')][_0x93da('0x2f')]);_0x32c14a[_0x93da('0x32')]=_['keys'](_0x1776f6[_0x93da('0x32')]);_0x32c14a[_0x93da('0x34')]=_[_0x93da('0x35')](_0x32c14a[_0x93da('0x31')],_0x32c14a['query']);_0x22ac0e[_0x93da('0x36')]=_[_0x93da('0x35')](_0x32c14a[_0x93da('0x31')],qs[_0x93da('0x37')](_0x1776f6[_0x93da('0x32')][_0x93da('0x37')]));_0x22ac0e[_0x93da('0x36')]=_0x22ac0e[_0x93da('0x36')]['length']?_0x22ac0e[_0x93da('0x36')]:_0x32c14a[_0x93da('0x31')];if(_0x1776f6['query']['includeAll']){_0x22ac0e[_0x93da('0x46')]=[{'all':!![]}];}_0x22ac0e=_['merge']({},_0x22ac0e,_0x1776f6[_0x93da('0x40')]);return db[_0x93da('0x41')][_0x93da('0x47')](_0x22ac0e)[_0x93da('0x28')](handleEntityNotFound(_0x2b8b2a,null))[_0x93da('0x28')](respondWithResult(_0x2b8b2a,null))[_0x93da('0x48')](handleError(_0x2b8b2a,null));};exports[_0x93da('0x49')]=function(_0x14029d,_0x49545f){var _0x495f49={'where':{'id':_0x14029d[_0x93da('0x45')]['id']}},_0x1c43b8={};_0x1c43b8[_0x93da('0x31')]=_[_0x93da('0x33')](db[_0x93da('0x41')][_0x93da('0x2f')]);_0x495f49[_0x93da('0x36')]=_[_0x93da('0x35')](_0x1c43b8[_0x93da('0x31')],qs[_0x93da('0x37')](_0x14029d[_0x93da('0x32')]['fields']));_0x495f49[_0x93da('0x36')]=_0x495f49[_0x93da('0x36')][_0x93da('0x38')]?_0x495f49['attributes']:_0x1c43b8[_0x93da('0x31')];if(_0x14029d[_0x93da('0x32')][_0x93da('0x42')]){_0x495f49[_0x93da('0x46')]=[{'all':!![]}];}_0x495f49=_[_0x93da('0x4a')]({},_0x495f49,_0x14029d[_0x93da('0x40')]);return db[_0x93da('0x41')][_0x93da('0x47')](_0x495f49)[_0x93da('0x28')](handleEntityNotFound(_0x49545f,null))[_0x93da('0x28')](function(_0x566ecc){if(_0x566ecc){var _0x50f364=_0x566ecc[_0x93da('0x4b')]({'plain':!![]});_0x50f364=qs[_0x93da('0x4c')](_0x50f364,['id',_0x93da('0x4d'),_0x93da('0x4e')]);_0x14029d[_0x93da('0x4f')]=_['omit'](_0x14029d[_0x93da('0x4f')],['id',_0x93da('0x4d'),'updatedAt']);return db[_0x93da('0x41')][_0x93da('0x50')](_[_0x93da('0x4a')](_0x50f364,_0x14029d[_0x93da('0x4f')]),{'include':_0x14029d['query'][_0x93da('0x42')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x49545f,0xc9))['catch'](handleError(_0x49545f,null));};exports[_0x93da('0x27')]=function(_0x41b3f1,_0x1c629b){if(_0x41b3f1[_0x93da('0x4f')]['id']){delete _0x41b3f1['body']['id'];}return db[_0x93da('0x41')]['find']({'where':{'id':_0x41b3f1[_0x93da('0x45')]['id']}})[_0x93da('0x28')](handleEntityNotFound(_0x1c629b,null))[_0x93da('0x28')](saveUpdates(_0x41b3f1['body'],null))[_0x93da('0x28')](respondWithResult(_0x1c629b,null))['catch'](handleError(_0x1c629b,null));};exports[_0x93da('0x29')]=function(_0x158f76,_0x16f5e5){return db[_0x93da('0x41')]['find']({'where':{'id':_0x158f76[_0x93da('0x45')]['id']}})[_0x93da('0x28')](handleEntityNotFound(_0x16f5e5,null))[_0x93da('0x28')](removeEntity(_0x16f5e5,null))[_0x93da('0x48')](handleError(_0x16f5e5,null));};exports['create']=function(_0x287317,_0x4ab71f,_0x47dd5b){_0x287317[_0x93da('0x4f')][_0x93da('0x2c')]=_0x287317['file'][_0x93da('0x51')];_0x287317[_0x93da('0x4f')]['basename']=_0x287317[_0x93da('0x52')][_0x93da('0x53')];_0x287317[_0x93da('0x4f')][_0x93da('0x3e')]=_0x287317[_0x93da('0x52')]['mimetype'];return db[_0x93da('0x41')][_0x93da('0x50')](_0x287317[_0x93da('0x4f')])['then'](respondWithResult(_0x4ab71f,0xc9))[_0x93da('0x48')](handleError(_0x4ab71f,null));};exports['download']=function(_0xe5c385,_0x3250d9,_0x2dabf9){return db[_0x93da('0x41')][_0x93da('0x54')]({'where':{'id':_0xe5c385['params']['id']},'raw':!![]})[_0x93da('0x28')](handleEntityNotFound(_0x3250d9,null))[_0x93da('0x28')](function(_0x3065b7){if(_0x3065b7){var _0x5443c5=_0x3065b7['ChatOfflineMessageId']!==null;var _0x4bc9d3=path['join'](config[_0x93da('0x55')],'server/files/attachments/');if(_0x5443c5){_0x4bc9d3=path['join'](_0x4bc9d3,_0x93da('0x56'));}var _0x42f732=path['join'](_0x4bc9d3,_0x3065b7[_0x93da('0x57')]);return _0x3250d9[_0x93da('0x58')](_0x42f732);}})['catch'](handleError(_0x3250d9,null));};
\ No newline at end of file
+var _0x7440=['map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','length','Attachment','find','clone','options','get','updatedAt','body','createdAt','create','params','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','undefined','offset','apply','reject','save','update','then','destroy','error','name','send','index'];(function(_0x5cbd7b,_0x207439){var _0x3fdfb8=function(_0x4eb12e){while(--_0x4eb12e){_0x5cbd7b['push'](_0x5cbd7b['shift']());}};_0x3fdfb8(++_0x207439);}(_0x7440,0x91));var _0x0744=function(_0x592d67,_0x34dd9b){_0x592d67=_0x592d67-0x0;var _0x533078=_0x7440[_0x592d67];return _0x533078;};'use strict';var emlformat=require(_0x0744('0x0'));var rimraf=require(_0x0744('0x1'));var zipdir=require(_0x0744('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0744('0x3'));var BPromise=require(_0x0744('0x4'));var Mustache=require(_0x0744('0x5'));var util=require(_0x0744('0x6'));var path=require(_0x0744('0x7'));var sox=require(_0x0744('0x8'));var csv=require(_0x0744('0x9'));var ejs=require(_0x0744('0xa'));var fs=require('fs');var fs_extra=require(_0x0744('0xb'));var _=require(_0x0744('0xc'));var squel=require(_0x0744('0xd'));var crypto=require('crypto');var jsforce=require(_0x0744('0xe'));var deskjs=require(_0x0744('0xf'));var toCsv=require(_0x0744('0x9'));var querystring=require(_0x0744('0x10'));var Papa=require(_0x0744('0x11'));var Redis=require(_0x0744('0x12'));var authService=require(_0x0744('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0744('0x14'));var hardwareService=require(_0x0744('0x15'));var logger=require(_0x0744('0x16'))(_0x0744('0x17'));var utils=require(_0x0744('0x18'));var config=require(_0x0744('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41b8d0,_0x48bcb9){_0x48bcb9=_0x48bcb9||0xcc;return function(_0x125e9b){if(_0x125e9b){return _0x41b8d0[_0x0744('0x1a')](_0x48bcb9);}return _0x41b8d0[_0x0744('0x1b')](_0x48bcb9)[_0x0744('0x1c')]();};}function respondWithResult(_0x5b5444,_0x4b65c7){_0x4b65c7=_0x4b65c7||0xc8;return function(_0x2617e8){if(_0x2617e8){return _0x5b5444['status'](_0x4b65c7)[_0x0744('0x1d')](_0x2617e8);}};}function respondWithFilteredResult(_0x45fe22,_0x28fc24){return function(_0x331db0){if(_0x331db0){var _0x42f47d=typeof _0x28fc24['offset']==='undefined'&&typeof _0x28fc24[_0x0744('0x1e')]===_0x0744('0x1f');var _0x4ef20f=_0x331db0['count'];var _0x4a4dda=_0x42f47d?0x0:_0x28fc24[_0x0744('0x20')];var _0x51266f=_0x42f47d?_0x331db0['count']:_0x28fc24[_0x0744('0x20')]+_0x28fc24[_0x0744('0x1e')];var _0x5140cf;if(_0x51266f>=_0x4ef20f){_0x51266f=_0x4ef20f;_0x5140cf=0xc8;}else{_0x5140cf=0xce;}_0x45fe22[_0x0744('0x1b')](_0x5140cf);return _0x45fe22['set']('Content-Range',_0x4a4dda+'-'+_0x51266f+'/'+_0x4ef20f)['json'](_0x331db0);}return null;};}function patchUpdates(_0x1a2917){return function(_0x1ce727){try{jsonpatch[_0x0744('0x21')](_0x1ce727,_0x1a2917,!![]);}catch(_0x3f16d4){return BPromise[_0x0744('0x22')](_0x3f16d4);}return _0x1ce727[_0x0744('0x23')]();};}function saveUpdates(_0x263a1d,_0xdb456f){return function(_0x2a5cd7){if(_0x2a5cd7){return _0x2a5cd7[_0x0744('0x24')](_0x263a1d)[_0x0744('0x25')](function(_0x4d46ba){return _0x4d46ba;});}return null;};}function removeEntity(_0x2115c9,_0x5c7510){return function(_0x4da666){if(_0x4da666){return _0x4da666[_0x0744('0x26')]()[_0x0744('0x25')](function(){_0x2115c9[_0x0744('0x1b')](0xcc)[_0x0744('0x1c')]();});}};}function handleEntityNotFound(_0x5efac8,_0x4a5e8f){return function(_0x51f2f3){if(!_0x51f2f3){_0x5efac8[_0x0744('0x1a')](0x194);}return _0x51f2f3;};}function handleError(_0x166989,_0x4e882f){_0x4e882f=_0x4e882f||0x1f4;return function(_0x5078de){logger[_0x0744('0x27')](_0x5078de['stack']);if(_0x5078de[_0x0744('0x28')]){delete _0x5078de['name'];}_0x166989['status'](_0x4e882f)[_0x0744('0x29')](_0x5078de);};}exports[_0x0744('0x2a')]=function(_0x1e66d0,_0x5deea0){var _0x37d2a5={},_0x4233d0={},_0xe647cb={'count':0x0,'rows':[]};var _0x1077f0=_[_0x0744('0x2b')](db['Attachment'][_0x0744('0x2c')],function(_0x17a87c){return{'name':_0x17a87c[_0x0744('0x2d')],'type':_0x17a87c['type'][_0x0744('0x2e')]};});_0x4233d0[_0x0744('0x2f')]=_['map'](_0x1077f0,_0x0744('0x28'));_0x4233d0[_0x0744('0x30')]=_[_0x0744('0x31')](_0x1e66d0[_0x0744('0x30')]);_0x4233d0[_0x0744('0x32')]=_[_0x0744('0x33')](_0x4233d0[_0x0744('0x2f')],_0x4233d0[_0x0744('0x30')]);_0x37d2a5['attributes']=_[_0x0744('0x33')](_0x4233d0[_0x0744('0x2f')],qs[_0x0744('0x34')](_0x1e66d0[_0x0744('0x30')][_0x0744('0x34')]));_0x37d2a5['attributes']=_0x37d2a5[_0x0744('0x35')]['length']?_0x37d2a5[_0x0744('0x35')]:_0x4233d0[_0x0744('0x2f')];if(!_0x1e66d0[_0x0744('0x30')][_0x0744('0x36')](_0x0744('0x37'))){_0x37d2a5[_0x0744('0x1e')]=qs[_0x0744('0x1e')](_0x1e66d0[_0x0744('0x30')]['limit']);_0x37d2a5['offset']=qs[_0x0744('0x20')](_0x1e66d0[_0x0744('0x30')][_0x0744('0x20')]);}_0x37d2a5[_0x0744('0x38')]=qs[_0x0744('0x39')](_0x1e66d0[_0x0744('0x30')][_0x0744('0x39')]);_0x37d2a5[_0x0744('0x3a')]=qs['filters'](_[_0x0744('0x3b')](_0x1e66d0['query'],_0x4233d0['filters']),_0x1077f0);if(_0x1e66d0['query'][_0x0744('0x3c')]){_0x37d2a5['where']=_[_0x0744('0x3d')](_0x37d2a5[_0x0744('0x3a')],{'$or':_[_0x0744('0x2b')](_0x1077f0,function(_0x10f718){if(_0x10f718[_0x0744('0x3e')]!==_0x0744('0x3f')){var _0x504f0d={};_0x504f0d[_0x10f718[_0x0744('0x28')]]={'$like':'%'+_0x1e66d0[_0x0744('0x30')][_0x0744('0x3c')]+'%'};return _0x504f0d;}})});}_0x37d2a5=_[_0x0744('0x3d')]({},_0x37d2a5,_0x1e66d0['options']);var _0x3848b8={'where':_0x37d2a5[_0x0744('0x3a')]};return db['Attachment'][_0x0744('0x40')](_0x3848b8)[_0x0744('0x25')](function(_0x3b7e26){_0xe647cb[_0x0744('0x40')]=_0x3b7e26;if(_0x1e66d0[_0x0744('0x30')][_0x0744('0x41')]){_0x37d2a5[_0x0744('0x42')]=[{'all':!![]}];}return db['Attachment'][_0x0744('0x43')](_0x37d2a5);})[_0x0744('0x25')](function(_0x2b8250){_0xe647cb[_0x0744('0x44')]=_0x2b8250;return _0xe647cb;})[_0x0744('0x25')](respondWithFilteredResult(_0x5deea0,_0x37d2a5))[_0x0744('0x45')](handleError(_0x5deea0,null));};exports[_0x0744('0x46')]=function(_0x2ce959,_0xcfee70){var _0x3cd33f={'raw':!![],'where':{'id':_0x2ce959['params']['id']}},_0x30625b={};_0x30625b[_0x0744('0x2f')]=_[_0x0744('0x31')](db['Attachment']['rawAttributes']);_0x30625b[_0x0744('0x30')]=_['keys'](_0x2ce959[_0x0744('0x30')]);_0x30625b['filters']=_[_0x0744('0x33')](_0x30625b[_0x0744('0x2f')],_0x30625b[_0x0744('0x30')]);_0x3cd33f[_0x0744('0x35')]=_[_0x0744('0x33')](_0x30625b[_0x0744('0x2f')],qs['fields'](_0x2ce959[_0x0744('0x30')]['fields']));_0x3cd33f[_0x0744('0x35')]=_0x3cd33f[_0x0744('0x35')][_0x0744('0x47')]?_0x3cd33f[_0x0744('0x35')]:_0x30625b[_0x0744('0x2f')];if(_0x2ce959[_0x0744('0x30')]['includeAll']){_0x3cd33f['include']=[{'all':!![]}];}_0x3cd33f=_[_0x0744('0x3d')]({},_0x3cd33f,_0x2ce959['options']);return db[_0x0744('0x48')][_0x0744('0x49')](_0x3cd33f)[_0x0744('0x25')](handleEntityNotFound(_0xcfee70,null))['then'](respondWithResult(_0xcfee70,null))[_0x0744('0x45')](handleError(_0xcfee70,null));};exports[_0x0744('0x4a')]=function(_0x1eaa75,_0x2596d4){var _0x150944={'where':{'id':_0x1eaa75['params']['id']}},_0x383c42={};_0x383c42[_0x0744('0x2f')]=_[_0x0744('0x31')](db[_0x0744('0x48')][_0x0744('0x2c')]);_0x150944['attributes']=_['intersection'](_0x383c42[_0x0744('0x2f')],qs[_0x0744('0x34')](_0x1eaa75[_0x0744('0x30')][_0x0744('0x34')]));_0x150944[_0x0744('0x35')]=_0x150944[_0x0744('0x35')][_0x0744('0x47')]?_0x150944[_0x0744('0x35')]:_0x383c42['model'];if(_0x1eaa75[_0x0744('0x30')]['includeAll']){_0x150944['include']=[{'all':!![]}];}_0x150944=_[_0x0744('0x3d')]({},_0x150944,_0x1eaa75[_0x0744('0x4b')]);return db[_0x0744('0x48')][_0x0744('0x49')](_0x150944)[_0x0744('0x25')](handleEntityNotFound(_0x2596d4,null))[_0x0744('0x25')](function(_0x3c018d){if(_0x3c018d){var _0x321f15=_0x3c018d[_0x0744('0x4c')]({'plain':!![]});_0x321f15=qs['omit'](_0x321f15,['id','createdAt',_0x0744('0x4d')]);_0x1eaa75[_0x0744('0x4e')]=_['omit'](_0x1eaa75['body'],['id',_0x0744('0x4f'),'updatedAt']);return db['Attachment'][_0x0744('0x50')](_[_0x0744('0x3d')](_0x321f15,_0x1eaa75[_0x0744('0x4e')]),{'include':_0x1eaa75[_0x0744('0x30')][_0x0744('0x41')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2596d4,0xc9))['catch'](handleError(_0x2596d4,null));};exports[_0x0744('0x24')]=function(_0x4fe8d3,_0x575f15){if(_0x4fe8d3[_0x0744('0x4e')]['id']){delete _0x4fe8d3['body']['id'];}return db[_0x0744('0x48')]['find']({'where':{'id':_0x4fe8d3[_0x0744('0x51')]['id']}})[_0x0744('0x25')](handleEntityNotFound(_0x575f15,null))[_0x0744('0x25')](saveUpdates(_0x4fe8d3[_0x0744('0x4e')],null))[_0x0744('0x25')](respondWithResult(_0x575f15,null))[_0x0744('0x45')](handleError(_0x575f15,null));};exports[_0x0744('0x26')]=function(_0x4bca33,_0x218c2e){return db[_0x0744('0x48')][_0x0744('0x49')]({'where':{'id':_0x4bca33[_0x0744('0x51')]['id']}})[_0x0744('0x25')](handleEntityNotFound(_0x218c2e,null))[_0x0744('0x25')](removeEntity(_0x218c2e,null))[_0x0744('0x45')](handleError(_0x218c2e,null));};exports[_0x0744('0x50')]=function(_0x685264,_0x20da74,_0x5bc3b2){_0x685264['body']['name']=_0x685264[_0x0744('0x52')][_0x0744('0x53')];_0x685264[_0x0744('0x4e')]['basename']=_0x685264['file'][_0x0744('0x54')];_0x685264[_0x0744('0x4e')][_0x0744('0x3e')]=_0x685264[_0x0744('0x52')][_0x0744('0x55')];return db[_0x0744('0x48')][_0x0744('0x50')](_0x685264[_0x0744('0x4e')])[_0x0744('0x25')](respondWithResult(_0x20da74,0xc9))[_0x0744('0x45')](handleError(_0x20da74,null));};exports[_0x0744('0x56')]=function(_0x1ad071,_0x41adec,_0x2bd9e6){return db[_0x0744('0x48')][_0x0744('0x57')]({'where':{'id':_0x1ad071['params']['id']},'raw':!![]})[_0x0744('0x25')](handleEntityNotFound(_0x41adec,null))[_0x0744('0x25')](function(_0x17e5ad){if(_0x17e5ad){var _0x1665c6=_0x17e5ad[_0x0744('0x58')]!==null;var _0x5641f0=path[_0x0744('0x59')](config[_0x0744('0x5a')],_0x0744('0x5b'));if(_0x1665c6){_0x5641f0=path[_0x0744('0x59')](_0x5641f0,_0x0744('0x5c'));}var _0x36d1ba=path[_0x0744('0x59')](_0x5641f0,_0x17e5ad[_0x0744('0x5d')]);return _0x41adec['download'](_0x36d1ba);}})['catch'](handleError(_0x41adec,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 85466aa..a8fd482 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 _0x3483=['rimraf','../../config/environment','./attachment.attributes','exports','Attachment','attachments','lodash','api','moment','bluebird','request-promise'];(function(_0x3121f2,_0x3b6a45){var _0x5d1785=function(_0x34b030){while(--_0x34b030){_0x3121f2['push'](_0x3121f2['shift']());}};_0x5d1785(++_0x3b6a45);}(_0x3483,0x150));var _0x3348=function(_0x5bd6a0,_0x42fe62){_0x5bd6a0=_0x5bd6a0-0x0;var _0x5be3c1=_0x3483[_0x5bd6a0];return _0x5be3c1;};'use strict';var _=require(_0x3348('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3348('0x1'));var moment=require(_0x3348('0x2'));var BPromise=require(_0x3348('0x3'));var rp=require(_0x3348('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3348('0x5'));var config=require(_0x3348('0x6'));var attributes=require(_0x3348('0x7'));module[_0x3348('0x8')]=function(_0x5ec477,_0x118108){return _0x5ec477['define'](_0x3348('0x9'),attributes,{'tableName':_0x3348('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x922e=['rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','../../config/logger','moment','bluebird','path'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x922e,0x103));var _0xe922=function(_0x48f1df,_0x3afca5){_0x48f1df=_0x48f1df-0x0;var _0x294cdd=_0x922e[_0x48f1df];return _0x294cdd;};'use strict';var _=require(_0xe922('0x0'));var util=require('util');var logger=require(_0xe922('0x1'))('api');var moment=require(_0xe922('0x2'));var BPromise=require(_0xe922('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe922('0x4'));var rimraf=require(_0xe922('0x5'));var config=require(_0xe922('0x6'));var attributes=require(_0xe922('0x7'));module['exports']=function(_0xe35e4,_0x421040){return _0xe35e4[_0xe922('0x8')](_0xe922('0x9'),attributes,{'tableName':_0xe922('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 ce24fbe..13d94c8 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 _0xb903=['Attachment,\x20%s,\x20%s','message','info','result','create','options','then','CreateAttachment','debug','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x55df9b,_0x256647){var _0x1859cd=function(_0x20e23e){while(--_0x20e23e){_0x55df9b['push'](_0x55df9b['shift']());}};_0x1859cd(++_0x256647);}(_0xb903,0x185));var _0x3b90=function(_0x1c5e30,_0x4e5b0e){_0x1c5e30=_0x1c5e30-0x0;var _0x4880b5=_0xb903[_0x1c5e30];return _0x4880b5;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('Attachment,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});}exports['CreateAttachment']=function(_0x269488){var _0x3cf281=this;return new Promise(function(_0x11ad7d,_0x131f3f){return db['Attachment'][_0x3b90('0x14')](_0x269488['body'],{'raw':_0x269488[_0x3b90('0x15')]?_0x269488[_0x3b90('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x3b90('0x16')](function(_0x12e1cf){logger[_0x3b90('0x12')](_0x3b90('0x17'),_0x269488);logger[_0x3b90('0x18')](_0x3b90('0x17'),_0x269488,JSON[_0x3b90('0x19')](_0x12e1cf));_0x11ad7d(_0x12e1cf);})[_0x3b90('0x1a')](function(_0xa98414){logger[_0x3b90('0xf')]('CreateAttachment',_0xa98414[_0x3b90('0x11')],_0x269488);_0x131f3f(_0x3cf281[_0x3b90('0xf')](0x1f4,_0xa98414[_0x3b90('0x11')]));});});};
\ No newline at end of file
+var _0x89e8=['then','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','create','options'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x89e8,0x74));var _0x889e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x89e8[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x889e('0x0'));var util=require(_0x889e('0x1'));var moment=require(_0x889e('0x2'));var BPromise=require(_0x889e('0x3'));var rs=require(_0x889e('0x4'));var fs=require('fs');var Redis=require(_0x889e('0x5'));var db=require(_0x889e('0x6'))['db'];var utils=require(_0x889e('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x889e('0x8'));var client=jayson[_0x889e('0x9')][_0x889e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed85f,_0x38eeae,_0x54f734){return new BPromise(function(_0x2bfae4,_0x42be62){return client[_0x889e('0xb')](_0x5ed85f,_0x54f734)['then'](function(_0x21c1d9){logger[_0x889e('0xc')](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));logger['debug'](_0x889e('0xf'),_0x38eeae,_0x889e('0xe'),JSON['stringify'](_0x21c1d9));if(_0x21c1d9[_0x889e('0x10')]){if(_0x21c1d9[_0x889e('0x10')][_0x889e('0x11')]===0x1f4){logger[_0x889e('0x10')]('Attachment,\x20%s,\x20%s',_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x42be62(_0x21c1d9[_0x889e('0x10')]['message']);}logger[_0x889e('0x10')](_0x889e('0xd'),_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x2bfae4(_0x21c1d9[_0x889e('0x10')]['message']);}else{logger['info'](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));_0x2bfae4(_0x21c1d9[_0x889e('0x13')][_0x889e('0x12')]);}})['catch'](function(_0x22fbf6){logger[_0x889e('0x10')]('Attachment,\x20%s,\x20%s',_0x38eeae,_0x22fbf6);_0x42be62(_0x22fbf6);});});}exports[_0x889e('0x14')]=function(_0x4f9b2c){var _0x75e219=this;return new Promise(function(_0x168fed,_0x232452){return db[_0x889e('0x15')][_0x889e('0x16')](_0x4f9b2c['body'],{'raw':_0x4f9b2c[_0x889e('0x17')]?_0x4f9b2c[_0x889e('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x889e('0x18')](function(_0x11abba){logger[_0x889e('0xc')]('CreateAttachment',_0x4f9b2c);logger[_0x889e('0x19')](_0x889e('0x14'),_0x4f9b2c,JSON[_0x889e('0x1a')](_0x11abba));_0x168fed(_0x11abba);})[_0x889e('0x1b')](function(_0x590b6f){logger['error'](_0x889e('0x14'),_0x590b6f[_0x889e('0x12')],_0x4f9b2c);_0x232452(_0x75e219[_0x889e('0x10')](0x1f4,_0x590b6f['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 9db9da4..029b2cb 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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x277715,_0x589457){var _0x4af325=function(_0x46a470){while(--_0x46a470){_0x277715['push'](_0x277715['shift']());}};_0x4af325(++_0x589457);}(_0x757a,0xde));var _0xa757=function(_0x174a5f,_0x4e580b){_0x174a5f=_0x174a5f-0x0;var _0x30dd50=_0x757a[_0x174a5f];return _0x30dd50;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index ca823d8..eae7349 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 _0x87af=['role','disabled','blockedAt','online','user','then','minutes','clearBlockUser','getLicense','catch','send','message','login','json','use','ad-login','password','User','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt'];(function(_0x397dcd,_0x44f397){var _0x431acf=function(_0x256b48){while(--_0x256b48){_0x397dcd['push'](_0x397dcd['shift']());}};_0x431acf(++_0x44f397);}(_0x87af,0x14d));var _0xf87a=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x87af[_0x3ab9ee];return _0x82ee88;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xf87a('0x0'))[_0xf87a('0x1')];var moment=require(_0xf87a('0x2'));var ActiveDirectory=require(_0xf87a('0x3'));var BPromise=require(_0xf87a('0x4'));var util=require(_0xf87a('0x5'));var db=require(_0xf87a('0x6'))['db'];var authService=require(_0xf87a('0x7'));var utils=require('../../config/utils');var config=require(_0xf87a('0x8'));var logger=require(_0xf87a('0x9'))('api');function isActiveDirectoryConfigured(_0x22d068){var _0x5f8973=![];if(typeof _0x22d068[_0xf87a('0xa')]!==_0xf87a('0xb')){_0x5f8973=_0x22d068[_0xf87a('0xa')][_0xf87a('0xc')]&&_0x22d068['activedirectory'][_0xf87a('0xd')]&&_0x22d068[_0xf87a('0xa')][_0xf87a('0xe')];}return _0x5f8973;}function adAuthenticate(_0x2aa8c0,_0x415e89,_0x274201){return new BPromise(function(_0x312e69,_0x1d5e4d){try{var _0x303024=new ActiveDirectory(_0x2aa8c0);_0x303024[_0xf87a('0xf')](_0x415e89,_0x274201,function(_0x3b6fd9,_0x4aa1c5){if(_0x3b6fd9){logger[_0xf87a('0x10')]('Error\x20authenticate\x20%s:\x20%s',_0x415e89,util[_0xf87a('0x11')](_0x3b6fd9,{'showHidden':![],'depth':null}));_0x1d5e4d(_0xf87a('0x12'));}else if(!_0x4aa1c5){logger[_0xf87a('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x415e89);_0x1d5e4d(_0xf87a('0x12'));}else{_0x312e69(_0x4aa1c5);}});}catch(_0x50c2ff){_0x1d5e4d(_0x50c2ff);}});}function ActiveDirectoryAuthenticate(_0x3a75e6,_0x3dccf8,_0x3ce17a,_0x2b7710){var _0x256491,_0x4f5201;if(!isActiveDirectoryConfigured(config)){logger[_0xf87a('0x10')](_0xf87a('0x13'),_0x3dccf8);return _0x2b7710(null,![],{'message':_0xf87a('0x12')});}return db[_0xf87a('0x14')][_0xf87a('0x15')]({'where':{'id':0x1},'attributes':[_0xf87a('0x16'),_0xf87a('0x17')],'raw':!![]})['then'](function(_0x61faf9){_0x256491=_0x61faf9;if(!_0x256491[_0xf87a('0x16')]){logger['error'](_0xf87a('0x18'),_0x3dccf8);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x3a75e6[_0xf87a('0x15')]({'attributes':['id',_0xf87a('0x19'),'password',_0xf87a('0x1a'),_0xf87a('0x1b'),_0xf87a('0x1c'),'blocked',_0xf87a('0x1d'),_0xf87a('0x1e')],'where':{'name':_0x3dccf8,'role':{'$or':['admin',_0xf87a('0x1f'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x15289e){if(!_0x15289e||_0x15289e&&_0x15289e[_0xf87a('0x19')]!==_0x3dccf8){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x4f5201=_0x15289e;var _0x55174e=_0x4f5201[_0xf87a('0x19')]+'@'+config[_0xf87a('0xa')][_0xf87a('0xe')];return adAuthenticate(config[_0xf87a('0xa')],_0x55174e,_0x3ce17a);})[_0xf87a('0x20')](function(_0x516b43){if(_0x4f5201['disabled']){throw new Error(_0xf87a('0x12'));}if(_0x256491[_0xf87a('0x17')]>0x0){if(_0x4f5201['blocked']){if(moment(_0x4f5201[_0xf87a('0x1d')])['add'](_0x256491['blockDuration'],_0xf87a('0x21'))>moment()){throw new Error(_0xf87a('0x12'));}return utils[_0xf87a('0x22')](_0x4f5201,0x0,![],null)[_0xf87a('0x20')](function(){return utils[_0xf87a('0x23')](_0x4f5201);})[_0xf87a('0x20')](function(){return _0x2b7710(null,_0x4f5201);});}else{return utils[_0xf87a('0x23')](_0x4f5201)[_0xf87a('0x20')](function(){return _0x2b7710(null,_0x4f5201);});}}else{return utils[_0xf87a('0x23')](_0x4f5201)[_0xf87a('0x20')](function(){return _0x2b7710(null,_0x4f5201);});}})[_0xf87a('0x24')](function(_0x1d1d7a){return _0x2b7710(null,![],_0x1d1d7a);});}function handleError(_0x34d778,_0x51dfb0,_0x34c8a2){return _0x34d778['status'](_0x51dfb0||0x1f4)[_0xf87a('0x25')]({'message':_0x34c8a2?_0x34c8a2[_0xf87a('0x26')]||_0x34c8a2:''});}exports[_0xf87a('0x27')]=function(_0xcc288f,_0x43c8ad,_0x15da1c){passport[_0xf87a('0xf')]('ad-login',function(_0x3b8eae,_0xe97e46,_0x1dd4ab){var _0x270f0=_0x3b8eae||_0x1dd4ab;if(_0x270f0){return handleError(_0x43c8ad,0x191,_0x270f0);}if(!_0xe97e46){return handleError(_0x43c8ad,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3263fb={'payload':{'id':_0xe97e46['id'],'role':_0xe97e46[_0xf87a('0x1b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3263fb)[_0xf87a('0x20')](function(_0x4d4a55){_0x43c8ad[_0xf87a('0x28')]({'id':_0xe97e46['id'],'token':_0x4d4a55,'statusCall':'','isAlreadyLogged':_0xe97e46[_0xf87a('0x1e')]});});}})(_0xcc288f,_0x43c8ad,_0x15da1c);};passport[_0xf87a('0x29')](_0xf87a('0x2a'),new LocalStrategy({'usernameField':_0xf87a('0x19'),'passwordField':_0xf87a('0x2b')},function(_0x3e1099,_0x533898,_0x274f41){return ActiveDirectoryAuthenticate(db[_0xf87a('0x2c')],_0x3e1099,_0x533898,_0x274f41);}));
\ No newline at end of file
+var _0x4523=['role','disabled','blocked','blockedAt','user','agent','blockDuration','add','minutes','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','baseDN','domain','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','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','name','password','salt'];(function(_0x3b4e7a,_0x49dffa){var _0x2e8a1d=function(_0x30cafa){while(--_0x30cafa){_0x3b4e7a['push'](_0x3b4e7a['shift']());}};_0x2e8a1d(++_0x49dffa);}(_0x4523,0x165));var _0x3452=function(_0x4443f3,_0x473ea6){_0x4443f3=_0x4443f3-0x0;var _0x4cf485=_0x4523[_0x4443f3];return _0x4cf485;};'use strict';var passport=require(_0x3452('0x0'));var LocalStrategy=require(_0x3452('0x1'))[_0x3452('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x3452('0x3'));var BPromise=require(_0x3452('0x4'));var util=require(_0x3452('0x5'));var db=require(_0x3452('0x6'))['db'];var authService=require(_0x3452('0x7'));var utils=require(_0x3452('0x8'));var config=require(_0x3452('0x9'));var logger=require('../../config/logger')(_0x3452('0xa'));function isActiveDirectoryConfigured(_0x441a12){var _0x2d1675=![];if(typeof _0x441a12['activedirectory']!=='undefined'){_0x2d1675=_0x441a12[_0x3452('0xb')][_0x3452('0xc')]&&_0x441a12['activedirectory']['url']&&_0x441a12[_0x3452('0xb')][_0x3452('0xd')];}return _0x2d1675;}function adAuthenticate(_0xf1db68,_0x105e43,_0x499655){return new BPromise(function(_0x5aeaa1,_0x2f1c5d){try{var _0x3985c4=new ActiveDirectory(_0xf1db68);_0x3985c4['authenticate'](_0x105e43,_0x499655,function(_0x1ff393,_0x5645e3){if(_0x1ff393){logger['error'](_0x3452('0xe'),_0x105e43,util[_0x3452('0xf')](_0x1ff393,{'showHidden':![],'depth':null}));_0x2f1c5d(_0x3452('0x10'));}else if(!_0x5645e3){logger['error'](_0x3452('0x11'),_0x105e43);_0x2f1c5d(_0x3452('0x10'));}else{_0x5aeaa1(_0x5645e3);}});}catch(_0xd6be3f){_0x2f1c5d(_0xd6be3f);}});}function ActiveDirectoryAuthenticate(_0x4194d0,_0x3f16ca,_0x3097a2,_0x24c633){var _0x21e0b2,_0x202fb9;if(!isActiveDirectoryConfigured(config)){logger[_0x3452('0x12')](_0x3452('0x13'),_0x3f16ca);return _0x24c633(null,![],{'message':_0x3452('0x10')});}return db[_0x3452('0x14')][_0x3452('0x15')]({'where':{'id':0x1},'attributes':[_0x3452('0x16'),'blockDuration'],'raw':!![]})[_0x3452('0x17')](function(_0x12f23d){_0x21e0b2=_0x12f23d;if(!_0x21e0b2[_0x3452('0x16')]){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x3f16ca);throw new Error(_0x3452('0x10'));}return _0x4194d0[_0x3452('0x15')]({'attributes':['id',_0x3452('0x18'),_0x3452('0x19'),_0x3452('0x1a'),_0x3452('0x1b'),_0x3452('0x1c'),_0x3452('0x1d'),_0x3452('0x1e'),'online'],'where':{'name':_0x3f16ca,'role':{'$or':['admin',_0x3452('0x1f'),_0x3452('0x20')]},'adSsoEnabled':!![]}});})[_0x3452('0x17')](function(_0x5d166){if(!_0x5d166||_0x5d166&&_0x5d166[_0x3452('0x18')]!==_0x3f16ca){throw new Error(_0x3452('0x10'));}_0x202fb9=_0x5d166;var _0xefc83c=_0x202fb9[_0x3452('0x18')]+'@'+config['activedirectory'][_0x3452('0xd')];return adAuthenticate(config[_0x3452('0xb')],_0xefc83c,_0x3097a2);})[_0x3452('0x17')](function(_0x5c1eb9){if(_0x202fb9[_0x3452('0x1c')]){throw new Error(_0x3452('0x10'));}if(_0x21e0b2[_0x3452('0x21')]>0x0){if(_0x202fb9[_0x3452('0x1d')]){if(moment(_0x202fb9[_0x3452('0x1e')])[_0x3452('0x22')](_0x21e0b2[_0x3452('0x21')],_0x3452('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x202fb9,0x0,![],null)[_0x3452('0x17')](function(){return utils[_0x3452('0x24')](_0x202fb9);})['then'](function(){return _0x24c633(null,_0x202fb9);});}else{return utils[_0x3452('0x24')](_0x202fb9)[_0x3452('0x17')](function(){return _0x24c633(null,_0x202fb9);});}}else{return utils[_0x3452('0x24')](_0x202fb9)[_0x3452('0x17')](function(){return _0x24c633(null,_0x202fb9);});}})[_0x3452('0x25')](function(_0x21355f){return _0x24c633(null,![],_0x21355f);});}function handleError(_0x1ffdde,_0x454481,_0x2cd95e){return _0x1ffdde[_0x3452('0x26')](_0x454481||0x1f4)['send']({'message':_0x2cd95e?_0x2cd95e[_0x3452('0x27')]||_0x2cd95e:''});}exports[_0x3452('0x28')]=function(_0x48924c,_0x24a358,_0x252709){passport[_0x3452('0x29')](_0x3452('0x2a'),function(_0x12c2a7,_0x48b85f,_0x4caaab){var _0x5dc6c6=_0x12c2a7||_0x4caaab;if(_0x5dc6c6){return handleError(_0x24a358,0x191,_0x5dc6c6);}if(!_0x48b85f){return handleError(_0x24a358,0x194,{'message':_0x3452('0x2b')});}else{var _0x5a4cab={'payload':{'id':_0x48b85f['id'],'role':_0x48b85f[_0x3452('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x3452('0x2c')](_0x5a4cab)['then'](function(_0x3a53de){_0x24a358[_0x3452('0x2d')]({'id':_0x48b85f['id'],'token':_0x3a53de,'statusCall':'','isAlreadyLogged':_0x48b85f[_0x3452('0x2e')]});});}})(_0x48924c,_0x24a358,_0x252709);};passport[_0x3452('0x2f')](_0x3452('0x2a'),new LocalStrategy({'usernameField':_0x3452('0x18'),'passwordField':_0x3452('0x19')},function(_0x1c70d5,_0x501463,_0x2f3145){return ActiveDirectoryAuthenticate(db['User'],_0x1c70d5,_0x501463,_0x2f3145);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 4e299d7..c5c2386 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 _0x2fb9=['Router','./authActiveDirectory.controller','post','exports','express'];(function(_0x535f2d,_0x2ca297){var _0x34a5d7=function(_0x21090b){while(--_0x21090b){_0x535f2d['push'](_0x535f2d['shift']());}};_0x34a5d7(++_0x2ca297);}(_0x2fb9,0x1e9));var _0x92fb=function(_0x3fea18,_0x386ae8){_0x3fea18=_0x3fea18-0x0;var _0x47a122=_0x2fb9[_0x3fea18];return _0x47a122;};'use strict';var express=require(_0x92fb('0x0'));var router=express[_0x92fb('0x1')]();var controller=require(_0x92fb('0x2'));router[_0x92fb('0x3')]('/',controller['login']);module[_0x92fb('0x4')]=router;
\ No newline at end of file
+var _0xdb87=['login','exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x470450,_0xe68acb){var _0x5fa1df=function(_0x2d8df8){while(--_0x2d8df8){_0x470450['push'](_0x470450['shift']());}};_0x5fa1df(++_0xe68acb);}(_0xdb87,0xda));var _0x7db8=function(_0x272f6e,_0x57f558){_0x272f6e=_0x272f6e-0x0;var _0xf945df=_0xdb87[_0x272f6e];return _0xf945df;};'use strict';var express=require(_0x7db8('0x0'));var router=express[_0x7db8('0x1')]();var controller=require(_0x7db8('0x2'));router[_0x7db8('0x3')]('/',controller[_0x7db8('0x4')]);module[_0x7db8('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index d814197..00f1242 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x7a54,0x106));var _0x47a5=function(_0x388e39,_0x5ccd06){_0x388e39=_0x388e39-0x0;var _0x295484=_0x7a54[_0x388e39];return _0x295484;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x7a54,0x106));var _0x47a5=function(_0xad2a0,_0x27904f){_0xad2a0=_0xad2a0-0x0;var _0x5cae03=_0x7a54[_0xad2a0];return _0x5cae03;};'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 35eda37..8764de6 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 _0xeb84=['../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb84,0x194));var _0x4eb8=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0xeb84[_0x330723];return _0x60c546;};'use strict';var express=require(_0x4eb8('0x0'));var passport=require(_0x4eb8('0x1'));var router=express[_0x4eb8('0x2')]();var controller=require(_0x4eb8('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x4eb8('0x4'));router[_0x4eb8('0x5')]('/',controller[_0x4eb8('0x6')]);router[_0x4eb8('0x5')](_0x4eb8('0x7'),controller[_0x4eb8('0x8')],authService[_0x4eb8('0x9')],userController['login'],authService[_0x4eb8('0xa')]);module[_0x4eb8('0xb')]=router;
\ No newline at end of file
+var _0xb708=['../../components/auth/service','get','/callback','callback','login','setTokenCookie','express','Router','../user/user.controller.js'];(function(_0x4004ed,_0x1d82a9){var _0x14ecf4=function(_0xd87ad8){while(--_0xd87ad8){_0x4004ed['push'](_0x4004ed['shift']());}};_0x14ecf4(++_0x1d82a9);}(_0xb708,0xe7));var _0x8b70=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xb708[_0x59c301];return _0x3866b9;};'use strict';var express=require(_0x8b70('0x0'));var passport=require('passport');var router=express[_0x8b70('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x8b70('0x2'));var authService=require(_0x8b70('0x3'));router[_0x8b70('0x4')]('/',controller['login']);router[_0x8b70('0x4')](_0x8b70('0x5'),controller[_0x8b70('0x6')],authService['isMiddleware'],userController[_0x8b70('0x7')],authService[_0x8b70('0x8')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 64e8590..952ce61 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 _0x546e=['merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','save','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions'];(function(_0x381900,_0x2d2804){var _0x54da53=function(_0x56d214){while(--_0x56d214){_0x381900['push'](_0x381900['shift']());}};_0x54da53(++_0x2d2804);}(_0x546e,0x1bf));var _0xe546=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x546e[_0x1f9f37];return _0x21c080;};'use strict';var util=require(_0xe546('0x0'));var passport=require(_0xe546('0x1'));var LocalStrategy=require(_0xe546('0x2'))[_0xe546('0x3')];var jayson=require(_0xe546('0x4'));var _=require('lodash');var rs=require(_0xe546('0x5'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xe546('0x6'));var utils=require(_0xe546('0x7'));var client=jayson['client'][_0xe546('0x8')]({'port':0x232b});function localAuthenticate(_0x425f62,_0x461cd5,_0x1cbfc1,_0x37ed73){var _0x58d355,_0x25bb51;return db[_0xe546('0x9')][_0xe546('0xa')]({'where':{'id':0x1},'attributes':[_0xe546('0xb'),_0xe546('0xc')],'raw':!![]})[_0xe546('0xd')](function(_0x3bbaec){_0x58d355=_0x3bbaec;return _0x425f62[_0xe546('0xa')]({'attributes':['id',_0xe546('0xe'),_0xe546('0xf'),_0xe546('0x10'),_0xe546('0x11'),_0xe546('0x12'),_0xe546('0x13'),_0xe546('0x14'),_0xe546('0x15')],'where':{'name':_0x461cd5,'role':{'$or':[_0xe546('0x16'),_0xe546('0x17'),_0xe546('0x18')]}}});})[_0xe546('0xd')](function(_0x2c861a){if(!_0x2c861a||_0x2c861a&&_0x2c861a['name']!==_0x461cd5){throw new Error(_0xe546('0x19'));}else{_0x25bb51=_0x2c861a;return _0x25bb51;}})[_0xe546('0xd')](function(){_0x25bb51[_0xe546('0x1a')](_0x1cbfc1,function(_0x2755e3,_0xb889a9){var _0x9701f2=_0x25bb51['loginAttempts']+0x1;if(_0x2755e3){return _0x37ed73(_0x2755e3);}else if(!_0xb889a9){if(_0x25bb51[_0xe546('0x12')]){return _0x37ed73(null,![],{'message':_0xe546('0x19')});}else if(_0x58d355[_0xe546('0xb')]>0x0){if(_0x25bb51[_0xe546('0x13')]){if(_0x58d355[_0xe546('0xc')]>0x0){if(moment(_0x25bb51[_0xe546('0x14')])[_0xe546('0x1b')](_0x58d355[_0xe546('0xc')],_0xe546('0x1c'))>moment()){return _0x37ed73(null,![],{'message':_0xe546('0x19')});}else{return utils[_0xe546('0x1d')](_0x25bb51,_0x9701f2,![],null)[_0xe546('0xd')](function(){return _0x37ed73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x37ed73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x9701f2>=_0x58d355['allowedLoginAttempts']){return utils[_0xe546('0x1d')](_0x25bb51,0x0,!![],moment())[_0xe546('0xd')](function(){return _0x37ed73(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xe546('0x1d')](_0x25bb51,_0x9701f2,![],null)[_0xe546('0xd')](function(){return _0x37ed73(null,![],{'message':_0xe546('0x19')});});}}}else{return _0x37ed73(null,![],{'message':_0xe546('0x19')});}}else{if(_0x25bb51['disabled']){return _0x37ed73(null,![],{'message':_0xe546('0x19')});}else if(_0x58d355[_0xe546('0xb')]>0x0){if(_0x25bb51[_0xe546('0x13')]){if(_0x58d355[_0xe546('0xc')]>0x0){if(moment(_0x25bb51[_0xe546('0x14')])[_0xe546('0x1b')](_0x58d355[_0xe546('0xc')],_0xe546('0x1c'))>moment()){return _0x37ed73(null,![],{'message':_0xe546('0x19')});}else{return utils[_0xe546('0x1d')](_0x25bb51,0x0,![],null)[_0xe546('0xd')](function(){return utils[_0xe546('0x1e')](_0x25bb51);})[_0xe546('0xd')](function(){return _0x37ed73(null,_0x25bb51);});}}else{return _0x37ed73(null,![],{'message':_0xe546('0x19')});}}else{return utils[_0xe546('0x1d')](_0x25bb51,0x0,![],null)[_0xe546('0xd')](function(){return utils['getLicense'](_0x25bb51);})['then'](function(){return _0x37ed73(null,_0x25bb51);})[_0xe546('0x1f')](function(_0x29134b){return _0x37ed73(null,![],_0x29134b);});}}else{if(_0x25bb51[_0xe546('0x13')]){return _0x37ed73(null,![],{'message':_0xe546('0x19')});}else{return utils[_0xe546('0x1e')](_0x25bb51)[_0xe546('0xd')](function(){return _0x37ed73(null,_0x25bb51);});}}}});})[_0xe546('0x1f')](function(_0x142016){return _0x37ed73(null,![],_0x142016);});}function sendServiceMail(_0x2e92f1){return db[_0xe546('0x20')][_0xe546('0x21')]({'where':{'service':!![]},'attributes':['id',_0xe546('0xe'),_0xe546('0x22')],'include':[{'model':db[_0xe546('0x23')],'as':_0xe546('0x24'),'include':[{'model':db[_0xe546('0x25')],'as':_0xe546('0x25')}]}]})[_0xe546('0xd')](function(_0x476738){if(!_0x476738){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x500226=_0x476738[_0xe546('0x26')]();var _0x59d9fb={'account':_0x500226,'message':_[_0xe546('0x27')]({'from':util[_0xe546('0x28')](_0xe546('0x29'),_0x476738[_0xe546('0xe')],_0x476738[_0xe546('0x22')]||_0x476738[_0xe546('0x24')][_0xe546('0x17')])},_0x2e92f1)};return client[_0xe546('0x2a')](_0xe546('0x2b'),_0x59d9fb);})[_0xe546('0xd')](function(_0x3783e8){if(_0x3783e8[_0xe546('0x2c')]){throw new Error(util[_0xe546('0x28')](_0xe546('0x2d'),_0x3783e8[_0xe546('0x2c')][_0xe546('0x2e')]||JSON[_0xe546('0x2f')](_0x3783e8[_0xe546('0x2c')])));}return!![];});}function handleError(_0x592397,_0x57c10c,_0x25b043){return _0x592397[_0xe546('0x30')](_0x57c10c||0x1f4)[_0xe546('0x31')]({'message':_0x25b043?_0x25b043[_0xe546('0x2e')]||_0x25b043:''});}exports[_0xe546('0x32')]=function(_0x1b3369,_0x35d24b,_0x46df24){passport[_0xe546('0x1a')](_0xe546('0x33'),function(_0xda4e00,_0x13d599,_0x24fce4){var _0x363144=_0xda4e00||_0x24fce4;if(_0x363144){return handleError(_0x35d24b,0x191,_0x363144);}if(!_0x13d599){return handleError(_0x35d24b,0x194,{'message':_0xe546('0x34')});}else{var _0x38b4a3={'payload':{'id':_0x13d599['id'],'role':_0x13d599['role']},'options':{'expiresIn':0x15180}};return authService[_0xe546('0x35')](_0x38b4a3)['then'](function(_0x3f2721){_0x35d24b[_0xe546('0x36')]({'id':_0x13d599['id'],'token':_0x3f2721,'statusCall':'','isAlreadyLogged':_0x13d599['online']});});}})(_0x1b3369,_0x35d24b,_0x46df24);};exports['forgot']=function(_0x468e04,_0x54a4ac){if(!_0x468e04[_0xe546('0x37')][_0xe546('0x22')]){return handleError(_0x54a4ac,0x1f4,{'message':_0xe546('0x38')});}var _0x5a75c0=rs['generate']();_0x468e04[_0xe546('0x37')]['email']=_0x468e04['body'][_0xe546('0x22')]['trim']()[_0xe546('0x39')]();var _0x4292c2;return db[_0xe546('0x9')][_0xe546('0xa')]({'where':{'id':0x1},'attributes':[_0xe546('0xb'),'blockDuration'],'raw':!![]})[_0xe546('0xd')](function(_0x42f8bf){_0x4292c2=_0x42f8bf;return db['User'][_0xe546('0x21')]({'where':{'email':_0x468e04[_0xe546('0x37')][_0xe546('0x22')]}});})[_0xe546('0xd')](function(_0x3874f7){if(!_0x3874f7){throw new Error(_0xe546('0x3a'));}if(_0x3874f7['disabled']){throw new Error(_0xe546('0x3b'));}if(_0x3874f7[_0xe546('0x13')]){if(moment(_0x3874f7[_0xe546('0x14')])[_0xe546('0x1b')](_0x4292c2[_0xe546('0xc')],_0xe546('0x1c'))>moment()){throw new Error(_0xe546('0x3c'));}else{_0x3874f7[_0xe546('0x13')]=![];_0x3874f7[_0xe546('0x14')]=null;}}_0x3874f7[_0xe546('0x3d')]=_0x5a75c0;_0x3874f7[_0xe546('0x3e')]=Date[_0xe546('0x3f')]()+0x36ee80;return _0x3874f7['save']();})[_0xe546('0xd')](function(){return sendServiceMail({'to':_0x468e04['body']['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xe546('0x40')+_0xe546('0x41')+_0xe546('0x42')+_0x468e04['headers'][_0xe546('0x43')]+_0xe546('0x44')+_0x5a75c0+'\x0a\x0a'+_0xe546('0x45')});})[_0xe546('0xd')](function(){_0x54a4ac['status'](0xc8)[_0xe546('0x31')]({'message':_0xe546('0x46')});})[_0xe546('0x1f')](function(_0x364564){return handleError(_0x54a4ac,0x1f4,_0x364564);});};exports[_0xe546('0x47')]=function(_0x5c2675,_0x22a91a){return db[_0xe546('0x48')][_0xe546('0x21')]({'where':{'resetPasswordToken':_0x5c2675['params'][_0xe546('0x49')],'resetPasswordExpires':{'$gt':Date[_0xe546('0x3f')]()}}})[_0xe546('0xd')](function(_0x3ba48a){if(!_0x3ba48a){throw new Error(_0xe546('0x4a'));}return db[_0xe546('0x9')][_0xe546('0xa')]({'attributes':['id','securePassword',_0xe546('0x4b'),_0xe546('0x4c')]})[_0xe546('0xd')](function(_0x525981){if(_0x525981[_0xe546('0x4d')])authService['validatePasswordPattern'](_0x5c2675[_0xe546('0x37')][_0xe546('0xf')]);if(!_0x525981['enforcePasswordHistory']||!_0x3ba48a['previousPasswords'])return _0x3ba48a;authService['validatePasswordHistory'](_0x5c2675[_0xe546('0x37')][_0xe546('0xf')],_0x3ba48a[_0xe546('0x4e')],_0x525981[_0xe546('0x4c')]);return _0x3ba48a;})[_0xe546('0xd')](function(){_0x3ba48a[_0xe546('0xf')]=_0x5c2675[_0xe546('0x37')][_0xe546('0xf')];_0x3ba48a[_0xe546('0x3d')]=null;_0x3ba48a[_0xe546('0x3e')]=null;return _0x3ba48a[_0xe546('0x4f')]();});})[_0xe546('0xd')](function(){_0x22a91a[_0xe546('0x30')](0xc8)[_0xe546('0x31')]({'message':'Password\x20reset!'});})['catch'](function(_0x538f1d){return handleError(_0x22a91a,0x1f4,_0x538f1d);});};passport[_0xe546('0x50')](_0xe546('0x33'),new LocalStrategy({'usernameField':_0xe546('0xe'),'passwordField':_0xe546('0xf')},function(_0x23b569,_0x537302,_0x267f3e){return localAuthenticate(db[_0xe546('0x48')],_0x23b569,_0x537302,_0x267f3e);}));
\ No newline at end of file
+var _0x9f37=['message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','generate','trim','toLowerCase','User','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://','host','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','resetPasswordExpires','use','util','passport','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','name','password','salt','role','loginAttempts','admin','user','authenticate','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','minutes','catch','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!'];(function(_0x1b087d,_0xbadd72){var _0x57400a=function(_0x21c333){while(--_0x21c333){_0x1b087d['push'](_0x1b087d['shift']());}};_0x57400a(++_0xbadd72);}(_0x9f37,0x10f));var _0x79f3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x9f37[_0x17d9e3];return _0x14192d;};'use strict';var util=require(_0x79f3('0x0'));var passport=require(_0x79f3('0x1'));var LocalStrategy=require('passport-local')[_0x79f3('0x2')];var jayson=require(_0x79f3('0x3'));var _=require('lodash');var rs=require(_0x79f3('0x4'));var moment=require(_0x79f3('0x5'));var db=require(_0x79f3('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x79f3('0x7'));var client=jayson[_0x79f3('0x8')][_0x79f3('0x9')]({'port':0x232b});function localAuthenticate(_0x472644,_0x3cce13,_0x5506e8,_0x1035ed){var _0x519f17,_0x34347c;return db[_0x79f3('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x79f3('0xb'),_0x79f3('0xc')],'raw':!![]})[_0x79f3('0xd')](function(_0x64078){_0x519f17=_0x64078;return _0x472644['findOne']({'attributes':['id',_0x79f3('0xe'),_0x79f3('0xf'),_0x79f3('0x10'),_0x79f3('0x11'),'disabled','blocked','blockedAt',_0x79f3('0x12')],'where':{'name':_0x3cce13,'role':{'$or':[_0x79f3('0x13'),_0x79f3('0x14'),'agent']}}});})['then'](function(_0x57769c){if(!_0x57769c||_0x57769c&&_0x57769c[_0x79f3('0xe')]!==_0x3cce13){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x34347c=_0x57769c;return _0x34347c;}})[_0x79f3('0xd')](function(){_0x34347c[_0x79f3('0x15')](_0x5506e8,function(_0x32990a,_0x576230){var _0x21a9a6=_0x34347c[_0x79f3('0x12')]+0x1;if(_0x32990a){return _0x1035ed(_0x32990a);}else if(!_0x576230){if(_0x34347c[_0x79f3('0x16')]){return _0x1035ed(null,![],{'message':_0x79f3('0x17')});}else if(_0x519f17['allowedLoginAttempts']>0x0){if(_0x34347c[_0x79f3('0x18')]){if(_0x519f17[_0x79f3('0xc')]>0x0){if(moment(_0x34347c[_0x79f3('0x19')])[_0x79f3('0x1a')](_0x519f17[_0x79f3('0xc')],'minutes')>moment()){return _0x1035ed(null,![],{'message':_0x79f3('0x17')});}else{return utils[_0x79f3('0x1b')](_0x34347c,_0x21a9a6,![],null)['then'](function(){return _0x1035ed(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x1035ed(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x21a9a6>=_0x519f17['allowedLoginAttempts']){return utils['clearBlockUser'](_0x34347c,0x0,!![],moment())[_0x79f3('0xd')](function(){return _0x1035ed(null,![],{'message':_0x79f3('0x17')});});}else{return utils['clearBlockUser'](_0x34347c,_0x21a9a6,![],null)['then'](function(){return _0x1035ed(null,![],{'message':_0x79f3('0x17')});});}}}else{return _0x1035ed(null,![],{'message':_0x79f3('0x17')});}}else{if(_0x34347c[_0x79f3('0x16')]){return _0x1035ed(null,![],{'message':_0x79f3('0x17')});}else if(_0x519f17[_0x79f3('0xb')]>0x0){if(_0x34347c[_0x79f3('0x18')]){if(_0x519f17[_0x79f3('0xc')]>0x0){if(moment(_0x34347c[_0x79f3('0x19')])[_0x79f3('0x1a')](_0x519f17[_0x79f3('0xc')],_0x79f3('0x1c'))>moment()){return _0x1035ed(null,![],{'message':_0x79f3('0x17')});}else{return utils[_0x79f3('0x1b')](_0x34347c,0x0,![],null)[_0x79f3('0xd')](function(){return utils['getLicense'](_0x34347c);})[_0x79f3('0xd')](function(){return _0x1035ed(null,_0x34347c);});}}else{return _0x1035ed(null,![],{'message':_0x79f3('0x17')});}}else{return utils[_0x79f3('0x1b')](_0x34347c,0x0,![],null)['then'](function(){return utils['getLicense'](_0x34347c);})[_0x79f3('0xd')](function(){return _0x1035ed(null,_0x34347c);})[_0x79f3('0x1d')](function(_0x3781a9){return _0x1035ed(null,![],_0x3781a9);});}}else{if(_0x34347c[_0x79f3('0x18')]){return _0x1035ed(null,![],{'message':_0x79f3('0x17')});}else{return utils['getLicense'](_0x34347c)[_0x79f3('0xd')](function(){return _0x1035ed(null,_0x34347c);});}}}});})[_0x79f3('0x1d')](function(_0x20a247){return _0x1035ed(null,![],_0x20a247);});}function sendServiceMail(_0x1e996e){return db[_0x79f3('0x1e')][_0x79f3('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x79f3('0xe'),_0x79f3('0x20')],'include':[{'model':db[_0x79f3('0x21')],'as':'Smtp','include':[{'model':db[_0x79f3('0x22')],'as':'CloudProvider'}]}]})[_0x79f3('0xd')](function(_0xa98436){if(!_0xa98436){throw new Error(_0x79f3('0x23'));}var _0x50e5a6=_0xa98436[_0x79f3('0x24')]();var _0x5b0629={'account':_0x50e5a6,'message':_[_0x79f3('0x25')]({'from':util[_0x79f3('0x26')](_0x79f3('0x27'),_0xa98436['name'],_0xa98436[_0x79f3('0x20')]||_0xa98436[_0x79f3('0x28')][_0x79f3('0x14')])},_0x1e996e)};return client[_0x79f3('0x29')](_0x79f3('0x2a'),_0x5b0629);})[_0x79f3('0xd')](function(_0x4923f5){if(_0x4923f5[_0x79f3('0x2b')]){throw new Error(util[_0x79f3('0x26')](_0x79f3('0x2c'),_0x4923f5[_0x79f3('0x2b')][_0x79f3('0x2d')]||JSON[_0x79f3('0x2e')](_0x4923f5['error'])));}return!![];});}function handleError(_0x31ee60,_0xe1ac74,_0x4864f3){return _0x31ee60[_0x79f3('0x2f')](_0xe1ac74||0x1f4)[_0x79f3('0x30')]({'message':_0x4864f3?_0x4864f3['message']||_0x4864f3:''});}exports[_0x79f3('0x31')]=function(_0x3acb93,_0x156b5e,_0x25bb92){passport[_0x79f3('0x15')](_0x79f3('0x32'),function(_0x2b64fd,_0x5cd1d2,_0x15f3af){var _0x4a65cb=_0x2b64fd||_0x15f3af;if(_0x4a65cb){return handleError(_0x156b5e,0x191,_0x4a65cb);}if(!_0x5cd1d2){return handleError(_0x156b5e,0x194,{'message':_0x79f3('0x33')});}else{var _0x640f28={'payload':{'id':_0x5cd1d2['id'],'role':_0x5cd1d2[_0x79f3('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x79f3('0x34')](_0x640f28)[_0x79f3('0xd')](function(_0x49951a){_0x156b5e[_0x79f3('0x35')]({'id':_0x5cd1d2['id'],'token':_0x49951a,'statusCall':'','isAlreadyLogged':_0x5cd1d2['online']});});}})(_0x3acb93,_0x156b5e,_0x25bb92);};exports['forgot']=function(_0x31588b,_0x5f14d1){if(!_0x31588b[_0x79f3('0x36')][_0x79f3('0x20')]){return handleError(_0x5f14d1,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x18e0fb=rs[_0x79f3('0x37')]();_0x31588b[_0x79f3('0x36')][_0x79f3('0x20')]=_0x31588b[_0x79f3('0x36')][_0x79f3('0x20')][_0x79f3('0x38')]()[_0x79f3('0x39')]();var _0x3fb270;return db[_0x79f3('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x79f3('0xb'),_0x79f3('0xc')],'raw':!![]})[_0x79f3('0xd')](function(_0x4c78c5){_0x3fb270=_0x4c78c5;return db[_0x79f3('0x3a')][_0x79f3('0x1f')]({'where':{'email':_0x31588b[_0x79f3('0x36')][_0x79f3('0x20')]}});})[_0x79f3('0xd')](function(_0x333340){if(!_0x333340){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x333340[_0x79f3('0x16')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x333340[_0x79f3('0x18')]){if(moment(_0x333340[_0x79f3('0x19')])[_0x79f3('0x1a')](_0x3fb270[_0x79f3('0xc')],_0x79f3('0x1c'))>moment()){throw new Error(_0x79f3('0x3b'));}else{_0x333340['blocked']=![];_0x333340['blockedAt']=null;}}_0x333340[_0x79f3('0x3c')]=_0x18e0fb;_0x333340['resetPasswordExpires']=Date[_0x79f3('0x3d')]()+0x36ee80;return _0x333340[_0x79f3('0x3e')]();})[_0x79f3('0xd')](function(){return sendServiceMail({'to':_0x31588b[_0x79f3('0x36')][_0x79f3('0x20')],'subject':_0x79f3('0x3f'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x79f3('0x40')+_0x79f3('0x41')+_0x31588b['headers'][_0x79f3('0x42')]+'/reset/'+_0x18e0fb+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x79f3('0xd')](function(){_0x5f14d1[_0x79f3('0x2f')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x79f3('0x1d')](function(_0x6ec0bb){return handleError(_0x5f14d1,0x1f4,_0x6ec0bb);});};exports[_0x79f3('0x43')]=function(_0x11897b,_0x942b2d){return db[_0x79f3('0x3a')]['find']({'where':{'resetPasswordToken':_0x11897b[_0x79f3('0x44')]['token'],'resetPasswordExpires':{'$gt':Date[_0x79f3('0x3d')]()}}})[_0x79f3('0xd')](function(_0x2bdd18){if(!_0x2bdd18){throw new Error(_0x79f3('0x45'));}return db[_0x79f3('0xa')][_0x79f3('0x46')]({'attributes':['id',_0x79f3('0x47'),_0x79f3('0x48'),_0x79f3('0x49')]})['then'](function(_0x234122){if(_0x234122[_0x79f3('0x47')])authService[_0x79f3('0x4a')](_0x11897b[_0x79f3('0x36')][_0x79f3('0xf')]);if(!_0x234122[_0x79f3('0x48')]||!_0x2bdd18['previousPasswords'])return _0x2bdd18;authService[_0x79f3('0x4b')](_0x11897b[_0x79f3('0x36')][_0x79f3('0xf')],_0x2bdd18[_0x79f3('0x4c')],_0x234122[_0x79f3('0x49')]);return _0x2bdd18;})['then'](function(){_0x2bdd18['password']=_0x11897b[_0x79f3('0x36')][_0x79f3('0xf')];_0x2bdd18['resetPasswordToken']=null;_0x2bdd18[_0x79f3('0x4d')]=null;return _0x2bdd18[_0x79f3('0x3e')]();});})[_0x79f3('0xd')](function(){_0x942b2d[_0x79f3('0x2f')](0xc8)[_0x79f3('0x30')]({'message':'Password\x20reset!'});})['catch'](function(_0x28b2c2){return handleError(_0x942b2d,0x1f4,_0x28b2c2);});};passport[_0x79f3('0x4e')](_0x79f3('0x32'),new LocalStrategy({'usernameField':_0x79f3('0xe'),'passwordField':'password'},function(_0x519aae,_0x224876,_0x4a3c7a){return localAuthenticate(db['User'],_0x519aae,_0x224876,_0x4a3c7a);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index b5b93d8..02d9a90 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 _0xdea2=['reset','exports','post','login','/forgot','forgot','/reset/:token'];(function(_0x301b80,_0x3aefbf){var _0x46ee80=function(_0x174fc1){while(--_0x174fc1){_0x301b80['push'](_0x301b80['shift']());}};_0x46ee80(++_0x3aefbf);}(_0xdea2,0xbf));var _0x2dea=function(_0x2e488e,_0x50b586){_0x2e488e=_0x2e488e-0x0;var _0x2b0900=_0xdea2[_0x2e488e];return _0x2b0900;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authLocal.controller');router[_0x2dea('0x0')]('/',controller[_0x2dea('0x1')]);router['post'](_0x2dea('0x2'),controller[_0x2dea('0x3')]);router[_0x2dea('0x0')](_0x2dea('0x4'),controller[_0x2dea('0x5')]);module[_0x2dea('0x6')]=router;
\ No newline at end of file
+var _0xa1df=['/forgot','forgot','exports','express','Router','./authLocal.controller','login','post'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0xa1df,0xfb));var _0xfa1d=function(_0x2c8530,_0x3dd387){_0x2c8530=_0x2c8530-0x0;var _0x41310a=_0xa1df[_0x2c8530];return _0x41310a;};'use strict';var express=require(_0xfa1d('0x0'));var router=express[_0xfa1d('0x1')]();var controller=require(_0xfa1d('0x2'));router['post']('/',controller[_0xfa1d('0x3')]);router[_0xfa1d('0x4')](_0xfa1d('0x5'),controller[_0xfa1d('0x6')]);router['post']('/reset/:token',controller['reset']);module[_0xfa1d('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 545f370..75dfbcf 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 _0x98d2=['STRING','sequelize','exports'];(function(_0x2a4578,_0x104646){var _0xb18fe7=function(_0x351cd){while(--_0x351cd){_0x2a4578['push'](_0x2a4578['shift']());}};_0xb18fe7(++_0x104646);}(_0x98d2,0xeb));var _0x298d=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0x98d2[_0x2e76a7];return _0x454cde;};'use strict';var Sequelize=require(_0x298d('0x0'));module[_0x298d('0x1')]={'name':{'type':Sequelize[_0x298d('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x298d('0x2')]},'description':{'type':Sequelize[_0x298d('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x2e60=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x1bdc79,_0x4803ff){var _0x4c0801=function(_0x3fd372){while(--_0x3fd372){_0x1bdc79['push'](_0x1bdc79['shift']());}};_0x4c0801(++_0x4803ff);}(_0x2e60,0x8a));var _0x02e6=function(_0x5b0f8f,_0x2c7f7c){_0x5b0f8f=_0x5b0f8f-0x0;var _0x4bd04f=_0x2e60[_0x5b0f8f];return _0x4bd04f;};'use strict';var Sequelize=require('sequelize');module[_0x02e6('0x0')]={'name':{'type':Sequelize[_0x02e6('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x02e6('0x1')]},'description':{'type':Sequelize[_0x02e6('0x1')]},'status':{'type':Sequelize[_0x02e6('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x02e6('0x3')],'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 62124de..ee1578f 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 _0x70bf=['reject','save','update','then','destroy','error','stack','name','map','Automation','rawAttributes','fieldName','key','query','keys','filters','model','intersection','fields','attributes','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','length','find','create','body','params','addConditions','ids','getConditions','findOne','Condition','hasOwnProperty','nolimit','addActions','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','apply'];(function(_0x202838,_0x277181){var _0x51e925=function(_0x3caa95){while(--_0x3caa95){_0x202838['push'](_0x202838['shift']());}};_0x51e925(++_0x277181);}(_0x70bf,0x124));var _0xf70b=function(_0x3443e4,_0x4a7dbc){_0x3443e4=_0x3443e4-0x0;var _0x35fed3=_0x70bf[_0x3443e4];return _0x35fed3;};'use strict';var emlformat=require(_0xf70b('0x0'));var rimraf=require(_0xf70b('0x1'));var zipdir=require(_0xf70b('0x2'));var jsonpatch=require(_0xf70b('0x3'));var rp=require(_0xf70b('0x4'));var moment=require('moment');var BPromise=require(_0xf70b('0x5'));var Mustache=require('mustache');var util=require(_0xf70b('0x6'));var path=require(_0xf70b('0x7'));var sox=require(_0xf70b('0x8'));var csv=require(_0xf70b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf70b('0xa'));var jsforce=require(_0xf70b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf70b('0x9'));var querystring=require(_0xf70b('0xc'));var Papa=require(_0xf70b('0xd'));var Redis=require('ioredis');var authService=require(_0xf70b('0xe'));var qs=require(_0xf70b('0xf'));var as=require(_0xf70b('0x10'));var hardwareService=require(_0xf70b('0x11'));var logger=require(_0xf70b('0x12'))(_0xf70b('0x13'));var utils=require(_0xf70b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf70b('0x15'));var db=require(_0xf70b('0x16'))['db'];function respondWithStatusCode(_0x5a8d7e,_0x367d5d){_0x367d5d=_0x367d5d||0xcc;return function(_0x2316f5){if(_0x2316f5){return _0x5a8d7e['sendStatus'](_0x367d5d);}return _0x5a8d7e['status'](_0x367d5d)[_0xf70b('0x17')]();};}function respondWithResult(_0xc2420e,_0x104e42){_0x104e42=_0x104e42||0xc8;return function(_0x586a56){if(_0x586a56){return _0xc2420e[_0xf70b('0x18')](_0x104e42)['json'](_0x586a56);}};}function respondWithFilteredResult(_0x212a1b,_0x443d78){return function(_0x50cdb6){if(_0x50cdb6){var _0x421bec=typeof _0x443d78[_0xf70b('0x19')]===_0xf70b('0x1a')&&typeof _0x443d78[_0xf70b('0x1b')]===_0xf70b('0x1a');var _0x1f2a38=_0x50cdb6[_0xf70b('0x1c')];var _0x38e919=_0x421bec?0x0:_0x443d78['offset'];var _0x10ea82=_0x421bec?_0x50cdb6[_0xf70b('0x1c')]:_0x443d78['offset']+_0x443d78[_0xf70b('0x1b')];var _0x1fe4ae;if(_0x10ea82>=_0x1f2a38){_0x10ea82=_0x1f2a38;_0x1fe4ae=0xc8;}else{_0x1fe4ae=0xce;}_0x212a1b[_0xf70b('0x18')](_0x1fe4ae);return _0x212a1b['set'](_0xf70b('0x1d'),_0x38e919+'-'+_0x10ea82+'/'+_0x1f2a38)[_0xf70b('0x1e')](_0x50cdb6);}return null;};}function patchUpdates(_0xa573d9){return function(_0xffc986){try{jsonpatch[_0xf70b('0x1f')](_0xffc986,_0xa573d9,!![]);}catch(_0x4eedd0){return BPromise[_0xf70b('0x20')](_0x4eedd0);}return _0xffc986[_0xf70b('0x21')]();};}function saveUpdates(_0xf778b7,_0x5285ea){return function(_0x5528cd){if(_0x5528cd){return _0x5528cd[_0xf70b('0x22')](_0xf778b7)[_0xf70b('0x23')](function(_0x4e0616){return _0x4e0616;});}return null;};}function removeEntity(_0x34de13,_0x5a116b){return function(_0x206c44){if(_0x206c44){return _0x206c44[_0xf70b('0x24')]()[_0xf70b('0x23')](function(){_0x34de13[_0xf70b('0x18')](0xcc)[_0xf70b('0x17')]();});}};}function handleEntityNotFound(_0x30b24b,_0x28a006){return function(_0x5870d3){if(!_0x5870d3){_0x30b24b['sendStatus'](0x194);}return _0x5870d3;};}function handleError(_0x5083c9,_0x413646){_0x413646=_0x413646||0x1f4;return function(_0x4bd39c){logger[_0xf70b('0x25')](_0x4bd39c[_0xf70b('0x26')]);if(_0x4bd39c[_0xf70b('0x27')]){delete _0x4bd39c['name'];}_0x5083c9['status'](_0x413646)['send'](_0x4bd39c);};}exports['index']=function(_0x31d696,_0x51f29d){var _0x222ae5={},_0x4f55a9={},_0x8de6ad={'count':0x0,'rows':[]};var _0x377cf1=_[_0xf70b('0x28')](db[_0xf70b('0x29')][_0xf70b('0x2a')],function(_0x453c95){return{'name':_0x453c95[_0xf70b('0x2b')],'type':_0x453c95['type'][_0xf70b('0x2c')]};});_0x4f55a9['model']=_['map'](_0x377cf1,_0xf70b('0x27'));_0x4f55a9[_0xf70b('0x2d')]=_[_0xf70b('0x2e')](_0x31d696['query']);_0x4f55a9[_0xf70b('0x2f')]=_['intersection'](_0x4f55a9[_0xf70b('0x30')],_0x4f55a9[_0xf70b('0x2d')]);_0x222ae5['attributes']=_[_0xf70b('0x31')](_0x4f55a9[_0xf70b('0x30')],qs['fields'](_0x31d696[_0xf70b('0x2d')][_0xf70b('0x32')]));_0x222ae5[_0xf70b('0x33')]=_0x222ae5[_0xf70b('0x33')]['length']?_0x222ae5[_0xf70b('0x33')]:_0x4f55a9['model'];if(!_0x31d696[_0xf70b('0x2d')]['hasOwnProperty']('nolimit')){_0x222ae5[_0xf70b('0x1b')]=qs['limit'](_0x31d696[_0xf70b('0x2d')]['limit']);_0x222ae5['offset']=qs[_0xf70b('0x19')](_0x31d696[_0xf70b('0x2d')]['offset']);}_0x222ae5[_0xf70b('0x34')]=qs[_0xf70b('0x35')](_0x31d696[_0xf70b('0x2d')][_0xf70b('0x35')]);_0x222ae5[_0xf70b('0x36')]=qs[_0xf70b('0x2f')](_[_0xf70b('0x37')](_0x31d696['query'],_0x4f55a9[_0xf70b('0x2f')]),_0x377cf1);if(_0x31d696[_0xf70b('0x2d')][_0xf70b('0x38')]){_0x222ae5[_0xf70b('0x36')]=_['merge'](_0x222ae5[_0xf70b('0x36')],{'$or':_['map'](_0x377cf1,function(_0x1e9274){if(_0x1e9274[_0xf70b('0x39')]!==_0xf70b('0x3a')){var _0x4fd0a5={};_0x4fd0a5[_0x1e9274[_0xf70b('0x27')]]={'$like':'%'+_0x31d696[_0xf70b('0x2d')]['filter']+'%'};return _0x4fd0a5;}})});}_0x222ae5=_[_0xf70b('0x3b')]({},_0x222ae5,_0x31d696[_0xf70b('0x3c')]);var _0x1bede1={'where':_0x222ae5[_0xf70b('0x36')]};return db[_0xf70b('0x29')]['count'](_0x1bede1)[_0xf70b('0x23')](function(_0x397db3){_0x8de6ad['count']=_0x397db3;if(_0x31d696[_0xf70b('0x2d')][_0xf70b('0x3d')]){_0x222ae5[_0xf70b('0x3e')]=[{'all':!![]}];}return db[_0xf70b('0x29')][_0xf70b('0x3f')](_0x222ae5);})[_0xf70b('0x23')](function(_0x369417){_0x8de6ad[_0xf70b('0x40')]=_0x369417;return _0x8de6ad;})[_0xf70b('0x23')](respondWithFilteredResult(_0x51f29d,_0x222ae5))[_0xf70b('0x41')](handleError(_0x51f29d,null));};exports['show']=function(_0xaf2297,_0x3e80dd){var _0x5b5ca2={'raw':![],'where':{'id':_0xaf2297['params']['id']}},_0x2960a2={};_0x2960a2['model']=_[_0xf70b('0x2e')](db[_0xf70b('0x29')][_0xf70b('0x2a')]);_0x2960a2[_0xf70b('0x2d')]=_[_0xf70b('0x2e')](_0xaf2297['query']);_0x2960a2[_0xf70b('0x2f')]=_['intersection'](_0x2960a2['model'],_0x2960a2['query']);_0x5b5ca2[_0xf70b('0x33')]=_[_0xf70b('0x31')](_0x2960a2['model'],qs['fields'](_0xaf2297[_0xf70b('0x2d')][_0xf70b('0x32')]));_0x5b5ca2[_0xf70b('0x33')]=_0x5b5ca2['attributes'][_0xf70b('0x42')]?_0x5b5ca2[_0xf70b('0x33')]:_0x2960a2[_0xf70b('0x30')];if(_0xaf2297[_0xf70b('0x2d')]['includeAll']){_0x5b5ca2[_0xf70b('0x3e')]=[{'all':!![]}];}_0x5b5ca2=_[_0xf70b('0x3b')]({},_0x5b5ca2,_0xaf2297['options']);return db['Automation'][_0xf70b('0x43')](_0x5b5ca2)[_0xf70b('0x23')](handleEntityNotFound(_0x3e80dd,null))[_0xf70b('0x23')](respondWithResult(_0x3e80dd,null))[_0xf70b('0x41')](handleError(_0x3e80dd,null));};exports[_0xf70b('0x44')]=function(_0x2b6b38,_0x4383d7){return db[_0xf70b('0x29')][_0xf70b('0x44')](_0x2b6b38[_0xf70b('0x45')],{})['then'](respondWithResult(_0x4383d7,0xc9))[_0xf70b('0x41')](handleError(_0x4383d7,null));};exports[_0xf70b('0x22')]=function(_0x24eb3b,_0x5984f0){if(_0x24eb3b[_0xf70b('0x45')]['id']){delete _0x24eb3b['body']['id'];}return db[_0xf70b('0x29')]['find']({'where':{'id':_0x24eb3b['params']['id']}})[_0xf70b('0x23')](handleEntityNotFound(_0x5984f0,null))['then'](saveUpdates(_0x24eb3b[_0xf70b('0x45')],null))['then'](respondWithResult(_0x5984f0,null))[_0xf70b('0x41')](handleError(_0x5984f0,null));};exports[_0xf70b('0x24')]=function(_0x146e02,_0x5f4560){return db[_0xf70b('0x29')]['find']({'where':{'id':_0x146e02[_0xf70b('0x46')]['id']}})[_0xf70b('0x23')](handleEntityNotFound(_0x5f4560,null))[_0xf70b('0x23')](removeEntity(_0x5f4560,null))[_0xf70b('0x41')](handleError(_0x5f4560,null));};exports[_0xf70b('0x47')]=function(_0x57d22c,_0x3d42de,_0x39d549){return db['Condition'][_0xf70b('0x43')]({'where':{'id':_0x57d22c[_0xf70b('0x46')]['id']}})[_0xf70b('0x23')](handleEntityNotFound(_0x3d42de,null))['then'](function(_0xcf32b9){if(_0xcf32b9){return _0xcf32b9[_0xf70b('0x47')](_0x57d22c[_0xf70b('0x45')][_0xf70b('0x48')],_['omit'](_0x57d22c[_0xf70b('0x45')],[_0xf70b('0x48'),'id'])||{});}})['then'](respondWithResult(_0x3d42de,null))[_0xf70b('0x41')](handleError(_0x3d42de,null));};exports[_0xf70b('0x49')]=function(_0xab5e1d,_0x2676b0,_0x4b80f4){var _0x504366={};var _0x34c981={};var _0x40e9b1;var _0x55dd53;return db[_0xf70b('0x29')][_0xf70b('0x4a')]({'where':{'id':_0xab5e1d[_0xf70b('0x46')]['id']}})['then'](handleEntityNotFound(_0x2676b0,null))[_0xf70b('0x23')](function(_0x2446ce){if(_0x2446ce){_0x40e9b1=_0x2446ce;_0x34c981[_0xf70b('0x30')]=_['keys'](db[_0xf70b('0x4b')][_0xf70b('0x2a')]);_0x34c981[_0xf70b('0x2d')]=_['keys'](_0xab5e1d[_0xf70b('0x2d')]);_0x34c981[_0xf70b('0x2f')]=_[_0xf70b('0x31')](_0x34c981[_0xf70b('0x30')],_0x34c981[_0xf70b('0x2d')]);_0x504366[_0xf70b('0x33')]=_[_0xf70b('0x31')](_0x34c981[_0xf70b('0x30')],qs[_0xf70b('0x32')](_0xab5e1d[_0xf70b('0x2d')][_0xf70b('0x32')]));_0x504366[_0xf70b('0x33')]=_0x504366[_0xf70b('0x33')][_0xf70b('0x42')]?_0x504366[_0xf70b('0x33')]:_0x34c981[_0xf70b('0x30')];_0x504366[_0xf70b('0x34')]=qs[_0xf70b('0x35')](_0xab5e1d[_0xf70b('0x2d')][_0xf70b('0x35')]);_0x504366[_0xf70b('0x36')]=qs[_0xf70b('0x2f')](_[_0xf70b('0x37')](_0xab5e1d[_0xf70b('0x2d')],_0x34c981[_0xf70b('0x2f')]));if(_0xab5e1d['query'][_0xf70b('0x38')]){_0x504366[_0xf70b('0x36')]=_[_0xf70b('0x3b')](_0x504366[_0xf70b('0x36')],{'$or':_[_0xf70b('0x28')](_0x504366[_0xf70b('0x33')],function(_0x3ab410){var _0x5db767={};_0x5db767[_0x3ab410]={'$like':'%'+_0xab5e1d[_0xf70b('0x2d')][_0xf70b('0x38')]+'%'};return _0x5db767;})});}_0x504366=_[_0xf70b('0x3b')]({},_0x504366,_0xab5e1d[_0xf70b('0x3c')]);return _0x40e9b1[_0xf70b('0x49')](_0x504366);}})[_0xf70b('0x23')](function(_0x1321ff){if(_0x1321ff){_0x55dd53=_0x1321ff[_0xf70b('0x42')];if(!_0xab5e1d[_0xf70b('0x2d')][_0xf70b('0x4c')](_0xf70b('0x4d'))){_0x504366['limit']=qs[_0xf70b('0x1b')](_0xab5e1d[_0xf70b('0x2d')][_0xf70b('0x1b')]);_0x504366[_0xf70b('0x19')]=qs[_0xf70b('0x19')](_0xab5e1d[_0xf70b('0x2d')][_0xf70b('0x19')]);}return _0x40e9b1[_0xf70b('0x49')](_0x504366);}})[_0xf70b('0x23')](function(_0x179eb1){if(_0x179eb1){return _0x179eb1?{'count':_0x55dd53,'rows':_0x179eb1}:null;}})[_0xf70b('0x23')](respondWithResult(_0x2676b0,null))[_0xf70b('0x41')](handleError(_0x2676b0,null));};exports[_0xf70b('0x4e')]=function(_0x325702,_0x30623d,_0x4a9326){return db['Action']['find']({'where':{'id':_0x325702[_0xf70b('0x46')]['id']}})['then'](handleEntityNotFound(_0x30623d,null))[_0xf70b('0x23')](function(_0x20647b){if(_0x20647b){return _0x20647b[_0xf70b('0x4e')](_0x325702[_0xf70b('0x45')][_0xf70b('0x48')],_['omit'](_0x325702['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x30623d,null))[_0xf70b('0x41')](handleError(_0x30623d,null));};exports[_0xf70b('0x4f')]=function(_0x5cba8a,_0x1e99f9,_0x16bb59){var _0x3c32ba={};var _0x3ef8db={};var _0x15084c;var _0xcc5434;return db[_0xf70b('0x29')][_0xf70b('0x4a')]({'where':{'id':_0x5cba8a[_0xf70b('0x46')]['id']}})[_0xf70b('0x23')](handleEntityNotFound(_0x1e99f9,null))[_0xf70b('0x23')](function(_0x170aac){if(_0x170aac){_0x15084c=_0x170aac;_0x3ef8db[_0xf70b('0x30')]=_[_0xf70b('0x2e')](db[_0xf70b('0x50')]['rawAttributes']);_0x3ef8db['query']=_[_0xf70b('0x2e')](_0x5cba8a[_0xf70b('0x2d')]);_0x3ef8db[_0xf70b('0x2f')]=_[_0xf70b('0x31')](_0x3ef8db['model'],_0x3ef8db[_0xf70b('0x2d')]);_0x3c32ba[_0xf70b('0x33')]=_['intersection'](_0x3ef8db[_0xf70b('0x30')],qs['fields'](_0x5cba8a['query'][_0xf70b('0x32')]));_0x3c32ba[_0xf70b('0x33')]=_0x3c32ba['attributes'][_0xf70b('0x42')]?_0x3c32ba['attributes']:_0x3ef8db['model'];_0x3c32ba['order']=qs[_0xf70b('0x35')](_0x5cba8a[_0xf70b('0x2d')][_0xf70b('0x35')]);_0x3c32ba[_0xf70b('0x36')]=qs[_0xf70b('0x2f')](_[_0xf70b('0x37')](_0x5cba8a[_0xf70b('0x2d')],_0x3ef8db[_0xf70b('0x2f')]));if(_0x5cba8a['query'][_0xf70b('0x38')]){_0x3c32ba[_0xf70b('0x36')]=_[_0xf70b('0x3b')](_0x3c32ba['where'],{'$or':_[_0xf70b('0x28')](_0x3c32ba[_0xf70b('0x33')],function(_0x392db2){var _0x23e74a={};_0x23e74a[_0x392db2]={'$like':'%'+_0x5cba8a[_0xf70b('0x2d')][_0xf70b('0x38')]+'%'};return _0x23e74a;})});}_0x3c32ba=_['merge']({},_0x3c32ba,_0x5cba8a['options']);return _0x15084c[_0xf70b('0x4f')](_0x3c32ba);}})[_0xf70b('0x23')](function(_0x21e8d3){if(_0x21e8d3){_0xcc5434=_0x21e8d3[_0xf70b('0x42')];if(!_0x5cba8a[_0xf70b('0x2d')]['hasOwnProperty'](_0xf70b('0x4d'))){_0x3c32ba[_0xf70b('0x1b')]=qs[_0xf70b('0x1b')](_0x5cba8a[_0xf70b('0x2d')][_0xf70b('0x1b')]);_0x3c32ba[_0xf70b('0x19')]=qs['offset'](_0x5cba8a['query'][_0xf70b('0x19')]);}return _0x15084c['getActions'](_0x3c32ba);}})[_0xf70b('0x23')](function(_0x34a971){if(_0x34a971){return _0x34a971?{'count':_0xcc5434,'rows':_0x34a971}:null;}})[_0xf70b('0x23')](respondWithResult(_0x1e99f9,null))[_0xf70b('0x41')](handleError(_0x1e99f9,null));};
\ No newline at end of file
+var _0xe5e1=['then','destroy','sendStatus','error','stack','name','send','map','Automation','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','body','addConditions','Condition','omit','ids','getConditions','nolimit','addActions','getActions','Action','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update'];(function(_0x3d9f79,_0x3e71a7){var _0x336016=function(_0x33396d){while(--_0x33396d){_0x3d9f79['push'](_0x3d9f79['shift']());}};_0x336016(++_0x3e71a7);}(_0xe5e1,0xd2));var _0x1e5e=function(_0x296278,_0x543001){_0x296278=_0x296278-0x0;var _0x2ade7c=_0xe5e1[_0x296278];return _0x2ade7c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1e5e('0x0'));var jsonpatch=require(_0x1e5e('0x1'));var rp=require(_0x1e5e('0x2'));var moment=require(_0x1e5e('0x3'));var BPromise=require(_0x1e5e('0x4'));var Mustache=require('mustache');var util=require(_0x1e5e('0x5'));var path=require(_0x1e5e('0x6'));var sox=require('sox');var csv=require(_0x1e5e('0x7'));var ejs=require(_0x1e5e('0x8'));var fs=require('fs');var fs_extra=require(_0x1e5e('0x9'));var _=require(_0x1e5e('0xa'));var squel=require(_0x1e5e('0xb'));var crypto=require(_0x1e5e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1e5e('0xd'));var toCsv=require(_0x1e5e('0x7'));var querystring=require(_0x1e5e('0xe'));var Papa=require('papaparse');var Redis=require(_0x1e5e('0xf'));var authService=require(_0x1e5e('0x10'));var qs=require(_0x1e5e('0x11'));var as=require(_0x1e5e('0x12'));var hardwareService=require(_0x1e5e('0x13'));var logger=require(_0x1e5e('0x14'))('api');var utils=require(_0x1e5e('0x15'));var config=require(_0x1e5e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1e5e('0x17'))['db'];function respondWithStatusCode(_0x4f9d0c,_0x4f2e87){_0x4f2e87=_0x4f2e87||0xcc;return function(_0x23d374){if(_0x23d374){return _0x4f9d0c['sendStatus'](_0x4f2e87);}return _0x4f9d0c[_0x1e5e('0x18')](_0x4f2e87)[_0x1e5e('0x19')]();};}function respondWithResult(_0x4fd727,_0x5e6a44){_0x5e6a44=_0x5e6a44||0xc8;return function(_0x1f8d01){if(_0x1f8d01){return _0x4fd727[_0x1e5e('0x18')](_0x5e6a44)[_0x1e5e('0x1a')](_0x1f8d01);}};}function respondWithFilteredResult(_0x3890a1,_0x5d2826){return function(_0x5e0022){if(_0x5e0022){var _0xf9a4f6=typeof _0x5d2826[_0x1e5e('0x1b')]===_0x1e5e('0x1c')&&typeof _0x5d2826['limit']===_0x1e5e('0x1c');var _0x4651b0=_0x5e0022['count'];var _0x4dec64=_0xf9a4f6?0x0:_0x5d2826[_0x1e5e('0x1b')];var _0x468572=_0xf9a4f6?_0x5e0022[_0x1e5e('0x1d')]:_0x5d2826['offset']+_0x5d2826[_0x1e5e('0x1e')];var _0x5ca691;if(_0x468572>=_0x4651b0){_0x468572=_0x4651b0;_0x5ca691=0xc8;}else{_0x5ca691=0xce;}_0x3890a1[_0x1e5e('0x18')](_0x5ca691);return _0x3890a1[_0x1e5e('0x1f')](_0x1e5e('0x20'),_0x4dec64+'-'+_0x468572+'/'+_0x4651b0)[_0x1e5e('0x1a')](_0x5e0022);}return null;};}function patchUpdates(_0x35933e){return function(_0x45e22c){try{jsonpatch[_0x1e5e('0x21')](_0x45e22c,_0x35933e,!![]);}catch(_0x5a0eb4){return BPromise['reject'](_0x5a0eb4);}return _0x45e22c[_0x1e5e('0x22')]();};}function saveUpdates(_0x214f7d,_0x1dfdd2){return function(_0x5c0555){if(_0x5c0555){return _0x5c0555[_0x1e5e('0x23')](_0x214f7d)[_0x1e5e('0x24')](function(_0x2f3c7b){return _0x2f3c7b;});}return null;};}function removeEntity(_0x1a6f80,_0x5eeda6){return function(_0x445955){if(_0x445955){return _0x445955[_0x1e5e('0x25')]()['then'](function(){_0x1a6f80['status'](0xcc)[_0x1e5e('0x19')]();});}};}function handleEntityNotFound(_0x21b208,_0x4a9b98){return function(_0x32380e){if(!_0x32380e){_0x21b208[_0x1e5e('0x26')](0x194);}return _0x32380e;};}function handleError(_0x1337ab,_0x20b2b3){_0x20b2b3=_0x20b2b3||0x1f4;return function(_0x4a1733){logger[_0x1e5e('0x27')](_0x4a1733[_0x1e5e('0x28')]);if(_0x4a1733['name']){delete _0x4a1733[_0x1e5e('0x29')];}_0x1337ab['status'](_0x20b2b3)[_0x1e5e('0x2a')](_0x4a1733);};}exports['index']=function(_0x3dc47a,_0x13a88c){var _0x3fb87f={},_0x166c28={},_0x2bad94={'count':0x0,'rows':[]};var _0x460976=_[_0x1e5e('0x2b')](db[_0x1e5e('0x2c')][_0x1e5e('0x2d')],function(_0x3dbacf){return{'name':_0x3dbacf[_0x1e5e('0x2e')],'type':_0x3dbacf[_0x1e5e('0x2f')][_0x1e5e('0x30')]};});_0x166c28['model']=_[_0x1e5e('0x2b')](_0x460976,_0x1e5e('0x29'));_0x166c28[_0x1e5e('0x31')]=_[_0x1e5e('0x32')](_0x3dc47a['query']);_0x166c28['filters']=_[_0x1e5e('0x33')](_0x166c28[_0x1e5e('0x34')],_0x166c28[_0x1e5e('0x31')]);_0x3fb87f['attributes']=_[_0x1e5e('0x33')](_0x166c28[_0x1e5e('0x34')],qs[_0x1e5e('0x35')](_0x3dc47a[_0x1e5e('0x31')]['fields']));_0x3fb87f['attributes']=_0x3fb87f[_0x1e5e('0x36')][_0x1e5e('0x37')]?_0x3fb87f[_0x1e5e('0x36')]:_0x166c28[_0x1e5e('0x34')];if(!_0x3dc47a[_0x1e5e('0x31')][_0x1e5e('0x38')]('nolimit')){_0x3fb87f[_0x1e5e('0x1e')]=qs[_0x1e5e('0x1e')](_0x3dc47a[_0x1e5e('0x31')][_0x1e5e('0x1e')]);_0x3fb87f[_0x1e5e('0x1b')]=qs[_0x1e5e('0x1b')](_0x3dc47a[_0x1e5e('0x31')][_0x1e5e('0x1b')]);}_0x3fb87f[_0x1e5e('0x39')]=qs['sort'](_0x3dc47a[_0x1e5e('0x31')][_0x1e5e('0x3a')]);_0x3fb87f[_0x1e5e('0x3b')]=qs['filters'](_[_0x1e5e('0x3c')](_0x3dc47a[_0x1e5e('0x31')],_0x166c28[_0x1e5e('0x3d')]),_0x460976);if(_0x3dc47a[_0x1e5e('0x31')][_0x1e5e('0x3e')]){_0x3fb87f[_0x1e5e('0x3b')]=_[_0x1e5e('0x3f')](_0x3fb87f[_0x1e5e('0x3b')],{'$or':_['map'](_0x460976,function(_0x413444){if(_0x413444[_0x1e5e('0x2f')]!=='VIRTUAL'){var _0x5f35d6={};_0x5f35d6[_0x413444[_0x1e5e('0x29')]]={'$like':'%'+_0x3dc47a[_0x1e5e('0x31')][_0x1e5e('0x3e')]+'%'};return _0x5f35d6;}})});}_0x3fb87f=_[_0x1e5e('0x3f')]({},_0x3fb87f,_0x3dc47a[_0x1e5e('0x40')]);var _0x5efeeb={'where':_0x3fb87f[_0x1e5e('0x3b')]};return db[_0x1e5e('0x2c')]['count'](_0x5efeeb)[_0x1e5e('0x24')](function(_0x40aa37){_0x2bad94[_0x1e5e('0x1d')]=_0x40aa37;if(_0x3dc47a[_0x1e5e('0x31')][_0x1e5e('0x41')]){_0x3fb87f[_0x1e5e('0x42')]=[{'all':!![]}];}return db['Automation'][_0x1e5e('0x43')](_0x3fb87f);})[_0x1e5e('0x24')](function(_0x243502){_0x2bad94[_0x1e5e('0x44')]=_0x243502;return _0x2bad94;})[_0x1e5e('0x24')](respondWithFilteredResult(_0x13a88c,_0x3fb87f))[_0x1e5e('0x45')](handleError(_0x13a88c,null));};exports['show']=function(_0x57a821,_0x236162){var _0x5326d4={'raw':![],'where':{'id':_0x57a821[_0x1e5e('0x46')]['id']}},_0x10cf94={};_0x10cf94[_0x1e5e('0x34')]=_[_0x1e5e('0x32')](db[_0x1e5e('0x2c')][_0x1e5e('0x2d')]);_0x10cf94['query']=_[_0x1e5e('0x32')](_0x57a821['query']);_0x10cf94[_0x1e5e('0x3d')]=_[_0x1e5e('0x33')](_0x10cf94[_0x1e5e('0x34')],_0x10cf94[_0x1e5e('0x31')]);_0x5326d4[_0x1e5e('0x36')]=_[_0x1e5e('0x33')](_0x10cf94[_0x1e5e('0x34')],qs[_0x1e5e('0x35')](_0x57a821[_0x1e5e('0x31')][_0x1e5e('0x35')]));_0x5326d4[_0x1e5e('0x36')]=_0x5326d4['attributes']['length']?_0x5326d4[_0x1e5e('0x36')]:_0x10cf94['model'];if(_0x57a821[_0x1e5e('0x31')][_0x1e5e('0x41')]){_0x5326d4[_0x1e5e('0x42')]=[{'all':!![]}];}_0x5326d4=_[_0x1e5e('0x3f')]({},_0x5326d4,_0x57a821[_0x1e5e('0x40')]);return db[_0x1e5e('0x2c')][_0x1e5e('0x47')](_0x5326d4)[_0x1e5e('0x24')](handleEntityNotFound(_0x236162,null))[_0x1e5e('0x24')](respondWithResult(_0x236162,null))['catch'](handleError(_0x236162,null));};exports['create']=function(_0x41e77a,_0x57ce52){return db[_0x1e5e('0x2c')]['create'](_0x41e77a[_0x1e5e('0x48')],{})['then'](respondWithResult(_0x57ce52,0xc9))[_0x1e5e('0x45')](handleError(_0x57ce52,null));};exports[_0x1e5e('0x23')]=function(_0x18e034,_0x1f51f5){if(_0x18e034[_0x1e5e('0x48')]['id']){delete _0x18e034[_0x1e5e('0x48')]['id'];}return db[_0x1e5e('0x2c')][_0x1e5e('0x47')]({'where':{'id':_0x18e034[_0x1e5e('0x46')]['id']}})[_0x1e5e('0x24')](handleEntityNotFound(_0x1f51f5,null))[_0x1e5e('0x24')](saveUpdates(_0x18e034[_0x1e5e('0x48')],null))[_0x1e5e('0x24')](respondWithResult(_0x1f51f5,null))[_0x1e5e('0x45')](handleError(_0x1f51f5,null));};exports['destroy']=function(_0x3a4d60,_0x1b6703){return db[_0x1e5e('0x2c')]['find']({'where':{'id':_0x3a4d60[_0x1e5e('0x46')]['id']}})[_0x1e5e('0x24')](handleEntityNotFound(_0x1b6703,null))[_0x1e5e('0x24')](removeEntity(_0x1b6703,null))['catch'](handleError(_0x1b6703,null));};exports[_0x1e5e('0x49')]=function(_0x26e462,_0x3efacf,_0x3e721e){return db[_0x1e5e('0x4a')][_0x1e5e('0x47')]({'where':{'id':_0x26e462[_0x1e5e('0x46')]['id']}})['then'](handleEntityNotFound(_0x3efacf,null))['then'](function(_0x368a41){if(_0x368a41){return _0x368a41[_0x1e5e('0x49')](_0x26e462[_0x1e5e('0x48')]['ids'],_[_0x1e5e('0x4b')](_0x26e462[_0x1e5e('0x48')],[_0x1e5e('0x4c'),'id'])||{});}})[_0x1e5e('0x24')](respondWithResult(_0x3efacf,null))[_0x1e5e('0x45')](handleError(_0x3efacf,null));};exports[_0x1e5e('0x4d')]=function(_0x3fa3bf,_0x4612ea,_0x24ac6a){var _0x48f307={};var _0x530733={};var _0xed9bec;var _0x2a7656;return db[_0x1e5e('0x2c')]['findOne']({'where':{'id':_0x3fa3bf[_0x1e5e('0x46')]['id']}})['then'](handleEntityNotFound(_0x4612ea,null))['then'](function(_0x230e2b){if(_0x230e2b){_0xed9bec=_0x230e2b;_0x530733[_0x1e5e('0x34')]=_[_0x1e5e('0x32')](db[_0x1e5e('0x4a')]['rawAttributes']);_0x530733[_0x1e5e('0x31')]=_[_0x1e5e('0x32')](_0x3fa3bf['query']);_0x530733['filters']=_['intersection'](_0x530733['model'],_0x530733[_0x1e5e('0x31')]);_0x48f307[_0x1e5e('0x36')]=_[_0x1e5e('0x33')](_0x530733[_0x1e5e('0x34')],qs['fields'](_0x3fa3bf[_0x1e5e('0x31')][_0x1e5e('0x35')]));_0x48f307[_0x1e5e('0x36')]=_0x48f307[_0x1e5e('0x36')][_0x1e5e('0x37')]?_0x48f307[_0x1e5e('0x36')]:_0x530733[_0x1e5e('0x34')];_0x48f307['order']=qs[_0x1e5e('0x3a')](_0x3fa3bf['query'][_0x1e5e('0x3a')]);_0x48f307[_0x1e5e('0x3b')]=qs[_0x1e5e('0x3d')](_[_0x1e5e('0x3c')](_0x3fa3bf[_0x1e5e('0x31')],_0x530733[_0x1e5e('0x3d')]));if(_0x3fa3bf[_0x1e5e('0x31')]['filter']){_0x48f307[_0x1e5e('0x3b')]=_['merge'](_0x48f307['where'],{'$or':_[_0x1e5e('0x2b')](_0x48f307[_0x1e5e('0x36')],function(_0x2e4f88){var _0x574008={};_0x574008[_0x2e4f88]={'$like':'%'+_0x3fa3bf[_0x1e5e('0x31')]['filter']+'%'};return _0x574008;})});}_0x48f307=_[_0x1e5e('0x3f')]({},_0x48f307,_0x3fa3bf[_0x1e5e('0x40')]);return _0xed9bec[_0x1e5e('0x4d')](_0x48f307);}})['then'](function(_0x16de22){if(_0x16de22){_0x2a7656=_0x16de22['length'];if(!_0x3fa3bf[_0x1e5e('0x31')][_0x1e5e('0x38')](_0x1e5e('0x4e'))){_0x48f307[_0x1e5e('0x1e')]=qs[_0x1e5e('0x1e')](_0x3fa3bf['query']['limit']);_0x48f307[_0x1e5e('0x1b')]=qs[_0x1e5e('0x1b')](_0x3fa3bf[_0x1e5e('0x31')][_0x1e5e('0x1b')]);}return _0xed9bec[_0x1e5e('0x4d')](_0x48f307);}})[_0x1e5e('0x24')](function(_0x52c8ef){if(_0x52c8ef){return _0x52c8ef?{'count':_0x2a7656,'rows':_0x52c8ef}:null;}})[_0x1e5e('0x24')](respondWithResult(_0x4612ea,null))[_0x1e5e('0x45')](handleError(_0x4612ea,null));};exports[_0x1e5e('0x4f')]=function(_0x2fab98,_0x23453b,_0x487916){return db['Action'][_0x1e5e('0x47')]({'where':{'id':_0x2fab98[_0x1e5e('0x46')]['id']}})[_0x1e5e('0x24')](handleEntityNotFound(_0x23453b,null))[_0x1e5e('0x24')](function(_0xc4c7ef){if(_0xc4c7ef){return _0xc4c7ef[_0x1e5e('0x4f')](_0x2fab98['body']['ids'],_['omit'](_0x2fab98[_0x1e5e('0x48')],['ids','id'])||{});}})[_0x1e5e('0x24')](respondWithResult(_0x23453b,null))['catch'](handleError(_0x23453b,null));};exports[_0x1e5e('0x50')]=function(_0x9869ee,_0x50684b,_0xe7be8d){var _0x326819={};var _0x4e1640={};var _0x19af2d;var _0x26dad1;return db[_0x1e5e('0x2c')]['findOne']({'where':{'id':_0x9869ee[_0x1e5e('0x46')]['id']}})[_0x1e5e('0x24')](handleEntityNotFound(_0x50684b,null))[_0x1e5e('0x24')](function(_0x983c42){if(_0x983c42){_0x19af2d=_0x983c42;_0x4e1640[_0x1e5e('0x34')]=_[_0x1e5e('0x32')](db[_0x1e5e('0x51')][_0x1e5e('0x2d')]);_0x4e1640[_0x1e5e('0x31')]=_[_0x1e5e('0x32')](_0x9869ee[_0x1e5e('0x31')]);_0x4e1640[_0x1e5e('0x3d')]=_[_0x1e5e('0x33')](_0x4e1640[_0x1e5e('0x34')],_0x4e1640['query']);_0x326819['attributes']=_[_0x1e5e('0x33')](_0x4e1640[_0x1e5e('0x34')],qs['fields'](_0x9869ee[_0x1e5e('0x31')][_0x1e5e('0x35')]));_0x326819[_0x1e5e('0x36')]=_0x326819[_0x1e5e('0x36')][_0x1e5e('0x37')]?_0x326819[_0x1e5e('0x36')]:_0x4e1640[_0x1e5e('0x34')];_0x326819['order']=qs[_0x1e5e('0x3a')](_0x9869ee[_0x1e5e('0x31')][_0x1e5e('0x3a')]);_0x326819[_0x1e5e('0x3b')]=qs[_0x1e5e('0x3d')](_['pick'](_0x9869ee[_0x1e5e('0x31')],_0x4e1640[_0x1e5e('0x3d')]));if(_0x9869ee[_0x1e5e('0x31')][_0x1e5e('0x3e')]){_0x326819[_0x1e5e('0x3b')]=_[_0x1e5e('0x3f')](_0x326819[_0x1e5e('0x3b')],{'$or':_[_0x1e5e('0x2b')](_0x326819[_0x1e5e('0x36')],function(_0x329b7e){var _0x4d9406={};_0x4d9406[_0x329b7e]={'$like':'%'+_0x9869ee['query'][_0x1e5e('0x3e')]+'%'};return _0x4d9406;})});}_0x326819=_[_0x1e5e('0x3f')]({},_0x326819,_0x9869ee[_0x1e5e('0x40')]);return _0x19af2d[_0x1e5e('0x50')](_0x326819);}})['then'](function(_0x561331){if(_0x561331){_0x26dad1=_0x561331[_0x1e5e('0x37')];if(!_0x9869ee[_0x1e5e('0x31')][_0x1e5e('0x38')]('nolimit')){_0x326819[_0x1e5e('0x1e')]=qs[_0x1e5e('0x1e')](_0x9869ee[_0x1e5e('0x31')]['limit']);_0x326819['offset']=qs[_0x1e5e('0x1b')](_0x9869ee[_0x1e5e('0x31')]['offset']);}return _0x19af2d[_0x1e5e('0x50')](_0x326819);}})['then'](function(_0x3b649d){if(_0x3b649d){return _0x3b649d?{'count':_0x26dad1,'rows':_0x3b649d}:null;}})[_0x1e5e('0x24')](respondWithResult(_0x50684b,null))[_0x1e5e('0x45')](handleError(_0x50684b,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index d76217d..23fdc04 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 _0x47c1=['bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment'];(function(_0xa9ac7a,_0xa358de){var _0x58aae7=function(_0x1fb29c){while(--_0x1fb29c){_0xa9ac7a['push'](_0xa9ac7a['shift']());}};_0x58aae7(++_0xa358de);}(_0x47c1,0xa3));var _0x147c=function(_0x58284c,_0x52bfa7){_0x58284c=_0x58284c-0x0;var _0x4fc8bb=_0x47c1[_0x58284c];return _0x4fc8bb;};'use strict';var _=require(_0x147c('0x0'));var util=require(_0x147c('0x1'));var logger=require(_0x147c('0x2'))(_0x147c('0x3'));var moment=require(_0x147c('0x4'));var BPromise=require(_0x147c('0x5'));var rp=require(_0x147c('0x6'));var fs=require('fs');var path=require(_0x147c('0x7'));var rimraf=require(_0x147c('0x8'));var config=require('../../config/environment');var attributes=require(_0x147c('0x9'));module[_0x147c('0xa')]=function(_0x469075,_0x1930c5){return _0x469075[_0x147c('0xb')](_0x147c('0xc'),attributes,{'tableName':_0x147c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf452=['../../config/logger','api','moment','bluebird','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util'];(function(_0x587c36,_0x290584){var _0x8f3e11=function(_0x352b39){while(--_0x352b39){_0x587c36['push'](_0x587c36['shift']());}};_0x8f3e11(++_0x290584);}(_0xf452,0xaf));var _0x2f45=function(_0x1fcfa2,_0xf609b4){_0x1fcfa2=_0x1fcfa2-0x0;var _0x412b90=_0xf452[_0x1fcfa2];return _0x412b90;};'use strict';var _=require('lodash');var util=require(_0x2f45('0x0'));var logger=require(_0x2f45('0x1'))(_0x2f45('0x2'));var moment=require(_0x2f45('0x3'));var BPromise=require(_0x2f45('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2f45('0x5'));var attributes=require(_0x2f45('0x6'));module[_0x2f45('0x7')]=function(_0x3e47c6,_0x59a65d){return _0x3e47c6[_0x2f45('0x8')](_0x2f45('0x9'),attributes,{'tableName':_0x2f45('0xa'),'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 ea72c34..76dfe3e 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 _0xb6da=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x203bf4,_0x25fd0c){var _0x3a6598=function(_0x1caaf2){while(--_0x1caaf2){_0x203bf4['push'](_0x203bf4['shift']());}};_0x3a6598(++_0x25fd0c);}(_0xb6da,0x8e));var _0xab6d=function(_0x17976c,_0x5205e7){_0x17976c=_0x17976c-0x0;var _0x68ac6f=_0xb6da[_0x17976c];return _0x68ac6f;};'use strict';var _=require(_0xab6d('0x0'));var util=require('util');var moment=require(_0xab6d('0x1'));var BPromise=require(_0xab6d('0x2'));var rs=require(_0xab6d('0x3'));var fs=require('fs');var Redis=require(_0xab6d('0x4'));var db=require(_0xab6d('0x5'))['db'];var utils=require(_0xab6d('0x6'));var logger=require(_0xab6d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xab6d('0x8'));var client=jayson[_0xab6d('0x9')][_0xab6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x130285,_0x359bef,_0x44d5fa){return new BPromise(function(_0x4ba0f7,_0x2e30f1){return client['request'](_0x130285,_0x44d5fa)[_0xab6d('0xb')](function(_0x590cfa){logger['info'](_0xab6d('0xc'),_0x359bef,_0xab6d('0xd'));logger['debug'](_0xab6d('0xe'),_0x359bef,'request\x20sent',JSON['stringify'](_0x590cfa));if(_0x590cfa[_0xab6d('0xf')]){if(_0x590cfa[_0xab6d('0xf')][_0xab6d('0x10')]===0x1f4){logger[_0xab6d('0xf')](_0xab6d('0xc'),_0x359bef,_0x590cfa[_0xab6d('0xf')][_0xab6d('0x11')]);return _0x2e30f1(_0x590cfa[_0xab6d('0xf')]['message']);}logger[_0xab6d('0xf')](_0xab6d('0xc'),_0x359bef,_0x590cfa[_0xab6d('0xf')][_0xab6d('0x11')]);return _0x4ba0f7(_0x590cfa[_0xab6d('0xf')][_0xab6d('0x11')]);}else{logger['info'](_0xab6d('0xc'),_0x359bef,_0xab6d('0xd'));_0x4ba0f7(_0x590cfa[_0xab6d('0x12')]['message']);}})[_0xab6d('0x13')](function(_0x3bd40a){logger[_0xab6d('0xf')](_0xab6d('0xc'),_0x359bef,_0x3bd40a);_0x2e30f1(_0x3bd40a);});});}
\ No newline at end of file
+var _0x84c6=['catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','code','Automation,\x20%s,\x20%s','error','message','result'];(function(_0x243e52,_0x1915d9){var _0x1d42ab=function(_0xf7add1){while(--_0xf7add1){_0x243e52['push'](_0x243e52['shift']());}};_0x1d42ab(++_0x1915d9);}(_0x84c6,0xe7));var _0x684c=function(_0x1fc470,_0x1de953){_0x1fc470=_0x1fc470-0x0;var _0x1f3991=_0x84c6[_0x1fc470];return _0x1f3991;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x684c('0x0'));var BPromise=require(_0x684c('0x1'));var rs=require(_0x684c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x684c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x684c('0x4'))(_0x684c('0x5'));var config=require(_0x684c('0x6'));var jayson=require(_0x684c('0x7'));var client=jayson[_0x684c('0x8')][_0x684c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x209f74,_0x2c52dd,_0x168935){return new BPromise(function(_0x2fd628,_0x5824d8){return client[_0x684c('0xa')](_0x209f74,_0x168935)[_0x684c('0xb')](function(_0x5502ad){logger[_0x684c('0xc')]('Automation,\x20%s,\x20%s',_0x2c52dd,_0x684c('0xd'));logger[_0x684c('0xe')](_0x684c('0xf'),_0x2c52dd,_0x684c('0xd'),JSON[_0x684c('0x10')](_0x5502ad));if(_0x5502ad['error']){if(_0x5502ad['error'][_0x684c('0x11')]===0x1f4){logger['error'](_0x684c('0x12'),_0x2c52dd,_0x5502ad[_0x684c('0x13')][_0x684c('0x14')]);return _0x5824d8(_0x5502ad['error'][_0x684c('0x14')]);}logger['error'](_0x684c('0x12'),_0x2c52dd,_0x5502ad[_0x684c('0x13')][_0x684c('0x14')]);return _0x2fd628(_0x5502ad[_0x684c('0x13')][_0x684c('0x14')]);}else{logger[_0x684c('0xc')](_0x684c('0x12'),_0x2c52dd,_0x684c('0xd'));_0x2fd628(_0x5502ad[_0x684c('0x15')]['message']);}})[_0x684c('0x16')](function(_0x5dd4f1){logger['error'](_0x684c('0x12'),_0x2c52dd,_0x5dd4f1);_0x5824d8(_0x5dd4f1);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 6be8d69..0b0203c 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 _0x8fe4=['../../config/environment','./automation.controller','get','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','post','create','addActions','put','/:id','update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8fe4,0x170));var _0x48fe=function(_0x23b801,_0x2b2c30){_0x23b801=_0x23b801-0x0;var _0x340c60=_0x8fe4[_0x23b801];return _0x340c60;};'use strict';var multer=require(_0x48fe('0x0'));var util=require(_0x48fe('0x1'));var path=require('path');var timeout=require(_0x48fe('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x48fe('0x3'));var auth=require(_0x48fe('0x4'));var interaction=require(_0x48fe('0x5'));var config=require(_0x48fe('0x6'));var controller=require(_0x48fe('0x7'));router[_0x48fe('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x48fe('0x9')](),controller[_0x48fe('0xa')]);router[_0x48fe('0x8')](_0x48fe('0xb'),auth['isAuthenticated'](),controller[_0x48fe('0xc')]);router[_0x48fe('0x8')](_0x48fe('0xd'),auth[_0x48fe('0x9')](),controller['getActions']);router[_0x48fe('0xe')]('/',auth[_0x48fe('0x9')](),controller[_0x48fe('0xf')]);router[_0x48fe('0xe')](_0x48fe('0xb'),auth[_0x48fe('0x9')](),controller['addConditions']);router[_0x48fe('0xe')](_0x48fe('0xd'),auth['isAuthenticated'](),controller[_0x48fe('0x10')]);router[_0x48fe('0x11')](_0x48fe('0x12'),auth[_0x48fe('0x9')](),controller[_0x48fe('0x13')]);router['delete'](_0x48fe('0x12'),auth[_0x48fe('0x9')](),controller[_0x48fe('0x14')]);module[_0x48fe('0x15')]=router;
\ No newline at end of file
+var _0x351d=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./automation.controller','isAuthenticated','get','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','exports','multer'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x351d,0x137));var _0xd351=function(_0xe010fc,_0x1caf6d){_0xe010fc=_0xe010fc-0x0;var _0x3a3f75=_0x351d[_0xe010fc];return _0x3a3f75;};'use strict';var multer=require(_0xd351('0x0'));var util=require(_0xd351('0x1'));var path=require(_0xd351('0x2'));var timeout=require(_0xd351('0x3'));var express=require(_0xd351('0x4'));var router=express[_0xd351('0x5')]();var fs_extra=require(_0xd351('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd351('0x7'));var config=require('../../config/environment');var controller=require(_0xd351('0x8'));router['get']('/',auth[_0xd351('0x9')](),controller['index']);router[_0xd351('0xa')](_0xd351('0xb'),auth[_0xd351('0x9')](),controller[_0xd351('0xc')]);router[_0xd351('0xa')](_0xd351('0xd'),auth[_0xd351('0x9')](),controller[_0xd351('0xe')]);router[_0xd351('0xa')](_0xd351('0xf'),auth['isAuthenticated'](),controller[_0xd351('0x10')]);router[_0xd351('0x11')]('/',auth[_0xd351('0x9')](),controller[_0xd351('0x12')]);router[_0xd351('0x11')](_0xd351('0xd'),auth[_0xd351('0x9')](),controller[_0xd351('0x13')]);router[_0xd351('0x11')](_0xd351('0xf'),auth[_0xd351('0x9')](),controller[_0xd351('0x14')]);router[_0xd351('0x15')]('/:id',auth[_0xd351('0x9')](),controller[_0xd351('0x16')]);router[_0xd351('0x17')](_0xd351('0xb'),auth['isAuthenticated'](),controller[_0xd351('0x18')]);module[_0xd351('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 807d71e..698c321 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 _0x1b5b=['#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)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x1b5b,0x74));var _0xb1b5=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0x1b5b[_0x269ee8];return _0x4d98bd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb1b5('0x0'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb1b5('0x1')](_0xb1b5('0x2')),'allowNull':![],'defaultValue':_0xb1b5('0x2')},'description':{'type':Sequelize[_0xb1b5('0x3')]},'active':{'type':Sequelize[_0xb1b5('0x4')],'defaultValue':0x0,'comment':_0xb1b5('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb1b5('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb1b5('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb1b5('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0xb1b5('0x7')](0x3)[_0xb1b5('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1b5('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1b5('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb1b5('0x7')](0x5)[_0xb1b5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb1b5('0x7')](0x3)[_0xb1b5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1b5('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb1b5('0x7')](0x5)[_0xb1b5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1b5('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb1b5('0x7')](0x3)[_0xb1b5('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb1b5('0x7')](0x5)[_0xb1b5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1b5('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb1b5('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xb1b5('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb1b5('0x3')],'defaultValue':_0xb1b5('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xb1b5('0x1')](_0xb1b5('0xf'),_0xb1b5('0x10'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xb1b5('0x4')],'defaultValue':0x0,'comment':_0xb1b5('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0xb1b5('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb1b5('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xb1b5('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb1b5('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb1b5('0x7')](0x9)[_0xb1b5('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb1b5('0x7')](0x9)[_0xb1b5('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb1b5('0x14')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb1b5('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb1b5('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb1b5('0x7')](0x9)[_0xb1b5('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb1b5('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb1b5('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb1b5('0x7')](0x5)[_0xb1b5('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb1b5('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb1b5('0x7')](0x9)[_0xb1b5('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb1b5('0x1')]('DESC','ASC'),'defaultValue':_0xb1b5('0x18')},'dialPrefix':{'type':Sequelize[_0xb1b5('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb1b5('0x7')](0x3)[_0xb1b5('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb1b5('0x19')},'dialCutDigit':{'type':Sequelize[_0xb1b5('0x7')](0x3)[_0xb1b5('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb1b5('0x7')](0x3)[_0xb1b5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1b5('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb1b5('0x7')](0x5)[_0xb1b5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1b5('0x1b')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1b5('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xb1b5('0x7')](0x5)[_0xb1b5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1b5('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb1b5('0x7')](0x3)[_0xb1b5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1b5('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb1b5('0x7')](0x5)[_0xb1b5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1b5('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0xb1b5('0x7')](0x3)[_0xb1b5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1b5('0x20')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb1b5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1b5('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb1b5('0x7')](0x3)[_0xb1b5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1b5('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb1b5('0x7')](0x5)[_0xb1b5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1b5('0x23')}};
\ No newline at end of file
+var _0x8544=['name','ivr','BOOLEAN','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#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','ASC','DESC','Random\x20Last\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)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x8544,0x11c));var _0x4854=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x8544[_0x368fb9];return _0x4892fb;};'use strict';var Sequelize=require(_0x4854('0x0'));module[_0x4854('0x1')]={'name':{'type':Sequelize[_0x4854('0x2')],'unique':_0x4854('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x4854('0x4')),'allowNull':![],'defaultValue':_0x4854('0x4')},'description':{'type':Sequelize[_0x4854('0x2')]},'active':{'type':Sequelize[_0x4854('0x5')],'defaultValue':0x0,'comment':_0x4854('0x6')},'limitCalls':{'type':Sequelize[_0x4854('0x7')](0x4)[_0x4854('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4854('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4854('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4854('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x4854('0x7')](0x3)[_0x4854('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4854('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4854('0x7')](0x3)[_0x4854('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4854('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4854('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4854('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x4854('0x7')](0x3)[_0x4854('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x4854('0x7')](0x5)[_0x4854('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4854('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4854('0x8')],'defaultValue':0x3,'comment':_0x4854('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4854('0x7')](0x5)[_0x4854('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4854('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4854('0x7')](0x3)[_0x4854('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4854('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4854('0x2')],'defaultValue':_0x4854('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x4854('0x12')]('always','never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x4854('0x5')],'defaultValue':0x0,'comment':_0x4854('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x4854('0x7')](0x9)[_0x4854('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4854('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x4854('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4854('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4854('0x7')](0x9)[_0x4854('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4854('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4854('0x7')](0x9)[_0x4854('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4854('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x4854('0x7')](0x9)[_0x4854('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4854('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4854('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4854('0x7')](0x9)[_0x4854('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4854('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4854('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4854('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4854('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4854('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x4854('0x1d')),'defaultValue':_0x4854('0x1e')},'dialPrefix':{'type':Sequelize[_0x4854('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4854('0x7')](0x3)[_0x4854('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4854('0x1f')},'dialCutDigit':{'type':Sequelize[_0x4854('0x7')](0x3)[_0x4854('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4854('0x7')](0x3)[_0x4854('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4854('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4854('0x7')](0x5)[_0x4854('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4854('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x4854('0x7')](0x3)[_0x4854('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4854('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x4854('0x7')](0x5)[_0x4854('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4854('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4854('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4854('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4854('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x4854('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4854('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4854('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4854('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4854('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4854('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4854('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4854('0x28')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 2801a79..3bf4251 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 _0x6324=['CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','fromQuery','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','push','sequelize','all','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../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','IvrCampaigns','UserProfileResource','error','stack','name','send','map','Campaign','fieldName','type','keys','query','filters','intersection','model','attributes','nolimit','order','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','fields','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','updatedAt','body','getHoppers','findOne','CmHopper','hasOwnProperty','sort','getHopperHistories','CmHopperHistory','CampaignId','rows','getHopperFinals','CmHopperFinal','pick','CmHopperBlack','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','cm_hopper','scheduledAt','ContactId','ListId','createdAt','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final'];(function(_0x110f59,_0x31ef13){var _0x5b77e8=function(_0x317244){while(--_0x317244){_0x110f59['push'](_0x110f59['shift']());}};_0x5b77e8(++_0x31ef13);}(_0x6324,0x142));var _0x4632=function(_0x4afc33,_0x5088fd){_0x4afc33=_0x4afc33-0x0;var _0x448b1c=_0x6324[_0x4afc33];return _0x448b1c;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b3f0f,_0x499d88){_0x499d88=_0x499d88||0xcc;return function(_0x4719f7){if(_0x4719f7){return _0x2b3f0f[_0x4632('0x18')](_0x499d88);}return _0x2b3f0f[_0x4632('0x19')](_0x499d88)[_0x4632('0x1a')]();};}function respondWithResult(_0x51ee37,_0x3ba361){_0x3ba361=_0x3ba361||0xc8;return function(_0x255882){if(_0x255882){return _0x51ee37[_0x4632('0x19')](_0x3ba361)[_0x4632('0x1b')](_0x255882);}};}function respondWithFilteredResult(_0x1c1be0,_0x5438ab){return function(_0x47b349){if(_0x47b349){var _0x2fd7ae=typeof _0x5438ab[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x5438ab[_0x4632('0x1e')]==='undefined';var _0x158831=_0x47b349[_0x4632('0x1f')];var _0x1a94c0=_0x2fd7ae?0x0:_0x5438ab['offset'];var _0x3cddfa=_0x2fd7ae?_0x47b349[_0x4632('0x1f')]:_0x5438ab['offset']+_0x5438ab['limit'];var _0x1c0523;if(_0x3cddfa>=_0x158831){_0x3cddfa=_0x158831;_0x1c0523=0xc8;}else{_0x1c0523=0xce;}_0x1c1be0[_0x4632('0x19')](_0x1c0523);return _0x1c1be0[_0x4632('0x20')](_0x4632('0x21'),_0x1a94c0+'-'+_0x3cddfa+'/'+_0x158831)[_0x4632('0x1b')](_0x47b349);}return null;};}function patchUpdates(_0x3d2d23){return function(_0x9ab826){try{jsonpatch[_0x4632('0x22')](_0x9ab826,_0x3d2d23,!![]);}catch(_0x29f875){return BPromise[_0x4632('0x23')](_0x29f875);}return _0x9ab826[_0x4632('0x24')]();};}function saveUpdates(_0x2d656a,_0x2ca6a5){return function(_0x263907){if(_0x263907){return _0x263907[_0x4632('0x25')](_0x2d656a)[_0x4632('0x26')](function(_0x4264d5){return _0x4264d5;});}return null;};}function removeEntity(_0x3537ed,_0x380a9f){return function(_0x1e1b86){if(_0x1e1b86){return _0x1e1b86[_0x4632('0x27')]()[_0x4632('0x26')](function(){var _0x3b0823=_0x1e1b86[_0x4632('0x28')]({'plain':!![]});var _0xb074d=_0x4632('0x29');return db[_0x4632('0x2a')][_0x4632('0x27')]({'where':{'type':_0xb074d,'resourceId':_0x3b0823['id']}})[_0x4632('0x26')](function(){return _0x1e1b86;});})[_0x4632('0x26')](function(){_0x3537ed[_0x4632('0x19')](0xcc)[_0x4632('0x1a')]();});}};}function handleEntityNotFound(_0x438354,_0x4d9098){return function(_0x57798a){if(!_0x57798a){_0x438354[_0x4632('0x18')](0x194);}return _0x57798a;};}function handleError(_0x244743,_0x2f6656){_0x2f6656=_0x2f6656||0x1f4;return function(_0x35a533){logger[_0x4632('0x2b')](_0x35a533[_0x4632('0x2c')]);if(_0x35a533[_0x4632('0x2d')]){delete _0x35a533['name'];}_0x244743[_0x4632('0x19')](_0x2f6656)[_0x4632('0x2e')](_0x35a533);};}exports['index']=function(_0x216119,_0x5316f7){var _0x6599ad={},_0x4cb661={},_0x4fda35={'count':0x0,'rows':[]};var _0x1973eb=_[_0x4632('0x2f')](db[_0x4632('0x30')]['rawAttributes'],function(_0x5ed4d6){return{'name':_0x5ed4d6[_0x4632('0x31')],'type':_0x5ed4d6[_0x4632('0x32')]['key']};});_0x4cb661['model']=_[_0x4632('0x2f')](_0x1973eb,_0x4632('0x2d'));_0x4cb661['query']=_[_0x4632('0x33')](_0x216119[_0x4632('0x34')]);_0x4cb661[_0x4632('0x35')]=_[_0x4632('0x36')](_0x4cb661[_0x4632('0x37')],_0x4cb661['query']);_0x6599ad[_0x4632('0x38')]=_[_0x4632('0x36')](_0x4cb661['model'],qs['fields'](_0x216119[_0x4632('0x34')]['fields']));_0x6599ad['attributes']=_0x6599ad[_0x4632('0x38')]['length']?_0x6599ad[_0x4632('0x38')]:_0x4cb661[_0x4632('0x37')];if(!_0x216119[_0x4632('0x34')]['hasOwnProperty'](_0x4632('0x39'))){_0x6599ad[_0x4632('0x1e')]=qs[_0x4632('0x1e')](_0x216119[_0x4632('0x34')][_0x4632('0x1e')]);_0x6599ad['offset']=qs['offset'](_0x216119[_0x4632('0x34')][_0x4632('0x1c')]);}_0x6599ad[_0x4632('0x3a')]=qs['sort'](_0x216119['query']['sort']);_0x6599ad[_0x4632('0x3b')]=qs[_0x4632('0x35')](_['pick'](_0x216119[_0x4632('0x34')],_0x4cb661[_0x4632('0x35')]),_0x1973eb);if(_0x216119[_0x4632('0x34')][_0x4632('0x3c')]){_0x6599ad[_0x4632('0x3b')]=_[_0x4632('0x3d')](_0x6599ad[_0x4632('0x3b')],{'$or':_[_0x4632('0x2f')](_0x1973eb,function(_0x21c6a5){if(_0x21c6a5[_0x4632('0x32')]!==_0x4632('0x3e')){var _0x3b6258={};_0x3b6258[_0x21c6a5['name']]={'$like':'%'+_0x216119[_0x4632('0x34')][_0x4632('0x3c')]+'%'};return _0x3b6258;}})});}_0x6599ad=_['merge']({},_0x6599ad,_0x216119[_0x4632('0x3f')]);var _0x1c39bc={'where':_0x6599ad['where']};return db[_0x4632('0x30')]['count'](_0x1c39bc)[_0x4632('0x26')](function(_0x28df3b){_0x4fda35[_0x4632('0x1f')]=_0x28df3b;if(_0x216119[_0x4632('0x34')]['includeAll']){_0x6599ad[_0x4632('0x40')]=[{'all':!![]}];}return db[_0x4632('0x30')][_0x4632('0x41')](_0x6599ad);})[_0x4632('0x26')](function(_0x5cc716){_0x4fda35['rows']=_0x5cc716;return _0x4fda35;})[_0x4632('0x26')](respondWithFilteredResult(_0x5316f7,_0x6599ad))[_0x4632('0x42')](handleError(_0x5316f7,null));};exports[_0x4632('0x43')]=function(_0x512db1,_0x330f21){var _0x1467c8={'raw':![],'where':{'id':_0x512db1[_0x4632('0x44')]['id']}},_0x66598d={};_0x66598d[_0x4632('0x37')]=_[_0x4632('0x33')](db[_0x4632('0x30')]['rawAttributes']);_0x66598d[_0x4632('0x34')]=_[_0x4632('0x33')](_0x512db1[_0x4632('0x34')]);_0x66598d[_0x4632('0x35')]=_[_0x4632('0x36')](_0x66598d['model'],_0x66598d['query']);_0x1467c8[_0x4632('0x38')]=_[_0x4632('0x36')](_0x66598d[_0x4632('0x37')],qs[_0x4632('0x45')](_0x512db1['query'][_0x4632('0x45')]));_0x1467c8[_0x4632('0x38')]=_0x1467c8[_0x4632('0x38')][_0x4632('0x46')]?_0x1467c8[_0x4632('0x38')]:_0x66598d['model'];if(_0x512db1[_0x4632('0x34')][_0x4632('0x47')]){_0x1467c8[_0x4632('0x40')]=[{'all':!![]}];}_0x1467c8=_[_0x4632('0x3d')]({},_0x1467c8,_0x512db1[_0x4632('0x3f')]);return db[_0x4632('0x30')][_0x4632('0x48')](_0x1467c8)[_0x4632('0x26')](handleEntityNotFound(_0x330f21,null))[_0x4632('0x26')](respondWithResult(_0x330f21,null))[_0x4632('0x42')](handleError(_0x330f21,null));};exports[_0x4632('0x49')]=function(_0x517584,_0xc3ffd0){return db[_0x4632('0x30')][_0x4632('0x49')](_0x517584['body'],{})[_0x4632('0x26')](function(_0x5f4fb5){var _0x1309aa=_0x517584[_0x4632('0x4a')][_0x4632('0x28')]({'plain':!![]});if(!_0x1309aa)throw new Error(_0x4632('0x4b'));if(_0x1309aa[_0x4632('0x4c')]===_0x4632('0x4a')){var _0x1f43b6=_0x5f4fb5[_0x4632('0x28')]({'plain':!![]});var _0x4e89e3=_0x4632('0x29');return db[_0x4632('0x4d')]['find']({'where':{'name':_0x4e89e3,'userProfileId':_0x1309aa[_0x4632('0x4e')]},'raw':!![]})[_0x4632('0x26')](function(_0x18cc47){if(_0x18cc47&&_0x18cc47[_0x4632('0x4f')]===0x0){return db[_0x4632('0x2a')][_0x4632('0x49')]({'name':_0x1f43b6[_0x4632('0x2d')],'resourceId':_0x1f43b6['id'],'type':_0x18cc47[_0x4632('0x2d')],'sectionId':_0x18cc47['id']},{})[_0x4632('0x26')](function(){return _0x5f4fb5;});}else{return _0x5f4fb5;}})[_0x4632('0x42')](function(_0x3e66d8){logger[_0x4632('0x2b')](_0x4632('0x50'),_0x3e66d8);throw _0x3e66d8;});}return _0x5f4fb5;})[_0x4632('0x26')](respondWithResult(_0xc3ffd0,0xc9))[_0x4632('0x42')](handleError(_0xc3ffd0,null));};exports[_0x4632('0x51')]=function(_0x32cd35,_0x6c2864){var _0xb1456b={'where':{'id':_0x32cd35['params']['id']}},_0x36c824={};_0x36c824[_0x4632('0x37')]=_[_0x4632('0x33')](db[_0x4632('0x30')][_0x4632('0x52')]);_0xb1456b[_0x4632('0x38')]=_[_0x4632('0x36')](_0x36c824['model'],qs[_0x4632('0x45')](_0x32cd35[_0x4632('0x34')][_0x4632('0x45')]));_0xb1456b['attributes']=_0xb1456b[_0x4632('0x38')][_0x4632('0x46')]?_0xb1456b['attributes']:_0x36c824[_0x4632('0x37')];if(_0x32cd35[_0x4632('0x34')][_0x4632('0x47')]){_0xb1456b['include']=[{'all':!![]}];}_0xb1456b=_[_0x4632('0x3d')]({},_0xb1456b,_0x32cd35[_0x4632('0x3f')]);return db[_0x4632('0x30')][_0x4632('0x48')](_0xb1456b)[_0x4632('0x26')](handleEntityNotFound(_0x6c2864,null))[_0x4632('0x26')](function(_0x180662){if(_0x180662){var _0x4658de=_0x180662[_0x4632('0x28')]({'plain':!![]});_0x4658de=qs[_0x4632('0x53')](_0x4658de,['id','createdAt',_0x4632('0x54')]);_0x32cd35[_0x4632('0x55')]=_['omit'](_0x32cd35[_0x4632('0x55')],['id','createdAt','updatedAt']);return db[_0x4632('0x30')][_0x4632('0x49')](_[_0x4632('0x3d')](_0x4658de,_0x32cd35[_0x4632('0x55')]),{'include':_0x32cd35[_0x4632('0x34')][_0x4632('0x47')]?[{'all':!![]}]:undefined})[_0x4632('0x26')](function(_0x3e2849){var _0x133cb6=_0x32cd35[_0x4632('0x4a')][_0x4632('0x28')]({'plain':!![]});if(!_0x133cb6)throw new Error(_0x4632('0x4b'));if(_0x133cb6[_0x4632('0x4c')]===_0x4632('0x4a')){var _0x5442c9=_0x3e2849['get']({'plain':!![]});var _0x2e34d9=_0x4632('0x29');return db[_0x4632('0x4d')][_0x4632('0x48')]({'where':{'name':_0x2e34d9,'userProfileId':_0x133cb6[_0x4632('0x4e')]},'raw':!![]})[_0x4632('0x26')](function(_0x5b66ee){if(_0x5b66ee&&_0x5b66ee[_0x4632('0x4f')]===0x0){return db[_0x4632('0x2a')][_0x4632('0x49')]({'name':_0x5442c9[_0x4632('0x2d')],'resourceId':_0x5442c9['id'],'type':_0x5b66ee['name'],'sectionId':_0x5b66ee['id']},{})['then'](function(){return _0x3e2849;});}else{return _0x3e2849;}})[_0x4632('0x42')](function(_0x4c547c){logger[_0x4632('0x2b')](_0x4632('0x50'),_0x4c547c);throw _0x4c547c;});}return _0x3e2849;});}})[_0x4632('0x26')](respondWithResult(_0x6c2864,0xc9))[_0x4632('0x42')](handleError(_0x6c2864,null));};exports[_0x4632('0x25')]=function(_0x5e5669,_0x61aa92){if(_0x5e5669[_0x4632('0x55')]['id']){delete _0x5e5669['body']['id'];}return db['Campaign'][_0x4632('0x48')]({'where':{'id':_0x5e5669[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x61aa92,null))[_0x4632('0x26')](saveUpdates(_0x5e5669['body'],null))['then'](respondWithResult(_0x61aa92,null))['catch'](handleError(_0x61aa92,null));};exports[_0x4632('0x27')]=function(_0x5b37cc,_0x3af9ec){return db[_0x4632('0x30')][_0x4632('0x48')]({'where':{'id':_0x5b37cc[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x3af9ec,null))[_0x4632('0x26')](removeEntity(_0x3af9ec,null))[_0x4632('0x42')](handleError(_0x3af9ec,null));};exports[_0x4632('0x56')]=function(_0x44590d,_0x321969,_0x1dbba9){var _0x2b4c83={'raw':!![],'where':{}};var _0x1c5c49={};var _0x3d5e65={'count':0x0,'rows':[]};return db[_0x4632('0x30')][_0x4632('0x57')]({'where':{'id':_0x44590d['params']['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x321969,null))[_0x4632('0x26')](function(_0x3bc386){if(_0x3bc386){_0x1c5c49[_0x4632('0x37')]=_[_0x4632('0x33')](db[_0x4632('0x58')][_0x4632('0x52')]);_0x1c5c49[_0x4632('0x34')]=_[_0x4632('0x33')](_0x44590d[_0x4632('0x34')]);_0x1c5c49[_0x4632('0x35')]=_[_0x4632('0x36')](_0x1c5c49[_0x4632('0x37')],_0x1c5c49['query']);_0x2b4c83[_0x4632('0x38')]=_[_0x4632('0x36')](_0x1c5c49[_0x4632('0x37')],qs[_0x4632('0x45')](_0x44590d[_0x4632('0x34')][_0x4632('0x45')]));_0x2b4c83['attributes']=_0x2b4c83[_0x4632('0x38')][_0x4632('0x46')]?_0x2b4c83['attributes']:_0x1c5c49[_0x4632('0x37')];if(!_0x44590d[_0x4632('0x34')][_0x4632('0x59')](_0x4632('0x39'))){_0x2b4c83[_0x4632('0x1e')]=qs['limit'](_0x44590d[_0x4632('0x34')][_0x4632('0x1e')]);_0x2b4c83[_0x4632('0x1c')]=qs['offset'](_0x44590d[_0x4632('0x34')][_0x4632('0x1c')]);}_0x2b4c83[_0x4632('0x3a')]=qs[_0x4632('0x5a')](_0x44590d[_0x4632('0x34')][_0x4632('0x5a')]);_0x2b4c83[_0x4632('0x3b')]=qs[_0x4632('0x35')](_['pick'](_0x44590d[_0x4632('0x34')],_0x1c5c49[_0x4632('0x35')]));_0x2b4c83[_0x4632('0x3b')]['CampaignId']=_0x3bc386['id'];if(_0x44590d[_0x4632('0x34')][_0x4632('0x3c')]){_0x2b4c83['where']=_['merge'](_0x2b4c83[_0x4632('0x3b')],{'$or':_[_0x4632('0x2f')](_0x2b4c83['attributes'],function(_0x63d3e1){var _0x27e95f={};_0x27e95f[_0x63d3e1]={'$like':'%'+_0x44590d[_0x4632('0x34')][_0x4632('0x3c')]+'%'};return _0x27e95f;})});}_0x2b4c83=_[_0x4632('0x3d')]({},_0x2b4c83,_0x44590d[_0x4632('0x3f')]);return db[_0x4632('0x58')][_0x4632('0x1f')]({'where':_0x2b4c83['where']})[_0x4632('0x26')](function(_0x3f7dff){_0x3d5e65[_0x4632('0x1f')]=_0x3f7dff;if(_0x44590d[_0x4632('0x34')]['includeAll']){_0x2b4c83[_0x4632('0x40')]=[{'all':!![]}];}return db[_0x4632('0x58')][_0x4632('0x41')](_0x2b4c83);})[_0x4632('0x26')](function(_0x3cee1d){_0x3d5e65['rows']=_0x3cee1d;return _0x3d5e65;});}})[_0x4632('0x26')](respondWithFilteredResult(_0x321969,_0x2b4c83))[_0x4632('0x42')](handleError(_0x321969,null));};exports[_0x4632('0x5b')]=function(_0x2f3fd2,_0x1440ee,_0x219017){var _0x35b01a={'raw':!![],'where':{}};var _0x399037={};var _0x56a39b={'count':0x0,'rows':[]};return db[_0x4632('0x30')][_0x4632('0x57')]({'where':{'id':_0x2f3fd2[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x1440ee,null))[_0x4632('0x26')](function(_0x3a2560){if(_0x3a2560){_0x399037['model']=_[_0x4632('0x33')](db[_0x4632('0x5c')][_0x4632('0x52')]);_0x399037[_0x4632('0x34')]=_[_0x4632('0x33')](_0x2f3fd2[_0x4632('0x34')]);_0x399037[_0x4632('0x35')]=_['intersection'](_0x399037[_0x4632('0x37')],_0x399037[_0x4632('0x34')]);_0x35b01a[_0x4632('0x38')]=_[_0x4632('0x36')](_0x399037[_0x4632('0x37')],qs[_0x4632('0x45')](_0x2f3fd2[_0x4632('0x34')]['fields']));_0x35b01a[_0x4632('0x38')]=_0x35b01a['attributes'][_0x4632('0x46')]?_0x35b01a[_0x4632('0x38')]:_0x399037[_0x4632('0x37')];if(!_0x2f3fd2[_0x4632('0x34')][_0x4632('0x59')](_0x4632('0x39'))){_0x35b01a[_0x4632('0x1e')]=qs[_0x4632('0x1e')](_0x2f3fd2[_0x4632('0x34')]['limit']);_0x35b01a[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x2f3fd2[_0x4632('0x34')]['offset']);}_0x35b01a[_0x4632('0x3a')]=qs[_0x4632('0x5a')](_0x2f3fd2[_0x4632('0x34')][_0x4632('0x5a')]);_0x35b01a[_0x4632('0x3b')]=qs[_0x4632('0x35')](_['pick'](_0x2f3fd2['query'],_0x399037[_0x4632('0x35')]));_0x35b01a[_0x4632('0x3b')][_0x4632('0x5d')]=_0x3a2560['id'];if(_0x2f3fd2['query'][_0x4632('0x3c')]){_0x35b01a['where']=_[_0x4632('0x3d')](_0x35b01a['where'],{'$or':_[_0x4632('0x2f')](_0x35b01a[_0x4632('0x38')],function(_0x49ebe8){var _0x219a62={};_0x219a62[_0x49ebe8]={'$like':'%'+_0x2f3fd2[_0x4632('0x34')][_0x4632('0x3c')]+'%'};return _0x219a62;})});}_0x35b01a=_['merge']({},_0x35b01a,_0x2f3fd2[_0x4632('0x3f')]);return db[_0x4632('0x5c')][_0x4632('0x1f')]({'where':_0x35b01a[_0x4632('0x3b')]})['then'](function(_0x43386b){_0x56a39b[_0x4632('0x1f')]=_0x43386b;if(_0x2f3fd2[_0x4632('0x34')][_0x4632('0x47')]){_0x35b01a['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x4632('0x41')](_0x35b01a);})[_0x4632('0x26')](function(_0x248220){_0x56a39b[_0x4632('0x5e')]=_0x248220;return _0x56a39b;});}})[_0x4632('0x26')](respondWithFilteredResult(_0x1440ee,_0x35b01a))[_0x4632('0x42')](handleError(_0x1440ee,null));};exports[_0x4632('0x5f')]=function(_0x5aa17f,_0x3ccd89,_0x33b497){var _0x505664={'raw':!![],'where':{}};var _0x51df53={};var _0x1aaaca={'count':0x0,'rows':[]};return db[_0x4632('0x30')][_0x4632('0x57')]({'where':{'id':_0x5aa17f[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x3ccd89,null))[_0x4632('0x26')](function(_0x2a2b1b){if(_0x2a2b1b){_0x51df53[_0x4632('0x37')]=_[_0x4632('0x33')](db[_0x4632('0x60')]['rawAttributes']);_0x51df53[_0x4632('0x34')]=_[_0x4632('0x33')](_0x5aa17f[_0x4632('0x34')]);_0x51df53[_0x4632('0x35')]=_[_0x4632('0x36')](_0x51df53[_0x4632('0x37')],_0x51df53[_0x4632('0x34')]);_0x505664[_0x4632('0x38')]=_[_0x4632('0x36')](_0x51df53['model'],qs[_0x4632('0x45')](_0x5aa17f['query'][_0x4632('0x45')]));_0x505664['attributes']=_0x505664[_0x4632('0x38')]['length']?_0x505664[_0x4632('0x38')]:_0x51df53[_0x4632('0x37')];if(!_0x5aa17f[_0x4632('0x34')]['hasOwnProperty']('nolimit')){_0x505664[_0x4632('0x1e')]=qs[_0x4632('0x1e')](_0x5aa17f[_0x4632('0x34')][_0x4632('0x1e')]);_0x505664[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x5aa17f[_0x4632('0x34')][_0x4632('0x1c')]);}_0x505664['order']=qs[_0x4632('0x5a')](_0x5aa17f[_0x4632('0x34')][_0x4632('0x5a')]);_0x505664[_0x4632('0x3b')]=qs[_0x4632('0x35')](_[_0x4632('0x61')](_0x5aa17f[_0x4632('0x34')],_0x51df53[_0x4632('0x35')]));_0x505664[_0x4632('0x3b')][_0x4632('0x5d')]=_0x2a2b1b['id'];if(_0x5aa17f['query'][_0x4632('0x3c')]){_0x505664[_0x4632('0x3b')]=_[_0x4632('0x3d')](_0x505664['where'],{'$or':_[_0x4632('0x2f')](_0x505664[_0x4632('0x38')],function(_0x27e56d){var _0x77891b={};_0x77891b[_0x27e56d]={'$like':'%'+_0x5aa17f[_0x4632('0x34')][_0x4632('0x3c')]+'%'};return _0x77891b;})});}_0x505664=_[_0x4632('0x3d')]({},_0x505664,_0x5aa17f[_0x4632('0x3f')]);return db[_0x4632('0x60')][_0x4632('0x1f')]({'where':_0x505664[_0x4632('0x3b')]})['then'](function(_0x3a86d9){_0x1aaaca['count']=_0x3a86d9;if(_0x5aa17f[_0x4632('0x34')][_0x4632('0x47')]){_0x505664['include']=[{'all':!![]}];}return db[_0x4632('0x60')][_0x4632('0x41')](_0x505664);})[_0x4632('0x26')](function(_0x537711){_0x1aaaca[_0x4632('0x5e')]=_0x537711;return _0x1aaaca;});}})[_0x4632('0x26')](respondWithFilteredResult(_0x3ccd89,_0x505664))['catch'](handleError(_0x3ccd89,null));};exports['getHopperBlacks']=function(_0x27f0d4,_0x2addad,_0x225318){var _0x3380ae={'raw':!![],'where':{}};var _0x134488={};var _0x2feec1={'count':0x0,'rows':[]};return db[_0x4632('0x30')][_0x4632('0x57')]({'where':{'id':_0x27f0d4[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x2addad,null))[_0x4632('0x26')](function(_0xd86291){if(_0xd86291){_0x134488[_0x4632('0x37')]=_[_0x4632('0x33')](db['CmHopperBlack'][_0x4632('0x52')]);_0x134488[_0x4632('0x34')]=_[_0x4632('0x33')](_0x27f0d4['query']);_0x134488[_0x4632('0x35')]=_[_0x4632('0x36')](_0x134488[_0x4632('0x37')],_0x134488[_0x4632('0x34')]);_0x3380ae[_0x4632('0x38')]=_[_0x4632('0x36')](_0x134488[_0x4632('0x37')],qs[_0x4632('0x45')](_0x27f0d4[_0x4632('0x34')]['fields']));_0x3380ae[_0x4632('0x38')]=_0x3380ae[_0x4632('0x38')][_0x4632('0x46')]?_0x3380ae[_0x4632('0x38')]:_0x134488[_0x4632('0x37')];if(!_0x27f0d4[_0x4632('0x34')]['hasOwnProperty'](_0x4632('0x39'))){_0x3380ae[_0x4632('0x1e')]=qs[_0x4632('0x1e')](_0x27f0d4['query']['limit']);_0x3380ae['offset']=qs[_0x4632('0x1c')](_0x27f0d4['query'][_0x4632('0x1c')]);}_0x3380ae[_0x4632('0x3a')]=qs[_0x4632('0x5a')](_0x27f0d4[_0x4632('0x34')][_0x4632('0x5a')]);_0x3380ae[_0x4632('0x3b')]=qs[_0x4632('0x35')](_[_0x4632('0x61')](_0x27f0d4[_0x4632('0x34')],_0x134488[_0x4632('0x35')]));_0x3380ae[_0x4632('0x3b')][_0x4632('0x5d')]=_0xd86291['id'];if(_0x27f0d4[_0x4632('0x34')][_0x4632('0x3c')]){_0x3380ae[_0x4632('0x3b')]=_[_0x4632('0x3d')](_0x3380ae['where'],{'$or':_[_0x4632('0x2f')](_0x3380ae[_0x4632('0x38')],function(_0x41cae7){var _0x5e17f3={};_0x5e17f3[_0x41cae7]={'$like':'%'+_0x27f0d4[_0x4632('0x34')][_0x4632('0x3c')]+'%'};return _0x5e17f3;})});}_0x3380ae=_[_0x4632('0x3d')]({},_0x3380ae,_0x27f0d4[_0x4632('0x3f')]);return db[_0x4632('0x62')][_0x4632('0x1f')]({'where':_0x3380ae[_0x4632('0x3b')]})['then'](function(_0x310e64){_0x2feec1['count']=_0x310e64;if(_0x27f0d4['query']['includeAll']){_0x3380ae['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x4632('0x41')](_0x3380ae);})[_0x4632('0x26')](function(_0x29d271){_0x2feec1[_0x4632('0x5e')]=_0x29d271;return _0x2feec1;});}})[_0x4632('0x26')](respondWithFilteredResult(_0x2addad,_0x3380ae))['catch'](handleError(_0x2addad,null));};exports['getLists']=function(_0x1687e2,_0x29b08a,_0x1b005f){var _0x125db7={};var _0x1135e6={};var _0x29ec86;var _0x5cbd30;return db['Campaign'][_0x4632('0x57')]({'where':{'id':_0x1687e2[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x29b08a,null))[_0x4632('0x26')](function(_0x1aef6b){if(_0x1aef6b){_0x29ec86=_0x1aef6b;_0x1135e6['model']=_[_0x4632('0x33')](db[_0x4632('0x63')][_0x4632('0x52')]);_0x1135e6[_0x4632('0x34')]=_[_0x4632('0x33')](_0x1687e2['query']);_0x1135e6[_0x4632('0x35')]=_[_0x4632('0x36')](_0x1135e6['model'],_0x1135e6['query']);_0x125db7[_0x4632('0x38')]=_[_0x4632('0x36')](_0x1135e6[_0x4632('0x37')],qs['fields'](_0x1687e2['query'][_0x4632('0x45')]));_0x125db7[_0x4632('0x38')]=_0x125db7[_0x4632('0x38')][_0x4632('0x46')]?_0x125db7[_0x4632('0x38')]:_0x1135e6['model'];_0x125db7[_0x4632('0x3a')]=qs['sort'](_0x1687e2[_0x4632('0x34')]['sort']);_0x125db7['where']=qs[_0x4632('0x35')](_['pick'](_0x1687e2[_0x4632('0x34')],_0x1135e6[_0x4632('0x35')]));if(_0x1687e2[_0x4632('0x34')]['filter']){_0x125db7[_0x4632('0x3b')]=_[_0x4632('0x3d')](_0x125db7['where'],{'$or':_['map'](_0x125db7[_0x4632('0x38')],function(_0x527a5c){var _0x80a451={};_0x80a451[_0x527a5c]={'$like':'%'+_0x1687e2[_0x4632('0x34')][_0x4632('0x3c')]+'%'};return _0x80a451;})});}_0x125db7=_[_0x4632('0x3d')]({},_0x125db7,_0x1687e2['options']);return _0x29ec86['getLists'](_0x125db7);}})['then'](function(_0x5dd45b){if(_0x5dd45b){_0x5cbd30=_0x5dd45b[_0x4632('0x46')];if(!_0x1687e2[_0x4632('0x34')][_0x4632('0x59')](_0x4632('0x39'))){_0x125db7[_0x4632('0x1e')]=qs[_0x4632('0x1e')](_0x1687e2[_0x4632('0x34')][_0x4632('0x1e')]);_0x125db7[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x1687e2['query'][_0x4632('0x1c')]);}return _0x29ec86['getLists'](_0x125db7);}})[_0x4632('0x26')](function(_0x1210fd){if(_0x1210fd){return _0x1210fd?{'count':_0x5cbd30,'rows':_0x1210fd}:null;}})[_0x4632('0x26')](respondWithResult(_0x29b08a,null))[_0x4632('0x42')](handleError(_0x29b08a,null));};exports[_0x4632('0x64')]=function(_0x5f3f6b,_0x2b9a28,_0x279456){var _0x4c3399,_0x199546;var _0x28f727=[];var _0x47d2cc=moment()[_0x4632('0x65')](_0x4632('0x66'));return db[_0x4632('0x30')][_0x4632('0x48')]({'where':{'id':_0x5f3f6b[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x2b9a28,null))[_0x4632('0x26')](function(_0x9b14e4){if(_0x9b14e4){_0x199546=_0x9b14e4;return _0x9b14e4['addLists'](_0x5f3f6b[_0x4632('0x55')][_0x4632('0x67')],_[_0x4632('0x53')](_0x5f3f6b[_0x4632('0x55')],[_0x4632('0x67'),'id'])||{});}return null;})[_0x4632('0x68')](function(_0x27efa3){var _0x5d0c25;var _0x20ea25;_0x4c3399=_0x27efa3||[];var _0x22d667=[];if(_0x27efa3){for(var _0x2f09c4=0x0;_0x2f09c4<_0x27efa3[_0x4632('0x46')];_0x2f09c4+=0x1){var _0x2172a2=_0x27efa3[_0x2f09c4]['get']({'plain':!![]});_0x199546['dialCheckDuplicateType']=_0x5f3f6b['body'][_0x4632('0x69')]?_0x5f3f6b[_0x4632('0x55')][_0x4632('0x69')]:_0x199546[_0x4632('0x69')];switch(_0x199546[_0x4632('0x69')]){case _0x4632('0x6a'):_0x5d0c25=squel['insert']()['into'](_0x4632('0x6b'))['fromQuery'](['phone',_0x4632('0x6c'),_0x4632('0x6d'),_0x4632('0x6e'),_0x4632('0x5d'),_0x4632('0x6f'),_0x4632('0x54')],squel[_0x4632('0x70')]()[_0x4632('0x71')](_0x4632('0x72'),_0x4632('0x72'))[_0x4632('0x71')](_0x4632('0x73'),_0x4632('0x6c'))[_0x4632('0x71')]('id',_0x4632('0x6d'))[_0x4632('0x71')](_0x2172a2[_0x4632('0x74')][_0x4632('0x75')](),_0x4632('0x6e'))[_0x4632('0x71')](_0x5f3f6b[_0x4632('0x44')]['id'][_0x4632('0x75')](),_0x4632('0x5d'))['field']('\x27'+_0x47d2cc+'\x27',_0x4632('0x6f'))['field']('\x27'+_0x47d2cc+'\x27','updatedAt')[_0x4632('0x76')](_0x4632('0x77'))['where'](_0x4632('0x78'))['where']('ListId\x20=\x20?',_0x2172a2[_0x4632('0x74')]['toString']())['where'](_0x4632('0x79'))[_0x4632('0x3b')](_0x4632('0x7a'),squel[_0x4632('0x70')]()[_0x4632('0x71')](_0x4632('0x7b'))['from'](_0x4632('0x7c'))[_0x4632('0x3b')](_0x4632('0x7d'),_0x5f3f6b['params']['id'][_0x4632('0x75')]()))['where'](_0x4632('0x7a'),squel['select']()['field'](_0x4632('0x7e'))[_0x4632('0x76')](_0x4632('0x6b'))[_0x4632('0x3b')](_0x4632('0x7d'),_0x5f3f6b['params']['id'][_0x4632('0x75')]())))[_0x4632('0x75')]();break;case _0x4632('0x7f'):_0x5d0c25=squel[_0x4632('0x80')]()[_0x4632('0x81')](_0x4632('0x6b'))[_0x4632('0x82')]([_0x4632('0x72'),'scheduledAt',_0x4632('0x6d'),_0x4632('0x6e'),_0x4632('0x5d'),'createdAt',_0x4632('0x54')],squel[_0x4632('0x70')]()[_0x4632('0x71')](_0x4632('0x72'),_0x4632('0x72'))[_0x4632('0x71')](_0x4632('0x73'),'scheduledAt')[_0x4632('0x71')]('id','ContactId')['field'](_0x2172a2[_0x4632('0x74')][_0x4632('0x75')](),_0x4632('0x6e'))[_0x4632('0x71')](_0x5f3f6b[_0x4632('0x44')]['id']['toString'](),'CampaignId')['field']('\x27'+_0x47d2cc+'\x27',_0x4632('0x6f'))['field']('\x27'+_0x47d2cc+'\x27','updatedAt')[_0x4632('0x76')](_0x4632('0x77'))[_0x4632('0x3b')](_0x4632('0x78'))[_0x4632('0x3b')](_0x4632('0x83'),_0x2172a2[_0x4632('0x74')]['toString']())[_0x4632('0x3b')](_0x4632('0x79'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x4632('0x70')]()[_0x4632('0x71')](_0x4632('0x7e'))[_0x4632('0x76')](_0x4632('0x6b'))[_0x4632('0x3b')](_0x4632('0x7d'),_0x5f3f6b[_0x4632('0x44')]['id']['toString']())))['toString']();break;default:_0x5d0c25=squel[_0x4632('0x80')]()['into'](_0x4632('0x6b'))[_0x4632('0x82')]([_0x4632('0x72'),_0x4632('0x6c'),'ContactId',_0x4632('0x6e'),_0x4632('0x5d'),'createdAt',_0x4632('0x54')],squel['select']()[_0x4632('0x71')](_0x4632('0x72'),_0x4632('0x72'))[_0x4632('0x71')](_0x4632('0x73'),_0x4632('0x6c'))[_0x4632('0x71')]('id',_0x4632('0x6d'))[_0x4632('0x71')](_0x2172a2[_0x4632('0x74')][_0x4632('0x75')](),_0x4632('0x6e'))[_0x4632('0x71')](_0x5f3f6b[_0x4632('0x44')]['id'][_0x4632('0x75')](),_0x4632('0x5d'))[_0x4632('0x71')]('\x27'+_0x47d2cc+'\x27','createdAt')[_0x4632('0x71')]('\x27'+_0x47d2cc+'\x27',_0x4632('0x54'))[_0x4632('0x76')](_0x4632('0x77'))[_0x4632('0x3b')](_0x4632('0x78'))[_0x4632('0x3b')]('ListId\x20=\x20?',_0x2172a2[_0x4632('0x74')][_0x4632('0x75')]())[_0x4632('0x3b')](_0x4632('0x79')))[_0x4632('0x75')]();}_0x20ea25=squel[_0x4632('0x80')]()[_0x4632('0x81')](_0x4632('0x84'))[_0x4632('0x82')]([_0x4632('0x85'),_0x4632('0x6c'),_0x4632('0x72'),_0x4632('0x86'),'createdAt',_0x4632('0x54')],squel[_0x4632('0x70')]()[_0x4632('0x71')](_0x4632('0x87'),'id')[_0x4632('0x71')](_0x4632('0x73'),_0x4632('0x6c'))[_0x4632('0x71')](_0x4632('0x88'),'phone')['field'](_0x4632('0x89'),_0x4632('0x86'))[_0x4632('0x71')]('\x27'+_0x47d2cc+'\x27',_0x4632('0x6f'))[_0x4632('0x71')]('\x27'+_0x47d2cc+'\x27',_0x4632('0x54'))['from'](_0x4632('0x8a'),'ci')[_0x4632('0x8b')]('cm_hopper','h',_0x4632('0x8c'))[_0x4632('0x3b')]('h.ListId\x20=\x20?',_0x2172a2['CmListId'][_0x4632('0x75')]())[_0x4632('0x3b')]('h.CampaignId=?',_0x5f3f6b['params']['id'][_0x4632('0x75')]())[_0x4632('0x3b')](_0x4632('0x8d'),_0x47d2cc))[_0x4632('0x75')]();_0x22d667[_0x4632('0x8e')](db[_0x4632('0x8f')][_0x4632('0x34')](_0x5d0c25));_0x28f727['push'](db[_0x4632('0x8f')][_0x4632('0x34')](_0x20ea25));}return BPromise[_0x4632('0x90')](_0x22d667);}})[_0x4632('0x26')](function(){return BPromise[_0x4632('0x90')](_0x28f727);})['then'](function(){return _0x4c3399;})['then'](respondWithResult(_0x2b9a28,null))[_0x4632('0x42')](handleError(_0x2b9a28,null));};exports['removeLists']=function(_0x18b3b7,_0xdd065f,_0x32ee2c){return db[_0x4632('0x30')][_0x4632('0x48')]({'where':{'id':_0x18b3b7[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0xdd065f,null))[_0x4632('0x26')](function(_0xbe285c){if(_0xbe285c){return _0xbe285c['removeLists'](_0x18b3b7['query']['ids']);}})[_0x4632('0x26')](function(_0x2d8d83){if(_0x2d8d83){return db[_0x4632('0x58')]['destroy']({'where':{'ListId':_0x18b3b7[_0x4632('0x34')][_0x4632('0x67')],'CampaignId':_0x18b3b7[_0x4632('0x44')]['id']}})[_0x4632('0x26')](function(){return _0x2d8d83;});}})[_0x4632('0x26')](respondWithStatusCode(_0xdd065f,null))['catch'](handleError(_0xdd065f,null));};exports[_0x4632('0x91')]=function(_0x2586ca,_0x9a5191,_0x350691){var _0x33336a={};var _0x287d7b={};var _0x1eaf71;var _0xbadb5e;return db[_0x4632('0x30')][_0x4632('0x57')]({'where':{'id':_0x2586ca['params']['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x9a5191,null))[_0x4632('0x26')](function(_0x40e1a0){if(_0x40e1a0){_0x1eaf71=_0x40e1a0;_0x287d7b[_0x4632('0x37')]=_[_0x4632('0x33')](db[_0x4632('0x63')][_0x4632('0x52')]);_0x287d7b[_0x4632('0x34')]=_[_0x4632('0x33')](_0x2586ca[_0x4632('0x34')]);_0x287d7b[_0x4632('0x35')]=_[_0x4632('0x36')](_0x287d7b[_0x4632('0x37')],_0x287d7b[_0x4632('0x34')]);_0x33336a['attributes']=_[_0x4632('0x36')](_0x287d7b[_0x4632('0x37')],qs[_0x4632('0x45')](_0x2586ca[_0x4632('0x34')][_0x4632('0x45')]));_0x33336a[_0x4632('0x38')]=_0x33336a[_0x4632('0x38')][_0x4632('0x46')]?_0x33336a[_0x4632('0x38')]:_0x287d7b['model'];_0x33336a['order']=qs[_0x4632('0x5a')](_0x2586ca['query'][_0x4632('0x5a')]);_0x33336a['where']=qs[_0x4632('0x35')](_[_0x4632('0x61')](_0x2586ca[_0x4632('0x34')],_0x287d7b[_0x4632('0x35')]));if(_0x2586ca['query'][_0x4632('0x3c')]){_0x33336a[_0x4632('0x3b')]=_['merge'](_0x33336a['where'],{'$or':_[_0x4632('0x2f')](_0x33336a[_0x4632('0x38')],function(_0x1a5d60){var _0x4c3619={};_0x4c3619[_0x1a5d60]={'$like':'%'+_0x2586ca['query'][_0x4632('0x3c')]+'%'};return _0x4c3619;})});}_0x33336a=_['merge']({},_0x33336a,_0x2586ca[_0x4632('0x3f')]);return _0x1eaf71[_0x4632('0x91')](_0x33336a);}})['then'](function(_0x594957){if(_0x594957){_0xbadb5e=_0x594957[_0x4632('0x46')];if(!_0x2586ca[_0x4632('0x34')][_0x4632('0x59')]('nolimit')){_0x33336a[_0x4632('0x1e')]=qs['limit'](_0x2586ca['query'][_0x4632('0x1e')]);_0x33336a[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x2586ca[_0x4632('0x34')][_0x4632('0x1c')]);}return _0x1eaf71[_0x4632('0x91')](_0x33336a);}})[_0x4632('0x26')](function(_0x652a18){if(_0x652a18){return _0x652a18?{'count':_0xbadb5e,'rows':_0x652a18}:null;}})[_0x4632('0x26')](respondWithResult(_0x9a5191,null))[_0x4632('0x42')](handleError(_0x9a5191,null));};exports[_0x4632('0x92')]=function(_0x2324b1,_0x32e515,_0x27f514){var _0x56e812,_0x2374e6;var _0xa7816c=[];var _0x5a1eb7=moment()[_0x4632('0x65')](_0x4632('0x66'));return db[_0x4632('0x30')][_0x4632('0x48')]({'where':{'id':_0x2324b1['params']['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x32e515,null))['then'](function(_0x7622fe){if(_0x7622fe){_0x2374e6=_0x7622fe;return _0x7622fe[_0x4632('0x92')](_0x2324b1[_0x4632('0x55')][_0x4632('0x67')],_[_0x4632('0x53')](_0x2324b1[_0x4632('0x55')],[_0x4632('0x67'),'id'])||{});}return null;})[_0x4632('0x68')](function(_0x68216b){var _0x5a19a5;var _0x1e8f57;_0x56e812=_0x68216b||[];var _0xdb8048=[];if(_0x68216b){for(var _0x1e824f=0x0;_0x1e824f<_0x68216b[_0x4632('0x46')];_0x1e824f+=0x1){var _0x55c04f=_0x68216b[_0x1e824f][_0x4632('0x28')]({'plain':!![]});_0x5a19a5=squel[_0x4632('0x80')]()[_0x4632('0x81')](_0x4632('0x93'))['fromQuery'](['phone',_0x4632('0x6d'),_0x4632('0x6e'),_0x4632('0x5d'),'createdAt',_0x4632('0x54')],squel['select']()[_0x4632('0x71')](_0x4632('0x72'),_0x4632('0x72'))[_0x4632('0x71')]('id',_0x4632('0x6d'))[_0x4632('0x71')](_0x55c04f['CmListId'][_0x4632('0x75')](),_0x4632('0x6e'))['field'](_0x2324b1[_0x4632('0x44')]['id'][_0x4632('0x75')](),_0x4632('0x5d'))[_0x4632('0x71')]('NOW()',_0x4632('0x6f'))[_0x4632('0x71')](_0x4632('0x73'),'updatedAt')[_0x4632('0x76')](_0x4632('0x77'))[_0x4632('0x3b')](_0x4632('0x78'))['where'](_0x4632('0x83'),_0x55c04f[_0x4632('0x74')]['toString']())[_0x4632('0x3b')](_0x4632('0x79')))[_0x4632('0x75')]();_0xdb8048[_0x4632('0x8e')](db[_0x4632('0x8f')]['query'](_0x5a19a5));}return BPromise[_0x4632('0x90')](_0xdb8048);}})['then'](function(){return _0x56e812;})[_0x4632('0x26')](respondWithResult(_0x32e515,null))['catch'](handleError(_0x32e515,null));};exports[_0x4632('0x94')]=function(_0x3caed3,_0x504de7,_0xeb4cc8){return db[_0x4632('0x30')][_0x4632('0x48')]({'where':{'id':_0x3caed3[_0x4632('0x44')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0x504de7,null))['then'](function(_0x1bc678){if(_0x1bc678){return _0x1bc678['removeBlackLists'](_0x3caed3[_0x4632('0x34')][_0x4632('0x67')]);}})[_0x4632('0x26')](function(_0x22f0cd){if(_0x22f0cd){return db[_0x4632('0x62')][_0x4632('0x27')]({'where':{'ListId':_0x3caed3['query'][_0x4632('0x67')],'CampaignId':_0x3caed3[_0x4632('0x44')]['id']}})[_0x4632('0x26')](function(){return _0x22f0cd;});}})[_0x4632('0x26')](respondWithStatusCode(_0x504de7,null))['catch'](handleError(_0x504de7,null));};
\ No newline at end of file
+var _0x8da1=['status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','get','destroy','end','error','stack','name','send','index','map','Campaign','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','createdAt','updatedAt','role','user','autoAssociation','getHoppers','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','hasOwnProperty','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','into','cm_hopper','phone','scheduledAt','ContactId','field','toString','ListId','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','NOW()','deletedAt\x20IS\x20NULL','CmListId','CampaignId\x20=\x20?','fromQuery','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x8da1,0x1a6));var _0x18da=function(_0x507d62,_0x1f83cb){_0x507d62=_0x507d62-0x0;var _0xed22f2=_0x8da1[_0x507d62];return _0xed22f2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x18da('0x0'));var jsonpatch=require(_0x18da('0x1'));var rp=require(_0x18da('0x2'));var moment=require(_0x18da('0x3'));var BPromise=require(_0x18da('0x4'));var Mustache=require(_0x18da('0x5'));var util=require(_0x18da('0x6'));var path=require('path');var sox=require(_0x18da('0x7'));var csv=require(_0x18da('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x18da('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x18da('0xa'));var jsforce=require(_0x18da('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x18da('0xc'));var Papa=require('papaparse');var Redis=require(_0x18da('0xd'));var authService=require(_0x18da('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x18da('0xf'));var hardwareService=require(_0x18da('0x10'));var logger=require(_0x18da('0x11'))(_0x18da('0x12'));var utils=require('../../config/utils');var config=require(_0x18da('0x13'));var licenseUtil=require(_0x18da('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x509e5b,_0x351d79){_0x351d79=_0x351d79||0xcc;return function(_0x2c1032){if(_0x2c1032){return _0x509e5b[_0x18da('0x15')](_0x351d79);}return _0x509e5b[_0x18da('0x16')](_0x351d79)['end']();};}function respondWithResult(_0x186c5e,_0x5f39aa){_0x5f39aa=_0x5f39aa||0xc8;return function(_0x4a5fe7){if(_0x4a5fe7){return _0x186c5e['status'](_0x5f39aa)['json'](_0x4a5fe7);}};}function respondWithFilteredResult(_0x1c42c8,_0x99c0cf){return function(_0x4120c2){if(_0x4120c2){var _0x2881a7=typeof _0x99c0cf[_0x18da('0x17')]==='undefined'&&typeof _0x99c0cf['limit']===_0x18da('0x18');var _0x31dd7d=_0x4120c2[_0x18da('0x19')];var _0xe867a=_0x2881a7?0x0:_0x99c0cf[_0x18da('0x17')];var _0x55b3a1=_0x2881a7?_0x4120c2[_0x18da('0x19')]:_0x99c0cf[_0x18da('0x17')]+_0x99c0cf[_0x18da('0x1a')];var _0xc7033e;if(_0x55b3a1>=_0x31dd7d){_0x55b3a1=_0x31dd7d;_0xc7033e=0xc8;}else{_0xc7033e=0xce;}_0x1c42c8[_0x18da('0x16')](_0xc7033e);return _0x1c42c8['set'](_0x18da('0x1b'),_0xe867a+'-'+_0x55b3a1+'/'+_0x31dd7d)[_0x18da('0x1c')](_0x4120c2);}return null;};}function patchUpdates(_0x1ad984){return function(_0x21a792){try{jsonpatch[_0x18da('0x1d')](_0x21a792,_0x1ad984,!![]);}catch(_0x3045f1){return BPromise[_0x18da('0x1e')](_0x3045f1);}return _0x21a792[_0x18da('0x1f')]();};}function saveUpdates(_0xfd2afd,_0x4d5958){return function(_0x27f6d1){if(_0x27f6d1){return _0x27f6d1[_0x18da('0x20')](_0xfd2afd)['then'](function(_0x183f63){return _0x183f63;});}return null;};}function removeEntity(_0x1ef528,_0x2f5429){return function(_0x2d3cba){if(_0x2d3cba){return _0x2d3cba['destroy']()[_0x18da('0x21')](function(){var _0x253c5b=_0x2d3cba[_0x18da('0x22')]({'plain':!![]});var _0x588014='IvrCampaigns';return db['UserProfileResource'][_0x18da('0x23')]({'where':{'type':_0x588014,'resourceId':_0x253c5b['id']}})['then'](function(){return _0x2d3cba;});})[_0x18da('0x21')](function(){_0x1ef528[_0x18da('0x16')](0xcc)[_0x18da('0x24')]();});}};}function handleEntityNotFound(_0x2cd46d,_0x52db6c){return function(_0xa91c23){if(!_0xa91c23){_0x2cd46d[_0x18da('0x15')](0x194);}return _0xa91c23;};}function handleError(_0x4d7cf7,_0x3bec6f){_0x3bec6f=_0x3bec6f||0x1f4;return function(_0xd3732b){logger[_0x18da('0x25')](_0xd3732b[_0x18da('0x26')]);if(_0xd3732b[_0x18da('0x27')]){delete _0xd3732b[_0x18da('0x27')];}_0x4d7cf7['status'](_0x3bec6f)[_0x18da('0x28')](_0xd3732b);};}exports[_0x18da('0x29')]=function(_0x1cf0b0,_0xc554d7){var _0x34f6fd={},_0x291c2a={},_0x46d863={'count':0x0,'rows':[]};var _0x20cf42=_[_0x18da('0x2a')](db[_0x18da('0x2b')]['rawAttributes'],function(_0x1f0e57){return{'name':_0x1f0e57[_0x18da('0x2c')],'type':_0x1f0e57[_0x18da('0x2d')][_0x18da('0x2e')]};});_0x291c2a['model']=_[_0x18da('0x2a')](_0x20cf42,'name');_0x291c2a[_0x18da('0x2f')]=_[_0x18da('0x30')](_0x1cf0b0[_0x18da('0x2f')]);_0x291c2a[_0x18da('0x31')]=_[_0x18da('0x32')](_0x291c2a[_0x18da('0x33')],_0x291c2a[_0x18da('0x2f')]);_0x34f6fd['attributes']=_[_0x18da('0x32')](_0x291c2a['model'],qs[_0x18da('0x34')](_0x1cf0b0[_0x18da('0x2f')][_0x18da('0x34')]));_0x34f6fd[_0x18da('0x35')]=_0x34f6fd[_0x18da('0x35')][_0x18da('0x36')]?_0x34f6fd['attributes']:_0x291c2a['model'];if(!_0x1cf0b0[_0x18da('0x2f')]['hasOwnProperty'](_0x18da('0x37'))){_0x34f6fd[_0x18da('0x1a')]=qs[_0x18da('0x1a')](_0x1cf0b0['query'][_0x18da('0x1a')]);_0x34f6fd['offset']=qs['offset'](_0x1cf0b0[_0x18da('0x2f')][_0x18da('0x17')]);}_0x34f6fd[_0x18da('0x38')]=qs[_0x18da('0x39')](_0x1cf0b0[_0x18da('0x2f')][_0x18da('0x39')]);_0x34f6fd['where']=qs['filters'](_[_0x18da('0x3a')](_0x1cf0b0[_0x18da('0x2f')],_0x291c2a[_0x18da('0x31')]),_0x20cf42);if(_0x1cf0b0[_0x18da('0x2f')][_0x18da('0x3b')]){_0x34f6fd[_0x18da('0x3c')]=_['merge'](_0x34f6fd['where'],{'$or':_[_0x18da('0x2a')](_0x20cf42,function(_0x5a6797){if(_0x5a6797[_0x18da('0x2d')]!==_0x18da('0x3d')){var _0xc8e2f0={};_0xc8e2f0[_0x5a6797[_0x18da('0x27')]]={'$like':'%'+_0x1cf0b0[_0x18da('0x2f')][_0x18da('0x3b')]+'%'};return _0xc8e2f0;}})});}_0x34f6fd=_[_0x18da('0x3e')]({},_0x34f6fd,_0x1cf0b0['options']);var _0x35534d={'where':_0x34f6fd[_0x18da('0x3c')]};return db[_0x18da('0x2b')][_0x18da('0x19')](_0x35534d)[_0x18da('0x21')](function(_0x59d7a1){_0x46d863[_0x18da('0x19')]=_0x59d7a1;if(_0x1cf0b0[_0x18da('0x2f')]['includeAll']){_0x34f6fd['include']=[{'all':!![]}];}return db[_0x18da('0x2b')][_0x18da('0x3f')](_0x34f6fd);})[_0x18da('0x21')](function(_0x3c2f26){_0x46d863[_0x18da('0x40')]=_0x3c2f26;return _0x46d863;})[_0x18da('0x21')](respondWithFilteredResult(_0xc554d7,_0x34f6fd))[_0x18da('0x41')](handleError(_0xc554d7,null));};exports[_0x18da('0x42')]=function(_0x4a8525,_0xa23065){var _0x5eccf3={'raw':![],'where':{'id':_0x4a8525[_0x18da('0x43')]['id']}},_0x557dfe={};_0x557dfe[_0x18da('0x33')]=_[_0x18da('0x30')](db[_0x18da('0x2b')][_0x18da('0x44')]);_0x557dfe[_0x18da('0x2f')]=_[_0x18da('0x30')](_0x4a8525['query']);_0x557dfe[_0x18da('0x31')]=_[_0x18da('0x32')](_0x557dfe[_0x18da('0x33')],_0x557dfe[_0x18da('0x2f')]);_0x5eccf3[_0x18da('0x35')]=_[_0x18da('0x32')](_0x557dfe[_0x18da('0x33')],qs[_0x18da('0x34')](_0x4a8525[_0x18da('0x2f')][_0x18da('0x34')]));_0x5eccf3['attributes']=_0x5eccf3[_0x18da('0x35')]['length']?_0x5eccf3[_0x18da('0x35')]:_0x557dfe['model'];if(_0x4a8525[_0x18da('0x2f')]['includeAll']){_0x5eccf3[_0x18da('0x45')]=[{'all':!![]}];}_0x5eccf3=_[_0x18da('0x3e')]({},_0x5eccf3,_0x4a8525[_0x18da('0x46')]);return db[_0x18da('0x2b')][_0x18da('0x47')](_0x5eccf3)[_0x18da('0x21')](handleEntityNotFound(_0xa23065,null))['then'](respondWithResult(_0xa23065,null))['catch'](handleError(_0xa23065,null));};exports['create']=function(_0x51885e,_0x3ef616){return db[_0x18da('0x2b')][_0x18da('0x48')](_0x51885e[_0x18da('0x49')],{})[_0x18da('0x21')](function(_0x571848){var _0x44960f=_0x51885e['user'][_0x18da('0x22')]({'plain':!![]});if(!_0x44960f)throw new Error(_0x18da('0x4a'));if(_0x44960f['role']==='user'){var _0x5d5546=_0x571848[_0x18da('0x22')]({'plain':!![]});var _0x37d182=_0x18da('0x4b');return db[_0x18da('0x4c')][_0x18da('0x47')]({'where':{'name':_0x37d182,'userProfileId':_0x44960f[_0x18da('0x4d')]},'raw':!![]})['then'](function(_0x5cc3e7){if(_0x5cc3e7&&_0x5cc3e7['autoAssociation']===0x0){return db[_0x18da('0x4e')][_0x18da('0x48')]({'name':_0x5d5546[_0x18da('0x27')],'resourceId':_0x5d5546['id'],'type':_0x5cc3e7['name'],'sectionId':_0x5cc3e7['id']},{})[_0x18da('0x21')](function(){return _0x571848;});}else{return _0x571848;}})['catch'](function(_0x57592a){logger[_0x18da('0x25')](_0x18da('0x4f'),_0x57592a);throw _0x57592a;});}return _0x571848;})[_0x18da('0x21')](respondWithResult(_0x3ef616,0xc9))['catch'](handleError(_0x3ef616,null));};exports[_0x18da('0x50')]=function(_0x26421b,_0x4eb1da){var _0x48cb21={'where':{'id':_0x26421b[_0x18da('0x43')]['id']}},_0x45e3a7={};_0x45e3a7[_0x18da('0x33')]=_[_0x18da('0x30')](db[_0x18da('0x2b')][_0x18da('0x44')]);_0x48cb21[_0x18da('0x35')]=_[_0x18da('0x32')](_0x45e3a7['model'],qs[_0x18da('0x34')](_0x26421b[_0x18da('0x2f')]['fields']));_0x48cb21[_0x18da('0x35')]=_0x48cb21[_0x18da('0x35')][_0x18da('0x36')]?_0x48cb21[_0x18da('0x35')]:_0x45e3a7[_0x18da('0x33')];if(_0x26421b[_0x18da('0x2f')][_0x18da('0x51')]){_0x48cb21[_0x18da('0x45')]=[{'all':!![]}];}_0x48cb21=_[_0x18da('0x3e')]({},_0x48cb21,_0x26421b[_0x18da('0x46')]);return db['Campaign'][_0x18da('0x47')](_0x48cb21)['then'](handleEntityNotFound(_0x4eb1da,null))[_0x18da('0x21')](function(_0x604586){if(_0x604586){var _0x375f20=_0x604586['get']({'plain':!![]});_0x375f20=qs[_0x18da('0x52')](_0x375f20,['id',_0x18da('0x53'),_0x18da('0x54')]);_0x26421b[_0x18da('0x49')]=_['omit'](_0x26421b[_0x18da('0x49')],['id','createdAt',_0x18da('0x54')]);return db[_0x18da('0x2b')][_0x18da('0x48')](_[_0x18da('0x3e')](_0x375f20,_0x26421b[_0x18da('0x49')]),{'include':_0x26421b[_0x18da('0x2f')][_0x18da('0x51')]?[{'all':!![]}]:undefined})[_0x18da('0x21')](function(_0x45b347){var _0x456c03=_0x26421b['user'][_0x18da('0x22')]({'plain':!![]});if(!_0x456c03)throw new Error(_0x18da('0x4a'));if(_0x456c03[_0x18da('0x55')]===_0x18da('0x56')){var _0x40f66c=_0x45b347[_0x18da('0x22')]({'plain':!![]});var _0x4ad8f8='IvrCampaigns';return db['UserProfileSection'][_0x18da('0x47')]({'where':{'name':_0x4ad8f8,'userProfileId':_0x456c03[_0x18da('0x4d')]},'raw':!![]})['then'](function(_0x2ab7e7){if(_0x2ab7e7&&_0x2ab7e7[_0x18da('0x57')]===0x0){return db[_0x18da('0x4e')][_0x18da('0x48')]({'name':_0x40f66c[_0x18da('0x27')],'resourceId':_0x40f66c['id'],'type':_0x2ab7e7[_0x18da('0x27')],'sectionId':_0x2ab7e7['id']},{})[_0x18da('0x21')](function(){return _0x45b347;});}else{return _0x45b347;}})[_0x18da('0x41')](function(_0x30f411){logger[_0x18da('0x25')](_0x18da('0x4f'),_0x30f411);throw _0x30f411;});}return _0x45b347;});}})[_0x18da('0x21')](respondWithResult(_0x4eb1da,0xc9))[_0x18da('0x41')](handleError(_0x4eb1da,null));};exports['update']=function(_0x2875e2,_0x5b7188){if(_0x2875e2[_0x18da('0x49')]['id']){delete _0x2875e2[_0x18da('0x49')]['id'];}return db[_0x18da('0x2b')][_0x18da('0x47')]({'where':{'id':_0x2875e2[_0x18da('0x43')]['id']}})[_0x18da('0x21')](handleEntityNotFound(_0x5b7188,null))[_0x18da('0x21')](saveUpdates(_0x2875e2[_0x18da('0x49')],null))[_0x18da('0x21')](respondWithResult(_0x5b7188,null))[_0x18da('0x41')](handleError(_0x5b7188,null));};exports[_0x18da('0x23')]=function(_0x1c58f7,_0x1d063a){return db[_0x18da('0x2b')][_0x18da('0x47')]({'where':{'id':_0x1c58f7[_0x18da('0x43')]['id']}})[_0x18da('0x21')](handleEntityNotFound(_0x1d063a,null))[_0x18da('0x21')](removeEntity(_0x1d063a,null))[_0x18da('0x41')](handleError(_0x1d063a,null));};exports[_0x18da('0x58')]=function(_0xbf5914,_0x3315ae,_0x480ab8){var _0x322c80={'raw':!![],'where':{}};var _0x2852fd={};var _0x56ea45={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xbf5914[_0x18da('0x43')]['id']}})[_0x18da('0x21')](handleEntityNotFound(_0x3315ae,null))[_0x18da('0x21')](function(_0x5bad78){if(_0x5bad78){_0x2852fd[_0x18da('0x33')]=_[_0x18da('0x30')](db['CmHopper'][_0x18da('0x44')]);_0x2852fd[_0x18da('0x2f')]=_['keys'](_0xbf5914[_0x18da('0x2f')]);_0x2852fd[_0x18da('0x31')]=_[_0x18da('0x32')](_0x2852fd['model'],_0x2852fd[_0x18da('0x2f')]);_0x322c80[_0x18da('0x35')]=_[_0x18da('0x32')](_0x2852fd[_0x18da('0x33')],qs[_0x18da('0x34')](_0xbf5914[_0x18da('0x2f')][_0x18da('0x34')]));_0x322c80[_0x18da('0x35')]=_0x322c80['attributes'][_0x18da('0x36')]?_0x322c80[_0x18da('0x35')]:_0x2852fd[_0x18da('0x33')];if(!_0xbf5914[_0x18da('0x2f')]['hasOwnProperty'](_0x18da('0x37'))){_0x322c80[_0x18da('0x1a')]=qs[_0x18da('0x1a')](_0xbf5914['query']['limit']);_0x322c80['offset']=qs[_0x18da('0x17')](_0xbf5914['query']['offset']);}_0x322c80[_0x18da('0x38')]=qs[_0x18da('0x39')](_0xbf5914[_0x18da('0x2f')][_0x18da('0x39')]);_0x322c80['where']=qs[_0x18da('0x31')](_[_0x18da('0x3a')](_0xbf5914[_0x18da('0x2f')],_0x2852fd['filters']));_0x322c80[_0x18da('0x3c')][_0x18da('0x59')]=_0x5bad78['id'];if(_0xbf5914[_0x18da('0x2f')][_0x18da('0x3b')]){_0x322c80['where']=_['merge'](_0x322c80[_0x18da('0x3c')],{'$or':_[_0x18da('0x2a')](_0x322c80[_0x18da('0x35')],function(_0x4c9525){var _0xa0275e={};_0xa0275e[_0x4c9525]={'$like':'%'+_0xbf5914[_0x18da('0x2f')][_0x18da('0x3b')]+'%'};return _0xa0275e;})});}_0x322c80=_['merge']({},_0x322c80,_0xbf5914[_0x18da('0x46')]);return db[_0x18da('0x5a')][_0x18da('0x19')]({'where':_0x322c80['where']})['then'](function(_0xe43eec){_0x56ea45[_0x18da('0x19')]=_0xe43eec;if(_0xbf5914[_0x18da('0x2f')][_0x18da('0x51')]){_0x322c80[_0x18da('0x45')]=[{'all':!![]}];}return db[_0x18da('0x5a')][_0x18da('0x3f')](_0x322c80);})[_0x18da('0x21')](function(_0x3f9adc){_0x56ea45[_0x18da('0x40')]=_0x3f9adc;return _0x56ea45;});}})[_0x18da('0x21')](respondWithFilteredResult(_0x3315ae,_0x322c80))[_0x18da('0x41')](handleError(_0x3315ae,null));};exports[_0x18da('0x5b')]=function(_0x416a1f,_0x2b98ef,_0x453132){var _0x2623e5={'raw':!![],'where':{}};var _0x473de6={};var _0x3a8176={'count':0x0,'rows':[]};return db[_0x18da('0x2b')]['findOne']({'where':{'id':_0x416a1f['params']['id']}})['then'](handleEntityNotFound(_0x2b98ef,null))[_0x18da('0x21')](function(_0x28d3e1){if(_0x28d3e1){_0x473de6['model']=_[_0x18da('0x30')](db[_0x18da('0x5c')]['rawAttributes']);_0x473de6[_0x18da('0x2f')]=_[_0x18da('0x30')](_0x416a1f[_0x18da('0x2f')]);_0x473de6['filters']=_[_0x18da('0x32')](_0x473de6[_0x18da('0x33')],_0x473de6[_0x18da('0x2f')]);_0x2623e5[_0x18da('0x35')]=_[_0x18da('0x32')](_0x473de6[_0x18da('0x33')],qs[_0x18da('0x34')](_0x416a1f[_0x18da('0x2f')][_0x18da('0x34')]));_0x2623e5['attributes']=_0x2623e5['attributes']['length']?_0x2623e5['attributes']:_0x473de6[_0x18da('0x33')];if(!_0x416a1f[_0x18da('0x2f')][_0x18da('0x5d')](_0x18da('0x37'))){_0x2623e5[_0x18da('0x1a')]=qs[_0x18da('0x1a')](_0x416a1f[_0x18da('0x2f')][_0x18da('0x1a')]);_0x2623e5[_0x18da('0x17')]=qs[_0x18da('0x17')](_0x416a1f['query']['offset']);}_0x2623e5[_0x18da('0x38')]=qs[_0x18da('0x39')](_0x416a1f[_0x18da('0x2f')][_0x18da('0x39')]);_0x2623e5['where']=qs[_0x18da('0x31')](_[_0x18da('0x3a')](_0x416a1f[_0x18da('0x2f')],_0x473de6['filters']));_0x2623e5['where']['CampaignId']=_0x28d3e1['id'];if(_0x416a1f[_0x18da('0x2f')][_0x18da('0x3b')]){_0x2623e5[_0x18da('0x3c')]=_['merge'](_0x2623e5[_0x18da('0x3c')],{'$or':_[_0x18da('0x2a')](_0x2623e5['attributes'],function(_0x24b7f8){var _0x17346d={};_0x17346d[_0x24b7f8]={'$like':'%'+_0x416a1f[_0x18da('0x2f')]['filter']+'%'};return _0x17346d;})});}_0x2623e5=_['merge']({},_0x2623e5,_0x416a1f[_0x18da('0x46')]);return db[_0x18da('0x5c')][_0x18da('0x19')]({'where':_0x2623e5['where']})['then'](function(_0x1ff66e){_0x3a8176[_0x18da('0x19')]=_0x1ff66e;if(_0x416a1f[_0x18da('0x2f')][_0x18da('0x51')]){_0x2623e5[_0x18da('0x45')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x2623e5);})[_0x18da('0x21')](function(_0x3527b1){_0x3a8176[_0x18da('0x40')]=_0x3527b1;return _0x3a8176;});}})[_0x18da('0x21')](respondWithFilteredResult(_0x2b98ef,_0x2623e5))[_0x18da('0x41')](handleError(_0x2b98ef,null));};exports[_0x18da('0x5e')]=function(_0x55e08a,_0x384d1f,_0x39780a){var _0x10e391={'raw':!![],'where':{}};var _0x5262f9={};var _0x566938={'count':0x0,'rows':[]};return db[_0x18da('0x2b')][_0x18da('0x5f')]({'where':{'id':_0x55e08a[_0x18da('0x43')]['id']}})[_0x18da('0x21')](handleEntityNotFound(_0x384d1f,null))[_0x18da('0x21')](function(_0x469901){if(_0x469901){_0x5262f9[_0x18da('0x33')]=_[_0x18da('0x30')](db['CmHopperFinal'][_0x18da('0x44')]);_0x5262f9[_0x18da('0x2f')]=_[_0x18da('0x30')](_0x55e08a[_0x18da('0x2f')]);_0x5262f9['filters']=_['intersection'](_0x5262f9[_0x18da('0x33')],_0x5262f9[_0x18da('0x2f')]);_0x10e391[_0x18da('0x35')]=_['intersection'](_0x5262f9[_0x18da('0x33')],qs['fields'](_0x55e08a[_0x18da('0x2f')][_0x18da('0x34')]));_0x10e391['attributes']=_0x10e391[_0x18da('0x35')][_0x18da('0x36')]?_0x10e391[_0x18da('0x35')]:_0x5262f9['model'];if(!_0x55e08a[_0x18da('0x2f')]['hasOwnProperty'](_0x18da('0x37'))){_0x10e391['limit']=qs[_0x18da('0x1a')](_0x55e08a[_0x18da('0x2f')]['limit']);_0x10e391[_0x18da('0x17')]=qs[_0x18da('0x17')](_0x55e08a['query'][_0x18da('0x17')]);}_0x10e391[_0x18da('0x38')]=qs[_0x18da('0x39')](_0x55e08a[_0x18da('0x2f')][_0x18da('0x39')]);_0x10e391[_0x18da('0x3c')]=qs['filters'](_[_0x18da('0x3a')](_0x55e08a['query'],_0x5262f9[_0x18da('0x31')]));_0x10e391['where']['CampaignId']=_0x469901['id'];if(_0x55e08a[_0x18da('0x2f')][_0x18da('0x3b')]){_0x10e391[_0x18da('0x3c')]=_[_0x18da('0x3e')](_0x10e391[_0x18da('0x3c')],{'$or':_[_0x18da('0x2a')](_0x10e391[_0x18da('0x35')],function(_0x1558d4){var _0x464a15={};_0x464a15[_0x1558d4]={'$like':'%'+_0x55e08a[_0x18da('0x2f')][_0x18da('0x3b')]+'%'};return _0x464a15;})});}_0x10e391=_[_0x18da('0x3e')]({},_0x10e391,_0x55e08a[_0x18da('0x46')]);return db[_0x18da('0x60')][_0x18da('0x19')]({'where':_0x10e391[_0x18da('0x3c')]})[_0x18da('0x21')](function(_0x4589b2){_0x566938[_0x18da('0x19')]=_0x4589b2;if(_0x55e08a[_0x18da('0x2f')][_0x18da('0x51')]){_0x10e391[_0x18da('0x45')]=[{'all':!![]}];}return db[_0x18da('0x60')][_0x18da('0x3f')](_0x10e391);})[_0x18da('0x21')](function(_0x151c39){_0x566938['rows']=_0x151c39;return _0x566938;});}})[_0x18da('0x21')](respondWithFilteredResult(_0x384d1f,_0x10e391))[_0x18da('0x41')](handleError(_0x384d1f,null));};exports[_0x18da('0x61')]=function(_0x1b0f48,_0x21c282,_0x23294c){var _0x1c3202={'raw':!![],'where':{}};var _0xe406c5={};var _0x50b0cf={'count':0x0,'rows':[]};return db[_0x18da('0x2b')]['findOne']({'where':{'id':_0x1b0f48[_0x18da('0x43')]['id']}})['then'](handleEntityNotFound(_0x21c282,null))[_0x18da('0x21')](function(_0x4c0620){if(_0x4c0620){_0xe406c5[_0x18da('0x33')]=_[_0x18da('0x30')](db[_0x18da('0x62')][_0x18da('0x44')]);_0xe406c5[_0x18da('0x2f')]=_[_0x18da('0x30')](_0x1b0f48[_0x18da('0x2f')]);_0xe406c5[_0x18da('0x31')]=_['intersection'](_0xe406c5['model'],_0xe406c5[_0x18da('0x2f')]);_0x1c3202[_0x18da('0x35')]=_['intersection'](_0xe406c5['model'],qs[_0x18da('0x34')](_0x1b0f48[_0x18da('0x2f')][_0x18da('0x34')]));_0x1c3202[_0x18da('0x35')]=_0x1c3202[_0x18da('0x35')][_0x18da('0x36')]?_0x1c3202[_0x18da('0x35')]:_0xe406c5[_0x18da('0x33')];if(!_0x1b0f48['query'][_0x18da('0x5d')]('nolimit')){_0x1c3202['limit']=qs['limit'](_0x1b0f48['query'][_0x18da('0x1a')]);_0x1c3202[_0x18da('0x17')]=qs[_0x18da('0x17')](_0x1b0f48[_0x18da('0x2f')][_0x18da('0x17')]);}_0x1c3202[_0x18da('0x38')]=qs[_0x18da('0x39')](_0x1b0f48[_0x18da('0x2f')][_0x18da('0x39')]);_0x1c3202[_0x18da('0x3c')]=qs['filters'](_['pick'](_0x1b0f48[_0x18da('0x2f')],_0xe406c5[_0x18da('0x31')]));_0x1c3202[_0x18da('0x3c')][_0x18da('0x59')]=_0x4c0620['id'];if(_0x1b0f48[_0x18da('0x2f')]['filter']){_0x1c3202[_0x18da('0x3c')]=_[_0x18da('0x3e')](_0x1c3202[_0x18da('0x3c')],{'$or':_[_0x18da('0x2a')](_0x1c3202[_0x18da('0x35')],function(_0x4eaa06){var _0x207e11={};_0x207e11[_0x4eaa06]={'$like':'%'+_0x1b0f48['query'][_0x18da('0x3b')]+'%'};return _0x207e11;})});}_0x1c3202=_[_0x18da('0x3e')]({},_0x1c3202,_0x1b0f48[_0x18da('0x46')]);return db[_0x18da('0x62')]['count']({'where':_0x1c3202['where']})[_0x18da('0x21')](function(_0x171e50){_0x50b0cf[_0x18da('0x19')]=_0x171e50;if(_0x1b0f48[_0x18da('0x2f')][_0x18da('0x51')]){_0x1c3202[_0x18da('0x45')]=[{'all':!![]}];}return db[_0x18da('0x62')][_0x18da('0x3f')](_0x1c3202);})[_0x18da('0x21')](function(_0x45097d){_0x50b0cf[_0x18da('0x40')]=_0x45097d;return _0x50b0cf;});}})[_0x18da('0x21')](respondWithFilteredResult(_0x21c282,_0x1c3202))[_0x18da('0x41')](handleError(_0x21c282,null));};exports[_0x18da('0x63')]=function(_0x5c9141,_0x34076c,_0x539509){var _0x42ae8f={};var _0x5540ac={};var _0x8fd104;var _0x1ab929;return db['Campaign'][_0x18da('0x5f')]({'where':{'id':_0x5c9141[_0x18da('0x43')]['id']}})[_0x18da('0x21')](handleEntityNotFound(_0x34076c,null))['then'](function(_0x522a4e){if(_0x522a4e){_0x8fd104=_0x522a4e;_0x5540ac['model']=_[_0x18da('0x30')](db[_0x18da('0x64')][_0x18da('0x44')]);_0x5540ac[_0x18da('0x2f')]=_[_0x18da('0x30')](_0x5c9141[_0x18da('0x2f')]);_0x5540ac[_0x18da('0x31')]=_[_0x18da('0x32')](_0x5540ac[_0x18da('0x33')],_0x5540ac[_0x18da('0x2f')]);_0x42ae8f[_0x18da('0x35')]=_[_0x18da('0x32')](_0x5540ac['model'],qs[_0x18da('0x34')](_0x5c9141['query']['fields']));_0x42ae8f['attributes']=_0x42ae8f[_0x18da('0x35')][_0x18da('0x36')]?_0x42ae8f[_0x18da('0x35')]:_0x5540ac['model'];_0x42ae8f[_0x18da('0x38')]=qs[_0x18da('0x39')](_0x5c9141[_0x18da('0x2f')]['sort']);_0x42ae8f['where']=qs['filters'](_[_0x18da('0x3a')](_0x5c9141[_0x18da('0x2f')],_0x5540ac[_0x18da('0x31')]));if(_0x5c9141[_0x18da('0x2f')][_0x18da('0x3b')]){_0x42ae8f[_0x18da('0x3c')]=_[_0x18da('0x3e')](_0x42ae8f[_0x18da('0x3c')],{'$or':_[_0x18da('0x2a')](_0x42ae8f['attributes'],function(_0x186ed5){var _0x5e4bc9={};_0x5e4bc9[_0x186ed5]={'$like':'%'+_0x5c9141[_0x18da('0x2f')][_0x18da('0x3b')]+'%'};return _0x5e4bc9;})});}_0x42ae8f=_['merge']({},_0x42ae8f,_0x5c9141['options']);return _0x8fd104[_0x18da('0x63')](_0x42ae8f);}})[_0x18da('0x21')](function(_0x226223){if(_0x226223){_0x1ab929=_0x226223[_0x18da('0x36')];if(!_0x5c9141['query'][_0x18da('0x5d')]('nolimit')){_0x42ae8f[_0x18da('0x1a')]=qs[_0x18da('0x1a')](_0x5c9141['query'][_0x18da('0x1a')]);_0x42ae8f[_0x18da('0x17')]=qs[_0x18da('0x17')](_0x5c9141[_0x18da('0x2f')][_0x18da('0x17')]);}return _0x8fd104[_0x18da('0x63')](_0x42ae8f);}})[_0x18da('0x21')](function(_0x3c2a4a){if(_0x3c2a4a){return _0x3c2a4a?{'count':_0x1ab929,'rows':_0x3c2a4a}:null;}})['then'](respondWithResult(_0x34076c,null))['catch'](handleError(_0x34076c,null));};exports['addLists']=function(_0xa24214,_0x4d09a0,_0x406803){var _0x2fb492,_0x2719bc;var _0x2f597b=[];var _0x9707a3=moment()[_0x18da('0x65')](_0x18da('0x66'));return db[_0x18da('0x2b')][_0x18da('0x47')]({'where':{'id':_0xa24214[_0x18da('0x43')]['id']}})['then'](handleEntityNotFound(_0x4d09a0,null))[_0x18da('0x21')](function(_0x472f9b){if(_0x472f9b){_0x2719bc=_0x472f9b;return _0x472f9b[_0x18da('0x67')](_0xa24214[_0x18da('0x49')][_0x18da('0x68')],_[_0x18da('0x52')](_0xa24214[_0x18da('0x49')],[_0x18da('0x68'),'id'])||{});}return null;})[_0x18da('0x69')](function(_0x3fddc0){var _0x3b1a70;var _0x414500;_0x2fb492=_0x3fddc0||[];var _0x4ef61=[];if(_0x3fddc0){for(var _0x27f636=0x0;_0x27f636<_0x3fddc0[_0x18da('0x36')];_0x27f636+=0x1){var _0xdd8d66=_0x3fddc0[_0x27f636][_0x18da('0x22')]({'plain':!![]});_0x2719bc['dialCheckDuplicateType']=_0xa24214[_0x18da('0x49')][_0x18da('0x6a')]?_0xa24214[_0x18da('0x49')][_0x18da('0x6a')]:_0x2719bc[_0x18da('0x6a')];switch(_0x2719bc[_0x18da('0x6a')]){case'always':_0x3b1a70=squel['insert']()[_0x18da('0x6b')](_0x18da('0x6c'))['fromQuery']([_0x18da('0x6d'),_0x18da('0x6e'),_0x18da('0x6f'),'ListId','CampaignId',_0x18da('0x53'),_0x18da('0x54')],squel['select']()['field'](_0x18da('0x6d'),_0x18da('0x6d'))[_0x18da('0x70')]('NOW()','scheduledAt')[_0x18da('0x70')]('id',_0x18da('0x6f'))[_0x18da('0x70')](_0xdd8d66['CmListId'][_0x18da('0x71')](),_0x18da('0x72'))[_0x18da('0x70')](_0xa24214['params']['id'][_0x18da('0x71')](),_0x18da('0x59'))[_0x18da('0x70')]('\x27'+_0x9707a3+'\x27',_0x18da('0x53'))[_0x18da('0x70')]('\x27'+_0x9707a3+'\x27',_0x18da('0x54'))[_0x18da('0x73')](_0x18da('0x74'))[_0x18da('0x3c')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0xdd8d66['CmListId']['toString']())[_0x18da('0x3c')](_0x18da('0x75'))[_0x18da('0x3c')](_0x18da('0x76'),squel[_0x18da('0x77')]()[_0x18da('0x70')](_0x18da('0x78'))[_0x18da('0x73')](_0x18da('0x79'))[_0x18da('0x3c')]('CampaignId\x20=\x20?',_0xa24214[_0x18da('0x43')]['id'][_0x18da('0x71')]()))[_0x18da('0x3c')](_0x18da('0x76'),squel[_0x18da('0x77')]()[_0x18da('0x70')](_0x18da('0x7a'))[_0x18da('0x73')]('cm_hopper')[_0x18da('0x3c')]('CampaignId\x20=\x20?',_0xa24214[_0x18da('0x43')]['id'][_0x18da('0x71')]())))[_0x18da('0x71')]();break;case _0x18da('0x7b'):_0x3b1a70=squel[_0x18da('0x7c')]()['into'](_0x18da('0x6c'))['fromQuery']([_0x18da('0x6d'),_0x18da('0x6e'),'ContactId',_0x18da('0x72'),_0x18da('0x59'),_0x18da('0x53'),_0x18da('0x54')],squel[_0x18da('0x77')]()[_0x18da('0x70')](_0x18da('0x6d'),'phone')['field'](_0x18da('0x7d'),_0x18da('0x6e'))['field']('id',_0x18da('0x6f'))['field'](_0xdd8d66['CmListId'][_0x18da('0x71')](),_0x18da('0x72'))[_0x18da('0x70')](_0xa24214['params']['id'][_0x18da('0x71')](),_0x18da('0x59'))[_0x18da('0x70')]('\x27'+_0x9707a3+'\x27','createdAt')[_0x18da('0x70')]('\x27'+_0x9707a3+'\x27','updatedAt')[_0x18da('0x73')](_0x18da('0x74'))[_0x18da('0x3c')](_0x18da('0x7e'))[_0x18da('0x3c')]('ListId\x20=\x20?',_0xdd8d66[_0x18da('0x7f')][_0x18da('0x71')]())['where'](_0x18da('0x75'))['where'](_0x18da('0x76'),squel[_0x18da('0x77')]()[_0x18da('0x70')](_0x18da('0x7a'))[_0x18da('0x73')]('cm_hopper')[_0x18da('0x3c')](_0x18da('0x80'),_0xa24214[_0x18da('0x43')]['id'][_0x18da('0x71')]())))[_0x18da('0x71')]();break;default:_0x3b1a70=squel[_0x18da('0x7c')]()[_0x18da('0x6b')]('cm_hopper')[_0x18da('0x81')]([_0x18da('0x6d'),_0x18da('0x6e'),_0x18da('0x6f'),_0x18da('0x72'),_0x18da('0x59'),'createdAt',_0x18da('0x54')],squel[_0x18da('0x77')]()[_0x18da('0x70')]('phone','phone')[_0x18da('0x70')](_0x18da('0x7d'),_0x18da('0x6e'))['field']('id',_0x18da('0x6f'))['field'](_0xdd8d66['CmListId'][_0x18da('0x71')](),'ListId')[_0x18da('0x70')](_0xa24214['params']['id']['toString'](),'CampaignId')['field']('\x27'+_0x9707a3+'\x27',_0x18da('0x53'))[_0x18da('0x70')]('\x27'+_0x9707a3+'\x27',_0x18da('0x54'))['from'](_0x18da('0x74'))[_0x18da('0x3c')](_0x18da('0x7e'))[_0x18da('0x3c')](_0x18da('0x82'),_0xdd8d66[_0x18da('0x7f')]['toString']())['where'](_0x18da('0x75')))[_0x18da('0x71')]();}_0x414500=squel[_0x18da('0x7c')]()[_0x18da('0x6b')](_0x18da('0x83'))['fromQuery']([_0x18da('0x84'),_0x18da('0x6e'),_0x18da('0x6d'),_0x18da('0x85'),_0x18da('0x53'),'updatedAt'],squel[_0x18da('0x77')]()[_0x18da('0x70')](_0x18da('0x86'),'id')['field'](_0x18da('0x7d'),_0x18da('0x6e'))['field'](_0x18da('0x87'),_0x18da('0x6d'))['field'](_0x18da('0x88'),_0x18da('0x85'))[_0x18da('0x70')]('\x27'+_0x9707a3+'\x27',_0x18da('0x53'))['field']('\x27'+_0x9707a3+'\x27',_0x18da('0x54'))[_0x18da('0x73')](_0x18da('0x89'),'ci')['join']('cm_hopper','h',_0x18da('0x8a'))[_0x18da('0x3c')](_0x18da('0x8b'),_0xdd8d66['CmListId'][_0x18da('0x71')]())[_0x18da('0x3c')](_0x18da('0x8c'),_0xa24214[_0x18da('0x43')]['id'][_0x18da('0x71')]())[_0x18da('0x3c')](_0x18da('0x8d'),_0x9707a3))[_0x18da('0x71')]();_0x4ef61['push'](db['sequelize'][_0x18da('0x2f')](_0x3b1a70));_0x2f597b[_0x18da('0x8e')](db['sequelize']['query'](_0x414500));}return BPromise[_0x18da('0x8f')](_0x4ef61);}})[_0x18da('0x21')](function(){return BPromise['all'](_0x2f597b);})[_0x18da('0x21')](function(){return _0x2fb492;})[_0x18da('0x21')](respondWithResult(_0x4d09a0,null))[_0x18da('0x41')](handleError(_0x4d09a0,null));};exports['removeLists']=function(_0x530cb1,_0x476926,_0x18e62e){return db['Campaign'][_0x18da('0x47')]({'where':{'id':_0x530cb1[_0x18da('0x43')]['id']}})['then'](handleEntityNotFound(_0x476926,null))[_0x18da('0x21')](function(_0x4c1a8b){if(_0x4c1a8b){return _0x4c1a8b[_0x18da('0x90')](_0x530cb1[_0x18da('0x2f')][_0x18da('0x68')]);}})[_0x18da('0x21')](function(_0x1f16b5){if(_0x1f16b5){return db[_0x18da('0x5a')][_0x18da('0x23')]({'where':{'ListId':_0x530cb1[_0x18da('0x2f')][_0x18da('0x68')],'CampaignId':_0x530cb1[_0x18da('0x43')]['id']}})[_0x18da('0x21')](function(){return _0x1f16b5;});}})[_0x18da('0x21')](respondWithStatusCode(_0x476926,null))[_0x18da('0x41')](handleError(_0x476926,null));};exports[_0x18da('0x91')]=function(_0x555c15,_0x48b32c,_0x2fc9e4){var _0x1716f4={};var _0x4e20b8={};var _0x11b36a;var _0x41fedc;return db['Campaign']['findOne']({'where':{'id':_0x555c15[_0x18da('0x43')]['id']}})[_0x18da('0x21')](handleEntityNotFound(_0x48b32c,null))[_0x18da('0x21')](function(_0x2a2280){if(_0x2a2280){_0x11b36a=_0x2a2280;_0x4e20b8[_0x18da('0x33')]=_[_0x18da('0x30')](db[_0x18da('0x64')]['rawAttributes']);_0x4e20b8[_0x18da('0x2f')]=_[_0x18da('0x30')](_0x555c15[_0x18da('0x2f')]);_0x4e20b8[_0x18da('0x31')]=_['intersection'](_0x4e20b8['model'],_0x4e20b8[_0x18da('0x2f')]);_0x1716f4['attributes']=_[_0x18da('0x32')](_0x4e20b8['model'],qs[_0x18da('0x34')](_0x555c15[_0x18da('0x2f')]['fields']));_0x1716f4['attributes']=_0x1716f4[_0x18da('0x35')]['length']?_0x1716f4[_0x18da('0x35')]:_0x4e20b8[_0x18da('0x33')];_0x1716f4[_0x18da('0x38')]=qs[_0x18da('0x39')](_0x555c15[_0x18da('0x2f')][_0x18da('0x39')]);_0x1716f4[_0x18da('0x3c')]=qs[_0x18da('0x31')](_[_0x18da('0x3a')](_0x555c15[_0x18da('0x2f')],_0x4e20b8[_0x18da('0x31')]));if(_0x555c15[_0x18da('0x2f')]['filter']){_0x1716f4[_0x18da('0x3c')]=_[_0x18da('0x3e')](_0x1716f4[_0x18da('0x3c')],{'$or':_[_0x18da('0x2a')](_0x1716f4[_0x18da('0x35')],function(_0x4ec996){var _0x5cd711={};_0x5cd711[_0x4ec996]={'$like':'%'+_0x555c15[_0x18da('0x2f')][_0x18da('0x3b')]+'%'};return _0x5cd711;})});}_0x1716f4=_['merge']({},_0x1716f4,_0x555c15[_0x18da('0x46')]);return _0x11b36a[_0x18da('0x91')](_0x1716f4);}})[_0x18da('0x21')](function(_0x3ced9e){if(_0x3ced9e){_0x41fedc=_0x3ced9e['length'];if(!_0x555c15[_0x18da('0x2f')][_0x18da('0x5d')](_0x18da('0x37'))){_0x1716f4[_0x18da('0x1a')]=qs[_0x18da('0x1a')](_0x555c15[_0x18da('0x2f')]['limit']);_0x1716f4[_0x18da('0x17')]=qs[_0x18da('0x17')](_0x555c15[_0x18da('0x2f')][_0x18da('0x17')]);}return _0x11b36a[_0x18da('0x91')](_0x1716f4);}})[_0x18da('0x21')](function(_0x1406ab){if(_0x1406ab){return _0x1406ab?{'count':_0x41fedc,'rows':_0x1406ab}:null;}})[_0x18da('0x21')](respondWithResult(_0x48b32c,null))[_0x18da('0x41')](handleError(_0x48b32c,null));};exports[_0x18da('0x92')]=function(_0x4a9f7d,_0xa2237b,_0x12dcd8){var _0x219446,_0x45cb8d;var _0x3dc5c9=[];var _0x210cd6=moment()[_0x18da('0x65')](_0x18da('0x66'));return db['Campaign'][_0x18da('0x47')]({'where':{'id':_0x4a9f7d[_0x18da('0x43')]['id']}})[_0x18da('0x21')](handleEntityNotFound(_0xa2237b,null))[_0x18da('0x21')](function(_0x3d0156){if(_0x3d0156){_0x45cb8d=_0x3d0156;return _0x3d0156[_0x18da('0x92')](_0x4a9f7d['body'][_0x18da('0x68')],_[_0x18da('0x52')](_0x4a9f7d[_0x18da('0x49')],[_0x18da('0x68'),'id'])||{});}return null;})[_0x18da('0x69')](function(_0x446018){var _0x1ce5fa;var _0xc348ed;_0x219446=_0x446018||[];var _0xe9b08f=[];if(_0x446018){for(var _0x23f47c=0x0;_0x23f47c<_0x446018[_0x18da('0x36')];_0x23f47c+=0x1){var _0x15453b=_0x446018[_0x23f47c][_0x18da('0x22')]({'plain':!![]});_0x1ce5fa=squel[_0x18da('0x7c')]()['into']('cm_hopper_black')['fromQuery'](['phone','ContactId',_0x18da('0x72'),_0x18da('0x59'),'createdAt',_0x18da('0x54')],squel[_0x18da('0x77')]()['field'](_0x18da('0x6d'),_0x18da('0x6d'))[_0x18da('0x70')]('id','ContactId')[_0x18da('0x70')](_0x15453b[_0x18da('0x7f')][_0x18da('0x71')](),'ListId')['field'](_0x4a9f7d[_0x18da('0x43')]['id']['toString'](),_0x18da('0x59'))[_0x18da('0x70')]('NOW()',_0x18da('0x53'))[_0x18da('0x70')]('NOW()',_0x18da('0x54'))[_0x18da('0x73')](_0x18da('0x74'))['where'](_0x18da('0x7e'))[_0x18da('0x3c')]('ListId\x20=\x20?',_0x15453b[_0x18da('0x7f')][_0x18da('0x71')]())[_0x18da('0x3c')](_0x18da('0x75')))[_0x18da('0x71')]();_0xe9b08f[_0x18da('0x8e')](db['sequelize'][_0x18da('0x2f')](_0x1ce5fa));}return BPromise[_0x18da('0x8f')](_0xe9b08f);}})['then'](function(){return _0x219446;})['then'](respondWithResult(_0xa2237b,null))[_0x18da('0x41')](handleError(_0xa2237b,null));};exports[_0x18da('0x93')]=function(_0xa5626b,_0x663052,_0x64fbfe){return db[_0x18da('0x2b')][_0x18da('0x47')]({'where':{'id':_0xa5626b['params']['id']}})['then'](handleEntityNotFound(_0x663052,null))[_0x18da('0x21')](function(_0x5e6b2f){if(_0x5e6b2f){return _0x5e6b2f[_0x18da('0x93')](_0xa5626b[_0x18da('0x2f')][_0x18da('0x68')]);}})[_0x18da('0x21')](function(_0x5d9ee6){if(_0x5d9ee6){return db['CmHopperBlack'][_0x18da('0x23')]({'where':{'ListId':_0xa5626b['query'][_0x18da('0x68')],'CampaignId':_0xa5626b[_0x18da('0x43')]['id']}})['then'](function(){return _0x5d9ee6;});}})[_0x18da('0x21')](respondWithStatusCode(_0x663052,null))['catch'](handleError(_0x663052,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 9ffb62d..eb2ee5d 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4597a7,_0x5da925){var _0x52cd16=function(_0x58a526){while(--_0x58a526){_0x4597a7['push'](_0x4597a7['shift']());}};_0x52cd16(++_0x5da925);}(_0x7a54,0x106));var _0x47a5=function(_0x34fca5,_0x103f92){_0x34fca5=_0x34fca5-0x0;var _0x2b94bf=_0x7a54[_0x34fca5];return _0x2b94bf;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x3655bd,_0x5da5f1){var _0x3a69e4=function(_0x11192c){while(--_0x11192c){_0x3655bd['push'](_0x3655bd['shift']());}};_0x3a69e4(++_0x5da5f1);}(_0x7a54,0x106));var _0x47a5=function(_0x32fc41,_0x12fabd){_0x32fc41=_0x32fc41-0x0;var _0x33f702=_0x7a54[_0x32fc41];return _0x33f702;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index a1d37cb..d0ead51 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 _0xaa88=['../../config/environment','http','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','Campaign,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','GetCampaign','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x457b0e,_0x5f5b0b){var _0x6e91af=function(_0x36fdfc){while(--_0x36fdfc){_0x457b0e['push'](_0x457b0e['shift']());}};_0x6e91af(++_0x5f5b0b);}(_0xaa88,0x137));var _0x8aa8=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0xaa88[_0x434783];return _0x13efcf;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('Campaign,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('Campaign,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('Campaign,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});}exports['GetCampaign']=function(_0x2c1b9a){var _0x49d80d=this;return new Promise(function(_0x557adc,_0xab7af5){return db['Campaign'][_0x8aa8('0x15')]({'raw':_0x2c1b9a[_0x8aa8('0x16')]?_0x2c1b9a[_0x8aa8('0x16')][_0x8aa8('0x17')]===undefined?!![]:![]:!![],'where':_0x2c1b9a['options']?_0x2c1b9a[_0x8aa8('0x16')][_0x8aa8('0x18')]||null:null,'attributes':_0x2c1b9a[_0x8aa8('0x16')]?_0x2c1b9a[_0x8aa8('0x16')][_0x8aa8('0x19')]||null:null,'limit':_0x2c1b9a[_0x8aa8('0x16')]?_0x2c1b9a['options'][_0x8aa8('0x1a')]||null:null,'include':_0x2c1b9a['options']?_0x2c1b9a[_0x8aa8('0x16')]['include']?_[_0x8aa8('0x1b')](_0x2c1b9a['options'][_0x8aa8('0x1c')],function(_0x40adb5){return{'model':db[_0x40adb5[_0x8aa8('0x1d')]],'as':_0x40adb5['as'],'attributes':_0x40adb5['attributes'],'include':_0x40adb5[_0x8aa8('0x1c')]?_[_0x8aa8('0x1b')](_0x40adb5[_0x8aa8('0x1c')],function(_0x547a7b){return{'model':db[_0x547a7b['model']],'as':_0x547a7b['as'],'attributes':_0x547a7b[_0x8aa8('0x19')],'include':_0x547a7b[_0x8aa8('0x1c')]?_[_0x8aa8('0x1b')](_0x547a7b[_0x8aa8('0x1c')],function(_0x24143e){return{'model':db[_0x24143e['model']],'as':_0x24143e['as'],'attributes':_0x24143e[_0x8aa8('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a0ff2){logger[_0x8aa8('0xc')](_0x8aa8('0x1e'),_0x2c1b9a);logger['debug']('GetCampaign',_0x2c1b9a,JSON[_0x8aa8('0x1f')](_0x2a0ff2));_0x557adc(_0x2a0ff2);})['catch'](function(_0x385208){logger[_0x8aa8('0x10')](_0x8aa8('0x1e'),_0x385208[_0x8aa8('0x12')],_0x2c1b9a);_0xab7af5(_0x49d80d[_0x8aa8('0x10')](0x1f4,_0x385208['message']));});});};
\ No newline at end of file
+var _0x984b=['ioredis','../../config/logger','rpc','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','bluebird','randomstring'];(function(_0x416cea,_0x7d4ee0){var _0x43fdd4=function(_0xa19c32){while(--_0xa19c32){_0x416cea['push'](_0x416cea['shift']());}};_0x43fdd4(++_0x7d4ee0);}(_0x984b,0xee));var _0xb984=function(_0x50ceb2,_0x58b68b){_0x50ceb2=_0x50ceb2-0x0;var _0xd8ff98=_0x984b[_0x50ceb2];return _0xd8ff98;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb984('0x0'));var rs=require(_0xb984('0x1'));var fs=require('fs');var Redis=require(_0xb984('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb984('0x3'))(_0xb984('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb984('0x5')][_0xb984('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a605a,_0x7405cd,_0x1a00d6){return new BPromise(function(_0x4d72b7,_0x37fd36){return client['request'](_0x5a605a,_0x1a00d6)[_0xb984('0x7')](function(_0x42dfd9){logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,_0xb984('0xa'));logger[_0xb984('0xb')](_0xb984('0xc'),_0x7405cd,_0xb984('0xa'),JSON[_0xb984('0xd')](_0x42dfd9));if(_0x42dfd9[_0xb984('0xe')]){if(_0x42dfd9[_0xb984('0xe')][_0xb984('0xf')]===0x1f4){logger['error'](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x37fd36(_0x42dfd9[_0xb984('0xe')]['message']);}logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x42dfd9['error'][_0xb984('0x10')]);return _0x4d72b7(_0x42dfd9[_0xb984('0xe')]['message']);}else{logger[_0xb984('0x8')](_0xb984('0x9'),_0x7405cd,'request\x20sent');_0x4d72b7(_0x42dfd9[_0xb984('0x11')]['message']);}})[_0xb984('0x12')](function(_0x1dc4df){logger[_0xb984('0xe')](_0xb984('0x9'),_0x7405cd,_0x1dc4df);_0x37fd36(_0x1dc4df);});});}exports['GetCampaign']=function(_0x396c36){var _0x35bd75=this;return new Promise(function(_0x3a5c96,_0x9afbee){return db[_0xb984('0x13')][_0xb984('0x14')]({'raw':_0x396c36['options']?_0x396c36[_0xb984('0x15')][_0xb984('0x16')]===undefined?!![]:![]:!![],'where':_0x396c36[_0xb984('0x15')]?_0x396c36[_0xb984('0x15')][_0xb984('0x17')]||null:null,'attributes':_0x396c36[_0xb984('0x15')]?_0x396c36['options'][_0xb984('0x18')]||null:null,'limit':_0x396c36[_0xb984('0x15')]?_0x396c36['options'][_0xb984('0x19')]||null:null,'include':_0x396c36[_0xb984('0x15')]?_0x396c36[_0xb984('0x15')][_0xb984('0x1a')]?_[_0xb984('0x1b')](_0x396c36[_0xb984('0x15')][_0xb984('0x1a')],function(_0x52c581){return{'model':db[_0x52c581[_0xb984('0x1c')]],'as':_0x52c581['as'],'attributes':_0x52c581[_0xb984('0x18')],'include':_0x52c581[_0xb984('0x1a')]?_['map'](_0x52c581[_0xb984('0x1a')],function(_0x2e806e){return{'model':db[_0x2e806e[_0xb984('0x1c')]],'as':_0x2e806e['as'],'attributes':_0x2e806e[_0xb984('0x18')],'include':_0x2e806e[_0xb984('0x1a')]?_[_0xb984('0x1b')](_0x2e806e[_0xb984('0x1a')],function(_0x4b3da0){return{'model':db[_0x4b3da0['model']],'as':_0x4b3da0['as'],'attributes':_0x4b3da0[_0xb984('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb984('0x7')](function(_0x3e254b){logger[_0xb984('0x8')]('GetCampaign',_0x396c36);logger[_0xb984('0xb')](_0xb984('0x1d'),_0x396c36,JSON[_0xb984('0xd')](_0x3e254b));_0x3a5c96(_0x3e254b);})['catch'](function(_0x363e33){logger[_0xb984('0xe')](_0xb984('0x1d'),_0x363e33[_0xb984('0x10')],_0x396c36);_0x9afbee(_0x35bd75['error'](0x1f4,_0x363e33['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index e8a6142..7508856 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 _0x08db=['/:id/hopper_black','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','/:id','update','delete','removeLists','removeBlackLists','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x29f50d,_0x580fae){var _0x4eeeae=function(_0x267422){while(--_0x267422){_0x29f50d['push'](_0x29f50d['shift']());}};_0x4eeeae(++_0x580fae);}(_0x08db,0x14e));var _0xb08d=function(_0x473680,_0x412316){_0x473680=_0x473680-0x0;var _0x2e2bd3=_0x08db[_0x473680];return _0x2e2bd3;};'use strict';var multer=require(_0xb08d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb08d('0x1'));var express=require('express');var router=express[_0xb08d('0x2')]();var fs_extra=require(_0xb08d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb08d('0x4'));var config=require(_0xb08d('0x5'));var controller=require(_0xb08d('0x6'));router[_0xb08d('0x7')]('/',auth[_0xb08d('0x8')](),controller['index']);router[_0xb08d('0x7')]('/:id',auth[_0xb08d('0x8')](),controller['show']);router['get'](_0xb08d('0x9'),auth[_0xb08d('0x8')](),controller[_0xb08d('0xa')]);router[_0xb08d('0x7')]('/:id/hopper_histories',auth[_0xb08d('0x8')](),controller[_0xb08d('0xb')]);router[_0xb08d('0x7')](_0xb08d('0xc'),auth[_0xb08d('0x8')](),controller[_0xb08d('0xd')]);router[_0xb08d('0x7')](_0xb08d('0xe'),auth[_0xb08d('0x8')](),controller['getHopperBlacks']);router[_0xb08d('0x7')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0xb08d('0x7')](_0xb08d('0xf'),auth[_0xb08d('0x8')](),controller[_0xb08d('0x10')]);router['post']('/',auth[_0xb08d('0x8')](),controller[_0xb08d('0x11')]);router[_0xb08d('0x12')](_0xb08d('0x13'),auth[_0xb08d('0x8')](),controller[_0xb08d('0x14')]);router['post'](_0xb08d('0x15'),auth[_0xb08d('0x8')](),controller[_0xb08d('0x16')]);router[_0xb08d('0x12')](_0xb08d('0xf'),auth[_0xb08d('0x8')](),controller[_0xb08d('0x17')]);router['put'](_0xb08d('0x18'),auth[_0xb08d('0x8')](),controller[_0xb08d('0x19')]);router['delete'](_0xb08d('0x18'),auth[_0xb08d('0x8')](),controller['destroy']);router[_0xb08d('0x1a')](_0xb08d('0x15'),auth['isAuthenticated'](),controller[_0xb08d('0x1b')]);router[_0xb08d('0x1a')](_0xb08d('0xf'),auth[_0xb08d('0x8')](),controller[_0xb08d('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x8728=['isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','addLists','put','/:id','update','delete','removeLists','removeBlackLists','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get'];(function(_0x11198b,_0x4b5155){var _0x1732b1=function(_0xbf8a00){while(--_0xbf8a00){_0x11198b['push'](_0x11198b['shift']());}};_0x1732b1(++_0x4b5155);}(_0x8728,0x14a));var _0x8872=function(_0x54b025,_0x45a708){_0x54b025=_0x54b025-0x0;var _0x196a8c=_0x8728[_0x54b025];return _0x196a8c;};'use strict';var multer=require(_0x8872('0x0'));var util=require(_0x8872('0x1'));var path=require('path');var timeout=require(_0x8872('0x2'));var express=require('express');var router=express[_0x8872('0x3')]();var fs_extra=require(_0x8872('0x4'));var auth=require(_0x8872('0x5'));var interaction=require(_0x8872('0x6'));var config=require(_0x8872('0x7'));var controller=require(_0x8872('0x8'));router[_0x8872('0x9')]('/',auth[_0x8872('0xa')](),controller[_0x8872('0xb')]);router[_0x8872('0x9')]('/:id',auth[_0x8872('0xa')](),controller[_0x8872('0xc')]);router[_0x8872('0x9')]('/:id/hoppers',auth[_0x8872('0xa')](),controller[_0x8872('0xd')]);router[_0x8872('0x9')](_0x8872('0xe'),auth[_0x8872('0xa')](),controller[_0x8872('0xf')]);router[_0x8872('0x9')](_0x8872('0x10'),auth['isAuthenticated'](),controller[_0x8872('0x11')]);router[_0x8872('0x9')](_0x8872('0x12'),auth[_0x8872('0xa')](),controller[_0x8872('0x13')]);router['get'](_0x8872('0x14'),auth[_0x8872('0xa')](),controller[_0x8872('0x15')]);router[_0x8872('0x9')](_0x8872('0x16'),auth[_0x8872('0xa')](),controller[_0x8872('0x17')]);router[_0x8872('0x18')]('/',auth[_0x8872('0xa')](),controller[_0x8872('0x19')]);router['post']('/:id/clone',auth[_0x8872('0xa')](),controller['clone']);router[_0x8872('0x18')](_0x8872('0x14'),auth['isAuthenticated'](),controller[_0x8872('0x1a')]);router[_0x8872('0x18')]('/:id/blacklists',auth[_0x8872('0xa')](),controller['addBlackLists']);router[_0x8872('0x1b')](_0x8872('0x1c'),auth['isAuthenticated'](),controller[_0x8872('0x1d')]);router[_0x8872('0x1e')](_0x8872('0x1c'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/lists',auth['isAuthenticated'](),controller[_0x8872('0x1f')]);router[_0x8872('0x1e')](_0x8872('0x16'),auth[_0x8872('0xa')](),controller[_0x8872('0x20')]);module[_0x8872('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index e0dbadb..79843c6 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 _0x5e29=['STRING','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x349a9e,_0x473cb8){var _0x24c207=function(_0x22f148){while(--_0x22f148){_0x349a9e['push'](_0x349a9e['shift']());}};_0x24c207(++_0x473cb8);}(_0x5e29,0xd6));var _0x95e2=function(_0xd5246e,_0x90d9d2){_0xd5246e=_0xd5246e-0x0;var _0x57397d=_0x5e29[_0xd5246e];return _0x57397d;};'use strict';var Sequelize=require(_0x95e2('0x0'));module[_0x95e2('0x1')]={'key':{'type':Sequelize[_0x95e2('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x95e2('0x2')]},'name':{'type':Sequelize[_0x95e2('0x3')],'get':function(){return this[_0x95e2('0x4')](_0x95e2('0x5'));}}};
\ No newline at end of file
+var _0x5ec6=['key','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x259728,_0x467c29){var _0x636d55=function(_0x6d37ea){while(--_0x6d37ea){_0x259728['push'](_0x259728['shift']());}};_0x636d55(++_0x467c29);}(_0x5ec6,0xc1));var _0x65ec=function(_0x4ad285,_0x38adca){_0x4ad285=_0x4ad285-0x0;var _0x47dbf1=_0x5ec6[_0x4ad285];return _0x47dbf1;};'use strict';var Sequelize=require('sequelize');module[_0x65ec('0x0')]={'key':{'type':Sequelize[_0x65ec('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x65ec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x65ec('0x1')]},'name':{'type':Sequelize[_0x65ec('0x3')],'get':function(){return this[_0x65ec('0x4')](_0x65ec('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 843e500..c5b3a07 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 _0xf6cd=['includeAll','include','options','find','body','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','get','CannedAnswers','destroy','end','sendStatus','error','stack','name','send','index','CannedAnswer','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','where','filter','merge','findAll','rows','params','rawAttributes','length'];(function(_0x31d8bb,_0x259e4){var _0x4bf266=function(_0x20c68e){while(--_0x20c68e){_0x31d8bb['push'](_0x31d8bb['shift']());}};_0x4bf266(++_0x259e4);}(_0xf6cd,0x185));var _0xdf6c=function(_0x6823e,_0xc66f0e){_0x6823e=_0x6823e-0x0;var _0x5a2be8=_0xf6cd[_0x6823e];return _0x5a2be8;};'use strict';var emlformat=require(_0xdf6c('0x0'));var rimraf=require(_0xdf6c('0x1'));var zipdir=require(_0xdf6c('0x2'));var jsonpatch=require(_0xdf6c('0x3'));var rp=require(_0xdf6c('0x4'));var moment=require(_0xdf6c('0x5'));var BPromise=require(_0xdf6c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdf6c('0x7'));var sox=require(_0xdf6c('0x8'));var csv=require(_0xdf6c('0x9'));var ejs=require(_0xdf6c('0xa'));var fs=require('fs');var fs_extra=require(_0xdf6c('0xb'));var _=require(_0xdf6c('0xc'));var squel=require(_0xdf6c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdf6c('0xe'));var toCsv=require(_0xdf6c('0x9'));var querystring=require(_0xdf6c('0xf'));var Papa=require(_0xdf6c('0x10'));var Redis=require(_0xdf6c('0x11'));var authService=require(_0xdf6c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdf6c('0x13'));var hardwareService=require(_0xdf6c('0x14'));var logger=require(_0xdf6c('0x15'))(_0xdf6c('0x16'));var utils=require(_0xdf6c('0x17'));var config=require(_0xdf6c('0x18'));var licenseUtil=require(_0xdf6c('0x19'));var db=require(_0xdf6c('0x1a'))['db'];function respondWithStatusCode(_0x4943ff,_0x11ad4e){_0x11ad4e=_0x11ad4e||0xcc;return function(_0x4cb72c){if(_0x4cb72c){return _0x4943ff['sendStatus'](_0x11ad4e);}return _0x4943ff['status'](_0x11ad4e)['end']();};}function respondWithResult(_0x59bdf8,_0xe804c2){_0xe804c2=_0xe804c2||0xc8;return function(_0x38485f){if(_0x38485f){return _0x59bdf8[_0xdf6c('0x1b')](_0xe804c2)[_0xdf6c('0x1c')](_0x38485f);}};}function respondWithFilteredResult(_0x2c89f2,_0x3e0745){return function(_0x49da8f){if(_0x49da8f){var _0x266ad5=typeof _0x3e0745[_0xdf6c('0x1d')]===_0xdf6c('0x1e')&&typeof _0x3e0745['limit']==='undefined';var _0x211b6e=_0x49da8f[_0xdf6c('0x1f')];var _0x1f0c0b=_0x266ad5?0x0:_0x3e0745['offset'];var _0x5d7062=_0x266ad5?_0x49da8f[_0xdf6c('0x1f')]:_0x3e0745['offset']+_0x3e0745['limit'];var _0x29f663;if(_0x5d7062>=_0x211b6e){_0x5d7062=_0x211b6e;_0x29f663=0xc8;}else{_0x29f663=0xce;}_0x2c89f2[_0xdf6c('0x1b')](_0x29f663);return _0x2c89f2[_0xdf6c('0x20')](_0xdf6c('0x21'),_0x1f0c0b+'-'+_0x5d7062+'/'+_0x211b6e)[_0xdf6c('0x1c')](_0x49da8f);}return null;};}function patchUpdates(_0x377487){return function(_0x271f90){try{jsonpatch[_0xdf6c('0x22')](_0x271f90,_0x377487,!![]);}catch(_0x20edb2){return BPromise[_0xdf6c('0x23')](_0x20edb2);}return _0x271f90[_0xdf6c('0x24')]();};}function saveUpdates(_0x203c96,_0x2d0f4a){return function(_0x4a8c77){if(_0x4a8c77){return _0x4a8c77['update'](_0x203c96)[_0xdf6c('0x25')](function(_0xb86613){return _0xb86613;});}return null;};}function removeEntity(_0x2486dc,_0x16d94c){return function(_0x469ae4){if(_0x469ae4){return _0x469ae4['destroy']()[_0xdf6c('0x25')](function(){var _0x14560b=_0x469ae4[_0xdf6c('0x26')]({'plain':!![]});var _0x176734=_0xdf6c('0x27');return db['UserProfileResource'][_0xdf6c('0x28')]({'where':{'type':_0x176734,'resourceId':_0x14560b['id']}})['then'](function(){return _0x469ae4;});})[_0xdf6c('0x25')](function(){_0x2486dc['status'](0xcc)[_0xdf6c('0x29')]();});}};}function handleEntityNotFound(_0x1efcb0,_0x442885){return function(_0x12ff92){if(!_0x12ff92){_0x1efcb0[_0xdf6c('0x2a')](0x194);}return _0x12ff92;};}function handleError(_0x4801a7,_0x46737e){_0x46737e=_0x46737e||0x1f4;return function(_0x3cd35d){logger[_0xdf6c('0x2b')](_0x3cd35d[_0xdf6c('0x2c')]);if(_0x3cd35d['name']){delete _0x3cd35d[_0xdf6c('0x2d')];}_0x4801a7[_0xdf6c('0x1b')](_0x46737e)[_0xdf6c('0x2e')](_0x3cd35d);};}exports[_0xdf6c('0x2f')]=function(_0x597c53,_0x3fc453){var _0x53c41a={},_0x8e970a={},_0x3e2df3={'count':0x0,'rows':[]};var _0x52b1ff=_['map'](db[_0xdf6c('0x30')]['rawAttributes'],function(_0x3aa7d1){return{'name':_0x3aa7d1[_0xdf6c('0x31')],'type':_0x3aa7d1[_0xdf6c('0x32')][_0xdf6c('0x33')]};});_0x8e970a[_0xdf6c('0x34')]=_['map'](_0x52b1ff,'name');_0x8e970a['query']=_[_0xdf6c('0x35')](_0x597c53[_0xdf6c('0x36')]);_0x8e970a[_0xdf6c('0x37')]=_['intersection'](_0x8e970a['model'],_0x8e970a['query']);_0x53c41a[_0xdf6c('0x38')]=_[_0xdf6c('0x39')](_0x8e970a[_0xdf6c('0x34')],qs[_0xdf6c('0x3a')](_0x597c53[_0xdf6c('0x36')][_0xdf6c('0x3a')]));_0x53c41a['attributes']=_0x53c41a[_0xdf6c('0x38')]['length']?_0x53c41a[_0xdf6c('0x38')]:_0x8e970a['model'];if(!_0x597c53['query'][_0xdf6c('0x3b')](_0xdf6c('0x3c'))){_0x53c41a['limit']=qs[_0xdf6c('0x3d')](_0x597c53[_0xdf6c('0x36')][_0xdf6c('0x3d')]);_0x53c41a[_0xdf6c('0x1d')]=qs[_0xdf6c('0x1d')](_0x597c53[_0xdf6c('0x36')][_0xdf6c('0x1d')]);}_0x53c41a['order']=qs[_0xdf6c('0x3e')](_0x597c53[_0xdf6c('0x36')][_0xdf6c('0x3e')]);_0x53c41a[_0xdf6c('0x3f')]=qs[_0xdf6c('0x37')](_['pick'](_0x597c53['query'],_0x8e970a[_0xdf6c('0x37')]),_0x52b1ff);if(_0x597c53[_0xdf6c('0x36')][_0xdf6c('0x40')]){_0x53c41a[_0xdf6c('0x3f')]=_[_0xdf6c('0x41')](_0x53c41a[_0xdf6c('0x3f')],{'$or':[{'key':{'$like':'%'+_0x597c53[_0xdf6c('0x36')]['filter']+'%'}},{'value':{'$like':'%'+_0x597c53['query'][_0xdf6c('0x40')]+'%'}}]});}_0x53c41a=_[_0xdf6c('0x41')]({},_0x53c41a,_0x597c53['options']);var _0x42d2c6={'where':_0x53c41a[_0xdf6c('0x3f')]};return db[_0xdf6c('0x30')][_0xdf6c('0x1f')](_0x42d2c6)[_0xdf6c('0x25')](function(_0x276cce){_0x3e2df3[_0xdf6c('0x1f')]=_0x276cce;if(_0x597c53[_0xdf6c('0x36')]['includeAll']){_0x53c41a['include']=[{'all':!![]}];}return db[_0xdf6c('0x30')][_0xdf6c('0x42')](_0x53c41a);})[_0xdf6c('0x25')](function(_0x3c92bd){_0x3e2df3[_0xdf6c('0x43')]=_0x3c92bd;return _0x3e2df3;})[_0xdf6c('0x25')](respondWithFilteredResult(_0x3fc453,_0x53c41a))['catch'](handleError(_0x3fc453,null));};exports['show']=function(_0x3cb6af,_0x415280){var _0x4c2eec={'raw':!![],'where':{'id':_0x3cb6af[_0xdf6c('0x44')]['id']}},_0x23d580={};_0x23d580[_0xdf6c('0x34')]=_[_0xdf6c('0x35')](db['CannedAnswer'][_0xdf6c('0x45')]);_0x23d580[_0xdf6c('0x36')]=_['keys'](_0x3cb6af[_0xdf6c('0x36')]);_0x23d580[_0xdf6c('0x37')]=_['intersection'](_0x23d580[_0xdf6c('0x34')],_0x23d580[_0xdf6c('0x36')]);_0x4c2eec[_0xdf6c('0x38')]=_[_0xdf6c('0x39')](_0x23d580[_0xdf6c('0x34')],qs[_0xdf6c('0x3a')](_0x3cb6af[_0xdf6c('0x36')][_0xdf6c('0x3a')]));_0x4c2eec[_0xdf6c('0x38')]=_0x4c2eec['attributes'][_0xdf6c('0x46')]?_0x4c2eec[_0xdf6c('0x38')]:_0x23d580[_0xdf6c('0x34')];if(_0x3cb6af[_0xdf6c('0x36')][_0xdf6c('0x47')]){_0x4c2eec[_0xdf6c('0x48')]=[{'all':!![]}];}_0x4c2eec=_[_0xdf6c('0x41')]({},_0x4c2eec,_0x3cb6af[_0xdf6c('0x49')]);return db[_0xdf6c('0x30')][_0xdf6c('0x4a')](_0x4c2eec)[_0xdf6c('0x25')](handleEntityNotFound(_0x415280,null))[_0xdf6c('0x25')](respondWithResult(_0x415280,null))['catch'](handleError(_0x415280,null));};exports['update']=function(_0x186ba3,_0x559a25){if(_0x186ba3[_0xdf6c('0x4b')]['id']){delete _0x186ba3[_0xdf6c('0x4b')]['id'];}return db[_0xdf6c('0x30')][_0xdf6c('0x4a')]({'where':{'id':_0x186ba3['params']['id']}})[_0xdf6c('0x25')](handleEntityNotFound(_0x559a25,null))['then'](saveUpdates(_0x186ba3[_0xdf6c('0x4b')],null))[_0xdf6c('0x25')](respondWithResult(_0x559a25,null))[_0xdf6c('0x4c')](handleError(_0x559a25,null));};exports[_0xdf6c('0x28')]=function(_0x2b5d22,_0x36ea4f){return db[_0xdf6c('0x30')][_0xdf6c('0x4a')]({'where':{'id':_0x2b5d22[_0xdf6c('0x44')]['id']}})['then'](handleEntityNotFound(_0x36ea4f,null))[_0xdf6c('0x25')](removeEntity(_0x36ea4f,null))[_0xdf6c('0x4c')](handleError(_0x36ea4f,null));};exports[_0xdf6c('0x4d')]=function(_0x5771af,_0x1722dc){var _0xc51c66={'key':_0x5771af[_0xdf6c('0x4b')][_0xdf6c('0x33')]};if(_0x5771af[_0xdf6c('0x4b')][_0xdf6c('0x4e')]){_0xc51c66[_0xdf6c('0x4e')]=_0x5771af[_0xdf6c('0x4b')]['MailAccountId'];}else if(_0x5771af[_0xdf6c('0x4b')][_0xdf6c('0x4f')]){_0xc51c66[_0xdf6c('0x4f')]=_0x5771af[_0xdf6c('0x4b')][_0xdf6c('0x4f')];}else if(_0x5771af[_0xdf6c('0x4b')][_0xdf6c('0x50')]){_0xc51c66[_0xdf6c('0x50')]=_0x5771af[_0xdf6c('0x4b')][_0xdf6c('0x50')];}else if(_0x5771af[_0xdf6c('0x4b')]['ChatWebsiteId']){_0xc51c66[_0xdf6c('0x51')]=_0x5771af[_0xdf6c('0x4b')][_0xdf6c('0x51')];}return db['CannedAnswer']['find']({'where':_0xc51c66})[_0xdf6c('0x25')](function(_0x31fd5e){if(_0x31fd5e){throw new db[(_0xdf6c('0x52'))][(_0xdf6c('0x53'))](_0xdf6c('0x54'));}return db[_0xdf6c('0x30')][_0xdf6c('0x4d')](_0x5771af[_0xdf6c('0x4b')]);})[_0xdf6c('0x25')](function(_0x38a277){var _0x240aaf=_0x5771af['user'][_0xdf6c('0x26')]({'plain':!![]});if(!_0x240aaf)throw new Error(_0xdf6c('0x55'));if(_0x240aaf[_0xdf6c('0x56')]==='user'){var _0x545f50=_0x38a277[_0xdf6c('0x26')]({'plain':!![]});return db[_0xdf6c('0x57')][_0xdf6c('0x4a')]({'where':{'name':_0xdf6c('0x27'),'userProfileId':_0x240aaf[_0xdf6c('0x58')]},'raw':!![]})[_0xdf6c('0x25')](function(_0x24a285){if(_0x24a285&&_0x24a285[_0xdf6c('0x59')]===0x0){return db[_0xdf6c('0x5a')]['create']({'name':_0x545f50['name'],'resourceId':_0x545f50['id'],'type':_0x24a285[_0xdf6c('0x2d')],'sectionId':_0x24a285['id']},{})[_0xdf6c('0x25')](function(){return _0x38a277;});}else{return _0x38a277;}})[_0xdf6c('0x4c')](function(_0x4e6acf){logger[_0xdf6c('0x2b')](_0xdf6c('0x5b'),_0x4e6acf);throw _0x4e6acf;});}return _0x38a277;})['then'](respondWithResult(_0x1722dc,0xc9))[_0xdf6c('0x4c')](handleError(_0x1722dc,null));};
\ No newline at end of file
+var _0x52a1=['fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','include','findAll','show','params','includeAll','catch','update','body','find','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x52a1,0x1ef));var _0x152a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x52a1[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x152a('0x0'));var zipdir=require(_0x152a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x152a('0x2'));var moment=require(_0x152a('0x3'));var BPromise=require(_0x152a('0x4'));var Mustache=require(_0x152a('0x5'));var util=require('util');var path=require(_0x152a('0x6'));var sox=require(_0x152a('0x7'));var csv=require('to-csv');var ejs=require(_0x152a('0x8'));var fs=require('fs');var fs_extra=require(_0x152a('0x9'));var _=require(_0x152a('0xa'));var squel=require(_0x152a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x152a('0xc'));var toCsv=require(_0x152a('0xd'));var querystring=require(_0x152a('0xe'));var Papa=require(_0x152a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x152a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x152a('0x11'));var logger=require(_0x152a('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x492302,_0x8233e9){_0x8233e9=_0x8233e9||0xcc;return function(_0x5e232c){if(_0x5e232c){return _0x492302[_0x152a('0x13')](_0x8233e9);}return _0x492302['status'](_0x8233e9)[_0x152a('0x14')]();};}function respondWithResult(_0x4d481a,_0x2f914a){_0x2f914a=_0x2f914a||0xc8;return function(_0x24b638){if(_0x24b638){return _0x4d481a[_0x152a('0x15')](_0x2f914a)[_0x152a('0x16')](_0x24b638);}};}function respondWithFilteredResult(_0x35c222,_0x1b0fa1){return function(_0x2d70f6){if(_0x2d70f6){var _0x429563=typeof _0x1b0fa1['offset']==='undefined'&&typeof _0x1b0fa1['limit']==='undefined';var _0x2aaeed=_0x2d70f6[_0x152a('0x17')];var _0x54751a=_0x429563?0x0:_0x1b0fa1[_0x152a('0x18')];var _0x66aedb=_0x429563?_0x2d70f6[_0x152a('0x17')]:_0x1b0fa1['offset']+_0x1b0fa1[_0x152a('0x19')];var _0x4a8d16;if(_0x66aedb>=_0x2aaeed){_0x66aedb=_0x2aaeed;_0x4a8d16=0xc8;}else{_0x4a8d16=0xce;}_0x35c222[_0x152a('0x15')](_0x4a8d16);return _0x35c222[_0x152a('0x1a')](_0x152a('0x1b'),_0x54751a+'-'+_0x66aedb+'/'+_0x2aaeed)[_0x152a('0x16')](_0x2d70f6);}return null;};}function patchUpdates(_0x40794c){return function(_0x43532a){try{jsonpatch[_0x152a('0x1c')](_0x43532a,_0x40794c,!![]);}catch(_0x5a45c0){return BPromise[_0x152a('0x1d')](_0x5a45c0);}return _0x43532a[_0x152a('0x1e')]();};}function saveUpdates(_0x3650f1,_0x461253){return function(_0x17fbfc){if(_0x17fbfc){return _0x17fbfc['update'](_0x3650f1)[_0x152a('0x1f')](function(_0x371d52){return _0x371d52;});}return null;};}function removeEntity(_0x4352c6,_0x426f78){return function(_0x4983c4){if(_0x4983c4){return _0x4983c4[_0x152a('0x20')]()[_0x152a('0x1f')](function(){var _0x3e3d43=_0x4983c4[_0x152a('0x21')]({'plain':!![]});var _0x87e33a='CannedAnswers';return db[_0x152a('0x22')][_0x152a('0x20')]({'where':{'type':_0x87e33a,'resourceId':_0x3e3d43['id']}})[_0x152a('0x1f')](function(){return _0x4983c4;});})[_0x152a('0x1f')](function(){_0x4352c6[_0x152a('0x15')](0xcc)[_0x152a('0x14')]();});}};}function handleEntityNotFound(_0x480b6b,_0x215860){return function(_0x445e4b){if(!_0x445e4b){_0x480b6b[_0x152a('0x13')](0x194);}return _0x445e4b;};}function handleError(_0x5f1bbf,_0x482a48){_0x482a48=_0x482a48||0x1f4;return function(_0x49c9da){logger[_0x152a('0x23')](_0x49c9da[_0x152a('0x24')]);if(_0x49c9da[_0x152a('0x25')]){delete _0x49c9da[_0x152a('0x25')];}_0x5f1bbf['status'](_0x482a48)[_0x152a('0x26')](_0x49c9da);};}exports[_0x152a('0x27')]=function(_0x474c77,_0x390b04){var _0x5d4570={},_0x2722af={},_0x293313={'count':0x0,'rows':[]};var _0x1bb5d0=_['map'](db[_0x152a('0x28')][_0x152a('0x29')],function(_0x468057){return{'name':_0x468057[_0x152a('0x2a')],'type':_0x468057['type']['key']};});_0x2722af[_0x152a('0x2b')]=_['map'](_0x1bb5d0,_0x152a('0x25'));_0x2722af[_0x152a('0x2c')]=_[_0x152a('0x2d')](_0x474c77[_0x152a('0x2c')]);_0x2722af[_0x152a('0x2e')]=_['intersection'](_0x2722af[_0x152a('0x2b')],_0x2722af[_0x152a('0x2c')]);_0x5d4570[_0x152a('0x2f')]=_[_0x152a('0x30')](_0x2722af['model'],qs[_0x152a('0x31')](_0x474c77[_0x152a('0x2c')]['fields']));_0x5d4570['attributes']=_0x5d4570[_0x152a('0x2f')][_0x152a('0x32')]?_0x5d4570[_0x152a('0x2f')]:_0x2722af[_0x152a('0x2b')];if(!_0x474c77['query'][_0x152a('0x33')](_0x152a('0x34'))){_0x5d4570[_0x152a('0x19')]=qs[_0x152a('0x19')](_0x474c77['query'][_0x152a('0x19')]);_0x5d4570[_0x152a('0x18')]=qs[_0x152a('0x18')](_0x474c77[_0x152a('0x2c')][_0x152a('0x18')]);}_0x5d4570[_0x152a('0x35')]=qs['sort'](_0x474c77[_0x152a('0x2c')]['sort']);_0x5d4570[_0x152a('0x36')]=qs[_0x152a('0x2e')](_[_0x152a('0x37')](_0x474c77[_0x152a('0x2c')],_0x2722af[_0x152a('0x2e')]),_0x1bb5d0);if(_0x474c77['query'][_0x152a('0x38')]){_0x5d4570[_0x152a('0x36')]=_[_0x152a('0x39')](_0x5d4570[_0x152a('0x36')],{'$or':[{'key':{'$like':'%'+_0x474c77[_0x152a('0x2c')][_0x152a('0x38')]+'%'}},{'value':{'$like':'%'+_0x474c77['query'][_0x152a('0x38')]+'%'}}]});}_0x5d4570=_['merge']({},_0x5d4570,_0x474c77[_0x152a('0x3a')]);var _0xf6189d={'where':_0x5d4570[_0x152a('0x36')]};return db[_0x152a('0x28')][_0x152a('0x17')](_0xf6189d)[_0x152a('0x1f')](function(_0x1d838a){_0x293313[_0x152a('0x17')]=_0x1d838a;if(_0x474c77[_0x152a('0x2c')]['includeAll']){_0x5d4570[_0x152a('0x3b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x152a('0x3c')](_0x5d4570);})[_0x152a('0x1f')](function(_0x60d3c5){_0x293313['rows']=_0x60d3c5;return _0x293313;})[_0x152a('0x1f')](respondWithFilteredResult(_0x390b04,_0x5d4570))['catch'](handleError(_0x390b04,null));};exports[_0x152a('0x3d')]=function(_0xc84f31,_0x23b944){var _0x47dc65={'raw':!![],'where':{'id':_0xc84f31[_0x152a('0x3e')]['id']}},_0x2d9083={};_0x2d9083['model']=_['keys'](db[_0x152a('0x28')][_0x152a('0x29')]);_0x2d9083[_0x152a('0x2c')]=_['keys'](_0xc84f31[_0x152a('0x2c')]);_0x2d9083[_0x152a('0x2e')]=_[_0x152a('0x30')](_0x2d9083['model'],_0x2d9083['query']);_0x47dc65[_0x152a('0x2f')]=_[_0x152a('0x30')](_0x2d9083[_0x152a('0x2b')],qs[_0x152a('0x31')](_0xc84f31[_0x152a('0x2c')][_0x152a('0x31')]));_0x47dc65[_0x152a('0x2f')]=_0x47dc65['attributes'][_0x152a('0x32')]?_0x47dc65[_0x152a('0x2f')]:_0x2d9083[_0x152a('0x2b')];if(_0xc84f31[_0x152a('0x2c')][_0x152a('0x3f')]){_0x47dc65['include']=[{'all':!![]}];}_0x47dc65=_['merge']({},_0x47dc65,_0xc84f31[_0x152a('0x3a')]);return db['CannedAnswer']['find'](_0x47dc65)[_0x152a('0x1f')](handleEntityNotFound(_0x23b944,null))[_0x152a('0x1f')](respondWithResult(_0x23b944,null))[_0x152a('0x40')](handleError(_0x23b944,null));};exports[_0x152a('0x41')]=function(_0x176af8,_0xfd6f70){if(_0x176af8[_0x152a('0x42')]['id']){delete _0x176af8[_0x152a('0x42')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x176af8[_0x152a('0x3e')]['id']}})['then'](handleEntityNotFound(_0xfd6f70,null))[_0x152a('0x1f')](saveUpdates(_0x176af8[_0x152a('0x42')],null))['then'](respondWithResult(_0xfd6f70,null))[_0x152a('0x40')](handleError(_0xfd6f70,null));};exports[_0x152a('0x20')]=function(_0x21c53f,_0x52e1d6){return db[_0x152a('0x28')][_0x152a('0x43')]({'where':{'id':_0x21c53f[_0x152a('0x3e')]['id']}})[_0x152a('0x1f')](handleEntityNotFound(_0x52e1d6,null))[_0x152a('0x1f')](removeEntity(_0x52e1d6,null))[_0x152a('0x40')](handleError(_0x52e1d6,null));};exports['create']=function(_0x40bcb8,_0x4e515d){var _0x1f3753={'key':_0x40bcb8[_0x152a('0x42')][_0x152a('0x44')]};if(_0x40bcb8[_0x152a('0x42')][_0x152a('0x45')]){_0x1f3753[_0x152a('0x45')]=_0x40bcb8[_0x152a('0x42')][_0x152a('0x45')];}else if(_0x40bcb8['body'][_0x152a('0x46')]){_0x1f3753[_0x152a('0x46')]=_0x40bcb8[_0x152a('0x42')][_0x152a('0x46')];}else if(_0x40bcb8['body'][_0x152a('0x47')]){_0x1f3753[_0x152a('0x47')]=_0x40bcb8[_0x152a('0x42')][_0x152a('0x47')];}else if(_0x40bcb8[_0x152a('0x42')][_0x152a('0x48')]){_0x1f3753[_0x152a('0x48')]=_0x40bcb8[_0x152a('0x42')][_0x152a('0x48')];}return db[_0x152a('0x28')][_0x152a('0x43')]({'where':_0x1f3753})['then'](function(_0x581193){if(_0x581193){throw new db[(_0x152a('0x49'))][(_0x152a('0x4a'))](_0x152a('0x4b'));}return db[_0x152a('0x28')][_0x152a('0x4c')](_0x40bcb8[_0x152a('0x42')]);})[_0x152a('0x1f')](function(_0x3a6796){var _0x580170=_0x40bcb8[_0x152a('0x4d')][_0x152a('0x21')]({'plain':!![]});if(!_0x580170)throw new Error(_0x152a('0x4e'));if(_0x580170[_0x152a('0x4f')]==='user'){var _0x51be61=_0x3a6796[_0x152a('0x21')]({'plain':!![]});return db[_0x152a('0x50')][_0x152a('0x43')]({'where':{'name':_0x152a('0x51'),'userProfileId':_0x580170['userProfileId']},'raw':!![]})[_0x152a('0x1f')](function(_0xd3660d){if(_0xd3660d&&_0xd3660d[_0x152a('0x52')]===0x0){return db[_0x152a('0x22')][_0x152a('0x4c')]({'name':_0x51be61['name'],'resourceId':_0x51be61['id'],'type':_0xd3660d['name'],'sectionId':_0xd3660d['id']},{})[_0x152a('0x1f')](function(){return _0x3a6796;});}else{return _0x3a6796;}})[_0x152a('0x40')](function(_0x598b41){logger[_0x152a('0x23')](_0x152a('0x53'),_0x598b41);throw _0x598b41;});}return _0x3a6796;})[_0x152a('0x1f')](respondWithResult(_0x4e515d,0xc9))[_0x152a('0x40')](handleError(_0x4e515d,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 7084060..3f53e83 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 _0x2bc2=['./cannedAnswer.attributes','define','CannedAnswer','utf8mb4_unicode_ci','lodash','api','request-promise','rimraf'];(function(_0x593487,_0x40c39b){var _0x4d3f61=function(_0x4079c1){while(--_0x4079c1){_0x593487['push'](_0x593487['shift']());}};_0x4d3f61(++_0x40c39b);}(_0x2bc2,0x1ac));var _0x22bc=function(_0x586998,_0xc9fd34){_0x586998=_0x586998-0x0;var _0x1c882d=_0x2bc2[_0x586998];return _0x1c882d;};'use strict';var _=require(_0x22bc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x22bc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x22bc('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22bc('0x3'));var config=require('../../config/environment');var attributes=require(_0x22bc('0x4'));module['exports']=function(_0x12232a,_0x130212){return _0x12232a[_0x22bc('0x5')](_0x22bc('0x6'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x22bc('0x7')});};
\ No newline at end of file
+var _0xe706=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x397f37,_0x3cf86d){var _0x31cae6=function(_0x5cddb9){while(--_0x5cddb9){_0x397f37['push'](_0x397f37['shift']());}};_0x31cae6(++_0x3cf86d);}(_0xe706,0xa3));var _0x6e70=function(_0x1ea729,_0x3552bb){_0x1ea729=_0x1ea729-0x0;var _0x3576c4=_0xe706[_0x1ea729];return _0x3576c4;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e70('0xe'),'collate':_0x6e70('0xf')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 47a3218..c464682 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(_0x217f74,_0x14dd9b){var _0x3ab223=function(_0x17a123){while(--_0x17a123){_0x217f74['push'](_0x217f74['shift']());}};_0x3ab223(++_0x14dd9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x8b5726,_0x1f33d3){var _0x538c4d=function(_0x4cd9bc){while(--_0x4cd9bc){_0x8b5726['push'](_0x8b5726['shift']());}};_0x538c4d(++_0x1f33d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 9971e41..5cbcdca 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 _0xc5d0=['exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy'];(function(_0x4b86bc,_0x13ccf7){var _0x561b60=function(_0x42a3d8){while(--_0x42a3d8){_0x4b86bc['push'](_0x4b86bc['shift']());}};_0x561b60(++_0x13ccf7);}(_0xc5d0,0xbc));var _0x0c5d=function(_0xbcd604,_0x5c6862){_0xbcd604=_0xbcd604-0x0;var _0x16a71e=_0xc5d0[_0xbcd604];return _0x16a71e;};'use strict';var multer=require(_0x0c5d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c5d('0x1'));var router=express[_0x0c5d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0c5d('0x3'));var interaction=require(_0x0c5d('0x4'));var config=require(_0x0c5d('0x5'));var controller=require('./cannedAnswer.controller');router[_0x0c5d('0x6')]('/',auth[_0x0c5d('0x7')](),controller[_0x0c5d('0x8')]);router[_0x0c5d('0x6')](_0x0c5d('0x9'),auth['isAuthenticated'](),controller[_0x0c5d('0xa')]);router[_0x0c5d('0xb')]('/',auth[_0x0c5d('0x7')](),controller[_0x0c5d('0xc')]);router['put']('/:id',auth[_0x0c5d('0x7')](),controller[_0x0c5d('0xd')]);router[_0x0c5d('0xe')](_0x0c5d('0x9'),auth[_0x0c5d('0x7')](),controller[_0x0c5d('0xf')]);module[_0x0c5d('0x10')]=router;
\ No newline at end of file
+var _0x3dff=['isAuthenticated','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','/:id'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x3dff,0xec));var _0xf3df=function(_0x241b08,_0x41c97a){_0x241b08=_0x241b08-0x0;var _0x5e2bfa=_0x3dff[_0x241b08];return _0x5e2bfa;};'use strict';var multer=require(_0xf3df('0x0'));var util=require('util');var path=require(_0xf3df('0x1'));var timeout=require(_0xf3df('0x2'));var express=require(_0xf3df('0x3'));var router=express[_0xf3df('0x4')]();var fs_extra=require(_0xf3df('0x5'));var auth=require(_0xf3df('0x6'));var interaction=require(_0xf3df('0x7'));var config=require('../../config/environment');var controller=require(_0xf3df('0x8'));router[_0xf3df('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf3df('0x9')](_0xf3df('0xa'),auth[_0xf3df('0xb')](),controller[_0xf3df('0xc')]);router[_0xf3df('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf3df('0xe')]('/:id',auth[_0xf3df('0xb')](),controller[_0xf3df('0xf')]);router[_0xf3df('0x10')](_0xf3df('0xa'),auth[_0xf3df('0xb')](),controller[_0xf3df('0x11')]);module[_0xf3df('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 912d395..2afefc2 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 _0xd770=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x52deb5,_0x4c7748){var _0x476601=function(_0x19c7f2){while(--_0x19c7f2){_0x52deb5['push'](_0x52deb5['shift']());}};_0x476601(++_0x4c7748);}(_0xd770,0x1e5));var _0x0d77=function(_0x24dda9,_0x59f3a5){_0x24dda9=_0x24dda9-0x0;var _0x416acb=_0xd770[_0x24dda9];return _0x416acb;};'use strict';var Sequelize=require('sequelize');module[_0x0d77('0x0')]={'calldate':{'type':Sequelize[_0x0d77('0x1')],'allowNull':![],'defaultValue':_0x0d77('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x0d77('0x3')]},'dst':{'type':Sequelize[_0x0d77('0x3')]},'dcontext':{'type':Sequelize[_0x0d77('0x3')]},'channel':{'type':Sequelize[_0x0d77('0x3')]},'dstchannel':{'type':Sequelize[_0x0d77('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x0d77('0x3')]},'duration':{'type':Sequelize[_0x0d77('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0d77('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0d77('0x3')]},'userfield':{'type':Sequelize[_0x0d77('0x3')]},'uniqueid':{'type':Sequelize[_0x0d77('0x3')]},'linkedid':{'type':Sequelize[_0x0d77('0x3')]},'sequence':{'type':Sequelize[_0x0d77('0x3')]},'peeraccount':{'type':Sequelize[_0x0d77('0x3')]},'type':{'type':Sequelize[_0x0d77('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3df4=['STRING','INTEGER','DATE','1970-01-01\x2000:00:01'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3df4,0x102));var _0x43df=function(_0x320112,_0x5f10ae){_0x320112=_0x320112-0x0;var _0x353564=_0x3df4[_0x320112];return _0x353564;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x43df('0x0')],'allowNull':![],'defaultValue':_0x43df('0x1')},'clid':{'type':Sequelize[_0x43df('0x2')]},'src':{'type':Sequelize[_0x43df('0x2')]},'dst':{'type':Sequelize[_0x43df('0x2')]},'dcontext':{'type':Sequelize[_0x43df('0x2')]},'channel':{'type':Sequelize[_0x43df('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x43df('0x2')]},'duration':{'type':Sequelize[_0x43df('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x43df('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x43df('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x43df('0x2')]},'uniqueid':{'type':Sequelize[_0x43df('0x2')]},'linkedid':{'type':Sequelize[_0x43df('0x2')]},'sequence':{'type':Sequelize[_0x43df('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x43df('0x2')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index e07ef61..c2dad5b 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 _0xa9b1=['where','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter'];(function(_0x2ba1b2,_0x1d4370){var _0x23345e=function(_0x397142){while(--_0x397142){_0x2ba1b2['push'](_0x2ba1b2['shift']());}};_0x23345e(++_0x1d4370);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1a9b('0x0'));var jsonpatch=require(_0x1a9b('0x1'));var rp=require(_0x1a9b('0x2'));var moment=require(_0x1a9b('0x3'));var BPromise=require(_0x1a9b('0x4'));var Mustache=require(_0x1a9b('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1a9b('0x6'));var ejs=require(_0x1a9b('0x7'));var fs=require('fs');var fs_extra=require(_0x1a9b('0x8'));var _=require(_0x1a9b('0x9'));var squel=require(_0x1a9b('0xa'));var crypto=require(_0x1a9b('0xb'));var jsforce=require(_0x1a9b('0xc'));var deskjs=require(_0x1a9b('0xd'));var toCsv=require(_0x1a9b('0x6'));var querystring=require(_0x1a9b('0xe'));var Papa=require(_0x1a9b('0xf'));var Redis=require(_0x1a9b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a9b('0x11'));var hardwareService=require(_0x1a9b('0x12'));var logger=require(_0x1a9b('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a9b('0x14'));var db=require(_0x1a9b('0x15'))['db'];function respondWithStatusCode(_0x2c75cf,_0x11bf7e){_0x11bf7e=_0x11bf7e||0xcc;return function(_0x2c3170){if(_0x2c3170){return _0x2c75cf[_0x1a9b('0x16')](_0x11bf7e);}return _0x2c75cf['status'](_0x11bf7e)[_0x1a9b('0x17')]();};}function respondWithResult(_0x34f082,_0x245883){_0x245883=_0x245883||0xc8;return function(_0x53c725){if(_0x53c725){return _0x34f082[_0x1a9b('0x18')](_0x245883)[_0x1a9b('0x19')](_0x53c725);}};}function respondWithFilteredResult(_0x55a00d,_0x2a7d72){return function(_0x57ca87){if(_0x57ca87){var _0x439acd=typeof _0x2a7d72[_0x1a9b('0x1a')]===_0x1a9b('0x1b')&&typeof _0x2a7d72[_0x1a9b('0x1c')]===_0x1a9b('0x1b');var _0x20b8dc=_0x57ca87[_0x1a9b('0x1d')];var _0x205a0d=_0x439acd?0x0:_0x2a7d72[_0x1a9b('0x1a')];var _0x1281c2=_0x439acd?_0x57ca87['count']:_0x2a7d72[_0x1a9b('0x1a')]+_0x2a7d72[_0x1a9b('0x1c')];var _0x3df7d2;if(_0x1281c2>=_0x20b8dc){_0x1281c2=_0x20b8dc;_0x3df7d2=0xc8;}else{_0x3df7d2=0xce;}_0x55a00d[_0x1a9b('0x18')](_0x3df7d2);return _0x55a00d['set'](_0x1a9b('0x1e'),_0x205a0d+'-'+_0x1281c2+'/'+_0x20b8dc)[_0x1a9b('0x19')](_0x57ca87);}return null;};}function patchUpdates(_0x4b3cd3){return function(_0x23e327){try{jsonpatch[_0x1a9b('0x1f')](_0x23e327,_0x4b3cd3,!![]);}catch(_0x44cebf){return BPromise[_0x1a9b('0x20')](_0x44cebf);}return _0x23e327[_0x1a9b('0x21')]();};}function saveUpdates(_0x590568,_0x189e78){return function(_0x17b1dd){if(_0x17b1dd){return _0x17b1dd[_0x1a9b('0x22')](_0x590568)[_0x1a9b('0x23')](function(_0x36391a){return _0x36391a;});}return null;};}function removeEntity(_0x2e42f1,_0x28f937){return function(_0x488a33){if(_0x488a33){return _0x488a33[_0x1a9b('0x24')]()['then'](function(){_0x2e42f1[_0x1a9b('0x18')](0xcc)[_0x1a9b('0x17')]();});}};}function handleEntityNotFound(_0xad6541,_0x4e7234){return function(_0x213841){if(!_0x213841){_0xad6541[_0x1a9b('0x16')](0x194);}return _0x213841;};}function handleError(_0x1521f4,_0x181331){_0x181331=_0x181331||0x1f4;return function(_0x18c9dd){logger[_0x1a9b('0x25')](_0x18c9dd['stack']);if(_0x18c9dd[_0x1a9b('0x26')]){delete _0x18c9dd[_0x1a9b('0x26')];}_0x1521f4['status'](_0x181331)[_0x1a9b('0x27')](_0x18c9dd);};}exports[_0x1a9b('0x28')]=function(_0x5d70dc,_0x5d7e8c){var _0x3f8e98={},_0x1d981e={},_0x5362b8={'count':0x0,'rows':[]};var _0x30278b=_[_0x1a9b('0x29')](db[_0x1a9b('0x2a')][_0x1a9b('0x2b')],function(_0x1a5085){return{'name':_0x1a5085[_0x1a9b('0x2c')],'type':_0x1a5085[_0x1a9b('0x2d')]['key']};});_0x1d981e[_0x1a9b('0x2e')]=_[_0x1a9b('0x29')](_0x30278b,_0x1a9b('0x26'));_0x1d981e[_0x1a9b('0x2f')]=_[_0x1a9b('0x30')](_0x5d70dc[_0x1a9b('0x2f')]);_0x1d981e[_0x1a9b('0x31')]=_[_0x1a9b('0x32')](_0x1d981e[_0x1a9b('0x2e')],_0x1d981e[_0x1a9b('0x2f')]);_0x3f8e98[_0x1a9b('0x33')]=_['intersection'](_0x1d981e['model'],qs[_0x1a9b('0x34')](_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x34')]));_0x3f8e98['attributes']=_0x3f8e98[_0x1a9b('0x33')]['length']?_0x3f8e98[_0x1a9b('0x33')]:_0x1d981e['model'];if(!_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x35')]('nolimit')){_0x3f8e98[_0x1a9b('0x1c')]=qs['limit'](_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x1c')]);_0x3f8e98[_0x1a9b('0x1a')]=qs[_0x1a9b('0x1a')](_0x5d70dc['query'][_0x1a9b('0x1a')]);}_0x3f8e98[_0x1a9b('0x36')]=qs[_0x1a9b('0x37')](_0x5d70dc['query'][_0x1a9b('0x37')]);_0x3f8e98['where']=qs['filters'](_[_0x1a9b('0x38')](_0x5d70dc[_0x1a9b('0x2f')],_0x1d981e[_0x1a9b('0x31')]),_0x30278b);if(_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x39')]){_0x3f8e98[_0x1a9b('0x3a')]=_[_0x1a9b('0x3b')](_0x3f8e98['where'],{'$or':_[_0x1a9b('0x29')](_0x30278b,function(_0x230fc6){if(_0x230fc6[_0x1a9b('0x2d')]!=='VIRTUAL'){var _0x466827={};_0x466827[_0x230fc6[_0x1a9b('0x26')]]={'$like':'%'+_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x39')]+'%'};return _0x466827;}})});}_0x3f8e98=_['merge']({},_0x3f8e98,_0x5d70dc['options']);var _0x10e80f={'where':_0x3f8e98[_0x1a9b('0x3a')]};return db[_0x1a9b('0x2a')]['count'](_0x10e80f)['then'](function(_0x2b9bcf){_0x5362b8[_0x1a9b('0x1d')]=_0x2b9bcf;if(_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x3c')]){_0x3f8e98[_0x1a9b('0x3d')]=[{'all':!![]}];}return db[_0x1a9b('0x2a')][_0x1a9b('0x3e')](_0x3f8e98);})['then'](function(_0x313921){_0x5362b8[_0x1a9b('0x3f')]=_0x313921;return _0x5362b8;})[_0x1a9b('0x23')](respondWithFilteredResult(_0x5d7e8c,_0x3f8e98))[_0x1a9b('0x40')](handleError(_0x5d7e8c,null));};exports[_0x1a9b('0x41')]=function(_0x1decb8,_0xb4cbf4){var _0x398db3={'raw':!![],'where':{'id':_0x1decb8[_0x1a9b('0x42')]['id']}},_0x35f6d8={};_0x35f6d8[_0x1a9b('0x2e')]=_[_0x1a9b('0x30')](db[_0x1a9b('0x2a')][_0x1a9b('0x2b')]);_0x35f6d8[_0x1a9b('0x2f')]=_[_0x1a9b('0x30')](_0x1decb8['query']);_0x35f6d8[_0x1a9b('0x31')]=_[_0x1a9b('0x32')](_0x35f6d8['model'],_0x35f6d8[_0x1a9b('0x2f')]);_0x398db3['attributes']=_['intersection'](_0x35f6d8[_0x1a9b('0x2e')],qs[_0x1a9b('0x34')](_0x1decb8[_0x1a9b('0x2f')][_0x1a9b('0x34')]));_0x398db3[_0x1a9b('0x33')]=_0x398db3[_0x1a9b('0x33')][_0x1a9b('0x43')]?_0x398db3['attributes']:_0x35f6d8[_0x1a9b('0x2e')];if(_0x1decb8[_0x1a9b('0x2f')][_0x1a9b('0x3c')]){_0x398db3[_0x1a9b('0x3d')]=[{'all':!![]}];}_0x398db3=_['merge']({},_0x398db3,_0x1decb8[_0x1a9b('0x44')]);return db[_0x1a9b('0x2a')][_0x1a9b('0x45')](_0x398db3)[_0x1a9b('0x23')](handleEntityNotFound(_0xb4cbf4,null))['then'](respondWithResult(_0xb4cbf4,null))[_0x1a9b('0x40')](handleError(_0xb4cbf4,null));};exports[_0x1a9b('0x46')]=function(_0x41e9fc,_0x1e93df){return db[_0x1a9b('0x2a')]['create'](_0x41e9fc['body'],{})[_0x1a9b('0x23')](respondWithResult(_0x1e93df,0xc9))[_0x1a9b('0x40')](handleError(_0x1e93df,null));};exports['update']=function(_0x52b06e,_0x252140){if(_0x52b06e[_0x1a9b('0x47')]['id']){delete _0x52b06e[_0x1a9b('0x47')]['id'];}return db['Cdr'][_0x1a9b('0x45')]({'where':{'id':_0x52b06e[_0x1a9b('0x42')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x252140,null))[_0x1a9b('0x23')](saveUpdates(_0x52b06e[_0x1a9b('0x47')],null))[_0x1a9b('0x23')](respondWithResult(_0x252140,null))[_0x1a9b('0x40')](handleError(_0x252140,null));};exports['destroy']=function(_0x54b9ac,_0x5465d0){return db[_0x1a9b('0x2a')][_0x1a9b('0x45')]({'where':{'id':_0x54b9ac[_0x1a9b('0x42')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x5465d0,null))[_0x1a9b('0x23')](removeEntity(_0x5465d0,null))['catch'](handleError(_0x5465d0,null));};exports[_0x1a9b('0x48')]=function(_0x222bba,_0x3b1fdf){return db[_0x1a9b('0x2a')][_0x1a9b('0x48')]()[_0x1a9b('0x23')](respondWithResult(_0x3b1fdf,null))[_0x1a9b('0x40')](handleError(_0x3b1fdf,null));};
\ No newline at end of file
+var _0xac9d=['fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xac9d,0x14d));var _0xdac9=function(_0x1feefe,_0x2018ad){_0x1feefe=_0x1feefe-0x0;var _0x56471a=_0xac9d[_0x1feefe];return _0x56471a;};'use strict';var emlformat=require(_0xdac9('0x0'));var rimraf=require(_0xdac9('0x1'));var zipdir=require(_0xdac9('0x2'));var jsonpatch=require(_0xdac9('0x3'));var rp=require(_0xdac9('0x4'));var moment=require(_0xdac9('0x5'));var BPromise=require(_0xdac9('0x6'));var Mustache=require(_0xdac9('0x7'));var util=require('util');var path=require(_0xdac9('0x8'));var sox=require('sox');var csv=require(_0xdac9('0x9'));var ejs=require(_0xdac9('0xa'));var fs=require('fs');var fs_extra=require(_0xdac9('0xb'));var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var licenseUtil=require(_0xdac9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xcc;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['sendStatus'](_0xeddbc1);}return _0x3d8e97[_0xdac9('0x1b')](_0xeddbc1)[_0xdac9('0x1c')]();};}function respondWithResult(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0xc8;return function(_0x5dd536){if(_0x5dd536){return _0x9e1bf6[_0xdac9('0x1b')](_0x5f0bbd)[_0xdac9('0x1d')](_0x5dd536);}};}function respondWithFilteredResult(_0x50f9fe,_0x76af7a){return function(_0x36cbe4){if(_0x36cbe4){var _0x152ea5=typeof _0x76af7a[_0xdac9('0x1e')]===_0xdac9('0x1f')&&typeof _0x76af7a[_0xdac9('0x20')]===_0xdac9('0x1f');var _0xec1016=_0x36cbe4['count'];var _0x283343=_0x152ea5?0x0:_0x76af7a[_0xdac9('0x1e')];var _0x571e07=_0x152ea5?_0x36cbe4[_0xdac9('0x21')]:_0x76af7a[_0xdac9('0x1e')]+_0x76af7a[_0xdac9('0x20')];var _0x181d11;if(_0x571e07>=_0xec1016){_0x571e07=_0xec1016;_0x181d11=0xc8;}else{_0x181d11=0xce;}_0x50f9fe['status'](_0x181d11);return _0x50f9fe['set'](_0xdac9('0x22'),_0x283343+'-'+_0x571e07+'/'+_0xec1016)[_0xdac9('0x1d')](_0x36cbe4);}return null;};}function patchUpdates(_0x2b9d91){return function(_0x395ec7){try{jsonpatch['apply'](_0x395ec7,_0x2b9d91,!![]);}catch(_0x23ee5e){return BPromise[_0xdac9('0x23')](_0x23ee5e);}return _0x395ec7[_0xdac9('0x24')]();};}function saveUpdates(_0xae680a,_0xe7bd10){return function(_0x42317c){if(_0x42317c){return _0x42317c[_0xdac9('0x25')](_0xae680a)[_0xdac9('0x26')](function(_0x419f0c){return _0x419f0c;});}return null;};}function removeEntity(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(_0x2943f5){return _0x2943f5[_0xdac9('0x27')]()[_0xdac9('0x26')](function(){_0x33de5c[_0xdac9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e631a,_0x5686db){return function(_0x3ce475){if(!_0x3ce475){_0x1e631a[_0xdac9('0x28')](0x194);}return _0x3ce475;};}function handleError(_0x566d8c,_0x433be9){_0x433be9=_0x433be9||0x1f4;return function(_0x5105f1){logger[_0xdac9('0x29')](_0x5105f1[_0xdac9('0x2a')]);if(_0x5105f1[_0xdac9('0x2b')]){delete _0x5105f1[_0xdac9('0x2b')];}_0x566d8c['status'](_0x433be9)['send'](_0x5105f1);};}exports[_0xdac9('0x2c')]=function(_0x170afd,_0x4fe3bd){var _0x4c4e21={},_0x3eed7a={},_0x3505c5={'count':0x0,'rows':[]};var _0x13efba=_[_0xdac9('0x2d')](db[_0xdac9('0x2e')][_0xdac9('0x2f')],function(_0xed99f9){return{'name':_0xed99f9[_0xdac9('0x30')],'type':_0xed99f9[_0xdac9('0x31')][_0xdac9('0x32')]};});_0x3eed7a[_0xdac9('0x33')]=_[_0xdac9('0x2d')](_0x13efba,_0xdac9('0x2b'));_0x3eed7a[_0xdac9('0x34')]=_[_0xdac9('0x35')](_0x170afd[_0xdac9('0x34')]);_0x3eed7a[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x3eed7a[_0xdac9('0x33')],_0x3eed7a[_0xdac9('0x34')]);_0x4c4e21[_0xdac9('0x38')]=_['intersection'](_0x3eed7a['model'],qs[_0xdac9('0x39')](_0x170afd[_0xdac9('0x34')][_0xdac9('0x39')]));_0x4c4e21[_0xdac9('0x38')]=_0x4c4e21[_0xdac9('0x38')]['length']?_0x4c4e21[_0xdac9('0x38')]:_0x3eed7a['model'];if(!_0x170afd[_0xdac9('0x34')][_0xdac9('0x3a')]('nolimit')){_0x4c4e21[_0xdac9('0x20')]=qs['limit'](_0x170afd['query'][_0xdac9('0x20')]);_0x4c4e21[_0xdac9('0x1e')]=qs[_0xdac9('0x1e')](_0x170afd[_0xdac9('0x34')][_0xdac9('0x1e')]);}_0x4c4e21[_0xdac9('0x3b')]=qs['sort'](_0x170afd[_0xdac9('0x34')][_0xdac9('0x3c')]);_0x4c4e21['where']=qs[_0xdac9('0x36')](_[_0xdac9('0x3d')](_0x170afd[_0xdac9('0x34')],_0x3eed7a[_0xdac9('0x36')]),_0x13efba);if(_0x170afd[_0xdac9('0x34')][_0xdac9('0x3e')]){_0x4c4e21[_0xdac9('0x3f')]=_['merge'](_0x4c4e21[_0xdac9('0x3f')],{'$or':_[_0xdac9('0x2d')](_0x13efba,function(_0x238769){if(_0x238769['type']!==_0xdac9('0x40')){var _0x338e4a={};_0x338e4a[_0x238769[_0xdac9('0x2b')]]={'$like':'%'+_0x170afd[_0xdac9('0x34')]['filter']+'%'};return _0x338e4a;}})});}_0x4c4e21=_['merge']({},_0x4c4e21,_0x170afd[_0xdac9('0x41')]);var _0xe47a3c={'where':_0x4c4e21[_0xdac9('0x3f')]};return db[_0xdac9('0x2e')][_0xdac9('0x21')](_0xe47a3c)['then'](function(_0x8435e8){_0x3505c5['count']=_0x8435e8;if(_0x170afd[_0xdac9('0x34')][_0xdac9('0x42')]){_0x4c4e21[_0xdac9('0x43')]=[{'all':!![]}];}return db[_0xdac9('0x2e')][_0xdac9('0x44')](_0x4c4e21);})[_0xdac9('0x26')](function(_0x413fb1){_0x3505c5[_0xdac9('0x45')]=_0x413fb1;return _0x3505c5;})[_0xdac9('0x26')](respondWithFilteredResult(_0x4fe3bd,_0x4c4e21))[_0xdac9('0x46')](handleError(_0x4fe3bd,null));};exports[_0xdac9('0x47')]=function(_0x24b570,_0x278826){var _0x441676={'raw':!![],'where':{'id':_0x24b570[_0xdac9('0x48')]['id']}},_0x5335ae={};_0x5335ae[_0xdac9('0x33')]=_['keys'](db[_0xdac9('0x2e')][_0xdac9('0x2f')]);_0x5335ae[_0xdac9('0x34')]=_[_0xdac9('0x35')](_0x24b570[_0xdac9('0x34')]);_0x5335ae[_0xdac9('0x36')]=_['intersection'](_0x5335ae[_0xdac9('0x33')],_0x5335ae['query']);_0x441676[_0xdac9('0x38')]=_[_0xdac9('0x37')](_0x5335ae[_0xdac9('0x33')],qs[_0xdac9('0x39')](_0x24b570['query']['fields']));_0x441676['attributes']=_0x441676[_0xdac9('0x38')]['length']?_0x441676['attributes']:_0x5335ae[_0xdac9('0x33')];if(_0x24b570[_0xdac9('0x34')]['includeAll']){_0x441676['include']=[{'all':!![]}];}_0x441676=_[_0xdac9('0x49')]({},_0x441676,_0x24b570[_0xdac9('0x41')]);return db[_0xdac9('0x2e')][_0xdac9('0x4a')](_0x441676)[_0xdac9('0x26')](handleEntityNotFound(_0x278826,null))[_0xdac9('0x26')](respondWithResult(_0x278826,null))[_0xdac9('0x46')](handleError(_0x278826,null));};exports[_0xdac9('0x4b')]=function(_0x5c008b,_0x621cf){return db[_0xdac9('0x2e')][_0xdac9('0x4b')](_0x5c008b[_0xdac9('0x4c')],{})[_0xdac9('0x26')](respondWithResult(_0x621cf,0xc9))[_0xdac9('0x46')](handleError(_0x621cf,null));};exports[_0xdac9('0x25')]=function(_0x37b498,_0x140dc5){if(_0x37b498[_0xdac9('0x4c')]['id']){delete _0x37b498[_0xdac9('0x4c')]['id'];}return db[_0xdac9('0x2e')][_0xdac9('0x4a')]({'where':{'id':_0x37b498[_0xdac9('0x48')]['id']}})['then'](handleEntityNotFound(_0x140dc5,null))['then'](saveUpdates(_0x37b498['body'],null))[_0xdac9('0x26')](respondWithResult(_0x140dc5,null))[_0xdac9('0x46')](handleError(_0x140dc5,null));};exports['destroy']=function(_0x2a60bd,_0x2843f2){return db[_0xdac9('0x2e')]['find']({'where':{'id':_0x2a60bd[_0xdac9('0x48')]['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x2843f2,null))['then'](removeEntity(_0x2843f2,null))['catch'](handleError(_0x2843f2,null));};exports[_0xdac9('0x4d')]=function(_0x4469d8,_0x222de9){return db[_0xdac9('0x2e')][_0xdac9('0x4d')]()[_0xdac9('0x26')](respondWithResult(_0x222de9,null))[_0xdac9('0x46')](handleError(_0x222de9,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 2d94f07..ca2ba40 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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x30d065,_0x538346){var _0x52bd72=function(_0x4a25b0){while(--_0x4a25b0){_0x30d065['push'](_0x30d065['shift']());}};_0x52bd72(++_0x538346);}(_0x7a54,0x106));var _0x47a5=function(_0x2efb08,_0x2f0164){_0x2efb08=_0x2efb08-0x0;var _0x5eae74=_0x7a54[_0x2efb08];return _0x5eae74;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x372e7b,_0x37289d){var _0x36b1c2=function(_0x5033eb){while(--_0x5033eb){_0x372e7b['push'](_0x372e7b['shift']());}};_0x36b1c2(++_0x37289d);}(_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 e32cc69..af396e8 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 _0xa388=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa388,0x1d0));var _0x8a38=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa388[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8a38('0x0'));var util=require(_0x8a38('0x1'));var moment=require('moment');var BPromise=require(_0x8a38('0x2'));var rs=require(_0x8a38('0x3'));var fs=require('fs');var Redis=require(_0x8a38('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a38('0x5'));var logger=require(_0x8a38('0x6'))('rpc');var config=require(_0x8a38('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8a38('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x188f85,_0x1161bf,_0x3065d7){return new BPromise(function(_0xda76e7,_0x432a47){return client[_0x8a38('0x9')](_0x188f85,_0x3065d7)[_0x8a38('0xa')](function(_0x12f07f){logger[_0x8a38('0xb')](_0x8a38('0xc'),_0x1161bf,_0x8a38('0xd'));logger[_0x8a38('0xe')](_0x8a38('0xf'),_0x1161bf,_0x8a38('0xd'),JSON['stringify'](_0x12f07f));if(_0x12f07f[_0x8a38('0x10')]){if(_0x12f07f[_0x8a38('0x10')][_0x8a38('0x11')]===0x1f4){logger[_0x8a38('0x10')](_0x8a38('0xc'),_0x1161bf,_0x12f07f[_0x8a38('0x10')][_0x8a38('0x12')]);return _0x432a47(_0x12f07f[_0x8a38('0x10')][_0x8a38('0x12')]);}logger[_0x8a38('0x10')](_0x8a38('0xc'),_0x1161bf,_0x12f07f[_0x8a38('0x10')][_0x8a38('0x12')]);return _0xda76e7(_0x12f07f['error'][_0x8a38('0x12')]);}else{logger[_0x8a38('0xb')](_0x8a38('0xc'),_0x1161bf,_0x8a38('0xd'));_0xda76e7(_0x12f07f[_0x8a38('0x13')][_0x8a38('0x12')]);}})[_0x8a38('0x14')](function(_0x338444){logger[_0x8a38('0x10')](_0x8a38('0xc'),_0x1161bf,_0x338444);_0x432a47(_0x338444);});});}
\ No newline at end of file
+var _0x9d14=['message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x194b44,_0x1bf886){var _0x4b93dc=function(_0x3d0e9a){while(--_0x3d0e9a){_0x194b44['push'](_0x194b44['shift']());}};_0x4b93dc(++_0x1bf886);}(_0x9d14,0x1e8));var _0x49d1=function(_0x10b8e5,_0x395072){_0x10b8e5=_0x10b8e5-0x0;var _0x37d55b=_0x9d14[_0x10b8e5];return _0x37d55b;};'use strict';var _=require(_0x49d1('0x0'));var util=require(_0x49d1('0x1'));var moment=require(_0x49d1('0x2'));var BPromise=require(_0x49d1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x49d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49d1('0x6'));var jayson=require(_0x49d1('0x7'));var client=jayson['client'][_0x49d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5054d6,_0x5052e3,_0x54f128){return new BPromise(function(_0x143169,_0x22a16e){return client[_0x49d1('0x9')](_0x5054d6,_0x54f128)[_0x49d1('0xa')](function(_0x5a6afa){logger['info'](_0x49d1('0xb'),_0x5052e3,_0x49d1('0xc'));logger[_0x49d1('0xd')](_0x49d1('0xe'),_0x5052e3,_0x49d1('0xc'),JSON[_0x49d1('0xf')](_0x5a6afa));if(_0x5a6afa[_0x49d1('0x10')]){if(_0x5a6afa[_0x49d1('0x10')][_0x49d1('0x11')]===0x1f4){logger[_0x49d1('0x10')](_0x49d1('0xb'),_0x5052e3,_0x5a6afa[_0x49d1('0x10')][_0x49d1('0x12')]);return _0x22a16e(_0x5a6afa['error'][_0x49d1('0x12')]);}logger['error'](_0x49d1('0xb'),_0x5052e3,_0x5a6afa[_0x49d1('0x10')][_0x49d1('0x12')]);return _0x143169(_0x5a6afa[_0x49d1('0x10')][_0x49d1('0x12')]);}else{logger[_0x49d1('0x13')]('Cdr,\x20%s,\x20%s',_0x5052e3,_0x49d1('0xc'));_0x143169(_0x5a6afa[_0x49d1('0x14')][_0x49d1('0x12')]);}})[_0x49d1('0x15')](function(_0x394227){logger[_0x49d1('0x10')](_0x49d1('0xb'),_0x5052e3,_0x394227);_0x22a16e(_0x394227);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 9311fde..0d9a873 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(_0x42e98c,_0x1c6bb9){var _0x59803e=function(_0x3a587e){while(--_0x3a587e){_0x42e98c['push'](_0x42e98c['shift']());}};_0x59803e(++_0x1c6bb9);}(_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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0xa45395,_0x5579e6){var _0x3c83d2=function(_0x5d013c){while(--_0x5d013c){_0xa45395['push'](_0xa45395['shift']());}};_0x3c83d2(++_0x5579e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('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 fbeb1e0..cda7917 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 _0x76ca=['sequelize','exports','STRING','noop','TEXT'];(function(_0x2ade6f,_0x18d576){var _0x28fa0f=function(_0x4ad67c){while(--_0x4ad67c){_0x2ade6f['push'](_0x2ade6f['shift']());}};_0x28fa0f(++_0x18d576);}(_0x76ca,0xcd));var _0xa76c=function(_0x3c9be5,_0x3b5e36){_0x3c9be5=_0x3c9be5-0x0;var _0x467cca=_0x76ca[_0x3c9be5];return _0x467cca;};'use strict';var Sequelize=require(_0xa76c('0x0'));module[_0xa76c('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa76c('0x2')],'allowNull':![],'defaultValue':_0xa76c('0x3')},'appdata':{'type':Sequelize[_0xa76c('0x4')]()},'description':{'type':Sequelize[_0xa76c('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x349a=['exports','STRING','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x349a,0x17f));var _0xa349=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0x349a[_0x1ae4a9];return _0x54d0b0;};'use strict';var Sequelize=require(_0xa349('0x0'));module[_0xa349('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa349('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa349('0x3')]()},'description':{'type':Sequelize[_0xa349('0x2')]},'interval':{'type':Sequelize[_0xa349('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index fbc320e..8fe9ab4 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 _0xe3ed=['Content-Range','apply','reject','save','then','destroy','error','stack','name','params','model','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatApplication','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','set'];(function(_0x2b98cc,_0x512e0e){var _0x97b31f=function(_0x1af0d2){while(--_0x1af0d2){_0x2b98cc['push'](_0x2b98cc['shift']());}};_0x97b31f(++_0x512e0e);}(_0xe3ed,0x8d));var _0xde3e=function(_0x20eeb5,_0x5dbaaa){_0x20eeb5=_0x20eeb5-0x0;var _0x1e3e86=_0xe3ed[_0x20eeb5];return _0x1e3e86;};'use strict';var emlformat=require(_0xde3e('0x0'));var rimraf=require(_0xde3e('0x1'));var zipdir=require(_0xde3e('0x2'));var jsonpatch=require(_0xde3e('0x3'));var rp=require(_0xde3e('0x4'));var moment=require(_0xde3e('0x5'));var BPromise=require(_0xde3e('0x6'));var Mustache=require(_0xde3e('0x7'));var util=require('util');var path=require(_0xde3e('0x8'));var sox=require(_0xde3e('0x9'));var csv=require('to-csv');var ejs=require(_0xde3e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde3e('0xb'));var squel=require(_0xde3e('0xc'));var crypto=require('crypto');var jsforce=require(_0xde3e('0xd'));var deskjs=require(_0xde3e('0xe'));var toCsv=require(_0xde3e('0xf'));var querystring=require(_0xde3e('0x10'));var Papa=require(_0xde3e('0x11'));var Redis=require('ioredis');var authService=require(_0xde3e('0x12'));var qs=require(_0xde3e('0x13'));var as=require(_0xde3e('0x14'));var hardwareService=require(_0xde3e('0x15'));var logger=require('../../config/logger')(_0xde3e('0x16'));var utils=require(_0xde3e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xde3e('0x18'));var db=require(_0xde3e('0x19'))['db'];function respondWithStatusCode(_0x5d0240,_0x22ffc2){_0x22ffc2=_0x22ffc2||0xcc;return function(_0x4e0f23){if(_0x4e0f23){return _0x5d0240[_0xde3e('0x1a')](_0x22ffc2);}return _0x5d0240[_0xde3e('0x1b')](_0x22ffc2)[_0xde3e('0x1c')]();};}function respondWithResult(_0x4fe882,_0x167fa7){_0x167fa7=_0x167fa7||0xc8;return function(_0x1fee7b){if(_0x1fee7b){return _0x4fe882['status'](_0x167fa7)['json'](_0x1fee7b);}};}function respondWithFilteredResult(_0x120077,_0x11db96){return function(_0x6543f7){if(_0x6543f7){var _0x552fc4=typeof _0x11db96['offset']===_0xde3e('0x1d')&&typeof _0x11db96['limit']==='undefined';var _0xc3ee05=_0x6543f7[_0xde3e('0x1e')];var _0x4aa02c=_0x552fc4?0x0:_0x11db96[_0xde3e('0x1f')];var _0x276e83=_0x552fc4?_0x6543f7[_0xde3e('0x1e')]:_0x11db96['offset']+_0x11db96['limit'];var _0x4fa0d2;if(_0x276e83>=_0xc3ee05){_0x276e83=_0xc3ee05;_0x4fa0d2=0xc8;}else{_0x4fa0d2=0xce;}_0x120077[_0xde3e('0x1b')](_0x4fa0d2);return _0x120077[_0xde3e('0x20')](_0xde3e('0x21'),_0x4aa02c+'-'+_0x276e83+'/'+_0xc3ee05)['json'](_0x6543f7);}return null;};}function patchUpdates(_0x2ceb3e){return function(_0x11dd22){try{jsonpatch[_0xde3e('0x22')](_0x11dd22,_0x2ceb3e,!![]);}catch(_0x8c8ace){return BPromise[_0xde3e('0x23')](_0x8c8ace);}return _0x11dd22[_0xde3e('0x24')]();};}function saveUpdates(_0x26c5ca,_0x1eda88){return function(_0x443e8d){if(_0x443e8d){return _0x443e8d['update'](_0x26c5ca)[_0xde3e('0x25')](function(_0x334093){return _0x334093;});}return null;};}function removeEntity(_0x37615f,_0x57df9e){return function(_0x361511){if(_0x361511){return _0x361511[_0xde3e('0x26')]()[_0xde3e('0x25')](function(){_0x37615f['status'](0xcc)[_0xde3e('0x1c')]();});}};}function handleEntityNotFound(_0x78647,_0x1d9432){return function(_0xd795ac){if(!_0xd795ac){_0x78647[_0xde3e('0x1a')](0x194);}return _0xd795ac;};}function handleError(_0x5ec4b6,_0x5313cb){_0x5313cb=_0x5313cb||0x1f4;return function(_0x6c0db0){logger[_0xde3e('0x27')](_0x6c0db0[_0xde3e('0x28')]);if(_0x6c0db0['name']){delete _0x6c0db0[_0xde3e('0x29')];}_0x5ec4b6[_0xde3e('0x1b')](_0x5313cb)['send'](_0x6c0db0);};}exports['show']=function(_0x245fbc,_0x3c83c8){var _0x582c8d={'raw':!![],'where':{'id':_0x245fbc[_0xde3e('0x2a')]['id']}},_0x2e4c62={};_0x2e4c62[_0xde3e('0x2b')]=_['keys'](db['ChatApplication'][_0xde3e('0x2c')]);_0x2e4c62['query']=_['keys'](_0x245fbc[_0xde3e('0x2d')]);_0x2e4c62[_0xde3e('0x2e')]=_[_0xde3e('0x2f')](_0x2e4c62[_0xde3e('0x2b')],_0x2e4c62[_0xde3e('0x2d')]);_0x582c8d[_0xde3e('0x30')]=_[_0xde3e('0x2f')](_0x2e4c62[_0xde3e('0x2b')],qs[_0xde3e('0x31')](_0x245fbc[_0xde3e('0x2d')][_0xde3e('0x31')]));_0x582c8d[_0xde3e('0x30')]=_0x582c8d[_0xde3e('0x30')][_0xde3e('0x32')]?_0x582c8d[_0xde3e('0x30')]:_0x2e4c62[_0xde3e('0x2b')];if(_0x245fbc[_0xde3e('0x2d')]['includeAll']){_0x582c8d[_0xde3e('0x33')]=[{'all':!![]}];}_0x582c8d=_[_0xde3e('0x34')]({},_0x582c8d,_0x245fbc[_0xde3e('0x35')]);return db[_0xde3e('0x36')][_0xde3e('0x37')](_0x582c8d)[_0xde3e('0x25')](handleEntityNotFound(_0x3c83c8,null))[_0xde3e('0x25')](respondWithResult(_0x3c83c8,null))[_0xde3e('0x38')](handleError(_0x3c83c8,null));};exports['update']=function(_0x50f1e3,_0x47793d){if(_0x50f1e3['body']['id']){delete _0x50f1e3['body']['id'];}return db[_0xde3e('0x36')][_0xde3e('0x37')]({'where':{'id':_0x50f1e3[_0xde3e('0x2a')]['id']}})[_0xde3e('0x25')](handleEntityNotFound(_0x47793d,null))[_0xde3e('0x25')](saveUpdates(_0x50f1e3[_0xde3e('0x39')],null))['then'](respondWithResult(_0x47793d,null))['catch'](handleError(_0x47793d,null));};exports[_0xde3e('0x26')]=function(_0x24adee,_0x1ade0c){return db[_0xde3e('0x36')][_0xde3e('0x37')]({'where':{'id':_0x24adee[_0xde3e('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1ade0c,null))[_0xde3e('0x25')](removeEntity(_0x1ade0c,null))['catch'](handleError(_0x1ade0c,null));};
\ No newline at end of file
+var _0x7daf=['jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','includeAll','include','merge','find','update','params','catch','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4491d9,_0x5856ec){var _0x3e9dba=function(_0x2a6302){while(--_0x2a6302){_0x4491d9['push'](_0x4491d9['shift']());}};_0x3e9dba(++_0x5856ec);}(_0x7daf,0xaa));var _0xf7da=function(_0x331e28,_0x163e3c){_0x331e28=_0x331e28-0x0;var _0x42abb8=_0x7daf[_0x331e28];return _0x42abb8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7da('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7da('0x1'));var rp=require(_0xf7da('0x2'));var moment=require('moment');var BPromise=require(_0xf7da('0x3'));var Mustache=require(_0xf7da('0x4'));var util=require(_0xf7da('0x5'));var path=require(_0xf7da('0x6'));var sox=require(_0xf7da('0x7'));var csv=require('to-csv');var ejs=require(_0xf7da('0x8'));var fs=require('fs');var fs_extra=require(_0xf7da('0x9'));var _=require(_0xf7da('0xa'));var squel=require(_0xf7da('0xb'));var crypto=require(_0xf7da('0xc'));var jsforce=require(_0xf7da('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7da('0xe'));var querystring=require(_0xf7da('0xf'));var Papa=require(_0xf7da('0x10'));var Redis=require(_0xf7da('0x11'));var authService=require(_0xf7da('0x12'));var qs=require(_0xf7da('0x13'));var as=require(_0xf7da('0x14'));var hardwareService=require(_0xf7da('0x15'));var logger=require(_0xf7da('0x16'))(_0xf7da('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf7da('0x18'));var db=require(_0xf7da('0x19'))['db'];function respondWithStatusCode(_0x2a5afc,_0x392244){_0x392244=_0x392244||0xcc;return function(_0x2da6bd){if(_0x2da6bd){return _0x2a5afc[_0xf7da('0x1a')](_0x392244);}return _0x2a5afc['status'](_0x392244)[_0xf7da('0x1b')]();};}function respondWithResult(_0x61af71,_0x5bfc67){_0x5bfc67=_0x5bfc67||0xc8;return function(_0x1958dd){if(_0x1958dd){return _0x61af71[_0xf7da('0x1c')](_0x5bfc67)[_0xf7da('0x1d')](_0x1958dd);}};}function respondWithFilteredResult(_0x37d3f7,_0xe82d40){return function(_0x26f112){if(_0x26f112){var _0x4f5afa=typeof _0xe82d40['offset']==='undefined'&&typeof _0xe82d40[_0xf7da('0x1e')]===_0xf7da('0x1f');var _0x231d6e=_0x26f112[_0xf7da('0x20')];var _0x336fca=_0x4f5afa?0x0:_0xe82d40[_0xf7da('0x21')];var _0xb75a2c=_0x4f5afa?_0x26f112[_0xf7da('0x20')]:_0xe82d40[_0xf7da('0x21')]+_0xe82d40[_0xf7da('0x1e')];var _0x303459;if(_0xb75a2c>=_0x231d6e){_0xb75a2c=_0x231d6e;_0x303459=0xc8;}else{_0x303459=0xce;}_0x37d3f7[_0xf7da('0x1c')](_0x303459);return _0x37d3f7[_0xf7da('0x22')](_0xf7da('0x23'),_0x336fca+'-'+_0xb75a2c+'/'+_0x231d6e)['json'](_0x26f112);}return null;};}function patchUpdates(_0x3f5f58){return function(_0x3b0913){try{jsonpatch[_0xf7da('0x24')](_0x3b0913,_0x3f5f58,!![]);}catch(_0xa43acc){return BPromise[_0xf7da('0x25')](_0xa43acc);}return _0x3b0913[_0xf7da('0x26')]();};}function saveUpdates(_0x119f49,_0x35ac94){return function(_0x3affce){if(_0x3affce){return _0x3affce['update'](_0x119f49)[_0xf7da('0x27')](function(_0x1b68d3){return _0x1b68d3;});}return null;};}function removeEntity(_0x265192,_0x4b627e){return function(_0x3bf5d1){if(_0x3bf5d1){return _0x3bf5d1[_0xf7da('0x28')]()[_0xf7da('0x27')](function(){_0x265192[_0xf7da('0x1c')](0xcc)[_0xf7da('0x1b')]();});}};}function handleEntityNotFound(_0x9d2da,_0x5a9866){return function(_0x1aadd8){if(!_0x1aadd8){_0x9d2da[_0xf7da('0x1a')](0x194);}return _0x1aadd8;};}function handleError(_0x474aa4,_0x583bfc){_0x583bfc=_0x583bfc||0x1f4;return function(_0x13ace4){logger[_0xf7da('0x29')](_0x13ace4[_0xf7da('0x2a')]);if(_0x13ace4[_0xf7da('0x2b')]){delete _0x13ace4[_0xf7da('0x2b')];}_0x474aa4['status'](_0x583bfc)[_0xf7da('0x2c')](_0x13ace4);};}exports['show']=function(_0x258c74,_0xdaef0d){var _0x1dfcc5={'raw':!![],'where':{'id':_0x258c74['params']['id']}},_0x23a27e={};_0x23a27e[_0xf7da('0x2d')]=_[_0xf7da('0x2e')](db[_0xf7da('0x2f')][_0xf7da('0x30')]);_0x23a27e[_0xf7da('0x31')]=_[_0xf7da('0x2e')](_0x258c74[_0xf7da('0x31')]);_0x23a27e[_0xf7da('0x32')]=_['intersection'](_0x23a27e[_0xf7da('0x2d')],_0x23a27e[_0xf7da('0x31')]);_0x1dfcc5[_0xf7da('0x33')]=_[_0xf7da('0x34')](_0x23a27e[_0xf7da('0x2d')],qs['fields'](_0x258c74[_0xf7da('0x31')][_0xf7da('0x35')]));_0x1dfcc5['attributes']=_0x1dfcc5[_0xf7da('0x33')]['length']?_0x1dfcc5[_0xf7da('0x33')]:_0x23a27e[_0xf7da('0x2d')];if(_0x258c74[_0xf7da('0x31')][_0xf7da('0x36')]){_0x1dfcc5[_0xf7da('0x37')]=[{'all':!![]}];}_0x1dfcc5=_[_0xf7da('0x38')]({},_0x1dfcc5,_0x258c74['options']);return db[_0xf7da('0x2f')][_0xf7da('0x39')](_0x1dfcc5)[_0xf7da('0x27')](handleEntityNotFound(_0xdaef0d,null))['then'](respondWithResult(_0xdaef0d,null))['catch'](handleError(_0xdaef0d,null));};exports[_0xf7da('0x3a')]=function(_0x4f5637,_0x4ec362){if(_0x4f5637['body']['id']){delete _0x4f5637['body']['id'];}return db[_0xf7da('0x2f')]['find']({'where':{'id':_0x4f5637[_0xf7da('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4ec362,null))[_0xf7da('0x27')](saveUpdates(_0x4f5637['body'],null))[_0xf7da('0x27')](respondWithResult(_0x4ec362,null))[_0xf7da('0x3c')](handleError(_0x4ec362,null));};exports[_0xf7da('0x28')]=function(_0x281fd4,_0x44f982){return db['ChatApplication'][_0xf7da('0x39')]({'where':{'id':_0x281fd4[_0xf7da('0x3b')]['id']}})[_0xf7da('0x27')](handleEntityNotFound(_0x44f982,null))[_0xf7da('0x27')](removeEntity(_0x44f982,null))[_0xf7da('0x3c')](handleError(_0x44f982,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index c2bc56c..5bab0d5 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 _0xb38e=['api','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4_unicode_ci','util'];(function(_0x24a46c,_0x2f195d){var _0x1c7990=function(_0x1723ef){while(--_0x1723ef){_0x24a46c['push'](_0x24a46c['shift']());}};_0x1c7990(++_0x2f195d);}(_0xb38e,0x1d8));var _0xeb38=function(_0x3343c8,_0x39eaa9){_0x3343c8=_0x3343c8-0x0;var _0x2374db=_0xb38e[_0x3343c8];return _0x2374db;};'use strict';var _=require('lodash');var util=require(_0xeb38('0x0'));var logger=require('../../config/logger')(_0xeb38('0x1'));var moment=require('moment');var BPromise=require(_0xeb38('0x2'));var rp=require(_0xeb38('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb38('0x4'));var config=require(_0xeb38('0x5'));var attributes=require(_0xeb38('0x6'));module[_0xeb38('0x7')]=function(_0x5238d1,_0x40f090){return _0x5238d1[_0xeb38('0x8')](_0xeb38('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xeb38('0xa')});};
\ No newline at end of file
+var _0xe489=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','./chatApplication.attributes','define','ChatApplication'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe489,0x9e));var _0x9e48=function(_0x33b669,_0x451958){_0x33b669=_0x33b669-0x0;var _0x3d13d0=_0xe489[_0x33b669];return _0x3d13d0;};'use strict';var _=require(_0x9e48('0x0'));var util=require(_0x9e48('0x1'));var logger=require('../../config/logger')(_0x9e48('0x2'));var moment=require(_0x9e48('0x3'));var BPromise=require(_0x9e48('0x4'));var rp=require(_0x9e48('0x5'));var fs=require('fs');var path=require(_0x9e48('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9e48('0x7'));module['exports']=function(_0x9b6c19,_0x42747f){return _0x9b6c19[_0x9e48('0x8')](_0x9e48('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9e48('0xa'),'collate':_0x9e48('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 333c65b..176e3e9 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 _0x8e34=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x7874e7,_0x2c4b42){var _0x29db49=function(_0x493b72){while(--_0x493b72){_0x7874e7['push'](_0x7874e7['shift']());}};_0x29db49(++_0x2c4b42);}(_0x8e34,0x73));var _0x48e3=function(_0x12322a,_0x5f99ae){_0x12322a=_0x12322a-0x0;var _0x25bc57=_0x8e34[_0x12322a];return _0x25bc57;};'use strict';var _=require(_0x48e3('0x0'));var util=require(_0x48e3('0x1'));var moment=require(_0x48e3('0x2'));var BPromise=require(_0x48e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48e3('0x4'));var db=require(_0x48e3('0x5'))['db'];var utils=require(_0x48e3('0x6'));var logger=require(_0x48e3('0x7'))(_0x48e3('0x8'));var config=require(_0x48e3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x48e3('0xa')][_0x48e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe78a,_0x152a16,_0x5cd6af){return new BPromise(function(_0x149111,_0x49f7e5){return client[_0x48e3('0xc')](_0xe78a,_0x5cd6af)['then'](function(_0x598a24){logger[_0x48e3('0xd')](_0x48e3('0xe'),_0x152a16,_0x48e3('0xf'));logger[_0x48e3('0x10')](_0x48e3('0x11'),_0x152a16,_0x48e3('0xf'),JSON[_0x48e3('0x12')](_0x598a24));if(_0x598a24[_0x48e3('0x13')]){if(_0x598a24['error']['code']===0x1f4){logger[_0x48e3('0x13')](_0x48e3('0xe'),_0x152a16,_0x598a24[_0x48e3('0x13')][_0x48e3('0x14')]);return _0x49f7e5(_0x598a24[_0x48e3('0x13')][_0x48e3('0x14')]);}logger[_0x48e3('0x13')](_0x48e3('0xe'),_0x152a16,_0x598a24[_0x48e3('0x13')]['message']);return _0x149111(_0x598a24[_0x48e3('0x13')][_0x48e3('0x14')]);}else{logger[_0x48e3('0xd')]('ChatApplication,\x20%s,\x20%s',_0x152a16,_0x48e3('0xf'));_0x149111(_0x598a24[_0x48e3('0x15')][_0x48e3('0x14')]);}})[_0x48e3('0x16')](function(_0x5a8dc5){logger[_0x48e3('0x13')](_0x48e3('0xe'),_0x152a16,_0x5a8dc5);_0x49f7e5(_0x5a8dc5);});});}
\ No newline at end of file
+var _0xaf21=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0xed0012,_0x2d512a){var _0x511415=function(_0x45e806){while(--_0x45e806){_0xed0012['push'](_0xed0012['shift']());}};_0x511415(++_0x2d512a);}(_0xaf21,0x16e));var _0x1af2=function(_0x550e3b,_0x40a6b4){_0x550e3b=_0x550e3b-0x0;var _0x473a74=_0xaf21[_0x550e3b];return _0x473a74;};'use strict';var _=require(_0x1af2('0x0'));var util=require(_0x1af2('0x1'));var moment=require(_0x1af2('0x2'));var BPromise=require(_0x1af2('0x3'));var rs=require(_0x1af2('0x4'));var fs=require('fs');var Redis=require(_0x1af2('0x5'));var db=require(_0x1af2('0x6'))['db'];var utils=require(_0x1af2('0x7'));var logger=require(_0x1af2('0x8'))(_0x1af2('0x9'));var config=require(_0x1af2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1af2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55b545,_0xbc9b01,_0x5b0607){return new BPromise(function(_0x37c59d,_0x52a5bf){return client['request'](_0x55b545,_0x5b0607)['then'](function(_0x5c12ba){logger['info'](_0x1af2('0xc'),_0xbc9b01,_0x1af2('0xd'));logger[_0x1af2('0xe')](_0x1af2('0xf'),_0xbc9b01,_0x1af2('0xd'),JSON['stringify'](_0x5c12ba));if(_0x5c12ba[_0x1af2('0x10')]){if(_0x5c12ba[_0x1af2('0x10')][_0x1af2('0x11')]===0x1f4){logger[_0x1af2('0x10')]('ChatApplication,\x20%s,\x20%s',_0xbc9b01,_0x5c12ba[_0x1af2('0x10')][_0x1af2('0x12')]);return _0x52a5bf(_0x5c12ba[_0x1af2('0x10')][_0x1af2('0x12')]);}logger[_0x1af2('0x10')]('ChatApplication,\x20%s,\x20%s',_0xbc9b01,_0x5c12ba[_0x1af2('0x10')][_0x1af2('0x12')]);return _0x37c59d(_0x5c12ba[_0x1af2('0x10')]['message']);}else{logger['info'](_0x1af2('0xc'),_0xbc9b01,'request\x20sent');_0x37c59d(_0x5c12ba['result'][_0x1af2('0x12')]);}})[_0x1af2('0x13')](function(_0x2330ad){logger[_0x1af2('0x10')]('ChatApplication,\x20%s,\x20%s',_0xbc9b01,_0x2330ad);_0x52a5bf(_0x2330ad);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index c649af2..58fb994 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 _0x96f4=['./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1c72b8,_0x104b7e){var _0x191114=function(_0x5d76da){while(--_0x5d76da){_0x1c72b8['push'](_0x1c72b8['shift']());}};_0x191114(++_0x104b7e);}(_0x96f4,0x15e));var _0x496f=function(_0x57cc22,_0x2d351f){_0x57cc22=_0x57cc22-0x0;var _0x6f7bdc=_0x96f4[_0x57cc22];return _0x6f7bdc;};'use strict';var multer=require('multer');var util=require(_0x496f('0x0'));var path=require(_0x496f('0x1'));var timeout=require(_0x496f('0x2'));var express=require('express');var router=express[_0x496f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x496f('0x4'));var interaction=require(_0x496f('0x5'));var config=require(_0x496f('0x6'));var controller=require(_0x496f('0x7'));router[_0x496f('0x8')](_0x496f('0x9'),auth[_0x496f('0xa')](),controller[_0x496f('0xb')]);router[_0x496f('0xc')](_0x496f('0x9'),auth[_0x496f('0xa')](),controller[_0x496f('0xd')]);router[_0x496f('0xe')]('/:id',auth[_0x496f('0xa')](),controller[_0x496f('0xf')]);module[_0x496f('0x10')]=router;
\ No newline at end of file
+var _0x7c0a=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy','exports','path','connect-timeout','express'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x7c0a,0x1ed));var _0xa7c0=function(_0x4560a1,_0x4bab97){_0x4560a1=_0x4560a1-0x0;var _0x4bab23=_0x7c0a[_0x4560a1];return _0x4bab23;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa7c0('0x0'));var timeout=require(_0xa7c0('0x1'));var express=require(_0xa7c0('0x2'));var router=express[_0xa7c0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa7c0('0x4'));var interaction=require(_0xa7c0('0x5'));var config=require(_0xa7c0('0x6'));var controller=require(_0xa7c0('0x7'));router[_0xa7c0('0x8')](_0xa7c0('0x9'),auth[_0xa7c0('0xa')](),controller[_0xa7c0('0xb')]);router[_0xa7c0('0xc')](_0xa7c0('0x9'),auth[_0xa7c0('0xa')](),controller['update']);router[_0xa7c0('0xd')](_0xa7c0('0x9'),auth[_0xa7c0('0xa')](),controller[_0xa7c0('0xe')]);module[_0xa7c0('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index bf58860..f72d840 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 _0xf494=['STRING','BOOLEAN','sequelize','exports'];(function(_0x8d9185,_0xbc4093){var _0x40c6f5=function(_0x6519a8){while(--_0x6519a8){_0x8d9185['push'](_0x8d9185['shift']());}};_0x40c6f5(++_0xbc4093);}(_0xf494,0x1c6));var _0x4f49=function(_0x54dc07,_0x1c0445){_0x54dc07=_0x54dc07-0x0;var _0x3bbd21=_0xf494[_0x54dc07];return _0x3bbd21;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x4f49('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1a3b=['exports','STRING','BOOLEAN','sequelize'];(function(_0x2120f1,_0x5a524c){var _0x2e7ebb=function(_0xb59ff4){while(--_0xb59ff4){_0x2120f1['push'](_0x2120f1['shift']());}};_0x2e7ebb(++_0x5a524c);}(_0x1a3b,0x83));var _0xb1a3=function(_0x4f6148,_0x21bb49){_0x4f6148=_0x4f6148-0x0;var _0x5920f3=_0x1a3b[_0x4f6148];return _0x5920f3;};'use strict';var Sequelize=require(_0xb1a3('0x0'));module[_0xb1a3('0x1')]={'name':{'type':Sequelize[_0xb1a3('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xb1a3('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index ae061f3..3dc9702 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 _0x7169=['ChatGroup','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send'];(function(_0x4d93cd,_0x3dcf49){var _0x71b7f8=function(_0x4da677){while(--_0x4da677){_0x4d93cd['push'](_0x4d93cd['shift']());}};_0x71b7f8(++_0x3dcf49);}(_0x7169,0x92));var _0x9716=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x7169[_0x58afd5];return _0x3e503b;};'use strict';var emlformat=require(_0x9716('0x0'));var rimraf=require(_0x9716('0x1'));var zipdir=require(_0x9716('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9716('0x3'));var moment=require(_0x9716('0x4'));var BPromise=require(_0x9716('0x5'));var Mustache=require(_0x9716('0x6'));var util=require('util');var path=require(_0x9716('0x7'));var sox=require('sox');var csv=require(_0x9716('0x8'));var ejs=require(_0x9716('0x9'));var fs=require('fs');var fs_extra=require(_0x9716('0xa'));var _=require(_0x9716('0xb'));var squel=require(_0x9716('0xc'));var crypto=require(_0x9716('0xd'));var jsforce=require(_0x9716('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9716('0x8'));var querystring=require(_0x9716('0xf'));var Papa=require('papaparse');var Redis=require(_0x9716('0x10'));var authService=require(_0x9716('0x11'));var qs=require(_0x9716('0x12'));var as=require(_0x9716('0x13'));var hardwareService=require(_0x9716('0x14'));var logger=require('../../config/logger')(_0x9716('0x15'));var utils=require(_0x9716('0x16'));var config=require(_0x9716('0x17'));var licenseUtil=require(_0x9716('0x18'));var db=require(_0x9716('0x19'))['db'];config[_0x9716('0x1a')]=_['defaults'](config['redis'],{'host':_0x9716('0x1b'),'port':0x18eb});var socket=require(_0x9716('0x1c'))(new Redis(config[_0x9716('0x1a')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x3237cb,_0x4618dc){_0x4618dc=_0x4618dc||0xcc;return function(_0x21b2f5){if(_0x21b2f5){return _0x3237cb['sendStatus'](_0x4618dc);}return _0x3237cb['status'](_0x4618dc)[_0x9716('0x1d')]();};}function respondWithResult(_0x1639af,_0x11f94c){_0x11f94c=_0x11f94c||0xc8;return function(_0x514abb){if(_0x514abb){return _0x1639af[_0x9716('0x1e')](_0x11f94c)[_0x9716('0x1f')](_0x514abb);}};}function respondWithFilteredResult(_0x4c0585,_0x35fd0a){return function(_0x4d9b68){if(_0x4d9b68){var _0x47cf32=typeof _0x35fd0a[_0x9716('0x20')]===_0x9716('0x21')&&typeof _0x35fd0a[_0x9716('0x22')]==='undefined';var _0x243ebd=_0x4d9b68[_0x9716('0x23')];var _0x31fed7=_0x47cf32?0x0:_0x35fd0a[_0x9716('0x20')];var _0x30c3f1=_0x47cf32?_0x4d9b68[_0x9716('0x23')]:_0x35fd0a[_0x9716('0x20')]+_0x35fd0a[_0x9716('0x22')];var _0x39e8ee;if(_0x30c3f1>=_0x243ebd){_0x30c3f1=_0x243ebd;_0x39e8ee=0xc8;}else{_0x39e8ee=0xce;}_0x4c0585[_0x9716('0x1e')](_0x39e8ee);return _0x4c0585[_0x9716('0x24')](_0x9716('0x25'),_0x31fed7+'-'+_0x30c3f1+'/'+_0x243ebd)[_0x9716('0x1f')](_0x4d9b68);}return null;};}function patchUpdates(_0x26e853){return function(_0x24a0a7){try{jsonpatch[_0x9716('0x26')](_0x24a0a7,_0x26e853,!![]);}catch(_0x5bb22b){return BPromise[_0x9716('0x27')](_0x5bb22b);}return _0x24a0a7[_0x9716('0x28')]();};}function saveUpdates(_0x407e56,_0x55568f){return function(_0x19fcc1){if(_0x19fcc1){return _0x19fcc1[_0x9716('0x29')](_0x407e56)['then'](function(_0x53acc2){return _0x53acc2;});}return null;};}function removeEntity(_0x2b36a6,_0x3280d0){return function(_0x3f8fcb){if(_0x3f8fcb){return _0x3f8fcb['destroy']()[_0x9716('0x2a')](function(){_0x2b36a6[_0x9716('0x1e')](0xcc)[_0x9716('0x1d')]();});}};}function handleEntityNotFound(_0x4507f0,_0x5cbe52){return function(_0x3768bc){if(!_0x3768bc){_0x4507f0[_0x9716('0x2b')](0x194);}return _0x3768bc;};}function handleError(_0x3295ae,_0x10bc33){_0x10bc33=_0x10bc33||0x1f4;return function(_0x3e2760){logger[_0x9716('0x2c')](_0x3e2760[_0x9716('0x2d')]);if(_0x3e2760[_0x9716('0x2e')]){delete _0x3e2760[_0x9716('0x2e')];}_0x3295ae[_0x9716('0x1e')](_0x10bc33)[_0x9716('0x2f')](_0x3e2760);};}exports['index']=function(_0x528e3e,_0x4a9196){var _0x13d1e2={},_0x397ba2={},_0x98d4b1={'count':0x0,'rows':[]};var _0x5ae329=_['map'](db[_0x9716('0x30')][_0x9716('0x31')],function(_0x921e04){return{'name':_0x921e04['fieldName'],'type':_0x921e04[_0x9716('0x32')][_0x9716('0x33')]};});_0x397ba2[_0x9716('0x34')]=_[_0x9716('0x35')](_0x5ae329,_0x9716('0x2e'));_0x397ba2[_0x9716('0x36')]=_[_0x9716('0x37')](_0x528e3e['query']);_0x397ba2[_0x9716('0x38')]=_[_0x9716('0x39')](_0x397ba2[_0x9716('0x34')],_0x397ba2[_0x9716('0x36')]);_0x13d1e2[_0x9716('0x3a')]=_[_0x9716('0x39')](_0x397ba2[_0x9716('0x34')],qs[_0x9716('0x3b')](_0x528e3e[_0x9716('0x36')][_0x9716('0x3b')]));_0x13d1e2['attributes']=_0x13d1e2['attributes'][_0x9716('0x3c')]?_0x13d1e2['attributes']:_0x397ba2[_0x9716('0x34')];if(!_0x528e3e[_0x9716('0x36')][_0x9716('0x3d')](_0x9716('0x3e'))){_0x13d1e2[_0x9716('0x22')]=qs[_0x9716('0x22')](_0x528e3e[_0x9716('0x36')][_0x9716('0x22')]);_0x13d1e2[_0x9716('0x20')]=qs[_0x9716('0x20')](_0x528e3e[_0x9716('0x36')][_0x9716('0x20')]);}_0x13d1e2[_0x9716('0x3f')]=qs['sort'](_0x528e3e[_0x9716('0x36')][_0x9716('0x40')]);_0x13d1e2[_0x9716('0x41')]=qs[_0x9716('0x38')](_[_0x9716('0x42')](_0x528e3e[_0x9716('0x36')],_0x397ba2[_0x9716('0x38')]),_0x5ae329);if(_0x528e3e[_0x9716('0x36')][_0x9716('0x43')]){_0x13d1e2['where']=_[_0x9716('0x44')](_0x13d1e2[_0x9716('0x41')],{'$or':_[_0x9716('0x35')](_0x5ae329,function(_0xd5a7b6){if(_0xd5a7b6[_0x9716('0x32')]!==_0x9716('0x45')){var _0x4670df={};_0x4670df[_0xd5a7b6['name']]={'$like':'%'+_0x528e3e[_0x9716('0x36')][_0x9716('0x43')]+'%'};return _0x4670df;}})});}_0x13d1e2=_[_0x9716('0x44')]({},_0x13d1e2,_0x528e3e[_0x9716('0x46')]);var _0x2278a3={'where':_0x13d1e2[_0x9716('0x41')]};return db[_0x9716('0x30')][_0x9716('0x23')](_0x2278a3)['then'](function(_0x45343d){_0x98d4b1[_0x9716('0x23')]=_0x45343d;if(_0x528e3e[_0x9716('0x36')]['includeAll']){_0x13d1e2[_0x9716('0x47')]=[{'all':!![]}];}return db['ChatGroup'][_0x9716('0x48')](_0x13d1e2);})[_0x9716('0x2a')](function(_0x4999cf){_0x98d4b1[_0x9716('0x49')]=_0x4999cf;return _0x98d4b1;})[_0x9716('0x2a')](respondWithFilteredResult(_0x4a9196,_0x13d1e2))[_0x9716('0x4a')](handleError(_0x4a9196,null));};exports['show']=function(_0x480de8,_0xc2edf7){var _0x253d3e={'raw':!![],'where':{'id':_0x480de8[_0x9716('0x4b')]['id']}},_0x140f1a={};_0x140f1a[_0x9716('0x34')]=_['keys'](db[_0x9716('0x30')][_0x9716('0x31')]);_0x140f1a['query']=_[_0x9716('0x37')](_0x480de8[_0x9716('0x36')]);_0x140f1a[_0x9716('0x38')]=_[_0x9716('0x39')](_0x140f1a['model'],_0x140f1a[_0x9716('0x36')]);_0x253d3e[_0x9716('0x3a')]=_['intersection'](_0x140f1a[_0x9716('0x34')],qs[_0x9716('0x3b')](_0x480de8['query']['fields']));_0x253d3e[_0x9716('0x3a')]=_0x253d3e[_0x9716('0x3a')][_0x9716('0x3c')]?_0x253d3e[_0x9716('0x3a')]:_0x140f1a[_0x9716('0x34')];if(_0x480de8[_0x9716('0x36')][_0x9716('0x4c')]){_0x253d3e[_0x9716('0x47')]=[{'all':!![]}];}_0x253d3e=_[_0x9716('0x44')]({},_0x253d3e,_0x480de8[_0x9716('0x46')]);return db[_0x9716('0x30')][_0x9716('0x4d')](_0x253d3e)['then'](handleEntityNotFound(_0xc2edf7,null))[_0x9716('0x2a')](respondWithResult(_0xc2edf7,null))[_0x9716('0x4a')](handleError(_0xc2edf7,null));};exports['create']=function(_0x3b458a,_0x24a59a){return db[_0x9716('0x30')][_0x9716('0x4e')](_0x3b458a[_0x9716('0x4f')],{})[_0x9716('0x2a')](respondWithResult(_0x24a59a,0xc9))['catch'](handleError(_0x24a59a,null));};exports[_0x9716('0x29')]=function(_0x111922,_0x58be10){if(_0x111922[_0x9716('0x4f')]['id']){delete _0x111922[_0x9716('0x4f')]['id'];}return db[_0x9716('0x30')][_0x9716('0x4d')]({'where':{'id':_0x111922[_0x9716('0x4b')]['id']}})['then'](handleEntityNotFound(_0x58be10,null))[_0x9716('0x2a')](saveUpdates(_0x111922[_0x9716('0x4f')],null))['then'](respondWithResult(_0x58be10,null))[_0x9716('0x4a')](handleError(_0x58be10,null));};exports['destroy']=function(_0x26b18b,_0x2353e3){return db[_0x9716('0x30')]['find']({'where':{'id':_0x26b18b[_0x9716('0x4b')]['id']}})[_0x9716('0x2a')](handleEntityNotFound(_0x2353e3,null))[_0x9716('0x2a')](removeEntity(_0x2353e3,null))[_0x9716('0x4a')](handleError(_0x2353e3,null));};exports[_0x9716('0x50')]=function(_0x3a12af,_0xf218f6){return db[_0x9716('0x30')][_0x9716('0x50')]()[_0x9716('0x2a')](respondWithResult(_0xf218f6,null))['catch'](handleError(_0xf218f6,null));};exports[_0x9716('0x51')]=function(_0x3a55ab,_0x57b258,_0x1da6e8){return db[_0x9716('0x52')]['count']({'where':{'ChatGroupId':_0x3a55ab[_0x9716('0x4b')]['id'],'ToId':_0x3a55ab['user']['id'],'read':![]}})[_0x9716('0x2a')](function(_0x52e2b7){return{'id':_[_0x9716('0x53')](_0x3a55ab[_0x9716('0x4b')]['id']),'count':_0x52e2b7};})[_0x9716('0x2a')](respondWithResult(_0x57b258,null))[_0x9716('0x4a')](handleError(_0x57b258,null));};exports[_0x9716('0x54')]=function(_0x28ee27,_0x5029d4,_0xcb82b4){return db[_0x9716('0x30')][_0x9716('0x4d')]({'where':{'id':_0x28ee27[_0x9716('0x4b')]['id']}})[_0x9716('0x2a')](handleEntityNotFound(_0x5029d4,null))['then'](function(_0x280a55){if(_0x280a55){return _0x280a55[_0x9716('0x54')](_0x28ee27['body'][_0x9716('0x55')],_['omit'](_0x28ee27[_0x9716('0x4f')],[_0x9716('0x55'),'id'])||{});}})[_0x9716('0x2a')](respondWithResult(_0x5029d4,null))[_0x9716('0x4a')](handleError(_0x5029d4,null));};exports[_0x9716('0x56')]=function(_0x48b982,_0x5dc396,_0x2bbd10){var _0x1a8706={};var _0x33df3f={};var _0x2837a5;var _0x379e97;return db[_0x9716('0x30')][_0x9716('0x57')]({'where':{'id':_0x48b982[_0x9716('0x4b')]['id']}})[_0x9716('0x2a')](handleEntityNotFound(_0x5dc396,null))[_0x9716('0x2a')](function(_0x3c8871){if(_0x3c8871){_0x2837a5=_0x3c8871;_0x33df3f[_0x9716('0x34')]=_[_0x9716('0x37')](db[_0x9716('0x58')][_0x9716('0x31')]);_0x33df3f['query']=_[_0x9716('0x37')](_0x48b982[_0x9716('0x36')]);_0x33df3f['filters']=_['intersection'](_0x33df3f[_0x9716('0x34')],_0x33df3f['query']);_0x1a8706[_0x9716('0x3a')]=_[_0x9716('0x39')](_0x33df3f[_0x9716('0x34')],qs[_0x9716('0x3b')](_0x48b982[_0x9716('0x36')][_0x9716('0x3b')]));_0x1a8706[_0x9716('0x3a')]=_0x1a8706[_0x9716('0x3a')][_0x9716('0x3c')]?_0x1a8706[_0x9716('0x3a')]:_0x33df3f[_0x9716('0x34')];_0x1a8706[_0x9716('0x3f')]=qs[_0x9716('0x40')](_0x48b982[_0x9716('0x36')][_0x9716('0x40')]);_0x1a8706[_0x9716('0x41')]=qs[_0x9716('0x38')](_['pick'](_0x48b982[_0x9716('0x36')],_0x33df3f['filters']));if(_0x48b982[_0x9716('0x36')]['filter']){_0x1a8706['where']=_[_0x9716('0x44')](_0x1a8706[_0x9716('0x41')],{'$or':_[_0x9716('0x35')](_0x1a8706[_0x9716('0x3a')],function(_0x120d3a){var _0x1765a9={};_0x1765a9[_0x120d3a]={'$like':'%'+_0x48b982['query'][_0x9716('0x43')]+'%'};return _0x1765a9;})});}_0x1a8706=_['merge']({},_0x1a8706,_0x48b982['options']);return _0x2837a5[_0x9716('0x56')](_0x1a8706);}})[_0x9716('0x2a')](function(_0x285068){if(_0x285068){_0x379e97=_0x285068[_0x9716('0x3c')];if(!_0x48b982[_0x9716('0x36')][_0x9716('0x3d')](_0x9716('0x3e'))){_0x1a8706['limit']=qs[_0x9716('0x22')](_0x48b982[_0x9716('0x36')][_0x9716('0x22')]);_0x1a8706[_0x9716('0x20')]=qs['offset'](_0x48b982[_0x9716('0x36')][_0x9716('0x20')]);}return _0x2837a5[_0x9716('0x56')](_0x1a8706);}})[_0x9716('0x2a')](function(_0x4042b0){if(_0x4042b0){return _0x4042b0?{'count':_0x379e97,'rows':_0x4042b0}:null;}})[_0x9716('0x2a')](respondWithResult(_0x5dc396,null))['catch'](handleError(_0x5dc396,null));};exports[_0x9716('0x59')]=function(_0x4e0a2c,_0x10a430,_0x4a89ea){return db[_0x9716('0x30')]['find']({'where':{'id':_0x4e0a2c[_0x9716('0x4b')]['id']}})['then'](handleEntityNotFound(_0x10a430,null))['then'](function(_0x34182c){if(_0x34182c){return _0x34182c[_0x9716('0x59')](_0x4e0a2c[_0x9716('0x36')][_0x9716('0x55')]);}})[_0x9716('0x2a')](respondWithStatusCode(_0x10a430,null))['catch'](handleError(_0x10a430,null));};exports[_0x9716('0x5a')]=function(_0x4bccf7,_0x24507f,_0x38d5ed){if(_0x4bccf7[_0x9716('0x4f')]['id']){delete _0x4bccf7[_0x9716('0x4f')]['id'];}return db['ChatGroup'][_0x9716('0x4d')]({'where':{'id':_0x4bccf7[_0x9716('0x4b')]['id']}})[_0x9716('0x2a')](handleEntityNotFound(_0x24507f,null))['then'](function(_0x34d2f1){if(_0x34d2f1){_0x4bccf7['body'][_0x9716('0x5b')]=_0x34d2f1['id'];return db[_0x9716('0x52')][_0x9716('0x4e')](_0x4bccf7[_0x9716('0x4f')]);}})[_0x9716('0x2a')](respondWithResult(_0x24507f,null))[_0x9716('0x4a')](handleError(_0x24507f,null));};exports[_0x9716('0x5c')]=function(_0x3c38aa,_0x52e50c,_0x55f544){var _0x5133fc={};var _0x568bf3={};var _0x392b5c;var _0x5e8c59;return db[_0x9716('0x30')][_0x9716('0x57')]({'where':{'id':_0x3c38aa['params']['id']}})['then'](handleEntityNotFound(_0x52e50c,null))[_0x9716('0x2a')](function(_0x32d56e){if(_0x32d56e){_0x392b5c=_0x32d56e;_0x568bf3[_0x9716('0x34')]=_[_0x9716('0x37')](db[_0x9716('0x52')][_0x9716('0x31')]);_0x568bf3['query']=_[_0x9716('0x37')](_0x3c38aa[_0x9716('0x36')]);_0x568bf3[_0x9716('0x38')]=_[_0x9716('0x39')](_0x568bf3[_0x9716('0x34')],_0x568bf3['query']);_0x5133fc[_0x9716('0x3a')]=_['intersection'](_0x568bf3[_0x9716('0x34')],qs[_0x9716('0x3b')](_0x3c38aa['query'][_0x9716('0x3b')]));_0x5133fc[_0x9716('0x3a')]=_0x5133fc[_0x9716('0x3a')]['length']?_0x5133fc[_0x9716('0x3a')]:_0x568bf3[_0x9716('0x34')];_0x5133fc[_0x9716('0x3f')]=qs[_0x9716('0x40')](_0x3c38aa['query']['sort']);_0x5133fc[_0x9716('0x41')]=qs[_0x9716('0x38')](_['pick'](_0x3c38aa['query'],_0x568bf3['filters']));if(_0x3c38aa['query'][_0x9716('0x43')]){_0x5133fc['where']=_[_0x9716('0x44')](_0x5133fc['where'],{'$or':_[_0x9716('0x35')](_0x5133fc[_0x9716('0x3a')],function(_0x5f19bd){var _0x48040a={};_0x48040a[_0x5f19bd]={'$like':'%'+_0x3c38aa[_0x9716('0x36')][_0x9716('0x43')]+'%'};return _0x48040a;})});}if(_0x3c38aa[_0x9716('0x36')][_0x9716('0x5d')]){var _0x50a170=_0x3c38aa[_0x9716('0x36')][_0x9716('0x5d')][_0x9716('0x5e')](',');var _0x773200={};_0x773200[_0x50a170[0x0]]={'$gte':moment(_0x50a170[0x1])[_0x9716('0x5f')](_0x9716('0x60'))};_0x5133fc['where']=_[_0x9716('0x44')](_0x5133fc[_0x9716('0x41')],_0x773200);}_0x5133fc=_[_0x9716('0x44')]({},_0x5133fc,_0x3c38aa[_0x9716('0x46')]);return _0x392b5c[_0x9716('0x5c')](_0x5133fc);}})[_0x9716('0x2a')](function(_0x2158fe){if(_0x2158fe){_0x5e8c59=_0x2158fe[_0x9716('0x3c')];if(!_0x3c38aa['query'][_0x9716('0x3d')](_0x9716('0x3e'))){_0x5133fc['limit']=qs['limit'](_0x3c38aa['query'][_0x9716('0x22')]);_0x5133fc[_0x9716('0x20')]=qs[_0x9716('0x20')](_0x3c38aa[_0x9716('0x36')][_0x9716('0x20')]);}return _0x392b5c[_0x9716('0x5c')](_0x5133fc);}})[_0x9716('0x2a')](function(_0x34a2d1){if(_0x34a2d1){return _0x34a2d1?{'count':_0x5e8c59,'rows':_0x34a2d1}:null;}})[_0x9716('0x2a')](respondWithResult(_0x52e50c,null))[_0x9716('0x4a')](handleError(_0x52e50c,null));};
\ No newline at end of file
+var _0x031b=['create','body','describe','user','toInteger','addMembers','omit','getMembers','User','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','ChatGroup','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0x031b,0x1ef));var _0xb031=function(_0x26a4ae,_0x47d1e6){_0x26a4ae=_0x26a4ae-0x0;var _0x123384=_0x031b[_0x26a4ae];return _0x123384;};'use strict';var emlformat=require(_0xb031('0x0'));var rimraf=require(_0xb031('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb031('0x2'));var rp=require(_0xb031('0x3'));var moment=require(_0xb031('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb031('0x5'));var util=require('util');var path=require(_0xb031('0x6'));var sox=require(_0xb031('0x7'));var csv=require(_0xb031('0x8'));var ejs=require(_0xb031('0x9'));var fs=require('fs');var fs_extra=require(_0xb031('0xa'));var _=require(_0xb031('0xb'));var squel=require(_0xb031('0xc'));var crypto=require(_0xb031('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb031('0xe'));var Papa=require(_0xb031('0xf'));var Redis=require(_0xb031('0x10'));var authService=require(_0xb031('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb031('0x12'))(_0xb031('0x13'));var utils=require(_0xb031('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb031('0x15'));var db=require(_0xb031('0x16'))['db'];config['redis']=_[_0xb031('0x17')](config[_0xb031('0x18')],{'host':_0xb031('0x19'),'port':0x18eb});var socket=require(_0xb031('0x1a'))(new Redis(config[_0xb031('0x18')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x282a9c,_0x24a005){_0x24a005=_0x24a005||0xcc;return function(_0x2dc8d8){if(_0x2dc8d8){return _0x282a9c[_0xb031('0x1b')](_0x24a005);}return _0x282a9c[_0xb031('0x1c')](_0x24a005)[_0xb031('0x1d')]();};}function respondWithResult(_0x343b19,_0x536771){_0x536771=_0x536771||0xc8;return function(_0x100c4f){if(_0x100c4f){return _0x343b19[_0xb031('0x1c')](_0x536771)['json'](_0x100c4f);}};}function respondWithFilteredResult(_0x2efe7c,_0x67fbcd){return function(_0x2e14e4){if(_0x2e14e4){var _0x4d3ce0=typeof _0x67fbcd['offset']===_0xb031('0x1e')&&typeof _0x67fbcd['limit']===_0xb031('0x1e');var _0x25f3f3=_0x2e14e4[_0xb031('0x1f')];var _0x5c06cb=_0x4d3ce0?0x0:_0x67fbcd[_0xb031('0x20')];var _0x3128d2=_0x4d3ce0?_0x2e14e4[_0xb031('0x1f')]:_0x67fbcd[_0xb031('0x20')]+_0x67fbcd[_0xb031('0x21')];var _0x528b53;if(_0x3128d2>=_0x25f3f3){_0x3128d2=_0x25f3f3;_0x528b53=0xc8;}else{_0x528b53=0xce;}_0x2efe7c['status'](_0x528b53);return _0x2efe7c['set'](_0xb031('0x22'),_0x5c06cb+'-'+_0x3128d2+'/'+_0x25f3f3)[_0xb031('0x23')](_0x2e14e4);}return null;};}function patchUpdates(_0x2dc5a6){return function(_0x142064){try{jsonpatch[_0xb031('0x24')](_0x142064,_0x2dc5a6,!![]);}catch(_0x2c2512){return BPromise['reject'](_0x2c2512);}return _0x142064[_0xb031('0x25')]();};}function saveUpdates(_0x427641,_0x47f22c){return function(_0x512cd4){if(_0x512cd4){return _0x512cd4[_0xb031('0x26')](_0x427641)[_0xb031('0x27')](function(_0x553700){return _0x553700;});}return null;};}function removeEntity(_0x31b9d8,_0x3fdb7e){return function(_0x4a3b72){if(_0x4a3b72){return _0x4a3b72[_0xb031('0x28')]()['then'](function(){_0x31b9d8['status'](0xcc)[_0xb031('0x1d')]();});}};}function handleEntityNotFound(_0x30cecd,_0x46a0de){return function(_0x2afb97){if(!_0x2afb97){_0x30cecd[_0xb031('0x1b')](0x194);}return _0x2afb97;};}function handleError(_0x1be974,_0x39dd54){_0x39dd54=_0x39dd54||0x1f4;return function(_0x356c4a){logger[_0xb031('0x29')](_0x356c4a[_0xb031('0x2a')]);if(_0x356c4a[_0xb031('0x2b')]){delete _0x356c4a[_0xb031('0x2b')];}_0x1be974['status'](_0x39dd54)[_0xb031('0x2c')](_0x356c4a);};}exports[_0xb031('0x2d')]=function(_0x30d91f,_0xeda96d){var _0x3f189a={},_0x5d0a7b={},_0x157977={'count':0x0,'rows':[]};var _0x44a5e7=_[_0xb031('0x2e')](db[_0xb031('0x2f')]['rawAttributes'],function(_0x55434b){return{'name':_0x55434b['fieldName'],'type':_0x55434b['type'][_0xb031('0x30')]};});_0x5d0a7b[_0xb031('0x31')]=_[_0xb031('0x2e')](_0x44a5e7,'name');_0x5d0a7b['query']=_[_0xb031('0x32')](_0x30d91f[_0xb031('0x33')]);_0x5d0a7b[_0xb031('0x34')]=_[_0xb031('0x35')](_0x5d0a7b[_0xb031('0x31')],_0x5d0a7b['query']);_0x3f189a['attributes']=_[_0xb031('0x35')](_0x5d0a7b[_0xb031('0x31')],qs[_0xb031('0x36')](_0x30d91f[_0xb031('0x33')][_0xb031('0x36')]));_0x3f189a[_0xb031('0x37')]=_0x3f189a[_0xb031('0x37')][_0xb031('0x38')]?_0x3f189a[_0xb031('0x37')]:_0x5d0a7b['model'];if(!_0x30d91f['query'][_0xb031('0x39')]('nolimit')){_0x3f189a[_0xb031('0x21')]=qs[_0xb031('0x21')](_0x30d91f[_0xb031('0x33')][_0xb031('0x21')]);_0x3f189a[_0xb031('0x20')]=qs[_0xb031('0x20')](_0x30d91f[_0xb031('0x33')][_0xb031('0x20')]);}_0x3f189a[_0xb031('0x3a')]=qs[_0xb031('0x3b')](_0x30d91f[_0xb031('0x33')]['sort']);_0x3f189a[_0xb031('0x3c')]=qs[_0xb031('0x34')](_[_0xb031('0x3d')](_0x30d91f[_0xb031('0x33')],_0x5d0a7b['filters']),_0x44a5e7);if(_0x30d91f[_0xb031('0x33')][_0xb031('0x3e')]){_0x3f189a[_0xb031('0x3c')]=_[_0xb031('0x3f')](_0x3f189a[_0xb031('0x3c')],{'$or':_[_0xb031('0x2e')](_0x44a5e7,function(_0x42a2fb){if(_0x42a2fb[_0xb031('0x40')]!==_0xb031('0x41')){var _0x15b3e0={};_0x15b3e0[_0x42a2fb[_0xb031('0x2b')]]={'$like':'%'+_0x30d91f[_0xb031('0x33')]['filter']+'%'};return _0x15b3e0;}})});}_0x3f189a=_['merge']({},_0x3f189a,_0x30d91f['options']);var _0x979b40={'where':_0x3f189a[_0xb031('0x3c')]};return db['ChatGroup'][_0xb031('0x1f')](_0x979b40)[_0xb031('0x27')](function(_0x45855d){_0x157977[_0xb031('0x1f')]=_0x45855d;if(_0x30d91f[_0xb031('0x33')][_0xb031('0x42')]){_0x3f189a[_0xb031('0x43')]=[{'all':!![]}];}return db[_0xb031('0x2f')][_0xb031('0x44')](_0x3f189a);})[_0xb031('0x27')](function(_0x58a51f){_0x157977[_0xb031('0x45')]=_0x58a51f;return _0x157977;})[_0xb031('0x27')](respondWithFilteredResult(_0xeda96d,_0x3f189a))[_0xb031('0x46')](handleError(_0xeda96d,null));};exports[_0xb031('0x47')]=function(_0x2f471b,_0x80d14f){var _0x11c1ec={'raw':!![],'where':{'id':_0x2f471b[_0xb031('0x48')]['id']}},_0x4e1195={};_0x4e1195[_0xb031('0x31')]=_[_0xb031('0x32')](db[_0xb031('0x2f')][_0xb031('0x49')]);_0x4e1195[_0xb031('0x33')]=_[_0xb031('0x32')](_0x2f471b['query']);_0x4e1195[_0xb031('0x34')]=_[_0xb031('0x35')](_0x4e1195[_0xb031('0x31')],_0x4e1195[_0xb031('0x33')]);_0x11c1ec[_0xb031('0x37')]=_['intersection'](_0x4e1195[_0xb031('0x31')],qs[_0xb031('0x36')](_0x2f471b[_0xb031('0x33')]['fields']));_0x11c1ec['attributes']=_0x11c1ec['attributes']['length']?_0x11c1ec['attributes']:_0x4e1195[_0xb031('0x31')];if(_0x2f471b[_0xb031('0x33')][_0xb031('0x42')]){_0x11c1ec[_0xb031('0x43')]=[{'all':!![]}];}_0x11c1ec=_['merge']({},_0x11c1ec,_0x2f471b['options']);return db['ChatGroup'][_0xb031('0x4a')](_0x11c1ec)['then'](handleEntityNotFound(_0x80d14f,null))[_0xb031('0x27')](respondWithResult(_0x80d14f,null))['catch'](handleError(_0x80d14f,null));};exports['create']=function(_0x4727c2,_0x4f117c){return db['ChatGroup'][_0xb031('0x4b')](_0x4727c2[_0xb031('0x4c')],{})[_0xb031('0x27')](respondWithResult(_0x4f117c,0xc9))[_0xb031('0x46')](handleError(_0x4f117c,null));};exports[_0xb031('0x26')]=function(_0x3dcd51,_0x433f20){if(_0x3dcd51['body']['id']){delete _0x3dcd51[_0xb031('0x4c')]['id'];}return db['ChatGroup'][_0xb031('0x4a')]({'where':{'id':_0x3dcd51[_0xb031('0x48')]['id']}})[_0xb031('0x27')](handleEntityNotFound(_0x433f20,null))['then'](saveUpdates(_0x3dcd51[_0xb031('0x4c')],null))[_0xb031('0x27')](respondWithResult(_0x433f20,null))['catch'](handleError(_0x433f20,null));};exports['destroy']=function(_0x2b0474,_0x81f1d2){return db[_0xb031('0x2f')][_0xb031('0x4a')]({'where':{'id':_0x2b0474[_0xb031('0x48')]['id']}})[_0xb031('0x27')](handleEntityNotFound(_0x81f1d2,null))[_0xb031('0x27')](removeEntity(_0x81f1d2,null))[_0xb031('0x46')](handleError(_0x81f1d2,null));};exports['describe']=function(_0x285ef2,_0x444d6c){return db['ChatGroup'][_0xb031('0x4d')]()['then'](respondWithResult(_0x444d6c,null))[_0xb031('0x46')](handleError(_0x444d6c,null));};exports['getUnread']=function(_0x5f1a1d,_0x46c8a9,_0x32a234){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x5f1a1d[_0xb031('0x48')]['id'],'ToId':_0x5f1a1d[_0xb031('0x4e')]['id'],'read':![]}})[_0xb031('0x27')](function(_0x1caf76){return{'id':_[_0xb031('0x4f')](_0x5f1a1d[_0xb031('0x48')]['id']),'count':_0x1caf76};})[_0xb031('0x27')](respondWithResult(_0x46c8a9,null))[_0xb031('0x46')](handleError(_0x46c8a9,null));};exports[_0xb031('0x50')]=function(_0x47448d,_0x3d9c87,_0x24c9eb){return db[_0xb031('0x2f')][_0xb031('0x4a')]({'where':{'id':_0x47448d[_0xb031('0x48')]['id']}})[_0xb031('0x27')](handleEntityNotFound(_0x3d9c87,null))[_0xb031('0x27')](function(_0x2ad9a6){if(_0x2ad9a6){return _0x2ad9a6[_0xb031('0x50')](_0x47448d[_0xb031('0x4c')]['ids'],_[_0xb031('0x51')](_0x47448d['body'],['ids','id'])||{});}})[_0xb031('0x27')](respondWithResult(_0x3d9c87,null))[_0xb031('0x46')](handleError(_0x3d9c87,null));};exports[_0xb031('0x52')]=function(_0x65c622,_0x856a36,_0x4b5ce4){var _0x44fd50={};var _0x5473f5={};var _0x2ff83b;var _0x15569d;return db[_0xb031('0x2f')]['findOne']({'where':{'id':_0x65c622[_0xb031('0x48')]['id']}})[_0xb031('0x27')](handleEntityNotFound(_0x856a36,null))[_0xb031('0x27')](function(_0x1c2fe6){if(_0x1c2fe6){_0x2ff83b=_0x1c2fe6;_0x5473f5[_0xb031('0x31')]=_['keys'](db[_0xb031('0x53')]['rawAttributes']);_0x5473f5['query']=_[_0xb031('0x32')](_0x65c622[_0xb031('0x33')]);_0x5473f5[_0xb031('0x34')]=_[_0xb031('0x35')](_0x5473f5[_0xb031('0x31')],_0x5473f5[_0xb031('0x33')]);_0x44fd50['attributes']=_[_0xb031('0x35')](_0x5473f5[_0xb031('0x31')],qs[_0xb031('0x36')](_0x65c622['query'][_0xb031('0x36')]));_0x44fd50[_0xb031('0x37')]=_0x44fd50[_0xb031('0x37')][_0xb031('0x38')]?_0x44fd50[_0xb031('0x37')]:_0x5473f5[_0xb031('0x31')];_0x44fd50['order']=qs[_0xb031('0x3b')](_0x65c622[_0xb031('0x33')][_0xb031('0x3b')]);_0x44fd50[_0xb031('0x3c')]=qs[_0xb031('0x34')](_[_0xb031('0x3d')](_0x65c622[_0xb031('0x33')],_0x5473f5[_0xb031('0x34')]));if(_0x65c622[_0xb031('0x33')]['filter']){_0x44fd50[_0xb031('0x3c')]=_['merge'](_0x44fd50[_0xb031('0x3c')],{'$or':_[_0xb031('0x2e')](_0x44fd50[_0xb031('0x37')],function(_0x2f791b){var _0x2f45a6={};_0x2f45a6[_0x2f791b]={'$like':'%'+_0x65c622['query'][_0xb031('0x3e')]+'%'};return _0x2f45a6;})});}_0x44fd50=_[_0xb031('0x3f')]({},_0x44fd50,_0x65c622['options']);return _0x2ff83b[_0xb031('0x52')](_0x44fd50);}})['then'](function(_0x5c572f){if(_0x5c572f){_0x15569d=_0x5c572f[_0xb031('0x38')];if(!_0x65c622['query']['hasOwnProperty'](_0xb031('0x54'))){_0x44fd50[_0xb031('0x21')]=qs['limit'](_0x65c622['query']['limit']);_0x44fd50[_0xb031('0x20')]=qs[_0xb031('0x20')](_0x65c622[_0xb031('0x33')][_0xb031('0x20')]);}return _0x2ff83b[_0xb031('0x52')](_0x44fd50);}})[_0xb031('0x27')](function(_0x9fb970){if(_0x9fb970){return _0x9fb970?{'count':_0x15569d,'rows':_0x9fb970}:null;}})[_0xb031('0x27')](respondWithResult(_0x856a36,null))[_0xb031('0x46')](handleError(_0x856a36,null));};exports[_0xb031('0x55')]=function(_0x3d6757,_0x4fba7e,_0x559202){return db[_0xb031('0x2f')][_0xb031('0x4a')]({'where':{'id':_0x3d6757[_0xb031('0x48')]['id']}})[_0xb031('0x27')](handleEntityNotFound(_0x4fba7e,null))[_0xb031('0x27')](function(_0x58018e){if(_0x58018e){return _0x58018e[_0xb031('0x55')](_0x3d6757[_0xb031('0x33')]['ids']);}})[_0xb031('0x27')](respondWithStatusCode(_0x4fba7e,null))[_0xb031('0x46')](handleError(_0x4fba7e,null));};exports[_0xb031('0x56')]=function(_0x4bd5b6,_0x3c8c49,_0x2a96ea){if(_0x4bd5b6['body']['id']){delete _0x4bd5b6[_0xb031('0x4c')]['id'];}return db[_0xb031('0x2f')][_0xb031('0x4a')]({'where':{'id':_0x4bd5b6[_0xb031('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c8c49,null))[_0xb031('0x27')](function(_0x3f28d4){if(_0x3f28d4){_0x4bd5b6['body'][_0xb031('0x57')]=_0x3f28d4['id'];return db[_0xb031('0x58')]['create'](_0x4bd5b6[_0xb031('0x4c')]);}})[_0xb031('0x27')](respondWithResult(_0x3c8c49,null))[_0xb031('0x46')](handleError(_0x3c8c49,null));};exports[_0xb031('0x59')]=function(_0x5ccf5b,_0x2ca3ef,_0x48c595){var _0x916e7d={};var _0x3832cd={};var _0x10dc7d;var _0x4b22a3;return db[_0xb031('0x2f')][_0xb031('0x5a')]({'where':{'id':_0x5ccf5b[_0xb031('0x48')]['id']}})[_0xb031('0x27')](handleEntityNotFound(_0x2ca3ef,null))[_0xb031('0x27')](function(_0x265655){if(_0x265655){_0x10dc7d=_0x265655;_0x3832cd[_0xb031('0x31')]=_[_0xb031('0x32')](db[_0xb031('0x58')][_0xb031('0x49')]);_0x3832cd[_0xb031('0x33')]=_[_0xb031('0x32')](_0x5ccf5b[_0xb031('0x33')]);_0x3832cd['filters']=_[_0xb031('0x35')](_0x3832cd[_0xb031('0x31')],_0x3832cd['query']);_0x916e7d['attributes']=_['intersection'](_0x3832cd['model'],qs[_0xb031('0x36')](_0x5ccf5b[_0xb031('0x33')][_0xb031('0x36')]));_0x916e7d['attributes']=_0x916e7d[_0xb031('0x37')][_0xb031('0x38')]?_0x916e7d[_0xb031('0x37')]:_0x3832cd['model'];_0x916e7d[_0xb031('0x3a')]=qs[_0xb031('0x3b')](_0x5ccf5b['query'][_0xb031('0x3b')]);_0x916e7d['where']=qs[_0xb031('0x34')](_[_0xb031('0x3d')](_0x5ccf5b[_0xb031('0x33')],_0x3832cd[_0xb031('0x34')]));if(_0x5ccf5b['query'][_0xb031('0x3e')]){_0x916e7d[_0xb031('0x3c')]=_[_0xb031('0x3f')](_0x916e7d[_0xb031('0x3c')],{'$or':_[_0xb031('0x2e')](_0x916e7d['attributes'],function(_0x1467e7){var _0x3eaa8f={};_0x3eaa8f[_0x1467e7]={'$like':'%'+_0x5ccf5b['query'][_0xb031('0x3e')]+'%'};return _0x3eaa8f;})});}if(_0x5ccf5b[_0xb031('0x33')]['$gte']){var _0x102345=_0x5ccf5b[_0xb031('0x33')][_0xb031('0x5b')]['split'](',');var _0x5d4af0={};_0x5d4af0[_0x102345[0x0]]={'$gte':moment(_0x102345[0x1])[_0xb031('0x5c')](_0xb031('0x5d'))};_0x916e7d[_0xb031('0x3c')]=_[_0xb031('0x3f')](_0x916e7d[_0xb031('0x3c')],_0x5d4af0);}_0x916e7d=_['merge']({},_0x916e7d,_0x5ccf5b[_0xb031('0x5e')]);return _0x10dc7d[_0xb031('0x59')](_0x916e7d);}})['then'](function(_0x4b30c6){if(_0x4b30c6){_0x4b22a3=_0x4b30c6['length'];if(!_0x5ccf5b[_0xb031('0x33')]['hasOwnProperty'](_0xb031('0x54'))){_0x916e7d['limit']=qs[_0xb031('0x21')](_0x5ccf5b[_0xb031('0x33')][_0xb031('0x21')]);_0x916e7d[_0xb031('0x20')]=qs['offset'](_0x5ccf5b[_0xb031('0x33')]['offset']);}return _0x10dc7d['getMessages'](_0x916e7d);}})[_0xb031('0x27')](function(_0x1bf7a8){if(_0x1bf7a8){return _0x1bf7a8?{'count':_0x4b22a3,'rows':_0x1bf7a8}:null;}})[_0xb031('0x27')](respondWithResult(_0x2ca3ef,null))['catch'](handleError(_0x2ca3ef,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 356112f..d7d47c3 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 _0xa46e=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0xa713ca,_0x35c118){var _0x23a3be=function(_0x531774){while(--_0x531774){_0xa713ca['push'](_0xa713ca['shift']());}};_0x23a3be(++_0x35c118);}(_0xa46e,0x8a));var _0xea46=function(_0x199c03,_0x3254aa){_0x199c03=_0x199c03-0x0;var _0x11a7d4=_0xa46e[_0x199c03];return _0x11a7d4;};'use strict';var EventEmitter=require(_0xea46('0x0'));var ChatGroup=require(_0xea46('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xea46('0x2')](0x0);var events={'afterCreate':_0xea46('0x3'),'afterUpdate':_0xea46('0x4'),'afterDestroy':'remove'};function emitEvent(_0x19f135){return function(_0x4b6e4a,_0x3a2209,_0x47d633){ChatGroupEvents[_0xea46('0x5')](_0x19f135+':'+_0x4b6e4a['id'],_0x4b6e4a);ChatGroupEvents['emit'](_0x19f135,_0x4b6e4a);_0x47d633(null);};}for(var e in events){if(events[_0xea46('0x6')](e)){var event=events[e];ChatGroup[_0xea46('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x1e20=['emit','hook','../../mysqldb','save','update','remove'];(function(_0x4b9f55,_0x50768d){var _0x3d443b=function(_0xf01582){while(--_0xf01582){_0x4b9f55['push'](_0x4b9f55['shift']());}};_0x3d443b(++_0x50768d);}(_0x1e20,0x1ac));var _0x01e2=function(_0x5257c0,_0xc2e255){_0x5257c0=_0x5257c0-0x0;var _0x5677a6=_0x1e20[_0x5257c0];return _0x5677a6;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x01e2('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x01e2('0x1'),'afterUpdate':_0x01e2('0x2'),'afterDestroy':_0x01e2('0x3')};function emitEvent(_0x1225ad){return function(_0x47b2e6,_0x7a5157,_0x4f5b5d){ChatGroupEvents[_0x01e2('0x4')](_0x1225ad+':'+_0x47b2e6['id'],_0x47b2e6);ChatGroupEvents[_0x01e2('0x4')](_0x1225ad,_0x47b2e6);_0x4f5b5d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x01e2('0x5')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 05c5c35..2efd7e3 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 _0x6957=['./chatGroup.attributes','exports','define','chat_groups','lodash','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd3bc,_0x332f04){var _0x28d039=function(_0x10b604){while(--_0x10b604){_0x3dd3bc['push'](_0x3dd3bc['shift']());}};_0x28d039(++_0x332f04);}(_0x6957,0x176));var _0x7695=function(_0x4596a9,_0x44655a){_0x4596a9=_0x4596a9-0x0;var _0x3ea3d0=_0x6957[_0x4596a9];return _0x3ea3d0;};'use strict';var _=require(_0x7695('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7695('0x1'));var BPromise=require('bluebird');var rp=require(_0x7695('0x2'));var fs=require('fs');var path=require(_0x7695('0x3'));var rimraf=require(_0x7695('0x4'));var config=require(_0x7695('0x5'));var attributes=require(_0x7695('0x6'));module[_0x7695('0x7')]=function(_0x313ced,_0x56a4cd){return _0x313ced[_0x7695('0x8')]('ChatGroup',attributes,{'tableName':_0x7695('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a16=['chat_groups','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup'];(function(_0x35b223,_0x436064){var _0x3e32b0=function(_0x5d27c1){while(--_0x5d27c1){_0x35b223['push'](_0x35b223['shift']());}};_0x3e32b0(++_0x436064);}(_0x0a16,0x19b));var _0x60a1=function(_0x106999,_0x32e943){_0x106999=_0x106999-0x0;var _0x2f8661=_0x0a16[_0x106999];return _0x2f8661;};'use strict';var _=require('lodash');var util=require(_0x60a1('0x0'));var logger=require(_0x60a1('0x1'))(_0x60a1('0x2'));var moment=require('moment');var BPromise=require(_0x60a1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x60a1('0x4'));var config=require(_0x60a1('0x5'));var attributes=require(_0x60a1('0x6'));module[_0x60a1('0x7')]=function(_0x418f10,_0x3640fb){return _0x418f10['define'](_0x60a1('0x8'),attributes,{'tableName':_0x60a1('0x9'),'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 b4f4ac1..eb99790 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 _0x0738=['http','redis','defaults','localhost','./chatGroup.socket','register','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2ffee8,_0x126cdd){var _0x432ebf=function(_0x521355){while(--_0x521355){_0x2ffee8['push'](_0x2ffee8['shift']());}};_0x432ebf(++_0x126cdd);}(_0x0738,0xb9));var _0x8073=function(_0x4920f2,_0xa4bfbf){_0x4920f2=_0x4920f2-0x0;var _0x1f27cf=_0x0738[_0x4920f2];return _0x1f27cf;};'use strict';var _=require(_0x8073('0x0'));var util=require(_0x8073('0x1'));var moment=require(_0x8073('0x2'));var BPromise=require(_0x8073('0x3'));var rs=require(_0x8073('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8073('0x5'));var logger=require(_0x8073('0x6'))(_0x8073('0x7'));var config=require(_0x8073('0x8'));var jayson=require(_0x8073('0x9'));var client=jayson[_0x8073('0xa')][_0x8073('0xb')]({'port':0x232a});config[_0x8073('0xc')]=_[_0x8073('0xd')](config[_0x8073('0xc')],{'host':_0x8073('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8073('0xf'))[_0x8073('0x10')](socket);function respondWithRpcPromise(_0x5d0760,_0x2d3df4,_0x33674f){return new BPromise(function(_0x28031e,_0x3f2c1c){return client['request'](_0x5d0760,_0x33674f)[_0x8073('0x11')](function(_0x5d0356){logger[_0x8073('0x12')]('ChatGroup,\x20%s,\x20%s',_0x2d3df4,'request\x20sent');logger[_0x8073('0x13')](_0x8073('0x14'),_0x2d3df4,'request\x20sent',JSON[_0x8073('0x15')](_0x5d0356));if(_0x5d0356[_0x8073('0x16')]){if(_0x5d0356['error'][_0x8073('0x17')]===0x1f4){logger[_0x8073('0x16')](_0x8073('0x18'),_0x2d3df4,_0x5d0356[_0x8073('0x16')]['message']);return _0x3f2c1c(_0x5d0356[_0x8073('0x16')][_0x8073('0x19')]);}logger[_0x8073('0x16')](_0x8073('0x18'),_0x2d3df4,_0x5d0356[_0x8073('0x16')][_0x8073('0x19')]);return _0x28031e(_0x5d0356['error'][_0x8073('0x19')]);}else{logger['info'](_0x8073('0x18'),_0x2d3df4,_0x8073('0x1a'));_0x28031e(_0x5d0356['result'][_0x8073('0x19')]);}})[_0x8073('0x1b')](function(_0xdb5ddf){logger[_0x8073('0x16')](_0x8073('0x18'),_0x2d3df4,_0xdb5ddf);_0x3f2c1c(_0xdb5ddf);});});}
\ No newline at end of file
+var _0xe0ae=['request\x20sent','stringify','code','error','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','socket.io-emitter','register','then','info','ChatGroup,\x20%s,\x20%s','debug'];(function(_0xd0c858,_0x296098){var _0x491d93=function(_0x1d9b8d){while(--_0x1d9b8d){_0xd0c858['push'](_0xd0c858['shift']());}};_0x491d93(++_0x296098);}(_0xe0ae,0xa1));var _0xee0a=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0xe0ae[_0x3d13bb];return _0x4b5a1b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee0a('0x0'));var BPromise=require(_0xee0a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee0a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xee0a('0x3'));var logger=require(_0xee0a('0x4'))('rpc');var config=require(_0xee0a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xee0a('0x6')]({'port':0x232a});config[_0xee0a('0x7')]=_[_0xee0a('0x8')](config[_0xee0a('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xee0a('0x9'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xee0a('0xa')](socket);function respondWithRpcPromise(_0x3d0b3f,_0xbd4483,_0x57d190){return new BPromise(function(_0x3bc0cf,_0x1a953e){return client['request'](_0x3d0b3f,_0x57d190)[_0xee0a('0xb')](function(_0x4b3e49){logger[_0xee0a('0xc')](_0xee0a('0xd'),_0xbd4483,'request\x20sent');logger[_0xee0a('0xe')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0xbd4483,_0xee0a('0xf'),JSON[_0xee0a('0x10')](_0x4b3e49));if(_0x4b3e49['error']){if(_0x4b3e49['error'][_0xee0a('0x11')]===0x1f4){logger[_0xee0a('0x12')](_0xee0a('0xd'),_0xbd4483,_0x4b3e49[_0xee0a('0x12')][_0xee0a('0x13')]);return _0x1a953e(_0x4b3e49['error'][_0xee0a('0x13')]);}logger[_0xee0a('0x12')]('ChatGroup,\x20%s,\x20%s',_0xbd4483,_0x4b3e49[_0xee0a('0x12')][_0xee0a('0x13')]);return _0x3bc0cf(_0x4b3e49[_0xee0a('0x12')][_0xee0a('0x13')]);}else{logger['info'](_0xee0a('0xd'),_0xbd4483,_0xee0a('0xf'));_0x3bc0cf(_0x4b3e49[_0xee0a('0x14')]['message']);}})[_0xee0a('0x15')](function(_0x1ffdb5){logger[_0xee0a('0x12')](_0xee0a('0xd'),_0xbd4483,_0x1ffdb5);_0x1a953e(_0x1ffdb5);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 140f08e..caff291 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 _0x1f0f=['emit','removeListener','register','chatGroup:','save','remove','update'];(function(_0x2aa48b,_0x5a4446){var _0x48caf8=function(_0x13230c){while(--_0x13230c){_0x2aa48b['push'](_0x2aa48b['shift']());}};_0x48caf8(++_0x5a4446);}(_0x1f0f,0x1ee));var _0xf1f0=function(_0xbcd28d,_0x5eaa62){_0xbcd28d=_0xbcd28d-0x0;var _0x1b86da=_0x1f0f[_0xbcd28d];return _0x1b86da;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xf1f0('0x0'),_0xf1f0('0x1'),_0xf1f0('0x2')];function createListener(_0x5961ca,_0xbc4e59){return function(_0xb9a323){_0xbc4e59[_0xf1f0('0x3')](_0x5961ca,_0xb9a323);};}function removeListener(_0x4dc8ce,_0x48d8e3){return function(){ChatGroupEvents[_0xf1f0('0x4')](_0x4dc8ce,_0x48d8e3);};}exports[_0xf1f0('0x5')]=function(_0x56383b){for(var _0x2084d7=0x0,_0x4149b0=events['length'];_0x2084d7<_0x4149b0;_0x2084d7++){var _0x49e289=events[_0x2084d7];var _0x1c2373=createListener(_0xf1f0('0x6')+_0x49e289,_0x56383b);ChatGroupEvents['on'](_0x49e289,_0x1c2373);}};
\ No newline at end of file
+var _0x61de=['remove','update','emit','removeListener','length','chatGroup:','./chatGroup.events'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x61de,0x164));var _0xe61d=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x61de[_0x4ea69d];return _0x5318e0;};'use strict';var ChatGroupEvents=require(_0xe61d('0x0'));var events=['save',_0xe61d('0x1'),_0xe61d('0x2')];function createListener(_0x11e27e,_0x473397){return function(_0x38c036){_0x473397[_0xe61d('0x3')](_0x11e27e,_0x38c036);};}function removeListener(_0x12025d,_0x2795b2){return function(){ChatGroupEvents[_0xe61d('0x4')](_0x12025d,_0x2795b2);};}exports['register']=function(_0x4215af){for(var _0x47a54d=0x0,_0x3f9070=events[_0xe61d('0x5')];_0x47a54d<_0x3f9070;_0x47a54d++){var _0x253061=events[_0x47a54d];var _0x470d69=createListener(_0xe61d('0x6')+_0x253061,_0x4215af);ChatGroupEvents['on'](_0x253061,_0x470d69);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 87432f9..c1830ae 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 _0xb80c=['addMessage','put','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','addMembers'];(function(_0x31c4cc,_0x150943){var _0x3099ee=function(_0xe3f487){while(--_0xe3f487){_0x31c4cc['push'](_0x31c4cc['shift']());}};_0x3099ee(++_0x150943);}(_0xb80c,0x1f2));var _0xcb80=function(_0x3cfa2c,_0x30b6cb){_0x3cfa2c=_0x3cfa2c-0x0;var _0x35740c=_0xb80c[_0x3cfa2c];return _0x35740c;};'use strict';var multer=require(_0xcb80('0x0'));var util=require(_0xcb80('0x1'));var path=require('path');var timeout=require(_0xcb80('0x2'));var express=require(_0xcb80('0x3'));var router=express[_0xcb80('0x4')]();var fs_extra=require(_0xcb80('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcb80('0x6'));var config=require('../../config/environment');var controller=require(_0xcb80('0x7'));router[_0xcb80('0x8')]('/',auth['isAuthenticated'](),controller[_0xcb80('0x9')]);router['get'](_0xcb80('0xa'),auth[_0xcb80('0xb')](),controller[_0xcb80('0xc')]);router[_0xcb80('0x8')](_0xcb80('0xd'),auth[_0xcb80('0xb')](),controller[_0xcb80('0xe')]);router[_0xcb80('0x8')](_0xcb80('0xf'),auth[_0xcb80('0xb')](),controller[_0xcb80('0x10')]);router[_0xcb80('0x8')](_0xcb80('0x11'),auth['isAuthenticated'](),controller[_0xcb80('0x12')]);router[_0xcb80('0x8')]('/:id/messages',auth[_0xcb80('0xb')](),controller[_0xcb80('0x13')]);router[_0xcb80('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcb80('0x14')]('/:id/members',auth['isAuthenticated'](),controller[_0xcb80('0x15')]);router[_0xcb80('0x14')]('/:id/messages',auth['isAuthenticated'](),controller[_0xcb80('0x16')]);router[_0xcb80('0x17')](_0xcb80('0xd'),auth[_0xcb80('0xb')](),controller['update']);router[_0xcb80('0x18')](_0xcb80('0xd'),auth[_0xcb80('0xb')](),controller[_0xcb80('0x19')]);router['delete']('/:id/members',auth[_0xcb80('0xb')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0xd9df=['getUnread','getMembers','getMessages','post','create','/:id/members','addMembers','/:id/messages','addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','/:id/unread'];(function(_0x36cb50,_0x59e5a5){var _0xa7b819=function(_0x50bc01){while(--_0x50bc01){_0x36cb50['push'](_0x36cb50['shift']());}};_0xa7b819(++_0x59e5a5);}(_0xd9df,0x87));var _0xfd9d=function(_0x4fb606,_0x127320){_0x4fb606=_0x4fb606-0x0;var _0x27349d=_0xd9df[_0x4fb606];return _0x27349d;};'use strict';var multer=require(_0xfd9d('0x0'));var util=require(_0xfd9d('0x1'));var path=require(_0xfd9d('0x2'));var timeout=require(_0xfd9d('0x3'));var express=require(_0xfd9d('0x4'));var router=express[_0xfd9d('0x5')]();var fs_extra=require(_0xfd9d('0x6'));var auth=require(_0xfd9d('0x7'));var interaction=require(_0xfd9d('0x8'));var config=require(_0xfd9d('0x9'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xfd9d('0xa')](),controller['index']);router[_0xfd9d('0xb')]('/describe',auth[_0xfd9d('0xa')](),controller[_0xfd9d('0xc')]);router['get'](_0xfd9d('0xd'),auth[_0xfd9d('0xa')](),controller['show']);router[_0xfd9d('0xb')](_0xfd9d('0xe'),auth[_0xfd9d('0xa')](),controller[_0xfd9d('0xf')]);router['get']('/:id/members',auth[_0xfd9d('0xa')](),controller[_0xfd9d('0x10')]);router[_0xfd9d('0xb')]('/:id/messages',auth[_0xfd9d('0xa')](),controller[_0xfd9d('0x11')]);router[_0xfd9d('0x12')]('/',auth[_0xfd9d('0xa')](),controller[_0xfd9d('0x13')]);router[_0xfd9d('0x12')](_0xfd9d('0x14'),auth[_0xfd9d('0xa')](),controller[_0xfd9d('0x15')]);router[_0xfd9d('0x12')](_0xfd9d('0x16'),auth['isAuthenticated'](),controller[_0xfd9d('0x17')]);router[_0xfd9d('0x18')](_0xfd9d('0xd'),auth[_0xfd9d('0xa')](),controller[_0xfd9d('0x19')]);router[_0xfd9d('0x1a')](_0xfd9d('0xd'),auth['isAuthenticated'](),controller[_0xfd9d('0x1b')]);router[_0xfd9d('0x1a')](_0xfd9d('0x14'),auth['isAuthenticated'](),controller[_0xfd9d('0x1c')]);module[_0xfd9d('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 5a0f50a..4a47336 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 _0xb677=['DATE','STRING','sequelize','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb677,0x119));var _0x7b67=function(_0x573654,_0x4b3f64){_0x573654=_0x573654-0x0;var _0x274d3b=_0xb677[_0x573654];return _0x274d3b;};'use strict';var Sequelize=require(_0x7b67('0x0'));module['exports']={'closed':{'type':Sequelize[_0x7b67('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7b67('0x2')]},'ratingType':{'type':Sequelize[_0x7b67('0x3')](_0x7b67('0x4'),_0x7b67('0x5')),'defaultValue':_0x7b67('0x4')},'ratingMessage':{'type':Sequelize[_0x7b67('0x6')]},'pathTranscript':{'type':Sequelize[_0x7b67('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7b67('0x7')]},'disposition':{'type':Sequelize[_0x7b67('0x8')]},'secondDisposition':{'type':Sequelize[_0x7b67('0x8')]},'thirdDisposition':{'type':Sequelize[_0x7b67('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x7b67('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x7b67('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x7b67('0x8')]},'referer':{'type':Sequelize[_0x7b67('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x7b67('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x7b67('0x7')]},'lastMsgAt':{'type':Sequelize[_0x7b67('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x7b67('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x7b67('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x7b67('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7117=['INTEGER','star','thumb','TEXT','STRING','DATE','long','ENUM','sequelize','exports','BOOLEAN'];(function(_0x16f41b,_0x5e0f92){var _0x321c3b=function(_0x5253f0){while(--_0x5253f0){_0x16f41b['push'](_0x16f41b['shift']());}};_0x321c3b(++_0x5e0f92);}(_0x7117,0x1ec));var _0x7711=function(_0x351987,_0x2ad352){_0x351987=_0x351987-0x0;var _0x4cdf93=_0x7117[_0x351987];return _0x4cdf93;};'use strict';var Sequelize=require(_0x7711('0x0'));module[_0x7711('0x1')]={'closed':{'type':Sequelize[_0x7711('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7711('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x7711('0x4'),_0x7711('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x7711('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x7711('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7711('0x8')]},'disposition':{'type':Sequelize[_0x7711('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x7711('0x7')]},'osName':{'type':Sequelize[_0x7711('0x7')]},'osVersion':{'type':Sequelize[_0x7711('0x7')]},'deviceModel':{'type':Sequelize[_0x7711('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x7711('0x7')]},'referer':{'type':Sequelize[_0x7711('0x6')]},'customerIp':{'type':Sequelize[_0x7711('0x7')]},'formData':{'type':Sequelize[_0x7711('0x6')](_0x7711('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x7711('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x7711('0xa')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x7711('0x7')]},'customerPort':{'type':Sequelize[_0x7711('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x7711('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x7711('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index eb32337..281f030 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 _0x63b5=['ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','basename','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','User','ChatWebsiteId','ContactId','length','UserId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','CloudProvider','Smtp','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','rows','getMyMessages','includeAgent','push','includeAll','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','firstName','lastName','Owner','get','mkdirSync','Account','N.A.','toString','closedAt','browserName','osName','customerPort','tail','createReadStream','read','value','renderFile','views','.pdf','Chat','createPdfFromHTML','err','unlinkSync','zip-dir','request-promise','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','update','destroy','name','render','body','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','params','model','keys','filters','intersection','attributes','fields','include','merge','create','find','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','isNull','parse','metadata','Sequelize'];(function(_0xa94fd,_0x21edfe){var _0x315fea=function(_0x488acd){while(--_0x488acd){_0xa94fd['push'](_0xa94fd['shift']());}};_0x315fea(++_0x21edfe);}(_0x63b5,0x142));var _0x563b=function(_0xdd2074,_0x59bb75){_0xdd2074=_0xdd2074-0x0;var _0x4d08f9=_0x63b5[_0xdd2074];return _0x4d08f9;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x563b('0x0'));var rp=require(_0x563b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x563b('0x2'));var util=require(_0x563b('0x3'));var path=require(_0x563b('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x563b('0x5'));var Redis=require(_0x563b('0x6'));var interaction=require(_0x563b('0x7'));var qs=require(_0x563b('0x8'));var pdf=require(_0x563b('0x9'));var logger=require(_0x563b('0xa'))(_0x563b('0xb'));var config=require(_0x563b('0xc'));var db=require(_0x563b('0xd'))['db'];config[_0x563b('0xe')]=_[_0x563b('0xf')](config[_0x563b('0xe')],{'host':_0x563b('0x10'),'port':0x18eb});var socket=require(_0x563b('0x11'))(new Redis(config['redis']));require(_0x563b('0x12'))[_0x563b('0x13')](socket);var jayson=require('jayson/promise');var client=jayson[_0x563b('0x14')][_0x563b('0x15')]({'port':0x232b});var client9004=jayson[_0x563b('0x14')][_0x563b('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x39a3d9,_0x2a4e13,_0x52d12e,_0x1c2333){return new BPromise(function(_0x4b5c2d,_0x1cfdbd){var _0x184dc8=_0x1c2333||client;return _0x184dc8[_0x563b('0x16')](_0x39a3d9,_0x52d12e)[_0x563b('0x17')](function(_0x3b697b){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x2a4e13,_0x563b('0x18'));logger['debug'](_0x563b('0x19'),_0x2a4e13,'request\x20sent',JSON['stringify'](_0x3b697b));if(_0x3b697b[_0x563b('0x1a')]){if(_0x3b697b[_0x563b('0x1a')][_0x563b('0x1b')]===0x1f4){logger[_0x563b('0x1a')](_0x563b('0x1c'),_0x2a4e13,_0x3b697b['error'][_0x563b('0x1d')]);return _0x1cfdbd(_0x3b697b[_0x563b('0x1a')][_0x563b('0x1d')]);}logger[_0x563b('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x2a4e13,_0x3b697b[_0x563b('0x1a')][_0x563b('0x1d')]);return _0x4b5c2d(_0x3b697b[_0x563b('0x1a')][_0x563b('0x1d')]);}else{logger['info'](_0x563b('0x1c'),_0x2a4e13,_0x563b('0x18'));_0x4b5c2d(_0x3b697b[_0x563b('0x1e')][_0x563b('0x1d')]);}})[_0x563b('0x1f')](function(_0x1889b0){logger[_0x563b('0x1a')](_0x563b('0x1c'),_0x2a4e13,_0x1889b0);_0x1cfdbd(_0x1889b0);});});}function respondWithStatusCode(_0x56cce8,_0x6ed85c){_0x6ed85c=_0x6ed85c||0xcc;return function(_0x9bf9c){if(_0x9bf9c){return _0x56cce8[_0x563b('0x20')](_0x6ed85c);}return _0x56cce8[_0x563b('0x21')](_0x6ed85c)[_0x563b('0x22')]();};}function respondWithResult(_0x41cbd4,_0x44b8cf){_0x44b8cf=_0x44b8cf||0xc8;return function(_0x56e18e){if(_0x56e18e){return _0x41cbd4['status'](_0x44b8cf)[_0x563b('0x23')](_0x56e18e);}};}function respondWithFilteredResult(_0x29c718,_0x182527){return function(_0x1e86ca){if(_0x1e86ca){var _0x1622ef=typeof _0x182527['offset']===_0x563b('0x24')&&typeof _0x182527[_0x563b('0x25')]===_0x563b('0x24');var _0x4dee69=_0x1e86ca[_0x563b('0x26')];var _0xee4b89=_0x1622ef?0x0:_0x182527[_0x563b('0x27')];var _0x36fb03=_0x1622ef?_0x1e86ca[_0x563b('0x26')]:_0x182527[_0x563b('0x27')]+_0x182527[_0x563b('0x25')];var _0x1ec25f;if(_0x36fb03>=_0x4dee69){_0x36fb03=_0x4dee69;_0x1ec25f=0xc8;}else{_0x1ec25f=0xce;}_0x29c718[_0x563b('0x21')](_0x1ec25f);return _0x29c718[_0x563b('0x28')]('Content-Range',_0xee4b89+'-'+_0x36fb03+'/'+_0x4dee69)['json'](_0x1e86ca);}return null;};}function saveUpdates(_0x112d97){return function(_0x2a4341){if(_0x2a4341){return _0x2a4341[_0x563b('0x29')](_0x112d97)[_0x563b('0x17')](function(_0x3d6a3f){return _0x3d6a3f;});}return null;};}function removeEntity(_0x1fb8e6){return function(_0x47e87a){if(_0x47e87a){return _0x47e87a[_0x563b('0x2a')]()[_0x563b('0x17')](function(){_0x1fb8e6[_0x563b('0x21')](0xcc)[_0x563b('0x22')]();});}};}function handleEntityNotFound(_0xbb5eb6){return function(_0x11b97f){if(!_0x11b97f){_0xbb5eb6['sendStatus'](0x194);}return _0x11b97f;};}function handleError(_0x3418b7,_0x47fc6f){_0x47fc6f=_0x47fc6f||0x1f4;return function(_0x4c2e3b){logger[_0x563b('0x1a')](_0x4c2e3b['stack']);if(_0x4c2e3b['name']){delete _0x4c2e3b[_0x563b('0x2b')];}_0x3418b7[_0x563b('0x21')](_0x47fc6f)['send'](_0x4c2e3b);};}function getMustacheRender(_0x2a60ca,_0x547f51){return Mustache[_0x563b('0x2c')](_0x2a60ca,_['merge'](_0x547f51[_0x563b('0x2d')],{'contact':_0x547f51['contact'],'message':_0x547f51[_0x563b('0x1d')],'agent':_0x547f51['agent'],'interaction':_0x547f51[_0x563b('0x2e')],'account':_0x547f51[_0x563b('0x2f')]}))||'';}exports[_0x563b('0x30')]=function(_0x4719d4,_0xe49f81){var _0x5ad0c0={};var _0x537357=_[_0x563b('0x31')](db[_0x563b('0x32')][_0x563b('0x33')],function(_0xec5431){return{'name':_0xec5431[_0x563b('0x34')],'type':_0xec5431[_0x563b('0x35')][_0x563b('0x36')]};});_0x5ad0c0=qs[_0x563b('0x37')](_0x537357,_0x4719d4);return interaction[_0x563b('0x38')](_0x563b('0x39'),_0x4719d4[_0x563b('0x3a')],_0x4719d4[_0x563b('0x3b')],_0x5ad0c0,_0x537357)[_0x563b('0x17')](respondWithFilteredResult(_0xe49f81,_0x5ad0c0))[_0x563b('0x1f')](handleError(_0xe49f81,null));};exports['show']=function(_0x8f025,_0x5ea37f){var _0x2a2737={'raw':![],'where':{'id':_0x8f025[_0x563b('0x3c')]['id']}},_0x9e6ab3={};_0x9e6ab3[_0x563b('0x3d')]=_['keys'](db['ChatInteraction'][_0x563b('0x33')]);_0x9e6ab3[_0x563b('0x3a')]=_[_0x563b('0x3e')](_0x8f025[_0x563b('0x3a')]);_0x9e6ab3[_0x563b('0x3f')]=_[_0x563b('0x40')](_0x9e6ab3[_0x563b('0x3d')],_0x9e6ab3[_0x563b('0x3a')]);_0x2a2737[_0x563b('0x41')]=_[_0x563b('0x40')](_0x9e6ab3[_0x563b('0x3d')],qs[_0x563b('0x42')](_0x8f025[_0x563b('0x3a')][_0x563b('0x42')]));_0x2a2737['attributes']=_0x2a2737[_0x563b('0x41')]['length']?_0x2a2737[_0x563b('0x41')]:_0x9e6ab3[_0x563b('0x3d')];if(_0x8f025[_0x563b('0x3a')]['includeAll']){_0x2a2737[_0x563b('0x43')]=[{'all':!![]}];}_0x2a2737=_[_0x563b('0x44')]({},_0x2a2737,_0x8f025['options']);return db[_0x563b('0x32')]['find'](_0x2a2737)[_0x563b('0x17')](handleEntityNotFound(_0x5ea37f,null))[_0x563b('0x17')](respondWithResult(_0x5ea37f,null))['catch'](handleError(_0x5ea37f,null));};exports[_0x563b('0x45')]=function(_0x1fffda,_0x16a267){return db[_0x563b('0x32')][_0x563b('0x45')](_0x1fffda['body'],{})['then'](respondWithResult(_0x16a267,0xc9))[_0x563b('0x1f')](handleError(_0x16a267,null));};exports[_0x563b('0x29')]=function(_0x1a0856,_0x58f765){if(_0x1a0856[_0x563b('0x2d')]['id']){delete _0x1a0856['body']['id'];}return db[_0x563b('0x32')][_0x563b('0x46')]({'where':{'id':_0x1a0856[_0x563b('0x3c')]['id']}})[_0x563b('0x17')](handleEntityNotFound(_0x58f765,null))[_0x563b('0x17')](saveUpdates(_0x1a0856['body'],null))[_0x563b('0x17')](respondWithResult(_0x58f765,null))[_0x563b('0x1f')](handleError(_0x58f765,null));};exports['destroy']=function(_0x48742,_0x67a5ea){return db[_0x563b('0x32')]['find']({'where':{'id':_0x48742['params']['id']}})['then'](handleEntityNotFound(_0x67a5ea,null))[_0x563b('0x17')](removeEntity(_0x67a5ea,null))[_0x563b('0x1f')](handleError(_0x67a5ea,null));};exports[_0x563b('0x47')]=function(_0x12ba44,_0x5c61f7){return db[_0x563b('0x32')]['describe']()[_0x563b('0x17')](respondWithResult(_0x5c61f7,null))[_0x563b('0x1f')](handleError(_0x5c61f7,null));};exports[_0x563b('0x48')]=function(_0x49ef91,_0xbfecbe){var _0x37f1b6=_0x49ef91[_0x563b('0x3c')]['id'];var _0x4f870b;var _0x28f1f4;var _0x122d94;return db[_0x563b('0x32')][_0x563b('0x49')]({'where':{'id':_0x37f1b6}})[_0x563b('0x17')](function(_0x533061){_0x4f870b=_0x533061;return db[_0x563b('0x4a')]['findOne']({'where':{'id':_0x533061['ChatWebsiteId']},'attributes':['id',_0x563b('0x4b'),_0x563b('0x4c'),_0x563b('0x4d'),_0x563b('0x4e'),_0x563b('0x4f')],'raw':!![]});})[_0x563b('0x17')](function(_0x20e570){if(_0x20e570&&_0x20e570[_0x563b('0x4b')]&&_0x20e570['vidaooEscalation']){_0x28f1f4=_0x20e570;var _0x2f9954={'interaction':{'id':_0x37f1b6},'agent':{'id':_0x49ef91[_0x563b('0x3b')]['id'],'name':_0x49ef91[_0x563b('0x3b')][_0x563b('0x2b')],'fullname':_0x49ef91[_0x563b('0x3b')]['fullname'],'email':_0x49ef91[_0x563b('0x3b')][_0x563b('0x50')]},'contact':_0x49ef91['body']['contact'],'account':_0x49ef91[_0x563b('0x2d')]['account']};var _0x5ce761={'rejectUnauthorized':![],'method':_0x563b('0x51'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x20e570[_0x563b('0x4b')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x49ef91[_0x563b('0x3b')][_0x563b('0x50')]],'buttons':null,'topic':_0x28f1f4['vidaooTopic'],'note':_[_0x563b('0x52')](_0x28f1f4[_0x563b('0x4e')])?null:getMustacheRender(_0x28f1f4[_0x563b('0x4e')],_0x2f9954),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x563b('0x52')](_0x28f1f4[_0x563b('0x4f')])){var _0x26b378=getMustacheRender(_0x28f1f4['vidaooMetadata'],_0x2f9954);var _0x512282=JSON[_0x563b('0x53')](_0x26b378);_0x5ce761[_0x563b('0x2d')][_0x563b('0x54')]=_0x512282;}}catch(_0x44e222){throw new db[(_0x563b('0x55'))][(_0x563b('0x56'))](_0x563b('0x57'));}return rp(_0x5ce761);}else{throw new db[(_0x563b('0x55'))][(_0x563b('0x56'))](_0x563b('0x58'));}})['then'](function(_0x21655b){_0x122d94=_0x21655b;if(_0x122d94['id']){var _0x1c9931={'body':_0x122d94['join_url'],'ChatWebsiteId':_0x28f1f4['id'],'ChatInteractionId':_0x4f870b['id'],'direction':_0x563b('0x59'),'UserId':_0x49ef91['user']['id']};return db[_0x563b('0x5a')][_0x563b('0x45')](_0x1c9931,{});}else{throw new db[(_0x563b('0x55'))][(_0x563b('0x56'))](_0x563b('0x5b'));}})[_0x563b('0x17')](function(){return _0x4f870b['updateAttributes']({'vidaooSessionId':_0x122d94['id']});})[_0x563b('0x17')](respondWithResult(_0xbfecbe,null))['catch'](handleError(_0xbfecbe,null));};exports[_0x563b('0x5c')]=function(_0xd9bab1,_0x1dcfea){if(_0xd9bab1['body']['id']){delete _0xd9bab1[_0x563b('0x2d')]['id'];}return db[_0x563b('0x32')][_0x563b('0x46')]({'where':{'id':_0xd9bab1[_0x563b('0x3c')]['id']},'include':[{'model':db[_0x563b('0x5d')],'as':_0x563b('0x5e')}]})['then'](handleEntityNotFound(_0x1dcfea,null))[_0x563b('0x17')](saveUpdates(_0xd9bab1[_0x563b('0x2d')],null))[_0x563b('0x17')](respondWithResult(_0x1dcfea,null))[_0x563b('0x1f')](handleError(_0x1dcfea,null));};exports['abandon']=function(_0x14ae4d,_0x2ff09e){if(_0x14ae4d[_0x563b('0x2d')]['id']){delete _0x14ae4d[_0x563b('0x2d')]['id'];}return db[_0x563b('0x32')][_0x563b('0x46')]({'where':{'id':_0x14ae4d['params']['id']}})['then'](function(_0x3d150f){if(!_0x3d150f){logger['error'](_0x563b('0x5f'),'abandon',0x194,_0x563b('0x60'));_0x2ff09e[_0x563b('0x20')](0x194);}else{if(_0x3d150f['UserId']){throw new db['Sequelize'][(_0x563b('0x56'))](_0x563b('0x61'));}}return _0x3d150f;})[_0x563b('0x17')](function(_0x16cd46){if(_0x16cd46){return _0x16cd46[_0x563b('0x29')]({'closed':_0x14ae4d[_0x563b('0x2d')][_0x563b('0x62')],'disposition':_0x14ae4d[_0x563b('0x2d')][_0x563b('0x63')]})['then'](function(_0x564d32){return _0x564d32;});}})[_0x563b('0x17')](function(){return respondWithRpcPromise(_0x563b('0x64'),'abandon',_0x14ae4d[_0x563b('0x2d')],client9004);})['then'](respondWithResult(_0x2ff09e,null))[_0x563b('0x1f')](handleError(_0x2ff09e,null));};exports['attachmentUpload']=function(_0x395703,_0x4ca441){_0x395703[_0x563b('0x2d')][_0x563b('0x2b')]=_0x395703[_0x563b('0x65')][_0x563b('0x66')];_0x395703[_0x563b('0x2d')]['basename']=_0x395703[_0x563b('0x65')][_0x563b('0x67')];_0x395703['body'][_0x563b('0x35')]=_0x395703['file'][_0x563b('0x68')];return db[_0x563b('0x69')]['create'](_0x395703['body'])[_0x563b('0x17')](respondWithResult(_0x4ca441,0xc9))[_0x563b('0x1f')](handleError(_0x4ca441,null));};exports[_0x563b('0x6a')]=function(_0x13f7a0,_0x4cdb51){return db[_0x563b('0x32')][_0x563b('0x49')]({'where':{'id':_0x13f7a0['params']['id']},'raw':!![]})[_0x563b('0x17')](handleEntityNotFound(_0x4cdb51,null))[_0x563b('0x17')](function(_0x1bb925){if(_0x1bb925){if(_0x1bb925['closed']){return _0x4cdb51[_0x563b('0x21')](0x193)[_0x563b('0x23')]({'status':0x193,'message':_0x563b('0x6b')});}return db[_0x563b('0x69')][_0x563b('0x49')]({'where':{'id':_0x13f7a0[_0x563b('0x3a')][_0x563b('0x6c')]},'raw':!![]})[_0x563b('0x17')](handleEntityNotFound(_0x4cdb51,null));}})[_0x563b('0x17')](function(_0x4b5411){if(_0x4b5411){var _0x59d329=_0x4b5411[_0x563b('0x6d')]!==null;var _0xe6df85=path[_0x563b('0x6e')](config[_0x563b('0x6f')],_0x563b('0x70'));if(_0x59d329){_0xe6df85=path[_0x563b('0x6e')](_0xe6df85,'offline-chat/');}var _0x1c99cc=path['join'](_0xe6df85,_0x4b5411[_0x563b('0x71')]);return _0x4cdb51[_0x563b('0x72')](_0x1c99cc);}})['catch'](handleError(_0x4cdb51,null));};exports[_0x563b('0x73')]=function(_0x5de8ee,_0x12efea){var _0x2c9a0f=null;var _0x5e29a3=null;var _0x182317=null;if(_0x5de8ee[_0x563b('0x2d')]['id']){delete _0x5de8ee[_0x563b('0x2d')]['id'];}if(_0x5de8ee['body'][_0x563b('0x74')]){_0x182317=path[_0x563b('0x6e')](config[_0x563b('0x6f')],_0x563b('0x75'),util[_0x563b('0x76')](_0x563b('0x77'),Date['now']()));_0x5de8ee[_0x563b('0x2d')][_0x563b('0x78')]=_0x182317;}return db[_0x563b('0x32')][_0x563b('0x46')]({'where':{'id':_0x5de8ee[_0x563b('0x3c')]['id']},'include':[{'model':db[_0x563b('0x5a')],'as':_0x563b('0x79'),'include':[{'model':db[_0x563b('0x7a')],'as':_0x563b('0x7a')}]}]})[_0x563b('0x17')](handleEntityNotFound(_0x12efea,null))[_0x563b('0x17')](saveUpdates(_0x5de8ee[_0x563b('0x2d')],null))[_0x563b('0x17')](function(_0x322c5b){if(_0x322c5b){_0x2c9a0f=_0x322c5b;return db[_0x563b('0x4a')][_0x563b('0x46')]({'where':{'id':_0x2c9a0f[_0x563b('0x7b')]}});}})[_0x563b('0x17')](function(_0x3a5839){if(_0x3a5839){_0x5e29a3=_0x3a5839;return db[_0x563b('0x5d')]['find']({'where':{'id':_0x2c9a0f[_0x563b('0x7c')]}});}})[_0x563b('0x17')](function(_0x51d742){if(_0x51d742){if(_0x182317){var _0x970855=null;for(var _0xafbc42=0x1;_0xafbc42<_0x2c9a0f[_0x563b('0x79')][_0x563b('0x7d')];++_0xafbc42){_0x970855=_0x2c9a0f[_0x563b('0x79')][_0xafbc42];var _0xa33618=_0x970855[_0x563b('0x7e')]?util[_0x563b('0x76')](_0x563b('0x7f'),_0x5e29a3[_0x563b('0x80')],_0x970855[_0x563b('0x7e')]):_0x563b('0x81');var _0x58e2ba=_0x5de8ee[_0x563b('0x2d')][_0x563b('0x82')]||util[_0x563b('0x76')](_0x563b('0x7f'),_0x563b('0x83'),_0x970855['ContactId']);switch(_0x5e29a3[_0x563b('0x84')]){case _0x563b('0x85'):_0xa33618=_0x970855[_0x563b('0x7e')]?util[_0x563b('0x76')]('%s%d',_0x5e29a3[_0x563b('0x80')],_0x970855[_0x563b('0x7e')]):_0x563b('0x81');break;case _0x563b('0x86'):_0xa33618=_0x970855[_0x563b('0x7e')]?_0x970855['User'][_0x563b('0x87')]||_0x970855[_0x563b('0x7a')][_0x563b('0x88')]:_0x563b('0x81');break;case _0x563b('0x89'):_0xa33618=_0x970855[_0x563b('0x7e')]?_0x970855[_0x563b('0x7a')]['fullname']:_0x563b('0x81');break;default:_0xa33618=_0x970855['UserId']?util[_0x563b('0x76')]('%s%d',_0x5e29a3['agentAlias'],_0x970855[_0x563b('0x7e')]):'System';}var _0x4dfc2b=util[_0x563b('0x76')](_0x563b('0x8a'),moment(_0x970855[_0x563b('0x8b')])[_0x563b('0x76')](_0x563b('0x8c')),_0x970855[_0x563b('0x8d')]==='in'?_0x58e2ba:_0xa33618,_0x970855[_0x563b('0x2d')]);if(!_0x970855[_0x563b('0x8e')]){fs[_0x563b('0x8f')](_0x182317,_0x4dfc2b);}}return db['MailAccount'][_0x563b('0x49')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x563b('0x90')],'as':_0x563b('0x90'),'raw':!![]}]}]});}}})[_0x563b('0x17')](function(_0x2d5dcf){if(!_0x2d5dcf||!_0x2d5dcf[_0x563b('0x91')]||!_0x5de8ee[_0x563b('0x2d')])return _0x2c9a0f;var _0x58c210=_0x2d5dcf['getSmtpOptions']();return respondWithRpcPromise(_0x563b('0x92'),_0x563b('0x93'),{'account':_0x58c210,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2d5dcf['name'],_0x2d5dcf['email']||_0x2d5dcf[_0x563b('0x91')]['user']),'to':_0x5de8ee['body']['mailTranscript'],'subject':_0x563b('0x94'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x5de8ee['body'][_0x563b('0x74')]),'attachments':[{'path':_0x182317}]}})[_0x563b('0x17')](function(){return _0x2c9a0f;})[_0x563b('0x1f')](function(_0x4ecf85){logger['error'](_0x4ecf85);});})[_0x563b('0x17')](respondWithStatusCode(_0x12efea,0xc8))[_0x563b('0x1f')](handleError(_0x12efea,null));};exports['addMessage']=function(_0x598cc3,_0x31f6bb){return db[_0x563b('0x5a')][_0x563b('0x46')]({'where':{'id':_0x598cc3[_0x563b('0x3c')]['id']}})['then'](handleEntityNotFound(_0x31f6bb,null))[_0x563b('0x17')](function(_0x4281cd){if(_0x4281cd){return _0x4281cd[_0x563b('0x95')](_0x598cc3[_0x563b('0x2d')][_0x563b('0x96')],_[_0x563b('0x97')](_0x598cc3[_0x563b('0x2d')],[_0x563b('0x96'),'id'])||{});}})['then'](respondWithResult(_0x31f6bb,null))[_0x563b('0x1f')](handleError(_0x31f6bb,null));};exports[_0x563b('0x98')]=function(_0x44a55e,_0x4ee59f){var _0x42c8f3={'raw':![],'where':{}};var _0x19802d={};var _0x511f11={'count':0x0,'rows':[]};return db[_0x563b('0x32')][_0x563b('0x49')]({'where':{'id':_0x44a55e['params']['id']}})[_0x563b('0x17')](handleEntityNotFound(_0x4ee59f,null))[_0x563b('0x17')](function(_0xe849ab){if(_0xe849ab){_0x19802d[_0x563b('0x3d')]=_[_0x563b('0x3e')](db['ChatMessage']['rawAttributes']);_0x19802d[_0x563b('0x3a')]=_['keys'](_0x44a55e[_0x563b('0x3a')]);_0x19802d[_0x563b('0x3f')]=_[_0x563b('0x40')](_0x19802d[_0x563b('0x3d')],_0x19802d[_0x563b('0x3a')]);_0x42c8f3['attributes']=_[_0x563b('0x40')](_0x19802d[_0x563b('0x3d')],qs['fields'](_0x44a55e[_0x563b('0x3a')][_0x563b('0x42')]));_0x42c8f3[_0x563b('0x41')]=_0x42c8f3[_0x563b('0x41')][_0x563b('0x7d')]?_0x42c8f3[_0x563b('0x41')]:_0x19802d['model'];if(!_0x44a55e[_0x563b('0x3a')][_0x563b('0x99')](_0x563b('0x9a'))){_0x42c8f3[_0x563b('0x25')]=qs['limit'](_0x44a55e[_0x563b('0x3a')][_0x563b('0x25')]);_0x42c8f3[_0x563b('0x27')]=qs[_0x563b('0x27')](_0x44a55e[_0x563b('0x3a')][_0x563b('0x27')]);}_0x42c8f3[_0x563b('0x9b')]=qs[_0x563b('0x9c')](_0x44a55e[_0x563b('0x3a')][_0x563b('0x9c')]);_0x42c8f3[_0x563b('0x9d')]=qs[_0x563b('0x3f')](_[_0x563b('0x9e')](_0x44a55e['query'],_0x19802d[_0x563b('0x3f')]));_0x42c8f3['where'][_0x563b('0x9f')]=_0xe849ab['id'];if(_0x44a55e[_0x563b('0x3a')][_0x563b('0xa0')]){_0x42c8f3[_0x563b('0x9d')]=_[_0x563b('0x44')](_0x42c8f3[_0x563b('0x9d')],{'$or':_[_0x563b('0x31')](_0x42c8f3[_0x563b('0x41')],function(_0x6d7899){var _0x40f06a={};_0x40f06a[_0x6d7899]={'$like':'%'+_0x44a55e[_0x563b('0x3a')]['filter']+'%'};return _0x40f06a;})});}if(_0x44a55e[_0x563b('0x3a')][_0x563b('0xa1')]){var _0x18c95b=_0x44a55e['query'][_0x563b('0xa1')][_0x563b('0xa2')](',');var _0x50a20c={};_0x50a20c[_0x18c95b[0x0]]={'$gte':moment(_0x18c95b[0x1])[_0x563b('0x76')](_0x563b('0xa3'))};_0x42c8f3[_0x563b('0x9d')]=_[_0x563b('0x44')](_0x42c8f3['where'],_0x50a20c);}_0x42c8f3=_[_0x563b('0x44')]({},_0x42c8f3,_0x44a55e[_0x563b('0xa4')]);return db[_0x563b('0x5a')][_0x563b('0x26')]({'where':_0x42c8f3[_0x563b('0x9d')]})[_0x563b('0x17')](function(_0x593feb){_0x511f11[_0x563b('0x26')]=_0x593feb;if(_0x44a55e[_0x563b('0x3a')]['includeAll']){_0x42c8f3[_0x563b('0x43')]=[{'all':!![]}];}return db[_0x563b('0x5a')]['findAll'](_0x42c8f3);})[_0x563b('0x17')](function(_0x15cedc){_0x511f11[_0x563b('0xa5')]=_0x15cedc;return _0x511f11;});}})[_0x563b('0x17')](respondWithFilteredResult(_0x4ee59f,_0x42c8f3))[_0x563b('0x1f')](handleError(_0x4ee59f,null));};exports[_0x563b('0xa6')]=function(_0xe44077,_0x2d4e28){var _0x417b1d={'where':{}},_0x5142d0={},_0x1069e1={'count':0x0,'rows':[]};return db[_0x563b('0x32')][_0x563b('0x49')]({'where':{'id':_0xe44077[_0x563b('0x3c')]['id']}})[_0x563b('0x17')](handleEntityNotFound(_0x2d4e28,null))[_0x563b('0x17')](function(_0x641552){if(_0x641552){_0x5142d0[_0x563b('0x3d')]=_[_0x563b('0x3e')](db[_0x563b('0x5a')][_0x563b('0x33')]);_0x5142d0[_0x563b('0x3a')]=_['keys'](_0xe44077['query']);_0x5142d0[_0x563b('0x3f')]=_[_0x563b('0x40')](_0x5142d0['model'],_0x5142d0[_0x563b('0x3a')]);_0x417b1d['attributes']=_[_0x563b('0x40')](_0x5142d0[_0x563b('0x3d')],qs[_0x563b('0x42')](_0xe44077[_0x563b('0x3a')][_0x563b('0x42')]));_0x417b1d[_0x563b('0x41')]=_0x417b1d['attributes'][_0x563b('0x7d')]?_0x417b1d[_0x563b('0x41')]:_0x5142d0[_0x563b('0x3d')];if(!_0xe44077['query'][_0x563b('0x99')](_0x563b('0x9a'))){_0x417b1d[_0x563b('0x25')]=qs[_0x563b('0x25')](_0xe44077[_0x563b('0x3a')]['limit']);_0x417b1d['offset']=qs[_0x563b('0x27')](_0xe44077[_0x563b('0x3a')][_0x563b('0x27')]);}_0x417b1d[_0x563b('0x9b')]=qs[_0x563b('0x9c')](_0xe44077['query']['sort']);_0x417b1d[_0x563b('0x9d')]=qs[_0x563b('0x3f')](_['pick'](_0xe44077[_0x563b('0x3a')],_0x5142d0[_0x563b('0x3f')]));_0x417b1d['where'][_0x563b('0x9f')]=_0x641552['id'];if(_0xe44077[_0x563b('0x3a')][_0x563b('0xa0')]){_0x417b1d['where']=_[_0x563b('0x44')](_0x417b1d[_0x563b('0x9d')],{'$or':_[_0x563b('0x31')](_0x417b1d[_0x563b('0x41')],function(_0x3562aa){var _0x500b40={};_0x500b40[_0x3562aa]={'$like':'%'+_0xe44077['query'][_0x563b('0xa0')]+'%'};return _0x500b40;})});}_0x417b1d[_0x563b('0x9d')][_0x563b('0x8e')]=![];if(_0xe44077[_0x563b('0x3a')]['id']){_0x417b1d[_0x563b('0x9d')]['id']={'$gt':_0xe44077[_0x563b('0x3a')]['id']};}_0x417b1d=_[_0x563b('0x44')]({},_0x417b1d,_0xe44077[_0x563b('0xa4')]);return db[_0x563b('0x5a')][_0x563b('0x26')]({'where':_0x417b1d[_0x563b('0x9d')]})[_0x563b('0x17')](function(_0x28e1a4){_0x1069e1[_0x563b('0x26')]=_0x28e1a4;_0x417b1d['include']=[];if(_0xe44077[_0x563b('0x3a')][_0x563b('0xa7')]){_0x417b1d[_0x563b('0x43')][_0x563b('0xa8')]({'model':db[_0x563b('0x7a')],'as':_0x563b('0x7a'),'attributes':['id',_0x563b('0x88'),_0x563b('0x87')]});}if(_0xe44077[_0x563b('0x3a')][_0x563b('0xa9')]){_0x417b1d[_0x563b('0x43')]=[{'all':!![]}];}return db[_0x563b('0x5a')][_0x563b('0x38')](_0x417b1d);})[_0x563b('0x17')](function(_0x38cae7){_0x1069e1['rows']=_0x38cae7;return _0x1069e1;});}})[_0x563b('0x17')](respondWithFilteredResult(_0x2d4e28,_0x417b1d))[_0x563b('0x1f')](handleError(_0x2d4e28,null));};exports['addTags']=function(_0x436b52,_0x35075f){return db[_0x563b('0x32')][_0x563b('0x46')]({'where':{'id':_0x436b52['params']['id']}})[_0x563b('0x17')](handleEntityNotFound(_0x35075f,null))['then'](function(_0x4c2072){if(_0x4c2072){return _0x4c2072[_0x563b('0xaa')](_0x436b52[_0x563b('0x2d')]['ids'],_[_0x563b('0x97')](_0x436b52['body'],[_0x563b('0x96'),'id'])||{})['spread'](function(){return db[_0x563b('0xab')]['findAll']({'attributes':['id',_0x563b('0x2b'),_0x563b('0xac')],'where':{'id':_0x436b52[_0x563b('0x2d')][_0x563b('0x96')]}});})[_0x563b('0x17')](function(_0x566399){socket[_0x563b('0xad')](_0x563b('0xae'),{'id':Number(_0x436b52[_0x563b('0x3c')]['id']),'tags':_0x566399||[]});return{'id':Number(_0x436b52[_0x563b('0x3c')]['id']),'tags':_0x566399||[]};});}})['then'](respondWithResult(_0x35075f,null))[_0x563b('0x1f')](handleError(_0x35075f,null));};exports[_0x563b('0xaf')]=function(_0x7e3bc1,_0x401571){return db['ChatInteraction'][_0x563b('0x46')]({'where':{'id':_0x7e3bc1[_0x563b('0x3c')]['id']}})['then'](handleEntityNotFound(_0x401571,null))[_0x563b('0x17')](function(_0x41b5d0){if(_0x41b5d0){return _0x41b5d0['removeTags'](_0x7e3bc1[_0x563b('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0x401571,null))[_0x563b('0x1f')](handleError(_0x401571,null));};exports['download']=function(_0x441855,_0x6f0e21){var _0x49748a=moment()[_0x563b('0xb0')]()['toString']();var _0x5a96cc=path[_0x563b('0x6e')](config[_0x563b('0x6f')],_0x563b('0xb1'),_0x563b('0xb2'),_0x563b('0xb3'));var _0x3ab220=path[_0x563b('0x6e')](config[_0x563b('0x6f')],_0x563b('0xb1'),_0x563b('0xb2'),_0x563b('0xb4'));var _0x3bb5bb=path[_0x563b('0x6e')](_0x5a96cc,_0x49748a);var _0x1c0497=util[_0x563b('0x76')]('transcript-%d-%s.zip',_0x441855['params']['id'],_0x49748a);var _0x4dc176=path[_0x563b('0x6e')](_0x5a96cc,_0x1c0497);var _0x144548=[];_0x144548[_0x563b('0xa8')]({'model':db[_0x563b('0x7a')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x144548['push']({'model':db[_0x563b('0x5d')],'as':_0x563b('0x5e'),'attributes':['id',_0x563b('0xb5'),_0x563b('0xb6')],'raw':!![]});if(_0x441855[_0x563b('0x3a')][_0x563b('0xb4')]){_0x144548[_0x563b('0xa8')]({'model':db[_0x563b('0x69')],'as':_0x563b('0x69'),'raw':!![]});}var _0x5bfd02=[{'model':db[_0x563b('0x5a')],'as':'Messages','attributes':['id',_0x563b('0x2d'),_0x563b('0x8b'),_0x563b('0x8d'),_0x563b('0x8e'),'read'],'include':_0x144548}];_0x5bfd02[_0x563b('0xa8')]({'model':db[_0x563b('0x4a')],'as':'Account','attributes':['id','name']});_0x5bfd02[_0x563b('0xa8')]({'model':db[_0x563b('0x7a')],'as':_0x563b('0xb7'),'attributes':['id',_0x563b('0x88')]});return db[_0x563b('0x32')][_0x563b('0x46')]({'where':{'id':_0x441855['params']['id']},'include':_0x5bfd02})[_0x563b('0x17')](handleEntityNotFound(_0x6f0e21,null))['then'](function(_0x61a141){if(_0x61a141){var _0x4700ed=_0x61a141[_0x563b('0xb8')]({'plain':!![]});fs[_0x563b('0xb9')](_0x3bb5bb);var _0x4dcf4f={'channel':'Chat','account':_0x4700ed[_0x563b('0xba')][_0x563b('0x2b')],'agent':_0x4700ed[_0x563b('0xb7')]?_0x4700ed[_0x563b('0xb7')][_0x563b('0x88')]:_0x563b('0xbb'),'createdAt':moment(_0x4700ed['createdAt'])[_0x563b('0x76')]('YYYY-MM-DD\x20HH:mm:ss')[_0x563b('0xbc')](),'closedAt':_0x4700ed[_0x563b('0x62')]?moment(_0x4700ed[_0x563b('0xbd')])[_0x563b('0x76')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x4700ed['disposition'],'chatInfo':{'browser':_0x4700ed[_0x563b('0xbe')],'os':_0x4700ed[_0x563b('0xbf')],'referer':_0x4700ed['referer'],'customerIp':_0x4700ed['customerIp'],'customerPort':_0x4700ed[_0x563b('0xc0')]?_0x4700ed[_0x563b('0xc0')]:_0x563b('0xbb')},'messages':_(_0x4700ed[_0x563b('0x79')])[_0x563b('0xc1')]()[_0x563b('0xa0')]({'secret':![]})[_0x563b('0x31')](function(_0x334f7f){if(_0x334f7f['Attachment']){var _0x53816e=path[_0x563b('0x6e')](_0x3ab220,_0x334f7f['Attachment'][_0x563b('0x71')]);if(fs['existsSync'](_0x53816e)){fs[_0x563b('0xc2')](_0x53816e)['pipe'](fs['createWriteStream'](path[_0x563b('0x6e')](_0x3bb5bb,_0x334f7f[_0x563b('0x69')][_0x563b('0x71')])));}}return{'date':moment(_0x334f7f[_0x563b('0x8b')])[_0x563b('0x76')](_0x563b('0xa3'))['toString'](),'sender':_0x334f7f[_0x563b('0x8d')]===_0x563b('0x59')?_0x334f7f[_0x563b('0x7a')]?_0x334f7f['User'][_0x563b('0x88')]:'System':_0x334f7f[_0x563b('0x5e')][_0x563b('0xb5')]+(_0x334f7f[_0x563b('0x5e')][_0x563b('0xb6')]?'\x20'+_0x334f7f[_0x563b('0x5e')][_0x563b('0xb6')]:''),'body':_0x334f7f[_0x563b('0x69')]?_0x334f7f['Attachment'][_0x563b('0x71')]:_0x334f7f[_0x563b('0x2d')],'direction':_0x334f7f[_0x563b('0x8d')]==='out'?'A':'C','secret':_0x334f7f[_0x563b('0x8e')],'read':_0x334f7f[_0x563b('0xc3')],'attachment':_0x334f7f[_0x563b('0x69')]};})[_0x563b('0xc4')]()};return ejs[_0x563b('0xc5')](path['join'](config[_0x563b('0x6f')],_0x563b('0xb1'),_0x563b('0xc6'),'downloadInteraction.ejs'),{'interaction':_0x4dcf4f})['then'](function(_0x3d9bc2){var _0x4cf79d=path[_0x563b('0x6e')](_0x3bb5bb,'transcript-'+_0x4700ed['id']+'-'+_0x49748a+_0x563b('0xc7'));var _0xe896da={'path':_0x4cf79d,'channel':_0x563b('0xc8'),'interactionId':_0x4700ed['id']};return pdf[_0x563b('0xc9')](_0x3d9bc2,_0xe896da);})['then'](function(){return new Promise(function(_0x3dab2d,_0x23ce9a){zipdir(_0x3bb5bb,{'saveTo':_0x4dc176},function(_0x4efeb3,_0x334156){if(_0x4efeb3)return _0x23ce9a(_0x4efeb3);return _0x3dab2d(_0x334156);});})[_0x563b('0x17')](function(){return new BPromise(function(_0x5a4010,_0x3e3416){rimraf(_0x3bb5bb,function(_0x37233b){if(_0x37233b)_0x3e3416(_0x37233b);return _0x5a4010();});});})[_0x563b('0x17')](function(){return _0x6f0e21[_0x563b('0x72')](_0x4dc176,_0x1c0497,function(_0x5b51ec){if(_0x5b51ec){logger[_0x563b('0x1a')](_0x563b('0xca'),_0x5b51ec);}else{fs[_0x563b('0xcb')](_0x4dc176);}});});});}else{return _0x6f0e21[_0x563b('0x20')](0xc8);}})[_0x563b('0x1f')](handleError(_0x6f0e21,null));};
\ No newline at end of file
+var _0xe4dd=['Content-Range','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','show','params','model','keys','filters','intersection','attributes','fields','query','length','includeAll','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','User','ContactId','UserId','%s%d','System','customer','website_alias','agentAlias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','rows','getMyMessages','hasOwnProperty','addTags','spread','Tag','color','emit','chatInteractionTags:save','toString','server','files','tmp','transcript-%d-%s.zip','push','firstName','lastName','attachments','direction','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','err','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','./chatInteraction.socket','register','jayson/promise','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0xe4dd,0xa8));var _0xde4d=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xe4dd[_0xd1d19a];return _0x52a79d;};'use strict';var rimraf=require(_0xde4d('0x0'));var zipdir=require(_0xde4d('0x1'));var rp=require(_0xde4d('0x2'));var moment=require(_0xde4d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xde4d('0x4'));var util=require(_0xde4d('0x5'));var path=require(_0xde4d('0x6'));var ejs=require(_0xde4d('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xde4d('0x8'));var qs=require(_0xde4d('0x9'));var pdf=require(_0xde4d('0xa'));var logger=require('../../config/logger')('api');var config=require(_0xde4d('0xb'));var db=require(_0xde4d('0xc'))['db'];config['redis']=_['defaults'](config[_0xde4d('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde4d('0xd')]));require(_0xde4d('0xe'))[_0xde4d('0xf')](socket);var jayson=require(_0xde4d('0x10'));var client=jayson['client'][_0xde4d('0x11')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x427e63,_0x10693c,_0x320e74,_0x54aab9){return new BPromise(function(_0x1b8106,_0x569c01){var _0x23e04c=_0x54aab9||client;return _0x23e04c[_0xde4d('0x12')](_0x427e63,_0x320e74)[_0xde4d('0x13')](function(_0x5cbe3c){logger[_0xde4d('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x10693c,_0xde4d('0x15'));logger[_0xde4d('0x16')](_0xde4d('0x17'),_0x10693c,_0xde4d('0x15'),JSON[_0xde4d('0x18')](_0x5cbe3c));if(_0x5cbe3c['error']){if(_0x5cbe3c[_0xde4d('0x19')][_0xde4d('0x1a')]===0x1f4){logger['error'](_0xde4d('0x1b'),_0x10693c,_0x5cbe3c[_0xde4d('0x19')][_0xde4d('0x1c')]);return _0x569c01(_0x5cbe3c[_0xde4d('0x19')][_0xde4d('0x1c')]);}logger[_0xde4d('0x19')](_0xde4d('0x1b'),_0x10693c,_0x5cbe3c[_0xde4d('0x19')][_0xde4d('0x1c')]);return _0x1b8106(_0x5cbe3c[_0xde4d('0x19')][_0xde4d('0x1c')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x10693c,_0xde4d('0x15'));_0x1b8106(_0x5cbe3c[_0xde4d('0x1d')][_0xde4d('0x1c')]);}})[_0xde4d('0x1e')](function(_0x549c04){logger[_0xde4d('0x19')](_0xde4d('0x1b'),_0x10693c,_0x549c04);_0x569c01(_0x549c04);});});}function respondWithStatusCode(_0x212366,_0x72c0d1){_0x72c0d1=_0x72c0d1||0xcc;return function(_0x8555b3){if(_0x8555b3){return _0x212366[_0xde4d('0x1f')](_0x72c0d1);}return _0x212366[_0xde4d('0x20')](_0x72c0d1)[_0xde4d('0x21')]();};}function respondWithResult(_0x4da0ec,_0x925a7a){_0x925a7a=_0x925a7a||0xc8;return function(_0x5487fa){if(_0x5487fa){return _0x4da0ec[_0xde4d('0x20')](_0x925a7a)[_0xde4d('0x22')](_0x5487fa);}};}function respondWithFilteredResult(_0x4b63bb,_0x3f8639){return function(_0x3506e2){if(_0x3506e2){var _0x3f04ee=typeof _0x3f8639[_0xde4d('0x23')]===_0xde4d('0x24')&&typeof _0x3f8639[_0xde4d('0x25')]===_0xde4d('0x24');var _0x16d850=_0x3506e2[_0xde4d('0x26')];var _0x10b6e9=_0x3f04ee?0x0:_0x3f8639[_0xde4d('0x23')];var _0x4f9c1c=_0x3f04ee?_0x3506e2[_0xde4d('0x26')]:_0x3f8639['offset']+_0x3f8639[_0xde4d('0x25')];var _0x50de7b;if(_0x4f9c1c>=_0x16d850){_0x4f9c1c=_0x16d850;_0x50de7b=0xc8;}else{_0x50de7b=0xce;}_0x4b63bb[_0xde4d('0x20')](_0x50de7b);return _0x4b63bb[_0xde4d('0x27')](_0xde4d('0x28'),_0x10b6e9+'-'+_0x4f9c1c+'/'+_0x16d850)['json'](_0x3506e2);}return null;};}function saveUpdates(_0x5db01){return function(_0x3859fa){if(_0x3859fa){return _0x3859fa[_0xde4d('0x29')](_0x5db01)['then'](function(_0x14a922){return _0x14a922;});}return null;};}function removeEntity(_0x37e78d){return function(_0x16c2a3){if(_0x16c2a3){return _0x16c2a3[_0xde4d('0x2a')]()[_0xde4d('0x13')](function(){_0x37e78d[_0xde4d('0x20')](0xcc)[_0xde4d('0x21')]();});}};}function handleEntityNotFound(_0x4f4f02){return function(_0x2584f3){if(!_0x2584f3){_0x4f4f02['sendStatus'](0x194);}return _0x2584f3;};}function handleError(_0x21778f,_0x353d58){_0x353d58=_0x353d58||0x1f4;return function(_0x43aa5b){logger[_0xde4d('0x19')](_0x43aa5b[_0xde4d('0x2b')]);if(_0x43aa5b[_0xde4d('0x2c')]){delete _0x43aa5b[_0xde4d('0x2c')];}_0x21778f[_0xde4d('0x20')](_0x353d58)[_0xde4d('0x2d')](_0x43aa5b);};}function getMustacheRender(_0x1b2c1c,_0x1d8c9b){return Mustache[_0xde4d('0x2e')](_0x1b2c1c,_[_0xde4d('0x2f')](_0x1d8c9b[_0xde4d('0x30')],{'contact':_0x1d8c9b[_0xde4d('0x31')],'message':_0x1d8c9b[_0xde4d('0x1c')],'agent':_0x1d8c9b[_0xde4d('0x32')],'interaction':_0x1d8c9b[_0xde4d('0x33')],'account':_0x1d8c9b[_0xde4d('0x34')]}))||'';}exports[_0xde4d('0x35')]=function(_0x2e6429,_0x4d63e8){var _0x22b51e={};var _0x3011bc=_[_0xde4d('0x36')](db[_0xde4d('0x37')][_0xde4d('0x38')],function(_0x1bf1b1){return{'name':_0x1bf1b1[_0xde4d('0x39')],'type':_0x1bf1b1[_0xde4d('0x3a')][_0xde4d('0x3b')]};});_0x22b51e=qs[_0xde4d('0x3c')](_0x3011bc,_0x2e6429);return interaction[_0xde4d('0x3d')]('chat',_0x2e6429['query'],_0x2e6429['user'],_0x22b51e,_0x3011bc)[_0xde4d('0x13')](respondWithFilteredResult(_0x4d63e8,_0x22b51e))[_0xde4d('0x1e')](handleError(_0x4d63e8,null));};exports[_0xde4d('0x3e')]=function(_0x265126,_0x325548){var _0x14cd4b={'raw':![],'where':{'id':_0x265126[_0xde4d('0x3f')]['id']}},_0x3b1870={};_0x3b1870[_0xde4d('0x40')]=_[_0xde4d('0x41')](db[_0xde4d('0x37')]['rawAttributes']);_0x3b1870['query']=_[_0xde4d('0x41')](_0x265126['query']);_0x3b1870[_0xde4d('0x42')]=_[_0xde4d('0x43')](_0x3b1870[_0xde4d('0x40')],_0x3b1870['query']);_0x14cd4b[_0xde4d('0x44')]=_[_0xde4d('0x43')](_0x3b1870[_0xde4d('0x40')],qs[_0xde4d('0x45')](_0x265126[_0xde4d('0x46')]['fields']));_0x14cd4b['attributes']=_0x14cd4b[_0xde4d('0x44')][_0xde4d('0x47')]?_0x14cd4b[_0xde4d('0x44')]:_0x3b1870[_0xde4d('0x40')];if(_0x265126[_0xde4d('0x46')][_0xde4d('0x48')]){_0x14cd4b['include']=[{'all':!![]}];}_0x14cd4b=_[_0xde4d('0x2f')]({},_0x14cd4b,_0x265126[_0xde4d('0x49')]);return db[_0xde4d('0x37')][_0xde4d('0x4a')](_0x14cd4b)[_0xde4d('0x13')](handleEntityNotFound(_0x325548,null))[_0xde4d('0x13')](respondWithResult(_0x325548,null))['catch'](handleError(_0x325548,null));};exports[_0xde4d('0x4b')]=function(_0x3acf6b,_0x44fcce){return db[_0xde4d('0x37')][_0xde4d('0x4b')](_0x3acf6b[_0xde4d('0x30')],{})[_0xde4d('0x13')](respondWithResult(_0x44fcce,0xc9))[_0xde4d('0x1e')](handleError(_0x44fcce,null));};exports['update']=function(_0x7534cd,_0x11853e){if(_0x7534cd['body']['id']){delete _0x7534cd[_0xde4d('0x30')]['id'];}return db[_0xde4d('0x37')][_0xde4d('0x4a')]({'where':{'id':_0x7534cd[_0xde4d('0x3f')]['id']}})[_0xde4d('0x13')](handleEntityNotFound(_0x11853e,null))['then'](saveUpdates(_0x7534cd[_0xde4d('0x30')],null))[_0xde4d('0x13')](respondWithResult(_0x11853e,null))[_0xde4d('0x1e')](handleError(_0x11853e,null));};exports['destroy']=function(_0x6ab3b0,_0xe19d91){return db[_0xde4d('0x37')][_0xde4d('0x4a')]({'where':{'id':_0x6ab3b0[_0xde4d('0x3f')]['id']}})[_0xde4d('0x13')](handleEntityNotFound(_0xe19d91,null))[_0xde4d('0x13')](removeEntity(_0xe19d91,null))[_0xde4d('0x1e')](handleError(_0xe19d91,null));};exports[_0xde4d('0x4c')]=function(_0xf095a9,_0x31d6b4){return db[_0xde4d('0x37')][_0xde4d('0x4c')]()['then'](respondWithResult(_0x31d6b4,null))[_0xde4d('0x1e')](handleError(_0x31d6b4,null));};exports[_0xde4d('0x4d')]=function(_0x5da51f,_0x3d2e01){var _0x4f2feb=_0x5da51f[_0xde4d('0x3f')]['id'];var _0xcf3a37;var _0x1f9ecd;var _0x47c5f1;return db[_0xde4d('0x37')][_0xde4d('0x4e')]({'where':{'id':_0x4f2feb}})[_0xde4d('0x13')](function(_0x473c5c){_0xcf3a37=_0x473c5c;return db[_0xde4d('0x4f')][_0xde4d('0x4e')]({'where':{'id':_0x473c5c[_0xde4d('0x50')]},'attributes':['id',_0xde4d('0x51'),_0xde4d('0x52'),_0xde4d('0x53'),_0xde4d('0x54'),_0xde4d('0x55')],'raw':!![]});})[_0xde4d('0x13')](function(_0x295ca9){if(_0x295ca9&&_0x295ca9[_0xde4d('0x51')]&&_0x295ca9[_0xde4d('0x52')]){_0x1f9ecd=_0x295ca9;var _0x3eb7fd={'interaction':{'id':_0x4f2feb},'agent':{'id':_0x5da51f[_0xde4d('0x56')]['id'],'name':_0x5da51f[_0xde4d('0x56')]['name'],'fullname':_0x5da51f['user'][_0xde4d('0x57')],'email':_0x5da51f[_0xde4d('0x56')][_0xde4d('0x58')]},'contact':_0x5da51f[_0xde4d('0x30')][_0xde4d('0x31')],'account':_0x5da51f[_0xde4d('0x30')][_0xde4d('0x34')]};var _0xc5d9b5={'rejectUnauthorized':![],'method':_0xde4d('0x59'),'url':_0xde4d('0x5a'),'headers':{'X-APIKEY':_0x295ca9[_0xde4d('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5da51f[_0xde4d('0x56')]['email']],'buttons':null,'topic':_0x1f9ecd[_0xde4d('0x53')],'note':_['isNull'](_0x1f9ecd[_0xde4d('0x54')])?null:getMustacheRender(_0x1f9ecd[_0xde4d('0x54')],_0x3eb7fd),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xde4d('0x5b')](_0x1f9ecd[_0xde4d('0x55')])){var _0x4d57c5=getMustacheRender(_0x1f9ecd[_0xde4d('0x55')],_0x3eb7fd);var _0x37259d=JSON[_0xde4d('0x5c')](_0x4d57c5);_0xc5d9b5[_0xde4d('0x30')][_0xde4d('0x5d')]=_0x37259d;}}catch(_0x5a3f20){throw new db[(_0xde4d('0x5e'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xc5d9b5);}else{throw new db[(_0xde4d('0x5e'))][(_0xde4d('0x5f'))](_0xde4d('0x60'));}})[_0xde4d('0x13')](function(_0x3322d3){_0x47c5f1=_0x3322d3;if(_0x47c5f1['id']){var _0x4e4751={'body':_0x47c5f1['join_url'],'ChatWebsiteId':_0x1f9ecd['id'],'ChatInteractionId':_0xcf3a37['id'],'direction':_0xde4d('0x61'),'UserId':_0x5da51f[_0xde4d('0x56')]['id']};return db['ChatMessage'][_0xde4d('0x4b')](_0x4e4751,{});}else{throw new db[(_0xde4d('0x5e'))][(_0xde4d('0x5f'))](_0xde4d('0x62'));}})[_0xde4d('0x13')](function(){return _0xcf3a37[_0xde4d('0x63')]({'vidaooSessionId':_0x47c5f1['id']});})['then'](respondWithResult(_0x3d2e01,null))[_0xde4d('0x1e')](handleError(_0x3d2e01,null));};exports['customUpdate']=function(_0x558edc,_0x153d72){if(_0x558edc[_0xde4d('0x30')]['id']){delete _0x558edc[_0xde4d('0x30')]['id'];}return db['ChatInteraction'][_0xde4d('0x4a')]({'where':{'id':_0x558edc[_0xde4d('0x3f')]['id']},'include':[{'model':db[_0xde4d('0x64')],'as':_0xde4d('0x65')}]})[_0xde4d('0x13')](handleEntityNotFound(_0x153d72,null))['then'](saveUpdates(_0x558edc['body'],null))[_0xde4d('0x13')](respondWithResult(_0x153d72,null))[_0xde4d('0x1e')](handleError(_0x153d72,null));};exports[_0xde4d('0x66')]=function(_0x53cb86,_0x352d9a){if(_0x53cb86['body']['id']){delete _0x53cb86[_0xde4d('0x30')]['id'];}return db[_0xde4d('0x37')]['find']({'where':{'id':_0x53cb86[_0xde4d('0x3f')]['id']}})[_0xde4d('0x13')](function(_0x52fa9b){if(!_0x52fa9b){logger[_0xde4d('0x19')](_0xde4d('0x67'),_0xde4d('0x66'),0x194,_0xde4d('0x68'));_0x352d9a['sendStatus'](0x194);}else{if(_0x52fa9b['UserId']){throw new db[(_0xde4d('0x5e'))][(_0xde4d('0x5f'))](_0xde4d('0x69'));}}return _0x52fa9b;})['then'](function(_0x1d317c){if(_0x1d317c){return _0x1d317c['update']({'closed':_0x53cb86[_0xde4d('0x30')][_0xde4d('0x6a')],'disposition':_0x53cb86[_0xde4d('0x30')][_0xde4d('0x6b')]})[_0xde4d('0x13')](function(_0x59c5b5){return _0x59c5b5;});}})['then'](function(){return respondWithRpcPromise(_0xde4d('0x6c'),_0xde4d('0x66'),_0x53cb86[_0xde4d('0x30')],client9004);})[_0xde4d('0x13')](respondWithResult(_0x352d9a,null))[_0xde4d('0x1e')](handleError(_0x352d9a,null));};exports[_0xde4d('0x6d')]=function(_0x16d9e4,_0x4b6dcf){_0x16d9e4[_0xde4d('0x30')][_0xde4d('0x2c')]=_0x16d9e4[_0xde4d('0x6e')][_0xde4d('0x6f')];_0x16d9e4[_0xde4d('0x30')]['basename']=_0x16d9e4[_0xde4d('0x6e')]['filename'];_0x16d9e4[_0xde4d('0x30')][_0xde4d('0x3a')]=_0x16d9e4[_0xde4d('0x6e')][_0xde4d('0x70')];return db[_0xde4d('0x71')]['create'](_0x16d9e4[_0xde4d('0x30')])[_0xde4d('0x13')](respondWithResult(_0x4b6dcf,0xc9))[_0xde4d('0x1e')](handleError(_0x4b6dcf,null));};exports[_0xde4d('0x72')]=function(_0x8b8b23,_0x91862a){return db[_0xde4d('0x37')][_0xde4d('0x4e')]({'where':{'id':_0x8b8b23[_0xde4d('0x3f')]['id']},'raw':!![]})[_0xde4d('0x13')](handleEntityNotFound(_0x91862a,null))[_0xde4d('0x13')](function(_0x44ed94){if(_0x44ed94){if(_0x44ed94[_0xde4d('0x6a')]){return _0x91862a[_0xde4d('0x20')](0x193)[_0xde4d('0x22')]({'status':0x193,'message':_0xde4d('0x73')});}return db[_0xde4d('0x71')][_0xde4d('0x4e')]({'where':{'id':_0x8b8b23[_0xde4d('0x46')][_0xde4d('0x74')]},'raw':!![]})['then'](handleEntityNotFound(_0x91862a,null));}})[_0xde4d('0x13')](function(_0x36e51c){if(_0x36e51c){var _0x44ec61=_0x36e51c[_0xde4d('0x75')]!==null;var _0x11fc0d=path[_0xde4d('0x76')](config[_0xde4d('0x77')],_0xde4d('0x78'));if(_0x44ec61){_0x11fc0d=path[_0xde4d('0x76')](_0x11fc0d,_0xde4d('0x79'));}var _0x993d19=path[_0xde4d('0x76')](_0x11fc0d,_0x36e51c[_0xde4d('0x7a')]);return _0x91862a[_0xde4d('0x7b')](_0x993d19);}})[_0xde4d('0x1e')](handleError(_0x91862a,null));};exports[_0xde4d('0x7c')]=function(_0x6f64d4,_0x46d129){var _0xcbd990=null;var _0x481b61=null;var _0x3aff8d=null;if(_0x6f64d4[_0xde4d('0x30')]['id']){delete _0x6f64d4[_0xde4d('0x30')]['id'];}if(_0x6f64d4['body'][_0xde4d('0x7d')]){_0x3aff8d=path[_0xde4d('0x76')](config[_0xde4d('0x77')],_0xde4d('0x7e'),util[_0xde4d('0x7f')]('transcript-%s.txt',Date[_0xde4d('0x80')]()));_0x6f64d4[_0xde4d('0x30')][_0xde4d('0x81')]=_0x3aff8d;}return db['ChatInteraction'][_0xde4d('0x4a')]({'where':{'id':_0x6f64d4['params']['id']},'include':[{'model':db[_0xde4d('0x82')],'as':_0xde4d('0x83'),'include':[{'model':db[_0xde4d('0x84')],'as':_0xde4d('0x84')}]}]})[_0xde4d('0x13')](handleEntityNotFound(_0x46d129,null))[_0xde4d('0x13')](saveUpdates(_0x6f64d4[_0xde4d('0x30')],null))[_0xde4d('0x13')](function(_0x25d67c){if(_0x25d67c){_0xcbd990=_0x25d67c;return db[_0xde4d('0x4f')][_0xde4d('0x4a')]({'where':{'id':_0xcbd990[_0xde4d('0x50')]}});}})[_0xde4d('0x13')](function(_0x29dc11){if(_0x29dc11){_0x481b61=_0x29dc11;return db['CmContact'][_0xde4d('0x4a')]({'where':{'id':_0xcbd990[_0xde4d('0x85')]}});}})[_0xde4d('0x13')](function(_0x551a07){if(_0x551a07){if(_0x3aff8d){var _0x621631=null;for(var _0x105431=0x1;_0x105431<_0xcbd990[_0xde4d('0x83')]['length'];++_0x105431){_0x621631=_0xcbd990[_0xde4d('0x83')][_0x105431];var _0x365ac6=_0x621631[_0xde4d('0x86')]?util[_0xde4d('0x7f')](_0xde4d('0x87'),_0x481b61['agentAlias'],_0x621631[_0xde4d('0x86')]):_0xde4d('0x88');var _0x3f5c3f=_0x6f64d4[_0xde4d('0x30')][_0xde4d('0x89')]||util[_0xde4d('0x7f')](_0xde4d('0x87'),'Visitor',_0x621631[_0xde4d('0x85')]);switch(_0x481b61['agentIdentifier']){case _0xde4d('0x8a'):_0x365ac6=_0x621631[_0xde4d('0x86')]?util[_0xde4d('0x7f')]('%s%d',_0x481b61[_0xde4d('0x8b')],_0x621631['UserId']):'System';break;case'agent_alias':_0x365ac6=_0x621631['UserId']?_0x621631[_0xde4d('0x84')][_0xde4d('0x8c')]||_0x621631[_0xde4d('0x84')][_0xde4d('0x57')]:_0xde4d('0x88');break;case _0xde4d('0x8d'):_0x365ac6=_0x621631[_0xde4d('0x86')]?_0x621631['User'][_0xde4d('0x57')]:_0xde4d('0x88');break;default:_0x365ac6=_0x621631['UserId']?util[_0xde4d('0x7f')](_0xde4d('0x87'),_0x481b61[_0xde4d('0x8b')],_0x621631[_0xde4d('0x86')]):_0xde4d('0x88');}var _0x43ccdd=util['format'](_0xde4d('0x8e'),moment(_0x621631[_0xde4d('0x8f')])[_0xde4d('0x7f')](_0xde4d('0x90')),_0x621631['direction']==='in'?_0x3f5c3f:_0x365ac6,_0x621631[_0xde4d('0x30')]);if(!_0x621631[_0xde4d('0x91')]){fs[_0xde4d('0x92')](_0x3aff8d,_0x43ccdd);}}return db[_0xde4d('0x93')][_0xde4d('0x4e')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xde4d('0x94'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xde4d('0x95'),'raw':!![]}]}]});}}})['then'](function(_0x48d787){if(!_0x48d787||!_0x48d787[_0xde4d('0x94')]||!_0x6f64d4[_0xde4d('0x30')])return _0xcbd990;var _0x954411=_0x48d787[_0xde4d('0x96')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x954411,'message':{'from':util[_0xde4d('0x7f')](_0xde4d('0x97'),_0x48d787['name'],_0x48d787[_0xde4d('0x58')]||_0x48d787[_0xde4d('0x94')][_0xde4d('0x56')]),'to':_0x6f64d4[_0xde4d('0x30')][_0xde4d('0x7d')],'subject':_0xde4d('0x98'),'text':util[_0xde4d('0x7f')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x6f64d4['body'][_0xde4d('0x7d')]),'attachments':[{'path':_0x3aff8d}]}})[_0xde4d('0x13')](function(){return _0xcbd990;})[_0xde4d('0x1e')](function(_0x51bdaa){logger[_0xde4d('0x19')](_0x51bdaa);});})['then'](respondWithStatusCode(_0x46d129,0xc8))['catch'](handleError(_0x46d129,null));};exports[_0xde4d('0x99')]=function(_0x5ed162,_0x1e33d8){return db['ChatMessage'][_0xde4d('0x4a')]({'where':{'id':_0x5ed162['params']['id']}})[_0xde4d('0x13')](handleEntityNotFound(_0x1e33d8,null))['then'](function(_0x104f0e){if(_0x104f0e){return _0x104f0e['addMessage'](_0x5ed162[_0xde4d('0x30')][_0xde4d('0x9a')],_[_0xde4d('0x9b')](_0x5ed162[_0xde4d('0x30')],['ids','id'])||{});}})[_0xde4d('0x13')](respondWithResult(_0x1e33d8,null))[_0xde4d('0x1e')](handleError(_0x1e33d8,null));};exports[_0xde4d('0x9c')]=function(_0xbd7c46,_0x51a0de){var _0x2deceb={'raw':![],'where':{}};var _0x57881b={};var _0x29feb3={'count':0x0,'rows':[]};return db[_0xde4d('0x37')][_0xde4d('0x4e')]({'where':{'id':_0xbd7c46['params']['id']}})[_0xde4d('0x13')](handleEntityNotFound(_0x51a0de,null))[_0xde4d('0x13')](function(_0x1595fb){if(_0x1595fb){_0x57881b['model']=_[_0xde4d('0x41')](db['ChatMessage'][_0xde4d('0x38')]);_0x57881b['query']=_[_0xde4d('0x41')](_0xbd7c46[_0xde4d('0x46')]);_0x57881b[_0xde4d('0x42')]=_[_0xde4d('0x43')](_0x57881b[_0xde4d('0x40')],_0x57881b[_0xde4d('0x46')]);_0x2deceb[_0xde4d('0x44')]=_[_0xde4d('0x43')](_0x57881b[_0xde4d('0x40')],qs[_0xde4d('0x45')](_0xbd7c46[_0xde4d('0x46')][_0xde4d('0x45')]));_0x2deceb['attributes']=_0x2deceb[_0xde4d('0x44')]['length']?_0x2deceb[_0xde4d('0x44')]:_0x57881b[_0xde4d('0x40')];if(!_0xbd7c46[_0xde4d('0x46')]['hasOwnProperty']('nolimit')){_0x2deceb['limit']=qs[_0xde4d('0x25')](_0xbd7c46[_0xde4d('0x46')][_0xde4d('0x25')]);_0x2deceb['offset']=qs[_0xde4d('0x23')](_0xbd7c46[_0xde4d('0x46')][_0xde4d('0x23')]);}_0x2deceb[_0xde4d('0x9d')]=qs[_0xde4d('0x9e')](_0xbd7c46[_0xde4d('0x46')][_0xde4d('0x9e')]);_0x2deceb[_0xde4d('0x9f')]=qs[_0xde4d('0x42')](_[_0xde4d('0xa0')](_0xbd7c46['query'],_0x57881b[_0xde4d('0x42')]));_0x2deceb[_0xde4d('0x9f')][_0xde4d('0xa1')]=_0x1595fb['id'];if(_0xbd7c46[_0xde4d('0x46')][_0xde4d('0xa2')]){_0x2deceb[_0xde4d('0x9f')]=_[_0xde4d('0x2f')](_0x2deceb[_0xde4d('0x9f')],{'$or':_[_0xde4d('0x36')](_0x2deceb[_0xde4d('0x44')],function(_0x2dbd42){var _0x57144d={};_0x57144d[_0x2dbd42]={'$like':'%'+_0xbd7c46[_0xde4d('0x46')]['filter']+'%'};return _0x57144d;})});}if(_0xbd7c46[_0xde4d('0x46')][_0xde4d('0xa3')]){var _0x312939=_0xbd7c46[_0xde4d('0x46')][_0xde4d('0xa3')][_0xde4d('0xa4')](',');var _0x39fa88={};_0x39fa88[_0x312939[0x0]]={'$gte':moment(_0x312939[0x1])[_0xde4d('0x7f')](_0xde4d('0xa5'))};_0x2deceb['where']=_[_0xde4d('0x2f')](_0x2deceb[_0xde4d('0x9f')],_0x39fa88);}_0x2deceb=_['merge']({},_0x2deceb,_0xbd7c46[_0xde4d('0x49')]);return db[_0xde4d('0x82')][_0xde4d('0x26')]({'where':_0x2deceb[_0xde4d('0x9f')]})[_0xde4d('0x13')](function(_0x45bab9){_0x29feb3['count']=_0x45bab9;if(_0xbd7c46['query'][_0xde4d('0x48')]){_0x2deceb[_0xde4d('0xa6')]=[{'all':!![]}];}return db[_0xde4d('0x82')][_0xde4d('0x3d')](_0x2deceb);})[_0xde4d('0x13')](function(_0x3fc3a6){_0x29feb3[_0xde4d('0xa7')]=_0x3fc3a6;return _0x29feb3;});}})[_0xde4d('0x13')](respondWithFilteredResult(_0x51a0de,_0x2deceb))[_0xde4d('0x1e')](handleError(_0x51a0de,null));};exports[_0xde4d('0xa8')]=function(_0x122ee5,_0xe019d8){var _0x51ab0b={'where':{}},_0x30b7c0={},_0x437444={'count':0x0,'rows':[]};return db[_0xde4d('0x37')][_0xde4d('0x4e')]({'where':{'id':_0x122ee5['params']['id']}})[_0xde4d('0x13')](handleEntityNotFound(_0xe019d8,null))[_0xde4d('0x13')](function(_0x381696){if(_0x381696){_0x30b7c0['model']=_[_0xde4d('0x41')](db[_0xde4d('0x82')][_0xde4d('0x38')]);_0x30b7c0[_0xde4d('0x46')]=_['keys'](_0x122ee5[_0xde4d('0x46')]);_0x30b7c0['filters']=_[_0xde4d('0x43')](_0x30b7c0[_0xde4d('0x40')],_0x30b7c0[_0xde4d('0x46')]);_0x51ab0b[_0xde4d('0x44')]=_[_0xde4d('0x43')](_0x30b7c0[_0xde4d('0x40')],qs[_0xde4d('0x45')](_0x122ee5[_0xde4d('0x46')][_0xde4d('0x45')]));_0x51ab0b[_0xde4d('0x44')]=_0x51ab0b[_0xde4d('0x44')][_0xde4d('0x47')]?_0x51ab0b[_0xde4d('0x44')]:_0x30b7c0['model'];if(!_0x122ee5[_0xde4d('0x46')][_0xde4d('0xa9')]('nolimit')){_0x51ab0b[_0xde4d('0x25')]=qs[_0xde4d('0x25')](_0x122ee5[_0xde4d('0x46')][_0xde4d('0x25')]);_0x51ab0b[_0xde4d('0x23')]=qs['offset'](_0x122ee5[_0xde4d('0x46')][_0xde4d('0x23')]);}_0x51ab0b[_0xde4d('0x9d')]=qs[_0xde4d('0x9e')](_0x122ee5[_0xde4d('0x46')][_0xde4d('0x9e')]);_0x51ab0b[_0xde4d('0x9f')]=qs['filters'](_[_0xde4d('0xa0')](_0x122ee5[_0xde4d('0x46')],_0x30b7c0[_0xde4d('0x42')]));_0x51ab0b[_0xde4d('0x9f')][_0xde4d('0xa1')]=_0x381696['id'];if(_0x122ee5[_0xde4d('0x46')][_0xde4d('0xa2')]){_0x51ab0b[_0xde4d('0x9f')]=_[_0xde4d('0x2f')](_0x51ab0b[_0xde4d('0x9f')],{'$or':_[_0xde4d('0x36')](_0x51ab0b[_0xde4d('0x44')],function(_0x5ac0da){var _0x5f03c9={};_0x5f03c9[_0x5ac0da]={'$like':'%'+_0x122ee5['query'][_0xde4d('0xa2')]+'%'};return _0x5f03c9;})});}_0x51ab0b[_0xde4d('0x9f')][_0xde4d('0x91')]=![];if(_0x122ee5[_0xde4d('0x46')]['id']){_0x51ab0b[_0xde4d('0x9f')]['id']={'$gt':_0x122ee5[_0xde4d('0x46')]['id']};}_0x51ab0b=_[_0xde4d('0x2f')]({},_0x51ab0b,_0x122ee5['options']);return db['ChatMessage'][_0xde4d('0x26')]({'where':_0x51ab0b['where']})[_0xde4d('0x13')](function(_0x23b529){_0x437444[_0xde4d('0x26')]=_0x23b529;_0x51ab0b[_0xde4d('0xa6')]=[];if(_0x122ee5[_0xde4d('0x46')]['includeAgent']){_0x51ab0b[_0xde4d('0xa6')]['push']({'model':db[_0xde4d('0x84')],'as':_0xde4d('0x84'),'attributes':['id',_0xde4d('0x57'),_0xde4d('0x8c')]});}if(_0x122ee5[_0xde4d('0x46')][_0xde4d('0x48')]){_0x51ab0b[_0xde4d('0xa6')]=[{'all':!![]}];}return db['ChatMessage'][_0xde4d('0x3d')](_0x51ab0b);})['then'](function(_0x280283){_0x437444[_0xde4d('0xa7')]=_0x280283;return _0x437444;});}})[_0xde4d('0x13')](respondWithFilteredResult(_0xe019d8,_0x51ab0b))[_0xde4d('0x1e')](handleError(_0xe019d8,null));};exports[_0xde4d('0xaa')]=function(_0x5af129,_0x44d432){return db[_0xde4d('0x37')][_0xde4d('0x4a')]({'where':{'id':_0x5af129[_0xde4d('0x3f')]['id']}})[_0xde4d('0x13')](handleEntityNotFound(_0x44d432,null))[_0xde4d('0x13')](function(_0x18e2b6){if(_0x18e2b6){return _0x18e2b6['setTags'](_0x5af129[_0xde4d('0x30')][_0xde4d('0x9a')],_[_0xde4d('0x9b')](_0x5af129[_0xde4d('0x30')],[_0xde4d('0x9a'),'id'])||{})[_0xde4d('0xab')](function(){return db[_0xde4d('0xac')][_0xde4d('0x3d')]({'attributes':['id',_0xde4d('0x2c'),_0xde4d('0xad')],'where':{'id':_0x5af129[_0xde4d('0x30')][_0xde4d('0x9a')]}});})[_0xde4d('0x13')](function(_0x1dc502){socket[_0xde4d('0xae')](_0xde4d('0xaf'),{'id':Number(_0x5af129[_0xde4d('0x3f')]['id']),'tags':_0x1dc502||[]});return{'id':Number(_0x5af129[_0xde4d('0x3f')]['id']),'tags':_0x1dc502||[]};});}})[_0xde4d('0x13')](respondWithResult(_0x44d432,null))['catch'](handleError(_0x44d432,null));};exports['removeTags']=function(_0x5e099b,_0x3135a4){return db[_0xde4d('0x37')][_0xde4d('0x4a')]({'where':{'id':_0x5e099b[_0xde4d('0x3f')]['id']}})[_0xde4d('0x13')](handleEntityNotFound(_0x3135a4,null))[_0xde4d('0x13')](function(_0x6c0351){if(_0x6c0351){return _0x6c0351['removeTags'](_0x5e099b[_0xde4d('0x46')][_0xde4d('0x9a')]);}})[_0xde4d('0x13')](respondWithStatusCode(_0x3135a4,null))['catch'](handleError(_0x3135a4,null));};exports[_0xde4d('0x7b')]=function(_0x7c6cfb,_0x553ca1){var _0x156861=moment()['unix']()[_0xde4d('0xb0')]();var _0x4c1c29=path[_0xde4d('0x76')](config[_0xde4d('0x77')],_0xde4d('0xb1'),_0xde4d('0xb2'),_0xde4d('0xb3'));var _0x3ba545=path['join'](config['root'],_0xde4d('0xb1'),'files','attachments');var _0x4f145f=path[_0xde4d('0x76')](_0x4c1c29,_0x156861);var _0x59da37=util[_0xde4d('0x7f')](_0xde4d('0xb4'),_0x7c6cfb['params']['id'],_0x156861);var _0x3c630f=path['join'](_0x4c1c29,_0x59da37);var _0x5b85cf=[];_0x5b85cf[_0xde4d('0xb5')]({'model':db[_0xde4d('0x84')],'as':_0xde4d('0x84'),'attributes':['id',_0xde4d('0x57')],'raw':!![]});_0x5b85cf[_0xde4d('0xb5')]({'model':db[_0xde4d('0x64')],'as':_0xde4d('0x65'),'attributes':['id',_0xde4d('0xb6'),_0xde4d('0xb7')],'raw':!![]});if(_0x7c6cfb['query'][_0xde4d('0xb8')]){_0x5b85cf[_0xde4d('0xb5')]({'model':db['Attachment'],'as':_0xde4d('0x71'),'raw':!![]});}var _0xe3a604=[{'model':db[_0xde4d('0x82')],'as':_0xde4d('0x83'),'attributes':['id',_0xde4d('0x30'),_0xde4d('0x8f'),_0xde4d('0xb9'),_0xde4d('0x91'),_0xde4d('0xba')],'include':_0x5b85cf}];_0xe3a604[_0xde4d('0xb5')]({'model':db['ChatWebsite'],'as':_0xde4d('0xbb'),'attributes':['id',_0xde4d('0x2c')]});_0xe3a604[_0xde4d('0xb5')]({'model':db[_0xde4d('0x84')],'as':_0xde4d('0xbc'),'attributes':['id',_0xde4d('0x57')]});return db['ChatInteraction'][_0xde4d('0x4a')]({'where':{'id':_0x7c6cfb[_0xde4d('0x3f')]['id']},'include':_0xe3a604})['then'](handleEntityNotFound(_0x553ca1,null))[_0xde4d('0x13')](function(_0x522f82){if(_0x522f82){var _0x1a6c76=_0x522f82[_0xde4d('0xbd')]({'plain':!![]});fs[_0xde4d('0xbe')](_0x4f145f);var _0x36a95b={'channel':_0xde4d('0xbf'),'account':_0x1a6c76[_0xde4d('0xbb')]['name'],'agent':_0x1a6c76[_0xde4d('0xbc')]?_0x1a6c76[_0xde4d('0xbc')][_0xde4d('0x57')]:_0xde4d('0xc0'),'createdAt':moment(_0x1a6c76[_0xde4d('0x8f')])['format'](_0xde4d('0xa5'))[_0xde4d('0xb0')](),'closedAt':_0x1a6c76[_0xde4d('0x6a')]?moment(_0x1a6c76[_0xde4d('0xc1')])[_0xde4d('0x7f')](_0xde4d('0xa5'))[_0xde4d('0xb0')]():'','disposition':_0x1a6c76[_0xde4d('0x6b')],'chatInfo':{'browser':_0x1a6c76[_0xde4d('0xc2')],'os':_0x1a6c76[_0xde4d('0xc3')],'referer':_0x1a6c76[_0xde4d('0xc4')],'customerIp':_0x1a6c76[_0xde4d('0xc5')],'customerPort':_0x1a6c76['customerPort']?_0x1a6c76[_0xde4d('0xc6')]:_0xde4d('0xc0')},'messages':_(_0x1a6c76[_0xde4d('0x83')])[_0xde4d('0xc7')]()['filter']({'secret':![]})[_0xde4d('0x36')](function(_0x204a31){if(_0x204a31[_0xde4d('0x71')]){var _0xb65f0d=path[_0xde4d('0x76')](_0x3ba545,_0x204a31['Attachment'][_0xde4d('0x7a')]);if(fs[_0xde4d('0xc8')](_0xb65f0d)){fs[_0xde4d('0xc9')](_0xb65f0d)[_0xde4d('0xca')](fs[_0xde4d('0xcb')](path[_0xde4d('0x76')](_0x4f145f,_0x204a31[_0xde4d('0x71')][_0xde4d('0x7a')])));}}return{'date':moment(_0x204a31[_0xde4d('0x8f')])[_0xde4d('0x7f')]('YYYY-MM-DD\x20HH:mm:ss')[_0xde4d('0xb0')](),'sender':_0x204a31[_0xde4d('0xb9')]===_0xde4d('0x61')?_0x204a31[_0xde4d('0x84')]?_0x204a31[_0xde4d('0x84')][_0xde4d('0x57')]:_0xde4d('0x88'):_0x204a31[_0xde4d('0x65')][_0xde4d('0xb6')]+(_0x204a31['Contact'][_0xde4d('0xb7')]?'\x20'+_0x204a31[_0xde4d('0x65')][_0xde4d('0xb7')]:''),'body':_0x204a31[_0xde4d('0x71')]?_0x204a31['Attachment']['basename']:_0x204a31[_0xde4d('0x30')],'direction':_0x204a31[_0xde4d('0xb9')]===_0xde4d('0x61')?'A':'C','secret':_0x204a31['secret'],'read':_0x204a31['read'],'attachment':_0x204a31[_0xde4d('0x71')]};})['value']()};return ejs[_0xde4d('0xcc')](path[_0xde4d('0x76')](config[_0xde4d('0x77')],'server',_0xde4d('0xcd'),'downloadInteraction.ejs'),{'interaction':_0x36a95b})[_0xde4d('0x13')](function(_0x3a7639){var _0x56d1cf=path[_0xde4d('0x76')](_0x4f145f,'transcript-'+_0x1a6c76['id']+'-'+_0x156861+'.pdf');var _0x52ac59={'path':_0x56d1cf,'channel':_0xde4d('0xbf'),'interactionId':_0x1a6c76['id']};return pdf['createPdfFromHTML'](_0x3a7639,_0x52ac59);})[_0xde4d('0x13')](function(){return new Promise(function(_0x32c2e2,_0x3fc410){zipdir(_0x4f145f,{'saveTo':_0x3c630f},function(_0x22f9fc,_0x401853){if(_0x22f9fc)return _0x3fc410(_0x22f9fc);return _0x32c2e2(_0x401853);});})[_0xde4d('0x13')](function(){return new BPromise(function(_0x2e861f,_0x137d1b){rimraf(_0x4f145f,function(_0x28e10a){if(_0x28e10a)_0x137d1b(_0x28e10a);return _0x2e861f();});});})[_0xde4d('0x13')](function(){return _0x553ca1[_0xde4d('0x7b')](_0x3c630f,_0x59da37,function(_0x4d9ca1){if(_0x4d9ca1){logger[_0xde4d('0x19')](_0xde4d('0xce'),_0x4d9ca1);}else{fs[_0xde4d('0xcf')](_0x3c630f);}});});});}else{return _0x553ca1[_0xde4d('0x1f')](0xc8);}})[_0xde4d('0x1e')](handleError(_0x553ca1,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 5b08757..81040c4 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 _0x5428=['ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x35f5a5,_0x3f8a65){var _0x143dce=function(_0x5c3197){while(--_0x5c3197){_0x35f5a5['push'](_0x35f5a5['shift']());}};_0x143dce(++_0x3f8a65);}(_0x5428,0x1eb));var _0x8542=function(_0x47eed5,_0x91ec98){_0x47eed5=_0x47eed5-0x0;var _0x59fb5f=_0x5428[_0x47eed5];return _0x59fb5f;};'use strict';var EventEmitter=require(_0x8542('0x0'));var ChatInteraction=require(_0x8542('0x1'))['db'][_0x8542('0x2')];var ChatMessage=require(_0x8542('0x1'))['db'][_0x8542('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8542('0x4')](0x0);var events={'afterCreate':_0x8542('0x5'),'afterUpdate':'update','afterDestroy':_0x8542('0x6')};function emitEvent(_0xb3ab65){return function(_0x415ef0,_0x200d42,_0x7efcba){_0x415ef0[_0x8542('0x7')]({'attributes':['id'],'raw':!![]})[_0x8542('0x8')](function(_0x407275){_0x415ef0[_0x8542('0x9')]('Users',_0x407275[_0x8542('0xa')](function(_0x3aaf2c){return{'id':_0x3aaf2c['id']};}));return ChatMessage[_0x8542('0xb')]({'where':{'ChatInteractionId':_0x415ef0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8542('0x8')](function(_0x4696cc){_0x415ef0['setDataValue'](_0x8542('0xc'),_0x4696cc['length']);ChatInteractionEvents[_0x8542('0xd')](_0xb3ab65+':'+_0x415ef0['id'],_0x415ef0);ChatInteractionEvents[_0x8542('0xd')](_0xb3ab65,_0x415ef0);_0x7efcba(null);})[_0x8542('0xe')](_0x7efcba(null));};}for(var e in events){if(events[_0x8542('0xf')](e)){var event=events[e];ChatInteraction[_0x8542('0x10')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x03da=['findAll','unreadMessages','length','emit','catch','hook','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','then','setDataValue','Users','map'];(function(_0x1a26cf,_0x24ff00){var _0x34e0e1=function(_0x177354){while(--_0x177354){_0x1a26cf['push'](_0x1a26cf['shift']());}};_0x34e0e1(++_0x24ff00);}(_0x03da,0x66));var _0xa03d=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0x03da[_0xb6e43];return _0x47c40f;};'use strict';var EventEmitter=require(_0xa03d('0x0'));var ChatInteraction=require(_0xa03d('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xa03d('0x1'))['db'][_0xa03d('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xa03d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa03d('0x4'),'afterDestroy':_0xa03d('0x5')};function emitEvent(_0x55926){return function(_0x22da6c,_0x34a8e8,_0x23bd99){_0x22da6c['getUsers']({'attributes':['id'],'raw':!![]})[_0xa03d('0x6')](function(_0x1f5b4c){_0x22da6c[_0xa03d('0x7')](_0xa03d('0x8'),_0x1f5b4c[_0xa03d('0x9')](function(_0x2c049c){return{'id':_0x2c049c['id']};}));return ChatMessage[_0xa03d('0xa')]({'where':{'ChatInteractionId':_0x22da6c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa03d('0x6')](function(_0x3b5fb7){_0x22da6c[_0xa03d('0x7')](_0xa03d('0xb'),_0x3b5fb7[_0xa03d('0xc')]);ChatInteractionEvents[_0xa03d('0xd')](_0x55926+':'+_0x22da6c['id'],_0x22da6c);ChatInteractionEvents[_0xa03d('0xd')](_0x55926,_0x22da6c);_0x23bd99(null);})[_0xa03d('0xe')](_0x23bd99(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xa03d('0xf')](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 986d8cf..66deca6 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 _0x7606=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7606,0x8d));var _0x6760=function(_0x42d041,_0x4a3448){_0x42d041=_0x42d041-0x0;var _0x14b609=_0x7606[_0x42d041];return _0x14b609;};'use strict';var _=require(_0x6760('0x0'));var util=require(_0x6760('0x1'));var logger=require(_0x6760('0x2'))(_0x6760('0x3'));var moment=require(_0x6760('0x4'));var BPromise=require(_0x6760('0x5'));var rp=require(_0x6760('0x6'));var fs=require('fs');var path=require(_0x6760('0x7'));var rimraf=require(_0x6760('0x8'));var config=require(_0x6760('0x9'));var attributes=require(_0x6760('0xa'));module[_0x6760('0xb')]=function(_0xb07b5,_0xb57fc6){return _0xb07b5[_0x6760('0xc')](_0x6760('0xd'),attributes,{'tableName':_0x6760('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ca3cf,_0x2a7853,_0x4ae7cb){if(_0x3ca3cf[_0x6760('0xf')]('closed')){_0x3ca3cf[_0x6760('0x10')]=moment()[_0x6760('0x11')](_0x6760('0x12'));}_0x4ae7cb(null,_0x3ca3cf);}},'charset':'utf8mb4','collate':_0x6760('0x13')});};
\ No newline at end of file
+var _0xc3f6=['../../config/environment','ChatInteraction','changed','closed','format','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x554d40,_0x3e4d2e){var _0x2e95a6=function(_0x5924de){while(--_0x5924de){_0x554d40['push'](_0x554d40['shift']());}};_0x2e95a6(++_0x3e4d2e);}(_0xc3f6,0xb0));var _0x6c3f=function(_0x1f088c,_0x53b5a7){_0x1f088c=_0x1f088c-0x0;var _0x1fbe22=_0xc3f6[_0x1f088c];return _0x1fbe22;};'use strict';var _=require(_0x6c3f('0x0'));var util=require('util');var logger=require(_0x6c3f('0x1'))(_0x6c3f('0x2'));var moment=require('moment');var BPromise=require(_0x6c3f('0x3'));var rp=require(_0x6c3f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c3f('0x5'));var config=require(_0x6c3f('0x6'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x75924b,_0x413ffc){return _0x75924b['define'](_0x6c3f('0x7'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b238d,_0x355dcd,_0x2885d6){if(_0x5b238d[_0x6c3f('0x8')](_0x6c3f('0x9'))){_0x5b238d['closedAt']=moment()[_0x6c3f('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2885d6(null,_0x5b238d);}},'charset':_0x6c3f('0xb'),'collate':_0x6c3f('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 785015b..d40f228 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 _0xb1f6=['debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','ChatInteraction','body','options','where','attributes','limit','then','UpdateChatInteraction','stringify','catch','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s'];(function(_0x89eef8,_0x2896dd){var _0xe260aa=function(_0x1bf035){while(--_0x1bf035){_0x89eef8['push'](_0x89eef8['shift']());}};_0xe260aa(++_0x2896dd);}(_0xb1f6,0x187));var _0x6b1f=function(_0x3d7159,_0x4bf336){_0x3d7159=_0x3d7159-0x0;var _0x7e9b2f=_0xb1f6[_0x3d7159];return _0x7e9b2f;};'use strict';var _=require(_0x6b1f('0x0'));var util=require(_0x6b1f('0x1'));var moment=require(_0x6b1f('0x2'));var BPromise=require(_0x6b1f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b1f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6b1f('0x5'))(_0x6b1f('0x6'));var config=require(_0x6b1f('0x7'));var jayson=require(_0x6b1f('0x8'));var client=jayson[_0x6b1f('0x9')]['http']({'port':0x232a});config[_0x6b1f('0xa')]=_[_0x6b1f('0xb')](config[_0x6b1f('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b1f('0xa')]));require(_0x6b1f('0xc'))[_0x6b1f('0xd')](socket);function respondWithRpcPromise(_0x53a680,_0x19b0c6,_0xdefc30){return new BPromise(function(_0x3fe938,_0x4934b9){return client[_0x6b1f('0xe')](_0x53a680,_0xdefc30)['then'](function(_0x17358a){logger['info'](_0x6b1f('0xf'),_0x19b0c6,'request\x20sent');logger[_0x6b1f('0x10')](_0x6b1f('0x11'),_0x19b0c6,_0x6b1f('0x12'),JSON['stringify'](_0x17358a));if(_0x17358a[_0x6b1f('0x13')]){if(_0x17358a['error']['code']===0x1f4){logger[_0x6b1f('0x13')](_0x6b1f('0xf'),_0x19b0c6,_0x17358a['error']['message']);return _0x4934b9(_0x17358a[_0x6b1f('0x13')]['message']);}logger[_0x6b1f('0x13')](_0x6b1f('0xf'),_0x19b0c6,_0x17358a[_0x6b1f('0x13')][_0x6b1f('0x14')]);return _0x3fe938(_0x17358a['error'][_0x6b1f('0x14')]);}else{logger[_0x6b1f('0x15')](_0x6b1f('0xf'),_0x19b0c6,_0x6b1f('0x12'));_0x3fe938(_0x17358a['result']['message']);}})['catch'](function(_0x3814c4){logger['error'](_0x6b1f('0xf'),_0x19b0c6,_0x3814c4);_0x4934b9(_0x3814c4);});});}exports['UpdateChatInteraction']=function(_0x576d38){var _0x250743=this;return new Promise(function(_0x267649,_0x3e6adc){return db[_0x6b1f('0x16')]['update'](_0x576d38[_0x6b1f('0x17')],{'raw':_0x576d38[_0x6b1f('0x18')]?_0x576d38[_0x6b1f('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x576d38['options']?_0x576d38['options'][_0x6b1f('0x19')]||null:null,'attributes':_0x576d38[_0x6b1f('0x18')]?_0x576d38[_0x6b1f('0x18')][_0x6b1f('0x1a')]||null:null,'limit':_0x576d38[_0x6b1f('0x18')]?_0x576d38[_0x6b1f('0x18')][_0x6b1f('0x1b')]||null:null})[_0x6b1f('0x1c')](function(_0x3fd841){logger['info'](_0x6b1f('0x1d'),_0x576d38);logger[_0x6b1f('0x10')](_0x6b1f('0x1d'),_0x576d38,JSON[_0x6b1f('0x1e')](_0x3fd841));_0x267649(_0x3fd841);})[_0x6b1f('0x1f')](function(_0x15c23d){logger[_0x6b1f('0x13')](_0x6b1f('0x1d'),_0x15c23d['message'],_0x576d38);_0x3e6adc(_0x250743[_0x6b1f('0x13')](0x1f4,_0x15c23d[_0x6b1f('0x14')]));});});};exports['AddTagsToChatInteraction']=function(_0x3623b9){return new Promise(function(_0x51b323,_0x116ca5){return db[_0x6b1f('0x16')][_0x6b1f('0x20')]({'where':_0x3623b9[_0x6b1f('0x18')]?_0x3623b9['options'][_0x6b1f('0x19')]||null:null})[_0x6b1f('0x1c')](function(_0x4e2fd3){if(_0x4e2fd3){return _0x4e2fd3['addTags'](_0x3623b9['body'][_0x6b1f('0x21')],_[_0x6b1f('0x22')](_0x3623b9['body'],['ids','id'])||{});}})[_0x6b1f('0x23')](function(_0x6e6f1e){logger[_0x6b1f('0x15')](_0x6b1f('0x24'),_0x3623b9);logger['debug'](_0x6b1f('0x24'),_0x3623b9,JSON[_0x6b1f('0x1e')](_0x6e6f1e));_0x51b323(_0x6e6f1e);})[_0x6b1f('0x1f')](function(_0x4b45ce){logger['error'](_0x6b1f('0x24'),_0x4b45ce[_0x6b1f('0x14')],_0x3623b9);_0x116ca5(_this[_0x6b1f('0x13')](0x1f4,_0x4b45ce[_0x6b1f('0x14')]));});});};
\ No newline at end of file
+var _0xe944=['redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x2e1ca2,_0x150397){var _0x60bc65=function(_0x12de2d){while(--_0x12de2d){_0x2e1ca2['push'](_0x2e1ca2['shift']());}};_0x60bc65(++_0x150397);}(_0xe944,0x178));var _0x4e94=function(_0x597b02,_0x6860c){_0x597b02=_0x597b02-0x0;var _0x39a2f9=_0xe944[_0x597b02];return _0x39a2f9;};'use strict';var _=require(_0x4e94('0x0'));var util=require(_0x4e94('0x1'));var moment=require(_0x4e94('0x2'));var BPromise=require(_0x4e94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e94('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e94('0x5'));var logger=require(_0x4e94('0x6'))(_0x4e94('0x7'));var config=require('../../config/environment');var jayson=require(_0x4e94('0x8'));var client=jayson[_0x4e94('0x9')][_0x4e94('0xa')]({'port':0x232a});config[_0x4e94('0xb')]=_[_0x4e94('0xc')](config[_0x4e94('0xb')],{'host':_0x4e94('0xd'),'port':0x18eb});var socket=require(_0x4e94('0xe'))(new Redis(config['redis']));require(_0x4e94('0xf'))[_0x4e94('0x10')](socket);function respondWithRpcPromise(_0x4e8394,_0x1d8427,_0x16f4a9){return new BPromise(function(_0x58fa7a,_0x5ddd51){return client['request'](_0x4e8394,_0x16f4a9)[_0x4e94('0x11')](function(_0x1249a5){logger[_0x4e94('0x12')](_0x4e94('0x13'),_0x1d8427,_0x4e94('0x14'));logger[_0x4e94('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1d8427,_0x4e94('0x14'),JSON[_0x4e94('0x16')](_0x1249a5));if(_0x1249a5[_0x4e94('0x17')]){if(_0x1249a5[_0x4e94('0x17')][_0x4e94('0x18')]===0x1f4){logger['error'](_0x4e94('0x13'),_0x1d8427,_0x1249a5[_0x4e94('0x17')][_0x4e94('0x19')]);return _0x5ddd51(_0x1249a5[_0x4e94('0x17')][_0x4e94('0x19')]);}logger[_0x4e94('0x17')](_0x4e94('0x13'),_0x1d8427,_0x1249a5[_0x4e94('0x17')][_0x4e94('0x19')]);return _0x58fa7a(_0x1249a5['error'][_0x4e94('0x19')]);}else{logger[_0x4e94('0x12')](_0x4e94('0x13'),_0x1d8427,_0x4e94('0x14'));_0x58fa7a(_0x1249a5[_0x4e94('0x1a')][_0x4e94('0x19')]);}})['catch'](function(_0x10ff24){logger[_0x4e94('0x17')](_0x4e94('0x13'),_0x1d8427,_0x10ff24);_0x5ddd51(_0x10ff24);});});}exports[_0x4e94('0x1b')]=function(_0x24326d){var _0x1c3ab4=this;return new Promise(function(_0x210b22,_0x445ff1){return db[_0x4e94('0x1c')][_0x4e94('0x1d')](_0x24326d[_0x4e94('0x1e')],{'raw':_0x24326d[_0x4e94('0x1f')]?_0x24326d[_0x4e94('0x1f')][_0x4e94('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24326d[_0x4e94('0x1f')]?_0x24326d['options'][_0x4e94('0x21')]||null:null,'attributes':_0x24326d[_0x4e94('0x1f')]?_0x24326d[_0x4e94('0x1f')][_0x4e94('0x22')]||null:null,'limit':_0x24326d[_0x4e94('0x1f')]?_0x24326d['options']['limit']||null:null})[_0x4e94('0x11')](function(_0x16a3b2){logger['info'](_0x4e94('0x1b'),_0x24326d);logger[_0x4e94('0x15')](_0x4e94('0x1b'),_0x24326d,JSON[_0x4e94('0x16')](_0x16a3b2));_0x210b22(_0x16a3b2);})[_0x4e94('0x23')](function(_0x196b24){logger['error'](_0x4e94('0x1b'),_0x196b24[_0x4e94('0x19')],_0x24326d);_0x445ff1(_0x1c3ab4['error'](0x1f4,_0x196b24[_0x4e94('0x19')]));});});};exports[_0x4e94('0x24')]=function(_0x259ed2){return new Promise(function(_0x486c9a,_0x36f47d){return db[_0x4e94('0x1c')][_0x4e94('0x25')]({'where':_0x259ed2[_0x4e94('0x1f')]?_0x259ed2[_0x4e94('0x1f')][_0x4e94('0x21')]||null:null})['then'](function(_0x1c307f){if(_0x1c307f){return _0x1c307f[_0x4e94('0x26')](_0x259ed2['body'][_0x4e94('0x27')],_[_0x4e94('0x28')](_0x259ed2[_0x4e94('0x1e')],[_0x4e94('0x27'),'id'])||{});}})[_0x4e94('0x29')](function(_0x1b26a2){logger[_0x4e94('0x12')](_0x4e94('0x2a'),_0x259ed2);logger[_0x4e94('0x15')]('AddTags',_0x259ed2,JSON[_0x4e94('0x16')](_0x1b26a2));_0x486c9a(_0x1b26a2);})[_0x4e94('0x23')](function(_0x50c017){logger[_0x4e94('0x17')](_0x4e94('0x2a'),_0x50c017[_0x4e94('0x19')],_0x259ed2);_0x36f47d(_this[_0x4e94('0x17')](0x1f4,_0x50c017[_0x4e94('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 07a707f..6bab2ea 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 _0x9daa=['remove','update','emit','removeListener','register','chatInteraction:','./chatInteraction.events','save'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9daa,0x146));var _0xa9da=function(_0x1dba8d,_0x34b988){_0x1dba8d=_0x1dba8d-0x0;var _0x202828=_0x9daa[_0x1dba8d];return _0x202828;};'use strict';var ChatInteractionEvents=require(_0xa9da('0x0'));var events=[_0xa9da('0x1'),_0xa9da('0x2'),_0xa9da('0x3')];function createListener(_0x54105a,_0xa817d9){return function(_0x112851){_0xa817d9[_0xa9da('0x4')](_0x54105a,_0x112851);};}function removeListener(_0xee9072,_0x347ed7){return function(){ChatInteractionEvents[_0xa9da('0x5')](_0xee9072,_0x347ed7);};}exports[_0xa9da('0x6')]=function(_0x56a8fc){for(var _0x4dbf12=0x0,_0x4ef8e6=events['length'];_0x4dbf12<_0x4ef8e6;_0x4dbf12++){var _0x2840df=events[_0x4dbf12];var _0x5e588c=createListener(_0xa9da('0x7')+_0x2840df,_0x56a8fc);ChatInteractionEvents['on'](_0x2840df,_0x5e588c);}};
\ No newline at end of file
+var _0x7deb=['save','remove','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x25ee27,_0x180283){var _0xa793a5=function(_0x4fb627){while(--_0x4fb627){_0x25ee27['push'](_0x25ee27['shift']());}};_0xa793a5(++_0x180283);}(_0x7deb,0x11f));var _0xb7de=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x7deb[_0xb833b1];return _0x1ab87a;};'use strict';var ChatInteractionEvents=require(_0xb7de('0x0'));var events=[_0xb7de('0x1'),_0xb7de('0x2'),'update'];function createListener(_0x57e31f,_0x4e1dbe){return function(_0x5a8a45){_0x4e1dbe[_0xb7de('0x3')](_0x57e31f,_0x5a8a45);};}function removeListener(_0x219f61,_0x54d165){return function(){ChatInteractionEvents[_0xb7de('0x4')](_0x219f61,_0x54d165);};}exports[_0xb7de('0x5')]=function(_0x3fa2f8){for(var _0x27e8ab=0x0,_0x12dc76=events[_0xb7de('0x6')];_0x27e8ab<_0x12dc76;_0x27e8ab++){var _0x28c892=events[_0x27e8ab];var _0x4e7710=createListener(_0xb7de('0x7')+_0x28c892,_0x3fa2f8);ChatInteractionEvents['on'](_0x28c892,_0x4e7710);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index cfb76a3..b4ddab2 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 _0xc34d=['chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','root','%s-%s','now','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put'];(function(_0x81a95,_0x49ec86){var _0x41518c=function(_0x4180c3){while(--_0x4180c3){_0x81a95['push'](_0x81a95['shift']());}};_0x41518c(++_0x49ec86);}(_0xc34d,0x1e9));var _0xdc34=function(_0x4bfd4a,_0x444995){_0x4bfd4a=_0x4bfd4a-0x0;var _0x4cd8a8=_0xc34d[_0x4bfd4a];return _0x4cd8a8;};'use strict';var multer=require('multer');var util=require(_0xdc34('0x0'));var path=require(_0xdc34('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc34('0x2'));var router=express[_0xdc34('0x3')]();var fs_extra=require(_0xdc34('0x4'));var auth=require(_0xdc34('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdc34('0x6'));var controller=require(_0xdc34('0x7'));router['get']('/',auth[_0xdc34('0x8')](),controller[_0xdc34('0x9')]);router[_0xdc34('0xa')](_0xdc34('0xb'),auth[_0xdc34('0x8')](),controller[_0xdc34('0xc')]);router[_0xdc34('0xa')](_0xdc34('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xdc34('0xe')]);router['get']('/:id/attachment_download',auth[_0xdc34('0xf')](),controller[_0xdc34('0x10')]);router[_0xdc34('0xa')](_0xdc34('0x11'),auth[_0xdc34('0x8')](),controller[_0xdc34('0x12')]);router[_0xdc34('0xa')](_0xdc34('0x13'),auth[_0xdc34('0xf')](),controller[_0xdc34('0x14')]);router[_0xdc34('0xa')](_0xdc34('0x15'),auth[_0xdc34('0x8')](),controller[_0xdc34('0x16')]);router['post']('/',auth[_0xdc34('0x8')](),controller[_0xdc34('0x17')]);router[_0xdc34('0x18')](_0xdc34('0x19'),auth[_0xdc34('0x8')](),controller[_0xdc34('0x1a')]);var upload=multer({'storage':multer[_0xdc34('0x1b')]({'destination':function(_0x45b6eb,_0xfbadfc,_0x5f2ba9){_0x5f2ba9(null,path['join'](config[_0xdc34('0x1c')],'server/files/attachments/'));},'filename':function(_0xa3e0f5,_0x4aec9e,_0x54abef){_0x54abef(null,util['format'](_0xdc34('0x1d'),Date[_0xdc34('0x1e')](),_0x4aec9e['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdc34('0x18')](_0xdc34('0x1f'),upload[_0xdc34('0x20')](_0xdc34('0x21')),controller[_0xdc34('0x22')]);router['post']('/:id/messages',auth[_0xdc34('0xf')](),controller[_0xdc34('0x23')]);router[_0xdc34('0x18')](_0xdc34('0x24'),auth[_0xdc34('0x8')](),interaction[_0xdc34('0x25')](_0xdc34('0x26'),_0xdc34('0x27')),controller['addTags']);router[_0xdc34('0x28')](_0xdc34('0xd'),auth[_0xdc34('0x8')](),interaction[_0xdc34('0x25')](_0xdc34('0x26'),_0xdc34('0x29')),controller[_0xdc34('0x2a')]);router[_0xdc34('0x28')](_0xdc34('0x2b'),controller[_0xdc34('0x2c')]);router[_0xdc34('0x28')](_0xdc34('0x2d'),auth[_0xdc34('0xf')](),controller[_0xdc34('0x2e')]);router[_0xdc34('0x28')](_0xdc34('0x2f'),controller[_0xdc34('0x30')]);router[_0xdc34('0x31')](_0xdc34('0xd'),auth[_0xdc34('0x8')](),interaction[_0xdc34('0x25')](_0xdc34('0x26'),_0xdc34('0x32')),controller[_0xdc34('0x33')]);router[_0xdc34('0x31')](_0xdc34('0x24'),auth[_0xdc34('0x8')](),controller[_0xdc34('0x34')]);module['exports']=router;
\ No newline at end of file
+var _0x1f4c=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMyMessages','create','post','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','exports','multer'];(function(_0x69ba74,_0x587a85){var _0x4b32e4=function(_0xc13461){while(--_0xc13461){_0x69ba74['push'](_0x69ba74['shift']());}};_0x4b32e4(++_0x587a85);}(_0x1f4c,0xd7));var _0xc1f4=function(_0x163876,_0x1c4181){_0x163876=_0x163876-0x0;var _0x13a661=_0x1f4c[_0x163876];return _0x13a661;};'use strict';var multer=require(_0xc1f4('0x0'));var util=require(_0xc1f4('0x1'));var path=require(_0xc1f4('0x2'));var timeout=require(_0xc1f4('0x3'));var express=require(_0xc1f4('0x4'));var router=express[_0xc1f4('0x5')]();var fs_extra=require(_0xc1f4('0x6'));var auth=require(_0xc1f4('0x7'));var interaction=require(_0xc1f4('0x8'));var config=require(_0xc1f4('0x9'));var controller=require(_0xc1f4('0xa'));router[_0xc1f4('0xb')]('/',auth[_0xc1f4('0xc')](),controller[_0xc1f4('0xd')]);router[_0xc1f4('0xb')](_0xc1f4('0xe'),auth[_0xc1f4('0xc')](),controller[_0xc1f4('0xf')]);router[_0xc1f4('0xb')](_0xc1f4('0x10'),auth[_0xc1f4('0x11')](),controller[_0xc1f4('0x12')]);router['get'](_0xc1f4('0x13'),auth['isChatInteractionAuthorized'](),controller[_0xc1f4('0x14')]);router['get'](_0xc1f4('0x15'),auth[_0xc1f4('0xc')](),controller['getMessages']);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0xc1f4('0x16')]);router[_0xc1f4('0xb')]('/:id/download',auth[_0xc1f4('0xc')](),controller['download']);router['post']('/',auth[_0xc1f4('0xc')](),controller[_0xc1f4('0x17')]);router[_0xc1f4('0x18')]('/:id/vidaoo',auth[_0xc1f4('0xc')](),controller[_0xc1f4('0x19')]);var upload=multer({'storage':multer[_0xc1f4('0x1a')]({'destination':function(_0x3eced8,_0x1f2cbe,_0x16d60d){_0x16d60d(null,path[_0xc1f4('0x1b')](config[_0xc1f4('0x1c')],_0xc1f4('0x1d')));},'filename':function(_0x80473,_0x3ac525,_0x1eac38){_0x1eac38(null,util[_0xc1f4('0x1e')]('%s-%s',Date[_0xc1f4('0x1f')](),_0x3ac525[_0xc1f4('0x20')][_0xc1f4('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xc1f4('0x22'),upload[_0xc1f4('0x23')](_0xc1f4('0x24')),controller[_0xc1f4('0x25')]);router[_0xc1f4('0x18')]('/:id/messages',auth[_0xc1f4('0x11')](),controller['addMessage']);router[_0xc1f4('0x18')](_0xc1f4('0x26'),auth['isAuthenticated'](),interaction[_0xc1f4('0x27')](_0xc1f4('0x28'),'chatinteraction:addtags'),controller[_0xc1f4('0x29')]);router[_0xc1f4('0x2a')](_0xc1f4('0x10'),auth[_0xc1f4('0xc')](),interaction[_0xc1f4('0x27')](_0xc1f4('0x28'),_0xc1f4('0x2b')),controller[_0xc1f4('0x2c')]);router[_0xc1f4('0x2a')](_0xc1f4('0x2d'),controller[_0xc1f4('0x2e')]);router[_0xc1f4('0x2a')](_0xc1f4('0x2f'),auth[_0xc1f4('0x11')](),controller['abandon']);router[_0xc1f4('0x2a')](_0xc1f4('0x30'),controller[_0xc1f4('0x31')]);router['delete'](_0xc1f4('0x10'),auth[_0xc1f4('0xc')](),interaction[_0xc1f4('0x27')](_0xc1f4('0x28'),_0xc1f4('0x32')),controller[_0xc1f4('0x33')]);router[_0xc1f4('0x34')](_0xc1f4('0x26'),auth['isAuthenticated'](),controller['removeTags']);module[_0xc1f4('0x35')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 59b0fb2..8911450 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 _0x6d83=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x33f34e,_0x4fde5b){var _0x58dc01=function(_0x36e155){while(--_0x36e155){_0x33f34e['push'](_0x33f34e['shift']());}};_0x58dc01(++_0x4fde5b);}(_0x6d83,0x80));var _0x36d8=function(_0x23449d,_0x5395f4){_0x23449d=_0x23449d-0x0;var _0x1b78bb=_0x6d83[_0x23449d];return _0x1b78bb;};'use strict';var Sequelize=require(_0x36d8('0x0'));module[_0x36d8('0x1')]={'body':{'type':Sequelize[_0x36d8('0x2')](_0x36d8('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x36d8('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x36d8('0x5')]}};
\ No newline at end of file
+var _0xe223=['sequelize','exports','TEXT','BOOLEAN','INTEGER'];(function(_0x3bf2f7,_0x540f96){var _0x2e5307=function(_0x333beb){while(--_0x333beb){_0x3bf2f7['push'](_0x3bf2f7['shift']());}};_0x2e5307(++_0x540f96);}(_0xe223,0x1d1));var _0x3e22=function(_0x44f45f,_0x2ae023){_0x44f45f=_0x44f45f-0x0;var _0x985a3c=_0xe223[_0x44f45f];return _0x985a3c;};'use strict';var Sequelize=require(_0x3e22('0x0'));module[_0x3e22('0x1')]={'body':{'type':Sequelize[_0x3e22('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3e22('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3e22('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index e223712..d191292 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 _0xa1d1=['role','userpic','allowmessenger','showWebBar','sort','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','resourceId','push','FromId','ToId','read','all','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatInternalMessage.socket','sendStatus','end','status','json','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','name','ChatInternalMessage','rawAttributes','fieldName','map','query','filters','model','attributes','intersection','fields','hasOwnProperty','order','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','length','create','body','params','find','describe','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user'];(function(_0x274600,_0x100ccf){var _0xef0f9c=function(_0x2961a0){while(--_0x2961a0){_0x274600['push'](_0x274600['shift']());}};_0xef0f9c(++_0x100ccf);}(_0xa1d1,0x71));var _0x1a1d=function(_0x20ae2f,_0x455457){_0x20ae2f=_0x20ae2f-0x0;var _0x47adce=_0xa1d1[_0x20ae2f];return _0x47adce;};'use strict';var emlformat=require(_0x1a1d('0x0'));var rimraf=require(_0x1a1d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a1d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1a1d('0x3'));var util=require(_0x1a1d('0x4'));var path=require(_0x1a1d('0x5'));var sox=require(_0x1a1d('0x6'));var csv=require(_0x1a1d('0x7'));var ejs=require(_0x1a1d('0x8'));var fs=require('fs');var fs_extra=require(_0x1a1d('0x9'));var _=require('lodash');var squel=require(_0x1a1d('0xa'));var crypto=require(_0x1a1d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1a1d('0xc'));var toCsv=require(_0x1a1d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1a1d('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x1a1d('0xe'));var hardwareService=require(_0x1a1d('0xf'));var logger=require(_0x1a1d('0x10'))(_0x1a1d('0x11'));var utils=require('../../config/utils');var config=require(_0x1a1d('0x12'));var licenseUtil=require(_0x1a1d('0x13'));var db=require(_0x1a1d('0x14'))['db'];config[_0x1a1d('0x15')]=_['defaults'](config[_0x1a1d('0x15')],{'host':_0x1a1d('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a1d('0x15')]));require(_0x1a1d('0x17'))['register'](socket);function respondWithStatusCode(_0xe96cb9,_0x44981f){_0x44981f=_0x44981f||0xcc;return function(_0x59b0a4){if(_0x59b0a4){return _0xe96cb9[_0x1a1d('0x18')](_0x44981f);}return _0xe96cb9['status'](_0x44981f)[_0x1a1d('0x19')]();};}function respondWithResult(_0x183a7e,_0x55cb4b){_0x55cb4b=_0x55cb4b||0xc8;return function(_0x38f429){if(_0x38f429){return _0x183a7e[_0x1a1d('0x1a')](_0x55cb4b)[_0x1a1d('0x1b')](_0x38f429);}};}function respondWithFilteredResult(_0x47ef30,_0x116684){return function(_0x54cb9d){if(_0x54cb9d){var _0xecbd9d=typeof _0x116684['offset']==='undefined'&&typeof _0x116684[_0x1a1d('0x1c')]==='undefined';var _0x30db76=_0x54cb9d[_0x1a1d('0x1d')];var _0x11521c=_0xecbd9d?0x0:_0x116684[_0x1a1d('0x1e')];var _0x523873=_0xecbd9d?_0x54cb9d['count']:_0x116684[_0x1a1d('0x1e')]+_0x116684[_0x1a1d('0x1c')];var _0x47e577;if(_0x523873>=_0x30db76){_0x523873=_0x30db76;_0x47e577=0xc8;}else{_0x47e577=0xce;}_0x47ef30[_0x1a1d('0x1a')](_0x47e577);return _0x47ef30[_0x1a1d('0x1f')](_0x1a1d('0x20'),_0x11521c+'-'+_0x523873+'/'+_0x30db76)[_0x1a1d('0x1b')](_0x54cb9d);}return null;};}function patchUpdates(_0xf4679e){return function(_0x57e7f2){try{jsonpatch[_0x1a1d('0x21')](_0x57e7f2,_0xf4679e,!![]);}catch(_0x19c6e1){return BPromise['reject'](_0x19c6e1);}return _0x57e7f2[_0x1a1d('0x22')]();};}function saveUpdates(_0x1a83b5,_0x29bf02){return function(_0xb27b72){if(_0xb27b72){return _0xb27b72[_0x1a1d('0x23')](_0x1a83b5)[_0x1a1d('0x24')](function(_0x581f35){return _0x581f35;});}return null;};}function removeEntity(_0x414547,_0x2af664){return function(_0x48eee1){if(_0x48eee1){return _0x48eee1[_0x1a1d('0x25')]()[_0x1a1d('0x24')](function(){_0x414547[_0x1a1d('0x1a')](0xcc)[_0x1a1d('0x19')]();});}};}function handleEntityNotFound(_0x1c8712,_0x39536f){return function(_0x348f9f){if(!_0x348f9f){_0x1c8712[_0x1a1d('0x18')](0x194);}return _0x348f9f;};}function handleError(_0x3013ad,_0x2ada71){_0x2ada71=_0x2ada71||0x1f4;return function(_0x33c6f2){logger['error'](_0x33c6f2['stack']);if(_0x33c6f2['name']){delete _0x33c6f2[_0x1a1d('0x26')];}_0x3013ad[_0x1a1d('0x1a')](_0x2ada71)['send'](_0x33c6f2);};}exports['index']=function(_0x1ddf0f,_0x531cc7){var _0x2e14a1={},_0x36cd17={},_0xe2150a={'count':0x0,'rows':[]};var _0x389dce=_['map'](db[_0x1a1d('0x27')][_0x1a1d('0x28')],function(_0x43e92d){return{'name':_0x43e92d[_0x1a1d('0x29')],'type':_0x43e92d['type']['key']};});_0x36cd17['model']=_[_0x1a1d('0x2a')](_0x389dce,'name');_0x36cd17[_0x1a1d('0x2b')]=_['keys'](_0x1ddf0f['query']);_0x36cd17[_0x1a1d('0x2c')]=_['intersection'](_0x36cd17[_0x1a1d('0x2d')],_0x36cd17[_0x1a1d('0x2b')]);_0x2e14a1[_0x1a1d('0x2e')]=_[_0x1a1d('0x2f')](_0x36cd17[_0x1a1d('0x2d')],qs['fields'](_0x1ddf0f[_0x1a1d('0x2b')][_0x1a1d('0x30')]));_0x2e14a1['attributes']=_0x2e14a1['attributes']['length']?_0x2e14a1[_0x1a1d('0x2e')]:_0x36cd17[_0x1a1d('0x2d')];if(!_0x1ddf0f[_0x1a1d('0x2b')][_0x1a1d('0x31')]('nolimit')){_0x2e14a1[_0x1a1d('0x1c')]=qs[_0x1a1d('0x1c')](_0x1ddf0f['query'][_0x1a1d('0x1c')]);_0x2e14a1[_0x1a1d('0x1e')]=qs[_0x1a1d('0x1e')](_0x1ddf0f['query']['offset']);}_0x2e14a1[_0x1a1d('0x32')]=qs['sort'](_0x1ddf0f[_0x1a1d('0x2b')]['sort']);_0x2e14a1[_0x1a1d('0x33')]=qs[_0x1a1d('0x2c')](_[_0x1a1d('0x34')](_0x1ddf0f[_0x1a1d('0x2b')],_0x36cd17[_0x1a1d('0x2c')]),_0x389dce);if(_0x1ddf0f['query']['filter']){_0x2e14a1[_0x1a1d('0x33')]=_['merge'](_0x2e14a1[_0x1a1d('0x33')],{'$or':_[_0x1a1d('0x2a')](_0x389dce,function(_0x457f05){if(_0x457f05[_0x1a1d('0x35')]!==_0x1a1d('0x36')){var _0x218da5={};_0x218da5[_0x457f05[_0x1a1d('0x26')]]={'$like':'%'+_0x1ddf0f[_0x1a1d('0x2b')][_0x1a1d('0x37')]+'%'};return _0x218da5;}})});}_0x2e14a1=_[_0x1a1d('0x38')]({},_0x2e14a1,_0x1ddf0f[_0x1a1d('0x39')]);var _0x60194d={'where':_0x2e14a1['where']};return db[_0x1a1d('0x27')]['count'](_0x60194d)[_0x1a1d('0x24')](function(_0x44e137){_0xe2150a[_0x1a1d('0x1d')]=_0x44e137;if(_0x1ddf0f[_0x1a1d('0x2b')][_0x1a1d('0x3a')]){_0x2e14a1[_0x1a1d('0x3b')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x1a1d('0x3c')](_0x2e14a1);})[_0x1a1d('0x24')](function(_0x2d7def){_0xe2150a[_0x1a1d('0x3d')]=_0x2d7def;return _0xe2150a;})['then'](respondWithFilteredResult(_0x531cc7,_0x2e14a1))[_0x1a1d('0x3e')](handleError(_0x531cc7,null));};exports[_0x1a1d('0x3f')]=function(_0x597848,_0x425c86){var _0x56c771={'raw':!![],'where':{'id':_0x597848['params']['id']}},_0x24ac59={};_0x24ac59[_0x1a1d('0x2d')]=_[_0x1a1d('0x40')](db[_0x1a1d('0x27')][_0x1a1d('0x28')]);_0x24ac59[_0x1a1d('0x2b')]=_['keys'](_0x597848[_0x1a1d('0x2b')]);_0x24ac59[_0x1a1d('0x2c')]=_[_0x1a1d('0x2f')](_0x24ac59[_0x1a1d('0x2d')],_0x24ac59[_0x1a1d('0x2b')]);_0x56c771[_0x1a1d('0x2e')]=_[_0x1a1d('0x2f')](_0x24ac59['model'],qs[_0x1a1d('0x30')](_0x597848['query'][_0x1a1d('0x30')]));_0x56c771[_0x1a1d('0x2e')]=_0x56c771[_0x1a1d('0x2e')][_0x1a1d('0x41')]?_0x56c771[_0x1a1d('0x2e')]:_0x24ac59['model'];if(_0x597848[_0x1a1d('0x2b')]['includeAll']){_0x56c771[_0x1a1d('0x3b')]=[{'all':!![]}];}_0x56c771=_[_0x1a1d('0x38')]({},_0x56c771,_0x597848[_0x1a1d('0x39')]);return db[_0x1a1d('0x27')]['find'](_0x56c771)[_0x1a1d('0x24')](handleEntityNotFound(_0x425c86,null))[_0x1a1d('0x24')](respondWithResult(_0x425c86,null))[_0x1a1d('0x3e')](handleError(_0x425c86,null));};exports[_0x1a1d('0x42')]=function(_0x523997,_0x2ee4ec){return db[_0x1a1d('0x27')][_0x1a1d('0x42')](_0x523997[_0x1a1d('0x43')],{})[_0x1a1d('0x24')](respondWithResult(_0x2ee4ec,0xc9))[_0x1a1d('0x3e')](handleError(_0x2ee4ec,null));};exports[_0x1a1d('0x23')]=function(_0x261391,_0x2eed4d){if(_0x261391[_0x1a1d('0x43')]['id']){delete _0x261391[_0x1a1d('0x43')]['id'];}return db[_0x1a1d('0x27')]['find']({'where':{'id':_0x261391[_0x1a1d('0x44')]['id']}})[_0x1a1d('0x24')](handleEntityNotFound(_0x2eed4d,null))[_0x1a1d('0x24')](saveUpdates(_0x261391['body'],null))['then'](respondWithResult(_0x2eed4d,null))[_0x1a1d('0x3e')](handleError(_0x2eed4d,null));};exports[_0x1a1d('0x25')]=function(_0x5664c8,_0x5ab965){return db[_0x1a1d('0x27')][_0x1a1d('0x45')]({'where':{'id':_0x5664c8['params']['id']}})[_0x1a1d('0x24')](handleEntityNotFound(_0x5ab965,null))[_0x1a1d('0x24')](removeEntity(_0x5ab965,null))[_0x1a1d('0x3e')](handleError(_0x5ab965,null));};exports['describe']=function(_0x19debe,_0x4ab450){return db[_0x1a1d('0x27')][_0x1a1d('0x46')]()[_0x1a1d('0x24')](respondWithResult(_0x4ab450,null))['catch'](handleError(_0x4ab450,null));};function wrapUser(_0x48a62a){return function(_0x5a42f7){var _0x4c3e8d=_0x48a62a['get']({'plain':!![]});_0x4c3e8d[_0x1a1d('0x47')]=[];if(_0x5a42f7){_0x4c3e8d[_0x1a1d('0x48')]=_0x5a42f7[_0x1a1d('0x49')];_0x4c3e8d[_0x1a1d('0x4a')]=_0x5a42f7;}else{_0x4c3e8d[_0x1a1d('0x48')]=moment(0x0)['format'](_0x1a1d('0x4b'));_0x4c3e8d[_0x1a1d('0x4a')]={};}return _0x4c3e8d;};}exports[_0x1a1d('0x4c')]=function(_0x135878,_0x75856c,_0x93b716){var _0x1bd661=[];return db[_0x1a1d('0x4d')][_0x1a1d('0x3c')]({'where':{'role':[_0x1a1d('0x4e'),_0x1a1d('0x4f'),_0x1a1d('0x50')]},'attributes':['id','fullname','name',_0x1a1d('0x51'),_0x1a1d('0x52'),'internal','online','lastLoginAt',_0x1a1d('0x53'),_0x1a1d('0x54')],'order':qs[_0x1a1d('0x55')](_0x1a1d('0x56')),'include':[{'model':db[_0x1a1d('0x57')],'as':'VoiceQueues','attributes':['id',_0x1a1d('0x26'),_0x1a1d('0x35')],'through':{'attributes':[]}}]})[_0x1a1d('0x24')](function(_0x2decd9){if(_0x2decd9){var _0xc8eca7=_0x135878[_0x1a1d('0x50')]['get']({'plain':!![]});if(!_0xc8eca7)throw new Error(_0x1a1d('0x58'));if(_0xc8eca7[_0x1a1d('0x51')]===_0x1a1d('0x50')){return db[_0x1a1d('0x59')][_0x1a1d('0x45')]({'where':{'name':_0x1a1d('0x5a'),'userProfileId':_0xc8eca7['userProfileId']},'raw':!![]})[_0x1a1d('0x24')](function(_0x5c9171){if(_0x5c9171){if(_0x5c9171['autoAssociation']===0x0){return db['UserProfileResource'][_0x1a1d('0x3c')]({'where':{'sectionId':_0x5c9171['id']},'raw':!![]})[_0x1a1d('0x24')](function(_0x1aa751){var _0xc2913a=[];if(_['isEmpty'](_0x1aa751)){_0xc2913a=_[_0x1a1d('0x37')](_0x2decd9,function(_0x404b0a){if(_0x404b0a[_0x1a1d('0x51')]!==_0x1a1d('0x4e')){return _0x404b0a;}});return _0xc2913a;}else{for(var _0x1db02e=0x0;_0x1db02e<_0x2decd9[_0x1a1d('0x41')];_0x1db02e++){var _0x8c010b=_0x2decd9[_0x1db02e];if(_0x8c010b[_0x1a1d('0x51')]==='agent'){var _0x14a6af=_['find'](_0x1aa751,function(_0x1fb6f5){return _0x1fb6f5[_0x1a1d('0x5b')]===_0x8c010b['id'];});if(_0x14a6af)_0xc2913a['push'](_0x8c010b);}else{_0xc2913a['push'](_0x8c010b);}}return _0xc2913a;}});}else{return _0x2decd9;}}else{var _0x1cb573=_[_0x1a1d('0x37')](_0x2decd9,function(_0x397dfe){if(_0x397dfe['role']!==_0x1a1d('0x4e')){return _0x397dfe;}});return _0x1cb573;}});}else{return _0x2decd9;}}})['then'](function(_0x518f8b){var _0x56d426=[];if(_0x518f8b){_0x1bd661=_0x518f8b;for(var _0x53a9fd=0x0;_0x53a9fd<_0x518f8b[_0x1a1d('0x41')];_0x53a9fd+=0x1){_0x1bd661[_0x53a9fd]['messages']=[];_0x56d426[_0x1a1d('0x5c')](db[_0x1a1d('0x27')][_0x1a1d('0x45')]({'where':{'FromId':[_0x135878[_0x1a1d('0x50')]['id'],_0x518f8b[_0x53a9fd]['id']],'ToId':[_0x135878['user']['id'],_0x518f8b[_0x53a9fd]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x1a1d('0x5d'),_0x1a1d('0x5e'),_0x1a1d('0x5f'),_0x1a1d('0x43')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x1a1d('0x24')](wrapUser(_0x518f8b[_0x53a9fd])));}return BPromise[_0x1a1d('0x60')](_0x56d426);}return[];})['then'](function(_0x5cdf6a){return{'rows':_0x5cdf6a,'count':_0x5cdf6a[_0x1a1d('0x41')]};})['then'](respondWithResult(_0x75856c,null))['catch'](handleError(_0x75856c,null));};
\ No newline at end of file
+var _0x47a2=['./chatInternalMessage.socket','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','ChatInternalMessage','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','role','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','socket.io-emitter'];(function(_0xddd0c9,_0x204372){var _0x514258=function(_0x5021e0){while(--_0x5021e0){_0xddd0c9['push'](_0xddd0c9['shift']());}};_0x514258(++_0x204372);}(_0x47a2,0xbf));var _0x247a=function(_0x58de16,_0x2cc1f5){_0x58de16=_0x58de16-0x0;var _0x48ff5c=_0x47a2[_0x58de16];return _0x48ff5c;};'use strict';var emlformat=require(_0x247a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x247a('0x1'));var jsonpatch=require(_0x247a('0x2'));var rp=require(_0x247a('0x3'));var moment=require(_0x247a('0x4'));var BPromise=require(_0x247a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x247a('0x6'));var sox=require(_0x247a('0x7'));var csv=require(_0x247a('0x8'));var ejs=require(_0x247a('0x9'));var fs=require('fs');var fs_extra=require(_0x247a('0xa'));var _=require(_0x247a('0xb'));var squel=require(_0x247a('0xc'));var crypto=require('crypto');var jsforce=require(_0x247a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x247a('0x8'));var querystring=require(_0x247a('0xe'));var Papa=require(_0x247a('0xf'));var Redis=require(_0x247a('0x10'));var authService=require(_0x247a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x247a('0x12'));var logger=require(_0x247a('0x13'))(_0x247a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x247a('0x15'));var db=require(_0x247a('0x16'))['db'];config['redis']=_['defaults'](config[_0x247a('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x247a('0x18'))(new Redis(config['redis']));require(_0x247a('0x19'))['register'](socket);function respondWithStatusCode(_0x3e9a84,_0x1ee099){_0x1ee099=_0x1ee099||0xcc;return function(_0x3304fe){if(_0x3304fe){return _0x3e9a84[_0x247a('0x1a')](_0x1ee099);}return _0x3e9a84[_0x247a('0x1b')](_0x1ee099)[_0x247a('0x1c')]();};}function respondWithResult(_0x324c31,_0x3af2ce){_0x3af2ce=_0x3af2ce||0xc8;return function(_0x1b3e5d){if(_0x1b3e5d){return _0x324c31[_0x247a('0x1b')](_0x3af2ce)[_0x247a('0x1d')](_0x1b3e5d);}};}function respondWithFilteredResult(_0x2f3d71,_0x13be60){return function(_0x3a9671){if(_0x3a9671){var _0xda5bec=typeof _0x13be60[_0x247a('0x1e')]==='undefined'&&typeof _0x13be60[_0x247a('0x1f')]==='undefined';var _0x1416fc=_0x3a9671[_0x247a('0x20')];var _0x9e4b08=_0xda5bec?0x0:_0x13be60[_0x247a('0x1e')];var _0x503940=_0xda5bec?_0x3a9671[_0x247a('0x20')]:_0x13be60[_0x247a('0x1e')]+_0x13be60['limit'];var _0x16491c;if(_0x503940>=_0x1416fc){_0x503940=_0x1416fc;_0x16491c=0xc8;}else{_0x16491c=0xce;}_0x2f3d71[_0x247a('0x1b')](_0x16491c);return _0x2f3d71[_0x247a('0x21')](_0x247a('0x22'),_0x9e4b08+'-'+_0x503940+'/'+_0x1416fc)[_0x247a('0x1d')](_0x3a9671);}return null;};}function patchUpdates(_0x1c6b77){return function(_0x3b1edc){try{jsonpatch[_0x247a('0x23')](_0x3b1edc,_0x1c6b77,!![]);}catch(_0xbe9f91){return BPromise[_0x247a('0x24')](_0xbe9f91);}return _0x3b1edc[_0x247a('0x25')]();};}function saveUpdates(_0x2768b5,_0x406399){return function(_0x41636a){if(_0x41636a){return _0x41636a[_0x247a('0x26')](_0x2768b5)[_0x247a('0x27')](function(_0x17848d){return _0x17848d;});}return null;};}function removeEntity(_0x4af52d,_0x5e0afb){return function(_0x16eba3){if(_0x16eba3){return _0x16eba3['destroy']()['then'](function(){_0x4af52d[_0x247a('0x1b')](0xcc)[_0x247a('0x1c')]();});}};}function handleEntityNotFound(_0x1d2d05,_0x4f4f2e){return function(_0x25c740){if(!_0x25c740){_0x1d2d05[_0x247a('0x1a')](0x194);}return _0x25c740;};}function handleError(_0x2d0db2,_0x105637){_0x105637=_0x105637||0x1f4;return function(_0x4ba860){logger['error'](_0x4ba860[_0x247a('0x28')]);if(_0x4ba860[_0x247a('0x29')]){delete _0x4ba860[_0x247a('0x29')];}_0x2d0db2[_0x247a('0x1b')](_0x105637)[_0x247a('0x2a')](_0x4ba860);};}exports[_0x247a('0x2b')]=function(_0x34ccc4,_0x3bc3ec){var _0x3d4c39={},_0x1c8690={},_0x19dcf8={'count':0x0,'rows':[]};var _0x51346b=_[_0x247a('0x2c')](db['ChatInternalMessage']['rawAttributes'],function(_0x5bb3e9){return{'name':_0x5bb3e9['fieldName'],'type':_0x5bb3e9[_0x247a('0x2d')][_0x247a('0x2e')]};});_0x1c8690['model']=_['map'](_0x51346b,_0x247a('0x29'));_0x1c8690['query']=_[_0x247a('0x2f')](_0x34ccc4[_0x247a('0x30')]);_0x1c8690[_0x247a('0x31')]=_[_0x247a('0x32')](_0x1c8690[_0x247a('0x33')],_0x1c8690['query']);_0x3d4c39['attributes']=_[_0x247a('0x32')](_0x1c8690['model'],qs[_0x247a('0x34')](_0x34ccc4['query'][_0x247a('0x34')]));_0x3d4c39[_0x247a('0x35')]=_0x3d4c39[_0x247a('0x35')][_0x247a('0x36')]?_0x3d4c39[_0x247a('0x35')]:_0x1c8690[_0x247a('0x33')];if(!_0x34ccc4[_0x247a('0x30')][_0x247a('0x37')](_0x247a('0x38'))){_0x3d4c39[_0x247a('0x1f')]=qs['limit'](_0x34ccc4[_0x247a('0x30')]['limit']);_0x3d4c39[_0x247a('0x1e')]=qs['offset'](_0x34ccc4['query'][_0x247a('0x1e')]);}_0x3d4c39[_0x247a('0x39')]=qs[_0x247a('0x3a')](_0x34ccc4[_0x247a('0x30')][_0x247a('0x3a')]);_0x3d4c39['where']=qs[_0x247a('0x31')](_[_0x247a('0x3b')](_0x34ccc4[_0x247a('0x30')],_0x1c8690['filters']),_0x51346b);if(_0x34ccc4[_0x247a('0x30')]['filter']){_0x3d4c39[_0x247a('0x3c')]=_[_0x247a('0x3d')](_0x3d4c39['where'],{'$or':_[_0x247a('0x2c')](_0x51346b,function(_0x4a3893){if(_0x4a3893[_0x247a('0x2d')]!==_0x247a('0x3e')){var _0x4dc239={};_0x4dc239[_0x4a3893[_0x247a('0x29')]]={'$like':'%'+_0x34ccc4[_0x247a('0x30')][_0x247a('0x3f')]+'%'};return _0x4dc239;}})});}_0x3d4c39=_[_0x247a('0x3d')]({},_0x3d4c39,_0x34ccc4[_0x247a('0x40')]);var _0x455e36={'where':_0x3d4c39[_0x247a('0x3c')]};return db['ChatInternalMessage'][_0x247a('0x20')](_0x455e36)[_0x247a('0x27')](function(_0x5a4f65){_0x19dcf8[_0x247a('0x20')]=_0x5a4f65;if(_0x34ccc4[_0x247a('0x30')]['includeAll']){_0x3d4c39[_0x247a('0x41')]=[{'all':!![]}];}return db[_0x247a('0x42')][_0x247a('0x43')](_0x3d4c39);})['then'](function(_0x44c8da){_0x19dcf8['rows']=_0x44c8da;return _0x19dcf8;})[_0x247a('0x27')](respondWithFilteredResult(_0x3bc3ec,_0x3d4c39))[_0x247a('0x44')](handleError(_0x3bc3ec,null));};exports[_0x247a('0x45')]=function(_0x402299,_0x5cdcb3){var _0x111b2f={'raw':!![],'where':{'id':_0x402299[_0x247a('0x46')]['id']}},_0x26812d={};_0x26812d[_0x247a('0x33')]=_[_0x247a('0x2f')](db[_0x247a('0x42')][_0x247a('0x47')]);_0x26812d[_0x247a('0x30')]=_[_0x247a('0x2f')](_0x402299['query']);_0x26812d[_0x247a('0x31')]=_[_0x247a('0x32')](_0x26812d['model'],_0x26812d[_0x247a('0x30')]);_0x111b2f['attributes']=_[_0x247a('0x32')](_0x26812d[_0x247a('0x33')],qs['fields'](_0x402299[_0x247a('0x30')][_0x247a('0x34')]));_0x111b2f[_0x247a('0x35')]=_0x111b2f['attributes']['length']?_0x111b2f[_0x247a('0x35')]:_0x26812d[_0x247a('0x33')];if(_0x402299[_0x247a('0x30')][_0x247a('0x48')]){_0x111b2f['include']=[{'all':!![]}];}_0x111b2f=_[_0x247a('0x3d')]({},_0x111b2f,_0x402299['options']);return db[_0x247a('0x42')][_0x247a('0x49')](_0x111b2f)[_0x247a('0x27')](handleEntityNotFound(_0x5cdcb3,null))[_0x247a('0x27')](respondWithResult(_0x5cdcb3,null))['catch'](handleError(_0x5cdcb3,null));};exports[_0x247a('0x4a')]=function(_0x6cb1a0,_0x3f0868){return db[_0x247a('0x42')][_0x247a('0x4a')](_0x6cb1a0['body'],{})[_0x247a('0x27')](respondWithResult(_0x3f0868,0xc9))['catch'](handleError(_0x3f0868,null));};exports[_0x247a('0x26')]=function(_0x355c9b,_0x10a876){if(_0x355c9b[_0x247a('0x4b')]['id']){delete _0x355c9b[_0x247a('0x4b')]['id'];}return db[_0x247a('0x42')][_0x247a('0x49')]({'where':{'id':_0x355c9b['params']['id']}})[_0x247a('0x27')](handleEntityNotFound(_0x10a876,null))[_0x247a('0x27')](saveUpdates(_0x355c9b[_0x247a('0x4b')],null))[_0x247a('0x27')](respondWithResult(_0x10a876,null))[_0x247a('0x44')](handleError(_0x10a876,null));};exports['destroy']=function(_0x4370a7,_0x4becbd){return db['ChatInternalMessage']['find']({'where':{'id':_0x4370a7[_0x247a('0x46')]['id']}})['then'](handleEntityNotFound(_0x4becbd,null))[_0x247a('0x27')](removeEntity(_0x4becbd,null))[_0x247a('0x44')](handleError(_0x4becbd,null));};exports[_0x247a('0x4c')]=function(_0x15e01f,_0x3a5417){return db[_0x247a('0x42')][_0x247a('0x4c')]()[_0x247a('0x27')](respondWithResult(_0x3a5417,null))['catch'](handleError(_0x3a5417,null));};function wrapUser(_0x349196){return function(_0x129a36){var _0x5ce7bf=_0x349196[_0x247a('0x4d')]({'plain':!![]});_0x5ce7bf[_0x247a('0x4e')]=[];if(_0x129a36){_0x5ce7bf[_0x247a('0x4f')]=_0x129a36[_0x247a('0x50')];_0x5ce7bf[_0x247a('0x51')]=_0x129a36;}else{_0x5ce7bf[_0x247a('0x4f')]=moment(0x0)[_0x247a('0x52')](_0x247a('0x53'));_0x5ce7bf['lastMessage']={};}return _0x5ce7bf;};}exports[_0x247a('0x54')]=function(_0x1880ce,_0x5a2b2a,_0x2781a1){var _0x55e908=[];return db[_0x247a('0x55')][_0x247a('0x43')]({'where':{'role':[_0x247a('0x56'),_0x247a('0x57'),'user']},'attributes':['id','fullname',_0x247a('0x29'),_0x247a('0x58'),'userpic','internal',_0x247a('0x59'),_0x247a('0x5a'),_0x247a('0x5b'),_0x247a('0x5c')],'order':qs[_0x247a('0x3a')]('-online'),'include':[{'model':db[_0x247a('0x5d')],'as':_0x247a('0x5e'),'attributes':['id',_0x247a('0x29'),_0x247a('0x2d')],'through':{'attributes':[]}}]})[_0x247a('0x27')](function(_0x48a572){if(_0x48a572){var _0x423903=_0x1880ce[_0x247a('0x5f')][_0x247a('0x4d')]({'plain':!![]});if(!_0x423903)throw new Error(_0x247a('0x60'));if(_0x423903[_0x247a('0x58')]===_0x247a('0x5f')){return db[_0x247a('0x61')][_0x247a('0x49')]({'where':{'name':_0x247a('0x62'),'userProfileId':_0x423903['userProfileId']},'raw':!![]})['then'](function(_0x3efba9){if(_0x3efba9){if(_0x3efba9[_0x247a('0x63')]===0x0){return db[_0x247a('0x64')][_0x247a('0x43')]({'where':{'sectionId':_0x3efba9['id']},'raw':!![]})[_0x247a('0x27')](function(_0x410787){var _0x14029c=[];if(_[_0x247a('0x65')](_0x410787)){_0x14029c=_[_0x247a('0x3f')](_0x48a572,function(_0x2c739e){if(_0x2c739e['role']!==_0x247a('0x56')){return _0x2c739e;}});return _0x14029c;}else{for(var _0x4fb1a3=0x0;_0x4fb1a3<_0x48a572[_0x247a('0x36')];_0x4fb1a3++){var _0x1f2f42=_0x48a572[_0x4fb1a3];if(_0x1f2f42[_0x247a('0x58')]==='agent'){var _0x7b284b=_['find'](_0x410787,function(_0x225ecc){return _0x225ecc[_0x247a('0x66')]===_0x1f2f42['id'];});if(_0x7b284b)_0x14029c[_0x247a('0x67')](_0x1f2f42);}else{_0x14029c['push'](_0x1f2f42);}}return _0x14029c;}});}else{return _0x48a572;}}else{var _0x4513c1=_[_0x247a('0x3f')](_0x48a572,function(_0x1e13b5){if(_0x1e13b5[_0x247a('0x58')]!=='agent'){return _0x1e13b5;}});return _0x4513c1;}});}else{return _0x48a572;}}})[_0x247a('0x27')](function(_0x17cdb6){var _0x23ae76=[];if(_0x17cdb6){_0x55e908=_0x17cdb6;for(var _0x3d034a=0x0;_0x3d034a<_0x17cdb6[_0x247a('0x36')];_0x3d034a+=0x1){_0x55e908[_0x3d034a][_0x247a('0x4e')]=[];_0x23ae76['push'](db[_0x247a('0x42')][_0x247a('0x49')]({'where':{'FromId':[_0x1880ce[_0x247a('0x5f')]['id'],_0x17cdb6[_0x3d034a]['id']],'ToId':[_0x1880ce[_0x247a('0x5f')]['id'],_0x17cdb6[_0x3d034a]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x247a('0x68'),_0x247a('0x69'),_0x247a('0x6a'),_0x247a('0x4b')],'order':qs['sort'](_0x247a('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x17cdb6[_0x3d034a])));}return BPromise['all'](_0x23ae76);}return[];})[_0x247a('0x27')](function(_0x2bf899){return{'rows':_0x2bf899,'count':_0x2bf899['length']};})['then'](respondWithResult(_0x5a2b2a,null))['catch'](handleError(_0x5a2b2a,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 2c60a49..fefd55e 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 _0x3b48=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x186bfa,_0xae755f){var _0x458af4=function(_0x1f572d){while(--_0x1f572d){_0x186bfa['push'](_0x186bfa['shift']());}};_0x458af4(++_0xae755f);}(_0x3b48,0x1b1));var _0x83b4=function(_0x240315,_0x5888c8){_0x240315=_0x240315-0x0;var _0x1f0a1d=_0x3b48[_0x240315];return _0x1f0a1d;};'use strict';var EventEmitter=require(_0x83b4('0x0'));var ChatInternalMessage=require(_0x83b4('0x1'))['db'][_0x83b4('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x83b4('0x3')](0x0);var events={'afterCreate':_0x83b4('0x4'),'afterUpdate':_0x83b4('0x5'),'afterDestroy':_0x83b4('0x6')};function emitEvent(_0x559fc7){return function(_0x516c2a,_0x48a0f8,_0x2b7ca3){ChatInternalMessageEvents[_0x83b4('0x7')](_0x559fc7+':'+_0x516c2a['id'],_0x516c2a);ChatInternalMessageEvents[_0x83b4('0x7')](_0x559fc7,_0x516c2a);_0x2b7ca3(null);};}for(var e in events){if(events[_0x83b4('0x8')](e)){var event=events[e];ChatInternalMessage[_0x83b4('0x9')](e,emitEvent(event));}}module[_0x83b4('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xb923=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x8ee223,_0x3ecb7d){var _0x3adefb=function(_0x405385){while(--_0x405385){_0x8ee223['push'](_0x8ee223['shift']());}};_0x3adefb(++_0x3ecb7d);}(_0xb923,0x1a2));var _0x3b92=function(_0x265a39,_0x21b24a){_0x265a39=_0x265a39-0x0;var _0x4b9b52=_0xb923[_0x265a39];return _0x4b9b52;};'use strict';var EventEmitter=require(_0x3b92('0x0'));var ChatInternalMessage=require(_0x3b92('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3b92('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3b92('0x3'),'afterDestroy':_0x3b92('0x4')};function emitEvent(_0xb6b069){return function(_0x597b75,_0x2bcb94,_0x31d981){ChatInternalMessageEvents[_0x3b92('0x5')](_0xb6b069+':'+_0x597b75['id'],_0x597b75);ChatInternalMessageEvents[_0x3b92('0x5')](_0xb6b069,_0x597b75);_0x31d981(null);};}for(var e in events){if(events[_0x3b92('0x6')](e)){var event=events[e];ChatInternalMessage[_0x3b92('0x7')](e,emitEvent(event));}}module[_0x3b92('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 8b5c8d6..c3b0536 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 _0x7b50=['../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4322de,_0x4c21d3){var _0x3230f8=function(_0x337676){while(--_0x337676){_0x4322de['push'](_0x4322de['shift']());}};_0x3230f8(++_0x4c21d3);}(_0x7b50,0x1df));var _0x07b5=function(_0x4aaa22,_0x18bd75){_0x4aaa22=_0x4aaa22-0x0;var _0x40be29=_0x7b50[_0x4aaa22];return _0x40be29;};'use strict';var _=require(_0x07b5('0x0'));var util=require('util');var logger=require(_0x07b5('0x1'))(_0x07b5('0x2'));var moment=require(_0x07b5('0x3'));var BPromise=require(_0x07b5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x07b5('0x5'));var rimraf=require('rimraf');var config=require(_0x07b5('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0x07b5('0x7')]=function(_0x24d12d,_0x1929ad){return _0x24d12d[_0x07b5('0x8')]('ChatInternalMessage',attributes,{'tableName':_0x07b5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x07b5('0xa'),'collate':_0x07b5('0xb')});};
\ No newline at end of file
+var _0x0723=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xd1dc6,_0x4f64c5){var _0xa275ee=function(_0x3e2c44){while(--_0x3e2c44){_0xd1dc6['push'](_0xd1dc6['shift']());}};_0xa275ee(++_0x4f64c5);}(_0x0723,0x169));var _0x3072=function(_0x27153e,_0xe304d5){_0x27153e=_0x27153e-0x0;var _0x4b1254=_0x0723[_0x27153e];return _0x4b1254;};'use strict';var _=require(_0x3072('0x0'));var util=require(_0x3072('0x1'));var logger=require(_0x3072('0x2'))(_0x3072('0x3'));var moment=require(_0x3072('0x4'));var BPromise=require(_0x3072('0x5'));var rp=require(_0x3072('0x6'));var fs=require('fs');var path=require(_0x3072('0x7'));var rimraf=require(_0x3072('0x8'));var config=require(_0x3072('0x9'));var attributes=require(_0x3072('0xa'));module[_0x3072('0xb')]=function(_0x26ba78,_0x501629){return _0x26ba78[_0x3072('0xc')](_0x3072('0xd'),attributes,{'tableName':_0x3072('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3072('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index ab58ea6..eec429e 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 _0x5889=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','then','ChatInternalMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger'];(function(_0x556e0b,_0x413257){var _0x2e49ff=function(_0x44a9c2){while(--_0x44a9c2){_0x556e0b['push'](_0x556e0b['shift']());}};_0x2e49ff(++_0x413257);}(_0x5889,0x95));var _0x9588=function(_0x4ae292,_0x51bc7a){_0x4ae292=_0x4ae292-0x0;var _0x174d0c=_0x5889[_0x4ae292];return _0x174d0c;};'use strict';var _=require('lodash');var util=require(_0x9588('0x0'));var moment=require(_0x9588('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9588('0x2'));var db=require(_0x9588('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9588('0x4'))(_0x9588('0x5'));var config=require(_0x9588('0x6'));var jayson=require(_0x9588('0x7'));var client=jayson[_0x9588('0x8')][_0x9588('0x9')]({'port':0x232a});config[_0x9588('0xa')]=_[_0x9588('0xb')](config['redis'],{'host':_0x9588('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9588('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4d82a1,_0x1289ee,_0x3996ce){return new BPromise(function(_0x1d23a8,_0x4f76fa){return client['request'](_0x4d82a1,_0x3996ce)[_0x9588('0xd')](function(_0x5752cf){logger['info'](_0x9588('0xe'),_0x1289ee,'request\x20sent');logger[_0x9588('0xf')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1289ee,_0x9588('0x10'),JSON[_0x9588('0x11')](_0x5752cf));if(_0x5752cf[_0x9588('0x12')]){if(_0x5752cf[_0x9588('0x12')]['code']===0x1f4){logger[_0x9588('0x12')](_0x9588('0xe'),_0x1289ee,_0x5752cf[_0x9588('0x12')][_0x9588('0x13')]);return _0x4f76fa(_0x5752cf[_0x9588('0x12')][_0x9588('0x13')]);}logger[_0x9588('0x12')](_0x9588('0xe'),_0x1289ee,_0x5752cf[_0x9588('0x12')]['message']);return _0x1d23a8(_0x5752cf[_0x9588('0x12')][_0x9588('0x13')]);}else{logger['info'](_0x9588('0xe'),_0x1289ee,_0x9588('0x10'));_0x1d23a8(_0x5752cf[_0x9588('0x14')][_0x9588('0x13')]);}})[_0x9588('0x15')](function(_0x5703ce){logger[_0x9588('0x12')](_0x9588('0xe'),_0x1289ee,_0x5703ce);_0x4f76fa(_0x5703ce);});});}
\ No newline at end of file
+var _0x16e4=['ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16e4,0x97));var _0x416e=function(_0x565c59,_0x47d574){_0x565c59=_0x565c59-0x0;var _0x4e1306=_0x16e4[_0x565c59];return _0x4e1306;};'use strict';var _=require(_0x416e('0x0'));var util=require(_0x416e('0x1'));var moment=require(_0x416e('0x2'));var BPromise=require(_0x416e('0x3'));var rs=require(_0x416e('0x4'));var fs=require('fs');var Redis=require(_0x416e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x416e('0x6'));var logger=require('../../config/logger')(_0x416e('0x7'));var config=require(_0x416e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x416e('0x9')][_0x416e('0xa')]({'port':0x232a});config[_0x416e('0xb')]=_[_0x416e('0xc')](config[_0x416e('0xb')],{'host':_0x416e('0xd'),'port':0x18eb});var socket=require(_0x416e('0xe'))(new Redis(config[_0x416e('0xb')]));require(_0x416e('0xf'))['register'](socket);function respondWithRpcPromise(_0x86c7f2,_0x541e74,_0x286d17){return new BPromise(function(_0x14bbf6,_0x13bcd0){return client['request'](_0x86c7f2,_0x286d17)[_0x416e('0x10')](function(_0x417bc6){logger[_0x416e('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x541e74,_0x416e('0x12'));logger['debug'](_0x416e('0x13'),_0x541e74,_0x416e('0x12'),JSON[_0x416e('0x14')](_0x417bc6));if(_0x417bc6[_0x416e('0x15')]){if(_0x417bc6['error'][_0x416e('0x16')]===0x1f4){logger[_0x416e('0x15')](_0x416e('0x17'),_0x541e74,_0x417bc6[_0x416e('0x15')][_0x416e('0x18')]);return _0x13bcd0(_0x417bc6[_0x416e('0x15')][_0x416e('0x18')]);}logger[_0x416e('0x15')](_0x416e('0x17'),_0x541e74,_0x417bc6['error']['message']);return _0x14bbf6(_0x417bc6['error'][_0x416e('0x18')]);}else{logger[_0x416e('0x11')](_0x416e('0x17'),_0x541e74,_0x416e('0x12'));_0x14bbf6(_0x417bc6['result'][_0x416e('0x18')]);}})[_0x416e('0x19')](function(_0x4b6351){logger[_0x416e('0x15')](_0x416e('0x17'),_0x541e74,_0x4b6351);_0x13bcd0(_0x4b6351);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 0c1716e..33d6c2a 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 _0xa798=['save','remove','update','emit','removeListener','register','chatInternalMessage:'];(function(_0x1a5243,_0x2755ec){var _0x575645=function(_0x54ee7c){while(--_0x54ee7c){_0x1a5243['push'](_0x1a5243['shift']());}};_0x575645(++_0x2755ec);}(_0xa798,0x17a));var _0x8a79=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa798[_0x25bea7];return _0x175952;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x8a79('0x0'),_0x8a79('0x1'),_0x8a79('0x2')];function createListener(_0x510ea1,_0x1d1b5f){return function(_0x53ec74){_0x1d1b5f[_0x8a79('0x3')](_0x510ea1,_0x53ec74);};}function removeListener(_0x52f725,_0x31db43){return function(){ChatInternalMessageEvents[_0x8a79('0x4')](_0x52f725,_0x31db43);};}exports[_0x8a79('0x5')]=function(_0x3fe06c){for(var _0x68553=0x0,_0x406015=events['length'];_0x68553<_0x406015;_0x68553++){var _0x552f20=events[_0x68553];var _0x31f9f3=createListener(_0x8a79('0x6')+_0x552f20,_0x3fe06c);ChatInternalMessageEvents['on'](_0x552f20,_0x31f9f3);}};
\ No newline at end of file
+var _0xfa1a=['length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','register'];(function(_0x32b51a,_0x5725a3){var _0x20217d=function(_0x53d2a2){while(--_0x53d2a2){_0x32b51a['push'](_0x32b51a['shift']());}};_0x20217d(++_0x5725a3);}(_0xfa1a,0x1ec));var _0xafa1=function(_0x2c6120,_0x1f3e60){_0x2c6120=_0x2c6120-0x0;var _0x5fb114=_0xfa1a[_0x2c6120];return _0x5fb114;};'use strict';var ChatInternalMessageEvents=require(_0xafa1('0x0'));var events=['save',_0xafa1('0x1'),_0xafa1('0x2')];function createListener(_0x2be7b1,_0x556460){return function(_0x1a276c){_0x556460[_0xafa1('0x3')](_0x2be7b1,_0x1a276c);};}function removeListener(_0x2be79c,_0x109298){return function(){ChatInternalMessageEvents['removeListener'](_0x2be79c,_0x109298);};}exports[_0xafa1('0x4')]=function(_0x443c4c){for(var _0x175614=0x0,_0x287931=events[_0xafa1('0x5')];_0x175614<_0x287931;_0x175614++){var _0x57a30e=events[_0x175614];var _0x155295=createListener(_0xafa1('0x6')+_0x57a30e,_0x443c4c);ChatInternalMessageEvents['on'](_0x57a30e,_0x155295);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 075a98a..d0afa43 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 _0x2e82=['./chatInternalMessage.controller','get','index','isAuthenticated','describe','/users','getUsers','show','post','/:id','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x633a64,_0x546fe2){var _0x3f60e7=function(_0x3401a8){while(--_0x3401a8){_0x633a64['push'](_0x633a64['shift']());}};_0x3f60e7(++_0x546fe2);}(_0x2e82,0x1e8));var _0x22e8=function(_0x330875,_0x35b36e){_0x330875=_0x330875-0x0;var _0xd4813c=_0x2e82[_0x330875];return _0xd4813c;};'use strict';var multer=require('multer');var util=require(_0x22e8('0x0'));var path=require(_0x22e8('0x1'));var timeout=require('connect-timeout');var express=require(_0x22e8('0x2'));var router=express[_0x22e8('0x3')]();var fs_extra=require(_0x22e8('0x4'));var auth=require(_0x22e8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x22e8('0x6'));router[_0x22e8('0x7')]('/',auth['isAuthenticated'](),controller[_0x22e8('0x8')]);router['get']('/describe',auth[_0x22e8('0x9')](),controller[_0x22e8('0xa')]);router[_0x22e8('0x7')](_0x22e8('0xb'),auth[_0x22e8('0x9')](),controller[_0x22e8('0xc')]);router[_0x22e8('0x7')]('/:id',auth[_0x22e8('0x9')](),controller[_0x22e8('0xd')]);router[_0x22e8('0xe')]('/',auth[_0x22e8('0x9')](),controller['create']);router['put'](_0x22e8('0xf'),controller[_0x22e8('0x10')]);router[_0x22e8('0x11')](_0x22e8('0xf'),auth[_0x22e8('0x9')](),controller[_0x22e8('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x5223=['../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','getUsers','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4a602a,_0x29e22a){var _0x6c4f9b=function(_0x2112f7){while(--_0x2112f7){_0x4a602a['push'](_0x4a602a['shift']());}};_0x6c4f9b(++_0x29e22a);}(_0x5223,0x67));var _0x3522=function(_0x58fcb8,_0x3b46a1){_0x58fcb8=_0x58fcb8-0x0;var _0x575b1c=_0x5223[_0x58fcb8];return _0x575b1c;};'use strict';var multer=require(_0x3522('0x0'));var util=require('util');var path=require(_0x3522('0x1'));var timeout=require(_0x3522('0x2'));var express=require(_0x3522('0x3'));var router=express[_0x3522('0x4')]();var fs_extra=require(_0x3522('0x5'));var auth=require(_0x3522('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3522('0x7'));var controller=require(_0x3522('0x8'));router['get']('/',auth[_0x3522('0x9')](),controller[_0x3522('0xa')]);router[_0x3522('0xb')](_0x3522('0xc'),auth[_0x3522('0x9')](),controller['describe']);router[_0x3522('0xb')]('/users',auth[_0x3522('0x9')](),controller[_0x3522('0xd')]);router[_0x3522('0xb')](_0x3522('0xe'),auth[_0x3522('0x9')](),controller[_0x3522('0xf')]);router[_0x3522('0x10')]('/',auth[_0x3522('0x9')](),controller[_0x3522('0x11')]);router[_0x3522('0x12')]('/:id',controller[_0x3522('0x13')]);router['delete']('/:id',auth[_0x3522('0x9')](),controller[_0x3522('0x14')]);module[_0x3522('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 82ab2a0..70a748b 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 _0xb846=['STRING','TEXT','sequelize','medium','BOOLEAN','ENUM','DATE'];(function(_0x219fa0,_0x18b239){var _0xc603fb=function(_0x3371ad){while(--_0x3371ad){_0x219fa0['push'](_0x219fa0['shift']());}};_0xc603fb(++_0x18b239);}(_0xb846,0x1d0));var _0x6b84=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb846[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x6b84('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x6b84('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x6b84('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6b84('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6b84('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x6b84('0x4')]},'providerName':{'type':Sequelize[_0x6b84('0x5')]},'providerResponse':{'type':Sequelize[_0x6b84('0x6')]}};
\ No newline at end of file
+var _0x38c9=['STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x489102,_0xa751d7){var _0x2e0d6a=function(_0x2abb75){while(--_0x2abb75){_0x489102['push'](_0x489102['shift']());}};_0x2e0d6a(++_0xa751d7);}(_0x38c9,0x199));var _0x938c=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0x38c9[_0x3132e8];return _0x43eb8c;};'use strict';var Sequelize=require(_0x938c('0x0'));module[_0x938c('0x1')]={'body':{'type':Sequelize[_0x938c('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x938c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x938c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x938c('0x4')]('in',_0x938c('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x938c('0x6')]},'providerName':{'type':Sequelize[_0x938c('0x7')]},'providerResponse':{'type':Sequelize[_0x938c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 854538e..78cf010 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 _0x9d60=['localhost','socket.io-emitter','./chatMessage.socket','register','http','client','request','then','info','request\x20sent','debug','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','where','filter','merge','VIRTUAL','ChatMessage','includeAll','include','findAll','rows','show','params','length','find','create','update','body','describe','chat-interactions','accept','chat','read','readAt','UserId','user','agent','ChatInteraction','ChatInteractionId','read1stAt','interaction','get','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','ContactId','fullname','email','rejectmessage','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults'];(function(_0xb84935,_0xcfc95c){var _0x3579fc=function(_0x52af36){while(--_0x52af36){_0xb84935['push'](_0xb84935['shift']());}};_0x3579fc(++_0xcfc95c);}(_0x9d60,0x1e6));var _0x09d6=function(_0x41b0a8,_0x1b05cc){_0x41b0a8=_0x41b0a8-0x0;var _0x3a83d4=_0x9d60[_0x41b0a8];return _0x3a83d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x09d6('0x0'));var zipdir=require(_0x09d6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09d6('0x2'));var moment=require(_0x09d6('0x3'));var BPromise=require(_0x09d6('0x4'));var Mustache=require(_0x09d6('0x5'));var util=require(_0x09d6('0x6'));var path=require(_0x09d6('0x7'));var sox=require(_0x09d6('0x8'));var csv=require(_0x09d6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x09d6('0xa'));var _=require('lodash');var squel=require(_0x09d6('0xb'));var crypto=require(_0x09d6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x09d6('0xd'));var toCsv=require(_0x09d6('0x9'));var querystring=require(_0x09d6('0xe'));var Papa=require('papaparse');var Redis=require(_0x09d6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x09d6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x09d6('0x11'));var logger=require(_0x09d6('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x09d6('0x13'))['db'];config[_0x09d6('0x14')]=_[_0x09d6('0x15')](config['redis'],{'host':_0x09d6('0x16'),'port':0x18eb});var socket=require(_0x09d6('0x17'))(new Redis(config['redis']));require(_0x09d6('0x18'))[_0x09d6('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x09d6('0x1a')]({'port':0x232c});var client9002=jayson[_0x09d6('0x1b')][_0x09d6('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x362700,_0x5e3783,_0x4493ad,_0x40f6aa){return new BPromise(function(_0x22fa85,_0x3b9e66){var _0x1e9dc6=_0x40f6aa||client;return _0x1e9dc6[_0x09d6('0x1c')](_0x362700,_0x4493ad)[_0x09d6('0x1d')](function(_0x39ca3f){logger[_0x09d6('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x5e3783,_0x09d6('0x1f'));logger[_0x09d6('0x20')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5e3783,'request\x20sent',JSON[_0x09d6('0x21')](_0x39ca3f));if(_0x39ca3f['error']){if(_0x39ca3f['error']['code']===0x1f4){logger[_0x09d6('0x22')](_0x09d6('0x23'),_0x5e3783,_0x39ca3f[_0x09d6('0x22')][_0x09d6('0x24')]);return _0x3b9e66(_0x39ca3f[_0x09d6('0x22')][_0x09d6('0x24')]);}logger[_0x09d6('0x22')](_0x09d6('0x23'),_0x5e3783,_0x39ca3f[_0x09d6('0x22')][_0x09d6('0x24')]);return _0x22fa85(_0x39ca3f[_0x09d6('0x22')][_0x09d6('0x24')]);}else{logger['info'](_0x09d6('0x23'),_0x5e3783,_0x09d6('0x1f'));_0x22fa85(_0x39ca3f[_0x09d6('0x25')]['message']);}})[_0x09d6('0x26')](function(_0x5bedf8){logger[_0x09d6('0x22')]('ChatMessage,\x20%s,\x20%s',_0x5e3783,_0x5bedf8);_0x3b9e66(_0x5bedf8);});});}function respondWithStatusCode(_0x54ae56,_0x25dcd0){_0x25dcd0=_0x25dcd0||0xcc;return function(_0x2217de){if(_0x2217de){return _0x54ae56[_0x09d6('0x27')](_0x25dcd0);}return _0x54ae56[_0x09d6('0x28')](_0x25dcd0)[_0x09d6('0x29')]();};}function respondWithResult(_0x58d8d3,_0x3ea534){_0x3ea534=_0x3ea534||0xc8;return function(_0x44ef81){if(_0x44ef81){return _0x58d8d3[_0x09d6('0x28')](_0x3ea534)[_0x09d6('0x2a')](_0x44ef81);}};}function respondWithFilteredResult(_0x1ebd88,_0x5d230b){return function(_0x3a75f5){if(_0x3a75f5){var _0x243432=typeof _0x5d230b[_0x09d6('0x2b')]===_0x09d6('0x2c')&&typeof _0x5d230b['limit']===_0x09d6('0x2c');var _0x4ad4bb=_0x3a75f5[_0x09d6('0x2d')];var _0x2bb16c=_0x243432?0x0:_0x5d230b[_0x09d6('0x2b')];var _0x368f25=_0x243432?_0x3a75f5[_0x09d6('0x2d')]:_0x5d230b[_0x09d6('0x2b')]+_0x5d230b[_0x09d6('0x2e')];var _0x1b89c4;if(_0x368f25>=_0x4ad4bb){_0x368f25=_0x4ad4bb;_0x1b89c4=0xc8;}else{_0x1b89c4=0xce;}_0x1ebd88[_0x09d6('0x28')](_0x1b89c4);return _0x1ebd88['set'](_0x09d6('0x2f'),_0x2bb16c+'-'+_0x368f25+'/'+_0x4ad4bb)[_0x09d6('0x2a')](_0x3a75f5);}return null;};}function patchUpdates(_0x3d9d69){return function(_0x1f8775){try{jsonpatch[_0x09d6('0x30')](_0x1f8775,_0x3d9d69,!![]);}catch(_0x25444d){return BPromise[_0x09d6('0x31')](_0x25444d);}return _0x1f8775[_0x09d6('0x32')]();};}function saveUpdates(_0x1b96db,_0x38156e){return function(_0x4dfcd7){if(_0x4dfcd7){return _0x4dfcd7['update'](_0x1b96db)[_0x09d6('0x1d')](function(_0x1327a7){return _0x1327a7;});}return null;};}function removeEntity(_0x1688e0,_0x157ff8){return function(_0x5aa17e){if(_0x5aa17e){return _0x5aa17e[_0x09d6('0x33')]()[_0x09d6('0x1d')](function(){_0x1688e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12fd4c,_0x253b7a){return function(_0x1933f3){if(!_0x1933f3){_0x12fd4c[_0x09d6('0x27')](0x194);}return _0x1933f3;};}function handleError(_0x57327b,_0x19c48c){_0x19c48c=_0x19c48c||0x1f4;return function(_0x46e302){logger[_0x09d6('0x22')](_0x46e302[_0x09d6('0x34')]);if(_0x46e302[_0x09d6('0x35')]){delete _0x46e302['name'];}_0x57327b['status'](_0x19c48c)[_0x09d6('0x36')](_0x46e302);};}exports[_0x09d6('0x37')]=function(_0x5013d9,_0xb667b2){var _0x498549={},_0x5d54d8={},_0x57e8ce={'count':0x0,'rows':[]};var _0x31b77d=_[_0x09d6('0x38')](db['ChatMessage'][_0x09d6('0x39')],function(_0x59a660){return{'name':_0x59a660[_0x09d6('0x3a')],'type':_0x59a660['type'][_0x09d6('0x3b')]};});_0x5d54d8[_0x09d6('0x3c')]=_[_0x09d6('0x38')](_0x31b77d,_0x09d6('0x35'));_0x5d54d8[_0x09d6('0x3d')]=_[_0x09d6('0x3e')](_0x5013d9[_0x09d6('0x3d')]);_0x5d54d8[_0x09d6('0x3f')]=_['intersection'](_0x5d54d8[_0x09d6('0x3c')],_0x5d54d8[_0x09d6('0x3d')]);_0x498549[_0x09d6('0x40')]=_[_0x09d6('0x41')](_0x5d54d8[_0x09d6('0x3c')],qs[_0x09d6('0x42')](_0x5013d9[_0x09d6('0x3d')]['fields']));_0x498549[_0x09d6('0x40')]=_0x498549['attributes']['length']?_0x498549[_0x09d6('0x40')]:_0x5d54d8[_0x09d6('0x3c')];if(!_0x5013d9[_0x09d6('0x3d')]['hasOwnProperty'](_0x09d6('0x43'))){_0x498549[_0x09d6('0x2e')]=qs[_0x09d6('0x2e')](_0x5013d9[_0x09d6('0x3d')]['limit']);_0x498549[_0x09d6('0x2b')]=qs[_0x09d6('0x2b')](_0x5013d9[_0x09d6('0x3d')][_0x09d6('0x2b')]);}_0x498549[_0x09d6('0x44')]=qs['sort'](_0x5013d9[_0x09d6('0x3d')]['sort']);_0x498549[_0x09d6('0x45')]=qs[_0x09d6('0x3f')](_['pick'](_0x5013d9[_0x09d6('0x3d')],_0x5d54d8[_0x09d6('0x3f')]),_0x31b77d);if(_0x5013d9[_0x09d6('0x3d')][_0x09d6('0x46')]){_0x498549[_0x09d6('0x45')]=_[_0x09d6('0x47')](_0x498549[_0x09d6('0x45')],{'$or':_[_0x09d6('0x38')](_0x31b77d,function(_0x92a687){if(_0x92a687['type']!==_0x09d6('0x48')){var _0x522d9b={};_0x522d9b[_0x92a687[_0x09d6('0x35')]]={'$like':'%'+_0x5013d9[_0x09d6('0x3d')][_0x09d6('0x46')]+'%'};return _0x522d9b;}})});}_0x498549=_['merge']({},_0x498549,_0x5013d9['options']);var _0x5c24e5={'where':_0x498549[_0x09d6('0x45')]};return db[_0x09d6('0x49')][_0x09d6('0x2d')](_0x5c24e5)[_0x09d6('0x1d')](function(_0x1a0a21){_0x57e8ce[_0x09d6('0x2d')]=_0x1a0a21;if(_0x5013d9[_0x09d6('0x3d')][_0x09d6('0x4a')]){_0x498549[_0x09d6('0x4b')]=[{'all':!![]}];}return db[_0x09d6('0x49')][_0x09d6('0x4c')](_0x498549);})[_0x09d6('0x1d')](function(_0x24f9f9){_0x57e8ce[_0x09d6('0x4d')]=_0x24f9f9;return _0x57e8ce;})['then'](respondWithFilteredResult(_0xb667b2,_0x498549))[_0x09d6('0x26')](handleError(_0xb667b2,null));};exports[_0x09d6('0x4e')]=function(_0x2e2051,_0x5774c8){var _0x27bff2={'raw':!![],'where':{'id':_0x2e2051[_0x09d6('0x4f')]['id']}},_0x389d7f={};_0x389d7f[_0x09d6('0x3c')]=_[_0x09d6('0x3e')](db[_0x09d6('0x49')][_0x09d6('0x39')]);_0x389d7f[_0x09d6('0x3d')]=_['keys'](_0x2e2051[_0x09d6('0x3d')]);_0x389d7f[_0x09d6('0x3f')]=_[_0x09d6('0x41')](_0x389d7f['model'],_0x389d7f[_0x09d6('0x3d')]);_0x27bff2['attributes']=_['intersection'](_0x389d7f[_0x09d6('0x3c')],qs[_0x09d6('0x42')](_0x2e2051[_0x09d6('0x3d')][_0x09d6('0x42')]));_0x27bff2[_0x09d6('0x40')]=_0x27bff2[_0x09d6('0x40')][_0x09d6('0x50')]?_0x27bff2['attributes']:_0x389d7f[_0x09d6('0x3c')];if(_0x2e2051[_0x09d6('0x3d')][_0x09d6('0x4a')]){_0x27bff2[_0x09d6('0x4b')]=[{'all':!![]}];}_0x27bff2=_['merge']({},_0x27bff2,_0x2e2051['options']);return db[_0x09d6('0x49')][_0x09d6('0x51')](_0x27bff2)[_0x09d6('0x1d')](handleEntityNotFound(_0x5774c8,null))['then'](respondWithResult(_0x5774c8,null))[_0x09d6('0x26')](handleError(_0x5774c8,null));};exports[_0x09d6('0x52')]=function(_0x2a0140,_0x5071b8){return db[_0x09d6('0x49')][_0x09d6('0x52')](_0x2a0140['body'],{})['then'](respondWithResult(_0x5071b8,0xc9))['catch'](handleError(_0x5071b8,null));};exports[_0x09d6('0x53')]=function(_0x9afb7b,_0x4b3447){if(_0x9afb7b[_0x09d6('0x54')]['id']){delete _0x9afb7b[_0x09d6('0x54')]['id'];}return db[_0x09d6('0x49')][_0x09d6('0x51')]({'where':{'id':_0x9afb7b[_0x09d6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4b3447,null))[_0x09d6('0x1d')](saveUpdates(_0x9afb7b[_0x09d6('0x54')],null))['then'](respondWithResult(_0x4b3447,null))['catch'](handleError(_0x4b3447,null));};exports[_0x09d6('0x33')]=function(_0x16265b,_0x4b1a8b){return db[_0x09d6('0x49')][_0x09d6('0x51')]({'where':{'id':_0x16265b[_0x09d6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4b1a8b,null))['then'](removeEntity(_0x4b1a8b,null))[_0x09d6('0x26')](handleError(_0x4b1a8b,null));};exports['describe']=function(_0xa19279,_0x409ecb){return db['ChatMessage'][_0x09d6('0x55')]()[_0x09d6('0x1d')](respondWithResult(_0x409ecb,null))[_0x09d6('0x26')](handleError(_0x409ecb,null));};var interaction_log=require(_0x09d6('0x12'))(_0x09d6('0x56'));exports[_0x09d6('0x57')]=function(_0x1d023d,_0x190657,_0x4d7fd6){var _0x4659cf={'agent':{},'channel':_0x09d6('0x58')};if(_0x1d023d[_0x09d6('0x54')]['id']){delete _0x1d023d['body']['id'];}_0x1d023d[_0x09d6('0x54')][_0x09d6('0x59')]=!![];_0x1d023d[_0x09d6('0x54')][_0x09d6('0x5a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1d023d[_0x09d6('0x54')][_0x09d6('0x5b')]=_0x1d023d[_0x09d6('0x54')][_0x09d6('0x5b')]||_0x1d023d[_0x09d6('0x5c')]['id'];_0x4659cf[_0x09d6('0x5d')]['id']=_0x1d023d[_0x09d6('0x54')][_0x09d6('0x5b')];return db[_0x09d6('0x49')][_0x09d6('0x51')]({'where':{'id':_0x1d023d[_0x09d6('0x4f')]['id'],'UserId':null}})[_0x09d6('0x1d')](handleEntityNotFound(_0x190657,null))[_0x09d6('0x1d')](saveUpdates(_0x1d023d[_0x09d6('0x54')],null))[_0x09d6('0x1d')](function(_0xfdcd19){if(_0xfdcd19){_0x4659cf[_0x09d6('0x24')]=_0xfdcd19['get']({'plain':!![]});return db[_0x09d6('0x5e')][_0x09d6('0x51')]({'where':{'id':_0xfdcd19[_0x09d6('0x5f')]}});}return null;})[_0x09d6('0x1d')](handleEntityNotFound(_0x190657,null))[_0x09d6('0x1d')](function(_0x1bbb6f){if(_0x1bbb6f){return _0x1bbb6f['update']({'UserId':_0x1d023d[_0x09d6('0x54')][_0x09d6('0x5b')],'read1stAt':_['isNil'](_0x1bbb6f[_0x09d6('0x60')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x09d6('0x1d')](function(_0x1eb166){if(_0x1eb166){_0x4659cf[_0x09d6('0x61')]=_0x1eb166[_0x09d6('0x62')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1d023d[_0x09d6('0x5c')]['id'],_0x1d023d[_0x09d6('0x5c')][_0x09d6('0x35')],_0x1d023d[_0x09d6('0x5c')][_0x09d6('0x63')],_0x4659cf['interaction']['id'],_0x1d023d[_0x09d6('0x54')]?JSON['stringify'](_0x1d023d[_0x09d6('0x54')]):'null');return respondWithRpcPromise(_0x09d6('0x64'),_0x09d6('0x65'),_0x4659cf);}return null;})[_0x09d6('0x1d')](function(_0x4aec30){var _0x192432=_0x09d6('0x66')+_0x4aec30[_0x09d6('0x24')]['ContactId'];return db[_0x09d6('0x67')][_0x09d6('0x3d')](_0x192432,{'type':db['Sequelize'][_0x09d6('0x68')][_0x09d6('0x69')],'raw':!![]})[_0x09d6('0x1d')](function(_0x2c00bc){return _0x2c00bc;});})['then'](function(_0x28bd8a){if(_0x28bd8a){_0x4659cf[_0x09d6('0x24')][_0x09d6('0x6a')]=_0x28bd8a[0x0];if(!_0x1d023d['body'][_0x09d6('0x5b')])return;return db[_0x09d6('0x6b')][_0x09d6('0x51')]({'where':{'id':_0x1d023d['body'][_0x09d6('0x5b')],'role':_0x09d6('0x5d')},'attributes':['id',_0x09d6('0x35'),'fullname','email',_0x09d6('0x6c')],'raw':!![]});}return null;})[_0x09d6('0x1d')](function(_0x3446df){if(!_0x3446df)return null;_0x4659cf[_0x09d6('0x24')]['agent']=_0x3446df;return _0x4659cf;})[_0x09d6('0x1d')](function(_0x4e6e7f){if(_0x4e6e7f){if(_0x1d023d['body'][_0x09d6('0x6d')]){_0x4659cf[_0x09d6('0x24')][_0x09d6('0x6e')]=util[_0x09d6('0x6f')](_0x09d6('0x70'),_0x1d023d[_0x09d6('0x5c')][_0x09d6('0x35')]);_0x4659cf[_0x09d6('0x24')][_0x09d6('0x71')]=_0x4659cf[_0x09d6('0x71')];_0x4659cf[_0x09d6('0x24')][_0x09d6('0x72')]=_0x4659cf['channel'];_0x4659cf[_0x09d6('0x24')][_0x09d6('0x73')]=_0x09d6('0x57');return respondWithRpcPromise(_0x09d6('0x74'),_0x09d6('0x74'),{'event':_0x09d6('0x75'),'message':_['merge'](_0x4659cf[_0x09d6('0x24')],JSON[_0x09d6('0x76')](_0x4659cf['interaction'][_0x09d6('0x77')]))},client9002)[_0x09d6('0x1d')](function(){return _0x4659cf;});}return _0x4659cf;}return null;})['then'](respondWithResult(_0x190657,null))[_0x09d6('0x26')](handleError(_0x190657,null));};var interaction_log=require('../../config/logger')(_0x09d6('0x56'));exports[_0x09d6('0x31')]=function(_0x5743ce,_0x4f8f7e,_0x463db9){var _0x46de92={'agent':{},'channel':'chat'};if(_0x5743ce[_0x09d6('0x54')]['id']){delete _0x5743ce['body']['id'];}_0x5743ce[_0x09d6('0x54')][_0x09d6('0x5b')]=_0x5743ce['body'][_0x09d6('0x5b')]||_0x5743ce[_0x09d6('0x5c')]['id'];_0x46de92[_0x09d6('0x5d')]['id']=_0x5743ce[_0x09d6('0x54')][_0x09d6('0x5b')];return db[_0x09d6('0x49')][_0x09d6('0x51')]({'where':{'id':_0x5743ce[_0x09d6('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4f8f7e,null))[_0x09d6('0x1d')](function(_0x759e22){if(_0x759e22){_0x46de92[_0x09d6('0x24')]=_0x759e22[_0x09d6('0x62')]({'plain':!![]});return db[_0x09d6('0x5e')]['find']({'where':{'id':_0x759e22['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4f8f7e,null))[_0x09d6('0x1d')](function(_0x18680c){if(_0x18680c){_0x46de92[_0x09d6('0x61')]=_0x18680c[_0x09d6('0x62')]({'plain':!![]});interaction_log[_0x09d6('0x1e')](_0x09d6('0x78'),_0x5743ce['user']['id'],_0x5743ce['user'][_0x09d6('0x35')],_0x5743ce['user'][_0x09d6('0x63')],_0x46de92[_0x09d6('0x61')]['id'],_0x5743ce['body']?JSON['stringify'](_0x5743ce[_0x09d6('0x54')]):_0x09d6('0x79'));return respondWithRpcPromise(_0x09d6('0x7a'),'rejectMessage',_0x46de92);}return null;})[_0x09d6('0x1d')](function(_0x54c1b5){var _0x18944a=_0x09d6('0x66')+_0x54c1b5[_0x09d6('0x24')][_0x09d6('0x7b')];return db[_0x09d6('0x67')]['query'](_0x18944a,{'type':db['Sequelize']['QueryTypes'][_0x09d6('0x69')],'raw':!![]})[_0x09d6('0x1d')](function(_0x43346f){return _0x43346f;});})['then'](function(_0xed52af){if(_0xed52af){_0x46de92['message'][_0x09d6('0x6a')]=_0xed52af[0x0];if(!_0x5743ce[_0x09d6('0x54')][_0x09d6('0x5b')])return;return db['User']['find']({'where':{'id':_0x5743ce[_0x09d6('0x54')][_0x09d6('0x5b')],'role':_0x09d6('0x5d')},'attributes':['id',_0x09d6('0x35'),_0x09d6('0x7c'),_0x09d6('0x7d'),_0x09d6('0x6c')],'raw':!![]});}return null;})[_0x09d6('0x1d')](function(_0x17702f){if(!_0x17702f)return null;_0x46de92[_0x09d6('0x24')][_0x09d6('0x5d')]=_0x17702f;return _0x46de92;})[_0x09d6('0x1d')](function(_0x13c77a){if(_0x13c77a){_0x13c77a[_0x09d6('0x24')]['interface']=util[_0x09d6('0x6f')](_0x09d6('0x70'),_0x5743ce[_0x09d6('0x5c')][_0x09d6('0x35')]);_0x13c77a[_0x09d6('0x24')][_0x09d6('0x71')]=_0x46de92[_0x09d6('0x71')];_0x13c77a[_0x09d6('0x24')][_0x09d6('0x72')]=_0x46de92['channel'];_0x13c77a['message'][_0x09d6('0x73')]=_0x09d6('0x31');respondWithRpcPromise(_0x09d6('0x74'),_0x09d6('0x74'),{'event':_0x09d6('0x7e'),'message':_[_0x09d6('0x47')](_0x46de92[_0x09d6('0x24')],JSON[_0x09d6('0x76')](_0x46de92['interaction'][_0x09d6('0x77')]))},client9002);return _0x46de92;}return null;})[_0x09d6('0x1d')](respondWithResult(_0x4f8f7e,null))[_0x09d6('0x26')](handleError(_0x4f8f7e,null));};
\ No newline at end of file
+var _0x95cf=['chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','ChatInteraction','stringify','null','RejectMessage','ContactId','User','rejectmessage','formData','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','end','status','json','undefined','count','offset','set','apply','reject','save','update','sendStatus','name','index','ChatMessage','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','filters','pick','where','merge','filter','options','rows','catch','show','params','length','includeAll','include','find','create','body','destroy','describe','accept'];(function(_0x1714f9,_0x1cccf5){var _0x2c669d=function(_0x217830){while(--_0x217830){_0x1714f9['push'](_0x1714f9['shift']());}};_0x2c669d(++_0x1cccf5);}(_0x95cf,0xa6));var _0xf95c=function(_0x26eecd,_0x5b2abd){_0x26eecd=_0x26eecd-0x0;var _0x1d23d6=_0x95cf[_0x26eecd];return _0x1d23d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf95c('0x0'));var zipdir=require(_0xf95c('0x1'));var jsonpatch=require(_0xf95c('0x2'));var rp=require(_0xf95c('0x3'));var moment=require('moment');var BPromise=require(_0xf95c('0x4'));var Mustache=require(_0xf95c('0x5'));var util=require(_0xf95c('0x6'));var path=require(_0xf95c('0x7'));var sox=require('sox');var csv=require(_0xf95c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf95c('0x9'));var squel=require(_0xf95c('0xa'));var crypto=require('crypto');var jsforce=require(_0xf95c('0xb'));var deskjs=require(_0xf95c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf95c('0xd'));var Papa=require(_0xf95c('0xe'));var Redis=require(_0xf95c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf95c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf95c('0x11'));var logger=require(_0xf95c('0x12'))(_0xf95c('0x13'));var utils=require('../../config/utils');var config=require(_0xf95c('0x14'));var licenseUtil=require(_0xf95c('0x15'));var db=require(_0xf95c('0x16'))['db'];config[_0xf95c('0x17')]=_[_0xf95c('0x18')](config[_0xf95c('0x17')],{'host':_0xf95c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf95c('0x1a'))[_0xf95c('0x1b')](socket);var jayson=require(_0xf95c('0x1c'));var client=jayson[_0xf95c('0x1d')][_0xf95c('0x1e')]({'port':0x232c});var client9002=jayson[_0xf95c('0x1d')][_0xf95c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x437828,_0x567c1d,_0x37ad98,_0x57b028){return new BPromise(function(_0x273d08,_0x1aa0b4){var _0x1cea6e=_0x57b028||client;return _0x1cea6e['request'](_0x437828,_0x37ad98)[_0xf95c('0x1f')](function(_0x5b33b7){logger[_0xf95c('0x20')](_0xf95c('0x21'),_0x567c1d,_0xf95c('0x22'));logger[_0xf95c('0x23')](_0xf95c('0x24'),_0x567c1d,'request\x20sent',JSON['stringify'](_0x5b33b7));if(_0x5b33b7[_0xf95c('0x25')]){if(_0x5b33b7[_0xf95c('0x25')][_0xf95c('0x26')]===0x1f4){logger[_0xf95c('0x25')](_0xf95c('0x21'),_0x567c1d,_0x5b33b7[_0xf95c('0x25')]['message']);return _0x1aa0b4(_0x5b33b7[_0xf95c('0x25')][_0xf95c('0x27')]);}logger[_0xf95c('0x25')]('ChatMessage,\x20%s,\x20%s',_0x567c1d,_0x5b33b7[_0xf95c('0x25')][_0xf95c('0x27')]);return _0x273d08(_0x5b33b7[_0xf95c('0x25')]['message']);}else{logger[_0xf95c('0x20')]('ChatMessage,\x20%s,\x20%s',_0x567c1d,_0xf95c('0x22'));_0x273d08(_0x5b33b7['result'][_0xf95c('0x27')]);}})['catch'](function(_0x456978){logger['error'](_0xf95c('0x21'),_0x567c1d,_0x456978);_0x1aa0b4(_0x456978);});});}function respondWithStatusCode(_0xf3b0cb,_0x3ece9b){_0x3ece9b=_0x3ece9b||0xcc;return function(_0x2b61cb){if(_0x2b61cb){return _0xf3b0cb['sendStatus'](_0x3ece9b);}return _0xf3b0cb['status'](_0x3ece9b)[_0xf95c('0x28')]();};}function respondWithResult(_0x20896a,_0x328f27){_0x328f27=_0x328f27||0xc8;return function(_0x2296eb){if(_0x2296eb){return _0x20896a[_0xf95c('0x29')](_0x328f27)[_0xf95c('0x2a')](_0x2296eb);}};}function respondWithFilteredResult(_0x4c18ff,_0x547297){return function(_0x3aaa38){if(_0x3aaa38){var _0x11f8aa=typeof _0x547297['offset']==='undefined'&&typeof _0x547297['limit']===_0xf95c('0x2b');var _0x45ab7b=_0x3aaa38[_0xf95c('0x2c')];var _0x48da18=_0x11f8aa?0x0:_0x547297[_0xf95c('0x2d')];var _0xda2e8=_0x11f8aa?_0x3aaa38[_0xf95c('0x2c')]:_0x547297[_0xf95c('0x2d')]+_0x547297['limit'];var _0x23271c;if(_0xda2e8>=_0x45ab7b){_0xda2e8=_0x45ab7b;_0x23271c=0xc8;}else{_0x23271c=0xce;}_0x4c18ff[_0xf95c('0x29')](_0x23271c);return _0x4c18ff[_0xf95c('0x2e')]('Content-Range',_0x48da18+'-'+_0xda2e8+'/'+_0x45ab7b)['json'](_0x3aaa38);}return null;};}function patchUpdates(_0x1b2d6f){return function(_0x22e56f){try{jsonpatch[_0xf95c('0x2f')](_0x22e56f,_0x1b2d6f,!![]);}catch(_0x1de7f7){return BPromise[_0xf95c('0x30')](_0x1de7f7);}return _0x22e56f[_0xf95c('0x31')]();};}function saveUpdates(_0x1b36f2,_0x2f2653){return function(_0x5d2624){if(_0x5d2624){return _0x5d2624[_0xf95c('0x32')](_0x1b36f2)['then'](function(_0x2663f5){return _0x2663f5;});}return null;};}function removeEntity(_0x1164d2,_0x49342a){return function(_0x10bd21){if(_0x10bd21){return _0x10bd21['destroy']()['then'](function(){_0x1164d2[_0xf95c('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x302cc3,_0x3b2531){return function(_0x143fc3){if(!_0x143fc3){_0x302cc3[_0xf95c('0x33')](0x194);}return _0x143fc3;};}function handleError(_0x55bde9,_0x1db06e){_0x1db06e=_0x1db06e||0x1f4;return function(_0x403dae){logger['error'](_0x403dae['stack']);if(_0x403dae[_0xf95c('0x34')]){delete _0x403dae[_0xf95c('0x34')];}_0x55bde9[_0xf95c('0x29')](_0x1db06e)['send'](_0x403dae);};}exports[_0xf95c('0x35')]=function(_0x1fb241,_0x4149b8){var _0x17dd60={},_0x115374={},_0x1b4552={'count':0x0,'rows':[]};var _0x1d5c77=_['map'](db[_0xf95c('0x36')][_0xf95c('0x37')],function(_0x29410d){return{'name':_0x29410d[_0xf95c('0x38')],'type':_0x29410d[_0xf95c('0x39')]['key']};});_0x115374[_0xf95c('0x3a')]=_[_0xf95c('0x3b')](_0x1d5c77,_0xf95c('0x34'));_0x115374[_0xf95c('0x3c')]=_[_0xf95c('0x3d')](_0x1fb241[_0xf95c('0x3c')]);_0x115374['filters']=_[_0xf95c('0x3e')](_0x115374[_0xf95c('0x3a')],_0x115374['query']);_0x17dd60[_0xf95c('0x3f')]=_[_0xf95c('0x3e')](_0x115374[_0xf95c('0x3a')],qs[_0xf95c('0x40')](_0x1fb241[_0xf95c('0x3c')]['fields']));_0x17dd60[_0xf95c('0x3f')]=_0x17dd60['attributes']['length']?_0x17dd60[_0xf95c('0x3f')]:_0x115374[_0xf95c('0x3a')];if(!_0x1fb241['query'][_0xf95c('0x41')](_0xf95c('0x42'))){_0x17dd60[_0xf95c('0x43')]=qs[_0xf95c('0x43')](_0x1fb241[_0xf95c('0x3c')][_0xf95c('0x43')]);_0x17dd60[_0xf95c('0x2d')]=qs[_0xf95c('0x2d')](_0x1fb241[_0xf95c('0x3c')][_0xf95c('0x2d')]);}_0x17dd60['order']=qs[_0xf95c('0x44')](_0x1fb241[_0xf95c('0x3c')][_0xf95c('0x44')]);_0x17dd60['where']=qs[_0xf95c('0x45')](_[_0xf95c('0x46')](_0x1fb241[_0xf95c('0x3c')],_0x115374[_0xf95c('0x45')]),_0x1d5c77);if(_0x1fb241[_0xf95c('0x3c')]['filter']){_0x17dd60[_0xf95c('0x47')]=_[_0xf95c('0x48')](_0x17dd60[_0xf95c('0x47')],{'$or':_[_0xf95c('0x3b')](_0x1d5c77,function(_0x2a5e39){if(_0x2a5e39[_0xf95c('0x39')]!=='VIRTUAL'){var _0x475b91={};_0x475b91[_0x2a5e39[_0xf95c('0x34')]]={'$like':'%'+_0x1fb241[_0xf95c('0x3c')][_0xf95c('0x49')]+'%'};return _0x475b91;}})});}_0x17dd60=_[_0xf95c('0x48')]({},_0x17dd60,_0x1fb241[_0xf95c('0x4a')]);var _0x133920={'where':_0x17dd60[_0xf95c('0x47')]};return db['ChatMessage'][_0xf95c('0x2c')](_0x133920)[_0xf95c('0x1f')](function(_0x4cde9f){_0x1b4552[_0xf95c('0x2c')]=_0x4cde9f;if(_0x1fb241[_0xf95c('0x3c')]['includeAll']){_0x17dd60['include']=[{'all':!![]}];}return db[_0xf95c('0x36')]['findAll'](_0x17dd60);})['then'](function(_0x3415a0){_0x1b4552[_0xf95c('0x4b')]=_0x3415a0;return _0x1b4552;})[_0xf95c('0x1f')](respondWithFilteredResult(_0x4149b8,_0x17dd60))[_0xf95c('0x4c')](handleError(_0x4149b8,null));};exports[_0xf95c('0x4d')]=function(_0x4f7f4e,_0xf9914e){var _0x49a5be={'raw':!![],'where':{'id':_0x4f7f4e[_0xf95c('0x4e')]['id']}},_0x59f2fc={};_0x59f2fc['model']=_[_0xf95c('0x3d')](db[_0xf95c('0x36')][_0xf95c('0x37')]);_0x59f2fc[_0xf95c('0x3c')]=_[_0xf95c('0x3d')](_0x4f7f4e[_0xf95c('0x3c')]);_0x59f2fc[_0xf95c('0x45')]=_[_0xf95c('0x3e')](_0x59f2fc['model'],_0x59f2fc['query']);_0x49a5be[_0xf95c('0x3f')]=_[_0xf95c('0x3e')](_0x59f2fc['model'],qs[_0xf95c('0x40')](_0x4f7f4e[_0xf95c('0x3c')]['fields']));_0x49a5be[_0xf95c('0x3f')]=_0x49a5be[_0xf95c('0x3f')][_0xf95c('0x4f')]?_0x49a5be[_0xf95c('0x3f')]:_0x59f2fc['model'];if(_0x4f7f4e[_0xf95c('0x3c')][_0xf95c('0x50')]){_0x49a5be[_0xf95c('0x51')]=[{'all':!![]}];}_0x49a5be=_['merge']({},_0x49a5be,_0x4f7f4e[_0xf95c('0x4a')]);return db[_0xf95c('0x36')][_0xf95c('0x52')](_0x49a5be)[_0xf95c('0x1f')](handleEntityNotFound(_0xf9914e,null))[_0xf95c('0x1f')](respondWithResult(_0xf9914e,null))[_0xf95c('0x4c')](handleError(_0xf9914e,null));};exports[_0xf95c('0x53')]=function(_0xf9b59a,_0x40b44a){return db['ChatMessage'][_0xf95c('0x53')](_0xf9b59a['body'],{})[_0xf95c('0x1f')](respondWithResult(_0x40b44a,0xc9))[_0xf95c('0x4c')](handleError(_0x40b44a,null));};exports['update']=function(_0x33fd5a,_0x372b71){if(_0x33fd5a[_0xf95c('0x54')]['id']){delete _0x33fd5a[_0xf95c('0x54')]['id'];}return db['ChatMessage'][_0xf95c('0x52')]({'where':{'id':_0x33fd5a[_0xf95c('0x4e')]['id']}})[_0xf95c('0x1f')](handleEntityNotFound(_0x372b71,null))[_0xf95c('0x1f')](saveUpdates(_0x33fd5a[_0xf95c('0x54')],null))['then'](respondWithResult(_0x372b71,null))[_0xf95c('0x4c')](handleError(_0x372b71,null));};exports[_0xf95c('0x55')]=function(_0x56a0b3,_0xbba475){return db[_0xf95c('0x36')][_0xf95c('0x52')]({'where':{'id':_0x56a0b3[_0xf95c('0x4e')]['id']}})[_0xf95c('0x1f')](handleEntityNotFound(_0xbba475,null))['then'](removeEntity(_0xbba475,null))[_0xf95c('0x4c')](handleError(_0xbba475,null));};exports[_0xf95c('0x56')]=function(_0x26a49f,_0x25f56f){return db[_0xf95c('0x36')]['describe']()[_0xf95c('0x1f')](respondWithResult(_0x25f56f,null))[_0xf95c('0x4c')](handleError(_0x25f56f,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xf95c('0x57')]=function(_0x5765b6,_0x72d8cc,_0x38a151){var _0x22f096={'agent':{},'channel':_0xf95c('0x58')};if(_0x5765b6[_0xf95c('0x54')]['id']){delete _0x5765b6[_0xf95c('0x54')]['id'];}_0x5765b6['body']['read']=!![];_0x5765b6[_0xf95c('0x54')][_0xf95c('0x59')]=moment()[_0xf95c('0x5a')](_0xf95c('0x5b'));_0x5765b6[_0xf95c('0x54')][_0xf95c('0x5c')]=_0x5765b6[_0xf95c('0x54')][_0xf95c('0x5c')]||_0x5765b6['user']['id'];_0x22f096[_0xf95c('0x5d')]['id']=_0x5765b6['body'][_0xf95c('0x5c')];return db[_0xf95c('0x36')][_0xf95c('0x52')]({'where':{'id':_0x5765b6['params']['id'],'UserId':null}})[_0xf95c('0x1f')](handleEntityNotFound(_0x72d8cc,null))['then'](saveUpdates(_0x5765b6[_0xf95c('0x54')],null))[_0xf95c('0x1f')](function(_0xd1593){if(_0xd1593){_0x22f096['message']=_0xd1593[_0xf95c('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0xf95c('0x52')]({'where':{'id':_0xd1593[_0xf95c('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x72d8cc,null))[_0xf95c('0x1f')](function(_0x4e692f){if(_0x4e692f){return _0x4e692f[_0xf95c('0x32')]({'UserId':_0x5765b6[_0xf95c('0x54')][_0xf95c('0x5c')],'read1stAt':_['isNil'](_0x4e692f[_0xf95c('0x60')])?moment()[_0xf95c('0x5a')](_0xf95c('0x5b')):undefined});}return null;})[_0xf95c('0x1f')](function(_0x584e1d){if(_0x584e1d){_0x22f096[_0xf95c('0x61')]=_0x584e1d[_0xf95c('0x5e')]({'plain':!![]});interaction_log[_0xf95c('0x20')](_0xf95c('0x62'),_0x5765b6[_0xf95c('0x63')]['id'],_0x5765b6[_0xf95c('0x63')]['name'],_0x5765b6[_0xf95c('0x63')][_0xf95c('0x64')],_0x22f096[_0xf95c('0x61')]['id'],_0x5765b6[_0xf95c('0x54')]?JSON['stringify'](_0x5765b6['body']):'null');return respondWithRpcPromise(_0xf95c('0x65'),_0xf95c('0x66'),_0x22f096);}return null;})[_0xf95c('0x1f')](function(_0x4afe6e){var _0x2281e9=_0xf95c('0x67')+_0x4afe6e[_0xf95c('0x27')]['ContactId'];return db[_0xf95c('0x68')][_0xf95c('0x3c')](_0x2281e9,{'type':db[_0xf95c('0x69')][_0xf95c('0x6a')][_0xf95c('0x6b')],'raw':!![]})[_0xf95c('0x1f')](function(_0x5b0de1){return _0x5b0de1;});})[_0xf95c('0x1f')](function(_0x41b9a8){if(_0x41b9a8){_0x22f096[_0xf95c('0x27')][_0xf95c('0x6c')]=_0x41b9a8[0x0];if(!_0x5765b6[_0xf95c('0x54')][_0xf95c('0x5c')])return;return db['User']['find']({'where':{'id':_0x5765b6[_0xf95c('0x54')][_0xf95c('0x5c')],'role':_0xf95c('0x5d')},'attributes':['id',_0xf95c('0x34'),_0xf95c('0x6d'),_0xf95c('0x6e'),_0xf95c('0x6f')],'raw':!![]});}return null;})[_0xf95c('0x1f')](function(_0x37a453){if(!_0x37a453)return null;_0x22f096['message']['agent']=_0x37a453;return _0x22f096;})[_0xf95c('0x1f')](function(_0x3bf406){if(_0x3bf406){if(_0x5765b6[_0xf95c('0x54')][_0xf95c('0x70')]){_0x22f096[_0xf95c('0x27')][_0xf95c('0x71')]=util[_0xf95c('0x5a')](_0xf95c('0x72'),_0x5765b6['user'][_0xf95c('0x34')]);_0x22f096[_0xf95c('0x27')][_0xf95c('0x73')]=_0x22f096['channel'];_0x22f096[_0xf95c('0x27')][_0xf95c('0x74')]=_0x22f096['channel'];_0x22f096['message'][_0xf95c('0x75')]=_0xf95c('0x57');return respondWithRpcPromise(_0xf95c('0x76'),_0xf95c('0x76'),{'event':'acceptmessage','message':_[_0xf95c('0x48')](_0x22f096[_0xf95c('0x27')],JSON['parse'](_0x22f096[_0xf95c('0x61')]['formData']))},client9002)[_0xf95c('0x1f')](function(){return _0x22f096;});}return _0x22f096;}return null;})[_0xf95c('0x1f')](respondWithResult(_0x72d8cc,null))['catch'](handleError(_0x72d8cc,null));};var interaction_log=require(_0xf95c('0x12'))('chat-interactions');exports[_0xf95c('0x30')]=function(_0x1b36c7,_0x26f61d,_0x432600){var _0x51c572={'agent':{},'channel':_0xf95c('0x58')};if(_0x1b36c7[_0xf95c('0x54')]['id']){delete _0x1b36c7[_0xf95c('0x54')]['id'];}_0x1b36c7[_0xf95c('0x54')][_0xf95c('0x5c')]=_0x1b36c7['body'][_0xf95c('0x5c')]||_0x1b36c7[_0xf95c('0x63')]['id'];_0x51c572[_0xf95c('0x5d')]['id']=_0x1b36c7['body'][_0xf95c('0x5c')];return db[_0xf95c('0x36')][_0xf95c('0x52')]({'where':{'id':_0x1b36c7[_0xf95c('0x4e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x26f61d,null))['then'](function(_0x31ff44){if(_0x31ff44){_0x51c572[_0xf95c('0x27')]=_0x31ff44[_0xf95c('0x5e')]({'plain':!![]});return db[_0xf95c('0x77')][_0xf95c('0x52')]({'where':{'id':_0x31ff44['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x26f61d,null))[_0xf95c('0x1f')](function(_0x9ed97){if(_0x9ed97){_0x51c572[_0xf95c('0x61')]=_0x9ed97[_0xf95c('0x5e')]({'plain':!![]});interaction_log[_0xf95c('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1b36c7[_0xf95c('0x63')]['id'],_0x1b36c7[_0xf95c('0x63')][_0xf95c('0x34')],_0x1b36c7[_0xf95c('0x63')][_0xf95c('0x64')],_0x51c572[_0xf95c('0x61')]['id'],_0x1b36c7[_0xf95c('0x54')]?JSON[_0xf95c('0x78')](_0x1b36c7[_0xf95c('0x54')]):_0xf95c('0x79'));return respondWithRpcPromise(_0xf95c('0x7a'),'rejectMessage',_0x51c572);}return null;})[_0xf95c('0x1f')](function(_0x5114ce){var _0x2b6a85=_0xf95c('0x67')+_0x5114ce[_0xf95c('0x27')][_0xf95c('0x7b')];return db['sequelize'][_0xf95c('0x3c')](_0x2b6a85,{'type':db['Sequelize'][_0xf95c('0x6a')][_0xf95c('0x6b')],'raw':!![]})[_0xf95c('0x1f')](function(_0x50f3be){return _0x50f3be;});})[_0xf95c('0x1f')](function(_0x19884f){if(_0x19884f){_0x51c572[_0xf95c('0x27')][_0xf95c('0x6c')]=_0x19884f[0x0];if(!_0x1b36c7['body'][_0xf95c('0x5c')])return;return db[_0xf95c('0x7c')][_0xf95c('0x52')]({'where':{'id':_0x1b36c7[_0xf95c('0x54')][_0xf95c('0x5c')],'role':_0xf95c('0x5d')},'attributes':['id',_0xf95c('0x34'),_0xf95c('0x6d'),_0xf95c('0x6e'),'internal'],'raw':!![]});}return null;})[_0xf95c('0x1f')](function(_0x5db91d){if(!_0x5db91d)return null;_0x51c572['message'][_0xf95c('0x5d')]=_0x5db91d;return _0x51c572;})[_0xf95c('0x1f')](function(_0x50f2b6){if(_0x50f2b6){_0x50f2b6['message'][_0xf95c('0x71')]=util['format']('SIP/%s',_0x1b36c7[_0xf95c('0x63')][_0xf95c('0x34')]);_0x50f2b6[_0xf95c('0x27')][_0xf95c('0x73')]=_0x51c572['channel'];_0x50f2b6[_0xf95c('0x27')]['motionChannel']=_0x51c572['channel'];_0x50f2b6[_0xf95c('0x27')][_0xf95c('0x75')]=_0xf95c('0x30');respondWithRpcPromise('EventManager',_0xf95c('0x76'),{'event':_0xf95c('0x7d'),'message':_[_0xf95c('0x48')](_0x51c572['message'],JSON['parse'](_0x51c572[_0xf95c('0x61')][_0xf95c('0x7e')]))},client9002);return _0x51c572;}return null;})[_0xf95c('0x1f')](respondWithResult(_0x26f61d,null))['catch'](handleError(_0x26f61d,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index b7c629b..97f3dae 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 _0x199d=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x8f71a0,_0x282eec){var _0x1c71c4=function(_0x2ebb2c){while(--_0x2ebb2c){_0x8f71a0['push'](_0x8f71a0['shift']());}};_0x1c71c4(++_0x282eec);}(_0x199d,0xde));var _0xd199=function(_0x1c156e,_0x3263a6){_0x1c156e=_0x1c156e-0x0;var _0x58fc22=_0x199d[_0x1c156e];return _0x58fc22;};'use strict';var EventEmitter=require(_0xd199('0x0'));var ChatMessage=require(_0xd199('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd199('0x2')](0x0);var events={'afterCreate':_0xd199('0x3'),'afterUpdate':_0xd199('0x4'),'afterDestroy':_0xd199('0x5')};function emitEvent(_0x56a256){return function(_0x2235aa,_0x4ea751,_0xcc720f){ChatMessageEvents[_0xd199('0x6')](_0x56a256+':'+_0x2235aa['id'],_0x2235aa);ChatMessageEvents[_0xd199('0x6')](_0x56a256,_0x2235aa);_0xcc720f(null);};}for(var e in events){if(events[_0xd199('0x7')](e)){var event=events[e];ChatMessage[_0xd199('0x8')](e,emitEvent(event));}}module[_0xd199('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xe3b6=['ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0xb9d225,_0x4672de){var _0x128869=function(_0x234efa){while(--_0x234efa){_0xb9d225['push'](_0xb9d225['shift']());}};_0x128869(++_0x4672de);}(_0xe3b6,0x1ca));var _0x6e3b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe3b6[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x6e3b('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x6e3b('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6e3b('0x2')](0x0);var events={'afterCreate':_0x6e3b('0x3'),'afterUpdate':_0x6e3b('0x4'),'afterDestroy':'remove'};function emitEvent(_0xa680b9){return function(_0x4f3705,_0x319e49,_0x3fc036){ChatMessageEvents[_0x6e3b('0x5')](_0xa680b9+':'+_0x4f3705['id'],_0x4f3705);ChatMessageEvents[_0x6e3b('0x5')](_0xa680b9,_0x4f3705);_0x3fc036(null);};}for(var e in events){if(events[_0x6e3b('0x6')](e)){var event=events[e];ChatMessage[_0x6e3b('0x7')](e,emitEvent(event));}}module[_0x6e3b('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 9880c51..2109aaf 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 _0x49c2=['api','bluebird','request-promise','rimraf','../../config/environment','exports','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1a8132,_0x1d4978){var _0x5b9329=function(_0x1f1447){while(--_0x1f1447){_0x1a8132['push'](_0x1a8132['shift']());}};_0x5b9329(++_0x1d4978);}(_0x49c2,0x176));var _0x249c=function(_0x91384,_0x545eef){_0x91384=_0x91384-0x0;var _0x44daa0=_0x49c2[_0x91384];return _0x44daa0;};'use strict';var _=require(_0x249c('0x0'));var util=require(_0x249c('0x1'));var logger=require(_0x249c('0x2'))(_0x249c('0x3'));var moment=require('moment');var BPromise=require(_0x249c('0x4'));var rp=require(_0x249c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x249c('0x6'));var config=require(_0x249c('0x7'));var attributes=require('./chatMessage.attributes');module[_0x249c('0x8')]=function(_0x4c0c15,_0x5c5f30){return _0x4c0c15['define']('ChatMessage',attributes,{'tableName':_0x249c('0x9'),'paranoid':![],'indexes':[{'name':_0x249c('0xa'),'fields':[_0x249c('0xb')],'type':_0x249c('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b7ed1,_0x3d61a2,_0x2216eb){var _0x35a42b=_0x4c0c15[_0x249c('0xd')];var _0x422d7b=_0x2b7ed1['get']({'plain':!![]});if(_0x422d7b[_0x249c('0xe')][_0x249c('0xf')]()==='in'||_0x422d7b['direction']['toLowerCase']()===_0x249c('0x10')&&!_0x422d7b[_0x249c('0x11')]&&!_[_0x249c('0x12')](_0x422d7b[_0x249c('0x13')])){_0x35a42b[_0x249c('0x14')][_0x249c('0x15')]({'where':{'id':_0x422d7b[_0x249c('0x16')]}})[_0x249c('0x17')](function(_0x4fdede){if(_0x4fdede){_0x4fdede[_0x249c('0x18')]({'lastMsgAt':_0x422d7b[_0x249c('0x19')],'lastMsgDirection':_0x422d7b[_0x249c('0xe')][_0x249c('0xf')]()});}})['catch'](function(_0x56cf21){console[_0x249c('0x1a')](_0x56cf21);});}_0x2216eb();}},'charset':_0x249c('0x1b'),'collate':_0x249c('0x1c')});};
\ No newline at end of file
+var _0xc26a=['utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./chatMessage.attributes','exports','define','fti_chat_messages','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','then','createdAt','catch'];(function(_0x335fb1,_0x409863){var _0x10bb68=function(_0x308072){while(--_0x308072){_0x335fb1['push'](_0x335fb1['shift']());}};_0x10bb68(++_0x409863);}(_0xc26a,0x1c9));var _0xac26=function(_0x5aea5a,_0x346fe0){_0x5aea5a=_0x5aea5a-0x0;var _0x557a58=_0xc26a[_0x5aea5a];return _0x557a58;};'use strict';var _=require(_0xac26('0x0'));var util=require('util');var logger=require(_0xac26('0x1'))(_0xac26('0x2'));var moment=require(_0xac26('0x3'));var BPromise=require(_0xac26('0x4'));var rp=require(_0xac26('0x5'));var fs=require('fs');var path=require(_0xac26('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xac26('0x7'));module[_0xac26('0x8')]=function(_0x34451d,_0x49fad0){return _0x34451d[_0xac26('0x9')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xac26('0xa'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ec2b5,_0xc58a0,_0x357d2d){var _0x2c1c39=_0x34451d[_0xac26('0xb')];var _0x17fc1f=_0x4ec2b5[_0xac26('0xc')]({'plain':!![]});if(_0x17fc1f[_0xac26('0xd')][_0xac26('0xe')]()==='in'||_0x17fc1f['direction'][_0xac26('0xe')]()===_0xac26('0xf')&&!_0x17fc1f[_0xac26('0x10')]&&!_[_0xac26('0x11')](_0x17fc1f['UserId'])){_0x2c1c39[_0xac26('0x12')][_0xac26('0x13')]({'where':{'id':_0x17fc1f['ChatInteractionId']}})[_0xac26('0x14')](function(_0x3f33bc){if(_0x3f33bc){_0x3f33bc['update']({'lastMsgAt':_0x17fc1f[_0xac26('0x15')],'lastMsgDirection':_0x17fc1f[_0xac26('0xd')][_0xac26('0xe')]()});}})[_0xac26('0x16')](function(_0x1f6b6e){console['error'](_0x1f6b6e);});}_0x357d2d();}},'charset':_0xac26('0x17'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 4cd0a40..e2f73ef 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 _0x978a=['rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','ChatMessage,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','CreateChatMessage','ChatMessage','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x59f97a,_0x511696){var _0x411b33=function(_0x4f801e){while(--_0x4f801e){_0x59f97a['push'](_0x59f97a['shift']());}};_0x411b33(++_0x511696);}(_0x978a,0x93));var _0xa978=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x978a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa978('0x0'));var util=require(_0xa978('0x1'));var moment=require(_0xa978('0x2'));var BPromise=require(_0xa978('0x3'));var rs=require(_0xa978('0x4'));var fs=require('fs');var Redis=require(_0xa978('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa978('0x6'));var logger=require(_0xa978('0x7'))(_0xa978('0x8'));var config=require(_0xa978('0x9'));var jayson=require(_0xa978('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xa978('0xb')]=_[_0xa978('0xc')](config[_0xa978('0xb')],{'host':_0xa978('0xd'),'port':0x18eb});var socket=require(_0xa978('0xe'))(new Redis(config[_0xa978('0xb')]));require(_0xa978('0xf'))[_0xa978('0x10')](socket);function respondWithRpcPromise(_0x5c7af3,_0x460c3e,_0x21ae97){return new BPromise(function(_0x3520b0,_0xdd7815){return client['request'](_0x5c7af3,_0x21ae97)[_0xa978('0x11')](function(_0x26a0b9){logger['info'](_0xa978('0x12'),_0x460c3e,_0xa978('0x13'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x460c3e,_0xa978('0x13'),JSON['stringify'](_0x26a0b9));if(_0x26a0b9[_0xa978('0x14')]){if(_0x26a0b9[_0xa978('0x14')][_0xa978('0x15')]===0x1f4){logger[_0xa978('0x14')](_0xa978('0x12'),_0x460c3e,_0x26a0b9[_0xa978('0x14')][_0xa978('0x16')]);return _0xdd7815(_0x26a0b9[_0xa978('0x14')][_0xa978('0x16')]);}logger[_0xa978('0x14')]('ChatMessage,\x20%s,\x20%s',_0x460c3e,_0x26a0b9['error'][_0xa978('0x16')]);return _0x3520b0(_0x26a0b9[_0xa978('0x14')][_0xa978('0x16')]);}else{logger[_0xa978('0x17')](_0xa978('0x12'),_0x460c3e,_0xa978('0x13'));_0x3520b0(_0x26a0b9[_0xa978('0x18')][_0xa978('0x16')]);}})['catch'](function(_0x11b36b){logger['error'](_0xa978('0x12'),_0x460c3e,_0x11b36b);_0xdd7815(_0x11b36b);});});}exports[_0xa978('0x19')]=function(_0x6dbb7f){var _0x4f4f31=this;return new Promise(function(_0x2a20d8,_0x5d6137){return db[_0xa978('0x1a')]['create'](_0x6dbb7f[_0xa978('0x1b')],{'raw':_0x6dbb7f[_0xa978('0x1c')]?_0x6dbb7f['options'][_0xa978('0x1d')]===undefined?!![]:![]:!![]})[_0xa978('0x11')](function(_0x547fe){logger[_0xa978('0x17')]('CreateChatMessage',_0x6dbb7f);logger['debug'](_0xa978('0x19'),_0x6dbb7f,JSON[_0xa978('0x1e')](_0x547fe));_0x2a20d8(_0x547fe);})['catch'](function(_0x4beb97){logger[_0xa978('0x14')](_0xa978('0x19'),_0x4beb97[_0xa978('0x16')],_0x6dbb7f);_0x5d6137(_0x4f4f31[_0xa978('0x14')](0x1f4,_0x4beb97[_0xa978('0x16')]));});});};
\ No newline at end of file
+var _0x76c1=['error','ChatMessage,\x20%s,\x20%s','message','info','catch','ChatMessage','body','options','raw','CreateChatMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5d7dc0,_0x212a52){var _0xfc6a81=function(_0x5b92a2){while(--_0x5b92a2){_0x5d7dc0['push'](_0x5d7dc0['shift']());}};_0xfc6a81(++_0x212a52);}(_0x76c1,0x87));var _0x176c=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x76c1[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x176c('0x0'));var util=require(_0x176c('0x1'));var moment=require(_0x176c('0x2'));var BPromise=require(_0x176c('0x3'));var rs=require(_0x176c('0x4'));var fs=require('fs');var Redis=require(_0x176c('0x5'));var db=require(_0x176c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x176c('0x7'))(_0x176c('0x8'));var config=require(_0x176c('0x9'));var jayson=require(_0x176c('0xa'));var client=jayson[_0x176c('0xb')]['http']({'port':0x232a});config[_0x176c('0xc')]=_[_0x176c('0xd')](config['redis'],{'host':_0x176c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x176c('0xc')]));require('./chatMessage.socket')[_0x176c('0xf')](socket);function respondWithRpcPromise(_0x549802,_0x130994,_0x183a49){return new BPromise(function(_0x277c79,_0x530688){return client[_0x176c('0x10')](_0x549802,_0x183a49)['then'](function(_0x262a5f){logger['info']('ChatMessage,\x20%s,\x20%s',_0x130994,_0x176c('0x11'));logger[_0x176c('0x12')](_0x176c('0x13'),_0x130994,_0x176c('0x11'),JSON['stringify'](_0x262a5f));if(_0x262a5f[_0x176c('0x14')]){if(_0x262a5f['error']['code']===0x1f4){logger[_0x176c('0x14')](_0x176c('0x15'),_0x130994,_0x262a5f[_0x176c('0x14')][_0x176c('0x16')]);return _0x530688(_0x262a5f[_0x176c('0x14')][_0x176c('0x16')]);}logger[_0x176c('0x14')](_0x176c('0x15'),_0x130994,_0x262a5f[_0x176c('0x14')][_0x176c('0x16')]);return _0x277c79(_0x262a5f[_0x176c('0x14')][_0x176c('0x16')]);}else{logger[_0x176c('0x17')](_0x176c('0x15'),_0x130994,_0x176c('0x11'));_0x277c79(_0x262a5f['result'][_0x176c('0x16')]);}})[_0x176c('0x18')](function(_0xd85970){logger[_0x176c('0x14')]('ChatMessage,\x20%s,\x20%s',_0x130994,_0xd85970);_0x530688(_0xd85970);});});}exports['CreateChatMessage']=function(_0x420ddb){var _0x154bbb=this;return new Promise(function(_0x46c7f4,_0x1cb1f8){return db[_0x176c('0x19')]['create'](_0x420ddb[_0x176c('0x1a')],{'raw':_0x420ddb[_0x176c('0x1b')]?_0x420ddb['options'][_0x176c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0xfb879b){logger[_0x176c('0x17')](_0x176c('0x1d'),_0x420ddb);logger[_0x176c('0x12')](_0x176c('0x1d'),_0x420ddb,JSON[_0x176c('0x1e')](_0xfb879b));_0x46c7f4(_0xfb879b);})[_0x176c('0x18')](function(_0x4e5f25){logger[_0x176c('0x14')](_0x176c('0x1d'),_0x4e5f25[_0x176c('0x16')],_0x420ddb);_0x1cb1f8(_0x154bbb[_0x176c('0x14')](0x1f4,_0x4e5f25[_0x176c('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 342b682..213830d 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 _0x383d=['register','length','remove','update','emit','removeListener'];(function(_0x4f9e12,_0xec557f){var _0x146653=function(_0x2975e9){while(--_0x2975e9){_0x4f9e12['push'](_0x4f9e12['shift']());}};_0x146653(++_0xec557f);}(_0x383d,0x86));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0xd383('0x0'),_0xd383('0x1')];function createListener(_0x35486e,_0x559dd3){return function(_0x7554ef){_0x559dd3[_0xd383('0x2')](_0x35486e,_0x7554ef);};}function removeListener(_0x319f67,_0x3439dd){return function(){ChatMessageEvents[_0xd383('0x3')](_0x319f67,_0x3439dd);};}exports[_0xd383('0x4')]=function(_0x5a0b1d){for(var _0xc64e9b=0x0,_0x30ba82=events[_0xd383('0x5')];_0xc64e9b<_0x30ba82;_0xc64e9b++){var _0x470d8d=events[_0xc64e9b];var _0xffa778=createListener('chatMessage:'+_0x470d8d,_0x5a0b1d);ChatMessageEvents['on'](_0x470d8d,_0xffa778);}};
\ No newline at end of file
+var _0x9879=['remove','emit','removeListener','register','chatMessage:','./chatMessage.events','save'];(function(_0x2e2292,_0x1891b8){var _0x4f77ab=function(_0x3e5cb6){while(--_0x3e5cb6){_0x2e2292['push'](_0x2e2292['shift']());}};_0x4f77ab(++_0x1891b8);}(_0x9879,0x98));var _0x9987=function(_0x1a6fc7,_0x393068){_0x1a6fc7=_0x1a6fc7-0x0;var _0x3ad226=_0x9879[_0x1a6fc7];return _0x3ad226;};'use strict';var ChatMessageEvents=require(_0x9987('0x0'));var events=[_0x9987('0x1'),_0x9987('0x2'),'update'];function createListener(_0xadce9d,_0x525218){return function(_0x3a2473){_0x525218[_0x9987('0x3')](_0xadce9d,_0x3a2473);};}function removeListener(_0x1fd45d,_0xcc5722){return function(){ChatMessageEvents[_0x9987('0x4')](_0x1fd45d,_0xcc5722);};}exports[_0x9987('0x5')]=function(_0x4258df){for(var _0x4d479d=0x0,_0x34d2fd=events['length'];_0x4d479d<_0x34d2fd;_0x4d479d++){var _0x6cb988=events[_0x4d479d];var _0x3e5538=createListener(_0x9987('0x6')+_0x6cb988,_0x4258df);ChatMessageEvents['on'](_0x6cb988,_0x3e5538);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index aa2f945..3fb1a81 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 _0x2611=['create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','show','post','tracked','chat'];(function(_0x58dd9e,_0x283816){var _0xbcc1d1=function(_0x2d2ff4){while(--_0x2d2ff4){_0x58dd9e['push'](_0x58dd9e['shift']());}};_0xbcc1d1(++_0x283816);}(_0x2611,0x1af));var _0x1261=function(_0x1ffcad,_0x9afad3){_0x1ffcad=_0x1ffcad-0x0;var _0x63720e=_0x2611[_0x1ffcad];return _0x63720e;};'use strict';var multer=require('multer');var util=require(_0x1261('0x0'));var path=require(_0x1261('0x1'));var timeout=require(_0x1261('0x2'));var express=require(_0x1261('0x3'));var router=express[_0x1261('0x4')]();var fs_extra=require(_0x1261('0x5'));var auth=require(_0x1261('0x6'));var interaction=require(_0x1261('0x7'));var config=require(_0x1261('0x8'));var controller=require('./chatMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1261('0x9')]);router[_0x1261('0xa')](_0x1261('0xb'),auth[_0x1261('0xc')](),controller['describe']);router['get']('/:id',auth[_0x1261('0xc')](),controller[_0x1261('0xd')]);router[_0x1261('0xe')]('/',auth[_0x1261('0xc')](),interaction[_0x1261('0xf')](_0x1261('0x10'),'chatmessage:create'),controller[_0x1261('0x11')]);router[_0x1261('0x12')](_0x1261('0x13'),controller[_0x1261('0x14')]);router[_0x1261('0x12')](_0x1261('0x15'),auth['isAuthenticated'](),controller[_0x1261('0x16')]);router[_0x1261('0x12')](_0x1261('0x17'),auth[_0x1261('0xc')](),controller[_0x1261('0x18')]);router[_0x1261('0x19')]('/:id',auth[_0x1261('0xc')](),controller[_0x1261('0x1a')]);module[_0x1261('0x1b')]=router;
\ No newline at end of file
+var _0xfd19=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','post','chat','update','put','/:id/accept','accept','/:id/reject'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xfd19,0x16f));var _0x9fd1=function(_0x2ee78b,_0x489f2b){_0x2ee78b=_0x2ee78b-0x0;var _0x139bd7=_0xfd19[_0x2ee78b];return _0x139bd7;};'use strict';var multer=require(_0x9fd1('0x0'));var util=require(_0x9fd1('0x1'));var path=require(_0x9fd1('0x2'));var timeout=require(_0x9fd1('0x3'));var express=require(_0x9fd1('0x4'));var router=express[_0x9fd1('0x5')]();var fs_extra=require(_0x9fd1('0x6'));var auth=require(_0x9fd1('0x7'));var interaction=require(_0x9fd1('0x8'));var config=require('../../config/environment');var controller=require(_0x9fd1('0x9'));router['get']('/',auth[_0x9fd1('0xa')](),controller[_0x9fd1('0xb')]);router[_0x9fd1('0xc')](_0x9fd1('0xd'),auth[_0x9fd1('0xa')](),controller[_0x9fd1('0xe')]);router[_0x9fd1('0xc')](_0x9fd1('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x9fd1('0x10')]('/',auth[_0x9fd1('0xa')](),interaction['tracked'](_0x9fd1('0x11'),'chatmessage:create'),controller['create']);router['put'](_0x9fd1('0xf'),controller[_0x9fd1('0x12')]);router[_0x9fd1('0x13')](_0x9fd1('0x14'),auth[_0x9fd1('0xa')](),controller[_0x9fd1('0x15')]);router[_0x9fd1('0x13')](_0x9fd1('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0x9fd1('0x17')](_0x9fd1('0xf'),auth[_0x9fd1('0xa')](),controller[_0x9fd1('0x18')]);module[_0x9fd1('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 c606235..1457f18 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x51ec16,_0x489add){var _0x17f80d=function(_0x3934f9){while(--_0x3934f9){_0x51ec16['push'](_0x51ec16['shift']());}};_0x17f80d(++_0x489add);}(_0xb10b,0x12a));var _0xbb10=function(_0x888a02,_0x5df389){_0x888a02=_0x888a02-0x0;var _0xedd786=_0xb10b[_0x888a02];return _0xedd786;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0x343659,_0x51615f){var _0x19bf57=function(_0x48728e){while(--_0x48728e){_0x343659['push'](_0x343659['shift']());}};_0x19bf57(++_0x51615f);}(_0xadb5,0xad));var _0x5adb=function(_0x559077,_0x303940){_0x559077=_0x559077-0x0;var _0xb029b6=_0xadb5[_0x559077];return _0xb029b6;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('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 fef39ca..7a6236b 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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x34568e,_0x3c2e0e){var _0x4629a6=function(_0x27bb06){while(--_0x27bb06){_0x34568e['push'](_0x34568e['shift']());}};_0x4629a6(++_0x3c2e0e);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2cee38,_0x50c0d7){var _0x24fdfd=function(_0x479849){while(--_0x479849){_0x2cee38['push'](_0x2cee38['shift']());}};_0x24fdfd(++_0x50c0d7);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 6f98c50..0c23a55 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 _0x43a2=['setMaxListeners','update','emit','../../mysqldb','ChatOfflineMessage'];(function(_0x133e05,_0x28eb8d){var _0x30d761=function(_0x487c64){while(--_0x487c64){_0x133e05['push'](_0x133e05['shift']());}};_0x30d761(++_0x28eb8d);}(_0x43a2,0xd0));var _0x243a=function(_0x4e95e9,_0x4c1fad){_0x4e95e9=_0x4e95e9-0x0;var _0x53a4d8=_0x43a2[_0x4e95e9];return _0x53a4d8;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x243a('0x0'))['db'][_0x243a('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x243a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x243a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x37dba9){return function(_0x29fb13,_0x3da3b5,_0xff53f9){ChatOfflineMessageEvents['emit'](_0x37dba9+':'+_0x29fb13['id'],_0x29fb13);ChatOfflineMessageEvents[_0x243a('0x4')](_0x37dba9,_0x29fb13);_0xff53f9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x997d=['events','ChatOfflineMessage','setMaxListeners','remove','emit','exports'];(function(_0x40b1c8,_0x2a941e){var _0x1e54a9=function(_0x56cfac){while(--_0x56cfac){_0x40b1c8['push'](_0x40b1c8['shift']());}};_0x1e54a9(++_0x2a941e);}(_0x997d,0xae));var _0xd997=function(_0x5d72da,_0xb7ce32){_0x5d72da=_0x5d72da-0x0;var _0x43ebe7=_0x997d[_0x5d72da];return _0x43ebe7;};'use strict';var EventEmitter=require(_0xd997('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xd997('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xd997('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd997('0x3')};function emitEvent(_0x4cbed2){return function(_0x5e5b7d,_0x3ae2b6,_0x5543c1){ChatOfflineMessageEvents[_0xd997('0x4')](_0x4cbed2+':'+_0x5e5b7d['id'],_0x5e5b7d);ChatOfflineMessageEvents['emit'](_0x4cbed2,_0x5e5b7d);_0x5543c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xd997('0x5')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 2d73629..0f2959e 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 _0x2a63=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a63,0xfb));var _0x32a6=function(_0x7efe31,_0x1b42d3){_0x7efe31=_0x7efe31-0x0;var _0x59ea5a=_0x2a63[_0x7efe31];return _0x59ea5a;};'use strict';var attributes=require(_0x32a6('0x0'));module['exports']=function(_0xd71529){return _0xd71529[_0x32a6('0x1')](_0x32a6('0x2'),attributes,{'tableName':_0x32a6('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x32a6('0x4'),'collate':_0x32a6('0x5')});};
\ No newline at end of file
+var _0xf038=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xf038,0x110));var _0x8f03=function(_0x1943d9,_0x245bb8){_0x1943d9=_0x1943d9-0x0;var _0x4b4f3f=_0xf038[_0x1943d9];return _0x4b4f3f;};'use strict';var attributes=require(_0x8f03('0x0'));module[_0x8f03('0x1')]=function(_0x5e31f6){return _0x5e31f6[_0x8f03('0x2')](_0x8f03('0x3'),attributes,{'tableName':'chat_offline_messages','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 1e2fbe9..b10a934 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 _0x91e6=['../../config/logger','../../config/environment','jayson/promise','client','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x264a58,_0x31d451){var _0x137f2a=function(_0x15bfc5){while(--_0x15bfc5){_0x264a58['push'](_0x264a58['shift']());}};_0x137f2a(++_0x31d451);}(_0x91e6,0x123));var _0x691e=function(_0x3798c3,_0x4d6f41){_0x3798c3=_0x3798c3-0x0;var _0x339eec=_0x91e6[_0x3798c3];return _0x339eec;};'use strict';var _=require(_0x691e('0x0'));var util=require(_0x691e('0x1'));var moment=require(_0x691e('0x2'));var BPromise=require(_0x691e('0x3'));var rs=require(_0x691e('0x4'));var fs=require('fs');var Redis=require(_0x691e('0x5'));var db=require(_0x691e('0x6'))['db'];var utils=require(_0x691e('0x7'));var logger=require(_0x691e('0x8'))('rpc');var config=require(_0x691e('0x9'));var jayson=require(_0x691e('0xa'));var client=jayson[_0x691e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcd6a95,_0xb45a02,_0x532e63){return new BPromise(function(_0x5cdb4b,_0x476309){return client['request'](_0xcd6a95,_0x532e63)[_0x691e('0xc')](function(_0xd93e00){logger[_0x691e('0xd')](_0x691e('0xe'),_0xb45a02,'request\x20sent');logger[_0x691e('0xf')](_0x691e('0x10'),_0xb45a02,_0x691e('0x11'),JSON[_0x691e('0x12')](_0xd93e00));if(_0xd93e00[_0x691e('0x13')]){if(_0xd93e00['error'][_0x691e('0x14')]===0x1f4){logger['error'](_0x691e('0xe'),_0xb45a02,_0xd93e00[_0x691e('0x13')][_0x691e('0x15')]);return _0x476309(_0xd93e00['error'][_0x691e('0x15')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0xb45a02,_0xd93e00[_0x691e('0x13')][_0x691e('0x15')]);return _0x5cdb4b(_0xd93e00['error']['message']);}else{logger[_0x691e('0xd')](_0x691e('0xe'),_0xb45a02,_0x691e('0x11'));_0x5cdb4b(_0xd93e00['result']['message']);}})[_0x691e('0x16')](function(_0x55043b){logger['error'](_0x691e('0xe'),_0xb45a02,_0x55043b);_0x476309(_0x55043b);});});}
\ No newline at end of file
+var _0xbceb=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0xbceb,0x10d));var _0xbbce=function(_0x5c13f2,_0x976579){_0x5c13f2=_0x5c13f2-0x0;var _0x4d0753=_0xbceb[_0x5c13f2];return _0x4d0753;};'use strict';var _=require('lodash');var util=require(_0xbbce('0x0'));var moment=require(_0xbbce('0x1'));var BPromise=require(_0xbbce('0x2'));var rs=require(_0xbbce('0x3'));var fs=require('fs');var Redis=require(_0xbbce('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbbce('0x5'))(_0xbbce('0x6'));var config=require(_0xbbce('0x7'));var jayson=require(_0xbbce('0x8'));var client=jayson[_0xbbce('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3283da,_0xd4f3fb,_0x4dc031){return new BPromise(function(_0x2be991,_0x17d2bc){return client[_0xbbce('0xa')](_0x3283da,_0x4dc031)[_0xbbce('0xb')](function(_0x4379ba){logger['info'](_0xbbce('0xc'),_0xd4f3fb,_0xbbce('0xd'));logger[_0xbbce('0xe')](_0xbbce('0xf'),_0xd4f3fb,_0xbbce('0xd'),JSON[_0xbbce('0x10')](_0x4379ba));if(_0x4379ba[_0xbbce('0x11')]){if(_0x4379ba['error'][_0xbbce('0x12')]===0x1f4){logger[_0xbbce('0x11')](_0xbbce('0xc'),_0xd4f3fb,_0x4379ba['error'][_0xbbce('0x13')]);return _0x17d2bc(_0x4379ba['error'][_0xbbce('0x13')]);}logger[_0xbbce('0x11')](_0xbbce('0xc'),_0xd4f3fb,_0x4379ba['error'][_0xbbce('0x13')]);return _0x2be991(_0x4379ba[_0xbbce('0x11')][_0xbbce('0x13')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xd4f3fb,_0xbbce('0xd'));_0x2be991(_0x4379ba[_0xbbce('0x14')][_0xbbce('0x13')]);}})[_0xbbce('0x15')](function(_0xcf2ea6){logger[_0xbbce('0x11')](_0xbbce('0xc'),_0xd4f3fb,_0xcf2ea6);_0x17d2bc(_0xcf2ea6);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 6ee431e..6fe68cb 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 _0x903d=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x4fcdb7,_0x39f7fa){var _0x3264cb=function(_0x5ee371){while(--_0x5ee371){_0x4fcdb7['push'](_0x4fcdb7['shift']());}};_0x3264cb(++_0x39f7fa);}(_0x903d,0x15f));var _0xd903=function(_0x1a5bec,_0x126efd){_0x1a5bec=_0x1a5bec-0x0;var _0x19d79=_0x903d[_0x1a5bec];return _0x19d79;};'use strict';var multer=require(_0xd903('0x0'));var util=require('util');var path=require(_0xd903('0x1'));var timeout=require(_0xd903('0x2'));var express=require(_0xd903('0x3'));var router=express['Router']();var fs_extra=require(_0xd903('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd903('0x5'));var config=require(_0xd903('0x6'));var controller=require(_0xd903('0x7'));router[_0xd903('0x8')]('/',auth['isAuthenticated'](),controller[_0xd903('0x9')]);router[_0xd903('0x8')](_0xd903('0xa'),auth[_0xd903('0xb')](),controller[_0xd903('0xc')]);router[_0xd903('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd903('0xd')]);router[_0xd903('0xe')]('/',auth[_0xd903('0xb')](),controller[_0xd903('0xf')]);router[_0xd903('0x10')]('/:id',auth[_0xd903('0xb')](),controller[_0xd903('0x11')]);router[_0xd903('0x12')](_0xd903('0x13'),auth['isAuthenticated'](),controller[_0xd903('0x14')]);module[_0xd903('0x15')]=router;
\ No newline at end of file
+var _0xd6fc=['index','/describe','describe','/:id','show','post','put','update','delete','destroy','util','path','express','Router','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated'];(function(_0x4c1cc2,_0x2c2a83){var _0x32ab52=function(_0x1ad702){while(--_0x1ad702){_0x4c1cc2['push'](_0x4c1cc2['shift']());}};_0x32ab52(++_0x2c2a83);}(_0xd6fc,0x118));var _0xcd6f=function(_0x27422c,_0x48a151){_0x27422c=_0x27422c-0x0;var _0x361d69=_0xd6fc[_0x27422c];return _0x361d69;};'use strict';var multer=require('multer');var util=require(_0xcd6f('0x0'));var path=require(_0xcd6f('0x1'));var timeout=require('connect-timeout');var express=require(_0xcd6f('0x2'));var router=express[_0xcd6f('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcd6f('0x4'));var config=require('../../config/environment');var controller=require(_0xcd6f('0x5'));router[_0xcd6f('0x6')]('/',auth[_0xcd6f('0x7')](),controller[_0xcd6f('0x8')]);router['get'](_0xcd6f('0x9'),auth[_0xcd6f('0x7')](),controller[_0xcd6f('0xa')]);router[_0xcd6f('0x6')](_0xcd6f('0xb'),auth[_0xcd6f('0x7')](),controller[_0xcd6f('0xc')]);router[_0xcd6f('0xd')]('/',auth[_0xcd6f('0x7')](),controller['create']);router[_0xcd6f('0xe')]('/:id',auth[_0xcd6f('0x7')](),controller[_0xcd6f('0xf')]);router[_0xcd6f('0x10')](_0xcd6f('0xb'),auth[_0xcd6f('0x7')](),controller[_0xcd6f('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 6ae1809..fff4d53 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 _0x146f=['STRING','mouseOver','INTEGER','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x146f,0xff));var _0xf146=function(_0x42820f,_0x5b397b){_0x42820f=_0x42820f-0x0;var _0x2a1c48=_0x146f[_0x42820f];return _0x2a1c48;};'use strict';var Sequelize=require(_0xf146('0x0'));module['exports']={'name':{'type':Sequelize[_0xf146('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf146('0x2'),'timeout'),'defaultValue':_0xf146('0x2')},'selector':{'type':Sequelize[_0xf146('0x1')]},'timeout':{'type':Sequelize[_0xf146('0x3')]}};
\ No newline at end of file
+var _0x59dc=['INTEGER','sequelize','exports','ENUM','mouseOver','STRING'];(function(_0x403229,_0x1fc925){var _0x334e49=function(_0x4a1eb5){while(--_0x4a1eb5){_0x403229['push'](_0x403229['shift']());}};_0x334e49(++_0x1fc925);}(_0x59dc,0xa9));var _0xc59d=function(_0x58b3ec,_0x120252){_0x58b3ec=_0x58b3ec-0x0;var _0x109b74=_0x59dc[_0x58b3ec];return _0x109b74;};'use strict';var Sequelize=require(_0xc59d('0x0'));module[_0xc59d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc59d('0x2')]('mouseOver','timeout'),'defaultValue':_0xc59d('0x3')},'selector':{'type':Sequelize[_0xc59d('0x4')]},'timeout':{'type':Sequelize[_0xc59d('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 3c1bf7e..5c85aa6 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 _0xe6c1=['apply','reject','then','destroy','error','stack','name','send','show','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','create','body','catch','update','params','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x2e8349,_0x84c5ac){var _0x9c2cd5=function(_0x11e01f){while(--_0x11e01f){_0x2e8349['push'](_0x2e8349['shift']());}};_0x9c2cd5(++_0x84c5ac);}(_0xe6c1,0xd8));var _0x1e6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6c1[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e6c('0x0'));var zipdir=require(_0x1e6c('0x1'));var jsonpatch=require(_0x1e6c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1e6c('0x3'));var Mustache=require(_0x1e6c('0x4'));var util=require(_0x1e6c('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e6c('0x6'));var _=require(_0x1e6c('0x7'));var squel=require(_0x1e6c('0x8'));var crypto=require(_0x1e6c('0x9'));var jsforce=require(_0x1e6c('0xa'));var deskjs=require(_0x1e6c('0xb'));var toCsv=require(_0x1e6c('0xc'));var querystring=require(_0x1e6c('0xd'));var Papa=require(_0x1e6c('0xe'));var Redis=require(_0x1e6c('0xf'));var authService=require(_0x1e6c('0x10'));var qs=require(_0x1e6c('0x11'));var as=require(_0x1e6c('0x12'));var hardwareService=require(_0x1e6c('0x13'));var logger=require(_0x1e6c('0x14'))(_0x1e6c('0x15'));var utils=require(_0x1e6c('0x16'));var config=require(_0x1e6c('0x17'));var licenseUtil=require(_0x1e6c('0x18'));var db=require(_0x1e6c('0x19'))['db'];function respondWithStatusCode(_0x24c4cf,_0x4a76aa){_0x4a76aa=_0x4a76aa||0xcc;return function(_0x1bff58){if(_0x1bff58){return _0x24c4cf[_0x1e6c('0x1a')](_0x4a76aa);}return _0x24c4cf['status'](_0x4a76aa)[_0x1e6c('0x1b')]();};}function respondWithResult(_0x293712,_0x121326){_0x121326=_0x121326||0xc8;return function(_0x51489b){if(_0x51489b){return _0x293712[_0x1e6c('0x1c')](_0x121326)[_0x1e6c('0x1d')](_0x51489b);}};}function respondWithFilteredResult(_0x3ef544,_0x556244){return function(_0x1e8769){if(_0x1e8769){var _0x30cff0=typeof _0x556244[_0x1e6c('0x1e')]===_0x1e6c('0x1f')&&typeof _0x556244[_0x1e6c('0x20')]==='undefined';var _0x42a511=_0x1e8769[_0x1e6c('0x21')];var _0xe3ec5d=_0x30cff0?0x0:_0x556244[_0x1e6c('0x1e')];var _0x4dc9d3=_0x30cff0?_0x1e8769[_0x1e6c('0x21')]:_0x556244[_0x1e6c('0x1e')]+_0x556244['limit'];var _0x576fac;if(_0x4dc9d3>=_0x42a511){_0x4dc9d3=_0x42a511;_0x576fac=0xc8;}else{_0x576fac=0xce;}_0x3ef544[_0x1e6c('0x1c')](_0x576fac);return _0x3ef544[_0x1e6c('0x22')](_0x1e6c('0x23'),_0xe3ec5d+'-'+_0x4dc9d3+'/'+_0x42a511)[_0x1e6c('0x1d')](_0x1e8769);}return null;};}function patchUpdates(_0x3fa599){return function(_0x52eb0c){try{jsonpatch[_0x1e6c('0x24')](_0x52eb0c,_0x3fa599,!![]);}catch(_0x444784){return BPromise[_0x1e6c('0x25')](_0x444784);}return _0x52eb0c['save']();};}function saveUpdates(_0x4b9484,_0x8dd01e){return function(_0x356df1){if(_0x356df1){return _0x356df1['update'](_0x4b9484)[_0x1e6c('0x26')](function(_0x5efe57){return _0x5efe57;});}return null;};}function removeEntity(_0x4b5592,_0x2e92d5){return function(_0x2494b4){if(_0x2494b4){return _0x2494b4[_0x1e6c('0x27')]()[_0x1e6c('0x26')](function(){_0x4b5592[_0x1e6c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bdd9e,_0x3fa4d7){return function(_0x530fff){if(!_0x530fff){_0x2bdd9e[_0x1e6c('0x1a')](0x194);}return _0x530fff;};}function handleError(_0x37df4b,_0x586cad){_0x586cad=_0x586cad||0x1f4;return function(_0x513338){logger[_0x1e6c('0x28')](_0x513338[_0x1e6c('0x29')]);if(_0x513338[_0x1e6c('0x2a')]){delete _0x513338[_0x1e6c('0x2a')];}_0x37df4b['status'](_0x586cad)[_0x1e6c('0x2b')](_0x513338);};}exports[_0x1e6c('0x2c')]=function(_0x1f8d2b,_0x9e2f3c){var _0x247a57={'raw':!![],'where':{'id':_0x1f8d2b['params']['id']}},_0x485620={};_0x485620[_0x1e6c('0x2d')]=_[_0x1e6c('0x2e')](db[_0x1e6c('0x2f')]['rawAttributes']);_0x485620[_0x1e6c('0x30')]=_[_0x1e6c('0x2e')](_0x1f8d2b[_0x1e6c('0x30')]);_0x485620[_0x1e6c('0x31')]=_[_0x1e6c('0x32')](_0x485620[_0x1e6c('0x2d')],_0x485620['query']);_0x247a57[_0x1e6c('0x33')]=_['intersection'](_0x485620[_0x1e6c('0x2d')],qs[_0x1e6c('0x34')](_0x1f8d2b['query'][_0x1e6c('0x34')]));_0x247a57[_0x1e6c('0x33')]=_0x247a57[_0x1e6c('0x33')][_0x1e6c('0x35')]?_0x247a57['attributes']:_0x485620[_0x1e6c('0x2d')];if(_0x1f8d2b[_0x1e6c('0x30')][_0x1e6c('0x36')]){_0x247a57[_0x1e6c('0x37')]=[{'all':!![]}];}_0x247a57=_[_0x1e6c('0x38')]({},_0x247a57,_0x1f8d2b['options']);return db[_0x1e6c('0x2f')][_0x1e6c('0x39')](_0x247a57)[_0x1e6c('0x26')](handleEntityNotFound(_0x9e2f3c,null))[_0x1e6c('0x26')](respondWithResult(_0x9e2f3c,null))['catch'](handleError(_0x9e2f3c,null));};exports[_0x1e6c('0x3a')]=function(_0x4153d6,_0xfc87ac){return db[_0x1e6c('0x2f')]['create'](_0x4153d6[_0x1e6c('0x3b')],{})['then'](respondWithResult(_0xfc87ac,0xc9))[_0x1e6c('0x3c')](handleError(_0xfc87ac,null));};exports[_0x1e6c('0x3d')]=function(_0x35539e,_0x28421b){if(_0x35539e['body']['id']){delete _0x35539e[_0x1e6c('0x3b')]['id'];}return db[_0x1e6c('0x2f')][_0x1e6c('0x39')]({'where':{'id':_0x35539e[_0x1e6c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x28421b,null))[_0x1e6c('0x26')](saveUpdates(_0x35539e[_0x1e6c('0x3b')],null))['then'](respondWithResult(_0x28421b,null))[_0x1e6c('0x3c')](handleError(_0x28421b,null));};exports[_0x1e6c('0x27')]=function(_0x33ede4,_0x174f85){return db['ChatProactiveAction']['find']({'where':{'id':_0x33ede4[_0x1e6c('0x3e')]['id']}})[_0x1e6c('0x26')](handleEntityNotFound(_0x174f85,null))['then'](removeEntity(_0x174f85,null))[_0x1e6c('0x3c')](handleError(_0x174f85,null));};
\ No newline at end of file
+var _0xbd50=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','show','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv'];(function(_0x5ad666,_0x599b7a){var _0x49a665=function(_0xe5f52c){while(--_0xe5f52c){_0x5ad666['push'](_0x5ad666['shift']());}};_0x49a665(++_0x599b7a);}(_0xbd50,0x196));var _0x0bd5=function(_0x173f13,_0x4ea3cf){_0x173f13=_0x173f13-0x0;var _0x585942=_0xbd50[_0x173f13];return _0x585942;};'use strict';var emlformat=require(_0x0bd5('0x0'));var rimraf=require(_0x0bd5('0x1'));var zipdir=require(_0x0bd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var BPromise=require(_0x0bd5('0x5'));var Mustache=require(_0x0bd5('0x6'));var util=require(_0x0bd5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bd5('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd5('0x9'));var _=require(_0x0bd5('0xa'));var squel=require(_0x0bd5('0xb'));var crypto=require(_0x0bd5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0xd'));var querystring=require(_0x0bd5('0xe'));var Papa=require(_0x0bd5('0xf'));var Redis=require('ioredis');var authService=require(_0x0bd5('0x10'));var qs=require(_0x0bd5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd5('0x12'));var logger=require(_0x0bd5('0x13'))('api');var utils=require(_0x0bd5('0x14'));var config=require(_0x0bd5('0x15'));var licenseUtil=require(_0x0bd5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f7a0c,_0x23982f){_0x23982f=_0x23982f||0xcc;return function(_0x2f9588){if(_0x2f9588){return _0x2f7a0c[_0x0bd5('0x17')](_0x23982f);}return _0x2f7a0c[_0x0bd5('0x18')](_0x23982f)[_0x0bd5('0x19')]();};}function respondWithResult(_0x30765e,_0x1e961d){_0x1e961d=_0x1e961d||0xc8;return function(_0x4f485b){if(_0x4f485b){return _0x30765e[_0x0bd5('0x18')](_0x1e961d)[_0x0bd5('0x1a')](_0x4f485b);}};}function respondWithFilteredResult(_0x574315,_0x31349f){return function(_0x23ef4e){if(_0x23ef4e){var _0x3a34e4=typeof _0x31349f[_0x0bd5('0x1b')]==='undefined'&&typeof _0x31349f[_0x0bd5('0x1c')]===_0x0bd5('0x1d');var _0xa890be=_0x23ef4e[_0x0bd5('0x1e')];var _0x833c14=_0x3a34e4?0x0:_0x31349f[_0x0bd5('0x1b')];var _0xc58e12=_0x3a34e4?_0x23ef4e[_0x0bd5('0x1e')]:_0x31349f[_0x0bd5('0x1b')]+_0x31349f[_0x0bd5('0x1c')];var _0x27bc1e;if(_0xc58e12>=_0xa890be){_0xc58e12=_0xa890be;_0x27bc1e=0xc8;}else{_0x27bc1e=0xce;}_0x574315[_0x0bd5('0x18')](_0x27bc1e);return _0x574315[_0x0bd5('0x1f')](_0x0bd5('0x20'),_0x833c14+'-'+_0xc58e12+'/'+_0xa890be)['json'](_0x23ef4e);}return null;};}function patchUpdates(_0x5ba943){return function(_0x596b6a){try{jsonpatch['apply'](_0x596b6a,_0x5ba943,!![]);}catch(_0x47d74a){return BPromise[_0x0bd5('0x21')](_0x47d74a);}return _0x596b6a[_0x0bd5('0x22')]();};}function saveUpdates(_0x13ce46,_0x4a6910){return function(_0x6ee1a8){if(_0x6ee1a8){return _0x6ee1a8['update'](_0x13ce46)[_0x0bd5('0x23')](function(_0x3b235b){return _0x3b235b;});}return null;};}function removeEntity(_0x38c21d,_0x5a8139){return function(_0x5b6dde){if(_0x5b6dde){return _0x5b6dde['destroy']()['then'](function(){_0x38c21d[_0x0bd5('0x18')](0xcc)[_0x0bd5('0x19')]();});}};}function handleEntityNotFound(_0x184db3,_0x4fde84){return function(_0x42428c){if(!_0x42428c){_0x184db3['sendStatus'](0x194);}return _0x42428c;};}function handleError(_0x456e87,_0x3ffb08){_0x3ffb08=_0x3ffb08||0x1f4;return function(_0x18cec3){logger[_0x0bd5('0x24')](_0x18cec3[_0x0bd5('0x25')]);if(_0x18cec3[_0x0bd5('0x26')]){delete _0x18cec3[_0x0bd5('0x26')];}_0x456e87[_0x0bd5('0x18')](_0x3ffb08)[_0x0bd5('0x27')](_0x18cec3);};}exports[_0x0bd5('0x28')]=function(_0x15561b,_0xcbfc51){var _0x2e10ce={'raw':!![],'where':{'id':_0x15561b['params']['id']}},_0x2704ee={};_0x2704ee[_0x0bd5('0x29')]=_[_0x0bd5('0x2a')](db['ChatProactiveAction'][_0x0bd5('0x2b')]);_0x2704ee[_0x0bd5('0x2c')]=_['keys'](_0x15561b[_0x0bd5('0x2c')]);_0x2704ee[_0x0bd5('0x2d')]=_[_0x0bd5('0x2e')](_0x2704ee[_0x0bd5('0x29')],_0x2704ee['query']);_0x2e10ce[_0x0bd5('0x2f')]=_[_0x0bd5('0x2e')](_0x2704ee[_0x0bd5('0x29')],qs[_0x0bd5('0x30')](_0x15561b[_0x0bd5('0x2c')][_0x0bd5('0x30')]));_0x2e10ce['attributes']=_0x2e10ce[_0x0bd5('0x2f')]['length']?_0x2e10ce[_0x0bd5('0x2f')]:_0x2704ee[_0x0bd5('0x29')];if(_0x15561b[_0x0bd5('0x2c')][_0x0bd5('0x31')]){_0x2e10ce[_0x0bd5('0x32')]=[{'all':!![]}];}_0x2e10ce=_[_0x0bd5('0x33')]({},_0x2e10ce,_0x15561b[_0x0bd5('0x34')]);return db[_0x0bd5('0x35')][_0x0bd5('0x36')](_0x2e10ce)[_0x0bd5('0x23')](handleEntityNotFound(_0xcbfc51,null))[_0x0bd5('0x23')](respondWithResult(_0xcbfc51,null))[_0x0bd5('0x37')](handleError(_0xcbfc51,null));};exports[_0x0bd5('0x38')]=function(_0x4c9a61,_0x3e153a){return db[_0x0bd5('0x35')]['create'](_0x4c9a61['body'],{})[_0x0bd5('0x23')](respondWithResult(_0x3e153a,0xc9))[_0x0bd5('0x37')](handleError(_0x3e153a,null));};exports[_0x0bd5('0x39')]=function(_0x3155c5,_0x1dd2e1){if(_0x3155c5[_0x0bd5('0x3a')]['id']){delete _0x3155c5[_0x0bd5('0x3a')]['id'];}return db[_0x0bd5('0x35')][_0x0bd5('0x36')]({'where':{'id':_0x3155c5[_0x0bd5('0x3b')]['id']}})[_0x0bd5('0x23')](handleEntityNotFound(_0x1dd2e1,null))[_0x0bd5('0x23')](saveUpdates(_0x3155c5[_0x0bd5('0x3a')],null))['then'](respondWithResult(_0x1dd2e1,null))[_0x0bd5('0x37')](handleError(_0x1dd2e1,null));};exports['destroy']=function(_0x369d23,_0x2f17a1){return db[_0x0bd5('0x35')][_0x0bd5('0x36')]({'where':{'id':_0x369d23[_0x0bd5('0x3b')]['id']}})[_0x0bd5('0x23')](handleEntityNotFound(_0x2f17a1,null))['then'](removeEntity(_0x2f17a1,null))[_0x0bd5('0x37')](handleError(_0x2f17a1,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index aeba2f6..7098a62 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 _0x999a=['rimraf','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','util','../../config/logger','api','bluebird','request-promise'];(function(_0x29e19a,_0xc6bf2){var _0x19609f=function(_0x5e7078){while(--_0x5e7078){_0x29e19a['push'](_0x29e19a['shift']());}};_0x19609f(++_0xc6bf2);}(_0x999a,0x16d));var _0xa999=function(_0x4a78af,_0x268061){_0x4a78af=_0x4a78af-0x0;var _0x525ff8=_0x999a[_0x4a78af];return _0x525ff8;};'use strict';var _=require('lodash');var util=require(_0xa999('0x0'));var logger=require(_0xa999('0x1'))(_0xa999('0x2'));var moment=require('moment');var BPromise=require(_0xa999('0x3'));var rp=require(_0xa999('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa999('0x5'));var config=require('../../config/environment');var attributes=require(_0xa999('0x6'));module[_0xa999('0x7')]=function(_0x36d9c7,_0x6baba0){return _0x36d9c7[_0xa999('0x8')]('ChatProactiveAction',attributes,{'tableName':_0xa999('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa2cf=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x414280,_0xa59e35){var _0x2790b0=function(_0x56aef3){while(--_0x56aef3){_0x414280['push'](_0x414280['shift']());}};_0x2790b0(++_0xa59e35);}(_0xa2cf,0x1c2));var _0xfa2c=function(_0x45366e,_0x137fe8){_0x45366e=_0x45366e-0x0;var _0x2ee3fc=_0xa2cf[_0x45366e];return _0x2ee3fc;};'use strict';var _=require(_0xfa2c('0x0'));var util=require(_0xfa2c('0x1'));var logger=require(_0xfa2c('0x2'))(_0xfa2c('0x3'));var moment=require(_0xfa2c('0x4'));var BPromise=require(_0xfa2c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa2c('0x6'));var rimraf=require(_0xfa2c('0x7'));var config=require(_0xfa2c('0x8'));var attributes=require(_0xfa2c('0x9'));module[_0xfa2c('0xa')]=function(_0x851ff9,_0x6b9cf4){return _0x851ff9['define'](_0xfa2c('0xb'),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 eb6ffb8..ee81ade 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 _0x7633=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7633,0xbc));var _0x3763=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x7633[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x3763('0x0'));var util=require(_0x3763('0x1'));var moment=require(_0x3763('0x2'));var BPromise=require(_0x3763('0x3'));var rs=require(_0x3763('0x4'));var fs=require('fs');var Redis=require(_0x3763('0x5'));var db=require(_0x3763('0x6'))['db'];var utils=require(_0x3763('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3763('0x8'));var client=jayson['client'][_0x3763('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27d1e5,_0x187190,_0x3161c5){return new BPromise(function(_0xcfc8b1,_0x2dd9ad){return client[_0x3763('0xa')](_0x27d1e5,_0x3161c5)[_0x3763('0xb')](function(_0x3c0226){logger[_0x3763('0xc')](_0x3763('0xd'),_0x187190,_0x3763('0xe'));logger['debug'](_0x3763('0xf'),_0x187190,_0x3763('0xe'),JSON[_0x3763('0x10')](_0x3c0226));if(_0x3c0226[_0x3763('0x11')]){if(_0x3c0226['error']['code']===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x187190,_0x3c0226[_0x3763('0x11')][_0x3763('0x12')]);return _0x2dd9ad(_0x3c0226['error'][_0x3763('0x12')]);}logger[_0x3763('0x11')](_0x3763('0xd'),_0x187190,_0x3c0226['error'][_0x3763('0x12')]);return _0xcfc8b1(_0x3c0226[_0x3763('0x11')]['message']);}else{logger['info'](_0x3763('0xd'),_0x187190,_0x3763('0xe'));_0xcfc8b1(_0x3c0226[_0x3763('0x13')][_0x3763('0x12')]);}})[_0x3763('0x14')](function(_0x1d3251){logger[_0x3763('0x11')](_0x3763('0xd'),_0x187190,_0x1d3251);_0x2dd9ad(_0x1d3251);});});}
\ No newline at end of file
+var _0x42f3=['lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0xcc4461,_0x1d16cd){var _0x5b4269=function(_0x3c3548){while(--_0x3c3548){_0xcc4461['push'](_0xcc4461['shift']());}};_0x5b4269(++_0x1d16cd);}(_0x42f3,0x134));var _0x342f=function(_0x5ca52d,_0x3a4a22){_0x5ca52d=_0x5ca52d-0x0;var _0x89e54e=_0x42f3[_0x5ca52d];return _0x89e54e;};'use strict';var _=require(_0x342f('0x0'));var util=require(_0x342f('0x1'));var moment=require(_0x342f('0x2'));var BPromise=require(_0x342f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x342f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x342f('0x5'))('rpc');var config=require(_0x342f('0x6'));var jayson=require(_0x342f('0x7'));var client=jayson[_0x342f('0x8')][_0x342f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2748d6,_0x2fb282,_0x536708){return new BPromise(function(_0x48d6ac,_0x24d261){return client[_0x342f('0xa')](_0x2748d6,_0x536708)['then'](function(_0x6fdf8e){logger['info'](_0x342f('0xb'),_0x2fb282,_0x342f('0xc'));logger[_0x342f('0xd')](_0x342f('0xe'),_0x2fb282,_0x342f('0xc'),JSON[_0x342f('0xf')](_0x6fdf8e));if(_0x6fdf8e['error']){if(_0x6fdf8e[_0x342f('0x10')][_0x342f('0x11')]===0x1f4){logger[_0x342f('0x10')](_0x342f('0xb'),_0x2fb282,_0x6fdf8e[_0x342f('0x10')][_0x342f('0x12')]);return _0x24d261(_0x6fdf8e['error'][_0x342f('0x12')]);}logger[_0x342f('0x10')](_0x342f('0xb'),_0x2fb282,_0x6fdf8e['error'][_0x342f('0x12')]);return _0x48d6ac(_0x6fdf8e[_0x342f('0x10')]['message']);}else{logger[_0x342f('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x2fb282,_0x342f('0xc'));_0x48d6ac(_0x6fdf8e[_0x342f('0x14')][_0x342f('0x12')]);}})[_0x342f('0x15')](function(_0x2a4d7b){logger[_0x342f('0x10')](_0x342f('0xb'),_0x2fb282,_0x2a4d7b);_0x24d261(_0x2a4d7b);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 202ba9e..0589b9d 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 _0x24ca=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x517c37,_0xbc219d){var _0x4b157b=function(_0x3f50f2){while(--_0x3f50f2){_0x517c37['push'](_0x517c37['shift']());}};_0x4b157b(++_0xbc219d);}(_0x24ca,0x1bc));var _0xa24c=function(_0x3b4b1d,_0x15029e){_0x3b4b1d=_0x3b4b1d-0x0;var _0x488c36=_0x24ca[_0x3b4b1d];return _0x488c36;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0xc')]);router[_0xa24c('0xd')]('/',auth[_0xa24c('0xb')](),controller['create']);router[_0xa24c('0xe')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller['update']);router[_0xa24c('0xf')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0x10')]);module[_0xa24c('0x11')]=router;
\ No newline at end of file
+var _0x814b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x533bf7,_0x29485b){var _0x9e4c57=function(_0xe4211f){while(--_0xe4211f){_0x533bf7['push'](_0x533bf7['shift']());}};_0x9e4c57(++_0x29485b);}(_0x814b,0x1a2));var _0xb814=function(_0x120123,_0x4eff59){_0x120123=_0x120123-0x0;var _0x3bec4c=_0x814b[_0x120123];return _0x3bec4c;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')](_0xb814('0xb'),auth['isAuthenticated'](),controller[_0xb814('0xc')]);router[_0xb814('0xd')]('/',auth['isAuthenticated'](),controller[_0xb814('0xe')]);router[_0xb814('0xf')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index d076731..5ccfa1c 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 _0xe2ca=['name','INTEGER','ENUM','beepall','STRING'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0xe2ca,0xfe));var _0xae2c=function(_0x9bdecf,_0x5a030f){_0x9bdecf=_0x9bdecf-0x0;var _0x493fa5=_0xe2ca[_0x9bdecf];return _0x493fa5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xae2c('0x0')],'unique':_0xae2c('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xae2c('0x0')]},'timeout':{'type':Sequelize[_0xae2c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xae2c('0x3')]('rrmemory',_0xae2c('0x4'),'roundrobin')}};
\ No newline at end of file
+var _0x762c=['rrmemory','beepall','roundrobin','STRING','INTEGER'];(function(_0x11b9b3,_0x288679){var _0xc55357=function(_0x458133){while(--_0x458133){_0x11b9b3['push'](_0x11b9b3['shift']());}};_0xc55357(++_0x288679);}(_0x762c,0x184));var _0xc762=function(_0x527e14,_0x5d7ae9){_0x527e14=_0x527e14-0x0;var _0x33761a=_0x762c[_0x527e14];return _0x33761a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc762('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc762('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc762('0x2'),_0xc762('0x3'),_0xc762('0x4'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 4923e88..e5d3745 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 _0x9f89=['fast-json-patch','request-promise','moment','bluebird','mustache','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','ChatQueueId','UserChatQueue','UserId','agent','chatPause','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','addAgents','emit','isArray','userChatQueue:remove','getAgents','rimraf'];(function(_0x3ecf38,_0x2426af){var _0x2be6f0=function(_0x1b4727){while(--_0x1b4727){_0x3ecf38['push'](_0x3ecf38['shift']());}};_0x2be6f0(++_0x2426af);}(_0x9f89,0x13d));var _0x99f8=function(_0x5c525c,_0xc1d8a6){_0x5c525c=_0x5c525c-0x0;var _0x54413c=_0x9f89[_0x5c525c];return _0x54413c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99f8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99f8('0x1'));var rp=require(_0x99f8('0x2'));var moment=require(_0x99f8('0x3'));var BPromise=require(_0x99f8('0x4'));var Mustache=require(_0x99f8('0x5'));var util=require('util');var path=require(_0x99f8('0x6'));var sox=require(_0x99f8('0x7'));var csv=require(_0x99f8('0x8'));var ejs=require(_0x99f8('0x9'));var fs=require('fs');var fs_extra=require(_0x99f8('0xa'));var _=require(_0x99f8('0xb'));var squel=require(_0x99f8('0xc'));var crypto=require('crypto');var jsforce=require(_0x99f8('0xd'));var deskjs=require(_0x99f8('0xe'));var toCsv=require(_0x99f8('0x8'));var querystring=require(_0x99f8('0xf'));var Papa=require('papaparse');var Redis=require(_0x99f8('0x10'));var authService=require(_0x99f8('0x11'));var qs=require(_0x99f8('0x12'));var as=require(_0x99f8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99f8('0x14'))(_0x99f8('0x15'));var utils=require(_0x99f8('0x16'));var config=require(_0x99f8('0x17'));var licenseUtil=require(_0x99f8('0x18'));var db=require(_0x99f8('0x19'))['db'];config[_0x99f8('0x1a')]=_[_0x99f8('0x1b')](config[_0x99f8('0x1a')],{'host':_0x99f8('0x1c'),'port':0x18eb});var socket=require(_0x99f8('0x1d'))(new Redis(config['redis']));require(_0x99f8('0x1e'))[_0x99f8('0x1f')](socket);var jayson=require(_0x99f8('0x20'));var client=jayson[_0x99f8('0x21')][_0x99f8('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2430c1,_0x237558,_0x25a8a4,_0x29750c){return new BPromise(function(_0x1efc83,_0x3b1579){var _0x4841cc=_0x29750c||client;return _0x4841cc[_0x99f8('0x23')](_0x2430c1,_0x25a8a4)[_0x99f8('0x24')](function(_0x4937cd){logger[_0x99f8('0x25')](_0x99f8('0x26'),_0x237558,'request\x20sent');logger['debug'](_0x99f8('0x27'),_0x237558,_0x99f8('0x28'),JSON['stringify'](_0x4937cd));if(_0x4937cd[_0x99f8('0x29')]){if(_0x4937cd[_0x99f8('0x29')][_0x99f8('0x2a')]===0x1f4){logger[_0x99f8('0x29')]('ChatQueue,\x20%s,\x20%s',_0x237558,_0x4937cd[_0x99f8('0x29')][_0x99f8('0x2b')]);return _0x3b1579(_0x4937cd['error'][_0x99f8('0x2b')]);}logger[_0x99f8('0x29')](_0x99f8('0x26'),_0x237558,_0x4937cd[_0x99f8('0x29')][_0x99f8('0x2b')]);return _0x1efc83(_0x4937cd[_0x99f8('0x29')][_0x99f8('0x2b')]);}else{logger[_0x99f8('0x25')](_0x99f8('0x26'),_0x237558,_0x99f8('0x28'));_0x1efc83(_0x4937cd['result'][_0x99f8('0x2b')]);}})[_0x99f8('0x2c')](function(_0x2ed3e4){logger[_0x99f8('0x29')]('ChatQueue,\x20%s,\x20%s',_0x237558,_0x2ed3e4);_0x3b1579(_0x2ed3e4);});});}function respondWithStatusCode(_0x40f210,_0xde7280){_0xde7280=_0xde7280||0xcc;return function(_0x151e04){if(_0x151e04){return _0x40f210[_0x99f8('0x2d')](_0xde7280);}return _0x40f210[_0x99f8('0x2e')](_0xde7280)[_0x99f8('0x2f')]();};}function respondWithResult(_0x5cf6ba,_0xa6728e){_0xa6728e=_0xa6728e||0xc8;return function(_0x45509e){if(_0x45509e){return _0x5cf6ba['status'](_0xa6728e)['json'](_0x45509e);}};}function respondWithFilteredResult(_0x5dff29,_0x4ebfe5){return function(_0x55343e){if(_0x55343e){var _0x3599e5=typeof _0x4ebfe5[_0x99f8('0x30')]===_0x99f8('0x31')&&typeof _0x4ebfe5['limit']==='undefined';var _0x55ecb7=_0x55343e[_0x99f8('0x32')];var _0x16b350=_0x3599e5?0x0:_0x4ebfe5[_0x99f8('0x30')];var _0x3668e2=_0x3599e5?_0x55343e[_0x99f8('0x32')]:_0x4ebfe5[_0x99f8('0x30')]+_0x4ebfe5[_0x99f8('0x33')];var _0x3059d6;if(_0x3668e2>=_0x55ecb7){_0x3668e2=_0x55ecb7;_0x3059d6=0xc8;}else{_0x3059d6=0xce;}_0x5dff29[_0x99f8('0x2e')](_0x3059d6);return _0x5dff29[_0x99f8('0x34')](_0x99f8('0x35'),_0x16b350+'-'+_0x3668e2+'/'+_0x55ecb7)['json'](_0x55343e);}return null;};}function patchUpdates(_0x3159a4){return function(_0x519657){try{jsonpatch[_0x99f8('0x36')](_0x519657,_0x3159a4,!![]);}catch(_0x4e0f7f){return BPromise[_0x99f8('0x37')](_0x4e0f7f);}return _0x519657[_0x99f8('0x38')]();};}function saveUpdates(_0x18c209,_0x421ace){return function(_0x121930){if(_0x121930){return _0x121930[_0x99f8('0x39')](_0x18c209)[_0x99f8('0x24')](function(_0x4cb6cd){return _0x4cb6cd;});}return null;};}function removeEntity(_0x22a5f8,_0x9ba832){return function(_0x40060f){if(_0x40060f){return _0x40060f[_0x99f8('0x3a')]()[_0x99f8('0x24')](function(){var _0x1e36e8=_0x40060f['get']({'plain':!![]});var _0x5177d1=_0x99f8('0x3b');return db[_0x99f8('0x3c')][_0x99f8('0x3a')]({'where':{'type':_0x5177d1,'resourceId':_0x1e36e8['id']}})['then'](function(){return _0x40060f;});})[_0x99f8('0x24')](function(){_0x22a5f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x421c0c,_0x43f83c){return function(_0xdcb72d){if(!_0xdcb72d){_0x421c0c['sendStatus'](0x194);}return _0xdcb72d;};}function handleError(_0x1126b6,_0x569959){_0x569959=_0x569959||0x1f4;return function(_0x5c6a3e){logger['error'](_0x5c6a3e[_0x99f8('0x3d')]);if(_0x5c6a3e['name']){delete _0x5c6a3e[_0x99f8('0x3e')];}_0x1126b6[_0x99f8('0x2e')](_0x569959)[_0x99f8('0x3f')](_0x5c6a3e);};}exports[_0x99f8('0x40')]=function(_0x25f233,_0x4879ef){var _0x32f246={},_0x2a10e0={},_0x320738={'count':0x0,'rows':[]};var _0x35a37c=_[_0x99f8('0x41')](db[_0x99f8('0x42')][_0x99f8('0x43')],function(_0x3f81e6){return{'name':_0x3f81e6[_0x99f8('0x44')],'type':_0x3f81e6['type'][_0x99f8('0x45')]};});_0x2a10e0[_0x99f8('0x46')]=_[_0x99f8('0x41')](_0x35a37c,'name');_0x2a10e0[_0x99f8('0x47')]=_[_0x99f8('0x48')](_0x25f233['query']);_0x2a10e0['filters']=_[_0x99f8('0x49')](_0x2a10e0[_0x99f8('0x46')],_0x2a10e0[_0x99f8('0x47')]);_0x32f246['attributes']=_['intersection'](_0x2a10e0['model'],qs[_0x99f8('0x4a')](_0x25f233[_0x99f8('0x47')]['fields']));_0x32f246[_0x99f8('0x4b')]=_0x32f246[_0x99f8('0x4b')][_0x99f8('0x4c')]?_0x32f246['attributes']:_0x2a10e0['model'];if(!_0x25f233[_0x99f8('0x47')][_0x99f8('0x4d')](_0x99f8('0x4e'))){_0x32f246[_0x99f8('0x33')]=qs['limit'](_0x25f233['query'][_0x99f8('0x33')]);_0x32f246['offset']=qs[_0x99f8('0x30')](_0x25f233[_0x99f8('0x47')][_0x99f8('0x30')]);}_0x32f246[_0x99f8('0x4f')]=qs[_0x99f8('0x50')](_0x25f233['query'][_0x99f8('0x50')]);_0x32f246[_0x99f8('0x51')]=qs[_0x99f8('0x52')](_[_0x99f8('0x53')](_0x25f233[_0x99f8('0x47')],_0x2a10e0[_0x99f8('0x52')]),_0x35a37c);if(_0x25f233[_0x99f8('0x47')][_0x99f8('0x54')]){_0x32f246[_0x99f8('0x51')]=_[_0x99f8('0x55')](_0x32f246[_0x99f8('0x51')],{'$or':_['map'](_0x35a37c,function(_0x406086){if(_0x406086[_0x99f8('0x56')]!==_0x99f8('0x57')){var _0x17ff4f={};_0x17ff4f[_0x406086['name']]={'$like':'%'+_0x25f233['query'][_0x99f8('0x54')]+'%'};return _0x17ff4f;}})});}_0x32f246=_[_0x99f8('0x55')]({},_0x32f246,_0x25f233[_0x99f8('0x58')]);var _0x504739={'where':_0x32f246[_0x99f8('0x51')]};return db[_0x99f8('0x42')][_0x99f8('0x32')](_0x504739)[_0x99f8('0x24')](function(_0x4ac437){_0x320738[_0x99f8('0x32')]=_0x4ac437;if(_0x25f233[_0x99f8('0x47')][_0x99f8('0x59')]){_0x32f246[_0x99f8('0x5a')]=[{'all':!![]}];}return db[_0x99f8('0x42')][_0x99f8('0x5b')](_0x32f246);})[_0x99f8('0x24')](function(_0x184e1f){_0x320738[_0x99f8('0x5c')]=_0x184e1f;return _0x320738;})['then'](respondWithFilteredResult(_0x4879ef,_0x32f246))[_0x99f8('0x2c')](handleError(_0x4879ef,null));};exports[_0x99f8('0x5d')]=function(_0x112b08,_0x242113){var _0x2ee90e={'raw':!![],'where':{'id':_0x112b08[_0x99f8('0x5e')]['id']}},_0x27941a={};_0x27941a['model']=_[_0x99f8('0x48')](db[_0x99f8('0x42')][_0x99f8('0x43')]);_0x27941a[_0x99f8('0x47')]=_[_0x99f8('0x48')](_0x112b08[_0x99f8('0x47')]);_0x27941a[_0x99f8('0x52')]=_[_0x99f8('0x49')](_0x27941a[_0x99f8('0x46')],_0x27941a[_0x99f8('0x47')]);_0x2ee90e[_0x99f8('0x4b')]=_[_0x99f8('0x49')](_0x27941a[_0x99f8('0x46')],qs[_0x99f8('0x4a')](_0x112b08['query'][_0x99f8('0x4a')]));_0x2ee90e['attributes']=_0x2ee90e[_0x99f8('0x4b')][_0x99f8('0x4c')]?_0x2ee90e[_0x99f8('0x4b')]:_0x27941a[_0x99f8('0x46')];if(_0x112b08[_0x99f8('0x47')][_0x99f8('0x59')]){_0x2ee90e[_0x99f8('0x5a')]=[{'all':!![]}];}_0x2ee90e=_[_0x99f8('0x55')]({},_0x2ee90e,_0x112b08[_0x99f8('0x58')]);return db['ChatQueue'][_0x99f8('0x5f')](_0x2ee90e)[_0x99f8('0x24')](handleEntityNotFound(_0x242113,null))['then'](respondWithResult(_0x242113,null))[_0x99f8('0x2c')](handleError(_0x242113,null));};exports['create']=function(_0x3ef979,_0x9bbd46){return db[_0x99f8('0x42')][_0x99f8('0x60')](_0x3ef979['body'],{})[_0x99f8('0x24')](function(_0x59d558){var _0x5b02fe=_0x3ef979[_0x99f8('0x61')]['get']({'plain':!![]});if(!_0x5b02fe)throw new Error(_0x99f8('0x62'));if(_0x5b02fe[_0x99f8('0x63')]===_0x99f8('0x61')){var _0x2dde06=_0x59d558[_0x99f8('0x64')]({'plain':!![]});var _0x2558f0='ChatQueues';return db[_0x99f8('0x65')][_0x99f8('0x5f')]({'where':{'name':_0x2558f0,'userProfileId':_0x5b02fe[_0x99f8('0x66')]},'raw':!![]})[_0x99f8('0x24')](function(_0x233713){if(_0x233713&&_0x233713[_0x99f8('0x67')]===0x0){return db['UserProfileResource'][_0x99f8('0x60')]({'name':_0x2dde06[_0x99f8('0x3e')],'resourceId':_0x2dde06['id'],'type':_0x233713[_0x99f8('0x3e')],'sectionId':_0x233713['id']},{})[_0x99f8('0x24')](function(){return _0x59d558;});}else{return _0x59d558;}})[_0x99f8('0x2c')](function(_0x275ed6){logger['error'](_0x99f8('0x68'),_0x275ed6);throw _0x275ed6;});}return _0x59d558;})[_0x99f8('0x24')](respondWithResult(_0x9bbd46,0xc9))['catch'](handleError(_0x9bbd46,null));};exports[_0x99f8('0x39')]=function(_0x362628,_0x51f9e0){if(_0x362628[_0x99f8('0x69')]['id']){delete _0x362628[_0x99f8('0x69')]['id'];}return db[_0x99f8('0x42')][_0x99f8('0x5f')]({'where':{'id':_0x362628[_0x99f8('0x5e')]['id']}})['then'](handleEntityNotFound(_0x51f9e0,null))['then'](saveUpdates(_0x362628['body'],null))['then'](respondWithResult(_0x51f9e0,null))['catch'](handleError(_0x51f9e0,null));};exports[_0x99f8('0x3a')]=function(_0x5d1b54,_0x1e2d52){return db[_0x99f8('0x42')][_0x99f8('0x5f')]({'where':{'id':_0x5d1b54['params']['id']}})[_0x99f8('0x24')](handleEntityNotFound(_0x1e2d52,null))[_0x99f8('0x24')](removeEntity(_0x1e2d52,null))['catch'](handleError(_0x1e2d52,null));};exports[_0x99f8('0x6a')]=function(_0x1a797e,_0x13e5d4){return db[_0x99f8('0x42')][_0x99f8('0x6a')]()['then'](respondWithResult(_0x13e5d4,null))[_0x99f8('0x2c')](handleError(_0x13e5d4,null));};exports[_0x99f8('0x6b')]=function(_0xb48f2b,_0x1768fc,_0x205cce){var _0x4daa88={'raw':!![],'where':{}},_0x2b75a1={},_0x2b09ab;return db[_0x99f8('0x42')][_0x99f8('0x6c')]({'where':{'id':_0xb48f2b[_0x99f8('0x5e')]['id']}})[_0x99f8('0x24')](handleEntityNotFound(_0x1768fc,null))[_0x99f8('0x24')](function(_0x2d9c62){if(_0x2d9c62){_0x2b09ab=_0x2d9c62[_0x99f8('0x64')]({'plain':!![]});_0x2b75a1[_0x99f8('0x46')]=_['keys'](db['UserChatQueue']['rawAttributes']);_0x2b75a1['query']=_['keys'](_0xb48f2b[_0x99f8('0x47')]);_0x2b75a1[_0x99f8('0x52')]=_['intersection'](_0x2b75a1[_0x99f8('0x46')],_0x2b75a1[_0x99f8('0x47')]);_0x4daa88['attributes']=_[_0x99f8('0x49')](_0x2b75a1['model'],qs[_0x99f8('0x4a')](_0xb48f2b[_0x99f8('0x47')]['fields']));_0x4daa88[_0x99f8('0x4b')]=_0x4daa88[_0x99f8('0x4b')]['length']?_0x4daa88[_0x99f8('0x4b')]:_0x2b75a1[_0x99f8('0x46')];if(!_0xb48f2b['query'][_0x99f8('0x4d')]('nolimit')){_0x4daa88[_0x99f8('0x33')]=qs['limit'](_0xb48f2b[_0x99f8('0x47')][_0x99f8('0x33')]);_0x4daa88['offset']=qs['offset'](_0xb48f2b[_0x99f8('0x47')][_0x99f8('0x30')]);}_0x4daa88[_0x99f8('0x4f')]=qs[_0x99f8('0x50')](_0xb48f2b[_0x99f8('0x47')][_0x99f8('0x50')]);_0x4daa88['where']=qs[_0x99f8('0x52')](_['pick'](_0xb48f2b[_0x99f8('0x47')],_0x2b75a1[_0x99f8('0x52')]));_0x4daa88[_0x99f8('0x51')][_0x99f8('0x6d')]=_0x2d9c62['id'];if(_0xb48f2b[_0x99f8('0x47')][_0x99f8('0x54')]){_0x4daa88[_0x99f8('0x51')]=_[_0x99f8('0x55')](_0x4daa88[_0x99f8('0x51')],{'$or':_['map'](_0x4daa88['attributes'],function(_0x29a40b){var _0x19d585={};_0x19d585[_0x29a40b]={'$like':'%'+_0xb48f2b[_0x99f8('0x47')][_0x99f8('0x54')]+'%'};return _0x19d585;})});}_0x4daa88=_['merge']({},_0x4daa88,_0xb48f2b['options']);return db[_0x99f8('0x6e')][_0x99f8('0x5b')](_0x4daa88);}})[_0x99f8('0x24')](function(_0x4072cc){if(_0x4072cc){return db['User']['findAndCountAll']({'where':{'id':_[_0x99f8('0x41')](_0x4072cc,_0x99f8('0x6f')),'role':_0x99f8('0x70')},'attributes':['id',_0x99f8('0x3e'),_0x99f8('0x71'),'updatedAt',_0x99f8('0x72')]});}})[_0x99f8('0x24')](function(_0x1794be){if(_0x1794be){return{'count':_0x1794be['count'],'rows':_[_0x99f8('0x41')](_0x1794be[_0x99f8('0x5c')],function(_0x5e244e){return{'membername':_0x5e244e[_0x99f8('0x3e')],'UserId':_0x5e244e['id'],'queue_name':_0x2b09ab[_0x99f8('0x3e')],'ChatQueueId':_0x2b09ab['id'],'interface':util[_0x99f8('0x73')](_0x99f8('0x74'),_0x99f8('0x75'),_0x5e244e[_0x99f8('0x3e')]),'penalty':0x0,'paused':_0x5e244e[_0x99f8('0x71')],'createdAt':_0x5e244e[_0x99f8('0x72')],'updatedAt':_0x5e244e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x99f8('0x24')](respondWithFilteredResult(_0x1768fc,_0x4daa88))[_0x99f8('0x2c')](handleError(_0x1768fc,null));};exports[_0x99f8('0x76')]=function(_0x255088,_0x3a691,_0x1041e3){var _0x293dd6={};var _0x148ea1={};var _0x35156d;var _0x3cb606;return db[_0x99f8('0x42')][_0x99f8('0x6c')]({'where':{'id':_0x255088['params']['id']}})[_0x99f8('0x24')](handleEntityNotFound(_0x3a691,null))[_0x99f8('0x24')](function(_0x6bf41c){if(_0x6bf41c){_0x35156d=_0x6bf41c;_0x148ea1[_0x99f8('0x46')]=_['keys'](db[_0x99f8('0x77')][_0x99f8('0x43')]);_0x148ea1['query']=_['keys'](_0x255088[_0x99f8('0x47')]);_0x148ea1[_0x99f8('0x52')]=_[_0x99f8('0x49')](_0x148ea1[_0x99f8('0x46')],_0x148ea1[_0x99f8('0x47')]);_0x293dd6['attributes']=_[_0x99f8('0x49')](_0x148ea1[_0x99f8('0x46')],qs[_0x99f8('0x4a')](_0x255088[_0x99f8('0x47')][_0x99f8('0x4a')]));_0x293dd6['attributes']=_0x293dd6[_0x99f8('0x4b')][_0x99f8('0x4c')]?_0x293dd6['attributes']:_0x148ea1[_0x99f8('0x46')];_0x293dd6['order']=qs[_0x99f8('0x50')](_0x255088[_0x99f8('0x47')][_0x99f8('0x50')]);_0x293dd6[_0x99f8('0x51')]=qs[_0x99f8('0x52')](_[_0x99f8('0x53')](_0x255088[_0x99f8('0x47')],_0x148ea1[_0x99f8('0x52')]));if(_0x255088[_0x99f8('0x47')]['filter']){_0x293dd6[_0x99f8('0x51')]=_[_0x99f8('0x55')](_0x293dd6[_0x99f8('0x51')],{'$or':_[_0x99f8('0x41')](_0x293dd6['attributes'],function(_0x4a1f22){var _0x47c653={};_0x47c653[_0x4a1f22]={'$like':'%'+_0x255088[_0x99f8('0x47')][_0x99f8('0x54')]+'%'};return _0x47c653;})});}_0x293dd6=_['merge']({},_0x293dd6,_0x255088[_0x99f8('0x58')]);return _0x35156d[_0x99f8('0x76')](_0x293dd6);}})['then'](function(_0x3e6628){if(_0x3e6628){_0x3cb606=_0x3e6628[_0x99f8('0x4c')];if(!_0x255088[_0x99f8('0x47')][_0x99f8('0x4d')](_0x99f8('0x4e'))){_0x293dd6['limit']=qs[_0x99f8('0x33')](_0x255088[_0x99f8('0x47')][_0x99f8('0x33')]);_0x293dd6[_0x99f8('0x30')]=qs['offset'](_0x255088['query'][_0x99f8('0x30')]);}return _0x35156d[_0x99f8('0x76')](_0x293dd6);}})['then'](function(_0x7b314d){if(_0x7b314d){return _0x7b314d?{'count':_0x3cb606,'rows':_0x7b314d}:null;}})[_0x99f8('0x24')](respondWithResult(_0x3a691,null))['catch'](handleError(_0x3a691,null));};exports[_0x99f8('0x78')]=function(_0x2f38f3,_0x1edecf,_0x340fe7){var _0x375ef9=_0x2f38f3[_0x99f8('0x69')][_0x99f8('0x79')];return db[_0x99f8('0x77')][_0x99f8('0x5b')]({'where':{'id':_0x375ef9},'attributes':['id'],'include':[{'model':db[_0x99f8('0x7a')],'as':_0x99f8('0x7b'),'attributes':['id',_0x99f8('0x3e'),_0x99f8('0x7c'),_0x99f8('0x7d'),_0x99f8('0x7e')],'raw':!![]}]})[_0x99f8('0x24')](function(_0x3580e3){if(_0x3580e3){var _0x27c8bc=_[_0x99f8('0x7f')](_0x3580e3,function(_0x2a2390){var _0x42b7a7=_0x2a2390['get']({'plain':!![]});return _0x42b7a7[_0x99f8('0x7b')];});return db[_0x99f8('0x42')][_0x99f8('0x5f')]({'where':{'id':_0x2f38f3[_0x99f8('0x5e')]['id']}})[_0x99f8('0x24')](function(_0x4a9f34){return db[_0x99f8('0x80')][_0x99f8('0x81')](function(_0x17ef51){return _0x4a9f34['addTeams'](_0x375ef9,{'transaction':_0x17ef51})[_0x99f8('0x24')](function(){return BPromise['each'](_0x27c8bc,function(_0x2d0398){return db[_0x99f8('0x6e')][_0x99f8('0x82')]({'where':{'UserId':_0x2d0398['id'],'ChatQueueId':_0x2f38f3[_0x99f8('0x5e')]['id']},'transaction':_0x17ef51});});})[_0x99f8('0x24')](function(){_0x27c8bc[_0x99f8('0x83')](function(_0x2f3e83){socket['emit'](_0x99f8('0x84'),{'UserId':_0x2f3e83['id'],'ChatQueueId':_0x4a9f34['id']});});});});});}})[_0x99f8('0x24')](respondWithStatusCode(_0x1edecf,null))['catch'](handleError(_0x1edecf,null));};exports[_0x99f8('0x85')]=function(_0x443149,_0x146f2b,_0x9c8045){return db[_0x99f8('0x77')][_0x99f8('0x5b')]({'where':{'id':_0x443149[_0x99f8('0x47')]['ids']},'attributes':['id'],'include':[{'model':db[_0x99f8('0x7a')],'as':_0x99f8('0x7b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x146f2b,null))[_0x99f8('0x24')](function(_0x573992){var _0x4d9d48=_[_0x99f8('0x41')](_0x573992,'id');var _0xba170=[];var _0x5ce0c0=[];var _0x263b34=squel[_0x99f8('0x86')]();_0x263b34[_0x99f8('0x87')](_0x99f8('0x88'))['from'](_0x99f8('0x89'),'tq')[_0x99f8('0x8a')](_0x99f8('0x8b'),'ut',_0x99f8('0x8c'))[_0x99f8('0x51')](_0x99f8('0x8d'),_0x443149[_0x99f8('0x5e')]['id']);for(var _0x14a71c=0x0;_0x14a71c<_0x573992['length'];_0x14a71c+=0x1){let _0x7d43cd=_0x573992[_0x14a71c];for(var _0xf091e3=0x0;_0xf091e3<_0x7d43cd[_0x99f8('0x7b')]['length'];_0xf091e3+=0x1){let _0x3048fe=_0x7d43cd[_0x99f8('0x7b')][_0xf091e3];var _0x3e85ea=_0x263b34['clone']();_0x3e85ea[_0x99f8('0x51')](_0x99f8('0x8e'),_0x3048fe['id']);_0x5ce0c0[_0x99f8('0x8f')](db[_0x99f8('0x80')][_0x99f8('0x47')](_0x3e85ea[_0x99f8('0x90')](),{'type':db['sequelize'][_0x99f8('0x91')][_0x99f8('0x92')]})[_0x99f8('0x24')](function(_0x46301c){if(_0x46301c['length']===0x1){return _0x3048fe['id'];}else{var _0x5d2be7=_['every'](_[_0x99f8('0x41')](_0x46301c,_0x99f8('0x93')),function(_0x16ff56){return _[_0x99f8('0x94')](_0x4d9d48,_0x16ff56);});if(_0x5d2be7){return _0x3048fe['id'];}}}));}}return BPromise['all'](_0x5ce0c0)[_0x99f8('0x24')](function(_0x50c001){_0xba170=_(_0xba170)[_0x99f8('0x95')](_0x50c001)[_0x99f8('0x96')]()[_0x99f8('0x97')]();return db[_0x99f8('0x42')][_0x99f8('0x5f')]({'where':{'id':_0x443149[_0x99f8('0x5e')]['id']}})[_0x99f8('0x24')](function(_0x8e3b1a){return db[_0x99f8('0x80')]['transaction'](function(_0xa2206b){return _0x8e3b1a[_0x99f8('0x85')](_0x443149[_0x99f8('0x47')]['ids'],{'transaction':_0xa2206b})['then'](function(){if(!_[_0x99f8('0x98')](_0xba170)){return _0x8e3b1a[_0x99f8('0x99')](_0xba170,{'transaction':_0xa2206b});}})[_0x99f8('0x24')](function(){_0xba170[_0x99f8('0x83')](function(_0x3a6d30){socket['emit']('userChatQueue:remove',{'UserId':_0x3a6d30,'ChatQueueId':_0x8e3b1a['id']});});});});});});})[_0x99f8('0x24')](respondWithStatusCode(_0x146f2b,null))[_0x99f8('0x2c')](handleError(_0x146f2b,null));};exports[_0x99f8('0x9a')]=function(_0x91156,_0x4fa2cd,_0x186c63){return db[_0x99f8('0x42')]['find']({'where':{'id':_0x91156['params']['id']}})['then'](handleEntityNotFound(_0x4fa2cd,null))[_0x99f8('0x24')](function(_0x498848){if(_0x498848){return _0x498848[_0x99f8('0x9a')](_0x91156['body'][_0x99f8('0x79')],_['omit'](_0x91156[_0x99f8('0x69')],[_0x99f8('0x79'),'id'])||{})['spread'](function(_0x4edb8d){for(var _0x4a1332=0x0;_0x4a1332<_0x91156[_0x99f8('0x69')][_0x99f8('0x79')]['length'];_0x4a1332+=0x1){socket[_0x99f8('0x9b')]('userChatQueue:save',{'UserId':Number(_0x91156[_0x99f8('0x69')]['ids'][_0x4a1332]),'ChatQueueId':Number(_0x91156[_0x99f8('0x5e')]['id'])});}return _0x4edb8d;});}})[_0x99f8('0x24')](respondWithResult(_0x4fa2cd,null))['catch'](handleError(_0x4fa2cd,null));};exports[_0x99f8('0x99')]=function(_0x28d742,_0x4a0168,_0x86bd7b){return db[_0x99f8('0x42')][_0x99f8('0x5f')]({'where':{'id':_0x28d742[_0x99f8('0x5e')]['id']}})[_0x99f8('0x24')](handleEntityNotFound(_0x4a0168,null))['then'](function(_0x18a653){if(_0x18a653){return _0x18a653[_0x99f8('0x99')](_0x28d742['query'][_0x99f8('0x79')])[_0x99f8('0x24')](function(){if(_[_0x99f8('0x9c')](_0x28d742[_0x99f8('0x47')]['ids'])){for(var _0x3cdfc6=0x0;_0x3cdfc6<_0x28d742[_0x99f8('0x47')][_0x99f8('0x79')][_0x99f8('0x4c')];_0x3cdfc6+=0x1){socket[_0x99f8('0x9b')](_0x99f8('0x9d'),{'UserId':Number(_0x28d742[_0x99f8('0x47')][_0x99f8('0x79')][_0x3cdfc6]),'ChatQueueId':Number(_0x28d742[_0x99f8('0x5e')]['id'])});}}else{socket['emit'](_0x99f8('0x9d'),{'UserId':Number(_0x28d742[_0x99f8('0x47')][_0x99f8('0x79')]),'ChatQueueId':Number(_0x28d742['params']['id'])});}});}})[_0x99f8('0x24')](respondWithStatusCode(_0x4a0168,null))[_0x99f8('0x2c')](handleError(_0x4a0168,null));};exports['getAgents']=function(_0x1a1545,_0x1ef102,_0x362843){var _0x1e3ecb={};var _0x34e71a={};var _0x5b1a66;var _0x47c535;return db[_0x99f8('0x42')]['findOne']({'where':{'id':_0x1a1545[_0x99f8('0x5e')]['id']}})[_0x99f8('0x24')](handleEntityNotFound(_0x1ef102,null))['then'](function(_0x6e46bb){if(_0x6e46bb){_0x5b1a66=_0x6e46bb;_0x34e71a[_0x99f8('0x46')]=_['keys'](db[_0x99f8('0x7a')][_0x99f8('0x43')]);_0x34e71a[_0x99f8('0x47')]=_[_0x99f8('0x48')](_0x1a1545['query']);_0x34e71a[_0x99f8('0x52')]=_[_0x99f8('0x49')](_0x34e71a['model'],_0x34e71a[_0x99f8('0x47')]);_0x1e3ecb[_0x99f8('0x4b')]=_[_0x99f8('0x49')](_0x34e71a[_0x99f8('0x46')],qs[_0x99f8('0x4a')](_0x1a1545['query'][_0x99f8('0x4a')]));_0x1e3ecb['attributes']=_0x1e3ecb[_0x99f8('0x4b')]['length']?_0x1e3ecb[_0x99f8('0x4b')]:_0x34e71a['model'];_0x1e3ecb[_0x99f8('0x4f')]=qs[_0x99f8('0x50')](_0x1a1545[_0x99f8('0x47')][_0x99f8('0x50')]);_0x1e3ecb[_0x99f8('0x51')]=qs[_0x99f8('0x52')](_[_0x99f8('0x53')](_0x1a1545[_0x99f8('0x47')],_0x34e71a['filters']));if(_0x1a1545['query']['filter']){_0x1e3ecb[_0x99f8('0x51')]=_[_0x99f8('0x55')](_0x1e3ecb[_0x99f8('0x51')],{'$or':_['map'](_0x1e3ecb[_0x99f8('0x4b')],function(_0x3eef27){var _0x2076a5={};_0x2076a5[_0x3eef27]={'$like':'%'+_0x1a1545[_0x99f8('0x47')][_0x99f8('0x54')]+'%'};return _0x2076a5;})});}_0x1e3ecb=_[_0x99f8('0x55')]({},_0x1e3ecb,_0x1a1545[_0x99f8('0x58')]);return _0x5b1a66[_0x99f8('0x9e')](_0x1e3ecb);}})[_0x99f8('0x24')](function(_0x10fd09){if(_0x10fd09){_0x47c535=_0x10fd09[_0x99f8('0x4c')];if(!_0x1a1545[_0x99f8('0x47')][_0x99f8('0x4d')]('nolimit')){_0x1e3ecb['limit']=qs[_0x99f8('0x33')](_0x1a1545[_0x99f8('0x47')][_0x99f8('0x33')]);_0x1e3ecb[_0x99f8('0x30')]=qs[_0x99f8('0x30')](_0x1a1545[_0x99f8('0x47')][_0x99f8('0x30')]);}return _0x5b1a66[_0x99f8('0x9e')](_0x1e3ecb);}})[_0x99f8('0x24')](function(_0x17e37d){if(_0x17e37d){return _0x17e37d?{'count':_0x47c535,'rows':_0x17e37d}:null;}})['then'](respondWithResult(_0x1ef102,null))[_0x99f8('0x2c')](handleError(_0x1ef102,null));};
\ No newline at end of file
+var _0x1648=['user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','format','%s/%s','SIP','chatPause','createdAt','getTeams','Team','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','userChatQueue:save','removeTeams','field','tq.TeamId','team_has_chat_queues','join'];(function(_0x2bcd1f,_0x4f1972){var _0x2381ca=function(_0x51f935){while(--_0x51f935){_0x2bcd1f['push'](_0x2bcd1f['shift']());}};_0x2381ca(++_0x4f1972);}(_0x1648,0x1e9));var _0x8164=function(_0x17dc14,_0x474bdf){_0x17dc14=_0x17dc14-0x0;var _0x551bc2=_0x1648[_0x17dc14];return _0x551bc2;};'use strict';var emlformat=require(_0x8164('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8164('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8164('0x2'));var moment=require(_0x8164('0x3'));var BPromise=require(_0x8164('0x4'));var Mustache=require('mustache');var util=require(_0x8164('0x5'));var path=require(_0x8164('0x6'));var sox=require(_0x8164('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8164('0x8'));var _=require(_0x8164('0x9'));var squel=require(_0x8164('0xa'));var crypto=require('crypto');var jsforce=require(_0x8164('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8164('0xc'));var querystring=require(_0x8164('0xd'));var Papa=require(_0x8164('0xe'));var Redis=require(_0x8164('0xf'));var authService=require(_0x8164('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8164('0x11'));var hardwareService=require(_0x8164('0x12'));var logger=require(_0x8164('0x13'))('api');var utils=require(_0x8164('0x14'));var config=require(_0x8164('0x15'));var licenseUtil=require(_0x8164('0x16'));var db=require(_0x8164('0x17'))['db'];config[_0x8164('0x18')]=_[_0x8164('0x19')](config[_0x8164('0x18')],{'host':_0x8164('0x1a'),'port':0x18eb});var socket=require(_0x8164('0x1b'))(new Redis(config[_0x8164('0x18')]));require(_0x8164('0x1c'))[_0x8164('0x1d')](socket);var jayson=require(_0x8164('0x1e'));var client=jayson['client'][_0x8164('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x20ad07,_0x598262,_0x3835c7,_0x11a97b){return new BPromise(function(_0x49d3e0,_0x4e8aca){var _0x244a34=_0x11a97b||client;return _0x244a34['request'](_0x20ad07,_0x3835c7)['then'](function(_0x235dcd){logger[_0x8164('0x20')](_0x8164('0x21'),_0x598262,_0x8164('0x22'));logger[_0x8164('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x598262,'request\x20sent',JSON[_0x8164('0x24')](_0x235dcd));if(_0x235dcd[_0x8164('0x25')]){if(_0x235dcd[_0x8164('0x25')][_0x8164('0x26')]===0x1f4){logger[_0x8164('0x25')]('ChatQueue,\x20%s,\x20%s',_0x598262,_0x235dcd[_0x8164('0x25')][_0x8164('0x27')]);return _0x4e8aca(_0x235dcd[_0x8164('0x25')][_0x8164('0x27')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x598262,_0x235dcd[_0x8164('0x25')][_0x8164('0x27')]);return _0x49d3e0(_0x235dcd[_0x8164('0x25')][_0x8164('0x27')]);}else{logger[_0x8164('0x20')](_0x8164('0x21'),_0x598262,'request\x20sent');_0x49d3e0(_0x235dcd[_0x8164('0x28')][_0x8164('0x27')]);}})[_0x8164('0x29')](function(_0x34ca56){logger['error'](_0x8164('0x21'),_0x598262,_0x34ca56);_0x4e8aca(_0x34ca56);});});}function respondWithStatusCode(_0x51f3ff,_0x3471df){_0x3471df=_0x3471df||0xcc;return function(_0x18b709){if(_0x18b709){return _0x51f3ff[_0x8164('0x2a')](_0x3471df);}return _0x51f3ff[_0x8164('0x2b')](_0x3471df)[_0x8164('0x2c')]();};}function respondWithResult(_0x2b5aff,_0x52a2d9){_0x52a2d9=_0x52a2d9||0xc8;return function(_0x28e94d){if(_0x28e94d){return _0x2b5aff['status'](_0x52a2d9)[_0x8164('0x2d')](_0x28e94d);}};}function respondWithFilteredResult(_0x3bc989,_0x1ce94a){return function(_0xb7689b){if(_0xb7689b){var _0x467a11=typeof _0x1ce94a[_0x8164('0x2e')]===_0x8164('0x2f')&&typeof _0x1ce94a['limit']===_0x8164('0x2f');var _0x5c075b=_0xb7689b['count'];var _0x167ba6=_0x467a11?0x0:_0x1ce94a[_0x8164('0x2e')];var _0x40adea=_0x467a11?_0xb7689b[_0x8164('0x30')]:_0x1ce94a['offset']+_0x1ce94a[_0x8164('0x31')];var _0x249988;if(_0x40adea>=_0x5c075b){_0x40adea=_0x5c075b;_0x249988=0xc8;}else{_0x249988=0xce;}_0x3bc989[_0x8164('0x2b')](_0x249988);return _0x3bc989[_0x8164('0x32')](_0x8164('0x33'),_0x167ba6+'-'+_0x40adea+'/'+_0x5c075b)[_0x8164('0x2d')](_0xb7689b);}return null;};}function patchUpdates(_0x1c996c){return function(_0x2d6257){try{jsonpatch[_0x8164('0x34')](_0x2d6257,_0x1c996c,!![]);}catch(_0xe18bdd){return BPromise['reject'](_0xe18bdd);}return _0x2d6257[_0x8164('0x35')]();};}function saveUpdates(_0x38a864,_0x382f3d){return function(_0x3a026b){if(_0x3a026b){return _0x3a026b[_0x8164('0x36')](_0x38a864)[_0x8164('0x37')](function(_0x3676f8){return _0x3676f8;});}return null;};}function removeEntity(_0x480ea3,_0x1b343e){return function(_0xc3cddc){if(_0xc3cddc){return _0xc3cddc[_0x8164('0x38')]()[_0x8164('0x37')](function(){var _0x250e38=_0xc3cddc[_0x8164('0x39')]({'plain':!![]});var _0x4a9f9f=_0x8164('0x3a');return db[_0x8164('0x3b')][_0x8164('0x38')]({'where':{'type':_0x4a9f9f,'resourceId':_0x250e38['id']}})[_0x8164('0x37')](function(){return _0xc3cddc;});})[_0x8164('0x37')](function(){_0x480ea3[_0x8164('0x2b')](0xcc)[_0x8164('0x2c')]();});}};}function handleEntityNotFound(_0x11d8ea,_0x1102a7){return function(_0x407041){if(!_0x407041){_0x11d8ea[_0x8164('0x2a')](0x194);}return _0x407041;};}function handleError(_0x1daf94,_0x2a25ac){_0x2a25ac=_0x2a25ac||0x1f4;return function(_0x4b782d){logger['error'](_0x4b782d[_0x8164('0x3c')]);if(_0x4b782d['name']){delete _0x4b782d[_0x8164('0x3d')];}_0x1daf94['status'](_0x2a25ac)[_0x8164('0x3e')](_0x4b782d);};}exports[_0x8164('0x3f')]=function(_0x21928f,_0x34ba8b){var _0x4f01e7={},_0x69fc9b={},_0xdd6c4d={'count':0x0,'rows':[]};var _0x3c21e3=_[_0x8164('0x40')](db[_0x8164('0x41')][_0x8164('0x42')],function(_0x2b5a26){return{'name':_0x2b5a26[_0x8164('0x43')],'type':_0x2b5a26['type']['key']};});_0x69fc9b[_0x8164('0x44')]=_[_0x8164('0x40')](_0x3c21e3,_0x8164('0x3d'));_0x69fc9b['query']=_[_0x8164('0x45')](_0x21928f[_0x8164('0x46')]);_0x69fc9b[_0x8164('0x47')]=_['intersection'](_0x69fc9b[_0x8164('0x44')],_0x69fc9b[_0x8164('0x46')]);_0x4f01e7['attributes']=_[_0x8164('0x48')](_0x69fc9b[_0x8164('0x44')],qs['fields'](_0x21928f[_0x8164('0x46')][_0x8164('0x49')]));_0x4f01e7['attributes']=_0x4f01e7[_0x8164('0x4a')][_0x8164('0x4b')]?_0x4f01e7[_0x8164('0x4a')]:_0x69fc9b[_0x8164('0x44')];if(!_0x21928f[_0x8164('0x46')][_0x8164('0x4c')](_0x8164('0x4d'))){_0x4f01e7[_0x8164('0x31')]=qs[_0x8164('0x31')](_0x21928f[_0x8164('0x46')][_0x8164('0x31')]);_0x4f01e7[_0x8164('0x2e')]=qs[_0x8164('0x2e')](_0x21928f[_0x8164('0x46')][_0x8164('0x2e')]);}_0x4f01e7[_0x8164('0x4e')]=qs[_0x8164('0x4f')](_0x21928f[_0x8164('0x46')][_0x8164('0x4f')]);_0x4f01e7['where']=qs[_0x8164('0x47')](_[_0x8164('0x50')](_0x21928f[_0x8164('0x46')],_0x69fc9b[_0x8164('0x47')]),_0x3c21e3);if(_0x21928f['query']['filter']){_0x4f01e7[_0x8164('0x51')]=_[_0x8164('0x52')](_0x4f01e7[_0x8164('0x51')],{'$or':_[_0x8164('0x40')](_0x3c21e3,function(_0x2d0dd6){if(_0x2d0dd6[_0x8164('0x53')]!==_0x8164('0x54')){var _0x2f9c59={};_0x2f9c59[_0x2d0dd6[_0x8164('0x3d')]]={'$like':'%'+_0x21928f[_0x8164('0x46')][_0x8164('0x55')]+'%'};return _0x2f9c59;}})});}_0x4f01e7=_[_0x8164('0x52')]({},_0x4f01e7,_0x21928f[_0x8164('0x56')]);var _0x5ae23f={'where':_0x4f01e7[_0x8164('0x51')]};return db[_0x8164('0x41')][_0x8164('0x30')](_0x5ae23f)[_0x8164('0x37')](function(_0x2879a6){_0xdd6c4d[_0x8164('0x30')]=_0x2879a6;if(_0x21928f['query'][_0x8164('0x57')]){_0x4f01e7['include']=[{'all':!![]}];}return db['ChatQueue'][_0x8164('0x58')](_0x4f01e7);})[_0x8164('0x37')](function(_0x148134){_0xdd6c4d[_0x8164('0x59')]=_0x148134;return _0xdd6c4d;})[_0x8164('0x37')](respondWithFilteredResult(_0x34ba8b,_0x4f01e7))[_0x8164('0x29')](handleError(_0x34ba8b,null));};exports[_0x8164('0x5a')]=function(_0x1c56b1,_0x23697f){var _0x5c91a7={'raw':!![],'where':{'id':_0x1c56b1[_0x8164('0x5b')]['id']}},_0x17efb2={};_0x17efb2[_0x8164('0x44')]=_[_0x8164('0x45')](db[_0x8164('0x41')][_0x8164('0x42')]);_0x17efb2[_0x8164('0x46')]=_[_0x8164('0x45')](_0x1c56b1[_0x8164('0x46')]);_0x17efb2['filters']=_['intersection'](_0x17efb2[_0x8164('0x44')],_0x17efb2['query']);_0x5c91a7[_0x8164('0x4a')]=_[_0x8164('0x48')](_0x17efb2[_0x8164('0x44')],qs[_0x8164('0x49')](_0x1c56b1['query'][_0x8164('0x49')]));_0x5c91a7[_0x8164('0x4a')]=_0x5c91a7[_0x8164('0x4a')][_0x8164('0x4b')]?_0x5c91a7[_0x8164('0x4a')]:_0x17efb2[_0x8164('0x44')];if(_0x1c56b1[_0x8164('0x46')]['includeAll']){_0x5c91a7[_0x8164('0x5c')]=[{'all':!![]}];}_0x5c91a7=_[_0x8164('0x52')]({},_0x5c91a7,_0x1c56b1[_0x8164('0x56')]);return db[_0x8164('0x41')][_0x8164('0x5d')](_0x5c91a7)[_0x8164('0x37')](handleEntityNotFound(_0x23697f,null))['then'](respondWithResult(_0x23697f,null))[_0x8164('0x29')](handleError(_0x23697f,null));};exports[_0x8164('0x5e')]=function(_0x371073,_0x554c54){return db[_0x8164('0x41')][_0x8164('0x5e')](_0x371073[_0x8164('0x5f')],{})[_0x8164('0x37')](function(_0xc0b5ff){var _0x40676a=_0x371073[_0x8164('0x60')][_0x8164('0x39')]({'plain':!![]});if(!_0x40676a)throw new Error(_0x8164('0x61'));if(_0x40676a[_0x8164('0x62')]==='user'){var _0x561395=_0xc0b5ff[_0x8164('0x39')]({'plain':!![]});var _0x1a8c4c=_0x8164('0x3a');return db[_0x8164('0x63')][_0x8164('0x5d')]({'where':{'name':_0x1a8c4c,'userProfileId':_0x40676a[_0x8164('0x64')]},'raw':!![]})[_0x8164('0x37')](function(_0x4f33e4){if(_0x4f33e4&&_0x4f33e4[_0x8164('0x65')]===0x0){return db['UserProfileResource'][_0x8164('0x5e')]({'name':_0x561395['name'],'resourceId':_0x561395['id'],'type':_0x4f33e4[_0x8164('0x3d')],'sectionId':_0x4f33e4['id']},{})[_0x8164('0x37')](function(){return _0xc0b5ff;});}else{return _0xc0b5ff;}})[_0x8164('0x29')](function(_0x43505e){logger[_0x8164('0x25')](_0x8164('0x66'),_0x43505e);throw _0x43505e;});}return _0xc0b5ff;})[_0x8164('0x37')](respondWithResult(_0x554c54,0xc9))[_0x8164('0x29')](handleError(_0x554c54,null));};exports[_0x8164('0x36')]=function(_0x47230f,_0x116d28){if(_0x47230f[_0x8164('0x5f')]['id']){delete _0x47230f[_0x8164('0x5f')]['id'];}return db[_0x8164('0x41')][_0x8164('0x5d')]({'where':{'id':_0x47230f[_0x8164('0x5b')]['id']}})[_0x8164('0x37')](handleEntityNotFound(_0x116d28,null))['then'](saveUpdates(_0x47230f['body'],null))['then'](respondWithResult(_0x116d28,null))[_0x8164('0x29')](handleError(_0x116d28,null));};exports['destroy']=function(_0x468c28,_0x586139){return db[_0x8164('0x41')]['find']({'where':{'id':_0x468c28[_0x8164('0x5b')]['id']}})[_0x8164('0x37')](handleEntityNotFound(_0x586139,null))[_0x8164('0x37')](removeEntity(_0x586139,null))['catch'](handleError(_0x586139,null));};exports[_0x8164('0x67')]=function(_0x57a82f,_0x5b424d){return db[_0x8164('0x41')][_0x8164('0x67')]()['then'](respondWithResult(_0x5b424d,null))['catch'](handleError(_0x5b424d,null));};exports[_0x8164('0x68')]=function(_0x3509b8,_0x400158,_0x5b227e){var _0x37adc3={'raw':!![],'where':{}},_0x3418c9={},_0x328060;return db[_0x8164('0x41')][_0x8164('0x69')]({'where':{'id':_0x3509b8[_0x8164('0x5b')]['id']}})[_0x8164('0x37')](handleEntityNotFound(_0x400158,null))[_0x8164('0x37')](function(_0x35daa8){if(_0x35daa8){_0x328060=_0x35daa8['get']({'plain':!![]});_0x3418c9[_0x8164('0x44')]=_[_0x8164('0x45')](db['UserChatQueue'][_0x8164('0x42')]);_0x3418c9['query']=_[_0x8164('0x45')](_0x3509b8[_0x8164('0x46')]);_0x3418c9['filters']=_[_0x8164('0x48')](_0x3418c9[_0x8164('0x44')],_0x3418c9[_0x8164('0x46')]);_0x37adc3[_0x8164('0x4a')]=_[_0x8164('0x48')](_0x3418c9[_0x8164('0x44')],qs[_0x8164('0x49')](_0x3509b8[_0x8164('0x46')][_0x8164('0x49')]));_0x37adc3[_0x8164('0x4a')]=_0x37adc3[_0x8164('0x4a')][_0x8164('0x4b')]?_0x37adc3[_0x8164('0x4a')]:_0x3418c9['model'];if(!_0x3509b8[_0x8164('0x46')]['hasOwnProperty'](_0x8164('0x4d'))){_0x37adc3[_0x8164('0x31')]=qs[_0x8164('0x31')](_0x3509b8['query']['limit']);_0x37adc3[_0x8164('0x2e')]=qs['offset'](_0x3509b8[_0x8164('0x46')][_0x8164('0x2e')]);}_0x37adc3[_0x8164('0x4e')]=qs[_0x8164('0x4f')](_0x3509b8['query'][_0x8164('0x4f')]);_0x37adc3[_0x8164('0x51')]=qs[_0x8164('0x47')](_[_0x8164('0x50')](_0x3509b8[_0x8164('0x46')],_0x3418c9[_0x8164('0x47')]));_0x37adc3[_0x8164('0x51')][_0x8164('0x6a')]=_0x35daa8['id'];if(_0x3509b8[_0x8164('0x46')][_0x8164('0x55')]){_0x37adc3[_0x8164('0x51')]=_[_0x8164('0x52')](_0x37adc3[_0x8164('0x51')],{'$or':_[_0x8164('0x40')](_0x37adc3[_0x8164('0x4a')],function(_0x1cf1ed){var _0x366b43={};_0x366b43[_0x1cf1ed]={'$like':'%'+_0x3509b8[_0x8164('0x46')][_0x8164('0x55')]+'%'};return _0x366b43;})});}_0x37adc3=_[_0x8164('0x52')]({},_0x37adc3,_0x3509b8['options']);return db[_0x8164('0x6b')]['findAll'](_0x37adc3);}})[_0x8164('0x37')](function(_0x3d91e3){if(_0x3d91e3){return db[_0x8164('0x6c')][_0x8164('0x6d')]({'where':{'id':_[_0x8164('0x40')](_0x3d91e3,_0x8164('0x6e')),'role':_0x8164('0x6f')},'attributes':['id',_0x8164('0x3d'),'chatPause','updatedAt','createdAt']});}})[_0x8164('0x37')](function(_0x543487){if(_0x543487){return{'count':_0x543487[_0x8164('0x30')],'rows':_['map'](_0x543487['rows'],function(_0x5c750f){return{'membername':_0x5c750f[_0x8164('0x3d')],'UserId':_0x5c750f['id'],'queue_name':_0x328060[_0x8164('0x3d')],'ChatQueueId':_0x328060['id'],'interface':util[_0x8164('0x70')](_0x8164('0x71'),_0x8164('0x72'),_0x5c750f[_0x8164('0x3d')]),'penalty':0x0,'paused':_0x5c750f[_0x8164('0x73')],'createdAt':_0x5c750f[_0x8164('0x74')],'updatedAt':_0x5c750f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8164('0x37')](respondWithFilteredResult(_0x400158,_0x37adc3))[_0x8164('0x29')](handleError(_0x400158,null));};exports[_0x8164('0x75')]=function(_0x6cc197,_0x2859fc,_0x1a1652){var _0x4a7d60={};var _0xd14f61={};var _0x57fc04;var _0x3ed6ab;return db[_0x8164('0x41')][_0x8164('0x69')]({'where':{'id':_0x6cc197[_0x8164('0x5b')]['id']}})[_0x8164('0x37')](handleEntityNotFound(_0x2859fc,null))[_0x8164('0x37')](function(_0x465c77){if(_0x465c77){_0x57fc04=_0x465c77;_0xd14f61[_0x8164('0x44')]=_['keys'](db[_0x8164('0x76')][_0x8164('0x42')]);_0xd14f61[_0x8164('0x46')]=_[_0x8164('0x45')](_0x6cc197[_0x8164('0x46')]);_0xd14f61[_0x8164('0x47')]=_[_0x8164('0x48')](_0xd14f61[_0x8164('0x44')],_0xd14f61[_0x8164('0x46')]);_0x4a7d60['attributes']=_[_0x8164('0x48')](_0xd14f61[_0x8164('0x44')],qs[_0x8164('0x49')](_0x6cc197[_0x8164('0x46')]['fields']));_0x4a7d60[_0x8164('0x4a')]=_0x4a7d60['attributes'][_0x8164('0x4b')]?_0x4a7d60[_0x8164('0x4a')]:_0xd14f61[_0x8164('0x44')];_0x4a7d60['order']=qs['sort'](_0x6cc197['query'][_0x8164('0x4f')]);_0x4a7d60[_0x8164('0x51')]=qs[_0x8164('0x47')](_['pick'](_0x6cc197['query'],_0xd14f61[_0x8164('0x47')]));if(_0x6cc197[_0x8164('0x46')]['filter']){_0x4a7d60['where']=_[_0x8164('0x52')](_0x4a7d60[_0x8164('0x51')],{'$or':_[_0x8164('0x40')](_0x4a7d60[_0x8164('0x4a')],function(_0x583b6f){var _0x186417={};_0x186417[_0x583b6f]={'$like':'%'+_0x6cc197[_0x8164('0x46')][_0x8164('0x55')]+'%'};return _0x186417;})});}_0x4a7d60=_['merge']({},_0x4a7d60,_0x6cc197[_0x8164('0x56')]);return _0x57fc04[_0x8164('0x75')](_0x4a7d60);}})[_0x8164('0x37')](function(_0x4fb728){if(_0x4fb728){_0x3ed6ab=_0x4fb728[_0x8164('0x4b')];if(!_0x6cc197[_0x8164('0x46')][_0x8164('0x4c')](_0x8164('0x4d'))){_0x4a7d60[_0x8164('0x31')]=qs[_0x8164('0x31')](_0x6cc197[_0x8164('0x46')][_0x8164('0x31')]);_0x4a7d60[_0x8164('0x2e')]=qs[_0x8164('0x2e')](_0x6cc197[_0x8164('0x46')][_0x8164('0x2e')]);}return _0x57fc04[_0x8164('0x75')](_0x4a7d60);}})[_0x8164('0x37')](function(_0x59db03){if(_0x59db03){return _0x59db03?{'count':_0x3ed6ab,'rows':_0x59db03}:null;}})['then'](respondWithResult(_0x2859fc,null))[_0x8164('0x29')](handleError(_0x2859fc,null));};exports['addTeams']=function(_0x5ce07e,_0x3aebfc,_0x404395){var _0x253708=_0x5ce07e[_0x8164('0x5f')][_0x8164('0x77')];return db[_0x8164('0x76')][_0x8164('0x58')]({'where':{'id':_0x253708},'attributes':['id'],'include':[{'model':db[_0x8164('0x6c')],'as':_0x8164('0x78'),'attributes':['id',_0x8164('0x3d'),'online',_0x8164('0x79'),_0x8164('0x7a')],'raw':!![]}]})[_0x8164('0x37')](function(_0x4f0b2c){if(_0x4f0b2c){var _0x59270d=_[_0x8164('0x7b')](_0x4f0b2c,function(_0x6117ac){var _0x19d0e5=_0x6117ac[_0x8164('0x39')]({'plain':!![]});return _0x19d0e5[_0x8164('0x78')];});return db['ChatQueue'][_0x8164('0x5d')]({'where':{'id':_0x5ce07e[_0x8164('0x5b')]['id']}})[_0x8164('0x37')](function(_0x89f01a){return db[_0x8164('0x7c')][_0x8164('0x7d')](function(_0x12ddee){return _0x89f01a[_0x8164('0x7e')](_0x253708,{'transaction':_0x12ddee})[_0x8164('0x37')](function(){return BPromise[_0x8164('0x7f')](_0x59270d,function(_0x2d4922){return db[_0x8164('0x6b')]['findOrCreate']({'where':{'UserId':_0x2d4922['id'],'ChatQueueId':_0x5ce07e[_0x8164('0x5b')]['id']},'transaction':_0x12ddee});});})[_0x8164('0x37')](function(){_0x59270d[_0x8164('0x80')](function(_0x389ec0){socket['emit'](_0x8164('0x81'),{'UserId':_0x389ec0['id'],'ChatQueueId':_0x89f01a['id']});});});});});}})[_0x8164('0x37')](respondWithStatusCode(_0x3aebfc,null))['catch'](handleError(_0x3aebfc,null));};exports[_0x8164('0x82')]=function(_0x44c7c3,_0x3bff2c,_0x47d586){return db[_0x8164('0x76')][_0x8164('0x58')]({'where':{'id':_0x44c7c3[_0x8164('0x46')][_0x8164('0x77')]},'attributes':['id'],'include':[{'model':db[_0x8164('0x6c')],'as':_0x8164('0x78'),'attributes':['id'],'raw':!![]}]})[_0x8164('0x37')](handleEntityNotFound(_0x3bff2c,null))[_0x8164('0x37')](function(_0x466b1e){var _0x284a76=_[_0x8164('0x40')](_0x466b1e,'id');var _0x1e3f4e=[];var _0x46ee79=[];var _0x3b9d13=squel['select']();_0x3b9d13[_0x8164('0x83')](_0x8164('0x84'))['from'](_0x8164('0x85'),'tq')[_0x8164('0x86')](_0x8164('0x87'),'ut',_0x8164('0x88'))['where'](_0x8164('0x89'),_0x44c7c3[_0x8164('0x5b')]['id']);for(var _0x50f6f1=0x0;_0x50f6f1<_0x466b1e[_0x8164('0x4b')];_0x50f6f1+=0x1){let _0x10a140=_0x466b1e[_0x50f6f1];for(var _0x2f5ec5=0x0;_0x2f5ec5<_0x10a140[_0x8164('0x78')][_0x8164('0x4b')];_0x2f5ec5+=0x1){let _0x5bb72b=_0x10a140['Agents'][_0x2f5ec5];var _0x32bb18=_0x3b9d13[_0x8164('0x8a')]();_0x32bb18[_0x8164('0x51')](_0x8164('0x8b'),_0x5bb72b['id']);_0x46ee79[_0x8164('0x8c')](db[_0x8164('0x7c')][_0x8164('0x46')](_0x32bb18[_0x8164('0x8d')](),{'type':db[_0x8164('0x7c')][_0x8164('0x8e')]['SELECT']})[_0x8164('0x37')](function(_0x5a3e99){if(_0x5a3e99[_0x8164('0x4b')]===0x1){return _0x5bb72b['id'];}else{var _0x41c98c=_[_0x8164('0x8f')](_['map'](_0x5a3e99,'TeamId'),function(_0x5eb802){return _[_0x8164('0x90')](_0x284a76,_0x5eb802);});if(_0x41c98c){return _0x5bb72b['id'];}}}));}}return BPromise['all'](_0x46ee79)['then'](function(_0x1e66c4){_0x1e3f4e=_(_0x1e3f4e)[_0x8164('0x91')](_0x1e66c4)['compact']()[_0x8164('0x92')]();return db['ChatQueue'][_0x8164('0x5d')]({'where':{'id':_0x44c7c3['params']['id']}})[_0x8164('0x37')](function(_0xa77315){return db[_0x8164('0x7c')][_0x8164('0x7d')](function(_0x4d695c){return _0xa77315['removeTeams'](_0x44c7c3[_0x8164('0x46')][_0x8164('0x77')],{'transaction':_0x4d695c})[_0x8164('0x37')](function(){if(!_[_0x8164('0x93')](_0x1e3f4e)){return _0xa77315[_0x8164('0x94')](_0x1e3f4e,{'transaction':_0x4d695c});}})[_0x8164('0x37')](function(){_0x1e3f4e[_0x8164('0x80')](function(_0x3f246b){socket['emit'](_0x8164('0x95'),{'UserId':_0x3f246b,'ChatQueueId':_0xa77315['id']});});});});});});})[_0x8164('0x37')](respondWithStatusCode(_0x3bff2c,null))['catch'](handleError(_0x3bff2c,null));};exports[_0x8164('0x96')]=function(_0x107be0,_0x2ba591,_0x1ef4f0){return db['ChatQueue'][_0x8164('0x5d')]({'where':{'id':_0x107be0['params']['id']}})[_0x8164('0x37')](handleEntityNotFound(_0x2ba591,null))[_0x8164('0x37')](function(_0x2e0145){if(_0x2e0145){return _0x2e0145[_0x8164('0x96')](_0x107be0[_0x8164('0x5f')][_0x8164('0x77')],_[_0x8164('0x97')](_0x107be0['body'],['ids','id'])||{})[_0x8164('0x98')](function(_0x32c375){for(var _0x515233=0x0;_0x515233<_0x107be0[_0x8164('0x5f')][_0x8164('0x77')][_0x8164('0x4b')];_0x515233+=0x1){socket[_0x8164('0x99')](_0x8164('0x81'),{'UserId':Number(_0x107be0[_0x8164('0x5f')][_0x8164('0x77')][_0x515233]),'ChatQueueId':Number(_0x107be0[_0x8164('0x5b')]['id'])});}return _0x32c375;});}})[_0x8164('0x37')](respondWithResult(_0x2ba591,null))[_0x8164('0x29')](handleError(_0x2ba591,null));};exports['removeAgents']=function(_0xa49e1e,_0x3e860c,_0x20a140){return db['ChatQueue'][_0x8164('0x5d')]({'where':{'id':_0xa49e1e[_0x8164('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3e860c,null))['then'](function(_0x4d536a){if(_0x4d536a){return _0x4d536a[_0x8164('0x94')](_0xa49e1e[_0x8164('0x46')][_0x8164('0x77')])[_0x8164('0x37')](function(){if(_[_0x8164('0x9a')](_0xa49e1e[_0x8164('0x46')]['ids'])){for(var _0x256c23=0x0;_0x256c23<_0xa49e1e[_0x8164('0x46')][_0x8164('0x77')][_0x8164('0x4b')];_0x256c23+=0x1){socket[_0x8164('0x99')](_0x8164('0x95'),{'UserId':Number(_0xa49e1e[_0x8164('0x46')][_0x8164('0x77')][_0x256c23]),'ChatQueueId':Number(_0xa49e1e[_0x8164('0x5b')]['id'])});}}else{socket[_0x8164('0x99')]('userChatQueue:remove',{'UserId':Number(_0xa49e1e[_0x8164('0x46')][_0x8164('0x77')]),'ChatQueueId':Number(_0xa49e1e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3e860c,null))[_0x8164('0x29')](handleError(_0x3e860c,null));};exports[_0x8164('0x9b')]=function(_0x3c5faa,_0xbfadb,_0x4e5527){var _0xfd5e8f={};var _0x51f81b={};var _0x4016b3;var _0x50574a;return db[_0x8164('0x41')][_0x8164('0x69')]({'where':{'id':_0x3c5faa[_0x8164('0x5b')]['id']}})[_0x8164('0x37')](handleEntityNotFound(_0xbfadb,null))[_0x8164('0x37')](function(_0x2b9c7f){if(_0x2b9c7f){_0x4016b3=_0x2b9c7f;_0x51f81b[_0x8164('0x44')]=_['keys'](db[_0x8164('0x6c')][_0x8164('0x42')]);_0x51f81b[_0x8164('0x46')]=_[_0x8164('0x45')](_0x3c5faa[_0x8164('0x46')]);_0x51f81b[_0x8164('0x47')]=_[_0x8164('0x48')](_0x51f81b['model'],_0x51f81b[_0x8164('0x46')]);_0xfd5e8f[_0x8164('0x4a')]=_[_0x8164('0x48')](_0x51f81b['model'],qs[_0x8164('0x49')](_0x3c5faa[_0x8164('0x46')]['fields']));_0xfd5e8f[_0x8164('0x4a')]=_0xfd5e8f[_0x8164('0x4a')][_0x8164('0x4b')]?_0xfd5e8f[_0x8164('0x4a')]:_0x51f81b[_0x8164('0x44')];_0xfd5e8f[_0x8164('0x4e')]=qs[_0x8164('0x4f')](_0x3c5faa['query'][_0x8164('0x4f')]);_0xfd5e8f[_0x8164('0x51')]=qs[_0x8164('0x47')](_[_0x8164('0x50')](_0x3c5faa[_0x8164('0x46')],_0x51f81b['filters']));if(_0x3c5faa[_0x8164('0x46')][_0x8164('0x55')]){_0xfd5e8f['where']=_[_0x8164('0x52')](_0xfd5e8f[_0x8164('0x51')],{'$or':_[_0x8164('0x40')](_0xfd5e8f[_0x8164('0x4a')],function(_0x56b14b){var _0x83a7f1={};_0x83a7f1[_0x56b14b]={'$like':'%'+_0x3c5faa[_0x8164('0x46')][_0x8164('0x55')]+'%'};return _0x83a7f1;})});}_0xfd5e8f=_[_0x8164('0x52')]({},_0xfd5e8f,_0x3c5faa[_0x8164('0x56')]);return _0x4016b3[_0x8164('0x9b')](_0xfd5e8f);}})[_0x8164('0x37')](function(_0x5911ce){if(_0x5911ce){_0x50574a=_0x5911ce[_0x8164('0x4b')];if(!_0x3c5faa[_0x8164('0x46')]['hasOwnProperty'](_0x8164('0x4d'))){_0xfd5e8f['limit']=qs['limit'](_0x3c5faa['query'][_0x8164('0x31')]);_0xfd5e8f[_0x8164('0x2e')]=qs['offset'](_0x3c5faa['query'][_0x8164('0x2e')]);}return _0x4016b3[_0x8164('0x9b')](_0xfd5e8f);}})[_0x8164('0x37')](function(_0x573cbe){if(_0x573cbe){return _0x573cbe?{'count':_0x50574a,'rows':_0x573cbe}:null;}})[_0x8164('0x37')](respondWithResult(_0xbfadb,null))[_0x8164('0x29')](handleError(_0xbfadb,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index f90c89f..950fd4f 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 _0xc434=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x327c57,_0x129c09){var _0x322063=function(_0x2cc1c7){while(--_0x2cc1c7){_0x327c57['push'](_0x327c57['shift']());}};_0x322063(++_0x129c09);}(_0xc434,0x17a));var _0x4c43=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xc434[_0x243b59];return _0x3e1676;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x4c43('0x0'))['db'][_0x4c43('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4c43('0x2')](0x0);var events={'afterCreate':_0x4c43('0x3'),'afterUpdate':_0x4c43('0x4'),'afterDestroy':_0x4c43('0x5')};function emitEvent(_0x7d564a){return function(_0x29f080,_0x221fc0,_0x5d7a56){ChatQueueEvents[_0x4c43('0x6')](_0x7d564a+':'+_0x29f080['id'],_0x29f080);ChatQueueEvents[_0x4c43('0x6')](_0x7d564a,_0x29f080);_0x5d7a56(null);};}for(var e in events){if(events[_0x4c43('0x7')](e)){var event=events[e];ChatQueue[_0x4c43('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x0b4d=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x0b4d,0x99));var _0xd0b4=function(_0x3c7a48,_0x147ef7){_0x3c7a48=_0x3c7a48-0x0;var _0x487831=_0x0b4d[_0x3c7a48];return _0x487831;};'use strict';var EventEmitter=require(_0xd0b4('0x0'));var ChatQueue=require(_0xd0b4('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd0b4('0x2')](0x0);var events={'afterCreate':_0xd0b4('0x3'),'afterUpdate':'update','afterDestroy':_0xd0b4('0x4')};function emitEvent(_0x760c95){return function(_0x26540e,_0x432c3e,_0x44a44f){ChatQueueEvents[_0xd0b4('0x5')](_0x760c95+':'+_0x26540e['id'],_0x26540e);ChatQueueEvents[_0xd0b4('0x5')](_0x760c95,_0x26540e);_0x44a44f(null);};}for(var e in events){if(events[_0xd0b4('0x6')](e)){var event=events[e];ChatQueue[_0xd0b4('0x7')](e,emitEvent(event));}}module[_0xd0b4('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index c78f73d..bc2cac5 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 _0x797a=['path','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue','chat_queues','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x797a,0x10f));var _0xa797=function(_0x55fb4a,_0x84c93b){_0x55fb4a=_0x55fb4a-0x0;var _0x564fd5=_0x797a[_0x55fb4a];return _0x564fd5;};'use strict';var _=require('lodash');var util=require(_0xa797('0x0'));var logger=require(_0xa797('0x1'))('api');var moment=require(_0xa797('0x2'));var BPromise=require(_0xa797('0x3'));var rp=require(_0xa797('0x4'));var fs=require('fs');var path=require(_0xa797('0x5'));var rimraf=require(_0xa797('0x6'));var config=require(_0xa797('0x7'));var attributes=require(_0xa797('0x8'));module['exports']=function(_0x3e935e,_0xffd593){return _0x3e935e[_0xa797('0x9')](_0xa797('0xa'),attributes,{'tableName':_0xa797('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe698=['define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x187f71,_0xf40f00){var _0xdf027a=function(_0x127e87){while(--_0x127e87){_0x187f71['push'](_0x187f71['shift']());}};_0xdf027a(++_0xf40f00);}(_0xe698,0xd5));var _0x8e69=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe698[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x8e69('0x0'));var util=require(_0x8e69('0x1'));var logger=require(_0x8e69('0x2'))(_0x8e69('0x3'));var moment=require(_0x8e69('0x4'));var BPromise=require(_0x8e69('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e69('0x6'));var rimraf=require(_0x8e69('0x7'));var config=require(_0x8e69('0x8'));var attributes=require(_0x8e69('0x9'));module[_0x8e69('0xa')]=function(_0x1c2adc,_0xfbbb29){return _0x1c2adc[_0x8e69('0xb')](_0x8e69('0xc'),attributes,{'tableName':_0x8e69('0xd'),'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 320437d..0195d47 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 _0xa5fa=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','raw','include','map','model','attributes','catch','ShowChatQueue','find','where','util','moment','bluebird','randomstring'];(function(_0x4dc38c,_0x23daf9){var _0x3d939a=function(_0x348f0f){while(--_0x348f0f){_0x4dc38c['push'](_0x4dc38c['shift']());}};_0x3d939a(++_0x23daf9);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x53a9cb,_0x1d7a73){_0x53a9cb=_0x53a9cb-0x0;var _0x4fc163=_0xa5fa[_0x53a9cb];return _0x4fc163;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var moment=require(_0xaa5f('0x1'));var BPromise=require(_0xaa5f('0x2'));var rs=require(_0xaa5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa5f('0x4'))['db'];var utils=require(_0xaa5f('0x5'));var logger=require('../../config/logger')(_0xaa5f('0x6'));var config=require(_0xaa5f('0x7'));var jayson=require(_0xaa5f('0x8'));var client=jayson[_0xaa5f('0x9')][_0xaa5f('0xa')]({'port':0x232a});config[_0xaa5f('0xb')]=_[_0xaa5f('0xc')](config[_0xaa5f('0xb')],{'host':_0xaa5f('0xd'),'port':0x18eb});var socket=require(_0xaa5f('0xe'))(new Redis(config[_0xaa5f('0xb')]));require('./chatQueue.socket')[_0xaa5f('0xf')](socket);function respondWithRpcPromise(_0x227ebb,_0x4d3d16,_0x538865){return new BPromise(function(_0x3fa93f,_0x4bb69d){return client['request'](_0x227ebb,_0x538865)[_0xaa5f('0x10')](function(_0x4d24d2){logger[_0xaa5f('0x11')](_0xaa5f('0x12'),_0x4d3d16,_0xaa5f('0x13'));logger[_0xaa5f('0x14')](_0xaa5f('0x15'),_0x4d3d16,'request\x20sent',JSON[_0xaa5f('0x16')](_0x4d24d2));if(_0x4d24d2['error']){if(_0x4d24d2[_0xaa5f('0x17')][_0xaa5f('0x18')]===0x1f4){logger[_0xaa5f('0x17')](_0xaa5f('0x12'),_0x4d3d16,_0x4d24d2[_0xaa5f('0x17')]['message']);return _0x4bb69d(_0x4d24d2['error'][_0xaa5f('0x19')]);}logger[_0xaa5f('0x17')](_0xaa5f('0x12'),_0x4d3d16,_0x4d24d2[_0xaa5f('0x17')][_0xaa5f('0x19')]);return _0x3fa93f(_0x4d24d2[_0xaa5f('0x17')][_0xaa5f('0x19')]);}else{logger[_0xaa5f('0x11')](_0xaa5f('0x12'),_0x4d3d16,_0xaa5f('0x13'));_0x3fa93f(_0x4d24d2[_0xaa5f('0x1a')][_0xaa5f('0x19')]);}})['catch'](function(_0x1c072){logger[_0xaa5f('0x17')](_0xaa5f('0x12'),_0x4d3d16,_0x1c072);_0x4bb69d(_0x1c072);});});}exports[_0xaa5f('0x1b')]=function(_0xc07d99){var _0xc57fd5=this;return new Promise(function(_0x21cd23,_0x194691){return db[_0xaa5f('0x1c')][_0xaa5f('0x1d')]({'raw':_0xc07d99[_0xaa5f('0x1e')]?_0xc07d99[_0xaa5f('0x1e')][_0xaa5f('0x1f')]===undefined?!![]:![]:!![],'where':_0xc07d99['options']?_0xc07d99[_0xaa5f('0x1e')]['where']||null:null,'attributes':_0xc07d99[_0xaa5f('0x1e')]?_0xc07d99[_0xaa5f('0x1e')]['attributes']||null:null,'limit':_0xc07d99[_0xaa5f('0x1e')]?_0xc07d99[_0xaa5f('0x1e')]['limit']||null:null,'include':_0xc07d99[_0xaa5f('0x1e')]?_0xc07d99[_0xaa5f('0x1e')][_0xaa5f('0x20')]?_[_0xaa5f('0x21')](_0xc07d99[_0xaa5f('0x1e')][_0xaa5f('0x20')],function(_0x3d7bca){return{'model':db[_0x3d7bca[_0xaa5f('0x22')]],'as':_0x3d7bca['as'],'attributes':_0x3d7bca['attributes'],'include':_0x3d7bca[_0xaa5f('0x20')]?_[_0xaa5f('0x21')](_0x3d7bca[_0xaa5f('0x20')],function(_0x5a7cf1){return{'model':db[_0x5a7cf1[_0xaa5f('0x22')]],'as':_0x5a7cf1['as'],'attributes':_0x5a7cf1[_0xaa5f('0x23')],'include':_0x5a7cf1[_0xaa5f('0x20')]?_['map'](_0x5a7cf1[_0xaa5f('0x20')],function(_0x479f29){return{'model':db[_0x479f29['model']],'as':_0x479f29['as'],'attributes':_0x479f29[_0xaa5f('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bffec){logger['info']('GetChatQueue',_0xc07d99);logger['debug'](_0xaa5f('0x1b'),_0xc07d99,JSON['stringify'](_0x1bffec));_0x21cd23(_0x1bffec);})[_0xaa5f('0x24')](function(_0xc0bb03){logger['error']('GetChatQueue',_0xc0bb03[_0xaa5f('0x19')],_0xc07d99);_0x194691(_0xc57fd5['error'](0x1f4,_0xc0bb03[_0xaa5f('0x19')]));});});};exports[_0xaa5f('0x25')]=function(_0x52132c){var _0xda1742=this;return new Promise(function(_0x1610b8,_0x9c733b){return db['ChatQueue'][_0xaa5f('0x26')]({'raw':_0x52132c[_0xaa5f('0x1e')]?_0x52132c['options']['raw']===undefined?!![]:![]:!![],'where':_0x52132c['options']?_0x52132c['options'][_0xaa5f('0x27')]||null:null,'attributes':_0x52132c[_0xaa5f('0x1e')]?_0x52132c[_0xaa5f('0x1e')][_0xaa5f('0x23')]||null:null,'include':_0x52132c[_0xaa5f('0x1e')]?_0x52132c[_0xaa5f('0x1e')][_0xaa5f('0x20')]?_['map'](_0x52132c[_0xaa5f('0x1e')][_0xaa5f('0x20')],function(_0x440845){return{'model':db[_0x440845[_0xaa5f('0x22')]],'as':_0x440845['as'],'attributes':_0x440845[_0xaa5f('0x23')],'include':_0x440845[_0xaa5f('0x20')]?_['map'](_0x440845[_0xaa5f('0x20')],function(_0x3131c2){return{'model':db[_0x3131c2[_0xaa5f('0x22')]],'as':_0x3131c2['as'],'attributes':_0x3131c2[_0xaa5f('0x23')],'include':_0x3131c2[_0xaa5f('0x20')]?_['map'](_0x3131c2['include'],function(_0x43126e){return{'model':db[_0x43126e[_0xaa5f('0x22')]],'as':_0x43126e['as'],'attributes':_0x43126e[_0xaa5f('0x23')]};}):[]};}):[]};}):[]:[]})[_0xaa5f('0x10')](function(_0x56826c){logger[_0xaa5f('0x11')](_0xaa5f('0x25'),_0x52132c);logger[_0xaa5f('0x14')](_0xaa5f('0x25'),_0x52132c,JSON[_0xaa5f('0x16')](_0x56826c));_0x1610b8(_0x56826c);})[_0xaa5f('0x24')](function(_0xc4735b){logger[_0xaa5f('0x17')](_0xaa5f('0x25'),_0xc4735b[_0xaa5f('0x19')],_0x52132c);_0x9c733b(_0xda1742[_0xaa5f('0x17')](0x1f4,_0xc4735b['message']));});});};
\ No newline at end of file
+var _0xbbbc=['model','include','then','debug','catch','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','map'];(function(_0x1ad9b3,_0x1533c6){var _0x45e47c=function(_0x4e997e){while(--_0x4e997e){_0x1ad9b3['push'](_0x1ad9b3['shift']());}};_0x45e47c(++_0x1533c6);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x28da0c,_0x4282ed){_0x28da0c=_0x28da0c-0x0;var _0x3a3aa2=_0xbbbc[_0x28da0c];return _0x3a3aa2;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require(_0xcbbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')]['http']({'port':0x232a});config[_0xcbbb('0xc')]=_[_0xcbbb('0xd')](config[_0xcbbb('0xc')],{'host':_0xcbbb('0xe'),'port':0x18eb});var socket=require(_0xcbbb('0xf'))(new Redis(config[_0xcbbb('0xc')]));require(_0xcbbb('0x10'))['register'](socket);function respondWithRpcPromise(_0x225156,_0x4b0138,_0x5893f9){return new BPromise(function(_0x107c35,_0x56c7d0){return client[_0xcbbb('0x11')](_0x225156,_0x5893f9)['then'](function(_0x3766c2){logger[_0xcbbb('0x12')]('ChatQueue,\x20%s,\x20%s',_0x4b0138,_0xcbbb('0x13'));logger['debug'](_0xcbbb('0x14'),_0x4b0138,'request\x20sent',JSON[_0xcbbb('0x15')](_0x3766c2));if(_0x3766c2[_0xcbbb('0x16')]){if(_0x3766c2[_0xcbbb('0x16')]['code']===0x1f4){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x56c7d0(_0x3766c2['error']['message']);}logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x3766c2[_0xcbbb('0x16')][_0xcbbb('0x18')]);return _0x107c35(_0x3766c2['error'][_0xcbbb('0x18')]);}else{logger['info'](_0xcbbb('0x17'),_0x4b0138,_0xcbbb('0x13'));_0x107c35(_0x3766c2[_0xcbbb('0x19')]['message']);}})['catch'](function(_0x4bcd9a){logger[_0xcbbb('0x16')](_0xcbbb('0x17'),_0x4b0138,_0x4bcd9a);_0x56c7d0(_0x4bcd9a);});});}exports[_0xcbbb('0x1a')]=function(_0x25e92f){var _0x658337=this;return new Promise(function(_0x1cca90,_0x45de5f){return db[_0xcbbb('0x1b')][_0xcbbb('0x1c')]({'raw':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f['options'][_0xcbbb('0x1e')]===undefined?!![]:![]:!![],'where':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f[_0xcbbb('0x1d')][_0xcbbb('0x1f')]||null:null,'attributes':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f[_0xcbbb('0x1d')][_0xcbbb('0x20')]||null:null,'limit':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f[_0xcbbb('0x1d')]['limit']||null:null,'include':_0x25e92f[_0xcbbb('0x1d')]?_0x25e92f[_0xcbbb('0x1d')]['include']?_[_0xcbbb('0x21')](_0x25e92f['options']['include'],function(_0x575d56){return{'model':db[_0x575d56[_0xcbbb('0x22')]],'as':_0x575d56['as'],'attributes':_0x575d56['attributes'],'include':_0x575d56['include']?_['map'](_0x575d56[_0xcbbb('0x23')],function(_0x55e1d8){return{'model':db[_0x55e1d8['model']],'as':_0x55e1d8['as'],'attributes':_0x55e1d8[_0xcbbb('0x20')],'include':_0x55e1d8[_0xcbbb('0x23')]?_[_0xcbbb('0x21')](_0x55e1d8[_0xcbbb('0x23')],function(_0x372024){return{'model':db[_0x372024[_0xcbbb('0x22')]],'as':_0x372024['as'],'attributes':_0x372024[_0xcbbb('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcbbb('0x24')](function(_0x2a023f){logger[_0xcbbb('0x12')](_0xcbbb('0x1a'),_0x25e92f);logger[_0xcbbb('0x25')](_0xcbbb('0x1a'),_0x25e92f,JSON[_0xcbbb('0x15')](_0x2a023f));_0x1cca90(_0x2a023f);})[_0xcbbb('0x26')](function(_0xcae72c){logger[_0xcbbb('0x16')](_0xcbbb('0x1a'),_0xcae72c['message'],_0x25e92f);_0x45de5f(_0x658337[_0xcbbb('0x16')](0x1f4,_0xcae72c[_0xcbbb('0x18')]));});});};exports['ShowChatQueue']=function(_0xec2761){var _0x539dcf=this;return new Promise(function(_0x2d37d3,_0x1fb05e){return db[_0xcbbb('0x1b')]['find']({'raw':_0xec2761[_0xcbbb('0x1d')]?_0xec2761[_0xcbbb('0x1d')][_0xcbbb('0x1e')]===undefined?!![]:![]:!![],'where':_0xec2761[_0xcbbb('0x1d')]?_0xec2761[_0xcbbb('0x1d')][_0xcbbb('0x1f')]||null:null,'attributes':_0xec2761[_0xcbbb('0x1d')]?_0xec2761[_0xcbbb('0x1d')][_0xcbbb('0x20')]||null:null,'include':_0xec2761[_0xcbbb('0x1d')]?_0xec2761['options']['include']?_['map'](_0xec2761['options'][_0xcbbb('0x23')],function(_0x5ccc55){return{'model':db[_0x5ccc55[_0xcbbb('0x22')]],'as':_0x5ccc55['as'],'attributes':_0x5ccc55[_0xcbbb('0x20')],'include':_0x5ccc55[_0xcbbb('0x23')]?_[_0xcbbb('0x21')](_0x5ccc55[_0xcbbb('0x23')],function(_0x39a417){return{'model':db[_0x39a417[_0xcbbb('0x22')]],'as':_0x39a417['as'],'attributes':_0x39a417[_0xcbbb('0x20')],'include':_0x39a417[_0xcbbb('0x23')]?_[_0xcbbb('0x21')](_0x39a417['include'],function(_0x5f578f){return{'model':db[_0x5f578f[_0xcbbb('0x22')]],'as':_0x5f578f['as'],'attributes':_0x5f578f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dbd8d){logger[_0xcbbb('0x12')](_0xcbbb('0x27'),_0xec2761);logger[_0xcbbb('0x25')](_0xcbbb('0x27'),_0xec2761,JSON[_0xcbbb('0x15')](_0x5dbd8d));_0x2d37d3(_0x5dbd8d);})[_0xcbbb('0x26')](function(_0x18054f){logger[_0xcbbb('0x16')](_0xcbbb('0x27'),_0x18054f[_0xcbbb('0x18')],_0xec2761);_0x1fb05e(_0x539dcf[_0xcbbb('0x16')](0x1f4,_0x18054f['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 72b3b05..e801ccd 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 _0x5089=['length','chatQueue:','./chatQueue.events','save','update','emit','register'];(function(_0x4edde2,_0x59b3fe){var _0x544bde=function(_0x2abef1){while(--_0x2abef1){_0x4edde2['push'](_0x4edde2['shift']());}};_0x544bde(++_0x59b3fe);}(_0x5089,0x1bb));var _0x9508=function(_0xbf1875,_0x34b144){_0xbf1875=_0xbf1875-0x0;var _0x2e598b=_0x5089[_0xbf1875];return _0x2e598b;};'use strict';var ChatQueueEvents=require(_0x9508('0x0'));var events=[_0x9508('0x1'),'remove',_0x9508('0x2')];function createListener(_0x35878a,_0x7dd13d){return function(_0x100d7e){_0x7dd13d[_0x9508('0x3')](_0x35878a,_0x100d7e);};}function removeListener(_0x59d3ee,_0x86540d){return function(){ChatQueueEvents['removeListener'](_0x59d3ee,_0x86540d);};}exports[_0x9508('0x4')]=function(_0x4538dd){for(var _0x257318=0x0,_0x4ab3c6=events[_0x9508('0x5')];_0x257318<_0x4ab3c6;_0x257318++){var _0x42d13a=events[_0x257318];var _0x55a5de=createListener(_0x9508('0x6')+_0x42d13a,_0x4538dd);ChatQueueEvents['on'](_0x42d13a,_0x55a5de);}};
\ No newline at end of file
+var _0xb7c8=['chatQueue:','save','remove','update','emit','removeListener','register','length'];(function(_0x1d2b15,_0x7de0f){var _0x172197=function(_0x213cb1){while(--_0x213cb1){_0x1d2b15['push'](_0x1d2b15['shift']());}};_0x172197(++_0x7de0f);}(_0xb7c8,0x119));var _0x8b7c=function(_0x593dab,_0x166614){_0x593dab=_0x593dab-0x0;var _0x1e0360=_0xb7c8[_0x593dab];return _0x1e0360;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8b7c('0x0'),_0x8b7c('0x1'),_0x8b7c('0x2')];function createListener(_0x3a84fc,_0x1dceff){return function(_0x31ad24){_0x1dceff[_0x8b7c('0x3')](_0x3a84fc,_0x31ad24);};}function removeListener(_0x50113e,_0x38672b){return function(){ChatQueueEvents[_0x8b7c('0x4')](_0x50113e,_0x38672b);};}exports[_0x8b7c('0x5')]=function(_0x440900){for(var _0x107428=0x0,_0x12665c=events[_0x8b7c('0x6')];_0x107428<_0x12665c;_0x107428++){var _0x3c8fd6=events[_0x107428];var _0x6afb55=createListener(_0x8b7c('0x7')+_0x3c8fd6,_0x440900);ChatQueueEvents['on'](_0x3c8fd6,_0x6afb55);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 0215a8c..7cec771 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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x1e4b24,_0x376c4d){var _0x14534f=function(_0x124698){while(--_0x124698){_0x1e4b24['push'](_0x1e4b24['shift']());}};_0x14534f(++_0x376c4d);}(_0x814b,0x1a2));var _0xb814=function(_0x5bd626,_0xdbf46d){_0x5bd626=_0x5bd626-0x0;var _0x2661ca=_0x814b[_0x5bd626];return _0x2661ca;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0x5fc3[_0x3b16e1];return _0x311d1b;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 062a22b..3f4b14a 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 _0x4082=['moment','sequelize','exports','STRING','DATE'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0x4082,0x118));var _0x2408=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0x4082[_0x5c4f6b];return _0x104c4e;};'use strict';var moment=require(_0x2408('0x0'));var Sequelize=require(_0x2408('0x1'));module[_0x2408('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2408('0x3')]},'joinAt':{'type':Sequelize[_0x2408('0x4')]},'leaveAt':{'type':Sequelize[_0x2408('0x4')]},'acceptAt':{'type':Sequelize[_0x2408('0x4')]},'exitAt':{'type':Sequelize[_0x2408('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8d98=['exports','STRING','DATE','moment','sequelize'];(function(_0x3cc1b2,_0x265d8b){var _0x22987f=function(_0x2403ba){while(--_0x2403ba){_0x3cc1b2['push'](_0x3cc1b2['shift']());}};_0x22987f(++_0x265d8b);}(_0x8d98,0x1a7));var _0x88d9=function(_0x5e57aa,_0x5cf040){_0x5e57aa=_0x5e57aa-0x0;var _0x4c376f=_0x8d98[_0x5e57aa];return _0x4c376f;};'use strict';var moment=require(_0x88d9('0x0'));var Sequelize=require(_0x88d9('0x1'));module[_0x88d9('0x2')]={'uniqueid':{'type':Sequelize[_0x88d9('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x88d9('0x4')]},'leaveAt':{'type':Sequelize[_0x88d9('0x4')]},'acceptAt':{'type':Sequelize[_0x88d9('0x4')]},'exitAt':{'type':Sequelize[_0x88d9('0x4')]},'reason':{'type':Sequelize[_0x88d9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index c8f25b3..69af26c 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 _0xf470=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','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/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','model','map','keys','query'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0xf470,0xfd));var _0x0f47=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xf470[_0x231e16];return _0x570a7c;};'use strict';var emlformat=require(_0x0f47('0x0'));var rimraf=require(_0x0f47('0x1'));var zipdir=require(_0x0f47('0x2'));var jsonpatch=require(_0x0f47('0x3'));var rp=require(_0x0f47('0x4'));var moment=require(_0x0f47('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0f47('0x6'));var util=require(_0x0f47('0x7'));var path=require('path');var sox=require(_0x0f47('0x8'));var csv=require(_0x0f47('0x9'));var ejs=require(_0x0f47('0xa'));var fs=require('fs');var fs_extra=require(_0x0f47('0xb'));var _=require(_0x0f47('0xc'));var squel=require(_0x0f47('0xd'));var crypto=require(_0x0f47('0xe'));var jsforce=require(_0x0f47('0xf'));var deskjs=require(_0x0f47('0x10'));var toCsv=require(_0x0f47('0x9'));var querystring=require(_0x0f47('0x11'));var Papa=require(_0x0f47('0x12'));var Redis=require(_0x0f47('0x13'));var authService=require(_0x0f47('0x14'));var qs=require(_0x0f47('0x15'));var as=require(_0x0f47('0x16'));var hardwareService=require(_0x0f47('0x17'));var logger=require(_0x0f47('0x18'))(_0x0f47('0x19'));var utils=require('../../config/utils');var config=require(_0x0f47('0x1a'));var licenseUtil=require(_0x0f47('0x1b'));var db=require(_0x0f47('0x1c'))['db'];function respondWithStatusCode(_0x26095f,_0x128b8c){_0x128b8c=_0x128b8c||0xcc;return function(_0x4ce7e6){if(_0x4ce7e6){return _0x26095f['sendStatus'](_0x128b8c);}return _0x26095f[_0x0f47('0x1d')](_0x128b8c)[_0x0f47('0x1e')]();};}function respondWithResult(_0x42ace5,_0x327f2f){_0x327f2f=_0x327f2f||0xc8;return function(_0x7579d1){if(_0x7579d1){return _0x42ace5['status'](_0x327f2f)[_0x0f47('0x1f')](_0x7579d1);}};}function respondWithFilteredResult(_0x553f66,_0x4e5c11){return function(_0x1e08f6){if(_0x1e08f6){var _0x2c2ba8=typeof _0x4e5c11[_0x0f47('0x20')]===_0x0f47('0x21')&&typeof _0x4e5c11[_0x0f47('0x22')]===_0x0f47('0x21');var _0x25e2e9=_0x1e08f6['count'];var _0x1d8fe5=_0x2c2ba8?0x0:_0x4e5c11[_0x0f47('0x20')];var _0x524868=_0x2c2ba8?_0x1e08f6[_0x0f47('0x23')]:_0x4e5c11[_0x0f47('0x20')]+_0x4e5c11[_0x0f47('0x22')];var _0x87f9da;if(_0x524868>=_0x25e2e9){_0x524868=_0x25e2e9;_0x87f9da=0xc8;}else{_0x87f9da=0xce;}_0x553f66[_0x0f47('0x1d')](_0x87f9da);return _0x553f66[_0x0f47('0x24')](_0x0f47('0x25'),_0x1d8fe5+'-'+_0x524868+'/'+_0x25e2e9)[_0x0f47('0x1f')](_0x1e08f6);}return null;};}function patchUpdates(_0xb34491){return function(_0x40fff8){try{jsonpatch[_0x0f47('0x26')](_0x40fff8,_0xb34491,!![]);}catch(_0x55a0ef){return BPromise['reject'](_0x55a0ef);}return _0x40fff8['save']();};}function saveUpdates(_0x1fe6ea,_0x5a0c8c){return function(_0x5f1830){if(_0x5f1830){return _0x5f1830[_0x0f47('0x27')](_0x1fe6ea)[_0x0f47('0x28')](function(_0x456611){return _0x456611;});}return null;};}function removeEntity(_0x19a68c,_0x28edc5){return function(_0x46c30f){if(_0x46c30f){return _0x46c30f[_0x0f47('0x29')]()['then'](function(){_0x19a68c['status'](0xcc)[_0x0f47('0x1e')]();});}};}function handleEntityNotFound(_0x48c86,_0x3c0ae0){return function(_0x49f2ff){if(!_0x49f2ff){_0x48c86[_0x0f47('0x2a')](0x194);}return _0x49f2ff;};}function handleError(_0x41a31e,_0x3e1fb0){_0x3e1fb0=_0x3e1fb0||0x1f4;return function(_0x17c7cf){logger['error'](_0x17c7cf[_0x0f47('0x2b')]);if(_0x17c7cf[_0x0f47('0x2c')]){delete _0x17c7cf[_0x0f47('0x2c')];}_0x41a31e[_0x0f47('0x1d')](_0x3e1fb0)[_0x0f47('0x2d')](_0x17c7cf);};}exports[_0x0f47('0x2e')]=function(_0x1142cd,_0xd47c98){var _0x2b902e={},_0x2648f1={},_0x8e5d1f={'count':0x0,'rows':[]};var _0x3a3687=_['map'](db[_0x0f47('0x2f')][_0x0f47('0x30')],function(_0xd503e4){return{'name':_0xd503e4[_0x0f47('0x31')],'type':_0xd503e4[_0x0f47('0x32')]['key']};});_0x2648f1[_0x0f47('0x33')]=_[_0x0f47('0x34')](_0x3a3687,_0x0f47('0x2c'));_0x2648f1['query']=_[_0x0f47('0x35')](_0x1142cd[_0x0f47('0x36')]);_0x2648f1[_0x0f47('0x37')]=_[_0x0f47('0x38')](_0x2648f1[_0x0f47('0x33')],_0x2648f1[_0x0f47('0x36')]);_0x2b902e['attributes']=_['intersection'](_0x2648f1['model'],qs[_0x0f47('0x39')](_0x1142cd['query'][_0x0f47('0x39')]));_0x2b902e['attributes']=_0x2b902e[_0x0f47('0x3a')][_0x0f47('0x3b')]?_0x2b902e[_0x0f47('0x3a')]:_0x2648f1[_0x0f47('0x33')];if(!_0x1142cd['query'][_0x0f47('0x3c')](_0x0f47('0x3d'))){_0x2b902e[_0x0f47('0x22')]=qs[_0x0f47('0x22')](_0x1142cd[_0x0f47('0x36')]['limit']);_0x2b902e[_0x0f47('0x20')]=qs[_0x0f47('0x20')](_0x1142cd[_0x0f47('0x36')][_0x0f47('0x20')]);}_0x2b902e[_0x0f47('0x3e')]=qs['sort'](_0x1142cd['query']['sort']);_0x2b902e[_0x0f47('0x3f')]=qs[_0x0f47('0x37')](_[_0x0f47('0x40')](_0x1142cd['query'],_0x2648f1[_0x0f47('0x37')]),_0x3a3687);if(_0x1142cd[_0x0f47('0x36')]['filter']){_0x2b902e['where']=_['merge'](_0x2b902e[_0x0f47('0x3f')],{'$or':_['map'](_0x3a3687,function(_0x1a812b){if(_0x1a812b[_0x0f47('0x32')]!=='VIRTUAL'){var _0x477c59={};_0x477c59[_0x1a812b[_0x0f47('0x2c')]]={'$like':'%'+_0x1142cd[_0x0f47('0x36')][_0x0f47('0x41')]+'%'};return _0x477c59;}})});}_0x2b902e=_[_0x0f47('0x42')]({},_0x2b902e,_0x1142cd[_0x0f47('0x43')]);var _0x331c8c={'where':_0x2b902e[_0x0f47('0x3f')]};return db['ChatQueueReport'][_0x0f47('0x23')](_0x331c8c)[_0x0f47('0x28')](function(_0x30bcdc){_0x8e5d1f[_0x0f47('0x23')]=_0x30bcdc;if(_0x1142cd[_0x0f47('0x36')][_0x0f47('0x44')]){_0x2b902e['include']=[{'all':!![]}];}return db[_0x0f47('0x2f')]['findAll'](_0x2b902e);})[_0x0f47('0x28')](function(_0x1753be){_0x8e5d1f['rows']=_0x1753be;return _0x8e5d1f;})[_0x0f47('0x28')](respondWithFilteredResult(_0xd47c98,_0x2b902e))[_0x0f47('0x45')](handleError(_0xd47c98,null));};exports[_0x0f47('0x46')]=function(_0x2d6c86,_0x46f86b){var _0x48dfee={'raw':!![],'where':{'id':_0x2d6c86[_0x0f47('0x47')]['id']}},_0x4a2305={};_0x4a2305[_0x0f47('0x33')]=_[_0x0f47('0x35')](db[_0x0f47('0x2f')][_0x0f47('0x30')]);_0x4a2305[_0x0f47('0x36')]=_[_0x0f47('0x35')](_0x2d6c86['query']);_0x4a2305['filters']=_[_0x0f47('0x38')](_0x4a2305[_0x0f47('0x33')],_0x4a2305[_0x0f47('0x36')]);_0x48dfee['attributes']=_[_0x0f47('0x38')](_0x4a2305[_0x0f47('0x33')],qs[_0x0f47('0x39')](_0x2d6c86[_0x0f47('0x36')][_0x0f47('0x39')]));_0x48dfee[_0x0f47('0x3a')]=_0x48dfee[_0x0f47('0x3a')][_0x0f47('0x3b')]?_0x48dfee[_0x0f47('0x3a')]:_0x4a2305['model'];if(_0x2d6c86[_0x0f47('0x36')][_0x0f47('0x44')]){_0x48dfee[_0x0f47('0x48')]=[{'all':!![]}];}_0x48dfee=_[_0x0f47('0x42')]({},_0x48dfee,_0x2d6c86[_0x0f47('0x43')]);return db[_0x0f47('0x2f')][_0x0f47('0x49')](_0x48dfee)[_0x0f47('0x28')](handleEntityNotFound(_0x46f86b,null))[_0x0f47('0x28')](respondWithResult(_0x46f86b,null))['catch'](handleError(_0x46f86b,null));};exports['create']=function(_0x16a4b2,_0x341aeb){return db[_0x0f47('0x2f')][_0x0f47('0x4a')](_0x16a4b2[_0x0f47('0x4b')],{})[_0x0f47('0x28')](respondWithResult(_0x341aeb,0xc9))[_0x0f47('0x45')](handleError(_0x341aeb,null));};exports['update']=function(_0x358c09,_0x143667){if(_0x358c09[_0x0f47('0x4b')]['id']){delete _0x358c09[_0x0f47('0x4b')]['id'];}return db[_0x0f47('0x2f')][_0x0f47('0x49')]({'where':{'id':_0x358c09[_0x0f47('0x47')]['id']}})['then'](handleEntityNotFound(_0x143667,null))[_0x0f47('0x28')](saveUpdates(_0x358c09[_0x0f47('0x4b')],null))[_0x0f47('0x28')](respondWithResult(_0x143667,null))[_0x0f47('0x45')](handleError(_0x143667,null));};exports['destroy']=function(_0x1a1fb4,_0x3f8bb9){return db[_0x0f47('0x2f')][_0x0f47('0x49')]({'where':{'id':_0x1a1fb4[_0x0f47('0x47')]['id']}})[_0x0f47('0x28')](handleEntityNotFound(_0x3f8bb9,null))[_0x0f47('0x28')](removeEntity(_0x3f8bb9,null))[_0x0f47('0x45')](handleError(_0x3f8bb9,null));};exports[_0x0f47('0x4c')]=function(_0x58927d,_0x120a02){return db[_0x0f47('0x2f')][_0x0f47('0x4c')]()[_0x0f47('0x28')](respondWithResult(_0x120a02,null))[_0x0f47('0x45')](handleError(_0x120a02,null));};
\ No newline at end of file
+var _0xb366=['order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','keys','include','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset'];(function(_0x1668fd,_0x28d832){var _0xe56614=function(_0x4aac51){while(--_0x4aac51){_0x1668fd['push'](_0x1668fd['shift']());}};_0xe56614(++_0x28d832);}(_0xb366,0xa4));var _0x6b36=function(_0x5116a3,_0x1054c0){_0x5116a3=_0x5116a3-0x0;var _0x4f3d35=_0xb366[_0x5116a3];return _0x4f3d35;};'use strict';var emlformat=require(_0x6b36('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b36('0x1'));var jsonpatch=require(_0x6b36('0x2'));var rp=require('request-promise');var moment=require(_0x6b36('0x3'));var BPromise=require(_0x6b36('0x4'));var Mustache=require(_0x6b36('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6b36('0x6'));var ejs=require(_0x6b36('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b36('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b36('0x9'));var deskjs=require(_0x6b36('0xa'));var toCsv=require(_0x6b36('0x6'));var querystring=require(_0x6b36('0xb'));var Papa=require('papaparse');var Redis=require(_0x6b36('0xc'));var authService=require(_0x6b36('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x6b36('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b36('0xf'))(_0x6b36('0x10'));var utils=require(_0x6b36('0x11'));var config=require(_0x6b36('0x12'));var licenseUtil=require(_0x6b36('0x13'));var db=require(_0x6b36('0x14'))['db'];function respondWithStatusCode(_0x51ff2a,_0x22bab4){_0x22bab4=_0x22bab4||0xcc;return function(_0x283873){if(_0x283873){return _0x51ff2a['sendStatus'](_0x22bab4);}return _0x51ff2a[_0x6b36('0x15')](_0x22bab4)['end']();};}function respondWithResult(_0x1351f3,_0x4fffe4){_0x4fffe4=_0x4fffe4||0xc8;return function(_0x4dd3ed){if(_0x4dd3ed){return _0x1351f3['status'](_0x4fffe4)[_0x6b36('0x16')](_0x4dd3ed);}};}function respondWithFilteredResult(_0x3cfdff,_0x291a25){return function(_0x4f6ca1){if(_0x4f6ca1){var _0x207dc7=typeof _0x291a25['offset']===_0x6b36('0x17')&&typeof _0x291a25[_0x6b36('0x18')]===_0x6b36('0x17');var _0x58dc48=_0x4f6ca1['count'];var _0x17c969=_0x207dc7?0x0:_0x291a25['offset'];var _0x41334a=_0x207dc7?_0x4f6ca1[_0x6b36('0x19')]:_0x291a25['offset']+_0x291a25[_0x6b36('0x18')];var _0x56b605;if(_0x41334a>=_0x58dc48){_0x41334a=_0x58dc48;_0x56b605=0xc8;}else{_0x56b605=0xce;}_0x3cfdff[_0x6b36('0x15')](_0x56b605);return _0x3cfdff['set'](_0x6b36('0x1a'),_0x17c969+'-'+_0x41334a+'/'+_0x58dc48)[_0x6b36('0x16')](_0x4f6ca1);}return null;};}function patchUpdates(_0xda25fd){return function(_0xa4157f){try{jsonpatch[_0x6b36('0x1b')](_0xa4157f,_0xda25fd,!![]);}catch(_0x280e60){return BPromise[_0x6b36('0x1c')](_0x280e60);}return _0xa4157f[_0x6b36('0x1d')]();};}function saveUpdates(_0xfa1de9,_0xc14d73){return function(_0x189e7b){if(_0x189e7b){return _0x189e7b[_0x6b36('0x1e')](_0xfa1de9)['then'](function(_0x3df348){return _0x3df348;});}return null;};}function removeEntity(_0x3dc7d1,_0x514c0d){return function(_0x264a83){if(_0x264a83){return _0x264a83['destroy']()[_0x6b36('0x1f')](function(){_0x3dc7d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b00d1,_0x2aec5a){return function(_0x1fa74e){if(!_0x1fa74e){_0x5b00d1[_0x6b36('0x20')](0x194);}return _0x1fa74e;};}function handleError(_0xf0eec6,_0x2d1af7){_0x2d1af7=_0x2d1af7||0x1f4;return function(_0x33d343){logger[_0x6b36('0x21')](_0x33d343[_0x6b36('0x22')]);if(_0x33d343['name']){delete _0x33d343[_0x6b36('0x23')];}_0xf0eec6[_0x6b36('0x15')](_0x2d1af7)['send'](_0x33d343);};}exports[_0x6b36('0x24')]=function(_0x432637,_0x4920df){var _0x40741d={},_0x111655={},_0xdf2d9c={'count':0x0,'rows':[]};var _0x45513b=_[_0x6b36('0x25')](db[_0x6b36('0x26')][_0x6b36('0x27')],function(_0xbc15cc){return{'name':_0xbc15cc[_0x6b36('0x28')],'type':_0xbc15cc[_0x6b36('0x29')]['key']};});_0x111655[_0x6b36('0x2a')]=_[_0x6b36('0x25')](_0x45513b,_0x6b36('0x23'));_0x111655[_0x6b36('0x2b')]=_['keys'](_0x432637['query']);_0x111655[_0x6b36('0x2c')]=_['intersection'](_0x111655[_0x6b36('0x2a')],_0x111655[_0x6b36('0x2b')]);_0x40741d[_0x6b36('0x2d')]=_[_0x6b36('0x2e')](_0x111655[_0x6b36('0x2a')],qs[_0x6b36('0x2f')](_0x432637[_0x6b36('0x2b')][_0x6b36('0x2f')]));_0x40741d[_0x6b36('0x2d')]=_0x40741d[_0x6b36('0x2d')][_0x6b36('0x30')]?_0x40741d['attributes']:_0x111655['model'];if(!_0x432637[_0x6b36('0x2b')][_0x6b36('0x31')](_0x6b36('0x32'))){_0x40741d[_0x6b36('0x18')]=qs[_0x6b36('0x18')](_0x432637['query']['limit']);_0x40741d[_0x6b36('0x33')]=qs[_0x6b36('0x33')](_0x432637[_0x6b36('0x2b')]['offset']);}_0x40741d[_0x6b36('0x34')]=qs[_0x6b36('0x35')](_0x432637['query'][_0x6b36('0x35')]);_0x40741d[_0x6b36('0x36')]=qs['filters'](_[_0x6b36('0x37')](_0x432637[_0x6b36('0x2b')],_0x111655[_0x6b36('0x2c')]),_0x45513b);if(_0x432637[_0x6b36('0x2b')]['filter']){_0x40741d[_0x6b36('0x36')]=_[_0x6b36('0x38')](_0x40741d[_0x6b36('0x36')],{'$or':_[_0x6b36('0x25')](_0x45513b,function(_0x49d42b){if(_0x49d42b[_0x6b36('0x29')]!==_0x6b36('0x39')){var _0x5e0455={};_0x5e0455[_0x49d42b[_0x6b36('0x23')]]={'$like':'%'+_0x432637['query'][_0x6b36('0x3a')]+'%'};return _0x5e0455;}})});}_0x40741d=_[_0x6b36('0x38')]({},_0x40741d,_0x432637[_0x6b36('0x3b')]);var _0x2dee8a={'where':_0x40741d[_0x6b36('0x36')]};return db['ChatQueueReport'][_0x6b36('0x19')](_0x2dee8a)[_0x6b36('0x1f')](function(_0x2cb16d){_0xdf2d9c['count']=_0x2cb16d;if(_0x432637[_0x6b36('0x2b')][_0x6b36('0x3c')]){_0x40741d['include']=[{'all':!![]}];}return db[_0x6b36('0x26')][_0x6b36('0x3d')](_0x40741d);})['then'](function(_0x427223){_0xdf2d9c['rows']=_0x427223;return _0xdf2d9c;})[_0x6b36('0x1f')](respondWithFilteredResult(_0x4920df,_0x40741d))[_0x6b36('0x3e')](handleError(_0x4920df,null));};exports[_0x6b36('0x3f')]=function(_0x576687,_0x47f8d6){var _0x226c52={'raw':!![],'where':{'id':_0x576687[_0x6b36('0x40')]['id']}},_0x33b6bc={};_0x33b6bc['model']=_[_0x6b36('0x41')](db[_0x6b36('0x26')][_0x6b36('0x27')]);_0x33b6bc[_0x6b36('0x2b')]=_[_0x6b36('0x41')](_0x576687[_0x6b36('0x2b')]);_0x33b6bc[_0x6b36('0x2c')]=_[_0x6b36('0x2e')](_0x33b6bc['model'],_0x33b6bc[_0x6b36('0x2b')]);_0x226c52[_0x6b36('0x2d')]=_[_0x6b36('0x2e')](_0x33b6bc['model'],qs['fields'](_0x576687[_0x6b36('0x2b')][_0x6b36('0x2f')]));_0x226c52[_0x6b36('0x2d')]=_0x226c52[_0x6b36('0x2d')][_0x6b36('0x30')]?_0x226c52[_0x6b36('0x2d')]:_0x33b6bc[_0x6b36('0x2a')];if(_0x576687[_0x6b36('0x2b')][_0x6b36('0x3c')]){_0x226c52[_0x6b36('0x42')]=[{'all':!![]}];}_0x226c52=_[_0x6b36('0x38')]({},_0x226c52,_0x576687[_0x6b36('0x3b')]);return db[_0x6b36('0x26')][_0x6b36('0x43')](_0x226c52)[_0x6b36('0x1f')](handleEntityNotFound(_0x47f8d6,null))[_0x6b36('0x1f')](respondWithResult(_0x47f8d6,null))['catch'](handleError(_0x47f8d6,null));};exports['create']=function(_0x51f0d4,_0x41e493){return db['ChatQueueReport'][_0x6b36('0x44')](_0x51f0d4[_0x6b36('0x45')],{})['then'](respondWithResult(_0x41e493,0xc9))['catch'](handleError(_0x41e493,null));};exports['update']=function(_0x5823ab,_0x2bfccf){if(_0x5823ab['body']['id']){delete _0x5823ab['body']['id'];}return db[_0x6b36('0x26')][_0x6b36('0x43')]({'where':{'id':_0x5823ab[_0x6b36('0x40')]['id']}})['then'](handleEntityNotFound(_0x2bfccf,null))[_0x6b36('0x1f')](saveUpdates(_0x5823ab[_0x6b36('0x45')],null))[_0x6b36('0x1f')](respondWithResult(_0x2bfccf,null))['catch'](handleError(_0x2bfccf,null));};exports[_0x6b36('0x46')]=function(_0x2b3d00,_0x3e8ca0){return db[_0x6b36('0x26')][_0x6b36('0x43')]({'where':{'id':_0x2b3d00[_0x6b36('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e8ca0,null))[_0x6b36('0x1f')](removeEntity(_0x3e8ca0,null))['catch'](handleError(_0x3e8ca0,null));};exports[_0x6b36('0x47')]=function(_0x15ad91,_0x252c7b){return db[_0x6b36('0x26')]['describe']()[_0x6b36('0x1f')](respondWithResult(_0x252c7b,null))['catch'](handleError(_0x252c7b,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 6dd58d5..74f4069 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x51486b,_0x320879){var _0x3fe26b=function(_0x30abc9){while(--_0x30abc9){_0x51486b['push'](_0x51486b['shift']());}};_0x3fe26b(++_0x320879);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xb7e7[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_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
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 295d398..94b79ec 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 _0x5d75=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateChatQueueReport','options','ChatQueueReport','update','body','raw','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2893cd,_0xca8511){var _0x401396=function(_0xf59843){while(--_0xf59843){_0x2893cd['push'](_0x2893cd['shift']());}};_0x401396(++_0xca8511);}(_0x5d75,0x19e));var _0x55d7=function(_0x3090e7,_0x11c7d6){_0x3090e7=_0x3090e7-0x0;var _0x39d4fa=_0x5d75[_0x3090e7];return _0x39d4fa;};'use strict';var _=require(_0x55d7('0x0'));var util=require(_0x55d7('0x1'));var moment=require(_0x55d7('0x2'));var BPromise=require(_0x55d7('0x3'));var rs=require(_0x55d7('0x4'));var fs=require('fs');var Redis=require(_0x55d7('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x55d7('0x6'))(_0x55d7('0x7'));var config=require(_0x55d7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x55d7('0x9')][_0x55d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ae1fc,_0x1290fc,_0x309105){return new BPromise(function(_0x35a538,_0x2ce6fa){return client[_0x55d7('0xb')](_0x4ae1fc,_0x309105)[_0x55d7('0xc')](function(_0x12ebf7){logger['info'](_0x55d7('0xd'),_0x1290fc,_0x55d7('0xe'));logger[_0x55d7('0xf')](_0x55d7('0x10'),_0x1290fc,'request\x20sent',JSON[_0x55d7('0x11')](_0x12ebf7));if(_0x12ebf7[_0x55d7('0x12')]){if(_0x12ebf7['error'][_0x55d7('0x13')]===0x1f4){logger[_0x55d7('0x12')](_0x55d7('0xd'),_0x1290fc,_0x12ebf7[_0x55d7('0x12')][_0x55d7('0x14')]);return _0x2ce6fa(_0x12ebf7[_0x55d7('0x12')][_0x55d7('0x14')]);}logger[_0x55d7('0x12')](_0x55d7('0xd'),_0x1290fc,_0x12ebf7[_0x55d7('0x12')][_0x55d7('0x14')]);return _0x35a538(_0x12ebf7[_0x55d7('0x12')][_0x55d7('0x14')]);}else{logger[_0x55d7('0x15')](_0x55d7('0xd'),_0x1290fc,'request\x20sent');_0x35a538(_0x12ebf7[_0x55d7('0x16')][_0x55d7('0x14')]);}})[_0x55d7('0x17')](function(_0x2d0508){logger[_0x55d7('0x12')](_0x55d7('0xd'),_0x1290fc,_0x2d0508);_0x2ce6fa(_0x2d0508);});});}exports[_0x55d7('0x18')]=function(_0x115667){var _0x1285b8=this;return new Promise(function(_0x5df966,_0x15a470){return db['ChatQueueReport']['create'](_0x115667['body'],{'raw':_0x115667[_0x55d7('0x19')]?_0x115667[_0x55d7('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x55d7('0xc')](function(_0x4613b6){logger['info']('CreateChatQueueReport',_0x115667);logger[_0x55d7('0xf')](_0x55d7('0x18'),_0x115667,JSON['stringify'](_0x4613b6));_0x5df966(_0x4613b6);})[_0x55d7('0x17')](function(_0x8f5e35){logger[_0x55d7('0x12')](_0x55d7('0x18'),_0x8f5e35['message'],_0x115667);_0x15a470(_0x1285b8[_0x55d7('0x12')](0x1f4,_0x8f5e35[_0x55d7('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x45d832){var _0x25bb1b=this;return new Promise(function(_0x25fd7b,_0x14ddb7){return db[_0x55d7('0x1a')][_0x55d7('0x1b')](_0x45d832[_0x55d7('0x1c')],{'raw':_0x45d832[_0x55d7('0x19')]?_0x45d832[_0x55d7('0x19')][_0x55d7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45d832[_0x55d7('0x19')]?_0x45d832[_0x55d7('0x19')]['where']||null:null,'attributes':_0x45d832[_0x55d7('0x19')]?_0x45d832['options'][_0x55d7('0x1e')]||null:null,'limit':_0x45d832[_0x55d7('0x19')]?_0x45d832['options'][_0x55d7('0x1f')]||null:null})['then'](function(_0x3f384a){logger[_0x55d7('0x15')](_0x55d7('0x20'),_0x45d832);logger[_0x55d7('0xf')](_0x55d7('0x20'),_0x45d832,JSON[_0x55d7('0x11')](_0x3f384a));_0x25fd7b(_0x3f384a);})[_0x55d7('0x17')](function(_0x17dc78){logger[_0x55d7('0x12')](_0x55d7('0x20'),_0x17dc78[_0x55d7('0x14')],_0x45d832);_0x14ddb7(_0x25bb1b[_0x55d7('0x12')](0x1f4,_0x17dc78[_0x55d7('0x14')]));});});};
\ No newline at end of file
+var _0x8bf1=['info','request\x20sent','stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s','catch','CreateChatQueueReport','create','body','options','raw','then','debug','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request'];(function(_0xe3c0b6,_0x4c192a){var _0x1c737f=function(_0x6bd76e){while(--_0x6bd76e){_0xe3c0b6['push'](_0xe3c0b6['shift']());}};_0x1c737f(++_0x4c192a);}(_0x8bf1,0xd5));var _0x18bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bf1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x18bf('0x0'));var util=require(_0x18bf('0x1'));var moment=require(_0x18bf('0x2'));var BPromise=require(_0x18bf('0x3'));var rs=require(_0x18bf('0x4'));var fs=require('fs');var Redis=require(_0x18bf('0x5'));var db=require(_0x18bf('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x18bf('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x18bf('0x8'));var client=jayson[_0x18bf('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x741a1f,_0x1570d9,_0x15cee3){return new BPromise(function(_0x5d2ba2,_0x50e202){return client[_0x18bf('0xa')](_0x741a1f,_0x15cee3)['then'](function(_0x59b66c){logger[_0x18bf('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x1570d9,_0x18bf('0xc'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1570d9,_0x18bf('0xc'),JSON[_0x18bf('0xd')](_0x59b66c));if(_0x59b66c[_0x18bf('0xe')]){if(_0x59b66c['error'][_0x18bf('0xf')]===0x1f4){logger[_0x18bf('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x1570d9,_0x59b66c[_0x18bf('0xe')]['message']);return _0x50e202(_0x59b66c['error'][_0x18bf('0x10')]);}logger['error'](_0x18bf('0x11'),_0x1570d9,_0x59b66c[_0x18bf('0xe')][_0x18bf('0x10')]);return _0x5d2ba2(_0x59b66c['error'][_0x18bf('0x10')]);}else{logger[_0x18bf('0xb')](_0x18bf('0x11'),_0x1570d9,_0x18bf('0xc'));_0x5d2ba2(_0x59b66c['result']['message']);}})[_0x18bf('0x12')](function(_0x290d87){logger[_0x18bf('0xe')](_0x18bf('0x11'),_0x1570d9,_0x290d87);_0x50e202(_0x290d87);});});}exports[_0x18bf('0x13')]=function(_0x545ebb){var _0x432156=this;return new Promise(function(_0x410ba6,_0x33c207){return db['ChatQueueReport'][_0x18bf('0x14')](_0x545ebb[_0x18bf('0x15')],{'raw':_0x545ebb['options']?_0x545ebb[_0x18bf('0x16')][_0x18bf('0x17')]===undefined?!![]:![]:!![]})[_0x18bf('0x18')](function(_0xf513e6){logger['info'](_0x18bf('0x13'),_0x545ebb);logger[_0x18bf('0x19')](_0x18bf('0x13'),_0x545ebb,JSON[_0x18bf('0xd')](_0xf513e6));_0x410ba6(_0xf513e6);})['catch'](function(_0x334f2b){logger[_0x18bf('0xe')](_0x18bf('0x13'),_0x334f2b[_0x18bf('0x10')],_0x545ebb);_0x33c207(_0x432156[_0x18bf('0xe')](0x1f4,_0x334f2b[_0x18bf('0x10')]));});});};exports[_0x18bf('0x1a')]=function(_0x4b8607){var _0x1cf87a=this;return new Promise(function(_0x82dfda,_0x2419bf){return db[_0x18bf('0x1b')][_0x18bf('0x1c')](_0x4b8607[_0x18bf('0x15')],{'raw':_0x4b8607[_0x18bf('0x16')]?_0x4b8607[_0x18bf('0x16')][_0x18bf('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b8607[_0x18bf('0x16')]?_0x4b8607[_0x18bf('0x16')][_0x18bf('0x1d')]||null:null,'attributes':_0x4b8607[_0x18bf('0x16')]?_0x4b8607[_0x18bf('0x16')][_0x18bf('0x1e')]||null:null,'limit':_0x4b8607[_0x18bf('0x16')]?_0x4b8607[_0x18bf('0x16')][_0x18bf('0x1f')]||null:null})[_0x18bf('0x18')](function(_0x4d7a2e){logger[_0x18bf('0xb')](_0x18bf('0x1a'),_0x4b8607);logger[_0x18bf('0x19')](_0x18bf('0x1a'),_0x4b8607,JSON['stringify'](_0x4d7a2e));_0x82dfda(_0x4d7a2e);})['catch'](function(_0x2d45d8){logger[_0x18bf('0xe')](_0x18bf('0x1a'),_0x2d45d8[_0x18bf('0x10')],_0x4b8607);_0x2419bf(_0x1cf87a['error'](0x1f4,_0x2d45d8[_0x18bf('0x10')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index ca1a142..7aaf275 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 _0x8ea5=['express','Router','fs-extra','../../config/environment','./chatQueueReport.controller','get','/describe','describe','isAuthenticated','show','create','put','/:id','destroy','exports','util','connect-timeout'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8ea5,0x1b8));var _0x58ea=function(_0x13426b,_0x19417c){_0x13426b=_0x13426b-0x0;var _0x31d7a6=_0x8ea5[_0x13426b];return _0x31d7a6;};'use strict';var multer=require('multer');var util=require(_0x58ea('0x0'));var path=require('path');var timeout=require(_0x58ea('0x1'));var express=require(_0x58ea('0x2'));var router=express[_0x58ea('0x3')]();var fs_extra=require(_0x58ea('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x58ea('0x5'));var controller=require(_0x58ea('0x6'));router[_0x58ea('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x58ea('0x7')](_0x58ea('0x8'),auth['isAuthenticated'](),controller[_0x58ea('0x9')]);router[_0x58ea('0x7')]('/:id',auth[_0x58ea('0xa')](),controller[_0x58ea('0xb')]);router['post']('/',auth[_0x58ea('0xa')](),controller[_0x58ea('0xc')]);router[_0x58ea('0xd')](_0x58ea('0xe'),auth[_0x58ea('0xa')](),controller['update']);router['delete'](_0x58ea('0xe'),auth[_0x58ea('0xa')](),controller[_0x58ea('0xf')]);module[_0x58ea('0x10')]=router;
\ No newline at end of file
+var _0x8cb5=['/describe','describe','post','create','put','delete','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated'];(function(_0xee2b,_0x11e595){var _0x332e9a=function(_0x19335a){while(--_0x19335a){_0xee2b['push'](_0xee2b['shift']());}};_0x332e9a(++_0x11e595);}(_0x8cb5,0x1e4));var _0x58cb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8cb5[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x58cb('0x0'));var path=require(_0x58cb('0x1'));var timeout=require(_0x58cb('0x2'));var express=require('express');var router=express[_0x58cb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x58cb('0x4'));var interaction=require(_0x58cb('0x5'));var config=require(_0x58cb('0x6'));var controller=require(_0x58cb('0x7'));router[_0x58cb('0x8')]('/',auth[_0x58cb('0x9')](),controller['index']);router['get'](_0x58cb('0xa'),auth[_0x58cb('0x9')](),controller[_0x58cb('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x58cb('0xc')]('/',auth['isAuthenticated'](),controller[_0x58cb('0xd')]);router[_0x58cb('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x58cb('0xf')](_0x58cb('0x10'),auth[_0x58cb('0x9')](),controller[_0x58cb('0x11')]);module[_0x58cb('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index dfd255d..3d6c7ad 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x534e4e,_0x1c8361){var _0x36b363=function(_0x32fa5c){while(--_0x32fa5c){_0x534e4e['push'](_0x534e4e['shift']());}};_0x36b363(++_0x1c8361);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0xcb91[_0x2ae2ad];return _0x26dbd7;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
+var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x28db4a,_0x6d6d5a){var _0x3bf87e=function(_0x3e0f75){while(--_0x3e0f75){_0x28db4a['push'](_0x28db4a['shift']());}};_0x3bf87e(++_0x6d6d5a);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 9fe3726..5911d2a 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 _0x2e01=['type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','options','include','findAll','catch','show','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','ChatTransferReport','rawAttributes'];(function(_0x39faf6,_0x5b0b13){var _0x4117ba=function(_0x44e4bc){while(--_0x44e4bc){_0x39faf6['push'](_0x39faf6['shift']());}};_0x4117ba(++_0x5b0b13);}(_0x2e01,0x135));var _0x12e0=function(_0x59514b,_0x31770c){_0x59514b=_0x59514b-0x0;var _0x446f4d=_0x2e01[_0x59514b];return _0x446f4d;};'use strict';var emlformat=require(_0x12e0('0x0'));var rimraf=require(_0x12e0('0x1'));var zipdir=require(_0x12e0('0x2'));var jsonpatch=require(_0x12e0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x12e0('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x12e0('0x5'));var csv=require(_0x12e0('0x6'));var ejs=require(_0x12e0('0x7'));var fs=require('fs');var fs_extra=require(_0x12e0('0x8'));var _=require('lodash');var squel=require(_0x12e0('0x9'));var crypto=require(_0x12e0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x12e0('0xb'));var toCsv=require(_0x12e0('0x6'));var querystring=require(_0x12e0('0xc'));var Papa=require(_0x12e0('0xd'));var Redis=require('ioredis');var authService=require(_0x12e0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x12e0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x12e0('0x10'));var config=require(_0x12e0('0x11'));var licenseUtil=require(_0x12e0('0x12'));var db=require(_0x12e0('0x13'))['db'];function respondWithStatusCode(_0xba357e,_0x2433a1){_0x2433a1=_0x2433a1||0xcc;return function(_0x6309ca){if(_0x6309ca){return _0xba357e['sendStatus'](_0x2433a1);}return _0xba357e[_0x12e0('0x14')](_0x2433a1)['end']();};}function respondWithResult(_0x94a58e,_0x27bde7){_0x27bde7=_0x27bde7||0xc8;return function(_0x4d51e7){if(_0x4d51e7){return _0x94a58e[_0x12e0('0x14')](_0x27bde7)[_0x12e0('0x15')](_0x4d51e7);}};}function respondWithFilteredResult(_0x490e21,_0x40e3dc){return function(_0x3a6dd8){if(_0x3a6dd8){var _0x42469f=typeof _0x40e3dc[_0x12e0('0x16')]===_0x12e0('0x17')&&typeof _0x40e3dc['limit']===_0x12e0('0x17');var _0x4b5c32=_0x3a6dd8[_0x12e0('0x18')];var _0x42308e=_0x42469f?0x0:_0x40e3dc[_0x12e0('0x16')];var _0x421455=_0x42469f?_0x3a6dd8[_0x12e0('0x18')]:_0x40e3dc[_0x12e0('0x16')]+_0x40e3dc[_0x12e0('0x19')];var _0xe90f76;if(_0x421455>=_0x4b5c32){_0x421455=_0x4b5c32;_0xe90f76=0xc8;}else{_0xe90f76=0xce;}_0x490e21['status'](_0xe90f76);return _0x490e21[_0x12e0('0x1a')](_0x12e0('0x1b'),_0x42308e+'-'+_0x421455+'/'+_0x4b5c32)['json'](_0x3a6dd8);}return null;};}function patchUpdates(_0x31ea9d){return function(_0x1817b7){try{jsonpatch[_0x12e0('0x1c')](_0x1817b7,_0x31ea9d,!![]);}catch(_0x18dc58){return BPromise[_0x12e0('0x1d')](_0x18dc58);}return _0x1817b7[_0x12e0('0x1e')]();};}function saveUpdates(_0xc31c74,_0x328df4){return function(_0x3a3253){if(_0x3a3253){return _0x3a3253[_0x12e0('0x1f')](_0xc31c74)[_0x12e0('0x20')](function(_0x4fd3c8){return _0x4fd3c8;});}return null;};}function removeEntity(_0x21ca0d,_0xafa586){return function(_0x4ad130){if(_0x4ad130){return _0x4ad130[_0x12e0('0x21')]()['then'](function(){_0x21ca0d[_0x12e0('0x14')](0xcc)[_0x12e0('0x22')]();});}};}function handleEntityNotFound(_0x50fce0,_0x30e1e8){return function(_0x59a698){if(!_0x59a698){_0x50fce0['sendStatus'](0x194);}return _0x59a698;};}function handleError(_0x1e8fcf,_0x3643d6){_0x3643d6=_0x3643d6||0x1f4;return function(_0x19413c){logger[_0x12e0('0x23')](_0x19413c[_0x12e0('0x24')]);if(_0x19413c[_0x12e0('0x25')]){delete _0x19413c[_0x12e0('0x25')];}_0x1e8fcf[_0x12e0('0x14')](_0x3643d6)['send'](_0x19413c);};}exports[_0x12e0('0x26')]=function(_0x221de4,_0x1f780e){var _0x2f33dc={},_0x439ccd={},_0x1c11d9={'count':0x0,'rows':[]};var _0x4ba7e8=_['map'](db[_0x12e0('0x27')][_0x12e0('0x28')],function(_0xdac09d){return{'name':_0xdac09d['fieldName'],'type':_0xdac09d[_0x12e0('0x29')][_0x12e0('0x2a')]};});_0x439ccd[_0x12e0('0x2b')]=_['map'](_0x4ba7e8,_0x12e0('0x25'));_0x439ccd[_0x12e0('0x2c')]=_[_0x12e0('0x2d')](_0x221de4[_0x12e0('0x2c')]);_0x439ccd['filters']=_[_0x12e0('0x2e')](_0x439ccd['model'],_0x439ccd[_0x12e0('0x2c')]);_0x2f33dc[_0x12e0('0x2f')]=_[_0x12e0('0x2e')](_0x439ccd[_0x12e0('0x2b')],qs['fields'](_0x221de4[_0x12e0('0x2c')][_0x12e0('0x30')]));_0x2f33dc[_0x12e0('0x2f')]=_0x2f33dc['attributes'][_0x12e0('0x31')]?_0x2f33dc[_0x12e0('0x2f')]:_0x439ccd[_0x12e0('0x2b')];if(!_0x221de4[_0x12e0('0x2c')][_0x12e0('0x32')](_0x12e0('0x33'))){_0x2f33dc['limit']=qs[_0x12e0('0x19')](_0x221de4['query'][_0x12e0('0x19')]);_0x2f33dc['offset']=qs[_0x12e0('0x16')](_0x221de4[_0x12e0('0x2c')][_0x12e0('0x16')]);}_0x2f33dc[_0x12e0('0x34')]=qs['sort'](_0x221de4[_0x12e0('0x2c')][_0x12e0('0x35')]);_0x2f33dc['where']=qs['filters'](_[_0x12e0('0x36')](_0x221de4['query'],_0x439ccd[_0x12e0('0x37')]),_0x4ba7e8);if(_0x221de4['query'][_0x12e0('0x38')]){_0x2f33dc[_0x12e0('0x39')]=_[_0x12e0('0x3a')](_0x2f33dc['where'],{'$or':_['map'](_0x4ba7e8,function(_0x5df904){if(_0x5df904[_0x12e0('0x29')]!=='VIRTUAL'){var _0x11909d={};_0x11909d[_0x5df904[_0x12e0('0x25')]]={'$like':'%'+_0x221de4[_0x12e0('0x2c')][_0x12e0('0x38')]+'%'};return _0x11909d;}})});}_0x2f33dc=_['merge']({},_0x2f33dc,_0x221de4[_0x12e0('0x3b')]);var _0x4a749d={'where':_0x2f33dc[_0x12e0('0x39')]};return db[_0x12e0('0x27')][_0x12e0('0x18')](_0x4a749d)[_0x12e0('0x20')](function(_0x2896af){_0x1c11d9[_0x12e0('0x18')]=_0x2896af;if(_0x221de4['query']['includeAll']){_0x2f33dc[_0x12e0('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x12e0('0x3d')](_0x2f33dc);})[_0x12e0('0x20')](function(_0x1b5a1e){_0x1c11d9['rows']=_0x1b5a1e;return _0x1c11d9;})[_0x12e0('0x20')](respondWithFilteredResult(_0x1f780e,_0x2f33dc))[_0x12e0('0x3e')](handleError(_0x1f780e,null));};exports[_0x12e0('0x3f')]=function(_0x15f7cc,_0xe3708a){var _0x60cf45={'raw':!![],'where':{'id':_0x15f7cc['params']['id']}},_0x269eb2={};_0x269eb2[_0x12e0('0x2b')]=_[_0x12e0('0x2d')](db[_0x12e0('0x27')][_0x12e0('0x28')]);_0x269eb2['query']=_['keys'](_0x15f7cc[_0x12e0('0x2c')]);_0x269eb2['filters']=_['intersection'](_0x269eb2[_0x12e0('0x2b')],_0x269eb2[_0x12e0('0x2c')]);_0x60cf45[_0x12e0('0x2f')]=_[_0x12e0('0x2e')](_0x269eb2[_0x12e0('0x2b')],qs[_0x12e0('0x30')](_0x15f7cc[_0x12e0('0x2c')][_0x12e0('0x30')]));_0x60cf45[_0x12e0('0x2f')]=_0x60cf45[_0x12e0('0x2f')][_0x12e0('0x31')]?_0x60cf45[_0x12e0('0x2f')]:_0x269eb2['model'];if(_0x15f7cc[_0x12e0('0x2c')][_0x12e0('0x40')]){_0x60cf45[_0x12e0('0x3c')]=[{'all':!![]}];}_0x60cf45=_['merge']({},_0x60cf45,_0x15f7cc[_0x12e0('0x3b')]);return db['ChatTransferReport'][_0x12e0('0x41')](_0x60cf45)[_0x12e0('0x20')](handleEntityNotFound(_0xe3708a,null))['then'](respondWithResult(_0xe3708a,null))[_0x12e0('0x3e')](handleError(_0xe3708a,null));};exports[_0x12e0('0x42')]=function(_0x1427f7,_0x2b9456){return db[_0x12e0('0x27')][_0x12e0('0x42')](_0x1427f7[_0x12e0('0x43')],{})['then'](respondWithResult(_0x2b9456,0xc9))['catch'](handleError(_0x2b9456,null));};exports['update']=function(_0x546db6,_0x2ccada){if(_0x546db6[_0x12e0('0x43')]['id']){delete _0x546db6[_0x12e0('0x43')]['id'];}return db[_0x12e0('0x27')][_0x12e0('0x41')]({'where':{'id':_0x546db6[_0x12e0('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ccada,null))[_0x12e0('0x20')](saveUpdates(_0x546db6[_0x12e0('0x43')],null))[_0x12e0('0x20')](respondWithResult(_0x2ccada,null))[_0x12e0('0x3e')](handleError(_0x2ccada,null));};exports['destroy']=function(_0xa308c6,_0x18998f){return db['ChatTransferReport'][_0x12e0('0x41')]({'where':{'id':_0xa308c6[_0x12e0('0x44')]['id']}})[_0x12e0('0x20')](handleEntityNotFound(_0x18998f,null))[_0x12e0('0x20')](removeEntity(_0x18998f,null))[_0x12e0('0x3e')](handleError(_0x18998f,null));};exports['describe']=function(_0x52f856,_0x43cf23){return db[_0x12e0('0x27')][_0x12e0('0x45')]()['then'](respondWithResult(_0x43cf23,null))['catch'](handleError(_0x43cf23,null));};
\ No newline at end of file
+var _0x9d8c=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','ChatTransferReport','findAll','rows','catch','show','includeAll','find','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5d8758,_0x20640f){var _0x5d0dff=function(_0x5e4623){while(--_0x5e4623){_0x5d8758['push'](_0x5d8758['shift']());}};_0x5d0dff(++_0x20640f);}(_0x9d8c,0x158));var _0xc9d8=function(_0x57d357,_0x113487){_0x57d357=_0x57d357-0x0;var _0x1be154=_0x9d8c[_0x57d357];return _0x1be154;};'use strict';var emlformat=require(_0xc9d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc9d8('0x1'));var jsonpatch=require(_0xc9d8('0x2'));var rp=require(_0xc9d8('0x3'));var moment=require(_0xc9d8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc9d8('0x5'));var util=require('util');var path=require(_0xc9d8('0x6'));var sox=require(_0xc9d8('0x7'));var csv=require(_0xc9d8('0x8'));var ejs=require(_0xc9d8('0x9'));var fs=require('fs');var fs_extra=require(_0xc9d8('0xa'));var _=require(_0xc9d8('0xb'));var squel=require('squel');var crypto=require(_0xc9d8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc9d8('0xd'));var toCsv=require(_0xc9d8('0x8'));var querystring=require('querystring');var Papa=require(_0xc9d8('0xe'));var Redis=require(_0xc9d8('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc9d8('0x10'))(_0xc9d8('0x11'));var utils=require(_0xc9d8('0x12'));var config=require(_0xc9d8('0x13'));var licenseUtil=require(_0xc9d8('0x14'));var db=require(_0xc9d8('0x15'))['db'];function respondWithStatusCode(_0x1c4ed0,_0x2f5ede){_0x2f5ede=_0x2f5ede||0xcc;return function(_0x7aea14){if(_0x7aea14){return _0x1c4ed0[_0xc9d8('0x16')](_0x2f5ede);}return _0x1c4ed0[_0xc9d8('0x17')](_0x2f5ede)['end']();};}function respondWithResult(_0x40f0a7,_0xa33e20){_0xa33e20=_0xa33e20||0xc8;return function(_0x4c36cd){if(_0x4c36cd){return _0x40f0a7[_0xc9d8('0x17')](_0xa33e20)[_0xc9d8('0x18')](_0x4c36cd);}};}function respondWithFilteredResult(_0x509a16,_0xaa2fc5){return function(_0x4478a0){if(_0x4478a0){var _0x7c0a20=typeof _0xaa2fc5[_0xc9d8('0x19')]===_0xc9d8('0x1a')&&typeof _0xaa2fc5[_0xc9d8('0x1b')]===_0xc9d8('0x1a');var _0x13dc7a=_0x4478a0[_0xc9d8('0x1c')];var _0x324a41=_0x7c0a20?0x0:_0xaa2fc5[_0xc9d8('0x19')];var _0x7fd180=_0x7c0a20?_0x4478a0['count']:_0xaa2fc5[_0xc9d8('0x19')]+_0xaa2fc5['limit'];var _0x4f4804;if(_0x7fd180>=_0x13dc7a){_0x7fd180=_0x13dc7a;_0x4f4804=0xc8;}else{_0x4f4804=0xce;}_0x509a16[_0xc9d8('0x17')](_0x4f4804);return _0x509a16['set'](_0xc9d8('0x1d'),_0x324a41+'-'+_0x7fd180+'/'+_0x13dc7a)[_0xc9d8('0x18')](_0x4478a0);}return null;};}function patchUpdates(_0x1b7ef2){return function(_0x496d40){try{jsonpatch[_0xc9d8('0x1e')](_0x496d40,_0x1b7ef2,!![]);}catch(_0x298d81){return BPromise[_0xc9d8('0x1f')](_0x298d81);}return _0x496d40[_0xc9d8('0x20')]();};}function saveUpdates(_0x448163,_0x12a811){return function(_0x5b6547){if(_0x5b6547){return _0x5b6547['update'](_0x448163)[_0xc9d8('0x21')](function(_0x22d407){return _0x22d407;});}return null;};}function removeEntity(_0xdfd03a,_0x527de9){return function(_0x5a426f){if(_0x5a426f){return _0x5a426f[_0xc9d8('0x22')]()[_0xc9d8('0x21')](function(){_0xdfd03a['status'](0xcc)[_0xc9d8('0x23')]();});}};}function handleEntityNotFound(_0x4eeeec,_0x328680){return function(_0x52b5cd){if(!_0x52b5cd){_0x4eeeec[_0xc9d8('0x16')](0x194);}return _0x52b5cd;};}function handleError(_0x1cded6,_0x58a17c){_0x58a17c=_0x58a17c||0x1f4;return function(_0x3cca61){logger[_0xc9d8('0x24')](_0x3cca61[_0xc9d8('0x25')]);if(_0x3cca61[_0xc9d8('0x26')]){delete _0x3cca61['name'];}_0x1cded6['status'](_0x58a17c)['send'](_0x3cca61);};}exports[_0xc9d8('0x27')]=function(_0x53762e,_0x105c54){var _0x2b7a20={},_0x5e6aca={},_0x5ceb17={'count':0x0,'rows':[]};var _0x386ecf=_[_0xc9d8('0x28')](db['ChatTransferReport'][_0xc9d8('0x29')],function(_0x58d943){return{'name':_0x58d943[_0xc9d8('0x2a')],'type':_0x58d943[_0xc9d8('0x2b')]['key']};});_0x5e6aca[_0xc9d8('0x2c')]=_[_0xc9d8('0x28')](_0x386ecf,_0xc9d8('0x26'));_0x5e6aca[_0xc9d8('0x2d')]=_[_0xc9d8('0x2e')](_0x53762e[_0xc9d8('0x2d')]);_0x5e6aca[_0xc9d8('0x2f')]=_[_0xc9d8('0x30')](_0x5e6aca[_0xc9d8('0x2c')],_0x5e6aca[_0xc9d8('0x2d')]);_0x2b7a20[_0xc9d8('0x31')]=_['intersection'](_0x5e6aca[_0xc9d8('0x2c')],qs[_0xc9d8('0x32')](_0x53762e['query'][_0xc9d8('0x32')]));_0x2b7a20[_0xc9d8('0x31')]=_0x2b7a20[_0xc9d8('0x31')]['length']?_0x2b7a20[_0xc9d8('0x31')]:_0x5e6aca['model'];if(!_0x53762e[_0xc9d8('0x2d')][_0xc9d8('0x33')](_0xc9d8('0x34'))){_0x2b7a20[_0xc9d8('0x1b')]=qs[_0xc9d8('0x1b')](_0x53762e[_0xc9d8('0x2d')][_0xc9d8('0x1b')]);_0x2b7a20['offset']=qs[_0xc9d8('0x19')](_0x53762e['query'][_0xc9d8('0x19')]);}_0x2b7a20[_0xc9d8('0x35')]=qs[_0xc9d8('0x36')](_0x53762e[_0xc9d8('0x2d')][_0xc9d8('0x36')]);_0x2b7a20[_0xc9d8('0x37')]=qs['filters'](_[_0xc9d8('0x38')](_0x53762e[_0xc9d8('0x2d')],_0x5e6aca['filters']),_0x386ecf);if(_0x53762e[_0xc9d8('0x2d')]['filter']){_0x2b7a20[_0xc9d8('0x37')]=_[_0xc9d8('0x39')](_0x2b7a20[_0xc9d8('0x37')],{'$or':_[_0xc9d8('0x28')](_0x386ecf,function(_0x5da883){if(_0x5da883['type']!=='VIRTUAL'){var _0x270956={};_0x270956[_0x5da883['name']]={'$like':'%'+_0x53762e[_0xc9d8('0x2d')][_0xc9d8('0x3a')]+'%'};return _0x270956;}})});}_0x2b7a20=_[_0xc9d8('0x39')]({},_0x2b7a20,_0x53762e[_0xc9d8('0x3b')]);var _0x392679={'where':_0x2b7a20[_0xc9d8('0x37')]};return db['ChatTransferReport'][_0xc9d8('0x1c')](_0x392679)['then'](function(_0x45f259){_0x5ceb17['count']=_0x45f259;if(_0x53762e['query']['includeAll']){_0x2b7a20[_0xc9d8('0x3c')]=[{'all':!![]}];}return db[_0xc9d8('0x3d')][_0xc9d8('0x3e')](_0x2b7a20);})[_0xc9d8('0x21')](function(_0x5b058d){_0x5ceb17[_0xc9d8('0x3f')]=_0x5b058d;return _0x5ceb17;})[_0xc9d8('0x21')](respondWithFilteredResult(_0x105c54,_0x2b7a20))[_0xc9d8('0x40')](handleError(_0x105c54,null));};exports[_0xc9d8('0x41')]=function(_0x4265c2,_0x1b35ab){var _0x5110b7={'raw':!![],'where':{'id':_0x4265c2['params']['id']}},_0xc7e52d={};_0xc7e52d[_0xc9d8('0x2c')]=_[_0xc9d8('0x2e')](db[_0xc9d8('0x3d')][_0xc9d8('0x29')]);_0xc7e52d['query']=_['keys'](_0x4265c2[_0xc9d8('0x2d')]);_0xc7e52d['filters']=_['intersection'](_0xc7e52d[_0xc9d8('0x2c')],_0xc7e52d[_0xc9d8('0x2d')]);_0x5110b7[_0xc9d8('0x31')]=_['intersection'](_0xc7e52d[_0xc9d8('0x2c')],qs[_0xc9d8('0x32')](_0x4265c2['query'][_0xc9d8('0x32')]));_0x5110b7['attributes']=_0x5110b7[_0xc9d8('0x31')]['length']?_0x5110b7[_0xc9d8('0x31')]:_0xc7e52d[_0xc9d8('0x2c')];if(_0x4265c2['query'][_0xc9d8('0x42')]){_0x5110b7[_0xc9d8('0x3c')]=[{'all':!![]}];}_0x5110b7=_[_0xc9d8('0x39')]({},_0x5110b7,_0x4265c2[_0xc9d8('0x3b')]);return db['ChatTransferReport'][_0xc9d8('0x43')](_0x5110b7)[_0xc9d8('0x21')](handleEntityNotFound(_0x1b35ab,null))['then'](respondWithResult(_0x1b35ab,null))[_0xc9d8('0x40')](handleError(_0x1b35ab,null));};exports[_0xc9d8('0x44')]=function(_0x93d472,_0xb4a80a){return db[_0xc9d8('0x3d')][_0xc9d8('0x44')](_0x93d472[_0xc9d8('0x45')],{})[_0xc9d8('0x21')](respondWithResult(_0xb4a80a,0xc9))['catch'](handleError(_0xb4a80a,null));};exports[_0xc9d8('0x46')]=function(_0x388aef,_0x45edab){if(_0x388aef[_0xc9d8('0x45')]['id']){delete _0x388aef[_0xc9d8('0x45')]['id'];}return db[_0xc9d8('0x3d')][_0xc9d8('0x43')]({'where':{'id':_0x388aef[_0xc9d8('0x47')]['id']}})[_0xc9d8('0x21')](handleEntityNotFound(_0x45edab,null))['then'](saveUpdates(_0x388aef[_0xc9d8('0x45')],null))[_0xc9d8('0x21')](respondWithResult(_0x45edab,null))[_0xc9d8('0x40')](handleError(_0x45edab,null));};exports[_0xc9d8('0x22')]=function(_0x4f2f87,_0x501e15){return db[_0xc9d8('0x3d')][_0xc9d8('0x43')]({'where':{'id':_0x4f2f87[_0xc9d8('0x47')]['id']}})[_0xc9d8('0x21')](handleEntityNotFound(_0x501e15,null))['then'](removeEntity(_0x501e15,null))[_0xc9d8('0x40')](handleError(_0x501e15,null));};exports['describe']=function(_0x215467,_0x4f2d2f){return db[_0xc9d8('0x3d')][_0xc9d8('0x48')]()['then'](respondWithResult(_0x4f2d2f,null))['catch'](handleError(_0x4f2d2f,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index c022916..faf811d 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 _0x8501=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_chat_transfer'];(function(_0x4416c0,_0x53b522){var _0x35546d=function(_0x7354eb){while(--_0x7354eb){_0x4416c0['push'](_0x4416c0['shift']());}};_0x35546d(++_0x53b522);}(_0x8501,0x139));var _0x1850=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x8501[_0x28611e];return _0x530f69;};'use strict';var _=require(_0x1850('0x0'));var util=require(_0x1850('0x1'));var logger=require(_0x1850('0x2'))('api');var moment=require(_0x1850('0x3'));var BPromise=require(_0x1850('0x4'));var rp=require(_0x1850('0x5'));var fs=require('fs');var path=require(_0x1850('0x6'));var rimraf=require(_0x1850('0x7'));var config=require(_0x1850('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0x1850('0x9')]=function(_0x2574e2,_0x146b49){return _0x2574e2[_0x1850('0xa')]('ChatTransferReport',attributes,{'tableName':_0x1850('0xb'),'paranoid':![],'indexes':[{'name':_0x1850('0xc'),'fields':[_0x1850('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb9f2=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','request-promise','path','rimraf','exports','define'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb9f2,0x12c));var _0x2b9f=function(_0x59c92c,_0x1a98c9){_0x59c92c=_0x59c92c-0x0;var _0x11fe84=_0xb9f2[_0x59c92c];return _0x11fe84;};'use strict';var _=require(_0x2b9f('0x0'));var util=require(_0x2b9f('0x1'));var logger=require(_0x2b9f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2b9f('0x3'));var fs=require('fs');var path=require(_0x2b9f('0x4'));var rimraf=require(_0x2b9f('0x5'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x2b9f('0x6')]=function(_0x1b4f36,_0x222d32){return _0x1b4f36[_0x2b9f('0x7')](_0x2b9f('0x8'),attributes,{'tableName':_0x2b9f('0x9'),'paranoid':![],'indexes':[{'name':_0x2b9f('0xa'),'fields':[_0x2b9f('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index f677d6d..bb87381 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 _0xc891=['client','http','request','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3d209a,_0x5441f4){var _0x23fe42=function(_0x39651e){while(--_0x39651e){_0x3d209a['push'](_0x3d209a['shift']());}};_0x23fe42(++_0x5441f4);}(_0xc891,0xc0));var _0x1c89=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xc891[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1c89('0x0'));var BPromise=require(_0x1c89('0x1'));var rs=require(_0x1c89('0x2'));var fs=require('fs');var Redis=require(_0x1c89('0x3'));var db=require(_0x1c89('0x4'))['db'];var utils=require(_0x1c89('0x5'));var logger=require('../../config/logger')(_0x1c89('0x6'));var config=require(_0x1c89('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1c89('0x8')][_0x1c89('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4918e4,_0x184d5c,_0x37303d){return new BPromise(function(_0x5d936d,_0x2e1833){return client[_0x1c89('0xa')](_0x4918e4,_0x37303d)['then'](function(_0x530f56){logger[_0x1c89('0xb')](_0x1c89('0xc'),_0x184d5c,'request\x20sent');logger['debug'](_0x1c89('0xd'),_0x184d5c,_0x1c89('0xe'),JSON[_0x1c89('0xf')](_0x530f56));if(_0x530f56[_0x1c89('0x10')]){if(_0x530f56['error']['code']===0x1f4){logger[_0x1c89('0x10')](_0x1c89('0xc'),_0x184d5c,_0x530f56['error'][_0x1c89('0x11')]);return _0x2e1833(_0x530f56[_0x1c89('0x10')][_0x1c89('0x11')]);}logger['error'](_0x1c89('0xc'),_0x184d5c,_0x530f56[_0x1c89('0x10')][_0x1c89('0x11')]);return _0x5d936d(_0x530f56[_0x1c89('0x10')][_0x1c89('0x11')]);}else{logger['info'](_0x1c89('0xc'),_0x184d5c,_0x1c89('0xe'));_0x5d936d(_0x530f56[_0x1c89('0x12')]['message']);}})[_0x1c89('0x13')](function(_0x14e683){logger[_0x1c89('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x184d5c,_0x14e683);_0x2e1833(_0x14e683);});});}
\ No newline at end of file
+var _0x47a3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x47a3,0x6c));var _0x347a=function(_0xa86d9f,_0x51eaf6){_0xa86d9f=_0xa86d9f-0x0;var _0x227717=_0x47a3[_0xa86d9f];return _0x227717;};'use strict';var _=require(_0x347a('0x0'));var util=require(_0x347a('0x1'));var moment=require(_0x347a('0x2'));var BPromise=require(_0x347a('0x3'));var rs=require(_0x347a('0x4'));var fs=require('fs');var Redis=require(_0x347a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x347a('0x6'));var logger=require(_0x347a('0x7'))(_0x347a('0x8'));var config=require(_0x347a('0x9'));var jayson=require(_0x347a('0xa'));var client=jayson[_0x347a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3de943,_0x106959,_0x3f9192){return new BPromise(function(_0x3d8a33,_0x1e09a7){return client['request'](_0x3de943,_0x3f9192)[_0x347a('0xc')](function(_0xd6a451){logger[_0x347a('0xd')](_0x347a('0xe'),_0x106959,_0x347a('0xf'));logger[_0x347a('0x10')](_0x347a('0x11'),_0x106959,_0x347a('0xf'),JSON[_0x347a('0x12')](_0xd6a451));if(_0xd6a451[_0x347a('0x13')]){if(_0xd6a451['error'][_0x347a('0x14')]===0x1f4){logger[_0x347a('0x13')](_0x347a('0xe'),_0x106959,_0xd6a451[_0x347a('0x13')][_0x347a('0x15')]);return _0x1e09a7(_0xd6a451[_0x347a('0x13')][_0x347a('0x15')]);}logger[_0x347a('0x13')](_0x347a('0xe'),_0x106959,_0xd6a451[_0x347a('0x13')]['message']);return _0x3d8a33(_0xd6a451[_0x347a('0x13')]['message']);}else{logger[_0x347a('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x106959,'request\x20sent');_0x3d8a33(_0xd6a451[_0x347a('0x16')][_0x347a('0x15')]);}})['catch'](function(_0x591ff1){logger['error'](_0x347a('0xe'),_0x106959,_0x591ff1);_0x1e09a7(_0x591ff1);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index b75440b..e081856 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 _0x7651=['/describe','show','create','put','/:id','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index'];(function(_0xbcc213,_0xefb217){var _0xf1a438=function(_0x3f8f04){while(--_0x3f8f04){_0xbcc213['push'](_0xbcc213['shift']());}};_0xf1a438(++_0xefb217);}(_0x7651,0x6c));var _0x1765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7651[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1765('0x0'));var util=require(_0x1765('0x1'));var path=require(_0x1765('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1765('0x3')]();var fs_extra=require(_0x1765('0x4'));var auth=require(_0x1765('0x5'));var interaction=require(_0x1765('0x6'));var config=require(_0x1765('0x7'));var controller=require(_0x1765('0x8'));router[_0x1765('0x9')]('/',auth[_0x1765('0xa')](),controller[_0x1765('0xb')]);router[_0x1765('0x9')](_0x1765('0xc'),auth[_0x1765('0xa')](),controller['describe']);router[_0x1765('0x9')]('/:id',auth[_0x1765('0xa')](),controller[_0x1765('0xd')]);router['post']('/',auth[_0x1765('0xa')](),controller[_0x1765('0xe')]);router[_0x1765('0xf')](_0x1765('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x1765('0x11')](_0x1765('0x10'),auth['isAuthenticated'](),controller[_0x1765('0x12')]);module[_0x1765('0x13')]=router;
\ No newline at end of file
+var _0x87d5=['describe','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x236bf4,_0x1322e9){var _0x40d0eb=function(_0x4387cd){while(--_0x4387cd){_0x236bf4['push'](_0x236bf4['shift']());}};_0x40d0eb(++_0x1322e9);}(_0x87d5,0x185));var _0x587d=function(_0x264841,_0x346e09){_0x264841=_0x264841-0x0;var _0xa9d6e3=_0x87d5[_0x264841];return _0xa9d6e3;};'use strict';var multer=require('multer');var util=require(_0x587d('0x0'));var path=require(_0x587d('0x1'));var timeout=require(_0x587d('0x2'));var express=require(_0x587d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x587d('0x4'));var interaction=require(_0x587d('0x5'));var config=require(_0x587d('0x6'));var controller=require(_0x587d('0x7'));router[_0x587d('0x8')]('/',auth[_0x587d('0x9')](),controller['index']);router[_0x587d('0x8')](_0x587d('0xa'),auth['isAuthenticated'](),controller[_0x587d('0xb')]);router[_0x587d('0x8')](_0x587d('0xc'),auth[_0x587d('0x9')](),controller[_0x587d('0xd')]);router['post']('/',auth[_0x587d('0x9')](),controller[_0x587d('0xe')]);router[_0x587d('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x587d('0x10')]);router[_0x587d('0x11')](_0x587d('0xc'),auth[_0x587d('0x9')](),controller[_0x587d('0x12')]);module[_0x587d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 1632285..fb6a19d 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 _0x55e0=['CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','name','text','input','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','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','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x4e5564,_0x8c8c66){var _0x5ed04b=function(_0x3b6e6b){while(--_0x3b6e6b){_0x4e5564['push'](_0x4e5564['shift']());}};_0x5ed04b(++_0x8c8c66);}(_0x55e0,0xdc));var _0x055e=function(_0x130d1f,_0x19dd78){_0x130d1f=_0x130d1f-0x0;var _0x577e83=_0x55e0[_0x130d1f];return _0x577e83;};'use strict';var Sequelize=require(_0x055e('0x0'));var rs=require(_0x055e('0x1'));module[_0x055e('0x2')]={'name':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x055e('0x3')]},'mapKey':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'mapKeyOffline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'key':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x055e('0x3')]},'animation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x055e('0x9')]('rounded','squared'),'defaultValue':_0x055e('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0xb')},'start_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xc')},'offline_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'header_offline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x055e('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x13')},'noteTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x14')},'placeholderMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x16')},'closingMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'skipMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x17')},'ratingType':{'type':Sequelize[_0x055e('0x9')](_0x055e('0x18'),_0x055e('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON[_0x055e('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x055e('0x1b'),'type':_0x055e('0x1c'),'required':!![]},'props':{'title':_0x055e('0x1b'),'helpText':''}},{'type':_0x055e('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x1f'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')](_0x055e('0x1f'))):{};},'set':function(_0x4c653c){return this['setDataValue'](_0x055e('0x1f'),JSON[_0x055e('0x1a')](_0x4c653c));}},'offlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x055e('0x1d'),'props':{'title':_0x055e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':_0x055e('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x055e('0x21')},'props':{'title':'Comments','helpText':_0x055e('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x23'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')]('offlineForm')):{};},'set':function(_0x99a372){return this[_0x055e('0x24')](_0x055e('0x23'),JSON[_0x055e('0x1a')](_0x99a372));}},'token':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return rs[_0x055e('0x25')]();}},'autoclose':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x055e('0x3')]},'forwardOffline':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x26')},'waitingMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x29')},'sendUnmanaged':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x055e('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x055e('0x3')]},'notificationTemplate':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return _0x055e('0x2a');}},'notificationSound':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2c')},'verticalAlignment':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2e')},'defaultTitle':{'type':Sequelize[_0x055e('0x3')]},'customerAvatar':{'type':Sequelize[_0x055e('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x30')},'systemAvatar':{'type':Sequelize[_0x055e('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x055e('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1012a4){if(!_0x1012a4)this[_0x055e('0x24')](_0x055e('0x32'),null);this['setDataValue'](_0x055e('0x33'),_0x1012a4);}},'vidaooEscalation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x34')},'vidaooNote':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x055e('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x055e('0x10')]}};
\ No newline at end of file
+var _0xa74f=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','address','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Feedback','star','TEXT','stringify','input','name','getDataValue','onlineForm','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.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0xa74f,0x9a));var _0xfa74=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0xa74f[_0x58c20f];return _0x3b0318;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xfa74('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfa74('0x1')},'description':{'type':Sequelize[_0xfa74('0x2')]},'mapKey':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x4')},'customerAlias':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfa74('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xfa74('0x9')]('rounded',_0xfa74('0xa')),'defaultValue':_0xfa74('0xb')},'header_online':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0xd')},'offline_chat_button':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xe')},'header_offline':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x12')},'noteTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xe')},'skipMessageButton':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x14')},'ratingType':{'type':Sequelize[_0xfa74('0x9')]('star','thumb'),'defaultValue':_0xfa74('0x15')},'ratingStarsNumber':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return JSON[_0xfa74('0x17')]({'items':[{'type':_0xfa74('0x18'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0xfa74('0x19'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xfa74('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xfa74('0x1a')](_0xfa74('0x1b'))?JSON['parse'](this['getDataValue'](_0xfa74('0x1b'))):{};},'set':function(_0xeb6c11){return this['setDataValue'](_0xfa74('0x1b'),JSON['stringify'](_0xeb6c11));}},'offlineForm':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return JSON[_0xfa74('0x17')]({'items':[{'type':'input','props':{'title':_0xfa74('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xfa74('0x3'),'type':_0xfa74('0x3')},'variable':null},{'type':_0xfa74('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':_0xfa74('0x1d'),'helpText':_0xfa74('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xfa74('0x1a')]('offlineForm')?JSON['parse'](this[_0xfa74('0x1a')](_0xfa74('0x1f'))):{};},'set':function(_0x5df5cd){return this['setDataValue'](_0xfa74('0x1f'),JSON['stringify'](_0x5df5cd));}},'token':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfa74('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfa74('0x2')]},'waitingTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x20')},'waitingMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x22')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x23')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x24')},'skipUnmanaged':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x25')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfa74('0x16')]},'showAgentAvatar':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return _0xfa74('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x27')},'verticalAlignment':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x28')},'messagesAlignment':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x29')},'defaultTitle':{'type':Sequelize[_0xfa74('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x2b')},'systemAvatar':{'type':Sequelize[_0xfa74('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfa74('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![],'comment':_0xfa74('0x2d'),'set':function(_0x35f252){if(!_0x35f252)this['setDataValue'](_0xfa74('0x2e'),null);this[_0xfa74('0x2f')](_0xfa74('0x30'),_0x35f252);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x31')},'vidaooNote':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':function(){return _0xfa74('0x32');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xfa74('0x16')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index b8454fc..0e5af9c 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 _0x56fa=['removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','ejs','fs-extra','lodash','ioredis','../../config/logger','api','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','client','http','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','then','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','ChatWebsite','rawAttributes','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','mandatoryDispositionPause','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','rows','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','Applications','account','applications','list','asc','contact','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','device','vendor','type','threadId','ChatInteraction','externalUrl','ContactId','interaction','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','MailAccount','findOrCreate','readFileSync','utf8','render','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','offline-chat','basename','openNewInteraction','transaction','bulkCreate','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','Chat','remove','addInteraction','omit','getInteractions','Owner','fullname','Tag','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','custom','increment','chatLicenseExceeded','Intervals','some','server/files/chat/iframe.ejs','address','remote','x-real-ip','connection','replace','alignment','verticalAlignment','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','sequelize','Transaction','ISOLATION_LEVELS','ChatApplication','priority','finally','getApplications','chatProactiveAction','addProactiveActions','getFields','online','false','offlineForm','onlineForm','fromKey','getOfflineMessages','Contact','Attachments','addAgents','spread','emit','userChatWebsite:save'];(function(_0x177846,_0x12b670){var _0x242022=function(_0x54a4b4){while(--_0x54a4b4){_0x177846['push'](_0x177846['shift']());}};_0x242022(++_0x12b670);}(_0x56fa,0x12c));var _0xa56f=function(_0x154f92,_0x169556){_0x154f92=_0x154f92-0x0;var _0x4c6cd6=_0x56fa[_0x154f92];return _0x4c6cd6;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xa56f('0x0'));var util=require('util');var path=require('path');var ejs=require(_0xa56f('0x1'));var fs=require('fs');var fs_extra=require(_0xa56f('0x2'));var _=require(_0xa56f('0x3'));var querystring=require('querystring');var Redis=require(_0xa56f('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0xa56f('0x5'))(_0xa56f('0x6'));var config=require('../../config/environment');var url=require(_0xa56f('0x7'));var db=require(_0xa56f('0x8'))['db'];config[_0xa56f('0x9')]=_[_0xa56f('0xa')](config['redis'],{'host':_0xa56f('0xb'),'port':0x18eb});var socket=require(_0xa56f('0xc'))(new Redis(config[_0xa56f('0x9')]));require(_0xa56f('0xd'))['register'](socket);var htmlToText=require(_0xa56f('0xe'));var jayson=require('jayson/promise');var client=jayson[_0xa56f('0xf')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0xa56f('0xf')][_0xa56f('0x10')]({'port':0x232b});var client9001=jayson[_0xa56f('0xf')][_0xa56f('0x10')]({'port':0x2329});function respondWithRpcPromise(_0xe10459,_0x1e4a6a,_0x4ecdf0,_0x468b3e){return new BPromise(function(_0x28555d,_0x2828fc){var _0x145daf=_0x468b3e||client;return _0x145daf['request'](_0xe10459,_0x4ecdf0)['then'](function(_0x178ec6){logger[_0xa56f('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x1e4a6a,_0xa56f('0x12'));logger[_0xa56f('0x13')](_0xa56f('0x14'),_0x1e4a6a,'request\x20sent',JSON[_0xa56f('0x15')](_0x178ec6));if(_0x178ec6['error']){if(_0x178ec6[_0xa56f('0x16')][_0xa56f('0x17')]===0x1f4){logger['error'](_0xa56f('0x18'),_0x1e4a6a,_0x178ec6[_0xa56f('0x16')][_0xa56f('0x19')]);return _0x2828fc(_0x178ec6[_0xa56f('0x16')]['message']);}logger[_0xa56f('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1e4a6a,_0x178ec6[_0xa56f('0x16')][_0xa56f('0x19')]);return _0x28555d(_0x178ec6['error']['message']);}else{logger[_0xa56f('0x11')](_0xa56f('0x18'),_0x1e4a6a,_0xa56f('0x12'));_0x28555d(_0x178ec6[_0xa56f('0x1a')]['message']);}})['catch'](function(_0x28db2a){logger['error'](_0xa56f('0x18'),_0x1e4a6a,_0x28db2a);_0x2828fc(_0x28db2a);});});}function respondWithStatusCode(_0x26d447,_0xfb9039){_0xfb9039=_0xfb9039||0xcc;return function(_0x4fb7cc){if(_0x4fb7cc){return _0x26d447[_0xa56f('0x1b')](_0xfb9039);}return _0x26d447[_0xa56f('0x1c')](_0xfb9039)[_0xa56f('0x1d')]();};}function respondWithResult(_0x1bf989,_0x3cba93){_0x3cba93=_0x3cba93||0xc8;return function(_0x5596ad){if(_0x5596ad){return _0x1bf989[_0xa56f('0x1c')](_0x3cba93)[_0xa56f('0x1e')](_0x5596ad);}};}function respondWithFilteredResult(_0x4c319b,_0x1c7043){return function(_0x516c33){if(_0x516c33){var _0x6681c3=typeof _0x1c7043[_0xa56f('0x1f')]===_0xa56f('0x20')&&typeof _0x1c7043['limit']===_0xa56f('0x20');var _0x3ead12=_0x516c33[_0xa56f('0x21')];var _0x446742=_0x6681c3?0x0:_0x1c7043['offset'];var _0xed74f1=_0x6681c3?_0x516c33[_0xa56f('0x21')]:_0x1c7043[_0xa56f('0x1f')]+_0x1c7043[_0xa56f('0x22')];var _0xf02475;if(_0xed74f1>=_0x3ead12){_0xed74f1=_0x3ead12;_0xf02475=0xc8;}else{_0xf02475=0xce;}_0x4c319b['status'](_0xf02475);return _0x4c319b[_0xa56f('0x23')](_0xa56f('0x24'),_0x446742+'-'+_0xed74f1+'/'+_0x3ead12)[_0xa56f('0x1e')](_0x516c33);}return null;};}function saveUpdates(_0xc3f8e2){return function(_0x261fbb){if(_0x261fbb){return _0x261fbb[_0xa56f('0x25')](_0xc3f8e2)['then'](function(_0x265cd2){return _0x265cd2;});}return null;};}function removeEntity(_0x36d83b){return function(_0x2da3b1){if(_0x2da3b1){return _0x2da3b1[_0xa56f('0x26')]()[_0xa56f('0x27')](function(){var _0x4ef7a5=_0x2da3b1[_0xa56f('0x28')]({'plain':!![]});var _0x3154bf=_0xa56f('0x29');return db[_0xa56f('0x2a')][_0xa56f('0x26')]({'where':{'type':_0x3154bf,'resourceId':_0x4ef7a5['id']}})[_0xa56f('0x27')](function(){return _0x2da3b1;});})[_0xa56f('0x27')](function(){_0x36d83b[_0xa56f('0x1c')](0xcc)[_0xa56f('0x1d')]();});}};}function handleEntityNotFound(_0x1efe36){return function(_0x404822){if(!_0x404822){_0x1efe36[_0xa56f('0x1b')](0x194);}return _0x404822;};}function handleError(_0x25b064,_0x58ca30){_0x58ca30=_0x58ca30||0x1f4;return function(_0x255e48){logger[_0xa56f('0x16')](_0x255e48[_0xa56f('0x2b')]);if(_0x255e48[_0xa56f('0x2c')]){delete _0x255e48['name'];}_0x25b064['status'](_0x58ca30)[_0xa56f('0x2d')](_0x255e48);};}exports[_0xa56f('0x2e')]=function(_0x49e84e,_0x1f7490){var _0x33957e={'include':[{'model':db[_0xa56f('0x2f')],'as':'mandatoryDispositionPause'}]},_0x1ecb41={},_0x2d185b={'count':0x0,'rows':[]};var _0x1ae361=_['map'](db[_0xa56f('0x30')][_0xa56f('0x31')],function(_0x4065b6){return{'name':_0x4065b6['fieldName'],'type':_0x4065b6['type'][_0xa56f('0x32')]};});_0x1ecb41[_0xa56f('0x33')]=_[_0xa56f('0x34')](_0x1ae361,_0xa56f('0x2c'));_0x1ecb41[_0xa56f('0x35')]=_[_0xa56f('0x36')](_0x49e84e[_0xa56f('0x35')]);_0x1ecb41['filters']=_[_0xa56f('0x37')](_0x1ecb41[_0xa56f('0x33')],_0x1ecb41['query']);_0x33957e[_0xa56f('0x38')]=_[_0xa56f('0x37')](_0x1ecb41['model'],qs['fields'](_0x49e84e[_0xa56f('0x35')][_0xa56f('0x39')]));_0x33957e[_0xa56f('0x38')]=_0x33957e['attributes'][_0xa56f('0x3a')]?_0x33957e['attributes']:_0x1ecb41[_0xa56f('0x33')];if(!_0x49e84e[_0xa56f('0x35')][_0xa56f('0x3b')](_0xa56f('0x3c'))){_0x33957e[_0xa56f('0x22')]=qs['limit'](_0x49e84e[_0xa56f('0x35')][_0xa56f('0x22')]);_0x33957e['offset']=qs['offset'](_0x49e84e[_0xa56f('0x35')]['offset']);}_0x33957e[_0xa56f('0x3d')]=qs[_0xa56f('0x3e')](_0x49e84e[_0xa56f('0x35')][_0xa56f('0x3e')]);_0x33957e[_0xa56f('0x3f')]=qs[_0xa56f('0x40')](_[_0xa56f('0x41')](_0x49e84e[_0xa56f('0x35')],_0x1ecb41[_0xa56f('0x40')]),_0x1ae361);if(_0x49e84e[_0xa56f('0x35')][_0xa56f('0x42')]){_0x33957e[_0xa56f('0x3f')]=_['merge'](_0x33957e['where'],{'$or':_[_0xa56f('0x34')](_0x1ae361,function(_0xaa635f){if(_0xaa635f['type']!==_0xa56f('0x43')){var _0x369d9d={};_0x369d9d[_0xaa635f[_0xa56f('0x2c')]]={'$like':'%'+_0x49e84e['query'][_0xa56f('0x42')]+'%'};return _0x369d9d;}})});}_0x33957e=_[_0xa56f('0x44')]({},_0x33957e,_0x49e84e[_0xa56f('0x45')]);var _0x315545={'where':_0x33957e['where']};return db[_0xa56f('0x30')][_0xa56f('0x21')](_0x315545)[_0xa56f('0x27')](function(_0x2f3a44){_0x2d185b['count']=_0x2f3a44;if(_0x49e84e[_0xa56f('0x35')][_0xa56f('0x46')]){_0x33957e[_0xa56f('0x47')]=[{'all':!![]}];}return db[_0xa56f('0x30')][_0xa56f('0x48')](_0x33957e);})[_0xa56f('0x27')](function(_0x692ed1){_0x2d185b['rows']=_0x692ed1;return _0x2d185b;})[_0xa56f('0x27')](respondWithFilteredResult(_0x1f7490,_0x33957e))['catch'](handleError(_0x1f7490,null));};exports[_0xa56f('0x49')]=function(_0xae9670,_0xa1d4f7){var _0x2e0594={'raw':![],'where':{'id':_0xae9670[_0xa56f('0x4a')]['id']},'include':[{'model':db[_0xa56f('0x2f')],'as':_0xa56f('0x4b')}]},_0x5a6881={};_0x5a6881[_0xa56f('0x33')]=_[_0xa56f('0x36')](db[_0xa56f('0x30')][_0xa56f('0x31')]);_0x5a6881[_0xa56f('0x35')]=_['keys'](_0xae9670[_0xa56f('0x35')]);_0x5a6881['filters']=_[_0xa56f('0x37')](_0x5a6881[_0xa56f('0x33')],_0x5a6881[_0xa56f('0x35')]);_0x2e0594[_0xa56f('0x38')]=_[_0xa56f('0x37')](_0x5a6881[_0xa56f('0x33')],qs[_0xa56f('0x39')](_0xae9670[_0xa56f('0x35')][_0xa56f('0x39')]));_0x2e0594[_0xa56f('0x38')]=_0x2e0594[_0xa56f('0x38')][_0xa56f('0x3a')]?_0x2e0594[_0xa56f('0x38')]:_0x5a6881[_0xa56f('0x33')];if(_0xae9670['query'][_0xa56f('0x46')]){_0x2e0594[_0xa56f('0x47')]=[{'all':!![]}];}_0x2e0594=_[_0xa56f('0x44')]({},_0x2e0594,_0xae9670[_0xa56f('0x45')]);return db[_0xa56f('0x30')]['find'](_0x2e0594)['then'](handleEntityNotFound(_0xa1d4f7,null))[_0xa56f('0x27')](respondWithResult(_0xa1d4f7,null))[_0xa56f('0x4c')](handleError(_0xa1d4f7,null));};exports[_0xa56f('0x4d')]=function(_0x588754,_0x30943e){return db[_0xa56f('0x30')][_0xa56f('0x4d')](_0x588754[_0xa56f('0x4e')],{})['then'](function(_0x1e2d9c){var _0x17cc44=_0x588754[_0xa56f('0x4f')]['get']({'plain':!![]});if(!_0x17cc44)throw new Error(_0xa56f('0x50'));if(_0x17cc44['role']==='user'){var _0x7c7fef=_0x1e2d9c[_0xa56f('0x28')]({'plain':!![]});var _0x49603c=_0xa56f('0x29');return db[_0xa56f('0x51')][_0xa56f('0x52')]({'where':{'name':_0x49603c,'userProfileId':_0x17cc44[_0xa56f('0x53')]},'raw':!![]})['then'](function(_0x3fc2ae){if(_0x3fc2ae&&_0x3fc2ae['autoAssociation']===0x0){return db[_0xa56f('0x2a')]['create']({'name':_0x7c7fef[_0xa56f('0x2c')],'resourceId':_0x7c7fef['id'],'type':_0x3fc2ae[_0xa56f('0x2c')],'sectionId':_0x3fc2ae['id']},{})['then'](function(){return _0x1e2d9c;});}else{return _0x1e2d9c;}})[_0xa56f('0x4c')](function(_0x43542e){logger['error'](_0xa56f('0x54'),_0x43542e);throw _0x43542e;});}return _0x1e2d9c;})[_0xa56f('0x27')](respondWithResult(_0x30943e,0xc9))[_0xa56f('0x4c')](handleError(_0x30943e,null));};exports['update']=function(_0xdc840c,_0x33c9e4){if(_0xdc840c[_0xa56f('0x4e')]['id']){delete _0xdc840c['body']['id'];}return db[_0xa56f('0x30')][_0xa56f('0x52')]({'where':{'id':_0xdc840c['params']['id']},'include':[{'model':db[_0xa56f('0x2f')],'as':_0xa56f('0x4b')}]})[_0xa56f('0x27')](handleEntityNotFound(_0x33c9e4,null))[_0xa56f('0x27')](saveUpdates(_0xdc840c['body'],null))['then'](respondWithResult(_0x33c9e4,null))[_0xa56f('0x4c')](handleError(_0x33c9e4,null));};exports[_0xa56f('0x26')]=function(_0x34c359,_0x234d3b){return db[_0xa56f('0x30')]['find']({'where':{'id':_0x34c359[_0xa56f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x234d3b,null))[_0xa56f('0x27')](removeEntity(_0x234d3b,null))[_0xa56f('0x4c')](handleError(_0x234d3b,null));};exports[_0xa56f('0x55')]=function(_0x12723c,_0x4fa285){return db['ChatWebsite'][_0xa56f('0x55')]()[_0xa56f('0x27')](respondWithResult(_0x4fa285,null))[_0xa56f('0x4c')](handleError(_0x4fa285,null));};exports[_0xa56f('0x56')]=function(_0x4c8d05,_0x4dce6d){if(_0x4c8d05[_0xa56f('0x4e')]['id']){delete _0x4c8d05[_0xa56f('0x4e')]['id'];}return db[_0xa56f('0x30')][_0xa56f('0x52')]({'where':{'id':_0x4c8d05[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x4dce6d,null))[_0xa56f('0x27')](function(_0x4f2c41){if(_0x4f2c41){_0x4c8d05[_0xa56f('0x4e')][_0xa56f('0x57')]=_0x4f2c41['id'];return db[_0xa56f('0x58')][_0xa56f('0x4d')](_0x4c8d05[_0xa56f('0x4e')]);}})[_0xa56f('0x27')](respondWithResult(_0x4dce6d,null))[_0xa56f('0x4c')](handleError(_0x4dce6d,null));};exports[_0xa56f('0x59')]=function(_0x48a074,_0x5ddcb6){var _0x5647c0={'raw':![],'where':{}};var _0x37dd69={};var _0x34b2a2={'count':0x0,'rows':[]};return db[_0xa56f('0x30')]['findOne']({'where':{'id':_0x48a074[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x5ddcb6,null))['then'](function(_0x4cc990){if(_0x4cc990){_0x37dd69['model']=_['keys'](db[_0xa56f('0x58')][_0xa56f('0x31')]);_0x37dd69['query']=_[_0xa56f('0x36')](_0x48a074[_0xa56f('0x35')]);_0x37dd69[_0xa56f('0x40')]=_['intersection'](_0x37dd69[_0xa56f('0x33')],_0x37dd69[_0xa56f('0x35')]);_0x5647c0[_0xa56f('0x38')]=_[_0xa56f('0x37')](_0x37dd69[_0xa56f('0x33')],qs[_0xa56f('0x39')](_0x48a074[_0xa56f('0x35')][_0xa56f('0x39')]));_0x5647c0['attributes']=_0x5647c0['attributes'][_0xa56f('0x3a')]?_0x5647c0[_0xa56f('0x38')]:_0x37dd69[_0xa56f('0x33')];if(!_0x48a074['query'][_0xa56f('0x3b')](_0xa56f('0x3c'))){_0x5647c0[_0xa56f('0x22')]=qs[_0xa56f('0x22')](_0x48a074[_0xa56f('0x35')][_0xa56f('0x22')]);_0x5647c0[_0xa56f('0x1f')]=qs[_0xa56f('0x1f')](_0x48a074[_0xa56f('0x35')][_0xa56f('0x1f')]);}_0x5647c0[_0xa56f('0x3d')]=qs[_0xa56f('0x3e')](_0x48a074['query'][_0xa56f('0x3e')]);_0x5647c0[_0xa56f('0x3f')]=qs['filters'](_['pick'](_0x48a074[_0xa56f('0x35')],_0x37dd69[_0xa56f('0x40')]));_0x5647c0[_0xa56f('0x3f')]['ChatWebsiteId']=_0x4cc990['id'];if(_0x48a074['query'][_0xa56f('0x42')]){_0x5647c0[_0xa56f('0x3f')]=_['merge'](_0x5647c0[_0xa56f('0x3f')],{'$or':_[_0xa56f('0x34')](_0x5647c0[_0xa56f('0x38')],function(_0x59330c){var _0xeed3f={};_0xeed3f[_0x59330c]={'$like':'%'+_0x48a074['query'][_0xa56f('0x42')]+'%'};return _0xeed3f;})});}_0x5647c0=_[_0xa56f('0x44')]({},_0x5647c0,_0x48a074[_0xa56f('0x45')]);return db[_0xa56f('0x58')][_0xa56f('0x21')]({'where':_0x5647c0[_0xa56f('0x3f')]})['then'](function(_0x3a89e3){_0x34b2a2[_0xa56f('0x21')]=_0x3a89e3;if(_0x48a074[_0xa56f('0x35')][_0xa56f('0x46')]){_0x5647c0['include']=[{'all':!![]}];}return db[_0xa56f('0x58')][_0xa56f('0x48')](_0x5647c0);})[_0xa56f('0x27')](function(_0x1404d1){_0x34b2a2['rows']=_0x1404d1;return _0x34b2a2;});}})['then'](respondWithFilteredResult(_0x5ddcb6,_0x5647c0))[_0xa56f('0x4c')](handleError(_0x5ddcb6,null));};exports[_0xa56f('0x5a')]=function(_0x55ee68,_0x358aa5){return db[_0xa56f('0x30')]['find']({'where':{'id':_0x55ee68[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x358aa5,null))[_0xa56f('0x27')](function(_0x5343ef){if(_0x5343ef){return _0x5343ef[_0xa56f('0x5a')](_0x55ee68[_0xa56f('0x35')][_0xa56f('0x5b')]);}})['then'](respondWithStatusCode(_0x358aa5,null))[_0xa56f('0x4c')](handleError(_0x358aa5,null));};exports[_0xa56f('0x5c')]=function(_0x46ef1a,_0x1ba03e){if(_0x46ef1a[_0xa56f('0x4e')]['id']){delete _0x46ef1a[_0xa56f('0x4e')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x46ef1a[_0xa56f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1ba03e,null))[_0xa56f('0x27')](function(_0x27fed8){if(_0x27fed8){_0x46ef1a[_0xa56f('0x4e')][_0xa56f('0x57')]=_0x27fed8['id'];return db[_0xa56f('0x5d')][_0xa56f('0x4d')](_0x46ef1a[_0xa56f('0x4e')]);}})[_0xa56f('0x27')](respondWithResult(_0x1ba03e,null))['catch'](handleError(_0x1ba03e,null));};exports[_0xa56f('0x5e')]=function(_0x270c11,_0x508b05){var _0x57362d={'raw':![],'where':{}};var _0x5b9072={};var _0xa9872d={'count':0x0,'rows':[]};return db[_0xa56f('0x30')][_0xa56f('0x5f')]({'where':{'id':_0x270c11[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x508b05,null))['then'](function(_0x273c66){if(_0x273c66){_0x5b9072[_0xa56f('0x33')]=_[_0xa56f('0x36')](db['CannedAnswer']['rawAttributes']);_0x5b9072['query']=_[_0xa56f('0x36')](_0x270c11[_0xa56f('0x35')]);_0x5b9072[_0xa56f('0x40')]=_[_0xa56f('0x37')](_0x5b9072[_0xa56f('0x33')],_0x5b9072[_0xa56f('0x35')]);_0x57362d['attributes']=_[_0xa56f('0x37')](_0x5b9072['model'],qs[_0xa56f('0x39')](_0x270c11[_0xa56f('0x35')][_0xa56f('0x39')]));_0x57362d['attributes']=_0x57362d[_0xa56f('0x38')]['length']?_0x57362d[_0xa56f('0x38')]:_0x5b9072[_0xa56f('0x33')];if(!_0x270c11[_0xa56f('0x35')][_0xa56f('0x3b')](_0xa56f('0x3c'))){_0x57362d[_0xa56f('0x22')]=qs[_0xa56f('0x22')](_0x270c11[_0xa56f('0x35')]['limit']);_0x57362d[_0xa56f('0x1f')]=qs[_0xa56f('0x1f')](_0x270c11[_0xa56f('0x35')][_0xa56f('0x1f')]);}_0x57362d[_0xa56f('0x3d')]=qs[_0xa56f('0x3e')](_0x270c11['query'][_0xa56f('0x3e')]);_0x57362d[_0xa56f('0x3f')]=qs[_0xa56f('0x40')](_['pick'](_0x270c11[_0xa56f('0x35')],_0x5b9072[_0xa56f('0x40')]));_0x57362d['where']['ChatWebsiteId']=_0x273c66['id'];if(_0x270c11[_0xa56f('0x35')][_0xa56f('0x42')]){_0x57362d[_0xa56f('0x3f')]=_['merge'](_0x57362d[_0xa56f('0x3f')],{'$or':_[_0xa56f('0x34')](_0x57362d['attributes'],function(_0x2f164d){var _0x2c826e={};_0x2c826e[_0x2f164d]={'$like':'%'+_0x270c11[_0xa56f('0x35')]['filter']+'%'};return _0x2c826e;})});}_0x57362d=_[_0xa56f('0x44')]({},_0x57362d,_0x270c11['options']);return db[_0xa56f('0x5d')]['count']({'where':_0x57362d['where']})['then'](function(_0x2411a5){_0xa9872d[_0xa56f('0x21')]=_0x2411a5;if(_0x270c11['query']['includeAll']){_0x57362d[_0xa56f('0x47')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa56f('0x48')](_0x57362d);})[_0xa56f('0x27')](function(_0x1e7027){_0xa9872d[_0xa56f('0x60')]=_0x1e7027;return _0xa9872d;});}})[_0xa56f('0x27')](respondWithFilteredResult(_0x508b05,_0x57362d))['catch'](handleError(_0x508b05,null));};exports[_0xa56f('0x61')]=function(_0x59df31,_0x500b2f){return db[_0xa56f('0x30')][_0xa56f('0x52')]({'where':{'id':_0x59df31[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x500b2f,null))[_0xa56f('0x27')](function(_0x44618d){if(_0x44618d){return _0x44618d['removeAnswers'](_0x59df31['query']['ids']);}})[_0xa56f('0x27')](respondWithStatusCode(_0x500b2f,null))[_0xa56f('0x4c')](handleError(_0x500b2f,null));};exports[_0xa56f('0x62')]=function(_0x505fb8,_0x96da69){_0x505fb8[_0xa56f('0x4e')][_0xa56f('0x63')]=_0x505fb8[_0xa56f('0x64')][_0xa56f('0x65')];return db[_0xa56f('0x30')]['find']({'where':{'id':_0x505fb8[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x96da69,null))[_0xa56f('0x27')](saveUpdates(_0x505fb8['body'],null))[_0xa56f('0x27')](respondWithResult(_0x96da69,null))[_0xa56f('0x4c')](handleError(_0x96da69,null));};exports[_0xa56f('0x66')]=function(_0x420f73,_0x1d484d){_0x420f73[_0xa56f('0x4e')][_0xa56f('0x67')]=_0x420f73['file'][_0xa56f('0x65')];return db[_0xa56f('0x30')]['find']({'where':{'id':_0x420f73[_0xa56f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1d484d,null))[_0xa56f('0x27')](saveUpdates(_0x420f73[_0xa56f('0x4e')],null))['then'](respondWithResult(_0x1d484d,null))['catch'](handleError(_0x1d484d,null));};exports['addCustomerAvatar']=function(_0x1f35db,_0x104a75){_0x1f35db[_0xa56f('0x4e')][_0xa56f('0x68')]=_0x1f35db[_0xa56f('0x64')][_0xa56f('0x65')];return db[_0xa56f('0x30')]['find']({'where':{'id':_0x1f35db[_0xa56f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x104a75,null))['then'](saveUpdates(_0x1f35db['body'],null))[_0xa56f('0x27')](respondWithResult(_0x104a75,null))[_0xa56f('0x4c')](handleError(_0x104a75,null));};exports[_0xa56f('0x69')]=function(_0x481453,_0x3c31d6){_0x481453[_0xa56f('0x4e')][_0xa56f('0x6a')]=_0x481453['file'][_0xa56f('0x65')];return db[_0xa56f('0x30')][_0xa56f('0x52')]({'where':{'id':_0x481453[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x3c31d6,null))[_0xa56f('0x27')](saveUpdates(_0x481453[_0xa56f('0x4e')],null))[_0xa56f('0x27')](respondWithResult(_0x3c31d6,null))['catch'](handleError(_0x3c31d6,null));};exports[_0xa56f('0x6b')]=function(_0x2792f9,_0x3dbf82){var _0x1974f1=path[_0xa56f('0x6c')](config[_0xa56f('0x6d')],_0xa56f('0x6e'));var _0x531468={'where':{'id':_0x2792f9[_0xa56f('0x4a')]['id']},'attributes':['id',_0xa56f('0x63')],'raw':!![]};var _0x36215c=![];return require(_0xa56f('0x6f'))[_0xa56f('0x70')]()[_0xa56f('0x27')](function(_0x426e53){if(_0x426e53){_0x36215c=_0x426e53['custom'];}})[_0xa56f('0x27')](function(){return db[_0xa56f('0x30')]['find'](_0x531468);})['then'](handleEntityNotFound(_0x3dbf82,null))[_0xa56f('0x27')](function(_0x944838){if(_0x944838){if(!_['isNil'](_0x944838[_0xa56f('0x63')])){if(fs[_0xa56f('0x71')](path['join'](config[_0xa56f('0x6d')],_0xa56f('0x72'),_0x944838[_0xa56f('0x63')]))&&_0x36215c){_0x1974f1=path[_0xa56f('0x6c')](config[_0xa56f('0x6d')],'server/files/images/logos/',_0x944838[_0xa56f('0x63')]);}}return _0x3dbf82[_0xa56f('0x73')](_0x1974f1);}})[_0xa56f('0x4c')](handleError(_0x3dbf82,null));};exports[_0xa56f('0x74')]=function(_0x283b3a,_0x516689){var _0x937b09=path[_0xa56f('0x6c')](config[_0xa56f('0x6d')],_0xa56f('0x75'));var _0x2a122b={'where':{'id':_0x283b3a['params']['id']},'attributes':['id',_0xa56f('0x67')],'raw':!![]};return db[_0xa56f('0x30')][_0xa56f('0x52')](_0x2a122b)[_0xa56f('0x27')](handleEntityNotFound(_0x516689,null))[_0xa56f('0x27')](function(_0x4e00d4){if(_0x4e00d4){if(!_[_0xa56f('0x76')](_0x4e00d4[_0xa56f('0x67')])){if(fs['existsSync'](path[_0xa56f('0x6c')](config[_0xa56f('0x6d')],_0xa56f('0x77'),_0x4e00d4[_0xa56f('0x67')]))){_0x937b09=path[_0xa56f('0x6c')](config[_0xa56f('0x6d')],'server/files/images/avatars/',_0x4e00d4[_0xa56f('0x67')]);}}return _0x516689[_0xa56f('0x73')](_0x937b09);}})[_0xa56f('0x4c')](handleError(_0x516689,null));};exports[_0xa56f('0x78')]=function(_0xb0699f,_0x2cb7b5){var _0x360a12=path[_0xa56f('0x6c')](config['root'],_0xa56f('0x79'));var _0x1ebfd6={'where':{'id':_0xb0699f['params']['id']},'attributes':['id',_0xa56f('0x68'),_0xa56f('0x7a')],'raw':!![]};return db['ChatWebsite']['find'](_0x1ebfd6)[_0xa56f('0x27')](handleEntityNotFound(_0x2cb7b5,null))['then'](function(_0x5ad89b){if(_0x5ad89b){if(!_['isNil'](_0x5ad89b[_0xa56f('0x68')])){if(fs[_0xa56f('0x71')](path['join'](config['root'],_0xa56f('0x77'),_0x5ad89b[_0xa56f('0x68')]))&&_0x5ad89b['showCustomerAvatar']){_0x360a12=path[_0xa56f('0x6c')](config[_0xa56f('0x6d')],_0xa56f('0x77'),_0x5ad89b[_0xa56f('0x68')]);}}return _0x2cb7b5[_0xa56f('0x73')](_0x360a12);}})[_0xa56f('0x4c')](handleError(_0x2cb7b5,null));};exports[_0xa56f('0x7b')]=function(_0x4f896f,_0x58dccb){var _0x18d3ae=path['join'](config[_0xa56f('0x6d')],_0xa56f('0x7c'));var _0x21056e={'where':{'id':_0x4f896f[_0xa56f('0x4a')]['id']},'attributes':['id',_0xa56f('0x6a')],'raw':!![]};return db['ChatWebsite']['find'](_0x21056e)[_0xa56f('0x27')](handleEntityNotFound(_0x58dccb,null))[_0xa56f('0x27')](function(_0x31b230){if(_0x31b230){if(!_['isNil'](_0x31b230[_0xa56f('0x6a')])){if(fs['existsSync'](path[_0xa56f('0x6c')](config[_0xa56f('0x6d')],'server/files/images/avatars/',_0x31b230[_0xa56f('0x6a')]))){_0x18d3ae=path['join'](config[_0xa56f('0x6d')],_0xa56f('0x77'),_0x31b230['systemAvatar']);}}return _0x58dccb[_0xa56f('0x73')](_0x18d3ae);}})[_0xa56f('0x4c')](handleError(_0x58dccb,null));};exports[_0xa56f('0x7d')]=function(_0x502609,_0x543cd9){var _0x5db351=require(_0xa56f('0x7e'));var _0x57103d=new _0x5db351();var _0x2b2fdd=_0x57103d[_0xa56f('0x7f')](_0x502609['headers'][_0xa56f('0x80')])[_0xa56f('0x81')]();var _0x180a8f={'body':_0x502609[_0xa56f('0x4e')],'channel':_0xa56f('0x82')};var _0x235ed1=[];var _0x1e0a7=[];var _0x5e4efd={};var _0x5068ca=![];return db['CmContact'][_0xa56f('0x55')]()[_0xa56f('0x27')](function(_0x2dcf08){if(!_0x2dcf08){throw new db[(_0xa56f('0x83'))][(_0xa56f('0x84'))](_0xa56f('0x85'));}_0x235ed1=_[_0xa56f('0x86')](_[_0xa56f('0x36')](_0x2dcf08),['createdAt',_0xa56f('0x87')]);_0x1e0a7=_[_0xa56f('0x86')](_[_0xa56f('0x36')](_0x2dcf08),[_0xa56f('0x88'),_0xa56f('0x87'),_0xa56f('0x89'),_0xa56f('0x8a')]);if(_0x502609[_0xa56f('0x4e')]['id']){delete _0x502609['body']['id'];}if(_[_0xa56f('0x76')](_0x502609[_0xa56f('0x4e')][_0xa56f('0x8b')])){throw new db['Sequelize']['ValidationError'](_0xa56f('0x8c'));}if(_[_0xa56f('0x76')](_0x502609[_0xa56f('0x4e')][_0xa56f('0x4e')])||_0x502609[_0xa56f('0x4e')][_0xa56f('0x4e')]===''){throw new db[(_0xa56f('0x83'))][(_0xa56f('0x84'))](_0xa56f('0x8d'));}if(_[_0xa56f('0x76')](_0x502609[_0xa56f('0x4e')][_0xa56f('0x8e')])){throw new db[(_0xa56f('0x83'))]['ValidationError'](_0xa56f('0x8f')+_0x1e0a7);}if(!_['includes'](_0x1e0a7,_0x502609['body'][_0xa56f('0x8e')])){throw new db[(_0xa56f('0x83'))][(_0xa56f('0x84'))](_0xa56f('0x90')+_0x1e0a7);}_0x5e4efd[_0x502609['body'][_0xa56f('0x8e')]]=_0x502609['body'][_0xa56f('0x8b')];})['then'](function(){return db[_0xa56f('0x30')][_0xa56f('0x52')]({'where':{'id':_0x502609[_0xa56f('0x4a')]['id']},'include':[{'model':db[_0xa56f('0x91')],'as':_0xa56f('0x92'),'include':[{'model':db[_0xa56f('0x93')],'as':_0xa56f('0x94'),'where':_0x5e4efd,'limit':0x1,'order':[[_0xa56f('0x87'),_0xa56f('0x95')]]}]},{'model':db['ChatApplication'],'as':_0xa56f('0x96')}]});})[_0xa56f('0x27')](handleEntityNotFound(_0x543cd9,null))['then'](function(_0x11e7b2){if(_0x11e7b2&&_0x11e7b2[_0xa56f('0x92')]){_0x180a8f[_0xa56f('0x97')]=_0x11e7b2;_0x180a8f[_0xa56f('0x98')]=_0x11e7b2[_0xa56f('0x96')];_0x180a8f[_0xa56f('0x99')]=_0x11e7b2[_0xa56f('0x92')];_0x180a8f[_0xa56f('0x98')]=_['orderBy'](_0x180a8f['applications'],['priority'],[_0xa56f('0x9a')]);if(_0x180a8f['account'][_0xa56f('0x96')]){delete _0x180a8f[_0xa56f('0x97')][_0xa56f('0x96')];}if(_0x180a8f[_0xa56f('0x97')][_0xa56f('0x92')]&&_0x180a8f[_0xa56f('0x97')]['List'][_0xa56f('0x94')][_0xa56f('0x3a')]){return _0x180a8f[_0xa56f('0x97')][_0xa56f('0x92')][_0xa56f('0x94')][0x0];}var _0x57db7d=_[_0xa56f('0xa')](_0x502609['body'],{'firstName':_0x502609[_0xa56f('0x4e')][_0xa56f('0x8b')],'ListId':_0x11e7b2[_0xa56f('0x8a')]});_0x57db7d[_0x502609[_0xa56f('0x4e')]['mapKey']]=_0x502609[_0xa56f('0x4e')]['from'];return db[_0xa56f('0x93')][_0xa56f('0x4d')](_0x57db7d,{'fields':_0x235ed1,'raw':!![]});}})[_0xa56f('0x27')](handleEntityNotFound(_0x543cd9,null))[_0xa56f('0x27')](function(_0x2bc455){_0x180a8f[_0xa56f('0x9b')]=_0x2bc455;var _0x5c2e77=_0x502609[_0xa56f('0x4e')]['customerIp'];if(_0x502609['headers'][_0xa56f('0x9c')]){_0x5c2e77=_0x502609[_0xa56f('0x9d')][_0xa56f('0x9c')];}else if(_0x502609[_0xa56f('0x9d')][_0xa56f('0x9e')]){_0x5c2e77=_[_0xa56f('0x9f')](_0x502609[_0xa56f('0x9d')]['x-forwarded-for'][_0xa56f('0xa0')](','));}if(_0x2bc455){var _0x201c4d={'ContactId':_0x2bc455['id'],'ChatWebsiteId':_0x502609[_0xa56f('0x4a')]['id'],'from':(_0x2bc455[_0xa56f('0xa1')]||'')+'\x20'+(_0x2bc455['lastName']||''),'customerIp':_0x5c2e77,'customerPort':_0x502609[_0xa56f('0x9d')][_0xa56f('0xa2')]?_0x502609[_0xa56f('0x9d')][_0xa56f('0xa2')]:null,'referer':_0x502609[_0xa56f('0x4e')][_0xa56f('0xa3')],'browserName':_0x2b2fdd[_0xa56f('0xa4')][_0xa56f('0x2c')]&&_0x2b2fdd[_0xa56f('0xa4')][_0xa56f('0xa5')]?util[_0xa56f('0xa6')](_0xa56f('0xa7'),_0x2b2fdd[_0xa56f('0xa4')][_0xa56f('0x2c')],_0x2b2fdd[_0xa56f('0xa4')][_0xa56f('0xa5')]):'unknown','browserVersion':_0x2b2fdd[_0xa56f('0xa4')][_0xa56f('0xa5')]||'unknown','osName':util['format'](_0xa56f('0xa7'),_0x2b2fdd['os'][_0xa56f('0x2c')],_0x2b2fdd['os']['version']),'osVersion':_0x2b2fdd['os'][_0xa56f('0xa5')],'deviceModel':_0x2b2fdd[_0xa56f('0xa8')]['model']&&_0x2b2fdd[_0xa56f('0xa8')][_0xa56f('0xa9')]?util[_0xa56f('0xa6')]('%s\x20%s\x20%s',_0x2b2fdd[_0xa56f('0xa8')][_0xa56f('0x33')],_0x2b2fdd[_0xa56f('0xa8')][_0xa56f('0xa9')],_0x2b2fdd[_0xa56f('0xa8')][_0xa56f('0xaa')]):null,'deviceVendor':_0x2b2fdd[_0xa56f('0xa8')]['vendor'],'deviceType':_0x2b2fdd['device'][_0xa56f('0xaa')],'formData':JSON[_0xa56f('0x15')](_0x502609[_0xa56f('0x4e')])};var _0x1c0ea4={'ChatWebsiteId':_0x502609[_0xa56f('0x4a')]['id'],'closed':![]};if(_0x502609[_0xa56f('0x4e')][_0xa56f('0xab')]){_0x1c0ea4[_0xa56f('0xab')]=_0x502609['body'][_0xa56f('0xab')];return db[_0xa56f('0xac')][_0xa56f('0x52')]({'where':_0x1c0ea4})[_0xa56f('0x27')](function(_0x812c9c){if(_0x812c9c){return[_0x812c9c,![]];}_0x201c4d[_0xa56f('0xab')]=_0x502609[_0xa56f('0x4e')]['threadId'];_0x201c4d[_0xa56f('0xad')]=_0x502609[_0xa56f('0x4e')][_0xa56f('0xad')];return db[_0xa56f('0xac')][_0xa56f('0x4d')](_0x201c4d)['then'](function(_0x59e617){return[_0x59e617,!![]];});});}_0x1c0ea4[_0xa56f('0xae')]=_0x2bc455['id'];if(_0x502609['body'][_0xa56f('0xaf')]&&_0x502609[_0xa56f('0x4e')][_0xa56f('0xaf')]['id']){_0x1c0ea4['id']=_0x502609[_0xa56f('0x4e')][_0xa56f('0xaf')]['id'];return db['ChatInteraction']['find']({'where':_0x1c0ea4})[_0xa56f('0x27')](function(_0x5ba082){if(_0x5ba082){return[_0x5ba082,![]];}return db[_0xa56f('0xac')][_0xa56f('0x4d')](_0x201c4d)[_0xa56f('0x27')](function(_0x77ae9f){return[_0x77ae9f,!![]];});});}return db[_0xa56f('0xac')][_0xa56f('0x4d')](_0x201c4d)[_0xa56f('0x27')](function(_0x3cc61c){return[_0x3cc61c,!![]];});}})['spread'](function(_0xa20249,_0x1ef907){if(_0xa20249){_0x5068ca=_0x1ef907;if(!_0x1ef907){var _0x45bf0b={'from':(_0x180a8f[_0xa56f('0x9b')]['firstName']||'')+'\x20'+(_0x180a8f['contact'][_0xa56f('0xb0')]||'')};if(_0x502609[_0xa56f('0x4e')][_0xa56f('0xab')]&&_0x502609[_0xa56f('0x4e')]['messageId']&&_0x502609[_0xa56f('0x4e')][_0xa56f('0xab')]!=_0x502609[_0xa56f('0x4e')][_0xa56f('0xb1')]){_0x45bf0b[_0xa56f('0xab')]=_0x502609[_0xa56f('0x4e')][_0xa56f('0xb1')];}return _0xa20249[_0xa56f('0x25')](_0x45bf0b);}else{return _0xa20249;}}})[_0xa56f('0x27')](function(_0x4b5876){_0x180a8f['interaction']=_0x4b5876['get']({'plain':!![]});_0x180a8f[_0xa56f('0xaf')][_0xa56f('0xb2')]=_0x5068ca;if(_0x180a8f['interaction'][_0xa56f('0xb2')]){if(_0x180a8f[_0xa56f('0x97')][_0xa56f('0xb3')]){_0x180a8f['applications'][_0xa56f('0xb4')]({'id':0x0,'priority':_0x180a8f[_0xa56f('0x98')][_0xa56f('0x3a')]+0x1,'app':_0xa56f('0xb5'),'appdata':_0xa56f('0xb6'),'interval':_0xa56f('0xb7')});}}return db['ChatMessage'][_0xa56f('0x4d')]({'body':_0x502609['body']['body'],'ChatWebsiteId':_0x502609[_0xa56f('0x4a')]['id'],'ChatInteractionId':_0x4b5876['id'],'direction':'in','ContactId':_0x180a8f[_0xa56f('0x9b')]['id'],'AttachmentId':_0x502609[_0xa56f('0x4e')][_0xa56f('0xb8')]});})['then'](function(_0x255869){_0x180a8f[_0xa56f('0x19')]=_0x255869;if(_0x180a8f[_0xa56f('0xaf')]['UserId']){return db[_0xa56f('0xb9')][_0xa56f('0x52')]({'attributes':['id',_0xa56f('0x2c')],'where':{'id':_0x180a8f[_0xa56f('0xaf')][_0xa56f('0xba')]}})['then'](function(_0x33537d){if(_0x33537d){_0x180a8f[_0xa56f('0x98')][_0xa56f('0xbb')]({'id':0x0,'priority':0x0,'app':_0xa56f('0xbc'),'appdata':_0x33537d['name']+','+(_0x180a8f[_0xa56f('0x97')][_0xa56f('0xbd')]||0xa),'interval':_0xa56f('0xb7')});_0x180a8f[_0xa56f('0xbe')]=!![];}return respondWithRpcPromise(_0xa56f('0xbf'),_0xa56f('0xc0'),_0x180a8f);});}return respondWithRpcPromise('Start',_0xa56f('0xc0'),_0x180a8f);})[_0xa56f('0x27')](function(_0x5ea871){respondWithRpcPromise(_0xa56f('0xc1'),_0xa56f('0xc1'),{'event':'notify','message':_0x5ea871},client9002);return _0x5ea871;})[_0xa56f('0x27')](respondWithResult(_0x543cd9,null))['catch'](handleError(_0x543cd9,null));};exports[_0xa56f('0xc2')]=function(_0x9bbe3c,_0x1b8607){var _0x552378,_0x5ecb45,_0x157ef5;var _0x20cf75=[];var _0x1fa3e8={};var _0x1c005b=_0x9bbe3c[_0xa56f('0xc3')]||[];var _0x2157eb=[];var _0x4cca20;return db['CmContact'][_0xa56f('0x55')]()[_0xa56f('0x27')](function(_0x5368a0){if(!_0x5368a0){throw new db['Sequelize']['ValidationError'](_0xa56f('0x85'));}_0x20cf75=_[_0xa56f('0x86')](_['keys'](_0x5368a0),[_0xa56f('0x88'),'updatedAt','CompanyId','ListId']);if(_0x9bbe3c['body']['id']){delete _0x9bbe3c[_0xa56f('0x4e')]['id'];}if(_[_0xa56f('0x76')](_0x9bbe3c[_0xa56f('0x4e')][_0xa56f('0x8b')])){throw _0x1b8607[_0xa56f('0x1c')](0x1f4)[_0xa56f('0x2d')](new db[(_0xa56f('0x83'))][(_0xa56f('0x84'))](_0xa56f('0x8c')));}if(_['isNil'](_0x9bbe3c[_0xa56f('0x4e')]['body'])||_0x9bbe3c[_0xa56f('0x4e')][_0xa56f('0x4e')]===''){throw _0x1b8607[_0xa56f('0x1c')](0x1f4)[_0xa56f('0x2d')](new db['Sequelize']['ValidationError'](_0xa56f('0x8d')));}if(_[_0xa56f('0x76')](_0x9bbe3c[_0xa56f('0x4e')][_0xa56f('0xc4')])){throw _0x1b8607[_0xa56f('0x1c')](0x1f4)['send'](new db[(_0xa56f('0x83'))][(_0xa56f('0x84'))](_0xa56f('0xc5')+_0x20cf75));}if(!_[_0xa56f('0xc6')](_0x20cf75,_0x9bbe3c[_0xa56f('0x4e')][_0xa56f('0xc4')])){throw _0x1b8607['status'](0x1f4)['send'](new db[(_0xa56f('0x83'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x20cf75));}_0x1fa3e8[_0x9bbe3c[_0xa56f('0x4e')][_0xa56f('0xc4')]]=_0x9bbe3c[_0xa56f('0x4e')][_0xa56f('0x8b')];})[_0xa56f('0x27')](function(){return db['ChatWebsite'][_0xa56f('0x52')]({'where':{'id':_0x9bbe3c[_0xa56f('0x4a')]['id']},'include':[{'model':db[_0xa56f('0x91')],'as':_0xa56f('0x92')},{'model':db[_0xa56f('0xc7')],'as':_0xa56f('0xc7')}]});})[_0xa56f('0x27')](handleEntityNotFound(_0x1b8607,null))[_0xa56f('0x27')](function(_0x1a618a){if(_0x1a618a&&_0x1a618a[_0xa56f('0x92')]){_0x5ecb45=_0x1a618a;var _0xd6737c=_[_0xa56f('0xa')](_0x9bbe3c[_0xa56f('0x4e')],{'firstName':_0x9bbe3c['body'][_0xa56f('0x8b')],'phone':_0x9bbe3c[_0xa56f('0x4e')]['from'],'ListId':_0x1a618a['ListId']});_0xd6737c[_0x9bbe3c[_0xa56f('0x4e')][_0xa56f('0xc4')]]=_0x9bbe3c['body']['from'];return db['CmContact'][_0xa56f('0xc8')]({'where':_0x1fa3e8,'defaults':_0xd6737c});}})['spread'](function(_0x2e8db8){if(_0x2e8db8){_0x157ef5=_0x2e8db8;var _0x42885a=fs[_0xa56f('0xc9')](path['join'](config[_0xa56f('0x6d')],'server/files/templates/chatOfflineMessage.ejs'),_0xa56f('0xca'));var _0x1f93a2=ejs[_0xa56f('0xcb')](_0x42885a,{'body':_['toPairs'](_0x9bbe3c[_0xa56f('0x4e')]['body']),'bodyTitle':_0x5ecb45[_0xa56f('0xcc')]});return db[_0xa56f('0xcd')][_0xa56f('0x4d')]({'body':_0x1f93a2,'plainBody':htmlToText['fromString'](_0x1f93a2),'ContactId':_0x2e8db8['id'],'ChatWebsiteId':_0x5ecb45['id']});}})['then'](function(_0x2388fe){_0x4cca20=_0x2388fe;if(_0x1c005b[_0xa56f('0x3a')]){var _0x23e732=_0x1c005b['map'](function(_0x38c602){return{'name':_0x38c602[_0xa56f('0xce')],'basename':_0x38c602[_0xa56f('0x65')],'type':_0x38c602['mimetype'],'ChatOfflineMessageId':_0x2388fe['id']};});_0x2157eb=_0x23e732[_0xa56f('0x34')](_0x301360=>{var _0xa69d5f={'filename':_0x301360[_0xa56f('0x2c')],'path':path[_0xa56f('0x6c')](config[_0xa56f('0x6d')],_0xa56f('0xcf'),_0xa56f('0xc3'),_0xa56f('0xd0'),_0xa56f('0xd1'),_0x301360[_0xa56f('0xd2')])};return _0xa69d5f;});if(!_0x5ecb45[_0xa56f('0xd3')]){return db['sequelize'][_0xa56f('0xd4')](function(_0x42412d){return db['Attachment'][_0xa56f('0xd5')](_0x23e732,{'transaction':_0x42412d});});}}})['then'](function(){if(_0x4cca20){_0x552378=_0x4cca20;return db[_0xa56f('0xc7')][_0xa56f('0x5f')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa56f('0xd6')],'as':_0xa56f('0xd6'),'raw':!![]}]}]});}})['then'](function(_0x100411){if(_0x100411&&_0x100411[_0xa56f('0xd7')]&&_0x5ecb45[_0xa56f('0xd8')]&&_0x5ecb45[_0xa56f('0xd9')]){var _0x3364e8=_0x100411[_0xa56f('0xda')]();return respondWithRpcPromise(_0xa56f('0xdb'),'sendMail',{'account':_0x3364e8,'message':{'from':util['format'](_0xa56f('0xdc'),_0x100411['name'],_0x100411[_0xa56f('0xdd')]||_0x100411[_0xa56f('0xd7')][_0xa56f('0x4f')]),'to':_0x5ecb45[_0xa56f('0xd9')],'subject':_0x5ecb45[_0xa56f('0xde')],'html':_0x552378[_0xa56f('0x4e')],'attachments':_0x2157eb}},client9003)[_0xa56f('0x27')](function(){return _0x552378;})['catch'](function(_0x3696c5){logger['error'](_0x3696c5);});}})[_0xa56f('0x27')](function(){if(_0x5ecb45&&_0x5ecb45[_0xa56f('0xd3')]&&_0x5ecb45[_0xa56f('0xdf')]){var _0x276eb9=[];if(_0x1c005b[_0xa56f('0x3a')]){_0x276eb9=_0x1c005b[_0xa56f('0x34')](function(_0xa9fcf7){return{'name':_0xa9fcf7[_0xa56f('0xce')],'basename':_0xa9fcf7[_0xa56f('0x65')],'type':_0xa9fcf7[_0xa56f('0xe0')],'ChatOfflineMessageId':_0x4cca20['id']};});}var _0x269d4d;if(!_[_0xa56f('0x76')](_0x5ecb45[_0xa56f('0xe1')])){var _0x25c8e2=_[_0xa56f('0x34')](_0x9bbe3c[_0xa56f('0x4e')],function(_0x4b5798){return _0x4b5798;});var _0x531539=_[_0xa56f('0xe2')](_0x25c8e2)[0x0];var _0x630cf8=_['mapValues'](_0x531539,function(_0x8dd234){return _0x8dd234;});_0x269d4d=_0x630cf8[0x1][_0x5ecb45[_0xa56f('0xe1')]];}var _0x48365e={'from':_0x157ef5[_0xa56f('0xdd')],'firstName':_0x157ef5[_0xa56f('0xa1')],'lastName':_0x157ef5['lastName'],'mapKey':_0xa56f('0xdd'),'message':{'from':_0x157ef5[_0xa56f('0xdd')],'to':_0x5ecb45[_0xa56f('0xc7')][_0xa56f('0xdd')],'cc':'','subject':_[_0xa56f('0x76')](_0x269d4d)?_0x5ecb45[_0xa56f('0xde')]:_0x269d4d,'messageId':'','sentAt':new Date(),'attach':_0x276eb9['length'],'attachments':_0x276eb9,'originChannel':_0xa56f('0xe3'),'ChatWebsiteId':_0x5ecb45['id'],'ChatOfflineMessageId':_0x552378['id'],'originTo':_0x5ecb45[_0xa56f('0xc7')][_0xa56f('0xdd')]},'body':_0x552378['body']};var _0x4c931c={'account':{'id':_0x5ecb45[_0xa56f('0xdf')]},'body':_0x48365e,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x4c931c,client9001)[_0xa56f('0x27')](function(){return _0x552378;})[_0xa56f('0x4c')](function(_0x2f7b2e){logger[_0xa56f('0x16')](_0x2f7b2e);});}return;})['then'](function(){if(_0x552378){return _0x552378;}})[_0xa56f('0x27')](respondWithResult(_0x1b8607,null))[_0xa56f('0x4c')](function(_0x3bf0ec){logger[_0xa56f('0x16')]('catch',_0x3bf0ec);for(var _0x42ef44 of _0x1c005b){var _0x4d5d92=path[_0xa56f('0x6c')](config[_0xa56f('0x6d')],'server',_0xa56f('0xc3'),'attachments',_0xa56f('0xd1'),_0x42ef44['filename']);fs_extra[_0xa56f('0xe4')](_0x4d5d92)['catch'](function(_0x367d4b){logger[_0xa56f('0x16')]('Could\x20not\x20remove\x20attachment\x20file',_0x4d5d92,_0x367d4b);});}});};exports[_0xa56f('0xe5')]=function(_0x88e0f0,_0x5bae0d){return db[_0xa56f('0xac')][_0xa56f('0x52')]({'where':{'id':_0x88e0f0[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x5bae0d,null))[_0xa56f('0x27')](function(_0x58012f){if(_0x58012f){return _0x58012f[_0xa56f('0xe5')](_0x88e0f0[_0xa56f('0x4e')][_0xa56f('0x5b')],_[_0xa56f('0xe6')](_0x88e0f0[_0xa56f('0x4e')],['ids','id'])||{});}})[_0xa56f('0x27')](respondWithResult(_0x5bae0d,null))['catch'](handleError(_0x5bae0d,null));};exports[_0xa56f('0xe7')]=function(_0x28a064,_0x2cdaa8){var _0x4a374b={'raw':![],'where':{}};var _0x4e93c3={};var _0x5cc501={'count':0x0,'rows':[]};return db[_0xa56f('0x30')][_0xa56f('0x5f')]({'where':{'id':_0x28a064[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x2cdaa8,null))[_0xa56f('0x27')](function(_0x27c5d5){if(_0x27c5d5){_0x4e93c3[_0xa56f('0x33')]=_[_0xa56f('0x36')](db['ChatInteraction'][_0xa56f('0x31')]);_0x4e93c3['query']=_[_0xa56f('0x36')](_0x28a064[_0xa56f('0x35')]);_0x4e93c3[_0xa56f('0x40')]=_['intersection'](_0x4e93c3['model'],_0x4e93c3[_0xa56f('0x35')]);_0x4a374b['attributes']=_[_0xa56f('0x37')](_0x4e93c3[_0xa56f('0x33')],qs['fields'](_0x28a064[_0xa56f('0x35')][_0xa56f('0x39')]));_0x4a374b[_0xa56f('0x38')]=_0x4a374b['attributes'][_0xa56f('0x3a')]?_0x4a374b['attributes']:_0x4e93c3['model'];if(!_0x28a064[_0xa56f('0x35')][_0xa56f('0x3b')](_0xa56f('0x3c'))){_0x4a374b[_0xa56f('0x22')]=qs[_0xa56f('0x22')](_0x28a064[_0xa56f('0x35')]['limit']);_0x4a374b['offset']=qs[_0xa56f('0x1f')](_0x28a064['query']['offset']);}_0x4a374b['order']=qs['sort'](_0x28a064[_0xa56f('0x35')][_0xa56f('0x3e')]);_0x4a374b[_0xa56f('0x3f')]=qs[_0xa56f('0x40')](_['pick'](_0x28a064[_0xa56f('0x35')],_0x4e93c3['filters']));_0x4a374b[_0xa56f('0x3f')]['ChatWebsiteId']=_0x27c5d5['id'];if(_0x28a064[_0xa56f('0x35')][_0xa56f('0x42')]){_0x4a374b[_0xa56f('0x3f')]=_[_0xa56f('0x44')](_0x4a374b[_0xa56f('0x3f')],{'$or':_[_0xa56f('0x34')](_0x4a374b['attributes'],function(_0x43b0c4){var _0x322678={};_0x322678[_0x43b0c4]={'$like':'%'+_0x28a064[_0xa56f('0x35')][_0xa56f('0x42')]+'%'};return _0x322678;})});}_0x4a374b=_[_0xa56f('0x44')]({},_0x4a374b,_0x28a064['options']);return db['ChatInteraction'][_0xa56f('0x21')]({'where':_0x4a374b[_0xa56f('0x3f')]})['then'](function(_0x1617d0){_0x5cc501[_0xa56f('0x21')]=_0x1617d0;if(_0x28a064[_0xa56f('0x35')][_0xa56f('0x46')]){_0x4a374b['include']=[{'model':db[_0xa56f('0x93')],'as':'Contact','required':![]},{'model':db[_0xa56f('0xb9')],'as':_0xa56f('0xe8'),'attributes':['name',_0xa56f('0xe9'),'internal'],'required':![]},{'model':db[_0xa56f('0xea')],'as':'Tags','attributes':['id',_0xa56f('0x2c'),_0xa56f('0xeb')],'where':_0x28a064[_0xa56f('0x35')][_0xa56f('0xec')]?{'id':_0x28a064[_0xa56f('0x35')][_0xa56f('0xec')]}:undefined,'required':_0x28a064[_0xa56f('0x35')][_0xa56f('0xec')]?!![]:![]}];}return db[_0xa56f('0xac')][_0xa56f('0x48')](_0x4a374b);})[_0xa56f('0x27')](function(_0x475f9e){_0x5cc501[_0xa56f('0x60')]=_0x475f9e;return _0x5cc501;});}})[_0xa56f('0x27')](respondWithFilteredResult(_0x2cdaa8,_0x4a374b))[_0xa56f('0x4c')](handleError(_0x2cdaa8,null));};function iftimePromise(_0x336fb0,_0x13fc97){return respondWithRpcPromise('Command',_0xa56f('0xed'),{'command':_0x13fc97[_0xa56f('0xee')]?util['format'](_0xa56f('0xef'),_0x336fb0[_0xa56f('0xf0')],_0x13fc97['timezone']):util[_0xa56f('0xa6')](_0xa56f('0xf1'),_0x336fb0[_0xa56f('0xf0')])},client9002)[_0xa56f('0x27')](function(_0x14e42c){var _0x2ce301=_0x14e42c&&_0x14e42c[_0xa56f('0xf2')](_0xa56f('0xf3'))>=0x0?!![]:![];logger['info'](_0xa56f('0xf4'),_0x13fc97['id'],_0x336fb0['id'],_0x336fb0[_0xa56f('0xf0')],_0x2ce301?_0xa56f('0xf5'):_0xa56f('0xf6'),_0x13fc97[_0xa56f('0xee')]?_0x13fc97[_0xa56f('0xee')]:_0xa56f('0xf7'));return _0x2ce301;})[_0xa56f('0x4c')](function(_0x3dc670){logger[_0xa56f('0x16')](_0xa56f('0xf4'),_0x13fc97['id'],_0x336fb0['id'],_0x336fb0['interval'],util[_0xa56f('0xf8')](_0x3dc670,{'showHidden':![],'depth':null}),_0x13fc97['timezone']?_0x13fc97[_0xa56f('0xee')]:'No\x20timezone');return![];});}exports[_0xa56f('0xed')]=function(_0x2654a5,_0x3ee2f9){var _0x2ada27=0x0;var _0x4399e5=0x0;var _0x383403=![];var _0x4d87f2;var _0x4a08b5;return db[_0xa56f('0x30')][_0xa56f('0x52')]({'where':{'id':_0x2654a5[_0xa56f('0x4a')]['id']},'include':[{'model':db[_0xa56f('0xf9')],'as':_0xa56f('0xf9'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xa56f('0xf0')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3ee2f9,null))[_0xa56f('0x27')](function(_0x546347){if(_0x546347){_0x4d87f2=_0x546347;return _0x546347[_0xa56f('0xfa')]({'raw':!![]});}})['then'](function(_0x1f6cc0){if(_0x4d87f2){if(_0x1f6cc0){_0x4a08b5=_0x1f6cc0;}}return require(_0xa56f('0x6f'))[_0xa56f('0x70')]();})[_0xa56f('0x27')](function(_0x286fb6){if(_0x286fb6){_0x4399e5=_0x286fb6[_0xa56f('0xfb')];_0x383403=_0x286fb6[_0xa56f('0xfc')];}})[_0xa56f('0x27')](function(){return db[_0xa56f('0xac')]['count']({'where':{'closed':![]}});})[_0xa56f('0x27')](function(_0x255151){_0x2ada27=_0x255151;if(_0x4399e5&&_0x255151>_0x4399e5){return db['License'][_0xa56f('0x5f')]({'where':{'id':0x1}})['then'](function(_0x1e1e66){if(_0x1e1e66){_0x1e1e66[_0xa56f('0xfd')](_0xa56f('0xfe'));}});}})['then'](function(){if(_0x4d87f2[_0xa56f('0xf9')]&&_0x4d87f2[_0xa56f('0xf9')]['Intervals']){var _0x355ea1=[];for(var _0x281610=0x0;_0x281610<_0x4d87f2[_0xa56f('0xf9')][_0xa56f('0xff')]['length'];_0x281610++){var _0x6e8b23=_0x4d87f2['Interval'][_0xa56f('0xff')][_0x281610][_0xa56f('0x28')]({'plain':!![]});_0x355ea1[_0xa56f('0xb4')](iftimePromise(_0x6e8b23,_0x4d87f2));}return BPromise['all'](_0x355ea1)[_0xa56f('0x27')](function(_0x259874){return _[_0xa56f('0x100')](_0x259874);});}else{return!![];}})['then'](function(_0x471a4e){var _0x370a6f=fs[_0xa56f('0xc9')](path['join'](config[_0xa56f('0x6d')],_0xa56f('0x101')),_0xa56f('0xca'));var _0x56d640=new url['URL'](_0x4d87f2[_0xa56f('0x102')])['origin'];var _0x3049f3='3.1.0';var _0x4e9b33=![];var _0xc19457={'chatVersion':_0x3049f3,'chatWebsiteAddressOrigin':_0x56d640,'remote':_0x4d87f2[_0xa56f('0x103')],'query':querystring['stringify'](_['merge'](_0x4d87f2[_0xa56f('0x28')]({'plain':!![]}),{'customerIp':_0x2654a5['headers']['x-forwarded-for']||_0x2654a5['headers'][_0xa56f('0x104')]||_0x2654a5[_0xa56f('0x105')]['remoteAddress']||_0x2654a5['ip'],'referer':_0x2654a5['headers'][_0xa56f('0xa3')],'openedInteractions':_0x2ada27,'maxInteractions':_0x4399e5,'virtual':_0x383403[_0xa56f('0xfb')],'online':_0x471a4e,'custom':_0x383403}))[_0xa56f('0x106')](/'/g,'\x5c\x27')};_0x3ee2f9[_0xa56f('0x2d')](ejs[_0xa56f('0xcb')](Mustache[_0xa56f('0xcb')](_0x370a6f,_0xc19457),{'proactiveActions':_0x4a08b5,'alignment':_0x4d87f2[_0xa56f('0x107')],'verticalAlignment':_0x4d87f2[_0xa56f('0x108')],'div_color':_0x4d87f2[_0xa56f('0xeb')],'labelText':_0x4d87f2['labelText'],'text_color':_0x4d87f2[_0xa56f('0x109')],'text_button_color':_0x4d87f2[_0xa56f('0x10a')],'button_color':_0x4d87f2[_0xa56f('0x10b')],'background_color':_0x4d87f2['backgroundColor'],'hideWhenOffline':_0x4d87f2[_0xa56f('0x10c')],'intervalId':_0x4d87f2[_0xa56f('0x10d')],'isDevelopment':_0x4e9b33,'chatVersion':_0x3049f3}));})[_0xa56f('0x4c')](handleError(_0x3ee2f9,null));};exports['addApplications']=function(_0x53c41f,_0x2cbe41){var _0x1368e8=_0x53c41f[_0xa56f('0x4a')]['id'];var _0xee08dd=_0x53c41f['body'];var _0x1d4ff6=0xc8;var _0x941444=null;return db[_0xa56f('0x10e')][_0xa56f('0xd4')]({'isolationLevel':db[_0xa56f('0x10e')][_0xa56f('0x10f')][_0xa56f('0x110')]['READ_COMMITTED']},function(_0x14570b){return db[_0xa56f('0x30')][_0xa56f('0x5f')]({'where':{'id':_0x1368e8},'transaction':_0x14570b})[_0xa56f('0x27')](function(_0x1f1e1c){if(_0x1f1e1c){return db['ChatApplication'][_0xa56f('0x26')]({'where':{'ChatWebsiteId':_0x1368e8},'transaction':_0x14570b})[_0xa56f('0x27')](function(){var _0x3a7b38=_[_0xa56f('0x34')](_0xee08dd,function(_0x1566a1){_0x1566a1['ChatWebsiteId']=_0x1368e8;return _0x1566a1;});return db[_0xa56f('0x111')]['bulkCreate'](_0x3a7b38,{'transaction':_0x14570b});});}else{_0x1d4ff6=0x194;_0x941444=[];}});})['then'](function(){if(_0x1d4ff6!==0x194){return db[_0xa56f('0x111')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1368e8},'order':_0xa56f('0x112')})[_0xa56f('0x27')](function(_0x161bb2){_0x941444=_0x161bb2;});}})[_0xa56f('0x4c')](function(_0x449e3f){_0x1d4ff6=0x1f4;logger['error'](_0x449e3f[_0xa56f('0x2b')]);if(_0x449e3f[_0xa56f('0x2c')]){delete _0x449e3f[_0xa56f('0x2c')];}_0x941444=_0x449e3f;})[_0xa56f('0x113')](function(){if(_0x941444===null){_0x2cbe41['sendStatus'](_0x1d4ff6);}else{if(_0x1d4ff6===0x1f4){_0x2cbe41['status'](_0x1d4ff6)[_0xa56f('0x2d')](_0x941444);}else{_0x2cbe41['status'](_0x1d4ff6)[_0xa56f('0x1e')](_0x941444);}}});};exports[_0xa56f('0x114')]=function(_0x9d749f,_0x1aad8a){var _0x42bc42={};var _0x15f7c5={};var _0x2cc073;var _0x177b02;return db['ChatWebsite']['findOne']({'where':{'id':_0x9d749f[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x1aad8a,null))[_0xa56f('0x27')](function(_0x5df434){if(_0x5df434){_0x2cc073=_0x5df434;_0x15f7c5['model']=_[_0xa56f('0x36')](db[_0xa56f('0x111')][_0xa56f('0x31')]);_0x15f7c5['query']=_[_0xa56f('0x36')](_0x9d749f[_0xa56f('0x35')]);_0x15f7c5[_0xa56f('0x40')]=_[_0xa56f('0x37')](_0x15f7c5[_0xa56f('0x33')],_0x15f7c5['query']);_0x42bc42[_0xa56f('0x38')]=_[_0xa56f('0x37')](_0x15f7c5['model'],qs['fields'](_0x9d749f[_0xa56f('0x35')][_0xa56f('0x39')]));_0x42bc42[_0xa56f('0x38')]=_0x42bc42['attributes'][_0xa56f('0x3a')]?_0x42bc42[_0xa56f('0x38')]:_0x15f7c5[_0xa56f('0x33')];_0x42bc42[_0xa56f('0x3d')]=qs[_0xa56f('0x3e')](_0x9d749f[_0xa56f('0x35')][_0xa56f('0x3e')]);_0x42bc42[_0xa56f('0x3f')]=qs[_0xa56f('0x40')](_['pick'](_0x9d749f[_0xa56f('0x35')],_0x15f7c5[_0xa56f('0x40')]));if(_0x9d749f[_0xa56f('0x35')][_0xa56f('0x42')]){_0x42bc42['where']=_[_0xa56f('0x44')](_0x42bc42[_0xa56f('0x3f')],{'$or':_[_0xa56f('0x34')](_0x42bc42[_0xa56f('0x38')],function(_0x1ce365){var _0x30cecd={};_0x30cecd[_0x1ce365]={'$like':'%'+_0x9d749f[_0xa56f('0x35')][_0xa56f('0x42')]+'%'};return _0x30cecd;})});}_0x42bc42=_[_0xa56f('0x44')]({},_0x42bc42,_0x9d749f[_0xa56f('0x45')]);return _0x2cc073[_0xa56f('0x114')](_0x42bc42);}})['then'](function(_0x17f212){if(_0x17f212){_0x177b02=_0x17f212[_0xa56f('0x3a')];if(!_0x9d749f[_0xa56f('0x35')][_0xa56f('0x3b')]('nolimit')){_0x42bc42['limit']=qs[_0xa56f('0x22')](_0x9d749f[_0xa56f('0x35')][_0xa56f('0x22')]);_0x42bc42['offset']=qs['offset'](_0x9d749f[_0xa56f('0x35')]['offset']);}return _0x2cc073[_0xa56f('0x114')](_0x42bc42);}})[_0xa56f('0x27')](function(_0x28c495){if(_0x28c495){return _0x28c495?{'count':_0x177b02,'rows':_0x28c495}:null;}})[_0xa56f('0x27')](respondWithResult(_0x1aad8a,null))[_0xa56f('0x4c')](handleError(_0x1aad8a,null));};exports['addProactiveActions']=function(_0x2b62fd,_0x210ee2){return db[_0xa56f('0x115')][_0xa56f('0x52')]({'where':{'id':_0x2b62fd[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x210ee2,null))[_0xa56f('0x27')](function(_0x3c5348){if(_0x3c5348){return _0x3c5348[_0xa56f('0x116')](_0x2b62fd[_0xa56f('0x4e')]['ids'],_[_0xa56f('0xe6')](_0x2b62fd[_0xa56f('0x4e')],['ids','id'])||{});}})[_0xa56f('0x27')](respondWithResult(_0x210ee2,null))[_0xa56f('0x4c')](handleError(_0x210ee2,null));};exports[_0xa56f('0xfa')]=function(_0x37d183,_0x20e5c5){var _0x548d70={};var _0x2d2aa1={};var _0x72aacf;var _0x5ee7c3;return db[_0xa56f('0x30')]['findOne']({'where':{'id':_0x37d183['params']['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x20e5c5,null))[_0xa56f('0x27')](function(_0x13ab67){if(_0x13ab67){_0x72aacf=_0x13ab67;_0x2d2aa1[_0xa56f('0x33')]=_[_0xa56f('0x36')](db['ChatProactiveAction'][_0xa56f('0x31')]);_0x2d2aa1[_0xa56f('0x35')]=_[_0xa56f('0x36')](_0x37d183[_0xa56f('0x35')]);_0x2d2aa1[_0xa56f('0x40')]=_[_0xa56f('0x37')](_0x2d2aa1[_0xa56f('0x33')],_0x2d2aa1[_0xa56f('0x35')]);_0x548d70[_0xa56f('0x38')]=_[_0xa56f('0x37')](_0x2d2aa1[_0xa56f('0x33')],qs[_0xa56f('0x39')](_0x37d183[_0xa56f('0x35')][_0xa56f('0x39')]));_0x548d70['attributes']=_0x548d70[_0xa56f('0x38')]['length']?_0x548d70['attributes']:_0x2d2aa1['model'];_0x548d70['order']=qs[_0xa56f('0x3e')](_0x37d183[_0xa56f('0x35')][_0xa56f('0x3e')]);_0x548d70[_0xa56f('0x3f')]=qs[_0xa56f('0x40')](_['pick'](_0x37d183[_0xa56f('0x35')],_0x2d2aa1[_0xa56f('0x40')]));if(_0x37d183[_0xa56f('0x35')][_0xa56f('0x42')]){_0x548d70[_0xa56f('0x3f')]=_[_0xa56f('0x44')](_0x548d70['where'],{'$or':_['map'](_0x548d70[_0xa56f('0x38')],function(_0x5593f2){var _0x433805={};_0x433805[_0x5593f2]={'$like':'%'+_0x37d183[_0xa56f('0x35')][_0xa56f('0x42')]+'%'};return _0x433805;})});}_0x548d70=_[_0xa56f('0x44')]({},_0x548d70,_0x37d183['options']);return _0x72aacf[_0xa56f('0xfa')](_0x548d70);}})['then'](function(_0x25ecbe){if(_0x25ecbe){_0x5ee7c3=_0x25ecbe['length'];if(!_0x37d183[_0xa56f('0x35')][_0xa56f('0x3b')]('nolimit')){_0x548d70[_0xa56f('0x22')]=qs['limit'](_0x37d183[_0xa56f('0x35')][_0xa56f('0x22')]);_0x548d70[_0xa56f('0x1f')]=qs[_0xa56f('0x1f')](_0x37d183[_0xa56f('0x35')][_0xa56f('0x1f')]);}return _0x72aacf['getProactiveActions'](_0x548d70);}})[_0xa56f('0x27')](function(_0x1db8ee){if(_0x1db8ee){return _0x1db8ee?{'count':_0x5ee7c3,'rows':_0x1db8ee}:null;}})[_0xa56f('0x27')](respondWithResult(_0x20e5c5,null))[_0xa56f('0x4c')](handleError(_0x20e5c5,null));};exports[_0xa56f('0x117')]=function(_0x4a0c5c,_0x8f2773){var _0x333494=_0x4a0c5c[_0xa56f('0x35')][_0xa56f('0x118')]===_0xa56f('0x119')?_0xa56f('0x11a'):_0xa56f('0x11b');return db[_0xa56f('0x30')][_0xa56f('0x52')]({'attributes':['id',_0x333494],'where':{'id':_0x4a0c5c[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x8f2773,null))[_0xa56f('0x27')](function(_0x46d4f4){if(_0x46d4f4){var _0xc2b3e7=_0x46d4f4[_0x333494];var _0x2867a8=_0xc2b3e7&&_0xc2b3e7['items']?_0xc2b3e7['items']:[];_0x8f2773[_0xa56f('0x2d')]({'fromKey':_[_0xa56f('0x76')](_0xc2b3e7[_0xa56f('0x11c')])?undefined:_0xc2b3e7[_0xa56f('0x11c')],'count':_0x2867a8['length'],'rows':_0x2867a8});}})[_0xa56f('0x4c')](handleError(_0x8f2773,null));};exports[_0xa56f('0x11d')]=function(_0x2e3ed9,_0x14106f){var _0x58aa21={'raw':![],'where':{}};var _0x1fd12b={};var _0x5ae04b={'count':0x0,'rows':[]};return db[_0xa56f('0x30')][_0xa56f('0x5f')]({'where':{'id':_0x2e3ed9[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x14106f,null))['then'](function(_0x3e7e0b){if(_0x3e7e0b){_0x1fd12b[_0xa56f('0x33')]=_['keys'](db[_0xa56f('0xcd')][_0xa56f('0x31')]);_0x1fd12b[_0xa56f('0x35')]=_['keys'](_0x2e3ed9['query']);_0x1fd12b['filters']=_['intersection'](_0x1fd12b[_0xa56f('0x33')],_0x1fd12b[_0xa56f('0x35')]);_0x58aa21[_0xa56f('0x38')]=_[_0xa56f('0x37')](_0x1fd12b[_0xa56f('0x33')],qs[_0xa56f('0x39')](_0x2e3ed9[_0xa56f('0x35')]['fields']));_0x58aa21[_0xa56f('0x38')]=_0x58aa21['attributes']['length']?_0x58aa21[_0xa56f('0x38')]:_0x1fd12b[_0xa56f('0x33')];if(!_0x2e3ed9[_0xa56f('0x35')]['hasOwnProperty'](_0xa56f('0x3c'))){_0x58aa21[_0xa56f('0x22')]=qs[_0xa56f('0x22')](_0x2e3ed9[_0xa56f('0x35')][_0xa56f('0x22')]);_0x58aa21[_0xa56f('0x1f')]=qs[_0xa56f('0x1f')](_0x2e3ed9['query'][_0xa56f('0x1f')]);}_0x58aa21['order']=qs[_0xa56f('0x3e')](_0x2e3ed9[_0xa56f('0x35')]['sort']);_0x58aa21[_0xa56f('0x3f')]=qs[_0xa56f('0x40')](_[_0xa56f('0x41')](_0x2e3ed9['query'],_0x1fd12b[_0xa56f('0x40')]));_0x58aa21[_0xa56f('0x3f')][_0xa56f('0x57')]=_0x3e7e0b['id'];if(_0x2e3ed9[_0xa56f('0x35')][_0xa56f('0x42')]){_0x58aa21['where']=_[_0xa56f('0x44')](_0x58aa21['where'],{'$or':_['map'](_0x58aa21['attributes'],function(_0x646827){var _0x30710c={};_0x30710c[_0x646827]={'$like':'%'+_0x2e3ed9[_0xa56f('0x35')][_0xa56f('0x42')]+'%'};return _0x30710c;})});}_0x58aa21=_[_0xa56f('0x44')]({},_0x58aa21,_0x2e3ed9[_0xa56f('0x45')]);return db[_0xa56f('0xcd')][_0xa56f('0x21')]({'where':_0x58aa21['where']})['then'](function(_0x4c667b){_0x5ae04b[_0xa56f('0x21')]=_0x4c667b;if(_0x2e3ed9[_0xa56f('0x35')][_0xa56f('0x46')]){_0x58aa21['include']=[{'all':!![]}];}else{_0x58aa21[_0xa56f('0x47')]=[{'model':db[_0xa56f('0x93')],'as':_0xa56f('0x11e'),'required':![]},{'model':db['Attachment'],'as':_0xa56f('0x11f'),'required':![]}];}return db[_0xa56f('0xcd')]['findAll'](_0x58aa21);})[_0xa56f('0x27')](function(_0x140946){_0x5ae04b[_0xa56f('0x60')]=_0x140946;return _0x5ae04b;});}})[_0xa56f('0x27')](respondWithFilteredResult(_0x14106f,_0x58aa21))[_0xa56f('0x4c')](handleError(_0x14106f,null));};exports[_0xa56f('0x120')]=function(_0x139ec7,_0x5582d3){return db['ChatWebsite'][_0xa56f('0x52')]({'where':{'id':_0x139ec7[_0xa56f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5582d3,null))[_0xa56f('0x27')](function(_0xde85dd){if(_0xde85dd){return _0xde85dd['addAgents'](_0x139ec7[_0xa56f('0x4e')]['ids'],_[_0xa56f('0xe6')](_0x139ec7[_0xa56f('0x4e')],['ids','id'])||{})[_0xa56f('0x121')](function(_0x3cb5f4){for(var _0x13a6a7=0x0;_0x13a6a7<_0x139ec7[_0xa56f('0x4e')][_0xa56f('0x5b')][_0xa56f('0x3a')];_0x13a6a7+=0x1){socket[_0xa56f('0x122')](_0xa56f('0x123'),{'UserId':Number(_0x139ec7['body'][_0xa56f('0x5b')][_0x13a6a7]),'ChatWebsiteId':Number(_0x139ec7['params']['id'])});}return _0x3cb5f4;});}})[_0xa56f('0x27')](respondWithResult(_0x5582d3,null))[_0xa56f('0x4c')](handleError(_0x5582d3,null));};exports[_0xa56f('0x124')]=function(_0x509082,_0x1d7750){return db[_0xa56f('0x30')][_0xa56f('0x52')]({'where':{'id':_0x509082[_0xa56f('0x4a')]['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x1d7750,null))[_0xa56f('0x27')](function(_0x3b47e3){if(_0x3b47e3){return _0x3b47e3['removeAgents'](_0x509082['query']['ids'])['then'](function(){if(_[_0xa56f('0x125')](_0x509082[_0xa56f('0x35')]['ids'])){for(var _0x2bb697=0x0;_0x2bb697<_0x509082[_0xa56f('0x35')][_0xa56f('0x5b')][_0xa56f('0x3a')];_0x2bb697+=0x1){socket[_0xa56f('0x122')]('userChatWebsite:remove',{'UserId':Number(_0x509082[_0xa56f('0x35')][_0xa56f('0x5b')][_0x2bb697]),'ChatWebsiteId':Number(_0x509082[_0xa56f('0x4a')]['id'])});}}else{socket[_0xa56f('0x122')](_0xa56f('0x126'),{'UserId':Number(_0x509082[_0xa56f('0x35')][_0xa56f('0x5b')]),'ChatWebsiteId':Number(_0x509082[_0xa56f('0x4a')]['id'])});}});}})[_0xa56f('0x27')](respondWithStatusCode(_0x1d7750,null))['catch'](handleError(_0x1d7750,null));};exports[_0xa56f('0x127')]=function(_0x528246,_0x172281){var _0x497fe6={};var _0x221cfe={};var _0x4a1541;var _0xb8dc83;return db['ChatWebsite'][_0xa56f('0x5f')]({'where':{'id':_0x528246['params']['id']}})[_0xa56f('0x27')](handleEntityNotFound(_0x172281,null))[_0xa56f('0x27')](function(_0x18a23d){if(_0x18a23d){_0x4a1541=_0x18a23d;_0x221cfe[_0xa56f('0x33')]=_[_0xa56f('0x36')](db[_0xa56f('0xb9')][_0xa56f('0x31')]);_0x221cfe['query']=_[_0xa56f('0x36')](_0x528246['query']);_0x221cfe[_0xa56f('0x40')]=_[_0xa56f('0x37')](_0x221cfe[_0xa56f('0x33')],_0x221cfe[_0xa56f('0x35')]);_0x497fe6['attributes']=_[_0xa56f('0x37')](_0x221cfe[_0xa56f('0x33')],qs[_0xa56f('0x39')](_0x528246[_0xa56f('0x35')][_0xa56f('0x39')]));_0x497fe6[_0xa56f('0x38')]=_0x497fe6[_0xa56f('0x38')]['length']?_0x497fe6[_0xa56f('0x38')]:_0x221cfe[_0xa56f('0x33')];_0x497fe6[_0xa56f('0x3d')]=qs[_0xa56f('0x3e')](_0x528246[_0xa56f('0x35')][_0xa56f('0x3e')]);_0x497fe6['where']=qs[_0xa56f('0x40')](_[_0xa56f('0x41')](_0x528246[_0xa56f('0x35')],_0x221cfe[_0xa56f('0x40')]));if(_0x528246[_0xa56f('0x35')]['filter']){_0x497fe6[_0xa56f('0x3f')]=_[_0xa56f('0x44')](_0x497fe6[_0xa56f('0x3f')],{'$or':_['map'](_0x497fe6[_0xa56f('0x38')],function(_0x309364){var _0x189a84={};_0x189a84[_0x309364]={'$like':'%'+_0x528246[_0xa56f('0x35')][_0xa56f('0x42')]+'%'};return _0x189a84;})});}_0x497fe6=_[_0xa56f('0x44')]({},_0x497fe6,_0x528246['options']);return _0x4a1541[_0xa56f('0x127')](_0x497fe6);}})[_0xa56f('0x27')](function(_0x298194){if(_0x298194){_0xb8dc83=_0x298194[_0xa56f('0x3a')];if(!_0x528246['query'][_0xa56f('0x3b')](_0xa56f('0x3c'))){_0x497fe6[_0xa56f('0x22')]=qs[_0xa56f('0x22')](_0x528246[_0xa56f('0x35')]['limit']);_0x497fe6[_0xa56f('0x1f')]=qs[_0xa56f('0x1f')](_0x528246[_0xa56f('0x35')][_0xa56f('0x1f')]);}return _0x4a1541[_0xa56f('0x127')](_0x497fe6);}})['then'](function(_0x2f3340){if(_0x2f3340){return _0x2f3340?{'count':_0xb8dc83,'rows':_0x2f3340}:null;}})['then'](respondWithResult(_0x172281,null))['catch'](handleError(_0x172281,null));};
\ No newline at end of file
+var _0xa5d0=['server','attachments','basename','sequelize','transaction','findOne','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','openNewInteraction','MailAccountId','mapValues','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getLicense','virtual','License','all','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','x-real-ip','connection','remoteAddress','referer','replace','verticalAlignment','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','finally','getApplications','addProactiveActions','omit','getProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','path','lodash','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','url','../../mysqldb','redis','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','sendStatus','status','json','offset','limit','count','Content-Range','update','destroy','ChatWebsites','end','stack','send','Pause','mandatoryDispositionPause','ChatWebsite','type','key','name','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','map','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','rawAttributes','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','body','params','describe','addDisposition','ChatWebsiteId','Disposition','pick','ids','CannedAnswer','getAnswers','removeAnswers','sitepic','addAvatar','file','filename','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','CmList','Contacts','DESC','ChatApplication','List','account','applications','Applications','list','orderBy','priority','asc','defaults','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','files','CompanyId','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xa5d0,0x178));var _0x0a5d=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa5d0[_0xbe200f];return _0x192597;};'use strict';var BPromise=require(_0x0a5d('0x0'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0a5d('0x1'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a5d('0x2'));var querystring=require(_0x0a5d('0x3'));var Redis=require(_0x0a5d('0x4'));var qs=require(_0x0a5d('0x5'));var logger=require('../../config/logger')(_0x0a5d('0x6'));var config=require(_0x0a5d('0x7'));var url=require(_0x0a5d('0x8'));var db=require(_0x0a5d('0x9'))['db'];config[_0x0a5d('0xa')]=_['defaults'](config[_0x0a5d('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a5d('0xa')]));require(_0x0a5d('0xb'))[_0x0a5d('0xc')](socket);var htmlToText=require(_0x0a5d('0xd'));var jayson=require(_0x0a5d('0xe'));var client=jayson[_0x0a5d('0xf')][_0x0a5d('0x10')]({'port':0x232c});var client9002=jayson[_0x0a5d('0xf')][_0x0a5d('0x10')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x155f2f,_0x52afe1,_0x3a8725,_0x12798f){return new BPromise(function(_0x47b24f,_0x1e7fd5){var _0x40b40a=_0x12798f||client;return _0x40b40a[_0x0a5d('0x11')](_0x155f2f,_0x3a8725)[_0x0a5d('0x12')](function(_0x39c25c){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x52afe1,_0x0a5d('0x13'));logger['debug'](_0x0a5d('0x14'),_0x52afe1,'request\x20sent',JSON[_0x0a5d('0x15')](_0x39c25c));if(_0x39c25c[_0x0a5d('0x16')]){if(_0x39c25c[_0x0a5d('0x16')][_0x0a5d('0x17')]===0x1f4){logger['error'](_0x0a5d('0x18'),_0x52afe1,_0x39c25c[_0x0a5d('0x16')][_0x0a5d('0x19')]);return _0x1e7fd5(_0x39c25c[_0x0a5d('0x16')][_0x0a5d('0x19')]);}logger[_0x0a5d('0x16')](_0x0a5d('0x18'),_0x52afe1,_0x39c25c[_0x0a5d('0x16')][_0x0a5d('0x19')]);return _0x47b24f(_0x39c25c[_0x0a5d('0x16')][_0x0a5d('0x19')]);}else{logger[_0x0a5d('0x1a')](_0x0a5d('0x18'),_0x52afe1,_0x0a5d('0x13'));_0x47b24f(_0x39c25c['result'][_0x0a5d('0x19')]);}})['catch'](function(_0x4f0305){logger[_0x0a5d('0x16')](_0x0a5d('0x18'),_0x52afe1,_0x4f0305);_0x1e7fd5(_0x4f0305);});});}function respondWithStatusCode(_0x5c4f4d,_0x415da7){_0x415da7=_0x415da7||0xcc;return function(_0x9d2904){if(_0x9d2904){return _0x5c4f4d[_0x0a5d('0x1b')](_0x415da7);}return _0x5c4f4d[_0x0a5d('0x1c')](_0x415da7)['end']();};}function respondWithResult(_0x11087d,_0x2f76db){_0x2f76db=_0x2f76db||0xc8;return function(_0x211034){if(_0x211034){return _0x11087d[_0x0a5d('0x1c')](_0x2f76db)[_0x0a5d('0x1d')](_0x211034);}};}function respondWithFilteredResult(_0x705468,_0x10ee93){return function(_0x1a99cb){if(_0x1a99cb){var _0x2b214c=typeof _0x10ee93[_0x0a5d('0x1e')]==='undefined'&&typeof _0x10ee93[_0x0a5d('0x1f')]==='undefined';var _0x2fb8da=_0x1a99cb[_0x0a5d('0x20')];var _0x3ae8a1=_0x2b214c?0x0:_0x10ee93[_0x0a5d('0x1e')];var _0x4421cf=_0x2b214c?_0x1a99cb['count']:_0x10ee93['offset']+_0x10ee93[_0x0a5d('0x1f')];var _0x3fe4ef;if(_0x4421cf>=_0x2fb8da){_0x4421cf=_0x2fb8da;_0x3fe4ef=0xc8;}else{_0x3fe4ef=0xce;}_0x705468['status'](_0x3fe4ef);return _0x705468['set'](_0x0a5d('0x21'),_0x3ae8a1+'-'+_0x4421cf+'/'+_0x2fb8da)[_0x0a5d('0x1d')](_0x1a99cb);}return null;};}function saveUpdates(_0x3e2f09){return function(_0x21a7c9){if(_0x21a7c9){return _0x21a7c9[_0x0a5d('0x22')](_0x3e2f09)[_0x0a5d('0x12')](function(_0x387242){return _0x387242;});}return null;};}function removeEntity(_0xef4fa){return function(_0x81ee33){if(_0x81ee33){return _0x81ee33[_0x0a5d('0x23')]()[_0x0a5d('0x12')](function(){var _0x3452f9=_0x81ee33['get']({'plain':!![]});var _0x50eca4=_0x0a5d('0x24');return db['UserProfileResource'][_0x0a5d('0x23')]({'where':{'type':_0x50eca4,'resourceId':_0x3452f9['id']}})[_0x0a5d('0x12')](function(){return _0x81ee33;});})[_0x0a5d('0x12')](function(){_0xef4fa[_0x0a5d('0x1c')](0xcc)[_0x0a5d('0x25')]();});}};}function handleEntityNotFound(_0x5ea70b){return function(_0x3e2fba){if(!_0x3e2fba){_0x5ea70b['sendStatus'](0x194);}return _0x3e2fba;};}function handleError(_0x56f099,_0x4059cf){_0x4059cf=_0x4059cf||0x1f4;return function(_0x56676b){logger['error'](_0x56676b[_0x0a5d('0x26')]);if(_0x56676b['name']){delete _0x56676b['name'];}_0x56f099[_0x0a5d('0x1c')](_0x4059cf)[_0x0a5d('0x27')](_0x56676b);};}exports['index']=function(_0x51f25f,_0x4e2056){var _0x1cdf90={'include':[{'model':db[_0x0a5d('0x28')],'as':_0x0a5d('0x29')}]},_0xa963ee={},_0x16ccf8={'count':0x0,'rows':[]};var _0x1e7236=_['map'](db[_0x0a5d('0x2a')]['rawAttributes'],function(_0x1083a9){return{'name':_0x1083a9['fieldName'],'type':_0x1083a9[_0x0a5d('0x2b')][_0x0a5d('0x2c')]};});_0xa963ee['model']=_['map'](_0x1e7236,_0x0a5d('0x2d'));_0xa963ee[_0x0a5d('0x2e')]=_[_0x0a5d('0x2f')](_0x51f25f[_0x0a5d('0x2e')]);_0xa963ee[_0x0a5d('0x30')]=_[_0x0a5d('0x31')](_0xa963ee['model'],_0xa963ee[_0x0a5d('0x2e')]);_0x1cdf90[_0x0a5d('0x32')]=_[_0x0a5d('0x31')](_0xa963ee['model'],qs[_0x0a5d('0x33')](_0x51f25f[_0x0a5d('0x2e')][_0x0a5d('0x33')]));_0x1cdf90['attributes']=_0x1cdf90['attributes'][_0x0a5d('0x34')]?_0x1cdf90[_0x0a5d('0x32')]:_0xa963ee[_0x0a5d('0x35')];if(!_0x51f25f[_0x0a5d('0x2e')][_0x0a5d('0x36')](_0x0a5d('0x37'))){_0x1cdf90[_0x0a5d('0x1f')]=qs[_0x0a5d('0x1f')](_0x51f25f[_0x0a5d('0x2e')][_0x0a5d('0x1f')]);_0x1cdf90[_0x0a5d('0x1e')]=qs[_0x0a5d('0x1e')](_0x51f25f[_0x0a5d('0x2e')]['offset']);}_0x1cdf90[_0x0a5d('0x38')]=qs[_0x0a5d('0x39')](_0x51f25f['query'][_0x0a5d('0x39')]);_0x1cdf90['where']=qs[_0x0a5d('0x30')](_['pick'](_0x51f25f['query'],_0xa963ee[_0x0a5d('0x30')]),_0x1e7236);if(_0x51f25f[_0x0a5d('0x2e')]['filter']){_0x1cdf90['where']=_['merge'](_0x1cdf90[_0x0a5d('0x3a')],{'$or':_[_0x0a5d('0x3b')](_0x1e7236,function(_0x224cb4){if(_0x224cb4[_0x0a5d('0x2b')]!==_0x0a5d('0x3c')){var _0x5f4ff6={};_0x5f4ff6[_0x224cb4[_0x0a5d('0x2d')]]={'$like':'%'+_0x51f25f[_0x0a5d('0x2e')][_0x0a5d('0x3d')]+'%'};return _0x5f4ff6;}})});}_0x1cdf90=_[_0x0a5d('0x3e')]({},_0x1cdf90,_0x51f25f[_0x0a5d('0x3f')]);var _0x4e2ecc={'where':_0x1cdf90['where']};return db['ChatWebsite'][_0x0a5d('0x20')](_0x4e2ecc)[_0x0a5d('0x12')](function(_0x23abfe){_0x16ccf8['count']=_0x23abfe;if(_0x51f25f[_0x0a5d('0x2e')][_0x0a5d('0x40')]){_0x1cdf90[_0x0a5d('0x41')]=[{'all':!![]}];}return db[_0x0a5d('0x2a')][_0x0a5d('0x42')](_0x1cdf90);})[_0x0a5d('0x12')](function(_0x2ac97f){_0x16ccf8[_0x0a5d('0x43')]=_0x2ac97f;return _0x16ccf8;})[_0x0a5d('0x12')](respondWithFilteredResult(_0x4e2056,_0x1cdf90))['catch'](handleError(_0x4e2056,null));};exports['show']=function(_0x253b38,_0x3d4b5b){var _0x1465db={'raw':![],'where':{'id':_0x253b38['params']['id']},'include':[{'model':db[_0x0a5d('0x28')],'as':_0x0a5d('0x29')}]},_0x32f4ee={};_0x32f4ee['model']=_[_0x0a5d('0x2f')](db[_0x0a5d('0x2a')][_0x0a5d('0x44')]);_0x32f4ee[_0x0a5d('0x2e')]=_[_0x0a5d('0x2f')](_0x253b38[_0x0a5d('0x2e')]);_0x32f4ee['filters']=_[_0x0a5d('0x31')](_0x32f4ee[_0x0a5d('0x35')],_0x32f4ee['query']);_0x1465db[_0x0a5d('0x32')]=_[_0x0a5d('0x31')](_0x32f4ee[_0x0a5d('0x35')],qs[_0x0a5d('0x33')](_0x253b38[_0x0a5d('0x2e')]['fields']));_0x1465db[_0x0a5d('0x32')]=_0x1465db[_0x0a5d('0x32')][_0x0a5d('0x34')]?_0x1465db[_0x0a5d('0x32')]:_0x32f4ee[_0x0a5d('0x35')];if(_0x253b38[_0x0a5d('0x2e')][_0x0a5d('0x40')]){_0x1465db[_0x0a5d('0x41')]=[{'all':!![]}];}_0x1465db=_[_0x0a5d('0x3e')]({},_0x1465db,_0x253b38['options']);return db[_0x0a5d('0x2a')][_0x0a5d('0x45')](_0x1465db)[_0x0a5d('0x12')](handleEntityNotFound(_0x3d4b5b,null))[_0x0a5d('0x12')](respondWithResult(_0x3d4b5b,null))[_0x0a5d('0x46')](handleError(_0x3d4b5b,null));};exports[_0x0a5d('0x47')]=function(_0x6637b9,_0x22c07){return db[_0x0a5d('0x2a')][_0x0a5d('0x47')](_0x6637b9['body'],{})[_0x0a5d('0x12')](function(_0x3f33a4){var _0x4eca45=_0x6637b9[_0x0a5d('0x48')][_0x0a5d('0x49')]({'plain':!![]});if(!_0x4eca45)throw new Error(_0x0a5d('0x4a'));if(_0x4eca45['role']===_0x0a5d('0x48')){var _0x1d2512=_0x3f33a4[_0x0a5d('0x49')]({'plain':!![]});var _0x4386fb='ChatWebsites';return db['UserProfileSection'][_0x0a5d('0x45')]({'where':{'name':_0x4386fb,'userProfileId':_0x4eca45[_0x0a5d('0x4b')]},'raw':!![]})[_0x0a5d('0x12')](function(_0x3188f2){if(_0x3188f2&&_0x3188f2['autoAssociation']===0x0){return db[_0x0a5d('0x4c')]['create']({'name':_0x1d2512[_0x0a5d('0x2d')],'resourceId':_0x1d2512['id'],'type':_0x3188f2[_0x0a5d('0x2d')],'sectionId':_0x3188f2['id']},{})[_0x0a5d('0x12')](function(){return _0x3f33a4;});}else{return _0x3f33a4;}})['catch'](function(_0x1dd444){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1dd444);throw _0x1dd444;});}return _0x3f33a4;})[_0x0a5d('0x12')](respondWithResult(_0x22c07,0xc9))[_0x0a5d('0x46')](handleError(_0x22c07,null));};exports[_0x0a5d('0x22')]=function(_0x2e0593,_0x56895d){if(_0x2e0593[_0x0a5d('0x4d')]['id']){delete _0x2e0593[_0x0a5d('0x4d')]['id'];}return db[_0x0a5d('0x2a')]['find']({'where':{'id':_0x2e0593[_0x0a5d('0x4e')]['id']},'include':[{'model':db['Pause'],'as':_0x0a5d('0x29')}]})[_0x0a5d('0x12')](handleEntityNotFound(_0x56895d,null))[_0x0a5d('0x12')](saveUpdates(_0x2e0593[_0x0a5d('0x4d')],null))[_0x0a5d('0x12')](respondWithResult(_0x56895d,null))[_0x0a5d('0x46')](handleError(_0x56895d,null));};exports[_0x0a5d('0x23')]=function(_0x1650d7,_0x7f4e51){return db[_0x0a5d('0x2a')][_0x0a5d('0x45')]({'where':{'id':_0x1650d7[_0x0a5d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x7f4e51,null))['then'](removeEntity(_0x7f4e51,null))['catch'](handleError(_0x7f4e51,null));};exports[_0x0a5d('0x4f')]=function(_0x4fef44,_0x4e1ebb){return db[_0x0a5d('0x2a')]['describe']()[_0x0a5d('0x12')](respondWithResult(_0x4e1ebb,null))[_0x0a5d('0x46')](handleError(_0x4e1ebb,null));};exports[_0x0a5d('0x50')]=function(_0xff744e,_0x225717){if(_0xff744e[_0x0a5d('0x4d')]['id']){delete _0xff744e['body']['id'];}return db[_0x0a5d('0x2a')][_0x0a5d('0x45')]({'where':{'id':_0xff744e[_0x0a5d('0x4e')]['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0x225717,null))['then'](function(_0x1b7b79){if(_0x1b7b79){_0xff744e[_0x0a5d('0x4d')][_0x0a5d('0x51')]=_0x1b7b79['id'];return db[_0x0a5d('0x52')]['create'](_0xff744e[_0x0a5d('0x4d')]);}})[_0x0a5d('0x12')](respondWithResult(_0x225717,null))['catch'](handleError(_0x225717,null));};exports['getDispositions']=function(_0x3ab0e8,_0x2e17f4){var _0x18f0f4={'raw':![],'where':{}};var _0x14646e={};var _0x5ac037={'count':0x0,'rows':[]};return db[_0x0a5d('0x2a')]['findOne']({'where':{'id':_0x3ab0e8[_0x0a5d('0x4e')]['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0x2e17f4,null))[_0x0a5d('0x12')](function(_0x4dfb11){if(_0x4dfb11){_0x14646e['model']=_['keys'](db[_0x0a5d('0x52')][_0x0a5d('0x44')]);_0x14646e['query']=_['keys'](_0x3ab0e8[_0x0a5d('0x2e')]);_0x14646e[_0x0a5d('0x30')]=_[_0x0a5d('0x31')](_0x14646e[_0x0a5d('0x35')],_0x14646e[_0x0a5d('0x2e')]);_0x18f0f4[_0x0a5d('0x32')]=_['intersection'](_0x14646e['model'],qs[_0x0a5d('0x33')](_0x3ab0e8[_0x0a5d('0x2e')]['fields']));_0x18f0f4[_0x0a5d('0x32')]=_0x18f0f4[_0x0a5d('0x32')][_0x0a5d('0x34')]?_0x18f0f4[_0x0a5d('0x32')]:_0x14646e[_0x0a5d('0x35')];if(!_0x3ab0e8[_0x0a5d('0x2e')][_0x0a5d('0x36')]('nolimit')){_0x18f0f4[_0x0a5d('0x1f')]=qs[_0x0a5d('0x1f')](_0x3ab0e8[_0x0a5d('0x2e')][_0x0a5d('0x1f')]);_0x18f0f4['offset']=qs['offset'](_0x3ab0e8[_0x0a5d('0x2e')]['offset']);}_0x18f0f4[_0x0a5d('0x38')]=qs[_0x0a5d('0x39')](_0x3ab0e8[_0x0a5d('0x2e')][_0x0a5d('0x39')]);_0x18f0f4[_0x0a5d('0x3a')]=qs[_0x0a5d('0x30')](_[_0x0a5d('0x53')](_0x3ab0e8['query'],_0x14646e[_0x0a5d('0x30')]));_0x18f0f4[_0x0a5d('0x3a')][_0x0a5d('0x51')]=_0x4dfb11['id'];if(_0x3ab0e8[_0x0a5d('0x2e')]['filter']){_0x18f0f4[_0x0a5d('0x3a')]=_['merge'](_0x18f0f4['where'],{'$or':_['map'](_0x18f0f4[_0x0a5d('0x32')],function(_0x58039d){var _0x532ead={};_0x532ead[_0x58039d]={'$like':'%'+_0x3ab0e8[_0x0a5d('0x2e')][_0x0a5d('0x3d')]+'%'};return _0x532ead;})});}_0x18f0f4=_['merge']({},_0x18f0f4,_0x3ab0e8[_0x0a5d('0x3f')]);return db[_0x0a5d('0x52')][_0x0a5d('0x20')]({'where':_0x18f0f4[_0x0a5d('0x3a')]})[_0x0a5d('0x12')](function(_0x5a7ae9){_0x5ac037['count']=_0x5a7ae9;if(_0x3ab0e8[_0x0a5d('0x2e')][_0x0a5d('0x40')]){_0x18f0f4[_0x0a5d('0x41')]=[{'all':!![]}];}return db[_0x0a5d('0x52')][_0x0a5d('0x42')](_0x18f0f4);})[_0x0a5d('0x12')](function(_0x8ccc12){_0x5ac037[_0x0a5d('0x43')]=_0x8ccc12;return _0x5ac037;});}})[_0x0a5d('0x12')](respondWithFilteredResult(_0x2e17f4,_0x18f0f4))[_0x0a5d('0x46')](handleError(_0x2e17f4,null));};exports['removeDispositions']=function(_0x4648b7,_0x295adb){return db[_0x0a5d('0x2a')][_0x0a5d('0x45')]({'where':{'id':_0x4648b7[_0x0a5d('0x4e')]['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0x295adb,null))['then'](function(_0x45a8f6){if(_0x45a8f6){return _0x45a8f6['removeDispositions'](_0x4648b7['query'][_0x0a5d('0x54')]);}})[_0x0a5d('0x12')](respondWithStatusCode(_0x295adb,null))[_0x0a5d('0x46')](handleError(_0x295adb,null));};exports['addAnswer']=function(_0x4d28b6,_0x5486ac){if(_0x4d28b6[_0x0a5d('0x4d')]['id']){delete _0x4d28b6[_0x0a5d('0x4d')]['id'];}return db['ChatWebsite'][_0x0a5d('0x45')]({'where':{'id':_0x4d28b6[_0x0a5d('0x4e')]['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0x5486ac,null))[_0x0a5d('0x12')](function(_0x470334){if(_0x470334){_0x4d28b6['body']['ChatWebsiteId']=_0x470334['id'];return db[_0x0a5d('0x55')][_0x0a5d('0x47')](_0x4d28b6[_0x0a5d('0x4d')]);}})['then'](respondWithResult(_0x5486ac,null))[_0x0a5d('0x46')](handleError(_0x5486ac,null));};exports[_0x0a5d('0x56')]=function(_0x191f8d,_0x1abf83){var _0xb823de={'raw':![],'where':{}};var _0x259468={};var _0x20cd14={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x191f8d[_0x0a5d('0x4e')]['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0x1abf83,null))[_0x0a5d('0x12')](function(_0x3691f3){if(_0x3691f3){_0x259468[_0x0a5d('0x35')]=_['keys'](db[_0x0a5d('0x55')][_0x0a5d('0x44')]);_0x259468[_0x0a5d('0x2e')]=_['keys'](_0x191f8d['query']);_0x259468[_0x0a5d('0x30')]=_['intersection'](_0x259468[_0x0a5d('0x35')],_0x259468[_0x0a5d('0x2e')]);_0xb823de[_0x0a5d('0x32')]=_[_0x0a5d('0x31')](_0x259468['model'],qs[_0x0a5d('0x33')](_0x191f8d['query']['fields']));_0xb823de[_0x0a5d('0x32')]=_0xb823de[_0x0a5d('0x32')][_0x0a5d('0x34')]?_0xb823de[_0x0a5d('0x32')]:_0x259468['model'];if(!_0x191f8d['query'][_0x0a5d('0x36')](_0x0a5d('0x37'))){_0xb823de[_0x0a5d('0x1f')]=qs['limit'](_0x191f8d['query'][_0x0a5d('0x1f')]);_0xb823de[_0x0a5d('0x1e')]=qs[_0x0a5d('0x1e')](_0x191f8d['query'][_0x0a5d('0x1e')]);}_0xb823de[_0x0a5d('0x38')]=qs['sort'](_0x191f8d[_0x0a5d('0x2e')]['sort']);_0xb823de['where']=qs[_0x0a5d('0x30')](_[_0x0a5d('0x53')](_0x191f8d[_0x0a5d('0x2e')],_0x259468[_0x0a5d('0x30')]));_0xb823de['where'][_0x0a5d('0x51')]=_0x3691f3['id'];if(_0x191f8d[_0x0a5d('0x2e')][_0x0a5d('0x3d')]){_0xb823de[_0x0a5d('0x3a')]=_[_0x0a5d('0x3e')](_0xb823de[_0x0a5d('0x3a')],{'$or':_[_0x0a5d('0x3b')](_0xb823de[_0x0a5d('0x32')],function(_0x44739e){var _0x298d6f={};_0x298d6f[_0x44739e]={'$like':'%'+_0x191f8d[_0x0a5d('0x2e')]['filter']+'%'};return _0x298d6f;})});}_0xb823de=_[_0x0a5d('0x3e')]({},_0xb823de,_0x191f8d[_0x0a5d('0x3f')]);return db[_0x0a5d('0x55')][_0x0a5d('0x20')]({'where':_0xb823de[_0x0a5d('0x3a')]})[_0x0a5d('0x12')](function(_0x377643){_0x20cd14[_0x0a5d('0x20')]=_0x377643;if(_0x191f8d['query'][_0x0a5d('0x40')]){_0xb823de[_0x0a5d('0x41')]=[{'all':!![]}];}return db[_0x0a5d('0x55')][_0x0a5d('0x42')](_0xb823de);})[_0x0a5d('0x12')](function(_0x54bb73){_0x20cd14[_0x0a5d('0x43')]=_0x54bb73;return _0x20cd14;});}})[_0x0a5d('0x12')](respondWithFilteredResult(_0x1abf83,_0xb823de))[_0x0a5d('0x46')](handleError(_0x1abf83,null));};exports[_0x0a5d('0x57')]=function(_0x24b884,_0x2dd868){return db[_0x0a5d('0x2a')][_0x0a5d('0x45')]({'where':{'id':_0x24b884[_0x0a5d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2dd868,null))[_0x0a5d('0x12')](function(_0x1392e0){if(_0x1392e0){return _0x1392e0['removeAnswers'](_0x24b884['query'][_0x0a5d('0x54')]);}})[_0x0a5d('0x12')](respondWithStatusCode(_0x2dd868,null))['catch'](handleError(_0x2dd868,null));};exports['addLogo']=function(_0x173c1e,_0x12e88a){_0x173c1e[_0x0a5d('0x4d')][_0x0a5d('0x58')]=_0x173c1e['file']['filename'];return db[_0x0a5d('0x2a')][_0x0a5d('0x45')]({'where':{'id':_0x173c1e[_0x0a5d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x12e88a,null))['then'](saveUpdates(_0x173c1e[_0x0a5d('0x4d')],null))[_0x0a5d('0x12')](respondWithResult(_0x12e88a,null))[_0x0a5d('0x46')](handleError(_0x12e88a,null));};exports[_0x0a5d('0x59')]=function(_0xdaa037,_0xb10e48){_0xdaa037[_0x0a5d('0x4d')]['agentAvatar']=_0xdaa037[_0x0a5d('0x5a')][_0x0a5d('0x5b')];return db[_0x0a5d('0x2a')][_0x0a5d('0x45')]({'where':{'id':_0xdaa037[_0x0a5d('0x4e')]['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0xb10e48,null))[_0x0a5d('0x12')](saveUpdates(_0xdaa037[_0x0a5d('0x4d')],null))[_0x0a5d('0x12')](respondWithResult(_0xb10e48,null))[_0x0a5d('0x46')](handleError(_0xb10e48,null));};exports['addCustomerAvatar']=function(_0x5a0061,_0xfe27df){_0x5a0061[_0x0a5d('0x4d')][_0x0a5d('0x5c')]=_0x5a0061['file'][_0x0a5d('0x5b')];return db[_0x0a5d('0x2a')][_0x0a5d('0x45')]({'where':{'id':_0x5a0061['params']['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0xfe27df,null))[_0x0a5d('0x12')](saveUpdates(_0x5a0061['body'],null))['then'](respondWithResult(_0xfe27df,null))[_0x0a5d('0x46')](handleError(_0xfe27df,null));};exports[_0x0a5d('0x5d')]=function(_0x94f6ab,_0x5bab47){_0x94f6ab[_0x0a5d('0x4d')][_0x0a5d('0x5e')]=_0x94f6ab[_0x0a5d('0x5a')]['filename'];return db[_0x0a5d('0x2a')]['find']({'where':{'id':_0x94f6ab[_0x0a5d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5bab47,null))[_0x0a5d('0x12')](saveUpdates(_0x94f6ab[_0x0a5d('0x4d')],null))['then'](respondWithResult(_0x5bab47,null))[_0x0a5d('0x46')](handleError(_0x5bab47,null));};exports['getLogo']=function(_0x251c56,_0xd538e6){var _0x193408=path[_0x0a5d('0x5f')](config[_0x0a5d('0x60')],_0x0a5d('0x61'));var _0x4460e6={'where':{'id':_0x251c56[_0x0a5d('0x4e')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1f9d6d=![];return require(_0x0a5d('0x62'))['getLicense']()[_0x0a5d('0x12')](function(_0x5b920d){if(_0x5b920d){_0x1f9d6d=_0x5b920d[_0x0a5d('0x63')];}})[_0x0a5d('0x12')](function(){return db[_0x0a5d('0x2a')]['find'](_0x4460e6);})[_0x0a5d('0x12')](handleEntityNotFound(_0xd538e6,null))[_0x0a5d('0x12')](function(_0x416b4f){if(_0x416b4f){if(!_['isNil'](_0x416b4f['sitepic'])){if(fs['existsSync'](path[_0x0a5d('0x5f')](config[_0x0a5d('0x60')],_0x0a5d('0x64'),_0x416b4f[_0x0a5d('0x58')]))&&_0x1f9d6d){_0x193408=path[_0x0a5d('0x5f')](config[_0x0a5d('0x60')],_0x0a5d('0x64'),_0x416b4f[_0x0a5d('0x58')]);}}return _0xd538e6['download'](_0x193408);}})[_0x0a5d('0x46')](handleError(_0xd538e6,null));};exports[_0x0a5d('0x65')]=function(_0x5a5acc,_0x2315a4){var _0x40f09c=path[_0x0a5d('0x5f')](config['root'],_0x0a5d('0x66'));var _0x5b8a2b={'where':{'id':_0x5a5acc[_0x0a5d('0x4e')]['id']},'attributes':['id',_0x0a5d('0x67')],'raw':!![]};return db[_0x0a5d('0x2a')][_0x0a5d('0x45')](_0x5b8a2b)[_0x0a5d('0x12')](handleEntityNotFound(_0x2315a4,null))[_0x0a5d('0x12')](function(_0x5f5e01){if(_0x5f5e01){if(!_['isNil'](_0x5f5e01[_0x0a5d('0x67')])){if(fs['existsSync'](path[_0x0a5d('0x5f')](config[_0x0a5d('0x60')],_0x0a5d('0x68'),_0x5f5e01[_0x0a5d('0x67')]))){_0x40f09c=path[_0x0a5d('0x5f')](config['root'],_0x0a5d('0x68'),_0x5f5e01['agentAvatar']);}}return _0x2315a4['download'](_0x40f09c);}})[_0x0a5d('0x46')](handleError(_0x2315a4,null));};exports['getCustomerAvatar']=function(_0x330303,_0x196c1f){var _0x1867f9=path[_0x0a5d('0x5f')](config[_0x0a5d('0x60')],_0x0a5d('0x69'));var _0x44fe28={'where':{'id':_0x330303[_0x0a5d('0x4e')]['id']},'attributes':['id','customerAvatar',_0x0a5d('0x6a')],'raw':!![]};return db[_0x0a5d('0x2a')][_0x0a5d('0x45')](_0x44fe28)[_0x0a5d('0x12')](handleEntityNotFound(_0x196c1f,null))[_0x0a5d('0x12')](function(_0x2ace25){if(_0x2ace25){if(!_['isNil'](_0x2ace25[_0x0a5d('0x5c')])){if(fs[_0x0a5d('0x6b')](path[_0x0a5d('0x5f')](config[_0x0a5d('0x60')],_0x0a5d('0x68'),_0x2ace25[_0x0a5d('0x5c')]))&&_0x2ace25['showCustomerAvatar']){_0x1867f9=path[_0x0a5d('0x5f')](config[_0x0a5d('0x60')],_0x0a5d('0x68'),_0x2ace25['customerAvatar']);}}return _0x196c1f[_0x0a5d('0x6c')](_0x1867f9);}})[_0x0a5d('0x46')](handleError(_0x196c1f,null));};exports[_0x0a5d('0x6d')]=function(_0x1f5140,_0x46f054){var _0x1cd521=path[_0x0a5d('0x5f')](config['root'],_0x0a5d('0x6e'));var _0x16f3a0={'where':{'id':_0x1f5140['params']['id']},'attributes':['id',_0x0a5d('0x5e')],'raw':!![]};return db['ChatWebsite']['find'](_0x16f3a0)[_0x0a5d('0x12')](handleEntityNotFound(_0x46f054,null))[_0x0a5d('0x12')](function(_0x10a8ef){if(_0x10a8ef){if(!_['isNil'](_0x10a8ef[_0x0a5d('0x5e')])){if(fs[_0x0a5d('0x6b')](path['join'](config[_0x0a5d('0x60')],_0x0a5d('0x68'),_0x10a8ef[_0x0a5d('0x5e')]))){_0x1cd521=path[_0x0a5d('0x5f')](config[_0x0a5d('0x60')],_0x0a5d('0x68'),_0x10a8ef[_0x0a5d('0x5e')]);}}return _0x46f054[_0x0a5d('0x6c')](_0x1cd521);}})['catch'](handleError(_0x46f054,null));};exports[_0x0a5d('0x6f')]=function(_0x43ee17,_0x547d34){var _0x1f91b9=require(_0x0a5d('0x70'));var _0x4b316c=new _0x1f91b9();var _0x22446c=_0x4b316c[_0x0a5d('0x71')](_0x43ee17[_0x0a5d('0x72')]['user-agent'])[_0x0a5d('0x73')]();var _0x3ff6b8={'body':_0x43ee17[_0x0a5d('0x4d')],'channel':_0x0a5d('0x74')};var _0x5afd2c=[];var _0x491a5d=[];var _0x100c08={};var _0x4ce06a=![];return db[_0x0a5d('0x75')][_0x0a5d('0x4f')]()[_0x0a5d('0x12')](function(_0x2aa5a0){if(!_0x2aa5a0){throw new db[(_0x0a5d('0x76'))]['ValidationError'](_0x0a5d('0x77'));}_0x5afd2c=_[_0x0a5d('0x78')](_[_0x0a5d('0x2f')](_0x2aa5a0),[_0x0a5d('0x79'),_0x0a5d('0x7a')]);_0x491a5d=_[_0x0a5d('0x78')](_[_0x0a5d('0x2f')](_0x2aa5a0),[_0x0a5d('0x79'),_0x0a5d('0x7a'),'CompanyId','ListId']);if(_0x43ee17['body']['id']){delete _0x43ee17[_0x0a5d('0x4d')]['id'];}if(_[_0x0a5d('0x7b')](_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0x7c')])){throw new db[(_0x0a5d('0x76'))][(_0x0a5d('0x7d'))](_0x0a5d('0x7e'));}if(_[_0x0a5d('0x7b')](_0x43ee17['body'][_0x0a5d('0x4d')])||_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0x4d')]===''){throw new db[(_0x0a5d('0x76'))][(_0x0a5d('0x7d'))](_0x0a5d('0x7f'));}if(_['isNil'](_0x43ee17[_0x0a5d('0x4d')]['mapKey'])){throw new db[(_0x0a5d('0x76'))][(_0x0a5d('0x7d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x491a5d);}if(!_[_0x0a5d('0x80')](_0x491a5d,_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0x81')])){throw new db[(_0x0a5d('0x76'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x491a5d);}_0x100c08[_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0x81')]]=_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0x7c')];})[_0x0a5d('0x12')](function(){return db[_0x0a5d('0x2a')][_0x0a5d('0x45')]({'where':{'id':_0x43ee17['params']['id']},'include':[{'model':db[_0x0a5d('0x82')],'as':'List','include':[{'model':db[_0x0a5d('0x75')],'as':_0x0a5d('0x83'),'where':_0x100c08,'limit':0x1,'order':[[_0x0a5d('0x7a'),_0x0a5d('0x84')]]}]},{'model':db[_0x0a5d('0x85')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x547d34,null))['then'](function(_0x4a5366){if(_0x4a5366&&_0x4a5366[_0x0a5d('0x86')]){_0x3ff6b8[_0x0a5d('0x87')]=_0x4a5366;_0x3ff6b8[_0x0a5d('0x88')]=_0x4a5366[_0x0a5d('0x89')];_0x3ff6b8[_0x0a5d('0x8a')]=_0x4a5366[_0x0a5d('0x86')];_0x3ff6b8['applications']=_[_0x0a5d('0x8b')](_0x3ff6b8[_0x0a5d('0x88')],[_0x0a5d('0x8c')],[_0x0a5d('0x8d')]);if(_0x3ff6b8[_0x0a5d('0x87')][_0x0a5d('0x89')]){delete _0x3ff6b8[_0x0a5d('0x87')][_0x0a5d('0x89')];}if(_0x3ff6b8[_0x0a5d('0x87')][_0x0a5d('0x86')]&&_0x3ff6b8[_0x0a5d('0x87')][_0x0a5d('0x86')][_0x0a5d('0x83')][_0x0a5d('0x34')]){return _0x3ff6b8[_0x0a5d('0x87')]['List'][_0x0a5d('0x83')][0x0];}var _0x4dea7a=_[_0x0a5d('0x8e')](_0x43ee17[_0x0a5d('0x4d')],{'firstName':_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0x7c')],'ListId':_0x4a5366[_0x0a5d('0x8f')]});_0x4dea7a[_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0x81')]]=_0x43ee17['body'][_0x0a5d('0x7c')];return db[_0x0a5d('0x75')][_0x0a5d('0x47')](_0x4dea7a,{'fields':_0x5afd2c,'raw':!![]});}})[_0x0a5d('0x12')](handleEntityNotFound(_0x547d34,null))[_0x0a5d('0x12')](function(_0x4d6c50){_0x3ff6b8[_0x0a5d('0x90')]=_0x4d6c50;var _0x5d8f97=_0x43ee17['body'][_0x0a5d('0x91')];if(_0x43ee17['headers'][_0x0a5d('0x92')]){_0x5d8f97=_0x43ee17[_0x0a5d('0x72')]['cf-connecting-ip'];}else if(_0x43ee17[_0x0a5d('0x72')][_0x0a5d('0x93')]){_0x5d8f97=_['first'](_0x43ee17['headers'][_0x0a5d('0x93')][_0x0a5d('0x94')](','));}if(_0x4d6c50){var _0x456a69={'ContactId':_0x4d6c50['id'],'ChatWebsiteId':_0x43ee17[_0x0a5d('0x4e')]['id'],'from':(_0x4d6c50[_0x0a5d('0x95')]||'')+'\x20'+(_0x4d6c50[_0x0a5d('0x96')]||''),'customerIp':_0x5d8f97,'customerPort':_0x43ee17[_0x0a5d('0x72')][_0x0a5d('0x97')]?_0x43ee17[_0x0a5d('0x72')][_0x0a5d('0x97')]:null,'referer':_0x43ee17['body']['referer'],'browserName':_0x22446c[_0x0a5d('0x98')][_0x0a5d('0x2d')]&&_0x22446c[_0x0a5d('0x98')][_0x0a5d('0x99')]?util['format']('%s\x20%s',_0x22446c[_0x0a5d('0x98')][_0x0a5d('0x2d')],_0x22446c[_0x0a5d('0x98')][_0x0a5d('0x99')]):_0x0a5d('0x9a'),'browserVersion':_0x22446c['browser'][_0x0a5d('0x99')]||_0x0a5d('0x9a'),'osName':util[_0x0a5d('0x9b')](_0x0a5d('0x9c'),_0x22446c['os'][_0x0a5d('0x2d')],_0x22446c['os'][_0x0a5d('0x99')]),'osVersion':_0x22446c['os'][_0x0a5d('0x99')],'deviceModel':_0x22446c[_0x0a5d('0x9d')]['model']&&_0x22446c[_0x0a5d('0x9d')][_0x0a5d('0x9e')]?util[_0x0a5d('0x9b')]('%s\x20%s\x20%s',_0x22446c[_0x0a5d('0x9d')]['model'],_0x22446c['device'][_0x0a5d('0x9e')],_0x22446c[_0x0a5d('0x9d')][_0x0a5d('0x2b')]):null,'deviceVendor':_0x22446c[_0x0a5d('0x9d')][_0x0a5d('0x9e')],'deviceType':_0x22446c[_0x0a5d('0x9d')][_0x0a5d('0x2b')],'formData':JSON[_0x0a5d('0x15')](_0x43ee17[_0x0a5d('0x4d')])};var _0x156922={'ChatWebsiteId':_0x43ee17[_0x0a5d('0x4e')]['id'],'closed':![]};if(_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0x9f')]){_0x156922[_0x0a5d('0x9f')]=_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0x9f')];return db[_0x0a5d('0xa0')]['find']({'where':_0x156922})[_0x0a5d('0x12')](function(_0x2fbb0e){if(_0x2fbb0e){return[_0x2fbb0e,![]];}_0x456a69[_0x0a5d('0x9f')]=_0x43ee17['body'][_0x0a5d('0x9f')];_0x456a69[_0x0a5d('0xa1')]=_0x43ee17[_0x0a5d('0x4d')]['externalUrl'];return db[_0x0a5d('0xa0')][_0x0a5d('0x47')](_0x456a69)['then'](function(_0x164efa){return[_0x164efa,!![]];});});}_0x156922[_0x0a5d('0xa2')]=_0x4d6c50['id'];if(_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0xa3')]&&_0x43ee17[_0x0a5d('0x4d')]['interaction']['id']){_0x156922['id']=_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0xa3')]['id'];return db[_0x0a5d('0xa0')]['find']({'where':_0x156922})[_0x0a5d('0x12')](function(_0x793eb7){if(_0x793eb7){return[_0x793eb7,![]];}return db[_0x0a5d('0xa0')][_0x0a5d('0x47')](_0x456a69)[_0x0a5d('0x12')](function(_0x4a87c2){return[_0x4a87c2,!![]];});});}return db['ChatInteraction'][_0x0a5d('0x47')](_0x456a69)[_0x0a5d('0x12')](function(_0x564187){return[_0x564187,!![]];});}})[_0x0a5d('0xa4')](function(_0x4c1991,_0x454c8e){if(_0x4c1991){_0x4ce06a=_0x454c8e;if(!_0x454c8e){var _0x3f8925={'from':(_0x3ff6b8[_0x0a5d('0x90')][_0x0a5d('0x95')]||'')+'\x20'+(_0x3ff6b8[_0x0a5d('0x90')]['lastName']||'')};if(_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0x9f')]&&_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0xa5')]&&_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0x9f')]!=_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0xa5')]){_0x3f8925[_0x0a5d('0x9f')]=_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0xa5')];}return _0x4c1991[_0x0a5d('0x22')](_0x3f8925);}else{return _0x4c1991;}}})[_0x0a5d('0x12')](function(_0x1c61e9){_0x3ff6b8[_0x0a5d('0xa3')]=_0x1c61e9[_0x0a5d('0x49')]({'plain':!![]});_0x3ff6b8['interaction'][_0x0a5d('0xa6')]=_0x4ce06a;if(_0x3ff6b8[_0x0a5d('0xa3')]['created']){if(_0x3ff6b8[_0x0a5d('0x87')][_0x0a5d('0xa7')]){_0x3ff6b8[_0x0a5d('0x88')][_0x0a5d('0xa8')]({'id':0x0,'priority':_0x3ff6b8['applications'][_0x0a5d('0x34')]+0x1,'app':_0x0a5d('0xa9'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x0a5d('0xaa')]['create']({'body':_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0x4d')],'ChatWebsiteId':_0x43ee17[_0x0a5d('0x4e')]['id'],'ChatInteractionId':_0x1c61e9['id'],'direction':'in','ContactId':_0x3ff6b8[_0x0a5d('0x90')]['id'],'AttachmentId':_0x43ee17[_0x0a5d('0x4d')][_0x0a5d('0xab')]});})[_0x0a5d('0x12')](function(_0x2b720f){_0x3ff6b8[_0x0a5d('0x19')]=_0x2b720f;if(_0x3ff6b8['interaction'][_0x0a5d('0xac')]){return db[_0x0a5d('0xad')][_0x0a5d('0x45')]({'attributes':['id',_0x0a5d('0x2d')],'where':{'id':_0x3ff6b8['interaction'][_0x0a5d('0xac')]}})[_0x0a5d('0x12')](function(_0x567203){if(_0x567203){_0x3ff6b8[_0x0a5d('0x88')][_0x0a5d('0xae')]({'id':0x0,'priority':0x0,'app':_0x0a5d('0xaf'),'appdata':_0x567203['name']+','+(_0x3ff6b8[_0x0a5d('0x87')][_0x0a5d('0xb0')]||0xa),'interval':'*,*,*,*'});_0x3ff6b8[_0x0a5d('0xb1')]=!![];}return respondWithRpcPromise(_0x0a5d('0xb2'),'startRouting',_0x3ff6b8);});}return respondWithRpcPromise(_0x0a5d('0xb2'),'startRouting',_0x3ff6b8);})['then'](function(_0x3738ae){respondWithRpcPromise(_0x0a5d('0xb3'),_0x0a5d('0xb3'),{'event':_0x0a5d('0x6f'),'message':_0x3738ae},client9002);return _0x3738ae;})[_0x0a5d('0x12')](respondWithResult(_0x547d34,null))[_0x0a5d('0x46')](handleError(_0x547d34,null));};exports['offline']=function(_0xa5adb9,_0x4a3e05){var _0x41d54e,_0x4bbb1f,_0x7bc63f;var _0x168474=[];var _0x1966cb={};var _0x33d419=_0xa5adb9[_0x0a5d('0xb4')]||[];var _0x5d996b=[];var _0x5ad6d6;return db[_0x0a5d('0x75')][_0x0a5d('0x4f')]()[_0x0a5d('0x12')](function(_0x299e66){if(!_0x299e66){throw new db['Sequelize'][(_0x0a5d('0x7d'))](_0x0a5d('0x77'));}_0x168474=_[_0x0a5d('0x78')](_[_0x0a5d('0x2f')](_0x299e66),[_0x0a5d('0x79'),'updatedAt',_0x0a5d('0xb5'),_0x0a5d('0x8f')]);if(_0xa5adb9[_0x0a5d('0x4d')]['id']){delete _0xa5adb9[_0x0a5d('0x4d')]['id'];}if(_[_0x0a5d('0x7b')](_0xa5adb9['body'][_0x0a5d('0x7c')])){throw _0x4a3e05['status'](0x1f4)[_0x0a5d('0x27')](new db[(_0x0a5d('0x76'))][(_0x0a5d('0x7d'))](_0x0a5d('0x7e')));}if(_[_0x0a5d('0x7b')](_0xa5adb9[_0x0a5d('0x4d')][_0x0a5d('0x4d')])||_0xa5adb9['body'][_0x0a5d('0x4d')]===''){throw _0x4a3e05[_0x0a5d('0x1c')](0x1f4)[_0x0a5d('0x27')](new db[(_0x0a5d('0x76'))][(_0x0a5d('0x7d'))](_0x0a5d('0x7f')));}if(_[_0x0a5d('0x7b')](_0xa5adb9[_0x0a5d('0x4d')][_0x0a5d('0xb6')])){throw _0x4a3e05['status'](0x1f4)[_0x0a5d('0x27')](new db[(_0x0a5d('0x76'))][(_0x0a5d('0x7d'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x168474));}if(!_['includes'](_0x168474,_0xa5adb9[_0x0a5d('0x4d')][_0x0a5d('0xb6')])){throw _0x4a3e05[_0x0a5d('0x1c')](0x1f4)['send'](new db[(_0x0a5d('0x76'))][(_0x0a5d('0x7d'))](_0x0a5d('0xb7')+_0x168474));}_0x1966cb[_0xa5adb9[_0x0a5d('0x4d')][_0x0a5d('0xb6')]]=_0xa5adb9[_0x0a5d('0x4d')][_0x0a5d('0x7c')];})['then'](function(){return db['ChatWebsite'][_0x0a5d('0x45')]({'where':{'id':_0xa5adb9[_0x0a5d('0x4e')]['id']},'include':[{'model':db[_0x0a5d('0x82')],'as':_0x0a5d('0x86')},{'model':db[_0x0a5d('0xb8')],'as':_0x0a5d('0xb8')}]});})[_0x0a5d('0x12')](handleEntityNotFound(_0x4a3e05,null))['then'](function(_0x1f7fef){if(_0x1f7fef&&_0x1f7fef[_0x0a5d('0x86')]){_0x4bbb1f=_0x1f7fef;var _0x35d926=_[_0x0a5d('0x8e')](_0xa5adb9['body'],{'firstName':_0xa5adb9[_0x0a5d('0x4d')][_0x0a5d('0x7c')],'phone':_0xa5adb9[_0x0a5d('0x4d')][_0x0a5d('0x7c')],'ListId':_0x1f7fef[_0x0a5d('0x8f')]});_0x35d926[_0xa5adb9[_0x0a5d('0x4d')][_0x0a5d('0xb6')]]=_0xa5adb9[_0x0a5d('0x4d')][_0x0a5d('0x7c')];return db[_0x0a5d('0x75')][_0x0a5d('0xb9')]({'where':_0x1966cb,'defaults':_0x35d926});}})[_0x0a5d('0xa4')](function(_0x56a8a2){if(_0x56a8a2){_0x7bc63f=_0x56a8a2;var _0x4be04e=fs['readFileSync'](path[_0x0a5d('0x5f')](config[_0x0a5d('0x60')],_0x0a5d('0xba')),_0x0a5d('0xbb'));var _0x354a06=ejs[_0x0a5d('0xbc')](_0x4be04e,{'body':_[_0x0a5d('0xbd')](_0xa5adb9[_0x0a5d('0x4d')]['body']),'bodyTitle':_0x4bbb1f['offlineMessageBody']});return db[_0x0a5d('0xbe')][_0x0a5d('0x47')]({'body':_0x354a06,'plainBody':htmlToText[_0x0a5d('0xbf')](_0x354a06),'ContactId':_0x56a8a2['id'],'ChatWebsiteId':_0x4bbb1f['id']});}})[_0x0a5d('0x12')](function(_0x3f6789){_0x5ad6d6=_0x3f6789;if(_0x33d419[_0x0a5d('0x34')]){var _0x4eed71=_0x33d419['map'](function(_0x446838){return{'name':_0x446838[_0x0a5d('0xc0')],'basename':_0x446838[_0x0a5d('0x5b')],'type':_0x446838[_0x0a5d('0xc1')],'ChatOfflineMessageId':_0x3f6789['id']};});_0x5d996b=_0x4eed71[_0x0a5d('0x3b')](_0x40b9cc=>{var _0x357b3a={'filename':_0x40b9cc['name'],'path':path[_0x0a5d('0x5f')](config[_0x0a5d('0x60')],_0x0a5d('0xc2'),'files',_0x0a5d('0xc3'),'offline-chat',_0x40b9cc[_0x0a5d('0xc4')])};return _0x357b3a;});if(!_0x4bbb1f['openNewInteraction']){return db[_0x0a5d('0xc5')][_0x0a5d('0xc6')](function(_0x10168a){return db['Attachment']['bulkCreate'](_0x4eed71,{'transaction':_0x10168a});});}}})[_0x0a5d('0x12')](function(){if(_0x5ad6d6){_0x41d54e=_0x5ad6d6;return db[_0x0a5d('0xb8')][_0x0a5d('0xc7')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x0a5d('0xc8')],'as':_0x0a5d('0xc8'),'raw':!![]}]}]});}})[_0x0a5d('0x12')](function(_0xdf9322){if(_0xdf9322&&_0xdf9322[_0x0a5d('0xc9')]&&_0x4bbb1f[_0x0a5d('0xca')]&&_0x4bbb1f[_0x0a5d('0xcb')]){var _0x140be1=_0xdf9322['getSmtpOptions']();return respondWithRpcPromise(_0x0a5d('0xcc'),_0x0a5d('0xcd'),{'account':_0x140be1,'message':{'from':util[_0x0a5d('0x9b')](_0x0a5d('0xce'),_0xdf9322['name'],_0xdf9322[_0x0a5d('0xcf')]||_0xdf9322[_0x0a5d('0xc9')][_0x0a5d('0x48')]),'to':_0x4bbb1f[_0x0a5d('0xcb')],'subject':_0x4bbb1f['offlineMessageSubject'],'html':_0x41d54e[_0x0a5d('0x4d')],'attachments':_0x5d996b}},client9003)[_0x0a5d('0x12')](function(){return _0x41d54e;})[_0x0a5d('0x46')](function(_0xd12859){logger[_0x0a5d('0x16')](_0xd12859);});}})[_0x0a5d('0x12')](function(){if(_0x4bbb1f&&_0x4bbb1f[_0x0a5d('0xd0')]&&_0x4bbb1f[_0x0a5d('0xd1')]){var _0x2d5595=[];if(_0x33d419[_0x0a5d('0x34')]){_0x2d5595=_0x33d419[_0x0a5d('0x3b')](function(_0x5725bd){return{'name':_0x5725bd['originalname'],'basename':_0x5725bd['filename'],'type':_0x5725bd['mimetype'],'ChatOfflineMessageId':_0x5ad6d6['id']};});}var _0xc86d41;if(!_[_0x0a5d('0x7b')](_0x4bbb1f['subjectOffline'])){var _0x3367c1=_['map'](_0xa5adb9[_0x0a5d('0x4d')],function(_0x26ca83){return _0x26ca83;});var _0x5ed5d2=_['toPairsIn'](_0x3367c1)[0x0];var _0xff9dd6=_[_0x0a5d('0xd2')](_0x5ed5d2,function(_0x326645){return _0x326645;});_0xc86d41=_0xff9dd6[0x1][_0x4bbb1f[_0x0a5d('0xd3')]];}var _0x48c659={'from':_0x7bc63f[_0x0a5d('0xcf')],'firstName':_0x7bc63f[_0x0a5d('0x95')],'lastName':_0x7bc63f[_0x0a5d('0x96')],'mapKey':_0x0a5d('0xcf'),'message':{'from':_0x7bc63f[_0x0a5d('0xcf')],'to':_0x4bbb1f[_0x0a5d('0xb8')]['email'],'cc':'','subject':_[_0x0a5d('0x7b')](_0xc86d41)?_0x4bbb1f[_0x0a5d('0xd4')]:_0xc86d41,'messageId':'','sentAt':new Date(),'attach':_0x2d5595[_0x0a5d('0x34')],'attachments':_0x2d5595,'originChannel':_0x0a5d('0xd5'),'ChatWebsiteId':_0x4bbb1f['id'],'ChatOfflineMessageId':_0x41d54e['id'],'originTo':_0x4bbb1f['MailAccount'][_0x0a5d('0xcf')]},'body':_0x41d54e[_0x0a5d('0x4d')]};var _0x2b2cd8={'account':{'id':_0x4bbb1f[_0x0a5d('0xd1')]},'body':_0x48c659,'log':_0x0a5d('0xd6')};return respondWithRpcPromise('NotifyMailAccount',_0x0a5d('0xd7'),_0x2b2cd8,client9001)[_0x0a5d('0x12')](function(){return _0x41d54e;})[_0x0a5d('0x46')](function(_0x44f75c){logger['error'](_0x44f75c);});}return;})['then'](function(){if(_0x41d54e){return _0x41d54e;}})[_0x0a5d('0x12')](respondWithResult(_0x4a3e05,null))[_0x0a5d('0x46')](function(_0x3b5946){logger[_0x0a5d('0x16')](_0x0a5d('0x46'),_0x3b5946);for(var _0x24c8e3 of _0x33d419){var _0x19b1f1=path[_0x0a5d('0x5f')](config[_0x0a5d('0x60')],_0x0a5d('0xc2'),_0x0a5d('0xb4'),'attachments',_0x0a5d('0xd8'),_0x24c8e3['filename']);fs_extra['remove'](_0x19b1f1)[_0x0a5d('0x46')](function(_0x550a9b){logger['error'](_0x0a5d('0xd9'),_0x19b1f1,_0x550a9b);});}});};exports[_0x0a5d('0xda')]=function(_0x2c61a4,_0x1ca7f7){return db[_0x0a5d('0xa0')][_0x0a5d('0x45')]({'where':{'id':_0x2c61a4[_0x0a5d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1ca7f7,null))['then'](function(_0x5d640b){if(_0x5d640b){return _0x5d640b['addInteraction'](_0x2c61a4[_0x0a5d('0x4d')]['ids'],_['omit'](_0x2c61a4[_0x0a5d('0x4d')],[_0x0a5d('0x54'),'id'])||{});}})[_0x0a5d('0x12')](respondWithResult(_0x1ca7f7,null))['catch'](handleError(_0x1ca7f7,null));};exports[_0x0a5d('0xdb')]=function(_0x1b4861,_0x52daa8){var _0x4cc62a={'raw':![],'where':{}};var _0x5a6379={};var _0x12b40a={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0a5d('0xc7')]({'where':{'id':_0x1b4861[_0x0a5d('0x4e')]['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0x52daa8,null))[_0x0a5d('0x12')](function(_0xabd00){if(_0xabd00){_0x5a6379[_0x0a5d('0x35')]=_['keys'](db[_0x0a5d('0xa0')]['rawAttributes']);_0x5a6379[_0x0a5d('0x2e')]=_[_0x0a5d('0x2f')](_0x1b4861[_0x0a5d('0x2e')]);_0x5a6379[_0x0a5d('0x30')]=_[_0x0a5d('0x31')](_0x5a6379['model'],_0x5a6379[_0x0a5d('0x2e')]);_0x4cc62a[_0x0a5d('0x32')]=_['intersection'](_0x5a6379[_0x0a5d('0x35')],qs[_0x0a5d('0x33')](_0x1b4861[_0x0a5d('0x2e')][_0x0a5d('0x33')]));_0x4cc62a[_0x0a5d('0x32')]=_0x4cc62a[_0x0a5d('0x32')][_0x0a5d('0x34')]?_0x4cc62a['attributes']:_0x5a6379[_0x0a5d('0x35')];if(!_0x1b4861[_0x0a5d('0x2e')][_0x0a5d('0x36')]('nolimit')){_0x4cc62a[_0x0a5d('0x1f')]=qs[_0x0a5d('0x1f')](_0x1b4861[_0x0a5d('0x2e')][_0x0a5d('0x1f')]);_0x4cc62a[_0x0a5d('0x1e')]=qs[_0x0a5d('0x1e')](_0x1b4861['query']['offset']);}_0x4cc62a[_0x0a5d('0x38')]=qs['sort'](_0x1b4861[_0x0a5d('0x2e')][_0x0a5d('0x39')]);_0x4cc62a[_0x0a5d('0x3a')]=qs[_0x0a5d('0x30')](_[_0x0a5d('0x53')](_0x1b4861[_0x0a5d('0x2e')],_0x5a6379['filters']));_0x4cc62a[_0x0a5d('0x3a')]['ChatWebsiteId']=_0xabd00['id'];if(_0x1b4861['query']['filter']){_0x4cc62a[_0x0a5d('0x3a')]=_[_0x0a5d('0x3e')](_0x4cc62a[_0x0a5d('0x3a')],{'$or':_['map'](_0x4cc62a[_0x0a5d('0x32')],function(_0x4099e9){var _0x4afafd={};_0x4afafd[_0x4099e9]={'$like':'%'+_0x1b4861[_0x0a5d('0x2e')][_0x0a5d('0x3d')]+'%'};return _0x4afafd;})});}_0x4cc62a=_[_0x0a5d('0x3e')]({},_0x4cc62a,_0x1b4861['options']);return db[_0x0a5d('0xa0')][_0x0a5d('0x20')]({'where':_0x4cc62a[_0x0a5d('0x3a')]})[_0x0a5d('0x12')](function(_0x139ade){_0x12b40a[_0x0a5d('0x20')]=_0x139ade;if(_0x1b4861['query'][_0x0a5d('0x40')]){_0x4cc62a['include']=[{'model':db[_0x0a5d('0x75')],'as':_0x0a5d('0xdc'),'required':![]},{'model':db[_0x0a5d('0xad')],'as':_0x0a5d('0xdd'),'attributes':[_0x0a5d('0x2d'),_0x0a5d('0xde'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x0a5d('0xdf'),'attributes':['id',_0x0a5d('0x2d'),_0x0a5d('0xe0')],'where':_0x1b4861[_0x0a5d('0x2e')][_0x0a5d('0xe1')]?{'id':_0x1b4861[_0x0a5d('0x2e')][_0x0a5d('0xe1')]}:undefined,'required':_0x1b4861['query'][_0x0a5d('0xe1')]?!![]:![]}];}return db[_0x0a5d('0xa0')][_0x0a5d('0x42')](_0x4cc62a);})[_0x0a5d('0x12')](function(_0x1f17e6){_0x12b40a[_0x0a5d('0x43')]=_0x1f17e6;return _0x12b40a;});}})['then'](respondWithFilteredResult(_0x52daa8,_0x4cc62a))[_0x0a5d('0x46')](handleError(_0x52daa8,null));};function iftimePromise(_0x528538,_0x4f7a05){return respondWithRpcPromise(_0x0a5d('0xe2'),_0x0a5d('0xe3'),{'command':_0x4f7a05[_0x0a5d('0xe4')]?util[_0x0a5d('0x9b')](_0x0a5d('0xe5'),_0x528538[_0x0a5d('0xe6')],_0x4f7a05[_0x0a5d('0xe4')]):util[_0x0a5d('0x9b')](_0x0a5d('0xe7'),_0x528538[_0x0a5d('0xe6')])},client9002)[_0x0a5d('0x12')](function(_0x4149e0){var _0x349fb9=_0x4149e0&&_0x4149e0[_0x0a5d('0xe8')]('true')>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4f7a05['id'],_0x528538['id'],_0x528538[_0x0a5d('0xe6')],_0x349fb9?_0x0a5d('0xe9'):_0x0a5d('0xea'),_0x4f7a05[_0x0a5d('0xe4')]?_0x4f7a05['timezone']:_0x0a5d('0xeb'));return _0x349fb9;})['catch'](function(_0x5799b6){logger[_0x0a5d('0x16')](_0x0a5d('0xec'),_0x4f7a05['id'],_0x528538['id'],_0x528538['interval'],util[_0x0a5d('0xed')](_0x5799b6,{'showHidden':![],'depth':null}),_0x4f7a05[_0x0a5d('0xe4')]?_0x4f7a05[_0x0a5d('0xe4')]:_0x0a5d('0xeb'));return![];});}exports[_0x0a5d('0xe3')]=function(_0x187cc2,_0x3aec2c){var _0x410297=0x0;var _0x356121=0x0;var _0x455643=![];var _0x94b5ec;var _0x10f825;return db[_0x0a5d('0x2a')][_0x0a5d('0x45')]({'where':{'id':_0x187cc2['params']['id']},'include':[{'model':db[_0x0a5d('0xee')],'as':_0x0a5d('0xee'),'include':[{'model':db[_0x0a5d('0xee')],'as':_0x0a5d('0xef'),'attributes':['id',_0x0a5d('0xe6')],'raw':!![]}]}]})[_0x0a5d('0x12')](handleEntityNotFound(_0x3aec2c,null))['then'](function(_0x17f245){if(_0x17f245){_0x94b5ec=_0x17f245;return _0x17f245['getProactiveActions']({'raw':!![]});}})['then'](function(_0x3323f7){if(_0x94b5ec){if(_0x3323f7){_0x10f825=_0x3323f7;}}return require(_0x0a5d('0x62'))[_0x0a5d('0xf0')]();})[_0x0a5d('0x12')](function(_0xb730b8){if(_0xb730b8){_0x356121=_0xb730b8[_0x0a5d('0xf1')];_0x455643=_0xb730b8[_0x0a5d('0x63')];}})['then'](function(){return db[_0x0a5d('0xa0')][_0x0a5d('0x20')]({'where':{'closed':![]}});})[_0x0a5d('0x12')](function(_0x143cfe){_0x410297=_0x143cfe;if(_0x356121&&_0x143cfe>_0x356121){return db[_0x0a5d('0xf2')][_0x0a5d('0xc7')]({'where':{'id':0x1}})[_0x0a5d('0x12')](function(_0x5a2b47){if(_0x5a2b47){_0x5a2b47['increment']('chatLicenseExceeded');}});}})['then'](function(){if(_0x94b5ec['Interval']&&_0x94b5ec[_0x0a5d('0xee')][_0x0a5d('0xef')]){var _0x33b8e0=[];for(var _0xc72d5=0x0;_0xc72d5<_0x94b5ec[_0x0a5d('0xee')][_0x0a5d('0xef')][_0x0a5d('0x34')];_0xc72d5++){var _0x5f1fde=_0x94b5ec['Interval']['Intervals'][_0xc72d5][_0x0a5d('0x49')]({'plain':!![]});_0x33b8e0[_0x0a5d('0xa8')](iftimePromise(_0x5f1fde,_0x94b5ec));}return BPromise[_0x0a5d('0xf3')](_0x33b8e0)[_0x0a5d('0x12')](function(_0x2fa8c7){return _['some'](_0x2fa8c7);});}else{return!![];}})['then'](function(_0x144cf2){var _0x4d9544=fs[_0x0a5d('0xf4')](path['join'](config[_0x0a5d('0x60')],_0x0a5d('0xf5')),'utf8');var _0x30287d=new url[(_0x0a5d('0xf6'))](_0x94b5ec[_0x0a5d('0xf7')])[_0x0a5d('0xf8')];var _0x39bd92=_0x0a5d('0xf9');var _0x5f0bf7=![];var _0x2f8927={'chatVersion':_0x39bd92,'chatWebsiteAddressOrigin':_0x30287d,'remote':_0x94b5ec['remote'],'query':querystring[_0x0a5d('0x15')](_[_0x0a5d('0x3e')](_0x94b5ec['get']({'plain':!![]}),{'customerIp':_0x187cc2['headers'][_0x0a5d('0x93')]||_0x187cc2[_0x0a5d('0x72')][_0x0a5d('0xfa')]||_0x187cc2[_0x0a5d('0xfb')][_0x0a5d('0xfc')]||_0x187cc2['ip'],'referer':_0x187cc2[_0x0a5d('0x72')][_0x0a5d('0xfd')],'openedInteractions':_0x410297,'maxInteractions':_0x356121,'virtual':_0x455643['virtual'],'online':_0x144cf2,'custom':_0x455643}))[_0x0a5d('0xfe')](/'/g,'\x5c\x27')};_0x3aec2c['send'](ejs['render'](Mustache[_0x0a5d('0xbc')](_0x4d9544,_0x2f8927),{'proactiveActions':_0x10f825,'alignment':_0x94b5ec['alignment'],'verticalAlignment':_0x94b5ec[_0x0a5d('0xff')],'div_color':_0x94b5ec[_0x0a5d('0xe0')],'labelText':_0x94b5ec['labelText'],'text_color':_0x94b5ec[_0x0a5d('0x100')],'text_button_color':_0x94b5ec[_0x0a5d('0x101')],'button_color':_0x94b5ec[_0x0a5d('0x102')],'background_color':_0x94b5ec['backgroundColor'],'hideWhenOffline':_0x94b5ec[_0x0a5d('0x103')],'intervalId':_0x94b5ec[_0x0a5d('0x104')],'isDevelopment':_0x5f0bf7,'chatVersion':_0x39bd92}));})[_0x0a5d('0x46')](handleError(_0x3aec2c,null));};exports[_0x0a5d('0x105')]=function(_0x4e547e,_0x428129){var _0x4d955b=_0x4e547e[_0x0a5d('0x4e')]['id'];var _0x104788=_0x4e547e['body'];var _0x42a64b=0xc8;var _0x4b2825=null;return db['sequelize'][_0x0a5d('0xc6')]({'isolationLevel':db[_0x0a5d('0xc5')][_0x0a5d('0x106')]['ISOLATION_LEVELS'][_0x0a5d('0x107')]},function(_0x37f5e5){return db[_0x0a5d('0x2a')][_0x0a5d('0xc7')]({'where':{'id':_0x4d955b},'transaction':_0x37f5e5})[_0x0a5d('0x12')](function(_0x381b13){if(_0x381b13){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x4d955b},'transaction':_0x37f5e5})[_0x0a5d('0x12')](function(){var _0x3ad58e=_['map'](_0x104788,function(_0x28a910){_0x28a910[_0x0a5d('0x51')]=_0x4d955b;return _0x28a910;});return db[_0x0a5d('0x85')]['bulkCreate'](_0x3ad58e,{'transaction':_0x37f5e5});});}else{_0x42a64b=0x194;_0x4b2825=[];}});})[_0x0a5d('0x12')](function(){if(_0x42a64b!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x4d955b},'order':_0x0a5d('0x8c')})[_0x0a5d('0x12')](function(_0xd72e75){_0x4b2825=_0xd72e75;});}})[_0x0a5d('0x46')](function(_0x5b41d9){_0x42a64b=0x1f4;logger['error'](_0x5b41d9['stack']);if(_0x5b41d9['name']){delete _0x5b41d9[_0x0a5d('0x2d')];}_0x4b2825=_0x5b41d9;})[_0x0a5d('0x108')](function(){if(_0x4b2825===null){_0x428129[_0x0a5d('0x1b')](_0x42a64b);}else{if(_0x42a64b===0x1f4){_0x428129[_0x0a5d('0x1c')](_0x42a64b)['send'](_0x4b2825);}else{_0x428129['status'](_0x42a64b)['json'](_0x4b2825);}}});};exports['getApplications']=function(_0x53509b,_0x90c403){var _0x515983={};var _0x56a4fa={};var _0x3268a8;var _0xf83cd6;return db[_0x0a5d('0x2a')][_0x0a5d('0xc7')]({'where':{'id':_0x53509b[_0x0a5d('0x4e')]['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0x90c403,null))['then'](function(_0x3d5f32){if(_0x3d5f32){_0x3268a8=_0x3d5f32;_0x56a4fa[_0x0a5d('0x35')]=_['keys'](db[_0x0a5d('0x85')][_0x0a5d('0x44')]);_0x56a4fa[_0x0a5d('0x2e')]=_[_0x0a5d('0x2f')](_0x53509b[_0x0a5d('0x2e')]);_0x56a4fa[_0x0a5d('0x30')]=_['intersection'](_0x56a4fa[_0x0a5d('0x35')],_0x56a4fa[_0x0a5d('0x2e')]);_0x515983[_0x0a5d('0x32')]=_[_0x0a5d('0x31')](_0x56a4fa[_0x0a5d('0x35')],qs['fields'](_0x53509b[_0x0a5d('0x2e')][_0x0a5d('0x33')]));_0x515983['attributes']=_0x515983[_0x0a5d('0x32')][_0x0a5d('0x34')]?_0x515983[_0x0a5d('0x32')]:_0x56a4fa['model'];_0x515983[_0x0a5d('0x38')]=qs[_0x0a5d('0x39')](_0x53509b[_0x0a5d('0x2e')][_0x0a5d('0x39')]);_0x515983[_0x0a5d('0x3a')]=qs[_0x0a5d('0x30')](_[_0x0a5d('0x53')](_0x53509b[_0x0a5d('0x2e')],_0x56a4fa[_0x0a5d('0x30')]));if(_0x53509b['query']['filter']){_0x515983[_0x0a5d('0x3a')]=_['merge'](_0x515983[_0x0a5d('0x3a')],{'$or':_[_0x0a5d('0x3b')](_0x515983[_0x0a5d('0x32')],function(_0x24f244){var _0x3ac37d={};_0x3ac37d[_0x24f244]={'$like':'%'+_0x53509b['query'][_0x0a5d('0x3d')]+'%'};return _0x3ac37d;})});}_0x515983=_[_0x0a5d('0x3e')]({},_0x515983,_0x53509b[_0x0a5d('0x3f')]);return _0x3268a8[_0x0a5d('0x109')](_0x515983);}})[_0x0a5d('0x12')](function(_0x4b2572){if(_0x4b2572){_0xf83cd6=_0x4b2572['length'];if(!_0x53509b['query']['hasOwnProperty']('nolimit')){_0x515983[_0x0a5d('0x1f')]=qs[_0x0a5d('0x1f')](_0x53509b[_0x0a5d('0x2e')][_0x0a5d('0x1f')]);_0x515983['offset']=qs[_0x0a5d('0x1e')](_0x53509b[_0x0a5d('0x2e')][_0x0a5d('0x1e')]);}return _0x3268a8[_0x0a5d('0x109')](_0x515983);}})['then'](function(_0x3f8d3a){if(_0x3f8d3a){return _0x3f8d3a?{'count':_0xf83cd6,'rows':_0x3f8d3a}:null;}})[_0x0a5d('0x12')](respondWithResult(_0x90c403,null))[_0x0a5d('0x46')](handleError(_0x90c403,null));};exports[_0x0a5d('0x10a')]=function(_0x26336c,_0x2c570b){return db['chatProactiveAction'][_0x0a5d('0x45')]({'where':{'id':_0x26336c[_0x0a5d('0x4e')]['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0x2c570b,null))[_0x0a5d('0x12')](function(_0x34b146){if(_0x34b146){return _0x34b146['addProactiveActions'](_0x26336c[_0x0a5d('0x4d')][_0x0a5d('0x54')],_[_0x0a5d('0x10b')](_0x26336c['body'],[_0x0a5d('0x54'),'id'])||{});}})[_0x0a5d('0x12')](respondWithResult(_0x2c570b,null))[_0x0a5d('0x46')](handleError(_0x2c570b,null));};exports[_0x0a5d('0x10c')]=function(_0x3a646b,_0x5296fb){var _0x281154={};var _0x31e2ca={};var _0x1ba9ed;var _0x1b35fc;return db[_0x0a5d('0x2a')]['findOne']({'where':{'id':_0x3a646b[_0x0a5d('0x4e')]['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0x5296fb,null))[_0x0a5d('0x12')](function(_0x336f94){if(_0x336f94){_0x1ba9ed=_0x336f94;_0x31e2ca['model']=_[_0x0a5d('0x2f')](db[_0x0a5d('0x10d')][_0x0a5d('0x44')]);_0x31e2ca[_0x0a5d('0x2e')]=_['keys'](_0x3a646b[_0x0a5d('0x2e')]);_0x31e2ca[_0x0a5d('0x30')]=_[_0x0a5d('0x31')](_0x31e2ca[_0x0a5d('0x35')],_0x31e2ca['query']);_0x281154[_0x0a5d('0x32')]=_['intersection'](_0x31e2ca[_0x0a5d('0x35')],qs[_0x0a5d('0x33')](_0x3a646b['query']['fields']));_0x281154[_0x0a5d('0x32')]=_0x281154[_0x0a5d('0x32')][_0x0a5d('0x34')]?_0x281154['attributes']:_0x31e2ca[_0x0a5d('0x35')];_0x281154['order']=qs[_0x0a5d('0x39')](_0x3a646b[_0x0a5d('0x2e')][_0x0a5d('0x39')]);_0x281154['where']=qs[_0x0a5d('0x30')](_[_0x0a5d('0x53')](_0x3a646b['query'],_0x31e2ca['filters']));if(_0x3a646b[_0x0a5d('0x2e')][_0x0a5d('0x3d')]){_0x281154[_0x0a5d('0x3a')]=_[_0x0a5d('0x3e')](_0x281154[_0x0a5d('0x3a')],{'$or':_[_0x0a5d('0x3b')](_0x281154['attributes'],function(_0x468e8f){var _0xb00283={};_0xb00283[_0x468e8f]={'$like':'%'+_0x3a646b[_0x0a5d('0x2e')]['filter']+'%'};return _0xb00283;})});}_0x281154=_[_0x0a5d('0x3e')]({},_0x281154,_0x3a646b[_0x0a5d('0x3f')]);return _0x1ba9ed[_0x0a5d('0x10c')](_0x281154);}})[_0x0a5d('0x12')](function(_0x560e2c){if(_0x560e2c){_0x1b35fc=_0x560e2c[_0x0a5d('0x34')];if(!_0x3a646b[_0x0a5d('0x2e')][_0x0a5d('0x36')](_0x0a5d('0x37'))){_0x281154[_0x0a5d('0x1f')]=qs[_0x0a5d('0x1f')](_0x3a646b[_0x0a5d('0x2e')][_0x0a5d('0x1f')]);_0x281154[_0x0a5d('0x1e')]=qs['offset'](_0x3a646b[_0x0a5d('0x2e')][_0x0a5d('0x1e')]);}return _0x1ba9ed[_0x0a5d('0x10c')](_0x281154);}})[_0x0a5d('0x12')](function(_0x26bd0d){if(_0x26bd0d){return _0x26bd0d?{'count':_0x1b35fc,'rows':_0x26bd0d}:null;}})['then'](respondWithResult(_0x5296fb,null))['catch'](handleError(_0x5296fb,null));};exports[_0x0a5d('0x10e')]=function(_0x25ab99,_0x2213d1){var _0x8ce0b4=_0x25ab99[_0x0a5d('0x2e')][_0x0a5d('0x10f')]===_0x0a5d('0x110')?'offlineForm':_0x0a5d('0x111');return db[_0x0a5d('0x2a')][_0x0a5d('0x45')]({'attributes':['id',_0x8ce0b4],'where':{'id':_0x25ab99[_0x0a5d('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2213d1,null))['then'](function(_0x1ac85c){if(_0x1ac85c){var _0x482cb4=_0x1ac85c[_0x8ce0b4];var _0x337b8e=_0x482cb4&&_0x482cb4['items']?_0x482cb4[_0x0a5d('0x112')]:[];_0x2213d1['send']({'fromKey':_[_0x0a5d('0x7b')](_0x482cb4[_0x0a5d('0x113')])?undefined:_0x482cb4['fromKey'],'count':_0x337b8e[_0x0a5d('0x34')],'rows':_0x337b8e});}})['catch'](handleError(_0x2213d1,null));};exports[_0x0a5d('0x114')]=function(_0x4e439b,_0x1aefd5){var _0x2f7960={'raw':![],'where':{}};var _0x2be823={};var _0x115c36={'count':0x0,'rows':[]};return db[_0x0a5d('0x2a')][_0x0a5d('0xc7')]({'where':{'id':_0x4e439b['params']['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0x1aefd5,null))['then'](function(_0xf7a1fe){if(_0xf7a1fe){_0x2be823[_0x0a5d('0x35')]=_[_0x0a5d('0x2f')](db['ChatOfflineMessage']['rawAttributes']);_0x2be823['query']=_['keys'](_0x4e439b[_0x0a5d('0x2e')]);_0x2be823[_0x0a5d('0x30')]=_[_0x0a5d('0x31')](_0x2be823[_0x0a5d('0x35')],_0x2be823[_0x0a5d('0x2e')]);_0x2f7960[_0x0a5d('0x32')]=_['intersection'](_0x2be823[_0x0a5d('0x35')],qs[_0x0a5d('0x33')](_0x4e439b['query']['fields']));_0x2f7960[_0x0a5d('0x32')]=_0x2f7960[_0x0a5d('0x32')][_0x0a5d('0x34')]?_0x2f7960[_0x0a5d('0x32')]:_0x2be823[_0x0a5d('0x35')];if(!_0x4e439b[_0x0a5d('0x2e')][_0x0a5d('0x36')](_0x0a5d('0x37'))){_0x2f7960['limit']=qs[_0x0a5d('0x1f')](_0x4e439b[_0x0a5d('0x2e')][_0x0a5d('0x1f')]);_0x2f7960['offset']=qs[_0x0a5d('0x1e')](_0x4e439b[_0x0a5d('0x2e')][_0x0a5d('0x1e')]);}_0x2f7960[_0x0a5d('0x38')]=qs[_0x0a5d('0x39')](_0x4e439b['query'][_0x0a5d('0x39')]);_0x2f7960[_0x0a5d('0x3a')]=qs['filters'](_['pick'](_0x4e439b[_0x0a5d('0x2e')],_0x2be823[_0x0a5d('0x30')]));_0x2f7960[_0x0a5d('0x3a')][_0x0a5d('0x51')]=_0xf7a1fe['id'];if(_0x4e439b[_0x0a5d('0x2e')][_0x0a5d('0x3d')]){_0x2f7960[_0x0a5d('0x3a')]=_[_0x0a5d('0x3e')](_0x2f7960[_0x0a5d('0x3a')],{'$or':_[_0x0a5d('0x3b')](_0x2f7960[_0x0a5d('0x32')],function(_0x1d2ee0){var _0x28ef0e={};_0x28ef0e[_0x1d2ee0]={'$like':'%'+_0x4e439b['query'][_0x0a5d('0x3d')]+'%'};return _0x28ef0e;})});}_0x2f7960=_['merge']({},_0x2f7960,_0x4e439b['options']);return db[_0x0a5d('0xbe')]['count']({'where':_0x2f7960[_0x0a5d('0x3a')]})['then'](function(_0x40c64d){_0x115c36[_0x0a5d('0x20')]=_0x40c64d;if(_0x4e439b['query'][_0x0a5d('0x40')]){_0x2f7960['include']=[{'all':!![]}];}else{_0x2f7960['include']=[{'model':db[_0x0a5d('0x75')],'as':_0x0a5d('0xdc'),'required':![]},{'model':db[_0x0a5d('0x115')],'as':_0x0a5d('0x116'),'required':![]}];}return db[_0x0a5d('0xbe')]['findAll'](_0x2f7960);})['then'](function(_0x49ce34){_0x115c36[_0x0a5d('0x43')]=_0x49ce34;return _0x115c36;});}})[_0x0a5d('0x12')](respondWithFilteredResult(_0x1aefd5,_0x2f7960))['catch'](handleError(_0x1aefd5,null));};exports['addAgents']=function(_0x2bb58b,_0x1ce0cb){return db[_0x0a5d('0x2a')][_0x0a5d('0x45')]({'where':{'id':_0x2bb58b[_0x0a5d('0x4e')]['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0x1ce0cb,null))['then'](function(_0x598a92){if(_0x598a92){return _0x598a92['addAgents'](_0x2bb58b['body']['ids'],_['omit'](_0x2bb58b[_0x0a5d('0x4d')],[_0x0a5d('0x54'),'id'])||{})['spread'](function(_0x5099e3){for(var _0x4ee28f=0x0;_0x4ee28f<_0x2bb58b['body'][_0x0a5d('0x54')][_0x0a5d('0x34')];_0x4ee28f+=0x1){socket[_0x0a5d('0x117')](_0x0a5d('0x118'),{'UserId':Number(_0x2bb58b[_0x0a5d('0x4d')][_0x0a5d('0x54')][_0x4ee28f]),'ChatWebsiteId':Number(_0x2bb58b['params']['id'])});}return _0x5099e3;});}})['then'](respondWithResult(_0x1ce0cb,null))['catch'](handleError(_0x1ce0cb,null));};exports[_0x0a5d('0x119')]=function(_0xc7c28,_0x2f6dd5){return db[_0x0a5d('0x2a')][_0x0a5d('0x45')]({'where':{'id':_0xc7c28[_0x0a5d('0x4e')]['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0x2f6dd5,null))['then'](function(_0xa87e14){if(_0xa87e14){return _0xa87e14[_0x0a5d('0x119')](_0xc7c28[_0x0a5d('0x2e')][_0x0a5d('0x54')])['then'](function(){if(_[_0x0a5d('0x11a')](_0xc7c28[_0x0a5d('0x2e')][_0x0a5d('0x54')])){for(var _0x8e183f=0x0;_0x8e183f<_0xc7c28[_0x0a5d('0x2e')][_0x0a5d('0x54')]['length'];_0x8e183f+=0x1){socket[_0x0a5d('0x117')]('userChatWebsite:remove',{'UserId':Number(_0xc7c28['query'][_0x0a5d('0x54')][_0x8e183f]),'ChatWebsiteId':Number(_0xc7c28['params']['id'])});}}else{socket['emit'](_0x0a5d('0x11b'),{'UserId':Number(_0xc7c28[_0x0a5d('0x2e')]['ids']),'ChatWebsiteId':Number(_0xc7c28[_0x0a5d('0x4e')]['id'])});}});}})[_0x0a5d('0x12')](respondWithStatusCode(_0x2f6dd5,null))[_0x0a5d('0x46')](handleError(_0x2f6dd5,null));};exports[_0x0a5d('0x11c')]=function(_0x3f5a64,_0x33cce6){var _0x39b3fe={};var _0x274afd={};var _0x2e8ec1;var _0x12d4d1;return db[_0x0a5d('0x2a')][_0x0a5d('0xc7')]({'where':{'id':_0x3f5a64[_0x0a5d('0x4e')]['id']}})[_0x0a5d('0x12')](handleEntityNotFound(_0x33cce6,null))['then'](function(_0x58a665){if(_0x58a665){_0x2e8ec1=_0x58a665;_0x274afd['model']=_['keys'](db['User'][_0x0a5d('0x44')]);_0x274afd[_0x0a5d('0x2e')]=_[_0x0a5d('0x2f')](_0x3f5a64[_0x0a5d('0x2e')]);_0x274afd[_0x0a5d('0x30')]=_[_0x0a5d('0x31')](_0x274afd['model'],_0x274afd['query']);_0x39b3fe[_0x0a5d('0x32')]=_[_0x0a5d('0x31')](_0x274afd[_0x0a5d('0x35')],qs['fields'](_0x3f5a64[_0x0a5d('0x2e')][_0x0a5d('0x33')]));_0x39b3fe[_0x0a5d('0x32')]=_0x39b3fe['attributes']['length']?_0x39b3fe[_0x0a5d('0x32')]:_0x274afd[_0x0a5d('0x35')];_0x39b3fe[_0x0a5d('0x38')]=qs[_0x0a5d('0x39')](_0x3f5a64[_0x0a5d('0x2e')][_0x0a5d('0x39')]);_0x39b3fe[_0x0a5d('0x3a')]=qs['filters'](_[_0x0a5d('0x53')](_0x3f5a64[_0x0a5d('0x2e')],_0x274afd[_0x0a5d('0x30')]));if(_0x3f5a64[_0x0a5d('0x2e')][_0x0a5d('0x3d')]){_0x39b3fe[_0x0a5d('0x3a')]=_[_0x0a5d('0x3e')](_0x39b3fe[_0x0a5d('0x3a')],{'$or':_[_0x0a5d('0x3b')](_0x39b3fe['attributes'],function(_0x3f2ca0){var _0xe1b07d={};_0xe1b07d[_0x3f2ca0]={'$like':'%'+_0x3f5a64['query']['filter']+'%'};return _0xe1b07d;})});}_0x39b3fe=_['merge']({},_0x39b3fe,_0x3f5a64[_0x0a5d('0x3f')]);return _0x2e8ec1[_0x0a5d('0x11c')](_0x39b3fe);}})[_0x0a5d('0x12')](function(_0x1df04e){if(_0x1df04e){_0x12d4d1=_0x1df04e[_0x0a5d('0x34')];if(!_0x3f5a64[_0x0a5d('0x2e')]['hasOwnProperty'](_0x0a5d('0x37'))){_0x39b3fe[_0x0a5d('0x1f')]=qs[_0x0a5d('0x1f')](_0x3f5a64[_0x0a5d('0x2e')][_0x0a5d('0x1f')]);_0x39b3fe[_0x0a5d('0x1e')]=qs['offset'](_0x3f5a64['query'][_0x0a5d('0x1e')]);}return _0x2e8ec1[_0x0a5d('0x11c')](_0x39b3fe);}})[_0x0a5d('0x12')](function(_0xd1533c){if(_0xd1533c){return _0xd1533c?{'count':_0x12d4d1,'rows':_0xd1533c}:null;}})[_0x0a5d('0x12')](respondWithResult(_0x33cce6,null))[_0x0a5d('0x46')](handleError(_0x33cce6,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 2e560c6..1bbd8ad 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 _0xe35c=['hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','emit'];(function(_0x3667eb,_0x1bd874){var _0x44cf07=function(_0x260898){while(--_0x260898){_0x3667eb['push'](_0x3667eb['shift']());}};_0x44cf07(++_0x1bd874);}(_0xe35c,0x146));var _0xce35=function(_0x284bde,_0x3a2ab2){_0x284bde=_0x284bde-0x0;var _0x455f4b=_0xe35c[_0x284bde];return _0x455f4b;};'use strict';var EventEmitter=require(_0xce35('0x0'));var ChatWebsite=require(_0xce35('0x1'))['db'][_0xce35('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xce35('0x3')](0x0);var events={'afterCreate':_0xce35('0x4'),'afterUpdate':_0xce35('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5b2135){return function(_0x17648a,_0x4a005b,_0x3e370f){ChatWebsiteEvents[_0xce35('0x6')](_0x5b2135+':'+_0x17648a['id'],_0x17648a);ChatWebsiteEvents[_0xce35('0x6')](_0x5b2135,_0x17648a);_0x3e370f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xce35('0x7')](e,emitEvent(event));}}module[_0xce35('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x6f72=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','../../mysqldb','ChatWebsite'];(function(_0x4ce414,_0x5ac84d){var _0x3f0dd8=function(_0x5fe045){while(--_0x5fe045){_0x4ce414['push'](_0x4ce414['shift']());}};_0x3f0dd8(++_0x5ac84d);}(_0x6f72,0xae));var _0x26f7=function(_0x3be56b,_0x135bc6){_0x3be56b=_0x3be56b-0x0;var _0x30af13=_0x6f72[_0x3be56b];return _0x30af13;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x26f7('0x0'))['db'][_0x26f7('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x26f7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x26f7('0x3'),'afterDestroy':_0x26f7('0x4')};function emitEvent(_0x49904c){return function(_0x4e19f5,_0x10b953,_0x48d005){ChatWebsiteEvents[_0x26f7('0x5')](_0x49904c+':'+_0x4e19f5['id'],_0x4e19f5);ChatWebsiteEvents['emit'](_0x49904c,_0x4e19f5);_0x48d005(null);};}for(var e in events){if(events[_0x26f7('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x26f7('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 27fa8e0..7fc37b3 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 _0x58f4=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x41ffa9,_0x3297fd){var _0x2b54f1=function(_0x54a92d){while(--_0x54a92d){_0x41ffa9['push'](_0x41ffa9['shift']());}};_0x2b54f1(++_0x3297fd);}(_0x58f4,0xc6));var _0x458f=function(_0x455d24,_0x5d6798){_0x455d24=_0x455d24-0x0;var _0x329c60=_0x58f4[_0x455d24];return _0x329c60;};'use strict';var _=require('lodash');var util=require(_0x458f('0x0'));var logger=require(_0x458f('0x1'))(_0x458f('0x2'));var moment=require('moment');var BPromise=require(_0x458f('0x3'));var rp=require(_0x458f('0x4'));var fs=require('fs');var path=require(_0x458f('0x5'));var rimraf=require(_0x458f('0x6'));var config=require('../../config/environment');var attributes=require(_0x458f('0x7'));module[_0x458f('0x8')]=function(_0x29a575,_0x4dfc4d){return _0x29a575[_0x458f('0x9')](_0x458f('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4583=['define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x2706f2,_0x9a058){var _0x595bab=function(_0x54371f){while(--_0x54371f){_0x2706f2['push'](_0x2706f2['shift']());}};_0x595bab(++_0x9a058);}(_0x4583,0x1d1));var _0x3458=function(_0x228267,_0x57824a){_0x228267=_0x228267-0x0;var _0x1f0c90=_0x4583[_0x228267];return _0x1f0c90;};'use strict';var _=require(_0x3458('0x0'));var util=require(_0x3458('0x1'));var logger=require(_0x3458('0x2'))(_0x3458('0x3'));var moment=require(_0x3458('0x4'));var BPromise=require('bluebird');var rp=require(_0x3458('0x5'));var fs=require('fs');var path=require(_0x3458('0x6'));var rimraf=require(_0x3458('0x7'));var config=require(_0x3458('0x8'));var attributes=require(_0x3458('0x9'));module[_0x3458('0xa')]=function(_0x4a230f,_0x5ef4c0){return _0x4a230f[_0x3458('0xb')](_0x3458('0xc'),attributes,{'tableName':_0x3458('0xd'),'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 3904ff0..7985232 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 _0xf310=['code','message','request\x20sent','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','debug','stringify','error'];(function(_0x4ab6a1,_0x4d64d5){var _0x2a24cc=function(_0x2625a0){while(--_0x2625a0){_0x4ab6a1['push'](_0x4ab6a1['shift']());}};_0x2a24cc(++_0x4d64d5);}(_0xf310,0x1ae));var _0x0f31=function(_0x2ef041,_0x34e819){_0x2ef041=_0x2ef041-0x0;var _0x4babf1=_0xf310[_0x2ef041];return _0x4babf1;};'use strict';var _=require('lodash');var util=require(_0x0f31('0x0'));var moment=require(_0x0f31('0x1'));var BPromise=require(_0x0f31('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f31('0x3'));var db=require(_0x0f31('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f31('0x5'))('rpc');var config=require(_0x0f31('0x6'));var jayson=require(_0x0f31('0x7'));var client=jayson['client'][_0x0f31('0x8')]({'port':0x232a});config['redis']=_[_0x0f31('0x9')](config[_0x0f31('0xa')],{'host':_0x0f31('0xb'),'port':0x18eb});var socket=require(_0x0f31('0xc'))(new Redis(config[_0x0f31('0xa')]));require(_0x0f31('0xd'))[_0x0f31('0xe')](socket);function respondWithRpcPromise(_0x5b85bd,_0x21158f,_0x46f536){return new BPromise(function(_0x5a1801,_0x1bf217){return client[_0x0f31('0xf')](_0x5b85bd,_0x46f536)['then'](function(_0x3c8cd2){logger['info'](_0x0f31('0x10'),_0x21158f,'request\x20sent');logger[_0x0f31('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x21158f,'request\x20sent',JSON[_0x0f31('0x12')](_0x3c8cd2));if(_0x3c8cd2[_0x0f31('0x13')]){if(_0x3c8cd2[_0x0f31('0x13')][_0x0f31('0x14')]===0x1f4){logger['error'](_0x0f31('0x10'),_0x21158f,_0x3c8cd2[_0x0f31('0x13')]['message']);return _0x1bf217(_0x3c8cd2[_0x0f31('0x13')][_0x0f31('0x15')]);}logger[_0x0f31('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x21158f,_0x3c8cd2[_0x0f31('0x13')][_0x0f31('0x15')]);return _0x5a1801(_0x3c8cd2[_0x0f31('0x13')][_0x0f31('0x15')]);}else{logger['info'](_0x0f31('0x10'),_0x21158f,_0x0f31('0x16'));_0x5a1801(_0x3c8cd2[_0x0f31('0x17')][_0x0f31('0x15')]);}})[_0x0f31('0x18')](function(_0x1467ae){logger['error'](_0x0f31('0x10'),_0x21158f,_0x1467ae);_0x1bf217(_0x1467ae);});});}
\ No newline at end of file
+var _0xaa13=['../../config/environment','client','defaults','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5e3f6c,_0x40a8d5){var _0x34b41b=function(_0x561d31){while(--_0x561d31){_0x5e3f6c['push'](_0x5e3f6c['shift']());}};_0x34b41b(++_0x40a8d5);}(_0xaa13,0x198));var _0x3aa1=function(_0xa2a662,_0x4ee2a8){_0xa2a662=_0xa2a662-0x0;var _0x2b6030=_0xaa13[_0xa2a662];return _0x2b6030;};'use strict';var _=require(_0x3aa1('0x0'));var util=require(_0x3aa1('0x1'));var moment=require('moment');var BPromise=require(_0x3aa1('0x2'));var rs=require(_0x3aa1('0x3'));var fs=require('fs');var Redis=require(_0x3aa1('0x4'));var db=require(_0x3aa1('0x5'))['db'];var utils=require(_0x3aa1('0x6'));var logger=require('../../config/logger')(_0x3aa1('0x7'));var config=require(_0x3aa1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3aa1('0x9')]['http']({'port':0x232a});config['redis']=_[_0x3aa1('0xa')](config['redis'],{'host':_0x3aa1('0xb'),'port':0x18eb});var socket=require(_0x3aa1('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x3aa1('0xd')](socket);function respondWithRpcPromise(_0x8fd708,_0x1c44df,_0x487cbb){return new BPromise(function(_0x3accf8,_0x4ef87e){return client[_0x3aa1('0xe')](_0x8fd708,_0x487cbb)[_0x3aa1('0xf')](function(_0x5d24a8){logger[_0x3aa1('0x10')](_0x3aa1('0x11'),_0x1c44df,_0x3aa1('0x12'));logger[_0x3aa1('0x13')](_0x3aa1('0x14'),_0x1c44df,_0x3aa1('0x12'),JSON[_0x3aa1('0x15')](_0x5d24a8));if(_0x5d24a8[_0x3aa1('0x16')]){if(_0x5d24a8['error'][_0x3aa1('0x17')]===0x1f4){logger[_0x3aa1('0x16')](_0x3aa1('0x11'),_0x1c44df,_0x5d24a8[_0x3aa1('0x16')]['message']);return _0x4ef87e(_0x5d24a8[_0x3aa1('0x16')][_0x3aa1('0x18')]);}logger[_0x3aa1('0x16')](_0x3aa1('0x11'),_0x1c44df,_0x5d24a8[_0x3aa1('0x16')][_0x3aa1('0x18')]);return _0x3accf8(_0x5d24a8['error'][_0x3aa1('0x18')]);}else{logger['info'](_0x3aa1('0x11'),_0x1c44df,_0x3aa1('0x12'));_0x3accf8(_0x5d24a8['result'][_0x3aa1('0x18')]);}})[_0x3aa1('0x19')](function(_0x1c6163){logger['error'](_0x3aa1('0x11'),_0x1c44df,_0x1c6163);_0x4ef87e(_0x1c6163);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 88a6e5c..f5c9b47 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 _0xf154=['emit','removeListener','register','length','save','remove','update'];(function(_0x90c434,_0x42072a){var _0x10e99a=function(_0x5f39ca){while(--_0x5f39ca){_0x90c434['push'](_0x90c434['shift']());}};_0x10e99a(++_0x42072a);}(_0xf154,0x74));var _0x4f15=function(_0x4b71b4,_0x26595a){_0x4b71b4=_0x4b71b4-0x0;var _0xb99700=_0xf154[_0x4b71b4];return _0xb99700;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x4f15('0x0'),_0x4f15('0x1'),_0x4f15('0x2')];function createListener(_0x1bbf19,_0x5d74ba){return function(_0xdf5aca){_0x5d74ba[_0x4f15('0x3')](_0x1bbf19,_0xdf5aca);};}function removeListener(_0x1092c7,_0x5d2e73){return function(){ChatWebsiteEvents[_0x4f15('0x4')](_0x1092c7,_0x5d2e73);};}exports[_0x4f15('0x5')]=function(_0x34d983){for(var _0x15bc9e=0x0,_0x500f86=events[_0x4f15('0x6')];_0x15bc9e<_0x500f86;_0x15bc9e++){var _0x222a1e=events[_0x15bc9e];var _0x116110=createListener('chatWebsite:'+_0x222a1e,_0x34d983);ChatWebsiteEvents['on'](_0x222a1e,_0x116110);}};
\ No newline at end of file
+var _0xed18=['save','remove','update','emit','length','chatWebsite:','./chatWebsite.events'];(function(_0x5a2036,_0x25a0fd){var _0xbf1458=function(_0x4b6a2d){while(--_0x4b6a2d){_0x5a2036['push'](_0x5a2036['shift']());}};_0xbf1458(++_0x25a0fd);}(_0xed18,0xa7));var _0x8ed1=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0xed18[_0x1ccbcc];return _0x1e873f;};'use strict';var ChatWebsiteEvents=require(_0x8ed1('0x0'));var events=[_0x8ed1('0x1'),_0x8ed1('0x2'),_0x8ed1('0x3')];function createListener(_0xa49efb,_0xcd7986){return function(_0x4fb98f){_0xcd7986[_0x8ed1('0x4')](_0xa49efb,_0x4fb98f);};}function removeListener(_0x4deba7,_0x3bbbe6){return function(){ChatWebsiteEvents['removeListener'](_0x4deba7,_0x3bbbe6);};}exports['register']=function(_0x40a6cf){for(var _0x44f848=0x0,_0x5cd24f=events[_0x8ed1('0x5')];_0x44f848<_0x5cd24f;_0x44f848++){var _0x226ff4=events[_0x44f848];var _0x3ad203=createListener(_0x8ed1('0x6')+_0x226ff4,_0x40a6cf);ChatWebsiteEvents['on'](_0x226ff4,_0x3ad203);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index b0ad423..fd46eea 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 _0xfc7a=['server/files','attachments','replace','extname','/:id/offline','any','offline','/:id/interactions','/:id/applications','/:id/proactive_actions','addProactiveActions','put','/:id','update','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatWebsite.controller','index','get','/describe','isAuthenticated','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getApplications','/:id/fields','getFields','/:id/users','getAgents','post','create','addDisposition','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','addLogo','join','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify'];(function(_0x45b3c1,_0x2d161b){var _0x6d0616=function(_0x4980ee){while(--_0x4980ee){_0x45b3c1['push'](_0x45b3c1['shift']());}};_0x6d0616(++_0x2d161b);}(_0xfc7a,0x12d));var _0xafc7=function(_0xce3a0b,_0x5b271b){_0xce3a0b=_0xce3a0b-0x0;var _0x1ca1b9=_0xfc7a[_0xce3a0b];return _0x1ca1b9;};'use strict';var multer=require(_0xafc7('0x0'));var util=require(_0xafc7('0x1'));var path=require(_0xafc7('0x2'));var timeout=require(_0xafc7('0x3'));var express=require(_0xafc7('0x4'));var router=express[_0xafc7('0x5')]();var fs_extra=require(_0xafc7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xafc7('0x7'));var config=require('../../config/environment');var controller=require(_0xafc7('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xafc7('0x9')]);router[_0xafc7('0xa')](_0xafc7('0xb'),auth[_0xafc7('0xc')](),controller['describe']);router[_0xafc7('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xafc7('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xafc7('0xd')]);router['get'](_0xafc7('0xe'),auth[_0xafc7('0xc')](),controller['getAnswers']);router[_0xafc7('0xa')]('/:id/logo',controller[_0xafc7('0xf')]);router[_0xafc7('0xa')](_0xafc7('0x10'),controller[_0xafc7('0x11')]);router[_0xafc7('0xa')](_0xafc7('0x12'),controller[_0xafc7('0x13')]);router[_0xafc7('0xa')](_0xafc7('0x14'),controller[_0xafc7('0x15')]);router['get']('/:id/interactions',auth[_0xafc7('0xc')](),controller[_0xafc7('0x16')]);router[_0xafc7('0xa')](_0xafc7('0x17'),controller['getSnippet']);router[_0xafc7('0xa')]('/:id/applications',auth[_0xafc7('0xc')](),controller[_0xafc7('0x18')]);router[_0xafc7('0xa')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router[_0xafc7('0xa')](_0xafc7('0x19'),controller[_0xafc7('0x1a')]);router[_0xafc7('0xa')]('/:id/offline_messages',auth[_0xafc7('0xc')](),controller['getOfflineMessages']);router['get'](_0xafc7('0x1b'),auth[_0xafc7('0xc')](),controller[_0xafc7('0x1c')]);router[_0xafc7('0x1d')]('/',auth[_0xafc7('0xc')](),controller[_0xafc7('0x1e')]);router[_0xafc7('0x1d')]('/:id/dispositions',auth[_0xafc7('0xc')](),controller[_0xafc7('0x1f')]);router[_0xafc7('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0xafc7('0x20')]({'destination':function(_0x5484ea,_0x5aab5c,_0x3d0522){_0x3d0522(null,path['join'](config[_0xafc7('0x21')],_0xafc7('0x22')));},'filename':function(_0x331908,_0xa562de,_0xca6a85){_0xca6a85(null,util[_0xafc7('0x23')](_0xafc7('0x24'),Date[_0xafc7('0x25')](),_0xa562de[_0xafc7('0x26')]));}})});router[_0xafc7('0x1d')](_0xafc7('0x27'),upload[_0xafc7('0x28')](_0xafc7('0x29')),controller[_0xafc7('0x2a')]);var upload=multer({'storage':multer[_0xafc7('0x20')]({'destination':function(_0x291b3f,_0x566d33,_0xcb5f5a){_0xcb5f5a(null,path[_0xafc7('0x2b')](config['root'],_0xafc7('0x2c')));},'filename':function(_0x45fecc,_0x2dad3e,_0x1e0d28){_0x1e0d28(null,util[_0xafc7('0x23')]('%s-%s',Date['now'](),_0x2dad3e[_0xafc7('0x26')]));}})});router['post'](_0xafc7('0x10'),upload[_0xafc7('0x28')](_0xafc7('0x29')),controller['addAvatar']);var upload=multer({'storage':multer[_0xafc7('0x20')]({'destination':function(_0x2e96ba,_0x5a36a5,_0x2ce66b){_0x2ce66b(null,path[_0xafc7('0x2b')](config[_0xafc7('0x21')],_0xafc7('0x2c')));},'filename':function(_0x5b4ecd,_0x4a7021,_0x682883){_0x682883(null,util[_0xafc7('0x23')](_0xafc7('0x24'),Date[_0xafc7('0x25')](),_0x4a7021[_0xafc7('0x26')]));}})});router['post'](_0xafc7('0x12'),upload[_0xafc7('0x28')](_0xafc7('0x29')),controller[_0xafc7('0x2d')]);var upload=multer({'storage':multer[_0xafc7('0x20')]({'destination':function(_0x8d40bf,_0x2994bd,_0x51b40e){_0x51b40e(null,path[_0xafc7('0x2b')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x2a2cea,_0x2b8ee1,_0x2c76fe){_0x2c76fe(null,util[_0xafc7('0x23')](_0xafc7('0x24'),Date[_0xafc7('0x25')](),_0x2b8ee1[_0xafc7('0x26')]));}})});router[_0xafc7('0x1d')](_0xafc7('0x14'),upload['single'](_0xafc7('0x29')),controller[_0xafc7('0x2e')]);router[_0xafc7('0x1d')](_0xafc7('0x2f'),controller[_0xafc7('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0xafc7('0x20')]({'destination':function(_0xc96477,_0x409a7b,_0x3450ba){const _0x2b2289=path['join'](config[_0xafc7('0x21')],_0xafc7('0x31'),_0xafc7('0x32'),'offline-chat');fs_extra['ensureDir'](_0x2b2289,function(){_0x3450ba(null,_0x2b2289);});},'filename':function(_0x5b35eb,_0x2c2b86,_0xcde905){const _0x1c4179=_0x2c2b86[_0xafc7('0x26')][_0xafc7('0x33')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x85ef7=path[_0xafc7('0x34')](_0x1c4179);const _0x21a891=Date[_0xafc7('0x25')]()+'-'+_0x1c4179['replace'](_0x85ef7,'')+_0x85ef7;_0xcde905(null,_0x21a891);}})});router[_0xafc7('0x1d')](_0xafc7('0x35'),offlineUploadMulter[_0xafc7('0x36')](),controller[_0xafc7('0x37')]);router[_0xafc7('0x1d')](_0xafc7('0x38'),auth[_0xafc7('0xc')](),controller['addInteraction']);router[_0xafc7('0x1d')](_0xafc7('0x39'),auth[_0xafc7('0xc')](),controller['addApplications']);router[_0xafc7('0x1d')](_0xafc7('0x3a'),auth[_0xafc7('0xc')](),controller[_0xafc7('0x3b')]);router[_0xafc7('0x1d')](_0xafc7('0x1b'),auth[_0xafc7('0xc')](),controller['addAgents']);router[_0xafc7('0x3c')](_0xafc7('0x3d'),auth[_0xafc7('0xc')](),controller[_0xafc7('0x3e')]);router[_0xafc7('0x3f')]('/:id',auth['isAuthenticated'](),controller[_0xafc7('0x40')]);router['delete'](_0xafc7('0x41'),auth[_0xafc7('0xc')](),controller[_0xafc7('0x42')]);router[_0xafc7('0x3f')](_0xafc7('0xe'),auth[_0xafc7('0xc')](),controller[_0xafc7('0x43')]);router[_0xafc7('0x3f')](_0xafc7('0x1b'),auth['isAuthenticated'](),controller[_0xafc7('0x44')]);module[_0xafc7('0x45')]=router;
\ No newline at end of file
+var _0x9eb1=['addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','extname','replace','any','offline','addInteraction','/:id/applications','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','/:id/canned_answers','addAnswer','join','root','server/files/images/logos/','format','/:id/logo','single','file','addLogo','server/files/images/avatars/','%s-%s','now','originalname','addAvatar','diskStorage'];(function(_0x4b71aa,_0xfbf067){var _0x521f22=function(_0x43a224){while(--_0x43a224){_0x4b71aa['push'](_0x4b71aa['shift']());}};_0x521f22(++_0xfbf067);}(_0x9eb1,0x139));var _0x19eb=function(_0x56c05a,_0x12b70d){_0x56c05a=_0x56c05a-0x0;var _0x111d41=_0x9eb1[_0x56c05a];return _0x111d41;};'use strict';var multer=require('multer');var util=require(_0x19eb('0x0'));var path=require(_0x19eb('0x1'));var timeout=require(_0x19eb('0x2'));var express=require('express');var router=express[_0x19eb('0x3')]();var fs_extra=require(_0x19eb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x19eb('0x5'));var config=require(_0x19eb('0x6'));var controller=require(_0x19eb('0x7'));router[_0x19eb('0x8')]('/',auth[_0x19eb('0x9')](),controller[_0x19eb('0xa')]);router[_0x19eb('0x8')]('/describe',auth[_0x19eb('0x9')](),controller['describe']);router[_0x19eb('0x8')](_0x19eb('0xb'),auth[_0x19eb('0x9')](),controller[_0x19eb('0xc')]);router[_0x19eb('0x8')](_0x19eb('0xd'),auth[_0x19eb('0x9')](),controller[_0x19eb('0xe')]);router[_0x19eb('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x19eb('0xf')]);router[_0x19eb('0x8')]('/:id/logo',controller[_0x19eb('0x10')]);router[_0x19eb('0x8')](_0x19eb('0x11'),controller[_0x19eb('0x12')]);router[_0x19eb('0x8')](_0x19eb('0x13'),controller[_0x19eb('0x14')]);router[_0x19eb('0x8')](_0x19eb('0x15'),controller[_0x19eb('0x16')]);router[_0x19eb('0x8')](_0x19eb('0x17'),auth['isAuthenticated'](),controller[_0x19eb('0x18')]);router[_0x19eb('0x8')](_0x19eb('0x19'),controller[_0x19eb('0x1a')]);router[_0x19eb('0x8')]('/:id/applications',auth[_0x19eb('0x9')](),controller[_0x19eb('0x1b')]);router['get'](_0x19eb('0x1c'),auth[_0x19eb('0x9')](),controller[_0x19eb('0x1d')]);router[_0x19eb('0x8')](_0x19eb('0x1e'),controller['getFields']);router[_0x19eb('0x8')](_0x19eb('0x1f'),auth[_0x19eb('0x9')](),controller[_0x19eb('0x20')]);router['get']('/:id/users',auth[_0x19eb('0x9')](),controller[_0x19eb('0x21')]);router[_0x19eb('0x22')]('/',auth[_0x19eb('0x9')](),controller[_0x19eb('0x23')]);router[_0x19eb('0x22')](_0x19eb('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x19eb('0x22')](_0x19eb('0x24'),auth['isAuthenticated'](),controller[_0x19eb('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x411908,_0x47f3ce,_0x30edcb){_0x30edcb(null,path[_0x19eb('0x26')](config[_0x19eb('0x27')],_0x19eb('0x28')));},'filename':function(_0xe33162,_0x4e058a,_0x4c818f){_0x4c818f(null,util[_0x19eb('0x29')]('%s-%s',Date['now'](),_0x4e058a['originalname']));}})});router[_0x19eb('0x22')](_0x19eb('0x2a'),upload[_0x19eb('0x2b')](_0x19eb('0x2c')),controller[_0x19eb('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1b64bb,_0x15a2c9,_0x2dcf47){_0x2dcf47(null,path['join'](config[_0x19eb('0x27')],_0x19eb('0x2e')));},'filename':function(_0xadbd82,_0x351cd3,_0xf45d0e){_0xf45d0e(null,util['format'](_0x19eb('0x2f'),Date[_0x19eb('0x30')](),_0x351cd3[_0x19eb('0x31')]));}})});router['post'](_0x19eb('0x11'),upload[_0x19eb('0x2b')](_0x19eb('0x2c')),controller[_0x19eb('0x32')]);var upload=multer({'storage':multer[_0x19eb('0x33')]({'destination':function(_0x2d005d,_0x4fe9ee,_0x229178){_0x229178(null,path[_0x19eb('0x26')](config[_0x19eb('0x27')],_0x19eb('0x2e')));},'filename':function(_0x582b76,_0x283515,_0x5ad06a){_0x5ad06a(null,util[_0x19eb('0x29')](_0x19eb('0x2f'),Date[_0x19eb('0x30')](),_0x283515['originalname']));}})});router[_0x19eb('0x22')](_0x19eb('0x13'),upload[_0x19eb('0x2b')](_0x19eb('0x2c')),controller[_0x19eb('0x34')]);var upload=multer({'storage':multer[_0x19eb('0x33')]({'destination':function(_0x4b9aee,_0x1e6d2b,_0x22585e){_0x22585e(null,path[_0x19eb('0x26')](config[_0x19eb('0x27')],_0x19eb('0x2e')));},'filename':function(_0x11d21f,_0x1b28f8,_0x53c197){_0x53c197(null,util[_0x19eb('0x29')](_0x19eb('0x2f'),Date[_0x19eb('0x30')](),_0x1b28f8[_0x19eb('0x31')]));}})});router['post'](_0x19eb('0x15'),upload[_0x19eb('0x2b')](_0x19eb('0x2c')),controller['addSystemAvatar']);router['post'](_0x19eb('0x35'),controller[_0x19eb('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x19eb('0x33')]({'destination':function(_0x27156a,_0x2cf413,_0x52d885){const _0x1779de=path[_0x19eb('0x26')](config[_0x19eb('0x27')],_0x19eb('0x37'),'attachments',_0x19eb('0x38'));fs_extra[_0x19eb('0x39')](_0x1779de,function(){_0x52d885(null,_0x1779de);});},'filename':function(_0x20bd24,_0xb67df6,_0x3a343e){const _0x4e96be=_0xb67df6[_0x19eb('0x31')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4607d5=path[_0x19eb('0x3a')](_0x4e96be);const _0x28da15=Date[_0x19eb('0x30')]()+'-'+_0x4e96be[_0x19eb('0x3b')](_0x4607d5,'')+_0x4607d5;_0x3a343e(null,_0x28da15);}})});router[_0x19eb('0x22')]('/:id/offline',offlineUploadMulter[_0x19eb('0x3c')](),controller[_0x19eb('0x3d')]);router[_0x19eb('0x22')](_0x19eb('0x17'),auth[_0x19eb('0x9')](),controller[_0x19eb('0x3e')]);router['post'](_0x19eb('0x3f'),auth[_0x19eb('0x9')](),controller['addApplications']);router['post'](_0x19eb('0x1c'),auth[_0x19eb('0x9')](),controller['addProactiveActions']);router['post'](_0x19eb('0x40'),auth[_0x19eb('0x9')](),controller[_0x19eb('0x41')]);router[_0x19eb('0x42')](_0x19eb('0xb'),auth['isAuthenticated'](),controller[_0x19eb('0x43')]);router[_0x19eb('0x44')](_0x19eb('0xb'),auth[_0x19eb('0x9')](),controller[_0x19eb('0x45')]);router[_0x19eb('0x44')](_0x19eb('0xd'),auth[_0x19eb('0x9')](),controller[_0x19eb('0x46')]);router[_0x19eb('0x44')]('/:id/canned_answers',auth[_0x19eb('0x9')](),controller['removeAnswers']);router['delete'](_0x19eb('0x40'),auth[_0x19eb('0x9')](),controller[_0x19eb('0x47')]);module[_0x19eb('0x48')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index c3ea2c1..7b91527 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 _0x3003=['get','/client-logs','isAuthenticated','exports','beaver-logger/server','express','../config/environment','env','production','app'];(function(_0x38deb6,_0x587445){var _0x3cf12e=function(_0x4d178b){while(--_0x4d178b){_0x38deb6['push'](_0x38deb6['shift']());}};_0x3cf12e(++_0x587445);}(_0x3003,0x18a));var _0x3300=function(_0x2f6e0d,_0x19687d){_0x2f6e0d=_0x2f6e0d-0x0;var _0x4c0d36=_0x3003[_0x2f6e0d];return _0x4c0d36;};var beaverLogger=require(_0x3300('0x0'));var express=require(_0x3300('0x1'));var auth=require('../components/auth/service');var config=require(_0x3300('0x2'));var router=express['Router']();var isProduction=config[_0x3300('0x3')]===_0x3300('0x4')||![];function clientSideLogs(_0xb004e6,_0x424af5,_0x2a2e91){var _0x23f146=_0xb004e6[_0x3300('0x5')][_0x3300('0x6')]('client-side-logger');if(!_0x23f146){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':_0x3300('0x7'),'logger':_0x23f146,'enableCors':!isProduction})(_0xb004e6,_0x424af5,_0x2a2e91);}router['use'](auth[_0x3300('0x8')](),clientSideLogs);module[_0x3300('0x9')]=router;
\ No newline at end of file
+var _0x485f=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','../config/environment','Router','env','production','app','get'];(function(_0x28edf8,_0x3ab79f){var _0xb0bbba=function(_0x52eeae){while(--_0x52eeae){_0x28edf8['push'](_0x28edf8['shift']());}};_0xb0bbba(++_0x3ab79f);}(_0x485f,0x162));var _0xf485=function(_0x1d3dac,_0x24f28f){_0x1d3dac=_0x1d3dac-0x0;var _0x51a5b2=_0x485f[_0x1d3dac];return _0x51a5b2;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require('../components/auth/service');var config=require(_0xf485('0x0'));var router=express[_0xf485('0x1')]();var isProduction=config[_0xf485('0x2')]===_0xf485('0x3')||![];function clientSideLogs(_0x259d99,_0x2cb542,_0x3475c8){var _0x26a1ba=_0x259d99[_0xf485('0x4')][_0xf485('0x5')]('client-side-logger');if(!_0x26a1ba){throw new Error(_0xf485('0x6'));}return beaverLogger[_0xf485('0x7')]({'uri':_0xf485('0x8'),'logger':_0x26a1ba,'enableCors':!isProduction})(_0x259d99,_0x2cb542,_0x3475c8);}router[_0xf485('0x9')](auth[_0xf485('0xa')](),clientSideLogs);module[_0xf485('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 29fa9a1..b6c6b1a 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 _0xbd39=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','STRING','MicrosoftAzure\x20=>\x20client_id'];(function(_0x25b9c5,_0x31a38e){var _0x1a50d5=function(_0x33aaac){while(--_0x33aaac){_0x25b9c5['push'](_0x25b9c5['shift']());}};_0x1a50d5(++_0x31a38e);}(_0xbd39,0x102));var _0x9bd3=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xbd39[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require('sequelize');module[_0x9bd3('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9bd3('0x1')](_0x9bd3('0x2'),_0x9bd3('0x3'),_0x9bd3('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x9bd3('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0x9bd3('0x6')],'comment':_0x9bd3('0x7')},'data2':{'type':Sequelize[_0x9bd3('0x6')],'comment':_0x9bd3('0x8')},'data3':{'type':Sequelize[_0x9bd3('0x6')],'comment':_0x9bd3('0x9')},'data4':{'type':Sequelize[_0x9bd3('0x6')],'comment':_0x9bd3('0xa')},'data5':{'type':Sequelize[_0x9bd3('0xb')],'comment':_0x9bd3('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x9bd3('0xb')],'comment':_0x9bd3('0xd')}};
\ No newline at end of file
+var _0x3f30=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','AmazonAWS','Google'];(function(_0x227814,_0x1a334c){var _0x384d06=function(_0x253178){while(--_0x253178){_0x227814['push'](_0x227814['shift']());}};_0x384d06(++_0x1a334c);}(_0x3f30,0xe9));var _0x03f3=function(_0x5375c7,_0x46f518){_0x5375c7=_0x5375c7-0x0;var _0x3c4917=_0x3f30[_0x5375c7];return _0x3c4917;};'use strict';var Sequelize=require(_0x03f3('0x0'));module['exports']={'name':{'type':Sequelize[_0x03f3('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x03f3('0x2')](_0x03f3('0x3'),_0x03f3('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x03f3('0x2')](_0x03f3('0x5'),_0x03f3('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0x03f3('0x7')},'data3':{'type':Sequelize[_0x03f3('0x1')],'comment':_0x03f3('0x8')},'data4':{'type':Sequelize[_0x03f3('0x1')],'comment':_0x03f3('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0x03f3('0xa')},'data6':{'type':Sequelize['TEXT'],'comment':_0x03f3('0xb')},'data7':{'type':Sequelize[_0x03f3('0xc')],'comment':_0x03f3('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 8e157a2..fe0a161 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 _0x2a14=['options','CloudProvider','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','includeAll','include','create','body','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','find','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','base64','ascii','isValidIdToken','oauth2Claims','del','code','data5','access_token','refresh_token','data6','startRefreshInterval','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','padEnd','slice','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','pick','filter','where','merge','VIRTUAL'];(function(_0x443e88,_0x4b9d1e){var _0x50f7b1=function(_0x348e68){while(--_0x348e68){_0x443e88['push'](_0x443e88['shift']());}};_0x50f7b1(++_0x4b9d1e);}(_0x2a14,0x1ee));var _0x42a1=function(_0x297b47,_0x305c9d){_0x297b47=_0x297b47-0x0;var _0xc87900=_0x2a14[_0x297b47];return _0xc87900;};'use strict';var _=require(_0x42a1('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0x42a1('0x1'));var config=require(_0x42a1('0x2'));var logger=require(_0x42a1('0x3'))('api');var db=require(_0x42a1('0x4'))['db'];var oauth=require(_0x42a1('0x5'));config[_0x42a1('0x6')]=_[_0x42a1('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x42a1('0x8'))(new Redis(config[_0x42a1('0x6')]));var redis=new Redis(config[_0x42a1('0x6')]);function respondWithStatusCode(_0x28189b,_0x26ef14){_0x26ef14=_0x26ef14||0xcc;return function(_0x557a5d){if(_0x557a5d){return _0x28189b[_0x42a1('0x9')](_0x26ef14);}return _0x28189b[_0x42a1('0xa')](_0x26ef14)[_0x42a1('0xb')]();};}function respondWithResult(_0x5a2afe,_0x1521bc){_0x1521bc=_0x1521bc||0xc8;return function(_0x1ef271){if(_0x1ef271){return _0x5a2afe[_0x42a1('0xa')](_0x1521bc)[_0x42a1('0xc')](_0x1ef271);}};}function respondWithFilteredResult(_0x74c62b,_0x461239){return function(_0x3ae597){if(_0x3ae597){var _0x58f748=typeof _0x461239[_0x42a1('0xd')]===_0x42a1('0xe')&&typeof _0x461239[_0x42a1('0xf')]===_0x42a1('0xe');var _0xb00c84=_0x3ae597[_0x42a1('0x10')];var _0x5b82b5=_0x58f748?0x0:_0x461239['offset'];var _0x5cbed0=_0x58f748?_0x3ae597['count']:_0x461239['offset']+_0x461239['limit'];var _0x366292;if(_0x5cbed0>=_0xb00c84){_0x5cbed0=_0xb00c84;_0x366292=0xc8;}else{_0x366292=0xce;}_0x74c62b['status'](_0x366292);return _0x74c62b['set'](_0x42a1('0x11'),_0x5b82b5+'-'+_0x5cbed0+'/'+_0xb00c84)[_0x42a1('0xc')](_0x3ae597);}return null;};}function saveUpdates(_0x508725){return function(_0x39cfde){if(_0x39cfde){return _0x39cfde[_0x42a1('0x12')](_0x508725)[_0x42a1('0x13')](function(_0x163f6e){return _0x163f6e;});}return null;};}function removeEntity(_0x2cb17d){return function(_0x4c4ae8){if(_0x4c4ae8){return _0x4c4ae8[_0x42a1('0x14')]()[_0x42a1('0x13')](function(){_0x2cb17d[_0x42a1('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17a531){return function(_0x48eef7){if(!_0x48eef7){_0x17a531['sendStatus'](0x194);}return _0x48eef7;};}function handleError(_0x38233f,_0x92f6e9){_0x92f6e9=_0x92f6e9||0x1f4;return function(_0x2bd83b){logger[_0x42a1('0x15')](_0x2bd83b[_0x42a1('0x16')]);if(_0x2bd83b['name']){delete _0x2bd83b['name'];}_0x38233f['status'](_0x92f6e9)['send'](_0x2bd83b);};}function maskClientSecret(_0x32e08c){return _[_0x42a1('0x17')](_0x32e08c[_0x42a1('0x18')](0x0,0x3),0x14,'*');}exports[_0x42a1('0x19')]=function(_0x5e9495,_0x3c5fa2){var _0x55fb51={},_0x22cb21={},_0x31a9e8={'count':0x0,'rows':[]};var _0x168cf7=_[_0x42a1('0x1a')](db['CloudProvider'][_0x42a1('0x1b')],function(_0x364661){return{'name':_0x364661[_0x42a1('0x1c')],'type':_0x364661[_0x42a1('0x1d')][_0x42a1('0x1e')]};});_0x22cb21[_0x42a1('0x1f')]=_[_0x42a1('0x1a')](_0x168cf7,_0x42a1('0x20'));_0x22cb21['query']=_['keys'](_0x5e9495[_0x42a1('0x21')]);_0x22cb21[_0x42a1('0x22')]=_[_0x42a1('0x23')](_0x22cb21[_0x42a1('0x1f')],_0x22cb21[_0x42a1('0x21')]);_0x55fb51[_0x42a1('0x24')]=_['intersection'](_0x22cb21[_0x42a1('0x1f')],qs[_0x42a1('0x25')](_0x5e9495[_0x42a1('0x21')][_0x42a1('0x25')]));_0x55fb51[_0x42a1('0x24')]=_0x55fb51[_0x42a1('0x24')][_0x42a1('0x26')]?_0x55fb51[_0x42a1('0x24')]:_0x22cb21[_0x42a1('0x1f')];if(!_0x5e9495['query'][_0x42a1('0x27')]('nolimit')){_0x55fb51['limit']=qs[_0x42a1('0xf')](_0x5e9495[_0x42a1('0x21')][_0x42a1('0xf')]);_0x55fb51[_0x42a1('0xd')]=qs[_0x42a1('0xd')](_0x5e9495[_0x42a1('0x21')][_0x42a1('0xd')]);}_0x55fb51[_0x42a1('0x28')]=qs['sort'](_0x5e9495['query']['sort']);_0x55fb51['where']=qs[_0x42a1('0x22')](_[_0x42a1('0x29')](_0x5e9495[_0x42a1('0x21')],_0x22cb21[_0x42a1('0x22')]),_0x168cf7);if(_0x5e9495['query'][_0x42a1('0x2a')]){_0x55fb51[_0x42a1('0x2b')]=_[_0x42a1('0x2c')](_0x55fb51[_0x42a1('0x2b')],{'$or':_[_0x42a1('0x1a')](_0x168cf7,function(_0xfcea73){if(_0xfcea73[_0x42a1('0x1d')]!==_0x42a1('0x2d')){var _0x1f4f3a={};_0x1f4f3a[_0xfcea73[_0x42a1('0x20')]]={'$like':'%'+_0x5e9495[_0x42a1('0x21')][_0x42a1('0x2a')]+'%'};return _0x1f4f3a;}})});}_0x55fb51=_[_0x42a1('0x2c')]({},_0x55fb51,_0x5e9495[_0x42a1('0x2e')]);var _0x8cdb76={'where':_0x55fb51[_0x42a1('0x2b')]};return db[_0x42a1('0x2f')][_0x42a1('0x10')](_0x8cdb76)[_0x42a1('0x13')](function(_0x48e9b9){_0x31a9e8[_0x42a1('0x10')]=_0x48e9b9;if(_0x5e9495[_0x42a1('0x21')]['includeAll']){_0x55fb51['include']=[{'all':!![]}];}return db[_0x42a1('0x2f')][_0x42a1('0x30')](_0x55fb51);})['then'](function(_0x265651){_0x31a9e8[_0x42a1('0x31')]=_[_0x42a1('0x1a')](_0x265651,function(_0x39bfe1){if(_0x39bfe1[_0x42a1('0x32')]===_0x42a1('0x33')){var _0x8888ce=encryptor[_0x42a1('0x34')](_0x39bfe1[_0x42a1('0x35')]);_0x39bfe1[_0x42a1('0x35')]=maskClientSecret(_0x8888ce);}return _0x39bfe1;});return _0x31a9e8;})['then'](respondWithFilteredResult(_0x3c5fa2,_0x55fb51))[_0x42a1('0x36')](handleError(_0x3c5fa2,null));};exports[_0x42a1('0x37')]=function(_0x4cce7c,_0x4bc9ff){var _0x16b93e={'raw':!![],'where':{'id':_0x4cce7c[_0x42a1('0x38')]['id']}},_0x38b17c={};_0x38b17c['model']=_['keys'](db[_0x42a1('0x2f')][_0x42a1('0x1b')]);_0x38b17c[_0x42a1('0x21')]=_['keys'](_0x4cce7c[_0x42a1('0x21')]);_0x38b17c[_0x42a1('0x22')]=_[_0x42a1('0x23')](_0x38b17c['model'],_0x38b17c[_0x42a1('0x21')]);_0x16b93e['attributes']=_[_0x42a1('0x23')](_0x38b17c[_0x42a1('0x1f')],qs[_0x42a1('0x25')](_0x4cce7c['query'][_0x42a1('0x25')]));_0x16b93e['attributes']=_0x16b93e[_0x42a1('0x24')][_0x42a1('0x26')]?_0x16b93e[_0x42a1('0x24')]:_0x38b17c[_0x42a1('0x1f')];if(_0x4cce7c[_0x42a1('0x21')][_0x42a1('0x39')]){_0x16b93e[_0x42a1('0x3a')]=[{'all':!![]}];}_0x16b93e=_['merge']({},_0x16b93e,_0x4cce7c[_0x42a1('0x2e')]);return db[_0x42a1('0x2f')]['find'](_0x16b93e)[_0x42a1('0x13')](handleEntityNotFound(_0x4bc9ff,null))[_0x42a1('0x13')](function(_0x40b97b){if(_0x40b97b[_0x42a1('0x32')]===_0x42a1('0x33')){var _0x3e76d2=encryptor[_0x42a1('0x34')](_0x40b97b['data3']);_0x40b97b[_0x42a1('0x35')]=maskClientSecret(_0x3e76d2);}return _0x40b97b;})['then'](respondWithResult(_0x4bc9ff,null))[_0x42a1('0x36')](handleError(_0x4bc9ff,null));};exports[_0x42a1('0x3b')]=function(_0x1ac5a7,_0x271c08){if(!_0x1ac5a7[_0x42a1('0x3c')][_0x42a1('0x20')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x1ac5a7[_0x42a1('0x3c')][_0x42a1('0x32')])throw new Error(_0x42a1('0x3d'));var _0x3f725c=db[_0x42a1('0x2f')]['rawAttributes'][_0x42a1('0x32')]['values'];if(!_0x3f725c[_0x42a1('0x3e')](_0x1ac5a7[_0x42a1('0x3c')][_0x42a1('0x32')]))throw new Error(_0x42a1('0x3f')+_0x3f725c['join'](',\x20'));if(_0x1ac5a7[_0x42a1('0x3c')][_0x42a1('0x32')]==='MicrosoftAzure'&&_0x1ac5a7[_0x42a1('0x3c')][_0x42a1('0x35')]){_0x1ac5a7[_0x42a1('0x3c')]['data3']=encryptor[_0x42a1('0x40')](_0x1ac5a7['body'][_0x42a1('0x35')]);}return db['CloudProvider']['create'](_0x1ac5a7['body'],{})['then'](respondWithResult(_0x271c08,0xc9))[_0x42a1('0x36')](handleError(_0x271c08,null));};exports[_0x42a1('0x12')]=function(_0x7905cf,_0x2285c4){if(_0x7905cf[_0x42a1('0x3c')]['id']){delete _0x7905cf[_0x42a1('0x3c')]['id'];}return db[_0x42a1('0x2f')][_0x42a1('0x41')]({'where':{'id':_0x7905cf[_0x42a1('0x38')]['id']}})['then'](handleEntityNotFound(_0x2285c4,null))[_0x42a1('0x13')](function(_0x5c616d){if(_0x5c616d[_0x42a1('0x32')]==='MicrosoftAzure'&&_0x7905cf[_0x42a1('0x3c')][_0x42a1('0x35')]){_0x7905cf[_0x42a1('0x3c')][_0x42a1('0x35')]=encryptor[_0x42a1('0x40')](_0x7905cf['body'][_0x42a1('0x35')]);}return _0x5c616d;})[_0x42a1('0x13')](saveUpdates(_0x7905cf['body'],null))[_0x42a1('0x13')](respondWithResult(_0x2285c4,null))[_0x42a1('0x36')](handleError(_0x2285c4,null));};exports[_0x42a1('0x14')]=function(_0x7df153,_0x35d284){return db['CloudProvider']['find']({'where':{'id':_0x7df153[_0x42a1('0x38')]['id']}})[_0x42a1('0x13')](handleEntityNotFound(_0x35d284,null))['then'](removeEntity(_0x35d284,null))[_0x42a1('0x36')](handleError(_0x35d284,null));};exports['oauth2MicrosoftAuthorize']=function(_0xa05679,_0x14f5da){return db[_0x42a1('0x2f')]['findOne']({'where':{'id':_0xa05679[_0x42a1('0x38')]['id']},'raw':!![]})[_0x42a1('0x13')](function(_0x3d45a3){if(!_0x3d45a3)return _0x14f5da['sendStatus'](0x194);return{'url':oauth[_0x42a1('0x42')](_0x3d45a3,_0xa05679[_0x42a1('0x43')]['id'])};})[_0x42a1('0x13')](respondWithResult(_0x14f5da,null))['catch'](handleError(_0x14f5da,null));};exports[_0x42a1('0x44')]=function(_0x79dfc0,_0x4c7927){var _0x10d711=_0x79dfc0[_0x42a1('0x3c')];var _0x1f7a33;var _0x3c36ae;if(_0x10d711[_0x42a1('0x15')])throw _0x10d711;redis[_0x42a1('0x45')](_0x10d711[_0x42a1('0x46')])[_0x42a1('0x13')](function(_0x549782){if(!_0x549782)throw new Error(_0x42a1('0x47'));_0x1f7a33=JSON[_0x42a1('0x48')](_0x549782);var _0x1b5115=Buffer['from'](_0x10d711[_0x42a1('0x46')],_0x42a1('0x49'))['toString'](_0x42a1('0x4a'));_0x3c36ae=JSON['parse'](_0x1b5115);if(!oauth[_0x42a1('0x4b')](_0x10d711['id_token'],_0x1f7a33[_0x42a1('0x4c')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x42a1('0x4d')](_0x10d711['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x10d711[_0x42a1('0x4e')],_0x1f7a33);})[_0x42a1('0x13')](function(_0x4aa303){_0x1f7a33[_0x42a1('0x4f')]=_0x4aa303[_0x42a1('0x50')];_0x1f7a33['data6']=_0x4aa303[_0x42a1('0x51')];return db[_0x42a1('0x2f')][_0x42a1('0x12')]({'data5':_0x1f7a33['data5'],'data6':_0x1f7a33[_0x42a1('0x52')]},{'where':{'id':_0x1f7a33['id']}});})[_0x42a1('0x13')](function(){oauth[_0x42a1('0x53')](_0x1f7a33);socket['emit'](_0x42a1('0x54'),{'id':_0x3c36ae['id']});return;})['then'](respondWithStatusCode(_0x4c7927,null))[_0x42a1('0x36')](function(_0x127f8d){if(_0x3c36ae){socket['emit']('microsoftAuthorization:error',{'id':_0x3c36ae['id']});}if(!_0x1f7a33){logger[_0x42a1('0x15')](_0x42a1('0x55'),_0x127f8d);return _0x4c7927[_0x42a1('0xa')](0x1f4)[_0x42a1('0x56')](_0x127f8d[_0x42a1('0x57')]);}logger['error'](_0x42a1('0x58'),_0x1f7a33['id'],JSON[_0x42a1('0x59')](_0x127f8d));});};
\ No newline at end of file
+var _0x5cf4=['VIRTUAL','merge','options','CloudProvider','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','params','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','rawAttributes','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','find','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','update','then','destroy','name','padEnd','slice','map','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter'];(function(_0x408de5,_0x24fa7b){var _0x2015a1=function(_0x13082c){while(--_0x13082c){_0x408de5['push'](_0x408de5['shift']());}};_0x2015a1(++_0x24fa7b);}(_0x5cf4,0x93));var _0x45cf=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x5cf4[_0x3fd3a3];return _0xa3e4d5;};'use strict';var _=require('lodash');var Redis=require(_0x45cf('0x0'));var qs=require(_0x45cf('0x1'));var encryptor=require(_0x45cf('0x2'));var config=require(_0x45cf('0x3'));var logger=require(_0x45cf('0x4'))('api');var db=require(_0x45cf('0x5'))['db'];var oauth=require(_0x45cf('0x6'));config[_0x45cf('0x7')]=_['defaults'](config[_0x45cf('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x45cf('0x8'))(new Redis(config[_0x45cf('0x7')]));var redis=new Redis(config[_0x45cf('0x7')]);function respondWithStatusCode(_0x4c90b8,_0x5cfb42){_0x5cfb42=_0x5cfb42||0xcc;return function(_0x1af8f0){if(_0x1af8f0){return _0x4c90b8[_0x45cf('0x9')](_0x5cfb42);}return _0x4c90b8['status'](_0x5cfb42)[_0x45cf('0xa')]();};}function respondWithResult(_0x4e539c,_0x2174f3){_0x2174f3=_0x2174f3||0xc8;return function(_0x2e0b69){if(_0x2e0b69){return _0x4e539c[_0x45cf('0xb')](_0x2174f3)[_0x45cf('0xc')](_0x2e0b69);}};}function respondWithFilteredResult(_0xf7bf77,_0x17d9a0){return function(_0x29ab2a){if(_0x29ab2a){var _0x1c059c=typeof _0x17d9a0['offset']===_0x45cf('0xd')&&typeof _0x17d9a0[_0x45cf('0xe')]===_0x45cf('0xd');var _0x1ec7e5=_0x29ab2a[_0x45cf('0xf')];var _0x4a00ad=_0x1c059c?0x0:_0x17d9a0[_0x45cf('0x10')];var _0x5ba081=_0x1c059c?_0x29ab2a[_0x45cf('0xf')]:_0x17d9a0[_0x45cf('0x10')]+_0x17d9a0[_0x45cf('0xe')];var _0x5e12d0;if(_0x5ba081>=_0x1ec7e5){_0x5ba081=_0x1ec7e5;_0x5e12d0=0xc8;}else{_0x5e12d0=0xce;}_0xf7bf77['status'](_0x5e12d0);return _0xf7bf77['set'](_0x45cf('0x11'),_0x4a00ad+'-'+_0x5ba081+'/'+_0x1ec7e5)[_0x45cf('0xc')](_0x29ab2a);}return null;};}function saveUpdates(_0x2f0634){return function(_0x593961){if(_0x593961){return _0x593961[_0x45cf('0x12')](_0x2f0634)[_0x45cf('0x13')](function(_0x23382e){return _0x23382e;});}return null;};}function removeEntity(_0x272e93){return function(_0x21f766){if(_0x21f766){return _0x21f766[_0x45cf('0x14')]()[_0x45cf('0x13')](function(){_0x272e93[_0x45cf('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x176357){return function(_0xc974b4){if(!_0xc974b4){_0x176357[_0x45cf('0x9')](0x194);}return _0xc974b4;};}function handleError(_0x31e41a,_0x1b5866){_0x1b5866=_0x1b5866||0x1f4;return function(_0x3ee338){logger['error'](_0x3ee338['stack']);if(_0x3ee338[_0x45cf('0x15')]){delete _0x3ee338['name'];}_0x31e41a[_0x45cf('0xb')](_0x1b5866)['send'](_0x3ee338);};}function maskClientSecret(_0xcaee40){return _[_0x45cf('0x16')](_0xcaee40[_0x45cf('0x17')](0x0,0x3),0x14,'*');}exports['index']=function(_0x1f4f42,_0x2a53c9){var _0x45e54d={},_0x1cd1cc={},_0x84b1f0={'count':0x0,'rows':[]};var _0x115b44=_[_0x45cf('0x18')](db['CloudProvider']['rawAttributes'],function(_0x594a8f){return{'name':_0x594a8f[_0x45cf('0x19')],'type':_0x594a8f[_0x45cf('0x1a')][_0x45cf('0x1b')]};});_0x1cd1cc['model']=_[_0x45cf('0x18')](_0x115b44,'name');_0x1cd1cc['query']=_[_0x45cf('0x1c')](_0x1f4f42[_0x45cf('0x1d')]);_0x1cd1cc['filters']=_[_0x45cf('0x1e')](_0x1cd1cc[_0x45cf('0x1f')],_0x1cd1cc[_0x45cf('0x1d')]);_0x45e54d[_0x45cf('0x20')]=_[_0x45cf('0x1e')](_0x1cd1cc[_0x45cf('0x1f')],qs[_0x45cf('0x21')](_0x1f4f42[_0x45cf('0x1d')][_0x45cf('0x21')]));_0x45e54d['attributes']=_0x45e54d[_0x45cf('0x20')][_0x45cf('0x22')]?_0x45e54d[_0x45cf('0x20')]:_0x1cd1cc[_0x45cf('0x1f')];if(!_0x1f4f42[_0x45cf('0x1d')][_0x45cf('0x23')](_0x45cf('0x24'))){_0x45e54d['limit']=qs[_0x45cf('0xe')](_0x1f4f42[_0x45cf('0x1d')][_0x45cf('0xe')]);_0x45e54d['offset']=qs[_0x45cf('0x10')](_0x1f4f42[_0x45cf('0x1d')]['offset']);}_0x45e54d[_0x45cf('0x25')]=qs[_0x45cf('0x26')](_0x1f4f42[_0x45cf('0x1d')][_0x45cf('0x26')]);_0x45e54d[_0x45cf('0x27')]=qs[_0x45cf('0x28')](_[_0x45cf('0x29')](_0x1f4f42[_0x45cf('0x1d')],_0x1cd1cc[_0x45cf('0x28')]),_0x115b44);if(_0x1f4f42['query'][_0x45cf('0x2a')]){_0x45e54d['where']=_['merge'](_0x45e54d['where'],{'$or':_[_0x45cf('0x18')](_0x115b44,function(_0x50a896){if(_0x50a896[_0x45cf('0x1a')]!==_0x45cf('0x2b')){var _0x8f37e5={};_0x8f37e5[_0x50a896['name']]={'$like':'%'+_0x1f4f42['query']['filter']+'%'};return _0x8f37e5;}})});}_0x45e54d=_[_0x45cf('0x2c')]({},_0x45e54d,_0x1f4f42[_0x45cf('0x2d')]);var _0x100712={'where':_0x45e54d[_0x45cf('0x27')]};return db[_0x45cf('0x2e')][_0x45cf('0xf')](_0x100712)[_0x45cf('0x13')](function(_0x2bb8fd){_0x84b1f0[_0x45cf('0xf')]=_0x2bb8fd;if(_0x1f4f42['query'][_0x45cf('0x2f')]){_0x45e54d[_0x45cf('0x30')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x45e54d);})['then'](function(_0x3fa190){_0x84b1f0[_0x45cf('0x31')]=_[_0x45cf('0x18')](_0x3fa190,function(_0xe6d577){if(_0xe6d577[_0x45cf('0x32')]===_0x45cf('0x33')){var _0x38b0e0=encryptor[_0x45cf('0x34')](_0xe6d577[_0x45cf('0x35')]);_0xe6d577[_0x45cf('0x35')]=maskClientSecret(_0x38b0e0);}return _0xe6d577;});return _0x84b1f0;})['then'](respondWithFilteredResult(_0x2a53c9,_0x45e54d))['catch'](handleError(_0x2a53c9,null));};exports['show']=function(_0x33c6c7,_0x160258){var _0x31a18d={'raw':!![],'where':{'id':_0x33c6c7[_0x45cf('0x36')]['id']}},_0x1581bb={};_0x1581bb[_0x45cf('0x1f')]=_[_0x45cf('0x1c')](db[_0x45cf('0x2e')]['rawAttributes']);_0x1581bb[_0x45cf('0x1d')]=_[_0x45cf('0x1c')](_0x33c6c7['query']);_0x1581bb[_0x45cf('0x28')]=_[_0x45cf('0x1e')](_0x1581bb[_0x45cf('0x1f')],_0x1581bb['query']);_0x31a18d['attributes']=_[_0x45cf('0x1e')](_0x1581bb[_0x45cf('0x1f')],qs[_0x45cf('0x21')](_0x33c6c7[_0x45cf('0x1d')][_0x45cf('0x21')]));_0x31a18d['attributes']=_0x31a18d[_0x45cf('0x20')][_0x45cf('0x22')]?_0x31a18d[_0x45cf('0x20')]:_0x1581bb[_0x45cf('0x1f')];if(_0x33c6c7[_0x45cf('0x1d')][_0x45cf('0x2f')]){_0x31a18d['include']=[{'all':!![]}];}_0x31a18d=_[_0x45cf('0x2c')]({},_0x31a18d,_0x33c6c7[_0x45cf('0x2d')]);return db['CloudProvider']['find'](_0x31a18d)[_0x45cf('0x13')](handleEntityNotFound(_0x160258,null))[_0x45cf('0x13')](function(_0x34b519){if(_0x34b519['service']===_0x45cf('0x33')){var _0x4c3799=encryptor['decryptString'](_0x34b519[_0x45cf('0x35')]);_0x34b519[_0x45cf('0x35')]=maskClientSecret(_0x4c3799);}return _0x34b519;})['then'](respondWithResult(_0x160258,null))[_0x45cf('0x37')](handleError(_0x160258,null));};exports[_0x45cf('0x38')]=function(_0x165088,_0x3d9204){if(!_0x165088[_0x45cf('0x39')][_0x45cf('0x15')])throw new Error(_0x45cf('0x3a'));if(!_0x165088[_0x45cf('0x39')][_0x45cf('0x32')])throw new Error(_0x45cf('0x3b'));var _0x35318b=db[_0x45cf('0x2e')][_0x45cf('0x3c')][_0x45cf('0x32')]['values'];if(!_0x35318b[_0x45cf('0x3d')](_0x165088[_0x45cf('0x39')][_0x45cf('0x32')]))throw new Error(_0x45cf('0x3e')+_0x35318b[_0x45cf('0x3f')](',\x20'));if(_0x165088[_0x45cf('0x39')][_0x45cf('0x32')]===_0x45cf('0x33')&&_0x165088[_0x45cf('0x39')][_0x45cf('0x35')]){_0x165088[_0x45cf('0x39')][_0x45cf('0x35')]=encryptor['encryptString'](_0x165088[_0x45cf('0x39')][_0x45cf('0x35')]);}return db[_0x45cf('0x2e')]['create'](_0x165088[_0x45cf('0x39')],{})[_0x45cf('0x13')](respondWithResult(_0x3d9204,0xc9))[_0x45cf('0x37')](handleError(_0x3d9204,null));};exports[_0x45cf('0x12')]=function(_0x5adad8,_0xb16de4){if(_0x5adad8[_0x45cf('0x39')]['id']){delete _0x5adad8[_0x45cf('0x39')]['id'];}return db[_0x45cf('0x2e')][_0x45cf('0x40')]({'where':{'id':_0x5adad8[_0x45cf('0x36')]['id']}})[_0x45cf('0x13')](handleEntityNotFound(_0xb16de4,null))['then'](function(_0x12ccab){if(_0x12ccab[_0x45cf('0x32')]===_0x45cf('0x33')&&_0x5adad8['body'][_0x45cf('0x35')]){_0x5adad8['body'][_0x45cf('0x35')]=encryptor[_0x45cf('0x41')](_0x5adad8[_0x45cf('0x39')][_0x45cf('0x35')]);}return _0x12ccab;})[_0x45cf('0x13')](saveUpdates(_0x5adad8[_0x45cf('0x39')],null))[_0x45cf('0x13')](respondWithResult(_0xb16de4,null))['catch'](handleError(_0xb16de4,null));};exports[_0x45cf('0x14')]=function(_0x3e95dc,_0x56f3e2){return db[_0x45cf('0x2e')][_0x45cf('0x40')]({'where':{'id':_0x3e95dc[_0x45cf('0x36')]['id']}})['then'](handleEntityNotFound(_0x56f3e2,null))[_0x45cf('0x13')](removeEntity(_0x56f3e2,null))[_0x45cf('0x37')](handleError(_0x56f3e2,null));};exports[_0x45cf('0x42')]=function(_0x2da671,_0x2a3f14){return db[_0x45cf('0x2e')][_0x45cf('0x43')]({'where':{'id':_0x2da671[_0x45cf('0x36')]['id']},'raw':!![]})[_0x45cf('0x13')](function(_0x29a171){if(!_0x29a171)return _0x2a3f14[_0x45cf('0x9')](0x194);return{'url':oauth[_0x45cf('0x44')](_0x29a171,_0x2da671['user']['id'])};})[_0x45cf('0x13')](respondWithResult(_0x2a3f14,null))[_0x45cf('0x37')](handleError(_0x2a3f14,null));};exports[_0x45cf('0x45')]=function(_0x47857b,_0x77850b){var _0x186732=_0x47857b['body'];var _0x255bbd;var _0x29cb61;if(_0x186732[_0x45cf('0x46')])throw _0x186732;redis['get'](_0x186732['state'])['then'](function(_0x4d1422){if(!_0x4d1422)throw new Error(_0x45cf('0x47'));_0x255bbd=JSON[_0x45cf('0x48')](_0x4d1422);var _0x271b48=Buffer[_0x45cf('0x49')](_0x186732[_0x45cf('0x4a')],_0x45cf('0x4b'))[_0x45cf('0x4c')](_0x45cf('0x4d'));_0x29cb61=JSON[_0x45cf('0x48')](_0x271b48);if(!oauth[_0x45cf('0x4e')](_0x186732[_0x45cf('0x4f')],_0x255bbd['oauth2Claims']))throw new Error(_0x45cf('0x50'));redis[_0x45cf('0x51')](_0x186732[_0x45cf('0x4a')]);return oauth[_0x45cf('0x52')](_0x186732[_0x45cf('0x53')],_0x255bbd);})[_0x45cf('0x13')](function(_0x12808f){_0x255bbd[_0x45cf('0x54')]=_0x12808f['access_token'];_0x255bbd[_0x45cf('0x55')]=_0x12808f[_0x45cf('0x56')];return db[_0x45cf('0x2e')][_0x45cf('0x12')]({'data5':_0x255bbd[_0x45cf('0x54')],'data6':_0x255bbd[_0x45cf('0x55')]},{'where':{'id':_0x255bbd['id']}});})[_0x45cf('0x13')](function(){oauth[_0x45cf('0x57')](_0x255bbd);socket[_0x45cf('0x58')](_0x45cf('0x59'),{'id':_0x29cb61['id']});return;})[_0x45cf('0x13')](respondWithStatusCode(_0x77850b,null))[_0x45cf('0x37')](function(_0x4a98df){if(_0x29cb61){socket[_0x45cf('0x58')]('microsoftAuthorization:error',{'id':_0x29cb61['id']});}if(!_0x255bbd){logger[_0x45cf('0x46')](_0x45cf('0x5a'),_0x4a98df);return _0x77850b['status'](0x1f4)[_0x45cf('0x5b')](_0x4a98df[_0x45cf('0x5c')]);}logger[_0x45cf('0x46')](_0x45cf('0x5d'),_0x255bbd['id'],JSON[_0x45cf('0x5e')](_0x4a98df));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index bb18574..1c5c426 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 _0xd1c1=['../../config/logger','api','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x39d39d,_0x5586bd){var _0x577ac3=function(_0x12f9f2){while(--_0x12f9f2){_0x39d39d['push'](_0x39d39d['shift']());}};_0x577ac3(++_0x5586bd);}(_0xd1c1,0x1af));var _0x1d1c=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0xd1c1[_0x25a0b9];return _0x30b9ab;};'use strict';var _=require(_0x1d1c('0x0'));var util=require('util');var logger=require(_0x1d1c('0x1'))(_0x1d1c('0x2'));var moment=require('moment');var BPromise=require(_0x1d1c('0x3'));var rp=require(_0x1d1c('0x4'));var fs=require('fs');var path=require(_0x1d1c('0x5'));var rimraf=require(_0x1d1c('0x6'));var config=require('../../config/environment');var attributes=require(_0x1d1c('0x7'));module[_0x1d1c('0x8')]=function(_0x20bc1f,_0x48da36){return _0x20bc1f[_0x1d1c('0x9')](_0x1d1c('0xa'),attributes,{'tableName':_0x1d1c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfcd9=['bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment'];(function(_0x4a602,_0xaa5b8e){var _0x38643c=function(_0x40208e){while(--_0x40208e){_0x4a602['push'](_0x4a602['shift']());}};_0x38643c(++_0xaa5b8e);}(_0xfcd9,0xcd));var _0x9fcd=function(_0x32358b,_0x5c7c35){_0x32358b=_0x32358b-0x0;var _0x58c21d=_0xfcd9[_0x32358b];return _0x58c21d;};'use strict';var _=require(_0x9fcd('0x0'));var util=require(_0x9fcd('0x1'));var logger=require(_0x9fcd('0x2'))(_0x9fcd('0x3'));var moment=require(_0x9fcd('0x4'));var BPromise=require(_0x9fcd('0x5'));var rp=require(_0x9fcd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9fcd('0x7'));var config=require(_0x9fcd('0x8'));var attributes=require(_0x9fcd('0x9'));module[_0x9fcd('0xa')]=function(_0x44da9f,_0x2d9d06){return _0x44da9f[_0x9fcd('0xb')](_0x9fcd('0xc'),attributes,{'tableName':_0x9fcd('0xd'),'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 88648da..1d61668 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 _0xb6b7=['map','key','value','oauth2Claims','oauth2/','data1','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','data6','data4','POST','data5','access_token','update','catch','error','authorization_code','intervals','bind','CloudProvider','findAll','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','randomBytes','toString','client_id','response_type','join','redirect_uri','response_mode','state','nonce','prompt','login'];(function(_0x3f2605,_0x262173){var _0x15169a=function(_0x1438d0){while(--_0x1438d0){_0x3f2605['push'](_0x3f2605['shift']());}};_0x15169a(++_0x262173);}(_0xb6b7,0xc6));var _0x7b6b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb6b7[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7b6b('0x0'));var crypto=require(_0x7b6b('0x1'));var jwt=require(_0x7b6b('0x2'));var moment=require(_0x7b6b('0x3'));var Redis=require(_0x7b6b('0x4'));var rp=require(_0x7b6b('0x5'));var util=require('util');var encryptor=require(_0x7b6b('0x6'));var config=require('../../config/environment');var logger=require(_0x7b6b('0x7'))(_0x7b6b('0x8'));var schedule=require(_0x7b6b('0x9'));var db=require(_0x7b6b('0xa'))['db'];config[_0x7b6b('0xb')]=_[_0x7b6b('0xc')](config['redis'],{'host':_0x7b6b('0xd'),'port':0x18eb});var redis=new Redis(config[_0x7b6b('0xb')]);var MICROSOFT_AUTH_URL=_0x7b6b('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0x7b6b('0xf'),'profile',_0x7b6b('0x10'),_0x7b6b('0x11'),_0x7b6b('0x12'),'https://outlook.office.com/POP.AccessAsUser.All',_0x7b6b('0x13')],'Dynamics365':[_0x7b6b('0xf'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x7b6b('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x7b6b('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x37f696){var _0x54160e=_['map'](AZURE_AUTH_SCOPES[_0x37f696[_0x7b6b('0x16')]]);if(_0x37f696['type']===_0x7b6b('0x17'))_0x54160e[_0x7b6b('0x18')](_0x37f696[_0x7b6b('0x19')]+'/.default');return _0x54160e['join']('\x20');}function getAccessTokenScope(_0x33296a){if(_0x33296a[_0x7b6b('0x16')]===_0x7b6b('0x1a'))return _0x7b6b('0x12');if(_0x33296a['type']===_0x7b6b('0x17'))return _0x33296a[_0x7b6b('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x411761,_0x1c9175){var _0x35a98f=MICROSOFT_AUTH_URL[_0x7b6b('0x1b')](_0x7b6b('0x1c'),_0x411761[_0x7b6b('0x1d')]);var _0x38b8e8=[_0x7b6b('0x1e'),_0x7b6b('0x1f')];var _0x16a82e=Buffer[_0x7b6b('0x20')](JSON[_0x7b6b('0x21')]({'id':_0x1c9175}))['toString']('base64');var _0x2cac88=crypto[_0x7b6b('0x22')](0x10)[_0x7b6b('0x23')]('hex');var _0x56d214=getAuthorizationScopes(_0x411761);var _0x9d54ad=[{'key':_0x7b6b('0x24'),'value':_0x411761['data1']},{'key':_0x7b6b('0x25'),'value':encodeURIComponent(_0x38b8e8[_0x7b6b('0x26')]('\x20'))},{'key':_0x7b6b('0x27'),'value':_0x411761['data4']},{'key':_0x7b6b('0x28'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x56d214)},{'key':_0x7b6b('0x29'),'value':_0x16a82e},{'key':_0x7b6b('0x2a'),'value':_0x2cac88},{'key':_0x7b6b('0x2b'),'value':_0x7b6b('0x2c')}];var _0xa04fc9=_0x35a98f+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x7b6b('0x2d')](_0x9d54ad,function(_0x3926ef){return _0x3926ef[_0x7b6b('0x2e')]+'='+_0x3926ef[_0x7b6b('0x2f')];})[_0x7b6b('0x26')]('&');_0x411761[_0x7b6b('0x30')]={'issuer':_0x35a98f[_0x7b6b('0x1b')](_0x7b6b('0x31'),''),'audience':_0x411761[_0x7b6b('0x32')],'state':_0x16a82e,'nonce':_0x2cac88};redis['set'](_0x16a82e,JSON[_0x7b6b('0x21')](_0x411761));return _0xa04fc9;}function isValidIdToken(_0xb2ad45,_0x306490){try{var _0x3cfa43=jwt[_0x7b6b('0x33')](_0xb2ad45,{'complete':!![]});var _0x1e3076=_0x3cfa43[_0x7b6b('0x34')];if(_0x1e3076[_0x7b6b('0x35')]!==_0x306490[_0x7b6b('0x36')])return![];if(_0x1e3076[_0x7b6b('0x37')]!==_0x306490[_0x7b6b('0x38')])return![];if(_0x1e3076[_0x7b6b('0x2a')]!==_0x306490[_0x7b6b('0x2a')])return![];if(moment()[_0x7b6b('0x39')](moment[_0x7b6b('0x3a')](_0x1e3076[_0x7b6b('0x3b')])))return![];return!![];}catch(_0x255171){throw _0x255171;}}function refreshOauth2MicrosoftAccessToken(_0x16a36f){return Promise[_0x7b6b('0x3c')]()[_0x7b6b('0x3d')](function(){if(_0x16a36f[_0x7b6b('0x3e')])return _0x16a36f;return db['CloudProvider'][_0x7b6b('0x3f')]({'where':{'id':_0x16a36f['id']},'raw':!![]});})[_0x7b6b('0x3d')](function(_0x4df009){var _0x38852e={'grant_type':_0x7b6b('0x40'),'refresh_token':_0x4df009[_0x7b6b('0x41')],'scope':getAccessTokenScope(_0x4df009),'redirect_uri':_0x4df009[_0x7b6b('0x42')],'client_id':_0x4df009[_0x7b6b('0x32')],'client_secret':encryptor['decryptString'](_0x4df009[_0x7b6b('0x3e')])};var _0x454a0d={'method':_0x7b6b('0x43'),'uri':MICROSOFT_AUTH_URL[_0x7b6b('0x1b')](_0x7b6b('0x1c'),_0x4df009[_0x7b6b('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x38852e,'json':!![]};return rp(_0x454a0d);})[_0x7b6b('0x3d')](function(_0xde4bab){_0x16a36f[_0x7b6b('0x44')]=_0xde4bab[_0x7b6b('0x45')];_0x16a36f[_0x7b6b('0x41')]=_0xde4bab[_0x7b6b('0x40')];return db['CloudProvider'][_0x7b6b('0x46')]({'data5':_0x16a36f[_0x7b6b('0x44')],'data6':_0x16a36f['data6']},{'where':{'id':_0x16a36f['id']}});})[_0x7b6b('0x3d')](function(){return _0x16a36f;})[_0x7b6b('0x47')](function(_0x460bc7){logger[_0x7b6b('0x48')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x16a36f['id'],_0x460bc7);});}function getOauth2MicrosoftAccessToken(_0x2722e7,_0x220d5b){var _0x10a636={'grant_type':_0x7b6b('0x49'),'code':_0x2722e7,'scope':getAccessTokenScope(_0x220d5b),'redirect_uri':_0x220d5b['data4'],'client_id':_0x220d5b['data1'],'client_secret':encryptor['decryptString'](_0x220d5b[_0x7b6b('0x3e')])};var _0x10e743={'method':_0x7b6b('0x43'),'uri':MICROSOFT_AUTH_URL['replace'](_0x7b6b('0x1c'),_0x220d5b[_0x7b6b('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x10a636,'json':!![]};return rp(_0x10e743);}function startRefreshInterval(_0x22aeef){var _0x38f4ad=schedule[_0x7b6b('0x4a')];if(_0x38f4ad[_0x22aeef['id']])clearInterval(_0x38f4ad[_0x22aeef['id']]);_0x38f4ad[_0x22aeef['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7b6b('0x4b')](this,{'id':_0x22aeef['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7b6b('0x4a')]=_0x38f4ad;}function startAllRefreshIntervals(){return db[_0x7b6b('0x4c')][_0x7b6b('0x4d')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7b6b('0x3d')](function(_0x1d3672){var _0x4c7351=_0x1d3672[_0x7b6b('0x2d')](function(_0x57c064){return refreshOauth2MicrosoftAccessToken(_0x57c064)[_0x7b6b('0x3d')](function(_0x485260){startRefreshInterval(_0x485260);});});return Promise['all'](_0x4c7351);})[_0x7b6b('0x47')](function(_0x53e3bf){var _0x4142dd=_0x53e3bf?util[_0x7b6b('0x4e')](_0x53e3bf,{'showHidden':![],'depth':null}):'';logger[_0x7b6b('0x48')](_0x7b6b('0x4f'),_0x4142dd);});}module[_0x7b6b('0x50')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x8350=['ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../mysqldb','redis','defaults','localhost','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','map','type','Dynamics365','push','data7','join','Outlook365','/.default','replace','from','stringify','toString','randomBytes','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','key','value','set','decode','payload','iss','issuer','audience','isAfter','unix','resolve','data3','CloudProvider','findOne','then','refresh_token','decryptString','POST','data2','data5','access_token','update','data6','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','bind','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','moment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8350,0x1d8));var _0x0835=function(_0x54f996,_0x2464f8){_0x54f996=_0x54f996-0x0;var _0x3a7f6b=_0x8350[_0x54f996];return _0x3a7f6b;};'use strict';var _=require('lodash');var crypto=require(_0x0835('0x0'));var jwt=require('jsonwebtoken');var moment=require(_0x0835('0x1'));var Redis=require(_0x0835('0x2'));var rp=require(_0x0835('0x3'));var util=require(_0x0835('0x4'));var encryptor=require(_0x0835('0x5'));var config=require(_0x0835('0x6'));var logger=require('../../config/logger')(_0x0835('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x0835('0x8'))['db'];config[_0x0835('0x9')]=_[_0x0835('0xa')](config[_0x0835('0x9')],{'host':_0x0835('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':['openid',_0x0835('0xc'),_0x0835('0xd'),_0x0835('0xe'),_0x0835('0xf'),_0x0835('0x10'),_0x0835('0x11')],'Dynamics365':[_0x0835('0x12'),_0x0835('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x0835('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x28b72f){var _0x480f42=_[_0x0835('0x14')](AZURE_AUTH_SCOPES[_0x28b72f['type']]);if(_0x28b72f[_0x0835('0x15')]===_0x0835('0x16'))_0x480f42[_0x0835('0x17')](_0x28b72f[_0x0835('0x18')]+'/.default');return _0x480f42[_0x0835('0x19')]('\x20');}function getAccessTokenScope(_0x264c09){if(_0x264c09[_0x0835('0x15')]===_0x0835('0x1a'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x264c09['type']==='Dynamics365')return _0x264c09[_0x0835('0x18')]+_0x0835('0x1b');}function generateMicrosoftAuthorizationUrl(_0x3ea3e6,_0x2ce127){var _0x13c815=MICROSOFT_AUTH_URL[_0x0835('0x1c')]('{TENANT_ID}',_0x3ea3e6['data2']);var _0x47fb52=['code','id_token'];var _0x2c8acc=Buffer[_0x0835('0x1d')](JSON[_0x0835('0x1e')]({'id':_0x2ce127}))[_0x0835('0x1f')]('base64');var _0x14b1e9=crypto[_0x0835('0x20')](0x10)['toString']('hex');var _0x110f02=getAuthorizationScopes(_0x3ea3e6);var _0xf2f437=[{'key':_0x0835('0x21'),'value':_0x3ea3e6[_0x0835('0x22')]},{'key':_0x0835('0x23'),'value':encodeURIComponent(_0x47fb52['join']('\x20'))},{'key':_0x0835('0x24'),'value':_0x3ea3e6[_0x0835('0x25')]},{'key':_0x0835('0x26'),'value':_0x0835('0x27')},{'key':_0x0835('0x28'),'value':encodeURIComponent(_0x110f02)},{'key':_0x0835('0x29'),'value':_0x2c8acc},{'key':_0x0835('0x2a'),'value':_0x14b1e9},{'key':_0x0835('0x2b'),'value':_0x0835('0x2c')}];var _0x3e026d=_0x13c815+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x0835('0x14')](_0xf2f437,function(_0x2c8966){return _0x2c8966[_0x0835('0x2d')]+'='+_0x2c8966[_0x0835('0x2e')];})[_0x0835('0x19')]('&');_0x3ea3e6['oauth2Claims']={'issuer':_0x13c815[_0x0835('0x1c')]('oauth2/',''),'audience':_0x3ea3e6['data1'],'state':_0x2c8acc,'nonce':_0x14b1e9};redis[_0x0835('0x2f')](_0x2c8acc,JSON[_0x0835('0x1e')](_0x3ea3e6));return _0x3e026d;}function isValidIdToken(_0x502c83,_0x430910){try{var _0x557711=jwt[_0x0835('0x30')](_0x502c83,{'complete':!![]});var _0x1977bd=_0x557711[_0x0835('0x31')];if(_0x1977bd[_0x0835('0x32')]!==_0x430910[_0x0835('0x33')])return![];if(_0x1977bd['aud']!==_0x430910[_0x0835('0x34')])return![];if(_0x1977bd[_0x0835('0x2a')]!==_0x430910['nonce'])return![];if(moment()[_0x0835('0x35')](moment[_0x0835('0x36')](_0x1977bd['exp'])))return![];return!![];}catch(_0x31b195){throw _0x31b195;}}function refreshOauth2MicrosoftAccessToken(_0x2ac6d9){return Promise[_0x0835('0x37')]()['then'](function(){if(_0x2ac6d9[_0x0835('0x38')])return _0x2ac6d9;return db[_0x0835('0x39')][_0x0835('0x3a')]({'where':{'id':_0x2ac6d9['id']},'raw':!![]});})[_0x0835('0x3b')](function(_0x46e549){var _0x14ef33={'grant_type':_0x0835('0x3c'),'refresh_token':_0x46e549['data6'],'scope':getAccessTokenScope(_0x46e549),'redirect_uri':_0x46e549[_0x0835('0x25')],'client_id':_0x46e549['data1'],'client_secret':encryptor[_0x0835('0x3d')](_0x46e549['data3'])};var _0x5d95a9={'method':_0x0835('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x0835('0x1c')]('{TENANT_ID}',_0x46e549[_0x0835('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x14ef33,'json':!![]};return rp(_0x5d95a9);})['then'](function(_0x3a8dd3){_0x2ac6d9[_0x0835('0x40')]=_0x3a8dd3[_0x0835('0x41')];_0x2ac6d9['data6']=_0x3a8dd3['refresh_token'];return db[_0x0835('0x39')][_0x0835('0x42')]({'data5':_0x2ac6d9[_0x0835('0x40')],'data6':_0x2ac6d9[_0x0835('0x43')]},{'where':{'id':_0x2ac6d9['id']}});})[_0x0835('0x3b')](function(){return _0x2ac6d9;})[_0x0835('0x44')](function(_0x550298){logger[_0x0835('0x45')](_0x0835('0x46'),_0x2ac6d9['id'],_0x550298);});}function getOauth2MicrosoftAccessToken(_0x93f09a,_0x30c6ea){var _0x4d696c={'grant_type':_0x0835('0x47'),'code':_0x93f09a,'scope':getAccessTokenScope(_0x30c6ea),'redirect_uri':_0x30c6ea[_0x0835('0x25')],'client_id':_0x30c6ea[_0x0835('0x22')],'client_secret':encryptor['decryptString'](_0x30c6ea['data3'])};var _0x1e6a37={'method':_0x0835('0x3e'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x30c6ea[_0x0835('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4d696c,'json':!![]};return rp(_0x1e6a37);}function startRefreshInterval(_0x4958cb){var _0xf4becb=schedule['intervals'];if(_0xf4becb[_0x4958cb['id']])clearInterval(_0xf4becb[_0x4958cb['id']]);_0xf4becb[_0x4958cb['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x0835('0x48')](this,{'id':_0x4958cb['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x0835('0x49')]=_0xf4becb;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x0835('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x3fc675){var _0x589e16=_0x3fc675[_0x0835('0x14')](function(_0x1fe10b){return refreshOauth2MicrosoftAccessToken(_0x1fe10b)[_0x0835('0x3b')](function(_0x46ada1){startRefreshInterval(_0x46ada1);});});return Promise[_0x0835('0x4b')](_0x589e16);})[_0x0835('0x44')](function(_0x505d24){var _0x40c3bf=_0x505d24?util[_0x0835('0x4c')](_0x505d24,{'showHidden':![],'depth':null}):'';logger[_0x0835('0x45')](_0x0835('0x4d'),_0x40c3bf);});}module[_0x0835('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 0d412f1..f6b2d17 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 _0xa0a3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','moment','randomstring','ioredis'];(function(_0x3abc2b,_0x239fe6){var _0x1eb069=function(_0x37c100){while(--_0x37c100){_0x3abc2b['push'](_0x3abc2b['shift']());}};_0x1eb069(++_0x239fe6);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0xd3da2a,_0x22241c){_0xd3da2a=_0xd3da2a-0x0;var _0x10ab61=_0xa0a3[_0xd3da2a];return _0x10ab61;};'use strict';var _=require('lodash');var util=require(_0x3a0a('0x0'));var moment=require(_0x3a0a('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a0a('0x2'));var fs=require('fs');var Redis=require(_0x3a0a('0x3'));var db=require(_0x3a0a('0x4'))['db'];var utils=require(_0x3a0a('0x5'));var logger=require(_0x3a0a('0x6'))(_0x3a0a('0x7'));var config=require(_0x3a0a('0x8'));var jayson=require(_0x3a0a('0x9'));var client=jayson[_0x3a0a('0xa')][_0x3a0a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4719d,_0x451873,_0x1766c1){return new BPromise(function(_0x5d98d3,_0x56ee1b){return client[_0x3a0a('0xc')](_0x4719d,_0x1766c1)[_0x3a0a('0xd')](function(_0x29207e){logger[_0x3a0a('0xe')](_0x3a0a('0xf'),_0x451873,_0x3a0a('0x10'));logger[_0x3a0a('0x11')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x451873,'request\x20sent',JSON[_0x3a0a('0x12')](_0x29207e));if(_0x29207e[_0x3a0a('0x13')]){if(_0x29207e['error']['code']===0x1f4){logger[_0x3a0a('0x13')](_0x3a0a('0xf'),_0x451873,_0x29207e['error'][_0x3a0a('0x14')]);return _0x56ee1b(_0x29207e[_0x3a0a('0x13')][_0x3a0a('0x14')]);}logger[_0x3a0a('0x13')](_0x3a0a('0xf'),_0x451873,_0x29207e[_0x3a0a('0x13')][_0x3a0a('0x14')]);return _0x5d98d3(_0x29207e[_0x3a0a('0x13')][_0x3a0a('0x14')]);}else{logger[_0x3a0a('0xe')](_0x3a0a('0xf'),_0x451873,_0x3a0a('0x10'));_0x5d98d3(_0x29207e[_0x3a0a('0x15')][_0x3a0a('0x14')]);}})['catch'](function(_0x41a6b0){logger['error'](_0x3a0a('0xf'),_0x451873,_0x41a6b0);_0x56ee1b(_0x41a6b0);});});}
\ No newline at end of file
+var _0xb511=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2816aa,_0x3eee56){var _0x510f23=function(_0x5cac09){while(--_0x5cac09){_0x2816aa['push'](_0x2816aa['shift']());}};_0x510f23(++_0x3eee56);}(_0xb511,0x165));var _0x1b51=function(_0x38fa9c,_0xb11d1c){_0x38fa9c=_0x38fa9c-0x0;var _0x3fcf31=_0xb511[_0x38fa9c];return _0x3fcf31;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var moment=require(_0x1b51('0x2'));var BPromise=require('bluebird');var rs=require(_0x1b51('0x3'));var fs=require('fs');var Redis=require(_0x1b51('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b51('0x5'));var logger=require(_0x1b51('0x6'))(_0x1b51('0x7'));var config=require('../../config/environment');var jayson=require(_0x1b51('0x8'));var client=jayson[_0x1b51('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x475add,_0x43c14c,_0x5e7ece){return new BPromise(function(_0xfa46a3,_0x1690c9){return client[_0x1b51('0xa')](_0x475add,_0x5e7ece)[_0x1b51('0xb')](function(_0x3ceabe){logger[_0x1b51('0xc')](_0x1b51('0xd'),_0x43c14c,_0x1b51('0xe'));logger['debug'](_0x1b51('0xf'),_0x43c14c,_0x1b51('0xe'),JSON[_0x1b51('0x10')](_0x3ceabe));if(_0x3ceabe[_0x1b51('0x11')]){if(_0x3ceabe[_0x1b51('0x11')][_0x1b51('0x12')]===0x1f4){logger['error'](_0x1b51('0xd'),_0x43c14c,_0x3ceabe[_0x1b51('0x11')][_0x1b51('0x13')]);return _0x1690c9(_0x3ceabe[_0x1b51('0x11')][_0x1b51('0x13')]);}logger[_0x1b51('0x11')](_0x1b51('0xd'),_0x43c14c,_0x3ceabe['error'][_0x1b51('0x13')]);return _0xfa46a3(_0x3ceabe['error']['message']);}else{logger[_0x1b51('0xc')](_0x1b51('0xd'),_0x43c14c,'request\x20sent');_0xfa46a3(_0x3ceabe[_0x1b51('0x14')][_0x1b51('0x13')]);}})[_0x1b51('0x15')](function(_0x4ea5e3){logger[_0x1b51('0x11')](_0x1b51('0xd'),_0x43c14c,_0x4ea5e3);_0x1690c9(_0x4ea5e3);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 238a52a..5e12cf3 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x59145a,_0x1f60f1){var _0xf04d7=function(_0x247581){while(--_0x247581){_0x59145a['push'](_0x59145a['shift']());}};_0xf04d7(++_0x1f60f1);}(_0x1261,0x144));var _0x1126=function(_0x32b79a,_0xd2538a){_0x32b79a=_0x32b79a-0x0;var _0x483450=_0x1261[_0x32b79a];return _0x483450;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=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(_0x3cb3ca,_0x44d697){var _0x214366=function(_0x6b38e1){while(--_0x6b38e1){_0x3cb3ca['push'](_0x3cb3ca['shift']());}};_0x214366(++_0x44d697);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5daaa1,_0x545454){_0x5daaa1=_0x5daaa1-0x0;var _0x4b40a1=_0x5f2f[_0x5daaa1];return _0x4b40a1;};'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 37deb5f..f507311 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 _0x913c=['name','STRING','exports'];(function(_0x35cf09,_0x5e86eb){var _0x3063f8=function(_0x55187a){while(--_0x55187a){_0x35cf09['push'](_0x35cf09['shift']());}};_0x3063f8(++_0x5e86eb);}(_0x913c,0x1a0));var _0xc913=function(_0x4c1cbc,_0x2219c5){_0x4c1cbc=_0x4c1cbc-0x0;var _0x27dc70=_0x913c[_0x4c1cbc];return _0x27dc70;};'use strict';var Sequelize=require('sequelize');module[_0xc913('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xc913('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc913('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xc913('0x2')]},'phone':{'type':Sequelize[_0xc913('0x2')]},'fax':{'type':Sequelize[_0xc913('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xc913('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc913('0x2')]},'country':{'type':Sequelize[_0xc913('0x2')]},'email':{'type':Sequelize[_0xc913('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc913('0x2')]},'sStreet':{'type':Sequelize[_0xc913('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xc913('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xae6d=['STRING','name'];(function(_0x475741,_0x30bf38){var _0x4e34ec=function(_0x2e91c9){while(--_0x2e91c9){_0x475741['push'](_0x475741['shift']());}};_0x4e34ec(++_0x30bf38);}(_0xae6d,0xdc));var _0xdae6=function(_0x3df822,_0x299495){_0x3df822=_0x3df822-0x0;var _0x4e457d=_0xae6d[_0x3df822];return _0x4e457d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdae6('0x0')],'unique':_0xdae6('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xdae6('0x0')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xdae6('0x0')]},'type':{'type':Sequelize[_0xdae6('0x0')]},'street':{'type':Sequelize[_0xdae6('0x0')]},'postalCode':{'type':Sequelize[_0xdae6('0x0')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xdae6('0x0')]},'email':{'type':Sequelize[_0xdae6('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xdae6('0x0')]},'sPostalCode':{'type':Sequelize[_0xdae6('0x0')]},'sCity':{'type':Sequelize[_0xdae6('0x0')]},'sCountry':{'type':Sequelize[_0xdae6('0x0')]},'description':{'type':Sequelize[_0xdae6('0x0')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 9832d1a..6b58f8a 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 _0xccb9=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Companies','UserProfileResource','end','error','name','send','index','CmCompany','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','findAll','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2e6dc4,_0x502af5){var _0x3889cb=function(_0x5926cf){while(--_0x5926cf){_0x2e6dc4['push'](_0x2e6dc4['shift']());}};_0x3889cb(++_0x502af5);}(_0xccb9,0x1f0));var _0x9ccb=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0xccb9[_0x5e6cb8];return _0x3faeb3;};'use strict';var emlformat=require(_0x9ccb('0x0'));var rimraf=require(_0x9ccb('0x1'));var zipdir=require(_0x9ccb('0x2'));var jsonpatch=require(_0x9ccb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9ccb('0x4'));var Mustache=require(_0x9ccb('0x5'));var util=require(_0x9ccb('0x6'));var path=require(_0x9ccb('0x7'));var sox=require(_0x9ccb('0x8'));var csv=require('to-csv');var ejs=require(_0x9ccb('0x9'));var fs=require('fs');var fs_extra=require(_0x9ccb('0xa'));var _=require(_0x9ccb('0xb'));var squel=require(_0x9ccb('0xc'));var crypto=require(_0x9ccb('0xd'));var jsforce=require(_0x9ccb('0xe'));var deskjs=require(_0x9ccb('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9ccb('0x10'));var Papa=require(_0x9ccb('0x11'));var Redis=require(_0x9ccb('0x12'));var authService=require(_0x9ccb('0x13'));var qs=require(_0x9ccb('0x14'));var as=require(_0x9ccb('0x15'));var hardwareService=require(_0x9ccb('0x16'));var logger=require('../../config/logger')(_0x9ccb('0x17'));var utils=require('../../config/utils');var config=require(_0x9ccb('0x18'));var licenseUtil=require(_0x9ccb('0x19'));var db=require(_0x9ccb('0x1a'))['db'];function respondWithStatusCode(_0x3110ed,_0x1ddef9){_0x1ddef9=_0x1ddef9||0xcc;return function(_0x206a01){if(_0x206a01){return _0x3110ed[_0x9ccb('0x1b')](_0x1ddef9);}return _0x3110ed[_0x9ccb('0x1c')](_0x1ddef9)['end']();};}function respondWithResult(_0x585751,_0x3317dd){_0x3317dd=_0x3317dd||0xc8;return function(_0x2e73cb){if(_0x2e73cb){return _0x585751[_0x9ccb('0x1c')](_0x3317dd)['json'](_0x2e73cb);}};}function respondWithFilteredResult(_0x5aa0f5,_0x218acc){return function(_0x4d03e4){if(_0x4d03e4){var _0xc39172=typeof _0x218acc[_0x9ccb('0x1d')]===_0x9ccb('0x1e')&&typeof _0x218acc[_0x9ccb('0x1f')]===_0x9ccb('0x1e');var _0x8c55b0=_0x4d03e4['count'];var _0x1f65e0=_0xc39172?0x0:_0x218acc[_0x9ccb('0x1d')];var _0x7d49c7=_0xc39172?_0x4d03e4[_0x9ccb('0x20')]:_0x218acc[_0x9ccb('0x1d')]+_0x218acc[_0x9ccb('0x1f')];var _0x577bc2;if(_0x7d49c7>=_0x8c55b0){_0x7d49c7=_0x8c55b0;_0x577bc2=0xc8;}else{_0x577bc2=0xce;}_0x5aa0f5[_0x9ccb('0x1c')](_0x577bc2);return _0x5aa0f5[_0x9ccb('0x21')]('Content-Range',_0x1f65e0+'-'+_0x7d49c7+'/'+_0x8c55b0)['json'](_0x4d03e4);}return null;};}function patchUpdates(_0x579d58){return function(_0x25bfda){try{jsonpatch[_0x9ccb('0x22')](_0x25bfda,_0x579d58,!![]);}catch(_0x1468c8){return BPromise['reject'](_0x1468c8);}return _0x25bfda[_0x9ccb('0x23')]();};}function saveUpdates(_0xdee7f6,_0x278579){return function(_0x5cd3b1){if(_0x5cd3b1){return _0x5cd3b1[_0x9ccb('0x24')](_0xdee7f6)[_0x9ccb('0x25')](function(_0x11db26){return _0x11db26;});}return null;};}function removeEntity(_0x31bbc6,_0x51d89a){return function(_0x46929e){if(_0x46929e){return _0x46929e[_0x9ccb('0x26')]()['then'](function(){var _0x47ae1a=_0x46929e[_0x9ccb('0x27')]({'plain':!![]});var _0x4146c3=_0x9ccb('0x28');return db[_0x9ccb('0x29')][_0x9ccb('0x26')]({'where':{'type':_0x4146c3,'resourceId':_0x47ae1a['id']}})['then'](function(){return _0x46929e;});})[_0x9ccb('0x25')](function(){_0x31bbc6[_0x9ccb('0x1c')](0xcc)[_0x9ccb('0x2a')]();});}};}function handleEntityNotFound(_0x164858,_0x374e64){return function(_0x444580){if(!_0x444580){_0x164858[_0x9ccb('0x1b')](0x194);}return _0x444580;};}function handleError(_0x1311c7,_0x1adc61){_0x1adc61=_0x1adc61||0x1f4;return function(_0x6e8d7d){logger[_0x9ccb('0x2b')](_0x6e8d7d['stack']);if(_0x6e8d7d[_0x9ccb('0x2c')]){delete _0x6e8d7d[_0x9ccb('0x2c')];}_0x1311c7[_0x9ccb('0x1c')](_0x1adc61)[_0x9ccb('0x2d')](_0x6e8d7d);};}exports[_0x9ccb('0x2e')]=function(_0x18fa5b,_0x46bcf4){var _0x1040d7={},_0x2b9ac9={},_0x26a9c5={'count':0x0,'rows':[]};return db[_0x9ccb('0x2f')]['describe']()[_0x9ccb('0x25')](function(_0x30494a){_0x2b9ac9[_0x9ccb('0x30')]=_[_0x9ccb('0x31')](_0x30494a);_0x2b9ac9[_0x9ccb('0x32')]=_['keys'](_0x18fa5b[_0x9ccb('0x32')]);_0x2b9ac9[_0x9ccb('0x33')]=_['intersection'](_0x2b9ac9[_0x9ccb('0x30')],_0x2b9ac9['query']);_0x1040d7['attributes']=_[_0x9ccb('0x34')](_0x2b9ac9[_0x9ccb('0x30')],qs['fields'](_0x18fa5b['query'][_0x9ccb('0x35')]));_0x1040d7[_0x9ccb('0x36')]=_0x1040d7[_0x9ccb('0x36')][_0x9ccb('0x37')]?_0x1040d7[_0x9ccb('0x36')]:_0x2b9ac9['model'];if(!_0x18fa5b[_0x9ccb('0x32')][_0x9ccb('0x38')](_0x9ccb('0x39'))){_0x1040d7[_0x9ccb('0x1f')]=qs[_0x9ccb('0x1f')](_0x18fa5b['query']['limit']);_0x1040d7[_0x9ccb('0x1d')]=qs['offset'](_0x18fa5b['query'][_0x9ccb('0x1d')]);}_0x1040d7[_0x9ccb('0x3a')]=qs[_0x9ccb('0x3b')](_0x18fa5b[_0x9ccb('0x32')][_0x9ccb('0x3b')]);_0x1040d7[_0x9ccb('0x3c')]=qs[_0x9ccb('0x33')](_[_0x9ccb('0x3d')](_0x18fa5b[_0x9ccb('0x32')],_0x2b9ac9[_0x9ccb('0x33')]),_0x30494a);if(_0x18fa5b[_0x9ccb('0x32')][_0x9ccb('0x3e')]){_0x1040d7['where']=_[_0x9ccb('0x3f')](_0x1040d7[_0x9ccb('0x3c')],{'$or':_[_0x9ccb('0x40')](_0x1040d7[_0x9ccb('0x36')],function(_0x494b5b){var _0xcfe3cf={};_0xcfe3cf[_0x494b5b]={'$like':'%'+_0x18fa5b[_0x9ccb('0x32')][_0x9ccb('0x3e')]+'%'};return _0xcfe3cf;})});}_0x1040d7=_[_0x9ccb('0x3f')]({},_0x1040d7,_0x18fa5b[_0x9ccb('0x41')]);var _0x1c538a={'where':_0x1040d7[_0x9ccb('0x3c')]};return db[_0x9ccb('0x2f')][_0x9ccb('0x20')](_0x1c538a)[_0x9ccb('0x25')](function(_0x2f3979){_0x26a9c5[_0x9ccb('0x20')]=_0x2f3979;if(_0x18fa5b['query'][_0x9ccb('0x42')]){_0x1040d7['include']=[{'all':!![]}];}return db[_0x9ccb('0x2f')][_0x9ccb('0x43')](_0x1040d7);})['then'](function(_0x49a5eb){_0x26a9c5['rows']=_0x49a5eb;return _0x26a9c5;})[_0x9ccb('0x25')](respondWithFilteredResult(_0x46bcf4,_0x1040d7))[_0x9ccb('0x44')](handleError(_0x46bcf4,null));})[_0x9ccb('0x44')](handleError(_0x46bcf4,null));};exports[_0x9ccb('0x45')]=function(_0x1beb59,_0x441a7b){var _0x24ce66={'raw':![],'where':{'id':_0x1beb59[_0x9ccb('0x46')]['id']}},_0x5e4fbb={};_0x5e4fbb['model']=_[_0x9ccb('0x31')](db[_0x9ccb('0x2f')][_0x9ccb('0x47')]);_0x5e4fbb[_0x9ccb('0x32')]=_[_0x9ccb('0x31')](_0x1beb59[_0x9ccb('0x32')]);_0x5e4fbb[_0x9ccb('0x33')]=_[_0x9ccb('0x34')](_0x5e4fbb[_0x9ccb('0x30')],_0x5e4fbb[_0x9ccb('0x32')]);_0x24ce66['attributes']=_[_0x9ccb('0x34')](_0x5e4fbb[_0x9ccb('0x30')],qs['fields'](_0x1beb59[_0x9ccb('0x32')][_0x9ccb('0x35')]));_0x24ce66[_0x9ccb('0x36')]=_0x24ce66[_0x9ccb('0x36')][_0x9ccb('0x37')]?_0x24ce66['attributes']:_0x5e4fbb[_0x9ccb('0x30')];if(_0x1beb59[_0x9ccb('0x32')][_0x9ccb('0x42')]){_0x24ce66['include']=[{'all':!![]}];}_0x24ce66=_['merge']({},_0x24ce66,_0x1beb59['options']);return db[_0x9ccb('0x2f')][_0x9ccb('0x48')](_0x24ce66)[_0x9ccb('0x25')](handleEntityNotFound(_0x441a7b,null))['then'](respondWithResult(_0x441a7b,null))[_0x9ccb('0x44')](handleError(_0x441a7b,null));};exports[_0x9ccb('0x49')]=function(_0x37438a,_0x402358){return db['CmCompany']['create'](_0x37438a[_0x9ccb('0x4a')],{})['then'](function(_0x5537bc){var _0x244b6a=_0x37438a[_0x9ccb('0x4b')][_0x9ccb('0x27')]({'plain':!![]});if(!_0x244b6a)throw new Error(_0x9ccb('0x4c'));if(_0x244b6a[_0x9ccb('0x4d')]===_0x9ccb('0x4b')){var _0x5e1e22=_0x5537bc[_0x9ccb('0x27')]({'plain':!![]});var _0x117475=_0x9ccb('0x28');return db[_0x9ccb('0x4e')][_0x9ccb('0x48')]({'where':{'name':_0x117475,'userProfileId':_0x244b6a[_0x9ccb('0x4f')]},'raw':!![]})['then'](function(_0x24e0ce){if(_0x24e0ce&&_0x24e0ce['autoAssociation']===0x0){return db[_0x9ccb('0x29')][_0x9ccb('0x49')]({'name':_0x5e1e22[_0x9ccb('0x2c')],'resourceId':_0x5e1e22['id'],'type':_0x24e0ce[_0x9ccb('0x2c')],'sectionId':_0x24e0ce['id']},{})[_0x9ccb('0x25')](function(){return _0x5537bc;});}else{return _0x5537bc;}})[_0x9ccb('0x44')](function(_0x442041){logger['error'](_0x9ccb('0x50'),_0x442041);throw _0x442041;});}return _0x5537bc;})[_0x9ccb('0x25')](respondWithResult(_0x402358,0xc9))['catch'](handleError(_0x402358,null));};exports['update']=function(_0x2be60d,_0x3a6348){if(_0x2be60d[_0x9ccb('0x4a')]['id']){delete _0x2be60d[_0x9ccb('0x4a')]['id'];}return db[_0x9ccb('0x2f')][_0x9ccb('0x48')]({'where':{'id':_0x2be60d[_0x9ccb('0x46')]['id']}})[_0x9ccb('0x25')](handleEntityNotFound(_0x3a6348,null))['then'](saveUpdates(_0x2be60d[_0x9ccb('0x4a')],null))[_0x9ccb('0x25')](respondWithResult(_0x3a6348,null))[_0x9ccb('0x44')](handleError(_0x3a6348,null));};exports[_0x9ccb('0x26')]=function(_0x2d09ef,_0x5032c0){return db[_0x9ccb('0x2f')]['find']({'where':{'id':_0x2d09ef['params']['id']}})['then'](handleEntityNotFound(_0x5032c0,null))[_0x9ccb('0x25')](removeEntity(_0x5032c0,null))['catch'](handleError(_0x5032c0,null));};exports['describe']=function(_0x2719ed,_0x132b28){return db[_0x9ccb('0x2f')]['describe']()[_0x9ccb('0x25')](respondWithResult(_0x132b28,null))[_0x9ccb('0x44')](handleError(_0x132b28,null));};exports[_0x9ccb('0x51')]=function(_0x186ad5,_0x394965,_0x2d69bc){return db[_0x9ccb('0x52')]['find']({'where':{'id':_0x186ad5['params']['id']}})['then'](handleEntityNotFound(_0x394965,null))[_0x9ccb('0x25')](function(_0x1b1a28){if(_0x1b1a28){return _0x1b1a28[_0x9ccb('0x51')](_0x186ad5[_0x9ccb('0x4a')][_0x9ccb('0x53')],_[_0x9ccb('0x54')](_0x186ad5[_0x9ccb('0x4a')],['ids','id'])||{});}})[_0x9ccb('0x25')](respondWithResult(_0x394965,null))[_0x9ccb('0x44')](handleError(_0x394965,null));};exports['getContacts']=function(_0x4cfe75,_0x32d0b3,_0x2d30f6){var _0x7a5c53={};var _0x5619a4={};var _0x427b8c;var _0x1dfe1a;return db[_0x9ccb('0x2f')]['findOne']({'where':{'id':_0x4cfe75[_0x9ccb('0x46')]['id']}})[_0x9ccb('0x25')](handleEntityNotFound(_0x32d0b3,null))[_0x9ccb('0x25')](function(_0x27df7d){if(_0x27df7d){_0x427b8c=_0x27df7d;_0x5619a4['model']=_[_0x9ccb('0x31')](db[_0x9ccb('0x52')][_0x9ccb('0x47')]);_0x5619a4['query']=_[_0x9ccb('0x31')](_0x4cfe75['query']);_0x5619a4['filters']=_[_0x9ccb('0x34')](_0x5619a4[_0x9ccb('0x30')],_0x5619a4[_0x9ccb('0x32')]);_0x7a5c53[_0x9ccb('0x36')]=_[_0x9ccb('0x34')](_0x5619a4[_0x9ccb('0x30')],qs['fields'](_0x4cfe75['query'][_0x9ccb('0x35')]));_0x7a5c53['attributes']=_0x7a5c53[_0x9ccb('0x36')][_0x9ccb('0x37')]?_0x7a5c53[_0x9ccb('0x36')]:_0x5619a4[_0x9ccb('0x30')];_0x7a5c53[_0x9ccb('0x3a')]=qs[_0x9ccb('0x3b')](_0x4cfe75[_0x9ccb('0x32')][_0x9ccb('0x3b')]);_0x7a5c53['where']=qs['filters'](_['pick'](_0x4cfe75[_0x9ccb('0x32')],_0x5619a4[_0x9ccb('0x33')]));if(_0x4cfe75[_0x9ccb('0x32')][_0x9ccb('0x3e')]){_0x7a5c53[_0x9ccb('0x3c')]=_[_0x9ccb('0x3f')](_0x7a5c53[_0x9ccb('0x3c')],{'$or':_[_0x9ccb('0x40')](_0x7a5c53['attributes'],function(_0x260c3e){var _0x46969b={};_0x46969b[_0x260c3e]={'$like':'%'+_0x4cfe75[_0x9ccb('0x32')][_0x9ccb('0x3e')]+'%'};return _0x46969b;})});}_0x7a5c53=_[_0x9ccb('0x3f')]({},_0x7a5c53,_0x4cfe75[_0x9ccb('0x41')]);return _0x427b8c[_0x9ccb('0x55')](_0x7a5c53);}})[_0x9ccb('0x25')](function(_0x1be4f1){if(_0x1be4f1){_0x1dfe1a=_0x1be4f1['length'];if(!_0x4cfe75[_0x9ccb('0x32')][_0x9ccb('0x38')]('nolimit')){_0x7a5c53[_0x9ccb('0x1f')]=qs['limit'](_0x4cfe75[_0x9ccb('0x32')]['limit']);_0x7a5c53['offset']=qs['offset'](_0x4cfe75[_0x9ccb('0x32')]['offset']);}return _0x427b8c[_0x9ccb('0x55')](_0x7a5c53);}})[_0x9ccb('0x25')](function(_0x3cee1d){if(_0x3cee1d){return _0x3cee1d?{'count':_0x1dfe1a,'rows':_0x3cee1d}:null;}})['then'](respondWithResult(_0x32d0b3,null))[_0x9ccb('0x44')](handleError(_0x32d0b3,null));};
\ No newline at end of file
+var _0x791c=['status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','stack','name','send','index','describe','model','query','filters','intersection','fields','attributes','hasOwnProperty','offset','order','sort','pick','filter','where','merge','map','options','CmCompany','include','rows','catch','show','params','keys','rawAttributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','CmContact','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x162f4b,_0x31b569){var _0x57b00b=function(_0xef34c9){while(--_0xef34c9){_0x162f4b['push'](_0x162f4b['shift']());}};_0x57b00b(++_0x31b569);}(_0x791c,0x1aa));var _0xc791=function(_0x561f25,_0x2d95c1){_0x561f25=_0x561f25-0x0;var _0x150e4c=_0x791c[_0x561f25];return _0x150e4c;};'use strict';var emlformat=require(_0xc791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc791('0x1'));var jsonpatch=require(_0xc791('0x2'));var rp=require(_0xc791('0x3'));var moment=require(_0xc791('0x4'));var BPromise=require(_0xc791('0x5'));var Mustache=require(_0xc791('0x6'));var util=require(_0xc791('0x7'));var path=require(_0xc791('0x8'));var sox=require(_0xc791('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc791('0xa'));var squel=require(_0xc791('0xb'));var crypto=require('crypto');var jsforce=require(_0xc791('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc791('0xd'));var querystring=require(_0xc791('0xe'));var Papa=require(_0xc791('0xf'));var Redis=require(_0xc791('0x10'));var authService=require(_0xc791('0x11'));var qs=require(_0xc791('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc791('0x13'));var logger=require('../../config/logger')(_0xc791('0x14'));var utils=require(_0xc791('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc791('0x16'));var db=require(_0xc791('0x17'))['db'];function respondWithStatusCode(_0x1a8028,_0x41be1a){_0x41be1a=_0x41be1a||0xcc;return function(_0x58a16b){if(_0x58a16b){return _0x1a8028['sendStatus'](_0x41be1a);}return _0x1a8028[_0xc791('0x18')](_0x41be1a)[_0xc791('0x19')]();};}function respondWithResult(_0x4c3d94,_0x2931fc){_0x2931fc=_0x2931fc||0xc8;return function(_0x234187){if(_0x234187){return _0x4c3d94[_0xc791('0x18')](_0x2931fc)[_0xc791('0x1a')](_0x234187);}};}function respondWithFilteredResult(_0x735354,_0x4a227a){return function(_0x575510){if(_0x575510){var _0x475aec=typeof _0x4a227a['offset']===_0xc791('0x1b')&&typeof _0x4a227a[_0xc791('0x1c')]==='undefined';var _0xefda2a=_0x575510[_0xc791('0x1d')];var _0x11bf47=_0x475aec?0x0:_0x4a227a['offset'];var _0x17ebda=_0x475aec?_0x575510[_0xc791('0x1d')]:_0x4a227a['offset']+_0x4a227a[_0xc791('0x1c')];var _0x52f510;if(_0x17ebda>=_0xefda2a){_0x17ebda=_0xefda2a;_0x52f510=0xc8;}else{_0x52f510=0xce;}_0x735354[_0xc791('0x18')](_0x52f510);return _0x735354[_0xc791('0x1e')](_0xc791('0x1f'),_0x11bf47+'-'+_0x17ebda+'/'+_0xefda2a)['json'](_0x575510);}return null;};}function patchUpdates(_0x18bfe2){return function(_0x513c69){try{jsonpatch[_0xc791('0x20')](_0x513c69,_0x18bfe2,!![]);}catch(_0x2a2f25){return BPromise[_0xc791('0x21')](_0x2a2f25);}return _0x513c69[_0xc791('0x22')]();};}function saveUpdates(_0x5b7070,_0x5e18c4){return function(_0x33963a){if(_0x33963a){return _0x33963a[_0xc791('0x23')](_0x5b7070)[_0xc791('0x24')](function(_0x35167e){return _0x35167e;});}return null;};}function removeEntity(_0x55d817,_0x71cd2e){return function(_0x5cf270){if(_0x5cf270){return _0x5cf270[_0xc791('0x25')]()[_0xc791('0x24')](function(){var _0x1f7246=_0x5cf270[_0xc791('0x26')]({'plain':!![]});var _0x3012eb=_0xc791('0x27');return db[_0xc791('0x28')][_0xc791('0x25')]({'where':{'type':_0x3012eb,'resourceId':_0x1f7246['id']}})[_0xc791('0x24')](function(){return _0x5cf270;});})[_0xc791('0x24')](function(){_0x55d817[_0xc791('0x18')](0xcc)[_0xc791('0x19')]();});}};}function handleEntityNotFound(_0x2d6e1b,_0x14108b){return function(_0x5ad8ee){if(!_0x5ad8ee){_0x2d6e1b[_0xc791('0x29')](0x194);}return _0x5ad8ee;};}function handleError(_0x315d12,_0x3c02ef){_0x3c02ef=_0x3c02ef||0x1f4;return function(_0x5a2ba2){logger['error'](_0x5a2ba2[_0xc791('0x2a')]);if(_0x5a2ba2[_0xc791('0x2b')]){delete _0x5a2ba2[_0xc791('0x2b')];}_0x315d12[_0xc791('0x18')](_0x3c02ef)[_0xc791('0x2c')](_0x5a2ba2);};}exports[_0xc791('0x2d')]=function(_0x3197d8,_0x3adf4e){var _0x1c9880={},_0x162ccc={},_0x2939e8={'count':0x0,'rows':[]};return db['CmCompany'][_0xc791('0x2e')]()['then'](function(_0x15b134){_0x162ccc[_0xc791('0x2f')]=_['keys'](_0x15b134);_0x162ccc[_0xc791('0x30')]=_['keys'](_0x3197d8['query']);_0x162ccc[_0xc791('0x31')]=_[_0xc791('0x32')](_0x162ccc['model'],_0x162ccc[_0xc791('0x30')]);_0x1c9880['attributes']=_[_0xc791('0x32')](_0x162ccc['model'],qs[_0xc791('0x33')](_0x3197d8[_0xc791('0x30')][_0xc791('0x33')]));_0x1c9880[_0xc791('0x34')]=_0x1c9880['attributes']['length']?_0x1c9880[_0xc791('0x34')]:_0x162ccc[_0xc791('0x2f')];if(!_0x3197d8[_0xc791('0x30')][_0xc791('0x35')]('nolimit')){_0x1c9880[_0xc791('0x1c')]=qs['limit'](_0x3197d8[_0xc791('0x30')][_0xc791('0x1c')]);_0x1c9880['offset']=qs[_0xc791('0x36')](_0x3197d8[_0xc791('0x30')][_0xc791('0x36')]);}_0x1c9880[_0xc791('0x37')]=qs['sort'](_0x3197d8[_0xc791('0x30')][_0xc791('0x38')]);_0x1c9880['where']=qs[_0xc791('0x31')](_[_0xc791('0x39')](_0x3197d8[_0xc791('0x30')],_0x162ccc[_0xc791('0x31')]),_0x15b134);if(_0x3197d8[_0xc791('0x30')][_0xc791('0x3a')]){_0x1c9880[_0xc791('0x3b')]=_[_0xc791('0x3c')](_0x1c9880[_0xc791('0x3b')],{'$or':_[_0xc791('0x3d')](_0x1c9880[_0xc791('0x34')],function(_0x4e131f){var _0x3865dc={};_0x3865dc[_0x4e131f]={'$like':'%'+_0x3197d8[_0xc791('0x30')]['filter']+'%'};return _0x3865dc;})});}_0x1c9880=_['merge']({},_0x1c9880,_0x3197d8[_0xc791('0x3e')]);var _0xea170e={'where':_0x1c9880[_0xc791('0x3b')]};return db[_0xc791('0x3f')]['count'](_0xea170e)[_0xc791('0x24')](function(_0x46095e){_0x2939e8['count']=_0x46095e;if(_0x3197d8[_0xc791('0x30')]['includeAll']){_0x1c9880[_0xc791('0x40')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x1c9880);})[_0xc791('0x24')](function(_0x38bc83){_0x2939e8[_0xc791('0x41')]=_0x38bc83;return _0x2939e8;})['then'](respondWithFilteredResult(_0x3adf4e,_0x1c9880))[_0xc791('0x42')](handleError(_0x3adf4e,null));})['catch'](handleError(_0x3adf4e,null));};exports[_0xc791('0x43')]=function(_0x282a9a,_0x48d334){var _0x15f5d1={'raw':![],'where':{'id':_0x282a9a[_0xc791('0x44')]['id']}},_0x4236d4={};_0x4236d4[_0xc791('0x2f')]=_[_0xc791('0x45')](db[_0xc791('0x3f')][_0xc791('0x46')]);_0x4236d4[_0xc791('0x30')]=_[_0xc791('0x45')](_0x282a9a[_0xc791('0x30')]);_0x4236d4[_0xc791('0x31')]=_['intersection'](_0x4236d4['model'],_0x4236d4[_0xc791('0x30')]);_0x15f5d1['attributes']=_[_0xc791('0x32')](_0x4236d4[_0xc791('0x2f')],qs[_0xc791('0x33')](_0x282a9a['query'][_0xc791('0x33')]));_0x15f5d1[_0xc791('0x34')]=_0x15f5d1[_0xc791('0x34')][_0xc791('0x47')]?_0x15f5d1['attributes']:_0x4236d4[_0xc791('0x2f')];if(_0x282a9a['query'][_0xc791('0x48')]){_0x15f5d1['include']=[{'all':!![]}];}_0x15f5d1=_[_0xc791('0x3c')]({},_0x15f5d1,_0x282a9a['options']);return db[_0xc791('0x3f')][_0xc791('0x49')](_0x15f5d1)['then'](handleEntityNotFound(_0x48d334,null))[_0xc791('0x24')](respondWithResult(_0x48d334,null))[_0xc791('0x42')](handleError(_0x48d334,null));};exports[_0xc791('0x4a')]=function(_0x269ee4,_0xa97d3){return db['CmCompany']['create'](_0x269ee4[_0xc791('0x4b')],{})[_0xc791('0x24')](function(_0x344151){var _0x1ca119=_0x269ee4[_0xc791('0x4c')][_0xc791('0x26')]({'plain':!![]});if(!_0x1ca119)throw new Error(_0xc791('0x4d'));if(_0x1ca119[_0xc791('0x4e')]==='user'){var _0x30cd55=_0x344151[_0xc791('0x26')]({'plain':!![]});var _0x3a4245='Companies';return db[_0xc791('0x4f')][_0xc791('0x49')]({'where':{'name':_0x3a4245,'userProfileId':_0x1ca119[_0xc791('0x50')]},'raw':!![]})[_0xc791('0x24')](function(_0x26bbcd){if(_0x26bbcd&&_0x26bbcd[_0xc791('0x51')]===0x0){return db[_0xc791('0x28')][_0xc791('0x4a')]({'name':_0x30cd55[_0xc791('0x2b')],'resourceId':_0x30cd55['id'],'type':_0x26bbcd[_0xc791('0x2b')],'sectionId':_0x26bbcd['id']},{})[_0xc791('0x24')](function(){return _0x344151;});}else{return _0x344151;}})['catch'](function(_0x407ff3){logger[_0xc791('0x52')](_0xc791('0x53'),_0x407ff3);throw _0x407ff3;});}return _0x344151;})[_0xc791('0x24')](respondWithResult(_0xa97d3,0xc9))[_0xc791('0x42')](handleError(_0xa97d3,null));};exports['update']=function(_0x3b69f3,_0x1aa074){if(_0x3b69f3[_0xc791('0x4b')]['id']){delete _0x3b69f3['body']['id'];}return db[_0xc791('0x3f')][_0xc791('0x49')]({'where':{'id':_0x3b69f3[_0xc791('0x44')]['id']}})['then'](handleEntityNotFound(_0x1aa074,null))[_0xc791('0x24')](saveUpdates(_0x3b69f3[_0xc791('0x4b')],null))[_0xc791('0x24')](respondWithResult(_0x1aa074,null))['catch'](handleError(_0x1aa074,null));};exports[_0xc791('0x25')]=function(_0x3dcecc,_0x2021c3){return db[_0xc791('0x3f')][_0xc791('0x49')]({'where':{'id':_0x3dcecc[_0xc791('0x44')]['id']}})[_0xc791('0x24')](handleEntityNotFound(_0x2021c3,null))['then'](removeEntity(_0x2021c3,null))[_0xc791('0x42')](handleError(_0x2021c3,null));};exports[_0xc791('0x2e')]=function(_0x1a0aa5,_0x558591){return db[_0xc791('0x3f')]['describe']()[_0xc791('0x24')](respondWithResult(_0x558591,null))[_0xc791('0x42')](handleError(_0x558591,null));};exports[_0xc791('0x54')]=function(_0x286141,_0x33c948,_0xda62b2){return db['CmContact'][_0xc791('0x49')]({'where':{'id':_0x286141[_0xc791('0x44')]['id']}})[_0xc791('0x24')](handleEntityNotFound(_0x33c948,null))[_0xc791('0x24')](function(_0x5d77aa){if(_0x5d77aa){return _0x5d77aa[_0xc791('0x54')](_0x286141[_0xc791('0x4b')][_0xc791('0x55')],_[_0xc791('0x56')](_0x286141[_0xc791('0x4b')],['ids','id'])||{});}})[_0xc791('0x24')](respondWithResult(_0x33c948,null))[_0xc791('0x42')](handleError(_0x33c948,null));};exports[_0xc791('0x57')]=function(_0x41e5f8,_0x4cc8e1,_0x5a2481){var _0x5c3978={};var _0x5c0f38={};var _0x1f271b;var _0x4790e4;return db['CmCompany'][_0xc791('0x58')]({'where':{'id':_0x41e5f8[_0xc791('0x44')]['id']}})[_0xc791('0x24')](handleEntityNotFound(_0x4cc8e1,null))[_0xc791('0x24')](function(_0x3aa13e){if(_0x3aa13e){_0x1f271b=_0x3aa13e;_0x5c0f38[_0xc791('0x2f')]=_[_0xc791('0x45')](db[_0xc791('0x59')][_0xc791('0x46')]);_0x5c0f38[_0xc791('0x30')]=_[_0xc791('0x45')](_0x41e5f8[_0xc791('0x30')]);_0x5c0f38[_0xc791('0x31')]=_['intersection'](_0x5c0f38[_0xc791('0x2f')],_0x5c0f38[_0xc791('0x30')]);_0x5c3978['attributes']=_[_0xc791('0x32')](_0x5c0f38[_0xc791('0x2f')],qs[_0xc791('0x33')](_0x41e5f8[_0xc791('0x30')][_0xc791('0x33')]));_0x5c3978[_0xc791('0x34')]=_0x5c3978[_0xc791('0x34')][_0xc791('0x47')]?_0x5c3978[_0xc791('0x34')]:_0x5c0f38[_0xc791('0x2f')];_0x5c3978[_0xc791('0x37')]=qs[_0xc791('0x38')](_0x41e5f8[_0xc791('0x30')][_0xc791('0x38')]);_0x5c3978[_0xc791('0x3b')]=qs[_0xc791('0x31')](_[_0xc791('0x39')](_0x41e5f8[_0xc791('0x30')],_0x5c0f38['filters']));if(_0x41e5f8[_0xc791('0x30')]['filter']){_0x5c3978['where']=_[_0xc791('0x3c')](_0x5c3978['where'],{'$or':_[_0xc791('0x3d')](_0x5c3978[_0xc791('0x34')],function(_0x5b9074){var _0x52ec03={};_0x52ec03[_0x5b9074]={'$like':'%'+_0x41e5f8[_0xc791('0x30')][_0xc791('0x3a')]+'%'};return _0x52ec03;})});}_0x5c3978=_[_0xc791('0x3c')]({},_0x5c3978,_0x41e5f8[_0xc791('0x3e')]);return _0x1f271b[_0xc791('0x57')](_0x5c3978);}})[_0xc791('0x24')](function(_0x3fa53d){if(_0x3fa53d){_0x4790e4=_0x3fa53d[_0xc791('0x47')];if(!_0x41e5f8[_0xc791('0x30')]['hasOwnProperty']('nolimit')){_0x5c3978[_0xc791('0x1c')]=qs[_0xc791('0x1c')](_0x41e5f8['query'][_0xc791('0x1c')]);_0x5c3978[_0xc791('0x36')]=qs[_0xc791('0x36')](_0x41e5f8[_0xc791('0x30')]['offset']);}return _0x1f271b[_0xc791('0x57')](_0x5c3978);}})['then'](function(_0x5053fb){if(_0x5053fb){return _0x5053fb?{'count':_0x4790e4,'rows':_0x5053fb}:null;}})[_0xc791('0x24')](respondWithResult(_0x4cc8e1,null))[_0xc791('0x42')](handleError(_0x4cc8e1,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index dc22c22..ad4df53 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 _0xf769=['exports','define','CmCompany','util','api','bluebird','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x10f5e9,_0x68f062){var _0x552cc1=function(_0x35da1e){while(--_0x35da1e){_0x10f5e9['push'](_0x10f5e9['shift']());}};_0x552cc1(++_0x68f062);}(_0xf769,0x147));var _0x9f76=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0xf769[_0xe0b81f];return _0x290e5e;};'use strict';var _=require('lodash');var util=require(_0x9f76('0x0'));var logger=require('../../config/logger')(_0x9f76('0x1'));var moment=require('moment');var BPromise=require(_0x9f76('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9f76('0x3'));var config=require(_0x9f76('0x4'));var attributes=require(_0x9f76('0x5'));module[_0x9f76('0x6')]=function(_0x3c3e8f,_0x38f8c6){return _0x3c3e8f[_0x9f76('0x7')](_0x9f76('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x80b1=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash'];(function(_0x3bac6c,_0x54f9b7){var _0x242365=function(_0x10ccaa){while(--_0x10ccaa){_0x3bac6c['push'](_0x3bac6c['shift']());}};_0x242365(++_0x54f9b7);}(_0x80b1,0x173));var _0x180b=function(_0x19a90e,_0xe14b0b){_0x19a90e=_0x19a90e-0x0;var _0xa49b11=_0x80b1[_0x19a90e];return _0xa49b11;};'use strict';var _=require(_0x180b('0x0'));var util=require('util');var logger=require(_0x180b('0x1'))('api');var moment=require(_0x180b('0x2'));var BPromise=require(_0x180b('0x3'));var rp=require(_0x180b('0x4'));var fs=require('fs');var path=require(_0x180b('0x5'));var rimraf=require(_0x180b('0x6'));var config=require('../../config/environment');var attributes=require(_0x180b('0x7'));module[_0x180b('0x8')]=function(_0x5d46e0,_0x4d5bff){return _0x5d46e0[_0x180b('0x9')](_0x180b('0xa'),attributes,{'tableName':_0x180b('0xb'),'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 d1bc846..498f9cd 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 _0xcd31=['stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x562c98,_0x59211c){var _0x43f4c6=function(_0xc27258){while(--_0xc27258){_0x562c98['push'](_0x562c98['shift']());}};_0x43f4c6(++_0x59211c);}(_0xcd31,0x119));var _0x1cd3=function(_0x4e1a60,_0x233ed1){_0x4e1a60=_0x4e1a60-0x0;var _0x19277a=_0xcd31[_0x4e1a60];return _0x19277a;};'use strict';var _=require('lodash');var util=require(_0x1cd3('0x0'));var moment=require(_0x1cd3('0x1'));var BPromise=require(_0x1cd3('0x2'));var rs=require(_0x1cd3('0x3'));var fs=require('fs');var Redis=require(_0x1cd3('0x4'));var db=require(_0x1cd3('0x5'))['db'];var utils=require(_0x1cd3('0x6'));var logger=require(_0x1cd3('0x7'))(_0x1cd3('0x8'));var config=require('../../config/environment');var jayson=require(_0x1cd3('0x9'));var client=jayson[_0x1cd3('0xa')][_0x1cd3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2035d1,_0x59a5ae,_0x5e12bb){return new BPromise(function(_0xb40452,_0x2ee4a7){return client[_0x1cd3('0xc')](_0x2035d1,_0x5e12bb)['then'](function(_0x3f993c){logger[_0x1cd3('0xd')](_0x1cd3('0xe'),_0x59a5ae,_0x1cd3('0xf'));logger[_0x1cd3('0x10')](_0x1cd3('0x11'),_0x59a5ae,'request\x20sent',JSON[_0x1cd3('0x12')](_0x3f993c));if(_0x3f993c[_0x1cd3('0x13')]){if(_0x3f993c[_0x1cd3('0x13')][_0x1cd3('0x14')]===0x1f4){logger[_0x1cd3('0x13')]('CmCompany,\x20%s,\x20%s',_0x59a5ae,_0x3f993c['error']['message']);return _0x2ee4a7(_0x3f993c[_0x1cd3('0x13')][_0x1cd3('0x15')]);}logger[_0x1cd3('0x13')](_0x1cd3('0xe'),_0x59a5ae,_0x3f993c[_0x1cd3('0x13')][_0x1cd3('0x15')]);return _0xb40452(_0x3f993c['error'][_0x1cd3('0x15')]);}else{logger[_0x1cd3('0xd')](_0x1cd3('0xe'),_0x59a5ae,_0x1cd3('0xf'));_0xb40452(_0x3f993c[_0x1cd3('0x16')][_0x1cd3('0x15')]);}})['catch'](function(_0x5d0a37){logger[_0x1cd3('0x13')](_0x1cd3('0xe'),_0x59a5ae,_0x5d0a37);_0x2ee4a7(_0x5d0a37);});});}
\ No newline at end of file
+var _0x953d=['debug','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s'];(function(_0x2bc05b,_0x3dffbd){var _0x5ef2eb=function(_0x15e58d){while(--_0x15e58d){_0x2bc05b['push'](_0x2bc05b['shift']());}};_0x5ef2eb(++_0x3dffbd);}(_0x953d,0x105));var _0xd953=function(_0x14a321,_0x4889d9){_0x14a321=_0x14a321-0x0;var _0x16dd89=_0x953d[_0x14a321];return _0x16dd89;};'use strict';var _=require(_0xd953('0x0'));var util=require(_0xd953('0x1'));var moment=require(_0xd953('0x2'));var BPromise=require(_0xd953('0x3'));var rs=require(_0xd953('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd953('0x5'))['db'];var utils=require(_0xd953('0x6'));var logger=require(_0xd953('0x7'))(_0xd953('0x8'));var config=require('../../config/environment');var jayson=require(_0xd953('0x9'));var client=jayson[_0xd953('0xa')][_0xd953('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x172c57,_0x3c14cb,_0x87f0f4){return new BPromise(function(_0x4e9ecb,_0x2f57f2){return client[_0xd953('0xc')](_0x172c57,_0x87f0f4)[_0xd953('0xd')](function(_0x5a71c2){logger['info'](_0xd953('0xe'),_0x3c14cb,'request\x20sent');logger[_0xd953('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x3c14cb,_0xd953('0x10'),JSON[_0xd953('0x11')](_0x5a71c2));if(_0x5a71c2[_0xd953('0x12')]){if(_0x5a71c2[_0xd953('0x12')][_0xd953('0x13')]===0x1f4){logger[_0xd953('0x12')](_0xd953('0xe'),_0x3c14cb,_0x5a71c2[_0xd953('0x12')][_0xd953('0x14')]);return _0x2f57f2(_0x5a71c2['error'][_0xd953('0x14')]);}logger['error'](_0xd953('0xe'),_0x3c14cb,_0x5a71c2['error'][_0xd953('0x14')]);return _0x4e9ecb(_0x5a71c2[_0xd953('0x12')][_0xd953('0x14')]);}else{logger[_0xd953('0x15')](_0xd953('0xe'),_0x3c14cb,'request\x20sent');_0x4e9ecb(_0x5a71c2[_0xd953('0x16')]['message']);}})['catch'](function(_0x5f5c71){logger[_0xd953('0x12')]('CmCompany,\x20%s,\x20%s',_0x3c14cb,_0x5f5c71);_0x2f57f2(_0x5f5c71);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 4220072..42a5108 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 _0xd38e=['getContacts','post','create','put','update','delete','/:id','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','describe','show','/:id/contacts'];(function(_0x2ba701,_0x7da377){var _0x5a4dd1=function(_0x1457ca){while(--_0x1457ca){_0x2ba701['push'](_0x2ba701['shift']());}};_0x5a4dd1(++_0x7da377);}(_0xd38e,0x17d));var _0xed38=function(_0x4ae1fe,_0x54d08e){_0x4ae1fe=_0x4ae1fe-0x0;var _0x2a45e9=_0xd38e[_0x4ae1fe];return _0x2a45e9;};'use strict';var multer=require(_0xed38('0x0'));var util=require('util');var path=require(_0xed38('0x1'));var timeout=require(_0xed38('0x2'));var express=require(_0xed38('0x3'));var router=express[_0xed38('0x4')]();var fs_extra=require(_0xed38('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xed38('0x6'));var config=require(_0xed38('0x7'));var controller=require(_0xed38('0x8'));router['get']('/',auth[_0xed38('0x9')](),controller[_0xed38('0xa')]);router[_0xed38('0xb')]('/describe',auth[_0xed38('0x9')](),controller[_0xed38('0xc')]);router[_0xed38('0xb')]('/:id',auth[_0xed38('0x9')](),controller[_0xed38('0xd')]);router[_0xed38('0xb')](_0xed38('0xe'),auth['isAuthenticated'](),controller[_0xed38('0xf')]);router[_0xed38('0x10')]('/',auth[_0xed38('0x9')](),controller[_0xed38('0x11')]);router[_0xed38('0x10')](_0xed38('0xe'),auth['isAuthenticated'](),controller['addContacts']);router[_0xed38('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xed38('0x13')]);router[_0xed38('0x14')](_0xed38('0x15'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x516a=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getContacts','post','create','/:id/contacts','put','update','delete','exports','multer','util'];(function(_0x22074d,_0x33df85){var _0x3a24ce=function(_0x1dfb83){while(--_0x1dfb83){_0x22074d['push'](_0x22074d['shift']());}};_0x3a24ce(++_0x33df85);}(_0x516a,0x1d9));var _0xa516=function(_0xe6e3e2,_0x2b01da){_0xe6e3e2=_0xe6e3e2-0x0;var _0x126571=_0x516a[_0xe6e3e2];return _0x126571;};'use strict';var multer=require(_0xa516('0x0'));var util=require(_0xa516('0x1'));var path=require(_0xa516('0x2'));var timeout=require(_0xa516('0x3'));var express=require(_0xa516('0x4'));var router=express[_0xa516('0x5')]();var fs_extra=require(_0xa516('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa516('0x7'));var config=require(_0xa516('0x8'));var controller=require(_0xa516('0x9'));router[_0xa516('0xa')]('/',auth['isAuthenticated'](),controller[_0xa516('0xb')]);router[_0xa516('0xa')](_0xa516('0xc'),auth[_0xa516('0xd')](),controller[_0xa516('0xe')]);router[_0xa516('0xa')](_0xa516('0xf'),auth[_0xa516('0xd')](),controller[_0xa516('0x10')]);router[_0xa516('0xa')]('/:id/contacts',auth[_0xa516('0xd')](),controller[_0xa516('0x11')]);router[_0xa516('0x12')]('/',auth['isAuthenticated'](),controller[_0xa516('0x13')]);router[_0xa516('0x12')](_0xa516('0x14'),auth[_0xa516('0xd')](),controller['addContacts']);router[_0xa516('0x15')](_0xa516('0xf'),auth[_0xa516('0xd')](),controller[_0xa516('0x16')]);router[_0xa516('0x17')]('/:id',auth[_0xa516('0xd')](),controller['destroy']);module[_0xa516('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 4f9ffb8..f1dcd00 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 _0xb5d5=['STRING','INTEGER','UNSIGNED','NOW','sequelize','exports'];(function(_0x3f67b4,_0xb0c4eb){var _0x4b10b4=function(_0x983ac5){while(--_0x983ac5){_0x3f67b4['push'](_0x3f67b4['shift']());}};_0x4b10b4(++_0xb0c4eb);}(_0xb5d5,0xd6));var _0x5b5d=function(_0x4ad38b,_0x2a7e44){_0x4ad38b=_0x4ad38b-0x0;var _0x53090e=_0xb5d5[_0x4ad38b];return _0x53090e;};'use strict';var _=require('lodash');var Sequelize=require(_0x5b5d('0x0'));module[_0x5b5d('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x5b5d('0x2')]},'street':{'type':Sequelize[_0x5b5d('0x2')]},'postalCode':{'type':Sequelize[_0x5b5d('0x2')]},'city':{'type':Sequelize[_0x5b5d('0x2')]},'country':{'type':Sequelize[_0x5b5d('0x2')]},'dateOfBirth':{'type':Sequelize[_0x5b5d('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x5b5d('0x2')]},'mobile':{'type':Sequelize[_0x5b5d('0x2')]},'fax':{'type':Sequelize[_0x5b5d('0x2')]},'email':{'type':Sequelize[_0x5b5d('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x5b5d('0x2')]},'fb_data':{'type':Sequelize[_0x5b5d('0x2')]},'twitter':{'type':Sequelize[_0x5b5d('0x2')]},'skype':{'type':Sequelize[_0x5b5d('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x5b5d('0x2')]},'telegram':{'type':Sequelize[_0x5b5d('0x2')]},'UserId':{'type':Sequelize[_0x5b5d('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x5b5d('0x2')]},'priority':{'type':Sequelize[_0x5b5d('0x3')](0x2)[_0x5b5d('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x5b5d('0x5')]},'dialTimezone':{'type':Sequelize[_0x5b5d('0x2')]},'utcOffset':{'type':Sequelize[_0x5b5d('0x3')]}};
\ No newline at end of file
+var _0xbf67=['INTEGER','UNSIGNED','NOW','lodash','exports','STRING','TEXT'];(function(_0x6ef4ec,_0x1d73b0){var _0x2eb05b=function(_0x36ba4f){while(--_0x36ba4f){_0x6ef4ec['push'](_0x6ef4ec['shift']());}};_0x2eb05b(++_0x1d73b0);}(_0xbf67,0x1ca));var _0x7bf6=function(_0xc3ffb1,_0x2f1fcf){_0xc3ffb1=_0xc3ffb1-0x0;var _0x2f26ee=_0xbf67[_0xc3ffb1];return _0x2f26ee;};'use strict';var _=require(_0x7bf6('0x0'));var Sequelize=require('sequelize');module[_0x7bf6('0x1')]={'firstName':{'type':Sequelize[_0x7bf6('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x7bf6('0x2')]},'postalCode':{'type':Sequelize[_0x7bf6('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x7bf6('0x2')]},'dateOfBirth':{'type':Sequelize[_0x7bf6('0x2')]},'description':{'type':Sequelize[_0x7bf6('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x7bf6('0x2')]},'fax':{'type':Sequelize[_0x7bf6('0x2')]},'email':{'type':Sequelize[_0x7bf6('0x2')]},'url':{'type':Sequelize[_0x7bf6('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x7bf6('0x2')]},'twitter':{'type':Sequelize[_0x7bf6('0x2')]},'skype':{'type':Sequelize[_0x7bf6('0x2')]},'teams':{'type':Sequelize[_0x7bf6('0x2')]},'viber':{'type':Sequelize[_0x7bf6('0x2')]},'line':{'type':Sequelize[_0x7bf6('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x7bf6('0x2')]},'UserId':{'type':Sequelize[_0x7bf6('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x7bf6('0x2')]},'priority':{'type':Sequelize[_0x7bf6('0x4')](0x2)[_0x7bf6('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x7bf6('0x6')]},'dialTimezone':{'type':Sequelize[_0x7bf6('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 89d5e05..002b8e6 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','../../../config/logger','email','../../../config/environment','head','value','address','generate','name','substring'];(function(_0x1f7201,_0x141b79){var _0x289fd2=function(_0x20ce23){while(--_0x20ce23){_0x1f7201['push'](_0x1f7201['shift']());}};_0x289fd2(++_0x141b79);}(_0xe4df,0xdf));var _0xfe4d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe4df[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xfe4d('0x0'));var moment=require(_0xfe4d('0x1'));var random=require(_0xfe4d('0x2'));var fs=require('fs');var path=require(_0xfe4d('0x3'));var util=require(_0xfe4d('0x4'));var tnef=require('node-tnef');var logger=require(_0xfe4d('0x5'))(_0xfe4d('0x6'));var config=require(_0xfe4d('0x7'));function getAddress(_0x38c887){var _0x5c0034=_[_0xfe4d('0x8')](_0x38c887[_0xfe4d('0x9')]);return _0x5c0034&&_0x5c0034[_0xfe4d('0xa')]?_0x5c0034['address']:'anonymous'+random[_0xfe4d('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x576d8d){var _0x1ceab0=_[_0xfe4d('0x8')](_0x576d8d[_0xfe4d('0x9')]);if(_0x1ceab0&&_0x1ceab0[_0xfe4d('0xc')]){if(_0x1ceab0[_0xfe4d('0xc')]==_0x1ceab0[_0xfe4d('0xa')]){return _0x1ceab0['name'][_0xfe4d('0xd')](0x0,_0x1ceab0[_0xfe4d('0xc')]['indexOf']('@'));}var _0x586fc2=_0x1ceab0[_0xfe4d('0xc')][_0xfe4d('0xe')](/\s+/);return _0x586fc2[_0xfe4d('0xf')]>0x1?_0x586fc2[_0xfe4d('0x10')](0x0,-0x1)[_0xfe4d('0x11')]('\x20'):_0x1ceab0[_0xfe4d('0xc')];}return _0xfe4d('0x12');}function getLastName(_0x45bfb4){var _0x57613e=_[_0xfe4d('0x8')](_0x45bfb4['value']);if(_0x57613e&&_0x57613e['name']){var _0x22696c=_0x57613e['name'][_0xfe4d('0xe')](/\s+/);return _0x22696c[_0xfe4d('0xf')]>0x1?_0x22696c[_0xfe4d('0x13')]():'';}return'';}function getMails(_0x46dba,_0x2f4b0a){var _0x4f7898='';for(var _0x13da9f=0x0;_0x13da9f<_0x2f4b0a[_0xfe4d('0x9')][_0xfe4d('0xf')];_0x13da9f+=0x1){if(_0x2f4b0a['value'][_0x13da9f][_0xfe4d('0xa')]!==_0x46dba){if(!_[_0xfe4d('0x14')](_0x4f7898)){_0x4f7898+=',';}_0x4f7898+=_0x2f4b0a[_0xfe4d('0x9')][_0x13da9f][_0xfe4d('0xc')]||_0x2f4b0a['value'][_0x13da9f][_0xfe4d('0xa')]||'';_0x4f7898+='\x20<';_0x4f7898+=_0x2f4b0a[_0xfe4d('0x9')][_0x13da9f]['address']?_0x2f4b0a[_0xfe4d('0x9')][_0x13da9f][_0xfe4d('0xa')]:_0xfe4d('0x15')+random[_0xfe4d('0xb')](0x6)+'@xcally.com';_0x4f7898+='>';}}return _0x4f7898;}function parseEmail(_0x41c7af,_0x213190,_0xc266df){if(_0x213190[_0xfe4d('0x16')]){var _0x23e7d3=/