From: support
Date: Mon, 18 Jul 2022 14:05:29 +0000 (+0000)
Subject: Built motion from commit 2c0a2438.|2.6.12
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22?a=commitdiff_plain;h=841e72be0e016bb18c01ff233bf14193a5cc01ac;p=motion2.git
Built motion from commit 2c0a2438.|2.6.12
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 1c76efd..62e80dc 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-18T13:40:13.940Z",
+ "time": "2022-07-18T13:56:41.789Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index e900163..66b8609 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-18T13:40:13.940Z",
+ "time": "2022-07-18T13:56:41.789Z",
"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 a948212..69c8ff4 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 _0x2b5e=['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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','browser','bot'];(function(_0x187bb7,_0x420bab){var _0x2b356a=function(_0x40ee45){while(--_0x40ee45){_0x187bb7['push'](_0x187bb7['shift']());}};_0x2b356a(++_0x420bab);}(_0x2b5e,0xf4));var _0xe2b5=function(_0x1aae33,_0x110a80){_0x1aae33=_0x1aae33-0x0;var _0x2e91e9=_0x2b5e[_0x1aae33];return _0x2e91e9;};'use strict';var Sequelize=require(_0xe2b5('0x0'));module[_0xe2b5('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x56b3f2){return this[_0xe2b5('0x2')](_0xe2b5('0x3'));}},'action':{'type':Sequelize[_0xe2b5('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xe2b5('0x5'),_0xe2b5('0x6'),_0xe2b5('0x7'),_0xe2b5('0x8'),'urlForward',_0xe2b5('0x9'),_0xe2b5('0xa'),'script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xe2b5('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xe2b5('0xc')},'data2':{'type':Sequelize[_0xe2b5('0x4')](0x1000),'comment':_0xe2b5('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xe2b5('0xe')},'data5':{'type':Sequelize[_0xe2b5('0x4')](0x1000),'comments':_0xe2b5('0xf')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xe2b5('0x10')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xb9fb=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','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','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','jscripty','urlForward','browser','bot','script'];(function(_0x533110,_0x20937f){var _0xc3c866=function(_0x2d4a68){while(--_0x2d4a68){_0x533110['push'](_0x533110['shift']());}};_0xc3c866(++_0x20937f);}(_0xb9fb,0xef));var _0xbb9f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb9fb[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xbb9f('0x0'));module[_0xbb9f('0x1')]={'name':{'type':Sequelize[_0xbb9f('0x2')],'get':function(_0x2bc64a){return this[_0xbb9f('0x3')](_0xbb9f('0x4'));}},'action':{'type':Sequelize[_0xbb9f('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xbb9f('0x6'),_0xbb9f('0x7'),'motionbar',_0xbb9f('0x8'),_0xbb9f('0x9'),_0xbb9f('0xa'),_0xbb9f('0xb'),_0xbb9f('0xc')]],'msg':_0xbb9f('0xd')}},'comment':_0xbb9f('0xd')},'data1':{'type':Sequelize[_0xbb9f('0x5')](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0xbb9f('0x5')](0x1000),'comment':_0xbb9f('0xe')},'data3':{'type':Sequelize[_0xbb9f('0x5')](0x1000),'comment':_0xbb9f('0xf')},'data4':{'type':Sequelize[_0xbb9f('0x5')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xbb9f('0x10')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xbb9f('0x11')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 5e85c1b..1f3451b 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 _0xcbe8=['apply','save','update','then','destroy','end','stack','name','send','body','find','Action','params','catch','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set'];(function(_0xc7890c,_0xdc090d){var _0x406442=function(_0x1806d5){while(--_0x1806d5){_0xc7890c['push'](_0xc7890c['shift']());}};_0x406442(++_0xdc090d);}(_0xcbe8,0x116));var _0x8cbe=function(_0x17b4f9,_0x43410c){_0x17b4f9=_0x17b4f9-0x0;var _0x1e6897=_0xcbe8[_0x17b4f9];return _0x1e6897;};'use strict';var emlformat=require(_0x8cbe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8cbe('0x1'));var jsonpatch=require(_0x8cbe('0x2'));var rp=require('request-promise');var moment=require(_0x8cbe('0x3'));var BPromise=require(_0x8cbe('0x4'));var Mustache=require(_0x8cbe('0x5'));var util=require('util');var path=require(_0x8cbe('0x6'));var sox=require('sox');var csv=require(_0x8cbe('0x7'));var ejs=require(_0x8cbe('0x8'));var fs=require('fs');var fs_extra=require(_0x8cbe('0x9'));var _=require('lodash');var squel=require(_0x8cbe('0xa'));var crypto=require(_0x8cbe('0xb'));var jsforce=require(_0x8cbe('0xc'));var deskjs=require(_0x8cbe('0xd'));var toCsv=require(_0x8cbe('0x7'));var querystring=require('querystring');var Papa=require(_0x8cbe('0xe'));var Redis=require('ioredis');var authService=require(_0x8cbe('0xf'));var qs=require(_0x8cbe('0x10'));var as=require(_0x8cbe('0x11'));var hardwareService=require(_0x8cbe('0x12'));var logger=require(_0x8cbe('0x13'))(_0x8cbe('0x14'));var utils=require('../../config/utils');var config=require(_0x8cbe('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8cbe('0x16'))['db'];function respondWithStatusCode(_0x3f3de7,_0x356b18){_0x356b18=_0x356b18||0xcc;return function(_0x58b518){if(_0x58b518){return _0x3f3de7['sendStatus'](_0x356b18);}return _0x3f3de7[_0x8cbe('0x17')](_0x356b18)['end']();};}function respondWithResult(_0x18b6a1,_0x1a0761){_0x1a0761=_0x1a0761||0xc8;return function(_0x13ea4d){if(_0x13ea4d){return _0x18b6a1[_0x8cbe('0x17')](_0x1a0761)[_0x8cbe('0x18')](_0x13ea4d);}};}function respondWithFilteredResult(_0x2bcb60,_0x314837){return function(_0x27e920){if(_0x27e920){var _0x52a4a8=typeof _0x314837[_0x8cbe('0x19')]===_0x8cbe('0x1a')&&typeof _0x314837[_0x8cbe('0x1b')]===_0x8cbe('0x1a');var _0x579f6f=_0x27e920[_0x8cbe('0x1c')];var _0x4bea34=_0x52a4a8?0x0:_0x314837[_0x8cbe('0x19')];var _0x15a9ae=_0x52a4a8?_0x27e920[_0x8cbe('0x1c')]:_0x314837['offset']+_0x314837[_0x8cbe('0x1b')];var _0x2a0454;if(_0x15a9ae>=_0x579f6f){_0x15a9ae=_0x579f6f;_0x2a0454=0xc8;}else{_0x2a0454=0xce;}_0x2bcb60[_0x8cbe('0x17')](_0x2a0454);return _0x2bcb60[_0x8cbe('0x1d')]('Content-Range',_0x4bea34+'-'+_0x15a9ae+'/'+_0x579f6f)[_0x8cbe('0x18')](_0x27e920);}return null;};}function patchUpdates(_0x5ca59c){return function(_0x1aee55){try{jsonpatch[_0x8cbe('0x1e')](_0x1aee55,_0x5ca59c,!![]);}catch(_0xb0394e){return BPromise['reject'](_0xb0394e);}return _0x1aee55[_0x8cbe('0x1f')]();};}function saveUpdates(_0x4842fb,_0x315fd6){return function(_0x1a7e29){if(_0x1a7e29){return _0x1a7e29[_0x8cbe('0x20')](_0x4842fb)[_0x8cbe('0x21')](function(_0x30b335){return _0x30b335;});}return null;};}function removeEntity(_0x4811f0,_0x480c5d){return function(_0x239a75){if(_0x239a75){return _0x239a75[_0x8cbe('0x22')]()[_0x8cbe('0x21')](function(){_0x4811f0[_0x8cbe('0x17')](0xcc)[_0x8cbe('0x23')]();});}};}function handleEntityNotFound(_0x46eaea,_0x2e816a){return function(_0x528a47){if(!_0x528a47){_0x46eaea['sendStatus'](0x194);}return _0x528a47;};}function handleError(_0x3ea82d,_0x4337b1){_0x4337b1=_0x4337b1||0x1f4;return function(_0xfb5d05){logger['error'](_0xfb5d05[_0x8cbe('0x24')]);if(_0xfb5d05[_0x8cbe('0x25')]){delete _0xfb5d05[_0x8cbe('0x25')];}_0x3ea82d[_0x8cbe('0x17')](_0x4337b1)[_0x8cbe('0x26')](_0xfb5d05);};}exports[_0x8cbe('0x20')]=function(_0x2914ae,_0x2e3144){if(_0x2914ae[_0x8cbe('0x27')]['id']){delete _0x2914ae[_0x8cbe('0x27')]['id'];}return db['Action'][_0x8cbe('0x28')]({'where':{'id':_0x2914ae['params']['id']}})['then'](handleEntityNotFound(_0x2e3144,null))[_0x8cbe('0x21')](saveUpdates(_0x2914ae[_0x8cbe('0x27')],null))[_0x8cbe('0x21')](respondWithResult(_0x2e3144,null))['catch'](handleError(_0x2e3144,null));};exports[_0x8cbe('0x22')]=function(_0xb4b8fb,_0x148bbd){return db[_0x8cbe('0x29')][_0x8cbe('0x28')]({'where':{'id':_0xb4b8fb[_0x8cbe('0x2a')]['id']}})[_0x8cbe('0x21')](handleEntityNotFound(_0x148bbd,null))[_0x8cbe('0x21')](removeEntity(_0x148bbd,null))[_0x8cbe('0x2b')](handleError(_0x148bbd,null));};
\ No newline at end of file
+var _0xa7aa=['ejs','fs-extra','lodash','squel','crypto','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','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3cfd8c,_0x23116b){var _0x9f0972=function(_0x40fb9f){while(--_0x40fb9f){_0x3cfd8c['push'](_0x3cfd8c['shift']());}};_0x9f0972(++_0x23116b);}(_0xa7aa,0x1c1));var _0xaa7a=function(_0x1a0848,_0x486d35){_0x1a0848=_0x1a0848-0x0;var _0x5c16b3=_0xa7aa[_0x1a0848];return _0x5c16b3;};'use strict';var emlformat=require(_0xaa7a('0x0'));var rimraf=require(_0xaa7a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa7a('0x2'));var rp=require(_0xaa7a('0x3'));var moment=require('moment');var BPromise=require(_0xaa7a('0x4'));var Mustache=require(_0xaa7a('0x5'));var util=require(_0xaa7a('0x6'));var path=require(_0xaa7a('0x7'));var sox=require(_0xaa7a('0x8'));var csv=require(_0xaa7a('0x9'));var ejs=require(_0xaa7a('0xa'));var fs=require('fs');var fs_extra=require(_0xaa7a('0xb'));var _=require(_0xaa7a('0xc'));var squel=require(_0xaa7a('0xd'));var crypto=require(_0xaa7a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xaa7a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaa7a('0x10'));var Redis=require(_0xaa7a('0x11'));var authService=require(_0xaa7a('0x12'));var qs=require(_0xaa7a('0x13'));var as=require(_0xaa7a('0x14'));var hardwareService=require(_0xaa7a('0x15'));var logger=require(_0xaa7a('0x16'))(_0xaa7a('0x17'));var utils=require(_0xaa7a('0x18'));var config=require(_0xaa7a('0x19'));var licenseUtil=require(_0xaa7a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35b52e,_0x31019f){_0x31019f=_0x31019f||0xcc;return function(_0x32bfe8){if(_0x32bfe8){return _0x35b52e[_0xaa7a('0x1b')](_0x31019f);}return _0x35b52e[_0xaa7a('0x1c')](_0x31019f)[_0xaa7a('0x1d')]();};}function respondWithResult(_0x54a536,_0xeb7cc0){_0xeb7cc0=_0xeb7cc0||0xc8;return function(_0x1594ab){if(_0x1594ab){return _0x54a536['status'](_0xeb7cc0)['json'](_0x1594ab);}};}function respondWithFilteredResult(_0x5aaadc,_0x289c61){return function(_0x1bb90c){if(_0x1bb90c){var _0x53735b=typeof _0x289c61['offset']===_0xaa7a('0x1e')&&typeof _0x289c61[_0xaa7a('0x1f')]===_0xaa7a('0x1e');var _0x563533=_0x1bb90c['count'];var _0x3d17b8=_0x53735b?0x0:_0x289c61[_0xaa7a('0x20')];var _0x1f427e=_0x53735b?_0x1bb90c[_0xaa7a('0x21')]:_0x289c61[_0xaa7a('0x20')]+_0x289c61[_0xaa7a('0x1f')];var _0x330776;if(_0x1f427e>=_0x563533){_0x1f427e=_0x563533;_0x330776=0xc8;}else{_0x330776=0xce;}_0x5aaadc[_0xaa7a('0x1c')](_0x330776);return _0x5aaadc[_0xaa7a('0x22')](_0xaa7a('0x23'),_0x3d17b8+'-'+_0x1f427e+'/'+_0x563533)['json'](_0x1bb90c);}return null;};}function patchUpdates(_0x50fd57){return function(_0x5b9baa){try{jsonpatch[_0xaa7a('0x24')](_0x5b9baa,_0x50fd57,!![]);}catch(_0x30981b){return BPromise[_0xaa7a('0x25')](_0x30981b);}return _0x5b9baa[_0xaa7a('0x26')]();};}function saveUpdates(_0x262f9a,_0x53ab3d){return function(_0x38ec60){if(_0x38ec60){return _0x38ec60[_0xaa7a('0x27')](_0x262f9a)[_0xaa7a('0x28')](function(_0x3cc649){return _0x3cc649;});}return null;};}function removeEntity(_0x325506,_0x65f95){return function(_0x1235d0){if(_0x1235d0){return _0x1235d0[_0xaa7a('0x29')]()['then'](function(){_0x325506[_0xaa7a('0x1c')](0xcc)[_0xaa7a('0x1d')]();});}};}function handleEntityNotFound(_0x10bfca,_0x318cfd){return function(_0x4ea110){if(!_0x4ea110){_0x10bfca[_0xaa7a('0x1b')](0x194);}return _0x4ea110;};}function handleError(_0x2750d9,_0x33ad14){_0x33ad14=_0x33ad14||0x1f4;return function(_0x2ad835){logger[_0xaa7a('0x2a')](_0x2ad835[_0xaa7a('0x2b')]);if(_0x2ad835[_0xaa7a('0x2c')]){delete _0x2ad835[_0xaa7a('0x2c')];}_0x2750d9[_0xaa7a('0x1c')](_0x33ad14)[_0xaa7a('0x2d')](_0x2ad835);};}exports['update']=function(_0x160d45,_0x508c74){if(_0x160d45[_0xaa7a('0x2e')]['id']){delete _0x160d45[_0xaa7a('0x2e')]['id'];}return db[_0xaa7a('0x2f')][_0xaa7a('0x30')]({'where':{'id':_0x160d45[_0xaa7a('0x31')]['id']}})[_0xaa7a('0x28')](handleEntityNotFound(_0x508c74,null))[_0xaa7a('0x28')](saveUpdates(_0x160d45['body'],null))[_0xaa7a('0x28')](respondWithResult(_0x508c74,null))[_0xaa7a('0x32')](handleError(_0x508c74,null));};exports[_0xaa7a('0x29')]=function(_0x4589dc,_0x323dba){return db[_0xaa7a('0x2f')][_0xaa7a('0x30')]({'where':{'id':_0x4589dc[_0xaa7a('0x31')]['id']}})['then'](handleEntityNotFound(_0x323dba,null))[_0xaa7a('0x28')](removeEntity(_0x323dba,null))[_0xaa7a('0x32')](handleError(_0x323dba,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 3ce45bd..681453d 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 _0xa11d=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash'];(function(_0x4f7588,_0x399e6b){var _0x535c70=function(_0x5c2bbb){while(--_0x5c2bbb){_0x4f7588['push'](_0x4f7588['shift']());}};_0x535c70(++_0x399e6b);}(_0xa11d,0xd1));var _0xda11=function(_0x21e97b,_0x65a77f){_0x21e97b=_0x21e97b-0x0;var _0x10ba44=_0xa11d[_0x21e97b];return _0x10ba44;};'use strict';var _=require(_0xda11('0x0'));var util=require(_0xda11('0x1'));var logger=require(_0xda11('0x2'))('api');var moment=require(_0xda11('0x3'));var BPromise=require(_0xda11('0x4'));var rp=require(_0xda11('0x5'));var fs=require('fs');var path=require(_0xda11('0x6'));var rimraf=require(_0xda11('0x7'));var config=require(_0xda11('0x8'));var attributes=require(_0xda11('0x9'));module[_0xda11('0xa')]=function(_0x4fcd94,_0x17852a){return _0x4fcd94[_0xda11('0xb')](_0xda11('0xc'),attributes,{'tableName':_0xda11('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x743e=['request-promise','path','../../config/environment','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x52b286,_0x4b4dd9){var _0x23942e=function(_0x58e688){while(--_0x58e688){_0x52b286['push'](_0x52b286['shift']());}};_0x23942e(++_0x4b4dd9);}(_0x743e,0x1c1));var _0xe743=function(_0x1e6861,_0x430894){_0x1e6861=_0x1e6861-0x0;var _0x335eb4=_0x743e[_0x1e6861];return _0x335eb4;};'use strict';var _=require(_0xe743('0x0'));var util=require(_0xe743('0x1'));var logger=require(_0xe743('0x2'))(_0xe743('0x3'));var moment=require(_0xe743('0x4'));var BPromise=require(_0xe743('0x5'));var rp=require(_0xe743('0x6'));var fs=require('fs');var path=require(_0xe743('0x7'));var rimraf=require('rimraf');var config=require(_0xe743('0x8'));var attributes=require('./action.attributes');module[_0xe743('0x9')]=function(_0x5ec0c8,_0x4934f7){return _0x5ec0c8[_0xe743('0xa')](_0xe743('0xb'),attributes,{'tableName':_0xe743('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 129ebc0..2207125 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0xffefe8,_0x52e7dc){var _0x581cec=function(_0x40776a){while(--_0x40776a){_0xffefe8['push'](_0xffefe8['shift']());}};_0x581cec(++_0x52e7dc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'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')]('Action,\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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x5c6486,_0x14ddd5){var _0x10d57d=function(_0x7ecb89){while(--_0x7ecb89){_0x5c6486['push'](_0x5c6486['shift']());}};_0x10d57d(++_0x14ddd5);}(_0xabce,0x103));var _0xeabc=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xabce[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 321804d..f982f54 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 _0x75c3=['../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x120189,_0x3329b4){var _0x4018ad=function(_0x25ef74){while(--_0x25ef74){_0x120189['push'](_0x120189['shift']());}};_0x4018ad(++_0x3329b4);}(_0x75c3,0x1d8));var _0x375c=function(_0x4d4cf0,_0x1a00c8){_0x4d4cf0=_0x4d4cf0-0x0;var _0x1cbb1f=_0x75c3[_0x4d4cf0];return _0x1cbb1f;};'use strict';var multer=require(_0x375c('0x0'));var util=require(_0x375c('0x1'));var path=require('path');var timeout=require(_0x375c('0x2'));var express=require(_0x375c('0x3'));var router=express[_0x375c('0x4')]();var fs_extra=require(_0x375c('0x5'));var auth=require(_0x375c('0x6'));var interaction=require(_0x375c('0x7'));var config=require(_0x375c('0x8'));var controller=require(_0x375c('0x9'));router[_0x375c('0xa')](_0x375c('0xb'),auth[_0x375c('0xc')](),controller[_0x375c('0xd')]);router[_0x375c('0xe')](_0x375c('0xb'),auth[_0x375c('0xc')](),controller['destroy']);module[_0x375c('0xf')]=router;
\ No newline at end of file
+var _0x2eeb=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0x2eeb,0x13f));var _0xb2ee=function(_0x440de6,_0x2fbc65){_0x440de6=_0x440de6-0x0;var _0x4ce7d9=_0x2eeb[_0x440de6];return _0x4ce7d9;};'use strict';var multer=require(_0xb2ee('0x0'));var util=require(_0xb2ee('0x1'));var path=require(_0xb2ee('0x2'));var timeout=require(_0xb2ee('0x3'));var express=require(_0xb2ee('0x4'));var router=express[_0xb2ee('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb2ee('0x6'));var interaction=require(_0xb2ee('0x7'));var config=require(_0xb2ee('0x8'));var controller=require(_0xb2ee('0x9'));router[_0xb2ee('0xa')](_0xb2ee('0xb'),auth['isAuthenticated'](),controller[_0xb2ee('0xc')]);router[_0xb2ee('0xd')](_0xb2ee('0xb'),auth[_0xb2ee('0xe')](),controller[_0xb2ee('0xf')]);module[_0xb2ee('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index af3a255..4de7c05 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0xe3ada4,_0x25380f){var _0x2f3b33=function(_0x5ee167){while(--_0x5ee167){_0xe3ada4['push'](_0xe3ada4['shift']());}};_0x2f3b33(++_0x25380f);}(_0xeff8,0x186));var _0x8eff=function(_0x286726,_0x20a337){_0x286726=_0x286726-0x0;var _0xcd4fe9=_0xeff8[_0x286726];return _0xcd4fe9;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}};
\ No newline at end of file
+var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0xa0e76b,_0x3fbdf0){var _0x15660a=function(_0x514c75){while(--_0x514c75){_0xa0e76b['push'](_0xa0e76b['shift']());}};_0x15660a(++_0x3fbdf0);}(_0xabce,0x103));var _0xeabc=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xabce[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index d28e186..57d70d0 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 _0xd9ee=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','options','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','MetricId','metric','function','format','replace','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','table','groupBy','orderBy','output','web','fullPath','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','run','runReport','operator','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model'];(function(_0x100547,_0x3905d6){var _0x5d9aa7=function(_0x3bd161){while(--_0x3bd161){_0x100547['push'](_0x100547['shift']());}};_0x5d9aa7(++_0x3905d6);}(_0xd9ee,0x117));var _0xed9e=function(_0x3b4dd6,_0x392e80){_0x3b4dd6=_0x3b4dd6-0x0;var _0xc48377=_0xd9ee[_0x3b4dd6];return _0xc48377;};'use strict';var emlformat=require(_0xed9e('0x0'));var rimraf=require(_0xed9e('0x1'));var zipdir=require(_0xed9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed9e('0x3'));var moment=require('moment');var BPromise=require(_0xed9e('0x4'));var Mustache=require(_0xed9e('0x5'));var util=require(_0xed9e('0x6'));var path=require(_0xed9e('0x7'));var sox=require(_0xed9e('0x8'));var csv=require(_0xed9e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed9e('0xa'));var squel=require('squel');var crypto=require(_0xed9e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xed9e('0x9'));var querystring=require('querystring');var Papa=require(_0xed9e('0xc'));var Redis=require(_0xed9e('0xd'));var authService=require(_0xed9e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xed9e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed9e('0x10'))(_0xed9e('0x11'));var utils=require(_0xed9e('0x12'));var config=require(_0xed9e('0x13'));var licenseUtil=require(_0xed9e('0x14'));var db=require(_0xed9e('0x15'))['db'];var dbH=require('../../mysqldb')[_0xed9e('0x16')];function respondWithStatusCode(_0x4c5048,_0x1c1a53){_0x1c1a53=_0x1c1a53||0xcc;return function(_0x1bb9ae){if(_0x1bb9ae){return _0x4c5048[_0xed9e('0x17')](_0x1c1a53);}return _0x4c5048['status'](_0x1c1a53)['end']();};}function respondWithResult(_0x39d56d,_0x271b21){_0x271b21=_0x271b21||0xc8;return function(_0x26122d){if(_0x26122d){return _0x39d56d[_0xed9e('0x18')](_0x271b21)[_0xed9e('0x19')](_0x26122d);}};}function respondWithFilteredResult(_0x4dc7f2,_0x4151d3){return function(_0x4d9edb){if(_0x4d9edb){var _0x49d0f4=typeof _0x4151d3[_0xed9e('0x1a')]===_0xed9e('0x1b')&&typeof _0x4151d3[_0xed9e('0x1c')]===_0xed9e('0x1b');var _0x30a142=_0x4d9edb['count'];var _0xed9987=_0x49d0f4?0x0:_0x4151d3['offset'];var _0x538827=_0x49d0f4?_0x4d9edb[_0xed9e('0x1d')]:_0x4151d3[_0xed9e('0x1a')]+_0x4151d3[_0xed9e('0x1c')];var _0x534d2d;if(_0x538827>=_0x30a142){_0x538827=_0x30a142;_0x534d2d=0xc8;}else{_0x534d2d=0xce;}_0x4dc7f2[_0xed9e('0x18')](_0x534d2d);return _0x4dc7f2[_0xed9e('0x1e')](_0xed9e('0x1f'),_0xed9987+'-'+_0x538827+'/'+_0x30a142)[_0xed9e('0x19')](_0x4d9edb);}return null;};}function patchUpdates(_0x6edce9){return function(_0x569d53){try{jsonpatch[_0xed9e('0x20')](_0x569d53,_0x6edce9,!![]);}catch(_0x37ed7c){return BPromise['reject'](_0x37ed7c);}return _0x569d53['save']();};}function saveUpdates(_0x52bbc0,_0x3bde31){return function(_0x3c1140){if(_0x3c1140){return _0x3c1140[_0xed9e('0x21')](_0x52bbc0)[_0xed9e('0x22')](function(_0x4a89c3){return _0x4a89c3;});}return null;};}function removeEntity(_0x119191,_0x2dbcb7){return function(_0x219231){if(_0x219231){return _0x219231[_0xed9e('0x23')]()[_0xed9e('0x22')](function(){var _0x46f652=_0x219231[_0xed9e('0x24')]({'plain':!![]});var _0x386b98='CustomReports';return db['UserProfileResource'][_0xed9e('0x23')]({'where':{'type':_0x386b98,'resourceId':_0x46f652['id']}})[_0xed9e('0x22')](function(){return _0x219231;});})[_0xed9e('0x22')](function(){_0x119191[_0xed9e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x310cac,_0x997983){return function(_0x8a2684){if(!_0x8a2684){_0x310cac[_0xed9e('0x17')](0x194);}return _0x8a2684;};}function handleError(_0x58800e,_0x578cc9){_0x578cc9=_0x578cc9||0x1f4;return function(_0x5ef638){logger['error'](_0x5ef638[_0xed9e('0x25')]);if(_0x5ef638[_0xed9e('0x26')]){delete _0x5ef638[_0xed9e('0x26')];}_0x58800e[_0xed9e('0x18')](_0x578cc9)['send'](_0x5ef638);};}exports[_0xed9e('0x27')]=function(_0x337899,_0x355d84){var _0x4c316a={},_0x1911df={},_0x363051={'count':0x0,'rows':[]};var _0x486884=_[_0xed9e('0x28')](db[_0xed9e('0x29')][_0xed9e('0x2a')],function(_0x1658c2){return{'name':_0x1658c2[_0xed9e('0x2b')],'type':_0x1658c2[_0xed9e('0x2c')][_0xed9e('0x2d')]};});_0x1911df[_0xed9e('0x2e')]=_[_0xed9e('0x28')](_0x486884,_0xed9e('0x26'));_0x1911df['query']=_['keys'](_0x337899[_0xed9e('0x2f')]);_0x1911df[_0xed9e('0x30')]=_[_0xed9e('0x31')](_0x1911df['model'],_0x1911df[_0xed9e('0x2f')]);_0x4c316a['attributes']=_[_0xed9e('0x31')](_0x1911df[_0xed9e('0x2e')],qs[_0xed9e('0x32')](_0x337899[_0xed9e('0x2f')][_0xed9e('0x32')]));_0x4c316a['attributes']=_0x4c316a[_0xed9e('0x33')][_0xed9e('0x34')]?_0x4c316a[_0xed9e('0x33')]:_0x1911df[_0xed9e('0x2e')];if(!_0x337899[_0xed9e('0x2f')][_0xed9e('0x35')](_0xed9e('0x36'))){_0x4c316a[_0xed9e('0x1c')]=qs['limit'](_0x337899[_0xed9e('0x2f')][_0xed9e('0x1c')]);_0x4c316a['offset']=qs[_0xed9e('0x1a')](_0x337899[_0xed9e('0x2f')][_0xed9e('0x1a')]);}_0x4c316a[_0xed9e('0x37')]=qs['sort'](_0x337899[_0xed9e('0x2f')][_0xed9e('0x38')]);_0x4c316a['where']=qs['filters'](_['pick'](_0x337899[_0xed9e('0x2f')],_0x1911df[_0xed9e('0x30')]),_0x486884);if(_0x337899[_0xed9e('0x2f')][_0xed9e('0x39')]){_0x4c316a[_0xed9e('0x3a')]=_[_0xed9e('0x3b')](_0x4c316a[_0xed9e('0x3a')],{'$or':_[_0xed9e('0x28')](_0x486884,function(_0x59d18e){if(_0x59d18e[_0xed9e('0x2c')]!==_0xed9e('0x3c')){var _0x5e10f7={};_0x5e10f7[_0x59d18e[_0xed9e('0x26')]]={'$like':'%'+_0x337899[_0xed9e('0x2f')][_0xed9e('0x39')]+'%'};return _0x5e10f7;}})});}_0x4c316a=_['merge']({},_0x4c316a,_0x337899['options']);var _0x463f0a={'where':_0x4c316a[_0xed9e('0x3a')]};return db[_0xed9e('0x29')][_0xed9e('0x1d')](_0x463f0a)[_0xed9e('0x22')](function(_0x5648c4){_0x363051[_0xed9e('0x1d')]=_0x5648c4;if(_0x337899[_0xed9e('0x2f')][_0xed9e('0x3d')]){_0x4c316a[_0xed9e('0x3e')]=[{'all':!![]}];}return db[_0xed9e('0x29')][_0xed9e('0x3f')](_0x4c316a);})[_0xed9e('0x22')](function(_0x471959){_0x363051[_0xed9e('0x40')]=_0x471959;return _0x363051;})['then'](respondWithFilteredResult(_0x355d84,_0x4c316a))[_0xed9e('0x41')](handleError(_0x355d84,null));};exports[_0xed9e('0x42')]=function(_0x3fc8ee,_0x42c35d){var _0x382c36={'raw':![],'where':{'id':_0x3fc8ee['params']['id']}},_0x44d50d={};_0x44d50d[_0xed9e('0x2e')]=_['keys'](db[_0xed9e('0x29')][_0xed9e('0x2a')]);_0x44d50d['query']=_['keys'](_0x3fc8ee[_0xed9e('0x2f')]);_0x44d50d[_0xed9e('0x30')]=_['intersection'](_0x44d50d[_0xed9e('0x2e')],_0x44d50d[_0xed9e('0x2f')]);_0x382c36[_0xed9e('0x33')]=_[_0xed9e('0x31')](_0x44d50d[_0xed9e('0x2e')],qs[_0xed9e('0x32')](_0x3fc8ee['query'][_0xed9e('0x32')]));_0x382c36[_0xed9e('0x33')]=_0x382c36[_0xed9e('0x33')][_0xed9e('0x34')]?_0x382c36[_0xed9e('0x33')]:_0x44d50d[_0xed9e('0x2e')];if(_0x3fc8ee[_0xed9e('0x2f')][_0xed9e('0x3d')]){_0x382c36[_0xed9e('0x3e')]=[{'all':!![]}];}_0x382c36=_[_0xed9e('0x3b')]({},_0x382c36,_0x3fc8ee['options']);return db[_0xed9e('0x29')][_0xed9e('0x43')](_0x382c36)[_0xed9e('0x22')](handleEntityNotFound(_0x42c35d,null))[_0xed9e('0x22')](respondWithResult(_0x42c35d,null))[_0xed9e('0x41')](handleError(_0x42c35d,null));};exports['create']=function(_0x5a6950,_0x407097){return db['AnalyticCustomReport'][_0xed9e('0x44')](_0x5a6950[_0xed9e('0x45')],{})['then'](function(_0x2ef3fb){var _0x5118c3=_0x5a6950['user']['get']({'plain':!![]});if(!_0x5118c3)throw new Error(_0xed9e('0x46'));if(_0x5118c3[_0xed9e('0x47')]===_0xed9e('0x48')){var _0x1a9ba2=_0x2ef3fb[_0xed9e('0x24')]({'plain':!![]});var _0x4d9f5a=_0xed9e('0x49');return db[_0xed9e('0x4a')]['find']({'where':{'name':_0x4d9f5a,'userProfileId':_0x5118c3[_0xed9e('0x4b')]},'raw':!![]})[_0xed9e('0x22')](function(_0x18eb85){if(_0x18eb85&&_0x18eb85['autoAssociation']===0x0){return db[_0xed9e('0x4c')][_0xed9e('0x44')]({'name':_0x1a9ba2[_0xed9e('0x26')],'resourceId':_0x1a9ba2['id'],'type':'CustomReports','sectionId':_0x18eb85['id']},{})[_0xed9e('0x22')](function(){return _0x2ef3fb;});}else{return _0x2ef3fb;}})[_0xed9e('0x41')](function(_0x3f6e5c){logger[_0xed9e('0x4d')](_0xed9e('0x4e'),_0x3f6e5c);throw _0x3f6e5c;});}return _0x2ef3fb;})[_0xed9e('0x22')](respondWithResult(_0x407097,0xc9))[_0xed9e('0x41')](handleError(_0x407097,null));};exports[_0xed9e('0x21')]=function(_0x4c1b07,_0x76e3f3){if(_0x4c1b07[_0xed9e('0x45')]['id']){delete _0x4c1b07[_0xed9e('0x45')]['id'];}return db[_0xed9e('0x29')][_0xed9e('0x43')]({'where':{'id':_0x4c1b07[_0xed9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x76e3f3,null))[_0xed9e('0x22')](saveUpdates(_0x4c1b07[_0xed9e('0x45')],null))[_0xed9e('0x22')](respondWithResult(_0x76e3f3,null))[_0xed9e('0x41')](handleError(_0x76e3f3,null));};exports[_0xed9e('0x23')]=function(_0x17e0b2,_0x9c02c9){return db[_0xed9e('0x29')][_0xed9e('0x43')]({'where':{'id':_0x17e0b2[_0xed9e('0x4f')]['id']}})[_0xed9e('0x22')](handleEntityNotFound(_0x9c02c9,null))['then'](removeEntity(_0x9c02c9,null))[_0xed9e('0x41')](handleError(_0x9c02c9,null));};exports[_0xed9e('0x50')]=function(_0xc0a05f,_0x390b95){var _0x417f06=0xa;var _0xcc1d70=[_0xed9e('0x51'),_0xed9e('0x52'),_0xed9e('0x53'),_0xed9e('0x54')];var _0x24e90d={'SUM':_0xed9e('0x55'),'COUNT':_0xed9e('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xed9e('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xed9e('0x58'),'GROUP_CONCAT ASC':_0xed9e('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x573249={'SEC_TO_TIME':_0xed9e('0x5a'),'DATE':_0xed9e('0x5b'),'HOUR':_0xed9e('0x5c'),'ROUND':_0xed9e('0x5d'),'UNIX_TIMESTAMP':_0xed9e('0x5e')};var _0x2d07f2=function(_0x3df906){return!_[_0xed9e('0x5f')](['IS\x20NULL',_0xed9e('0x60'),_0xed9e('0x61'),_0xed9e('0x62')],_0x3df906);};var _0x105896=function(_0x5a1c63){if(!_0x5a1c63||!_0x5a1c63['rules'][_0xed9e('0x34')]){return'';}for(var _0x5ef1f0='(',_0x29ac94=0x0;_0x29ac94<_0x5a1c63[_0xed9e('0x63')][_0xed9e('0x34')];_0x29ac94+=0x1){_0x29ac94>0x0&&(_0x5ef1f0+='\x20'+_0x5a1c63['operator']+'\x20');_0x5ef1f0+=_0x5a1c63[_0xed9e('0x63')][_0x29ac94][_0xed9e('0x64')]?_0x105896(_0x5a1c63[_0xed9e('0x63')][_0x29ac94][_0xed9e('0x64')]):_0x5a1c63[_0xed9e('0x63')][_0x29ac94][_0xed9e('0x65')]+'\x20'+_0x5a1c63[_0xed9e('0x63')][_0x29ac94][_0xed9e('0x66')]+(_0x2d07f2(_0x5a1c63[_0xed9e('0x63')][_0x29ac94][_0xed9e('0x66')])?'\x20'+_0x5a1c63[_0xed9e('0x63')][_0x29ac94][_0xed9e('0x67')]:'');}return _0x5ef1f0+')';};var _0x276ec5={'where':{'id':_0xc0a05f['params']['id']}},_0x558262,_0x56feeb,_0xdb29fa,_0x53f4c7,_0x433ade;_0x276ec5=_[_0xed9e('0x3b')]({},_0x276ec5,_0xc0a05f[_0xed9e('0x68')]);return db[_0xed9e('0x29')][_0xed9e('0x43')](_0x276ec5)[_0xed9e('0x22')](function(_0x386207){if(_0x386207){_0x558262=_0x386207;return _0x386207[_0xed9e('0x69')]();}return null;})[_0xed9e('0x22')](function(_0x160b12){if(_0x160b12){if(!_0x160b12[_0xed9e('0x34')]){throw new db[(_0xed9e('0x6a'))][(_0xed9e('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56feeb=_0x160b12;return db[_0xed9e('0x6c')][_0xed9e('0x3f')]({'raw':!![]});}return null;})[_0xed9e('0x22')](function(_0x317f4b){if(_0x317f4b){_0xdb29fa=_[_0xed9e('0x6d')](_0x317f4b,'id');var _0x45cd76;var _0x3c8060=squel[_0xed9e('0x6e')]();_0x3c8060[_0xed9e('0x6f')](_0x558262['table']);for(var _0x336527=0x0;_0x336527<_0x56feeb[_0xed9e('0x34')];_0x336527+=0x1){_0x45cd76=_0x56feeb[_0x336527]['MetricId']?_0xdb29fa[_0x56feeb[_0x336527][_0xed9e('0x70')]][_0xed9e('0x71')]:_0x56feeb[_0x336527]['field'];_0x45cd76=_0x56feeb[_0x336527][_0xed9e('0x72')]?_['replace'](_0x24e90d[_0x56feeb[_0x336527]['function']],'%s',_0x45cd76):_0x45cd76;_0x45cd76=_0x56feeb[_0x336527][_0xed9e('0x73')]?_[_0xed9e('0x74')](_0x573249[_0x56feeb[_0x336527][_0xed9e('0x73')]],'%s',_0x45cd76):_0x45cd76;if(_0x56feeb[_0x336527]['groupBy']){_0x3c8060[_0xed9e('0x64')](_0x45cd76);}_0x56feeb[_0x336527]['orderBy']&&_0x3c8060[_0xed9e('0x37')](_0x45cd76,_0x56feeb[_0x336527]['orderBy']===_0xed9e('0x75')?![]:!![]);_0x3c8060[_0xed9e('0x65')](_0x45cd76,_0x56feeb[_0x336527][_0xed9e('0x76')]||_0x45cd76);}if(_0x558262[_0xed9e('0x77')]){_0x558262['joins']=JSON[_0xed9e('0x78')](_0x558262['joins']);for(var _0x593778=0x0;_0x593778<_0x558262[_0xed9e('0x77')][_0xed9e('0x34')];_0x593778+=0x1){if(_0x558262[_0xed9e('0x77')][_0x593778][_0xed9e('0x2c')]&&_[_0xed9e('0x5f')](_0xcc1d70,_0x558262[_0xed9e('0x77')][_0x593778][_0xed9e('0x2c')])&&_0x558262['joins'][_0x593778][_0xed9e('0x79')]&&_0x558262['joins'][_0x593778]['foreignTable']&&_0x558262[_0xed9e('0x77')][_0x593778][_0xed9e('0x7a')]){_0x3c8060[_0x558262[_0xed9e('0x77')][_0x593778]['type']](_0x558262[_0xed9e('0x77')][_0x593778][_0xed9e('0x7b')],null,util['format'](_0xed9e('0x7c'),_0x558262['table'],_0x558262[_0xed9e('0x77')][_0x593778]['parentKey'],_0x558262[_0xed9e('0x77')][_0x593778][_0xed9e('0x7b')],_0x558262[_0xed9e('0x77')][_0x593778]['foreignKey']));}}}if(_0x558262['conditions']){_0x558262['conditions']=JSON[_0xed9e('0x78')](_0x558262[_0xed9e('0x7d')]);_0x3c8060[_0xed9e('0x3a')](_0x105896(_0x558262[_0xed9e('0x7d')][_0xed9e('0x64')]));}_0x433ade=_0x3c8060[_0xed9e('0x7e')]();_0x3c8060[_0xed9e('0x1c')](_0x417f06);_0x3c8060[_0xed9e('0x1a')](0x0);logger[_0xed9e('0x7f')](_0xed9e('0x80'),_0x3c8060[_0xed9e('0x81')]());return dbH[_0xed9e('0x82')][_0xed9e('0x2f')](_0x3c8060[_0xed9e('0x81')](),{'type':dbH[_0xed9e('0x82')][_0xed9e('0x83')][_0xed9e('0x84')]});}})[_0xed9e('0x22')](respondWithResult(_0x390b95,null))[_0xed9e('0x41')](handleError(_0x390b95,null));};function runReport(_0x4579df,_0x3c92fb,_0x52c6fe){var _0x141db2=_0x3c92fb[_0xed9e('0x26')];var _0x150754=0xa;var _0x4e9e9c=[_0xed9e('0x51'),_0xed9e('0x52'),_0xed9e('0x53'),_0xed9e('0x54')];var _0x338bd4={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xed9e('0x85'),'MAX':_0xed9e('0x86'),'MIN':_0xed9e('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xed9e('0x58'),'GROUP_CONCAT ASC':_0xed9e('0x59'),'GROUP_CONCAT DESC':_0xed9e('0x87')};var _0x46c5cd={'SEC_TO_TIME':_0xed9e('0x5a'),'DATE':_0xed9e('0x5b'),'HOUR':_0xed9e('0x5c'),'ROUND':_0xed9e('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x12fb13=function(_0x3e0afa){return!_[_0xed9e('0x5f')]([_0xed9e('0x88'),_0xed9e('0x60'),_0xed9e('0x61'),_0xed9e('0x62')],_0x3e0afa);};var _0x8cf0e1=function(_0x5b4033){if(!_0x5b4033||!_0x5b4033[_0xed9e('0x63')][_0xed9e('0x34')]){return'';}for(var _0x969c10='(',_0x16a9b8=0x0;_0x16a9b8<_0x5b4033[_0xed9e('0x63')][_0xed9e('0x34')];_0x16a9b8+=0x1){_0x16a9b8>0x0&&(_0x969c10+='\x20'+_0x5b4033['operator']+'\x20');_0x969c10+=_0x5b4033['rules'][_0x16a9b8][_0xed9e('0x64')]?_0x8cf0e1(_0x5b4033[_0xed9e('0x63')][_0x16a9b8][_0xed9e('0x64')]):_0x5b4033[_0xed9e('0x63')][_0x16a9b8][_0xed9e('0x65')]+'\x20'+_0x5b4033['rules'][_0x16a9b8][_0xed9e('0x66')]+(_0x12fb13(_0x5b4033['rules'][_0x16a9b8][_0xed9e('0x66')])?'\x20'+_0x5b4033[_0xed9e('0x63')][_0x16a9b8][_0xed9e('0x67')]:'');}return _0x969c10+')';};var _0x55a01e={'where':{'id':_0x4579df['id']}},_0x3fe1dc,_0x41a0df,_0x24dd83,_0x2f6eb7,_0x350e2f;_0x55a01e=_[_0xed9e('0x3b')]({},_0x55a01e,_0x52c6fe);return db[_0xed9e('0x29')]['find'](_0x55a01e)['then'](function(_0x1f83a5){if(_0x1f83a5){_0x3fe1dc=_0x1f83a5;return _0x1f83a5[_0xed9e('0x69')]();}return null;})[_0xed9e('0x22')](function(_0x28de3a){if(_0x28de3a){if(!_0x28de3a[_0xed9e('0x34')]){throw new db[(_0xed9e('0x6a'))][(_0xed9e('0x6b'))](_0xed9e('0x89'),0x193);}_0x41a0df=_0x28de3a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x4c56ac){if(_0x4c56ac){_0x24dd83=_['keyBy'](_0x4c56ac,'id');var _0x58ae0a;var _0x297e52=squel[_0xed9e('0x6e')]();_0x297e52[_0xed9e('0x6f')](_0x3fe1dc[_0xed9e('0x8a')]);for(var _0x3008eb=0x0;_0x3008eb<_0x41a0df[_0xed9e('0x34')];_0x3008eb+=0x1){_0x58ae0a=_0x41a0df[_0x3008eb][_0xed9e('0x70')]?_0x24dd83[_0x41a0df[_0x3008eb][_0xed9e('0x70')]][_0xed9e('0x71')]:_0x41a0df[_0x3008eb]['field'];_0x58ae0a=_0x41a0df[_0x3008eb][_0xed9e('0x72')]?_['replace'](_0x338bd4[_0x41a0df[_0x3008eb]['function']],'%s',_0x58ae0a):_0x58ae0a;_0x58ae0a=_0x41a0df[_0x3008eb][_0xed9e('0x73')]?_[_0xed9e('0x74')](_0x46c5cd[_0x41a0df[_0x3008eb][_0xed9e('0x73')]],'%s',_0x58ae0a):_0x58ae0a;if(_0x41a0df[_0x3008eb][_0xed9e('0x8b')]){_0x297e52[_0xed9e('0x64')](_0x58ae0a);}_0x41a0df[_0x3008eb][_0xed9e('0x8c')]&&_0x297e52[_0xed9e('0x37')](_0x58ae0a,_0x41a0df[_0x3008eb]['orderBy']===_0xed9e('0x75')?![]:!![]);_0x297e52['field'](_0x58ae0a,_0x41a0df[_0x3008eb][_0xed9e('0x76')]||_0x58ae0a);}if(_0x3fe1dc['joins']){_0x3fe1dc['joins']=JSON[_0xed9e('0x78')](_0x3fe1dc['joins']);for(var _0xce6027=0x0;_0xce6027<_0x3fe1dc[_0xed9e('0x77')]['length'];_0xce6027+=0x1){if(_0x3fe1dc['joins'][_0xce6027][_0xed9e('0x2c')]&&_['includes'](_0x4e9e9c,_0x3fe1dc[_0xed9e('0x77')][_0xce6027][_0xed9e('0x2c')])&&_0x3fe1dc[_0xed9e('0x77')][_0xce6027][_0xed9e('0x79')]&&_0x3fe1dc[_0xed9e('0x77')][_0xce6027]['foreignTable']&&_0x3fe1dc[_0xed9e('0x77')][_0xce6027][_0xed9e('0x7a')]){_0x297e52[_0x3fe1dc[_0xed9e('0x77')][_0xce6027]['type']](_0x3fe1dc[_0xed9e('0x77')][_0xce6027][_0xed9e('0x7b')],null,util[_0xed9e('0x73')](_0xed9e('0x7c'),_0x3fe1dc[_0xed9e('0x8a')],_0x3fe1dc['joins'][_0xce6027][_0xed9e('0x79')],_0x3fe1dc['joins'][_0xce6027]['foreignTable'],_0x3fe1dc[_0xed9e('0x77')][_0xce6027][_0xed9e('0x7a')]));}}}if(_0x3fe1dc[_0xed9e('0x7d')]){_0x3fe1dc[_0xed9e('0x7d')]=JSON[_0xed9e('0x78')](_0x3fe1dc[_0xed9e('0x7d')]);_0x297e52[_0xed9e('0x3a')](_0x8cf0e1(_0x3fe1dc['conditions'][_0xed9e('0x64')]));}_0x350e2f=_0x297e52[_0xed9e('0x7e')]();_0x297e52[_0xed9e('0x1c')](_0x150754);_0x297e52[_0xed9e('0x1a')](0x0);return;}})['then'](function(){if(_0x3c92fb[_0xed9e('0x8d')]===_0xed9e('0x8e')){return null;}var _0x226a42=_['merge'](_0x3c92fb,{'name':_0x3c92fb[_0xed9e('0x8f')]||_0x3c92fb['name']||_0x3fe1dc[_0xed9e('0x26')],'basename':_0x141db2,'savename':util[_0xed9e('0x73')]('%s-%s.%s',_0x3c92fb[_0xed9e('0x26')]||_0x3fe1dc[_0xed9e('0x26')],require(_0xed9e('0x90'))[_0xed9e('0x91')](0x4),_0x3c92fb['output']||_0xed9e('0x92')),'reportId':_0x3fe1dc['id'],'reportType':_0xed9e('0x93')});return db['AnalyticExtractedReport'][_0xed9e('0x44')](_0x226a42,{'raw':!![]});})[_0xed9e('0x22')](function(_0x1ea915){if(_0x3fe1dc['table']===_0xed9e('0x94')){_0x350e2f[_0xed9e('0x3a')](_0x3fe1dc[_0xed9e('0x8a')]+_0xed9e('0x95'),_0x3c92fb['startDate'],_0x3c92fb['endDate']);}else{_0x350e2f[_0xed9e('0x3a')](_0x3fe1dc[_0xed9e('0x8a')]+_0xed9e('0x96'),_0x3c92fb[_0xed9e('0x97')],_0x3c92fb[_0xed9e('0x98')]);}if(_0x1ea915){logger[_0xed9e('0x99')](_0xed9e('0x9a'),_0x350e2f[_0xed9e('0x81')]());require(_0xed9e('0x9b'))[_0xed9e('0x9c')](path[_0xed9e('0x51')](__dirname,_0xed9e('0x9d'),_0x1ea915['output']),[_0x1ea915['id'],_0x350e2f['toString'](),path[_0xed9e('0x51')](__dirname,_0xed9e('0x9e'),_0x1ea915['savename']),_0x141db2]);return _0x1ea915;}else{var _0x48ba92=squel[_0xed9e('0x6e')]();_0x48ba92['from']('('+_0x350e2f['toString']()+')',_0xed9e('0x9f'));_0x48ba92[_0xed9e('0x65')]('COUNT(*)',_0xed9e('0x1d'));_0x350e2f[_0xed9e('0x1c')](_0x3c92fb[_0xed9e('0x1c')]||_0x150754);_0x350e2f[_0xed9e('0x1a')](_0x3c92fb['offset']||0x0);return dbH[_0xed9e('0x82')][_0xed9e('0x2f')](_0x48ba92['toString'](),{'type':dbH[_0xed9e('0x82')]['QueryTypes'][_0xed9e('0x84')]})['then'](function(_0x28abd8){if(!_0x28abd8[_0xed9e('0x34')]){_0x2f6eb7=0x0;}else{_0x2f6eb7=_0x28abd8[0x0][_0xed9e('0x1d')]||0x0;}return dbH['sequelize'][_0xed9e('0x2f')](_0x350e2f['toString'](),{'type':dbH[_0xed9e('0x82')][_0xed9e('0x83')]['SELECT']});})[_0xed9e('0x22')](function(_0x24f3dd){return{'rows':_0x24f3dd||[],'count':_0x2f6eb7};});}});}exports[_0xed9e('0xa0')]=function(_0x44ffdf,_0x3732b8){return runReport(_0x44ffdf[_0xed9e('0x4f')],_0x44ffdf[_0xed9e('0x2f')],_0x44ffdf[_0xed9e('0x68')])['then'](respondWithResult(_0x3732b8,null))[_0xed9e('0x41')](handleError(_0x3732b8,null));};exports[_0xed9e('0xa1')]=runReport;exports[_0xed9e('0x2f')]=function(_0x287a2a,_0x1f4889){var _0x27b79b=0xa;var _0x560be4=[_0xed9e('0x51'),_0xed9e('0x52'),'right_join',_0xed9e('0x54')];var _0x3e3973={'SUM':_0xed9e('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xed9e('0x85'),'MAX':_0xed9e('0x86'),'MIN':_0xed9e('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xed9e('0x58'),'GROUP_CONCAT ASC':_0xed9e('0x59'),'GROUP_CONCAT DESC':_0xed9e('0x87')};var _0x38117e={'SEC_TO_TIME':_0xed9e('0x5a'),'DATE':_0xed9e('0x5b'),'HOUR':_0xed9e('0x5c'),'ROUND':_0xed9e('0x5d'),'UNIX_TIMESTAMP':_0xed9e('0x5e')};var _0x57d977=function(_0x7b487e){return!_[_0xed9e('0x5f')](['IS\x20NULL',_0xed9e('0x60'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x7b487e);};var _0x3b11ad=function(_0x55b648){if(!_0x55b648||!_0x55b648[_0xed9e('0x63')][_0xed9e('0x34')]){return'';}for(var _0x1d4b53='(',_0x87356a=0x0;_0x87356a<_0x55b648[_0xed9e('0x63')][_0xed9e('0x34')];_0x87356a+=0x1){_0x87356a>0x0&&(_0x1d4b53+='\x20'+_0x55b648[_0xed9e('0xa2')]+'\x20');_0x1d4b53+=_0x55b648[_0xed9e('0x63')][_0x87356a]['group']?_0x3b11ad(_0x55b648['rules'][_0x87356a][_0xed9e('0x64')]):_0x55b648['rules'][_0x87356a][_0xed9e('0x65')]+'\x20'+_0x55b648['rules'][_0x87356a][_0xed9e('0x66')]+(_0x57d977(_0x55b648['rules'][_0x87356a][_0xed9e('0x66')])?'\x20'+_0x55b648[_0xed9e('0x63')][_0x87356a][_0xed9e('0x67')]:'');}return _0x1d4b53+')';};var _0x4734f4={'where':{'id':_0x287a2a[_0xed9e('0x4f')]['id']}},_0x22c470,_0x2a863f,_0x2e04f0,_0x56406a,_0x27ece7;_0x4734f4=_[_0xed9e('0x3b')]({},_0x4734f4,_0x287a2a['options']);return db[_0xed9e('0x29')][_0xed9e('0x43')](_0x4734f4)[_0xed9e('0x22')](function(_0x2b4d72){if(_0x2b4d72){_0x22c470=_0x2b4d72;return _0x2b4d72[_0xed9e('0x69')]();}return null;})[_0xed9e('0x22')](function(_0x7b68d0){if(_0x7b68d0){if(!_0x7b68d0[_0xed9e('0x34')]){throw new db['Sequelize'][(_0xed9e('0x6b'))](_0xed9e('0x89'),0x193);}_0x2a863f=_0x7b68d0;return db[_0xed9e('0x6c')][_0xed9e('0x3f')]({'raw':!![]});}return null;})[_0xed9e('0x22')](function(_0xaa1450){if(_0xaa1450){_0x2e04f0=_['keyBy'](_0xaa1450,'id');var _0x2b68d5;var _0x18664e=squel[_0xed9e('0x6e')]();_0x18664e[_0xed9e('0x6f')](_0x22c470[_0xed9e('0x8a')]);for(var _0x594f78=0x0;_0x594f78<_0x2a863f[_0xed9e('0x34')];_0x594f78+=0x1){_0x2b68d5=_0x2a863f[_0x594f78][_0xed9e('0x70')]?_0x2e04f0[_0x2a863f[_0x594f78][_0xed9e('0x70')]][_0xed9e('0x71')]:_0x2a863f[_0x594f78][_0xed9e('0x65')];_0x2b68d5=_0x2a863f[_0x594f78][_0xed9e('0x72')]?_[_0xed9e('0x74')](_0x3e3973[_0x2a863f[_0x594f78]['function']],'%s',_0x2b68d5):_0x2b68d5;_0x2b68d5=_0x2a863f[_0x594f78]['format']?_['replace'](_0x38117e[_0x2a863f[_0x594f78][_0xed9e('0x73')]],'%s',_0x2b68d5):_0x2b68d5;if(_0x2a863f[_0x594f78][_0xed9e('0x8b')]){_0x18664e['group'](_0x2b68d5);}_0x2a863f[_0x594f78][_0xed9e('0x8c')]&&_0x18664e[_0xed9e('0x37')](_0x2b68d5,_0x2a863f[_0x594f78][_0xed9e('0x8c')]===_0xed9e('0x75')?![]:!![]);_0x18664e[_0xed9e('0x65')](_0x2b68d5,_0x2a863f[_0x594f78][_0xed9e('0x76')]||_0x2b68d5);}if(_0x22c470[_0xed9e('0x77')]){_0x22c470[_0xed9e('0x77')]=JSON[_0xed9e('0x78')](_0x22c470[_0xed9e('0x77')]);for(var _0x9845ac=0x0;_0x9845ac<_0x22c470[_0xed9e('0x77')][_0xed9e('0x34')];_0x9845ac+=0x1){if(_0x22c470[_0xed9e('0x77')][_0x9845ac][_0xed9e('0x2c')]&&_['includes'](_0x560be4,_0x22c470['joins'][_0x9845ac][_0xed9e('0x2c')])&&_0x22c470[_0xed9e('0x77')][_0x9845ac][_0xed9e('0x79')]&&_0x22c470[_0xed9e('0x77')][_0x9845ac][_0xed9e('0x7b')]&&_0x22c470[_0xed9e('0x77')][_0x9845ac][_0xed9e('0x7a')]){_0x18664e[_0x22c470[_0xed9e('0x77')][_0x9845ac][_0xed9e('0x2c')]](_0x22c470[_0xed9e('0x77')][_0x9845ac][_0xed9e('0x7b')],null,util[_0xed9e('0x73')]('%s.%s\x20=\x20%s.%s',_0x22c470[_0xed9e('0x8a')],_0x22c470[_0xed9e('0x77')][_0x9845ac]['parentKey'],_0x22c470[_0xed9e('0x77')][_0x9845ac]['foreignTable'],_0x22c470[_0xed9e('0x77')][_0x9845ac]['foreignKey']));}}}if(_0x22c470[_0xed9e('0x7d')]){_0x22c470['conditions']=JSON[_0xed9e('0x78')](_0x22c470[_0xed9e('0x7d')]);_0x18664e[_0xed9e('0x3a')](_0x3b11ad(_0x22c470[_0xed9e('0x7d')]['group']));}_0x27ece7=_0x18664e[_0xed9e('0x7e')]();_0x18664e['limit'](_0x27b79b);_0x18664e['offset'](0x0);logger['debug'](_0xed9e('0x80'),_0x18664e[_0xed9e('0x81')]());return dbH[_0xed9e('0x82')][_0xed9e('0x2f')](_0x18664e['toString'](),{'type':dbH[_0xed9e('0x82')]['QueryTypes'][_0xed9e('0x84')]});}})['then'](function(){return{'sql':_0x27ece7[_0xed9e('0x81')]()};})[_0xed9e('0x22')](respondWithResult(_0x1f4889,null))['catch'](handleError(_0x1f4889,null));};
\ No newline at end of file
+var _0xf80a=['to-csv','ejs','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','error','stack','name','send','AnalyticCustomReport','rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','filter','options','include','findAll','params','length','includeAll','find','catch','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','output','fullPath','randomstring','generate','csv','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','ValidationErrorItem','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox'];(function(_0x1f35f8,_0x31259c){var _0x2a8bea=function(_0x41b1d0){while(--_0x41b1d0){_0x1f35f8['push'](_0x1f35f8['shift']());}};_0x2a8bea(++_0x31259c);}(_0xf80a,0x13a));var _0xaf80=function(_0x5a5d97,_0x300be6){_0x5a5d97=_0x5a5d97-0x0;var _0x4c4d27=_0xf80a[_0x5a5d97];return _0x4c4d27;};'use strict';var emlformat=require(_0xaf80('0x0'));var rimraf=require(_0xaf80('0x1'));var zipdir=require(_0xaf80('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaf80('0x3'));var BPromise=require(_0xaf80('0x4'));var Mustache=require(_0xaf80('0x5'));var util=require(_0xaf80('0x6'));var path=require('path');var sox=require(_0xaf80('0x7'));var csv=require(_0xaf80('0x8'));var ejs=require(_0xaf80('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaf80('0xa'));var toCsv=require(_0xaf80('0x8'));var querystring=require(_0xaf80('0xb'));var Papa=require('papaparse');var Redis=require(_0xaf80('0xc'));var authService=require(_0xaf80('0xd'));var qs=require(_0xaf80('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf80('0xf'))(_0xaf80('0x10'));var utils=require(_0xaf80('0x11'));var config=require(_0xaf80('0x12'));var licenseUtil=require(_0xaf80('0x13'));var db=require(_0xaf80('0x14'))['db'];var dbH=require(_0xaf80('0x14'))[_0xaf80('0x15')];function respondWithStatusCode(_0x3d075a,_0x153539){_0x153539=_0x153539||0xcc;return function(_0x4256af){if(_0x4256af){return _0x3d075a[_0xaf80('0x16')](_0x153539);}return _0x3d075a[_0xaf80('0x17')](_0x153539)['end']();};}function respondWithResult(_0x3e64bf,_0x4f390c){_0x4f390c=_0x4f390c||0xc8;return function(_0x1e204f){if(_0x1e204f){return _0x3e64bf[_0xaf80('0x17')](_0x4f390c)[_0xaf80('0x18')](_0x1e204f);}};}function respondWithFilteredResult(_0x38b907,_0x118fba){return function(_0xcd948){if(_0xcd948){var _0x23ed48=typeof _0x118fba[_0xaf80('0x19')]==='undefined'&&typeof _0x118fba['limit']===_0xaf80('0x1a');var _0x1ba6f8=_0xcd948[_0xaf80('0x1b')];var _0x174a40=_0x23ed48?0x0:_0x118fba[_0xaf80('0x19')];var _0x31e2e0=_0x23ed48?_0xcd948[_0xaf80('0x1b')]:_0x118fba[_0xaf80('0x19')]+_0x118fba['limit'];var _0xe48bb1;if(_0x31e2e0>=_0x1ba6f8){_0x31e2e0=_0x1ba6f8;_0xe48bb1=0xc8;}else{_0xe48bb1=0xce;}_0x38b907[_0xaf80('0x17')](_0xe48bb1);return _0x38b907[_0xaf80('0x1c')](_0xaf80('0x1d'),_0x174a40+'-'+_0x31e2e0+'/'+_0x1ba6f8)[_0xaf80('0x18')](_0xcd948);}return null;};}function patchUpdates(_0x4b4a94){return function(_0x105ec1){try{jsonpatch[_0xaf80('0x1e')](_0x105ec1,_0x4b4a94,!![]);}catch(_0x2968cd){return BPromise[_0xaf80('0x1f')](_0x2968cd);}return _0x105ec1[_0xaf80('0x20')]();};}function saveUpdates(_0x2ae065,_0x2dec6a){return function(_0x33c661){if(_0x33c661){return _0x33c661[_0xaf80('0x21')](_0x2ae065)['then'](function(_0x2427c7){return _0x2427c7;});}return null;};}function removeEntity(_0x23d9d9,_0x3e8720){return function(_0x1c571d){if(_0x1c571d){return _0x1c571d[_0xaf80('0x22')]()[_0xaf80('0x23')](function(){var _0x1e4ff0=_0x1c571d[_0xaf80('0x24')]({'plain':!![]});var _0x2f2a99=_0xaf80('0x25');return db[_0xaf80('0x26')][_0xaf80('0x22')]({'where':{'type':_0x2f2a99,'resourceId':_0x1e4ff0['id']}})[_0xaf80('0x23')](function(){return _0x1c571d;});})[_0xaf80('0x23')](function(){_0x23d9d9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fc0c1,_0x2cf638){return function(_0x407f1e){if(!_0x407f1e){_0x3fc0c1['sendStatus'](0x194);}return _0x407f1e;};}function handleError(_0x4c23be,_0x43bb8f){_0x43bb8f=_0x43bb8f||0x1f4;return function(_0xae5ff8){logger[_0xaf80('0x27')](_0xae5ff8[_0xaf80('0x28')]);if(_0xae5ff8[_0xaf80('0x29')]){delete _0xae5ff8['name'];}_0x4c23be[_0xaf80('0x17')](_0x43bb8f)[_0xaf80('0x2a')](_0xae5ff8);};}exports['index']=function(_0x2944ee,_0x3ea868){var _0x4069ea={},_0x2045dc={},_0x520d08={'count':0x0,'rows':[]};var _0x4a508=_['map'](db[_0xaf80('0x2b')][_0xaf80('0x2c')],function(_0x1a8f9e){return{'name':_0x1a8f9e[_0xaf80('0x2d')],'type':_0x1a8f9e[_0xaf80('0x2e')]['key']};});_0x2045dc[_0xaf80('0x2f')]=_[_0xaf80('0x30')](_0x4a508,_0xaf80('0x29'));_0x2045dc['query']=_[_0xaf80('0x31')](_0x2944ee[_0xaf80('0x32')]);_0x2045dc['filters']=_[_0xaf80('0x33')](_0x2045dc[_0xaf80('0x2f')],_0x2045dc[_0xaf80('0x32')]);_0x4069ea[_0xaf80('0x34')]=_[_0xaf80('0x33')](_0x2045dc['model'],qs[_0xaf80('0x35')](_0x2944ee[_0xaf80('0x32')]['fields']));_0x4069ea['attributes']=_0x4069ea[_0xaf80('0x34')]['length']?_0x4069ea[_0xaf80('0x34')]:_0x2045dc[_0xaf80('0x2f')];if(!_0x2944ee['query'][_0xaf80('0x36')](_0xaf80('0x37'))){_0x4069ea[_0xaf80('0x38')]=qs['limit'](_0x2944ee[_0xaf80('0x32')][_0xaf80('0x38')]);_0x4069ea[_0xaf80('0x19')]=qs[_0xaf80('0x19')](_0x2944ee['query']['offset']);}_0x4069ea[_0xaf80('0x39')]=qs[_0xaf80('0x3a')](_0x2944ee[_0xaf80('0x32')][_0xaf80('0x3a')]);_0x4069ea[_0xaf80('0x3b')]=qs[_0xaf80('0x3c')](_[_0xaf80('0x3d')](_0x2944ee[_0xaf80('0x32')],_0x2045dc[_0xaf80('0x3c')]),_0x4a508);if(_0x2944ee[_0xaf80('0x32')]['filter']){_0x4069ea['where']=_[_0xaf80('0x3e')](_0x4069ea[_0xaf80('0x3b')],{'$or':_[_0xaf80('0x30')](_0x4a508,function(_0x2d151b){if(_0x2d151b[_0xaf80('0x2e')]!=='VIRTUAL'){var _0x486f63={};_0x486f63[_0x2d151b[_0xaf80('0x29')]]={'$like':'%'+_0x2944ee[_0xaf80('0x32')][_0xaf80('0x3f')]+'%'};return _0x486f63;}})});}_0x4069ea=_[_0xaf80('0x3e')]({},_0x4069ea,_0x2944ee[_0xaf80('0x40')]);var _0x5b3e05={'where':_0x4069ea[_0xaf80('0x3b')]};return db[_0xaf80('0x2b')][_0xaf80('0x1b')](_0x5b3e05)[_0xaf80('0x23')](function(_0x1caf74){_0x520d08['count']=_0x1caf74;if(_0x2944ee[_0xaf80('0x32')]['includeAll']){_0x4069ea[_0xaf80('0x41')]=[{'all':!![]}];}return db[_0xaf80('0x2b')][_0xaf80('0x42')](_0x4069ea);})[_0xaf80('0x23')](function(_0x441170){_0x520d08['rows']=_0x441170;return _0x520d08;})[_0xaf80('0x23')](respondWithFilteredResult(_0x3ea868,_0x4069ea))['catch'](handleError(_0x3ea868,null));};exports['show']=function(_0x1e164e,_0x1c089a){var _0x42fc1d={'raw':![],'where':{'id':_0x1e164e[_0xaf80('0x43')]['id']}},_0x5cd3fb={};_0x5cd3fb[_0xaf80('0x2f')]=_[_0xaf80('0x31')](db['AnalyticCustomReport'][_0xaf80('0x2c')]);_0x5cd3fb[_0xaf80('0x32')]=_[_0xaf80('0x31')](_0x1e164e[_0xaf80('0x32')]);_0x5cd3fb[_0xaf80('0x3c')]=_[_0xaf80('0x33')](_0x5cd3fb[_0xaf80('0x2f')],_0x5cd3fb['query']);_0x42fc1d[_0xaf80('0x34')]=_[_0xaf80('0x33')](_0x5cd3fb['model'],qs[_0xaf80('0x35')](_0x1e164e[_0xaf80('0x32')]['fields']));_0x42fc1d[_0xaf80('0x34')]=_0x42fc1d[_0xaf80('0x34')][_0xaf80('0x44')]?_0x42fc1d['attributes']:_0x5cd3fb[_0xaf80('0x2f')];if(_0x1e164e[_0xaf80('0x32')][_0xaf80('0x45')]){_0x42fc1d[_0xaf80('0x41')]=[{'all':!![]}];}_0x42fc1d=_['merge']({},_0x42fc1d,_0x1e164e[_0xaf80('0x40')]);return db['AnalyticCustomReport'][_0xaf80('0x46')](_0x42fc1d)[_0xaf80('0x23')](handleEntityNotFound(_0x1c089a,null))[_0xaf80('0x23')](respondWithResult(_0x1c089a,null))[_0xaf80('0x47')](handleError(_0x1c089a,null));};exports[_0xaf80('0x48')]=function(_0x27a7eb,_0x5a61cc){return db[_0xaf80('0x2b')]['create'](_0x27a7eb[_0xaf80('0x49')],{})[_0xaf80('0x23')](function(_0x22ad9f){var _0x483f6c=_0x27a7eb[_0xaf80('0x4a')][_0xaf80('0x24')]({'plain':!![]});if(!_0x483f6c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x483f6c[_0xaf80('0x4b')]==='user'){var _0x32c0bf=_0x22ad9f[_0xaf80('0x24')]({'plain':!![]});var _0x4363e7=_0xaf80('0x4c');return db[_0xaf80('0x4d')][_0xaf80('0x46')]({'where':{'name':_0x4363e7,'userProfileId':_0x483f6c[_0xaf80('0x4e')]},'raw':!![]})[_0xaf80('0x23')](function(_0x43d522){if(_0x43d522&&_0x43d522[_0xaf80('0x4f')]===0x0){return db[_0xaf80('0x26')][_0xaf80('0x48')]({'name':_0x32c0bf[_0xaf80('0x29')],'resourceId':_0x32c0bf['id'],'type':_0xaf80('0x25'),'sectionId':_0x43d522['id']},{})[_0xaf80('0x23')](function(){return _0x22ad9f;});}else{return _0x22ad9f;}})[_0xaf80('0x47')](function(_0x5529ed){logger['error'](_0xaf80('0x50'),_0x5529ed);throw _0x5529ed;});}return _0x22ad9f;})[_0xaf80('0x23')](respondWithResult(_0x5a61cc,0xc9))[_0xaf80('0x47')](handleError(_0x5a61cc,null));};exports[_0xaf80('0x21')]=function(_0xa3d8f8,_0x4b35c0){if(_0xa3d8f8['body']['id']){delete _0xa3d8f8[_0xaf80('0x49')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0xa3d8f8['params']['id']}})[_0xaf80('0x23')](handleEntityNotFound(_0x4b35c0,null))[_0xaf80('0x23')](saveUpdates(_0xa3d8f8[_0xaf80('0x49')],null))[_0xaf80('0x23')](respondWithResult(_0x4b35c0,null))[_0xaf80('0x47')](handleError(_0x4b35c0,null));};exports[_0xaf80('0x22')]=function(_0x37050b,_0x33a397){return db[_0xaf80('0x2b')][_0xaf80('0x46')]({'where':{'id':_0x37050b['params']['id']}})['then'](handleEntityNotFound(_0x33a397,null))[_0xaf80('0x23')](removeEntity(_0x33a397,null))[_0xaf80('0x47')](handleError(_0x33a397,null));};exports[_0xaf80('0x51')]=function(_0x269193,_0x5cdb3a){var _0xfe82af=0xa;var _0x1c4627=[_0xaf80('0x52'),_0xaf80('0x53'),_0xaf80('0x54'),_0xaf80('0x55')];var _0x3e0ba9={'SUM':_0xaf80('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xaf80('0x57'),'MAX':_0xaf80('0x58'),'MIN':_0xaf80('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xaf80('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x32bdff={'SEC_TO_TIME':_0xaf80('0x5b'),'DATE':'DATE(%s)','HOUR':_0xaf80('0x5c'),'ROUND':_0xaf80('0x5d'),'UNIX_TIMESTAMP':_0xaf80('0x5e')};var _0x46a5b2=function(_0x4a3f87){return!_[_0xaf80('0x5f')]([_0xaf80('0x60'),_0xaf80('0x61'),_0xaf80('0x62'),_0xaf80('0x63')],_0x4a3f87);};var _0x3baabf=function(_0x1b019c){if(!_0x1b019c||!_0x1b019c[_0xaf80('0x64')][_0xaf80('0x44')]){return'';}for(var _0x2a6206='(',_0xf95e74=0x0;_0xf95e74<_0x1b019c[_0xaf80('0x64')][_0xaf80('0x44')];_0xf95e74+=0x1){_0xf95e74>0x0&&(_0x2a6206+='\x20'+_0x1b019c[_0xaf80('0x65')]+'\x20');_0x2a6206+=_0x1b019c[_0xaf80('0x64')][_0xf95e74][_0xaf80('0x66')]?_0x3baabf(_0x1b019c[_0xaf80('0x64')][_0xf95e74]['group']):_0x1b019c[_0xaf80('0x64')][_0xf95e74][_0xaf80('0x67')]+'\x20'+_0x1b019c[_0xaf80('0x64')][_0xf95e74][_0xaf80('0x68')]+(_0x46a5b2(_0x1b019c[_0xaf80('0x64')][_0xf95e74][_0xaf80('0x68')])?'\x20'+_0x1b019c[_0xaf80('0x64')][_0xf95e74][_0xaf80('0x69')]:'');}return _0x2a6206+')';};var _0x26afd4={'where':{'id':_0x269193[_0xaf80('0x43')]['id']}},_0x575742,_0x25058b,_0x500222,_0xfc2f1c,_0x55fdf2;_0x26afd4=_[_0xaf80('0x3e')]({},_0x26afd4,_0x269193[_0xaf80('0x40')]);return db[_0xaf80('0x2b')]['find'](_0x26afd4)['then'](function(_0x1790f6){if(_0x1790f6){_0x575742=_0x1790f6;return _0x1790f6[_0xaf80('0x6a')]();}return null;})[_0xaf80('0x23')](function(_0x15e6a6){if(_0x15e6a6){if(!_0x15e6a6[_0xaf80('0x44')]){throw new db[(_0xaf80('0x6b'))]['ValidationErrorItem'](_0xaf80('0x6c'),0x193);}_0x25058b=_0x15e6a6;return db[_0xaf80('0x6d')][_0xaf80('0x42')]({'raw':!![]});}return null;})[_0xaf80('0x23')](function(_0x184413){if(_0x184413){_0x500222=_[_0xaf80('0x6e')](_0x184413,'id');var _0x1316c6;var _0x19d1aa=squel[_0xaf80('0x6f')]();_0x19d1aa[_0xaf80('0x70')](_0x575742[_0xaf80('0x71')]);for(var _0x1c4f03=0x0;_0x1c4f03<_0x25058b[_0xaf80('0x44')];_0x1c4f03+=0x1){_0x1316c6=_0x25058b[_0x1c4f03][_0xaf80('0x72')]?_0x500222[_0x25058b[_0x1c4f03][_0xaf80('0x72')]][_0xaf80('0x73')]:_0x25058b[_0x1c4f03]['field'];_0x1316c6=_0x25058b[_0x1c4f03][_0xaf80('0x74')]?_[_0xaf80('0x75')](_0x3e0ba9[_0x25058b[_0x1c4f03][_0xaf80('0x74')]],'%s',_0x1316c6):_0x1316c6;_0x1316c6=_0x25058b[_0x1c4f03][_0xaf80('0x76')]?_[_0xaf80('0x75')](_0x32bdff[_0x25058b[_0x1c4f03]['format']],'%s',_0x1316c6):_0x1316c6;if(_0x25058b[_0x1c4f03][_0xaf80('0x77')]){_0x19d1aa[_0xaf80('0x66')](_0x1316c6);}_0x25058b[_0x1c4f03][_0xaf80('0x78')]&&_0x19d1aa[_0xaf80('0x39')](_0x1316c6,_0x25058b[_0x1c4f03][_0xaf80('0x78')]===_0xaf80('0x79')?![]:!![]);_0x19d1aa['field'](_0x1316c6,_0x25058b[_0x1c4f03][_0xaf80('0x7a')]||_0x1316c6);}if(_0x575742[_0xaf80('0x7b')]){_0x575742['joins']=JSON[_0xaf80('0x7c')](_0x575742[_0xaf80('0x7b')]);for(var _0x49c840=0x0;_0x49c840<_0x575742['joins'][_0xaf80('0x44')];_0x49c840+=0x1){if(_0x575742[_0xaf80('0x7b')][_0x49c840][_0xaf80('0x2e')]&&_[_0xaf80('0x5f')](_0x1c4627,_0x575742['joins'][_0x49c840]['type'])&&_0x575742[_0xaf80('0x7b')][_0x49c840][_0xaf80('0x7d')]&&_0x575742['joins'][_0x49c840][_0xaf80('0x7e')]&&_0x575742[_0xaf80('0x7b')][_0x49c840]['foreignKey']){_0x19d1aa[_0x575742['joins'][_0x49c840][_0xaf80('0x2e')]](_0x575742[_0xaf80('0x7b')][_0x49c840]['foreignTable'],null,util[_0xaf80('0x76')]('%s.%s\x20=\x20%s.%s',_0x575742[_0xaf80('0x71')],_0x575742[_0xaf80('0x7b')][_0x49c840][_0xaf80('0x7d')],_0x575742[_0xaf80('0x7b')][_0x49c840]['foreignTable'],_0x575742['joins'][_0x49c840][_0xaf80('0x7f')]));}}}if(_0x575742[_0xaf80('0x80')]){_0x575742[_0xaf80('0x80')]=JSON[_0xaf80('0x7c')](_0x575742['conditions']);_0x19d1aa[_0xaf80('0x3b')](_0x3baabf(_0x575742[_0xaf80('0x80')][_0xaf80('0x66')]));}_0x55fdf2=_0x19d1aa[_0xaf80('0x81')]();_0x19d1aa[_0xaf80('0x38')](_0xfe82af);_0x19d1aa[_0xaf80('0x19')](0x0);logger[_0xaf80('0x82')](_0xaf80('0x83'),_0x19d1aa['toString']());return dbH[_0xaf80('0x84')][_0xaf80('0x32')](_0x19d1aa[_0xaf80('0x85')](),{'type':dbH[_0xaf80('0x84')][_0xaf80('0x86')]['SELECT']});}})['then'](respondWithResult(_0x5cdb3a,null))['catch'](handleError(_0x5cdb3a,null));};function runReport(_0x2685b0,_0x87bdd3,_0x1003d0){var _0x150863=_0x87bdd3[_0xaf80('0x29')];var _0x32b0c3=0xa;var _0x2bd18d=[_0xaf80('0x52'),'left_join',_0xaf80('0x54'),'cross_join'];var _0x289489={'SUM':'SUM(%s)','COUNT':_0xaf80('0x87'),'COUNT DISTINCT':_0xaf80('0x57'),'MAX':'MAX(%s)','MIN':_0xaf80('0x59'),'AVG':_0xaf80('0x88'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xaf80('0x89'),'GROUP_CONCAT DESC':_0xaf80('0x8a')};var _0xdd9d0a={'SEC_TO_TIME':_0xaf80('0x5b'),'DATE':_0xaf80('0x8b'),'HOUR':_0xaf80('0x5c'),'ROUND':_0xaf80('0x5d'),'UNIX_TIMESTAMP':_0xaf80('0x5e')};var _0xda488c=function(_0x335b69){return!_[_0xaf80('0x5f')]([_0xaf80('0x60'),'IS\x20NOT\x20NULL',_0xaf80('0x62'),_0xaf80('0x63')],_0x335b69);};var _0x2fd4c7=function(_0x401249){if(!_0x401249||!_0x401249[_0xaf80('0x64')][_0xaf80('0x44')]){return'';}for(var _0x2f1b00='(',_0x2fc719=0x0;_0x2fc719<_0x401249['rules']['length'];_0x2fc719+=0x1){_0x2fc719>0x0&&(_0x2f1b00+='\x20'+_0x401249[_0xaf80('0x65')]+'\x20');_0x2f1b00+=_0x401249[_0xaf80('0x64')][_0x2fc719][_0xaf80('0x66')]?_0x2fd4c7(_0x401249[_0xaf80('0x64')][_0x2fc719][_0xaf80('0x66')]):_0x401249[_0xaf80('0x64')][_0x2fc719]['field']+'\x20'+_0x401249[_0xaf80('0x64')][_0x2fc719][_0xaf80('0x68')]+(_0xda488c(_0x401249[_0xaf80('0x64')][_0x2fc719][_0xaf80('0x68')])?'\x20'+_0x401249['rules'][_0x2fc719]['value']:'');}return _0x2f1b00+')';};var _0x3d821f={'where':{'id':_0x2685b0['id']}},_0x69fcb8,_0x1fbfe3,_0x46f5eb,_0xbdeec1,_0x334358;_0x3d821f=_['merge']({},_0x3d821f,_0x1003d0);return db[_0xaf80('0x2b')][_0xaf80('0x46')](_0x3d821f)[_0xaf80('0x23')](function(_0x3b7d18){if(_0x3b7d18){_0x69fcb8=_0x3b7d18;return _0x3b7d18[_0xaf80('0x6a')]();}return null;})[_0xaf80('0x23')](function(_0x45e1eb){if(_0x45e1eb){if(!_0x45e1eb[_0xaf80('0x44')]){throw new db[(_0xaf80('0x6b'))]['ValidationErrorItem'](_0xaf80('0x6c'),0x193);}_0x1fbfe3=_0x45e1eb;return db[_0xaf80('0x6d')][_0xaf80('0x42')]({'raw':!![]});}return null;})['then'](function(_0x5569de){if(_0x5569de){_0x46f5eb=_['keyBy'](_0x5569de,'id');var _0x1004f5;var _0x46221a=squel['select']();_0x46221a[_0xaf80('0x70')](_0x69fcb8[_0xaf80('0x71')]);for(var _0x442b56=0x0;_0x442b56<_0x1fbfe3[_0xaf80('0x44')];_0x442b56+=0x1){_0x1004f5=_0x1fbfe3[_0x442b56]['MetricId']?_0x46f5eb[_0x1fbfe3[_0x442b56]['MetricId']][_0xaf80('0x73')]:_0x1fbfe3[_0x442b56]['field'];_0x1004f5=_0x1fbfe3[_0x442b56][_0xaf80('0x74')]?_[_0xaf80('0x75')](_0x289489[_0x1fbfe3[_0x442b56]['function']],'%s',_0x1004f5):_0x1004f5;_0x1004f5=_0x1fbfe3[_0x442b56][_0xaf80('0x76')]?_[_0xaf80('0x75')](_0xdd9d0a[_0x1fbfe3[_0x442b56]['format']],'%s',_0x1004f5):_0x1004f5;if(_0x1fbfe3[_0x442b56][_0xaf80('0x77')]){_0x46221a[_0xaf80('0x66')](_0x1004f5);}_0x1fbfe3[_0x442b56][_0xaf80('0x78')]&&_0x46221a[_0xaf80('0x39')](_0x1004f5,_0x1fbfe3[_0x442b56][_0xaf80('0x78')]===_0xaf80('0x79')?![]:!![]);_0x46221a[_0xaf80('0x67')](_0x1004f5,_0x1fbfe3[_0x442b56][_0xaf80('0x7a')]||_0x1004f5);}if(_0x69fcb8[_0xaf80('0x7b')]){_0x69fcb8[_0xaf80('0x7b')]=JSON[_0xaf80('0x7c')](_0x69fcb8[_0xaf80('0x7b')]);for(var _0x49b27e=0x0;_0x49b27e<_0x69fcb8[_0xaf80('0x7b')][_0xaf80('0x44')];_0x49b27e+=0x1){if(_0x69fcb8[_0xaf80('0x7b')][_0x49b27e][_0xaf80('0x2e')]&&_[_0xaf80('0x5f')](_0x2bd18d,_0x69fcb8[_0xaf80('0x7b')][_0x49b27e][_0xaf80('0x2e')])&&_0x69fcb8[_0xaf80('0x7b')][_0x49b27e][_0xaf80('0x7d')]&&_0x69fcb8[_0xaf80('0x7b')][_0x49b27e][_0xaf80('0x7e')]&&_0x69fcb8[_0xaf80('0x7b')][_0x49b27e][_0xaf80('0x7f')]){_0x46221a[_0x69fcb8['joins'][_0x49b27e][_0xaf80('0x2e')]](_0x69fcb8['joins'][_0x49b27e][_0xaf80('0x7e')],null,util[_0xaf80('0x76')]('%s.%s\x20=\x20%s.%s',_0x69fcb8[_0xaf80('0x71')],_0x69fcb8[_0xaf80('0x7b')][_0x49b27e]['parentKey'],_0x69fcb8[_0xaf80('0x7b')][_0x49b27e][_0xaf80('0x7e')],_0x69fcb8[_0xaf80('0x7b')][_0x49b27e][_0xaf80('0x7f')]));}}}if(_0x69fcb8['conditions']){_0x69fcb8[_0xaf80('0x80')]=JSON[_0xaf80('0x7c')](_0x69fcb8['conditions']);_0x46221a[_0xaf80('0x3b')](_0x2fd4c7(_0x69fcb8['conditions'][_0xaf80('0x66')]));}_0x334358=_0x46221a[_0xaf80('0x81')]();_0x46221a[_0xaf80('0x38')](_0x32b0c3);_0x46221a[_0xaf80('0x19')](0x0);return;}})[_0xaf80('0x23')](function(){if(_0x87bdd3[_0xaf80('0x8c')]==='web'){return null;}var _0x4c2dab=_[_0xaf80('0x3e')](_0x87bdd3,{'name':_0x87bdd3[_0xaf80('0x8d')]||_0x87bdd3['name']||_0x69fcb8[_0xaf80('0x29')],'basename':_0x150863,'savename':util[_0xaf80('0x76')]('%s-%s.%s',_0x87bdd3[_0xaf80('0x29')]||_0x69fcb8[_0xaf80('0x29')],require(_0xaf80('0x8e'))[_0xaf80('0x8f')](0x4),_0x87bdd3[_0xaf80('0x8c')]||_0xaf80('0x90')),'reportId':_0x69fcb8['id'],'reportType':'custom'});return db['AnalyticExtractedReport']['create'](_0x4c2dab,{'raw':!![]});})[_0xaf80('0x23')](function(_0x2f8798){if(_0x69fcb8[_0xaf80('0x71')]==='cdr'){_0x334358[_0xaf80('0x3b')](_0x69fcb8[_0xaf80('0x71')]+_0xaf80('0x91'),_0x87bdd3[_0xaf80('0x92')],_0x87bdd3[_0xaf80('0x93')]);}else{_0x334358[_0xaf80('0x3b')](_0x69fcb8[_0xaf80('0x71')]+_0xaf80('0x94'),_0x87bdd3[_0xaf80('0x92')],_0x87bdd3[_0xaf80('0x93')]);}if(_0x2f8798){logger[_0xaf80('0x95')]('Run\x20Query:',_0x334358[_0xaf80('0x85')]());require(_0xaf80('0x96'))[_0xaf80('0x97')](path['join'](__dirname,'../../components/export/',_0x2f8798[_0xaf80('0x8c')]),[_0x2f8798['id'],_0x334358['toString'](),path['join'](__dirname,_0xaf80('0x98'),_0x2f8798[_0xaf80('0x99')]),_0x150863]);return _0x2f8798;}else{var _0x40160d=squel[_0xaf80('0x6f')]();_0x40160d[_0xaf80('0x70')]('('+_0x334358['toString']()+')',_0xaf80('0x9a'));_0x40160d[_0xaf80('0x67')](_0xaf80('0x9b'),_0xaf80('0x1b'));_0x334358[_0xaf80('0x38')](_0x87bdd3[_0xaf80('0x38')]||_0x32b0c3);_0x334358[_0xaf80('0x19')](_0x87bdd3[_0xaf80('0x19')]||0x0);return dbH[_0xaf80('0x84')]['query'](_0x40160d[_0xaf80('0x85')](),{'type':dbH[_0xaf80('0x84')][_0xaf80('0x86')]['SELECT']})[_0xaf80('0x23')](function(_0x44d597){if(!_0x44d597[_0xaf80('0x44')]){_0xbdeec1=0x0;}else{_0xbdeec1=_0x44d597[0x0][_0xaf80('0x1b')]||0x0;}return dbH[_0xaf80('0x84')][_0xaf80('0x32')](_0x334358[_0xaf80('0x85')](),{'type':dbH[_0xaf80('0x84')][_0xaf80('0x86')][_0xaf80('0x9c')]});})['then'](function(_0x315bc5){return{'rows':_0x315bc5||[],'count':_0xbdeec1};});}});}exports[_0xaf80('0x9d')]=function(_0x1bb3fa,_0x202383){return runReport(_0x1bb3fa[_0xaf80('0x43')],_0x1bb3fa[_0xaf80('0x32')],_0x1bb3fa[_0xaf80('0x40')])[_0xaf80('0x23')](respondWithResult(_0x202383,null))[_0xaf80('0x47')](handleError(_0x202383,null));};exports[_0xaf80('0x9e')]=runReport;exports[_0xaf80('0x32')]=function(_0x4eebc8,_0x4de63b){var _0x265614=0xa;var _0x273224=['join','left_join',_0xaf80('0x54'),_0xaf80('0x55')];var _0x306808={'SUM':_0xaf80('0x56'),'COUNT':_0xaf80('0x87'),'COUNT DISTINCT':_0xaf80('0x57'),'MAX':_0xaf80('0x58'),'MIN':_0xaf80('0x59'),'AVG':_0xaf80('0x88'),'GROUP_CONCAT':_0xaf80('0x5a'),'GROUP_CONCAT ASC':_0xaf80('0x89'),'GROUP_CONCAT DESC':_0xaf80('0x8a')};var _0x47f386={'SEC_TO_TIME':_0xaf80('0x5b'),'DATE':_0xaf80('0x8b'),'HOUR':_0xaf80('0x5c'),'ROUND':_0xaf80('0x5d'),'UNIX_TIMESTAMP':_0xaf80('0x5e')};var _0x215e13=function(_0x532483){return!_[_0xaf80('0x5f')]([_0xaf80('0x60'),_0xaf80('0x61'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x532483);};var _0x544740=function(_0x594808){if(!_0x594808||!_0x594808[_0xaf80('0x64')][_0xaf80('0x44')]){return'';}for(var _0x470da8='(',_0x3ee65b=0x0;_0x3ee65b<_0x594808[_0xaf80('0x64')]['length'];_0x3ee65b+=0x1){_0x3ee65b>0x0&&(_0x470da8+='\x20'+_0x594808[_0xaf80('0x65')]+'\x20');_0x470da8+=_0x594808['rules'][_0x3ee65b][_0xaf80('0x66')]?_0x544740(_0x594808['rules'][_0x3ee65b]['group']):_0x594808[_0xaf80('0x64')][_0x3ee65b][_0xaf80('0x67')]+'\x20'+_0x594808[_0xaf80('0x64')][_0x3ee65b]['condition']+(_0x215e13(_0x594808[_0xaf80('0x64')][_0x3ee65b][_0xaf80('0x68')])?'\x20'+_0x594808[_0xaf80('0x64')][_0x3ee65b][_0xaf80('0x69')]:'');}return _0x470da8+')';};var _0x4fc9d2={'where':{'id':_0x4eebc8[_0xaf80('0x43')]['id']}},_0x533914,_0x3315f9,_0x2b1bfc,_0x540cc5,_0x44f8be;_0x4fc9d2=_[_0xaf80('0x3e')]({},_0x4fc9d2,_0x4eebc8[_0xaf80('0x40')]);return db[_0xaf80('0x2b')]['find'](_0x4fc9d2)[_0xaf80('0x23')](function(_0x4da8a5){if(_0x4da8a5){_0x533914=_0x4da8a5;return _0x4da8a5[_0xaf80('0x6a')]();}return null;})[_0xaf80('0x23')](function(_0x13d9c4){if(_0x13d9c4){if(!_0x13d9c4['length']){throw new db[(_0xaf80('0x6b'))][(_0xaf80('0x9f'))](_0xaf80('0x6c'),0x193);}_0x3315f9=_0x13d9c4;return db[_0xaf80('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xaf80('0x23')](function(_0x400612){if(_0x400612){_0x2b1bfc=_[_0xaf80('0x6e')](_0x400612,'id');var _0x5c5317;var _0x1bb887=squel[_0xaf80('0x6f')]();_0x1bb887['from'](_0x533914['table']);for(var _0x237f9f=0x0;_0x237f9f<_0x3315f9[_0xaf80('0x44')];_0x237f9f+=0x1){_0x5c5317=_0x3315f9[_0x237f9f][_0xaf80('0x72')]?_0x2b1bfc[_0x3315f9[_0x237f9f][_0xaf80('0x72')]]['metric']:_0x3315f9[_0x237f9f]['field'];_0x5c5317=_0x3315f9[_0x237f9f][_0xaf80('0x74')]?_[_0xaf80('0x75')](_0x306808[_0x3315f9[_0x237f9f][_0xaf80('0x74')]],'%s',_0x5c5317):_0x5c5317;_0x5c5317=_0x3315f9[_0x237f9f][_0xaf80('0x76')]?_[_0xaf80('0x75')](_0x47f386[_0x3315f9[_0x237f9f]['format']],'%s',_0x5c5317):_0x5c5317;if(_0x3315f9[_0x237f9f][_0xaf80('0x77')]){_0x1bb887[_0xaf80('0x66')](_0x5c5317);}_0x3315f9[_0x237f9f][_0xaf80('0x78')]&&_0x1bb887[_0xaf80('0x39')](_0x5c5317,_0x3315f9[_0x237f9f]['orderBy']===_0xaf80('0x79')?![]:!![]);_0x1bb887[_0xaf80('0x67')](_0x5c5317,_0x3315f9[_0x237f9f]['alias']||_0x5c5317);}if(_0x533914[_0xaf80('0x7b')]){_0x533914['joins']=JSON[_0xaf80('0x7c')](_0x533914[_0xaf80('0x7b')]);for(var _0x1cc9a7=0x0;_0x1cc9a7<_0x533914['joins']['length'];_0x1cc9a7+=0x1){if(_0x533914[_0xaf80('0x7b')][_0x1cc9a7][_0xaf80('0x2e')]&&_[_0xaf80('0x5f')](_0x273224,_0x533914[_0xaf80('0x7b')][_0x1cc9a7][_0xaf80('0x2e')])&&_0x533914[_0xaf80('0x7b')][_0x1cc9a7][_0xaf80('0x7d')]&&_0x533914[_0xaf80('0x7b')][_0x1cc9a7]['foreignTable']&&_0x533914['joins'][_0x1cc9a7][_0xaf80('0x7f')]){_0x1bb887[_0x533914[_0xaf80('0x7b')][_0x1cc9a7][_0xaf80('0x2e')]](_0x533914[_0xaf80('0x7b')][_0x1cc9a7][_0xaf80('0x7e')],null,util[_0xaf80('0x76')](_0xaf80('0xa0'),_0x533914[_0xaf80('0x71')],_0x533914['joins'][_0x1cc9a7][_0xaf80('0x7d')],_0x533914['joins'][_0x1cc9a7][_0xaf80('0x7e')],_0x533914[_0xaf80('0x7b')][_0x1cc9a7][_0xaf80('0x7f')]));}}}if(_0x533914[_0xaf80('0x80')]){_0x533914[_0xaf80('0x80')]=JSON[_0xaf80('0x7c')](_0x533914['conditions']);_0x1bb887[_0xaf80('0x3b')](_0x544740(_0x533914[_0xaf80('0x80')][_0xaf80('0x66')]));}_0x44f8be=_0x1bb887[_0xaf80('0x81')]();_0x1bb887['limit'](_0x265614);_0x1bb887['offset'](0x0);logger[_0xaf80('0x82')](_0xaf80('0x83'),_0x1bb887[_0xaf80('0x85')]());return dbH['sequelize'][_0xaf80('0x32')](_0x1bb887[_0xaf80('0x85')](),{'type':dbH[_0xaf80('0x84')][_0xaf80('0x86')][_0xaf80('0x9c')]});}})[_0xaf80('0x23')](function(){return{'sql':_0x44f8be[_0xaf80('0x85')]()};})[_0xaf80('0x23')](respondWithResult(_0x4de63b,null))['catch'](handleError(_0x4de63b,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index c6cceb9..f4ba370 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 _0x2201=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x2201,0x127));var _0x1220=function(_0x3465f4,_0x28b5d5){_0x3465f4=_0x3465f4-0x0;var _0xc2306c=_0x2201[_0x3465f4];return _0xc2306c;};'use strict';var _=require(_0x1220('0x0'));var util=require(_0x1220('0x1'));var logger=require(_0x1220('0x2'))('api');var moment=require(_0x1220('0x3'));var BPromise=require(_0x1220('0x4'));var rp=require(_0x1220('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1220('0x6'));var config=require(_0x1220('0x7'));var attributes=require(_0x1220('0x8'));module['exports']=function(_0x3b0b7e,_0x4fe3a6){return _0x3b0b7e['define'](_0x1220('0x9'),attributes,{'tableName':_0x1220('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x04fb=['rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04fb,0xd2));var _0xb04f=function(_0x165c5c,_0x346405){_0x165c5c=_0x165c5c-0x0;var _0x3999ef=_0x04fb[_0x165c5c];return _0x3999ef;};'use strict';var _=require(_0xb04f('0x0'));var util=require(_0xb04f('0x1'));var logger=require(_0xb04f('0x2'))('api');var moment=require(_0xb04f('0x3'));var BPromise=require('bluebird');var rp=require(_0xb04f('0x4'));var fs=require('fs');var path=require(_0xb04f('0x5'));var rimraf=require(_0xb04f('0x6'));var config=require(_0xb04f('0x7'));var attributes=require(_0xb04f('0x8'));module['exports']=function(_0x537277,_0x5539e8){return _0x537277[_0xb04f('0x9')](_0xb04f('0xa'),attributes,{'tableName':_0xb04f('0xb'),'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 8f16d8b..2c9e3a4 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 _0xb5d2=['jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb5d2,0xd3));var _0x2b5d=function(_0x1d0cd2,_0x218b87){_0x1d0cd2=_0x1d0cd2-0x0;var _0x24a95f=_0xb5d2[_0x1d0cd2];return _0x24a95f;};'use strict';var _=require(_0x2b5d('0x0'));var util=require(_0x2b5d('0x1'));var moment=require(_0x2b5d('0x2'));var BPromise=require('bluebird');var rs=require(_0x2b5d('0x3'));var fs=require('fs');var Redis=require(_0x2b5d('0x4'));var db=require(_0x2b5d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b5d('0x6'))(_0x2b5d('0x7'));var config=require(_0x2b5d('0x8'));var jayson=require(_0x2b5d('0x9'));var client=jayson[_0x2b5d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5afebb,_0x422d3b,_0x17d7d4){return new BPromise(function(_0x1c68c5,_0x44d92c){return client[_0x2b5d('0xb')](_0x5afebb,_0x17d7d4)[_0x2b5d('0xc')](function(_0x8f249c){logger[_0x2b5d('0xd')](_0x2b5d('0xe'),_0x422d3b,_0x2b5d('0xf'));logger[_0x2b5d('0x10')](_0x2b5d('0x11'),_0x422d3b,_0x2b5d('0xf'),JSON['stringify'](_0x8f249c));if(_0x8f249c[_0x2b5d('0x12')]){if(_0x8f249c[_0x2b5d('0x12')][_0x2b5d('0x13')]===0x1f4){logger[_0x2b5d('0x12')](_0x2b5d('0xe'),_0x422d3b,_0x8f249c[_0x2b5d('0x12')]['message']);return _0x44d92c(_0x8f249c[_0x2b5d('0x12')][_0x2b5d('0x14')]);}logger['error'](_0x2b5d('0xe'),_0x422d3b,_0x8f249c['error'][_0x2b5d('0x14')]);return _0x1c68c5(_0x8f249c[_0x2b5d('0x12')]['message']);}else{logger[_0x2b5d('0xd')](_0x2b5d('0xe'),_0x422d3b,'request\x20sent');_0x1c68c5(_0x8f249c['result'][_0x2b5d('0x14')]);}})[_0x2b5d('0x15')](function(_0x1b2801){logger[_0x2b5d('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x422d3b,_0x1b2801);_0x44d92c(_0x1b2801);});});}
\ No newline at end of file
+var _0x6624=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','info','catch','lodash','moment','randomstring'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x6624,0x131));var _0x4662=function(_0x326ce1,_0x34a5b9){_0x326ce1=_0x326ce1-0x0;var _0x5c17fc=_0x6624[_0x326ce1];return _0x5c17fc;};'use strict';var _=require(_0x4662('0x0'));var util=require('util');var moment=require(_0x4662('0x1'));var BPromise=require('bluebird');var rs=require(_0x4662('0x2'));var fs=require('fs');var Redis=require(_0x4662('0x3'));var db=require(_0x4662('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4662('0x5'))(_0x4662('0x6'));var config=require('../../config/environment');var jayson=require(_0x4662('0x7'));var client=jayson[_0x4662('0x8')][_0x4662('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33239c,_0x23a3ca,_0x4739da){return new BPromise(function(_0x5a3175,_0x354c92){return client[_0x4662('0xa')](_0x33239c,_0x4739da)[_0x4662('0xb')](function(_0x5bdada){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x23a3ca,_0x4662('0xc'));logger[_0x4662('0xd')](_0x4662('0xe'),_0x23a3ca,_0x4662('0xc'),JSON[_0x4662('0xf')](_0x5bdada));if(_0x5bdada[_0x4662('0x10')]){if(_0x5bdada[_0x4662('0x10')][_0x4662('0x11')]===0x1f4){logger[_0x4662('0x10')](_0x4662('0x12'),_0x23a3ca,_0x5bdada[_0x4662('0x10')][_0x4662('0x13')]);return _0x354c92(_0x5bdada[_0x4662('0x10')][_0x4662('0x13')]);}logger['error'](_0x4662('0x12'),_0x23a3ca,_0x5bdada[_0x4662('0x10')][_0x4662('0x13')]);return _0x5a3175(_0x5bdada['error']['message']);}else{logger[_0x4662('0x14')](_0x4662('0x12'),_0x23a3ca,_0x4662('0xc'));_0x5a3175(_0x5bdada['result'][_0x4662('0x13')]);}})[_0x4662('0x15')](function(_0x55dd58){logger[_0x4662('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x23a3ca,_0x55dd58);_0x354c92(_0x55dd58);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 4db7ce7..2375fdc 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 _0x219a=['show','/:id/preview','preview','/:id/run','/:id/query','create','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','/:id'];(function(_0x199b59,_0x25a5bc){var _0x179e10=function(_0x510342){while(--_0x510342){_0x199b59['push'](_0x199b59['shift']());}};_0x179e10(++_0x25a5bc);}(_0x219a,0xb3));var _0xa219=function(_0x517c97,_0x3fd275){_0x517c97=_0x517c97-0x0;var _0x244ef3=_0x219a[_0x517c97];return _0x244ef3;};'use strict';var multer=require('multer');var util=require(_0xa219('0x0'));var path=require(_0xa219('0x1'));var timeout=require(_0xa219('0x2'));var express=require('express');var router=express[_0xa219('0x3')]();var fs_extra=require(_0xa219('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa219('0x5'));var config=require(_0xa219('0x6'));var controller=require(_0xa219('0x7'));router['get']('/',auth[_0xa219('0x8')](),controller['index']);router[_0xa219('0x9')](_0xa219('0xa'),auth[_0xa219('0x8')](),controller[_0xa219('0xb')]);router[_0xa219('0x9')](_0xa219('0xc'),auth[_0xa219('0x8')](),controller[_0xa219('0xd')]);router[_0xa219('0x9')](_0xa219('0xe'),auth[_0xa219('0x8')](),controller['run']);router[_0xa219('0x9')](_0xa219('0xf'),auth[_0xa219('0x8')](),controller['query']);router['post']('/',auth[_0xa219('0x8')](),controller[_0xa219('0x10')]);router['put'](_0xa219('0xa'),auth[_0xa219('0x8')](),controller['update']);router[_0xa219('0x11')](_0xa219('0xa'),auth[_0xa219('0x8')](),controller['destroy']);module[_0xa219('0x12')]=router;
\ No newline at end of file
+var _0x903d=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','query','post','create','put','delete','multer','util'];(function(_0x1945ec,_0x17e9f9){var _0x5be70b=function(_0x571a97){while(--_0x571a97){_0x1945ec['push'](_0x1945ec['shift']());}};_0x5be70b(++_0x17e9f9);}(_0x903d,0x163));var _0xd903=function(_0x5aec18,_0xe60625){_0x5aec18=_0x5aec18-0x0;var _0x578370=_0x903d[_0x5aec18];return _0x578370;};'use strict';var multer=require(_0xd903('0x0'));var util=require(_0xd903('0x1'));var path=require(_0xd903('0x2'));var timeout=require('connect-timeout');var express=require(_0xd903('0x3'));var router=express['Router']();var fs_extra=require(_0xd903('0x4'));var auth=require(_0xd903('0x5'));var interaction=require(_0xd903('0x6'));var config=require('../../config/environment');var controller=require(_0xd903('0x7'));router[_0xd903('0x8')]('/',auth[_0xd903('0x9')](),controller[_0xd903('0xa')]);router['get'](_0xd903('0xb'),auth[_0xd903('0x9')](),controller[_0xd903('0xc')]);router[_0xd903('0x8')](_0xd903('0xd'),auth[_0xd903('0x9')](),controller[_0xd903('0xe')]);router[_0xd903('0x8')](_0xd903('0xf'),auth[_0xd903('0x9')](),controller['run']);router[_0xd903('0x8')]('/:id/query',auth[_0xd903('0x9')](),controller[_0xd903('0x10')]);router[_0xd903('0x11')]('/',auth['isAuthenticated'](),controller[_0xd903('0x12')]);router[_0xd903('0x13')](_0xd903('0xb'),auth[_0xd903('0x9')](),controller['update']);router[_0xd903('0x14')](_0xd903('0xb'),auth['isAuthenticated'](),controller['destroy']);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 b6c95a6..fcce017 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 _0x7fbe=['STRING','TEXT'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x48cf09,_0x3b5f6c){_0x48cf09=_0x48cf09-0x0;var _0x203b57=_0x7fbe[_0x48cf09];return _0x203b57;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'parent':{'type':Sequelize[_0xe7fb('0x0')]},'table':{'type':Sequelize[_0xe7fb('0x0')]},'conditions':{'type':Sequelize[_0xe7fb('0x1')]},'joins':{'type':Sequelize[_0xe7fb('0x1')]}};
\ No newline at end of file
+var _0xb138=['TEXT','sequelize','exports','STRING'];(function(_0x27d408,_0x33967e){var _0x2187ee=function(_0x3b383e){while(--_0x3b383e){_0x27d408['push'](_0x27d408['shift']());}};_0x2187ee(++_0x33967e);}(_0xb138,0x1dd));var _0x8b13=function(_0x13f251,_0x50734d){_0x13f251=_0x13f251-0x0;var _0x3bbb59=_0xb138[_0x13f251];return _0x3bbb59;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'name':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b13('0x2')]},'parent':{'type':Sequelize[_0x8b13('0x2')]},'table':{'type':Sequelize[_0x8b13('0x2')]},'conditions':{'type':Sequelize[_0x8b13('0x3')]},'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 21eca00..e220744 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 _0x3f8a=['get','DefaultReports','end','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','keys','intersection','model','attributes','fields','query','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','condition','ValidationErrorItem','metric','DESC','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','%s.%s\x20=\x20%s.%s','debug','eml-format','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then'];(function(_0x175e8b,_0x4944c6){var _0x379185=function(_0x4807e8){while(--_0x4807e8){_0x175e8b['push'](_0x175e8b['shift']());}};_0x379185(++_0x4944c6);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x2ec699,_0x24e473){_0x2ec699=_0x2ec699-0x0;var _0x3c4349=_0x3f8a[_0x2ec699];return _0x3c4349;};'use strict';var emlformat=require(_0xa3f8('0x0'));var rimraf=require(_0xa3f8('0x1'));var zipdir=require(_0xa3f8('0x2'));var jsonpatch=require(_0xa3f8('0x3'));var rp=require('request-promise');var moment=require(_0xa3f8('0x4'));var BPromise=require(_0xa3f8('0x5'));var Mustache=require(_0xa3f8('0x6'));var util=require(_0xa3f8('0x7'));var path=require(_0xa3f8('0x8'));var sox=require(_0xa3f8('0x9'));var csv=require(_0xa3f8('0xa'));var ejs=require(_0xa3f8('0xb'));var fs=require('fs');var fs_extra=require(_0xa3f8('0xc'));var _=require(_0xa3f8('0xd'));var squel=require(_0xa3f8('0xe'));var crypto=require(_0xa3f8('0xf'));var jsforce=require(_0xa3f8('0x10'));var deskjs=require(_0xa3f8('0x11'));var toCsv=require(_0xa3f8('0xa'));var querystring=require(_0xa3f8('0x12'));var Papa=require(_0xa3f8('0x13'));var Redis=require('ioredis');var authService=require(_0xa3f8('0x14'));var qs=require(_0xa3f8('0x15'));var as=require(_0xa3f8('0x16'));var hardwareService=require(_0xa3f8('0x17'));var logger=require('../../config/logger')(_0xa3f8('0x18'));var utils=require(_0xa3f8('0x19'));var config=require(_0xa3f8('0x1a'));var licenseUtil=require(_0xa3f8('0x1b'));var db=require(_0xa3f8('0x1c'))['db'];var dbH=require(_0xa3f8('0x1c'))[_0xa3f8('0x1d')];function respondWithStatusCode(_0x63de8b,_0x324aa8){_0x324aa8=_0x324aa8||0xcc;return function(_0x36b1b8){if(_0x36b1b8){return _0x63de8b[_0xa3f8('0x1e')](_0x324aa8);}return _0x63de8b[_0xa3f8('0x1f')](_0x324aa8)['end']();};}function respondWithResult(_0x2d8f74,_0xe55848){_0xe55848=_0xe55848||0xc8;return function(_0x45014f){if(_0x45014f){return _0x2d8f74[_0xa3f8('0x1f')](_0xe55848)['json'](_0x45014f);}};}function respondWithFilteredResult(_0x39c450,_0x33b98e){return function(_0x46a8d9){if(_0x46a8d9){var _0x8cd130=typeof _0x33b98e[_0xa3f8('0x20')]===_0xa3f8('0x21')&&typeof _0x33b98e[_0xa3f8('0x22')]===_0xa3f8('0x21');var _0x2cb49f=_0x46a8d9[_0xa3f8('0x23')];var _0x54b870=_0x8cd130?0x0:_0x33b98e[_0xa3f8('0x20')];var _0x5a0e18=_0x8cd130?_0x46a8d9[_0xa3f8('0x23')]:_0x33b98e[_0xa3f8('0x20')]+_0x33b98e[_0xa3f8('0x22')];var _0x46042d;if(_0x5a0e18>=_0x2cb49f){_0x5a0e18=_0x2cb49f;_0x46042d=0xc8;}else{_0x46042d=0xce;}_0x39c450['status'](_0x46042d);return _0x39c450[_0xa3f8('0x24')]('Content-Range',_0x54b870+'-'+_0x5a0e18+'/'+_0x2cb49f)[_0xa3f8('0x25')](_0x46a8d9);}return null;};}function patchUpdates(_0x58336d){return function(_0x4066bb){try{jsonpatch[_0xa3f8('0x26')](_0x4066bb,_0x58336d,!![]);}catch(_0x353daa){return BPromise[_0xa3f8('0x27')](_0x353daa);}return _0x4066bb[_0xa3f8('0x28')]();};}function saveUpdates(_0x1e5f30,_0x187352){return function(_0x490717){if(_0x490717){return _0x490717[_0xa3f8('0x29')](_0x1e5f30)['then'](function(_0x3ce57b){return _0x3ce57b;});}return null;};}function removeEntity(_0xa5a697,_0x24985a){return function(_0x37b290){if(_0x37b290){return _0x37b290[_0xa3f8('0x2a')]()[_0xa3f8('0x2b')](function(){var _0x6e3cb4=_0x37b290[_0xa3f8('0x2c')]({'plain':!![]});var _0x1e22b8=_0xa3f8('0x2d');return db['UserProfileResource'][_0xa3f8('0x2a')]({'where':{'type':_0x1e22b8,'resourceId':_0x6e3cb4['id']}})[_0xa3f8('0x2b')](function(){return _0x37b290;});})[_0xa3f8('0x2b')](function(){_0xa5a697['status'](0xcc)[_0xa3f8('0x2e')]();});}};}function handleEntityNotFound(_0x57f6be,_0xbad6a6){return function(_0x3a3746){if(!_0x3a3746){_0x57f6be[_0xa3f8('0x1e')](0x194);}return _0x3a3746;};}function handleError(_0x4ea213,_0x458824){_0x458824=_0x458824||0x1f4;return function(_0x5e69e2){logger[_0xa3f8('0x2f')](_0x5e69e2[_0xa3f8('0x30')]);if(_0x5e69e2[_0xa3f8('0x31')]){delete _0x5e69e2[_0xa3f8('0x31')];}_0x4ea213[_0xa3f8('0x1f')](_0x458824)[_0xa3f8('0x32')](_0x5e69e2);};}exports[_0xa3f8('0x33')]=function(_0x424a3e,_0x25f9f5){var _0x290a4e={},_0x6e83b0={},_0x57c465={'count':0x0,'rows':[]};var _0x4404da=_[_0xa3f8('0x34')](db[_0xa3f8('0x35')][_0xa3f8('0x36')],function(_0x3bb4b0){return{'name':_0x3bb4b0['fieldName'],'type':_0x3bb4b0[_0xa3f8('0x37')][_0xa3f8('0x38')]};});_0x6e83b0['model']=_[_0xa3f8('0x34')](_0x4404da,_0xa3f8('0x31'));_0x6e83b0['query']=_[_0xa3f8('0x39')](_0x424a3e['query']);_0x6e83b0['filters']=_[_0xa3f8('0x3a')](_0x6e83b0[_0xa3f8('0x3b')],_0x6e83b0['query']);_0x290a4e[_0xa3f8('0x3c')]=_['intersection'](_0x6e83b0[_0xa3f8('0x3b')],qs[_0xa3f8('0x3d')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x290a4e['attributes']=_0x290a4e[_0xa3f8('0x3c')]['length']?_0x290a4e[_0xa3f8('0x3c')]:_0x6e83b0['model'];if(!_0x424a3e[_0xa3f8('0x3e')]['hasOwnProperty']('nolimit')){_0x290a4e['limit']=qs[_0xa3f8('0x22')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x22')]);_0x290a4e[_0xa3f8('0x20')]=qs['offset'](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x20')]);}_0x290a4e[_0xa3f8('0x3f')]=qs[_0xa3f8('0x40')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x40')]);_0x290a4e['where']=qs[_0xa3f8('0x41')](_[_0xa3f8('0x42')](_0x424a3e[_0xa3f8('0x3e')],_0x6e83b0['filters']),_0x4404da);if(_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x43')]){_0x290a4e['where']=_[_0xa3f8('0x44')](_0x290a4e['where'],{'$or':_[_0xa3f8('0x34')](_0x4404da,function(_0x5a077c){if(_0x5a077c[_0xa3f8('0x37')]!==_0xa3f8('0x45')){var _0x9a00e7={};_0x9a00e7[_0x5a077c[_0xa3f8('0x31')]]={'$like':'%'+_0x424a3e[_0xa3f8('0x3e')]['filter']+'%'};return _0x9a00e7;}})});}_0x290a4e=_[_0xa3f8('0x44')]({},_0x290a4e,_0x424a3e[_0xa3f8('0x46')]);var _0x4db9c5={'where':_0x290a4e[_0xa3f8('0x47')]};return db['AnalyticDefaultReport'][_0xa3f8('0x23')](_0x4db9c5)[_0xa3f8('0x2b')](function(_0x1542cc){_0x57c465[_0xa3f8('0x23')]=_0x1542cc;if(_0x424a3e[_0xa3f8('0x3e')]['includeAll']){_0x290a4e[_0xa3f8('0x48')]=[{'all':!![]}];}return db[_0xa3f8('0x35')][_0xa3f8('0x49')](_0x290a4e);})[_0xa3f8('0x2b')](function(_0x337808){_0x57c465['rows']=_0x337808;return _0x57c465;})[_0xa3f8('0x2b')](respondWithFilteredResult(_0x25f9f5,_0x290a4e))[_0xa3f8('0x4a')](handleError(_0x25f9f5,null));};exports[_0xa3f8('0x4b')]=function(_0x32e371,_0x2a124b){var _0x314dba={'raw':!![],'where':{'id':_0x32e371[_0xa3f8('0x4c')]['id']}},_0x497217={};_0x497217[_0xa3f8('0x3b')]=_[_0xa3f8('0x39')](db[_0xa3f8('0x35')][_0xa3f8('0x36')]);_0x497217[_0xa3f8('0x3e')]=_['keys'](_0x32e371['query']);_0x497217['filters']=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],_0x497217[_0xa3f8('0x3e')]);_0x314dba[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],qs['fields'](_0x32e371[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x314dba[_0xa3f8('0x3c')]=_0x314dba[_0xa3f8('0x3c')]['length']?_0x314dba[_0xa3f8('0x3c')]:_0x497217[_0xa3f8('0x3b')];if(_0x32e371[_0xa3f8('0x3e')]['includeAll']){_0x314dba['include']=[{'all':!![]}];}_0x314dba=_['merge']({},_0x314dba,_0x32e371[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')]['find'](_0x314dba)[_0xa3f8('0x2b')](handleEntityNotFound(_0x2a124b,null))[_0xa3f8('0x2b')](respondWithResult(_0x2a124b,null))[_0xa3f8('0x4a')](handleError(_0x2a124b,null));};exports[_0xa3f8('0x4d')]=function(_0x14932f,_0x3c74b5){return db[_0xa3f8('0x35')][_0xa3f8('0x4d')](_0x14932f[_0xa3f8('0x4e')],{})[_0xa3f8('0x2b')](function(_0x338554){var _0x29d8f5=_0x14932f[_0xa3f8('0x4f')][_0xa3f8('0x2c')]({'plain':!![]});if(!_0x29d8f5)throw new Error(_0xa3f8('0x50'));if(_0x29d8f5[_0xa3f8('0x51')]===_0xa3f8('0x4f')){var _0x559ae7=_0x338554['get']({'plain':!![]});var _0x1fad80=_0xa3f8('0x52');return db['UserProfileSection'][_0xa3f8('0x53')]({'where':{'name':_0x1fad80,'userProfileId':_0x29d8f5[_0xa3f8('0x54')]},'raw':!![]})[_0xa3f8('0x2b')](function(_0xaff79b){if(_0xaff79b&&_0xaff79b[_0xa3f8('0x55')]===0x0){return db[_0xa3f8('0x56')][_0xa3f8('0x4d')]({'name':_0x559ae7[_0xa3f8('0x31')],'resourceId':_0x559ae7['id'],'type':_0xa3f8('0x2d'),'sectionId':_0xaff79b['id']},{})[_0xa3f8('0x2b')](function(){return _0x338554;});}else{return _0x338554;}})[_0xa3f8('0x4a')](function(_0x3752fa){logger[_0xa3f8('0x2f')](_0xa3f8('0x57'),_0x3752fa);throw _0x3752fa;});}return _0x338554;})[_0xa3f8('0x2b')](respondWithResult(_0x3c74b5,0xc9))[_0xa3f8('0x4a')](handleError(_0x3c74b5,null));};exports['update']=function(_0x593614,_0xd0628e){if(_0x593614['body']['id']){delete _0x593614[_0xa3f8('0x4e')]['id'];}return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x593614['params']['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0xd0628e,null))[_0xa3f8('0x2b')](saveUpdates(_0x593614[_0xa3f8('0x4e')],null))[_0xa3f8('0x2b')](respondWithResult(_0xd0628e,null))['catch'](handleError(_0xd0628e,null));};exports[_0xa3f8('0x2a')]=function(_0x47cc0c,_0x392e1e){return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x47cc0c['params']['id']}})['then'](handleEntityNotFound(_0x392e1e,null))[_0xa3f8('0x2b')](removeEntity(_0x392e1e,null))[_0xa3f8('0x4a')](handleError(_0x392e1e,null));};exports[_0xa3f8('0x58')]=function(_0x6ad40a,_0x48f5a6){var _0x36eac9=0xa;var _0x3478e8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x5d7877={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x521719={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x27de61=function(_0x356643){return!_[_0xa3f8('0x68')](['IS\x20NULL',_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x356643);};var _0x42e3f8=function(_0x27c5aa){if(!_0x27c5aa||!_0x27c5aa[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x4d0404='(',_0x33ea06=0x0;_0x33ea06<_0x27c5aa[_0xa3f8('0x6c')]['length'];_0x33ea06+=0x1){_0x33ea06>0x0&&(_0x4d0404+='\x20'+_0x27c5aa[_0xa3f8('0x6e')]+'\x20');_0x4d0404+=_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]?_0x42e3f8(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]):_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x70')]+'\x20'+_0x27c5aa['rules'][_0x33ea06]['condition']+(_0x27de61(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06]['condition'])?'\x20'+_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x71')]:'');}return _0x4d0404+')';};var _0x3ff369={'where':{'id':_0x6ad40a[_0xa3f8('0x4c')]['id']}},_0x1dba7e,_0x452e99,_0x35d4d6,_0xeca2dc,_0x14508d;_0x3ff369=_[_0xa3f8('0x44')]({},_0x3ff369,_0x6ad40a[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x3ff369)['then'](function(_0x5efdcf){if(_0x5efdcf){_0x1dba7e=_0x5efdcf;return _0x5efdcf[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x1688ca){if(_0x1688ca){if(!_0x1688ca[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))]['ValidationErrorItem'](_0xa3f8('0x74'),0x193);}_0x452e99=_0x1688ca;return db[_0xa3f8('0x75')][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x28d359){if(_0x28d359){_0x35d4d6=_[_0xa3f8('0x76')](_0x28d359,'id');var _0x3d45ae;var _0x3a2362=squel[_0xa3f8('0x77')]();_0x3a2362[_0xa3f8('0x78')](_0x1dba7e[_0xa3f8('0x79')]);for(var _0x5d4fe5=0x0;_0x5d4fe5<_0x452e99[_0xa3f8('0x6d')];_0x5d4fe5+=0x1){_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7a')]?_0x35d4d6[_0x452e99[_0x5d4fe5]['MetricId']]['metric']:_0x452e99[_0x5d4fe5][_0xa3f8('0x70')];_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x5d7877[_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]],'%s',_0x3d45ae):_0x3d45ae;_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x521719[_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]],'%s',_0x3d45ae):_0x3d45ae;if(_0x452e99[_0x5d4fe5][_0xa3f8('0x7e')]){_0x3a2362['group'](_0x3d45ae);}_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]&&_0x3a2362[_0xa3f8('0x3f')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3a2362[_0xa3f8('0x70')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x80')]||_0x3d45ae);}if(_0x1dba7e['joins']){_0x1dba7e[_0xa3f8('0x81')]=JSON[_0xa3f8('0x82')](_0x1dba7e[_0xa3f8('0x81')]);for(var _0x14a5b5=0x0;_0x14a5b5<_0x1dba7e[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x14a5b5+=0x1){if(_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x3478e8,_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x37')])&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x83')]&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')]&&_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x85')]){_0x3a2362[_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]](_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')]('%s.%s\x20=\x20%s.%s',_0x1dba7e[_0xa3f8('0x79')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x83')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x84')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5]['foreignKey']));}}}if(_0x1dba7e[_0xa3f8('0x86')]){_0x1dba7e[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1dba7e['conditions']);_0x3a2362[_0xa3f8('0x47')](_0x42e3f8(_0x1dba7e['conditions'][_0xa3f8('0x6f')]));}_0x14508d=_0x3a2362['clone']();_0x3a2362['limit'](_0x36eac9);_0x3a2362[_0xa3f8('0x20')](0x0);logger['debug'](_0xa3f8('0x87'),_0x3a2362['toString']());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3a2362[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](respondWithResult(_0x48f5a6,null))['catch'](handleError(_0x48f5a6,null));};function runReport(_0x3187e0,_0xd0d568,_0x3715ea){var _0x345089=_0xd0d568[_0xa3f8('0x31')];var _0x20ae51=0xa;var _0x190ce8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x7dc5ec={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2e2d99={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x599484=function(_0x24fe62){return!_[_0xa3f8('0x68')]([_0xa3f8('0x8c'),_0xa3f8('0x69'),'IS\x20EMPTY',_0xa3f8('0x6b')],_0x24fe62);};var _0x427830=function(_0x3c5091){if(!_0x3c5091||!_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x2db7dd='(',_0x12fe03=0x0;_0x12fe03<_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')];_0x12fe03+=0x1){_0x12fe03>0x0&&(_0x2db7dd+='\x20'+_0x3c5091[_0xa3f8('0x6e')]+'\x20');_0x2db7dd+=_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']?_0x427830(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']):_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x70')]+'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')]+(_0x599484(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')])?'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x71')]:'');}return _0x2db7dd+')';};var _0x4bb7dd={'where':{'id':_0x3187e0['id']}},_0x2c6efe,_0x4f9513,_0x39bd5c,_0x52fcc3,_0x2d2883;_0x4bb7dd=_['merge']({},_0x4bb7dd,_0x3715ea);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x4bb7dd)[_0xa3f8('0x2b')](function(_0xe3cc6a){if(_0xe3cc6a){_0x2c6efe=_0xe3cc6a;return _0xe3cc6a['getFields']();}return null;})[_0xa3f8('0x2b')](function(_0x3d343f){if(_0x3d343f){if(!_0x3d343f[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f9513=_0x3d343f;return db['AnalyticMetric'][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0xbe1a54){if(_0xbe1a54){_0x39bd5c=_[_0xa3f8('0x76')](_0xbe1a54,'id');var _0x477b0a;var _0x565a10=squel[_0xa3f8('0x77')]();_0x565a10[_0xa3f8('0x78')](_0x2c6efe['table']);for(var _0x4494a5=0x0;_0x4494a5<_0x4f9513[_0xa3f8('0x6d')];_0x4494a5+=0x1){_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7a')]?_0x39bd5c[_0x4f9513[_0x4494a5]['MetricId']][_0xa3f8('0x8f')]:_0x4f9513[_0x4494a5][_0xa3f8('0x70')];_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x7dc5ec[_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]],'%s',_0x477b0a):_0x477b0a;_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x2e2d99[_0x4f9513[_0x4494a5]['format']],'%s',_0x477b0a):_0x477b0a;if(_0x4f9513[_0x4494a5][_0xa3f8('0x7e')]){_0x565a10[_0xa3f8('0x6f')](_0x477b0a);}_0x4f9513[_0x4494a5]['orderBy']&&_0x565a10[_0xa3f8('0x3f')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x7f')]===_0xa3f8('0x90')?![]:!![]);_0x565a10[_0xa3f8('0x70')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x80')]||_0x477b0a);}if(_0x2c6efe[_0xa3f8('0x81')]){_0x2c6efe[_0xa3f8('0x81')]=JSON['parse'](_0x2c6efe[_0xa3f8('0x81')]);for(var _0x151bab=0x0;_0x151bab<_0x2c6efe[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x151bab+=0x1){if(_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x190ce8,_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')])&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')]&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable']&&_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x85')]){_0x565a10[_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')]](_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x84')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2c6efe[_0xa3f8('0x79')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable'],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignKey']));}}}if(_0x2c6efe[_0xa3f8('0x86')]){_0x2c6efe[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x2c6efe['conditions']);_0x565a10['where'](_0x427830(_0x2c6efe['conditions'][_0xa3f8('0x6f')]));}_0x2d2883=_0x565a10[_0xa3f8('0x91')]();_0x565a10[_0xa3f8('0x22')](_0x20ae51);_0x565a10[_0xa3f8('0x20')](0x0);return;}})[_0xa3f8('0x2b')](function(){if(_0xd0d568[_0xa3f8('0x92')]===_0xa3f8('0x93')){return null;}var _0x18890e=_['merge'](_0xd0d568,{'name':_0xd0d568[_0xa3f8('0x94')]||_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe[_0xa3f8('0x31')],'basename':_0x345089,'savename':util['format'](_0xa3f8('0x95'),_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe['name'],require(_0xa3f8('0x96'))[_0xa3f8('0x97')](0x4),_0xd0d568['output']||_0xa3f8('0x98')),'reportId':_0x2c6efe['id'],'reportType':_0xa3f8('0x99')});return db['AnalyticExtractedReport'][_0xa3f8('0x4d')](_0x18890e,{'raw':!![]});})[_0xa3f8('0x2b')](function(_0x21cc1d){if(_0x2c6efe['table']===_0xa3f8('0x9a')){_0x2d2883[_0xa3f8('0x47')](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9b'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568['endDate']);}else{_0x2d2883['where'](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9d'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568[_0xa3f8('0x9e')]);}if(_0x21cc1d){logger['info'](_0xa3f8('0x9f'),_0x2d2883[_0xa3f8('0x89')]());require(_0xa3f8('0xa0'))[_0xa3f8('0xa1')](path[_0xa3f8('0x59')](__dirname,_0xa3f8('0xa2'),_0x21cc1d[_0xa3f8('0x92')]),[_0x21cc1d['id'],_0x2d2883[_0xa3f8('0x89')](),path['join'](__dirname,_0xa3f8('0xa3'),_0x21cc1d['savename']),_0x345089]);return _0x21cc1d;}else{var _0xe9842=squel['select']();_0xe9842['from']('('+_0x2d2883[_0xa3f8('0x89')]()+')',_0xa3f8('0xa4'));_0xe9842[_0xa3f8('0x70')](_0xa3f8('0xa5'),_0xa3f8('0x23'));_0x2d2883['limit'](_0xd0d568['limit']||_0x20ae51);_0x2d2883[_0xa3f8('0x20')](_0xd0d568[_0xa3f8('0x20')]||0x0);return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0xe9842[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]})[_0xa3f8('0x2b')](function(_0x5a4f4a){if(!_0x5a4f4a['length']){_0x52fcc3=0x0;}else{_0x52fcc3=_0x5a4f4a[0x0][_0xa3f8('0x23')]||0x0;}return dbH[_0xa3f8('0x88')]['query'](_0x2d2883[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});})[_0xa3f8('0x2b')](function(_0x52f592){return{'rows':_0x52f592||[],'count':_0x52fcc3};});}});}exports[_0xa3f8('0xa7')]=function(_0x59026b,_0x234636){return runReport(_0x59026b[_0xa3f8('0x4c')],_0x59026b['query'],_0x59026b['options'])[_0xa3f8('0x2b')](respondWithResult(_0x234636,null))[_0xa3f8('0x4a')](handleError(_0x234636,null));};exports[_0xa3f8('0xa8')]=runReport;exports[_0xa3f8('0x3e')]=function(_0x26ec07,_0x2c9db8){var _0x18ab67=0xa;var _0x1f21a2=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x15a11c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x481b70={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x1f776a=function(_0x5b1527){return!_['includes']([_0xa3f8('0x8c'),_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x5b1527);};var _0x4670cc=function(_0xfde509){if(!_0xfde509||!_0xfde509['rules']['length']){return'';}for(var _0x3d81fe='(',_0x15111a=0x0;_0x15111a<_0xfde509[_0xa3f8('0x6c')]['length'];_0x15111a+=0x1){_0x15111a>0x0&&(_0x3d81fe+='\x20'+_0xfde509[_0xa3f8('0x6e')]+'\x20');_0x3d81fe+=_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']?_0x4670cc(_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']):_0xfde509[_0xa3f8('0x6c')][_0x15111a]['field']+'\x20'+_0xfde509['rules'][_0x15111a][_0xa3f8('0x8d')]+(_0x1f776a(_0xfde509[_0xa3f8('0x6c')][_0x15111a][_0xa3f8('0x8d')])?'\x20'+_0xfde509[_0xa3f8('0x6c')][_0x15111a]['value']:'');}return _0x3d81fe+')';};var _0x2e694e={'where':{'id':_0x26ec07[_0xa3f8('0x4c')]['id']}},_0x1669be,_0x4f248f,_0x6ef1ad,_0xae3a31,_0x31d45c;_0x2e694e=_[_0xa3f8('0x44')]({},_0x2e694e,_0x26ec07[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x2e694e)[_0xa3f8('0x2b')](function(_0x529021){if(_0x529021){_0x1669be=_0x529021;return _0x529021[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x35c498){if(_0x35c498){if(!_0x35c498[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f248f=_0x35c498;return db[_0xa3f8('0x75')]['findAll']({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x286490){if(_0x286490){_0x6ef1ad=_['keyBy'](_0x286490,'id');var _0x16e98d;var _0x3be5c9=squel['select']();_0x3be5c9[_0xa3f8('0x78')](_0x1669be[_0xa3f8('0x79')]);for(var _0x5260e0=0x0;_0x5260e0<_0x4f248f[_0xa3f8('0x6d')];_0x5260e0+=0x1){_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7a')]?_0x6ef1ad[_0x4f248f[_0x5260e0]['MetricId']][_0xa3f8('0x8f')]:_0x4f248f[_0x5260e0][_0xa3f8('0x70')];_0x16e98d=_0x4f248f[_0x5260e0]['function']?_['replace'](_0x15a11c[_0x4f248f[_0x5260e0][_0xa3f8('0x7b')]],'%s',_0x16e98d):_0x16e98d;_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x481b70[_0x4f248f[_0x5260e0]['format']],'%s',_0x16e98d):_0x16e98d;if(_0x4f248f[_0x5260e0]['groupBy']){_0x3be5c9[_0xa3f8('0x6f')](_0x16e98d);}_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]&&_0x3be5c9['order'](_0x16e98d,_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3be5c9[_0xa3f8('0x70')](_0x16e98d,_0x4f248f[_0x5260e0]['alias']||_0x16e98d);}if(_0x1669be[_0xa3f8('0x81')]){_0x1669be['joins']=JSON['parse'](_0x1669be[_0xa3f8('0x81')]);for(var _0x5ac693=0x0;_0x5ac693<_0x1669be[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x5ac693+=0x1){if(_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x1f21a2,_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')])&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')]&&_0x1669be['joins'][_0x5ac693][_0xa3f8('0x84')]&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]){_0x3be5c9[_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]](_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')](_0xa3f8('0xa9'),_0x1669be[_0xa3f8('0x79')],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')],_0x1669be[_0xa3f8('0x81')][_0x5ac693]['foreignTable'],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]));}}}if(_0x1669be[_0xa3f8('0x86')]){_0x1669be[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1669be[_0xa3f8('0x86')]);_0x3be5c9['where'](_0x4670cc(_0x1669be[_0xa3f8('0x86')][_0xa3f8('0x6f')]));}_0x31d45c=_0x3be5c9[_0xa3f8('0x91')]();_0x3be5c9[_0xa3f8('0x22')](_0x18ab67);_0x3be5c9[_0xa3f8('0x20')](0x0);logger[_0xa3f8('0xaa')](_0xa3f8('0x87'),_0x3be5c9[_0xa3f8('0x89')]());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3be5c9[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](function(){return{'sql':_0x31d45c[_0xa3f8('0x89')]()};})[_0xa3f8('0x2b')](respondWithResult(_0x2c9db8,null))[_0xa3f8('0x4a')](handleError(_0x2c9db8,null));};
\ No newline at end of file
+var _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x2c3f37,_0x5a46b6){var _0x12a453=function(_0x506351){while(--_0x506351){_0x2c3f37['push'](_0x2c3f37['shift']());}};_0x12a453(++_0x5a46b6);}(_0x4819,0xcd));var _0x9481=function(_0x27e321,_0x222eb5){_0x27e321=_0x27e321-0x0;var _0x19ac6c=_0x4819[_0x27e321];return _0x19ac6c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 4edb641..6bc8b9e 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 _0x9110=['AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x5c6c2e,_0x86e980){var _0xd262ac=function(_0x2469a1){while(--_0x2469a1){_0x5c6c2e['push'](_0x5c6c2e['shift']());}};_0xd262ac(++_0x86e980);}(_0x9110,0x138));var _0x0911=function(_0x535336,_0x910777){_0x535336=_0x535336-0x0;var _0xd9ca7e=_0x9110[_0x535336];return _0xd9ca7e;};'use strict';var _=require('lodash');var util=require(_0x0911('0x0'));var logger=require(_0x0911('0x1'))(_0x0911('0x2'));var moment=require(_0x0911('0x3'));var BPromise=require(_0x0911('0x4'));var rp=require(_0x0911('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0911('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x0911('0x7')]=function(_0x7afff1,_0x99bf51){return _0x7afff1['define'](_0x0911('0x8'),attributes,{'tableName':_0x0911('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc253=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc253,0x1ad));var _0x3c25=function(_0x2bfd4f,_0x1bbf2c){_0x2bfd4f=_0x2bfd4f-0x0;var _0x341849=_0xc253[_0x2bfd4f];return _0x341849;};'use strict';var _=require(_0x3c25('0x0'));var util=require('util');var logger=require(_0x3c25('0x1'))(_0x3c25('0x2'));var moment=require('moment');var BPromise=require(_0x3c25('0x3'));var rp=require(_0x3c25('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c25('0x5'));var config=require(_0x3c25('0x6'));var attributes=require(_0x3c25('0x7'));module['exports']=function(_0x553435,_0x5754c5){return _0x553435[_0x3c25('0x8')](_0x3c25('0x9'),attributes,{'tableName':_0x3c25('0xa'),'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 bc709df..dcec7b8 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 _0x26ad=['jayson/promise','client','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x26ad,0x67));var _0xd26a=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0x26ad[_0x1b6311];return _0x25aab6;};'use strict';var _=require(_0xd26a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd26a('0x1'));var rs=require(_0xd26a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd26a('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd26a('0x4'));var config=require('../../config/environment');var jayson=require(_0xd26a('0x5'));var client=jayson[_0xd26a('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x392b13,_0x63be48,_0x34406b){return new BPromise(function(_0x2c619e,_0x132a51){return client['request'](_0x392b13,_0x34406b)['then'](function(_0x3f09d4){logger[_0xd26a('0x7')](_0xd26a('0x8'),_0x63be48,'request\x20sent');logger[_0xd26a('0x9')](_0xd26a('0xa'),_0x63be48,_0xd26a('0xb'),JSON[_0xd26a('0xc')](_0x3f09d4));if(_0x3f09d4[_0xd26a('0xd')]){if(_0x3f09d4[_0xd26a('0xd')][_0xd26a('0xe')]===0x1f4){logger['error'](_0xd26a('0x8'),_0x63be48,_0x3f09d4[_0xd26a('0xd')]['message']);return _0x132a51(_0x3f09d4['error'][_0xd26a('0xf')]);}logger['error'](_0xd26a('0x8'),_0x63be48,_0x3f09d4['error'][_0xd26a('0xf')]);return _0x2c619e(_0x3f09d4[_0xd26a('0xd')][_0xd26a('0xf')]);}else{logger['info'](_0xd26a('0x8'),_0x63be48,_0xd26a('0xb'));_0x2c619e(_0x3f09d4[_0xd26a('0x10')][_0xd26a('0xf')]);}})[_0xd26a('0x11')](function(_0x15b57a){logger[_0xd26a('0xd')](_0xd26a('0x8'),_0x63be48,_0x15b57a);_0x132a51(_0x15b57a);});});}
\ No newline at end of file
+var _0x02cd=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment'];(function(_0x5d5cc4,_0x3afa99){var _0x28caff=function(_0x3295b7){while(--_0x3295b7){_0x5d5cc4['push'](_0x5d5cc4['shift']());}};_0x28caff(++_0x3afa99);}(_0x02cd,0x14f));var _0xd02c=function(_0x26d26f,_0x302cce){_0x26d26f=_0x26d26f-0x0;var _0x5c8c0e=_0x02cd[_0x26d26f];return _0x5c8c0e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd02c('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd02c('0x1'));var db=require(_0xd02c('0x2'))['db'];var utils=require(_0xd02c('0x3'));var logger=require(_0xd02c('0x4'))(_0xd02c('0x5'));var config=require(_0xd02c('0x6'));var jayson=require(_0xd02c('0x7'));var client=jayson[_0xd02c('0x8')][_0xd02c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b5d16,_0x4d1fea,_0x107650){return new BPromise(function(_0x2aeb36,_0x5a6035){return client['request'](_0x2b5d16,_0x107650)[_0xd02c('0xa')](function(_0x24d642){logger[_0xd02c('0xb')](_0xd02c('0xc'),_0x4d1fea,_0xd02c('0xd'));logger['debug'](_0xd02c('0xe'),_0x4d1fea,_0xd02c('0xd'),JSON[_0xd02c('0xf')](_0x24d642));if(_0x24d642[_0xd02c('0x10')]){if(_0x24d642['error'][_0xd02c('0x11')]===0x1f4){logger[_0xd02c('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4d1fea,_0x24d642[_0xd02c('0x10')][_0xd02c('0x12')]);return _0x5a6035(_0x24d642[_0xd02c('0x10')][_0xd02c('0x12')]);}logger[_0xd02c('0x10')](_0xd02c('0xc'),_0x4d1fea,_0x24d642['error'][_0xd02c('0x12')]);return _0x2aeb36(_0x24d642[_0xd02c('0x10')][_0xd02c('0x12')]);}else{logger[_0xd02c('0xb')](_0xd02c('0xc'),_0x4d1fea,_0xd02c('0xd'));_0x2aeb36(_0x24d642[_0xd02c('0x13')][_0xd02c('0x12')]);}})[_0xd02c('0x14')](function(_0x3bf310){logger[_0xd02c('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4d1fea,_0x3bf310);_0x5a6035(_0x3bf310);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index af0611a..13e9dcd 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 _0xe02a=['../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','query','post','create','put','update','destroy','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x26b00e,_0x245a09){var _0x3764c3=function(_0x30fe77){while(--_0x30fe77){_0x26b00e['push'](_0x26b00e['shift']());}};_0x3764c3(++_0x245a09);}(_0xe02a,0xa3));var _0xae02=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe02a[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xae02('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xae02('0x1')]();var fs_extra=require(_0xae02('0x2'));var auth=require(_0xae02('0x3'));var interaction=require(_0xae02('0x4'));var config=require(_0xae02('0x5'));var controller=require(_0xae02('0x6'));router[_0xae02('0x7')]('/',auth[_0xae02('0x8')](),controller[_0xae02('0x9')]);router[_0xae02('0x7')](_0xae02('0xa'),auth[_0xae02('0x8')](),controller[_0xae02('0xb')]);router[_0xae02('0x7')](_0xae02('0xc'),auth[_0xae02('0x8')](),controller[_0xae02('0xd')]);router[_0xae02('0x7')](_0xae02('0xe'),auth[_0xae02('0x8')](),controller['run']);router[_0xae02('0x7')]('/:id/query',auth['isAuthenticated'](),controller[_0xae02('0xf')]);router[_0xae02('0x10')]('/',auth['isAuthenticated'](),controller[_0xae02('0x11')]);router[_0xae02('0x12')](_0xae02('0xa'),auth['isAuthenticated'](),controller[_0xae02('0x13')]);router['delete'](_0xae02('0xa'),auth[_0xae02('0x8')](),controller[_0xae02('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xc4a7=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put'];(function(_0x18b00e,_0x10d9ff){var _0x38de29=function(_0xf04d4){while(--_0xf04d4){_0x18b00e['push'](_0x18b00e['shift']());}};_0x38de29(++_0x10d9ff);}(_0xc4a7,0x163));var _0x7c4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4a7[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x7c4a('0x0'));var util=require(_0x7c4a('0x1'));var path=require(_0x7c4a('0x2'));var timeout=require(_0x7c4a('0x3'));var express=require('express');var router=express[_0x7c4a('0x4')]();var fs_extra=require(_0x7c4a('0x5'));var auth=require(_0x7c4a('0x6'));var interaction=require(_0x7c4a('0x7'));var config=require(_0x7c4a('0x8'));var controller=require(_0x7c4a('0x9'));router[_0x7c4a('0xa')]('/',auth[_0x7c4a('0xb')](),controller[_0x7c4a('0xc')]);router[_0x7c4a('0xa')](_0x7c4a('0xd'),auth[_0x7c4a('0xb')](),controller[_0x7c4a('0xe')]);router[_0x7c4a('0xa')](_0x7c4a('0xf'),auth[_0x7c4a('0xb')](),controller[_0x7c4a('0x10')]);router['get']('/:id/run',auth[_0x7c4a('0xb')](),controller[_0x7c4a('0x11')]);router['get'](_0x7c4a('0x12'),auth[_0x7c4a('0xb')](),controller[_0x7c4a('0x13')]);router[_0x7c4a('0x14')]('/',auth[_0x7c4a('0xb')](),controller[_0x7c4a('0x15')]);router[_0x7c4a('0x16')](_0x7c4a('0xd'),auth[_0x7c4a('0xb')](),controller[_0x7c4a('0x17')]);router[_0x7c4a('0x18')](_0x7c4a('0xd'),auth['isAuthenticated'](),controller[_0x7c4a('0x19')]);module[_0x7c4a('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index dd2b2b6..be6a04a 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 _0xed7a=['Loading','ENUM','manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xed7a,0xe2));var _0xaed7=function(_0x4bb898,_0x2b77eb){_0x4bb898=_0x4bb898-0x0;var _0x459657=_0xed7a[_0x4bb898];return _0x459657;};'use strict';var Sequelize=require(_0xaed7('0x0'));var moment=require(_0xaed7('0x1'));module[_0xaed7('0x2')]={'name':{'type':Sequelize[_0xaed7('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xaed7('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xaed7('0x4'),_0xaed7('0x5'),_0xaed7('0x6')),'allowNull':![],'defaultValue':_0xaed7('0x4')},'savename':{'type':Sequelize[_0xaed7('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xaed7('0x7')]},'status':{'type':Sequelize[_0xaed7('0x3')],'defaultValue':_0xaed7('0x8')},'type':{'type':Sequelize[_0xaed7('0x9')](_0xaed7('0xa'),_0xaed7('0xb')),'allowNull':![],'defaultValue':_0xaed7('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xaed7('0xc')]},'reportType':{'type':Sequelize[_0xaed7('0x3')]}};
\ No newline at end of file
+var _0x93a2=['UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled','INTEGER'];(function(_0x328486,_0x49e7e1){var _0x26cf8a=function(_0x577b6e){while(--_0x577b6e){_0x328486['push'](_0x328486['shift']());}};_0x26cf8a(++_0x49e7e1);}(_0x93a2,0x175));var _0x293a=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0x93a2[_0x2c1dcd];return _0x158ce5;};'use strict';var Sequelize=require(_0x293a('0x0'));var moment=require('moment');module[_0x293a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x293a('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x293a('0x3')](_0x293a('0x4'),_0x293a('0x5'),_0x293a('0x6')),'allowNull':![],'defaultValue':_0x293a('0x4')},'savename':{'type':Sequelize[_0x293a('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x293a('0x7')]},'status':{'type':Sequelize[_0x293a('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x293a('0x8'),_0x293a('0x9')),'allowNull':![],'defaultValue':_0x293a('0x8')},'reportId':{'type':Sequelize[_0x293a('0xa')](0xb)[_0x293a('0xb')]},'reportType':{'type':Sequelize[_0x293a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 7d4f358..a13cff6 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 _0x984c=['offset','undefined','limit','count','set','Content-Range','apply','save','update','then','ExtractedReports','UserProfileResource','destroy','sendStatus','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','includeAll','findAll','rows','catch','include','options','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','create','body','params','basename','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','exists','download','format','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x984c,0xa8));var _0xc984=function(_0x11f247,_0x577d13){_0x11f247=_0x11f247-0x0;var _0x38828b=_0x984c[_0x11f247];return _0x38828b;};'use strict';var emlformat=require(_0xc984('0x0'));var rimraf=require(_0xc984('0x1'));var zipdir=require(_0xc984('0x2'));var jsonpatch=require(_0xc984('0x3'));var rp=require(_0xc984('0x4'));var moment=require(_0xc984('0x5'));var BPromise=require(_0xc984('0x6'));var Mustache=require(_0xc984('0x7'));var util=require(_0xc984('0x8'));var path=require(_0xc984('0x9'));var sox=require(_0xc984('0xa'));var csv=require(_0xc984('0xb'));var ejs=require(_0xc984('0xc'));var fs=require('fs');var fs_extra=require(_0xc984('0xd'));var _=require(_0xc984('0xe'));var squel=require(_0xc984('0xf'));var crypto=require(_0xc984('0x10'));var jsforce=require(_0xc984('0x11'));var deskjs=require(_0xc984('0x12'));var toCsv=require('to-csv');var querystring=require(_0xc984('0x13'));var Papa=require('papaparse');var Redis=require(_0xc984('0x14'));var authService=require(_0xc984('0x15'));var qs=require(_0xc984('0x16'));var as=require(_0xc984('0x17'));var hardwareService=require(_0xc984('0x18'));var logger=require(_0xc984('0x19'))(_0xc984('0x1a'));var utils=require(_0xc984('0x1b'));var config=require(_0xc984('0x1c'));var licenseUtil=require(_0xc984('0x1d'));var db=require(_0xc984('0x1e'))['db'];function respondWithStatusCode(_0x266837,_0xe35bb1){_0xe35bb1=_0xe35bb1||0xcc;return function(_0x34fb1e){if(_0x34fb1e){return _0x266837['sendStatus'](_0xe35bb1);}return _0x266837[_0xc984('0x1f')](_0xe35bb1)[_0xc984('0x20')]();};}function respondWithResult(_0x4c62ab,_0x40fd89){_0x40fd89=_0x40fd89||0xc8;return function(_0x2b0a4a){if(_0x2b0a4a){return _0x4c62ab[_0xc984('0x1f')](_0x40fd89)[_0xc984('0x21')](_0x2b0a4a);}};}function respondWithFilteredResult(_0x205ad2,_0x3f331d){return function(_0x572e38){if(_0x572e38){var _0x34a192=typeof _0x3f331d[_0xc984('0x22')]===_0xc984('0x23')&&typeof _0x3f331d[_0xc984('0x24')]==='undefined';var _0x4bedca=_0x572e38[_0xc984('0x25')];var _0x2d5a20=_0x34a192?0x0:_0x3f331d[_0xc984('0x22')];var _0x38f4eb=_0x34a192?_0x572e38[_0xc984('0x25')]:_0x3f331d[_0xc984('0x22')]+_0x3f331d[_0xc984('0x24')];var _0x2c25e6;if(_0x38f4eb>=_0x4bedca){_0x38f4eb=_0x4bedca;_0x2c25e6=0xc8;}else{_0x2c25e6=0xce;}_0x205ad2[_0xc984('0x1f')](_0x2c25e6);return _0x205ad2[_0xc984('0x26')](_0xc984('0x27'),_0x2d5a20+'-'+_0x38f4eb+'/'+_0x4bedca)[_0xc984('0x21')](_0x572e38);}return null;};}function patchUpdates(_0x39379b){return function(_0x311de0){try{jsonpatch[_0xc984('0x28')](_0x311de0,_0x39379b,!![]);}catch(_0xcbad8f){return BPromise['reject'](_0xcbad8f);}return _0x311de0[_0xc984('0x29')]();};}function saveUpdates(_0x4b52a7,_0x48dd5d){return function(_0x48f780){if(_0x48f780){return _0x48f780[_0xc984('0x2a')](_0x4b52a7)['then'](function(_0x4908b2){return _0x4908b2;});}return null;};}function removeEntity(_0x59ca3a,_0x4832f0){return function(_0x488af4){if(_0x488af4){return _0x488af4['destroy']()[_0xc984('0x2b')](function(){var _0x1f9474=_0x488af4['get']({'plain':!![]});var _0x20551f=_0xc984('0x2c');return db[_0xc984('0x2d')][_0xc984('0x2e')]({'where':{'type':_0x20551f,'resourceId':_0x1f9474['id']}})[_0xc984('0x2b')](function(){return _0x488af4;});})['then'](function(){_0x59ca3a['status'](0xcc)[_0xc984('0x20')]();});}};}function handleEntityNotFound(_0x2d54d4,_0x2c422e){return function(_0x24025b){if(!_0x24025b){_0x2d54d4[_0xc984('0x2f')](0x194);}return _0x24025b;};}function handleError(_0x334740,_0x512051){_0x512051=_0x512051||0x1f4;return function(_0x17168a){logger['error'](_0x17168a['stack']);if(_0x17168a[_0xc984('0x30')]){delete _0x17168a[_0xc984('0x30')];}_0x334740[_0xc984('0x1f')](_0x512051)[_0xc984('0x31')](_0x17168a);};}exports[_0xc984('0x32')]=function(_0x90ab61,_0x1e9c4e){var _0x2f6e41={},_0x5b77b6={},_0x1c83f1={'count':0x0,'rows':[]};var _0x183995=_[_0xc984('0x33')](db[_0xc984('0x34')][_0xc984('0x35')],function(_0x558c9e){return{'name':_0x558c9e[_0xc984('0x36')],'type':_0x558c9e[_0xc984('0x37')][_0xc984('0x38')]};});_0x5b77b6['model']=_['map'](_0x183995,_0xc984('0x30'));_0x5b77b6[_0xc984('0x39')]=_[_0xc984('0x3a')](_0x90ab61[_0xc984('0x39')]);_0x5b77b6['filters']=_[_0xc984('0x3b')](_0x5b77b6[_0xc984('0x3c')],_0x5b77b6[_0xc984('0x39')]);_0x2f6e41['attributes']=_[_0xc984('0x3b')](_0x5b77b6[_0xc984('0x3c')],qs[_0xc984('0x3d')](_0x90ab61[_0xc984('0x39')][_0xc984('0x3d')]));_0x2f6e41[_0xc984('0x3e')]=_0x2f6e41[_0xc984('0x3e')][_0xc984('0x3f')]?_0x2f6e41[_0xc984('0x3e')]:_0x5b77b6[_0xc984('0x3c')];if(!_0x90ab61[_0xc984('0x39')][_0xc984('0x40')](_0xc984('0x41'))){_0x2f6e41[_0xc984('0x24')]=qs[_0xc984('0x24')](_0x90ab61[_0xc984('0x39')][_0xc984('0x24')]);_0x2f6e41[_0xc984('0x22')]=qs[_0xc984('0x22')](_0x90ab61[_0xc984('0x39')]['offset']);}_0x2f6e41[_0xc984('0x42')]=qs['sort'](_0x90ab61['query']['sort']);_0x2f6e41['where']=qs[_0xc984('0x43')](_[_0xc984('0x44')](_0x90ab61[_0xc984('0x39')],_0x5b77b6[_0xc984('0x43')]),_0x183995);if(_0x90ab61[_0xc984('0x39')][_0xc984('0x45')]){_0x2f6e41[_0xc984('0x46')]=_[_0xc984('0x47')](_0x2f6e41[_0xc984('0x46')],{'$or':_[_0xc984('0x33')](_0x183995,function(_0x3275a2){if(_0x3275a2[_0xc984('0x37')]!=='VIRTUAL'){var _0xa4ef18={};_0xa4ef18[_0x3275a2['name']]={'$like':'%'+_0x90ab61[_0xc984('0x39')]['filter']+'%'};return _0xa4ef18;}})});}_0x2f6e41=_[_0xc984('0x47')]({},_0x2f6e41,_0x90ab61['options']);var _0x28a6f1={'where':_0x2f6e41[_0xc984('0x46')]};return db['AnalyticExtractedReport'][_0xc984('0x25')](_0x28a6f1)['then'](function(_0x370953){_0x1c83f1[_0xc984('0x25')]=_0x370953;if(_0x90ab61[_0xc984('0x39')][_0xc984('0x48')]){_0x2f6e41['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xc984('0x49')](_0x2f6e41);})[_0xc984('0x2b')](function(_0x30f1f3){_0x1c83f1[_0xc984('0x4a')]=_0x30f1f3;return _0x1c83f1;})[_0xc984('0x2b')](respondWithFilteredResult(_0x1e9c4e,_0x2f6e41))[_0xc984('0x4b')](handleError(_0x1e9c4e,null));};exports['show']=function(_0x501e3f,_0x3468fb){var _0x3726a9={'raw':!![],'where':{'id':_0x501e3f['params']['id']}},_0x867121={};_0x867121['model']=_[_0xc984('0x3a')](db[_0xc984('0x34')][_0xc984('0x35')]);_0x867121[_0xc984('0x39')]=_[_0xc984('0x3a')](_0x501e3f[_0xc984('0x39')]);_0x867121[_0xc984('0x43')]=_[_0xc984('0x3b')](_0x867121[_0xc984('0x3c')],_0x867121[_0xc984('0x39')]);_0x3726a9[_0xc984('0x3e')]=_['intersection'](_0x867121[_0xc984('0x3c')],qs[_0xc984('0x3d')](_0x501e3f[_0xc984('0x39')][_0xc984('0x3d')]));_0x3726a9[_0xc984('0x3e')]=_0x3726a9[_0xc984('0x3e')][_0xc984('0x3f')]?_0x3726a9[_0xc984('0x3e')]:_0x867121[_0xc984('0x3c')];if(_0x501e3f[_0xc984('0x39')][_0xc984('0x48')]){_0x3726a9[_0xc984('0x4c')]=[{'all':!![]}];}_0x3726a9=_['merge']({},_0x3726a9,_0x501e3f[_0xc984('0x4d')]);return db[_0xc984('0x34')]['find'](_0x3726a9)[_0xc984('0x2b')](handleEntityNotFound(_0x3468fb,null))['then'](respondWithResult(_0x3468fb,null))[_0xc984('0x4b')](handleError(_0x3468fb,null));};exports['create']=function(_0x13bed9,_0x5dbd70){return db['AnalyticExtractedReport']['create'](_0x13bed9['body'],{})['then'](function(_0x18bc83){var _0x515c6d=_0x13bed9[_0xc984('0x4e')][_0xc984('0x4f')]({'plain':!![]});if(!_0x515c6d)throw new Error(_0xc984('0x50'));if(_0x515c6d[_0xc984('0x51')]==='user'){var _0x14ea16=_0x18bc83[_0xc984('0x4f')]({'plain':!![]});var _0x4641cb=_0xc984('0x2c');return db[_0xc984('0x52')][_0xc984('0x53')]({'where':{'name':_0x4641cb,'userProfileId':_0x515c6d['userProfileId']},'raw':!![]})[_0xc984('0x2b')](function(_0xa0e233){if(_0xa0e233&&_0xa0e233[_0xc984('0x54')]===0x0){return db[_0xc984('0x2d')][_0xc984('0x55')]({'name':_0x14ea16[_0xc984('0x30')],'resourceId':_0x14ea16['id'],'type':_0xa0e233['name'],'sectionId':_0xa0e233['id']},{})['then'](function(){return _0x18bc83;});}else{return _0x18bc83;}})[_0xc984('0x4b')](function(_0x2da0af){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2da0af);throw _0x2da0af;});}return _0x18bc83;})[_0xc984('0x2b')](respondWithResult(_0x5dbd70,0xc9))['catch'](handleError(_0x5dbd70,null));};exports[_0xc984('0x2a')]=function(_0x1f6b9c,_0x3c2ae7){if(_0x1f6b9c[_0xc984('0x56')]['id']){delete _0x1f6b9c[_0xc984('0x56')]['id'];}return db[_0xc984('0x34')][_0xc984('0x53')]({'where':{'id':_0x1f6b9c[_0xc984('0x57')]['id']}})[_0xc984('0x2b')](handleEntityNotFound(_0x3c2ae7,null))['then'](saveUpdates(_0x1f6b9c[_0xc984('0x56')],null))[_0xc984('0x2b')](respondWithResult(_0x3c2ae7,null))[_0xc984('0x4b')](handleError(_0x3c2ae7,null));};exports[_0xc984('0x2e')]=function(_0x124b69,_0x56fde1){return db[_0xc984('0x34')][_0xc984('0x53')]({'where':{'id':_0x124b69[_0xc984('0x57')]['id']}})['then'](handleEntityNotFound(_0x56fde1,null))[_0xc984('0x2b')](removeEntity(_0x56fde1,null))[_0xc984('0x4b')](handleError(_0x56fde1,null));};exports['download']=function(_0x14eb95,_0x4e7eac,_0x54af1f){return db[_0xc984('0x34')][_0xc984('0x53')]({'where':{'id':_0x14eb95['params']['id']},'attributes':[_0xc984('0x30'),_0xc984('0x58'),'savename','output'],'raw':!![]})['then'](handleEntityNotFound(_0x4e7eac,null))[_0xc984('0x2b')](function(_0x20aaab){if(_0x20aaab){if(!fs[_0xc984('0x59')](path[_0xc984('0x5a')](config[_0xc984('0x5b')],_0xc984('0x5c'),_0x20aaab[_0xc984('0x5d')]))){throw new db[(_0xc984('0x5e'))][(_0xc984('0x5f'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x14eb95['query'][_0xc984('0x60')]){return _0x4e7eac[_0xc984('0x2f')](0xc8);}return _0x4e7eac[_0xc984('0x61')](path[_0xc984('0x5a')](config['root'],_0xc984('0x5c'),_0x20aaab[_0xc984('0x5d')]),util[_0xc984('0x62')]('%s.%s',_0x20aaab[_0xc984('0x58')]||_0x20aaab[_0xc984('0x30')],_0x20aaab[_0xc984('0x63')][_0xc984('0x64')]()));}})[_0xc984('0x4b')](handleError(_0x4e7eac,null));};
\ No newline at end of file
+var _0xb5ea=['format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','where','merge','map','type','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','autoAssociation','catch','download','basename','savename','output','join','root','server/files/reports','Report\x20not\x20found\x20or\x20empty','exists'];(function(_0x54d49e,_0x5d9911){var _0x4af0f1=function(_0xf117b3){while(--_0xf117b3){_0x54d49e['push'](_0x54d49e['shift']());}};_0x4af0f1(++_0x5d9911);}(_0xb5ea,0x129));var _0xab5e=function(_0x22511f,_0x4281c9){_0x22511f=_0x22511f-0x0;var _0x4aba54=_0xb5ea[_0x22511f];return _0x4aba54;};'use strict';var emlformat=require(_0xab5e('0x0'));var rimraf=require(_0xab5e('0x1'));var zipdir=require(_0xab5e('0x2'));var jsonpatch=require(_0xab5e('0x3'));var rp=require(_0xab5e('0x4'));var moment=require(_0xab5e('0x5'));var BPromise=require(_0xab5e('0x6'));var Mustache=require(_0xab5e('0x7'));var util=require(_0xab5e('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xab5e('0x9'));var ejs=require(_0xab5e('0xa'));var fs=require('fs');var fs_extra=require(_0xab5e('0xb'));var _=require(_0xab5e('0xc'));var squel=require('squel');var crypto=require(_0xab5e('0xd'));var jsforce=require(_0xab5e('0xe'));var deskjs=require(_0xab5e('0xf'));var toCsv=require(_0xab5e('0x9'));var querystring=require(_0xab5e('0x10'));var Papa=require(_0xab5e('0x11'));var Redis=require('ioredis');var authService=require(_0xab5e('0x12'));var qs=require(_0xab5e('0x13'));var as=require(_0xab5e('0x14'));var hardwareService=require(_0xab5e('0x15'));var logger=require(_0xab5e('0x16'))(_0xab5e('0x17'));var utils=require(_0xab5e('0x18'));var config=require(_0xab5e('0x19'));var licenseUtil=require(_0xab5e('0x1a'));var db=require(_0xab5e('0x1b'))['db'];function respondWithStatusCode(_0x2c0ec4,_0x1d845a){_0x1d845a=_0x1d845a||0xcc;return function(_0x1cb793){if(_0x1cb793){return _0x2c0ec4[_0xab5e('0x1c')](_0x1d845a);}return _0x2c0ec4['status'](_0x1d845a)['end']();};}function respondWithResult(_0x3cf468,_0x3c376b){_0x3c376b=_0x3c376b||0xc8;return function(_0x4ebb2c){if(_0x4ebb2c){return _0x3cf468[_0xab5e('0x1d')](_0x3c376b)[_0xab5e('0x1e')](_0x4ebb2c);}};}function respondWithFilteredResult(_0xd85443,_0x458be5){return function(_0x54f94e){if(_0x54f94e){var _0x288cf1=typeof _0x458be5[_0xab5e('0x1f')]===_0xab5e('0x20')&&typeof _0x458be5[_0xab5e('0x21')]==='undefined';var _0x109786=_0x54f94e['count'];var _0x3b7f97=_0x288cf1?0x0:_0x458be5[_0xab5e('0x1f')];var _0x188a28=_0x288cf1?_0x54f94e['count']:_0x458be5[_0xab5e('0x1f')]+_0x458be5['limit'];var _0x2243e2;if(_0x188a28>=_0x109786){_0x188a28=_0x109786;_0x2243e2=0xc8;}else{_0x2243e2=0xce;}_0xd85443['status'](_0x2243e2);return _0xd85443['set'](_0xab5e('0x22'),_0x3b7f97+'-'+_0x188a28+'/'+_0x109786)['json'](_0x54f94e);}return null;};}function patchUpdates(_0x506e5b){return function(_0x572aa6){try{jsonpatch[_0xab5e('0x23')](_0x572aa6,_0x506e5b,!![]);}catch(_0x5b6abb){return BPromise[_0xab5e('0x24')](_0x5b6abb);}return _0x572aa6[_0xab5e('0x25')]();};}function saveUpdates(_0x11d6a5,_0x5aba4b){return function(_0x3d53dc){if(_0x3d53dc){return _0x3d53dc[_0xab5e('0x26')](_0x11d6a5)[_0xab5e('0x27')](function(_0x3c5917){return _0x3c5917;});}return null;};}function removeEntity(_0x4c970f,_0x4328e2){return function(_0x409ffe){if(_0x409ffe){return _0x409ffe[_0xab5e('0x28')]()[_0xab5e('0x27')](function(){var _0x52dd4d=_0x409ffe[_0xab5e('0x29')]({'plain':!![]});var _0x45090a='ExtractedReports';return db[_0xab5e('0x2a')][_0xab5e('0x28')]({'where':{'type':_0x45090a,'resourceId':_0x52dd4d['id']}})[_0xab5e('0x27')](function(){return _0x409ffe;});})[_0xab5e('0x27')](function(){_0x4c970f[_0xab5e('0x1d')](0xcc)[_0xab5e('0x2b')]();});}};}function handleEntityNotFound(_0x2ca131,_0x30acf8){return function(_0x4fbe61){if(!_0x4fbe61){_0x2ca131[_0xab5e('0x1c')](0x194);}return _0x4fbe61;};}function handleError(_0x5e9785,_0x1d2f8c){_0x1d2f8c=_0x1d2f8c||0x1f4;return function(_0x5224cc){logger[_0xab5e('0x2c')](_0x5224cc[_0xab5e('0x2d')]);if(_0x5224cc[_0xab5e('0x2e')]){delete _0x5224cc[_0xab5e('0x2e')];}_0x5e9785[_0xab5e('0x1d')](_0x1d2f8c)[_0xab5e('0x2f')](_0x5224cc);};}exports['index']=function(_0x41d3fc,_0xbe23e9){var _0x425483={},_0x2d567a={},_0x4047dd={'count':0x0,'rows':[]};var _0x45c71b=_['map'](db[_0xab5e('0x30')][_0xab5e('0x31')],function(_0x10650b){return{'name':_0x10650b[_0xab5e('0x32')],'type':_0x10650b['type'][_0xab5e('0x33')]};});_0x2d567a[_0xab5e('0x34')]=_['map'](_0x45c71b,_0xab5e('0x2e'));_0x2d567a[_0xab5e('0x35')]=_[_0xab5e('0x36')](_0x41d3fc[_0xab5e('0x35')]);_0x2d567a[_0xab5e('0x37')]=_[_0xab5e('0x38')](_0x2d567a[_0xab5e('0x34')],_0x2d567a[_0xab5e('0x35')]);_0x425483[_0xab5e('0x39')]=_[_0xab5e('0x38')](_0x2d567a[_0xab5e('0x34')],qs['fields'](_0x41d3fc[_0xab5e('0x35')][_0xab5e('0x3a')]));_0x425483[_0xab5e('0x39')]=_0x425483[_0xab5e('0x39')][_0xab5e('0x3b')]?_0x425483['attributes']:_0x2d567a[_0xab5e('0x34')];if(!_0x41d3fc[_0xab5e('0x35')]['hasOwnProperty']('nolimit')){_0x425483[_0xab5e('0x21')]=qs[_0xab5e('0x21')](_0x41d3fc[_0xab5e('0x35')]['limit']);_0x425483['offset']=qs[_0xab5e('0x1f')](_0x41d3fc[_0xab5e('0x35')][_0xab5e('0x1f')]);}_0x425483[_0xab5e('0x3c')]=qs[_0xab5e('0x3d')](_0x41d3fc[_0xab5e('0x35')]['sort']);_0x425483['where']=qs[_0xab5e('0x37')](_[_0xab5e('0x3e')](_0x41d3fc[_0xab5e('0x35')],_0x2d567a[_0xab5e('0x37')]),_0x45c71b);if(_0x41d3fc[_0xab5e('0x35')]['filter']){_0x425483[_0xab5e('0x3f')]=_[_0xab5e('0x40')](_0x425483[_0xab5e('0x3f')],{'$or':_[_0xab5e('0x41')](_0x45c71b,function(_0x408db1){if(_0x408db1[_0xab5e('0x42')]!==_0xab5e('0x43')){var _0xdad6f2={};_0xdad6f2[_0x408db1[_0xab5e('0x2e')]]={'$like':'%'+_0x41d3fc[_0xab5e('0x35')][_0xab5e('0x44')]+'%'};return _0xdad6f2;}})});}_0x425483=_['merge']({},_0x425483,_0x41d3fc[_0xab5e('0x45')]);var _0x25c78c={'where':_0x425483['where']};return db[_0xab5e('0x30')]['count'](_0x25c78c)[_0xab5e('0x27')](function(_0x10882e){_0x4047dd['count']=_0x10882e;if(_0x41d3fc[_0xab5e('0x35')][_0xab5e('0x46')]){_0x425483['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xab5e('0x47')](_0x425483);})[_0xab5e('0x27')](function(_0x1ec160){_0x4047dd[_0xab5e('0x48')]=_0x1ec160;return _0x4047dd;})['then'](respondWithFilteredResult(_0xbe23e9,_0x425483))['catch'](handleError(_0xbe23e9,null));};exports[_0xab5e('0x49')]=function(_0x1ebed2,_0x11e322){var _0x38f148={'raw':!![],'where':{'id':_0x1ebed2[_0xab5e('0x4a')]['id']}},_0x1a4abe={};_0x1a4abe[_0xab5e('0x34')]=_['keys'](db[_0xab5e('0x30')]['rawAttributes']);_0x1a4abe[_0xab5e('0x35')]=_[_0xab5e('0x36')](_0x1ebed2[_0xab5e('0x35')]);_0x1a4abe[_0xab5e('0x37')]=_[_0xab5e('0x38')](_0x1a4abe[_0xab5e('0x34')],_0x1a4abe[_0xab5e('0x35')]);_0x38f148['attributes']=_[_0xab5e('0x38')](_0x1a4abe['model'],qs[_0xab5e('0x3a')](_0x1ebed2[_0xab5e('0x35')][_0xab5e('0x3a')]));_0x38f148[_0xab5e('0x39')]=_0x38f148[_0xab5e('0x39')][_0xab5e('0x3b')]?_0x38f148[_0xab5e('0x39')]:_0x1a4abe[_0xab5e('0x34')];if(_0x1ebed2['query'][_0xab5e('0x46')]){_0x38f148[_0xab5e('0x4b')]=[{'all':!![]}];}_0x38f148=_[_0xab5e('0x40')]({},_0x38f148,_0x1ebed2[_0xab5e('0x45')]);return db['AnalyticExtractedReport'][_0xab5e('0x4c')](_0x38f148)['then'](handleEntityNotFound(_0x11e322,null))['then'](respondWithResult(_0x11e322,null))['catch'](handleError(_0x11e322,null));};exports[_0xab5e('0x4d')]=function(_0x3c8412,_0x37a0d9){return db[_0xab5e('0x30')][_0xab5e('0x4d')](_0x3c8412[_0xab5e('0x4e')],{})['then'](function(_0x3d978e){var _0x53c8a6=_0x3c8412[_0xab5e('0x4f')][_0xab5e('0x29')]({'plain':!![]});if(!_0x53c8a6)throw new Error(_0xab5e('0x50'));if(_0x53c8a6[_0xab5e('0x51')]===_0xab5e('0x4f')){var _0x2295ae=_0x3d978e[_0xab5e('0x29')]({'plain':!![]});var _0x321ef8=_0xab5e('0x52');return db[_0xab5e('0x53')][_0xab5e('0x4c')]({'where':{'name':_0x321ef8,'userProfileId':_0x53c8a6['userProfileId']},'raw':!![]})[_0xab5e('0x27')](function(_0x4dacbd){if(_0x4dacbd&&_0x4dacbd[_0xab5e('0x54')]===0x0){return db[_0xab5e('0x2a')][_0xab5e('0x4d')]({'name':_0x2295ae[_0xab5e('0x2e')],'resourceId':_0x2295ae['id'],'type':_0x4dacbd[_0xab5e('0x2e')],'sectionId':_0x4dacbd['id']},{})[_0xab5e('0x27')](function(){return _0x3d978e;});}else{return _0x3d978e;}})[_0xab5e('0x55')](function(_0x47a78a){logger[_0xab5e('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47a78a);throw _0x47a78a;});}return _0x3d978e;})[_0xab5e('0x27')](respondWithResult(_0x37a0d9,0xc9))[_0xab5e('0x55')](handleError(_0x37a0d9,null));};exports[_0xab5e('0x26')]=function(_0x2e5000,_0x5b9393){if(_0x2e5000[_0xab5e('0x4e')]['id']){delete _0x2e5000[_0xab5e('0x4e')]['id'];}return db[_0xab5e('0x30')]['find']({'where':{'id':_0x2e5000['params']['id']}})[_0xab5e('0x27')](handleEntityNotFound(_0x5b9393,null))[_0xab5e('0x27')](saveUpdates(_0x2e5000[_0xab5e('0x4e')],null))[_0xab5e('0x27')](respondWithResult(_0x5b9393,null))[_0xab5e('0x55')](handleError(_0x5b9393,null));};exports[_0xab5e('0x28')]=function(_0x4e289d,_0x38a194){return db[_0xab5e('0x30')][_0xab5e('0x4c')]({'where':{'id':_0x4e289d[_0xab5e('0x4a')]['id']}})[_0xab5e('0x27')](handleEntityNotFound(_0x38a194,null))[_0xab5e('0x27')](removeEntity(_0x38a194,null))[_0xab5e('0x55')](handleError(_0x38a194,null));};exports[_0xab5e('0x56')]=function(_0x42863f,_0x37ef31,_0x58fda3){return db['AnalyticExtractedReport'][_0xab5e('0x4c')]({'where':{'id':_0x42863f[_0xab5e('0x4a')]['id']},'attributes':['name',_0xab5e('0x57'),_0xab5e('0x58'),_0xab5e('0x59')],'raw':!![]})[_0xab5e('0x27')](handleEntityNotFound(_0x37ef31,null))[_0xab5e('0x27')](function(_0x4c42b1){if(_0x4c42b1){if(!fs['existsSync'](path[_0xab5e('0x5a')](config[_0xab5e('0x5b')],_0xab5e('0x5c'),_0x4c42b1['savename']))){throw new db['Sequelize']['ValidationError'](_0xab5e('0x5d'));}if(_0x42863f[_0xab5e('0x35')][_0xab5e('0x5e')]){return _0x37ef31[_0xab5e('0x1c')](0xc8);}return _0x37ef31[_0xab5e('0x56')](path[_0xab5e('0x5a')](config[_0xab5e('0x5b')],_0xab5e('0x5c'),_0x4c42b1[_0xab5e('0x58')]),util[_0xab5e('0x5f')](_0xab5e('0x60'),_0x4c42b1[_0xab5e('0x57')]||_0x4c42b1[_0xab5e('0x2e')],_0x4c42b1[_0xab5e('0x59')][_0xab5e('0x61')]()));}})[_0xab5e('0x55')](handleError(_0x37ef31,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 784ba09..57df535 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 _0xb9e0=['analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x54fe52,_0x35e901){var _0x24a0c4=function(_0x22b28d){while(--_0x22b28d){_0x54fe52['push'](_0x54fe52['shift']());}};_0x24a0c4(++_0x35e901);}(_0xb9e0,0x91));var _0x0b9e=function(_0x3a112c,_0x2830c7){_0x3a112c=_0x3a112c-0x0;var _0x24e770=_0xb9e0[_0x3a112c];return _0x24e770;};'use strict';var _=require(_0x0b9e('0x0'));var util=require('util');var logger=require(_0x0b9e('0x1'))(_0x0b9e('0x2'));var moment=require(_0x0b9e('0x3'));var BPromise=require(_0x0b9e('0x4'));var rp=require(_0x0b9e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0b9e('0x6'));var config=require('../../config/environment');var attributes=require(_0x0b9e('0x7'));module[_0x0b9e('0x8')]=function(_0x355c29,_0x1d41e5){return _0x355c29[_0x0b9e('0x9')](_0x0b9e('0xa'),attributes,{'tableName':_0x0b9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x286a=['./analyticExtractedReport.attributes','define','AnalyticExtractedReport','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x913b85,_0x213182){var _0x1ce434=function(_0x4c9c8b){while(--_0x4c9c8b){_0x913b85['push'](_0x913b85['shift']());}};_0x1ce434(++_0x213182);}(_0x286a,0xd4));var _0xa286=function(_0x5a2dd4,_0x6d8c3e){_0x5a2dd4=_0x5a2dd4-0x0;var _0x186df0=_0x286a[_0x5a2dd4];return _0x186df0;};'use strict';var _=require('lodash');var util=require(_0xa286('0x0'));var logger=require(_0xa286('0x1'))(_0xa286('0x2'));var moment=require(_0xa286('0x3'));var BPromise=require('bluebird');var rp=require(_0xa286('0x4'));var fs=require('fs');var path=require(_0xa286('0x5'));var rimraf=require(_0xa286('0x6'));var config=require(_0xa286('0x7'));var attributes=require(_0xa286('0x8'));module['exports']=function(_0x1de044,_0x4dd2a7){return _0x1de044[_0xa286('0x9')](_0xa286('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index f58049b..1ce72ba 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 _0x7dfc=['info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','AnalyticExtractedReport,\x20%s,\x20%s','error','message','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x24aa6f,_0xa57fb0){var _0x5e5595=function(_0x4f6e19){while(--_0x4f6e19){_0x24aa6f['push'](_0x24aa6f['shift']());}};_0x5e5595(++_0xa57fb0);}(_0x7dfc,0x197));var _0xc7df=function(_0x3756b1,_0x24c0d1){_0x3756b1=_0x3756b1-0x0;var _0x20fc7b=_0x7dfc[_0x3756b1];return _0x20fc7b;};'use strict';var _=require(_0xc7df('0x0'));var util=require(_0xc7df('0x1'));var moment=require('moment');var BPromise=require(_0xc7df('0x2'));var rs=require(_0xc7df('0x3'));var fs=require('fs');var Redis=require(_0xc7df('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc7df('0x5'));var logger=require(_0xc7df('0x6'))(_0xc7df('0x7'));var config=require(_0xc7df('0x8'));var jayson=require(_0xc7df('0x9'));var client=jayson[_0xc7df('0xa')][_0xc7df('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x328b78,_0x3b2d24,_0x4edd9f){return new BPromise(function(_0xfa11d9,_0xfbb8f4){return client['request'](_0x328b78,_0x4edd9f)[_0xc7df('0xc')](function(_0x2b56dd){logger[_0xc7df('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3b2d24,_0xc7df('0xe'));logger[_0xc7df('0xf')](_0xc7df('0x10'),_0x3b2d24,_0xc7df('0xe'),JSON[_0xc7df('0x11')](_0x2b56dd));if(_0x2b56dd['error']){if(_0x2b56dd['error']['code']===0x1f4){logger['error'](_0xc7df('0x12'),_0x3b2d24,_0x2b56dd['error']['message']);return _0xfbb8f4(_0x2b56dd['error']['message']);}logger['error'](_0xc7df('0x12'),_0x3b2d24,_0x2b56dd[_0xc7df('0x13')][_0xc7df('0x14')]);return _0xfa11d9(_0x2b56dd[_0xc7df('0x13')]['message']);}else{logger[_0xc7df('0xd')](_0xc7df('0x12'),_0x3b2d24,_0xc7df('0xe'));_0xfa11d9(_0x2b56dd['result'][_0xc7df('0x14')]);}})['catch'](function(_0x2428e4){logger[_0xc7df('0x13')](_0xc7df('0x12'),_0x3b2d24,_0x2428e4);_0xfbb8f4(_0x2428e4);});});}
\ No newline at end of file
+var _0x9aa3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9aa3,0x1bf));var _0x39aa=function(_0x9b0c9f,_0x15aeba){_0x9b0c9f=_0x9b0c9f-0x0;var _0x1cfd7a=_0x9aa3[_0x9b0c9f];return _0x1cfd7a;};'use strict';var _=require('lodash');var util=require(_0x39aa('0x0'));var moment=require(_0x39aa('0x1'));var BPromise=require(_0x39aa('0x2'));var rs=require(_0x39aa('0x3'));var fs=require('fs');var Redis=require(_0x39aa('0x4'));var db=require(_0x39aa('0x5'))['db'];var utils=require(_0x39aa('0x6'));var logger=require(_0x39aa('0x7'))(_0x39aa('0x8'));var config=require(_0x39aa('0x9'));var jayson=require(_0x39aa('0xa'));var client=jayson[_0x39aa('0xb')][_0x39aa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10f5da,_0xc4ca18,_0x5712d4){return new BPromise(function(_0x4bcaae,_0x2e7944){return client[_0x39aa('0xd')](_0x10f5da,_0x5712d4)[_0x39aa('0xe')](function(_0x30beae){logger['info'](_0x39aa('0xf'),_0xc4ca18,_0x39aa('0x10'));logger[_0x39aa('0x11')](_0x39aa('0x12'),_0xc4ca18,_0x39aa('0x10'),JSON[_0x39aa('0x13')](_0x30beae));if(_0x30beae[_0x39aa('0x14')]){if(_0x30beae['error']['code']===0x1f4){logger[_0x39aa('0x14')](_0x39aa('0xf'),_0xc4ca18,_0x30beae['error'][_0x39aa('0x15')]);return _0x2e7944(_0x30beae[_0x39aa('0x14')][_0x39aa('0x15')]);}logger['error'](_0x39aa('0xf'),_0xc4ca18,_0x30beae['error']['message']);return _0x4bcaae(_0x30beae[_0x39aa('0x14')][_0x39aa('0x15')]);}else{logger[_0x39aa('0x16')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xc4ca18,_0x39aa('0x10'));_0x4bcaae(_0x30beae[_0x39aa('0x17')][_0x39aa('0x15')]);}})[_0x39aa('0x18')](function(_0x75f5cd){logger[_0x39aa('0x14')](_0x39aa('0xf'),_0xc4ca18,_0x75f5cd);_0x2e7944(_0x75f5cd);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index c9e44ad..529316f 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 _0x8be3=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','/:id','isAuthenticated','show','/:id/download','download','create','put','destroy','exports','multer','util','path'];(function(_0x4dbdda,_0x11f07c){var _0x1acbf1=function(_0x1a9fc8){while(--_0x1a9fc8){_0x4dbdda['push'](_0x4dbdda['shift']());}};_0x1acbf1(++_0x11f07c);}(_0x8be3,0xe7));var _0x38be=function(_0x32659d,_0x58ece9){_0x32659d=_0x32659d-0x0;var _0x10d610=_0x8be3[_0x32659d];return _0x10d610;};'use strict';var multer=require(_0x38be('0x0'));var util=require(_0x38be('0x1'));var path=require(_0x38be('0x2'));var timeout=require(_0x38be('0x3'));var express=require('express');var router=express[_0x38be('0x4')]();var fs_extra=require(_0x38be('0x5'));var auth=require(_0x38be('0x6'));var interaction=require(_0x38be('0x7'));var config=require('../../config/environment');var controller=require(_0x38be('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x38be('0x9'),auth[_0x38be('0xa')](),controller[_0x38be('0xb')]);router['get'](_0x38be('0xc'),auth[_0x38be('0xa')](),controller[_0x38be('0xd')]);router['post']('/',auth[_0x38be('0xa')](),controller[_0x38be('0xe')]);router[_0x38be('0xf')](_0x38be('0x9'),auth[_0x38be('0xa')](),controller['update']);router['delete'](_0x38be('0x9'),auth['isAuthenticated'](),controller[_0x38be('0x10')]);module[_0x38be('0x11')]=router;
\ No newline at end of file
+var _0x0d77=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id/download','download','update'];(function(_0x53d250,_0x219096){var _0xf27636=function(_0x333f39){while(--_0x333f39){_0x53d250['push'](_0x53d250['shift']());}};_0xf27636(++_0x219096);}(_0x0d77,0x1ab));var _0x70d7=function(_0xdc7f18,_0x530e42){_0xdc7f18=_0xdc7f18-0x0;var _0x4c81e8=_0x0d77[_0xdc7f18];return _0x4c81e8;};'use strict';var multer=require(_0x70d7('0x0'));var util=require(_0x70d7('0x1'));var path=require(_0x70d7('0x2'));var timeout=require(_0x70d7('0x3'));var express=require(_0x70d7('0x4'));var router=express[_0x70d7('0x5')]();var fs_extra=require(_0x70d7('0x6'));var auth=require(_0x70d7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x70d7('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x70d7('0x9')]('/',auth[_0x70d7('0xa')](),controller[_0x70d7('0xb')]);router[_0x70d7('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x70d7('0x9')](_0x70d7('0xc'),auth[_0x70d7('0xa')](),controller[_0x70d7('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x70d7('0xa')](),controller[_0x70d7('0xe')]);router[_0x70d7('0xf')]('/:id',auth[_0x70d7('0xa')](),controller['destroy']);module[_0x70d7('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 9ed6d5b..7b607a0 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 _0xad13=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x28dd23,_0x308022){var _0xcdf7ae=function(_0x3e3108){while(--_0x3e3108){_0x28dd23['push'](_0x28dd23['shift']());}};_0xcdf7ae(++_0x308022);}(_0xad13,0xf6));var _0x3ad1=function(_0x41b78a,_0x2a566f){_0x41b78a=_0x41b78a-0x0;var _0x53bd2e=_0xad13[_0x41b78a];return _0x53bd2e;};'use strict';var Sequelize=require(_0x3ad1('0x0'));module[_0x3ad1('0x1')]={'field':{'type':Sequelize[_0x3ad1('0x2')]},'alias':{'type':Sequelize[_0x3ad1('0x3')]},'function':{'type':Sequelize[_0x3ad1('0x3')]},'format':{'type':Sequelize[_0x3ad1('0x3')]},'groupBy':{'type':Sequelize[_0x3ad1('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x1cba=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x5a9859,_0x23ca1a){var _0x4d1444=function(_0x36ea70){while(--_0x36ea70){_0x5a9859['push'](_0x5a9859['shift']());}};_0x4d1444(++_0x23ca1a);}(_0x1cba,0x19a));var _0xa1cb=function(_0x36bad3,_0x3cc324){_0x36bad3=_0x36bad3-0x0;var _0x3d6f23=_0x1cba[_0x36bad3];return _0x3d6f23;};'use strict';var Sequelize=require(_0xa1cb('0x0'));module['exports']={'field':{'type':Sequelize[_0xa1cb('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xa1cb('0x2')]},'format':{'type':Sequelize[_0xa1cb('0x2')]},'groupBy':{'type':Sequelize[_0xa1cb('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa1cb('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 ee41e94..7c562f4 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 _0x959d=['json','reject','update','then','destroy','sendStatus','name','send','index','map','AnalyticFieldReport','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','includeAll','create','body','bulkCreate','find','bulkDestroy','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x959d,0x157));var _0xd959=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0x959d[_0x1dfa63];return _0x26f2a9;};'use strict';var emlformat=require(_0xd959('0x0'));var rimraf=require(_0xd959('0x1'));var zipdir=require(_0xd959('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd959('0x3'));var moment=require('moment');var BPromise=require(_0xd959('0x4'));var Mustache=require(_0xd959('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd959('0x6'));var fs=require('fs');var fs_extra=require(_0xd959('0x7'));var _=require(_0xd959('0x8'));var squel=require('squel');var crypto=require(_0xd959('0x9'));var jsforce=require(_0xd959('0xa'));var deskjs=require(_0xd959('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd959('0xc'));var Papa=require(_0xd959('0xd'));var Redis=require('ioredis');var authService=require(_0xd959('0xe'));var qs=require(_0xd959('0xf'));var as=require(_0xd959('0x10'));var hardwareService=require(_0xd959('0x11'));var logger=require(_0xd959('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd959('0x13'))['db'];function respondWithStatusCode(_0x2baf9a,_0x493a6c){_0x493a6c=_0x493a6c||0xcc;return function(_0xd29ce1){if(_0xd29ce1){return _0x2baf9a['sendStatus'](_0x493a6c);}return _0x2baf9a[_0xd959('0x14')](_0x493a6c)[_0xd959('0x15')]();};}function respondWithResult(_0x14acc2,_0x144769){_0x144769=_0x144769||0xc8;return function(_0x4a932b){if(_0x4a932b){return _0x14acc2[_0xd959('0x14')](_0x144769)['json'](_0x4a932b);}};}function respondWithFilteredResult(_0x26cee8,_0x3d7f98){return function(_0x586984){if(_0x586984){var _0x93904=typeof _0x3d7f98[_0xd959('0x16')]===_0xd959('0x17')&&typeof _0x3d7f98[_0xd959('0x18')]===_0xd959('0x17');var _0x4ef08b=_0x586984[_0xd959('0x19')];var _0x1aa499=_0x93904?0x0:_0x3d7f98[_0xd959('0x16')];var _0x5d4ec5=_0x93904?_0x586984[_0xd959('0x19')]:_0x3d7f98[_0xd959('0x16')]+_0x3d7f98[_0xd959('0x18')];var _0x5a02c0;if(_0x5d4ec5>=_0x4ef08b){_0x5d4ec5=_0x4ef08b;_0x5a02c0=0xc8;}else{_0x5a02c0=0xce;}_0x26cee8[_0xd959('0x14')](_0x5a02c0);return _0x26cee8['set'](_0xd959('0x1a'),_0x1aa499+'-'+_0x5d4ec5+'/'+_0x4ef08b)[_0xd959('0x1b')](_0x586984);}return null;};}function patchUpdates(_0x4deed2){return function(_0x513a63){try{jsonpatch['apply'](_0x513a63,_0x4deed2,!![]);}catch(_0xd13cbe){return BPromise[_0xd959('0x1c')](_0xd13cbe);}return _0x513a63['save']();};}function saveUpdates(_0x9a5f76,_0x56ce3e){return function(_0x42e647){if(_0x42e647){return _0x42e647[_0xd959('0x1d')](_0x9a5f76)[_0xd959('0x1e')](function(_0x5bb447){return _0x5bb447;});}return null;};}function removeEntity(_0x42345e,_0x375a0a){return function(_0xee7541){if(_0xee7541){return _0xee7541[_0xd959('0x1f')]()['then'](function(){_0x42345e[_0xd959('0x14')](0xcc)[_0xd959('0x15')]();});}};}function handleEntityNotFound(_0x57ae42,_0x3888ca){return function(_0x551266){if(!_0x551266){_0x57ae42[_0xd959('0x20')](0x194);}return _0x551266;};}function handleError(_0xb2d2dd,_0x3a32d1){_0x3a32d1=_0x3a32d1||0x1f4;return function(_0x41bd0e){logger['error'](_0x41bd0e['stack']);if(_0x41bd0e['name']){delete _0x41bd0e[_0xd959('0x21')];}_0xb2d2dd[_0xd959('0x14')](_0x3a32d1)[_0xd959('0x22')](_0x41bd0e);};}exports[_0xd959('0x23')]=function(_0x369d16,_0x2fa174){var _0xcfafaf={},_0x3ab5b6={},_0x1b76a8={'count':0x0,'rows':[]};var _0x1d053e=_[_0xd959('0x24')](db[_0xd959('0x25')]['rawAttributes'],function(_0x32e8b7){return{'name':_0x32e8b7['fieldName'],'type':_0x32e8b7[_0xd959('0x26')][_0xd959('0x27')]};});_0x3ab5b6[_0xd959('0x28')]=_[_0xd959('0x24')](_0x1d053e,'name');_0x3ab5b6[_0xd959('0x29')]=_[_0xd959('0x2a')](_0x369d16[_0xd959('0x29')]);_0x3ab5b6['filters']=_[_0xd959('0x2b')](_0x3ab5b6[_0xd959('0x28')],_0x3ab5b6[_0xd959('0x29')]);_0xcfafaf[_0xd959('0x2c')]=_[_0xd959('0x2b')](_0x3ab5b6[_0xd959('0x28')],qs[_0xd959('0x2d')](_0x369d16[_0xd959('0x29')]['fields']));_0xcfafaf[_0xd959('0x2c')]=_0xcfafaf[_0xd959('0x2c')][_0xd959('0x2e')]?_0xcfafaf['attributes']:_0x3ab5b6[_0xd959('0x28')];if(!_0x369d16['query'][_0xd959('0x2f')]('nolimit')){_0xcfafaf[_0xd959('0x18')]=qs[_0xd959('0x18')](_0x369d16[_0xd959('0x29')][_0xd959('0x18')]);_0xcfafaf[_0xd959('0x16')]=qs[_0xd959('0x16')](_0x369d16['query'][_0xd959('0x16')]);}_0xcfafaf['order']=qs[_0xd959('0x30')](_0x369d16[_0xd959('0x29')]['sort']);_0xcfafaf[_0xd959('0x31')]=qs[_0xd959('0x32')](_[_0xd959('0x33')](_0x369d16[_0xd959('0x29')],_0x3ab5b6['filters']),_0x1d053e);if(_0x369d16['query'][_0xd959('0x34')]){_0xcfafaf['where']=_[_0xd959('0x35')](_0xcfafaf[_0xd959('0x31')],{'$or':_['map'](_0x1d053e,function(_0x360cda){if(_0x360cda['type']!==_0xd959('0x36')){var _0x320181={};_0x320181[_0x360cda[_0xd959('0x21')]]={'$like':'%'+_0x369d16[_0xd959('0x29')][_0xd959('0x34')]+'%'};return _0x320181;}})});}_0xcfafaf=_['merge']({},_0xcfafaf,_0x369d16[_0xd959('0x37')]);var _0x1ba7c8={'where':_0xcfafaf[_0xd959('0x31')]};return db['AnalyticFieldReport'][_0xd959('0x19')](_0x1ba7c8)[_0xd959('0x1e')](function(_0x2c74df){_0x1b76a8[_0xd959('0x19')]=_0x2c74df;if(_0x369d16[_0xd959('0x29')]['includeAll']){_0xcfafaf[_0xd959('0x38')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0xcfafaf);})['then'](function(_0x10d71e){_0x1b76a8[_0xd959('0x39')]=_0x10d71e;return _0x1b76a8;})[_0xd959('0x1e')](respondWithFilteredResult(_0x2fa174,_0xcfafaf))[_0xd959('0x3a')](handleError(_0x2fa174,null));};exports[_0xd959('0x3b')]=function(_0x21c268,_0x206c4a){var _0x374a6a={'raw':![],'where':{'id':_0x21c268[_0xd959('0x3c')]['id']}},_0x89c57e={};_0x89c57e[_0xd959('0x28')]=_[_0xd959('0x2a')](db[_0xd959('0x25')][_0xd959('0x3d')]);_0x89c57e[_0xd959('0x29')]=_['keys'](_0x21c268['query']);_0x89c57e[_0xd959('0x32')]=_['intersection'](_0x89c57e['model'],_0x89c57e['query']);_0x374a6a['attributes']=_[_0xd959('0x2b')](_0x89c57e[_0xd959('0x28')],qs[_0xd959('0x2d')](_0x21c268[_0xd959('0x29')][_0xd959('0x2d')]));_0x374a6a[_0xd959('0x2c')]=_0x374a6a[_0xd959('0x2c')][_0xd959('0x2e')]?_0x374a6a[_0xd959('0x2c')]:_0x89c57e['model'];if(_0x21c268[_0xd959('0x29')][_0xd959('0x3e')]){_0x374a6a[_0xd959('0x38')]=[{'all':!![]}];}_0x374a6a=_[_0xd959('0x35')]({},_0x374a6a,_0x21c268['options']);return db[_0xd959('0x25')]['find'](_0x374a6a)[_0xd959('0x1e')](handleEntityNotFound(_0x206c4a,null))['then'](respondWithResult(_0x206c4a,null))[_0xd959('0x3a')](handleError(_0x206c4a,null));};exports[_0xd959('0x3f')]=function(_0x4cff28,_0x1ae97a){return db[_0xd959('0x25')][_0xd959('0x3f')](_0x4cff28[_0xd959('0x40')],{})[_0xd959('0x1e')](respondWithResult(_0x1ae97a,0xc9))['catch'](handleError(_0x1ae97a,null));};exports[_0xd959('0x41')]=function(_0x3d244d,_0x286fe7){return db[_0xd959('0x25')][_0xd959('0x41')](_0x3d244d[_0xd959('0x40')],{'raw':![],'individualHooks':!![]})[_0xd959('0x1e')](respondWithResult(_0x286fe7,0xc9))[_0xd959('0x3a')](handleError(_0x286fe7,null));};exports[_0xd959('0x1d')]=function(_0x3920ea,_0x2be52a){if(_0x3920ea[_0xd959('0x40')]['id']){delete _0x3920ea[_0xd959('0x40')]['id'];}return db[_0xd959('0x25')][_0xd959('0x42')]({'where':{'id':_0x3920ea[_0xd959('0x3c')]['id']}})[_0xd959('0x1e')](handleEntityNotFound(_0x2be52a,null))[_0xd959('0x1e')](saveUpdates(_0x3920ea[_0xd959('0x40')],null))[_0xd959('0x1e')](respondWithResult(_0x2be52a,null))[_0xd959('0x3a')](handleError(_0x2be52a,null));};exports[_0xd959('0x1f')]=function(_0x4c1bc9,_0x107cd5){return db[_0xd959('0x25')][_0xd959('0x42')]({'where':{'id':_0x4c1bc9['params']['id']}})[_0xd959('0x1e')](handleEntityNotFound(_0x107cd5,null))['then'](removeEntity(_0x107cd5,null))[_0xd959('0x3a')](handleError(_0x107cd5,null));};exports[_0xd959('0x43')]=function(_0x16ca13,_0x4dea1a){return db['AnalyticFieldReport'][_0xd959('0x1f')]({'where':{'id':_0x16ca13[_0xd959('0x29')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4dea1a,0xcc))[_0xd959('0x3a')](handleError(_0x4dea1a,null));};exports['addFields']=function(_0x5764cf,_0x3ee7c3,_0xda0c1){return db[_0xd959('0x44')][_0xd959('0x45')]({'where':{'id':_0x5764cf['params']['id']}})[_0xd959('0x1e')](handleEntityNotFound(_0x3ee7c3,null))[_0xd959('0x1e')](function(_0x586523){if(_0x586523){return db[_0xd959('0x46')][_0xd959('0x47')](function(_0x52ee80){return db['AnalyticFieldReport'][_0xd959('0x1f')]({'where':{'CustomReportId':_0x5764cf[_0xd959('0x3c')]['id']},'transaction':_0x52ee80})[_0xd959('0x1e')](function(_0x3f171e){var _0x3be2b4=_['map'](_0x5764cf[_0xd959('0x40')],function(_0x229a60){delete _0x229a60['id'];_0x229a60[_0xd959('0x48')]=_0x5764cf[_0xd959('0x3c')]['id'];return _0x229a60;});return db['AnalyticFieldReport']['bulkCreate'](_0x3be2b4,{'transaction':_0x52ee80});});})[_0xd959('0x1e')](function(){return db[_0xd959('0x25')][_0xd959('0x49')]({'where':{'CustomReportId':_0x5764cf['params']['id']}});});}})[_0xd959('0x1e')](respondWithResult(_0x3ee7c3,null))[_0xd959('0x3a')](handleError(_0x3ee7c3,null));};
\ No newline at end of file
+var _0xfea1=['find','create','bulkCreate','body','bulkDestroy','ids','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','AnalyticFieldReport','findAll','rows','catch','show','params','keys'];(function(_0x325c1d,_0xaac33){var _0x41620d=function(_0x44e13c){while(--_0x44e13c){_0x325c1d['push'](_0x325c1d['shift']());}};_0x41620d(++_0xaac33);}(_0xfea1,0x186));var _0x1fea=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xfea1[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x1fea('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1fea('0x1'));var moment=require('moment');var BPromise=require(_0x1fea('0x2'));var Mustache=require(_0x1fea('0x3'));var util=require(_0x1fea('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x1fea('0x5'));var ejs=require(_0x1fea('0x6'));var fs=require('fs');var fs_extra=require(_0x1fea('0x7'));var _=require(_0x1fea('0x8'));var squel=require(_0x1fea('0x9'));var crypto=require('crypto');var jsforce=require(_0x1fea('0xa'));var deskjs=require(_0x1fea('0xb'));var toCsv=require(_0x1fea('0x5'));var querystring=require(_0x1fea('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1fea('0xd'));var qs=require(_0x1fea('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fea('0xf'));var logger=require('../../config/logger')(_0x1fea('0x10'));var utils=require('../../config/utils');var config=require(_0x1fea('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x1fea('0x12'))['db'];function respondWithStatusCode(_0xc5728b,_0x20264d){_0x20264d=_0x20264d||0xcc;return function(_0x4a6d85){if(_0x4a6d85){return _0xc5728b[_0x1fea('0x13')](_0x20264d);}return _0xc5728b['status'](_0x20264d)[_0x1fea('0x14')]();};}function respondWithResult(_0x3767c6,_0x2aa9d2){_0x2aa9d2=_0x2aa9d2||0xc8;return function(_0x4e06f6){if(_0x4e06f6){return _0x3767c6[_0x1fea('0x15')](_0x2aa9d2)[_0x1fea('0x16')](_0x4e06f6);}};}function respondWithFilteredResult(_0x326f3e,_0x15e4c3){return function(_0x5b2870){if(_0x5b2870){var _0xf150c3=typeof _0x15e4c3[_0x1fea('0x17')]===_0x1fea('0x18')&&typeof _0x15e4c3['limit']==='undefined';var _0x318f07=_0x5b2870[_0x1fea('0x19')];var _0x1484f0=_0xf150c3?0x0:_0x15e4c3[_0x1fea('0x17')];var _0xc1cbb5=_0xf150c3?_0x5b2870[_0x1fea('0x19')]:_0x15e4c3[_0x1fea('0x17')]+_0x15e4c3['limit'];var _0x1ad208;if(_0xc1cbb5>=_0x318f07){_0xc1cbb5=_0x318f07;_0x1ad208=0xc8;}else{_0x1ad208=0xce;}_0x326f3e[_0x1fea('0x15')](_0x1ad208);return _0x326f3e['set'](_0x1fea('0x1a'),_0x1484f0+'-'+_0xc1cbb5+'/'+_0x318f07)['json'](_0x5b2870);}return null;};}function patchUpdates(_0x2c405a){return function(_0xc33573){try{jsonpatch[_0x1fea('0x1b')](_0xc33573,_0x2c405a,!![]);}catch(_0x435c62){return BPromise['reject'](_0x435c62);}return _0xc33573[_0x1fea('0x1c')]();};}function saveUpdates(_0x1cfe54,_0x2e15dc){return function(_0x2ea697){if(_0x2ea697){return _0x2ea697[_0x1fea('0x1d')](_0x1cfe54)['then'](function(_0x1e60c2){return _0x1e60c2;});}return null;};}function removeEntity(_0x38d781,_0x35619b){return function(_0x126a68){if(_0x126a68){return _0x126a68[_0x1fea('0x1e')]()[_0x1fea('0x1f')](function(){_0x38d781[_0x1fea('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16f7c9,_0x57ef0c){return function(_0x1d073b){if(!_0x1d073b){_0x16f7c9[_0x1fea('0x13')](0x194);}return _0x1d073b;};}function handleError(_0x177174,_0xa35ba){_0xa35ba=_0xa35ba||0x1f4;return function(_0x2cb168){logger[_0x1fea('0x20')](_0x2cb168[_0x1fea('0x21')]);if(_0x2cb168[_0x1fea('0x22')]){delete _0x2cb168['name'];}_0x177174[_0x1fea('0x15')](_0xa35ba)[_0x1fea('0x23')](_0x2cb168);};}exports[_0x1fea('0x24')]=function(_0x6b3ba5,_0x5e8bfa){var _0x1ffdc8={},_0x4d77ac={},_0x1457b5={'count':0x0,'rows':[]};var _0x3efa68=_[_0x1fea('0x25')](db['AnalyticFieldReport'][_0x1fea('0x26')],function(_0x384683){return{'name':_0x384683[_0x1fea('0x27')],'type':_0x384683[_0x1fea('0x28')]['key']};});_0x4d77ac[_0x1fea('0x29')]=_[_0x1fea('0x25')](_0x3efa68,_0x1fea('0x22'));_0x4d77ac[_0x1fea('0x2a')]=_['keys'](_0x6b3ba5[_0x1fea('0x2a')]);_0x4d77ac[_0x1fea('0x2b')]=_[_0x1fea('0x2c')](_0x4d77ac[_0x1fea('0x29')],_0x4d77ac['query']);_0x1ffdc8[_0x1fea('0x2d')]=_[_0x1fea('0x2c')](_0x4d77ac[_0x1fea('0x29')],qs['fields'](_0x6b3ba5[_0x1fea('0x2a')][_0x1fea('0x2e')]));_0x1ffdc8[_0x1fea('0x2d')]=_0x1ffdc8[_0x1fea('0x2d')][_0x1fea('0x2f')]?_0x1ffdc8[_0x1fea('0x2d')]:_0x4d77ac[_0x1fea('0x29')];if(!_0x6b3ba5[_0x1fea('0x2a')][_0x1fea('0x30')](_0x1fea('0x31'))){_0x1ffdc8[_0x1fea('0x32')]=qs['limit'](_0x6b3ba5[_0x1fea('0x2a')]['limit']);_0x1ffdc8['offset']=qs['offset'](_0x6b3ba5[_0x1fea('0x2a')][_0x1fea('0x17')]);}_0x1ffdc8['order']=qs[_0x1fea('0x33')](_0x6b3ba5[_0x1fea('0x2a')][_0x1fea('0x33')]);_0x1ffdc8[_0x1fea('0x34')]=qs['filters'](_[_0x1fea('0x35')](_0x6b3ba5[_0x1fea('0x2a')],_0x4d77ac['filters']),_0x3efa68);if(_0x6b3ba5[_0x1fea('0x2a')]['filter']){_0x1ffdc8[_0x1fea('0x34')]=_[_0x1fea('0x36')](_0x1ffdc8[_0x1fea('0x34')],{'$or':_[_0x1fea('0x25')](_0x3efa68,function(_0x1f4685){if(_0x1f4685['type']!==_0x1fea('0x37')){var _0x2e18b3={};_0x2e18b3[_0x1f4685[_0x1fea('0x22')]]={'$like':'%'+_0x6b3ba5[_0x1fea('0x2a')]['filter']+'%'};return _0x2e18b3;}})});}_0x1ffdc8=_[_0x1fea('0x36')]({},_0x1ffdc8,_0x6b3ba5[_0x1fea('0x38')]);var _0x10ccb0={'where':_0x1ffdc8[_0x1fea('0x34')]};return db['AnalyticFieldReport']['count'](_0x10ccb0)[_0x1fea('0x1f')](function(_0x196485){_0x1457b5[_0x1fea('0x19')]=_0x196485;if(_0x6b3ba5[_0x1fea('0x2a')][_0x1fea('0x39')]){_0x1ffdc8[_0x1fea('0x3a')]=[{'all':!![]}];}return db[_0x1fea('0x3b')][_0x1fea('0x3c')](_0x1ffdc8);})[_0x1fea('0x1f')](function(_0x218cf6){_0x1457b5[_0x1fea('0x3d')]=_0x218cf6;return _0x1457b5;})[_0x1fea('0x1f')](respondWithFilteredResult(_0x5e8bfa,_0x1ffdc8))[_0x1fea('0x3e')](handleError(_0x5e8bfa,null));};exports[_0x1fea('0x3f')]=function(_0x24cb10,_0x34f6da){var _0x4b0f81={'raw':![],'where':{'id':_0x24cb10[_0x1fea('0x40')]['id']}},_0x3feeee={};_0x3feeee[_0x1fea('0x29')]=_[_0x1fea('0x41')](db[_0x1fea('0x3b')]['rawAttributes']);_0x3feeee[_0x1fea('0x2a')]=_['keys'](_0x24cb10['query']);_0x3feeee['filters']=_['intersection'](_0x3feeee[_0x1fea('0x29')],_0x3feeee[_0x1fea('0x2a')]);_0x4b0f81[_0x1fea('0x2d')]=_[_0x1fea('0x2c')](_0x3feeee[_0x1fea('0x29')],qs['fields'](_0x24cb10['query'][_0x1fea('0x2e')]));_0x4b0f81[_0x1fea('0x2d')]=_0x4b0f81['attributes']['length']?_0x4b0f81[_0x1fea('0x2d')]:_0x3feeee[_0x1fea('0x29')];if(_0x24cb10['query'][_0x1fea('0x39')]){_0x4b0f81[_0x1fea('0x3a')]=[{'all':!![]}];}_0x4b0f81=_[_0x1fea('0x36')]({},_0x4b0f81,_0x24cb10[_0x1fea('0x38')]);return db['AnalyticFieldReport'][_0x1fea('0x42')](_0x4b0f81)[_0x1fea('0x1f')](handleEntityNotFound(_0x34f6da,null))[_0x1fea('0x1f')](respondWithResult(_0x34f6da,null))[_0x1fea('0x3e')](handleError(_0x34f6da,null));};exports[_0x1fea('0x43')]=function(_0x3bef11,_0x5a00d5){return db[_0x1fea('0x3b')][_0x1fea('0x43')](_0x3bef11['body'],{})['then'](respondWithResult(_0x5a00d5,0xc9))[_0x1fea('0x3e')](handleError(_0x5a00d5,null));};exports[_0x1fea('0x44')]=function(_0xe943f8,_0x361253){return db[_0x1fea('0x3b')][_0x1fea('0x44')](_0xe943f8['body'],{'raw':![],'individualHooks':!![]})[_0x1fea('0x1f')](respondWithResult(_0x361253,0xc9))[_0x1fea('0x3e')](handleError(_0x361253,null));};exports[_0x1fea('0x1d')]=function(_0x435cb1,_0x513a5c){if(_0x435cb1[_0x1fea('0x45')]['id']){delete _0x435cb1[_0x1fea('0x45')]['id'];}return db[_0x1fea('0x3b')][_0x1fea('0x42')]({'where':{'id':_0x435cb1[_0x1fea('0x40')]['id']}})[_0x1fea('0x1f')](handleEntityNotFound(_0x513a5c,null))[_0x1fea('0x1f')](saveUpdates(_0x435cb1[_0x1fea('0x45')],null))['then'](respondWithResult(_0x513a5c,null))[_0x1fea('0x3e')](handleError(_0x513a5c,null));};exports[_0x1fea('0x1e')]=function(_0x5c5968,_0x1bc004){return db[_0x1fea('0x3b')][_0x1fea('0x42')]({'where':{'id':_0x5c5968[_0x1fea('0x40')]['id']}})[_0x1fea('0x1f')](handleEntityNotFound(_0x1bc004,null))['then'](removeEntity(_0x1bc004,null))[_0x1fea('0x3e')](handleError(_0x1bc004,null));};exports[_0x1fea('0x46')]=function(_0x55e9ad,_0x5716e3){return db[_0x1fea('0x3b')][_0x1fea('0x1e')]({'where':{'id':_0x55e9ad[_0x1fea('0x2a')][_0x1fea('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0x1fea('0x1f')](respondWithResult(_0x5716e3,0xcc))['catch'](handleError(_0x5716e3,null));};exports['addFields']=function(_0x406254,_0x348fab,_0x3ab2da){return db[_0x1fea('0x48')]['findOne']({'where':{'id':_0x406254[_0x1fea('0x40')]['id']}})[_0x1fea('0x1f')](handleEntityNotFound(_0x348fab,null))[_0x1fea('0x1f')](function(_0x11277a){if(_0x11277a){return db[_0x1fea('0x49')][_0x1fea('0x4a')](function(_0x164a7d){return db[_0x1fea('0x3b')][_0x1fea('0x1e')]({'where':{'CustomReportId':_0x406254[_0x1fea('0x40')]['id']},'transaction':_0x164a7d})[_0x1fea('0x1f')](function(_0x1b8c23){var _0x1ee693=_[_0x1fea('0x25')](_0x406254[_0x1fea('0x45')],function(_0x1938fc){delete _0x1938fc['id'];_0x1938fc[_0x1fea('0x4b')]=_0x406254[_0x1fea('0x40')]['id'];return _0x1938fc;});return db[_0x1fea('0x3b')][_0x1fea('0x44')](_0x1ee693,{'transaction':_0x164a7d});});})[_0x1fea('0x1f')](function(){return db[_0x1fea('0x3b')]['findAll']({'where':{'CustomReportId':_0x406254['params']['id']}});});}})[_0x1fea('0x1f')](respondWithResult(_0x348fab,null))['catch'](handleError(_0x348fab,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 10357ad..d5a4329 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 _0x58d4=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x9861ff,_0x41fb17){var _0x48852b=function(_0x557001){while(--_0x557001){_0x9861ff['push'](_0x9861ff['shift']());}};_0x48852b(++_0x41fb17);}(_0x58d4,0x1d7));var _0x458d=function(_0x56574f,_0x320675){_0x56574f=_0x56574f-0x0;var _0x362bcf=_0x58d4[_0x56574f];return _0x362bcf;};'use strict';var _=require('lodash');var util=require(_0x458d('0x0'));var logger=require(_0x458d('0x1'))(_0x458d('0x2'));var moment=require('moment');var BPromise=require(_0x458d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x458d('0x4'));var rimraf=require(_0x458d('0x5'));var config=require('../../config/environment');var attributes=require(_0x458d('0x6'));module[_0x458d('0x7')]=function(_0x2844a7,_0x2e663c){return _0x2844a7['define'](_0x458d('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x64ba=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x5a1929,_0x2e10f8){var _0x18c46f=function(_0x757d75){while(--_0x757d75){_0x5a1929['push'](_0x5a1929['shift']());}};_0x18c46f(++_0x2e10f8);}(_0x64ba,0x132));var _0xa64b=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x64ba[_0x19b3f9];return _0x18c3f6;};'use strict';var _=require(_0xa64b('0x0'));var util=require(_0xa64b('0x1'));var logger=require(_0xa64b('0x2'))(_0xa64b('0x3'));var moment=require(_0xa64b('0x4'));var BPromise=require(_0xa64b('0x5'));var rp=require(_0xa64b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa64b('0x7'));var config=require(_0xa64b('0x8'));var attributes=require(_0xa64b('0x9'));module[_0xa64b('0xa')]=function(_0x484d24,_0x341f18){return _0x484d24[_0xa64b('0xb')](_0xa64b('0xc'),attributes,{'tableName':_0xa64b('0xd'),'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 faf390e..875d8ce 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 _0x8065=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x7d2ad1,_0x15e28b){var _0x368660=function(_0x519bcf){while(--_0x519bcf){_0x7d2ad1['push'](_0x7d2ad1['shift']());}};_0x368660(++_0x15e28b);}(_0x8065,0xa6));var _0x5806=function(_0x1492f4,_0xce72ab){_0x1492f4=_0x1492f4-0x0;var _0x2aa407=_0x8065[_0x1492f4];return _0x2aa407;};'use strict';var _=require(_0x5806('0x0'));var util=require('util');var moment=require(_0x5806('0x1'));var BPromise=require(_0x5806('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5806('0x3'));var db=require(_0x5806('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5806('0x5'))(_0x5806('0x6'));var config=require('../../config/environment');var jayson=require(_0x5806('0x7'));var client=jayson[_0x5806('0x8')][_0x5806('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32ec16,_0x5ce78f,_0x571fc5){return new BPromise(function(_0xd13df1,_0x18d384){return client[_0x5806('0xa')](_0x32ec16,_0x571fc5)[_0x5806('0xb')](function(_0x104639){logger[_0x5806('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5ce78f,_0x5806('0xd'));logger[_0x5806('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5ce78f,_0x5806('0xd'),JSON[_0x5806('0xf')](_0x104639));if(_0x104639['error']){if(_0x104639[_0x5806('0x10')]['code']===0x1f4){logger['error'](_0x5806('0x11'),_0x5ce78f,_0x104639[_0x5806('0x10')][_0x5806('0x12')]);return _0x18d384(_0x104639[_0x5806('0x10')][_0x5806('0x12')]);}logger[_0x5806('0x10')](_0x5806('0x11'),_0x5ce78f,_0x104639[_0x5806('0x10')][_0x5806('0x12')]);return _0xd13df1(_0x104639[_0x5806('0x10')][_0x5806('0x12')]);}else{logger[_0x5806('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5ce78f,_0x5806('0xd'));_0xd13df1(_0x104639[_0x5806('0x13')][_0x5806('0x12')]);}})[_0x5806('0x14')](function(_0xfcb25d){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5ce78f,_0xfcb25d);_0x18d384(_0xfcb25d);});});}
\ No newline at end of file
+var _0x3933=['randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x343310,_0x307ec4){var _0x587f7d=function(_0xefd08b){while(--_0xefd08b){_0x343310['push'](_0x343310['shift']());}};_0x587f7d(++_0x307ec4);}(_0x3933,0x1a2));var _0x3393=function(_0x332b42,_0x9bd52e){_0x332b42=_0x332b42-0x0;var _0x3c7b43=_0x3933[_0x332b42];return _0x3c7b43;};'use strict';var _=require(_0x3393('0x0'));var util=require('util');var moment=require(_0x3393('0x1'));var BPromise=require('bluebird');var rs=require(_0x3393('0x2'));var fs=require('fs');var Redis=require(_0x3393('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3393('0x4'));var logger=require('../../config/logger')(_0x3393('0x5'));var config=require('../../config/environment');var jayson=require(_0x3393('0x6'));var client=jayson[_0x3393('0x7')][_0x3393('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b8dc9,_0x3a1856,_0x39289a){return new BPromise(function(_0x1e5774,_0x324fa6){return client[_0x3393('0x9')](_0x5b8dc9,_0x39289a)['then'](function(_0x1d204d){logger[_0x3393('0xa')](_0x3393('0xb'),_0x3a1856,_0x3393('0xc'));logger[_0x3393('0xd')](_0x3393('0xe'),_0x3a1856,_0x3393('0xc'),JSON[_0x3393('0xf')](_0x1d204d));if(_0x1d204d['error']){if(_0x1d204d[_0x3393('0x10')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3a1856,_0x1d204d[_0x3393('0x10')][_0x3393('0x11')]);return _0x324fa6(_0x1d204d[_0x3393('0x10')][_0x3393('0x11')]);}logger[_0x3393('0x10')](_0x3393('0xb'),_0x3a1856,_0x1d204d['error']['message']);return _0x1e5774(_0x1d204d['error'][_0x3393('0x11')]);}else{logger[_0x3393('0xa')](_0x3393('0xb'),_0x3a1856,'request\x20sent');_0x1e5774(_0x1d204d[_0x3393('0x12')][_0x3393('0x11')]);}})[_0x3393('0x13')](function(_0x42bcad){logger[_0x3393('0x10')](_0x3393('0xb'),_0x3a1856,_0x42bcad);_0x324fa6(_0x42bcad);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 53e9ac9..3d56211 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(_0x6ab30c,_0x2c713b){var _0x36e953=function(_0x1aea9a){while(--_0x1aea9a){_0x6ab30c['push'](_0x6ab30c['shift']());}};_0x36e953(++_0x2c713b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x2b44a1,_0x1114bf){var _0x3d031f=function(_0x1f490f){while(--_0x1f490f){_0x2b44a1['push'](_0x2b44a1['shift']());}};_0x3d031f(++_0x1114bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 9ca6c86..18ff370 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 _0xc2da=['sequelize','STRING'];(function(_0xf83629,_0x37cc5f){var _0x8eaa27=function(_0x1deb4e){while(--_0x1deb4e){_0xf83629['push'](_0xf83629['shift']());}};_0x8eaa27(++_0x37cc5f);}(_0xc2da,0x124));var _0xac2d=function(_0x3c8679,_0x2faea3){_0x3c8679=_0x3c8679-0x0;var _0x2791f8=_0xc2da[_0x3c8679];return _0x2791f8;};'use strict';var Sequelize=require(_0xac2d('0x0'));module['exports']={'name':{'type':Sequelize[_0xac2d('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xac2d('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xac2d('0x1')]}};
\ No newline at end of file
+var _0x18a9=['name','TEXT','STRING'];(function(_0xc0ee84,_0x876767){var _0x181aa9=function(_0x45eb4b){while(--_0x45eb4b){_0xc0ee84['push'](_0xc0ee84['shift']());}};_0x181aa9(++_0x876767);}(_0x18a9,0x15b));var _0x918a=function(_0x1c309c,_0x5d8058){_0x1c309c=_0x1c309c-0x0;var _0x504e71=_0x18a9[_0x1c309c];return _0x504e71;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x918a('0x0')],'allowNull':![],'unique':_0x918a('0x1')},'table':{'type':Sequelize[_0x918a('0x0')]},'metric':{'type':Sequelize[_0x918a('0x2')]},'description':{'type':Sequelize[_0x918a('0x0')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 7c4368a..16bd3a2 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 _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x1ef44d,_0x1199fb){var _0x30bfd1=function(_0x23a3f6){while(--_0x23a3f6){_0x1ef44d['push'](_0x1ef44d['shift']());}};_0x30bfd1(++_0x1199fb);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2b37b4,_0x2b5efe){_0x2b37b4=_0x2b37b4-0x0;var _0x575dc5=_0xdc97[_0x2b37b4];return _0x575dc5;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
+var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../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','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1230fd,_0x33c053){var _0xedc0ba=function(_0x289a64){while(--_0x289a64){_0x1230fd['push'](_0x1230fd['shift']());}};_0xedc0ba(++_0x33c053);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0xf2ca[_0xa3463d];return _0x50fd67;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 92a2247..79151f0 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 _0xbf07=['define','analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','./analyticMetric.attributes'];(function(_0x3b7a0c,_0xf1a4c2){var _0x3bb70f=function(_0x248b52){while(--_0x248b52){_0x3b7a0c['push'](_0x3b7a0c['shift']());}};_0x3bb70f(++_0xf1a4c2);}(_0xbf07,0x77));var _0x7bf0=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xbf07[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0x7bf0('0x0'));var util=require(_0x7bf0('0x1'));var logger=require(_0x7bf0('0x2'))(_0x7bf0('0x3'));var moment=require('moment');var BPromise=require(_0x7bf0('0x4'));var rp=require(_0x7bf0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7bf0('0x6'));module['exports']=function(_0x5d2b76,_0x4a925d){return _0x5d2b76[_0x7bf0('0x7')]('AnalyticMetric',attributes,{'tableName':_0x7bf0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3641=['define','AnalyticMetric','util','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x2d360e,_0x250ab){var _0x244edd=function(_0x1fe308){while(--_0x1fe308){_0x2d360e['push'](_0x2d360e['shift']());}};_0x244edd(++_0x250ab);}(_0x3641,0x173));var _0x1364=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3641[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x1364('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1364('0x1'));var BPromise=require(_0x1364('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1364('0x3'));var rimraf=require(_0x1364('0x4'));var config=require(_0x1364('0x5'));var attributes=require('./analyticMetric.attributes');module[_0x1364('0x6')]=function(_0x4bcb69,_0x169527){return _0x4bcb69[_0x1364('0x7')](_0x1364('0x8'),attributes,{'tableName':'analytics_metrics','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 44d0c7b..bab6410 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 _0x4243=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x30c8e3,_0x518c11){var _0x3c5a44=function(_0x448861){while(--_0x448861){_0x30c8e3['push'](_0x30c8e3['shift']());}};_0x3c5a44(++_0x518c11);}(_0x4243,0x176));var _0x3424=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4243[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3424('0x0'));var util=require('util');var moment=require(_0x3424('0x1'));var BPromise=require(_0x3424('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3424('0x3'));var db=require(_0x3424('0x4'))['db'];var utils=require(_0x3424('0x5'));var logger=require('../../config/logger')(_0x3424('0x6'));var config=require('../../config/environment');var jayson=require(_0x3424('0x7'));var client=jayson[_0x3424('0x8')][_0x3424('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b73b2,_0x107ed4,_0x21e295){return new BPromise(function(_0x3a9572,_0xc72166){return client[_0x3424('0xa')](_0x2b73b2,_0x21e295)['then'](function(_0x2b92a1){logger[_0x3424('0xb')](_0x3424('0xc'),_0x107ed4,_0x3424('0xd'));logger[_0x3424('0xe')](_0x3424('0xf'),_0x107ed4,_0x3424('0xd'),JSON[_0x3424('0x10')](_0x2b92a1));if(_0x2b92a1[_0x3424('0x11')]){if(_0x2b92a1[_0x3424('0x11')]['code']===0x1f4){logger[_0x3424('0x11')](_0x3424('0xc'),_0x107ed4,_0x2b92a1['error'][_0x3424('0x12')]);return _0xc72166(_0x2b92a1[_0x3424('0x11')][_0x3424('0x12')]);}logger[_0x3424('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x107ed4,_0x2b92a1[_0x3424('0x11')]['message']);return _0x3a9572(_0x2b92a1[_0x3424('0x11')][_0x3424('0x12')]);}else{logger[_0x3424('0xb')](_0x3424('0xc'),_0x107ed4,'request\x20sent');_0x3a9572(_0x2b92a1[_0x3424('0x13')][_0x3424('0x12')]);}})[_0x3424('0x14')](function(_0x21c11c){logger['error'](_0x3424('0xc'),_0x107ed4,_0x21c11c);_0xc72166(_0x21c11c);});});}
\ No newline at end of file
+var _0x3e42=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x1cd916,_0x333f5c){var _0x1ff07a=function(_0x340c8e){while(--_0x340c8e){_0x1cd916['push'](_0x1cd916['shift']());}};_0x1ff07a(++_0x333f5c);}(_0x3e42,0x8a));var _0x23e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e42[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x23e4('0x0'));var util=require(_0x23e4('0x1'));var moment=require(_0x23e4('0x2'));var BPromise=require(_0x23e4('0x3'));var rs=require(_0x23e4('0x4'));var fs=require('fs');var Redis=require(_0x23e4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x23e4('0x6'));var logger=require(_0x23e4('0x7'))(_0x23e4('0x8'));var config=require(_0x23e4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x23e4('0xa')][_0x23e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2eede7,_0x2950c2,_0x115d93){return new BPromise(function(_0x435196,_0x459286){return client[_0x23e4('0xc')](_0x2eede7,_0x115d93)[_0x23e4('0xd')](function(_0x1aaf1a){logger[_0x23e4('0xe')](_0x23e4('0xf'),_0x2950c2,_0x23e4('0x10'));logger[_0x23e4('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x2950c2,_0x23e4('0x10'),JSON[_0x23e4('0x12')](_0x1aaf1a));if(_0x1aaf1a[_0x23e4('0x13')]){if(_0x1aaf1a[_0x23e4('0x13')][_0x23e4('0x14')]===0x1f4){logger[_0x23e4('0x13')](_0x23e4('0xf'),_0x2950c2,_0x1aaf1a[_0x23e4('0x13')][_0x23e4('0x15')]);return _0x459286(_0x1aaf1a[_0x23e4('0x13')][_0x23e4('0x15')]);}logger[_0x23e4('0x13')](_0x23e4('0xf'),_0x2950c2,_0x1aaf1a[_0x23e4('0x13')][_0x23e4('0x15')]);return _0x435196(_0x1aaf1a['error'][_0x23e4('0x15')]);}else{logger['info'](_0x23e4('0xf'),_0x2950c2,_0x23e4('0x10'));_0x435196(_0x1aaf1a['result'][_0x23e4('0x15')]);}})[_0x23e4('0x16')](function(_0x2effd9){logger[_0x23e4('0x13')](_0x23e4('0xf'),_0x2950c2,_0x2effd9);_0x459286(_0x2effd9);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 97347b4..640d05e 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 _0x5a2a=['isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get'];(function(_0x1976fd,_0x1b3add){var _0x215e21=function(_0x5c9e41){while(--_0x5c9e41){_0x1976fd['push'](_0x1976fd['shift']());}};_0x215e21(++_0x1b3add);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x864cf0,_0x22face){_0x864cf0=_0x864cf0-0x0;var _0x3184f2=_0x5a2a[_0x864cf0];return _0x3184f2;};'use strict';var multer=require(_0xa5a2('0x0'));var util=require(_0xa5a2('0x1'));var path=require(_0xa5a2('0x2'));var timeout=require(_0xa5a2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa5a2('0x4'));var interaction=require(_0xa5a2('0x5'));var config=require('../../config/environment');var controller=require(_0xa5a2('0x6'));router[_0xa5a2('0x7')]('/',auth[_0xa5a2('0x8')](),controller['index']);router[_0xa5a2('0x7')]('/:id',auth[_0xa5a2('0x8')](),controller[_0xa5a2('0x9')]);router[_0xa5a2('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa5a2('0xb')](_0xa5a2('0xc'),auth[_0xa5a2('0x8')](),controller[_0xa5a2('0xd')]);router[_0xa5a2('0xe')]('/:id',auth[_0xa5a2('0x8')](),controller[_0xa5a2('0xf')]);module[_0xa5a2('0x10')]=router;
\ No newline at end of file
+var _0xe314=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','index','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','util','path'];(function(_0x392e80,_0x562daa){var _0x3d0274=function(_0x3f2628){while(--_0x3f2628){_0x392e80['push'](_0x392e80['shift']());}};_0x3d0274(++_0x562daa);}(_0xe314,0x7c));var _0x4e31=function(_0x10ea73,_0x3b515a){_0x10ea73=_0x10ea73-0x0;var _0x5752e6=_0xe314[_0x10ea73];return _0x5752e6;};'use strict';var multer=require('multer');var util=require(_0x4e31('0x0'));var path=require(_0x4e31('0x1'));var timeout=require(_0x4e31('0x2'));var express=require(_0x4e31('0x3'));var router=express[_0x4e31('0x4')]();var fs_extra=require(_0x4e31('0x5'));var auth=require(_0x4e31('0x6'));var interaction=require(_0x4e31('0x7'));var config=require(_0x4e31('0x8'));var controller=require(_0x4e31('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4e31('0xa')]);router[_0x4e31('0xb')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller[_0x4e31('0xe')]);router[_0x4e31('0xf')]('/',auth['isAuthenticated'](),controller[_0x4e31('0x10')]);router[_0x4e31('0x11')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller['update']);router[_0x4e31('0x12')](_0x4e31('0xc'),auth[_0x4e31('0xd')](),controller[_0x4e31('0x13')]);module[_0x4e31('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index cbf0722..60fbbb0 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 _0x519a=['sequelize'];(function(_0x7e142c,_0x1f24bb){var _0x3e7610=function(_0x5cec06){while(--_0x5cec06){_0x7e142c['push'](_0x7e142c['shift']());}};_0x3e7610(++_0x1f24bb);}(_0x519a,0x75));var _0xa519=function(_0x54d49e,_0x5d9911){_0x54d49e=_0x54d49e-0x0;var _0x4af0f1=_0x519a[_0x54d49e];return _0x4af0f1;};'use strict';var Sequelize=require(_0xa519('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x4435=['sequelize','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4435,0x136));var _0x5443=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x4435[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0x5443('0x0'));module['exports']={'tree':{'type':Sequelize[_0x5443('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 8a578e0..9c53e6b 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 _0xc13d=['fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','name','send','map','AnalyticTreeReport','fieldName','type','key','model','keys','query','filters','intersection'];(function(_0x190e03,_0x2b861a){var _0x3cca82=function(_0x91a386){while(--_0x91a386){_0x190e03['push'](_0x190e03['shift']());}};_0x3cca82(++_0x2b861a);}(_0xc13d,0x1de));var _0xdc13=function(_0xf9373d,_0x5572c4){_0xf9373d=_0xf9373d-0x0;var _0x4fc99c=_0xc13d[_0xf9373d];return _0x4fc99c;};'use strict';var emlformat=require(_0xdc13('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdc13('0x1'));var moment=require(_0xdc13('0x2'));var BPromise=require(_0xdc13('0x3'));var Mustache=require(_0xdc13('0x4'));var util=require('util');var path=require(_0xdc13('0x5'));var sox=require(_0xdc13('0x6'));var csv=require(_0xdc13('0x7'));var ejs=require(_0xdc13('0x8'));var fs=require('fs');var fs_extra=require(_0xdc13('0x9'));var _=require(_0xdc13('0xa'));var squel=require(_0xdc13('0xb'));var crypto=require(_0xdc13('0xc'));var jsforce=require(_0xdc13('0xd'));var deskjs=require(_0xdc13('0xe'));var toCsv=require(_0xdc13('0x7'));var querystring=require(_0xdc13('0xf'));var Papa=require(_0xdc13('0x10'));var Redis=require(_0xdc13('0x11'));var authService=require(_0xdc13('0x12'));var qs=require(_0xdc13('0x13'));var as=require(_0xdc13('0x14'));var hardwareService=require(_0xdc13('0x15'));var logger=require(_0xdc13('0x16'))(_0xdc13('0x17'));var utils=require(_0xdc13('0x18'));var config=require(_0xdc13('0x19'));var licenseUtil=require(_0xdc13('0x1a'));var db=require(_0xdc13('0x1b'))['db'];function respondWithStatusCode(_0x3b5231,_0x43bf92){_0x43bf92=_0x43bf92||0xcc;return function(_0x1f0f8e){if(_0x1f0f8e){return _0x3b5231['sendStatus'](_0x43bf92);}return _0x3b5231[_0xdc13('0x1c')](_0x43bf92)['end']();};}function respondWithResult(_0x4b801f,_0x32f359){_0x32f359=_0x32f359||0xc8;return function(_0x19d275){if(_0x19d275){return _0x4b801f[_0xdc13('0x1c')](_0x32f359)['json'](_0x19d275);}};}function respondWithFilteredResult(_0x2d9524,_0x38a2bb){return function(_0x37efaf){if(_0x37efaf){var _0x4c1e47=typeof _0x38a2bb[_0xdc13('0x1d')]===_0xdc13('0x1e')&&typeof _0x38a2bb[_0xdc13('0x1f')]===_0xdc13('0x1e');var _0x3996f6=_0x37efaf[_0xdc13('0x20')];var _0x333aa6=_0x4c1e47?0x0:_0x38a2bb[_0xdc13('0x1d')];var _0x45dedb=_0x4c1e47?_0x37efaf['count']:_0x38a2bb[_0xdc13('0x1d')]+_0x38a2bb['limit'];var _0x126cdc;if(_0x45dedb>=_0x3996f6){_0x45dedb=_0x3996f6;_0x126cdc=0xc8;}else{_0x126cdc=0xce;}_0x2d9524[_0xdc13('0x1c')](_0x126cdc);return _0x2d9524[_0xdc13('0x21')](_0xdc13('0x22'),_0x333aa6+'-'+_0x45dedb+'/'+_0x3996f6)[_0xdc13('0x23')](_0x37efaf);}return null;};}function patchUpdates(_0x3fb1ad){return function(_0x3afab7){try{jsonpatch['apply'](_0x3afab7,_0x3fb1ad,!![]);}catch(_0x274735){return BPromise[_0xdc13('0x24')](_0x274735);}return _0x3afab7[_0xdc13('0x25')]();};}function saveUpdates(_0x281df2,_0x19a264){return function(_0x335f05){if(_0x335f05){return _0x335f05[_0xdc13('0x26')](_0x281df2)[_0xdc13('0x27')](function(_0x557d5e){return _0x557d5e;});}return null;};}function removeEntity(_0x35c6cd,_0x2d157b){return function(_0x3d77a8){if(_0x3d77a8){return _0x3d77a8[_0xdc13('0x28')]()[_0xdc13('0x27')](function(){_0x35c6cd[_0xdc13('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfe82f2,_0x461682){return function(_0x2acd7a){if(!_0x2acd7a){_0xfe82f2['sendStatus'](0x194);}return _0x2acd7a;};}function handleError(_0x343918,_0x51962d){_0x51962d=_0x51962d||0x1f4;return function(_0x855f5){logger[_0xdc13('0x29')](_0x855f5['stack']);if(_0x855f5[_0xdc13('0x2a')]){delete _0x855f5['name'];}_0x343918[_0xdc13('0x1c')](_0x51962d)[_0xdc13('0x2b')](_0x855f5);};}exports['index']=function(_0x552a37,_0x10762d){var _0x2e6425={},_0x3c2d06={},_0x15e923={'count':0x0,'rows':[]};var _0x3f6ff8=_[_0xdc13('0x2c')](db[_0xdc13('0x2d')]['rawAttributes'],function(_0x1d8dc9){return{'name':_0x1d8dc9[_0xdc13('0x2e')],'type':_0x1d8dc9[_0xdc13('0x2f')][_0xdc13('0x30')]};});_0x3c2d06[_0xdc13('0x31')]=_[_0xdc13('0x2c')](_0x3f6ff8,_0xdc13('0x2a'));_0x3c2d06['query']=_[_0xdc13('0x32')](_0x552a37[_0xdc13('0x33')]);_0x3c2d06[_0xdc13('0x34')]=_[_0xdc13('0x35')](_0x3c2d06[_0xdc13('0x31')],_0x3c2d06[_0xdc13('0x33')]);_0x2e6425['attributes']=_['intersection'](_0x3c2d06['model'],qs[_0xdc13('0x36')](_0x552a37[_0xdc13('0x33')]['fields']));_0x2e6425[_0xdc13('0x37')]=_0x2e6425[_0xdc13('0x37')][_0xdc13('0x38')]?_0x2e6425[_0xdc13('0x37')]:_0x3c2d06[_0xdc13('0x31')];if(!_0x552a37[_0xdc13('0x33')][_0xdc13('0x39')](_0xdc13('0x3a'))){_0x2e6425['limit']=qs[_0xdc13('0x1f')](_0x552a37[_0xdc13('0x33')][_0xdc13('0x1f')]);_0x2e6425[_0xdc13('0x1d')]=qs[_0xdc13('0x1d')](_0x552a37[_0xdc13('0x33')][_0xdc13('0x1d')]);}_0x2e6425['order']=qs['sort'](_0x552a37[_0xdc13('0x33')][_0xdc13('0x3b')]);_0x2e6425['where']=qs[_0xdc13('0x34')](_[_0xdc13('0x3c')](_0x552a37[_0xdc13('0x33')],_0x3c2d06[_0xdc13('0x34')]),_0x3f6ff8);if(_0x552a37[_0xdc13('0x33')]['filter']){_0x2e6425[_0xdc13('0x3d')]=_['merge'](_0x2e6425['where'],{'$or':_[_0xdc13('0x2c')](_0x3f6ff8,function(_0x440710){if(_0x440710[_0xdc13('0x2f')]!==_0xdc13('0x3e')){var _0x2a5a5c={};_0x2a5a5c[_0x440710['name']]={'$like':'%'+_0x552a37['query'][_0xdc13('0x3f')]+'%'};return _0x2a5a5c;}})});}_0x2e6425=_[_0xdc13('0x40')]({},_0x2e6425,_0x552a37['options']);var _0x130079={'where':_0x2e6425[_0xdc13('0x3d')]};return db[_0xdc13('0x2d')][_0xdc13('0x20')](_0x130079)[_0xdc13('0x27')](function(_0x429762){_0x15e923[_0xdc13('0x20')]=_0x429762;if(_0x552a37['query'][_0xdc13('0x41')]){_0x2e6425[_0xdc13('0x42')]=[{'all':!![]}];}return db[_0xdc13('0x2d')][_0xdc13('0x43')](_0x2e6425);})[_0xdc13('0x27')](function(_0x550408){_0x15e923[_0xdc13('0x44')]=_0x550408;return _0x15e923;})['then'](respondWithFilteredResult(_0x10762d,_0x2e6425))[_0xdc13('0x45')](handleError(_0x10762d,null));};exports[_0xdc13('0x46')]=function(_0x3f9f20,_0x930015){var _0x5e5249={'raw':!![],'where':{'id':_0x3f9f20[_0xdc13('0x47')]['id']}},_0x46c2e8={};_0x46c2e8[_0xdc13('0x31')]=_[_0xdc13('0x32')](db['AnalyticTreeReport']['rawAttributes']);_0x46c2e8[_0xdc13('0x33')]=_[_0xdc13('0x32')](_0x3f9f20[_0xdc13('0x33')]);_0x46c2e8[_0xdc13('0x34')]=_[_0xdc13('0x35')](_0x46c2e8[_0xdc13('0x31')],_0x46c2e8['query']);_0x5e5249[_0xdc13('0x37')]=_['intersection'](_0x46c2e8[_0xdc13('0x31')],qs[_0xdc13('0x36')](_0x3f9f20[_0xdc13('0x33')][_0xdc13('0x36')]));_0x5e5249[_0xdc13('0x37')]=_0x5e5249['attributes'][_0xdc13('0x38')]?_0x5e5249[_0xdc13('0x37')]:_0x46c2e8[_0xdc13('0x31')];if(_0x3f9f20[_0xdc13('0x33')][_0xdc13('0x41')]){_0x5e5249[_0xdc13('0x42')]=[{'all':!![]}];}_0x5e5249=_[_0xdc13('0x40')]({},_0x5e5249,_0x3f9f20[_0xdc13('0x48')]);return db[_0xdc13('0x2d')][_0xdc13('0x49')](_0x5e5249)[_0xdc13('0x27')](handleEntityNotFound(_0x930015,null))[_0xdc13('0x27')](respondWithResult(_0x930015,null))[_0xdc13('0x45')](handleError(_0x930015,null));};exports[_0xdc13('0x4a')]=function(_0x1ab229,_0x20847c){return db['AnalyticTreeReport'][_0xdc13('0x4a')](_0x1ab229['body'],{})[_0xdc13('0x27')](respondWithResult(_0x20847c,0xc9))[_0xdc13('0x45')](handleError(_0x20847c,null));};exports[_0xdc13('0x26')]=function(_0x23934f,_0x359c70){if(_0x23934f['body']['id']){delete _0x23934f[_0xdc13('0x4b')]['id'];}return db['AnalyticTreeReport'][_0xdc13('0x49')]({'where':{'id':_0x23934f[_0xdc13('0x47')]['id']}})[_0xdc13('0x27')](handleEntityNotFound(_0x359c70,null))[_0xdc13('0x27')](saveUpdates(_0x23934f[_0xdc13('0x4b')],null))[_0xdc13('0x27')](respondWithResult(_0x359c70,null))[_0xdc13('0x45')](handleError(_0x359c70,null));};exports[_0xdc13('0x28')]=function(_0x1aa568,_0x1f30f6){return db[_0xdc13('0x2d')][_0xdc13('0x49')]({'where':{'id':_0x1aa568[_0xdc13('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f30f6,null))['then'](removeEntity(_0x1f30f6,null))[_0xdc13('0x45')](handleError(_0x1f30f6,null));};
\ No newline at end of file
+var _0x4525=['rows','catch','show','params','keys','intersection','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','sendStatus','stack','name','send','index','map','AnalyticTreeReport','fieldName','filters','model','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x271934,_0x236c06){var _0x26db69=function(_0x1c2314){while(--_0x1c2314){_0x271934['push'](_0x271934['shift']());}};_0x26db69(++_0x236c06);}(_0x4525,0xec));var _0x5452=function(_0x593cd7,_0x25abb9){_0x593cd7=_0x593cd7-0x0;var _0x47a67e=_0x4525[_0x593cd7];return _0x47a67e;};'use strict';var emlformat=require(_0x5452('0x0'));var rimraf=require(_0x5452('0x1'));var zipdir=require(_0x5452('0x2'));var jsonpatch=require(_0x5452('0x3'));var rp=require('request-promise');var moment=require(_0x5452('0x4'));var BPromise=require(_0x5452('0x5'));var Mustache=require(_0x5452('0x6'));var util=require(_0x5452('0x7'));var path=require(_0x5452('0x8'));var sox=require('sox');var csv=require(_0x5452('0x9'));var ejs=require(_0x5452('0xa'));var fs=require('fs');var fs_extra=require(_0x5452('0xb'));var _=require(_0x5452('0xc'));var squel=require(_0x5452('0xd'));var crypto=require(_0x5452('0xe'));var jsforce=require(_0x5452('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5452('0x9'));var querystring=require(_0x5452('0x10'));var Papa=require(_0x5452('0x11'));var Redis=require(_0x5452('0x12'));var authService=require(_0x5452('0x13'));var qs=require(_0x5452('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5452('0x15'));var logger=require(_0x5452('0x16'))('api');var utils=require(_0x5452('0x17'));var config=require(_0x5452('0x18'));var licenseUtil=require(_0x5452('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35e520,_0x1b5484){_0x1b5484=_0x1b5484||0xcc;return function(_0x3e1dc1){if(_0x3e1dc1){return _0x35e520['sendStatus'](_0x1b5484);}return _0x35e520[_0x5452('0x1a')](_0x1b5484)[_0x5452('0x1b')]();};}function respondWithResult(_0x3d213d,_0x342b13){_0x342b13=_0x342b13||0xc8;return function(_0x40059f){if(_0x40059f){return _0x3d213d[_0x5452('0x1a')](_0x342b13)[_0x5452('0x1c')](_0x40059f);}};}function respondWithFilteredResult(_0x56ba5a,_0x3a794f){return function(_0x333ff6){if(_0x333ff6){var _0x4a13e4=typeof _0x3a794f[_0x5452('0x1d')]==='undefined'&&typeof _0x3a794f['limit']===_0x5452('0x1e');var _0x4178b9=_0x333ff6[_0x5452('0x1f')];var _0x4b5eaa=_0x4a13e4?0x0:_0x3a794f[_0x5452('0x1d')];var _0x314d03=_0x4a13e4?_0x333ff6[_0x5452('0x1f')]:_0x3a794f['offset']+_0x3a794f[_0x5452('0x20')];var _0x3521bd;if(_0x314d03>=_0x4178b9){_0x314d03=_0x4178b9;_0x3521bd=0xc8;}else{_0x3521bd=0xce;}_0x56ba5a['status'](_0x3521bd);return _0x56ba5a[_0x5452('0x21')](_0x5452('0x22'),_0x4b5eaa+'-'+_0x314d03+'/'+_0x4178b9)[_0x5452('0x1c')](_0x333ff6);}return null;};}function patchUpdates(_0x205d81){return function(_0x83b632){try{jsonpatch['apply'](_0x83b632,_0x205d81,!![]);}catch(_0x4fafb8){return BPromise[_0x5452('0x23')](_0x4fafb8);}return _0x83b632[_0x5452('0x24')]();};}function saveUpdates(_0x56a321,_0x48ba67){return function(_0x4e3a43){if(_0x4e3a43){return _0x4e3a43[_0x5452('0x25')](_0x56a321)[_0x5452('0x26')](function(_0x2b2c36){return _0x2b2c36;});}return null;};}function removeEntity(_0x1baaed,_0x55e9fc){return function(_0x14b8d1){if(_0x14b8d1){return _0x14b8d1['destroy']()[_0x5452('0x26')](function(){_0x1baaed[_0x5452('0x1a')](0xcc)[_0x5452('0x1b')]();});}};}function handleEntityNotFound(_0x20d13e,_0x12ba97){return function(_0x58e8db){if(!_0x58e8db){_0x20d13e[_0x5452('0x27')](0x194);}return _0x58e8db;};}function handleError(_0x15003e,_0x2a9f37){_0x2a9f37=_0x2a9f37||0x1f4;return function(_0x322678){logger['error'](_0x322678[_0x5452('0x28')]);if(_0x322678[_0x5452('0x29')]){delete _0x322678['name'];}_0x15003e[_0x5452('0x1a')](_0x2a9f37)[_0x5452('0x2a')](_0x322678);};}exports[_0x5452('0x2b')]=function(_0x909efb,_0x4c26e4){var _0x80ba8f={},_0x4097d2={},_0x425ae0={'count':0x0,'rows':[]};var _0x5e9827=_[_0x5452('0x2c')](db[_0x5452('0x2d')]['rawAttributes'],function(_0x4b0a2d){return{'name':_0x4b0a2d[_0x5452('0x2e')],'type':_0x4b0a2d['type']['key']};});_0x4097d2['model']=_[_0x5452('0x2c')](_0x5e9827,_0x5452('0x29'));_0x4097d2['query']=_['keys'](_0x909efb['query']);_0x4097d2[_0x5452('0x2f')]=_['intersection'](_0x4097d2[_0x5452('0x30')],_0x4097d2[_0x5452('0x31')]);_0x80ba8f[_0x5452('0x32')]=_['intersection'](_0x4097d2[_0x5452('0x30')],qs[_0x5452('0x33')](_0x909efb[_0x5452('0x31')][_0x5452('0x33')]));_0x80ba8f[_0x5452('0x32')]=_0x80ba8f[_0x5452('0x32')][_0x5452('0x34')]?_0x80ba8f[_0x5452('0x32')]:_0x4097d2[_0x5452('0x30')];if(!_0x909efb[_0x5452('0x31')]['hasOwnProperty'](_0x5452('0x35'))){_0x80ba8f[_0x5452('0x20')]=qs[_0x5452('0x20')](_0x909efb[_0x5452('0x31')]['limit']);_0x80ba8f[_0x5452('0x1d')]=qs['offset'](_0x909efb[_0x5452('0x31')][_0x5452('0x1d')]);}_0x80ba8f[_0x5452('0x36')]=qs[_0x5452('0x37')](_0x909efb[_0x5452('0x31')][_0x5452('0x37')]);_0x80ba8f[_0x5452('0x38')]=qs['filters'](_[_0x5452('0x39')](_0x909efb[_0x5452('0x31')],_0x4097d2[_0x5452('0x2f')]),_0x5e9827);if(_0x909efb[_0x5452('0x31')][_0x5452('0x3a')]){_0x80ba8f[_0x5452('0x38')]=_[_0x5452('0x3b')](_0x80ba8f[_0x5452('0x38')],{'$or':_[_0x5452('0x2c')](_0x5e9827,function(_0x57d204){if(_0x57d204['type']!==_0x5452('0x3c')){var _0x23d010={};_0x23d010[_0x57d204['name']]={'$like':'%'+_0x909efb[_0x5452('0x31')]['filter']+'%'};return _0x23d010;}})});}_0x80ba8f=_[_0x5452('0x3b')]({},_0x80ba8f,_0x909efb[_0x5452('0x3d')]);var _0xb9a0f6={'where':_0x80ba8f[_0x5452('0x38')]};return db[_0x5452('0x2d')][_0x5452('0x1f')](_0xb9a0f6)['then'](function(_0x543b05){_0x425ae0['count']=_0x543b05;if(_0x909efb[_0x5452('0x31')][_0x5452('0x3e')]){_0x80ba8f['include']=[{'all':!![]}];}return db[_0x5452('0x2d')][_0x5452('0x3f')](_0x80ba8f);})[_0x5452('0x26')](function(_0x20ebc4){_0x425ae0[_0x5452('0x40')]=_0x20ebc4;return _0x425ae0;})['then'](respondWithFilteredResult(_0x4c26e4,_0x80ba8f))[_0x5452('0x41')](handleError(_0x4c26e4,null));};exports[_0x5452('0x42')]=function(_0x4fb449,_0x10845f){var _0x894d9d={'raw':!![],'where':{'id':_0x4fb449[_0x5452('0x43')]['id']}},_0x2b1639={};_0x2b1639[_0x5452('0x30')]=_['keys'](db[_0x5452('0x2d')]['rawAttributes']);_0x2b1639[_0x5452('0x31')]=_[_0x5452('0x44')](_0x4fb449['query']);_0x2b1639[_0x5452('0x2f')]=_[_0x5452('0x45')](_0x2b1639[_0x5452('0x30')],_0x2b1639['query']);_0x894d9d[_0x5452('0x32')]=_[_0x5452('0x45')](_0x2b1639[_0x5452('0x30')],qs[_0x5452('0x33')](_0x4fb449[_0x5452('0x31')][_0x5452('0x33')]));_0x894d9d['attributes']=_0x894d9d[_0x5452('0x32')][_0x5452('0x34')]?_0x894d9d['attributes']:_0x2b1639['model'];if(_0x4fb449[_0x5452('0x31')][_0x5452('0x3e')]){_0x894d9d[_0x5452('0x46')]=[{'all':!![]}];}_0x894d9d=_[_0x5452('0x3b')]({},_0x894d9d,_0x4fb449[_0x5452('0x3d')]);return db[_0x5452('0x2d')][_0x5452('0x47')](_0x894d9d)['then'](handleEntityNotFound(_0x10845f,null))[_0x5452('0x26')](respondWithResult(_0x10845f,null))[_0x5452('0x41')](handleError(_0x10845f,null));};exports['create']=function(_0x56fc3e,_0x4186f7){return db[_0x5452('0x2d')][_0x5452('0x48')](_0x56fc3e[_0x5452('0x49')],{})['then'](respondWithResult(_0x4186f7,0xc9))[_0x5452('0x41')](handleError(_0x4186f7,null));};exports[_0x5452('0x25')]=function(_0x5f49d2,_0x40d93a){if(_0x5f49d2[_0x5452('0x49')]['id']){delete _0x5f49d2['body']['id'];}return db['AnalyticTreeReport'][_0x5452('0x47')]({'where':{'id':_0x5f49d2['params']['id']}})[_0x5452('0x26')](handleEntityNotFound(_0x40d93a,null))[_0x5452('0x26')](saveUpdates(_0x5f49d2['body'],null))[_0x5452('0x26')](respondWithResult(_0x40d93a,null))[_0x5452('0x41')](handleError(_0x40d93a,null));};exports[_0x5452('0x4a')]=function(_0x462a7f,_0x140bc5){return db['AnalyticTreeReport']['find']({'where':{'id':_0x462a7f[_0x5452('0x43')]['id']}})[_0x5452('0x26')](handleEntityNotFound(_0x140bc5,null))[_0x5452('0x26')](removeEntity(_0x140bc5,null))['catch'](handleError(_0x140bc5,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 52d8f4a..ee38204 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 _0x478d=['exports','define','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes'];(function(_0x21b736,_0x4e94ff){var _0x3611cd=function(_0xa74cd9){while(--_0xa74cd9){_0x21b736['push'](_0x21b736['shift']());}};_0x3611cd(++_0x4e94ff);}(_0x478d,0x12e));var _0xd478=function(_0x499b78,_0x4ed368){_0x499b78=_0x499b78-0x0;var _0x5e4e9e=_0x478d[_0x499b78];return _0x5e4e9e;};'use strict';var _=require('lodash');var util=require(_0xd478('0x0'));var logger=require(_0xd478('0x1'))(_0xd478('0x2'));var moment=require('moment');var BPromise=require(_0xd478('0x3'));var rp=require(_0xd478('0x4'));var fs=require('fs');var path=require(_0xd478('0x5'));var rimraf=require(_0xd478('0x6'));var config=require('../../config/environment');var attributes=require(_0xd478('0x7'));module[_0xd478('0x8')]=function(_0x4ebfce,_0x5edf81){return _0x4ebfce[_0xd478('0x9')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7be7=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger'];(function(_0x1d14c0,_0xaaf038){var _0x54ebc0=function(_0x1684c9){while(--_0x1684c9){_0x1d14c0['push'](_0x1d14c0['shift']());}};_0x54ebc0(++_0xaaf038);}(_0x7be7,0x1b7));var _0x77be=function(_0x2401fd,_0x1bb90e){_0x2401fd=_0x2401fd-0x0;var _0x33a677=_0x7be7[_0x2401fd];return _0x33a677;};'use strict';var _=require(_0x77be('0x0'));var util=require(_0x77be('0x1'));var logger=require(_0x77be('0x2'))(_0x77be('0x3'));var moment=require(_0x77be('0x4'));var BPromise=require('bluebird');var rp=require(_0x77be('0x5'));var fs=require('fs');var path=require(_0x77be('0x6'));var rimraf=require(_0x77be('0x7'));var config=require(_0x77be('0x8'));var attributes=require(_0x77be('0x9'));module[_0x77be('0xa')]=function(_0x1fb592,_0x4c3548){return _0x1fb592[_0x77be('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0x77be('0xc'),'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 36a6b96..51d72eb 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x53d978,_0x1de9d8){var _0xd27e99=function(_0x5d7e2e){while(--_0x5d7e2e){_0x53d978['push'](_0x53d978['shift']());}};_0xd27e99(++_0x1de9d8);}(_0x1261,0x144));var _0x1126=function(_0x309385,_0x3ab38f){_0x309385=_0x309385-0x0;var _0x45b0f5=_0x1261[_0x309385];return _0x45b0f5;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3db604,_0x387384){var _0x7f023=function(_0x42537a){while(--_0x42537a){_0x3db604['push'](_0x3db604['shift']());}};_0x7f023(++_0x387384);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1403ac,_0x532100){_0x1403ac=_0x1403ac-0x0;var _0x368514=_0x5f2f[_0x1403ac];return _0x368514;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index a1e463b..552f087 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 _0xe436=['update','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','isAuthenticated','show','post','put','/:id'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe436,0xc9));var _0x6e43=function(_0x9e192,_0x159b0f){_0x9e192=_0x9e192-0x0;var _0x4a6400=_0xe436[_0x9e192];return _0x4a6400;};'use strict';var multer=require(_0x6e43('0x0'));var util=require(_0x6e43('0x1'));var path=require('path');var timeout=require(_0x6e43('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6e43('0x3'));var auth=require(_0x6e43('0x4'));var interaction=require(_0x6e43('0x5'));var config=require(_0x6e43('0x6'));var controller=require(_0x6e43('0x7'));router[_0x6e43('0x8')]('/',auth['isAuthenticated'](),controller[_0x6e43('0x9')]);router['get']('/:id',auth[_0x6e43('0xa')](),controller[_0x6e43('0xb')]);router[_0x6e43('0xc')]('/',auth[_0x6e43('0xa')](),controller['create']);router[_0x6e43('0xd')](_0x6e43('0xe'),auth[_0x6e43('0xa')](),controller[_0x6e43('0xf')]);router[_0x6e43('0x10')](_0x6e43('0xe'),auth[_0x6e43('0xa')](),controller['destroy']);module[_0x6e43('0x11')]=router;
\ No newline at end of file
+var _0x1348=['show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x5ad0d7,_0x2645f8){var _0xd83bd=function(_0x33d3bd){while(--_0x33d3bd){_0x5ad0d7['push'](_0x5ad0d7['shift']());}};_0xd83bd(++_0x2645f8);}(_0x1348,0xc4));var _0x8134=function(_0x118637,_0x1a65f3){_0x118637=_0x118637-0x0;var _0x5768e8=_0x1348[_0x118637];return _0x5768e8;};'use strict';var multer=require(_0x8134('0x0'));var util=require('util');var path=require(_0x8134('0x1'));var timeout=require(_0x8134('0x2'));var express=require(_0x8134('0x3'));var router=express[_0x8134('0x4')]();var fs_extra=require(_0x8134('0x5'));var auth=require(_0x8134('0x6'));var interaction=require(_0x8134('0x7'));var config=require(_0x8134('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x8134('0x9')]('/',auth['isAuthenticated'](),controller[_0x8134('0xa')]);router[_0x8134('0x9')](_0x8134('0xb'),auth[_0x8134('0xc')](),controller[_0x8134('0xd')]);router['post']('/',auth[_0x8134('0xc')](),controller[_0x8134('0xe')]);router[_0x8134('0xf')](_0x8134('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8134('0x10')](_0x8134('0xb'),auth['isAuthenticated'](),controller[_0x8134('0x11')]);module[_0x8134('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index e4c2e42..2d03005 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 _0x2830=['sequelize','exports','STRING'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x2830,0x117));var _0x0283=function(_0x1a39d3,_0x50bbbf){_0x1a39d3=_0x1a39d3-0x0;var _0x2881b5=_0x2830[_0x1a39d3];return _0x2881b5;};'use strict';var Sequelize=require(_0x0283('0x0'));module[_0x0283('0x1')]={'name':{'type':Sequelize[_0x0283('0x2')]},'basename':{'type':Sequelize[_0x0283('0x2')]},'type':{'type':Sequelize[_0x0283('0x2')]}};
\ No newline at end of file
+var _0x323b=['STRING','sequelize'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x323b,0x1ad));var _0xb323=function(_0x458a5b,_0x659004){_0x458a5b=_0x458a5b-0x0;var _0x193558=_0x323b[_0x458a5b];return _0x193558;};'use strict';var Sequelize=require(_0xb323('0x0'));module['exports']={'name':{'type':Sequelize[_0xb323('0x1')]},'basename':{'type':Sequelize[_0xb323('0x1')]},'type':{'type':Sequelize[_0xb323('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index b8f93f0..ee6e8bc 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 _0xaa0f=['join','offline-chat/','basename','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Attachment','includeAll','include','findAll','catch','params','length','find','clone','get','omit','createdAt','body','create','filename','file','mimetype','download','ChatOfflineMessageId'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xaa0f,0x1a7));var _0xfaa0=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0xaa0f[_0x385c76];return _0x5c8367;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfaa0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfaa0('0x1'));var moment=require(_0xfaa0('0x2'));var BPromise=require(_0xfaa0('0x3'));var Mustache=require(_0xfaa0('0x4'));var util=require(_0xfaa0('0x5'));var path=require(_0xfaa0('0x6'));var sox=require(_0xfaa0('0x7'));var csv=require(_0xfaa0('0x8'));var ejs=require(_0xfaa0('0x9'));var fs=require('fs');var fs_extra=require(_0xfaa0('0xa'));var _=require('lodash');var squel=require(_0xfaa0('0xb'));var crypto=require('crypto');var jsforce=require(_0xfaa0('0xc'));var deskjs=require(_0xfaa0('0xd'));var toCsv=require(_0xfaa0('0x8'));var querystring=require(_0xfaa0('0xe'));var Papa=require(_0xfaa0('0xf'));var Redis=require(_0xfaa0('0x10'));var authService=require(_0xfaa0('0x11'));var qs=require(_0xfaa0('0x12'));var as=require(_0xfaa0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfaa0('0x14'))(_0xfaa0('0x15'));var utils=require('../../config/utils');var config=require(_0xfaa0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfaa0('0x17'))['db'];function respondWithStatusCode(_0x592548,_0x3efa27){_0x3efa27=_0x3efa27||0xcc;return function(_0x2fd461){if(_0x2fd461){return _0x592548[_0xfaa0('0x18')](_0x3efa27);}return _0x592548[_0xfaa0('0x19')](_0x3efa27)[_0xfaa0('0x1a')]();};}function respondWithResult(_0x37a4d6,_0x3863a6){_0x3863a6=_0x3863a6||0xc8;return function(_0x1a0c2f){if(_0x1a0c2f){return _0x37a4d6[_0xfaa0('0x19')](_0x3863a6)[_0xfaa0('0x1b')](_0x1a0c2f);}};}function respondWithFilteredResult(_0x19ad51,_0x1a90ca){return function(_0x809c17){if(_0x809c17){var _0x57a6dd=typeof _0x1a90ca[_0xfaa0('0x1c')]===_0xfaa0('0x1d')&&typeof _0x1a90ca[_0xfaa0('0x1e')]===_0xfaa0('0x1d');var _0x3cc939=_0x809c17[_0xfaa0('0x1f')];var _0x27beac=_0x57a6dd?0x0:_0x1a90ca['offset'];var _0x594af4=_0x57a6dd?_0x809c17[_0xfaa0('0x1f')]:_0x1a90ca[_0xfaa0('0x1c')]+_0x1a90ca[_0xfaa0('0x1e')];var _0x56be02;if(_0x594af4>=_0x3cc939){_0x594af4=_0x3cc939;_0x56be02=0xc8;}else{_0x56be02=0xce;}_0x19ad51[_0xfaa0('0x19')](_0x56be02);return _0x19ad51['set'](_0xfaa0('0x20'),_0x27beac+'-'+_0x594af4+'/'+_0x3cc939)[_0xfaa0('0x1b')](_0x809c17);}return null;};}function patchUpdates(_0x1cb008){return function(_0x1eab27){try{jsonpatch[_0xfaa0('0x21')](_0x1eab27,_0x1cb008,!![]);}catch(_0x436e54){return BPromise['reject'](_0x436e54);}return _0x1eab27[_0xfaa0('0x22')]();};}function saveUpdates(_0x3b8856,_0x388f04){return function(_0x1495d7){if(_0x1495d7){return _0x1495d7[_0xfaa0('0x23')](_0x3b8856)[_0xfaa0('0x24')](function(_0x3fd61c){return _0x3fd61c;});}return null;};}function removeEntity(_0x59b1ac,_0xbfeb86){return function(_0x57088b){if(_0x57088b){return _0x57088b[_0xfaa0('0x25')]()['then'](function(){_0x59b1ac[_0xfaa0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30078a,_0x53aef9){return function(_0xcbb59f){if(!_0xcbb59f){_0x30078a['sendStatus'](0x194);}return _0xcbb59f;};}function handleError(_0xe7a138,_0x11560b){_0x11560b=_0x11560b||0x1f4;return function(_0x5628d6){logger[_0xfaa0('0x26')](_0x5628d6[_0xfaa0('0x27')]);if(_0x5628d6[_0xfaa0('0x28')]){delete _0x5628d6['name'];}_0xe7a138[_0xfaa0('0x19')](_0x11560b)[_0xfaa0('0x29')](_0x5628d6);};}exports[_0xfaa0('0x2a')]=function(_0x3f2482,_0x45fb0e){var _0x16f6d3={},_0xa73bc6={},_0x53ee29={'count':0x0,'rows':[]};var _0x456ff1=_['map'](db['Attachment'][_0xfaa0('0x2b')],function(_0xa1a7b1){return{'name':_0xa1a7b1[_0xfaa0('0x2c')],'type':_0xa1a7b1[_0xfaa0('0x2d')]['key']};});_0xa73bc6[_0xfaa0('0x2e')]=_['map'](_0x456ff1,_0xfaa0('0x28'));_0xa73bc6[_0xfaa0('0x2f')]=_[_0xfaa0('0x30')](_0x3f2482[_0xfaa0('0x2f')]);_0xa73bc6[_0xfaa0('0x31')]=_[_0xfaa0('0x32')](_0xa73bc6[_0xfaa0('0x2e')],_0xa73bc6[_0xfaa0('0x2f')]);_0x16f6d3[_0xfaa0('0x33')]=_[_0xfaa0('0x32')](_0xa73bc6[_0xfaa0('0x2e')],qs['fields'](_0x3f2482[_0xfaa0('0x2f')][_0xfaa0('0x34')]));_0x16f6d3[_0xfaa0('0x33')]=_0x16f6d3[_0xfaa0('0x33')]['length']?_0x16f6d3[_0xfaa0('0x33')]:_0xa73bc6['model'];if(!_0x3f2482[_0xfaa0('0x2f')]['hasOwnProperty'](_0xfaa0('0x35'))){_0x16f6d3[_0xfaa0('0x1e')]=qs[_0xfaa0('0x1e')](_0x3f2482[_0xfaa0('0x2f')][_0xfaa0('0x1e')]);_0x16f6d3['offset']=qs[_0xfaa0('0x1c')](_0x3f2482[_0xfaa0('0x2f')][_0xfaa0('0x1c')]);}_0x16f6d3[_0xfaa0('0x36')]=qs[_0xfaa0('0x37')](_0x3f2482[_0xfaa0('0x2f')][_0xfaa0('0x37')]);_0x16f6d3[_0xfaa0('0x38')]=qs['filters'](_[_0xfaa0('0x39')](_0x3f2482['query'],_0xa73bc6[_0xfaa0('0x31')]),_0x456ff1);if(_0x3f2482['query'][_0xfaa0('0x3a')]){_0x16f6d3[_0xfaa0('0x38')]=_[_0xfaa0('0x3b')](_0x16f6d3[_0xfaa0('0x38')],{'$or':_['map'](_0x456ff1,function(_0x32f9b6){if(_0x32f9b6[_0xfaa0('0x2d')]!==_0xfaa0('0x3c')){var _0x2c9fbf={};_0x2c9fbf[_0x32f9b6[_0xfaa0('0x28')]]={'$like':'%'+_0x3f2482[_0xfaa0('0x2f')][_0xfaa0('0x3a')]+'%'};return _0x2c9fbf;}})});}_0x16f6d3=_['merge']({},_0x16f6d3,_0x3f2482[_0xfaa0('0x3d')]);var _0x27cd92={'where':_0x16f6d3[_0xfaa0('0x38')]};return db[_0xfaa0('0x3e')][_0xfaa0('0x1f')](_0x27cd92)[_0xfaa0('0x24')](function(_0x877eb7){_0x53ee29[_0xfaa0('0x1f')]=_0x877eb7;if(_0x3f2482[_0xfaa0('0x2f')][_0xfaa0('0x3f')]){_0x16f6d3[_0xfaa0('0x40')]=[{'all':!![]}];}return db[_0xfaa0('0x3e')][_0xfaa0('0x41')](_0x16f6d3);})[_0xfaa0('0x24')](function(_0x1e1681){_0x53ee29['rows']=_0x1e1681;return _0x53ee29;})['then'](respondWithFilteredResult(_0x45fb0e,_0x16f6d3))[_0xfaa0('0x42')](handleError(_0x45fb0e,null));};exports['show']=function(_0x43d376,_0x541153){var _0x39810={'raw':!![],'where':{'id':_0x43d376[_0xfaa0('0x43')]['id']}},_0x1ccdf7={};_0x1ccdf7[_0xfaa0('0x2e')]=_[_0xfaa0('0x30')](db['Attachment'][_0xfaa0('0x2b')]);_0x1ccdf7[_0xfaa0('0x2f')]=_['keys'](_0x43d376[_0xfaa0('0x2f')]);_0x1ccdf7['filters']=_[_0xfaa0('0x32')](_0x1ccdf7['model'],_0x1ccdf7[_0xfaa0('0x2f')]);_0x39810['attributes']=_['intersection'](_0x1ccdf7[_0xfaa0('0x2e')],qs[_0xfaa0('0x34')](_0x43d376[_0xfaa0('0x2f')][_0xfaa0('0x34')]));_0x39810['attributes']=_0x39810['attributes'][_0xfaa0('0x44')]?_0x39810[_0xfaa0('0x33')]:_0x1ccdf7[_0xfaa0('0x2e')];if(_0x43d376[_0xfaa0('0x2f')][_0xfaa0('0x3f')]){_0x39810[_0xfaa0('0x40')]=[{'all':!![]}];}_0x39810=_['merge']({},_0x39810,_0x43d376[_0xfaa0('0x3d')]);return db[_0xfaa0('0x3e')][_0xfaa0('0x45')](_0x39810)[_0xfaa0('0x24')](handleEntityNotFound(_0x541153,null))[_0xfaa0('0x24')](respondWithResult(_0x541153,null))[_0xfaa0('0x42')](handleError(_0x541153,null));};exports[_0xfaa0('0x46')]=function(_0x5d6913,_0x1d0c67){var _0x489d87={'where':{'id':_0x5d6913[_0xfaa0('0x43')]['id']}},_0x1c02ff={};_0x1c02ff[_0xfaa0('0x2e')]=_[_0xfaa0('0x30')](db['Attachment'][_0xfaa0('0x2b')]);_0x489d87[_0xfaa0('0x33')]=_[_0xfaa0('0x32')](_0x1c02ff[_0xfaa0('0x2e')],qs[_0xfaa0('0x34')](_0x5d6913[_0xfaa0('0x2f')]['fields']));_0x489d87[_0xfaa0('0x33')]=_0x489d87[_0xfaa0('0x33')][_0xfaa0('0x44')]?_0x489d87['attributes']:_0x1c02ff['model'];if(_0x5d6913[_0xfaa0('0x2f')]['includeAll']){_0x489d87['include']=[{'all':!![]}];}_0x489d87=_['merge']({},_0x489d87,_0x5d6913[_0xfaa0('0x3d')]);return db[_0xfaa0('0x3e')][_0xfaa0('0x45')](_0x489d87)[_0xfaa0('0x24')](handleEntityNotFound(_0x1d0c67,null))['then'](function(_0x1ddb3c){if(_0x1ddb3c){var _0x2de155=_0x1ddb3c[_0xfaa0('0x47')]({'plain':!![]});_0x2de155=qs[_0xfaa0('0x48')](_0x2de155,['id',_0xfaa0('0x49'),'updatedAt']);_0x5d6913[_0xfaa0('0x4a')]=_[_0xfaa0('0x48')](_0x5d6913[_0xfaa0('0x4a')],['id','createdAt','updatedAt']);return db['Attachment'][_0xfaa0('0x4b')](_['merge'](_0x2de155,_0x5d6913[_0xfaa0('0x4a')]),{'include':_0x5d6913[_0xfaa0('0x2f')][_0xfaa0('0x3f')]?[{'all':!![]}]:undefined});}})[_0xfaa0('0x24')](respondWithResult(_0x1d0c67,0xc9))['catch'](handleError(_0x1d0c67,null));};exports[_0xfaa0('0x23')]=function(_0x497123,_0x1e628b){if(_0x497123[_0xfaa0('0x4a')]['id']){delete _0x497123[_0xfaa0('0x4a')]['id'];}return db[_0xfaa0('0x3e')][_0xfaa0('0x45')]({'where':{'id':_0x497123['params']['id']}})[_0xfaa0('0x24')](handleEntityNotFound(_0x1e628b,null))[_0xfaa0('0x24')](saveUpdates(_0x497123[_0xfaa0('0x4a')],null))[_0xfaa0('0x24')](respondWithResult(_0x1e628b,null))[_0xfaa0('0x42')](handleError(_0x1e628b,null));};exports[_0xfaa0('0x25')]=function(_0x699f72,_0x27c8db){return db['Attachment'][_0xfaa0('0x45')]({'where':{'id':_0x699f72[_0xfaa0('0x43')]['id']}})['then'](handleEntityNotFound(_0x27c8db,null))[_0xfaa0('0x24')](removeEntity(_0x27c8db,null))[_0xfaa0('0x42')](handleError(_0x27c8db,null));};exports[_0xfaa0('0x4b')]=function(_0x430e13,_0x241a07,_0x111f67){_0x430e13[_0xfaa0('0x4a')][_0xfaa0('0x28')]=_0x430e13['file']['originalname'];_0x430e13[_0xfaa0('0x4a')]['basename']=_0x430e13['file'][_0xfaa0('0x4c')];_0x430e13[_0xfaa0('0x4a')][_0xfaa0('0x2d')]=_0x430e13[_0xfaa0('0x4d')][_0xfaa0('0x4e')];return db['Attachment'][_0xfaa0('0x4b')](_0x430e13['body'])[_0xfaa0('0x24')](respondWithResult(_0x241a07,0xc9))[_0xfaa0('0x42')](handleError(_0x241a07,null));};exports[_0xfaa0('0x4f')]=function(_0x2ee27c,_0x360f3d,_0x5a175b){return db[_0xfaa0('0x3e')]['findOne']({'where':{'id':_0x2ee27c[_0xfaa0('0x43')]['id']},'raw':!![]})[_0xfaa0('0x24')](handleEntityNotFound(_0x360f3d,null))[_0xfaa0('0x24')](function(_0x556956){if(_0x556956){var _0x51c012=_0x556956[_0xfaa0('0x50')]!==null;var _0x5cad0c=path['join'](config['root'],'server/files/attachments/');if(_0x51c012){_0x5cad0c=path[_0xfaa0('0x51')](_0x5cad0c,_0xfaa0('0x52'));}var _0x29b943=path[_0xfaa0('0x51')](_0x5cad0c,_0x556956[_0xfaa0('0x53')]);return _0x360f3d['download'](_0x29b943);}})['catch'](handleError(_0x360f3d,null));};
\ No newline at end of file
+var _0x70c8=['pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','clone','length','get','omit','body','createdAt','updatedAt','create','file','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','basename','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Attachment','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x70c8,0xd5));var _0x870c=function(_0x106518,_0x5d731f){_0x106518=_0x106518-0x0;var _0x1eaf90=_0x70c8[_0x106518];return _0x1eaf90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x870c('0x0'));var zipdir=require(_0x870c('0x1'));var jsonpatch=require(_0x870c('0x2'));var rp=require(_0x870c('0x3'));var moment=require(_0x870c('0x4'));var BPromise=require(_0x870c('0x5'));var Mustache=require('mustache');var util=require(_0x870c('0x6'));var path=require('path');var sox=require(_0x870c('0x7'));var csv=require(_0x870c('0x8'));var ejs=require(_0x870c('0x9'));var fs=require('fs');var fs_extra=require(_0x870c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x870c('0xb'));var jsforce=require(_0x870c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x870c('0x8'));var querystring=require(_0x870c('0xd'));var Papa=require(_0x870c('0xe'));var Redis=require(_0x870c('0xf'));var authService=require(_0x870c('0x10'));var qs=require(_0x870c('0x11'));var as=require(_0x870c('0x12'));var hardwareService=require(_0x870c('0x13'));var logger=require(_0x870c('0x14'))(_0x870c('0x15'));var utils=require(_0x870c('0x16'));var config=require(_0x870c('0x17'));var licenseUtil=require(_0x870c('0x18'));var db=require(_0x870c('0x19'))['db'];function respondWithStatusCode(_0x3523f4,_0x1207d6){_0x1207d6=_0x1207d6||0xcc;return function(_0x3952a5){if(_0x3952a5){return _0x3523f4[_0x870c('0x1a')](_0x1207d6);}return _0x3523f4['status'](_0x1207d6)[_0x870c('0x1b')]();};}function respondWithResult(_0x66e324,_0x2570f0){_0x2570f0=_0x2570f0||0xc8;return function(_0x113cde){if(_0x113cde){return _0x66e324[_0x870c('0x1c')](_0x2570f0)[_0x870c('0x1d')](_0x113cde);}};}function respondWithFilteredResult(_0x2e1ec9,_0x240b9d){return function(_0xf473ad){if(_0xf473ad){var _0x542793=typeof _0x240b9d['offset']===_0x870c('0x1e')&&typeof _0x240b9d[_0x870c('0x1f')]===_0x870c('0x1e');var _0x474c24=_0xf473ad[_0x870c('0x20')];var _0x50e84b=_0x542793?0x0:_0x240b9d[_0x870c('0x21')];var _0x2f6cfa=_0x542793?_0xf473ad[_0x870c('0x20')]:_0x240b9d[_0x870c('0x21')]+_0x240b9d['limit'];var _0x30a09e;if(_0x2f6cfa>=_0x474c24){_0x2f6cfa=_0x474c24;_0x30a09e=0xc8;}else{_0x30a09e=0xce;}_0x2e1ec9[_0x870c('0x1c')](_0x30a09e);return _0x2e1ec9['set'](_0x870c('0x22'),_0x50e84b+'-'+_0x2f6cfa+'/'+_0x474c24)['json'](_0xf473ad);}return null;};}function patchUpdates(_0x1e8207){return function(_0x1c9075){try{jsonpatch[_0x870c('0x23')](_0x1c9075,_0x1e8207,!![]);}catch(_0x492f50){return BPromise[_0x870c('0x24')](_0x492f50);}return _0x1c9075[_0x870c('0x25')]();};}function saveUpdates(_0xbe3a12,_0x420e95){return function(_0x1d118d){if(_0x1d118d){return _0x1d118d[_0x870c('0x26')](_0xbe3a12)[_0x870c('0x27')](function(_0x3520fd){return _0x3520fd;});}return null;};}function removeEntity(_0x2a0acf,_0x21248b){return function(_0x2735b7){if(_0x2735b7){return _0x2735b7[_0x870c('0x28')]()[_0x870c('0x27')](function(){_0x2a0acf['status'](0xcc)[_0x870c('0x1b')]();});}};}function handleEntityNotFound(_0x506a1c,_0xda6fb){return function(_0x38a693){if(!_0x38a693){_0x506a1c[_0x870c('0x1a')](0x194);}return _0x38a693;};}function handleError(_0x2451ae,_0x1d5ae6){_0x1d5ae6=_0x1d5ae6||0x1f4;return function(_0x111c75){logger[_0x870c('0x29')](_0x111c75[_0x870c('0x2a')]);if(_0x111c75[_0x870c('0x2b')]){delete _0x111c75['name'];}_0x2451ae['status'](_0x1d5ae6)['send'](_0x111c75);};}exports['index']=function(_0x3870c0,_0x59991d){var _0x525486={},_0x12a433={},_0x3d1970={'count':0x0,'rows':[]};var _0x437491=_['map'](db[_0x870c('0x2c')][_0x870c('0x2d')],function(_0x9e7233){return{'name':_0x9e7233[_0x870c('0x2e')],'type':_0x9e7233[_0x870c('0x2f')]['key']};});_0x12a433[_0x870c('0x30')]=_[_0x870c('0x31')](_0x437491,_0x870c('0x2b'));_0x12a433[_0x870c('0x32')]=_[_0x870c('0x33')](_0x3870c0[_0x870c('0x32')]);_0x12a433[_0x870c('0x34')]=_[_0x870c('0x35')](_0x12a433[_0x870c('0x30')],_0x12a433[_0x870c('0x32')]);_0x525486[_0x870c('0x36')]=_[_0x870c('0x35')](_0x12a433[_0x870c('0x30')],qs[_0x870c('0x37')](_0x3870c0[_0x870c('0x32')]['fields']));_0x525486['attributes']=_0x525486[_0x870c('0x36')]['length']?_0x525486[_0x870c('0x36')]:_0x12a433[_0x870c('0x30')];if(!_0x3870c0[_0x870c('0x32')][_0x870c('0x38')](_0x870c('0x39'))){_0x525486['limit']=qs[_0x870c('0x1f')](_0x3870c0[_0x870c('0x32')]['limit']);_0x525486['offset']=qs[_0x870c('0x21')](_0x3870c0[_0x870c('0x32')][_0x870c('0x21')]);}_0x525486['order']=qs[_0x870c('0x3a')](_0x3870c0[_0x870c('0x32')][_0x870c('0x3a')]);_0x525486[_0x870c('0x3b')]=qs[_0x870c('0x34')](_[_0x870c('0x3c')](_0x3870c0[_0x870c('0x32')],_0x12a433[_0x870c('0x34')]),_0x437491);if(_0x3870c0['query'][_0x870c('0x3d')]){_0x525486[_0x870c('0x3b')]=_['merge'](_0x525486[_0x870c('0x3b')],{'$or':_[_0x870c('0x31')](_0x437491,function(_0x2c6d44){if(_0x2c6d44[_0x870c('0x2f')]!==_0x870c('0x3e')){var _0x4a091c={};_0x4a091c[_0x2c6d44['name']]={'$like':'%'+_0x3870c0[_0x870c('0x32')][_0x870c('0x3d')]+'%'};return _0x4a091c;}})});}_0x525486=_[_0x870c('0x3f')]({},_0x525486,_0x3870c0[_0x870c('0x40')]);var _0x2f5ecc={'where':_0x525486['where']};return db[_0x870c('0x2c')][_0x870c('0x20')](_0x2f5ecc)['then'](function(_0x5bc3a7){_0x3d1970[_0x870c('0x20')]=_0x5bc3a7;if(_0x3870c0[_0x870c('0x32')][_0x870c('0x41')]){_0x525486[_0x870c('0x42')]=[{'all':!![]}];}return db['Attachment'][_0x870c('0x43')](_0x525486);})[_0x870c('0x27')](function(_0x2e32d1){_0x3d1970[_0x870c('0x44')]=_0x2e32d1;return _0x3d1970;})[_0x870c('0x27')](respondWithFilteredResult(_0x59991d,_0x525486))[_0x870c('0x45')](handleError(_0x59991d,null));};exports[_0x870c('0x46')]=function(_0x523b15,_0x1fa253){var _0x4600ff={'raw':!![],'where':{'id':_0x523b15[_0x870c('0x47')]['id']}},_0x397a31={};_0x397a31[_0x870c('0x30')]=_['keys'](db['Attachment'][_0x870c('0x2d')]);_0x397a31[_0x870c('0x32')]=_['keys'](_0x523b15['query']);_0x397a31[_0x870c('0x34')]=_[_0x870c('0x35')](_0x397a31[_0x870c('0x30')],_0x397a31[_0x870c('0x32')]);_0x4600ff[_0x870c('0x36')]=_[_0x870c('0x35')](_0x397a31[_0x870c('0x30')],qs[_0x870c('0x37')](_0x523b15[_0x870c('0x32')][_0x870c('0x37')]));_0x4600ff[_0x870c('0x36')]=_0x4600ff['attributes']['length']?_0x4600ff[_0x870c('0x36')]:_0x397a31[_0x870c('0x30')];if(_0x523b15['query']['includeAll']){_0x4600ff[_0x870c('0x42')]=[{'all':!![]}];}_0x4600ff=_[_0x870c('0x3f')]({},_0x4600ff,_0x523b15[_0x870c('0x40')]);return db['Attachment'][_0x870c('0x48')](_0x4600ff)[_0x870c('0x27')](handleEntityNotFound(_0x1fa253,null))[_0x870c('0x27')](respondWithResult(_0x1fa253,null))[_0x870c('0x45')](handleError(_0x1fa253,null));};exports[_0x870c('0x49')]=function(_0x116495,_0x1bb082){var _0x377a6e={'where':{'id':_0x116495[_0x870c('0x47')]['id']}},_0x3ba2c1={};_0x3ba2c1[_0x870c('0x30')]=_[_0x870c('0x33')](db[_0x870c('0x2c')][_0x870c('0x2d')]);_0x377a6e[_0x870c('0x36')]=_[_0x870c('0x35')](_0x3ba2c1['model'],qs[_0x870c('0x37')](_0x116495[_0x870c('0x32')][_0x870c('0x37')]));_0x377a6e[_0x870c('0x36')]=_0x377a6e[_0x870c('0x36')][_0x870c('0x4a')]?_0x377a6e[_0x870c('0x36')]:_0x3ba2c1[_0x870c('0x30')];if(_0x116495[_0x870c('0x32')]['includeAll']){_0x377a6e[_0x870c('0x42')]=[{'all':!![]}];}_0x377a6e=_[_0x870c('0x3f')]({},_0x377a6e,_0x116495['options']);return db['Attachment'][_0x870c('0x48')](_0x377a6e)['then'](handleEntityNotFound(_0x1bb082,null))[_0x870c('0x27')](function(_0x5a4a17){if(_0x5a4a17){var _0x16689f=_0x5a4a17[_0x870c('0x4b')]({'plain':!![]});_0x16689f=qs[_0x870c('0x4c')](_0x16689f,['id','createdAt','updatedAt']);_0x116495[_0x870c('0x4d')]=_['omit'](_0x116495['body'],['id',_0x870c('0x4e'),_0x870c('0x4f')]);return db['Attachment'][_0x870c('0x50')](_[_0x870c('0x3f')](_0x16689f,_0x116495[_0x870c('0x4d')]),{'include':_0x116495[_0x870c('0x32')][_0x870c('0x41')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x1bb082,0xc9))['catch'](handleError(_0x1bb082,null));};exports['update']=function(_0x576ef9,_0x170a21){if(_0x576ef9[_0x870c('0x4d')]['id']){delete _0x576ef9[_0x870c('0x4d')]['id'];}return db['Attachment'][_0x870c('0x48')]({'where':{'id':_0x576ef9[_0x870c('0x47')]['id']}})[_0x870c('0x27')](handleEntityNotFound(_0x170a21,null))[_0x870c('0x27')](saveUpdates(_0x576ef9[_0x870c('0x4d')],null))[_0x870c('0x27')](respondWithResult(_0x170a21,null))['catch'](handleError(_0x170a21,null));};exports[_0x870c('0x28')]=function(_0x163218,_0x2e4f82){return db[_0x870c('0x2c')][_0x870c('0x48')]({'where':{'id':_0x163218['params']['id']}})[_0x870c('0x27')](handleEntityNotFound(_0x2e4f82,null))['then'](removeEntity(_0x2e4f82,null))[_0x870c('0x45')](handleError(_0x2e4f82,null));};exports[_0x870c('0x50')]=function(_0x256265,_0x2c03e2,_0x3626c4){_0x256265[_0x870c('0x4d')][_0x870c('0x2b')]=_0x256265[_0x870c('0x51')]['originalname'];_0x256265[_0x870c('0x4d')]['basename']=_0x256265[_0x870c('0x51')][_0x870c('0x52')];_0x256265[_0x870c('0x4d')]['type']=_0x256265[_0x870c('0x51')][_0x870c('0x53')];return db['Attachment'][_0x870c('0x50')](_0x256265[_0x870c('0x4d')])[_0x870c('0x27')](respondWithResult(_0x2c03e2,0xc9))[_0x870c('0x45')](handleError(_0x2c03e2,null));};exports['download']=function(_0x5671b8,_0x23887d,_0x514b96){return db[_0x870c('0x2c')][_0x870c('0x54')]({'where':{'id':_0x5671b8[_0x870c('0x47')]['id']},'raw':!![]})[_0x870c('0x27')](handleEntityNotFound(_0x23887d,null))[_0x870c('0x27')](function(_0x217e56){if(_0x217e56){var _0x203675=_0x217e56[_0x870c('0x55')]!==null;var _0x50aeb1=path[_0x870c('0x56')](config[_0x870c('0x57')],_0x870c('0x58'));if(_0x203675){_0x50aeb1=path[_0x870c('0x56')](_0x50aeb1,'offline-chat/');}var _0x519ad7=path[_0x870c('0x56')](_0x50aeb1,_0x217e56[_0x870c('0x59')]);return _0x23887d[_0x870c('0x5a')](_0x519ad7);}})['catch'](handleError(_0x23887d,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index abca8c7..9ac39bc 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 _0xb8a7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./attachment.attributes','define','Attachment','attachments','lodash'];(function(_0x2059df,_0x367401){var _0xdd848b=function(_0x13055b){while(--_0x13055b){_0x2059df['push'](_0x2059df['shift']());}};_0xdd848b(++_0x367401);}(_0xb8a7,0x81));var _0x7b8a=function(_0x535a87,_0x590522){_0x535a87=_0x535a87-0x0;var _0x1327c5=_0xb8a7[_0x535a87];return _0x1327c5;};'use strict';var _=require(_0x7b8a('0x0'));var util=require(_0x7b8a('0x1'));var logger=require(_0x7b8a('0x2'))(_0x7b8a('0x3'));var moment=require(_0x7b8a('0x4'));var BPromise=require(_0x7b8a('0x5'));var rp=require(_0x7b8a('0x6'));var fs=require('fs');var path=require(_0x7b8a('0x7'));var rimraf=require(_0x7b8a('0x8'));var config=require('../../config/environment');var attributes=require(_0x7b8a('0x9'));module['exports']=function(_0x3e3f24,_0x15572e){return _0x3e3f24[_0x7b8a('0xa')](_0x7b8a('0xb'),attributes,{'tableName':_0x7b8a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b58=['bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','lodash','../../config/logger','moment'];(function(_0x2ccbfb,_0x39cb77){var _0x138826=function(_0x5ae547){while(--_0x5ae547){_0x2ccbfb['push'](_0x2ccbfb['shift']());}};_0x138826(++_0x39cb77);}(_0x6b58,0x17e));var _0x86b5=function(_0x437d7f,_0x1feb46){_0x437d7f=_0x437d7f-0x0;var _0x31058c=_0x6b58[_0x437d7f];return _0x31058c;};'use strict';var _=require(_0x86b5('0x0'));var util=require('util');var logger=require(_0x86b5('0x1'))('api');var moment=require(_0x86b5('0x2'));var BPromise=require(_0x86b5('0x3'));var rp=require(_0x86b5('0x4'));var fs=require('fs');var path=require(_0x86b5('0x5'));var rimraf=require(_0x86b5('0x6'));var config=require(_0x86b5('0x7'));var attributes=require(_0x86b5('0x8'));module[_0x86b5('0x9')]=function(_0x42863b,_0x1cc2d1){return _0x42863b[_0x86b5('0xa')]('Attachment',attributes,{'tableName':'attachments','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 3c473df..e29048e 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 _0xfaa4=['http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Attachment','create','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2f2af,_0x572e68){var _0x163165=function(_0x5d35fa){while(--_0x5d35fa){_0x2f2af['push'](_0x2f2af['shift']());}};_0x163165(++_0x572e68);}(_0xfaa4,0x1a8));var _0x4faa=function(_0xdd087e,_0xb09416){_0xdd087e=_0xdd087e-0x0;var _0x1e59ed=_0xfaa4[_0xdd087e];return _0x1e59ed;};'use strict';var _=require(_0x4faa('0x0'));var util=require(_0x4faa('0x1'));var moment=require(_0x4faa('0x2'));var BPromise=require(_0x4faa('0x3'));var rs=require(_0x4faa('0x4'));var fs=require('fs');var Redis=require(_0x4faa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4faa('0x6'));var logger=require(_0x4faa('0x7'))(_0x4faa('0x8'));var config=require(_0x4faa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4faa('0xa')][_0x4faa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa46a7d,_0x504f83,_0x528871){return new BPromise(function(_0x5d476f,_0x159843){return client[_0x4faa('0xc')](_0xa46a7d,_0x528871)[_0x4faa('0xd')](function(_0x4dd4d4){logger[_0x4faa('0xe')](_0x4faa('0xf'),_0x504f83,_0x4faa('0x10'));logger[_0x4faa('0x11')](_0x4faa('0x12'),_0x504f83,'request\x20sent',JSON['stringify'](_0x4dd4d4));if(_0x4dd4d4[_0x4faa('0x13')]){if(_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x14')]===0x1f4){logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);return _0x159843(_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);}logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x4dd4d4[_0x4faa('0x13')][_0x4faa('0x15')]);return _0x5d476f(_0x4dd4d4['error'][_0x4faa('0x15')]);}else{logger[_0x4faa('0xe')](_0x4faa('0xf'),_0x504f83,'request\x20sent');_0x5d476f(_0x4dd4d4[_0x4faa('0x16')][_0x4faa('0x15')]);}})[_0x4faa('0x17')](function(_0x536a2b){logger[_0x4faa('0x13')](_0x4faa('0xf'),_0x504f83,_0x536a2b);_0x159843(_0x536a2b);});});}exports['CreateAttachment']=function(_0x5d8c8a){var _0x5444d9=this;return new Promise(function(_0x33592d,_0x361cdc){return db[_0x4faa('0x18')][_0x4faa('0x19')](_0x5d8c8a['body'],{'raw':_0x5d8c8a[_0x4faa('0x1a')]?_0x5d8c8a[_0x4faa('0x1a')][_0x4faa('0x1b')]===undefined?!![]:![]:!![]})[_0x4faa('0xd')](function(_0x492417){logger[_0x4faa('0xe')]('CreateAttachment',_0x5d8c8a);logger['debug'](_0x4faa('0x1c'),_0x5d8c8a,JSON['stringify'](_0x492417));_0x33592d(_0x492417);})['catch'](function(_0x14683b){logger[_0x4faa('0x13')](_0x4faa('0x1c'),_0x14683b[_0x4faa('0x15')],_0x5d8c8a);_0x361cdc(_0x5444d9[_0x4faa('0x13')](0x1f4,_0x14683b[_0x4faa('0x15')]));});});};
\ No newline at end of file
+var _0xaaa2=['code','Attachment,\x20%s,\x20%s','message','info','result','CreateAttachment','create','body','options','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error'];(function(_0x246034,_0x20698a){var _0x55ea66=function(_0x34888f){while(--_0x34888f){_0x246034['push'](_0x246034['shift']());}};_0x55ea66(++_0x20698a);}(_0xaaa2,0xac));var _0x2aaa=function(_0x1167f3,_0x560ab1){_0x1167f3=_0x1167f3-0x0;var _0x355aea=_0xaaa2[_0x1167f3];return _0x355aea;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var moment=require(_0x2aaa('0x2'));var BPromise=require(_0x2aaa('0x3'));var rs=require(_0x2aaa('0x4'));var fs=require('fs');var Redis=require(_0x2aaa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2aaa('0x6'));var logger=require('../../config/logger')(_0x2aaa('0x7'));var config=require(_0x2aaa('0x8'));var jayson=require(_0x2aaa('0x9'));var client=jayson[_0x2aaa('0xa')][_0x2aaa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106af9,_0x4f51e6,_0x2f16d7){return new BPromise(function(_0x514c32,_0x505fe8){return client[_0x2aaa('0xc')](_0x106af9,_0x2f16d7)['then'](function(_0x1ad6e9){logger['info']('Attachment,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));logger[_0x2aaa('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'),JSON[_0x2aaa('0xf')](_0x1ad6e9));if(_0x1ad6e9[_0x2aaa('0x10')]){if(_0x1ad6e9['error'][_0x2aaa('0x11')]===0x1f4){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x505fe8(_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);}logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x514c32(_0x1ad6e9[_0x2aaa('0x10')]['message']);}else{logger[_0x2aaa('0x14')]('Attachment,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));_0x514c32(_0x1ad6e9[_0x2aaa('0x15')]['message']);}})['catch'](function(_0x50a767){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x50a767);_0x505fe8(_0x50a767);});});}exports[_0x2aaa('0x16')]=function(_0x3b94bf){var _0x1cae3e=this;return new Promise(function(_0xdaa445,_0x38a049){return db['Attachment'][_0x2aaa('0x17')](_0x3b94bf[_0x2aaa('0x18')],{'raw':_0x3b94bf['options']?_0x3b94bf[_0x2aaa('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1ec32e){logger[_0x2aaa('0x14')](_0x2aaa('0x16'),_0x3b94bf);logger[_0x2aaa('0xe')](_0x2aaa('0x16'),_0x3b94bf,JSON[_0x2aaa('0xf')](_0x1ec32e));_0xdaa445(_0x1ec32e);})[_0x2aaa('0x1a')](function(_0x24da1e){logger['error'](_0x2aaa('0x16'),_0x24da1e[_0x2aaa('0x13')],_0x3b94bf);_0x38a049(_0x1cae3e['error'](0x1f4,_0x24da1e['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index cee2e14..d266cde 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x38e559,_0x512d53){var _0x39ee30=function(_0x2a5aaf){while(--_0x2a5aaf){_0x38e559['push'](_0x38e559['shift']());}};_0x39ee30(++_0x512d53);}(_0x2032,0xd9));var _0x2203=function(_0x72227e,_0x401f13){_0x72227e=_0x72227e-0x0;var _0x4f84bc=_0x2032[_0x72227e];return _0x4f84bc;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _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(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'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 58af99f..7eaf215 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 _0x6b06=['minutes','clearBlockUser','getLicense','catch','status','send','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','passport','passport-local','Strategy','../../config/utils','../../config/environment','../../config/logger','api','undefined','activedirectory','baseDN','domain','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','name','disabled','blocked','blockedAt','online','user','agent','add'];(function(_0x56019f,_0x306a23){var _0x50a58c=function(_0x3de80f){while(--_0x3de80f){_0x56019f['push'](_0x56019f['shift']());}};_0x50a58c(++_0x306a23);}(_0x6b06,0xd4));var _0x66b0=function(_0x5c6900,_0xb078e3){_0x5c6900=_0x5c6900-0x0;var _0x1cb0ac=_0x6b06[_0x5c6900];return _0x1cb0ac;};'use strict';var passport=require(_0x66b0('0x0'));var LocalStrategy=require(_0x66b0('0x1'))[_0x66b0('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require('util');var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x66b0('0x3'));var config=require(_0x66b0('0x4'));var logger=require(_0x66b0('0x5'))(_0x66b0('0x6'));function isActiveDirectoryConfigured(_0xf58416){var _0x11e816=![];if(typeof _0xf58416['activedirectory']!==_0x66b0('0x7')){_0x11e816=_0xf58416[_0x66b0('0x8')][_0x66b0('0x9')]&&_0xf58416[_0x66b0('0x8')]['url']&&_0xf58416[_0x66b0('0x8')][_0x66b0('0xa')];}return _0x11e816;}function adAuthenticate(_0x5c7785,_0x46b369,_0x44fd99){return new BPromise(function(_0x37b1b6,_0x104a70){try{var _0x2b443b=new ActiveDirectory(_0x5c7785);_0x2b443b['authenticate'](_0x46b369,_0x44fd99,function(_0x51bfdd,_0x58c271){if(_0x51bfdd){logger[_0x66b0('0xb')]('Error\x20authenticate\x20%s:\x20%s',_0x46b369,util['inspect'](_0x51bfdd,{'showHidden':![],'depth':null}));_0x104a70(_0x66b0('0xc'));}else if(!_0x58c271){logger[_0x66b0('0xb')](_0x66b0('0xd'),_0x46b369);_0x104a70(_0x66b0('0xc'));}else{_0x37b1b6(_0x58c271);}});}catch(_0x3ad46e){_0x104a70(_0x3ad46e);}});}function ActiveDirectoryAuthenticate(_0x5c67df,_0x4214ee,_0x7f8263,_0xfc1415){var _0x3fa001,_0x2e1096;if(!isActiveDirectoryConfigured(config)){logger[_0x66b0('0xb')](_0x66b0('0xe'),_0x4214ee);return _0xfc1415(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x66b0('0xf')][_0x66b0('0x10')]({'where':{'id':0x1},'attributes':[_0x66b0('0x11'),_0x66b0('0x12')],'raw':!![]})[_0x66b0('0x13')](function(_0x27e5c4){_0x3fa001=_0x27e5c4;if(!_0x3fa001[_0x66b0('0x11')]){logger[_0x66b0('0xb')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x4214ee);throw new Error(_0x66b0('0xc'));}return _0x5c67df['findOne']({'attributes':['id',_0x66b0('0x14'),'password','salt','role',_0x66b0('0x15'),_0x66b0('0x16'),_0x66b0('0x17'),_0x66b0('0x18')],'where':{'name':_0x4214ee,'role':{'$or':['admin',_0x66b0('0x19'),_0x66b0('0x1a')]},'adSsoEnabled':!![]}});})[_0x66b0('0x13')](function(_0x92da2a){if(!_0x92da2a||_0x92da2a&&_0x92da2a[_0x66b0('0x14')]!==_0x4214ee){throw new Error(_0x66b0('0xc'));}_0x2e1096=_0x92da2a;var _0x4af0e1=_0x2e1096['name']+'@'+config[_0x66b0('0x8')]['domain'];return adAuthenticate(config['activedirectory'],_0x4af0e1,_0x7f8263);})[_0x66b0('0x13')](function(_0x96e126){if(_0x2e1096[_0x66b0('0x15')]){throw new Error(_0x66b0('0xc'));}if(_0x3fa001[_0x66b0('0x12')]>0x0){if(_0x2e1096[_0x66b0('0x16')]){if(moment(_0x2e1096[_0x66b0('0x17')])[_0x66b0('0x1b')](_0x3fa001[_0x66b0('0x12')],_0x66b0('0x1c'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x66b0('0x1d')](_0x2e1096,0x0,![],null)[_0x66b0('0x13')](function(){return utils[_0x66b0('0x1e')](_0x2e1096);})[_0x66b0('0x13')](function(){return _0xfc1415(null,_0x2e1096);});}else{return utils[_0x66b0('0x1e')](_0x2e1096)[_0x66b0('0x13')](function(){return _0xfc1415(null,_0x2e1096);});}}else{return utils[_0x66b0('0x1e')](_0x2e1096)[_0x66b0('0x13')](function(){return _0xfc1415(null,_0x2e1096);});}})[_0x66b0('0x1f')](function(_0x32b0e1){return _0xfc1415(null,![],_0x32b0e1);});}function handleError(_0x55c81c,_0x3a346d,_0x36df6f){return _0x55c81c[_0x66b0('0x20')](_0x3a346d||0x1f4)[_0x66b0('0x21')]({'message':_0x36df6f?_0x36df6f['message']||_0x36df6f:''});}exports[_0x66b0('0x22')]=function(_0x3e9c8c,_0x32b25b,_0x3fac95){passport[_0x66b0('0x23')](_0x66b0('0x24'),function(_0xfa12fb,_0xf64321,_0x3fcdde){var _0x3a6c67=_0xfa12fb||_0x3fcdde;if(_0x3a6c67){return handleError(_0x32b25b,0x191,_0x3a6c67);}if(!_0xf64321){return handleError(_0x32b25b,0x194,{'message':_0x66b0('0x25')});}else{var _0x40898a={'payload':{'id':_0xf64321['id'],'role':_0xf64321['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x40898a)[_0x66b0('0x13')](function(_0x5bdbbf){_0x32b25b[_0x66b0('0x26')]({'id':_0xf64321['id'],'token':_0x5bdbbf,'statusCall':'','isAlreadyLogged':_0xf64321[_0x66b0('0x18')]});});}})(_0x3e9c8c,_0x32b25b,_0x3fac95);};passport[_0x66b0('0x27')](_0x66b0('0x24'),new LocalStrategy({'usernameField':_0x66b0('0x14'),'passwordField':'password'},function(_0xe15666,_0x1cfb02,_0x5efd4e){return ActiveDirectoryAuthenticate(db['User'],_0xe15666,_0x1cfb02,_0x5efd4e);}));
\ No newline at end of file
+var _0x25ed=['disabled','blocked','online','user','agent','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status','send','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role'];(function(_0x486aa7,_0x53f341){var _0x30133c=function(_0x2eff80){while(--_0x2eff80){_0x486aa7['push'](_0x486aa7['shift']());}};_0x30133c(++_0x53f341);}(_0x25ed,0x1e8));var _0xd25e=function(_0x4fc583,_0x1c9563){_0x4fc583=_0x4fc583-0x0;var _0x3b884d=_0x25ed[_0x4fc583];return _0x3b884d;};'use strict';var passport=require(_0xd25e('0x0'));var LocalStrategy=require(_0xd25e('0x1'))['Strategy'];var moment=require(_0xd25e('0x2'));var ActiveDirectory=require(_0xd25e('0x3'));var BPromise=require(_0xd25e('0x4'));var util=require(_0xd25e('0x5'));var db=require(_0xd25e('0x6'))['db'];var authService=require(_0xd25e('0x7'));var utils=require(_0xd25e('0x8'));var config=require(_0xd25e('0x9'));var logger=require(_0xd25e('0xa'))(_0xd25e('0xb'));function isActiveDirectoryConfigured(_0x3ebdc7){var _0x220902=![];if(typeof _0x3ebdc7[_0xd25e('0xc')]!==_0xd25e('0xd')){_0x220902=_0x3ebdc7[_0xd25e('0xc')]['baseDN']&&_0x3ebdc7[_0xd25e('0xc')][_0xd25e('0xe')]&&_0x3ebdc7[_0xd25e('0xc')][_0xd25e('0xf')];}return _0x220902;}function adAuthenticate(_0x474bab,_0x4f15ee,_0x57ce1a){return new BPromise(function(_0x5da1fc,_0x5490d8){try{var _0x3d2530=new ActiveDirectory(_0x474bab);_0x3d2530[_0xd25e('0x10')](_0x4f15ee,_0x57ce1a,function(_0x131c3a,_0x43d9d6){if(_0x131c3a){logger[_0xd25e('0x11')](_0xd25e('0x12'),_0x4f15ee,util[_0xd25e('0x13')](_0x131c3a,{'showHidden':![],'depth':null}));_0x5490d8(_0xd25e('0x14'));}else if(!_0x43d9d6){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x4f15ee);_0x5490d8(_0xd25e('0x14'));}else{_0x5da1fc(_0x43d9d6);}});}catch(_0xecae2e){_0x5490d8(_0xecae2e);}});}function ActiveDirectoryAuthenticate(_0x5e6369,_0x293388,_0x862015,_0x296cc7){var _0x2ebd2d,_0x5e9481;if(!isActiveDirectoryConfigured(config)){logger[_0xd25e('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x293388);return _0x296cc7(null,![],{'message':_0xd25e('0x14')});}return db['Setting'][_0xd25e('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xd25e('0x16')],'raw':!![]})[_0xd25e('0x17')](function(_0x3d3cfb){_0x2ebd2d=_0x3d3cfb;if(!_0x2ebd2d[_0xd25e('0x18')]){logger[_0xd25e('0x11')](_0xd25e('0x19'),_0x293388);throw new Error(_0xd25e('0x14'));}return _0x5e6369[_0xd25e('0x15')]({'attributes':['id',_0xd25e('0x1a'),_0xd25e('0x1b'),'salt',_0xd25e('0x1c'),_0xd25e('0x1d'),_0xd25e('0x1e'),'blockedAt',_0xd25e('0x1f')],'where':{'name':_0x293388,'role':{'$or':['admin',_0xd25e('0x20'),_0xd25e('0x21')]},'adSsoEnabled':!![]}});})[_0xd25e('0x17')](function(_0x217539){if(!_0x217539||_0x217539&&_0x217539[_0xd25e('0x1a')]!==_0x293388){throw new Error(_0xd25e('0x14'));}_0x5e9481=_0x217539;var _0x2d812f=_0x5e9481[_0xd25e('0x1a')]+'@'+config['activedirectory'][_0xd25e('0xf')];return adAuthenticate(config[_0xd25e('0xc')],_0x2d812f,_0x862015);})[_0xd25e('0x17')](function(_0x33d297){if(_0x5e9481[_0xd25e('0x1d')]){throw new Error(_0xd25e('0x14'));}if(_0x2ebd2d[_0xd25e('0x16')]>0x0){if(_0x5e9481['blocked']){if(moment(_0x5e9481[_0xd25e('0x22')])[_0xd25e('0x23')](_0x2ebd2d[_0xd25e('0x16')],_0xd25e('0x24'))>moment()){throw new Error(_0xd25e('0x14'));}return utils[_0xd25e('0x25')](_0x5e9481,0x0,![],null)['then'](function(){return utils[_0xd25e('0x26')](_0x5e9481);})[_0xd25e('0x17')](function(){return _0x296cc7(null,_0x5e9481);});}else{return utils['getLicense'](_0x5e9481)[_0xd25e('0x17')](function(){return _0x296cc7(null,_0x5e9481);});}}else{return utils[_0xd25e('0x26')](_0x5e9481)[_0xd25e('0x17')](function(){return _0x296cc7(null,_0x5e9481);});}})[_0xd25e('0x27')](function(_0x51742e){return _0x296cc7(null,![],_0x51742e);});}function handleError(_0x171630,_0x23d7e2,_0x381e21){return _0x171630[_0xd25e('0x28')](_0x23d7e2||0x1f4)[_0xd25e('0x29')]({'message':_0x381e21?_0x381e21['message']||_0x381e21:''});}exports['login']=function(_0x30642e,_0x489f68,_0x1baf32){passport[_0xd25e('0x10')](_0xd25e('0x2a'),function(_0x294e93,_0x39e1c8,_0xcff3af){var _0x94f360=_0x294e93||_0xcff3af;if(_0x94f360){return handleError(_0x489f68,0x191,_0x94f360);}if(!_0x39e1c8){return handleError(_0x489f68,0x194,{'message':_0xd25e('0x2b')});}else{var _0x461d9f={'payload':{'id':_0x39e1c8['id'],'role':_0x39e1c8[_0xd25e('0x1c')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x461d9f)[_0xd25e('0x17')](function(_0xfcf88c){_0x489f68[_0xd25e('0x2c')]({'id':_0x39e1c8['id'],'token':_0xfcf88c,'statusCall':'','isAlreadyLogged':_0x39e1c8[_0xd25e('0x1f')]});});}})(_0x30642e,_0x489f68,_0x1baf32);};passport[_0xd25e('0x2d')](_0xd25e('0x2a'),new LocalStrategy({'usernameField':_0xd25e('0x1a'),'passwordField':'password'},function(_0x35a771,_0x1a670f,_0x5689de){return ActiveDirectoryAuthenticate(db[_0xd25e('0x2e')],_0x35a771,_0x1a670f,_0x5689de);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index c7f863b..73e74d5 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 _0x78c6=['Router','post','login','express'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x78c6,0xef));var _0x678c=function(_0xba4328,_0x26ca88){_0xba4328=_0xba4328-0x0;var _0x5a3fe3=_0x78c6[_0xba4328];return _0x5a3fe3;};'use strict';var express=require(_0x678c('0x0'));var router=express[_0x678c('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x678c('0x2')]('/',controller[_0x678c('0x3')]);module['exports']=router;
\ No newline at end of file
+var _0x2736=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0xee8b3b,_0x299d1b){var _0x2ec8ce=function(_0x343b9b){while(--_0x343b9b){_0xee8b3b['push'](_0xee8b3b['shift']());}};_0x2ec8ce(++_0x299d1b);}(_0x2736,0xd2));var _0x6273=function(_0x5480fd,_0x46600d){_0x5480fd=_0x5480fd-0x0;var _0x2ec312=_0x2736[_0x5480fd];return _0x2ec312;};'use strict';var express=require(_0x6273('0x0'));var router=express[_0x6273('0x1')]();var controller=require(_0x6273('0x2'));router[_0x6273('0x3')]('/',controller[_0x6273('0x4')]);module[_0x6273('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 5e2ade8..21793a5 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(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x7a54,0x106));var _0x47a5=function(_0x43e023,_0x57c0da){_0x43e023=_0x43e023-0x0;var _0x336754=_0x7a54[_0x43e023];return _0x336754;};'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(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x7a54,0x106));var _0x47a5=function(_0x118b16,_0x4b6d97){_0x118b16=_0x118b16-0x0;var _0x434deb=_0x7a54[_0x118b16];return _0x434deb;};'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 0fa10a9..5bb80ed 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 _0x0787=['./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','exports','express','Router'];(function(_0x6acb69,_0xd36dbf){var _0x29a021=function(_0x374293){while(--_0x374293){_0x6acb69['push'](_0x6acb69['shift']());}};_0x29a021(++_0xd36dbf);}(_0x0787,0x115));var _0x7078=function(_0x506172,_0xbc3a3){_0x506172=_0x506172-0x0;var _0x2723c0=_0x0787[_0x506172];return _0x2723c0;};'use strict';var express=require(_0x7078('0x0'));var passport=require('passport');var router=express[_0x7078('0x1')]();var controller=require(_0x7078('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x7078('0x3'));router[_0x7078('0x4')]('/',controller[_0x7078('0x5')]);router['get'](_0x7078('0x6'),controller[_0x7078('0x7')],authService['isMiddleware'],userController[_0x7078('0x5')],authService['setTokenCookie']);module[_0x7078('0x8')]=router;
\ No newline at end of file
+var _0x0571=['callback','setTokenCookie','express','passport','./authGoogle.controller','../../components/auth/service','get','login','/callback'];(function(_0x148cca,_0x2a682a){var _0xb72d55=function(_0x1eac15){while(--_0x1eac15){_0x148cca['push'](_0x148cca['shift']());}};_0xb72d55(++_0x2a682a);}(_0x0571,0xa4));var _0x1057=function(_0x40b2ed,_0x2b1765){_0x40b2ed=_0x40b2ed-0x0;var _0x18397d=_0x0571[_0x40b2ed];return _0x18397d;};'use strict';var express=require(_0x1057('0x0'));var passport=require(_0x1057('0x1'));var router=express['Router']();var controller=require(_0x1057('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x1057('0x3'));router[_0x1057('0x4')]('/',controller[_0x1057('0x5')]);router[_0x1057('0x4')](_0x1057('0x6'),controller[_0x1057('0x7')],authService['isMiddleware'],userController[_0x1057('0x5')],authService[_0x1057('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 d279a1e..8529625 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 _0xe0ac=['status','send','local-login','role','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','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','params','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','disabled','blocked','blockedAt','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','MailAccount','find','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','email','Smtp','user','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message'];(function(_0x35d45f,_0x52249d){var _0x4475e8=function(_0x148acc){while(--_0x148acc){_0x35d45f['push'](_0x35d45f['shift']());}};_0x4475e8(++_0x52249d);}(_0xe0ac,0x15a));var _0xce0a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0ac[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xce0a('0x0'));var passport=require('passport');var LocalStrategy=require(_0xce0a('0x1'))[_0xce0a('0x2')];var jayson=require(_0xce0a('0x3'));var _=require(_0xce0a('0x4'));var rs=require(_0xce0a('0x5'));var moment=require(_0xce0a('0x6'));var db=require(_0xce0a('0x7'))['db'];var authService=require(_0xce0a('0x8'));var utils=require(_0xce0a('0x9'));var client=jayson[_0xce0a('0xa')]['http']({'port':0x232b});function localAuthenticate(_0x4dc9a8,_0x1f023a,_0x25c2b8,_0x2f8ead){var _0x376fa5,_0x3e3556;return db[_0xce0a('0xb')][_0xce0a('0xc')]({'where':{'id':0x1},'attributes':[_0xce0a('0xd'),_0xce0a('0xe')],'raw':!![]})[_0xce0a('0xf')](function(_0x562b1b){_0x376fa5=_0x562b1b;return _0x4dc9a8[_0xce0a('0xc')]({'attributes':['id',_0xce0a('0x10'),_0xce0a('0x11'),'salt','role',_0xce0a('0x12'),_0xce0a('0x13'),_0xce0a('0x14'),_0xce0a('0x15')],'where':{'name':_0x1f023a,'role':{'$or':[_0xce0a('0x16'),'user','agent']}}});})[_0xce0a('0xf')](function(_0x1026ce){if(!_0x1026ce||_0x1026ce&&_0x1026ce[_0xce0a('0x10')]!==_0x1f023a){throw new Error(_0xce0a('0x17'));}else{_0x3e3556=_0x1026ce;return _0x3e3556;}})[_0xce0a('0xf')](function(){_0x3e3556[_0xce0a('0x18')](_0x25c2b8,function(_0xf24775,_0x33e1a0){var _0x2369f2=_0x3e3556['loginAttempts']+0x1;if(_0xf24775){return _0x2f8ead(_0xf24775);}else if(!_0x33e1a0){if(_0x3e3556['disabled']){return _0x2f8ead(null,![],{'message':_0xce0a('0x17')});}else if(_0x376fa5[_0xce0a('0xd')]>0x0){if(_0x3e3556[_0xce0a('0x13')]){if(_0x376fa5['blockDuration']>0x0){if(moment(_0x3e3556[_0xce0a('0x14')])[_0xce0a('0x19')](_0x376fa5[_0xce0a('0xe')],_0xce0a('0x1a'))>moment()){return _0x2f8ead(null,![],{'message':_0xce0a('0x17')});}else{return utils['clearBlockUser'](_0x3e3556,_0x2369f2,![],null)['then'](function(){return _0x2f8ead(null,![],{'message':_0xce0a('0x17')});});}}else{return _0x2f8ead(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2369f2>=_0x376fa5[_0xce0a('0xd')]){return utils[_0xce0a('0x1b')](_0x3e3556,0x0,!![],moment())[_0xce0a('0xf')](function(){return _0x2f8ead(null,![],{'message':_0xce0a('0x17')});});}else{return utils[_0xce0a('0x1b')](_0x3e3556,_0x2369f2,![],null)[_0xce0a('0xf')](function(){return _0x2f8ead(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2f8ead(null,![],{'message':_0xce0a('0x17')});}}else{if(_0x3e3556[_0xce0a('0x12')]){return _0x2f8ead(null,![],{'message':_0xce0a('0x17')});}else if(_0x376fa5[_0xce0a('0xd')]>0x0){if(_0x3e3556[_0xce0a('0x13')]){if(_0x376fa5[_0xce0a('0xe')]>0x0){if(moment(_0x3e3556['blockedAt'])[_0xce0a('0x19')](_0x376fa5[_0xce0a('0xe')],'minutes')>moment()){return _0x2f8ead(null,![],{'message':_0xce0a('0x17')});}else{return utils[_0xce0a('0x1b')](_0x3e3556,0x0,![],null)[_0xce0a('0xf')](function(){return utils['getLicense'](_0x3e3556);})[_0xce0a('0xf')](function(){return _0x2f8ead(null,_0x3e3556);});}}else{return _0x2f8ead(null,![],{'message':_0xce0a('0x17')});}}else{return utils[_0xce0a('0x1b')](_0x3e3556,0x0,![],null)['then'](function(){return utils[_0xce0a('0x1c')](_0x3e3556);})[_0xce0a('0xf')](function(){return _0x2f8ead(null,_0x3e3556);})['catch'](function(_0x5b8f72){return _0x2f8ead(null,![],_0x5b8f72);});}}else{if(_0x3e3556['blocked']){return _0x2f8ead(null,![],{'message':_0xce0a('0x17')});}else{return utils[_0xce0a('0x1c')](_0x3e3556)[_0xce0a('0xf')](function(){return _0x2f8ead(null,_0x3e3556);});}}}});})['catch'](function(_0x31b1fc){return _0x2f8ead(null,![],_0x31b1fc);});}function sendServiceMail(_0x34da06){return db[_0xce0a('0x1d')][_0xce0a('0x1e')]({'where':{'service':!![]},'attributes':['id',_0xce0a('0x10'),'email'],'include':[{'model':db[_0xce0a('0x1f')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xce0a('0x20')}]}]})[_0xce0a('0xf')](function(_0x437509){if(!_0x437509){throw new Error(_0xce0a('0x21'));}var _0x431452=_0x437509[_0xce0a('0x22')]();var _0x443402={'account':_0x431452,'message':_[_0xce0a('0x23')]({'from':util['format'](_0xce0a('0x24'),_0x437509[_0xce0a('0x10')],_0x437509[_0xce0a('0x25')]||_0x437509[_0xce0a('0x26')][_0xce0a('0x27')])},_0x34da06)};return client['request']('SendMail',_0x443402);})[_0xce0a('0xf')](function(_0x1056c5){if(_0x1056c5[_0xce0a('0x28')]){throw new Error(util[_0xce0a('0x29')](_0xce0a('0x2a'),_0x1056c5['error'][_0xce0a('0x2b')]||JSON['stringify'](_0x1056c5[_0xce0a('0x28')])));}return!![];});}function handleError(_0x4a57b0,_0x5da0a4,_0x4c7497){return _0x4a57b0[_0xce0a('0x2c')](_0x5da0a4||0x1f4)[_0xce0a('0x2d')]({'message':_0x4c7497?_0x4c7497[_0xce0a('0x2b')]||_0x4c7497:''});}exports['login']=function(_0x462ff8,_0x18dcc2,_0x4028d2){passport[_0xce0a('0x18')](_0xce0a('0x2e'),function(_0x370d43,_0x50e316,_0x32005b){var _0x399257=_0x370d43||_0x32005b;if(_0x399257){return handleError(_0x18dcc2,0x191,_0x399257);}if(!_0x50e316){return handleError(_0x18dcc2,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x45e854={'payload':{'id':_0x50e316['id'],'role':_0x50e316[_0xce0a('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0xce0a('0x30')](_0x45e854)[_0xce0a('0xf')](function(_0x491d75){_0x18dcc2[_0xce0a('0x31')]({'id':_0x50e316['id'],'token':_0x491d75,'statusCall':'','isAlreadyLogged':_0x50e316[_0xce0a('0x32')]});});}})(_0x462ff8,_0x18dcc2,_0x4028d2);};exports[_0xce0a('0x33')]=function(_0x361385,_0x254dec){if(!_0x361385['body'][_0xce0a('0x25')]){return handleError(_0x254dec,0x1f4,{'message':_0xce0a('0x34')});}var _0x2026f9=rs[_0xce0a('0x35')]();_0x361385[_0xce0a('0x36')][_0xce0a('0x25')]=_0x361385[_0xce0a('0x36')][_0xce0a('0x25')][_0xce0a('0x37')]()[_0xce0a('0x38')]();var _0x1696b7;return db[_0xce0a('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xce0a('0xe')],'raw':!![]})[_0xce0a('0xf')](function(_0x27e09b){_0x1696b7=_0x27e09b;return db[_0xce0a('0x39')][_0xce0a('0x1e')]({'where':{'email':_0x361385[_0xce0a('0x36')]['email']}});})[_0xce0a('0xf')](function(_0x34743a){if(!_0x34743a){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x34743a[_0xce0a('0x12')]){throw new Error(_0xce0a('0x3a'));}if(_0x34743a[_0xce0a('0x13')]){if(moment(_0x34743a[_0xce0a('0x14')])['add'](_0x1696b7[_0xce0a('0xe')],_0xce0a('0x1a'))>moment()){throw new Error(_0xce0a('0x3b'));}else{_0x34743a[_0xce0a('0x13')]=![];_0x34743a[_0xce0a('0x14')]=null;}}_0x34743a[_0xce0a('0x3c')]=_0x2026f9;_0x34743a[_0xce0a('0x3d')]=Date[_0xce0a('0x3e')]()+0x36ee80;return _0x34743a[_0xce0a('0x3f')]();})[_0xce0a('0xf')](function(){return sendServiceMail({'to':_0x361385[_0xce0a('0x36')]['email'],'subject':_0xce0a('0x40'),'text':_0xce0a('0x41')+_0xce0a('0x42')+_0xce0a('0x43')+_0x361385['headers'][_0xce0a('0x44')]+_0xce0a('0x45')+_0x2026f9+'\x0a\x0a'+_0xce0a('0x46')});})[_0xce0a('0xf')](function(){_0x254dec[_0xce0a('0x2c')](0xc8)[_0xce0a('0x2d')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x104a8a){return handleError(_0x254dec,0x1f4,_0x104a8a);});};exports['reset']=function(_0x3ca26a,_0x124ccb){return db['User'][_0xce0a('0x1e')]({'where':{'resetPasswordToken':_0x3ca26a[_0xce0a('0x47')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xce0a('0xf')](function(_0x2e7b8c){if(!_0x2e7b8c){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xce0a('0xb')][_0xce0a('0xc')]({'attributes':['id',_0xce0a('0x48'),_0xce0a('0x49'),_0xce0a('0x4a')]})[_0xce0a('0xf')](function(_0x2a9309){if(_0x2a9309['securePassword'])authService[_0xce0a('0x4b')](_0x3ca26a['body']['password']);if(!_0x2a9309['enforcePasswordHistory']||!_0x2e7b8c[_0xce0a('0x4c')])return _0x2e7b8c;authService[_0xce0a('0x4d')](_0x3ca26a[_0xce0a('0x36')]['password'],_0x2e7b8c['previousPasswords'],_0x2a9309[_0xce0a('0x4a')]);return _0x2e7b8c;})[_0xce0a('0xf')](function(){_0x2e7b8c[_0xce0a('0x11')]=_0x3ca26a[_0xce0a('0x36')][_0xce0a('0x11')];_0x2e7b8c['resetPasswordToken']=null;_0x2e7b8c[_0xce0a('0x3d')]=null;return _0x2e7b8c[_0xce0a('0x3f')]();});})['then'](function(){_0x124ccb[_0xce0a('0x2c')](0xc8)[_0xce0a('0x2d')]({'message':'Password\x20reset!'});})['catch'](function(_0xae97a7){return handleError(_0x124ccb,0x1f4,_0xae97a7);});};passport['use'](_0xce0a('0x2e'),new LocalStrategy({'usernameField':_0xce0a('0x10'),'passwordField':_0xce0a('0x11')},function(_0x1f3be1,_0x5ee156,_0x5526c4){return localAuthenticate(db[_0xce0a('0x39')],_0x1f3be1,_0x5ee156,_0x5526c4);}));
\ No newline at end of file
+var _0x24fb=['Strategy','lodash','moment','../../components/auth/service','client','Setting','findOne','then','name','salt','role','disabled','blocked','blockedAt','loginAttempts','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','add','minutes','allowedLoginAttempts','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','Email\x20parameter\x20is\x20missing','body','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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://','headers','/reset/','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','password','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use'];(function(_0x143ce6,_0x46e089){var _0x33ed64=function(_0x5a6856){while(--_0x5a6856){_0x143ce6['push'](_0x143ce6['shift']());}};_0x33ed64(++_0x46e089);}(_0x24fb,0xde));var _0xb24f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x24fb[_0xa464c9];return _0x3d73c4;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require('passport-local')[_0xb24f('0x0')];var jayson=require('jayson/promise');var _=require(_0xb24f('0x1'));var rs=require('randomstring');var moment=require(_0xb24f('0x2'));var db=require('../../mysqldb')['db'];var authService=require(_0xb24f('0x3'));var utils=require('../../config/utils');var client=jayson[_0xb24f('0x4')]['http']({'port':0x232b});function localAuthenticate(_0x4ffc24,_0x214fe5,_0x2ac287,_0x1d1971){var _0x1fc31e,_0x17854e;return db[_0xb24f('0x5')][_0xb24f('0x6')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xb24f('0x7')](function(_0x18ba90){_0x1fc31e=_0x18ba90;return _0x4ffc24[_0xb24f('0x6')]({'attributes':['id',_0xb24f('0x8'),'password',_0xb24f('0x9'),_0xb24f('0xa'),_0xb24f('0xb'),_0xb24f('0xc'),_0xb24f('0xd'),_0xb24f('0xe')],'where':{'name':_0x214fe5,'role':{'$or':['admin',_0xb24f('0xf'),_0xb24f('0x10')]}}});})['then'](function(_0x393f8c){if(!_0x393f8c||_0x393f8c&&_0x393f8c['name']!==_0x214fe5){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x17854e=_0x393f8c;return _0x17854e;}})[_0xb24f('0x7')](function(){_0x17854e[_0xb24f('0x11')](_0x2ac287,function(_0x490468,_0xae7ac7){var _0xfbab5c=_0x17854e[_0xb24f('0xe')]+0x1;if(_0x490468){return _0x1d1971(_0x490468);}else if(!_0xae7ac7){if(_0x17854e['disabled']){return _0x1d1971(null,![],{'message':_0xb24f('0x12')});}else if(_0x1fc31e['allowedLoginAttempts']>0x0){if(_0x17854e[_0xb24f('0xc')]){if(_0x1fc31e[_0xb24f('0x13')]>0x0){if(moment(_0x17854e['blockedAt'])[_0xb24f('0x14')](_0x1fc31e[_0xb24f('0x13')],_0xb24f('0x15'))>moment()){return _0x1d1971(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x17854e,_0xfbab5c,![],null)['then'](function(){return _0x1d1971(null,![],{'message':_0xb24f('0x12')});});}}else{return _0x1d1971(null,![],{'message':_0xb24f('0x12')});}}else{if(_0xfbab5c>=_0x1fc31e[_0xb24f('0x16')]){return utils['clearBlockUser'](_0x17854e,0x0,!![],moment())['then'](function(){return _0x1d1971(null,![],{'message':_0xb24f('0x12')});});}else{return utils[_0xb24f('0x17')](_0x17854e,_0xfbab5c,![],null)['then'](function(){return _0x1d1971(null,![],{'message':_0xb24f('0x12')});});}}}else{return _0x1d1971(null,![],{'message':_0xb24f('0x12')});}}else{if(_0x17854e[_0xb24f('0xb')]){return _0x1d1971(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1fc31e[_0xb24f('0x16')]>0x0){if(_0x17854e[_0xb24f('0xc')]){if(_0x1fc31e[_0xb24f('0x13')]>0x0){if(moment(_0x17854e[_0xb24f('0xd')])['add'](_0x1fc31e[_0xb24f('0x13')],_0xb24f('0x15'))>moment()){return _0x1d1971(null,![],{'message':_0xb24f('0x12')});}else{return utils[_0xb24f('0x17')](_0x17854e,0x0,![],null)['then'](function(){return utils[_0xb24f('0x18')](_0x17854e);})[_0xb24f('0x7')](function(){return _0x1d1971(null,_0x17854e);});}}else{return _0x1d1971(null,![],{'message':_0xb24f('0x12')});}}else{return utils[_0xb24f('0x17')](_0x17854e,0x0,![],null)[_0xb24f('0x7')](function(){return utils[_0xb24f('0x18')](_0x17854e);})['then'](function(){return _0x1d1971(null,_0x17854e);})[_0xb24f('0x19')](function(_0x3cdf15){return _0x1d1971(null,![],_0x3cdf15);});}}else{if(_0x17854e[_0xb24f('0xc')]){return _0x1d1971(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x17854e)['then'](function(){return _0x1d1971(null,_0x17854e);});}}}});})['catch'](function(_0x118707){return _0x1d1971(null,![],_0x118707);});}function sendServiceMail(_0x7b4c90){return db[_0xb24f('0x1a')][_0xb24f('0x1b')]({'where':{'service':!![]},'attributes':['id','name',_0xb24f('0x1c')],'include':[{'model':db['MailServerOut'],'as':_0xb24f('0x1d'),'include':[{'model':db[_0xb24f('0x1e')],'as':'CloudProvider'}]}]})['then'](function(_0x2514f1){if(!_0x2514f1){throw new Error(_0xb24f('0x1f'));}var _0x2a43a2=_0x2514f1[_0xb24f('0x20')]();var _0x16b729={'account':_0x2a43a2,'message':_[_0xb24f('0x21')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x2514f1[_0xb24f('0x8')],_0x2514f1[_0xb24f('0x1c')]||_0x2514f1['Smtp'][_0xb24f('0xf')])},_0x7b4c90)};return client[_0xb24f('0x22')](_0xb24f('0x23'),_0x16b729);})[_0xb24f('0x7')](function(_0x38e596){if(_0x38e596[_0xb24f('0x24')]){throw new Error(util[_0xb24f('0x25')](_0xb24f('0x26'),_0x38e596[_0xb24f('0x24')][_0xb24f('0x27')]||JSON[_0xb24f('0x28')](_0x38e596[_0xb24f('0x24')])));}return!![];});}function handleError(_0x586850,_0x3aae5f,_0x1397b6){return _0x586850[_0xb24f('0x29')](_0x3aae5f||0x1f4)[_0xb24f('0x2a')]({'message':_0x1397b6?_0x1397b6[_0xb24f('0x27')]||_0x1397b6:''});}exports[_0xb24f('0x2b')]=function(_0x143ebe,_0x4f7747,_0x1b65a2){passport[_0xb24f('0x11')](_0xb24f('0x2c'),function(_0x31f209,_0x54f0b3,_0x1abac2){var _0x13614a=_0x31f209||_0x1abac2;if(_0x13614a){return handleError(_0x4f7747,0x191,_0x13614a);}if(!_0x54f0b3){return handleError(_0x4f7747,0x194,{'message':_0xb24f('0x2d')});}else{var _0x38711f={'payload':{'id':_0x54f0b3['id'],'role':_0x54f0b3[_0xb24f('0xa')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x38711f)[_0xb24f('0x7')](function(_0x374a13){_0x4f7747[_0xb24f('0x2e')]({'id':_0x54f0b3['id'],'token':_0x374a13,'statusCall':'','isAlreadyLogged':_0x54f0b3[_0xb24f('0x2f')]});});}})(_0x143ebe,_0x4f7747,_0x1b65a2);};exports['forgot']=function(_0x44983e,_0x1b6651){if(!_0x44983e['body'][_0xb24f('0x1c')]){return handleError(_0x1b6651,0x1f4,{'message':_0xb24f('0x30')});}var _0x5e7370=rs['generate']();_0x44983e[_0xb24f('0x31')][_0xb24f('0x1c')]=_0x44983e[_0xb24f('0x31')]['email']['trim']()['toLowerCase']();var _0x158689;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xb24f('0x16'),_0xb24f('0x13')],'raw':!![]})['then'](function(_0x50653b){_0x158689=_0x50653b;return db['User']['find']({'where':{'email':_0x44983e['body'][_0xb24f('0x1c')]}});})[_0xb24f('0x7')](function(_0x4ecd7e){if(!_0x4ecd7e){throw new Error(_0xb24f('0x32'));}if(_0x4ecd7e['disabled']){throw new Error(_0xb24f('0x33'));}if(_0x4ecd7e[_0xb24f('0xc')]){if(moment(_0x4ecd7e['blockedAt'])[_0xb24f('0x14')](_0x158689[_0xb24f('0x13')],_0xb24f('0x15'))>moment()){throw new Error(_0xb24f('0x34'));}else{_0x4ecd7e[_0xb24f('0xc')]=![];_0x4ecd7e['blockedAt']=null;}}_0x4ecd7e[_0xb24f('0x35')]=_0x5e7370;_0x4ecd7e[_0xb24f('0x36')]=Date['now']()+0x36ee80;return _0x4ecd7e['save']();})['then'](function(){return sendServiceMail({'to':_0x44983e[_0xb24f('0x31')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xb24f('0x37')+_0xb24f('0x38')+_0xb24f('0x39')+_0x44983e[_0xb24f('0x3a')]['host']+_0xb24f('0x3b')+_0x5e7370+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xb24f('0x7')](function(){_0x1b6651['status'](0xc8)[_0xb24f('0x2a')]({'message':'Reset\x20Email\x20sent!'});})[_0xb24f('0x19')](function(_0x136e93){return handleError(_0x1b6651,0x1f4,_0x136e93);});};exports['reset']=function(_0x191acc,_0x31d764){return db[_0xb24f('0x3c')]['find']({'where':{'resetPasswordToken':_0x191acc[_0xb24f('0x3d')][_0xb24f('0x3e')],'resetPasswordExpires':{'$gt':Date[_0xb24f('0x3f')]()}}})['then'](function(_0xd1cfb7){if(!_0xd1cfb7){throw new Error(_0xb24f('0x40'));}return db[_0xb24f('0x5')][_0xb24f('0x6')]({'attributes':['id',_0xb24f('0x41'),_0xb24f('0x42'),_0xb24f('0x43')]})[_0xb24f('0x7')](function(_0xea0887){if(_0xea0887[_0xb24f('0x41')])authService['validatePasswordPattern'](_0x191acc['body'][_0xb24f('0x44')]);if(!_0xea0887[_0xb24f('0x42')]||!_0xd1cfb7[_0xb24f('0x45')])return _0xd1cfb7;authService[_0xb24f('0x46')](_0x191acc[_0xb24f('0x31')]['password'],_0xd1cfb7[_0xb24f('0x45')],_0xea0887[_0xb24f('0x43')]);return _0xd1cfb7;})[_0xb24f('0x7')](function(){_0xd1cfb7['password']=_0x191acc[_0xb24f('0x31')][_0xb24f('0x44')];_0xd1cfb7[_0xb24f('0x35')]=null;_0xd1cfb7[_0xb24f('0x36')]=null;return _0xd1cfb7[_0xb24f('0x47')]();});})['then'](function(){_0x31d764[_0xb24f('0x29')](0xc8)['send']({'message':_0xb24f('0x48')});})[_0xb24f('0x19')](function(_0x355c8f){return handleError(_0x31d764,0x1f4,_0x355c8f);});};passport[_0xb24f('0x49')](_0xb24f('0x2c'),new LocalStrategy({'usernameField':_0xb24f('0x8'),'passwordField':'password'},function(_0x398686,_0x4348ef,_0x4a34cd){return localAuthenticate(db['User'],_0x398686,_0x4348ef,_0x4a34cd);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 63990bc..2e11401 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 _0x78d6=['forgot','reset','exports','express','Router','post','login','/forgot'];(function(_0x8ea5c9,_0x42336c){var _0x54b26f=function(_0x5ab6e6){while(--_0x5ab6e6){_0x8ea5c9['push'](_0x8ea5c9['shift']());}};_0x54b26f(++_0x42336c);}(_0x78d6,0xa3));var _0x678d=function(_0x4e58e0,_0x41edb5){_0x4e58e0=_0x4e58e0-0x0;var _0x1d9a44=_0x78d6[_0x4e58e0];return _0x1d9a44;};'use strict';var express=require(_0x678d('0x0'));var router=express[_0x678d('0x1')]();var controller=require('./authLocal.controller');router[_0x678d('0x2')]('/',controller[_0x678d('0x3')]);router['post'](_0x678d('0x4'),controller[_0x678d('0x5')]);router['post']('/reset/:token',controller[_0x678d('0x6')]);module[_0x678d('0x7')]=router;
\ No newline at end of file
+var _0x0dd1=['/reset/:token','reset','exports','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x1ac9e6,_0x32e25c){var _0x3b0218=function(_0x205ae3){while(--_0x205ae3){_0x1ac9e6['push'](_0x1ac9e6['shift']());}};_0x3b0218(++_0x32e25c);}(_0x0dd1,0x1a1));var _0x10dd=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x0dd1[_0xd22d95];return _0x15d7a3;};'use strict';var express=require('express');var router=express[_0x10dd('0x0')]();var controller=require(_0x10dd('0x1'));router[_0x10dd('0x2')]('/',controller[_0x10dd('0x3')]);router[_0x10dd('0x2')](_0x10dd('0x4'),controller[_0x10dd('0x5')]);router[_0x10dd('0x2')](_0x10dd('0x6'),controller[_0x10dd('0x7')]);module[_0x10dd('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 705bf1f..ecce620 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 _0x9393=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9393,0xcf));var _0x3939=function(_0x2c4724,_0x16b46e){_0x2c4724=_0x2c4724-0x0;var _0x238deb=_0x9393[_0x2c4724];return _0x238deb;};'use strict';var Sequelize=require('sequelize');module[_0x3939('0x0')]={'name':{'type':Sequelize[_0x3939('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3939('0x1')]},'status':{'type':Sequelize[_0x3939('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3939('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x7147=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7147,0x8e));var _0x7714=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0x7147[_0x671369];return _0x33f2b4;};'use strict';var Sequelize=require(_0x7714('0x0'));module[_0x7714('0x1')]={'name':{'type':Sequelize[_0x7714('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x7714('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7714('0x4')],'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 3d0917e..e18a445 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 _0x4f02=['sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','Automation','count','includeAll','findAll','rows','catch','show','params','find','create','body','addConditions','Condition','omit','ids','getConditions','findOne','pick','addActions','order','getActions','eml-format','rimraf','request-promise','moment','mustache','util'];(function(_0x11fbe2,_0x17a1dc){var _0x21a9ee=function(_0x773466){while(--_0x773466){_0x11fbe2['push'](_0x11fbe2['shift']());}};_0x21a9ee(++_0x17a1dc);}(_0x4f02,0x1da));var _0x24f0=function(_0x130efd,_0x5a97fe){_0x130efd=_0x130efd-0x0;var _0x5a1042=_0x4f02[_0x130efd];return _0x5a1042;};'use strict';var emlformat=require(_0x24f0('0x0'));var rimraf=require(_0x24f0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x24f0('0x2'));var moment=require(_0x24f0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x24f0('0x4'));var util=require(_0x24f0('0x5'));var path=require('path');var sox=require(_0x24f0('0x6'));var csv=require('to-csv');var ejs=require(_0x24f0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24f0('0x8'));var squel=require(_0x24f0('0x9'));var crypto=require('crypto');var jsforce=require(_0x24f0('0xa'));var deskjs=require(_0x24f0('0xb'));var toCsv=require(_0x24f0('0xc'));var querystring=require(_0x24f0('0xd'));var Papa=require(_0x24f0('0xe'));var Redis=require('ioredis');var authService=require(_0x24f0('0xf'));var qs=require(_0x24f0('0x10'));var as=require(_0x24f0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24f0('0x12'))(_0x24f0('0x13'));var utils=require(_0x24f0('0x14'));var config=require(_0x24f0('0x15'));var licenseUtil=require(_0x24f0('0x16'));var db=require(_0x24f0('0x17'))['db'];function respondWithStatusCode(_0x3a3999,_0x4b0959){_0x4b0959=_0x4b0959||0xcc;return function(_0x21ecbe){if(_0x21ecbe){return _0x3a3999[_0x24f0('0x18')](_0x4b0959);}return _0x3a3999[_0x24f0('0x19')](_0x4b0959)[_0x24f0('0x1a')]();};}function respondWithResult(_0x193ecc,_0x456f9b){_0x456f9b=_0x456f9b||0xc8;return function(_0x1aa246){if(_0x1aa246){return _0x193ecc[_0x24f0('0x19')](_0x456f9b)[_0x24f0('0x1b')](_0x1aa246);}};}function respondWithFilteredResult(_0x5a587f,_0x1213fc){return function(_0x4fcca4){if(_0x4fcca4){var _0x5c2267=typeof _0x1213fc[_0x24f0('0x1c')]==='undefined'&&typeof _0x1213fc['limit']==='undefined';var _0x14225c=_0x4fcca4['count'];var _0x2fa867=_0x5c2267?0x0:_0x1213fc[_0x24f0('0x1c')];var _0x5c4b5b=_0x5c2267?_0x4fcca4['count']:_0x1213fc['offset']+_0x1213fc[_0x24f0('0x1d')];var _0x33aca9;if(_0x5c4b5b>=_0x14225c){_0x5c4b5b=_0x14225c;_0x33aca9=0xc8;}else{_0x33aca9=0xce;}_0x5a587f['status'](_0x33aca9);return _0x5a587f['set']('Content-Range',_0x2fa867+'-'+_0x5c4b5b+'/'+_0x14225c)['json'](_0x4fcca4);}return null;};}function patchUpdates(_0x2a9836){return function(_0x35147c){try{jsonpatch[_0x24f0('0x1e')](_0x35147c,_0x2a9836,!![]);}catch(_0x483710){return BPromise[_0x24f0('0x1f')](_0x483710);}return _0x35147c[_0x24f0('0x20')]();};}function saveUpdates(_0xa27490,_0xf0c68e){return function(_0x4dd8e1){if(_0x4dd8e1){return _0x4dd8e1[_0x24f0('0x21')](_0xa27490)[_0x24f0('0x22')](function(_0x3f7127){return _0x3f7127;});}return null;};}function removeEntity(_0x4fa4a8,_0x101c1e){return function(_0x1ce0e1){if(_0x1ce0e1){return _0x1ce0e1[_0x24f0('0x23')]()[_0x24f0('0x22')](function(){_0x4fa4a8[_0x24f0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1928dc,_0x98b0cf){return function(_0x1de557){if(!_0x1de557){_0x1928dc[_0x24f0('0x18')](0x194);}return _0x1de557;};}function handleError(_0x3c2eb5,_0x28c9b6){_0x28c9b6=_0x28c9b6||0x1f4;return function(_0x301ada){logger['error'](_0x301ada[_0x24f0('0x24')]);if(_0x301ada[_0x24f0('0x25')]){delete _0x301ada[_0x24f0('0x25')];}_0x3c2eb5[_0x24f0('0x19')](_0x28c9b6)[_0x24f0('0x26')](_0x301ada);};}exports[_0x24f0('0x27')]=function(_0x541f09,_0x66478e){var _0x1ff6c4={},_0x3b1f71={},_0x5bcfaa={'count':0x0,'rows':[]};var _0x4df838=_[_0x24f0('0x28')](db['Automation'][_0x24f0('0x29')],function(_0x1f76c3){return{'name':_0x1f76c3['fieldName'],'type':_0x1f76c3['type']['key']};});_0x3b1f71['model']=_['map'](_0x4df838,_0x24f0('0x25'));_0x3b1f71[_0x24f0('0x2a')]=_[_0x24f0('0x2b')](_0x541f09[_0x24f0('0x2a')]);_0x3b1f71[_0x24f0('0x2c')]=_[_0x24f0('0x2d')](_0x3b1f71[_0x24f0('0x2e')],_0x3b1f71[_0x24f0('0x2a')]);_0x1ff6c4['attributes']=_[_0x24f0('0x2d')](_0x3b1f71[_0x24f0('0x2e')],qs['fields'](_0x541f09[_0x24f0('0x2a')][_0x24f0('0x2f')]));_0x1ff6c4[_0x24f0('0x30')]=_0x1ff6c4[_0x24f0('0x30')][_0x24f0('0x31')]?_0x1ff6c4[_0x24f0('0x30')]:_0x3b1f71[_0x24f0('0x2e')];if(!_0x541f09[_0x24f0('0x2a')][_0x24f0('0x32')](_0x24f0('0x33'))){_0x1ff6c4[_0x24f0('0x1d')]=qs['limit'](_0x541f09[_0x24f0('0x2a')][_0x24f0('0x1d')]);_0x1ff6c4[_0x24f0('0x1c')]=qs[_0x24f0('0x1c')](_0x541f09[_0x24f0('0x2a')][_0x24f0('0x1c')]);}_0x1ff6c4['order']=qs['sort'](_0x541f09[_0x24f0('0x2a')][_0x24f0('0x34')]);_0x1ff6c4[_0x24f0('0x35')]=qs['filters'](_['pick'](_0x541f09[_0x24f0('0x2a')],_0x3b1f71[_0x24f0('0x2c')]),_0x4df838);if(_0x541f09['query'][_0x24f0('0x36')]){_0x1ff6c4['where']=_[_0x24f0('0x37')](_0x1ff6c4[_0x24f0('0x35')],{'$or':_[_0x24f0('0x28')](_0x4df838,function(_0x9a1ba4){if(_0x9a1ba4[_0x24f0('0x38')]!==_0x24f0('0x39')){var _0x814acf={};_0x814acf[_0x9a1ba4[_0x24f0('0x25')]]={'$like':'%'+_0x541f09[_0x24f0('0x2a')][_0x24f0('0x36')]+'%'};return _0x814acf;}})});}_0x1ff6c4=_['merge']({},_0x1ff6c4,_0x541f09[_0x24f0('0x3a')]);var _0x43db35={'where':_0x1ff6c4[_0x24f0('0x35')]};return db[_0x24f0('0x3b')][_0x24f0('0x3c')](_0x43db35)[_0x24f0('0x22')](function(_0x4a6a9f){_0x5bcfaa[_0x24f0('0x3c')]=_0x4a6a9f;if(_0x541f09[_0x24f0('0x2a')][_0x24f0('0x3d')]){_0x1ff6c4['include']=[{'all':!![]}];}return db[_0x24f0('0x3b')][_0x24f0('0x3e')](_0x1ff6c4);})['then'](function(_0x3dc6b4){_0x5bcfaa[_0x24f0('0x3f')]=_0x3dc6b4;return _0x5bcfaa;})[_0x24f0('0x22')](respondWithFilteredResult(_0x66478e,_0x1ff6c4))[_0x24f0('0x40')](handleError(_0x66478e,null));};exports[_0x24f0('0x41')]=function(_0x489121,_0x2a8a7f){var _0x463e36={'raw':![],'where':{'id':_0x489121[_0x24f0('0x42')]['id']}},_0xf50ada={};_0xf50ada[_0x24f0('0x2e')]=_[_0x24f0('0x2b')](db['Automation']['rawAttributes']);_0xf50ada[_0x24f0('0x2a')]=_[_0x24f0('0x2b')](_0x489121['query']);_0xf50ada[_0x24f0('0x2c')]=_['intersection'](_0xf50ada[_0x24f0('0x2e')],_0xf50ada[_0x24f0('0x2a')]);_0x463e36[_0x24f0('0x30')]=_['intersection'](_0xf50ada[_0x24f0('0x2e')],qs[_0x24f0('0x2f')](_0x489121[_0x24f0('0x2a')][_0x24f0('0x2f')]));_0x463e36[_0x24f0('0x30')]=_0x463e36[_0x24f0('0x30')][_0x24f0('0x31')]?_0x463e36[_0x24f0('0x30')]:_0xf50ada[_0x24f0('0x2e')];if(_0x489121['query'][_0x24f0('0x3d')]){_0x463e36['include']=[{'all':!![]}];}_0x463e36=_[_0x24f0('0x37')]({},_0x463e36,_0x489121[_0x24f0('0x3a')]);return db[_0x24f0('0x3b')][_0x24f0('0x43')](_0x463e36)[_0x24f0('0x22')](handleEntityNotFound(_0x2a8a7f,null))[_0x24f0('0x22')](respondWithResult(_0x2a8a7f,null))['catch'](handleError(_0x2a8a7f,null));};exports['create']=function(_0x102835,_0x3de9c7){return db[_0x24f0('0x3b')][_0x24f0('0x44')](_0x102835[_0x24f0('0x45')],{})[_0x24f0('0x22')](respondWithResult(_0x3de9c7,0xc9))[_0x24f0('0x40')](handleError(_0x3de9c7,null));};exports[_0x24f0('0x21')]=function(_0x375012,_0x366827){if(_0x375012['body']['id']){delete _0x375012[_0x24f0('0x45')]['id'];}return db[_0x24f0('0x3b')][_0x24f0('0x43')]({'where':{'id':_0x375012[_0x24f0('0x42')]['id']}})['then'](handleEntityNotFound(_0x366827,null))['then'](saveUpdates(_0x375012['body'],null))[_0x24f0('0x22')](respondWithResult(_0x366827,null))['catch'](handleError(_0x366827,null));};exports['destroy']=function(_0x2d2eae,_0x291ff0){return db[_0x24f0('0x3b')][_0x24f0('0x43')]({'where':{'id':_0x2d2eae[_0x24f0('0x42')]['id']}})[_0x24f0('0x22')](handleEntityNotFound(_0x291ff0,null))['then'](removeEntity(_0x291ff0,null))[_0x24f0('0x40')](handleError(_0x291ff0,null));};exports[_0x24f0('0x46')]=function(_0x1d7da1,_0x3d6e16,_0x5c363d){return db[_0x24f0('0x47')][_0x24f0('0x43')]({'where':{'id':_0x1d7da1['params']['id']}})[_0x24f0('0x22')](handleEntityNotFound(_0x3d6e16,null))[_0x24f0('0x22')](function(_0x2e4cb6){if(_0x2e4cb6){return _0x2e4cb6[_0x24f0('0x46')](_0x1d7da1[_0x24f0('0x45')]['ids'],_[_0x24f0('0x48')](_0x1d7da1[_0x24f0('0x45')],[_0x24f0('0x49'),'id'])||{});}})[_0x24f0('0x22')](respondWithResult(_0x3d6e16,null))['catch'](handleError(_0x3d6e16,null));};exports[_0x24f0('0x4a')]=function(_0x41a8ef,_0x2ddca8,_0x4ee8e1){var _0x500d33={};var _0x423be9={};var _0x42c100;var _0x11894a;return db[_0x24f0('0x3b')][_0x24f0('0x4b')]({'where':{'id':_0x41a8ef[_0x24f0('0x42')]['id']}})[_0x24f0('0x22')](handleEntityNotFound(_0x2ddca8,null))[_0x24f0('0x22')](function(_0x3faa45){if(_0x3faa45){_0x42c100=_0x3faa45;_0x423be9['model']=_['keys'](db[_0x24f0('0x47')]['rawAttributes']);_0x423be9[_0x24f0('0x2a')]=_[_0x24f0('0x2b')](_0x41a8ef[_0x24f0('0x2a')]);_0x423be9[_0x24f0('0x2c')]=_['intersection'](_0x423be9[_0x24f0('0x2e')],_0x423be9['query']);_0x500d33['attributes']=_[_0x24f0('0x2d')](_0x423be9['model'],qs['fields'](_0x41a8ef[_0x24f0('0x2a')][_0x24f0('0x2f')]));_0x500d33['attributes']=_0x500d33[_0x24f0('0x30')][_0x24f0('0x31')]?_0x500d33['attributes']:_0x423be9[_0x24f0('0x2e')];_0x500d33['order']=qs[_0x24f0('0x34')](_0x41a8ef[_0x24f0('0x2a')][_0x24f0('0x34')]);_0x500d33[_0x24f0('0x35')]=qs[_0x24f0('0x2c')](_[_0x24f0('0x4c')](_0x41a8ef[_0x24f0('0x2a')],_0x423be9[_0x24f0('0x2c')]));if(_0x41a8ef[_0x24f0('0x2a')]['filter']){_0x500d33['where']=_[_0x24f0('0x37')](_0x500d33[_0x24f0('0x35')],{'$or':_[_0x24f0('0x28')](_0x500d33[_0x24f0('0x30')],function(_0x31818c){var _0xae5db9={};_0xae5db9[_0x31818c]={'$like':'%'+_0x41a8ef['query']['filter']+'%'};return _0xae5db9;})});}_0x500d33=_['merge']({},_0x500d33,_0x41a8ef[_0x24f0('0x3a')]);return _0x42c100[_0x24f0('0x4a')](_0x500d33);}})['then'](function(_0x2862b7){if(_0x2862b7){_0x11894a=_0x2862b7[_0x24f0('0x31')];if(!_0x41a8ef[_0x24f0('0x2a')][_0x24f0('0x32')](_0x24f0('0x33'))){_0x500d33[_0x24f0('0x1d')]=qs['limit'](_0x41a8ef[_0x24f0('0x2a')][_0x24f0('0x1d')]);_0x500d33['offset']=qs['offset'](_0x41a8ef[_0x24f0('0x2a')]['offset']);}return _0x42c100['getConditions'](_0x500d33);}})[_0x24f0('0x22')](function(_0x1da2e7){if(_0x1da2e7){return _0x1da2e7?{'count':_0x11894a,'rows':_0x1da2e7}:null;}})[_0x24f0('0x22')](respondWithResult(_0x2ddca8,null))[_0x24f0('0x40')](handleError(_0x2ddca8,null));};exports['addActions']=function(_0x201efd,_0x1800fb,_0x414029){return db['Action'][_0x24f0('0x43')]({'where':{'id':_0x201efd[_0x24f0('0x42')]['id']}})[_0x24f0('0x22')](handleEntityNotFound(_0x1800fb,null))[_0x24f0('0x22')](function(_0x5e4797){if(_0x5e4797){return _0x5e4797[_0x24f0('0x4d')](_0x201efd['body'][_0x24f0('0x49')],_['omit'](_0x201efd[_0x24f0('0x45')],['ids','id'])||{});}})[_0x24f0('0x22')](respondWithResult(_0x1800fb,null))[_0x24f0('0x40')](handleError(_0x1800fb,null));};exports['getActions']=function(_0x1fde66,_0x4f5c7f,_0x34dcaf){var _0x2fdce5={};var _0x2634d6={};var _0x5db3a2;var _0x4fbd51;return db[_0x24f0('0x3b')]['findOne']({'where':{'id':_0x1fde66[_0x24f0('0x42')]['id']}})[_0x24f0('0x22')](handleEntityNotFound(_0x4f5c7f,null))[_0x24f0('0x22')](function(_0x645c00){if(_0x645c00){_0x5db3a2=_0x645c00;_0x2634d6[_0x24f0('0x2e')]=_[_0x24f0('0x2b')](db['Action'][_0x24f0('0x29')]);_0x2634d6[_0x24f0('0x2a')]=_['keys'](_0x1fde66[_0x24f0('0x2a')]);_0x2634d6[_0x24f0('0x2c')]=_[_0x24f0('0x2d')](_0x2634d6[_0x24f0('0x2e')],_0x2634d6[_0x24f0('0x2a')]);_0x2fdce5[_0x24f0('0x30')]=_[_0x24f0('0x2d')](_0x2634d6[_0x24f0('0x2e')],qs[_0x24f0('0x2f')](_0x1fde66[_0x24f0('0x2a')]['fields']));_0x2fdce5[_0x24f0('0x30')]=_0x2fdce5['attributes']['length']?_0x2fdce5['attributes']:_0x2634d6[_0x24f0('0x2e')];_0x2fdce5[_0x24f0('0x4e')]=qs[_0x24f0('0x34')](_0x1fde66['query']['sort']);_0x2fdce5[_0x24f0('0x35')]=qs[_0x24f0('0x2c')](_['pick'](_0x1fde66[_0x24f0('0x2a')],_0x2634d6[_0x24f0('0x2c')]));if(_0x1fde66[_0x24f0('0x2a')]['filter']){_0x2fdce5['where']=_[_0x24f0('0x37')](_0x2fdce5[_0x24f0('0x35')],{'$or':_[_0x24f0('0x28')](_0x2fdce5['attributes'],function(_0x548010){var _0x3dbb4a={};_0x3dbb4a[_0x548010]={'$like':'%'+_0x1fde66[_0x24f0('0x2a')]['filter']+'%'};return _0x3dbb4a;})});}_0x2fdce5=_['merge']({},_0x2fdce5,_0x1fde66[_0x24f0('0x3a')]);return _0x5db3a2[_0x24f0('0x4f')](_0x2fdce5);}})[_0x24f0('0x22')](function(_0x34fe3c){if(_0x34fe3c){_0x4fbd51=_0x34fe3c[_0x24f0('0x31')];if(!_0x1fde66['query'][_0x24f0('0x32')](_0x24f0('0x33'))){_0x2fdce5[_0x24f0('0x1d')]=qs[_0x24f0('0x1d')](_0x1fde66[_0x24f0('0x2a')][_0x24f0('0x1d')]);_0x2fdce5[_0x24f0('0x1c')]=qs[_0x24f0('0x1c')](_0x1fde66[_0x24f0('0x2a')][_0x24f0('0x1c')]);}return _0x5db3a2[_0x24f0('0x4f')](_0x2fdce5);}})['then'](function(_0x1e3bb9){if(_0x1e3bb9){return _0x1e3bb9?{'count':_0x4fbd51,'rows':_0x1e3bb9}:null;}})['then'](respondWithResult(_0x4f5c7f,null))[_0x24f0('0x40')](handleError(_0x4f5c7f,null));};
\ No newline at end of file
+var _0x9752=['error','stack','name','send','index','rawAttributes','fieldName','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','Automation','count','includeAll','include','findAll','rows','catch','merge','find','create','body','params','addConditions','Condition','ids','omit','getConditions','findOne','order','options','length','Action','addActions','getActions','rimraf','fast-json-patch','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x187466,_0x3ad0bb){var _0x34c0a2=function(_0x41d10b){while(--_0x41d10b){_0x187466['push'](_0x187466['shift']());}};_0x34c0a2(++_0x3ad0bb);}(_0x9752,0x7d));var _0x2975=function(_0x534ac9,_0x5c71ca){_0x534ac9=_0x534ac9-0x0;var _0x3cbbfe=_0x9752[_0x534ac9];return _0x3cbbfe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2975('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2975('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2975('0x2'));var Mustache=require(_0x2975('0x3'));var util=require(_0x2975('0x4'));var path=require('path');var sox=require(_0x2975('0x5'));var csv=require('to-csv');var ejs=require(_0x2975('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2975('0x7'));var squel=require(_0x2975('0x8'));var crypto=require(_0x2975('0x9'));var jsforce=require(_0x2975('0xa'));var deskjs=require(_0x2975('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2975('0xc'));var Papa=require(_0x2975('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2975('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2975('0xf'));var utils=require(_0x2975('0x10'));var config=require(_0x2975('0x11'));var licenseUtil=require(_0x2975('0x12'));var db=require(_0x2975('0x13'))['db'];function respondWithStatusCode(_0x4c99bd,_0x10edab){_0x10edab=_0x10edab||0xcc;return function(_0x46ebce){if(_0x46ebce){return _0x4c99bd[_0x2975('0x14')](_0x10edab);}return _0x4c99bd[_0x2975('0x15')](_0x10edab)[_0x2975('0x16')]();};}function respondWithResult(_0x315910,_0x215d00){_0x215d00=_0x215d00||0xc8;return function(_0x25ced8){if(_0x25ced8){return _0x315910[_0x2975('0x15')](_0x215d00)[_0x2975('0x17')](_0x25ced8);}};}function respondWithFilteredResult(_0x21c3c1,_0x1361f6){return function(_0x18fb0f){if(_0x18fb0f){var _0x43ccf4=typeof _0x1361f6[_0x2975('0x18')]===_0x2975('0x19')&&typeof _0x1361f6['limit']===_0x2975('0x19');var _0x55b0c2=_0x18fb0f['count'];var _0x32bd12=_0x43ccf4?0x0:_0x1361f6['offset'];var _0x34f408=_0x43ccf4?_0x18fb0f['count']:_0x1361f6[_0x2975('0x18')]+_0x1361f6[_0x2975('0x1a')];var _0x56f1d5;if(_0x34f408>=_0x55b0c2){_0x34f408=_0x55b0c2;_0x56f1d5=0xc8;}else{_0x56f1d5=0xce;}_0x21c3c1[_0x2975('0x15')](_0x56f1d5);return _0x21c3c1[_0x2975('0x1b')](_0x2975('0x1c'),_0x32bd12+'-'+_0x34f408+'/'+_0x55b0c2)[_0x2975('0x17')](_0x18fb0f);}return null;};}function patchUpdates(_0x56f507){return function(_0x337e91){try{jsonpatch[_0x2975('0x1d')](_0x337e91,_0x56f507,!![]);}catch(_0x27323c){return BPromise[_0x2975('0x1e')](_0x27323c);}return _0x337e91[_0x2975('0x1f')]();};}function saveUpdates(_0x4acf3e,_0x4b287f){return function(_0x4072b0){if(_0x4072b0){return _0x4072b0[_0x2975('0x20')](_0x4acf3e)['then'](function(_0x36872c){return _0x36872c;});}return null;};}function removeEntity(_0xd26f58,_0x218efa){return function(_0x4399d1){if(_0x4399d1){return _0x4399d1[_0x2975('0x21')]()[_0x2975('0x22')](function(){_0xd26f58[_0x2975('0x15')](0xcc)[_0x2975('0x16')]();});}};}function handleEntityNotFound(_0x376d69,_0x13ac2a){return function(_0x9a55f8){if(!_0x9a55f8){_0x376d69[_0x2975('0x14')](0x194);}return _0x9a55f8;};}function handleError(_0x142719,_0x541ee7){_0x541ee7=_0x541ee7||0x1f4;return function(_0x13346c){logger[_0x2975('0x23')](_0x13346c[_0x2975('0x24')]);if(_0x13346c[_0x2975('0x25')]){delete _0x13346c[_0x2975('0x25')];}_0x142719[_0x2975('0x15')](_0x541ee7)[_0x2975('0x26')](_0x13346c);};}exports[_0x2975('0x27')]=function(_0x592fda,_0x357e28){var _0x2470d0={},_0x305160={},_0x466e03={'count':0x0,'rows':[]};var _0x18ced5=_['map'](db['Automation'][_0x2975('0x28')],function(_0x492c31){return{'name':_0x492c31[_0x2975('0x29')],'type':_0x492c31['type']['key']};});_0x305160['model']=_[_0x2975('0x2a')](_0x18ced5,_0x2975('0x25'));_0x305160[_0x2975('0x2b')]=_[_0x2975('0x2c')](_0x592fda[_0x2975('0x2b')]);_0x305160[_0x2975('0x2d')]=_[_0x2975('0x2e')](_0x305160[_0x2975('0x2f')],_0x305160[_0x2975('0x2b')]);_0x2470d0[_0x2975('0x30')]=_[_0x2975('0x2e')](_0x305160[_0x2975('0x2f')],qs[_0x2975('0x31')](_0x592fda[_0x2975('0x2b')]['fields']));_0x2470d0[_0x2975('0x30')]=_0x2470d0[_0x2975('0x30')]['length']?_0x2470d0[_0x2975('0x30')]:_0x305160[_0x2975('0x2f')];if(!_0x592fda[_0x2975('0x2b')][_0x2975('0x32')](_0x2975('0x33'))){_0x2470d0['limit']=qs['limit'](_0x592fda[_0x2975('0x2b')][_0x2975('0x1a')]);_0x2470d0[_0x2975('0x18')]=qs[_0x2975('0x18')](_0x592fda[_0x2975('0x2b')][_0x2975('0x18')]);}_0x2470d0['order']=qs[_0x2975('0x34')](_0x592fda[_0x2975('0x2b')][_0x2975('0x34')]);_0x2470d0[_0x2975('0x35')]=qs[_0x2975('0x2d')](_[_0x2975('0x36')](_0x592fda['query'],_0x305160[_0x2975('0x2d')]),_0x18ced5);if(_0x592fda[_0x2975('0x2b')][_0x2975('0x37')]){_0x2470d0[_0x2975('0x35')]=_['merge'](_0x2470d0[_0x2975('0x35')],{'$or':_[_0x2975('0x2a')](_0x18ced5,function(_0x1a97a4){if(_0x1a97a4['type']!=='VIRTUAL'){var _0x5cea80={};_0x5cea80[_0x1a97a4[_0x2975('0x25')]]={'$like':'%'+_0x592fda[_0x2975('0x2b')]['filter']+'%'};return _0x5cea80;}})});}_0x2470d0=_['merge']({},_0x2470d0,_0x592fda['options']);var _0x922ec9={'where':_0x2470d0[_0x2975('0x35')]};return db[_0x2975('0x38')][_0x2975('0x39')](_0x922ec9)[_0x2975('0x22')](function(_0x1480e1){_0x466e03[_0x2975('0x39')]=_0x1480e1;if(_0x592fda[_0x2975('0x2b')][_0x2975('0x3a')]){_0x2470d0[_0x2975('0x3b')]=[{'all':!![]}];}return db[_0x2975('0x38')][_0x2975('0x3c')](_0x2470d0);})[_0x2975('0x22')](function(_0x57d9cd){_0x466e03[_0x2975('0x3d')]=_0x57d9cd;return _0x466e03;})[_0x2975('0x22')](respondWithFilteredResult(_0x357e28,_0x2470d0))[_0x2975('0x3e')](handleError(_0x357e28,null));};exports['show']=function(_0x1253f2,_0x1f974e){var _0x4e7ec8={'raw':![],'where':{'id':_0x1253f2['params']['id']}},_0x3ba4a8={};_0x3ba4a8[_0x2975('0x2f')]=_[_0x2975('0x2c')](db[_0x2975('0x38')][_0x2975('0x28')]);_0x3ba4a8[_0x2975('0x2b')]=_[_0x2975('0x2c')](_0x1253f2['query']);_0x3ba4a8[_0x2975('0x2d')]=_[_0x2975('0x2e')](_0x3ba4a8['model'],_0x3ba4a8[_0x2975('0x2b')]);_0x4e7ec8[_0x2975('0x30')]=_[_0x2975('0x2e')](_0x3ba4a8[_0x2975('0x2f')],qs[_0x2975('0x31')](_0x1253f2[_0x2975('0x2b')][_0x2975('0x31')]));_0x4e7ec8['attributes']=_0x4e7ec8[_0x2975('0x30')]['length']?_0x4e7ec8['attributes']:_0x3ba4a8[_0x2975('0x2f')];if(_0x1253f2['query'][_0x2975('0x3a')]){_0x4e7ec8[_0x2975('0x3b')]=[{'all':!![]}];}_0x4e7ec8=_[_0x2975('0x3f')]({},_0x4e7ec8,_0x1253f2['options']);return db[_0x2975('0x38')][_0x2975('0x40')](_0x4e7ec8)[_0x2975('0x22')](handleEntityNotFound(_0x1f974e,null))[_0x2975('0x22')](respondWithResult(_0x1f974e,null))['catch'](handleError(_0x1f974e,null));};exports['create']=function(_0x316f04,_0x4dcb87){return db['Automation'][_0x2975('0x41')](_0x316f04[_0x2975('0x42')],{})[_0x2975('0x22')](respondWithResult(_0x4dcb87,0xc9))[_0x2975('0x3e')](handleError(_0x4dcb87,null));};exports[_0x2975('0x20')]=function(_0x47f0d8,_0x40cd47){if(_0x47f0d8[_0x2975('0x42')]['id']){delete _0x47f0d8['body']['id'];}return db[_0x2975('0x38')][_0x2975('0x40')]({'where':{'id':_0x47f0d8[_0x2975('0x43')]['id']}})['then'](handleEntityNotFound(_0x40cd47,null))[_0x2975('0x22')](saveUpdates(_0x47f0d8[_0x2975('0x42')],null))[_0x2975('0x22')](respondWithResult(_0x40cd47,null))[_0x2975('0x3e')](handleError(_0x40cd47,null));};exports[_0x2975('0x21')]=function(_0x52e9d5,_0x6750c4){return db[_0x2975('0x38')][_0x2975('0x40')]({'where':{'id':_0x52e9d5[_0x2975('0x43')]['id']}})[_0x2975('0x22')](handleEntityNotFound(_0x6750c4,null))[_0x2975('0x22')](removeEntity(_0x6750c4,null))[_0x2975('0x3e')](handleError(_0x6750c4,null));};exports[_0x2975('0x44')]=function(_0x160afd,_0x3b48d3,_0x4a09db){return db[_0x2975('0x45')][_0x2975('0x40')]({'where':{'id':_0x160afd[_0x2975('0x43')]['id']}})[_0x2975('0x22')](handleEntityNotFound(_0x3b48d3,null))[_0x2975('0x22')](function(_0xa005){if(_0xa005){return _0xa005['addConditions'](_0x160afd['body'][_0x2975('0x46')],_[_0x2975('0x47')](_0x160afd[_0x2975('0x42')],[_0x2975('0x46'),'id'])||{});}})[_0x2975('0x22')](respondWithResult(_0x3b48d3,null))[_0x2975('0x3e')](handleError(_0x3b48d3,null));};exports[_0x2975('0x48')]=function(_0x30af96,_0x2c76f6,_0x14463e){var _0x2cc5a8={};var _0x496278={};var _0x18842d;var _0xa18a5e;return db['Automation'][_0x2975('0x49')]({'where':{'id':_0x30af96[_0x2975('0x43')]['id']}})['then'](handleEntityNotFound(_0x2c76f6,null))[_0x2975('0x22')](function(_0x4196aa){if(_0x4196aa){_0x18842d=_0x4196aa;_0x496278[_0x2975('0x2f')]=_['keys'](db[_0x2975('0x45')][_0x2975('0x28')]);_0x496278[_0x2975('0x2b')]=_[_0x2975('0x2c')](_0x30af96[_0x2975('0x2b')]);_0x496278[_0x2975('0x2d')]=_[_0x2975('0x2e')](_0x496278[_0x2975('0x2f')],_0x496278[_0x2975('0x2b')]);_0x2cc5a8[_0x2975('0x30')]=_['intersection'](_0x496278[_0x2975('0x2f')],qs[_0x2975('0x31')](_0x30af96[_0x2975('0x2b')]['fields']));_0x2cc5a8[_0x2975('0x30')]=_0x2cc5a8[_0x2975('0x30')]['length']?_0x2cc5a8[_0x2975('0x30')]:_0x496278[_0x2975('0x2f')];_0x2cc5a8[_0x2975('0x4a')]=qs[_0x2975('0x34')](_0x30af96[_0x2975('0x2b')][_0x2975('0x34')]);_0x2cc5a8[_0x2975('0x35')]=qs['filters'](_['pick'](_0x30af96[_0x2975('0x2b')],_0x496278['filters']));if(_0x30af96[_0x2975('0x2b')]['filter']){_0x2cc5a8[_0x2975('0x35')]=_[_0x2975('0x3f')](_0x2cc5a8[_0x2975('0x35')],{'$or':_['map'](_0x2cc5a8[_0x2975('0x30')],function(_0x556249){var _0xbe254c={};_0xbe254c[_0x556249]={'$like':'%'+_0x30af96[_0x2975('0x2b')][_0x2975('0x37')]+'%'};return _0xbe254c;})});}_0x2cc5a8=_[_0x2975('0x3f')]({},_0x2cc5a8,_0x30af96[_0x2975('0x4b')]);return _0x18842d[_0x2975('0x48')](_0x2cc5a8);}})[_0x2975('0x22')](function(_0x5801c5){if(_0x5801c5){_0xa18a5e=_0x5801c5[_0x2975('0x4c')];if(!_0x30af96['query'][_0x2975('0x32')](_0x2975('0x33'))){_0x2cc5a8[_0x2975('0x1a')]=qs[_0x2975('0x1a')](_0x30af96[_0x2975('0x2b')]['limit']);_0x2cc5a8[_0x2975('0x18')]=qs[_0x2975('0x18')](_0x30af96['query']['offset']);}return _0x18842d[_0x2975('0x48')](_0x2cc5a8);}})[_0x2975('0x22')](function(_0x1087c3){if(_0x1087c3){return _0x1087c3?{'count':_0xa18a5e,'rows':_0x1087c3}:null;}})[_0x2975('0x22')](respondWithResult(_0x2c76f6,null))[_0x2975('0x3e')](handleError(_0x2c76f6,null));};exports['addActions']=function(_0x532a34,_0x4b97ae,_0x736660){return db[_0x2975('0x4d')][_0x2975('0x40')]({'where':{'id':_0x532a34[_0x2975('0x43')]['id']}})[_0x2975('0x22')](handleEntityNotFound(_0x4b97ae,null))[_0x2975('0x22')](function(_0x342f29){if(_0x342f29){return _0x342f29[_0x2975('0x4e')](_0x532a34['body']['ids'],_['omit'](_0x532a34[_0x2975('0x42')],['ids','id'])||{});}})['then'](respondWithResult(_0x4b97ae,null))['catch'](handleError(_0x4b97ae,null));};exports[_0x2975('0x4f')]=function(_0x334c47,_0x38b193,_0x1b8437){var _0x2c4335={};var _0x596569={};var _0x2f1b89;var _0x2a1099;return db[_0x2975('0x38')][_0x2975('0x49')]({'where':{'id':_0x334c47[_0x2975('0x43')]['id']}})[_0x2975('0x22')](handleEntityNotFound(_0x38b193,null))[_0x2975('0x22')](function(_0x74ce86){if(_0x74ce86){_0x2f1b89=_0x74ce86;_0x596569[_0x2975('0x2f')]=_[_0x2975('0x2c')](db['Action'][_0x2975('0x28')]);_0x596569[_0x2975('0x2b')]=_[_0x2975('0x2c')](_0x334c47[_0x2975('0x2b')]);_0x596569[_0x2975('0x2d')]=_['intersection'](_0x596569[_0x2975('0x2f')],_0x596569[_0x2975('0x2b')]);_0x2c4335['attributes']=_[_0x2975('0x2e')](_0x596569[_0x2975('0x2f')],qs[_0x2975('0x31')](_0x334c47[_0x2975('0x2b')]['fields']));_0x2c4335[_0x2975('0x30')]=_0x2c4335[_0x2975('0x30')]['length']?_0x2c4335[_0x2975('0x30')]:_0x596569[_0x2975('0x2f')];_0x2c4335[_0x2975('0x4a')]=qs[_0x2975('0x34')](_0x334c47[_0x2975('0x2b')]['sort']);_0x2c4335[_0x2975('0x35')]=qs['filters'](_['pick'](_0x334c47[_0x2975('0x2b')],_0x596569[_0x2975('0x2d')]));if(_0x334c47[_0x2975('0x2b')][_0x2975('0x37')]){_0x2c4335['where']=_[_0x2975('0x3f')](_0x2c4335['where'],{'$or':_[_0x2975('0x2a')](_0x2c4335[_0x2975('0x30')],function(_0x214df5){var _0xa178bc={};_0xa178bc[_0x214df5]={'$like':'%'+_0x334c47[_0x2975('0x2b')]['filter']+'%'};return _0xa178bc;})});}_0x2c4335=_[_0x2975('0x3f')]({},_0x2c4335,_0x334c47[_0x2975('0x4b')]);return _0x2f1b89[_0x2975('0x4f')](_0x2c4335);}})['then'](function(_0x278a77){if(_0x278a77){_0x2a1099=_0x278a77[_0x2975('0x4c')];if(!_0x334c47['query']['hasOwnProperty'](_0x2975('0x33'))){_0x2c4335[_0x2975('0x1a')]=qs[_0x2975('0x1a')](_0x334c47[_0x2975('0x2b')]['limit']);_0x2c4335['offset']=qs['offset'](_0x334c47[_0x2975('0x2b')][_0x2975('0x18')]);}return _0x2f1b89[_0x2975('0x4f')](_0x2c4335);}})[_0x2975('0x22')](function(_0x3e5555){if(_0x3e5555){return _0x3e5555?{'count':_0x2a1099,'rows':_0x3e5555}:null;}})[_0x2975('0x22')](respondWithResult(_0x38b193,null))['catch'](handleError(_0x38b193,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 6fbdda2..b7ffbfe 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 _0x9f86=['exports','Automation','tools_automations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x43a42a,_0x261cdb){var _0x1f363b=function(_0x4516f5){while(--_0x4516f5){_0x43a42a['push'](_0x43a42a['shift']());}};_0x1f363b(++_0x261cdb);}(_0x9f86,0xab));var _0x69f8=function(_0x7e3f06,_0x426f70){_0x7e3f06=_0x7e3f06-0x0;var _0x12b8ff=_0x9f86[_0x7e3f06];return _0x12b8ff;};'use strict';var _=require(_0x69f8('0x0'));var util=require(_0x69f8('0x1'));var logger=require('../../config/logger')(_0x69f8('0x2'));var moment=require(_0x69f8('0x3'));var BPromise=require(_0x69f8('0x4'));var rp=require(_0x69f8('0x5'));var fs=require('fs');var path=require(_0x69f8('0x6'));var rimraf=require(_0x69f8('0x7'));var config=require(_0x69f8('0x8'));var attributes=require('./automation.attributes');module[_0x69f8('0x9')]=function(_0x484c02,_0x5b0cfd){return _0x484c02['define'](_0x69f8('0xa'),attributes,{'tableName':_0x69f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbcc3=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash'];(function(_0x2949c4,_0xad5c15){var _0x513f02=function(_0x599c13){while(--_0x599c13){_0x2949c4['push'](_0x2949c4['shift']());}};_0x513f02(++_0xad5c15);}(_0xbcc3,0x8f));var _0x3bcc=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0xbcc3[_0x21de89];return _0x290b7e;};'use strict';var _=require(_0x3bcc('0x0'));var util=require(_0x3bcc('0x1'));var logger=require('../../config/logger')(_0x3bcc('0x2'));var moment=require(_0x3bcc('0x3'));var BPromise=require(_0x3bcc('0x4'));var rp=require(_0x3bcc('0x5'));var fs=require('fs');var path=require(_0x3bcc('0x6'));var rimraf=require(_0x3bcc('0x7'));var config=require(_0x3bcc('0x8'));var attributes=require(_0x3bcc('0x9'));module['exports']=function(_0xa5b33c,_0x2f2df2){return _0xa5b33c[_0x3bcc('0xa')]('Automation',attributes,{'tableName':_0x3bcc('0xb'),'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 7649412..e968557 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 _0xcac3=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x556b47,_0x53ffe5){var _0x101453=function(_0x301a79){while(--_0x301a79){_0x556b47['push'](_0x556b47['shift']());}};_0x101453(++_0x53ffe5);}(_0xcac3,0x193));var _0x3cac=function(_0x317bf0,_0x277c03){_0x317bf0=_0x317bf0-0x0;var _0x225932=_0xcac3[_0x317bf0];return _0x225932;};'use strict';var _=require('lodash');var util=require(_0x3cac('0x0'));var moment=require(_0x3cac('0x1'));var BPromise=require(_0x3cac('0x2'));var rs=require(_0x3cac('0x3'));var fs=require('fs');var Redis=require(_0x3cac('0x4'));var db=require(_0x3cac('0x5'))['db'];var utils=require(_0x3cac('0x6'));var logger=require(_0x3cac('0x7'))(_0x3cac('0x8'));var config=require(_0x3cac('0x9'));var jayson=require(_0x3cac('0xa'));var client=jayson[_0x3cac('0xb')][_0x3cac('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e2560,_0x14562c,_0x21365c){return new BPromise(function(_0x13c1b9,_0x55670d){return client[_0x3cac('0xd')](_0x1e2560,_0x21365c)[_0x3cac('0xe')](function(_0x3bcbed){logger[_0x3cac('0xf')](_0x3cac('0x10'),_0x14562c,'request\x20sent');logger[_0x3cac('0x11')](_0x3cac('0x12'),_0x14562c,_0x3cac('0x13'),JSON[_0x3cac('0x14')](_0x3bcbed));if(_0x3bcbed[_0x3cac('0x15')]){if(_0x3bcbed['error']['code']===0x1f4){logger[_0x3cac('0x15')](_0x3cac('0x10'),_0x14562c,_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);return _0x55670d(_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);}logger[_0x3cac('0x15')]('Automation,\x20%s,\x20%s',_0x14562c,_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);return _0x13c1b9(_0x3bcbed[_0x3cac('0x15')][_0x3cac('0x16')]);}else{logger[_0x3cac('0xf')](_0x3cac('0x10'),_0x14562c,_0x3cac('0x13'));_0x13c1b9(_0x3bcbed[_0x3cac('0x17')][_0x3cac('0x16')]);}})[_0x3cac('0x18')](function(_0x4173ca){logger[_0x3cac('0x15')](_0x3cac('0x10'),_0x14562c,_0x4173ca);_0x55670d(_0x4173ca);});});}
\ No newline at end of file
+var _0x531a=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x5870a6,_0x39867c){var _0x2a9efb=function(_0x2060f5){while(--_0x2060f5){_0x5870a6['push'](_0x5870a6['shift']());}};_0x2a9efb(++_0x39867c);}(_0x531a,0x100));var _0xa531=function(_0x1bf3b8,_0x8edcaa){_0x1bf3b8=_0x1bf3b8-0x0;var _0x52fd20=_0x531a[_0x1bf3b8];return _0x52fd20;};'use strict';var _=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var moment=require(_0xa531('0x2'));var BPromise=require(_0xa531('0x3'));var rs=require(_0xa531('0x4'));var fs=require('fs');var Redis=require(_0xa531('0x5'));var db=require(_0xa531('0x6'))['db'];var utils=require(_0xa531('0x7'));var logger=require(_0xa531('0x8'))(_0xa531('0x9'));var config=require('../../config/environment');var jayson=require(_0xa531('0xa'));var client=jayson['client'][_0xa531('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4446b9,_0x3fd172,_0x286dc7){return new BPromise(function(_0x3b68a7,_0x5bd2f9){return client[_0xa531('0xc')](_0x4446b9,_0x286dc7)[_0xa531('0xd')](function(_0x4d07e4){logger[_0xa531('0xe')](_0xa531('0xf'),_0x3fd172,_0xa531('0x10'));logger[_0xa531('0x11')](_0xa531('0x12'),_0x3fd172,'request\x20sent',JSON[_0xa531('0x13')](_0x4d07e4));if(_0x4d07e4['error']){if(_0x4d07e4[_0xa531('0x14')][_0xa531('0x15')]===0x1f4){logger[_0xa531('0x14')]('Automation,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x5bd2f9(_0x4d07e4['error'][_0xa531('0x16')]);}logger[_0xa531('0x14')]('Automation,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x3b68a7(_0x4d07e4[_0xa531('0x14')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x3fd172,_0xa531('0x10'));_0x3b68a7(_0x4d07e4[_0xa531('0x17')][_0xa531('0x16')]);}})[_0xa531('0x18')](function(_0x324076){logger[_0xa531('0x14')]('Automation,\x20%s,\x20%s',_0x3fd172,_0x324076);_0x5bd2f9(_0x324076);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 3315115..797030b 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 _0x7bbd=['delete','destroy','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','getActions','create','post','put'];(function(_0x2b9c0c,_0x4678a3){var _0xd8577b=function(_0x2dd9eb){while(--_0x2dd9eb){_0x2b9c0c['push'](_0x2b9c0c['shift']());}};_0xd8577b(++_0x4678a3);}(_0x7bbd,0x11f));var _0xd7bb=function(_0x2f05c7,_0x15b439){_0x2f05c7=_0x2f05c7-0x0;var _0x1533e3=_0x7bbd[_0x2f05c7];return _0x1533e3;};'use strict';var multer=require(_0xd7bb('0x0'));var util=require(_0xd7bb('0x1'));var path=require(_0xd7bb('0x2'));var timeout=require(_0xd7bb('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd7bb('0x4'));var config=require(_0xd7bb('0x5'));var controller=require('./automation.controller');router[_0xd7bb('0x6')]('/',auth[_0xd7bb('0x7')](),controller[_0xd7bb('0x8')]);router[_0xd7bb('0x6')](_0xd7bb('0x9'),auth[_0xd7bb('0x7')](),controller[_0xd7bb('0xa')]);router[_0xd7bb('0x6')](_0xd7bb('0xb'),auth[_0xd7bb('0x7')](),controller['getConditions']);router[_0xd7bb('0x6')](_0xd7bb('0xc'),auth[_0xd7bb('0x7')](),controller[_0xd7bb('0xd')]);router['post']('/',auth[_0xd7bb('0x7')](),controller[_0xd7bb('0xe')]);router['post']('/:id/conditions',auth[_0xd7bb('0x7')](),controller['addConditions']);router[_0xd7bb('0xf')]('/:id/actions',auth[_0xd7bb('0x7')](),controller['addActions']);router[_0xd7bb('0x10')](_0xd7bb('0x9'),auth[_0xd7bb('0x7')](),controller['update']);router[_0xd7bb('0x11')]('/:id',auth[_0xd7bb('0x7')](),controller[_0xd7bb('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xde6c=['../../config/environment','./automation.controller','isAuthenticated','index','get','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xde6c,0x119));var _0xcde6=function(_0x21b57f,_0x9ba5fb){_0x21b57f=_0x21b57f-0x0;var _0x3dac6f=_0xde6c[_0x21b57f];return _0x3dac6f;};'use strict';var multer=require(_0xcde6('0x0'));var util=require(_0xcde6('0x1'));var path=require('path');var timeout=require(_0xcde6('0x2'));var express=require(_0xcde6('0x3'));var router=express[_0xcde6('0x4')]();var fs_extra=require(_0xcde6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcde6('0x6'));var config=require(_0xcde6('0x7'));var controller=require(_0xcde6('0x8'));router['get']('/',auth[_0xcde6('0x9')](),controller[_0xcde6('0xa')]);router['get']('/:id',auth[_0xcde6('0x9')](),controller['show']);router[_0xcde6('0xb')](_0xcde6('0xc'),auth[_0xcde6('0x9')](),controller[_0xcde6('0xd')]);router['get'](_0xcde6('0xe'),auth[_0xcde6('0x9')](),controller['getActions']);router[_0xcde6('0xf')]('/',auth[_0xcde6('0x9')](),controller[_0xcde6('0x10')]);router[_0xcde6('0xf')](_0xcde6('0xc'),auth[_0xcde6('0x9')](),controller[_0xcde6('0x11')]);router[_0xcde6('0xf')](_0xcde6('0xe'),auth[_0xcde6('0x9')](),controller['addActions']);router[_0xcde6('0x12')](_0xcde6('0x13'),auth[_0xcde6('0x9')](),controller[_0xcde6('0x14')]);router[_0xcde6('0x15')](_0xcde6('0x13'),auth[_0xcde6('0x9')](),controller[_0xcde6('0x16')]);module[_0xcde6('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 6eb83ae..c3ba9ea 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 _0xae39=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#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)','STRING','name','ENUM','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\x20(min:1,\x20max:999)','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,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x2a44d3,_0x434aef){var _0x455b5f=function(_0x1e1ef5){while(--_0x1e1ef5){_0x2a44d3['push'](_0x2a44d3['shift']());}};_0x455b5f(++_0x434aef);}(_0xae39,0x165));var _0x9ae3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xae39[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9ae3('0x0')],'unique':_0x9ae3('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x9ae3('0x2')]('ivr'),'allowNull':![],'defaultValue':_0x9ae3('0x3')},'description':{'type':Sequelize[_0x9ae3('0x0')]},'active':{'type':Sequelize[_0x9ae3('0x4')],'defaultValue':0x0,'comment':_0x9ae3('0x5')},'limitCalls':{'type':Sequelize[_0x9ae3('0x6')](0x4)[_0x9ae3('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x9ae3('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9ae3('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x9ae3('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ae3('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9ae3('0x6')](0x3)[_0x9ae3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ae3('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9ae3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9ae3('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x9ae3('0x6')](0x3)[_0x9ae3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ae3('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9ae3('0x6')](0x5)[_0x9ae3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9ae3('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9ae3('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x9ae3('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9ae3('0x6')](0x5)[_0x9ae3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9ae3('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9ae3('0x6')](0x3)[_0x9ae3('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9ae3('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9ae3('0x0')],'defaultValue':_0x9ae3('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x9ae3('0x2')](_0x9ae3('0x12'),'never',_0x9ae3('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x9ae3('0x4')],'defaultValue':0x0,'comment':_0x9ae3('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x9ae3('0x6')](0x9)[_0x9ae3('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9ae3('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x9ae3('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9ae3('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9ae3('0x6')](0x9)[_0x9ae3('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x9ae3('0x6')](0x9)[_0x9ae3('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9ae3('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9ae3('0x6')](0x9)[_0x9ae3('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9ae3('0x6')](0x9)[_0x9ae3('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9ae3('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9ae3('0x6')](0x5)[_0x9ae3('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9ae3('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9ae3('0x6')](0x9)[_0x9ae3('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9ae3('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9ae3('0x2')](_0x9ae3('0x1b'),_0x9ae3('0x1c')),'defaultValue':_0x9ae3('0x1b')},'dialPrefix':{'type':Sequelize[_0x9ae3('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x9ae3('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9ae3('0x1d')},'dialCutDigit':{'type':Sequelize[_0x9ae3('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9ae3('0x6')](0x3)[_0x9ae3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ae3('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9ae3('0x6')](0x5)[_0x9ae3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9ae3('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x9ae3('0x6')](0x3)[_0x9ae3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ae3('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x9ae3('0x6')](0x5)[_0x9ae3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9ae3('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9ae3('0x6')](0x3)[_0x9ae3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ae3('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9ae3('0x6')](0x5)[_0x9ae3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x9ae3('0x6')](0x3)[_0x9ae3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ae3('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9ae3('0x6')](0x5)[_0x9ae3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9ae3('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9ae3('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9ae3('0x6')](0x5)[_0x9ae3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x34d7=['name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','DESC','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING'];(function(_0x46848e,_0xe1b792){var _0x3fcfcb=function(_0x2777dd){while(--_0x2777dd){_0x46848e['push'](_0x46848e['shift']());}};_0x3fcfcb(++_0xe1b792);}(_0x34d7,0x13c));var _0x734d=function(_0x34651c,_0xc8554c){_0x34651c=_0x34651c-0x0;var _0x3c5ada=_0x34d7[_0x34651c];return _0x3c5ada;};'use strict';var Sequelize=require(_0x734d('0x0'));module[_0x734d('0x1')]={'name':{'type':Sequelize[_0x734d('0x2')],'unique':_0x734d('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x734d('0x4')](_0x734d('0x5')),'allowNull':![],'defaultValue':_0x734d('0x5')},'description':{'type':Sequelize[_0x734d('0x2')]},'active':{'type':Sequelize[_0x734d('0x6')],'defaultValue':0x0,'comment':_0x734d('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x734d('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x734d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x734d('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x734d('0x9')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x734d('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x734d('0x9')](0x3)[_0x734d('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x734d('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x734d('0x9')](0x3)[_0x734d('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x734d('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x734d('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x734d('0x9')](0x3)[_0x734d('0xb')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x734d('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x734d('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x734d('0xd')},'dialTimezone':{'type':Sequelize[_0x734d('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x734d('0x2')],'defaultValue':_0x734d('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x734d('0x4')](_0x734d('0xf'),'never',_0x734d('0x10')),'defaultValue':_0x734d('0xf')},'dialAMDActive':{'type':Sequelize[_0x734d('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x734d('0x9')](0x9)[_0x734d('0xb')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x734d('0x11')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x734d('0xb')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x734d('0x9')](0x9)[_0x734d('0xb')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x734d('0x9')](0x9)[_0x734d('0xb')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x734d('0x12')},'dialAMDMinWordLength':{'type':Sequelize[_0x734d('0x9')](0x9)[_0x734d('0xb')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x734d('0x9')](0x9)[_0x734d('0xb')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x734d('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x734d('0x9')](0x9)[_0x734d('0xb')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x734d('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x734d('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x734d('0x9')](0x9)[_0x734d('0xb')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':_0x734d('0x15')},'dialPrefix':{'type':Sequelize[_0x734d('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x734d('0x9')](0x3)[_0x734d('0xb')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x734d('0xb')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x734d('0x9')](0x5)[_0x734d('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x734d('0x16')},'dialDropMaxRetry':{'type':Sequelize[_0x734d('0x9')](0x3)[_0x734d('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x734d('0x9')](0x5)[_0x734d('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x734d('0x17')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x734d('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x734d('0x18')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x734d('0x9')](0x5)[_0x734d('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x734d('0x19')},'dialMachineMaxRetry':{'type':Sequelize[_0x734d('0x9')](0x3)[_0x734d('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x734d('0x1a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x734d('0x9')](0x5)[_0x734d('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x734d('0xb')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x734d('0x1b')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x734d('0xb')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x734d('0x1c')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 590de3c..168d078 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 _0x6988=['../../config/logger','api','../../config/utils','../../config/license/util','status','end','undefined','limit','count','offset','set','json','reject','save','then','get','IvrCampaigns','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','order','sort','where','filters','merge','VIRTUAL','filter','options','include','Campaign','findAll','rows','catch','show','params','intersection','fields','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','update','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','field','phone','toString','from','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','getBlackLists','CmList','addBlackLists','spread','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0xd135db,_0x154ab1){var _0x2099d6=function(_0x260519){while(--_0x260519){_0xd135db['push'](_0xd135db['shift']());}};_0x2099d6(++_0x154ab1);}(_0x6988,0x81));var _0x8698=function(_0x4551c7,_0x546fa3){_0x4551c7=_0x4551c7-0x0;var _0x1823d0=_0x6988[_0x4551c7];return _0x1823d0;};'use strict';var emlformat=require(_0x8698('0x0'));var rimraf=require(_0x8698('0x1'));var zipdir=require(_0x8698('0x2'));var jsonpatch=require(_0x8698('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8698('0x4'));var Mustache=require(_0x8698('0x5'));var util=require(_0x8698('0x6'));var path=require(_0x8698('0x7'));var sox=require('sox');var csv=require(_0x8698('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8698('0x9'));var _=require(_0x8698('0xa'));var squel=require(_0x8698('0xb'));var crypto=require(_0x8698('0xc'));var jsforce=require(_0x8698('0xd'));var deskjs=require(_0x8698('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8698('0xf'));var Papa=require(_0x8698('0x10'));var Redis=require(_0x8698('0x11'));var authService=require(_0x8698('0x12'));var qs=require(_0x8698('0x13'));var as=require(_0x8698('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8698('0x15'))(_0x8698('0x16'));var utils=require(_0x8698('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8698('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ba336,_0x28587c){_0x28587c=_0x28587c||0xcc;return function(_0x510f8b){if(_0x510f8b){return _0x5ba336['sendStatus'](_0x28587c);}return _0x5ba336[_0x8698('0x19')](_0x28587c)[_0x8698('0x1a')]();};}function respondWithResult(_0x246d98,_0x2b0c5f){_0x2b0c5f=_0x2b0c5f||0xc8;return function(_0x21037d){if(_0x21037d){return _0x246d98['status'](_0x2b0c5f)['json'](_0x21037d);}};}function respondWithFilteredResult(_0x4e811d,_0x35de00){return function(_0x219b1a){if(_0x219b1a){var _0x4c59ba=typeof _0x35de00['offset']===_0x8698('0x1b')&&typeof _0x35de00[_0x8698('0x1c')]===_0x8698('0x1b');var _0x59722b=_0x219b1a[_0x8698('0x1d')];var _0x35f7ec=_0x4c59ba?0x0:_0x35de00[_0x8698('0x1e')];var _0x4a1da8=_0x4c59ba?_0x219b1a['count']:_0x35de00[_0x8698('0x1e')]+_0x35de00['limit'];var _0x1af6f9;if(_0x4a1da8>=_0x59722b){_0x4a1da8=_0x59722b;_0x1af6f9=0xc8;}else{_0x1af6f9=0xce;}_0x4e811d[_0x8698('0x19')](_0x1af6f9);return _0x4e811d[_0x8698('0x1f')]('Content-Range',_0x35f7ec+'-'+_0x4a1da8+'/'+_0x59722b)[_0x8698('0x20')](_0x219b1a);}return null;};}function patchUpdates(_0x20b2c7){return function(_0x3fdc69){try{jsonpatch['apply'](_0x3fdc69,_0x20b2c7,!![]);}catch(_0x5b7a04){return BPromise[_0x8698('0x21')](_0x5b7a04);}return _0x3fdc69[_0x8698('0x22')]();};}function saveUpdates(_0x8b702e,_0x101ab5){return function(_0x57cdc0){if(_0x57cdc0){return _0x57cdc0['update'](_0x8b702e)[_0x8698('0x23')](function(_0x3eebbd){return _0x3eebbd;});}return null;};}function removeEntity(_0x312558,_0x14e9f9){return function(_0x70db99){if(_0x70db99){return _0x70db99['destroy']()[_0x8698('0x23')](function(){var _0x29a7e0=_0x70db99[_0x8698('0x24')]({'plain':!![]});var _0x5d8766=_0x8698('0x25');return db['UserProfileResource'][_0x8698('0x26')]({'where':{'type':_0x5d8766,'resourceId':_0x29a7e0['id']}})['then'](function(){return _0x70db99;});})['then'](function(){_0x312558[_0x8698('0x19')](0xcc)[_0x8698('0x1a')]();});}};}function handleEntityNotFound(_0x2622d1,_0xc44fe8){return function(_0x10481a){if(!_0x10481a){_0x2622d1['sendStatus'](0x194);}return _0x10481a;};}function handleError(_0x3eb614,_0x53f4ce){_0x53f4ce=_0x53f4ce||0x1f4;return function(_0x423118){logger[_0x8698('0x27')](_0x423118[_0x8698('0x28')]);if(_0x423118[_0x8698('0x29')]){delete _0x423118[_0x8698('0x29')];}_0x3eb614['status'](_0x53f4ce)['send'](_0x423118);};}exports[_0x8698('0x2a')]=function(_0x5b4ce4,_0x3d596f){var _0x4d3bf4={},_0x3d26ec={},_0x20aca4={'count':0x0,'rows':[]};var _0x190c91=_[_0x8698('0x2b')](db['Campaign'][_0x8698('0x2c')],function(_0x54a294){return{'name':_0x54a294[_0x8698('0x2d')],'type':_0x54a294[_0x8698('0x2e')][_0x8698('0x2f')]};});_0x3d26ec[_0x8698('0x30')]=_[_0x8698('0x2b')](_0x190c91,_0x8698('0x29'));_0x3d26ec[_0x8698('0x31')]=_[_0x8698('0x32')](_0x5b4ce4[_0x8698('0x31')]);_0x3d26ec['filters']=_['intersection'](_0x3d26ec[_0x8698('0x30')],_0x3d26ec[_0x8698('0x31')]);_0x4d3bf4[_0x8698('0x33')]=_['intersection'](_0x3d26ec['model'],qs['fields'](_0x5b4ce4[_0x8698('0x31')]['fields']));_0x4d3bf4[_0x8698('0x33')]=_0x4d3bf4[_0x8698('0x33')]['length']?_0x4d3bf4[_0x8698('0x33')]:_0x3d26ec['model'];if(!_0x5b4ce4[_0x8698('0x31')]['hasOwnProperty']('nolimit')){_0x4d3bf4[_0x8698('0x1c')]=qs[_0x8698('0x1c')](_0x5b4ce4[_0x8698('0x31')][_0x8698('0x1c')]);_0x4d3bf4[_0x8698('0x1e')]=qs['offset'](_0x5b4ce4[_0x8698('0x31')]['offset']);}_0x4d3bf4[_0x8698('0x34')]=qs[_0x8698('0x35')](_0x5b4ce4['query'][_0x8698('0x35')]);_0x4d3bf4[_0x8698('0x36')]=qs[_0x8698('0x37')](_['pick'](_0x5b4ce4[_0x8698('0x31')],_0x3d26ec[_0x8698('0x37')]),_0x190c91);if(_0x5b4ce4[_0x8698('0x31')]['filter']){_0x4d3bf4[_0x8698('0x36')]=_[_0x8698('0x38')](_0x4d3bf4['where'],{'$or':_[_0x8698('0x2b')](_0x190c91,function(_0x17a9f0){if(_0x17a9f0[_0x8698('0x2e')]!==_0x8698('0x39')){var _0x190564={};_0x190564[_0x17a9f0['name']]={'$like':'%'+_0x5b4ce4[_0x8698('0x31')][_0x8698('0x3a')]+'%'};return _0x190564;}})});}_0x4d3bf4=_[_0x8698('0x38')]({},_0x4d3bf4,_0x5b4ce4[_0x8698('0x3b')]);var _0x3ca84f={'where':_0x4d3bf4[_0x8698('0x36')]};return db['Campaign'][_0x8698('0x1d')](_0x3ca84f)[_0x8698('0x23')](function(_0x5a7039){_0x20aca4['count']=_0x5a7039;if(_0x5b4ce4[_0x8698('0x31')]['includeAll']){_0x4d3bf4[_0x8698('0x3c')]=[{'all':!![]}];}return db[_0x8698('0x3d')][_0x8698('0x3e')](_0x4d3bf4);})[_0x8698('0x23')](function(_0x1bad4d){_0x20aca4[_0x8698('0x3f')]=_0x1bad4d;return _0x20aca4;})[_0x8698('0x23')](respondWithFilteredResult(_0x3d596f,_0x4d3bf4))[_0x8698('0x40')](handleError(_0x3d596f,null));};exports[_0x8698('0x41')]=function(_0x496d8e,_0x519ee3){var _0xdaa241={'raw':![],'where':{'id':_0x496d8e[_0x8698('0x42')]['id']}},_0x2224ac={};_0x2224ac['model']=_[_0x8698('0x32')](db[_0x8698('0x3d')][_0x8698('0x2c')]);_0x2224ac[_0x8698('0x31')]=_[_0x8698('0x32')](_0x496d8e[_0x8698('0x31')]);_0x2224ac[_0x8698('0x37')]=_[_0x8698('0x43')](_0x2224ac['model'],_0x2224ac[_0x8698('0x31')]);_0xdaa241[_0x8698('0x33')]=_[_0x8698('0x43')](_0x2224ac[_0x8698('0x30')],qs[_0x8698('0x44')](_0x496d8e[_0x8698('0x31')][_0x8698('0x44')]));_0xdaa241[_0x8698('0x33')]=_0xdaa241[_0x8698('0x33')][_0x8698('0x45')]?_0xdaa241[_0x8698('0x33')]:_0x2224ac[_0x8698('0x30')];if(_0x496d8e[_0x8698('0x31')][_0x8698('0x46')]){_0xdaa241[_0x8698('0x3c')]=[{'all':!![]}];}_0xdaa241=_[_0x8698('0x38')]({},_0xdaa241,_0x496d8e['options']);return db['Campaign'][_0x8698('0x47')](_0xdaa241)[_0x8698('0x23')](handleEntityNotFound(_0x519ee3,null))[_0x8698('0x23')](respondWithResult(_0x519ee3,null))['catch'](handleError(_0x519ee3,null));};exports[_0x8698('0x48')]=function(_0x1cb5d4,_0x124a52){return db['Campaign'][_0x8698('0x48')](_0x1cb5d4[_0x8698('0x49')],{})[_0x8698('0x23')](function(_0x5a3306){var _0x2ee8e1=_0x1cb5d4[_0x8698('0x4a')][_0x8698('0x24')]({'plain':!![]});if(!_0x2ee8e1)throw new Error(_0x8698('0x4b'));if(_0x2ee8e1[_0x8698('0x4c')]===_0x8698('0x4a')){var _0x47cc85=_0x5a3306[_0x8698('0x24')]({'plain':!![]});var _0x185799=_0x8698('0x25');return db['UserProfileSection'][_0x8698('0x47')]({'where':{'name':_0x185799,'userProfileId':_0x2ee8e1[_0x8698('0x4d')]},'raw':!![]})['then'](function(_0x59061b){if(_0x59061b&&_0x59061b[_0x8698('0x4e')]===0x0){return db[_0x8698('0x4f')][_0x8698('0x48')]({'name':_0x47cc85[_0x8698('0x29')],'resourceId':_0x47cc85['id'],'type':_0x59061b[_0x8698('0x29')],'sectionId':_0x59061b['id']},{})[_0x8698('0x23')](function(){return _0x5a3306;});}else{return _0x5a3306;}})[_0x8698('0x40')](function(_0x39780f){logger['error'](_0x8698('0x50'),_0x39780f);throw _0x39780f;});}return _0x5a3306;})[_0x8698('0x23')](respondWithResult(_0x124a52,0xc9))['catch'](handleError(_0x124a52,null));};exports[_0x8698('0x51')]=function(_0x50b522,_0x15e351){var _0x1d89d4={'where':{'id':_0x50b522[_0x8698('0x42')]['id']}},_0x33b02a={};_0x33b02a[_0x8698('0x30')]=_[_0x8698('0x32')](db[_0x8698('0x3d')][_0x8698('0x2c')]);_0x1d89d4['attributes']=_['intersection'](_0x33b02a['model'],qs[_0x8698('0x44')](_0x50b522[_0x8698('0x31')][_0x8698('0x44')]));_0x1d89d4[_0x8698('0x33')]=_0x1d89d4[_0x8698('0x33')][_0x8698('0x45')]?_0x1d89d4[_0x8698('0x33')]:_0x33b02a[_0x8698('0x30')];if(_0x50b522['query']['includeAll']){_0x1d89d4['include']=[{'all':!![]}];}_0x1d89d4=_['merge']({},_0x1d89d4,_0x50b522[_0x8698('0x3b')]);return db[_0x8698('0x3d')][_0x8698('0x47')](_0x1d89d4)[_0x8698('0x23')](handleEntityNotFound(_0x15e351,null))[_0x8698('0x23')](function(_0x5bc286){if(_0x5bc286){var _0x5cabf2=_0x5bc286[_0x8698('0x24')]({'plain':!![]});_0x5cabf2=qs[_0x8698('0x52')](_0x5cabf2,['id',_0x8698('0x53'),_0x8698('0x54')]);_0x50b522[_0x8698('0x49')]=_[_0x8698('0x52')](_0x50b522[_0x8698('0x49')],['id','createdAt',_0x8698('0x54')]);return db[_0x8698('0x3d')][_0x8698('0x48')](_[_0x8698('0x38')](_0x5cabf2,_0x50b522['body']),{'include':_0x50b522['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3a288b){var _0x1f3b6e=_0x50b522['user'][_0x8698('0x24')]({'plain':!![]});if(!_0x1f3b6e)throw new Error(_0x8698('0x4b'));if(_0x1f3b6e[_0x8698('0x4c')]===_0x8698('0x4a')){var _0x2a5159=_0x3a288b[_0x8698('0x24')]({'plain':!![]});var _0x49a22f=_0x8698('0x25');return db[_0x8698('0x55')][_0x8698('0x47')]({'where':{'name':_0x49a22f,'userProfileId':_0x1f3b6e[_0x8698('0x4d')]},'raw':!![]})[_0x8698('0x23')](function(_0x48bbe5){if(_0x48bbe5&&_0x48bbe5['autoAssociation']===0x0){return db[_0x8698('0x4f')]['create']({'name':_0x2a5159[_0x8698('0x29')],'resourceId':_0x2a5159['id'],'type':_0x48bbe5['name'],'sectionId':_0x48bbe5['id']},{})['then'](function(){return _0x3a288b;});}else{return _0x3a288b;}})[_0x8698('0x40')](function(_0x56e009){logger['error'](_0x8698('0x50'),_0x56e009);throw _0x56e009;});}return _0x3a288b;});}})[_0x8698('0x23')](respondWithResult(_0x15e351,0xc9))[_0x8698('0x40')](handleError(_0x15e351,null));};exports[_0x8698('0x56')]=function(_0x2fbc86,_0x31795f){if(_0x2fbc86[_0x8698('0x49')]['id']){delete _0x2fbc86[_0x8698('0x49')]['id'];}return db['Campaign'][_0x8698('0x47')]({'where':{'id':_0x2fbc86[_0x8698('0x42')]['id']}})[_0x8698('0x23')](handleEntityNotFound(_0x31795f,null))[_0x8698('0x23')](saveUpdates(_0x2fbc86[_0x8698('0x49')],null))['then'](respondWithResult(_0x31795f,null))[_0x8698('0x40')](handleError(_0x31795f,null));};exports[_0x8698('0x26')]=function(_0x5789e8,_0x5a05a8){return db['Campaign']['find']({'where':{'id':_0x5789e8[_0x8698('0x42')]['id']}})[_0x8698('0x23')](handleEntityNotFound(_0x5a05a8,null))[_0x8698('0x23')](removeEntity(_0x5a05a8,null))[_0x8698('0x40')](handleError(_0x5a05a8,null));};exports[_0x8698('0x57')]=function(_0x4c2547,_0x303171,_0x401194){var _0x577bbd={'raw':!![],'where':{}};var _0x396896={};var _0xb4d1ba={'count':0x0,'rows':[]};return db[_0x8698('0x3d')][_0x8698('0x58')]({'where':{'id':_0x4c2547[_0x8698('0x42')]['id']}})[_0x8698('0x23')](handleEntityNotFound(_0x303171,null))['then'](function(_0x2928ae){if(_0x2928ae){_0x396896[_0x8698('0x30')]=_['keys'](db[_0x8698('0x59')][_0x8698('0x2c')]);_0x396896[_0x8698('0x31')]=_[_0x8698('0x32')](_0x4c2547[_0x8698('0x31')]);_0x396896[_0x8698('0x37')]=_[_0x8698('0x43')](_0x396896[_0x8698('0x30')],_0x396896[_0x8698('0x31')]);_0x577bbd['attributes']=_[_0x8698('0x43')](_0x396896[_0x8698('0x30')],qs[_0x8698('0x44')](_0x4c2547[_0x8698('0x31')][_0x8698('0x44')]));_0x577bbd[_0x8698('0x33')]=_0x577bbd[_0x8698('0x33')][_0x8698('0x45')]?_0x577bbd[_0x8698('0x33')]:_0x396896[_0x8698('0x30')];if(!_0x4c2547['query'][_0x8698('0x5a')](_0x8698('0x5b'))){_0x577bbd[_0x8698('0x1c')]=qs[_0x8698('0x1c')](_0x4c2547[_0x8698('0x31')][_0x8698('0x1c')]);_0x577bbd[_0x8698('0x1e')]=qs['offset'](_0x4c2547[_0x8698('0x31')][_0x8698('0x1e')]);}_0x577bbd[_0x8698('0x34')]=qs['sort'](_0x4c2547[_0x8698('0x31')]['sort']);_0x577bbd[_0x8698('0x36')]=qs[_0x8698('0x37')](_[_0x8698('0x5c')](_0x4c2547['query'],_0x396896[_0x8698('0x37')]));_0x577bbd[_0x8698('0x36')][_0x8698('0x5d')]=_0x2928ae['id'];if(_0x4c2547[_0x8698('0x31')][_0x8698('0x3a')]){_0x577bbd[_0x8698('0x36')]=_['merge'](_0x577bbd['where'],{'$or':_[_0x8698('0x2b')](_0x577bbd[_0x8698('0x33')],function(_0x5f3258){var _0x22e4b5={};_0x22e4b5[_0x5f3258]={'$like':'%'+_0x4c2547[_0x8698('0x31')]['filter']+'%'};return _0x22e4b5;})});}_0x577bbd=_[_0x8698('0x38')]({},_0x577bbd,_0x4c2547['options']);return db[_0x8698('0x59')][_0x8698('0x1d')]({'where':_0x577bbd[_0x8698('0x36')]})['then'](function(_0x483b8f){_0xb4d1ba['count']=_0x483b8f;if(_0x4c2547['query']['includeAll']){_0x577bbd[_0x8698('0x3c')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x577bbd);})['then'](function(_0x4731ba){_0xb4d1ba[_0x8698('0x3f')]=_0x4731ba;return _0xb4d1ba;});}})['then'](respondWithFilteredResult(_0x303171,_0x577bbd))[_0x8698('0x40')](handleError(_0x303171,null));};exports[_0x8698('0x5e')]=function(_0x248faa,_0x747e07,_0x658b11){var _0x1c5631={'raw':!![],'where':{}};var _0x5369f8={};var _0x453d01={'count':0x0,'rows':[]};return db['Campaign'][_0x8698('0x58')]({'where':{'id':_0x248faa['params']['id']}})['then'](handleEntityNotFound(_0x747e07,null))[_0x8698('0x23')](function(_0x3c292c){if(_0x3c292c){_0x5369f8[_0x8698('0x30')]=_[_0x8698('0x32')](db['CmHopperHistory']['rawAttributes']);_0x5369f8[_0x8698('0x31')]=_[_0x8698('0x32')](_0x248faa[_0x8698('0x31')]);_0x5369f8[_0x8698('0x37')]=_[_0x8698('0x43')](_0x5369f8[_0x8698('0x30')],_0x5369f8['query']);_0x1c5631[_0x8698('0x33')]=_['intersection'](_0x5369f8[_0x8698('0x30')],qs[_0x8698('0x44')](_0x248faa[_0x8698('0x31')]['fields']));_0x1c5631[_0x8698('0x33')]=_0x1c5631[_0x8698('0x33')]['length']?_0x1c5631[_0x8698('0x33')]:_0x5369f8[_0x8698('0x30')];if(!_0x248faa[_0x8698('0x31')]['hasOwnProperty'](_0x8698('0x5b'))){_0x1c5631[_0x8698('0x1c')]=qs[_0x8698('0x1c')](_0x248faa[_0x8698('0x31')][_0x8698('0x1c')]);_0x1c5631[_0x8698('0x1e')]=qs[_0x8698('0x1e')](_0x248faa[_0x8698('0x31')]['offset']);}_0x1c5631[_0x8698('0x34')]=qs[_0x8698('0x35')](_0x248faa[_0x8698('0x31')][_0x8698('0x35')]);_0x1c5631[_0x8698('0x36')]=qs['filters'](_[_0x8698('0x5c')](_0x248faa[_0x8698('0x31')],_0x5369f8[_0x8698('0x37')]));_0x1c5631[_0x8698('0x36')][_0x8698('0x5d')]=_0x3c292c['id'];if(_0x248faa[_0x8698('0x31')][_0x8698('0x3a')]){_0x1c5631['where']=_[_0x8698('0x38')](_0x1c5631[_0x8698('0x36')],{'$or':_[_0x8698('0x2b')](_0x1c5631['attributes'],function(_0x340eff){var _0xae9ed8={};_0xae9ed8[_0x340eff]={'$like':'%'+_0x248faa[_0x8698('0x31')][_0x8698('0x3a')]+'%'};return _0xae9ed8;})});}_0x1c5631=_[_0x8698('0x38')]({},_0x1c5631,_0x248faa['options']);return db[_0x8698('0x5f')][_0x8698('0x1d')]({'where':_0x1c5631['where']})[_0x8698('0x23')](function(_0x150733){_0x453d01['count']=_0x150733;if(_0x248faa['query']['includeAll']){_0x1c5631[_0x8698('0x3c')]=[{'all':!![]}];}return db[_0x8698('0x5f')][_0x8698('0x3e')](_0x1c5631);})[_0x8698('0x23')](function(_0x557bb3){_0x453d01[_0x8698('0x3f')]=_0x557bb3;return _0x453d01;});}})[_0x8698('0x23')](respondWithFilteredResult(_0x747e07,_0x1c5631))[_0x8698('0x40')](handleError(_0x747e07,null));};exports[_0x8698('0x60')]=function(_0xe227c5,_0x97a5f5,_0x3e8b3b){var _0x114dd6={'raw':!![],'where':{}};var _0x28de9b={};var _0x354aca={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xe227c5[_0x8698('0x42')]['id']}})[_0x8698('0x23')](handleEntityNotFound(_0x97a5f5,null))[_0x8698('0x23')](function(_0x2f7afa){if(_0x2f7afa){_0x28de9b[_0x8698('0x30')]=_[_0x8698('0x32')](db[_0x8698('0x61')][_0x8698('0x2c')]);_0x28de9b[_0x8698('0x31')]=_['keys'](_0xe227c5[_0x8698('0x31')]);_0x28de9b['filters']=_[_0x8698('0x43')](_0x28de9b['model'],_0x28de9b[_0x8698('0x31')]);_0x114dd6[_0x8698('0x33')]=_[_0x8698('0x43')](_0x28de9b[_0x8698('0x30')],qs[_0x8698('0x44')](_0xe227c5[_0x8698('0x31')][_0x8698('0x44')]));_0x114dd6[_0x8698('0x33')]=_0x114dd6[_0x8698('0x33')][_0x8698('0x45')]?_0x114dd6[_0x8698('0x33')]:_0x28de9b['model'];if(!_0xe227c5['query']['hasOwnProperty'](_0x8698('0x5b'))){_0x114dd6[_0x8698('0x1c')]=qs[_0x8698('0x1c')](_0xe227c5[_0x8698('0x31')]['limit']);_0x114dd6[_0x8698('0x1e')]=qs[_0x8698('0x1e')](_0xe227c5[_0x8698('0x31')]['offset']);}_0x114dd6['order']=qs[_0x8698('0x35')](_0xe227c5[_0x8698('0x31')][_0x8698('0x35')]);_0x114dd6[_0x8698('0x36')]=qs[_0x8698('0x37')](_[_0x8698('0x5c')](_0xe227c5[_0x8698('0x31')],_0x28de9b['filters']));_0x114dd6[_0x8698('0x36')][_0x8698('0x5d')]=_0x2f7afa['id'];if(_0xe227c5[_0x8698('0x31')][_0x8698('0x3a')]){_0x114dd6[_0x8698('0x36')]=_[_0x8698('0x38')](_0x114dd6[_0x8698('0x36')],{'$or':_[_0x8698('0x2b')](_0x114dd6[_0x8698('0x33')],function(_0x3ba63d){var _0x5bdd48={};_0x5bdd48[_0x3ba63d]={'$like':'%'+_0xe227c5[_0x8698('0x31')]['filter']+'%'};return _0x5bdd48;})});}_0x114dd6=_[_0x8698('0x38')]({},_0x114dd6,_0xe227c5[_0x8698('0x3b')]);return db[_0x8698('0x61')]['count']({'where':_0x114dd6['where']})[_0x8698('0x23')](function(_0x1c48dc){_0x354aca[_0x8698('0x1d')]=_0x1c48dc;if(_0xe227c5[_0x8698('0x31')][_0x8698('0x46')]){_0x114dd6[_0x8698('0x3c')]=[{'all':!![]}];}return db[_0x8698('0x61')][_0x8698('0x3e')](_0x114dd6);})['then'](function(_0x3145ce){_0x354aca[_0x8698('0x3f')]=_0x3145ce;return _0x354aca;});}})[_0x8698('0x23')](respondWithFilteredResult(_0x97a5f5,_0x114dd6))['catch'](handleError(_0x97a5f5,null));};exports[_0x8698('0x62')]=function(_0x2b20e3,_0x3ff664,_0x29a4bc){var _0x3f97d5={'raw':!![],'where':{}};var _0x48d77a={};var _0x446c13={'count':0x0,'rows':[]};return db[_0x8698('0x3d')][_0x8698('0x58')]({'where':{'id':_0x2b20e3[_0x8698('0x42')]['id']}})[_0x8698('0x23')](handleEntityNotFound(_0x3ff664,null))[_0x8698('0x23')](function(_0x3d6243){if(_0x3d6243){_0x48d77a[_0x8698('0x30')]=_['keys'](db[_0x8698('0x63')]['rawAttributes']);_0x48d77a[_0x8698('0x31')]=_['keys'](_0x2b20e3[_0x8698('0x31')]);_0x48d77a[_0x8698('0x37')]=_[_0x8698('0x43')](_0x48d77a[_0x8698('0x30')],_0x48d77a[_0x8698('0x31')]);_0x3f97d5[_0x8698('0x33')]=_[_0x8698('0x43')](_0x48d77a[_0x8698('0x30')],qs[_0x8698('0x44')](_0x2b20e3['query'][_0x8698('0x44')]));_0x3f97d5['attributes']=_0x3f97d5[_0x8698('0x33')][_0x8698('0x45')]?_0x3f97d5[_0x8698('0x33')]:_0x48d77a['model'];if(!_0x2b20e3[_0x8698('0x31')][_0x8698('0x5a')]('nolimit')){_0x3f97d5[_0x8698('0x1c')]=qs[_0x8698('0x1c')](_0x2b20e3['query'][_0x8698('0x1c')]);_0x3f97d5['offset']=qs[_0x8698('0x1e')](_0x2b20e3['query'][_0x8698('0x1e')]);}_0x3f97d5[_0x8698('0x34')]=qs[_0x8698('0x35')](_0x2b20e3[_0x8698('0x31')][_0x8698('0x35')]);_0x3f97d5[_0x8698('0x36')]=qs['filters'](_[_0x8698('0x5c')](_0x2b20e3[_0x8698('0x31')],_0x48d77a[_0x8698('0x37')]));_0x3f97d5['where']['CampaignId']=_0x3d6243['id'];if(_0x2b20e3[_0x8698('0x31')]['filter']){_0x3f97d5[_0x8698('0x36')]=_[_0x8698('0x38')](_0x3f97d5[_0x8698('0x36')],{'$or':_[_0x8698('0x2b')](_0x3f97d5[_0x8698('0x33')],function(_0x1957b5){var _0x395531={};_0x395531[_0x1957b5]={'$like':'%'+_0x2b20e3[_0x8698('0x31')][_0x8698('0x3a')]+'%'};return _0x395531;})});}_0x3f97d5=_[_0x8698('0x38')]({},_0x3f97d5,_0x2b20e3[_0x8698('0x3b')]);return db[_0x8698('0x63')][_0x8698('0x1d')]({'where':_0x3f97d5[_0x8698('0x36')]})[_0x8698('0x23')](function(_0x56826e){_0x446c13[_0x8698('0x1d')]=_0x56826e;if(_0x2b20e3[_0x8698('0x31')]['includeAll']){_0x3f97d5[_0x8698('0x3c')]=[{'all':!![]}];}return db[_0x8698('0x63')]['findAll'](_0x3f97d5);})[_0x8698('0x23')](function(_0x4be769){_0x446c13['rows']=_0x4be769;return _0x446c13;});}})[_0x8698('0x23')](respondWithFilteredResult(_0x3ff664,_0x3f97d5))[_0x8698('0x40')](handleError(_0x3ff664,null));};exports['getLists']=function(_0x532fe7,_0x28e602,_0x4464ba){var _0x5015e4={};var _0x119af0={};var _0x164e0a;var _0x36a42e;return db[_0x8698('0x3d')][_0x8698('0x58')]({'where':{'id':_0x532fe7[_0x8698('0x42')]['id']}})[_0x8698('0x23')](handleEntityNotFound(_0x28e602,null))['then'](function(_0x643672){if(_0x643672){_0x164e0a=_0x643672;_0x119af0[_0x8698('0x30')]=_[_0x8698('0x32')](db['CmList']['rawAttributes']);_0x119af0[_0x8698('0x31')]=_[_0x8698('0x32')](_0x532fe7['query']);_0x119af0['filters']=_[_0x8698('0x43')](_0x119af0['model'],_0x119af0[_0x8698('0x31')]);_0x5015e4[_0x8698('0x33')]=_[_0x8698('0x43')](_0x119af0['model'],qs[_0x8698('0x44')](_0x532fe7[_0x8698('0x31')]['fields']));_0x5015e4['attributes']=_0x5015e4[_0x8698('0x33')][_0x8698('0x45')]?_0x5015e4[_0x8698('0x33')]:_0x119af0[_0x8698('0x30')];_0x5015e4[_0x8698('0x34')]=qs['sort'](_0x532fe7[_0x8698('0x31')][_0x8698('0x35')]);_0x5015e4[_0x8698('0x36')]=qs[_0x8698('0x37')](_['pick'](_0x532fe7['query'],_0x119af0[_0x8698('0x37')]));if(_0x532fe7['query'][_0x8698('0x3a')]){_0x5015e4[_0x8698('0x36')]=_[_0x8698('0x38')](_0x5015e4[_0x8698('0x36')],{'$or':_[_0x8698('0x2b')](_0x5015e4[_0x8698('0x33')],function(_0x42f0cf){var _0x45ffcc={};_0x45ffcc[_0x42f0cf]={'$like':'%'+_0x532fe7[_0x8698('0x31')][_0x8698('0x3a')]+'%'};return _0x45ffcc;})});}_0x5015e4=_[_0x8698('0x38')]({},_0x5015e4,_0x532fe7[_0x8698('0x3b')]);return _0x164e0a[_0x8698('0x64')](_0x5015e4);}})[_0x8698('0x23')](function(_0x2f6fee){if(_0x2f6fee){_0x36a42e=_0x2f6fee[_0x8698('0x45')];if(!_0x532fe7[_0x8698('0x31')][_0x8698('0x5a')](_0x8698('0x5b'))){_0x5015e4[_0x8698('0x1c')]=qs[_0x8698('0x1c')](_0x532fe7[_0x8698('0x31')][_0x8698('0x1c')]);_0x5015e4[_0x8698('0x1e')]=qs[_0x8698('0x1e')](_0x532fe7[_0x8698('0x31')][_0x8698('0x1e')]);}return _0x164e0a[_0x8698('0x64')](_0x5015e4);}})[_0x8698('0x23')](function(_0x4c8506){if(_0x4c8506){return _0x4c8506?{'count':_0x36a42e,'rows':_0x4c8506}:null;}})[_0x8698('0x23')](respondWithResult(_0x28e602,null))[_0x8698('0x40')](handleError(_0x28e602,null));};exports[_0x8698('0x65')]=function(_0x576c0a,_0x3469b5,_0x326061){var _0x2daaff,_0x3c5036;var _0xd39a50=[];var _0x96cad=moment()[_0x8698('0x66')](_0x8698('0x67'));return db[_0x8698('0x3d')][_0x8698('0x47')]({'where':{'id':_0x576c0a[_0x8698('0x42')]['id']}})[_0x8698('0x23')](handleEntityNotFound(_0x3469b5,null))[_0x8698('0x23')](function(_0x31fa98){if(_0x31fa98){_0x3c5036=_0x31fa98;return _0x31fa98[_0x8698('0x65')](_0x576c0a[_0x8698('0x49')][_0x8698('0x68')],_[_0x8698('0x52')](_0x576c0a[_0x8698('0x49')],['ids','id'])||{});}return null;})['spread'](function(_0x18b042){var _0x5ef1c5;var _0x2d27bc;_0x2daaff=_0x18b042||[];var _0x4b4fd3=[];if(_0x18b042){for(var _0xfa4b6=0x0;_0xfa4b6<_0x18b042[_0x8698('0x45')];_0xfa4b6+=0x1){var _0x3b581f=_0x18b042[_0xfa4b6][_0x8698('0x24')]({'plain':!![]});_0x3c5036[_0x8698('0x69')]=_0x576c0a['body'][_0x8698('0x69')]?_0x576c0a[_0x8698('0x49')][_0x8698('0x69')]:_0x3c5036[_0x8698('0x69')];switch(_0x3c5036[_0x8698('0x69')]){case _0x8698('0x6a'):_0x5ef1c5=squel[_0x8698('0x6b')]()[_0x8698('0x6c')](_0x8698('0x6d'))[_0x8698('0x6e')](['phone',_0x8698('0x6f'),_0x8698('0x70'),_0x8698('0x71'),_0x8698('0x5d'),'createdAt',_0x8698('0x54')],squel['select']()[_0x8698('0x72')](_0x8698('0x73'),_0x8698('0x73'))['field']('NOW()',_0x8698('0x6f'))[_0x8698('0x72')]('id',_0x8698('0x70'))[_0x8698('0x72')](_0x3b581f['CmListId']['toString'](),_0x8698('0x71'))[_0x8698('0x72')](_0x576c0a[_0x8698('0x42')]['id'][_0x8698('0x74')](),'CampaignId')[_0x8698('0x72')]('\x27'+_0x96cad+'\x27','createdAt')['field']('\x27'+_0x96cad+'\x27',_0x8698('0x54'))[_0x8698('0x75')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x8698('0x76'),_0x3b581f[_0x8698('0x77')][_0x8698('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x8698('0x78'),squel[_0x8698('0x79')]()['field'](_0x8698('0x7a'))[_0x8698('0x75')]('cm_hopper_final')['where'](_0x8698('0x7b'),_0x576c0a['params']['id'][_0x8698('0x74')]()))[_0x8698('0x36')](_0x8698('0x78'),squel[_0x8698('0x79')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x8698('0x6d'))[_0x8698('0x36')]('CampaignId\x20=\x20?',_0x576c0a[_0x8698('0x42')]['id'][_0x8698('0x74')]())))['toString']();break;case _0x8698('0x7c'):_0x5ef1c5=squel['insert']()[_0x8698('0x6c')](_0x8698('0x6d'))[_0x8698('0x6e')](['phone',_0x8698('0x6f'),_0x8698('0x70'),_0x8698('0x71'),_0x8698('0x5d'),_0x8698('0x53'),_0x8698('0x54')],squel[_0x8698('0x79')]()['field']('phone',_0x8698('0x73'))['field'](_0x8698('0x7d'),'scheduledAt')['field']('id',_0x8698('0x70'))['field'](_0x3b581f[_0x8698('0x77')][_0x8698('0x74')](),_0x8698('0x71'))[_0x8698('0x72')](_0x576c0a[_0x8698('0x42')]['id'][_0x8698('0x74')](),'CampaignId')[_0x8698('0x72')]('\x27'+_0x96cad+'\x27','createdAt')['field']('\x27'+_0x96cad+'\x27',_0x8698('0x54'))[_0x8698('0x75')](_0x8698('0x7e'))[_0x8698('0x36')](_0x8698('0x7f'))['where'](_0x8698('0x76'),_0x3b581f[_0x8698('0x77')][_0x8698('0x74')]())[_0x8698('0x36')]('phone\x20IS\x20NOT\x20NULL')[_0x8698('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0x8698('0x79')]()['field']('COALESCE(phone,\x27\x27)')[_0x8698('0x75')](_0x8698('0x6d'))[_0x8698('0x36')](_0x8698('0x7b'),_0x576c0a['params']['id']['toString']())))[_0x8698('0x74')]();break;default:_0x5ef1c5=squel[_0x8698('0x6b')]()[_0x8698('0x6c')]('cm_hopper')[_0x8698('0x6e')]([_0x8698('0x73'),_0x8698('0x6f'),'ContactId',_0x8698('0x71'),_0x8698('0x5d'),_0x8698('0x53'),_0x8698('0x54')],squel[_0x8698('0x79')]()['field'](_0x8698('0x73'),_0x8698('0x73'))[_0x8698('0x72')](_0x8698('0x7d'),_0x8698('0x6f'))[_0x8698('0x72')]('id',_0x8698('0x70'))[_0x8698('0x72')](_0x3b581f[_0x8698('0x77')][_0x8698('0x74')](),_0x8698('0x71'))[_0x8698('0x72')](_0x576c0a['params']['id']['toString'](),_0x8698('0x5d'))[_0x8698('0x72')]('\x27'+_0x96cad+'\x27',_0x8698('0x53'))[_0x8698('0x72')]('\x27'+_0x96cad+'\x27','updatedAt')['from'](_0x8698('0x7e'))['where'](_0x8698('0x7f'))[_0x8698('0x36')](_0x8698('0x76'),_0x3b581f[_0x8698('0x77')][_0x8698('0x74')]())['where'](_0x8698('0x80')))[_0x8698('0x74')]();}_0x2d27bc=squel[_0x8698('0x6b')]()[_0x8698('0x6c')](_0x8698('0x81'))[_0x8698('0x6e')]([_0x8698('0x82'),_0x8698('0x6f'),_0x8698('0x73'),_0x8698('0x83'),_0x8698('0x53'),_0x8698('0x54')],squel[_0x8698('0x79')]()[_0x8698('0x72')](_0x8698('0x84'),'id')[_0x8698('0x72')]('NOW()',_0x8698('0x6f'))[_0x8698('0x72')](_0x8698('0x85'),_0x8698('0x73'))['field'](_0x8698('0x86'),_0x8698('0x83'))[_0x8698('0x72')]('\x27'+_0x96cad+'\x27',_0x8698('0x53'))[_0x8698('0x72')]('\x27'+_0x96cad+'\x27','updatedAt')[_0x8698('0x75')](_0x8698('0x87'),'ci')[_0x8698('0x88')]('cm_hopper','h',_0x8698('0x89'))[_0x8698('0x36')](_0x8698('0x8a'),_0x3b581f[_0x8698('0x77')][_0x8698('0x74')]())[_0x8698('0x36')](_0x8698('0x8b'),_0x576c0a[_0x8698('0x42')]['id']['toString']())[_0x8698('0x36')](_0x8698('0x8c'),_0x96cad))[_0x8698('0x74')]();_0x4b4fd3[_0x8698('0x8d')](db[_0x8698('0x8e')][_0x8698('0x31')](_0x5ef1c5));_0xd39a50[_0x8698('0x8d')](db[_0x8698('0x8e')][_0x8698('0x31')](_0x2d27bc));}return BPromise['all'](_0x4b4fd3);}})['then'](function(){return BPromise['all'](_0xd39a50);})[_0x8698('0x23')](function(){return _0x2daaff;})[_0x8698('0x23')](respondWithResult(_0x3469b5,null))[_0x8698('0x40')](handleError(_0x3469b5,null));};exports['removeLists']=function(_0x58326c,_0x8dd7aa,_0xc4f368){return db[_0x8698('0x3d')][_0x8698('0x47')]({'where':{'id':_0x58326c[_0x8698('0x42')]['id']}})[_0x8698('0x23')](handleEntityNotFound(_0x8dd7aa,null))['then'](function(_0x40c929){if(_0x40c929){return _0x40c929['removeLists'](_0x58326c[_0x8698('0x31')][_0x8698('0x68')]);}})['then'](function(_0x1d1325){if(_0x1d1325){return db['CmHopper']['destroy']({'where':{'ListId':_0x58326c[_0x8698('0x31')][_0x8698('0x68')],'CampaignId':_0x58326c[_0x8698('0x42')]['id']}})[_0x8698('0x23')](function(){return _0x1d1325;});}})[_0x8698('0x23')](respondWithStatusCode(_0x8dd7aa,null))[_0x8698('0x40')](handleError(_0x8dd7aa,null));};exports[_0x8698('0x8f')]=function(_0xb0fe31,_0x1ab0fe,_0x201253){var _0x5a160d={};var _0xd201b6={};var _0x3a5cf0;var _0x1ea451;return db['Campaign'][_0x8698('0x58')]({'where':{'id':_0xb0fe31[_0x8698('0x42')]['id']}})[_0x8698('0x23')](handleEntityNotFound(_0x1ab0fe,null))[_0x8698('0x23')](function(_0x4a340e){if(_0x4a340e){_0x3a5cf0=_0x4a340e;_0xd201b6[_0x8698('0x30')]=_[_0x8698('0x32')](db[_0x8698('0x90')]['rawAttributes']);_0xd201b6[_0x8698('0x31')]=_[_0x8698('0x32')](_0xb0fe31['query']);_0xd201b6[_0x8698('0x37')]=_['intersection'](_0xd201b6['model'],_0xd201b6['query']);_0x5a160d[_0x8698('0x33')]=_['intersection'](_0xd201b6[_0x8698('0x30')],qs['fields'](_0xb0fe31[_0x8698('0x31')]['fields']));_0x5a160d[_0x8698('0x33')]=_0x5a160d[_0x8698('0x33')][_0x8698('0x45')]?_0x5a160d[_0x8698('0x33')]:_0xd201b6[_0x8698('0x30')];_0x5a160d['order']=qs[_0x8698('0x35')](_0xb0fe31[_0x8698('0x31')]['sort']);_0x5a160d[_0x8698('0x36')]=qs['filters'](_[_0x8698('0x5c')](_0xb0fe31[_0x8698('0x31')],_0xd201b6[_0x8698('0x37')]));if(_0xb0fe31[_0x8698('0x31')][_0x8698('0x3a')]){_0x5a160d[_0x8698('0x36')]=_[_0x8698('0x38')](_0x5a160d[_0x8698('0x36')],{'$or':_['map'](_0x5a160d[_0x8698('0x33')],function(_0x1111cd){var _0x9d9399={};_0x9d9399[_0x1111cd]={'$like':'%'+_0xb0fe31[_0x8698('0x31')]['filter']+'%'};return _0x9d9399;})});}_0x5a160d=_[_0x8698('0x38')]({},_0x5a160d,_0xb0fe31[_0x8698('0x3b')]);return _0x3a5cf0[_0x8698('0x8f')](_0x5a160d);}})['then'](function(_0x164105){if(_0x164105){_0x1ea451=_0x164105[_0x8698('0x45')];if(!_0xb0fe31[_0x8698('0x31')][_0x8698('0x5a')](_0x8698('0x5b'))){_0x5a160d[_0x8698('0x1c')]=qs[_0x8698('0x1c')](_0xb0fe31[_0x8698('0x31')]['limit']);_0x5a160d[_0x8698('0x1e')]=qs['offset'](_0xb0fe31[_0x8698('0x31')][_0x8698('0x1e')]);}return _0x3a5cf0[_0x8698('0x8f')](_0x5a160d);}})['then'](function(_0x38a0b2){if(_0x38a0b2){return _0x38a0b2?{'count':_0x1ea451,'rows':_0x38a0b2}:null;}})[_0x8698('0x23')](respondWithResult(_0x1ab0fe,null))[_0x8698('0x40')](handleError(_0x1ab0fe,null));};exports['addBlackLists']=function(_0x35625a,_0x3327f6,_0x581316){var _0x52f43e,_0x1987ed;var _0x2c03f7=[];var _0x1fb708=moment()[_0x8698('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x8698('0x3d')][_0x8698('0x47')]({'where':{'id':_0x35625a['params']['id']}})['then'](handleEntityNotFound(_0x3327f6,null))['then'](function(_0x5c8154){if(_0x5c8154){_0x1987ed=_0x5c8154;return _0x5c8154[_0x8698('0x91')](_0x35625a[_0x8698('0x49')][_0x8698('0x68')],_[_0x8698('0x52')](_0x35625a['body'],[_0x8698('0x68'),'id'])||{});}return null;})[_0x8698('0x92')](function(_0x3e861f){var _0xab3c8a;var _0x41530c;_0x52f43e=_0x3e861f||[];var _0x239007=[];if(_0x3e861f){for(var _0x436961=0x0;_0x436961<_0x3e861f[_0x8698('0x45')];_0x436961+=0x1){var _0x3a8480=_0x3e861f[_0x436961]['get']({'plain':!![]});_0xab3c8a=squel[_0x8698('0x6b')]()[_0x8698('0x6c')](_0x8698('0x93'))[_0x8698('0x6e')]([_0x8698('0x73'),_0x8698('0x70'),'ListId',_0x8698('0x5d'),_0x8698('0x53'),_0x8698('0x54')],squel['select']()['field'](_0x8698('0x73'),_0x8698('0x73'))[_0x8698('0x72')]('id',_0x8698('0x70'))[_0x8698('0x72')](_0x3a8480[_0x8698('0x77')][_0x8698('0x74')](),_0x8698('0x71'))['field'](_0x35625a['params']['id'][_0x8698('0x74')](),'CampaignId')[_0x8698('0x72')]('NOW()','createdAt')[_0x8698('0x72')](_0x8698('0x7d'),_0x8698('0x54'))[_0x8698('0x75')](_0x8698('0x7e'))['where'](_0x8698('0x7f'))[_0x8698('0x36')](_0x8698('0x76'),_0x3a8480[_0x8698('0x77')][_0x8698('0x74')]())[_0x8698('0x36')](_0x8698('0x80')))['toString']();_0x239007[_0x8698('0x8d')](db[_0x8698('0x8e')][_0x8698('0x31')](_0xab3c8a));}return BPromise[_0x8698('0x94')](_0x239007);}})['then'](function(){return _0x52f43e;})[_0x8698('0x23')](respondWithResult(_0x3327f6,null))[_0x8698('0x40')](handleError(_0x3327f6,null));};exports[_0x8698('0x95')]=function(_0x1cef0e,_0x2c8815,_0x15001f){return db[_0x8698('0x3d')][_0x8698('0x47')]({'where':{'id':_0x1cef0e[_0x8698('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c8815,null))[_0x8698('0x23')](function(_0x40f8c5){if(_0x40f8c5){return _0x40f8c5[_0x8698('0x95')](_0x1cef0e[_0x8698('0x31')]['ids']);}})[_0x8698('0x23')](function(_0x3039a3){if(_0x3039a3){return db['CmHopperBlack'][_0x8698('0x26')]({'where':{'ListId':_0x1cef0e[_0x8698('0x31')][_0x8698('0x68')],'CampaignId':_0x1cef0e[_0x8698('0x42')]['id']}})[_0x8698('0x23')](function(){return _0x3039a3;});}})[_0x8698('0x23')](respondWithStatusCode(_0x2c8815,null))[_0x8698('0x40')](handleError(_0x2c8815,null));};
\ No newline at end of file
+var _0x1042=['CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','params','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','getHopperHistories','nolimit','CmHopperHistory','getHopperFinals','CmHopperFinal','CampaignId','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','insert','into','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId'];(function(_0x2ad4c9,_0x2c6e67){var _0x2e4982=function(_0x418956){while(--_0x418956){_0x2ad4c9['push'](_0x2ad4c9['shift']());}};_0x2e4982(++_0x2c6e67);}(_0x1042,0x1de));var _0x2104=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1042[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2104('0x0'));var rimraf=require(_0x2104('0x1'));var zipdir=require(_0x2104('0x2'));var jsonpatch=require(_0x2104('0x3'));var rp=require(_0x2104('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2104('0x5'));var util=require(_0x2104('0x6'));var path=require(_0x2104('0x7'));var sox=require(_0x2104('0x8'));var csv=require(_0x2104('0x9'));var ejs=require(_0x2104('0xa'));var fs=require('fs');var fs_extra=require(_0x2104('0xb'));var _=require(_0x2104('0xc'));var squel=require('squel');var crypto=require(_0x2104('0xd'));var jsforce=require(_0x2104('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2104('0x9'));var querystring=require(_0x2104('0xf'));var Papa=require(_0x2104('0x10'));var Redis=require(_0x2104('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2104('0x12'));var as=require(_0x2104('0x13'));var hardwareService=require(_0x2104('0x14'));var logger=require(_0x2104('0x15'))(_0x2104('0x16'));var utils=require('../../config/utils');var config=require(_0x2104('0x17'));var licenseUtil=require(_0x2104('0x18'));var db=require(_0x2104('0x19'))['db'];function respondWithStatusCode(_0x4c58a4,_0x43748d){_0x43748d=_0x43748d||0xcc;return function(_0x5c1299){if(_0x5c1299){return _0x4c58a4[_0x2104('0x1a')](_0x43748d);}return _0x4c58a4['status'](_0x43748d)[_0x2104('0x1b')]();};}function respondWithResult(_0xf1241d,_0xfd91e9){_0xfd91e9=_0xfd91e9||0xc8;return function(_0x4c16d4){if(_0x4c16d4){return _0xf1241d[_0x2104('0x1c')](_0xfd91e9)[_0x2104('0x1d')](_0x4c16d4);}};}function respondWithFilteredResult(_0x42bb8e,_0x528045){return function(_0x2a1779){if(_0x2a1779){var _0x143a4d=typeof _0x528045[_0x2104('0x1e')]==='undefined'&&typeof _0x528045[_0x2104('0x1f')]===_0x2104('0x20');var _0x2c3011=_0x2a1779[_0x2104('0x21')];var _0x39258d=_0x143a4d?0x0:_0x528045['offset'];var _0x10e9c7=_0x143a4d?_0x2a1779[_0x2104('0x21')]:_0x528045[_0x2104('0x1e')]+_0x528045['limit'];var _0x1fb257;if(_0x10e9c7>=_0x2c3011){_0x10e9c7=_0x2c3011;_0x1fb257=0xc8;}else{_0x1fb257=0xce;}_0x42bb8e['status'](_0x1fb257);return _0x42bb8e[_0x2104('0x22')]('Content-Range',_0x39258d+'-'+_0x10e9c7+'/'+_0x2c3011)[_0x2104('0x1d')](_0x2a1779);}return null;};}function patchUpdates(_0x2cedf5){return function(_0x396435){try{jsonpatch['apply'](_0x396435,_0x2cedf5,!![]);}catch(_0x1a2056){return BPromise[_0x2104('0x23')](_0x1a2056);}return _0x396435['save']();};}function saveUpdates(_0x41ef2e,_0x1f6330){return function(_0x571e0e){if(_0x571e0e){return _0x571e0e[_0x2104('0x24')](_0x41ef2e)[_0x2104('0x25')](function(_0x3ff645){return _0x3ff645;});}return null;};}function removeEntity(_0x121916,_0x56c3d9){return function(_0x44a457){if(_0x44a457){return _0x44a457[_0x2104('0x26')]()[_0x2104('0x25')](function(){var _0xfa2694=_0x44a457[_0x2104('0x27')]({'plain':!![]});var _0x56fc04='IvrCampaigns';return db[_0x2104('0x28')]['destroy']({'where':{'type':_0x56fc04,'resourceId':_0xfa2694['id']}})[_0x2104('0x25')](function(){return _0x44a457;});})[_0x2104('0x25')](function(){_0x121916[_0x2104('0x1c')](0xcc)[_0x2104('0x1b')]();});}};}function handleEntityNotFound(_0x18eb37,_0x185f44){return function(_0xf2e9fd){if(!_0xf2e9fd){_0x18eb37[_0x2104('0x1a')](0x194);}return _0xf2e9fd;};}function handleError(_0x2a47fa,_0x6a1897){_0x6a1897=_0x6a1897||0x1f4;return function(_0x525723){logger[_0x2104('0x29')](_0x525723[_0x2104('0x2a')]);if(_0x525723['name']){delete _0x525723[_0x2104('0x2b')];}_0x2a47fa[_0x2104('0x1c')](_0x6a1897)[_0x2104('0x2c')](_0x525723);};}exports['index']=function(_0x2f11e0,_0x412318){var _0x4cc61e={},_0x281e16={},_0xa4018e={'count':0x0,'rows':[]};var _0x52521c=_[_0x2104('0x2d')](db['Campaign'][_0x2104('0x2e')],function(_0x3abec0){return{'name':_0x3abec0[_0x2104('0x2f')],'type':_0x3abec0[_0x2104('0x30')][_0x2104('0x31')]};});_0x281e16['model']=_[_0x2104('0x2d')](_0x52521c,'name');_0x281e16[_0x2104('0x32')]=_[_0x2104('0x33')](_0x2f11e0[_0x2104('0x32')]);_0x281e16[_0x2104('0x34')]=_[_0x2104('0x35')](_0x281e16[_0x2104('0x36')],_0x281e16[_0x2104('0x32')]);_0x4cc61e[_0x2104('0x37')]=_[_0x2104('0x35')](_0x281e16['model'],qs[_0x2104('0x38')](_0x2f11e0['query'][_0x2104('0x38')]));_0x4cc61e[_0x2104('0x37')]=_0x4cc61e[_0x2104('0x37')]['length']?_0x4cc61e[_0x2104('0x37')]:_0x281e16['model'];if(!_0x2f11e0['query'][_0x2104('0x39')]('nolimit')){_0x4cc61e[_0x2104('0x1f')]=qs['limit'](_0x2f11e0['query'][_0x2104('0x1f')]);_0x4cc61e['offset']=qs[_0x2104('0x1e')](_0x2f11e0[_0x2104('0x32')][_0x2104('0x1e')]);}_0x4cc61e[_0x2104('0x3a')]=qs['sort'](_0x2f11e0['query'][_0x2104('0x3b')]);_0x4cc61e[_0x2104('0x3c')]=qs['filters'](_[_0x2104('0x3d')](_0x2f11e0['query'],_0x281e16[_0x2104('0x34')]),_0x52521c);if(_0x2f11e0[_0x2104('0x32')][_0x2104('0x3e')]){_0x4cc61e[_0x2104('0x3c')]=_[_0x2104('0x3f')](_0x4cc61e[_0x2104('0x3c')],{'$or':_[_0x2104('0x2d')](_0x52521c,function(_0x38bb51){if(_0x38bb51[_0x2104('0x30')]!==_0x2104('0x40')){var _0x303407={};_0x303407[_0x38bb51[_0x2104('0x2b')]]={'$like':'%'+_0x2f11e0['query'][_0x2104('0x3e')]+'%'};return _0x303407;}})});}_0x4cc61e=_['merge']({},_0x4cc61e,_0x2f11e0[_0x2104('0x41')]);var _0x32e3ac={'where':_0x4cc61e[_0x2104('0x3c')]};return db[_0x2104('0x42')][_0x2104('0x21')](_0x32e3ac)[_0x2104('0x25')](function(_0x38da30){_0xa4018e[_0x2104('0x21')]=_0x38da30;if(_0x2f11e0['query'][_0x2104('0x43')]){_0x4cc61e[_0x2104('0x44')]=[{'all':!![]}];}return db[_0x2104('0x42')][_0x2104('0x45')](_0x4cc61e);})[_0x2104('0x25')](function(_0x89327e){_0xa4018e[_0x2104('0x46')]=_0x89327e;return _0xa4018e;})['then'](respondWithFilteredResult(_0x412318,_0x4cc61e))[_0x2104('0x47')](handleError(_0x412318,null));};exports[_0x2104('0x48')]=function(_0x23fcdd,_0x29a943){var _0x1403ec={'raw':![],'where':{'id':_0x23fcdd[_0x2104('0x49')]['id']}},_0x5dd06d={};_0x5dd06d[_0x2104('0x36')]=_[_0x2104('0x33')](db[_0x2104('0x42')][_0x2104('0x2e')]);_0x5dd06d['query']=_[_0x2104('0x33')](_0x23fcdd[_0x2104('0x32')]);_0x5dd06d[_0x2104('0x34')]=_[_0x2104('0x35')](_0x5dd06d['model'],_0x5dd06d['query']);_0x1403ec[_0x2104('0x37')]=_[_0x2104('0x35')](_0x5dd06d[_0x2104('0x36')],qs[_0x2104('0x38')](_0x23fcdd[_0x2104('0x32')]['fields']));_0x1403ec[_0x2104('0x37')]=_0x1403ec['attributes'][_0x2104('0x4a')]?_0x1403ec[_0x2104('0x37')]:_0x5dd06d[_0x2104('0x36')];if(_0x23fcdd['query']['includeAll']){_0x1403ec[_0x2104('0x44')]=[{'all':!![]}];}_0x1403ec=_[_0x2104('0x3f')]({},_0x1403ec,_0x23fcdd[_0x2104('0x41')]);return db['Campaign']['find'](_0x1403ec)['then'](handleEntityNotFound(_0x29a943,null))['then'](respondWithResult(_0x29a943,null))[_0x2104('0x47')](handleError(_0x29a943,null));};exports[_0x2104('0x4b')]=function(_0x4178ea,_0x508fa8){return db[_0x2104('0x42')]['create'](_0x4178ea[_0x2104('0x4c')],{})['then'](function(_0x566a98){var _0x4f31c9=_0x4178ea['user'][_0x2104('0x27')]({'plain':!![]});if(!_0x4f31c9)throw new Error(_0x2104('0x4d'));if(_0x4f31c9[_0x2104('0x4e')]===_0x2104('0x4f')){var _0x55f49e=_0x566a98[_0x2104('0x27')]({'plain':!![]});var _0x2d51a2=_0x2104('0x50');return db[_0x2104('0x51')]['find']({'where':{'name':_0x2d51a2,'userProfileId':_0x4f31c9[_0x2104('0x52')]},'raw':!![]})[_0x2104('0x25')](function(_0x4fc5d8){if(_0x4fc5d8&&_0x4fc5d8[_0x2104('0x53')]===0x0){return db['UserProfileResource'][_0x2104('0x4b')]({'name':_0x55f49e[_0x2104('0x2b')],'resourceId':_0x55f49e['id'],'type':_0x4fc5d8[_0x2104('0x2b')],'sectionId':_0x4fc5d8['id']},{})['then'](function(){return _0x566a98;});}else{return _0x566a98;}})[_0x2104('0x47')](function(_0x2ca9b5){logger['error'](_0x2104('0x54'),_0x2ca9b5);throw _0x2ca9b5;});}return _0x566a98;})[_0x2104('0x25')](respondWithResult(_0x508fa8,0xc9))[_0x2104('0x47')](handleError(_0x508fa8,null));};exports[_0x2104('0x55')]=function(_0x1feb0f,_0x5362d4){var _0x15b114={'where':{'id':_0x1feb0f['params']['id']}},_0x1b9130={};_0x1b9130[_0x2104('0x36')]=_['keys'](db[_0x2104('0x42')][_0x2104('0x2e')]);_0x15b114[_0x2104('0x37')]=_[_0x2104('0x35')](_0x1b9130[_0x2104('0x36')],qs[_0x2104('0x38')](_0x1feb0f[_0x2104('0x32')][_0x2104('0x38')]));_0x15b114[_0x2104('0x37')]=_0x15b114['attributes']['length']?_0x15b114[_0x2104('0x37')]:_0x1b9130[_0x2104('0x36')];if(_0x1feb0f[_0x2104('0x32')][_0x2104('0x43')]){_0x15b114[_0x2104('0x44')]=[{'all':!![]}];}_0x15b114=_[_0x2104('0x3f')]({},_0x15b114,_0x1feb0f[_0x2104('0x41')]);return db[_0x2104('0x42')][_0x2104('0x56')](_0x15b114)[_0x2104('0x25')](handleEntityNotFound(_0x5362d4,null))[_0x2104('0x25')](function(_0x304b60){if(_0x304b60){var _0x4913ed=_0x304b60[_0x2104('0x27')]({'plain':!![]});_0x4913ed=qs[_0x2104('0x57')](_0x4913ed,['id',_0x2104('0x58'),_0x2104('0x59')]);_0x1feb0f[_0x2104('0x4c')]=_[_0x2104('0x57')](_0x1feb0f[_0x2104('0x4c')],['id',_0x2104('0x58'),_0x2104('0x59')]);return db[_0x2104('0x42')][_0x2104('0x4b')](_[_0x2104('0x3f')](_0x4913ed,_0x1feb0f[_0x2104('0x4c')]),{'include':_0x1feb0f[_0x2104('0x32')][_0x2104('0x43')]?[{'all':!![]}]:undefined})[_0x2104('0x25')](function(_0x27262e){var _0x6e16b0=_0x1feb0f[_0x2104('0x4f')]['get']({'plain':!![]});if(!_0x6e16b0)throw new Error(_0x2104('0x4d'));if(_0x6e16b0[_0x2104('0x4e')]===_0x2104('0x4f')){var _0x490535=_0x27262e['get']({'plain':!![]});var _0x390fca=_0x2104('0x50');return db[_0x2104('0x51')][_0x2104('0x56')]({'where':{'name':_0x390fca,'userProfileId':_0x6e16b0[_0x2104('0x52')]},'raw':!![]})[_0x2104('0x25')](function(_0x38bfd2){if(_0x38bfd2&&_0x38bfd2[_0x2104('0x53')]===0x0){return db[_0x2104('0x28')][_0x2104('0x4b')]({'name':_0x490535[_0x2104('0x2b')],'resourceId':_0x490535['id'],'type':_0x38bfd2[_0x2104('0x2b')],'sectionId':_0x38bfd2['id']},{})['then'](function(){return _0x27262e;});}else{return _0x27262e;}})[_0x2104('0x47')](function(_0x19ba88){logger[_0x2104('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19ba88);throw _0x19ba88;});}return _0x27262e;});}})[_0x2104('0x25')](respondWithResult(_0x5362d4,0xc9))[_0x2104('0x47')](handleError(_0x5362d4,null));};exports[_0x2104('0x24')]=function(_0xf8f3d1,_0x3de1d6){if(_0xf8f3d1['body']['id']){delete _0xf8f3d1['body']['id'];}return db[_0x2104('0x42')][_0x2104('0x56')]({'where':{'id':_0xf8f3d1['params']['id']}})[_0x2104('0x25')](handleEntityNotFound(_0x3de1d6,null))[_0x2104('0x25')](saveUpdates(_0xf8f3d1['body'],null))['then'](respondWithResult(_0x3de1d6,null))['catch'](handleError(_0x3de1d6,null));};exports[_0x2104('0x26')]=function(_0x17d3d9,_0x4b16d2){return db[_0x2104('0x42')][_0x2104('0x56')]({'where':{'id':_0x17d3d9[_0x2104('0x49')]['id']}})[_0x2104('0x25')](handleEntityNotFound(_0x4b16d2,null))['then'](removeEntity(_0x4b16d2,null))[_0x2104('0x47')](handleError(_0x4b16d2,null));};exports[_0x2104('0x5a')]=function(_0xae45d4,_0x177310,_0x367d42){var _0x52c0f4={'raw':!![],'where':{}};var _0xc5eaa9={};var _0x3f0c47={'count':0x0,'rows':[]};return db[_0x2104('0x42')][_0x2104('0x5b')]({'where':{'id':_0xae45d4[_0x2104('0x49')]['id']}})['then'](handleEntityNotFound(_0x177310,null))[_0x2104('0x25')](function(_0x14949d){if(_0x14949d){_0xc5eaa9['model']=_[_0x2104('0x33')](db[_0x2104('0x5c')][_0x2104('0x2e')]);_0xc5eaa9[_0x2104('0x32')]=_[_0x2104('0x33')](_0xae45d4[_0x2104('0x32')]);_0xc5eaa9[_0x2104('0x34')]=_[_0x2104('0x35')](_0xc5eaa9[_0x2104('0x36')],_0xc5eaa9['query']);_0x52c0f4['attributes']=_['intersection'](_0xc5eaa9['model'],qs['fields'](_0xae45d4[_0x2104('0x32')][_0x2104('0x38')]));_0x52c0f4['attributes']=_0x52c0f4[_0x2104('0x37')][_0x2104('0x4a')]?_0x52c0f4[_0x2104('0x37')]:_0xc5eaa9['model'];if(!_0xae45d4[_0x2104('0x32')][_0x2104('0x39')]('nolimit')){_0x52c0f4[_0x2104('0x1f')]=qs[_0x2104('0x1f')](_0xae45d4[_0x2104('0x32')]['limit']);_0x52c0f4[_0x2104('0x1e')]=qs[_0x2104('0x1e')](_0xae45d4[_0x2104('0x32')][_0x2104('0x1e')]);}_0x52c0f4['order']=qs[_0x2104('0x3b')](_0xae45d4[_0x2104('0x32')][_0x2104('0x3b')]);_0x52c0f4['where']=qs['filters'](_[_0x2104('0x3d')](_0xae45d4[_0x2104('0x32')],_0xc5eaa9[_0x2104('0x34')]));_0x52c0f4[_0x2104('0x3c')]['CampaignId']=_0x14949d['id'];if(_0xae45d4[_0x2104('0x32')]['filter']){_0x52c0f4[_0x2104('0x3c')]=_[_0x2104('0x3f')](_0x52c0f4['where'],{'$or':_['map'](_0x52c0f4[_0x2104('0x37')],function(_0x344c98){var _0x3f5dff={};_0x3f5dff[_0x344c98]={'$like':'%'+_0xae45d4[_0x2104('0x32')][_0x2104('0x3e')]+'%'};return _0x3f5dff;})});}_0x52c0f4=_[_0x2104('0x3f')]({},_0x52c0f4,_0xae45d4[_0x2104('0x41')]);return db['CmHopper']['count']({'where':_0x52c0f4[_0x2104('0x3c')]})[_0x2104('0x25')](function(_0x174c5c){_0x3f0c47[_0x2104('0x21')]=_0x174c5c;if(_0xae45d4['query']['includeAll']){_0x52c0f4['include']=[{'all':!![]}];}return db[_0x2104('0x5c')]['findAll'](_0x52c0f4);})[_0x2104('0x25')](function(_0x3cb686){_0x3f0c47[_0x2104('0x46')]=_0x3cb686;return _0x3f0c47;});}})[_0x2104('0x25')](respondWithFilteredResult(_0x177310,_0x52c0f4))[_0x2104('0x47')](handleError(_0x177310,null));};exports[_0x2104('0x5d')]=function(_0x3e383c,_0xe6455f,_0x2bd3c1){var _0x21f377={'raw':!![],'where':{}};var _0x41bfbc={};var _0x430528={'count':0x0,'rows':[]};return db['Campaign'][_0x2104('0x5b')]({'where':{'id':_0x3e383c[_0x2104('0x49')]['id']}})[_0x2104('0x25')](handleEntityNotFound(_0xe6455f,null))[_0x2104('0x25')](function(_0x9bd715){if(_0x9bd715){_0x41bfbc[_0x2104('0x36')]=_[_0x2104('0x33')](db['CmHopperHistory'][_0x2104('0x2e')]);_0x41bfbc[_0x2104('0x32')]=_['keys'](_0x3e383c['query']);_0x41bfbc['filters']=_[_0x2104('0x35')](_0x41bfbc[_0x2104('0x36')],_0x41bfbc['query']);_0x21f377['attributes']=_[_0x2104('0x35')](_0x41bfbc[_0x2104('0x36')],qs[_0x2104('0x38')](_0x3e383c[_0x2104('0x32')][_0x2104('0x38')]));_0x21f377['attributes']=_0x21f377['attributes'][_0x2104('0x4a')]?_0x21f377['attributes']:_0x41bfbc[_0x2104('0x36')];if(!_0x3e383c['query'][_0x2104('0x39')](_0x2104('0x5e'))){_0x21f377['limit']=qs['limit'](_0x3e383c[_0x2104('0x32')][_0x2104('0x1f')]);_0x21f377[_0x2104('0x1e')]=qs[_0x2104('0x1e')](_0x3e383c['query']['offset']);}_0x21f377[_0x2104('0x3a')]=qs[_0x2104('0x3b')](_0x3e383c['query'][_0x2104('0x3b')]);_0x21f377[_0x2104('0x3c')]=qs[_0x2104('0x34')](_[_0x2104('0x3d')](_0x3e383c['query'],_0x41bfbc[_0x2104('0x34')]));_0x21f377[_0x2104('0x3c')]['CampaignId']=_0x9bd715['id'];if(_0x3e383c['query'][_0x2104('0x3e')]){_0x21f377[_0x2104('0x3c')]=_[_0x2104('0x3f')](_0x21f377['where'],{'$or':_['map'](_0x21f377[_0x2104('0x37')],function(_0x2e15fd){var _0x5812e8={};_0x5812e8[_0x2e15fd]={'$like':'%'+_0x3e383c[_0x2104('0x32')][_0x2104('0x3e')]+'%'};return _0x5812e8;})});}_0x21f377=_[_0x2104('0x3f')]({},_0x21f377,_0x3e383c[_0x2104('0x41')]);return db[_0x2104('0x5f')]['count']({'where':_0x21f377[_0x2104('0x3c')]})[_0x2104('0x25')](function(_0x96b962){_0x430528[_0x2104('0x21')]=_0x96b962;if(_0x3e383c['query'][_0x2104('0x43')]){_0x21f377[_0x2104('0x44')]=[{'all':!![]}];}return db[_0x2104('0x5f')][_0x2104('0x45')](_0x21f377);})[_0x2104('0x25')](function(_0x1e27cd){_0x430528[_0x2104('0x46')]=_0x1e27cd;return _0x430528;});}})[_0x2104('0x25')](respondWithFilteredResult(_0xe6455f,_0x21f377))[_0x2104('0x47')](handleError(_0xe6455f,null));};exports[_0x2104('0x60')]=function(_0x9db88a,_0x1dd13b,_0x524093){var _0x25c77f={'raw':!![],'where':{}};var _0x8dc325={};var _0xdab1c5={'count':0x0,'rows':[]};return db[_0x2104('0x42')][_0x2104('0x5b')]({'where':{'id':_0x9db88a[_0x2104('0x49')]['id']}})[_0x2104('0x25')](handleEntityNotFound(_0x1dd13b,null))[_0x2104('0x25')](function(_0x20ac2d){if(_0x20ac2d){_0x8dc325[_0x2104('0x36')]=_[_0x2104('0x33')](db[_0x2104('0x61')]['rawAttributes']);_0x8dc325['query']=_[_0x2104('0x33')](_0x9db88a[_0x2104('0x32')]);_0x8dc325[_0x2104('0x34')]=_[_0x2104('0x35')](_0x8dc325[_0x2104('0x36')],_0x8dc325[_0x2104('0x32')]);_0x25c77f[_0x2104('0x37')]=_[_0x2104('0x35')](_0x8dc325[_0x2104('0x36')],qs['fields'](_0x9db88a[_0x2104('0x32')][_0x2104('0x38')]));_0x25c77f[_0x2104('0x37')]=_0x25c77f[_0x2104('0x37')]['length']?_0x25c77f[_0x2104('0x37')]:_0x8dc325[_0x2104('0x36')];if(!_0x9db88a[_0x2104('0x32')]['hasOwnProperty']('nolimit')){_0x25c77f[_0x2104('0x1f')]=qs[_0x2104('0x1f')](_0x9db88a[_0x2104('0x32')][_0x2104('0x1f')]);_0x25c77f[_0x2104('0x1e')]=qs['offset'](_0x9db88a[_0x2104('0x32')][_0x2104('0x1e')]);}_0x25c77f[_0x2104('0x3a')]=qs[_0x2104('0x3b')](_0x9db88a[_0x2104('0x32')][_0x2104('0x3b')]);_0x25c77f[_0x2104('0x3c')]=qs[_0x2104('0x34')](_[_0x2104('0x3d')](_0x9db88a['query'],_0x8dc325[_0x2104('0x34')]));_0x25c77f[_0x2104('0x3c')][_0x2104('0x62')]=_0x20ac2d['id'];if(_0x9db88a['query'][_0x2104('0x3e')]){_0x25c77f['where']=_[_0x2104('0x3f')](_0x25c77f['where'],{'$or':_[_0x2104('0x2d')](_0x25c77f['attributes'],function(_0x297a0e){var _0x5724c1={};_0x5724c1[_0x297a0e]={'$like':'%'+_0x9db88a[_0x2104('0x32')][_0x2104('0x3e')]+'%'};return _0x5724c1;})});}_0x25c77f=_[_0x2104('0x3f')]({},_0x25c77f,_0x9db88a['options']);return db[_0x2104('0x61')][_0x2104('0x21')]({'where':_0x25c77f[_0x2104('0x3c')]})[_0x2104('0x25')](function(_0x2299c1){_0xdab1c5[_0x2104('0x21')]=_0x2299c1;if(_0x9db88a[_0x2104('0x32')][_0x2104('0x43')]){_0x25c77f[_0x2104('0x44')]=[{'all':!![]}];}return db[_0x2104('0x61')][_0x2104('0x45')](_0x25c77f);})[_0x2104('0x25')](function(_0x303e6e){_0xdab1c5[_0x2104('0x46')]=_0x303e6e;return _0xdab1c5;});}})[_0x2104('0x25')](respondWithFilteredResult(_0x1dd13b,_0x25c77f))['catch'](handleError(_0x1dd13b,null));};exports[_0x2104('0x63')]=function(_0x2ab4c9,_0x13ada6,_0x2e3448){var _0x20763e={'raw':!![],'where':{}};var _0x5e166e={};var _0x16b2e7={'count':0x0,'rows':[]};return db[_0x2104('0x42')][_0x2104('0x5b')]({'where':{'id':_0x2ab4c9[_0x2104('0x49')]['id']}})[_0x2104('0x25')](handleEntityNotFound(_0x13ada6,null))[_0x2104('0x25')](function(_0x3170c4){if(_0x3170c4){_0x5e166e['model']=_[_0x2104('0x33')](db[_0x2104('0x64')]['rawAttributes']);_0x5e166e[_0x2104('0x32')]=_[_0x2104('0x33')](_0x2ab4c9[_0x2104('0x32')]);_0x5e166e['filters']=_[_0x2104('0x35')](_0x5e166e['model'],_0x5e166e[_0x2104('0x32')]);_0x20763e[_0x2104('0x37')]=_[_0x2104('0x35')](_0x5e166e[_0x2104('0x36')],qs[_0x2104('0x38')](_0x2ab4c9['query'][_0x2104('0x38')]));_0x20763e[_0x2104('0x37')]=_0x20763e[_0x2104('0x37')][_0x2104('0x4a')]?_0x20763e['attributes']:_0x5e166e[_0x2104('0x36')];if(!_0x2ab4c9[_0x2104('0x32')][_0x2104('0x39')](_0x2104('0x5e'))){_0x20763e[_0x2104('0x1f')]=qs[_0x2104('0x1f')](_0x2ab4c9[_0x2104('0x32')][_0x2104('0x1f')]);_0x20763e[_0x2104('0x1e')]=qs[_0x2104('0x1e')](_0x2ab4c9[_0x2104('0x32')][_0x2104('0x1e')]);}_0x20763e[_0x2104('0x3a')]=qs[_0x2104('0x3b')](_0x2ab4c9[_0x2104('0x32')][_0x2104('0x3b')]);_0x20763e[_0x2104('0x3c')]=qs[_0x2104('0x34')](_['pick'](_0x2ab4c9[_0x2104('0x32')],_0x5e166e['filters']));_0x20763e[_0x2104('0x3c')][_0x2104('0x62')]=_0x3170c4['id'];if(_0x2ab4c9[_0x2104('0x32')][_0x2104('0x3e')]){_0x20763e[_0x2104('0x3c')]=_['merge'](_0x20763e[_0x2104('0x3c')],{'$or':_[_0x2104('0x2d')](_0x20763e[_0x2104('0x37')],function(_0x720bb4){var _0x493ac4={};_0x493ac4[_0x720bb4]={'$like':'%'+_0x2ab4c9[_0x2104('0x32')]['filter']+'%'};return _0x493ac4;})});}_0x20763e=_['merge']({},_0x20763e,_0x2ab4c9['options']);return db['CmHopperBlack']['count']({'where':_0x20763e[_0x2104('0x3c')]})['then'](function(_0x3e29fd){_0x16b2e7['count']=_0x3e29fd;if(_0x2ab4c9[_0x2104('0x32')][_0x2104('0x43')]){_0x20763e['include']=[{'all':!![]}];}return db[_0x2104('0x64')]['findAll'](_0x20763e);})[_0x2104('0x25')](function(_0x3971b5){_0x16b2e7[_0x2104('0x46')]=_0x3971b5;return _0x16b2e7;});}})[_0x2104('0x25')](respondWithFilteredResult(_0x13ada6,_0x20763e))[_0x2104('0x47')](handleError(_0x13ada6,null));};exports[_0x2104('0x65')]=function(_0x23c4de,_0x2e405b,_0x4d5467){var _0x54d549={};var _0xa835c2={};var _0x2eebd2;var _0x27a7bc;return db['Campaign'][_0x2104('0x5b')]({'where':{'id':_0x23c4de[_0x2104('0x49')]['id']}})[_0x2104('0x25')](handleEntityNotFound(_0x2e405b,null))[_0x2104('0x25')](function(_0x3e8787){if(_0x3e8787){_0x2eebd2=_0x3e8787;_0xa835c2[_0x2104('0x36')]=_[_0x2104('0x33')](db[_0x2104('0x66')][_0x2104('0x2e')]);_0xa835c2[_0x2104('0x32')]=_['keys'](_0x23c4de[_0x2104('0x32')]);_0xa835c2[_0x2104('0x34')]=_['intersection'](_0xa835c2['model'],_0xa835c2['query']);_0x54d549[_0x2104('0x37')]=_[_0x2104('0x35')](_0xa835c2[_0x2104('0x36')],qs[_0x2104('0x38')](_0x23c4de[_0x2104('0x32')][_0x2104('0x38')]));_0x54d549[_0x2104('0x37')]=_0x54d549['attributes'][_0x2104('0x4a')]?_0x54d549[_0x2104('0x37')]:_0xa835c2[_0x2104('0x36')];_0x54d549[_0x2104('0x3a')]=qs[_0x2104('0x3b')](_0x23c4de[_0x2104('0x32')][_0x2104('0x3b')]);_0x54d549[_0x2104('0x3c')]=qs[_0x2104('0x34')](_[_0x2104('0x3d')](_0x23c4de[_0x2104('0x32')],_0xa835c2[_0x2104('0x34')]));if(_0x23c4de[_0x2104('0x32')][_0x2104('0x3e')]){_0x54d549[_0x2104('0x3c')]=_['merge'](_0x54d549[_0x2104('0x3c')],{'$or':_[_0x2104('0x2d')](_0x54d549[_0x2104('0x37')],function(_0x57042c){var _0xf220c8={};_0xf220c8[_0x57042c]={'$like':'%'+_0x23c4de[_0x2104('0x32')][_0x2104('0x3e')]+'%'};return _0xf220c8;})});}_0x54d549=_[_0x2104('0x3f')]({},_0x54d549,_0x23c4de[_0x2104('0x41')]);return _0x2eebd2['getLists'](_0x54d549);}})[_0x2104('0x25')](function(_0x39cb1d){if(_0x39cb1d){_0x27a7bc=_0x39cb1d[_0x2104('0x4a')];if(!_0x23c4de['query'][_0x2104('0x39')]('nolimit')){_0x54d549[_0x2104('0x1f')]=qs[_0x2104('0x1f')](_0x23c4de[_0x2104('0x32')][_0x2104('0x1f')]);_0x54d549[_0x2104('0x1e')]=qs[_0x2104('0x1e')](_0x23c4de['query'][_0x2104('0x1e')]);}return _0x2eebd2[_0x2104('0x65')](_0x54d549);}})[_0x2104('0x25')](function(_0x4dcc8f){if(_0x4dcc8f){return _0x4dcc8f?{'count':_0x27a7bc,'rows':_0x4dcc8f}:null;}})[_0x2104('0x25')](respondWithResult(_0x2e405b,null))[_0x2104('0x47')](handleError(_0x2e405b,null));};exports[_0x2104('0x67')]=function(_0xa8b76d,_0x48369f,_0x12deaa){var _0x4f4329,_0x49a5ff;var _0x4757c0=[];var _0x1c8d80=moment()[_0x2104('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x2104('0x42')][_0x2104('0x56')]({'where':{'id':_0xa8b76d[_0x2104('0x49')]['id']}})[_0x2104('0x25')](handleEntityNotFound(_0x48369f,null))[_0x2104('0x25')](function(_0xf43567){if(_0xf43567){_0x49a5ff=_0xf43567;return _0xf43567[_0x2104('0x67')](_0xa8b76d['body'][_0x2104('0x69')],_[_0x2104('0x57')](_0xa8b76d[_0x2104('0x4c')],[_0x2104('0x69'),'id'])||{});}return null;})[_0x2104('0x6a')](function(_0x35614e){var _0x234bc0;var _0x1b1446;_0x4f4329=_0x35614e||[];var _0x4e8a1e=[];if(_0x35614e){for(var _0x2c7e20=0x0;_0x2c7e20<_0x35614e['length'];_0x2c7e20+=0x1){var _0x5a426e=_0x35614e[_0x2c7e20][_0x2104('0x27')]({'plain':!![]});_0x49a5ff[_0x2104('0x6b')]=_0xa8b76d[_0x2104('0x4c')]['dialCheckDuplicateType']?_0xa8b76d[_0x2104('0x4c')]['dialCheckDuplicateType']:_0x49a5ff[_0x2104('0x6b')];switch(_0x49a5ff['dialCheckDuplicateType']){case'always':_0x234bc0=squel[_0x2104('0x6c')]()[_0x2104('0x6d')]('cm_hopper')[_0x2104('0x6e')]([_0x2104('0x6f'),_0x2104('0x70'),'ContactId',_0x2104('0x71'),_0x2104('0x62'),'createdAt',_0x2104('0x59')],squel[_0x2104('0x72')]()['field'](_0x2104('0x6f'),_0x2104('0x6f'))[_0x2104('0x73')](_0x2104('0x74'),_0x2104('0x70'))[_0x2104('0x73')]('id',_0x2104('0x75'))['field'](_0x5a426e[_0x2104('0x76')]['toString'](),_0x2104('0x71'))[_0x2104('0x73')](_0xa8b76d[_0x2104('0x49')]['id'][_0x2104('0x77')](),_0x2104('0x62'))['field']('\x27'+_0x1c8d80+'\x27','createdAt')[_0x2104('0x73')]('\x27'+_0x1c8d80+'\x27',_0x2104('0x59'))[_0x2104('0x78')](_0x2104('0x79'))[_0x2104('0x3c')](_0x2104('0x7a'))[_0x2104('0x3c')]('ListId\x20=\x20?',_0x5a426e['CmListId'][_0x2104('0x77')]())[_0x2104('0x3c')](_0x2104('0x7b'))[_0x2104('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x2104('0x72')]()[_0x2104('0x73')](_0x2104('0x7c'))[_0x2104('0x78')]('cm_hopper_final')[_0x2104('0x3c')]('CampaignId\x20=\x20?',_0xa8b76d['params']['id'][_0x2104('0x77')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x2104('0x72')]()[_0x2104('0x73')](_0x2104('0x7d'))[_0x2104('0x78')](_0x2104('0x7e'))[_0x2104('0x3c')](_0x2104('0x7f'),_0xa8b76d[_0x2104('0x49')]['id'][_0x2104('0x77')]())))['toString']();break;case _0x2104('0x80'):_0x234bc0=squel[_0x2104('0x6c')]()[_0x2104('0x6d')](_0x2104('0x7e'))[_0x2104('0x6e')]([_0x2104('0x6f'),_0x2104('0x70'),_0x2104('0x75'),'ListId',_0x2104('0x62'),_0x2104('0x58'),'updatedAt'],squel[_0x2104('0x72')]()[_0x2104('0x73')](_0x2104('0x6f'),_0x2104('0x6f'))['field'](_0x2104('0x74'),_0x2104('0x70'))['field']('id',_0x2104('0x75'))[_0x2104('0x73')](_0x5a426e['CmListId'][_0x2104('0x77')](),'ListId')[_0x2104('0x73')](_0xa8b76d['params']['id'][_0x2104('0x77')](),_0x2104('0x62'))[_0x2104('0x73')]('\x27'+_0x1c8d80+'\x27',_0x2104('0x58'))[_0x2104('0x73')]('\x27'+_0x1c8d80+'\x27','updatedAt')[_0x2104('0x78')](_0x2104('0x79'))[_0x2104('0x3c')]('deletedAt\x20IS\x20NULL')['where'](_0x2104('0x81'),_0x5a426e[_0x2104('0x76')][_0x2104('0x77')]())[_0x2104('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x2104('0x3c')](_0x2104('0x82'),squel[_0x2104('0x72')]()['field'](_0x2104('0x7d'))[_0x2104('0x78')](_0x2104('0x7e'))[_0x2104('0x3c')]('CampaignId\x20=\x20?',_0xa8b76d[_0x2104('0x49')]['id']['toString']())))[_0x2104('0x77')]();break;default:_0x234bc0=squel[_0x2104('0x6c')]()[_0x2104('0x6d')](_0x2104('0x7e'))[_0x2104('0x6e')]([_0x2104('0x6f'),'scheduledAt',_0x2104('0x75'),_0x2104('0x71'),_0x2104('0x62'),_0x2104('0x58'),'updatedAt'],squel[_0x2104('0x72')]()[_0x2104('0x73')](_0x2104('0x6f'),'phone')[_0x2104('0x73')](_0x2104('0x74'),'scheduledAt')[_0x2104('0x73')]('id',_0x2104('0x75'))['field'](_0x5a426e[_0x2104('0x76')]['toString'](),'ListId')[_0x2104('0x73')](_0xa8b76d[_0x2104('0x49')]['id'][_0x2104('0x77')](),'CampaignId')[_0x2104('0x73')]('\x27'+_0x1c8d80+'\x27',_0x2104('0x58'))[_0x2104('0x73')]('\x27'+_0x1c8d80+'\x27',_0x2104('0x59'))[_0x2104('0x78')](_0x2104('0x79'))[_0x2104('0x3c')](_0x2104('0x7a'))[_0x2104('0x3c')](_0x2104('0x81'),_0x5a426e['CmListId']['toString']())[_0x2104('0x3c')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x1b1446=squel[_0x2104('0x6c')]()[_0x2104('0x6d')](_0x2104('0x83'))[_0x2104('0x6e')]([_0x2104('0x84'),'scheduledAt',_0x2104('0x6f'),_0x2104('0x85'),_0x2104('0x58'),_0x2104('0x59')],squel['select']()[_0x2104('0x73')](_0x2104('0x86'),'id')[_0x2104('0x73')](_0x2104('0x74'),'scheduledAt')['field'](_0x2104('0x87'),'phone')['field'](_0x2104('0x88'),_0x2104('0x85'))[_0x2104('0x73')]('\x27'+_0x1c8d80+'\x27',_0x2104('0x58'))[_0x2104('0x73')]('\x27'+_0x1c8d80+'\x27','updatedAt')[_0x2104('0x78')](_0x2104('0x89'),'ci')[_0x2104('0x8a')](_0x2104('0x7e'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x2104('0x3c')]('h.ListId\x20=\x20?',_0x5a426e['CmListId'][_0x2104('0x77')]())[_0x2104('0x3c')](_0x2104('0x8b'),_0xa8b76d[_0x2104('0x49')]['id'][_0x2104('0x77')]())[_0x2104('0x3c')](_0x2104('0x8c'),_0x1c8d80))[_0x2104('0x77')]();_0x4e8a1e['push'](db[_0x2104('0x8d')]['query'](_0x234bc0));_0x4757c0[_0x2104('0x8e')](db[_0x2104('0x8d')][_0x2104('0x32')](_0x1b1446));}return BPromise['all'](_0x4e8a1e);}})['then'](function(){return BPromise['all'](_0x4757c0);})[_0x2104('0x25')](function(){return _0x4f4329;})[_0x2104('0x25')](respondWithResult(_0x48369f,null))[_0x2104('0x47')](handleError(_0x48369f,null));};exports[_0x2104('0x8f')]=function(_0x4c58aa,_0x111c54,_0x399f3f){return db[_0x2104('0x42')][_0x2104('0x56')]({'where':{'id':_0x4c58aa[_0x2104('0x49')]['id']}})[_0x2104('0x25')](handleEntityNotFound(_0x111c54,null))[_0x2104('0x25')](function(_0xe40767){if(_0xe40767){return _0xe40767[_0x2104('0x8f')](_0x4c58aa[_0x2104('0x32')]['ids']);}})[_0x2104('0x25')](function(_0x5a22b7){if(_0x5a22b7){return db[_0x2104('0x5c')][_0x2104('0x26')]({'where':{'ListId':_0x4c58aa['query'][_0x2104('0x69')],'CampaignId':_0x4c58aa[_0x2104('0x49')]['id']}})['then'](function(){return _0x5a22b7;});}})[_0x2104('0x25')](respondWithStatusCode(_0x111c54,null))['catch'](handleError(_0x111c54,null));};exports[_0x2104('0x90')]=function(_0x41fdfd,_0xd80775,_0x14e146){var _0x5ece98={};var _0x557ae1={};var _0x8d2e42;var _0x3e47d7;return db[_0x2104('0x42')][_0x2104('0x5b')]({'where':{'id':_0x41fdfd[_0x2104('0x49')]['id']}})['then'](handleEntityNotFound(_0xd80775,null))['then'](function(_0x2a6d3d){if(_0x2a6d3d){_0x8d2e42=_0x2a6d3d;_0x557ae1[_0x2104('0x36')]=_[_0x2104('0x33')](db[_0x2104('0x66')][_0x2104('0x2e')]);_0x557ae1[_0x2104('0x32')]=_['keys'](_0x41fdfd[_0x2104('0x32')]);_0x557ae1[_0x2104('0x34')]=_['intersection'](_0x557ae1['model'],_0x557ae1[_0x2104('0x32')]);_0x5ece98[_0x2104('0x37')]=_[_0x2104('0x35')](_0x557ae1['model'],qs[_0x2104('0x38')](_0x41fdfd[_0x2104('0x32')]['fields']));_0x5ece98[_0x2104('0x37')]=_0x5ece98[_0x2104('0x37')][_0x2104('0x4a')]?_0x5ece98[_0x2104('0x37')]:_0x557ae1[_0x2104('0x36')];_0x5ece98[_0x2104('0x3a')]=qs[_0x2104('0x3b')](_0x41fdfd[_0x2104('0x32')][_0x2104('0x3b')]);_0x5ece98[_0x2104('0x3c')]=qs[_0x2104('0x34')](_[_0x2104('0x3d')](_0x41fdfd[_0x2104('0x32')],_0x557ae1[_0x2104('0x34')]));if(_0x41fdfd[_0x2104('0x32')]['filter']){_0x5ece98[_0x2104('0x3c')]=_['merge'](_0x5ece98[_0x2104('0x3c')],{'$or':_['map'](_0x5ece98['attributes'],function(_0x41622e){var _0x4e2256={};_0x4e2256[_0x41622e]={'$like':'%'+_0x41fdfd[_0x2104('0x32')]['filter']+'%'};return _0x4e2256;})});}_0x5ece98=_[_0x2104('0x3f')]({},_0x5ece98,_0x41fdfd[_0x2104('0x41')]);return _0x8d2e42['getBlackLists'](_0x5ece98);}})['then'](function(_0x557000){if(_0x557000){_0x3e47d7=_0x557000['length'];if(!_0x41fdfd[_0x2104('0x32')]['hasOwnProperty'](_0x2104('0x5e'))){_0x5ece98[_0x2104('0x1f')]=qs[_0x2104('0x1f')](_0x41fdfd[_0x2104('0x32')][_0x2104('0x1f')]);_0x5ece98[_0x2104('0x1e')]=qs[_0x2104('0x1e')](_0x41fdfd[_0x2104('0x32')][_0x2104('0x1e')]);}return _0x8d2e42[_0x2104('0x90')](_0x5ece98);}})[_0x2104('0x25')](function(_0xb5752b){if(_0xb5752b){return _0xb5752b?{'count':_0x3e47d7,'rows':_0xb5752b}:null;}})['then'](respondWithResult(_0xd80775,null))[_0x2104('0x47')](handleError(_0xd80775,null));};exports[_0x2104('0x91')]=function(_0x1560c0,_0x591791,_0x400bd2){var _0x56398f,_0x1792fc;var _0x234162=[];var _0x37f725=moment()[_0x2104('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x2104('0x42')][_0x2104('0x56')]({'where':{'id':_0x1560c0[_0x2104('0x49')]['id']}})['then'](handleEntityNotFound(_0x591791,null))['then'](function(_0x5db293){if(_0x5db293){_0x1792fc=_0x5db293;return _0x5db293[_0x2104('0x91')](_0x1560c0['body'][_0x2104('0x69')],_[_0x2104('0x57')](_0x1560c0['body'],['ids','id'])||{});}return null;})[_0x2104('0x6a')](function(_0x588d2b){var _0x32ff3c;var _0x2ceebe;_0x56398f=_0x588d2b||[];var _0x22bea8=[];if(_0x588d2b){for(var _0x56911b=0x0;_0x56911b<_0x588d2b['length'];_0x56911b+=0x1){var _0xccdd94=_0x588d2b[_0x56911b][_0x2104('0x27')]({'plain':!![]});_0x32ff3c=squel[_0x2104('0x6c')]()['into'](_0x2104('0x92'))[_0x2104('0x6e')]([_0x2104('0x6f'),_0x2104('0x75'),_0x2104('0x71'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0x2104('0x73')](_0x2104('0x6f'),_0x2104('0x6f'))[_0x2104('0x73')]('id','ContactId')['field'](_0xccdd94[_0x2104('0x76')][_0x2104('0x77')](),_0x2104('0x71'))[_0x2104('0x73')](_0x1560c0[_0x2104('0x49')]['id']['toString'](),'CampaignId')['field'](_0x2104('0x74'),_0x2104('0x58'))[_0x2104('0x73')](_0x2104('0x74'),_0x2104('0x59'))[_0x2104('0x78')](_0x2104('0x79'))[_0x2104('0x3c')](_0x2104('0x7a'))[_0x2104('0x3c')](_0x2104('0x81'),_0xccdd94[_0x2104('0x76')][_0x2104('0x77')]())[_0x2104('0x3c')](_0x2104('0x7b')))[_0x2104('0x77')]();_0x22bea8['push'](db['sequelize'][_0x2104('0x32')](_0x32ff3c));}return BPromise[_0x2104('0x93')](_0x22bea8);}})[_0x2104('0x25')](function(){return _0x56398f;})[_0x2104('0x25')](respondWithResult(_0x591791,null))['catch'](handleError(_0x591791,null));};exports[_0x2104('0x94')]=function(_0x4c3065,_0x5cc95b,_0x1807a9){return db[_0x2104('0x42')][_0x2104('0x56')]({'where':{'id':_0x4c3065[_0x2104('0x49')]['id']}})[_0x2104('0x25')](handleEntityNotFound(_0x5cc95b,null))[_0x2104('0x25')](function(_0x1e0aa3){if(_0x1e0aa3){return _0x1e0aa3[_0x2104('0x94')](_0x4c3065['query'][_0x2104('0x69')]);}})[_0x2104('0x25')](function(_0x4a6b38){if(_0x4a6b38){return db[_0x2104('0x64')]['destroy']({'where':{'ListId':_0x4c3065[_0x2104('0x32')][_0x2104('0x69')],'CampaignId':_0x4c3065['params']['id']}})[_0x2104('0x25')](function(){return _0x4a6b38;});}})[_0x2104('0x25')](respondWithStatusCode(_0x5cc95b,null))[_0x2104('0x47')](handleError(_0x5cc95b,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 411fafa..44a9656 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xb6a6bf,_0x184dfd){var _0x4a36b5=function(_0xa10bf3){while(--_0xa10bf3){_0xb6a6bf['push'](_0xb6a6bf['shift']());}};_0x4a36b5(++_0x184dfd);}(_0x7a54,0x106));var _0x47a5=function(_0x5586be,_0x1d1838){_0x5586be=_0x5586be-0x0;var _0x15a658=_0x7a54[_0x5586be];return _0x15a658;};'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 6c7c039..3f048ab 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 _0x8ccb=['GetCampaign','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','debug','Campaign,\x20%s,\x20%s,\x20%s','error','Campaign,\x20%s,\x20%s','message','request\x20sent','result','Campaign','options','raw','where','attributes','limit','include','map','model'];(function(_0x4e581f,_0x3f939d){var _0x8ced8b=function(_0x4700b7){while(--_0x4700b7){_0x4e581f['push'](_0x4e581f['shift']());}};_0x8ced8b(++_0x3f939d);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0x8ccb[_0x1e03a6];return _0x295b64;};'use strict';var _=require(_0xb8cc('0x0'));var util=require(_0xb8cc('0x1'));var moment=require('moment');var BPromise=require(_0xb8cc('0x2'));var rs=require(_0xb8cc('0x3'));var fs=require('fs');var Redis=require(_0xb8cc('0x4'));var db=require(_0xb8cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb8cc('0x6'));var config=require(_0xb8cc('0x7'));var jayson=require(_0xb8cc('0x8'));var client=jayson['client'][_0xb8cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x349552,_0x139945,_0x56951f){return new BPromise(function(_0x35c86d,_0x2c338f){return client[_0xb8cc('0xa')](_0x349552,_0x56951f)['then'](function(_0x175473){logger[_0xb8cc('0xb')]('Campaign,\x20%s,\x20%s',_0x139945,'request\x20sent');logger[_0xb8cc('0xc')](_0xb8cc('0xd'),_0x139945,'request\x20sent',JSON['stringify'](_0x175473));if(_0x175473[_0xb8cc('0xe')]){if(_0x175473[_0xb8cc('0xe')]['code']===0x1f4){logger[_0xb8cc('0xe')](_0xb8cc('0xf'),_0x139945,_0x175473[_0xb8cc('0xe')][_0xb8cc('0x10')]);return _0x2c338f(_0x175473[_0xb8cc('0xe')][_0xb8cc('0x10')]);}logger[_0xb8cc('0xe')]('Campaign,\x20%s,\x20%s',_0x139945,_0x175473[_0xb8cc('0xe')]['message']);return _0x35c86d(_0x175473[_0xb8cc('0xe')][_0xb8cc('0x10')]);}else{logger[_0xb8cc('0xb')]('Campaign,\x20%s,\x20%s',_0x139945,_0xb8cc('0x11'));_0x35c86d(_0x175473[_0xb8cc('0x12')][_0xb8cc('0x10')]);}})['catch'](function(_0x2ba498){logger['error'](_0xb8cc('0xf'),_0x139945,_0x2ba498);_0x2c338f(_0x2ba498);});});}exports['GetCampaign']=function(_0x2ac4cc){var _0x259708=this;return new Promise(function(_0x2b7130,_0x3e1ba7){return db[_0xb8cc('0x13')]['findAll']({'raw':_0x2ac4cc[_0xb8cc('0x14')]?_0x2ac4cc[_0xb8cc('0x14')][_0xb8cc('0x15')]===undefined?!![]:![]:!![],'where':_0x2ac4cc['options']?_0x2ac4cc[_0xb8cc('0x14')][_0xb8cc('0x16')]||null:null,'attributes':_0x2ac4cc['options']?_0x2ac4cc[_0xb8cc('0x14')][_0xb8cc('0x17')]||null:null,'limit':_0x2ac4cc['options']?_0x2ac4cc[_0xb8cc('0x14')][_0xb8cc('0x18')]||null:null,'include':_0x2ac4cc[_0xb8cc('0x14')]?_0x2ac4cc[_0xb8cc('0x14')][_0xb8cc('0x19')]?_[_0xb8cc('0x1a')](_0x2ac4cc[_0xb8cc('0x14')]['include'],function(_0x50aa38){return{'model':db[_0x50aa38[_0xb8cc('0x1b')]],'as':_0x50aa38['as'],'attributes':_0x50aa38['attributes'],'include':_0x50aa38[_0xb8cc('0x19')]?_['map'](_0x50aa38[_0xb8cc('0x19')],function(_0xbb1918){return{'model':db[_0xbb1918[_0xb8cc('0x1b')]],'as':_0xbb1918['as'],'attributes':_0xbb1918[_0xb8cc('0x17')],'include':_0xbb1918['include']?_[_0xb8cc('0x1a')](_0xbb1918[_0xb8cc('0x19')],function(_0x400de6){return{'model':db[_0x400de6[_0xb8cc('0x1b')]],'as':_0x400de6['as'],'attributes':_0x400de6[_0xb8cc('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50ed6f){logger[_0xb8cc('0xb')](_0xb8cc('0x1c'),_0x2ac4cc);logger['debug'](_0xb8cc('0x1c'),_0x2ac4cc,JSON['stringify'](_0x50ed6f));_0x2b7130(_0x50ed6f);})[_0xb8cc('0x1d')](function(_0x2634a4){logger[_0xb8cc('0xe')](_0xb8cc('0x1c'),_0x2634a4['message'],_0x2ac4cc);_0x3e1ba7(_0x259708[_0xb8cc('0xe')](0x1f4,_0x2634a4[_0xb8cc('0x10')]));});});};
\ No newline at end of file
+var _0x3299=['Campaign,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetCampaign','findAll','options','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug'];(function(_0x6dfd39,_0x1cb1ae){var _0xcb55b8=function(_0x32e62b){while(--_0x32e62b){_0x6dfd39['push'](_0x6dfd39['shift']());}};_0xcb55b8(++_0x1cb1ae);}(_0x3299,0x1bc));var _0x9329=function(_0x4674b7,_0x46e906){_0x4674b7=_0x4674b7-0x0;var _0x503198=_0x3299[_0x4674b7];return _0x503198;};'use strict';var _=require('lodash');var util=require(_0x9329('0x0'));var moment=require(_0x9329('0x1'));var BPromise=require(_0x9329('0x2'));var rs=require(_0x9329('0x3'));var fs=require('fs');var Redis=require(_0x9329('0x4'));var db=require(_0x9329('0x5'))['db'];var utils=require(_0x9329('0x6'));var logger=require(_0x9329('0x7'))(_0x9329('0x8'));var config=require(_0x9329('0x9'));var jayson=require(_0x9329('0xa'));var client=jayson[_0x9329('0xb')][_0x9329('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14bc45,_0x1fa6c4,_0x218cf3){return new BPromise(function(_0x182d15,_0x531cf1){return client[_0x9329('0xd')](_0x14bc45,_0x218cf3)[_0x9329('0xe')](function(_0x1c1033){logger[_0x9329('0xf')](_0x9329('0x10'),_0x1fa6c4,'request\x20sent');logger[_0x9329('0x11')](_0x9329('0x12'),_0x1fa6c4,'request\x20sent',JSON['stringify'](_0x1c1033));if(_0x1c1033['error']){if(_0x1c1033[_0x9329('0x13')][_0x9329('0x14')]===0x1f4){logger[_0x9329('0x13')](_0x9329('0x10'),_0x1fa6c4,_0x1c1033[_0x9329('0x13')]['message']);return _0x531cf1(_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);}logger[_0x9329('0x13')]('Campaign,\x20%s,\x20%s',_0x1fa6c4,_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);return _0x182d15(_0x1c1033['error'][_0x9329('0x15')]);}else{logger[_0x9329('0xf')]('Campaign,\x20%s,\x20%s',_0x1fa6c4,_0x9329('0x16'));_0x182d15(_0x1c1033[_0x9329('0x17')][_0x9329('0x15')]);}})[_0x9329('0x18')](function(_0x4dfbc1){logger[_0x9329('0x13')]('Campaign,\x20%s,\x20%s',_0x1fa6c4,_0x4dfbc1);_0x531cf1(_0x4dfbc1);});});}exports[_0x9329('0x19')]=function(_0x1b5eed){var _0x57718b=this;return new Promise(function(_0x41db73,_0x26a3c2){return db['Campaign'][_0x9329('0x1a')]({'raw':_0x1b5eed['options']?_0x1b5eed[_0x9329('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed['options'][_0x9329('0x1c')]||null:null,'attributes':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed[_0x9329('0x1b')][_0x9329('0x1d')]||null:null,'limit':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed[_0x9329('0x1b')]['limit']||null:null,'include':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed[_0x9329('0x1b')][_0x9329('0x1e')]?_[_0x9329('0x1f')](_0x1b5eed[_0x9329('0x1b')]['include'],function(_0x22caa4){return{'model':db[_0x22caa4[_0x9329('0x20')]],'as':_0x22caa4['as'],'attributes':_0x22caa4['attributes'],'include':_0x22caa4[_0x9329('0x1e')]?_[_0x9329('0x1f')](_0x22caa4[_0x9329('0x1e')],function(_0x2da39d){return{'model':db[_0x2da39d['model']],'as':_0x2da39d['as'],'attributes':_0x2da39d['attributes'],'include':_0x2da39d[_0x9329('0x1e')]?_[_0x9329('0x1f')](_0x2da39d[_0x9329('0x1e')],function(_0x4f5fbf){return{'model':db[_0x4f5fbf[_0x9329('0x20')]],'as':_0x4f5fbf['as'],'attributes':_0x4f5fbf['attributes']};}):[]};}):[]};}):[]:[]})[_0x9329('0xe')](function(_0x192d0a){logger[_0x9329('0xf')]('GetCampaign',_0x1b5eed);logger['debug'](_0x9329('0x19'),_0x1b5eed,JSON['stringify'](_0x192d0a));_0x41db73(_0x192d0a);})[_0x9329('0x18')](function(_0x4a5d27){logger[_0x9329('0x13')]('GetCampaign',_0x4a5d27[_0x9329('0x15')],_0x1b5eed);_0x26a3c2(_0x57718b[_0x9329('0x13')](0x1f4,_0x4a5d27['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 834a59d..e80b932 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 _0x142c=['/:id/hopper_histories','/:id/hopper_black','getHopperBlacks','/:id/lists','create','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','/:id/blacklists','removeBlackLists','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','./campaign.controller','isAuthenticated','get','/:id','/:id/hoppers'];(function(_0x8c27bc,_0x3d876b){var _0x58a502=function(_0x462298){while(--_0x462298){_0x8c27bc['push'](_0x8c27bc['shift']());}};_0x58a502(++_0x3d876b);}(_0x142c,0x86));var _0xc142=function(_0x2a95a0,_0xe5b698){_0x2a95a0=_0x2a95a0-0x0;var _0x2ac4bf=_0x142c[_0x2a95a0];return _0x2ac4bf;};'use strict';var multer=require(_0xc142('0x0'));var util=require('util');var path=require(_0xc142('0x1'));var timeout=require(_0xc142('0x2'));var express=require(_0xc142('0x3'));var router=express['Router']();var fs_extra=require(_0xc142('0x4'));var auth=require(_0xc142('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc142('0x6'));router['get']('/',auth[_0xc142('0x7')](),controller['index']);router[_0xc142('0x8')](_0xc142('0x9'),auth[_0xc142('0x7')](),controller['show']);router['get'](_0xc142('0xa'),auth[_0xc142('0x7')](),controller['getHoppers']);router['get'](_0xc142('0xb'),auth[_0xc142('0x7')](),controller['getHopperHistories']);router[_0xc142('0x8')]('/:id/hopper_finals',auth[_0xc142('0x7')](),controller['getHopperFinals']);router[_0xc142('0x8')](_0xc142('0xc'),auth[_0xc142('0x7')](),controller[_0xc142('0xd')]);router['get'](_0xc142('0xe'),auth[_0xc142('0x7')](),controller['getLists']);router[_0xc142('0x8')]('/:id/blacklists',auth[_0xc142('0x7')](),controller['getBlackLists']);router['post']('/',auth[_0xc142('0x7')](),controller[_0xc142('0xf')]);router[_0xc142('0x10')](_0xc142('0x11'),auth['isAuthenticated'](),controller[_0xc142('0x12')]);router[_0xc142('0x10')](_0xc142('0xe'),auth[_0xc142('0x7')](),controller[_0xc142('0x13')]);router[_0xc142('0x10')]('/:id/blacklists',auth[_0xc142('0x7')](),controller[_0xc142('0x14')]);router[_0xc142('0x15')](_0xc142('0x9'),auth[_0xc142('0x7')](),controller[_0xc142('0x16')]);router[_0xc142('0x17')](_0xc142('0x9'),auth[_0xc142('0x7')](),controller[_0xc142('0x18')]);router[_0xc142('0x17')]('/:id/lists',auth['isAuthenticated'](),controller[_0xc142('0x19')]);router['delete'](_0xc142('0x1a'),auth[_0xc142('0x7')](),controller[_0xc142('0x1b')]);module[_0xc142('0x1c')]=router;
\ No newline at end of file
+var _0x02e5=['getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories'];(function(_0x230767,_0x5dc481){var _0x452ed4=function(_0x1349ea){while(--_0x1349ea){_0x230767['push'](_0x230767['shift']());}};_0x452ed4(++_0x5dc481);}(_0x02e5,0x132));var _0x502e=function(_0x1b0533,_0x4fd2d6){_0x1b0533=_0x1b0533-0x0;var _0x408c77=_0x02e5[_0x1b0533];return _0x408c77;};'use strict';var multer=require(_0x502e('0x0'));var util=require(_0x502e('0x1'));var path=require(_0x502e('0x2'));var timeout=require('connect-timeout');var express=require(_0x502e('0x3'));var router=express[_0x502e('0x4')]();var fs_extra=require(_0x502e('0x5'));var auth=require(_0x502e('0x6'));var interaction=require(_0x502e('0x7'));var config=require(_0x502e('0x8'));var controller=require(_0x502e('0x9'));router[_0x502e('0xa')]('/',auth[_0x502e('0xb')](),controller[_0x502e('0xc')]);router[_0x502e('0xa')](_0x502e('0xd'),auth[_0x502e('0xb')](),controller[_0x502e('0xe')]);router[_0x502e('0xa')](_0x502e('0xf'),auth[_0x502e('0xb')](),controller[_0x502e('0x10')]);router[_0x502e('0xa')](_0x502e('0x11'),auth[_0x502e('0xb')](),controller[_0x502e('0x12')]);router[_0x502e('0xa')]('/:id/hopper_finals',auth[_0x502e('0xb')](),controller['getHopperFinals']);router['get'](_0x502e('0x13'),auth[_0x502e('0xb')](),controller[_0x502e('0x14')]);router[_0x502e('0xa')](_0x502e('0x15'),auth[_0x502e('0xb')](),controller['getLists']);router[_0x502e('0xa')]('/:id/blacklists',auth[_0x502e('0xb')](),controller[_0x502e('0x16')]);router[_0x502e('0x17')]('/',auth[_0x502e('0xb')](),controller[_0x502e('0x18')]);router[_0x502e('0x17')](_0x502e('0x19'),auth['isAuthenticated'](),controller[_0x502e('0x1a')]);router[_0x502e('0x17')]('/:id/lists',auth[_0x502e('0xb')](),controller[_0x502e('0x1b')]);router[_0x502e('0x17')](_0x502e('0x1c'),auth[_0x502e('0xb')](),controller[_0x502e('0x1d')]);router[_0x502e('0x1e')]('/:id',auth[_0x502e('0xb')](),controller[_0x502e('0x1f')]);router[_0x502e('0x20')](_0x502e('0xd'),auth[_0x502e('0xb')](),controller['destroy']);router[_0x502e('0x20')](_0x502e('0x15'),auth[_0x502e('0xb')](),controller[_0x502e('0x21')]);router[_0x502e('0x20')](_0x502e('0x1c'),auth['isAuthenticated'](),controller[_0x502e('0x22')]);module[_0x502e('0x23')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index da8d44e..1690907 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 _0x5a06=['exports','STRING','VIRTUAL','getDataValue','key','sequelize'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x5a06,0xb9));var _0x65a0=function(_0x492a9f,_0x28752e){_0x492a9f=_0x492a9f-0x0;var _0xa72548=_0x5a06[_0x492a9f];return _0xa72548;};'use strict';var Sequelize=require(_0x65a0('0x0'));module[_0x65a0('0x1')]={'key':{'type':Sequelize[_0x65a0('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x65a0('0x2')]},'name':{'type':Sequelize[_0x65a0('0x3')],'get':function(){return this[_0x65a0('0x4')](_0x65a0('0x5'));}}};
\ No newline at end of file
+var _0xf332=['getDataValue','sequelize','exports','TEXT','STRING'];(function(_0x15d8bd,_0x515e30){var _0x3b57d7=function(_0x101f4e){while(--_0x101f4e){_0x15d8bd['push'](_0x15d8bd['shift']());}};_0x3b57d7(++_0x515e30);}(_0xf332,0x105));var _0x2f33=function(_0x3a3e9d,_0x42e092){_0x3a3e9d=_0x3a3e9d-0x0;var _0x26aaf7=_0xf332[_0x3a3e9d];return _0x26aaf7;};'use strict';var Sequelize=require(_0x2f33('0x0'));module[_0x2f33('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x2f33('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2f33('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x2f33('0x4')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index d33f443..099658a 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 _0x53fb=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','rows','catch','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0xe4850f,_0x1ae0ce){var _0x302c7e=function(_0x11f7bc){while(--_0x11f7bc){_0xe4850f['push'](_0xe4850f['shift']());}};_0x302c7e(++_0x1ae0ce);}(_0x53fb,0x71));var _0xb53f=function(_0x311a31,_0x126007){_0x311a31=_0x311a31-0x0;var _0x4bfbaf=_0x53fb[_0x311a31];return _0x4bfbaf;};'use strict';var emlformat=require(_0xb53f('0x0'));var rimraf=require(_0xb53f('0x1'));var zipdir=require(_0xb53f('0x2'));var jsonpatch=require(_0xb53f('0x3'));var rp=require(_0xb53f('0x4'));var moment=require(_0xb53f('0x5'));var BPromise=require(_0xb53f('0x6'));var Mustache=require(_0xb53f('0x7'));var util=require('util');var path=require(_0xb53f('0x8'));var sox=require(_0xb53f('0x9'));var csv=require(_0xb53f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb53f('0xb'));var _=require('lodash');var squel=require(_0xb53f('0xc'));var crypto=require('crypto');var jsforce=require(_0xb53f('0xd'));var deskjs=require(_0xb53f('0xe'));var toCsv=require(_0xb53f('0xa'));var querystring=require(_0xb53f('0xf'));var Papa=require('papaparse');var Redis=require(_0xb53f('0x10'));var authService=require(_0xb53f('0x11'));var qs=require(_0xb53f('0x12'));var as=require(_0xb53f('0x13'));var hardwareService=require(_0xb53f('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xb53f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb53f('0x16'));var db=require(_0xb53f('0x17'))['db'];function respondWithStatusCode(_0xc86d69,_0x3b4a53){_0x3b4a53=_0x3b4a53||0xcc;return function(_0x47d7e3){if(_0x47d7e3){return _0xc86d69['sendStatus'](_0x3b4a53);}return _0xc86d69[_0xb53f('0x18')](_0x3b4a53)['end']();};}function respondWithResult(_0x35cdd2,_0x118f51){_0x118f51=_0x118f51||0xc8;return function(_0x1f5058){if(_0x1f5058){return _0x35cdd2['status'](_0x118f51)[_0xb53f('0x19')](_0x1f5058);}};}function respondWithFilteredResult(_0x155a41,_0x2432e8){return function(_0x588a53){if(_0x588a53){var _0x44ad4e=typeof _0x2432e8[_0xb53f('0x1a')]===_0xb53f('0x1b')&&typeof _0x2432e8[_0xb53f('0x1c')]===_0xb53f('0x1b');var _0x5df88d=_0x588a53[_0xb53f('0x1d')];var _0x2ea69f=_0x44ad4e?0x0:_0x2432e8[_0xb53f('0x1a')];var _0x2b8106=_0x44ad4e?_0x588a53[_0xb53f('0x1d')]:_0x2432e8[_0xb53f('0x1a')]+_0x2432e8[_0xb53f('0x1c')];var _0x501b4c;if(_0x2b8106>=_0x5df88d){_0x2b8106=_0x5df88d;_0x501b4c=0xc8;}else{_0x501b4c=0xce;}_0x155a41[_0xb53f('0x18')](_0x501b4c);return _0x155a41['set'](_0xb53f('0x1e'),_0x2ea69f+'-'+_0x2b8106+'/'+_0x5df88d)[_0xb53f('0x19')](_0x588a53);}return null;};}function patchUpdates(_0x2fd320){return function(_0xc14c77){try{jsonpatch[_0xb53f('0x1f')](_0xc14c77,_0x2fd320,!![]);}catch(_0x515afa){return BPromise[_0xb53f('0x20')](_0x515afa);}return _0xc14c77[_0xb53f('0x21')]();};}function saveUpdates(_0x18f770,_0xe7d530){return function(_0x3ad7b2){if(_0x3ad7b2){return _0x3ad7b2[_0xb53f('0x22')](_0x18f770)[_0xb53f('0x23')](function(_0x42cf55){return _0x42cf55;});}return null;};}function removeEntity(_0x52e178,_0x49f79b){return function(_0x70bc9a){if(_0x70bc9a){return _0x70bc9a[_0xb53f('0x24')]()[_0xb53f('0x23')](function(){var _0x3dd755=_0x70bc9a['get']({'plain':!![]});var _0x5db380='CannedAnswers';return db[_0xb53f('0x25')][_0xb53f('0x24')]({'where':{'type':_0x5db380,'resourceId':_0x3dd755['id']}})[_0xb53f('0x23')](function(){return _0x70bc9a;});})[_0xb53f('0x23')](function(){_0x52e178[_0xb53f('0x18')](0xcc)[_0xb53f('0x26')]();});}};}function handleEntityNotFound(_0x47497c,_0x4e1a11){return function(_0xe607c8){if(!_0xe607c8){_0x47497c[_0xb53f('0x27')](0x194);}return _0xe607c8;};}function handleError(_0x14be81,_0x5069a3){_0x5069a3=_0x5069a3||0x1f4;return function(_0x3c26d5){logger[_0xb53f('0x28')](_0x3c26d5[_0xb53f('0x29')]);if(_0x3c26d5['name']){delete _0x3c26d5[_0xb53f('0x2a')];}_0x14be81['status'](_0x5069a3)[_0xb53f('0x2b')](_0x3c26d5);};}exports[_0xb53f('0x2c')]=function(_0x538d4c,_0x5c0ba6){var _0x35bffe={},_0x18d851={},_0x38054d={'count':0x0,'rows':[]};var _0x5334cb=_[_0xb53f('0x2d')](db[_0xb53f('0x2e')][_0xb53f('0x2f')],function(_0x12060a){return{'name':_0x12060a['fieldName'],'type':_0x12060a[_0xb53f('0x30')][_0xb53f('0x31')]};});_0x18d851[_0xb53f('0x32')]=_[_0xb53f('0x2d')](_0x5334cb,_0xb53f('0x2a'));_0x18d851['query']=_[_0xb53f('0x33')](_0x538d4c[_0xb53f('0x34')]);_0x18d851[_0xb53f('0x35')]=_[_0xb53f('0x36')](_0x18d851['model'],_0x18d851[_0xb53f('0x34')]);_0x35bffe[_0xb53f('0x37')]=_[_0xb53f('0x36')](_0x18d851[_0xb53f('0x32')],qs[_0xb53f('0x38')](_0x538d4c['query'][_0xb53f('0x38')]));_0x35bffe[_0xb53f('0x37')]=_0x35bffe[_0xb53f('0x37')][_0xb53f('0x39')]?_0x35bffe[_0xb53f('0x37')]:_0x18d851[_0xb53f('0x32')];if(!_0x538d4c[_0xb53f('0x34')][_0xb53f('0x3a')](_0xb53f('0x3b'))){_0x35bffe[_0xb53f('0x1c')]=qs[_0xb53f('0x1c')](_0x538d4c[_0xb53f('0x34')][_0xb53f('0x1c')]);_0x35bffe[_0xb53f('0x1a')]=qs[_0xb53f('0x1a')](_0x538d4c[_0xb53f('0x34')][_0xb53f('0x1a')]);}_0x35bffe[_0xb53f('0x3c')]=qs[_0xb53f('0x3d')](_0x538d4c['query'][_0xb53f('0x3d')]);_0x35bffe['where']=qs[_0xb53f('0x35')](_['pick'](_0x538d4c[_0xb53f('0x34')],_0x18d851['filters']),_0x5334cb);if(_0x538d4c[_0xb53f('0x34')]['filter']){_0x35bffe[_0xb53f('0x3e')]=_['merge'](_0x35bffe[_0xb53f('0x3e')],{'$or':[{'key':{'$like':'%'+_0x538d4c[_0xb53f('0x34')][_0xb53f('0x3f')]+'%'}},{'value':{'$like':'%'+_0x538d4c[_0xb53f('0x34')][_0xb53f('0x3f')]+'%'}}]});}_0x35bffe=_[_0xb53f('0x40')]({},_0x35bffe,_0x538d4c[_0xb53f('0x41')]);var _0x11a5ea={'where':_0x35bffe['where']};return db['CannedAnswer']['count'](_0x11a5ea)[_0xb53f('0x23')](function(_0x3b7a1c){_0x38054d[_0xb53f('0x1d')]=_0x3b7a1c;if(_0x538d4c[_0xb53f('0x34')][_0xb53f('0x42')]){_0x35bffe['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x35bffe);})[_0xb53f('0x23')](function(_0x187fb1){_0x38054d[_0xb53f('0x43')]=_0x187fb1;return _0x38054d;})[_0xb53f('0x23')](respondWithFilteredResult(_0x5c0ba6,_0x35bffe))[_0xb53f('0x44')](handleError(_0x5c0ba6,null));};exports['show']=function(_0xfdd42a,_0x350965){var _0x1eaa50={'raw':!![],'where':{'id':_0xfdd42a[_0xb53f('0x45')]['id']}},_0x5a4925={};_0x5a4925[_0xb53f('0x32')]=_[_0xb53f('0x33')](db[_0xb53f('0x2e')]['rawAttributes']);_0x5a4925['query']=_['keys'](_0xfdd42a['query']);_0x5a4925['filters']=_[_0xb53f('0x36')](_0x5a4925['model'],_0x5a4925[_0xb53f('0x34')]);_0x1eaa50[_0xb53f('0x37')]=_[_0xb53f('0x36')](_0x5a4925[_0xb53f('0x32')],qs['fields'](_0xfdd42a[_0xb53f('0x34')][_0xb53f('0x38')]));_0x1eaa50[_0xb53f('0x37')]=_0x1eaa50['attributes'][_0xb53f('0x39')]?_0x1eaa50[_0xb53f('0x37')]:_0x5a4925[_0xb53f('0x32')];if(_0xfdd42a[_0xb53f('0x34')][_0xb53f('0x42')]){_0x1eaa50[_0xb53f('0x46')]=[{'all':!![]}];}_0x1eaa50=_[_0xb53f('0x40')]({},_0x1eaa50,_0xfdd42a[_0xb53f('0x41')]);return db[_0xb53f('0x2e')][_0xb53f('0x47')](_0x1eaa50)[_0xb53f('0x23')](handleEntityNotFound(_0x350965,null))['then'](respondWithResult(_0x350965,null))[_0xb53f('0x44')](handleError(_0x350965,null));};exports[_0xb53f('0x22')]=function(_0x309ef2,_0x3e0a1d){if(_0x309ef2['body']['id']){delete _0x309ef2[_0xb53f('0x48')]['id'];}return db[_0xb53f('0x2e')][_0xb53f('0x47')]({'where':{'id':_0x309ef2['params']['id']}})[_0xb53f('0x23')](handleEntityNotFound(_0x3e0a1d,null))[_0xb53f('0x23')](saveUpdates(_0x309ef2['body'],null))[_0xb53f('0x23')](respondWithResult(_0x3e0a1d,null))[_0xb53f('0x44')](handleError(_0x3e0a1d,null));};exports[_0xb53f('0x24')]=function(_0x4ac3f8,_0x4866c8){return db['CannedAnswer'][_0xb53f('0x47')]({'where':{'id':_0x4ac3f8['params']['id']}})[_0xb53f('0x23')](handleEntityNotFound(_0x4866c8,null))[_0xb53f('0x23')](removeEntity(_0x4866c8,null))[_0xb53f('0x44')](handleError(_0x4866c8,null));};exports[_0xb53f('0x49')]=function(_0x472b68,_0x2900c3){var _0x573258={'key':_0x472b68[_0xb53f('0x48')][_0xb53f('0x31')]};if(_0x472b68[_0xb53f('0x48')][_0xb53f('0x4a')]){_0x573258[_0xb53f('0x4a')]=_0x472b68[_0xb53f('0x48')][_0xb53f('0x4a')];}else if(_0x472b68[_0xb53f('0x48')][_0xb53f('0x4b')]){_0x573258[_0xb53f('0x4b')]=_0x472b68[_0xb53f('0x48')][_0xb53f('0x4b')];}else if(_0x472b68[_0xb53f('0x48')]['OpenchannelAccountId']){_0x573258['OpenchannelAccountId']=_0x472b68['body'][_0xb53f('0x4c')];}else if(_0x472b68[_0xb53f('0x48')][_0xb53f('0x4d')]){_0x573258[_0xb53f('0x4d')]=_0x472b68[_0xb53f('0x48')][_0xb53f('0x4d')];}return db[_0xb53f('0x2e')][_0xb53f('0x47')]({'where':_0x573258})['then'](function(_0x4498cc){if(_0x4498cc){throw new db[(_0xb53f('0x4e'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xb53f('0x2e')][_0xb53f('0x49')](_0x472b68[_0xb53f('0x48')]);})[_0xb53f('0x23')](function(_0x3b9033){var _0x37ca69=_0x472b68[_0xb53f('0x4f')][_0xb53f('0x50')]({'plain':!![]});if(!_0x37ca69)throw new Error(_0xb53f('0x51'));if(_0x37ca69['role']===_0xb53f('0x4f')){var _0x154701=_0x3b9033[_0xb53f('0x50')]({'plain':!![]});return db[_0xb53f('0x52')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x37ca69[_0xb53f('0x53')]},'raw':!![]})['then'](function(_0x5ec5bf){if(_0x5ec5bf&&_0x5ec5bf[_0xb53f('0x54')]===0x0){return db['UserProfileResource'][_0xb53f('0x49')]({'name':_0x154701[_0xb53f('0x2a')],'resourceId':_0x154701['id'],'type':_0x5ec5bf[_0xb53f('0x2a')],'sectionId':_0x5ec5bf['id']},{})['then'](function(){return _0x3b9033;});}else{return _0x3b9033;}})[_0xb53f('0x44')](function(_0x18f849){logger[_0xb53f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18f849);throw _0x18f849;});}return _0x3b9033;})['then'](respondWithResult(_0x2900c3,0xc9))[_0xb53f('0x44')](handleError(_0x2900c3,null));};
\ No newline at end of file
+var _0xe139=['send','map','CannedAnswer','rawAttributes','fieldName','type','query','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','length','find','body','params','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','name'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0xe139,0x13b));var _0x9e13=function(_0x315fab,_0x14c15d){_0x315fab=_0x315fab-0x0;var _0x5eb800=_0xe139[_0x315fab];return _0x5eb800;};'use strict';var emlformat=require(_0x9e13('0x0'));var rimraf=require(_0x9e13('0x1'));var zipdir=require(_0x9e13('0x2'));var jsonpatch=require(_0x9e13('0x3'));var rp=require(_0x9e13('0x4'));var moment=require(_0x9e13('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9e13('0x6'));var util=require(_0x9e13('0x7'));var path=require(_0x9e13('0x8'));var sox=require('sox');var csv=require(_0x9e13('0x9'));var ejs=require(_0x9e13('0xa'));var fs=require('fs');var fs_extra=require(_0x9e13('0xb'));var _=require(_0x9e13('0xc'));var squel=require(_0x9e13('0xd'));var crypto=require(_0x9e13('0xe'));var jsforce=require(_0x9e13('0xf'));var deskjs=require(_0x9e13('0x10'));var toCsv=require(_0x9e13('0x9'));var querystring=require(_0x9e13('0x11'));var Papa=require(_0x9e13('0x12'));var Redis=require('ioredis');var authService=require(_0x9e13('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9e13('0x14'));var hardwareService=require(_0x9e13('0x15'));var logger=require(_0x9e13('0x16'))(_0x9e13('0x17'));var utils=require(_0x9e13('0x18'));var config=require(_0x9e13('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12c458,_0x4c11a7){_0x4c11a7=_0x4c11a7||0xcc;return function(_0x34fb57){if(_0x34fb57){return _0x12c458['sendStatus'](_0x4c11a7);}return _0x12c458[_0x9e13('0x1a')](_0x4c11a7)[_0x9e13('0x1b')]();};}function respondWithResult(_0x2e5a17,_0x5368ad){_0x5368ad=_0x5368ad||0xc8;return function(_0x17f7bb){if(_0x17f7bb){return _0x2e5a17[_0x9e13('0x1a')](_0x5368ad)[_0x9e13('0x1c')](_0x17f7bb);}};}function respondWithFilteredResult(_0x2741a3,_0x1fc8c2){return function(_0x44f3a8){if(_0x44f3a8){var _0xdcffc8=typeof _0x1fc8c2[_0x9e13('0x1d')]===_0x9e13('0x1e')&&typeof _0x1fc8c2[_0x9e13('0x1f')]===_0x9e13('0x1e');var _0x26a285=_0x44f3a8[_0x9e13('0x20')];var _0x140267=_0xdcffc8?0x0:_0x1fc8c2[_0x9e13('0x1d')];var _0x2b9783=_0xdcffc8?_0x44f3a8[_0x9e13('0x20')]:_0x1fc8c2[_0x9e13('0x1d')]+_0x1fc8c2[_0x9e13('0x1f')];var _0x3502cf;if(_0x2b9783>=_0x26a285){_0x2b9783=_0x26a285;_0x3502cf=0xc8;}else{_0x3502cf=0xce;}_0x2741a3[_0x9e13('0x1a')](_0x3502cf);return _0x2741a3[_0x9e13('0x21')](_0x9e13('0x22'),_0x140267+'-'+_0x2b9783+'/'+_0x26a285)['json'](_0x44f3a8);}return null;};}function patchUpdates(_0x3159e1){return function(_0x11e1b2){try{jsonpatch[_0x9e13('0x23')](_0x11e1b2,_0x3159e1,!![]);}catch(_0x2b757c){return BPromise['reject'](_0x2b757c);}return _0x11e1b2['save']();};}function saveUpdates(_0x4e04ba,_0x4b3dcf){return function(_0x144f42){if(_0x144f42){return _0x144f42[_0x9e13('0x24')](_0x4e04ba)[_0x9e13('0x25')](function(_0x19e6ea){return _0x19e6ea;});}return null;};}function removeEntity(_0x40e3ef,_0x346f69){return function(_0x2db7ce){if(_0x2db7ce){return _0x2db7ce[_0x9e13('0x26')]()['then'](function(){var _0x39560e=_0x2db7ce[_0x9e13('0x27')]({'plain':!![]});var _0x48ccd5=_0x9e13('0x28');return db[_0x9e13('0x29')][_0x9e13('0x26')]({'where':{'type':_0x48ccd5,'resourceId':_0x39560e['id']}})['then'](function(){return _0x2db7ce;});})['then'](function(){_0x40e3ef[_0x9e13('0x1a')](0xcc)[_0x9e13('0x1b')]();});}};}function handleEntityNotFound(_0x53469f,_0x570fbf){return function(_0x274502){if(!_0x274502){_0x53469f[_0x9e13('0x2a')](0x194);}return _0x274502;};}function handleError(_0x2804b5,_0x4ef664){_0x4ef664=_0x4ef664||0x1f4;return function(_0x3b1df2){logger[_0x9e13('0x2b')](_0x3b1df2['stack']);if(_0x3b1df2[_0x9e13('0x2c')]){delete _0x3b1df2[_0x9e13('0x2c')];}_0x2804b5[_0x9e13('0x1a')](_0x4ef664)[_0x9e13('0x2d')](_0x3b1df2);};}exports['index']=function(_0x41ad75,_0x2e2b19){var _0x3d25ab={},_0x298777={},_0x3a8394={'count':0x0,'rows':[]};var _0x2d893c=_[_0x9e13('0x2e')](db[_0x9e13('0x2f')][_0x9e13('0x30')],function(_0x3a48cb){return{'name':_0x3a48cb[_0x9e13('0x31')],'type':_0x3a48cb[_0x9e13('0x32')]['key']};});_0x298777['model']=_[_0x9e13('0x2e')](_0x2d893c,_0x9e13('0x2c'));_0x298777[_0x9e13('0x33')]=_['keys'](_0x41ad75['query']);_0x298777['filters']=_['intersection'](_0x298777[_0x9e13('0x34')],_0x298777[_0x9e13('0x33')]);_0x3d25ab['attributes']=_[_0x9e13('0x35')](_0x298777[_0x9e13('0x34')],qs['fields'](_0x41ad75[_0x9e13('0x33')][_0x9e13('0x36')]));_0x3d25ab[_0x9e13('0x37')]=_0x3d25ab['attributes']['length']?_0x3d25ab['attributes']:_0x298777['model'];if(!_0x41ad75[_0x9e13('0x33')][_0x9e13('0x38')](_0x9e13('0x39'))){_0x3d25ab[_0x9e13('0x1f')]=qs['limit'](_0x41ad75[_0x9e13('0x33')]['limit']);_0x3d25ab['offset']=qs[_0x9e13('0x1d')](_0x41ad75[_0x9e13('0x33')]['offset']);}_0x3d25ab[_0x9e13('0x3a')]=qs[_0x9e13('0x3b')](_0x41ad75['query'][_0x9e13('0x3b')]);_0x3d25ab[_0x9e13('0x3c')]=qs[_0x9e13('0x3d')](_[_0x9e13('0x3e')](_0x41ad75[_0x9e13('0x33')],_0x298777[_0x9e13('0x3d')]),_0x2d893c);if(_0x41ad75[_0x9e13('0x33')][_0x9e13('0x3f')]){_0x3d25ab[_0x9e13('0x3c')]=_[_0x9e13('0x40')](_0x3d25ab[_0x9e13('0x3c')],{'$or':[{'key':{'$like':'%'+_0x41ad75[_0x9e13('0x33')][_0x9e13('0x3f')]+'%'}},{'value':{'$like':'%'+_0x41ad75[_0x9e13('0x33')][_0x9e13('0x3f')]+'%'}}]});}_0x3d25ab=_[_0x9e13('0x40')]({},_0x3d25ab,_0x41ad75[_0x9e13('0x41')]);var _0x20834a={'where':_0x3d25ab[_0x9e13('0x3c')]};return db[_0x9e13('0x2f')][_0x9e13('0x20')](_0x20834a)[_0x9e13('0x25')](function(_0x5283cf){_0x3a8394[_0x9e13('0x20')]=_0x5283cf;if(_0x41ad75[_0x9e13('0x33')][_0x9e13('0x42')]){_0x3d25ab[_0x9e13('0x43')]=[{'all':!![]}];}return db[_0x9e13('0x2f')][_0x9e13('0x44')](_0x3d25ab);})['then'](function(_0x516219){_0x3a8394[_0x9e13('0x45')]=_0x516219;return _0x3a8394;})[_0x9e13('0x25')](respondWithFilteredResult(_0x2e2b19,_0x3d25ab))[_0x9e13('0x46')](handleError(_0x2e2b19,null));};exports[_0x9e13('0x47')]=function(_0x557881,_0x443567){var _0x58bb36={'raw':!![],'where':{'id':_0x557881['params']['id']}},_0x4e4a22={};_0x4e4a22['model']=_[_0x9e13('0x48')](db[_0x9e13('0x2f')][_0x9e13('0x30')]);_0x4e4a22[_0x9e13('0x33')]=_[_0x9e13('0x48')](_0x557881['query']);_0x4e4a22['filters']=_[_0x9e13('0x35')](_0x4e4a22[_0x9e13('0x34')],_0x4e4a22[_0x9e13('0x33')]);_0x58bb36['attributes']=_['intersection'](_0x4e4a22[_0x9e13('0x34')],qs[_0x9e13('0x36')](_0x557881['query'][_0x9e13('0x36')]));_0x58bb36['attributes']=_0x58bb36[_0x9e13('0x37')][_0x9e13('0x49')]?_0x58bb36[_0x9e13('0x37')]:_0x4e4a22[_0x9e13('0x34')];if(_0x557881[_0x9e13('0x33')][_0x9e13('0x42')]){_0x58bb36[_0x9e13('0x43')]=[{'all':!![]}];}_0x58bb36=_['merge']({},_0x58bb36,_0x557881[_0x9e13('0x41')]);return db['CannedAnswer'][_0x9e13('0x4a')](_0x58bb36)[_0x9e13('0x25')](handleEntityNotFound(_0x443567,null))['then'](respondWithResult(_0x443567,null))[_0x9e13('0x46')](handleError(_0x443567,null));};exports[_0x9e13('0x24')]=function(_0x11bd34,_0x57a5e5){if(_0x11bd34[_0x9e13('0x4b')]['id']){delete _0x11bd34[_0x9e13('0x4b')]['id'];}return db['CannedAnswer'][_0x9e13('0x4a')]({'where':{'id':_0x11bd34[_0x9e13('0x4c')]['id']}})[_0x9e13('0x25')](handleEntityNotFound(_0x57a5e5,null))[_0x9e13('0x25')](saveUpdates(_0x11bd34['body'],null))[_0x9e13('0x25')](respondWithResult(_0x57a5e5,null))[_0x9e13('0x46')](handleError(_0x57a5e5,null));};exports[_0x9e13('0x26')]=function(_0x229c0c,_0x591487){return db[_0x9e13('0x2f')][_0x9e13('0x4a')]({'where':{'id':_0x229c0c[_0x9e13('0x4c')]['id']}})[_0x9e13('0x25')](handleEntityNotFound(_0x591487,null))['then'](removeEntity(_0x591487,null))[_0x9e13('0x46')](handleError(_0x591487,null));};exports[_0x9e13('0x4d')]=function(_0x360d77,_0x81a54b){var _0x532779={'key':_0x360d77[_0x9e13('0x4b')][_0x9e13('0x4e')]};if(_0x360d77['body'][_0x9e13('0x4f')]){_0x532779[_0x9e13('0x4f')]=_0x360d77[_0x9e13('0x4b')][_0x9e13('0x4f')];}else if(_0x360d77['body'][_0x9e13('0x50')]){_0x532779[_0x9e13('0x50')]=_0x360d77[_0x9e13('0x4b')][_0x9e13('0x50')];}else if(_0x360d77[_0x9e13('0x4b')][_0x9e13('0x51')]){_0x532779[_0x9e13('0x51')]=_0x360d77[_0x9e13('0x4b')]['OpenchannelAccountId'];}else if(_0x360d77['body']['ChatWebsiteId']){_0x532779['ChatWebsiteId']=_0x360d77['body']['ChatWebsiteId'];}return db[_0x9e13('0x2f')][_0x9e13('0x4a')]({'where':_0x532779})[_0x9e13('0x25')](function(_0x1a381d){if(_0x1a381d){throw new db[(_0x9e13('0x52'))][(_0x9e13('0x53'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x9e13('0x2f')][_0x9e13('0x4d')](_0x360d77[_0x9e13('0x4b')]);})[_0x9e13('0x25')](function(_0x58d188){var _0x2e0fec=_0x360d77[_0x9e13('0x54')][_0x9e13('0x27')]({'plain':!![]});if(!_0x2e0fec)throw new Error(_0x9e13('0x55'));if(_0x2e0fec[_0x9e13('0x56')]===_0x9e13('0x54')){var _0x180ee9=_0x58d188[_0x9e13('0x27')]({'plain':!![]});return db[_0x9e13('0x57')]['find']({'where':{'name':_0x9e13('0x28'),'userProfileId':_0x2e0fec[_0x9e13('0x58')]},'raw':!![]})[_0x9e13('0x25')](function(_0x2edd28){if(_0x2edd28&&_0x2edd28[_0x9e13('0x59')]===0x0){return db['UserProfileResource'][_0x9e13('0x4d')]({'name':_0x180ee9[_0x9e13('0x2c')],'resourceId':_0x180ee9['id'],'type':_0x2edd28[_0x9e13('0x2c')],'sectionId':_0x2edd28['id']},{})[_0x9e13('0x25')](function(){return _0x58d188;});}else{return _0x58d188;}})[_0x9e13('0x46')](function(_0x1e15e8){logger[_0x9e13('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e15e8);throw _0x1e15e8;});}return _0x58d188;})[_0x9e13('0x25')](respondWithResult(_0x81a54b,0xc9))['catch'](handleError(_0x81a54b,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 0ddc652..2e9146e 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 _0xdfe9=['rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xdfe9,0x6a));var _0x9dfe=function(_0x4986cf,_0x25005d){_0x4986cf=_0x4986cf-0x0;var _0x41afef=_0xdfe9[_0x4986cf];return _0x41afef;};'use strict';var _=require(_0x9dfe('0x0'));var util=require('util');var logger=require(_0x9dfe('0x1'))(_0x9dfe('0x2'));var moment=require(_0x9dfe('0x3'));var BPromise=require(_0x9dfe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9dfe('0x5'));var rimraf=require(_0x9dfe('0x6'));var config=require(_0x9dfe('0x7'));var attributes=require(_0x9dfe('0x8'));module[_0x9dfe('0x9')]=function(_0x23fa00,_0x2130ac){return _0x23fa00['define'](_0x9dfe('0xa'),attributes,{'tableName':_0x9dfe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9dfe('0xc'),'collate':_0x9dfe('0xd')});};
\ No newline at end of file
+var _0x2dd1=['./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x446f48,_0x22f9ac){var _0x5ef460=function(_0x4a9b80){while(--_0x4a9b80){_0x446f48['push'](_0x446f48['shift']());}};_0x5ef460(++_0x22f9ac);}(_0x2dd1,0x18c));var _0x12dd=function(_0xe011f8,_0x5b7d7b){_0xe011f8=_0xe011f8-0x0;var _0xe95964=_0x2dd1[_0xe011f8];return _0xe95964;};'use strict';var _=require(_0x12dd('0x0'));var util=require(_0x12dd('0x1'));var logger=require(_0x12dd('0x2'))(_0x12dd('0x3'));var moment=require(_0x12dd('0x4'));var BPromise=require(_0x12dd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12dd('0x6'));var rimraf=require(_0x12dd('0x7'));var config=require(_0x12dd('0x8'));var attributes=require(_0x12dd('0x9'));module[_0x12dd('0xa')]=function(_0x42f4a0,_0x5bcb6e){return _0x42f4a0[_0x12dd('0xb')](_0x12dd('0xc'),attributes,{'tableName':_0x12dd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x12dd('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 782d849..2f4cc69 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(_0x5b214a,_0x4833fc){var _0x44ec2d=function(_0x4e823b){while(--_0x4e823b){_0x5b214a['push'](_0x5b214a['shift']());}};_0x44ec2d(++_0x4833fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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(_0x2569b0,_0x59c064){var _0x336a0b=function(_0x4727e7){while(--_0x4727e7){_0x2569b0['push'](_0x2569b0['shift']());}};_0x336a0b(++_0x59c064);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 171fb35..96707ef 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 _0x0f82=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','express','Router'];(function(_0x52a505,_0x5dec98){var _0x1fc95e=function(_0xdc7744){while(--_0xdc7744){_0x52a505['push'](_0x52a505['shift']());}};_0x1fc95e(++_0x5dec98);}(_0x0f82,0x16e));var _0x20f8=function(_0xf34bcf,_0x41d6be){_0xf34bcf=_0xf34bcf-0x0;var _0x2b733b=_0x0f82[_0xf34bcf];return _0x2b733b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x20f8('0x0'));var router=express[_0x20f8('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x20f8('0x2'));var interaction=require(_0x20f8('0x3'));var config=require(_0x20f8('0x4'));var controller=require(_0x20f8('0x5'));router[_0x20f8('0x6')]('/',auth[_0x20f8('0x7')](),controller[_0x20f8('0x8')]);router[_0x20f8('0x6')](_0x20f8('0x9'),auth[_0x20f8('0x7')](),controller[_0x20f8('0xa')]);router[_0x20f8('0xb')]('/',auth[_0x20f8('0x7')](),controller[_0x20f8('0xc')]);router[_0x20f8('0xd')](_0x20f8('0x9'),auth[_0x20f8('0x7')](),controller[_0x20f8('0xe')]);router['delete']('/:id',auth[_0x20f8('0x7')](),controller['destroy']);module[_0x20f8('0xf')]=router;
\ No newline at end of file
+var _0x6296=['update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./cannedAnswer.controller','index','get','post','isAuthenticated','create','put','/:id'];(function(_0x981f03,_0x4644dc){var _0x5af90a=function(_0x2196cb){while(--_0x2196cb){_0x981f03['push'](_0x981f03['shift']());}};_0x5af90a(++_0x4644dc);}(_0x6296,0xff));var _0x6629=function(_0x359894,_0x985b16){_0x359894=_0x359894-0x0;var _0x35b794=_0x6296[_0x359894];return _0x35b794;};'use strict';var multer=require(_0x6629('0x0'));var util=require(_0x6629('0x1'));var path=require(_0x6629('0x2'));var timeout=require(_0x6629('0x3'));var express=require('express');var router=express[_0x6629('0x4')]();var fs_extra=require(_0x6629('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6629('0x6'));var config=require('../../config/environment');var controller=require(_0x6629('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6629('0x8')]);router[_0x6629('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6629('0xa')]('/',auth[_0x6629('0xb')](),controller[_0x6629('0xc')]);router[_0x6629('0xd')](_0x6629('0xe'),auth[_0x6629('0xb')](),controller[_0x6629('0xf')]);router['delete'](_0x6629('0xe'),auth[_0x6629('0xb')](),controller[_0x6629('0x10')]);module[_0x6629('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 27af811..92b6ffd 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 _0x115a=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x17b913,_0x599f34){var _0x432717=function(_0x336292){while(--_0x336292){_0x17b913['push'](_0x17b913['shift']());}};_0x432717(++_0x599f34);}(_0x115a,0x91));var _0xa115=function(_0x5c9bec,_0x132415){_0x5c9bec=_0x5c9bec-0x0;var _0x401a6b=_0x115a[_0x5c9bec];return _0x401a6b;};'use strict';var Sequelize=require(_0xa115('0x0'));module[_0xa115('0x1')]={'calldate':{'type':Sequelize[_0xa115('0x2')],'allowNull':![],'defaultValue':_0xa115('0x3')},'clid':{'type':Sequelize[_0xa115('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xa115('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa115('0x4')]},'dstchannel':{'type':Sequelize[_0xa115('0x4')]},'lastapp':{'type':Sequelize[_0xa115('0x4')]},'lastdata':{'type':Sequelize[_0xa115('0x4')]},'duration':{'type':Sequelize[_0xa115('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa115('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xa115('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa115('0x4')]},'userfield':{'type':Sequelize[_0xa115('0x4')]},'uniqueid':{'type':Sequelize[_0xa115('0x4')]},'linkedid':{'type':Sequelize[_0xa115('0x4')]},'sequence':{'type':Sequelize[_0xa115('0x4')]},'peeraccount':{'type':Sequelize[_0xa115('0x4')]},'type':{'type':Sequelize[_0xa115('0x4')]},'tag':{'type':Sequelize[_0xa115('0x4')]}};
\ No newline at end of file
+var _0x7ec2=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x516309,_0x35a3ae){var _0x5a3abc=function(_0x4b5638){while(--_0x4b5638){_0x516309['push'](_0x516309['shift']());}};_0x5a3abc(++_0x35a3ae);}(_0x7ec2,0x15c));var _0x27ec=function(_0x4edc20,_0x4dffde){_0x4edc20=_0x4edc20-0x0;var _0xdd5847=_0x7ec2[_0x4edc20];return _0xdd5847;};'use strict';var Sequelize=require(_0x27ec('0x0'));module[_0x27ec('0x1')]={'calldate':{'type':Sequelize[_0x27ec('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x27ec('0x3')]},'src':{'type':Sequelize[_0x27ec('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x27ec('0x3')]},'channel':{'type':Sequelize[_0x27ec('0x3')]},'dstchannel':{'type':Sequelize[_0x27ec('0x3')]},'lastapp':{'type':Sequelize[_0x27ec('0x3')]},'lastdata':{'type':Sequelize[_0x27ec('0x3')]},'duration':{'type':Sequelize[_0x27ec('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x27ec('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x27ec('0x3')]},'amaflags':{'type':Sequelize[_0x27ec('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x27ec('0x3')]},'userfield':{'type':Sequelize[_0x27ec('0x3')]},'uniqueid':{'type':Sequelize[_0x27ec('0x3')]},'linkedid':{'type':Sequelize[_0x27ec('0x3')]},'sequence':{'type':Sequelize[_0x27ec('0x3')]},'peeraccount':{'type':Sequelize[_0x27ec('0x3')]},'type':{'type':Sequelize[_0x27ec('0x3')]},'tag':{'type':Sequelize[_0x27ec('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index a8c812b..3f11040 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 _0xbeea=['stack','name','index','map','Cdr','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','save','update','destroy','then','sendStatus'];(function(_0x483e3a,_0x568361){var _0x43fca9=function(_0x273d7e){while(--_0x273d7e){_0x483e3a['push'](_0x483e3a['shift']());}};_0x43fca9(++_0x568361);}(_0xbeea,0xb1));var _0xabee=function(_0x4459df,_0x536b55){_0x4459df=_0x4459df-0x0;var _0xb7e0f2=_0xbeea[_0x4459df];return _0xb7e0f2;};'use strict';var emlformat=require(_0xabee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabee('0x1'));var jsonpatch=require(_0xabee('0x2'));var rp=require(_0xabee('0x3'));var moment=require('moment');var BPromise=require(_0xabee('0x4'));var Mustache=require('mustache');var util=require(_0xabee('0x5'));var path=require(_0xabee('0x6'));var sox=require(_0xabee('0x7'));var csv=require(_0xabee('0x8'));var ejs=require(_0xabee('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xabee('0xa'));var crypto=require(_0xabee('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xabee('0xc'));var toCsv=require('to-csv');var querystring=require(_0xabee('0xd'));var Papa=require(_0xabee('0xe'));var Redis=require(_0xabee('0xf'));var authService=require(_0xabee('0x10'));var qs=require(_0xabee('0x11'));var as=require(_0xabee('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabee('0x13'))(_0xabee('0x14'));var utils=require(_0xabee('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xabee('0x16'));var db=require(_0xabee('0x17'))['db'];function respondWithStatusCode(_0x16d6a5,_0x49fb73){_0x49fb73=_0x49fb73||0xcc;return function(_0x5915a1){if(_0x5915a1){return _0x16d6a5['sendStatus'](_0x49fb73);}return _0x16d6a5['status'](_0x49fb73)['end']();};}function respondWithResult(_0x113c5c,_0x370a4e){_0x370a4e=_0x370a4e||0xc8;return function(_0x38ba29){if(_0x38ba29){return _0x113c5c[_0xabee('0x18')](_0x370a4e)[_0xabee('0x19')](_0x38ba29);}};}function respondWithFilteredResult(_0x5e94ff,_0x177670){return function(_0x2d85a4){if(_0x2d85a4){var _0x2f1107=typeof _0x177670[_0xabee('0x1a')]===_0xabee('0x1b')&&typeof _0x177670[_0xabee('0x1c')]===_0xabee('0x1b');var _0x5a9562=_0x2d85a4[_0xabee('0x1d')];var _0x112bb9=_0x2f1107?0x0:_0x177670[_0xabee('0x1a')];var _0x471b24=_0x2f1107?_0x2d85a4[_0xabee('0x1d')]:_0x177670[_0xabee('0x1a')]+_0x177670['limit'];var _0x47fa3f;if(_0x471b24>=_0x5a9562){_0x471b24=_0x5a9562;_0x47fa3f=0xc8;}else{_0x47fa3f=0xce;}_0x5e94ff[_0xabee('0x18')](_0x47fa3f);return _0x5e94ff['set']('Content-Range',_0x112bb9+'-'+_0x471b24+'/'+_0x5a9562)[_0xabee('0x19')](_0x2d85a4);}return null;};}function patchUpdates(_0x443301){return function(_0x3dd1ff){try{jsonpatch[_0xabee('0x1e')](_0x3dd1ff,_0x443301,!![]);}catch(_0x2b66f5){return BPromise['reject'](_0x2b66f5);}return _0x3dd1ff[_0xabee('0x1f')]();};}function saveUpdates(_0x54014d,_0x4f5501){return function(_0x4926d7){if(_0x4926d7){return _0x4926d7[_0xabee('0x20')](_0x54014d)['then'](function(_0x870569){return _0x870569;});}return null;};}function removeEntity(_0x2834e3,_0x520bc){return function(_0x15a36c){if(_0x15a36c){return _0x15a36c[_0xabee('0x21')]()[_0xabee('0x22')](function(){_0x2834e3[_0xabee('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdbbf57,_0xfc419d){return function(_0x42277e){if(!_0x42277e){_0xdbbf57[_0xabee('0x23')](0x194);}return _0x42277e;};}function handleError(_0x4ae65e,_0x2aa470){_0x2aa470=_0x2aa470||0x1f4;return function(_0x123d58){logger['error'](_0x123d58[_0xabee('0x24')]);if(_0x123d58[_0xabee('0x25')]){delete _0x123d58[_0xabee('0x25')];}_0x4ae65e[_0xabee('0x18')](_0x2aa470)['send'](_0x123d58);};}exports[_0xabee('0x26')]=function(_0x2b7464,_0x1b5aee){var _0x37e780={},_0x1c4f51={},_0x116e41={'count':0x0,'rows':[]};var _0x3df00d=_[_0xabee('0x27')](db[_0xabee('0x28')]['rawAttributes'],function(_0x2a2441){return{'name':_0x2a2441['fieldName'],'type':_0x2a2441[_0xabee('0x29')][_0xabee('0x2a')]};});_0x1c4f51[_0xabee('0x2b')]=_[_0xabee('0x27')](_0x3df00d,'name');_0x1c4f51[_0xabee('0x2c')]=_['keys'](_0x2b7464[_0xabee('0x2c')]);_0x1c4f51['filters']=_[_0xabee('0x2d')](_0x1c4f51['model'],_0x1c4f51['query']);_0x37e780[_0xabee('0x2e')]=_[_0xabee('0x2d')](_0x1c4f51[_0xabee('0x2b')],qs[_0xabee('0x2f')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x2f')]));_0x37e780[_0xabee('0x2e')]=_0x37e780[_0xabee('0x2e')]['length']?_0x37e780[_0xabee('0x2e')]:_0x1c4f51[_0xabee('0x2b')];if(!_0x2b7464[_0xabee('0x2c')][_0xabee('0x30')](_0xabee('0x31'))){_0x37e780[_0xabee('0x1c')]=qs[_0xabee('0x1c')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x1c')]);_0x37e780[_0xabee('0x1a')]=qs[_0xabee('0x1a')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x1a')]);}_0x37e780[_0xabee('0x32')]=qs[_0xabee('0x33')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x33')]);_0x37e780['where']=qs['filters'](_[_0xabee('0x34')](_0x2b7464[_0xabee('0x2c')],_0x1c4f51[_0xabee('0x35')]),_0x3df00d);if(_0x2b7464[_0xabee('0x2c')]['filter']){_0x37e780[_0xabee('0x36')]=_[_0xabee('0x37')](_0x37e780[_0xabee('0x36')],{'$or':_['map'](_0x3df00d,function(_0x1a48d5){if(_0x1a48d5['type']!==_0xabee('0x38')){var _0x879d31={};_0x879d31[_0x1a48d5[_0xabee('0x25')]]={'$like':'%'+_0x2b7464[_0xabee('0x2c')]['filter']+'%'};return _0x879d31;}})});}_0x37e780=_['merge']({},_0x37e780,_0x2b7464[_0xabee('0x39')]);var _0xb76b1d={'where':_0x37e780[_0xabee('0x36')]};return db[_0xabee('0x28')][_0xabee('0x1d')](_0xb76b1d)['then'](function(_0x229b00){_0x116e41[_0xabee('0x1d')]=_0x229b00;if(_0x2b7464['query'][_0xabee('0x3a')]){_0x37e780[_0xabee('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0xabee('0x3c')](_0x37e780);})[_0xabee('0x22')](function(_0x3f05ee){_0x116e41[_0xabee('0x3d')]=_0x3f05ee;return _0x116e41;})[_0xabee('0x22')](respondWithFilteredResult(_0x1b5aee,_0x37e780))[_0xabee('0x3e')](handleError(_0x1b5aee,null));};exports[_0xabee('0x3f')]=function(_0x4ee7e6,_0x36fc07){var _0x22fc91={'raw':!![],'where':{'id':_0x4ee7e6['params']['id']}},_0x206350={};_0x206350[_0xabee('0x2b')]=_[_0xabee('0x40')](db['Cdr'][_0xabee('0x41')]);_0x206350[_0xabee('0x2c')]=_['keys'](_0x4ee7e6[_0xabee('0x2c')]);_0x206350[_0xabee('0x35')]=_[_0xabee('0x2d')](_0x206350[_0xabee('0x2b')],_0x206350[_0xabee('0x2c')]);_0x22fc91[_0xabee('0x2e')]=_[_0xabee('0x2d')](_0x206350['model'],qs[_0xabee('0x2f')](_0x4ee7e6[_0xabee('0x2c')][_0xabee('0x2f')]));_0x22fc91['attributes']=_0x22fc91[_0xabee('0x2e')][_0xabee('0x42')]?_0x22fc91['attributes']:_0x206350['model'];if(_0x4ee7e6['query'][_0xabee('0x3a')]){_0x22fc91[_0xabee('0x3b')]=[{'all':!![]}];}_0x22fc91=_['merge']({},_0x22fc91,_0x4ee7e6['options']);return db[_0xabee('0x28')][_0xabee('0x43')](_0x22fc91)[_0xabee('0x22')](handleEntityNotFound(_0x36fc07,null))[_0xabee('0x22')](respondWithResult(_0x36fc07,null))[_0xabee('0x3e')](handleError(_0x36fc07,null));};exports[_0xabee('0x44')]=function(_0x430b08,_0x307d34){return db[_0xabee('0x28')][_0xabee('0x44')](_0x430b08[_0xabee('0x45')],{})[_0xabee('0x22')](respondWithResult(_0x307d34,0xc9))[_0xabee('0x3e')](handleError(_0x307d34,null));};exports[_0xabee('0x20')]=function(_0x3e277d,_0x252f60){if(_0x3e277d[_0xabee('0x45')]['id']){delete _0x3e277d[_0xabee('0x45')]['id'];}return db['Cdr'][_0xabee('0x43')]({'where':{'id':_0x3e277d[_0xabee('0x46')]['id']}})['then'](handleEntityNotFound(_0x252f60,null))['then'](saveUpdates(_0x3e277d[_0xabee('0x45')],null))[_0xabee('0x22')](respondWithResult(_0x252f60,null))[_0xabee('0x3e')](handleError(_0x252f60,null));};exports[_0xabee('0x21')]=function(_0xe2433f,_0x3d819a){return db[_0xabee('0x28')]['find']({'where':{'id':_0xe2433f[_0xabee('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d819a,null))[_0xabee('0x22')](removeEntity(_0x3d819a,null))[_0xabee('0x3e')](handleError(_0x3d819a,null));};exports['describe']=function(_0x3ebd50,_0x3aaf14){return db[_0xabee('0x28')]['describe']()[_0xabee('0x22')](respondWithResult(_0x3aaf14,null))['catch'](handleError(_0x3aaf14,null));};
\ No newline at end of file
+var _0x814b=['undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','Cdr','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x28e3c9,_0x598e15){var _0x1eb84b=function(_0x2c38f4){while(--_0x2c38f4){_0x28e3c9['push'](_0x28e3c9['shift']());}};_0x1eb84b(++_0x598e15);}(_0x814b,0x1a2));var _0xb814=function(_0x115d5b,_0x26aff2){_0x115d5b=_0x115d5b-0x0;var _0x6cfc50=_0x814b[_0x115d5b];return _0x6cfc50;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['Cdr'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['create']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')](_0x338e80[_0xb814('0x49')],{})[_0xb814('0x28')](respondWithResult(_0x55234d,0xc9))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x2cc806,_0x45480e){if(_0x2cc806[_0xb814('0x49')]['id']){delete _0x2cc806[_0xb814('0x49')]['id'];}return db['Cdr']['find']({'where':{'id':_0x2cc806[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45480e,null))[_0xb814('0x28')](saveUpdates(_0x2cc806[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x45480e,null))[_0xb814('0x45')](handleError(_0x45480e,null));};exports[_0xb814('0x29')]=function(_0x4a4f9a,_0x26fd0b){return db[_0xb814('0x41')][_0xb814('0x47')]({'where':{'id':_0x4a4f9a['params']['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x26fd0b,null))['then'](removeEntity(_0x26fd0b,null))[_0xb814('0x45')](handleError(_0x26fd0b,null));};exports['describe']=function(_0x403872,_0x3cf8f8){return db['Cdr'][_0xb814('0x4a')]()[_0xb814('0x28')](respondWithResult(_0x3cf8f8,null))[_0xb814('0x45')](handleError(_0x3cf8f8,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index ca5b536..c78b7c1 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1dd7eb,_0x13b76a){var _0x3e6f1b=function(_0x2b5079){while(--_0x2b5079){_0x1dd7eb['push'](_0x1dd7eb['shift']());}};_0x3e6f1b(++_0x13b76a);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x270e1a,_0x2fd54c){var _0x389968=function(_0x9ef776){while(--_0x9ef776){_0x270e1a['push'](_0x270e1a['shift']());}};_0x389968(++_0x2fd54c);}(_0x7a54,0x106));var _0x47a5=function(_0x5465f3,_0x3c8f6a){_0x5465f3=_0x5465f3-0x0;var _0x2f959c=_0x7a54[_0x5465f3];return _0x2f959c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 824f198..ab39463 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 _0x9a7e=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9a7e,0x121));var _0xe9a7=function(_0x44c57e,_0xc00d2f){_0x44c57e=_0x44c57e-0x0;var _0x44d5aa=_0x9a7e[_0x44c57e];return _0x44d5aa;};'use strict';var _=require(_0xe9a7('0x0'));var util=require(_0xe9a7('0x1'));var moment=require(_0xe9a7('0x2'));var BPromise=require(_0xe9a7('0x3'));var rs=require(_0xe9a7('0x4'));var fs=require('fs');var Redis=require(_0xe9a7('0x5'));var db=require(_0xe9a7('0x6'))['db'];var utils=require(_0xe9a7('0x7'));var logger=require(_0xe9a7('0x8'))(_0xe9a7('0x9'));var config=require(_0xe9a7('0xa'));var jayson=require(_0xe9a7('0xb'));var client=jayson['client'][_0xe9a7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3793c9,_0xfcd3b9,_0x46068b){return new BPromise(function(_0x3361cc,_0x26ee89){return client[_0xe9a7('0xd')](_0x3793c9,_0x46068b)[_0xe9a7('0xe')](function(_0xfbf10a){logger[_0xe9a7('0xf')](_0xe9a7('0x10'),_0xfcd3b9,_0xe9a7('0x11'));logger[_0xe9a7('0x12')]('Cdr,\x20%s,\x20%s,\x20%s',_0xfcd3b9,_0xe9a7('0x11'),JSON[_0xe9a7('0x13')](_0xfbf10a));if(_0xfbf10a[_0xe9a7('0x14')]){if(_0xfbf10a['error']['code']===0x1f4){logger['error'](_0xe9a7('0x10'),_0xfcd3b9,_0xfbf10a[_0xe9a7('0x14')][_0xe9a7('0x15')]);return _0x26ee89(_0xfbf10a[_0xe9a7('0x14')]['message']);}logger[_0xe9a7('0x14')](_0xe9a7('0x10'),_0xfcd3b9,_0xfbf10a[_0xe9a7('0x14')]['message']);return _0x3361cc(_0xfbf10a[_0xe9a7('0x14')][_0xe9a7('0x15')]);}else{logger['info'](_0xe9a7('0x10'),_0xfcd3b9,_0xe9a7('0x11'));_0x3361cc(_0xfbf10a[_0xe9a7('0x16')][_0xe9a7('0x15')]);}})[_0xe9a7('0x17')](function(_0x513c46){logger[_0xe9a7('0x14')](_0xe9a7('0x10'),_0xfcd3b9,_0x513c46);_0x26ee89(_0x513c46);});});}
\ No newline at end of file
+var _0x8a8f=['error','code','Cdr,\x20%s,\x20%s','request\x20sent','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x8a8f,0xc2));var _0xf8a8=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x8a8f[_0x580647];return _0x5f0792;};'use strict';var _=require(_0xf8a8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf8a8('0x1'));var rs=require(_0xf8a8('0x2'));var fs=require('fs');var Redis=require(_0xf8a8('0x3'));var db=require(_0xf8a8('0x4'))['db'];var utils=require(_0xf8a8('0x5'));var logger=require(_0xf8a8('0x6'))('rpc');var config=require(_0xf8a8('0x7'));var jayson=require(_0xf8a8('0x8'));var client=jayson[_0xf8a8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x440236,_0x1729ec,_0x5d106a){return new BPromise(function(_0x4760cd,_0xe058e6){return client[_0xf8a8('0xa')](_0x440236,_0x5d106a)[_0xf8a8('0xb')](function(_0x2e9116){logger[_0xf8a8('0xc')]('Cdr,\x20%s,\x20%s',_0x1729ec,'request\x20sent');logger[_0xf8a8('0xd')](_0xf8a8('0xe'),_0x1729ec,'request\x20sent',JSON[_0xf8a8('0xf')](_0x2e9116));if(_0x2e9116[_0xf8a8('0x10')]){if(_0x2e9116[_0xf8a8('0x10')][_0xf8a8('0x11')]===0x1f4){logger[_0xf8a8('0x10')](_0xf8a8('0x12'),_0x1729ec,_0x2e9116['error']['message']);return _0xe058e6(_0x2e9116[_0xf8a8('0x10')]['message']);}logger[_0xf8a8('0x10')](_0xf8a8('0x12'),_0x1729ec,_0x2e9116[_0xf8a8('0x10')]['message']);return _0x4760cd(_0x2e9116[_0xf8a8('0x10')]['message']);}else{logger[_0xf8a8('0xc')](_0xf8a8('0x12'),_0x1729ec,_0xf8a8('0x13'));_0x4760cd(_0x2e9116[_0xf8a8('0x14')]['message']);}})['catch'](function(_0x1c3eef){logger[_0xf8a8('0x10')](_0xf8a8('0x12'),_0x1729ec,_0x1c3eef);_0xe058e6(_0x1c3eef);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 25444b4..e9978a2 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4e41d0,_0x5e1e9c){var _0x338498=function(_0x47e31f){while(--_0x47e31f){_0x4e41d0['push'](_0x4e41d0['shift']());}};_0x338498(++_0x5e1e9c);}(_0xb10b,0x12a));var _0xbb10=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xb10b[_0x5cb1af];return _0x8d7940;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x33bf01,_0x1898f9){var _0x1d1cd2=function(_0x21dbc1){while(--_0x21dbc1){_0x33bf01['push'](_0x33bf01['shift']());}};_0x1d1cd2(++_0x1898f9);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 1b2220b..9d6c7b3 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 _0xdc06=['STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x168ad0,_0x45e98b){var _0x3596fc=function(_0x388510){while(--_0x388510){_0x168ad0['push'](_0x168ad0['shift']());}};_0x3596fc(++_0x45e98b);}(_0xdc06,0x112));var _0x6dc0=function(_0x19c1ca,_0x45d439){_0x19c1ca=_0x19c1ca-0x0;var _0x2c620f=_0xdc06[_0x19c1ca];return _0x2c620f;};'use strict';var Sequelize=require('sequelize');module[_0x6dc0('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6dc0('0x1')],'allowNull':![],'defaultValue':_0x6dc0('0x2')},'appdata':{'type':Sequelize[_0x6dc0('0x3')]()},'description':{'type':Sequelize[_0x6dc0('0x1')]},'interval':{'type':Sequelize[_0x6dc0('0x1')],'defaultValue':_0x6dc0('0x4')}};
\ No newline at end of file
+var _0xe032=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x152aa1,_0x307718){var _0x1bc01a=function(_0xd3211e){while(--_0xd3211e){_0x152aa1['push'](_0x152aa1['shift']());}};_0x1bc01a(++_0x307718);}(_0xe032,0x6a));var _0x2e03=function(_0x214d54,_0x133c72){_0x214d54=_0x214d54-0x0;var _0x44ca46=_0xe032[_0x214d54];return _0x44ca46;};'use strict';var Sequelize=require(_0x2e03('0x0'));module[_0x2e03('0x1')]={'priority':{'type':Sequelize[_0x2e03('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2e03('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2e03('0x4')]()},'description':{'type':Sequelize[_0x2e03('0x3')]},'interval':{'type':Sequelize[_0x2e03('0x3')],'defaultValue':_0x2e03('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 025cc91..b089d0b 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 _0x3f19=['send','show','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','includeAll','include','merge','options','find','then','body','params','catch','eml-format','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','stack','name'];(function(_0x21a188,_0x463d5f){var _0xa30c59=function(_0x3807c5){while(--_0x3807c5){_0x21a188['push'](_0x21a188['shift']());}};_0xa30c59(++_0x463d5f);}(_0x3f19,0xc0));var _0x93f1=function(_0x322652,_0x5a85c0){_0x322652=_0x322652-0x0;var _0x5d5e88=_0x3f19[_0x322652];return _0x5d5e88;};'use strict';var emlformat=require(_0x93f1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x93f1('0x1'));var moment=require('moment');var BPromise=require(_0x93f1('0x2'));var Mustache=require(_0x93f1('0x3'));var util=require(_0x93f1('0x4'));var path=require(_0x93f1('0x5'));var sox=require('sox');var csv=require(_0x93f1('0x6'));var ejs=require(_0x93f1('0x7'));var fs=require('fs');var fs_extra=require(_0x93f1('0x8'));var _=require(_0x93f1('0x9'));var squel=require(_0x93f1('0xa'));var crypto=require(_0x93f1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x93f1('0xc'));var toCsv=require(_0x93f1('0x6'));var querystring=require(_0x93f1('0xd'));var Papa=require(_0x93f1('0xe'));var Redis=require(_0x93f1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x93f1('0x10'));var as=require(_0x93f1('0x11'));var hardwareService=require(_0x93f1('0x12'));var logger=require(_0x93f1('0x13'))(_0x93f1('0x14'));var utils=require(_0x93f1('0x15'));var config=require(_0x93f1('0x16'));var licenseUtil=require(_0x93f1('0x17'));var db=require(_0x93f1('0x18'))['db'];function respondWithStatusCode(_0x3348ab,_0x5b4aa3){_0x5b4aa3=_0x5b4aa3||0xcc;return function(_0x4080a8){if(_0x4080a8){return _0x3348ab[_0x93f1('0x19')](_0x5b4aa3);}return _0x3348ab[_0x93f1('0x1a')](_0x5b4aa3)[_0x93f1('0x1b')]();};}function respondWithResult(_0x552ae6,_0x391deb){_0x391deb=_0x391deb||0xc8;return function(_0x49f4c8){if(_0x49f4c8){return _0x552ae6[_0x93f1('0x1a')](_0x391deb)[_0x93f1('0x1c')](_0x49f4c8);}};}function respondWithFilteredResult(_0x176cf2,_0x43b0bc){return function(_0x120c83){if(_0x120c83){var _0x48e0a1=typeof _0x43b0bc[_0x93f1('0x1d')]===_0x93f1('0x1e')&&typeof _0x43b0bc[_0x93f1('0x1f')]===_0x93f1('0x1e');var _0x2ed400=_0x120c83[_0x93f1('0x20')];var _0xaed1b5=_0x48e0a1?0x0:_0x43b0bc[_0x93f1('0x1d')];var _0x15c213=_0x48e0a1?_0x120c83[_0x93f1('0x20')]:_0x43b0bc[_0x93f1('0x1d')]+_0x43b0bc['limit'];var _0x54880e;if(_0x15c213>=_0x2ed400){_0x15c213=_0x2ed400;_0x54880e=0xc8;}else{_0x54880e=0xce;}_0x176cf2['status'](_0x54880e);return _0x176cf2[_0x93f1('0x21')]('Content-Range',_0xaed1b5+'-'+_0x15c213+'/'+_0x2ed400)[_0x93f1('0x1c')](_0x120c83);}return null;};}function patchUpdates(_0x39ae13){return function(_0x3795b8){try{jsonpatch[_0x93f1('0x22')](_0x3795b8,_0x39ae13,!![]);}catch(_0x595943){return BPromise[_0x93f1('0x23')](_0x595943);}return _0x3795b8['save']();};}function saveUpdates(_0xe7cea3,_0x310e76){return function(_0x4b26bb){if(_0x4b26bb){return _0x4b26bb[_0x93f1('0x24')](_0xe7cea3)['then'](function(_0x578ccc){return _0x578ccc;});}return null;};}function removeEntity(_0x14313d,_0x2b2115){return function(_0x5c30a5){if(_0x5c30a5){return _0x5c30a5[_0x93f1('0x25')]()['then'](function(){_0x14313d[_0x93f1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5272ba,_0x2972cd){return function(_0x9ed8af){if(!_0x9ed8af){_0x5272ba[_0x93f1('0x19')](0x194);}return _0x9ed8af;};}function handleError(_0x46719c,_0x2e9444){_0x2e9444=_0x2e9444||0x1f4;return function(_0x3e8f2f){logger['error'](_0x3e8f2f[_0x93f1('0x26')]);if(_0x3e8f2f['name']){delete _0x3e8f2f[_0x93f1('0x27')];}_0x46719c[_0x93f1('0x1a')](_0x2e9444)[_0x93f1('0x28')](_0x3e8f2f);};}exports[_0x93f1('0x29')]=function(_0x29ec13,_0x27efcf){var _0x2e6661={'raw':!![],'where':{'id':_0x29ec13['params']['id']}},_0x35a2d5={};_0x35a2d5[_0x93f1('0x2a')]=_[_0x93f1('0x2b')](db[_0x93f1('0x2c')][_0x93f1('0x2d')]);_0x35a2d5['query']=_[_0x93f1('0x2b')](_0x29ec13[_0x93f1('0x2e')]);_0x35a2d5['filters']=_[_0x93f1('0x2f')](_0x35a2d5[_0x93f1('0x2a')],_0x35a2d5['query']);_0x2e6661['attributes']=_[_0x93f1('0x2f')](_0x35a2d5['model'],qs['fields'](_0x29ec13['query']['fields']));_0x2e6661[_0x93f1('0x30')]=_0x2e6661[_0x93f1('0x30')]['length']?_0x2e6661[_0x93f1('0x30')]:_0x35a2d5[_0x93f1('0x2a')];if(_0x29ec13[_0x93f1('0x2e')][_0x93f1('0x31')]){_0x2e6661[_0x93f1('0x32')]=[{'all':!![]}];}_0x2e6661=_[_0x93f1('0x33')]({},_0x2e6661,_0x29ec13[_0x93f1('0x34')]);return db[_0x93f1('0x2c')][_0x93f1('0x35')](_0x2e6661)[_0x93f1('0x36')](handleEntityNotFound(_0x27efcf,null))[_0x93f1('0x36')](respondWithResult(_0x27efcf,null))['catch'](handleError(_0x27efcf,null));};exports['update']=function(_0x35f23c,_0x22e526){if(_0x35f23c[_0x93f1('0x37')]['id']){delete _0x35f23c[_0x93f1('0x37')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x35f23c[_0x93f1('0x38')]['id']}})[_0x93f1('0x36')](handleEntityNotFound(_0x22e526,null))['then'](saveUpdates(_0x35f23c[_0x93f1('0x37')],null))[_0x93f1('0x36')](respondWithResult(_0x22e526,null))[_0x93f1('0x39')](handleError(_0x22e526,null));};exports[_0x93f1('0x25')]=function(_0x422336,_0xb5696e){return db[_0x93f1('0x2c')][_0x93f1('0x35')]({'where':{'id':_0x422336[_0x93f1('0x38')]['id']}})[_0x93f1('0x36')](handleEntityNotFound(_0xb5696e,null))['then'](removeEntity(_0xb5696e,null))['catch'](handleError(_0xb5696e,null));};
\ No newline at end of file
+var _0xeb74=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','show','params','keys','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','merge','options','ChatApplication','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x30cc4b,_0x2cf083){var _0x4f1539=function(_0x252045){while(--_0x252045){_0x30cc4b['push'](_0x30cc4b['shift']());}};_0x4f1539(++_0x2cf083);}(_0xeb74,0xe3));var _0x4eb7=function(_0x24699d,_0x59b9c9){_0x24699d=_0x24699d-0x0;var _0x579d4e=_0xeb74[_0x24699d];return _0x579d4e;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];function respondWithStatusCode(_0x35fa89,_0x4194e1){_0x4194e1=_0x4194e1||0xcc;return function(_0x3c9f45){if(_0x3c9f45){return _0x35fa89['sendStatus'](_0x4194e1);}return _0x35fa89['status'](_0x4194e1)['end']();};}function respondWithResult(_0x17fb81,_0x51f09d){_0x51f09d=_0x51f09d||0xc8;return function(_0x84c68b){if(_0x84c68b){return _0x17fb81[_0x4eb7('0x19')](_0x51f09d)[_0x4eb7('0x1a')](_0x84c68b);}};}function respondWithFilteredResult(_0x1c4a97,_0x5d6d5){return function(_0x21433d){if(_0x21433d){var _0x11674f=typeof _0x5d6d5[_0x4eb7('0x1b')]===_0x4eb7('0x1c')&&typeof _0x5d6d5[_0x4eb7('0x1d')]==='undefined';var _0xb86bc9=_0x21433d[_0x4eb7('0x1e')];var _0x3b6d41=_0x11674f?0x0:_0x5d6d5[_0x4eb7('0x1b')];var _0x302e16=_0x11674f?_0x21433d[_0x4eb7('0x1e')]:_0x5d6d5[_0x4eb7('0x1b')]+_0x5d6d5[_0x4eb7('0x1d')];var _0x5f4780;if(_0x302e16>=_0xb86bc9){_0x302e16=_0xb86bc9;_0x5f4780=0xc8;}else{_0x5f4780=0xce;}_0x1c4a97[_0x4eb7('0x19')](_0x5f4780);return _0x1c4a97[_0x4eb7('0x1f')](_0x4eb7('0x20'),_0x3b6d41+'-'+_0x302e16+'/'+_0xb86bc9)[_0x4eb7('0x1a')](_0x21433d);}return null;};}function patchUpdates(_0x32f0f5){return function(_0x2efd67){try{jsonpatch[_0x4eb7('0x21')](_0x2efd67,_0x32f0f5,!![]);}catch(_0x4ddbe4){return BPromise[_0x4eb7('0x22')](_0x4ddbe4);}return _0x2efd67[_0x4eb7('0x23')]();};}function saveUpdates(_0x4783b1,_0x164515){return function(_0x14a7be){if(_0x14a7be){return _0x14a7be[_0x4eb7('0x24')](_0x4783b1)[_0x4eb7('0x25')](function(_0x2df1b1){return _0x2df1b1;});}return null;};}function removeEntity(_0x1a2b8b,_0x13e871){return function(_0x4de2d9){if(_0x4de2d9){return _0x4de2d9[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x1a2b8b[_0x4eb7('0x19')](0xcc)[_0x4eb7('0x27')]();});}};}function handleEntityNotFound(_0x3e0da2,_0x25eb74){return function(_0x365060){if(!_0x365060){_0x3e0da2[_0x4eb7('0x28')](0x194);}return _0x365060;};}function handleError(_0x80b804,_0x248759){_0x248759=_0x248759||0x1f4;return function(_0xf83c11){logger[_0x4eb7('0x29')](_0xf83c11[_0x4eb7('0x2a')]);if(_0xf83c11[_0x4eb7('0x2b')]){delete _0xf83c11[_0x4eb7('0x2b')];}_0x80b804[_0x4eb7('0x19')](_0x248759)[_0x4eb7('0x2c')](_0xf83c11);};}exports[_0x4eb7('0x2d')]=function(_0x33a2c1,_0x28fda8){var _0x114c68={'raw':!![],'where':{'id':_0x33a2c1[_0x4eb7('0x2e')]['id']}},_0x17030a={};_0x17030a['model']=_[_0x4eb7('0x2f')](db['ChatApplication'][_0x4eb7('0x30')]);_0x17030a[_0x4eb7('0x31')]=_[_0x4eb7('0x2f')](_0x33a2c1[_0x4eb7('0x31')]);_0x17030a[_0x4eb7('0x32')]=_[_0x4eb7('0x33')](_0x17030a[_0x4eb7('0x34')],_0x17030a[_0x4eb7('0x31')]);_0x114c68[_0x4eb7('0x35')]=_['intersection'](_0x17030a[_0x4eb7('0x34')],qs['fields'](_0x33a2c1[_0x4eb7('0x31')][_0x4eb7('0x36')]));_0x114c68['attributes']=_0x114c68['attributes'][_0x4eb7('0x37')]?_0x114c68[_0x4eb7('0x35')]:_0x17030a[_0x4eb7('0x34')];if(_0x33a2c1[_0x4eb7('0x31')]['includeAll']){_0x114c68[_0x4eb7('0x38')]=[{'all':!![]}];}_0x114c68=_[_0x4eb7('0x39')]({},_0x114c68,_0x33a2c1[_0x4eb7('0x3a')]);return db[_0x4eb7('0x3b')][_0x4eb7('0x3c')](_0x114c68)['then'](handleEntityNotFound(_0x28fda8,null))[_0x4eb7('0x25')](respondWithResult(_0x28fda8,null))[_0x4eb7('0x3d')](handleError(_0x28fda8,null));};exports[_0x4eb7('0x24')]=function(_0x59d70a,_0x115642){if(_0x59d70a[_0x4eb7('0x3e')]['id']){delete _0x59d70a[_0x4eb7('0x3e')]['id'];}return db['ChatApplication'][_0x4eb7('0x3c')]({'where':{'id':_0x59d70a['params']['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x115642,null))[_0x4eb7('0x25')](saveUpdates(_0x59d70a[_0x4eb7('0x3e')],null))[_0x4eb7('0x25')](respondWithResult(_0x115642,null))['catch'](handleError(_0x115642,null));};exports[_0x4eb7('0x26')]=function(_0xfd2721,_0x9c44e9){return db[_0x4eb7('0x3b')]['find']({'where':{'id':_0xfd2721['params']['id']}})['then'](handleEntityNotFound(_0x9c44e9,null))[_0x4eb7('0x25')](removeEntity(_0x9c44e9,null))[_0x4eb7('0x3d')](handleError(_0x9c44e9,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index d409022..0c375f1 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 _0xbb7c=['ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x86c0ae,_0x402578){var _0x28bea5=function(_0x4359a2){while(--_0x4359a2){_0x86c0ae['push'](_0x86c0ae['shift']());}};_0x28bea5(++_0x402578);}(_0xbb7c,0x17a));var _0xcbb7=function(_0x3851a5,_0x5bd024){_0x3851a5=_0x3851a5-0x0;var _0x733106=_0xbb7c[_0x3851a5];return _0x733106;};'use strict';var _=require(_0xcbb7('0x0'));var util=require(_0xcbb7('0x1'));var logger=require(_0xcbb7('0x2'))(_0xcbb7('0x3'));var moment=require(_0xcbb7('0x4'));var BPromise=require(_0xcbb7('0x5'));var rp=require(_0xcbb7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbb7('0x7'));var config=require(_0xcbb7('0x8'));var attributes=require(_0xcbb7('0x9'));module[_0xcbb7('0xa')]=function(_0x397075,_0x3824f5){return _0x397075[_0xcbb7('0xb')](_0xcbb7('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcbb7('0xd'),'collate':_0xcbb7('0xe')});};
\ No newline at end of file
+var _0xe4c7=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x238ce5,_0x36d4a4){var _0x5d6469=function(_0x206b98){while(--_0x206b98){_0x238ce5['push'](_0x238ce5['shift']());}};_0x5d6469(++_0x36d4a4);}(_0xe4c7,0x1d2));var _0x7e4c=function(_0x115f14,_0x1242e8){_0x115f14=_0x115f14-0x0;var _0x1785ee=_0xe4c7[_0x115f14];return _0x1785ee;};'use strict';var _=require(_0x7e4c('0x0'));var util=require(_0x7e4c('0x1'));var logger=require(_0x7e4c('0x2'))(_0x7e4c('0x3'));var moment=require(_0x7e4c('0x4'));var BPromise=require(_0x7e4c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e4c('0x6'));var rimraf=require(_0x7e4c('0x7'));var config=require(_0x7e4c('0x8'));var attributes=require('./chatApplication.attributes');module[_0x7e4c('0x9')]=function(_0x305963,_0x40b497){return _0x305963['define']('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7e4c('0xa'),'collate':_0x7e4c('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index d516fa1..e819123 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 _0x29ad=['info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x34bf85,_0x26b2f5){var _0x438e25=function(_0x1df525){while(--_0x1df525){_0x34bf85['push'](_0x34bf85['shift']());}};_0x438e25(++_0x26b2f5);}(_0x29ad,0x128));var _0xd29a=function(_0x133b08,_0x3a7aaf){_0x133b08=_0x133b08-0x0;var _0x967196=_0x29ad[_0x133b08];return _0x967196;};'use strict';var _=require(_0xd29a('0x0'));var util=require(_0xd29a('0x1'));var moment=require(_0xd29a('0x2'));var BPromise=require(_0xd29a('0x3'));var rs=require(_0xd29a('0x4'));var fs=require('fs');var Redis=require(_0xd29a('0x5'));var db=require(_0xd29a('0x6'))['db'];var utils=require(_0xd29a('0x7'));var logger=require(_0xd29a('0x8'))(_0xd29a('0x9'));var config=require(_0xd29a('0xa'));var jayson=require(_0xd29a('0xb'));var client=jayson[_0xd29a('0xc')][_0xd29a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5b4ee4,_0x31c9c2,_0x391e68){return new BPromise(function(_0x2bd10e,_0x3d9bc2){return client[_0xd29a('0xe')](_0x5b4ee4,_0x391e68)[_0xd29a('0xf')](function(_0x184538){logger[_0xd29a('0x10')]('ChatApplication,\x20%s,\x20%s',_0x31c9c2,_0xd29a('0x11'));logger[_0xd29a('0x12')](_0xd29a('0x13'),_0x31c9c2,_0xd29a('0x11'),JSON[_0xd29a('0x14')](_0x184538));if(_0x184538[_0xd29a('0x15')]){if(_0x184538['error']['code']===0x1f4){logger[_0xd29a('0x15')](_0xd29a('0x16'),_0x31c9c2,_0x184538[_0xd29a('0x15')]['message']);return _0x3d9bc2(_0x184538[_0xd29a('0x15')]['message']);}logger[_0xd29a('0x15')](_0xd29a('0x16'),_0x31c9c2,_0x184538[_0xd29a('0x15')][_0xd29a('0x17')]);return _0x2bd10e(_0x184538[_0xd29a('0x15')][_0xd29a('0x17')]);}else{logger[_0xd29a('0x10')](_0xd29a('0x16'),_0x31c9c2,_0xd29a('0x11'));_0x2bd10e(_0x184538[_0xd29a('0x18')][_0xd29a('0x17')]);}})[_0xd29a('0x19')](function(_0x26a163){logger[_0xd29a('0x15')]('ChatApplication,\x20%s,\x20%s',_0x31c9c2,_0x26a163);_0x3d9bc2(_0x26a163);});});}
\ No newline at end of file
+var _0x22fc=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x22fc,0x99));var _0xc22f=function(_0x4f6883,_0x5130fd){_0x4f6883=_0x4f6883-0x0;var _0x13dba6=_0x22fc[_0x4f6883];return _0x13dba6;};'use strict';var _=require(_0xc22f('0x0'));var util=require(_0xc22f('0x1'));var moment=require(_0xc22f('0x2'));var BPromise=require('bluebird');var rs=require(_0xc22f('0x3'));var fs=require('fs');var Redis=require(_0xc22f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc22f('0x5'));var logger=require(_0xc22f('0x6'))('rpc');var config=require(_0xc22f('0x7'));var jayson=require(_0xc22f('0x8'));var client=jayson[_0xc22f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x367e52,_0x1dc7a4,_0x1faae9){return new BPromise(function(_0xe68a0b,_0x53581b){return client[_0xc22f('0xa')](_0x367e52,_0x1faae9)[_0xc22f('0xb')](function(_0x53cce8){logger[_0xc22f('0xc')](_0xc22f('0xd'),_0x1dc7a4,'request\x20sent');logger[_0xc22f('0xe')](_0xc22f('0xf'),_0x1dc7a4,_0xc22f('0x10'),JSON['stringify'](_0x53cce8));if(_0x53cce8[_0xc22f('0x11')]){if(_0x53cce8[_0xc22f('0x11')][_0xc22f('0x12')]===0x1f4){logger[_0xc22f('0x11')](_0xc22f('0xd'),_0x1dc7a4,_0x53cce8[_0xc22f('0x11')][_0xc22f('0x13')]);return _0x53581b(_0x53cce8[_0xc22f('0x11')][_0xc22f('0x13')]);}logger[_0xc22f('0x11')]('ChatApplication,\x20%s,\x20%s',_0x1dc7a4,_0x53cce8[_0xc22f('0x11')][_0xc22f('0x13')]);return _0xe68a0b(_0x53cce8[_0xc22f('0x11')]['message']);}else{logger[_0xc22f('0xc')](_0xc22f('0xd'),_0x1dc7a4,_0xc22f('0x10'));_0xe68a0b(_0x53cce8[_0xc22f('0x14')]['message']);}})[_0xc22f('0x15')](function(_0x3e7810){logger['error'](_0xc22f('0xd'),_0x1dc7a4,_0x3e7810);_0x53581b(_0x3e7810);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 0d55029..e0de3a9 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 _0xeb7d=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x36bfe3,_0x358938){var _0x9b0436=function(_0x86e47d){while(--_0x86e47d){_0x36bfe3['push'](_0x36bfe3['shift']());}};_0x9b0436(++_0x358938);}(_0xeb7d,0x158));var _0xdeb7=function(_0x1de94d,_0x30499c){_0x1de94d=_0x1de94d-0x0;var _0x507fed=_0xeb7d[_0x1de94d];return _0x507fed;};'use strict';var multer=require(_0xdeb7('0x0'));var util=require('util');var path=require(_0xdeb7('0x1'));var timeout=require(_0xdeb7('0x2'));var express=require(_0xdeb7('0x3'));var router=express[_0xdeb7('0x4')]();var fs_extra=require(_0xdeb7('0x5'));var auth=require(_0xdeb7('0x6'));var interaction=require(_0xdeb7('0x7'));var config=require(_0xdeb7('0x8'));var controller=require(_0xdeb7('0x9'));router[_0xdeb7('0xa')](_0xdeb7('0xb'),auth[_0xdeb7('0xc')](),controller[_0xdeb7('0xd')]);router[_0xdeb7('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xdeb7('0xf')]);router[_0xdeb7('0x10')]('/:id',auth[_0xdeb7('0xc')](),controller[_0xdeb7('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x00e4=['/:id','update','delete','destroy','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','isAuthenticated','show'];(function(_0x12094a,_0x36505c){var _0x24a900=function(_0x45e4ec){while(--_0x45e4ec){_0x12094a['push'](_0x12094a['shift']());}};_0x24a900(++_0x36505c);}(_0x00e4,0xbb));var _0x400e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x00e4[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0x400e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x400e('0x1'));var router=express['Router']();var fs_extra=require(_0x400e('0x2'));var auth=require(_0x400e('0x3'));var interaction=require(_0x400e('0x4'));var config=require(_0x400e('0x5'));var controller=require(_0x400e('0x6'));router['get']('/:id',auth[_0x400e('0x7')](),controller[_0x400e('0x8')]);router['put'](_0x400e('0x9'),auth[_0x400e('0x7')](),controller[_0x400e('0xa')]);router[_0x400e('0xb')](_0x400e('0x9'),auth[_0x400e('0x7')](),controller[_0x400e('0xc')]);module[_0x400e('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 6a78488..d7a7181 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 _0xb101=['BOOLEAN','STRING'];(function(_0x3c7bf8,_0x1242a4){var _0x52eeb8=function(_0x24e1b1){while(--_0x24e1b1){_0x3c7bf8['push'](_0x3c7bf8['shift']());}};_0x52eeb8(++_0x1242a4);}(_0xb101,0x75));var _0x1b10=function(_0x1c778e,_0x30077a){_0x1c778e=_0x1c778e-0x0;var _0x54c6fd=_0xb101[_0x1c778e];return _0x54c6fd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1b10('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x1b10('0x1')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x67d1=['BOOLEAN','exports','STRING'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x67d1,0xf1));var _0x167d=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x67d1[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require('sequelize');module[_0x167d('0x0')]={'name':{'type':Sequelize[_0x167d('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x167d('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 3272694..a872d23 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 _0x3cd1=['catch','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','User','getMembers','nolimit','removeMembers','ChatGroupId','getMessages','findOne','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','end','json','offset','undefined','limit','count','status','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','includeAll','include','findAll','show','params','keys','find','create','body'];(function(_0xfea32e,_0x4b012f){var _0x210cf3=function(_0x5848cb){while(--_0x5848cb){_0xfea32e['push'](_0xfea32e['shift']());}};_0x210cf3(++_0x4b012f);}(_0x3cd1,0x19a));var _0x13cd=function(_0x28b4ca,_0xd1069e){_0x28b4ca=_0x28b4ca-0x0;var _0x204e5b=_0x3cd1[_0x28b4ca];return _0x204e5b;};'use strict';var emlformat=require(_0x13cd('0x0'));var rimraf=require(_0x13cd('0x1'));var zipdir=require(_0x13cd('0x2'));var jsonpatch=require(_0x13cd('0x3'));var rp=require(_0x13cd('0x4'));var moment=require('moment');var BPromise=require(_0x13cd('0x5'));var Mustache=require(_0x13cd('0x6'));var util=require(_0x13cd('0x7'));var path=require('path');var sox=require(_0x13cd('0x8'));var csv=require('to-csv');var ejs=require(_0x13cd('0x9'));var fs=require('fs');var fs_extra=require(_0x13cd('0xa'));var _=require(_0x13cd('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x13cd('0xc'));var deskjs=require(_0x13cd('0xd'));var toCsv=require(_0x13cd('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x13cd('0xf'));var authService=require(_0x13cd('0x10'));var qs=require(_0x13cd('0x11'));var as=require(_0x13cd('0x12'));var hardwareService=require(_0x13cd('0x13'));var logger=require(_0x13cd('0x14'))(_0x13cd('0x15'));var utils=require(_0x13cd('0x16'));var config=require(_0x13cd('0x17'));var licenseUtil=require(_0x13cd('0x18'));var db=require(_0x13cd('0x19'))['db'];config[_0x13cd('0x1a')]=_[_0x13cd('0x1b')](config[_0x13cd('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x13cd('0x1c'))(new Redis(config[_0x13cd('0x1a')]));require(_0x13cd('0x1d'))[_0x13cd('0x1e')](socket);function respondWithStatusCode(_0x207e88,_0x437359){_0x437359=_0x437359||0xcc;return function(_0x903a38){if(_0x903a38){return _0x207e88['sendStatus'](_0x437359);}return _0x207e88['status'](_0x437359)[_0x13cd('0x1f')]();};}function respondWithResult(_0x24452a,_0x367d37){_0x367d37=_0x367d37||0xc8;return function(_0x221c64){if(_0x221c64){return _0x24452a['status'](_0x367d37)[_0x13cd('0x20')](_0x221c64);}};}function respondWithFilteredResult(_0x13b848,_0x47c3d5){return function(_0x36de9d){if(_0x36de9d){var _0x31b01e=typeof _0x47c3d5[_0x13cd('0x21')]===_0x13cd('0x22')&&typeof _0x47c3d5[_0x13cd('0x23')]==='undefined';var _0xd8e77e=_0x36de9d[_0x13cd('0x24')];var _0x4ca246=_0x31b01e?0x0:_0x47c3d5[_0x13cd('0x21')];var _0xada2d0=_0x31b01e?_0x36de9d[_0x13cd('0x24')]:_0x47c3d5[_0x13cd('0x21')]+_0x47c3d5[_0x13cd('0x23')];var _0x3355a4;if(_0xada2d0>=_0xd8e77e){_0xada2d0=_0xd8e77e;_0x3355a4=0xc8;}else{_0x3355a4=0xce;}_0x13b848[_0x13cd('0x25')](_0x3355a4);return _0x13b848['set'](_0x13cd('0x26'),_0x4ca246+'-'+_0xada2d0+'/'+_0xd8e77e)[_0x13cd('0x20')](_0x36de9d);}return null;};}function patchUpdates(_0x24d9b3){return function(_0x5ad165){try{jsonpatch['apply'](_0x5ad165,_0x24d9b3,!![]);}catch(_0x33d88c){return BPromise[_0x13cd('0x27')](_0x33d88c);}return _0x5ad165['save']();};}function saveUpdates(_0x889a80,_0x3369e0){return function(_0x4af390){if(_0x4af390){return _0x4af390[_0x13cd('0x28')](_0x889a80)[_0x13cd('0x29')](function(_0x17bf16){return _0x17bf16;});}return null;};}function removeEntity(_0x391a26,_0x2eb190){return function(_0x161390){if(_0x161390){return _0x161390[_0x13cd('0x2a')]()['then'](function(){_0x391a26[_0x13cd('0x25')](0xcc)[_0x13cd('0x1f')]();});}};}function handleEntityNotFound(_0x75d486,_0x2a0aa2){return function(_0x2e12d5){if(!_0x2e12d5){_0x75d486[_0x13cd('0x2b')](0x194);}return _0x2e12d5;};}function handleError(_0x7c70e3,_0x5db2b7){_0x5db2b7=_0x5db2b7||0x1f4;return function(_0x319a3d){logger[_0x13cd('0x2c')](_0x319a3d[_0x13cd('0x2d')]);if(_0x319a3d[_0x13cd('0x2e')]){delete _0x319a3d[_0x13cd('0x2e')];}_0x7c70e3[_0x13cd('0x25')](_0x5db2b7)[_0x13cd('0x2f')](_0x319a3d);};}exports[_0x13cd('0x30')]=function(_0x4e78ec,_0x5e708d){var _0x24b07f={},_0x49c50d={},_0x1c56f5={'count':0x0,'rows':[]};var _0x4407f0=_[_0x13cd('0x31')](db['ChatGroup'][_0x13cd('0x32')],function(_0x5c53f8){return{'name':_0x5c53f8[_0x13cd('0x33')],'type':_0x5c53f8[_0x13cd('0x34')][_0x13cd('0x35')]};});_0x49c50d[_0x13cd('0x36')]=_['map'](_0x4407f0,_0x13cd('0x2e'));_0x49c50d[_0x13cd('0x37')]=_['keys'](_0x4e78ec[_0x13cd('0x37')]);_0x49c50d[_0x13cd('0x38')]=_[_0x13cd('0x39')](_0x49c50d['model'],_0x49c50d['query']);_0x24b07f['attributes']=_[_0x13cd('0x39')](_0x49c50d[_0x13cd('0x36')],qs[_0x13cd('0x3a')](_0x4e78ec[_0x13cd('0x37')][_0x13cd('0x3a')]));_0x24b07f[_0x13cd('0x3b')]=_0x24b07f['attributes'][_0x13cd('0x3c')]?_0x24b07f['attributes']:_0x49c50d[_0x13cd('0x36')];if(!_0x4e78ec['query'][_0x13cd('0x3d')]('nolimit')){_0x24b07f[_0x13cd('0x23')]=qs[_0x13cd('0x23')](_0x4e78ec[_0x13cd('0x37')][_0x13cd('0x23')]);_0x24b07f['offset']=qs['offset'](_0x4e78ec['query']['offset']);}_0x24b07f[_0x13cd('0x3e')]=qs[_0x13cd('0x3f')](_0x4e78ec[_0x13cd('0x37')][_0x13cd('0x3f')]);_0x24b07f[_0x13cd('0x40')]=qs[_0x13cd('0x38')](_[_0x13cd('0x41')](_0x4e78ec[_0x13cd('0x37')],_0x49c50d[_0x13cd('0x38')]),_0x4407f0);if(_0x4e78ec[_0x13cd('0x37')][_0x13cd('0x42')]){_0x24b07f[_0x13cd('0x40')]=_[_0x13cd('0x43')](_0x24b07f[_0x13cd('0x40')],{'$or':_[_0x13cd('0x31')](_0x4407f0,function(_0x10ef5f){if(_0x10ef5f[_0x13cd('0x34')]!==_0x13cd('0x44')){var _0xda71b={};_0xda71b[_0x10ef5f[_0x13cd('0x2e')]]={'$like':'%'+_0x4e78ec[_0x13cd('0x37')][_0x13cd('0x42')]+'%'};return _0xda71b;}})});}_0x24b07f=_[_0x13cd('0x43')]({},_0x24b07f,_0x4e78ec[_0x13cd('0x45')]);var _0x22fe2a={'where':_0x24b07f[_0x13cd('0x40')]};return db[_0x13cd('0x46')][_0x13cd('0x24')](_0x22fe2a)[_0x13cd('0x29')](function(_0x539047){_0x1c56f5['count']=_0x539047;if(_0x4e78ec[_0x13cd('0x37')][_0x13cd('0x47')]){_0x24b07f[_0x13cd('0x48')]=[{'all':!![]}];}return db[_0x13cd('0x46')][_0x13cd('0x49')](_0x24b07f);})[_0x13cd('0x29')](function(_0x1fe12a){_0x1c56f5['rows']=_0x1fe12a;return _0x1c56f5;})[_0x13cd('0x29')](respondWithFilteredResult(_0x5e708d,_0x24b07f))['catch'](handleError(_0x5e708d,null));};exports[_0x13cd('0x4a')]=function(_0x1516f6,_0x14033e){var _0x104967={'raw':!![],'where':{'id':_0x1516f6[_0x13cd('0x4b')]['id']}},_0x4129c5={};_0x4129c5['model']=_[_0x13cd('0x4c')](db[_0x13cd('0x46')][_0x13cd('0x32')]);_0x4129c5['query']=_['keys'](_0x1516f6[_0x13cd('0x37')]);_0x4129c5[_0x13cd('0x38')]=_[_0x13cd('0x39')](_0x4129c5[_0x13cd('0x36')],_0x4129c5['query']);_0x104967['attributes']=_[_0x13cd('0x39')](_0x4129c5[_0x13cd('0x36')],qs[_0x13cd('0x3a')](_0x1516f6[_0x13cd('0x37')]['fields']));_0x104967['attributes']=_0x104967['attributes']['length']?_0x104967[_0x13cd('0x3b')]:_0x4129c5['model'];if(_0x1516f6['query']['includeAll']){_0x104967['include']=[{'all':!![]}];}_0x104967=_['merge']({},_0x104967,_0x1516f6[_0x13cd('0x45')]);return db[_0x13cd('0x46')][_0x13cd('0x4d')](_0x104967)['then'](handleEntityNotFound(_0x14033e,null))['then'](respondWithResult(_0x14033e,null))['catch'](handleError(_0x14033e,null));};exports[_0x13cd('0x4e')]=function(_0x98f4f7,_0x5cca92){return db['ChatGroup'][_0x13cd('0x4e')](_0x98f4f7[_0x13cd('0x4f')],{})[_0x13cd('0x29')](respondWithResult(_0x5cca92,0xc9))[_0x13cd('0x50')](handleError(_0x5cca92,null));};exports[_0x13cd('0x28')]=function(_0x466171,_0x5ba2f9){if(_0x466171[_0x13cd('0x4f')]['id']){delete _0x466171[_0x13cd('0x4f')]['id'];}return db[_0x13cd('0x46')][_0x13cd('0x4d')]({'where':{'id':_0x466171[_0x13cd('0x4b')]['id']}})[_0x13cd('0x29')](handleEntityNotFound(_0x5ba2f9,null))[_0x13cd('0x29')](saveUpdates(_0x466171[_0x13cd('0x4f')],null))['then'](respondWithResult(_0x5ba2f9,null))[_0x13cd('0x50')](handleError(_0x5ba2f9,null));};exports[_0x13cd('0x2a')]=function(_0x248ab8,_0x337f26){return db[_0x13cd('0x46')][_0x13cd('0x4d')]({'where':{'id':_0x248ab8[_0x13cd('0x4b')]['id']}})[_0x13cd('0x29')](handleEntityNotFound(_0x337f26,null))[_0x13cd('0x29')](removeEntity(_0x337f26,null))[_0x13cd('0x50')](handleError(_0x337f26,null));};exports[_0x13cd('0x51')]=function(_0xc8fc27,_0x43e58c){return db[_0x13cd('0x46')][_0x13cd('0x51')]()[_0x13cd('0x29')](respondWithResult(_0x43e58c,null))['catch'](handleError(_0x43e58c,null));};exports[_0x13cd('0x52')]=function(_0x2d89c2,_0x145a0c,_0x33eab4){return db[_0x13cd('0x53')]['count']({'where':{'ChatGroupId':_0x2d89c2[_0x13cd('0x4b')]['id'],'ToId':_0x2d89c2[_0x13cd('0x54')]['id'],'read':![]}})[_0x13cd('0x29')](function(_0x44fbbb){return{'id':_['toInteger'](_0x2d89c2[_0x13cd('0x4b')]['id']),'count':_0x44fbbb};})['then'](respondWithResult(_0x145a0c,null))[_0x13cd('0x50')](handleError(_0x145a0c,null));};exports[_0x13cd('0x55')]=function(_0x328e70,_0x1be1e0,_0x347294){return db[_0x13cd('0x46')][_0x13cd('0x4d')]({'where':{'id':_0x328e70['params']['id']}})[_0x13cd('0x29')](handleEntityNotFound(_0x1be1e0,null))[_0x13cd('0x29')](function(_0x3bd58d){if(_0x3bd58d){return _0x3bd58d[_0x13cd('0x55')](_0x328e70['body'][_0x13cd('0x56')],_[_0x13cd('0x57')](_0x328e70['body'],[_0x13cd('0x56'),'id'])||{});}})[_0x13cd('0x29')](respondWithResult(_0x1be1e0,null))[_0x13cd('0x50')](handleError(_0x1be1e0,null));};exports['getMembers']=function(_0x3445be,_0x50c9a2,_0x2deaf9){var _0x1cf410={};var _0x44dd98={};var _0x3167b0;var _0x13c823;return db[_0x13cd('0x46')]['findOne']({'where':{'id':_0x3445be[_0x13cd('0x4b')]['id']}})[_0x13cd('0x29')](handleEntityNotFound(_0x50c9a2,null))[_0x13cd('0x29')](function(_0x599cae){if(_0x599cae){_0x3167b0=_0x599cae;_0x44dd98[_0x13cd('0x36')]=_['keys'](db[_0x13cd('0x58')][_0x13cd('0x32')]);_0x44dd98[_0x13cd('0x37')]=_['keys'](_0x3445be[_0x13cd('0x37')]);_0x44dd98['filters']=_[_0x13cd('0x39')](_0x44dd98[_0x13cd('0x36')],_0x44dd98[_0x13cd('0x37')]);_0x1cf410['attributes']=_['intersection'](_0x44dd98[_0x13cd('0x36')],qs[_0x13cd('0x3a')](_0x3445be['query'][_0x13cd('0x3a')]));_0x1cf410['attributes']=_0x1cf410[_0x13cd('0x3b')][_0x13cd('0x3c')]?_0x1cf410[_0x13cd('0x3b')]:_0x44dd98['model'];_0x1cf410['order']=qs[_0x13cd('0x3f')](_0x3445be[_0x13cd('0x37')][_0x13cd('0x3f')]);_0x1cf410[_0x13cd('0x40')]=qs[_0x13cd('0x38')](_[_0x13cd('0x41')](_0x3445be[_0x13cd('0x37')],_0x44dd98[_0x13cd('0x38')]));if(_0x3445be[_0x13cd('0x37')][_0x13cd('0x42')]){_0x1cf410[_0x13cd('0x40')]=_[_0x13cd('0x43')](_0x1cf410[_0x13cd('0x40')],{'$or':_[_0x13cd('0x31')](_0x1cf410[_0x13cd('0x3b')],function(_0x542ab5){var _0x5be241={};_0x5be241[_0x542ab5]={'$like':'%'+_0x3445be[_0x13cd('0x37')][_0x13cd('0x42')]+'%'};return _0x5be241;})});}_0x1cf410=_[_0x13cd('0x43')]({},_0x1cf410,_0x3445be[_0x13cd('0x45')]);return _0x3167b0[_0x13cd('0x59')](_0x1cf410);}})['then'](function(_0x469465){if(_0x469465){_0x13c823=_0x469465[_0x13cd('0x3c')];if(!_0x3445be[_0x13cd('0x37')][_0x13cd('0x3d')](_0x13cd('0x5a'))){_0x1cf410[_0x13cd('0x23')]=qs[_0x13cd('0x23')](_0x3445be[_0x13cd('0x37')][_0x13cd('0x23')]);_0x1cf410[_0x13cd('0x21')]=qs[_0x13cd('0x21')](_0x3445be[_0x13cd('0x37')][_0x13cd('0x21')]);}return _0x3167b0['getMembers'](_0x1cf410);}})[_0x13cd('0x29')](function(_0x26db40){if(_0x26db40){return _0x26db40?{'count':_0x13c823,'rows':_0x26db40}:null;}})[_0x13cd('0x29')](respondWithResult(_0x50c9a2,null))[_0x13cd('0x50')](handleError(_0x50c9a2,null));};exports[_0x13cd('0x5b')]=function(_0x83e96b,_0x472adc,_0x529656){return db[_0x13cd('0x46')][_0x13cd('0x4d')]({'where':{'id':_0x83e96b[_0x13cd('0x4b')]['id']}})[_0x13cd('0x29')](handleEntityNotFound(_0x472adc,null))[_0x13cd('0x29')](function(_0x27e57b){if(_0x27e57b){return _0x27e57b[_0x13cd('0x5b')](_0x83e96b[_0x13cd('0x37')][_0x13cd('0x56')]);}})[_0x13cd('0x29')](respondWithStatusCode(_0x472adc,null))[_0x13cd('0x50')](handleError(_0x472adc,null));};exports['addMessage']=function(_0x1909fe,_0x477c64,_0x3102d1){if(_0x1909fe[_0x13cd('0x4f')]['id']){delete _0x1909fe[_0x13cd('0x4f')]['id'];}return db[_0x13cd('0x46')][_0x13cd('0x4d')]({'where':{'id':_0x1909fe['params']['id']}})[_0x13cd('0x29')](handleEntityNotFound(_0x477c64,null))[_0x13cd('0x29')](function(_0xbcad38){if(_0xbcad38){_0x1909fe[_0x13cd('0x4f')][_0x13cd('0x5c')]=_0xbcad38['id'];return db[_0x13cd('0x53')]['create'](_0x1909fe[_0x13cd('0x4f')]);}})[_0x13cd('0x29')](respondWithResult(_0x477c64,null))[_0x13cd('0x50')](handleError(_0x477c64,null));};exports[_0x13cd('0x5d')]=function(_0x245e8b,_0x101ae5,_0x11b240){var _0x450153={};var _0x5e4aa5={};var _0x5c74be;var _0x5c1e18;return db[_0x13cd('0x46')][_0x13cd('0x5e')]({'where':{'id':_0x245e8b['params']['id']}})[_0x13cd('0x29')](handleEntityNotFound(_0x101ae5,null))['then'](function(_0x95dfb0){if(_0x95dfb0){_0x5c74be=_0x95dfb0;_0x5e4aa5[_0x13cd('0x36')]=_[_0x13cd('0x4c')](db['ChatInternalMessage'][_0x13cd('0x32')]);_0x5e4aa5['query']=_[_0x13cd('0x4c')](_0x245e8b[_0x13cd('0x37')]);_0x5e4aa5[_0x13cd('0x38')]=_[_0x13cd('0x39')](_0x5e4aa5[_0x13cd('0x36')],_0x5e4aa5[_0x13cd('0x37')]);_0x450153[_0x13cd('0x3b')]=_['intersection'](_0x5e4aa5['model'],qs['fields'](_0x245e8b['query'][_0x13cd('0x3a')]));_0x450153[_0x13cd('0x3b')]=_0x450153[_0x13cd('0x3b')]['length']?_0x450153['attributes']:_0x5e4aa5[_0x13cd('0x36')];_0x450153[_0x13cd('0x3e')]=qs[_0x13cd('0x3f')](_0x245e8b[_0x13cd('0x37')][_0x13cd('0x3f')]);_0x450153['where']=qs[_0x13cd('0x38')](_[_0x13cd('0x41')](_0x245e8b[_0x13cd('0x37')],_0x5e4aa5[_0x13cd('0x38')]));if(_0x245e8b[_0x13cd('0x37')][_0x13cd('0x42')]){_0x450153[_0x13cd('0x40')]=_[_0x13cd('0x43')](_0x450153[_0x13cd('0x40')],{'$or':_['map'](_0x450153[_0x13cd('0x3b')],function(_0x26831b){var _0x38282d={};_0x38282d[_0x26831b]={'$like':'%'+_0x245e8b['query']['filter']+'%'};return _0x38282d;})});}if(_0x245e8b[_0x13cd('0x37')]['$gte']){var _0x21ff63=_0x245e8b[_0x13cd('0x37')]['$gte'][_0x13cd('0x5f')](',');var _0x39fe95={};_0x39fe95[_0x21ff63[0x0]]={'$gte':moment(_0x21ff63[0x1])[_0x13cd('0x60')](_0x13cd('0x61'))};_0x450153[_0x13cd('0x40')]=_['merge'](_0x450153['where'],_0x39fe95);}_0x450153=_[_0x13cd('0x43')]({},_0x450153,_0x245e8b[_0x13cd('0x45')]);return _0x5c74be[_0x13cd('0x5d')](_0x450153);}})['then'](function(_0x55e20d){if(_0x55e20d){_0x5c1e18=_0x55e20d['length'];if(!_0x245e8b['query'][_0x13cd('0x3d')](_0x13cd('0x5a'))){_0x450153[_0x13cd('0x23')]=qs[_0x13cd('0x23')](_0x245e8b[_0x13cd('0x37')][_0x13cd('0x23')]);_0x450153[_0x13cd('0x21')]=qs[_0x13cd('0x21')](_0x245e8b['query'][_0x13cd('0x21')]);}return _0x5c74be['getMessages'](_0x450153);}})[_0x13cd('0x29')](function(_0x284906){if(_0x284906){return _0x284906?{'count':_0x5c1e18,'rows':_0x284906}:null;}})['then'](respondWithResult(_0x101ae5,null))[_0x13cd('0x50')](handleError(_0x101ae5,null));};
\ No newline at end of file
+var _0xf9bb=['format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatGroup.socket','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','ChatGroup','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','keys','find','create','body','update','destroy','describe','ChatInternalMessage','params','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','rawAttributes','$gte','split'];(function(_0x194d6d,_0x43781b){var _0x6d23cc=function(_0x6c57ad){while(--_0x6c57ad){_0x194d6d['push'](_0x194d6d['shift']());}};_0x6d23cc(++_0x43781b);}(_0xf9bb,0xcb));var _0xbf9b=function(_0x3419b0,_0x255acd){_0x3419b0=_0x3419b0-0x0;var _0x2fddb6=_0xf9bb[_0x3419b0];return _0x2fddb6;};'use strict';var emlformat=require(_0xbf9b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf9b('0x1'));var jsonpatch=require(_0xbf9b('0x2'));var rp=require(_0xbf9b('0x3'));var moment=require(_0xbf9b('0x4'));var BPromise=require(_0xbf9b('0x5'));var Mustache=require('mustache');var util=require(_0xbf9b('0x6'));var path=require(_0xbf9b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbf9b('0x8'));var fs=require('fs');var fs_extra=require(_0xbf9b('0x9'));var _=require(_0xbf9b('0xa'));var squel=require(_0xbf9b('0xb'));var crypto=require(_0xbf9b('0xc'));var jsforce=require(_0xbf9b('0xd'));var deskjs=require(_0xbf9b('0xe'));var toCsv=require(_0xbf9b('0xf'));var querystring=require(_0xbf9b('0x10'));var Papa=require(_0xbf9b('0x11'));var Redis=require('ioredis');var authService=require(_0xbf9b('0x12'));var qs=require(_0xbf9b('0x13'));var as=require(_0xbf9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf9b('0x15'))(_0xbf9b('0x16'));var utils=require(_0xbf9b('0x17'));var config=require(_0xbf9b('0x18'));var licenseUtil=require(_0xbf9b('0x19'));var db=require(_0xbf9b('0x1a'))['db'];config[_0xbf9b('0x1b')]=_[_0xbf9b('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf9b('0x1b')]));require(_0xbf9b('0x1d'))['register'](socket);function respondWithStatusCode(_0x57991b,_0x28d787){_0x28d787=_0x28d787||0xcc;return function(_0x5d6f97){if(_0x5d6f97){return _0x57991b['sendStatus'](_0x28d787);}return _0x57991b['status'](_0x28d787)[_0xbf9b('0x1e')]();};}function respondWithResult(_0x3ba5e4,_0x3664b8){_0x3664b8=_0x3664b8||0xc8;return function(_0x20cb15){if(_0x20cb15){return _0x3ba5e4[_0xbf9b('0x1f')](_0x3664b8)[_0xbf9b('0x20')](_0x20cb15);}};}function respondWithFilteredResult(_0x3c8aae,_0x17b3f6){return function(_0x4ca6cc){if(_0x4ca6cc){var _0x5950bf=typeof _0x17b3f6[_0xbf9b('0x21')]===_0xbf9b('0x22')&&typeof _0x17b3f6['limit']==='undefined';var _0x2f678b=_0x4ca6cc[_0xbf9b('0x23')];var _0x569807=_0x5950bf?0x0:_0x17b3f6['offset'];var _0x2bc07a=_0x5950bf?_0x4ca6cc[_0xbf9b('0x23')]:_0x17b3f6[_0xbf9b('0x21')]+_0x17b3f6[_0xbf9b('0x24')];var _0x25a5e7;if(_0x2bc07a>=_0x2f678b){_0x2bc07a=_0x2f678b;_0x25a5e7=0xc8;}else{_0x25a5e7=0xce;}_0x3c8aae[_0xbf9b('0x1f')](_0x25a5e7);return _0x3c8aae[_0xbf9b('0x25')](_0xbf9b('0x26'),_0x569807+'-'+_0x2bc07a+'/'+_0x2f678b)[_0xbf9b('0x20')](_0x4ca6cc);}return null;};}function patchUpdates(_0x23ed3e){return function(_0xeede8d){try{jsonpatch[_0xbf9b('0x27')](_0xeede8d,_0x23ed3e,!![]);}catch(_0x40866c){return BPromise[_0xbf9b('0x28')](_0x40866c);}return _0xeede8d[_0xbf9b('0x29')]();};}function saveUpdates(_0x3e55a1,_0x1b5f61){return function(_0x492c8d){if(_0x492c8d){return _0x492c8d['update'](_0x3e55a1)[_0xbf9b('0x2a')](function(_0x2e2594){return _0x2e2594;});}return null;};}function removeEntity(_0x3e387b,_0x50c030){return function(_0x53ba4e){if(_0x53ba4e){return _0x53ba4e['destroy']()[_0xbf9b('0x2a')](function(){_0x3e387b[_0xbf9b('0x1f')](0xcc)[_0xbf9b('0x1e')]();});}};}function handleEntityNotFound(_0x429814,_0x22a23b){return function(_0x56ee2c){if(!_0x56ee2c){_0x429814[_0xbf9b('0x2b')](0x194);}return _0x56ee2c;};}function handleError(_0x558e81,_0xd37e48){_0xd37e48=_0xd37e48||0x1f4;return function(_0xb9ed3f){logger[_0xbf9b('0x2c')](_0xb9ed3f[_0xbf9b('0x2d')]);if(_0xb9ed3f['name']){delete _0xb9ed3f[_0xbf9b('0x2e')];}_0x558e81['status'](_0xd37e48)[_0xbf9b('0x2f')](_0xb9ed3f);};}exports[_0xbf9b('0x30')]=function(_0x4b5aae,_0x2e799a){var _0x2c5bf5={},_0x5bc912={},_0x1db753={'count':0x0,'rows':[]};var _0x2e7aaf=_[_0xbf9b('0x31')](db[_0xbf9b('0x32')]['rawAttributes'],function(_0x18eb11){return{'name':_0x18eb11['fieldName'],'type':_0x18eb11[_0xbf9b('0x33')][_0xbf9b('0x34')]};});_0x5bc912['model']=_[_0xbf9b('0x31')](_0x2e7aaf,_0xbf9b('0x2e'));_0x5bc912[_0xbf9b('0x35')]=_['keys'](_0x4b5aae[_0xbf9b('0x35')]);_0x5bc912['filters']=_[_0xbf9b('0x36')](_0x5bc912['model'],_0x5bc912[_0xbf9b('0x35')]);_0x2c5bf5[_0xbf9b('0x37')]=_['intersection'](_0x5bc912[_0xbf9b('0x38')],qs[_0xbf9b('0x39')](_0x4b5aae[_0xbf9b('0x35')][_0xbf9b('0x39')]));_0x2c5bf5[_0xbf9b('0x37')]=_0x2c5bf5[_0xbf9b('0x37')][_0xbf9b('0x3a')]?_0x2c5bf5[_0xbf9b('0x37')]:_0x5bc912[_0xbf9b('0x38')];if(!_0x4b5aae['query'][_0xbf9b('0x3b')]('nolimit')){_0x2c5bf5[_0xbf9b('0x24')]=qs[_0xbf9b('0x24')](_0x4b5aae[_0xbf9b('0x35')][_0xbf9b('0x24')]);_0x2c5bf5['offset']=qs[_0xbf9b('0x21')](_0x4b5aae['query'][_0xbf9b('0x21')]);}_0x2c5bf5[_0xbf9b('0x3c')]=qs['sort'](_0x4b5aae[_0xbf9b('0x35')][_0xbf9b('0x3d')]);_0x2c5bf5[_0xbf9b('0x3e')]=qs[_0xbf9b('0x3f')](_[_0xbf9b('0x40')](_0x4b5aae[_0xbf9b('0x35')],_0x5bc912[_0xbf9b('0x3f')]),_0x2e7aaf);if(_0x4b5aae[_0xbf9b('0x35')][_0xbf9b('0x41')]){_0x2c5bf5['where']=_[_0xbf9b('0x42')](_0x2c5bf5[_0xbf9b('0x3e')],{'$or':_['map'](_0x2e7aaf,function(_0x3f4ae0){if(_0x3f4ae0[_0xbf9b('0x33')]!=='VIRTUAL'){var _0x176934={};_0x176934[_0x3f4ae0[_0xbf9b('0x2e')]]={'$like':'%'+_0x4b5aae[_0xbf9b('0x35')][_0xbf9b('0x41')]+'%'};return _0x176934;}})});}_0x2c5bf5=_[_0xbf9b('0x42')]({},_0x2c5bf5,_0x4b5aae[_0xbf9b('0x43')]);var _0x1fdaa8={'where':_0x2c5bf5[_0xbf9b('0x3e')]};return db[_0xbf9b('0x32')]['count'](_0x1fdaa8)[_0xbf9b('0x2a')](function(_0x21600e){_0x1db753[_0xbf9b('0x23')]=_0x21600e;if(_0x4b5aae[_0xbf9b('0x35')][_0xbf9b('0x44')]){_0x2c5bf5[_0xbf9b('0x45')]=[{'all':!![]}];}return db[_0xbf9b('0x32')][_0xbf9b('0x46')](_0x2c5bf5);})[_0xbf9b('0x2a')](function(_0x3dc743){_0x1db753[_0xbf9b('0x47')]=_0x3dc743;return _0x1db753;})[_0xbf9b('0x2a')](respondWithFilteredResult(_0x2e799a,_0x2c5bf5))[_0xbf9b('0x48')](handleError(_0x2e799a,null));};exports['show']=function(_0x18cd1d,_0x30042d){var _0x5269aa={'raw':!![],'where':{'id':_0x18cd1d['params']['id']}},_0xbdeba5={};_0xbdeba5[_0xbf9b('0x38')]=_[_0xbf9b('0x49')](db['ChatGroup']['rawAttributes']);_0xbdeba5[_0xbf9b('0x35')]=_[_0xbf9b('0x49')](_0x18cd1d[_0xbf9b('0x35')]);_0xbdeba5[_0xbf9b('0x3f')]=_['intersection'](_0xbdeba5[_0xbf9b('0x38')],_0xbdeba5[_0xbf9b('0x35')]);_0x5269aa['attributes']=_['intersection'](_0xbdeba5[_0xbf9b('0x38')],qs[_0xbf9b('0x39')](_0x18cd1d[_0xbf9b('0x35')][_0xbf9b('0x39')]));_0x5269aa['attributes']=_0x5269aa[_0xbf9b('0x37')]['length']?_0x5269aa[_0xbf9b('0x37')]:_0xbdeba5['model'];if(_0x18cd1d[_0xbf9b('0x35')][_0xbf9b('0x44')]){_0x5269aa[_0xbf9b('0x45')]=[{'all':!![]}];}_0x5269aa=_[_0xbf9b('0x42')]({},_0x5269aa,_0x18cd1d[_0xbf9b('0x43')]);return db[_0xbf9b('0x32')][_0xbf9b('0x4a')](_0x5269aa)[_0xbf9b('0x2a')](handleEntityNotFound(_0x30042d,null))['then'](respondWithResult(_0x30042d,null))['catch'](handleError(_0x30042d,null));};exports[_0xbf9b('0x4b')]=function(_0x55c507,_0x505477){return db[_0xbf9b('0x32')][_0xbf9b('0x4b')](_0x55c507[_0xbf9b('0x4c')],{})[_0xbf9b('0x2a')](respondWithResult(_0x505477,0xc9))[_0xbf9b('0x48')](handleError(_0x505477,null));};exports[_0xbf9b('0x4d')]=function(_0x115f1c,_0x594849){if(_0x115f1c['body']['id']){delete _0x115f1c[_0xbf9b('0x4c')]['id'];}return db[_0xbf9b('0x32')][_0xbf9b('0x4a')]({'where':{'id':_0x115f1c['params']['id']}})['then'](handleEntityNotFound(_0x594849,null))[_0xbf9b('0x2a')](saveUpdates(_0x115f1c[_0xbf9b('0x4c')],null))[_0xbf9b('0x2a')](respondWithResult(_0x594849,null))[_0xbf9b('0x48')](handleError(_0x594849,null));};exports[_0xbf9b('0x4e')]=function(_0x1f9601,_0x382dea){return db['ChatGroup'][_0xbf9b('0x4a')]({'where':{'id':_0x1f9601['params']['id']}})[_0xbf9b('0x2a')](handleEntityNotFound(_0x382dea,null))['then'](removeEntity(_0x382dea,null))['catch'](handleError(_0x382dea,null));};exports[_0xbf9b('0x4f')]=function(_0x172cac,_0x21841f){return db[_0xbf9b('0x32')][_0xbf9b('0x4f')]()[_0xbf9b('0x2a')](respondWithResult(_0x21841f,null))[_0xbf9b('0x48')](handleError(_0x21841f,null));};exports['getUnread']=function(_0x29fd0d,_0x478733,_0x34c4f1){return db[_0xbf9b('0x50')][_0xbf9b('0x23')]({'where':{'ChatGroupId':_0x29fd0d[_0xbf9b('0x51')]['id'],'ToId':_0x29fd0d[_0xbf9b('0x52')]['id'],'read':![]}})['then'](function(_0x2f2b92){return{'id':_[_0xbf9b('0x53')](_0x29fd0d[_0xbf9b('0x51')]['id']),'count':_0x2f2b92};})['then'](respondWithResult(_0x478733,null))['catch'](handleError(_0x478733,null));};exports[_0xbf9b('0x54')]=function(_0x19a9ca,_0x53a9e9,_0x28ee57){return db[_0xbf9b('0x32')][_0xbf9b('0x4a')]({'where':{'id':_0x19a9ca['params']['id']}})['then'](handleEntityNotFound(_0x53a9e9,null))[_0xbf9b('0x2a')](function(_0x44df83){if(_0x44df83){return _0x44df83[_0xbf9b('0x54')](_0x19a9ca['body']['ids'],_[_0xbf9b('0x55')](_0x19a9ca[_0xbf9b('0x4c')],[_0xbf9b('0x56'),'id'])||{});}})[_0xbf9b('0x2a')](respondWithResult(_0x53a9e9,null))[_0xbf9b('0x48')](handleError(_0x53a9e9,null));};exports[_0xbf9b('0x57')]=function(_0x5a2244,_0xe21d87,_0xf4489){var _0x23a167={};var _0x428b92={};var _0x53dfc7;var _0x11f2f4;return db[_0xbf9b('0x32')][_0xbf9b('0x58')]({'where':{'id':_0x5a2244[_0xbf9b('0x51')]['id']}})[_0xbf9b('0x2a')](handleEntityNotFound(_0xe21d87,null))[_0xbf9b('0x2a')](function(_0x3ad902){if(_0x3ad902){_0x53dfc7=_0x3ad902;_0x428b92[_0xbf9b('0x38')]=_[_0xbf9b('0x49')](db[_0xbf9b('0x59')]['rawAttributes']);_0x428b92['query']=_['keys'](_0x5a2244['query']);_0x428b92[_0xbf9b('0x3f')]=_['intersection'](_0x428b92['model'],_0x428b92[_0xbf9b('0x35')]);_0x23a167['attributes']=_[_0xbf9b('0x36')](_0x428b92[_0xbf9b('0x38')],qs['fields'](_0x5a2244['query'][_0xbf9b('0x39')]));_0x23a167[_0xbf9b('0x37')]=_0x23a167[_0xbf9b('0x37')][_0xbf9b('0x3a')]?_0x23a167[_0xbf9b('0x37')]:_0x428b92['model'];_0x23a167[_0xbf9b('0x3c')]=qs['sort'](_0x5a2244['query'][_0xbf9b('0x3d')]);_0x23a167[_0xbf9b('0x3e')]=qs['filters'](_[_0xbf9b('0x40')](_0x5a2244['query'],_0x428b92[_0xbf9b('0x3f')]));if(_0x5a2244[_0xbf9b('0x35')][_0xbf9b('0x41')]){_0x23a167[_0xbf9b('0x3e')]=_[_0xbf9b('0x42')](_0x23a167['where'],{'$or':_[_0xbf9b('0x31')](_0x23a167[_0xbf9b('0x37')],function(_0x25198c){var _0x45c146={};_0x45c146[_0x25198c]={'$like':'%'+_0x5a2244['query'][_0xbf9b('0x41')]+'%'};return _0x45c146;})});}_0x23a167=_[_0xbf9b('0x42')]({},_0x23a167,_0x5a2244[_0xbf9b('0x43')]);return _0x53dfc7['getMembers'](_0x23a167);}})[_0xbf9b('0x2a')](function(_0x3c0c34){if(_0x3c0c34){_0x11f2f4=_0x3c0c34[_0xbf9b('0x3a')];if(!_0x5a2244[_0xbf9b('0x35')][_0xbf9b('0x3b')](_0xbf9b('0x5a'))){_0x23a167[_0xbf9b('0x24')]=qs[_0xbf9b('0x24')](_0x5a2244[_0xbf9b('0x35')]['limit']);_0x23a167[_0xbf9b('0x21')]=qs['offset'](_0x5a2244[_0xbf9b('0x35')][_0xbf9b('0x21')]);}return _0x53dfc7[_0xbf9b('0x57')](_0x23a167);}})['then'](function(_0x1a3658){if(_0x1a3658){return _0x1a3658?{'count':_0x11f2f4,'rows':_0x1a3658}:null;}})['then'](respondWithResult(_0xe21d87,null))['catch'](handleError(_0xe21d87,null));};exports[_0xbf9b('0x5b')]=function(_0x17cb08,_0x31f60c,_0x18b541){return db[_0xbf9b('0x32')]['find']({'where':{'id':_0x17cb08[_0xbf9b('0x51')]['id']}})['then'](handleEntityNotFound(_0x31f60c,null))[_0xbf9b('0x2a')](function(_0x59a84d){if(_0x59a84d){return _0x59a84d['removeMembers'](_0x17cb08[_0xbf9b('0x35')]['ids']);}})[_0xbf9b('0x2a')](respondWithStatusCode(_0x31f60c,null))[_0xbf9b('0x48')](handleError(_0x31f60c,null));};exports[_0xbf9b('0x5c')]=function(_0x30bddc,_0x2e8529,_0x215e47){if(_0x30bddc[_0xbf9b('0x4c')]['id']){delete _0x30bddc[_0xbf9b('0x4c')]['id'];}return db[_0xbf9b('0x32')]['find']({'where':{'id':_0x30bddc['params']['id']}})[_0xbf9b('0x2a')](handleEntityNotFound(_0x2e8529,null))[_0xbf9b('0x2a')](function(_0x501f03){if(_0x501f03){_0x30bddc[_0xbf9b('0x4c')][_0xbf9b('0x5d')]=_0x501f03['id'];return db['ChatInternalMessage'][_0xbf9b('0x4b')](_0x30bddc[_0xbf9b('0x4c')]);}})[_0xbf9b('0x2a')](respondWithResult(_0x2e8529,null))[_0xbf9b('0x48')](handleError(_0x2e8529,null));};exports['getMessages']=function(_0x36f4c2,_0x349c6f,_0x43b928){var _0x3971d4={};var _0x4a1c53={};var _0x3a0fec;var _0x5f2823;return db[_0xbf9b('0x32')]['findOne']({'where':{'id':_0x36f4c2[_0xbf9b('0x51')]['id']}})[_0xbf9b('0x2a')](handleEntityNotFound(_0x349c6f,null))[_0xbf9b('0x2a')](function(_0x236987){if(_0x236987){_0x3a0fec=_0x236987;_0x4a1c53[_0xbf9b('0x38')]=_[_0xbf9b('0x49')](db[_0xbf9b('0x50')][_0xbf9b('0x5e')]);_0x4a1c53[_0xbf9b('0x35')]=_[_0xbf9b('0x49')](_0x36f4c2['query']);_0x4a1c53['filters']=_[_0xbf9b('0x36')](_0x4a1c53[_0xbf9b('0x38')],_0x4a1c53['query']);_0x3971d4[_0xbf9b('0x37')]=_[_0xbf9b('0x36')](_0x4a1c53[_0xbf9b('0x38')],qs['fields'](_0x36f4c2[_0xbf9b('0x35')][_0xbf9b('0x39')]));_0x3971d4[_0xbf9b('0x37')]=_0x3971d4[_0xbf9b('0x37')][_0xbf9b('0x3a')]?_0x3971d4[_0xbf9b('0x37')]:_0x4a1c53[_0xbf9b('0x38')];_0x3971d4[_0xbf9b('0x3c')]=qs[_0xbf9b('0x3d')](_0x36f4c2[_0xbf9b('0x35')]['sort']);_0x3971d4['where']=qs[_0xbf9b('0x3f')](_[_0xbf9b('0x40')](_0x36f4c2[_0xbf9b('0x35')],_0x4a1c53['filters']));if(_0x36f4c2['query'][_0xbf9b('0x41')]){_0x3971d4[_0xbf9b('0x3e')]=_['merge'](_0x3971d4['where'],{'$or':_[_0xbf9b('0x31')](_0x3971d4[_0xbf9b('0x37')],function(_0x5ef324){var _0x38e244={};_0x38e244[_0x5ef324]={'$like':'%'+_0x36f4c2[_0xbf9b('0x35')][_0xbf9b('0x41')]+'%'};return _0x38e244;})});}if(_0x36f4c2[_0xbf9b('0x35')][_0xbf9b('0x5f')]){var _0x433b0a=_0x36f4c2['query'][_0xbf9b('0x5f')][_0xbf9b('0x60')](',');var _0x25c913={};_0x25c913[_0x433b0a[0x0]]={'$gte':moment(_0x433b0a[0x1])[_0xbf9b('0x61')](_0xbf9b('0x62'))};_0x3971d4['where']=_['merge'](_0x3971d4['where'],_0x25c913);}_0x3971d4=_[_0xbf9b('0x42')]({},_0x3971d4,_0x36f4c2[_0xbf9b('0x43')]);return _0x3a0fec['getMessages'](_0x3971d4);}})[_0xbf9b('0x2a')](function(_0x3cc129){if(_0x3cc129){_0x5f2823=_0x3cc129['length'];if(!_0x36f4c2[_0xbf9b('0x35')]['hasOwnProperty'](_0xbf9b('0x5a'))){_0x3971d4[_0xbf9b('0x24')]=qs[_0xbf9b('0x24')](_0x36f4c2[_0xbf9b('0x35')][_0xbf9b('0x24')]);_0x3971d4[_0xbf9b('0x21')]=qs['offset'](_0x36f4c2['query'][_0xbf9b('0x21')]);}return _0x3a0fec[_0xbf9b('0x63')](_0x3971d4);}})[_0xbf9b('0x2a')](function(_0xf1cce5){if(_0xf1cce5){return _0xf1cce5?{'count':_0x5f2823,'rows':_0xf1cce5}:null;}})['then'](respondWithResult(_0x349c6f,null))['catch'](handleError(_0x349c6f,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 553b12c..14fdbb9 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 _0xa4a9=['hasOwnProperty','exports','../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0xa0f722,_0x3f23f9){var _0xf38792=function(_0x94d157){while(--_0x94d157){_0xa0f722['push'](_0xa0f722['shift']());}};_0xf38792(++_0x3f23f9);}(_0xa4a9,0x7a));var _0x9a4a=function(_0x51ab83,_0x2721b9){_0x51ab83=_0x51ab83-0x0;var _0x14b6de=_0xa4a9[_0x51ab83];return _0x14b6de;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x9a4a('0x0'))['db'][_0x9a4a('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9a4a('0x2')](0x0);var events={'afterCreate':_0x9a4a('0x3'),'afterUpdate':'update','afterDestroy':_0x9a4a('0x4')};function emitEvent(_0x5c0388){return function(_0x2cee09,_0xbe5cb7,_0x2ef3ba){ChatGroupEvents[_0x9a4a('0x5')](_0x5c0388+':'+_0x2cee09['id'],_0x2cee09);ChatGroupEvents['emit'](_0x5c0388,_0x2cee09);_0x2ef3ba(null);};}for(var e in events){if(events[_0x9a4a('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x9a4a('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x685d=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x4fabe0,_0x505145){var _0x385e2c=function(_0x5312bf){while(--_0x5312bf){_0x4fabe0['push'](_0x4fabe0['shift']());}};_0x385e2c(++_0x505145);}(_0x685d,0x143));var _0xd685=function(_0x43832d,_0x55427b){_0x43832d=_0x43832d-0x0;var _0x5757a0=_0x685d[_0x43832d];return _0x5757a0;};'use strict';var EventEmitter=require(_0xd685('0x0'));var ChatGroup=require(_0xd685('0x1'))['db'][_0xd685('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd685('0x3')](0x0);var events={'afterCreate':_0xd685('0x4'),'afterUpdate':_0xd685('0x5'),'afterDestroy':_0xd685('0x6')};function emitEvent(_0xa220a0){return function(_0x1acf84,_0x3c2166,_0x2ae524){ChatGroupEvents[_0xd685('0x7')](_0xa220a0+':'+_0x1acf84['id'],_0x1acf84);ChatGroupEvents[_0xd685('0x7')](_0xa220a0,_0x1acf84);_0x2ae524(null);};}for(var e in events){if(events[_0xd685('0x8')](e)){var event=events[e];ChatGroup[_0xd685('0x9')](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 b832c53..3eef1fd 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 _0x8815=['../../config/logger','api','bluebird','path','rimraf','./chatGroup.attributes','define','ChatGroup'];(function(_0x256c5d,_0x4154ce){var _0x279814=function(_0x4e7ea9){while(--_0x4e7ea9){_0x256c5d['push'](_0x256c5d['shift']());}};_0x279814(++_0x4154ce);}(_0x8815,0x78));var _0x5881=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x8815[_0x1bbc08];return _0x5d825b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5881('0x0'))(_0x5881('0x1'));var moment=require('moment');var BPromise=require(_0x5881('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5881('0x3'));var rimraf=require(_0x5881('0x4'));var config=require('../../config/environment');var attributes=require(_0x5881('0x5'));module['exports']=function(_0x3c9475,_0x53ecca){return _0x3c9475[_0x5881('0x6')](_0x5881('0x7'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbc35=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x2d4dc8,_0x591909){var _0x2ee36c=function(_0x573664){while(--_0x573664){_0x2d4dc8['push'](_0x2d4dc8['shift']());}};_0x2ee36c(++_0x591909);}(_0xbc35,0x8c));var _0x5bc3=function(_0x45b238,_0x4c8f42){_0x45b238=_0x45b238-0x0;var _0xd6f2a9=_0xbc35[_0x45b238];return _0xd6f2a9;};'use strict';var _=require(_0x5bc3('0x0'));var util=require(_0x5bc3('0x1'));var logger=require(_0x5bc3('0x2'))(_0x5bc3('0x3'));var moment=require(_0x5bc3('0x4'));var BPromise=require(_0x5bc3('0x5'));var rp=require(_0x5bc3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bc3('0x7'));var config=require(_0x5bc3('0x8'));var attributes=require('./chatGroup.attributes');module[_0x5bc3('0x9')]=function(_0x158b48,_0x2b53ec){return _0x158b48[_0x5bc3('0xa')](_0x5bc3('0xb'),attributes,{'tableName':_0x5bc3('0xc'),'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 023df9c..f4d160a 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 _0xc73a=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util'];(function(_0xea2c75,_0x4bf4bd){var _0x2bebca=function(_0x2a60f3){while(--_0x2a60f3){_0xea2c75['push'](_0xea2c75['shift']());}};_0x2bebca(++_0x4bf4bd);}(_0xc73a,0x72));var _0xac73=function(_0x223358,_0xc8dd93){_0x223358=_0x223358-0x0;var _0x1b4ad6=_0xc73a[_0x223358];return _0x1b4ad6;};'use strict';var _=require('lodash');var util=require(_0xac73('0x0'));var moment=require(_0xac73('0x1'));var BPromise=require(_0xac73('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac73('0x3'))['db'];var utils=require(_0xac73('0x4'));var logger=require(_0xac73('0x5'))('rpc');var config=require(_0xac73('0x6'));var jayson=require(_0xac73('0x7'));var client=jayson[_0xac73('0x8')]['http']({'port':0x232a});config[_0xac73('0x9')]=_[_0xac73('0xa')](config[_0xac73('0x9')],{'host':_0xac73('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac73('0x9')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0xf3b7e6,_0x454f8c,_0x468ee9){return new BPromise(function(_0x1844fe,_0x280be1){return client[_0xac73('0xc')](_0xf3b7e6,_0x468ee9)[_0xac73('0xd')](function(_0x2c8bfa){logger['info'](_0xac73('0xe'),_0x454f8c,_0xac73('0xf'));logger[_0xac73('0x10')](_0xac73('0x11'),_0x454f8c,_0xac73('0xf'),JSON[_0xac73('0x12')](_0x2c8bfa));if(_0x2c8bfa['error']){if(_0x2c8bfa[_0xac73('0x13')]['code']===0x1f4){logger[_0xac73('0x13')](_0xac73('0xe'),_0x454f8c,_0x2c8bfa[_0xac73('0x13')][_0xac73('0x14')]);return _0x280be1(_0x2c8bfa['error'][_0xac73('0x14')]);}logger[_0xac73('0x13')]('ChatGroup,\x20%s,\x20%s',_0x454f8c,_0x2c8bfa[_0xac73('0x13')][_0xac73('0x14')]);return _0x1844fe(_0x2c8bfa[_0xac73('0x13')]['message']);}else{logger[_0xac73('0x15')](_0xac73('0xe'),_0x454f8c,_0xac73('0xf'));_0x1844fe(_0x2c8bfa[_0xac73('0x16')][_0xac73('0x14')]);}})['catch'](function(_0x1e2bfd){logger[_0xac73('0x13')]('ChatGroup,\x20%s,\x20%s',_0x454f8c,_0x1e2bfd);_0x280be1(_0x1e2bfd);});});}
\ No newline at end of file
+var _0x84cb=['redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x1d9fbc,_0x6a62f3){var _0x50e7e0=function(_0x4e0c6c){while(--_0x4e0c6c){_0x1d9fbc['push'](_0x1d9fbc['shift']());}};_0x50e7e0(++_0x6a62f3);}(_0x84cb,0xf8));var _0xb84c=function(_0x586106,_0x23eba5){_0x586106=_0x586106-0x0;var _0x6be57f=_0x84cb[_0x586106];return _0x6be57f;};'use strict';var _=require(_0xb84c('0x0'));var util=require('util');var moment=require(_0xb84c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb84c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84c('0x3'))['db'];var utils=require(_0xb84c('0x4'));var logger=require(_0xb84c('0x5'))(_0xb84c('0x6'));var config=require(_0xb84c('0x7'));var jayson=require(_0xb84c('0x8'));var client=jayson[_0xb84c('0x9')][_0xb84c('0xa')]({'port':0x232a});config['redis']=_[_0xb84c('0xb')](config[_0xb84c('0xc')],{'host':_0xb84c('0xd'),'port':0x18eb});var socket=require(_0xb84c('0xe'))(new Redis(config[_0xb84c('0xc')]));require(_0xb84c('0xf'))[_0xb84c('0x10')](socket);function respondWithRpcPromise(_0x553ed8,_0x186a92,_0xcf6fb4){return new BPromise(function(_0x2a3523,_0x19fadc){return client['request'](_0x553ed8,_0xcf6fb4)[_0xb84c('0x11')](function(_0x46d08b){logger[_0xb84c('0x12')](_0xb84c('0x13'),_0x186a92,_0xb84c('0x14'));logger[_0xb84c('0x15')](_0xb84c('0x16'),_0x186a92,'request\x20sent',JSON['stringify'](_0x46d08b));if(_0x46d08b[_0xb84c('0x17')]){if(_0x46d08b['error'][_0xb84c('0x18')]===0x1f4){logger[_0xb84c('0x17')](_0xb84c('0x13'),_0x186a92,_0x46d08b[_0xb84c('0x17')]['message']);return _0x19fadc(_0x46d08b[_0xb84c('0x17')]['message']);}logger[_0xb84c('0x17')](_0xb84c('0x13'),_0x186a92,_0x46d08b['error'][_0xb84c('0x19')]);return _0x2a3523(_0x46d08b[_0xb84c('0x17')][_0xb84c('0x19')]);}else{logger[_0xb84c('0x12')](_0xb84c('0x13'),_0x186a92,_0xb84c('0x14'));_0x2a3523(_0x46d08b['result']['message']);}})['catch'](function(_0x565c37){logger['error']('ChatGroup,\x20%s,\x20%s',_0x186a92,_0x565c37);_0x19fadc(_0x565c37);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 08f122a..d70c578 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 _0x6548=['./chatGroup.events','save','remove','emit','removeListener','register','chatGroup:'];(function(_0x21d78c,_0x353407){var _0x215754=function(_0x2e1163){while(--_0x2e1163){_0x21d78c['push'](_0x21d78c['shift']());}};_0x215754(++_0x353407);}(_0x6548,0x118));var _0x8654=function(_0x1c9219,_0x46a66b){_0x1c9219=_0x1c9219-0x0;var _0x112897=_0x6548[_0x1c9219];return _0x112897;};'use strict';var ChatGroupEvents=require(_0x8654('0x0'));var events=[_0x8654('0x1'),_0x8654('0x2'),'update'];function createListener(_0x533bd8,_0x2e4c86){return function(_0x5efeb7){_0x2e4c86[_0x8654('0x3')](_0x533bd8,_0x5efeb7);};}function removeListener(_0x123c7f,_0x5888a3){return function(){ChatGroupEvents[_0x8654('0x4')](_0x123c7f,_0x5888a3);};}exports[_0x8654('0x5')]=function(_0x313a){for(var _0x233f36=0x0,_0x45b6a7=events['length'];_0x233f36<_0x45b6a7;_0x233f36++){var _0x562201=events[_0x233f36];var _0x561062=createListener(_0x8654('0x6')+_0x562201,_0x313a);ChatGroupEvents['on'](_0x562201,_0x561062);}};
\ No newline at end of file
+var _0x2112=['removeListener','length','./chatGroup.events','remove','update','emit'];(function(_0x5e4d4d,_0x5a5aa6){var _0x40cbd6=function(_0x53c522){while(--_0x53c522){_0x5e4d4d['push'](_0x5e4d4d['shift']());}};_0x40cbd6(++_0x5a5aa6);}(_0x2112,0x68));var _0x2211=function(_0x1c7e9a,_0x451336){_0x1c7e9a=_0x1c7e9a-0x0;var _0x2be451=_0x2112[_0x1c7e9a];return _0x2be451;};'use strict';var ChatGroupEvents=require(_0x2211('0x0'));var events=['save',_0x2211('0x1'),_0x2211('0x2')];function createListener(_0x3d95de,_0x767881){return function(_0x1b1add){_0x767881[_0x2211('0x3')](_0x3d95de,_0x1b1add);};}function removeListener(_0x495186,_0x273613){return function(){ChatGroupEvents[_0x2211('0x4')](_0x495186,_0x273613);};}exports['register']=function(_0x1477b7){for(var _0x98987b=0x0,_0x184c1c=events[_0x2211('0x5')];_0x98987b<_0x184c1c;_0x98987b++){var _0x190cac=events[_0x98987b];var _0x4f0eaf=createListener('chatGroup:'+_0x190cac,_0x1477b7);ChatGroupEvents['on'](_0x190cac,_0x4f0eaf);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 37d77a3..9b8d9de 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 _0x960c=['addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers'];(function(_0x42eca2,_0x5e2e70){var _0x2a9e4c=function(_0x4d74e5){while(--_0x4d74e5){_0x42eca2['push'](_0x42eca2['shift']());}};_0x2a9e4c(++_0x5e2e70);}(_0x960c,0xbb));var _0xc960=function(_0x2122aa,_0x113985){_0x2122aa=_0x2122aa-0x0;var _0x1f1bc6=_0x960c[_0x2122aa];return _0x1f1bc6;};'use strict';var multer=require(_0xc960('0x0'));var util=require(_0xc960('0x1'));var path=require(_0xc960('0x2'));var timeout=require(_0xc960('0x3'));var express=require(_0xc960('0x4'));var router=express[_0xc960('0x5')]();var fs_extra=require(_0xc960('0x6'));var auth=require(_0xc960('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc960('0x8'));router[_0xc960('0x9')]('/',auth[_0xc960('0xa')](),controller[_0xc960('0xb')]);router[_0xc960('0x9')]('/describe',auth[_0xc960('0xa')](),controller[_0xc960('0xc')]);router[_0xc960('0x9')](_0xc960('0xd'),auth['isAuthenticated'](),controller[_0xc960('0xe')]);router[_0xc960('0x9')](_0xc960('0xf'),auth[_0xc960('0xa')](),controller[_0xc960('0x10')]);router[_0xc960('0x9')](_0xc960('0x11'),auth[_0xc960('0xa')](),controller[_0xc960('0x12')]);router[_0xc960('0x9')](_0xc960('0x13'),auth['isAuthenticated'](),controller['getMessages']);router[_0xc960('0x14')]('/',auth[_0xc960('0xa')](),controller[_0xc960('0x15')]);router['post'](_0xc960('0x11'),auth[_0xc960('0xa')](),controller[_0xc960('0x16')]);router['post'](_0xc960('0x13'),auth[_0xc960('0xa')](),controller[_0xc960('0x17')]);router[_0xc960('0x18')](_0xc960('0xd'),auth['isAuthenticated'](),controller[_0xc960('0x19')]);router[_0xc960('0x1a')](_0xc960('0xd'),auth[_0xc960('0xa')](),controller[_0xc960('0x1b')]);router['delete']('/:id/members',auth[_0xc960('0xa')](),controller[_0xc960('0x1c')]);module[_0xc960('0x1d')]=router;
\ No newline at end of file
+var _0x5a57=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','delete','destroy','removeMembers','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x5ed11c,_0x165512){var _0x433303=function(_0x33971a){while(--_0x33971a){_0x5ed11c['push'](_0x5ed11c['shift']());}};_0x433303(++_0x165512);}(_0x5a57,0x13f));var _0x75a5=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x5a57[_0x40bffc];return _0x3007e9;};'use strict';var multer=require(_0x75a5('0x0'));var util=require('util');var path=require(_0x75a5('0x1'));var timeout=require(_0x75a5('0x2'));var express=require('express');var router=express[_0x75a5('0x3')]();var fs_extra=require(_0x75a5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75a5('0x5'));var config=require(_0x75a5('0x6'));var controller=require('./chatGroup.controller');router[_0x75a5('0x7')]('/',auth[_0x75a5('0x8')](),controller['index']);router['get'](_0x75a5('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x75a5('0x7')](_0x75a5('0xa'),auth['isAuthenticated'](),controller[_0x75a5('0xb')]);router['get'](_0x75a5('0xc'),auth['isAuthenticated'](),controller[_0x75a5('0xd')]);router[_0x75a5('0x7')](_0x75a5('0xe'),auth[_0x75a5('0x8')](),controller[_0x75a5('0xf')]);router[_0x75a5('0x7')](_0x75a5('0x10'),auth['isAuthenticated'](),controller[_0x75a5('0x11')]);router[_0x75a5('0x12')]('/',auth['isAuthenticated'](),controller[_0x75a5('0x13')]);router[_0x75a5('0x12')](_0x75a5('0xe'),auth['isAuthenticated'](),controller[_0x75a5('0x14')]);router[_0x75a5('0x12')](_0x75a5('0x10'),auth[_0x75a5('0x8')](),controller[_0x75a5('0x15')]);router[_0x75a5('0x16')](_0x75a5('0xa'),auth[_0x75a5('0x8')](),controller['update']);router[_0x75a5('0x17')](_0x75a5('0xa'),auth[_0x75a5('0x8')](),controller[_0x75a5('0x18')]);router[_0x75a5('0x17')]('/:id/members',auth['isAuthenticated'](),controller[_0x75a5('0x19')]);module[_0x75a5('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 87b3787..0c1a643 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 _0x4157=['DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','STRING'];(function(_0x56216f,_0x51c5e6){var _0x156930=function(_0x5b7802){while(--_0x5b7802){_0x56216f['push'](_0x56216f['shift']());}};_0x156930(++_0x51c5e6);}(_0x4157,0xf3));var _0x7415=function(_0x2c5081,_0x970714){_0x2c5081=_0x2c5081-0x0;var _0x569ad4=_0x4157[_0x2c5081];return _0x569ad4;};'use strict';var Sequelize=require(_0x7415('0x0'));module[_0x7415('0x1')]={'closed':{'type':Sequelize[_0x7415('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7415('0x3')]},'ratingType':{'type':Sequelize[_0x7415('0x4')]('star',_0x7415('0x5')),'defaultValue':_0x7415('0x6')},'ratingMessage':{'type':Sequelize[_0x7415('0x7')]},'pathTranscript':{'type':Sequelize[_0x7415('0x7')]},'mailTranscript':{'type':Sequelize[_0x7415('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7415('0x9')]},'disposition':{'type':Sequelize[_0x7415('0x8')]},'secondDisposition':{'type':Sequelize[_0x7415('0x8')]},'thirdDisposition':{'type':Sequelize[_0x7415('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x7415('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x7415('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x7415('0x8')]},'deviceVendor':{'type':Sequelize[_0x7415('0x8')]},'deviceType':{'type':Sequelize[_0x7415('0x8')]},'referer':{'type':Sequelize[_0x7415('0x7')]},'customerIp':{'type':Sequelize[_0x7415('0x8')]},'formData':{'type':Sequelize[_0x7415('0x7')](_0x7415('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x7415('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x7415('0x4')]('in',_0x7415('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x7415('0x8')]},'customerPort':{'type':Sequelize[_0x7415('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x7415('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x174b=['STRING','out','BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','TEXT','DATE'];(function(_0x486569,_0x1897ef){var _0x394683=function(_0x208a4a){while(--_0x208a4a){_0x486569['push'](_0x486569['shift']());}};_0x394683(++_0x1897ef);}(_0x174b,0x19d));var _0xb174=function(_0x89e3bc,_0x4298cd){_0x89e3bc=_0x89e3bc-0x0;var _0x26a433=_0x174b[_0x89e3bc];return _0x26a433;};'use strict';var Sequelize=require(_0xb174('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb174('0x1')]},'ratingType':{'type':Sequelize[_0xb174('0x2')](_0xb174('0x3'),_0xb174('0x4')),'defaultValue':_0xb174('0x3')},'ratingMessage':{'type':Sequelize[_0xb174('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xb174('0x6')]},'disposition':{'type':Sequelize[_0xb174('0x7')]},'secondDisposition':{'type':Sequelize[_0xb174('0x7')]},'thirdDisposition':{'type':Sequelize[_0xb174('0x7')]},'note':{'type':Sequelize[_0xb174('0x7')]},'browserName':{'type':Sequelize[_0xb174('0x7')]},'browserVersion':{'type':Sequelize[_0xb174('0x7')]},'osName':{'type':Sequelize[_0xb174('0x7')]},'osVersion':{'type':Sequelize[_0xb174('0x7')]},'deviceModel':{'type':Sequelize[_0xb174('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xb174('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xb174('0x7')]},'formData':{'type':Sequelize[_0xb174('0x5')]('long')},'read1stAt':{'type':Sequelize[_0xb174('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb174('0x2')]('in',_0xb174('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xb174('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xb174('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xb174('0x9')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index c7ec647..b7b975a 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 _0xa436=['request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','update','destroy','stack','name','send','render','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','type','key','getOptions','chat','user','params','model','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','parse','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','basename','file','filename','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','keys','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','findAll','addTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','files','server','transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createWriteStream','value','renderFile','downloadInteraction.ejs','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client'];(function(_0x156798,_0x506dd1){var _0x381210=function(_0x296c75){while(--_0x296c75){_0x156798['push'](_0x156798['shift']());}};_0x381210(++_0x506dd1);}(_0xa436,0x194));var _0x6a43=function(_0x4625c5,_0x390e54){_0x4625c5=_0x4625c5-0x0;var _0x402364=_0xa436[_0x4625c5];return _0x402364;};'use strict';var rimraf=require(_0x6a43('0x0'));var zipdir=require(_0x6a43('0x1'));var rp=require('request-promise');var moment=require(_0x6a43('0x2'));var BPromise=require(_0x6a43('0x3'));var Mustache=require(_0x6a43('0x4'));var util=require(_0x6a43('0x5'));var path=require(_0x6a43('0x6'));var ejs=require(_0x6a43('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x6a43('0x8'));var interaction=require(_0x6a43('0x9'));var qs=require(_0x6a43('0xa'));var pdf=require(_0x6a43('0xb'));var logger=require(_0x6a43('0xc'))(_0x6a43('0xd'));var config=require(_0x6a43('0xe'));var db=require('../../mysqldb')['db'];config[_0x6a43('0xf')]=_[_0x6a43('0x10')](config[_0x6a43('0xf')],{'host':_0x6a43('0x11'),'port':0x18eb});var socket=require(_0x6a43('0x12'))(new Redis(config[_0x6a43('0xf')]));require(_0x6a43('0x13'))[_0x6a43('0x14')](socket);var jayson=require(_0x6a43('0x15'));var client=jayson['client'][_0x6a43('0x16')]({'port':0x232b});var client9004=jayson[_0x6a43('0x17')][_0x6a43('0x16')]({'port':0x232c});function respondWithRpcPromise(_0xaf9833,_0x5ea53d,_0x2f59d9,_0x112348){return new BPromise(function(_0x38f775,_0x4c30bd){var _0x6e4f88=_0x112348||client;return _0x6e4f88[_0x6a43('0x18')](_0xaf9833,_0x2f59d9)[_0x6a43('0x19')](function(_0x3f4d53){logger[_0x6a43('0x1a')](_0x6a43('0x1b'),_0x5ea53d,_0x6a43('0x1c'));logger[_0x6a43('0x1d')](_0x6a43('0x1e'),_0x5ea53d,_0x6a43('0x1c'),JSON[_0x6a43('0x1f')](_0x3f4d53));if(_0x3f4d53[_0x6a43('0x20')]){if(_0x3f4d53[_0x6a43('0x20')][_0x6a43('0x21')]===0x1f4){logger[_0x6a43('0x20')](_0x6a43('0x1b'),_0x5ea53d,_0x3f4d53['error'][_0x6a43('0x22')]);return _0x4c30bd(_0x3f4d53[_0x6a43('0x20')]['message']);}logger[_0x6a43('0x20')](_0x6a43('0x1b'),_0x5ea53d,_0x3f4d53[_0x6a43('0x20')][_0x6a43('0x22')]);return _0x38f775(_0x3f4d53['error'][_0x6a43('0x22')]);}else{logger[_0x6a43('0x1a')](_0x6a43('0x1b'),_0x5ea53d,_0x6a43('0x1c'));_0x38f775(_0x3f4d53[_0x6a43('0x23')]['message']);}})[_0x6a43('0x24')](function(_0x4f4593){logger[_0x6a43('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x5ea53d,_0x4f4593);_0x4c30bd(_0x4f4593);});});}function respondWithStatusCode(_0x1531f3,_0x17ee77){_0x17ee77=_0x17ee77||0xcc;return function(_0x139b9d){if(_0x139b9d){return _0x1531f3[_0x6a43('0x25')](_0x17ee77);}return _0x1531f3[_0x6a43('0x26')](_0x17ee77)[_0x6a43('0x27')]();};}function respondWithResult(_0x4c703a,_0x4eec4b){_0x4eec4b=_0x4eec4b||0xc8;return function(_0x42b414){if(_0x42b414){return _0x4c703a[_0x6a43('0x26')](_0x4eec4b)[_0x6a43('0x28')](_0x42b414);}};}function respondWithFilteredResult(_0x234e17,_0x539021){return function(_0x59ff88){if(_0x59ff88){var _0x386f0c=typeof _0x539021[_0x6a43('0x29')]==='undefined'&&typeof _0x539021[_0x6a43('0x2a')]===_0x6a43('0x2b');var _0x5179d8=_0x59ff88['count'];var _0x53de6a=_0x386f0c?0x0:_0x539021['offset'];var _0x583ba6=_0x386f0c?_0x59ff88[_0x6a43('0x2c')]:_0x539021[_0x6a43('0x29')]+_0x539021[_0x6a43('0x2a')];var _0x9d38ca;if(_0x583ba6>=_0x5179d8){_0x583ba6=_0x5179d8;_0x9d38ca=0xc8;}else{_0x9d38ca=0xce;}_0x234e17['status'](_0x9d38ca);return _0x234e17[_0x6a43('0x2d')]('Content-Range',_0x53de6a+'-'+_0x583ba6+'/'+_0x5179d8)[_0x6a43('0x28')](_0x59ff88);}return null;};}function saveUpdates(_0xeae1cc){return function(_0x37a7fe){if(_0x37a7fe){return _0x37a7fe[_0x6a43('0x2e')](_0xeae1cc)['then'](function(_0x4706d9){return _0x4706d9;});}return null;};}function removeEntity(_0x44763a){return function(_0x284c99){if(_0x284c99){return _0x284c99[_0x6a43('0x2f')]()[_0x6a43('0x19')](function(){_0x44763a[_0x6a43('0x26')](0xcc)[_0x6a43('0x27')]();});}};}function handleEntityNotFound(_0x1f13d0){return function(_0x583447){if(!_0x583447){_0x1f13d0[_0x6a43('0x25')](0x194);}return _0x583447;};}function handleError(_0x361df7,_0x2cd984){_0x2cd984=_0x2cd984||0x1f4;return function(_0x25fc0b){logger[_0x6a43('0x20')](_0x25fc0b[_0x6a43('0x30')]);if(_0x25fc0b[_0x6a43('0x31')]){delete _0x25fc0b[_0x6a43('0x31')];}_0x361df7[_0x6a43('0x26')](_0x2cd984)[_0x6a43('0x32')](_0x25fc0b);};}function getMustacheRender(_0x5ec147,_0x259191){return Mustache[_0x6a43('0x33')](_0x5ec147,_['merge'](_0x259191[_0x6a43('0x34')],{'contact':_0x259191[_0x6a43('0x35')],'message':_0x259191[_0x6a43('0x22')],'agent':_0x259191[_0x6a43('0x36')],'interaction':_0x259191[_0x6a43('0x37')],'account':_0x259191[_0x6a43('0x38')]}))||'';}exports[_0x6a43('0x39')]=function(_0x56a7b2,_0x57ce35){var _0x3faa4a={};var _0xaeebfd=_[_0x6a43('0x3a')](db[_0x6a43('0x3b')][_0x6a43('0x3c')],function(_0x266479){return{'name':_0x266479['fieldName'],'type':_0x266479[_0x6a43('0x3d')][_0x6a43('0x3e')]};});_0x3faa4a=qs[_0x6a43('0x3f')](_0xaeebfd,_0x56a7b2);return interaction['findAll'](_0x6a43('0x40'),_0x56a7b2['query'],_0x56a7b2[_0x6a43('0x41')],_0x3faa4a,_0xaeebfd)[_0x6a43('0x19')](respondWithFilteredResult(_0x57ce35,_0x3faa4a))[_0x6a43('0x24')](handleError(_0x57ce35,null));};exports['show']=function(_0x505803,_0x145e04){var _0x494b56={'raw':![],'where':{'id':_0x505803[_0x6a43('0x42')]['id']}},_0x4fea20={};_0x4fea20[_0x6a43('0x43')]=_['keys'](db[_0x6a43('0x3b')][_0x6a43('0x3c')]);_0x4fea20[_0x6a43('0x44')]=_['keys'](_0x505803['query']);_0x4fea20[_0x6a43('0x45')]=_['intersection'](_0x4fea20[_0x6a43('0x43')],_0x4fea20[_0x6a43('0x44')]);_0x494b56[_0x6a43('0x46')]=_[_0x6a43('0x47')](_0x4fea20[_0x6a43('0x43')],qs[_0x6a43('0x48')](_0x505803[_0x6a43('0x44')][_0x6a43('0x48')]));_0x494b56[_0x6a43('0x46')]=_0x494b56[_0x6a43('0x46')][_0x6a43('0x49')]?_0x494b56[_0x6a43('0x46')]:_0x4fea20[_0x6a43('0x43')];if(_0x505803[_0x6a43('0x44')][_0x6a43('0x4a')]){_0x494b56[_0x6a43('0x4b')]=[{'all':!![]}];}_0x494b56=_[_0x6a43('0x4c')]({},_0x494b56,_0x505803[_0x6a43('0x4d')]);return db[_0x6a43('0x3b')][_0x6a43('0x4e')](_0x494b56)['then'](handleEntityNotFound(_0x145e04,null))[_0x6a43('0x19')](respondWithResult(_0x145e04,null))[_0x6a43('0x24')](handleError(_0x145e04,null));};exports[_0x6a43('0x4f')]=function(_0xa68c53,_0x355a95){return db['ChatInteraction'][_0x6a43('0x4f')](_0xa68c53[_0x6a43('0x34')],{})['then'](respondWithResult(_0x355a95,0xc9))['catch'](handleError(_0x355a95,null));};exports['update']=function(_0x125834,_0x17fa2b){if(_0x125834[_0x6a43('0x34')]['id']){delete _0x125834['body']['id'];}return db['ChatInteraction'][_0x6a43('0x4e')]({'where':{'id':_0x125834[_0x6a43('0x42')]['id']}})[_0x6a43('0x19')](handleEntityNotFound(_0x17fa2b,null))[_0x6a43('0x19')](saveUpdates(_0x125834[_0x6a43('0x34')],null))[_0x6a43('0x19')](respondWithResult(_0x17fa2b,null))[_0x6a43('0x24')](handleError(_0x17fa2b,null));};exports[_0x6a43('0x2f')]=function(_0x3f6db9,_0x581dd2){return db[_0x6a43('0x3b')][_0x6a43('0x4e')]({'where':{'id':_0x3f6db9['params']['id']}})[_0x6a43('0x19')](handleEntityNotFound(_0x581dd2,null))[_0x6a43('0x19')](removeEntity(_0x581dd2,null))[_0x6a43('0x24')](handleError(_0x581dd2,null));};exports['describe']=function(_0x3f94f5,_0x53224d){return db[_0x6a43('0x3b')][_0x6a43('0x50')]()[_0x6a43('0x19')](respondWithResult(_0x53224d,null))[_0x6a43('0x24')](handleError(_0x53224d,null));};exports[_0x6a43('0x51')]=function(_0x81ae81,_0x318079){var _0x8acd2b=_0x81ae81[_0x6a43('0x42')]['id'];var _0x3d26d8;var _0x4cbe97;var _0x14fb77;return db[_0x6a43('0x3b')][_0x6a43('0x52')]({'where':{'id':_0x8acd2b}})[_0x6a43('0x19')](function(_0x2a1b8f){_0x3d26d8=_0x2a1b8f;return db[_0x6a43('0x53')]['findOne']({'where':{'id':_0x2a1b8f[_0x6a43('0x54')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0x6a43('0x55'),_0x6a43('0x56'),_0x6a43('0x57')],'raw':!![]});})['then'](function(_0x5d9393){if(_0x5d9393&&_0x5d9393['vidaooApiKey']&&_0x5d9393[_0x6a43('0x58')]){_0x4cbe97=_0x5d9393;var _0x3a0bc7={'interaction':{'id':_0x8acd2b},'agent':{'id':_0x81ae81['user']['id'],'name':_0x81ae81[_0x6a43('0x41')][_0x6a43('0x31')],'fullname':_0x81ae81[_0x6a43('0x41')][_0x6a43('0x59')],'email':_0x81ae81[_0x6a43('0x41')]['email']},'contact':_0x81ae81[_0x6a43('0x34')][_0x6a43('0x35')],'account':_0x81ae81[_0x6a43('0x34')][_0x6a43('0x38')]};var _0x5930af={'rejectUnauthorized':![],'method':_0x6a43('0x5a'),'url':_0x6a43('0x5b'),'headers':{'X-APIKEY':_0x5d9393['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x81ae81['user'][_0x6a43('0x5c')]],'buttons':null,'topic':_0x4cbe97[_0x6a43('0x55')],'note':_[_0x6a43('0x5d')](_0x4cbe97['vidaooNote'])?null:getMustacheRender(_0x4cbe97['vidaooNote'],_0x3a0bc7),'metadata':null},'redirect':_0x6a43('0x5e'),'json':!![]};try{if(!_[_0x6a43('0x5d')](_0x4cbe97[_0x6a43('0x57')])){var _0x4d7f3a=getMustacheRender(_0x4cbe97[_0x6a43('0x57')],_0x3a0bc7);var _0x4ae262=JSON[_0x6a43('0x5f')](_0x4d7f3a);_0x5930af[_0x6a43('0x34')]['metadata']=_0x4ae262;}}catch(_0xaf10e7){throw new db[(_0x6a43('0x60'))]['ValidationError'](_0x6a43('0x61'));}return rp(_0x5930af);}else{throw new db[(_0x6a43('0x60'))][(_0x6a43('0x62'))](_0x6a43('0x63'));}})[_0x6a43('0x19')](function(_0x510669){_0x14fb77=_0x510669;if(_0x14fb77['id']){var _0xc0998={'body':_0x14fb77['join_url'],'ChatWebsiteId':_0x4cbe97['id'],'ChatInteractionId':_0x3d26d8['id'],'direction':_0x6a43('0x64'),'UserId':_0x81ae81[_0x6a43('0x41')]['id']};return db[_0x6a43('0x65')][_0x6a43('0x4f')](_0xc0998,{});}else{throw new db[(_0x6a43('0x60'))]['ValidationError'](_0x6a43('0x66'));}})['then'](function(){return _0x3d26d8[_0x6a43('0x67')]({'vidaooSessionId':_0x14fb77['id']});})[_0x6a43('0x19')](respondWithResult(_0x318079,null))['catch'](handleError(_0x318079,null));};exports[_0x6a43('0x68')]=function(_0x28dd76,_0x3f2cd8){if(_0x28dd76[_0x6a43('0x34')]['id']){delete _0x28dd76[_0x6a43('0x34')]['id'];}return db[_0x6a43('0x3b')][_0x6a43('0x4e')]({'where':{'id':_0x28dd76[_0x6a43('0x42')]['id']},'include':[{'model':db[_0x6a43('0x69')],'as':_0x6a43('0x6a')}]})[_0x6a43('0x19')](handleEntityNotFound(_0x3f2cd8,null))[_0x6a43('0x19')](saveUpdates(_0x28dd76[_0x6a43('0x34')],null))[_0x6a43('0x19')](respondWithResult(_0x3f2cd8,null))[_0x6a43('0x24')](handleError(_0x3f2cd8,null));};exports['abandon']=function(_0x79d690,_0xd04de0){if(_0x79d690[_0x6a43('0x34')]['id']){delete _0x79d690[_0x6a43('0x34')]['id'];}return db[_0x6a43('0x3b')][_0x6a43('0x4e')]({'where':{'id':_0x79d690[_0x6a43('0x42')]['id']}})[_0x6a43('0x19')](function(_0x2c8d2e){if(!_0x2c8d2e){logger[_0x6a43('0x20')](_0x6a43('0x6b'),'abandon',0x194,'entity\x20not\x20found');_0xd04de0['sendStatus'](0x194);}else{if(_0x2c8d2e[_0x6a43('0x6c')]){throw new db[(_0x6a43('0x60'))]['ValidationError'](_0x6a43('0x6d'));}}return _0x2c8d2e;})[_0x6a43('0x19')](function(_0x5c58fb){if(_0x5c58fb){return _0x5c58fb['update']({'closed':_0x79d690['body'][_0x6a43('0x6e')],'disposition':_0x79d690[_0x6a43('0x34')][_0x6a43('0x6f')]})[_0x6a43('0x19')](function(_0x535227){return _0x535227;});}})[_0x6a43('0x19')](function(){return respondWithRpcPromise(_0x6a43('0x70'),_0x6a43('0x71'),_0x79d690[_0x6a43('0x34')],client9004);})[_0x6a43('0x19')](respondWithResult(_0xd04de0,null))['catch'](handleError(_0xd04de0,null));};exports[_0x6a43('0x72')]=function(_0x5de588,_0x9e1ac9){_0x5de588[_0x6a43('0x34')][_0x6a43('0x31')]=_0x5de588['file']['originalname'];_0x5de588[_0x6a43('0x34')][_0x6a43('0x73')]=_0x5de588[_0x6a43('0x74')][_0x6a43('0x75')];_0x5de588[_0x6a43('0x34')][_0x6a43('0x3d')]=_0x5de588[_0x6a43('0x74')]['mimetype'];return db[_0x6a43('0x76')][_0x6a43('0x4f')](_0x5de588[_0x6a43('0x34')])['then'](respondWithResult(_0x9e1ac9,0xc9))[_0x6a43('0x24')](handleError(_0x9e1ac9,null));};exports['attachmentDownload']=function(_0x153963,_0x350935){return db[_0x6a43('0x3b')][_0x6a43('0x52')]({'where':{'id':_0x153963['params']['id']},'raw':!![]})[_0x6a43('0x19')](handleEntityNotFound(_0x350935,null))[_0x6a43('0x19')](function(_0x2bf84f){if(_0x2bf84f){if(_0x2bf84f[_0x6a43('0x6e')]){return _0x350935[_0x6a43('0x26')](0x193)[_0x6a43('0x28')]({'status':0x193,'message':_0x6a43('0x77')});}return db[_0x6a43('0x76')][_0x6a43('0x52')]({'where':{'id':_0x153963[_0x6a43('0x44')][_0x6a43('0x78')]},'raw':!![]})[_0x6a43('0x19')](handleEntityNotFound(_0x350935,null));}})[_0x6a43('0x19')](function(_0x2ad16a){if(_0x2ad16a){var _0x346f99=_0x2ad16a[_0x6a43('0x79')]!==null;var _0x149e76=path[_0x6a43('0x7a')](config[_0x6a43('0x7b')],_0x6a43('0x7c'));if(_0x346f99){_0x149e76=path[_0x6a43('0x7a')](_0x149e76,_0x6a43('0x7d'));}var _0x32a36c=path[_0x6a43('0x7a')](_0x149e76,_0x2ad16a[_0x6a43('0x73')]);return _0x350935[_0x6a43('0x7e')](_0x32a36c);}})[_0x6a43('0x24')](handleError(_0x350935,null));};exports[_0x6a43('0x7f')]=function(_0x3ff1c0,_0x4a5782){var _0x3f8508=null;var _0x587bf7=null;var _0x157d93=null;if(_0x3ff1c0[_0x6a43('0x34')]['id']){delete _0x3ff1c0['body']['id'];}if(_0x3ff1c0['body'][_0x6a43('0x80')]){_0x157d93=path[_0x6a43('0x7a')](config[_0x6a43('0x7b')],'server/files/chat/upload/',util[_0x6a43('0x81')](_0x6a43('0x82'),Date[_0x6a43('0x83')]()));_0x3ff1c0[_0x6a43('0x34')][_0x6a43('0x84')]=_0x157d93;}return db[_0x6a43('0x3b')][_0x6a43('0x4e')]({'where':{'id':_0x3ff1c0[_0x6a43('0x42')]['id']},'include':[{'model':db[_0x6a43('0x65')],'as':'Messages','include':[{'model':db[_0x6a43('0x85')],'as':_0x6a43('0x85')}]}]})['then'](handleEntityNotFound(_0x4a5782,null))['then'](saveUpdates(_0x3ff1c0[_0x6a43('0x34')],null))[_0x6a43('0x19')](function(_0x353459){if(_0x353459){_0x3f8508=_0x353459;return db[_0x6a43('0x53')]['find']({'where':{'id':_0x3f8508[_0x6a43('0x54')]}});}})[_0x6a43('0x19')](function(_0x3eec5f){if(_0x3eec5f){_0x587bf7=_0x3eec5f;return db[_0x6a43('0x69')][_0x6a43('0x4e')]({'where':{'id':_0x3f8508[_0x6a43('0x86')]}});}})[_0x6a43('0x19')](function(_0x452b2f){if(_0x452b2f){if(_0x157d93){var _0x57ccee=null;for(var _0xb9b88f=0x1;_0xb9b88f<_0x3f8508[_0x6a43('0x87')]['length'];++_0xb9b88f){_0x57ccee=_0x3f8508[_0x6a43('0x87')][_0xb9b88f];var _0x14863c=_0x57ccee[_0x6a43('0x6c')]?util[_0x6a43('0x81')](_0x6a43('0x88'),_0x587bf7[_0x6a43('0x89')],_0x57ccee['UserId']):_0x6a43('0x8a');var _0x236d61=_0x3ff1c0[_0x6a43('0x34')][_0x6a43('0x8b')]||util[_0x6a43('0x81')]('%s%d',_0x6a43('0x8c'),_0x57ccee[_0x6a43('0x86')]);switch(_0x587bf7[_0x6a43('0x8d')]){case _0x6a43('0x8e'):_0x14863c=_0x57ccee[_0x6a43('0x6c')]?util[_0x6a43('0x81')]('%s%d',_0x587bf7[_0x6a43('0x89')],_0x57ccee[_0x6a43('0x6c')]):_0x6a43('0x8a');break;case _0x6a43('0x8f'):_0x14863c=_0x57ccee['UserId']?_0x57ccee[_0x6a43('0x85')][_0x6a43('0x90')]||_0x57ccee['User']['fullname']:_0x6a43('0x8a');break;case _0x6a43('0x91'):_0x14863c=_0x57ccee[_0x6a43('0x6c')]?_0x57ccee[_0x6a43('0x85')][_0x6a43('0x59')]:_0x6a43('0x8a');break;default:_0x14863c=_0x57ccee[_0x6a43('0x6c')]?util[_0x6a43('0x81')](_0x6a43('0x88'),_0x587bf7[_0x6a43('0x89')],_0x57ccee[_0x6a43('0x6c')]):_0x6a43('0x8a');}var _0x5c2fbb=util['format'](_0x6a43('0x92'),moment(_0x57ccee[_0x6a43('0x93')])[_0x6a43('0x81')](_0x6a43('0x94')),_0x57ccee[_0x6a43('0x95')]==='in'?_0x236d61:_0x14863c,_0x57ccee['body']);if(!_0x57ccee[_0x6a43('0x96')]){fs['appendFileSync'](_0x157d93,_0x5c2fbb);}}return db[_0x6a43('0x97')][_0x6a43('0x52')]({'where':{'service':!![]},'include':[{'model':db[_0x6a43('0x98')],'as':_0x6a43('0x99'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x6a43('0x9a'),'raw':!![]}]}]});}}})[_0x6a43('0x19')](function(_0x1d86d0){if(!_0x1d86d0||!_0x1d86d0[_0x6a43('0x99')]||!_0x3ff1c0[_0x6a43('0x34')])return _0x3f8508;var _0x27e206=_0x1d86d0[_0x6a43('0x9b')]();return respondWithRpcPromise(_0x6a43('0x9c'),_0x6a43('0x9d'),{'account':_0x27e206,'message':{'from':util['format'](_0x6a43('0x9e'),_0x1d86d0[_0x6a43('0x31')],_0x1d86d0[_0x6a43('0x5c')]||_0x1d86d0['Smtp'][_0x6a43('0x41')]),'to':_0x3ff1c0[_0x6a43('0x34')]['mailTranscript'],'subject':_0x6a43('0x9f'),'text':util[_0x6a43('0x81')](_0x6a43('0xa0'),_0x3ff1c0[_0x6a43('0x34')][_0x6a43('0x80')]),'attachments':[{'path':_0x157d93}]}})[_0x6a43('0x19')](function(){return _0x3f8508;})[_0x6a43('0x24')](function(_0x40e183){logger[_0x6a43('0x20')](_0x40e183);});})[_0x6a43('0x19')](respondWithStatusCode(_0x4a5782,0xc8))['catch'](handleError(_0x4a5782,null));};exports[_0x6a43('0xa1')]=function(_0x50bdd,_0x21d366){return db[_0x6a43('0x65')][_0x6a43('0x4e')]({'where':{'id':_0x50bdd[_0x6a43('0x42')]['id']}})['then'](handleEntityNotFound(_0x21d366,null))[_0x6a43('0x19')](function(_0x3e8ddb){if(_0x3e8ddb){return _0x3e8ddb[_0x6a43('0xa1')](_0x50bdd[_0x6a43('0x34')][_0x6a43('0xa2')],_[_0x6a43('0xa3')](_0x50bdd['body'],['ids','id'])||{});}})[_0x6a43('0x19')](respondWithResult(_0x21d366,null))[_0x6a43('0x24')](handleError(_0x21d366,null));};exports[_0x6a43('0xa4')]=function(_0x216544,_0x575c28){var _0x344d73={'raw':![],'where':{}};var _0x8e8309={};var _0x2fab58={'count':0x0,'rows':[]};return db[_0x6a43('0x3b')][_0x6a43('0x52')]({'where':{'id':_0x216544[_0x6a43('0x42')]['id']}})[_0x6a43('0x19')](handleEntityNotFound(_0x575c28,null))[_0x6a43('0x19')](function(_0x39fc3a){if(_0x39fc3a){_0x8e8309[_0x6a43('0x43')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x8e8309['query']=_[_0x6a43('0xa5')](_0x216544[_0x6a43('0x44')]);_0x8e8309['filters']=_[_0x6a43('0x47')](_0x8e8309[_0x6a43('0x43')],_0x8e8309['query']);_0x344d73['attributes']=_['intersection'](_0x8e8309[_0x6a43('0x43')],qs[_0x6a43('0x48')](_0x216544[_0x6a43('0x44')][_0x6a43('0x48')]));_0x344d73[_0x6a43('0x46')]=_0x344d73['attributes'][_0x6a43('0x49')]?_0x344d73[_0x6a43('0x46')]:_0x8e8309[_0x6a43('0x43')];if(!_0x216544[_0x6a43('0x44')][_0x6a43('0xa6')]('nolimit')){_0x344d73[_0x6a43('0x2a')]=qs[_0x6a43('0x2a')](_0x216544['query'][_0x6a43('0x2a')]);_0x344d73['offset']=qs['offset'](_0x216544[_0x6a43('0x44')][_0x6a43('0x29')]);}_0x344d73[_0x6a43('0xa7')]=qs['sort'](_0x216544[_0x6a43('0x44')][_0x6a43('0xa8')]);_0x344d73[_0x6a43('0xa9')]=qs[_0x6a43('0x45')](_[_0x6a43('0xaa')](_0x216544[_0x6a43('0x44')],_0x8e8309[_0x6a43('0x45')]));_0x344d73[_0x6a43('0xa9')][_0x6a43('0xab')]=_0x39fc3a['id'];if(_0x216544[_0x6a43('0x44')][_0x6a43('0xac')]){_0x344d73[_0x6a43('0xa9')]=_['merge'](_0x344d73[_0x6a43('0xa9')],{'$or':_[_0x6a43('0x3a')](_0x344d73[_0x6a43('0x46')],function(_0x527b39){var _0x9140a6={};_0x9140a6[_0x527b39]={'$like':'%'+_0x216544[_0x6a43('0x44')]['filter']+'%'};return _0x9140a6;})});}if(_0x216544[_0x6a43('0x44')]['$gte']){var _0x35a3c1=_0x216544['query']['$gte'][_0x6a43('0xad')](',');var _0x44d1bc={};_0x44d1bc[_0x35a3c1[0x0]]={'$gte':moment(_0x35a3c1[0x1])['format'](_0x6a43('0xae'))};_0x344d73['where']=_['merge'](_0x344d73[_0x6a43('0xa9')],_0x44d1bc);}_0x344d73=_[_0x6a43('0x4c')]({},_0x344d73,_0x216544[_0x6a43('0x4d')]);return db['ChatMessage'][_0x6a43('0x2c')]({'where':_0x344d73[_0x6a43('0xa9')]})['then'](function(_0x70c01c){_0x2fab58['count']=_0x70c01c;if(_0x216544[_0x6a43('0x44')]['includeAll']){_0x344d73[_0x6a43('0x4b')]=[{'all':!![]}];}return db[_0x6a43('0x65')]['findAll'](_0x344d73);})[_0x6a43('0x19')](function(_0x419abb){_0x2fab58[_0x6a43('0xaf')]=_0x419abb;return _0x2fab58;});}})[_0x6a43('0x19')](respondWithFilteredResult(_0x575c28,_0x344d73))[_0x6a43('0x24')](handleError(_0x575c28,null));};exports[_0x6a43('0xb0')]=function(_0x2cb37f,_0x469175){var _0x46f1c6={'where':{}},_0x38fe3e={},_0xe9504c={'count':0x0,'rows':[]};return db[_0x6a43('0x3b')][_0x6a43('0x52')]({'where':{'id':_0x2cb37f[_0x6a43('0x42')]['id']}})[_0x6a43('0x19')](handleEntityNotFound(_0x469175,null))[_0x6a43('0x19')](function(_0x25bac0){if(_0x25bac0){_0x38fe3e[_0x6a43('0x43')]=_['keys'](db['ChatMessage'][_0x6a43('0x3c')]);_0x38fe3e['query']=_['keys'](_0x2cb37f[_0x6a43('0x44')]);_0x38fe3e['filters']=_[_0x6a43('0x47')](_0x38fe3e[_0x6a43('0x43')],_0x38fe3e['query']);_0x46f1c6[_0x6a43('0x46')]=_[_0x6a43('0x47')](_0x38fe3e[_0x6a43('0x43')],qs[_0x6a43('0x48')](_0x2cb37f['query']['fields']));_0x46f1c6[_0x6a43('0x46')]=_0x46f1c6[_0x6a43('0x46')]['length']?_0x46f1c6['attributes']:_0x38fe3e[_0x6a43('0x43')];if(!_0x2cb37f[_0x6a43('0x44')][_0x6a43('0xa6')]('nolimit')){_0x46f1c6[_0x6a43('0x2a')]=qs[_0x6a43('0x2a')](_0x2cb37f[_0x6a43('0x44')][_0x6a43('0x2a')]);_0x46f1c6['offset']=qs[_0x6a43('0x29')](_0x2cb37f[_0x6a43('0x44')][_0x6a43('0x29')]);}_0x46f1c6[_0x6a43('0xa7')]=qs[_0x6a43('0xa8')](_0x2cb37f[_0x6a43('0x44')]['sort']);_0x46f1c6['where']=qs[_0x6a43('0x45')](_[_0x6a43('0xaa')](_0x2cb37f[_0x6a43('0x44')],_0x38fe3e['filters']));_0x46f1c6[_0x6a43('0xa9')][_0x6a43('0xab')]=_0x25bac0['id'];if(_0x2cb37f[_0x6a43('0x44')][_0x6a43('0xac')]){_0x46f1c6[_0x6a43('0xa9')]=_[_0x6a43('0x4c')](_0x46f1c6[_0x6a43('0xa9')],{'$or':_[_0x6a43('0x3a')](_0x46f1c6[_0x6a43('0x46')],function(_0x1f2b52){var _0x2597c0={};_0x2597c0[_0x1f2b52]={'$like':'%'+_0x2cb37f[_0x6a43('0x44')]['filter']+'%'};return _0x2597c0;})});}_0x46f1c6[_0x6a43('0xa9')]['secret']=![];if(_0x2cb37f[_0x6a43('0x44')]['id']){_0x46f1c6['where']['id']={'$gt':_0x2cb37f[_0x6a43('0x44')]['id']};}_0x46f1c6=_[_0x6a43('0x4c')]({},_0x46f1c6,_0x2cb37f[_0x6a43('0x4d')]);return db['ChatMessage']['count']({'where':_0x46f1c6['where']})[_0x6a43('0x19')](function(_0x5ae5b3){_0xe9504c[_0x6a43('0x2c')]=_0x5ae5b3;_0x46f1c6[_0x6a43('0x4b')]=[];if(_0x2cb37f[_0x6a43('0x44')][_0x6a43('0xb1')]){_0x46f1c6['include']['push']({'model':db['User'],'as':_0x6a43('0x85'),'attributes':['id','fullname',_0x6a43('0x90')]});}if(_0x2cb37f[_0x6a43('0x44')][_0x6a43('0x4a')]){_0x46f1c6[_0x6a43('0x4b')]=[{'all':!![]}];}return db[_0x6a43('0x65')][_0x6a43('0xb2')](_0x46f1c6);})[_0x6a43('0x19')](function(_0x330be7){_0xe9504c[_0x6a43('0xaf')]=_0x330be7;return _0xe9504c;});}})['then'](respondWithFilteredResult(_0x469175,_0x46f1c6))['catch'](handleError(_0x469175,null));};exports[_0x6a43('0xb3')]=function(_0x141571,_0x1800ea){return db[_0x6a43('0x3b')][_0x6a43('0x4e')]({'where':{'id':_0x141571[_0x6a43('0x42')]['id']}})[_0x6a43('0x19')](handleEntityNotFound(_0x1800ea,null))[_0x6a43('0x19')](function(_0x54edf1){if(_0x54edf1){return _0x54edf1['setTags'](_0x141571[_0x6a43('0x34')][_0x6a43('0xa2')],_[_0x6a43('0xa3')](_0x141571[_0x6a43('0x34')],[_0x6a43('0xa2'),'id'])||{})['spread'](function(){return db[_0x6a43('0xb4')][_0x6a43('0xb2')]({'attributes':['id',_0x6a43('0x31'),_0x6a43('0xb5')],'where':{'id':_0x141571[_0x6a43('0x34')][_0x6a43('0xa2')]}});})[_0x6a43('0x19')](function(_0x3a3d90){socket[_0x6a43('0xb6')](_0x6a43('0xb7'),{'id':Number(_0x141571[_0x6a43('0x42')]['id']),'tags':_0x3a3d90||[]});return{'id':Number(_0x141571[_0x6a43('0x42')]['id']),'tags':_0x3a3d90||[]};});}})[_0x6a43('0x19')](respondWithResult(_0x1800ea,null))[_0x6a43('0x24')](handleError(_0x1800ea,null));};exports[_0x6a43('0xb8')]=function(_0x43759a,_0x2cc3dc){return db['ChatInteraction'][_0x6a43('0x4e')]({'where':{'id':_0x43759a['params']['id']}})['then'](handleEntityNotFound(_0x2cc3dc,null))[_0x6a43('0x19')](function(_0x54c906){if(_0x54c906){return _0x54c906['removeTags'](_0x43759a[_0x6a43('0x44')][_0x6a43('0xa2')]);}})[_0x6a43('0x19')](respondWithStatusCode(_0x2cc3dc,null))[_0x6a43('0x24')](handleError(_0x2cc3dc,null));};exports[_0x6a43('0x7e')]=function(_0x196a34,_0x39bc5d){var _0x528c40=moment()[_0x6a43('0xb9')]()[_0x6a43('0xba')]();var _0x52e3b4=path['join'](config['root'],'server',_0x6a43('0xbb'),'tmp');var _0x337486=path[_0x6a43('0x7a')](config[_0x6a43('0x7b')],_0x6a43('0xbc'),_0x6a43('0xbb'),'attachments');var _0x4cf14a=path[_0x6a43('0x7a')](_0x52e3b4,_0x528c40);var _0x376c7c=util[_0x6a43('0x81')](_0x6a43('0xbd'),_0x196a34[_0x6a43('0x42')]['id'],_0x528c40);var _0xf73aa3=path[_0x6a43('0x7a')](_0x52e3b4,_0x376c7c);var _0x407908=[];_0x407908[_0x6a43('0xbe')]({'model':db[_0x6a43('0x85')],'as':_0x6a43('0x85'),'attributes':['id',_0x6a43('0x59')],'raw':!![]});_0x407908[_0x6a43('0xbe')]({'model':db[_0x6a43('0x69')],'as':_0x6a43('0x6a'),'attributes':['id',_0x6a43('0xbf'),_0x6a43('0xc0')],'raw':!![]});if(_0x196a34[_0x6a43('0x44')]['attachments']){_0x407908[_0x6a43('0xbe')]({'model':db[_0x6a43('0x76')],'as':'Attachment','raw':!![]});}var _0x12fe39=[{'model':db[_0x6a43('0x65')],'as':_0x6a43('0x87'),'attributes':['id','body',_0x6a43('0x93'),'direction',_0x6a43('0x96'),_0x6a43('0xc1')],'include':_0x407908}];_0x12fe39[_0x6a43('0xbe')]({'model':db['ChatWebsite'],'as':_0x6a43('0xc2'),'attributes':['id',_0x6a43('0x31')]});_0x12fe39[_0x6a43('0xbe')]({'model':db[_0x6a43('0x85')],'as':_0x6a43('0xc3'),'attributes':['id',_0x6a43('0x59')]});return db[_0x6a43('0x3b')][_0x6a43('0x4e')]({'where':{'id':_0x196a34['params']['id']},'include':_0x12fe39})['then'](handleEntityNotFound(_0x39bc5d,null))[_0x6a43('0x19')](function(_0x3b76d2){if(_0x3b76d2){var _0x4eb1d8=_0x3b76d2[_0x6a43('0xc4')]({'plain':!![]});fs[_0x6a43('0xc5')](_0x4cf14a);var _0x385124={'channel':_0x6a43('0xc6'),'account':_0x4eb1d8[_0x6a43('0xc2')]['name'],'agent':_0x4eb1d8[_0x6a43('0xc3')]?_0x4eb1d8['Owner'][_0x6a43('0x59')]:_0x6a43('0xc7'),'createdAt':moment(_0x4eb1d8[_0x6a43('0x93')])[_0x6a43('0x81')](_0x6a43('0xae'))[_0x6a43('0xba')](),'closedAt':_0x4eb1d8[_0x6a43('0x6e')]?moment(_0x4eb1d8[_0x6a43('0xc8')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x6a43('0xba')]():'','disposition':_0x4eb1d8[_0x6a43('0x6f')],'chatInfo':{'browser':_0x4eb1d8[_0x6a43('0xc9')],'os':_0x4eb1d8[_0x6a43('0xca')],'referer':_0x4eb1d8[_0x6a43('0xcb')],'customerIp':_0x4eb1d8['customerIp'],'customerPort':_0x4eb1d8['customerPort']?_0x4eb1d8[_0x6a43('0xcc')]:_0x6a43('0xc7')},'messages':_(_0x4eb1d8[_0x6a43('0x87')])[_0x6a43('0xcd')]()[_0x6a43('0xac')]({'secret':![]})[_0x6a43('0x3a')](function(_0x1e01d8){if(_0x1e01d8[_0x6a43('0x76')]){var _0x4b1bfa=path[_0x6a43('0x7a')](_0x337486,_0x1e01d8['Attachment'][_0x6a43('0x73')]);if(fs[_0x6a43('0xce')](_0x4b1bfa)){fs['createReadStream'](_0x4b1bfa)['pipe'](fs[_0x6a43('0xcf')](path[_0x6a43('0x7a')](_0x4cf14a,_0x1e01d8['Attachment'][_0x6a43('0x73')])));}}return{'date':moment(_0x1e01d8[_0x6a43('0x93')])[_0x6a43('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6a43('0xba')](),'sender':_0x1e01d8['direction']===_0x6a43('0x64')?_0x1e01d8[_0x6a43('0x85')]?_0x1e01d8[_0x6a43('0x85')][_0x6a43('0x59')]:'System':_0x1e01d8[_0x6a43('0x6a')][_0x6a43('0xbf')]+(_0x1e01d8['Contact'][_0x6a43('0xc0')]?'\x20'+_0x1e01d8[_0x6a43('0x6a')][_0x6a43('0xc0')]:''),'body':_0x1e01d8[_0x6a43('0x76')]?_0x1e01d8[_0x6a43('0x76')][_0x6a43('0x73')]:_0x1e01d8[_0x6a43('0x34')],'direction':_0x1e01d8['direction']==='out'?'A':'C','secret':_0x1e01d8['secret'],'read':_0x1e01d8[_0x6a43('0xc1')],'attachment':_0x1e01d8[_0x6a43('0x76')]};})[_0x6a43('0xd0')]()};return ejs[_0x6a43('0xd1')](path[_0x6a43('0x7a')](config[_0x6a43('0x7b')],_0x6a43('0xbc'),'views',_0x6a43('0xd2')),{'interaction':_0x385124})[_0x6a43('0x19')](function(_0x4326f1){var _0x3fbbc7=path[_0x6a43('0x7a')](_0x4cf14a,'transcript-'+_0x4eb1d8['id']+'-'+_0x528c40+'.pdf');var _0x170c06={'path':_0x3fbbc7,'channel':'Chat','interactionId':_0x4eb1d8['id']};return pdf[_0x6a43('0xd3')](_0x4326f1,_0x170c06);})[_0x6a43('0x19')](function(){return new Promise(function(_0x5b2a52,_0x1b76b7){zipdir(_0x4cf14a,{'saveTo':_0xf73aa3},function(_0x2d6895,_0x24e960){if(_0x2d6895)return _0x1b76b7(_0x2d6895);return _0x5b2a52(_0x24e960);});})['then'](function(){return new BPromise(function(_0xbe6961,_0x266d77){rimraf(_0x4cf14a,function(_0x21088f){if(_0x21088f)_0x266d77(_0x21088f);return _0xbe6961();});});})['then'](function(){return _0x39bc5d[_0x6a43('0x7e')](_0xf73aa3,_0x376c7c,function(_0x364023){if(_0x364023){logger[_0x6a43('0x20')](_0x6a43('0xd4'),_0x364023);}else{fs[_0x6a43('0xd5')](_0xf73aa3);}});});});}else{return _0x39bc5d[_0x6a43('0x25')](0xc8);}})[_0x6a43('0x24')](handleError(_0x39bc5d,null));};
\ No newline at end of file
+var _0x08fc=['email','contact','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooNote','follow','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','UserId','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','where','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','includeAgent','push','alias','rows','addTags','setTags','spread','Tag','color','emit','removeTags','unix','toString','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','read','Owner','get','mkdirSync','Chat','closedAt','disposition','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','out','value','renderFile','views','downloadInteraction.ejs','transcript-','err','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','api','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','end','sendStatus','name','send','merge','body','agent','index','ChatInteraction','rawAttributes','fieldName','type','key','findAll','chat','query','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','user','fullname'];(function(_0x404554,_0x43c7cb){var _0x573664=function(_0x5e1845){while(--_0x5e1845){_0x404554['push'](_0x404554['shift']());}};_0x573664(++_0x43c7cb);}(_0x08fc,0x14d));var _0xc08f=function(_0x11e03f,_0x20b967){_0x11e03f=_0x11e03f-0x0;var _0x5666fe=_0x08fc[_0x11e03f];return _0x5666fe;};'use strict';var rimraf=require(_0xc08f('0x0'));var zipdir=require(_0xc08f('0x1'));var rp=require(_0xc08f('0x2'));var moment=require(_0xc08f('0x3'));var BPromise=require(_0xc08f('0x4'));var Mustache=require(_0xc08f('0x5'));var util=require(_0xc08f('0x6'));var path=require(_0xc08f('0x7'));var ejs=require(_0xc08f('0x8'));var fs=require('fs');var _=require(_0xc08f('0x9'));var Redis=require(_0xc08f('0xa'));var interaction=require(_0xc08f('0xb'));var qs=require('../../components/parsers/qs');var pdf=require(_0xc08f('0xc'));var logger=require('../../config/logger')(_0xc08f('0xd'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xc08f('0xe')]=_[_0xc08f('0xf')](config[_0xc08f('0xe')],{'host':_0xc08f('0x10'),'port':0x18eb});var socket=require(_0xc08f('0x11'))(new Redis(config[_0xc08f('0xe')]));require(_0xc08f('0x12'))[_0xc08f('0x13')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc08f('0x14')]['http']({'port':0x232b});var client9004=jayson[_0xc08f('0x14')][_0xc08f('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x59859f,_0x4eb3a7,_0x19a6e0,_0x32b68d){return new BPromise(function(_0x5bc5fc,_0x57ee3e){var _0x484b16=_0x32b68d||client;return _0x484b16[_0xc08f('0x16')](_0x59859f,_0x19a6e0)[_0xc08f('0x17')](function(_0x364185){logger[_0xc08f('0x18')](_0xc08f('0x19'),_0x4eb3a7,'request\x20sent');logger[_0xc08f('0x1a')](_0xc08f('0x1b'),_0x4eb3a7,_0xc08f('0x1c'),JSON[_0xc08f('0x1d')](_0x364185));if(_0x364185['error']){if(_0x364185[_0xc08f('0x1e')][_0xc08f('0x1f')]===0x1f4){logger[_0xc08f('0x1e')](_0xc08f('0x19'),_0x4eb3a7,_0x364185[_0xc08f('0x1e')]['message']);return _0x57ee3e(_0x364185['error'][_0xc08f('0x20')]);}logger[_0xc08f('0x1e')](_0xc08f('0x19'),_0x4eb3a7,_0x364185[_0xc08f('0x1e')]['message']);return _0x5bc5fc(_0x364185[_0xc08f('0x1e')][_0xc08f('0x20')]);}else{logger[_0xc08f('0x18')](_0xc08f('0x19'),_0x4eb3a7,_0xc08f('0x1c'));_0x5bc5fc(_0x364185[_0xc08f('0x21')][_0xc08f('0x20')]);}})[_0xc08f('0x22')](function(_0x38b420){logger['error'](_0xc08f('0x19'),_0x4eb3a7,_0x38b420);_0x57ee3e(_0x38b420);});});}function respondWithStatusCode(_0xf6f5a7,_0x52f11e){_0x52f11e=_0x52f11e||0xcc;return function(_0x32875f){if(_0x32875f){return _0xf6f5a7['sendStatus'](_0x52f11e);}return _0xf6f5a7[_0xc08f('0x23')](_0x52f11e)['end']();};}function respondWithResult(_0x170090,_0x27e044){_0x27e044=_0x27e044||0xc8;return function(_0x291d6d){if(_0x291d6d){return _0x170090[_0xc08f('0x23')](_0x27e044)[_0xc08f('0x24')](_0x291d6d);}};}function respondWithFilteredResult(_0x5ec8f3,_0x2bcdf6){return function(_0x3c5309){if(_0x3c5309){var _0x47be14=typeof _0x2bcdf6['offset']===_0xc08f('0x25')&&typeof _0x2bcdf6[_0xc08f('0x26')]===_0xc08f('0x25');var _0x5e6714=_0x3c5309[_0xc08f('0x27')];var _0x6634cd=_0x47be14?0x0:_0x2bcdf6[_0xc08f('0x28')];var _0x2102f8=_0x47be14?_0x3c5309[_0xc08f('0x27')]:_0x2bcdf6['offset']+_0x2bcdf6['limit'];var _0xf86e62;if(_0x2102f8>=_0x5e6714){_0x2102f8=_0x5e6714;_0xf86e62=0xc8;}else{_0xf86e62=0xce;}_0x5ec8f3[_0xc08f('0x23')](_0xf86e62);return _0x5ec8f3[_0xc08f('0x29')](_0xc08f('0x2a'),_0x6634cd+'-'+_0x2102f8+'/'+_0x5e6714)[_0xc08f('0x24')](_0x3c5309);}return null;};}function saveUpdates(_0x441e1d){return function(_0x256a7d){if(_0x256a7d){return _0x256a7d[_0xc08f('0x2b')](_0x441e1d)[_0xc08f('0x17')](function(_0x1b2b81){return _0x1b2b81;});}return null;};}function removeEntity(_0x3a1d45){return function(_0x5e4bce){if(_0x5e4bce){return _0x5e4bce[_0xc08f('0x2c')]()[_0xc08f('0x17')](function(){_0x3a1d45[_0xc08f('0x23')](0xcc)[_0xc08f('0x2d')]();});}};}function handleEntityNotFound(_0x35f3b9){return function(_0x3ab023){if(!_0x3ab023){_0x35f3b9[_0xc08f('0x2e')](0x194);}return _0x3ab023;};}function handleError(_0x2120c9,_0x575613){_0x575613=_0x575613||0x1f4;return function(_0x3684eb){logger['error'](_0x3684eb['stack']);if(_0x3684eb[_0xc08f('0x2f')]){delete _0x3684eb[_0xc08f('0x2f')];}_0x2120c9['status'](_0x575613)[_0xc08f('0x30')](_0x3684eb);};}function getMustacheRender(_0x291392,_0x10d9cb){return Mustache['render'](_0x291392,_[_0xc08f('0x31')](_0x10d9cb[_0xc08f('0x32')],{'contact':_0x10d9cb['contact'],'message':_0x10d9cb[_0xc08f('0x20')],'agent':_0x10d9cb[_0xc08f('0x33')],'interaction':_0x10d9cb['interaction'],'account':_0x10d9cb['account']}))||'';}exports[_0xc08f('0x34')]=function(_0x2107bd,_0x24e58c){var _0x37c83e={};var _0x5164fd=_['map'](db[_0xc08f('0x35')][_0xc08f('0x36')],function(_0x24c00f){return{'name':_0x24c00f[_0xc08f('0x37')],'type':_0x24c00f[_0xc08f('0x38')][_0xc08f('0x39')]};});_0x37c83e=qs['getOptions'](_0x5164fd,_0x2107bd);return interaction[_0xc08f('0x3a')](_0xc08f('0x3b'),_0x2107bd[_0xc08f('0x3c')],_0x2107bd['user'],_0x37c83e,_0x5164fd)['then'](respondWithFilteredResult(_0x24e58c,_0x37c83e))['catch'](handleError(_0x24e58c,null));};exports['show']=function(_0x5c2b48,_0x2e7880){var _0x4d8ba0={'raw':![],'where':{'id':_0x5c2b48[_0xc08f('0x3d')]['id']}},_0x583acd={};_0x583acd[_0xc08f('0x3e')]=_['keys'](db[_0xc08f('0x35')][_0xc08f('0x36')]);_0x583acd[_0xc08f('0x3c')]=_[_0xc08f('0x3f')](_0x5c2b48[_0xc08f('0x3c')]);_0x583acd[_0xc08f('0x40')]=_[_0xc08f('0x41')](_0x583acd[_0xc08f('0x3e')],_0x583acd['query']);_0x4d8ba0[_0xc08f('0x42')]=_[_0xc08f('0x41')](_0x583acd[_0xc08f('0x3e')],qs['fields'](_0x5c2b48[_0xc08f('0x3c')][_0xc08f('0x43')]));_0x4d8ba0[_0xc08f('0x42')]=_0x4d8ba0['attributes'][_0xc08f('0x44')]?_0x4d8ba0[_0xc08f('0x42')]:_0x583acd[_0xc08f('0x3e')];if(_0x5c2b48[_0xc08f('0x3c')][_0xc08f('0x45')]){_0x4d8ba0[_0xc08f('0x46')]=[{'all':!![]}];}_0x4d8ba0=_[_0xc08f('0x31')]({},_0x4d8ba0,_0x5c2b48[_0xc08f('0x47')]);return db['ChatInteraction'][_0xc08f('0x48')](_0x4d8ba0)[_0xc08f('0x17')](handleEntityNotFound(_0x2e7880,null))[_0xc08f('0x17')](respondWithResult(_0x2e7880,null))[_0xc08f('0x22')](handleError(_0x2e7880,null));};exports[_0xc08f('0x49')]=function(_0x21bb4c,_0x5e6abc){return db[_0xc08f('0x35')][_0xc08f('0x49')](_0x21bb4c[_0xc08f('0x32')],{})[_0xc08f('0x17')](respondWithResult(_0x5e6abc,0xc9))[_0xc08f('0x22')](handleError(_0x5e6abc,null));};exports['update']=function(_0x3de9d2,_0x2b9ece){if(_0x3de9d2['body']['id']){delete _0x3de9d2[_0xc08f('0x32')]['id'];}return db['ChatInteraction'][_0xc08f('0x48')]({'where':{'id':_0x3de9d2['params']['id']}})[_0xc08f('0x17')](handleEntityNotFound(_0x2b9ece,null))['then'](saveUpdates(_0x3de9d2['body'],null))[_0xc08f('0x17')](respondWithResult(_0x2b9ece,null))['catch'](handleError(_0x2b9ece,null));};exports['destroy']=function(_0x412e41,_0x7f46db){return db[_0xc08f('0x35')]['find']({'where':{'id':_0x412e41[_0xc08f('0x3d')]['id']}})[_0xc08f('0x17')](handleEntityNotFound(_0x7f46db,null))[_0xc08f('0x17')](removeEntity(_0x7f46db,null))[_0xc08f('0x22')](handleError(_0x7f46db,null));};exports[_0xc08f('0x4a')]=function(_0x7d7ede,_0x56889a){return db['ChatInteraction']['describe']()[_0xc08f('0x17')](respondWithResult(_0x56889a,null))[_0xc08f('0x22')](handleError(_0x56889a,null));};exports[_0xc08f('0x4b')]=function(_0x4cd1d1,_0x5c33cb){var _0x147749=_0x4cd1d1[_0xc08f('0x3d')]['id'];var _0x4725a2;var _0x16f5c3;var _0x4d1262;return db[_0xc08f('0x35')][_0xc08f('0x4c')]({'where':{'id':_0x147749}})[_0xc08f('0x17')](function(_0x1bf8af){_0x4725a2=_0x1bf8af;return db[_0xc08f('0x4d')][_0xc08f('0x4c')]({'where':{'id':_0x1bf8af[_0xc08f('0x4e')]},'attributes':['id','vidaooApiKey',_0xc08f('0x4f'),_0xc08f('0x50'),'vidaooNote',_0xc08f('0x51')],'raw':!![]});})['then'](function(_0x26871e){if(_0x26871e&&_0x26871e[_0xc08f('0x52')]&&_0x26871e[_0xc08f('0x4f')]){_0x16f5c3=_0x26871e;var _0x6f2336={'interaction':{'id':_0x147749},'agent':{'id':_0x4cd1d1[_0xc08f('0x53')]['id'],'name':_0x4cd1d1[_0xc08f('0x53')]['name'],'fullname':_0x4cd1d1[_0xc08f('0x53')][_0xc08f('0x54')],'email':_0x4cd1d1['user'][_0xc08f('0x55')]},'contact':_0x4cd1d1['body'][_0xc08f('0x56')],'account':_0x4cd1d1[_0xc08f('0x32')][_0xc08f('0x57')]};var _0x5c8967={'rejectUnauthorized':![],'method':_0xc08f('0x58'),'url':_0xc08f('0x59'),'headers':{'X-APIKEY':_0x26871e[_0xc08f('0x52')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4cd1d1[_0xc08f('0x53')][_0xc08f('0x55')]],'buttons':null,'topic':_0x16f5c3[_0xc08f('0x50')],'note':_['isNull'](_0x16f5c3[_0xc08f('0x5a')])?null:getMustacheRender(_0x16f5c3[_0xc08f('0x5a')],_0x6f2336),'metadata':null},'redirect':_0xc08f('0x5b'),'json':!![]};try{if(!_[_0xc08f('0x5c')](_0x16f5c3['vidaooMetadata'])){var _0x23f22f=getMustacheRender(_0x16f5c3[_0xc08f('0x51')],_0x6f2336);var _0x2e15ee=JSON['parse'](_0x23f22f);_0x5c8967[_0xc08f('0x32')][_0xc08f('0x5d')]=_0x2e15ee;}}catch(_0x43dfbb){throw new db[(_0xc08f('0x5e'))][(_0xc08f('0x5f'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5c8967);}else{throw new db[(_0xc08f('0x5e'))][(_0xc08f('0x5f'))](_0xc08f('0x60'));}})[_0xc08f('0x17')](function(_0x5df1b0){_0x4d1262=_0x5df1b0;if(_0x4d1262['id']){var _0x5baaa8={'body':_0x4d1262['join_url'],'ChatWebsiteId':_0x16f5c3['id'],'ChatInteractionId':_0x4725a2['id'],'direction':'out','UserId':_0x4cd1d1[_0xc08f('0x53')]['id']};return db[_0xc08f('0x61')]['create'](_0x5baaa8,{});}else{throw new db[(_0xc08f('0x5e'))][(_0xc08f('0x5f'))](_0xc08f('0x62'));}})['then'](function(){return _0x4725a2[_0xc08f('0x63')]({'vidaooSessionId':_0x4d1262['id']});})[_0xc08f('0x17')](respondWithResult(_0x5c33cb,null))[_0xc08f('0x22')](handleError(_0x5c33cb,null));};exports[_0xc08f('0x64')]=function(_0x23bb9b,_0x5b1de2){if(_0x23bb9b['body']['id']){delete _0x23bb9b['body']['id'];}return db[_0xc08f('0x35')][_0xc08f('0x48')]({'where':{'id':_0x23bb9b[_0xc08f('0x3d')]['id']},'include':[{'model':db['CmContact'],'as':_0xc08f('0x65')}]})[_0xc08f('0x17')](handleEntityNotFound(_0x5b1de2,null))[_0xc08f('0x17')](saveUpdates(_0x23bb9b[_0xc08f('0x32')],null))[_0xc08f('0x17')](respondWithResult(_0x5b1de2,null))['catch'](handleError(_0x5b1de2,null));};exports[_0xc08f('0x66')]=function(_0x3731a4,_0x43d861){if(_0x3731a4[_0xc08f('0x32')]['id']){delete _0x3731a4['body']['id'];}return db[_0xc08f('0x35')][_0xc08f('0x48')]({'where':{'id':_0x3731a4[_0xc08f('0x3d')]['id']}})[_0xc08f('0x17')](function(_0xe20adb){if(!_0xe20adb){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0xc08f('0x67'));_0x43d861['sendStatus'](0x194);}else{if(_0xe20adb[_0xc08f('0x68')]){throw new db[(_0xc08f('0x5e'))][(_0xc08f('0x5f'))]('Interaction\x20already\x20assigned');}}return _0xe20adb;})['then'](function(_0x4cbcf7){if(_0x4cbcf7){return _0x4cbcf7[_0xc08f('0x2b')]({'closed':_0x3731a4[_0xc08f('0x32')]['closed'],'disposition':_0x3731a4[_0xc08f('0x32')]['disposition']})[_0xc08f('0x17')](function(_0x18b64a){return _0x18b64a;});}})[_0xc08f('0x17')](function(){return respondWithRpcPromise('AbandonInteraction',_0xc08f('0x66'),_0x3731a4[_0xc08f('0x32')],client9004);})['then'](respondWithResult(_0x43d861,null))[_0xc08f('0x22')](handleError(_0x43d861,null));};exports[_0xc08f('0x69')]=function(_0x2bb613,_0x51e508){_0x2bb613[_0xc08f('0x32')][_0xc08f('0x2f')]=_0x2bb613[_0xc08f('0x6a')][_0xc08f('0x6b')];_0x2bb613[_0xc08f('0x32')][_0xc08f('0x6c')]=_0x2bb613[_0xc08f('0x6a')][_0xc08f('0x6d')];_0x2bb613[_0xc08f('0x32')]['type']=_0x2bb613[_0xc08f('0x6a')]['mimetype'];return db[_0xc08f('0x6e')][_0xc08f('0x49')](_0x2bb613['body'])[_0xc08f('0x17')](respondWithResult(_0x51e508,0xc9))[_0xc08f('0x22')](handleError(_0x51e508,null));};exports[_0xc08f('0x6f')]=function(_0x40c00c,_0x1a5bd1){return db[_0xc08f('0x35')]['findOne']({'where':{'id':_0x40c00c[_0xc08f('0x3d')]['id']},'raw':!![]})[_0xc08f('0x17')](handleEntityNotFound(_0x1a5bd1,null))[_0xc08f('0x17')](function(_0x34bbe8){if(_0x34bbe8){if(_0x34bbe8[_0xc08f('0x70')]){return _0x1a5bd1[_0xc08f('0x23')](0x193)[_0xc08f('0x24')]({'status':0x193,'message':_0xc08f('0x71')});}return db[_0xc08f('0x6e')][_0xc08f('0x4c')]({'where':{'id':_0x40c00c[_0xc08f('0x3c')][_0xc08f('0x72')]},'raw':!![]})[_0xc08f('0x17')](handleEntityNotFound(_0x1a5bd1,null));}})[_0xc08f('0x17')](function(_0x15b50f){if(_0x15b50f){var _0x2d11a9=_0x15b50f[_0xc08f('0x73')]!==null;var _0x12bc11=path[_0xc08f('0x74')](config[_0xc08f('0x75')],_0xc08f('0x76'));if(_0x2d11a9){_0x12bc11=path[_0xc08f('0x74')](_0x12bc11,_0xc08f('0x77'));}var _0x30d721=path[_0xc08f('0x74')](_0x12bc11,_0x15b50f[_0xc08f('0x6c')]);return _0x1a5bd1[_0xc08f('0x78')](_0x30d721);}})[_0xc08f('0x22')](handleError(_0x1a5bd1,null));};exports['close']=function(_0x347510,_0x16e90d){var _0x404e9e=null;var _0x23e0bf=null;var _0x22d761=null;if(_0x347510[_0xc08f('0x32')]['id']){delete _0x347510['body']['id'];}if(_0x347510[_0xc08f('0x32')][_0xc08f('0x79')]){_0x22d761=path['join'](config[_0xc08f('0x75')],_0xc08f('0x7a'),util[_0xc08f('0x7b')](_0xc08f('0x7c'),Date[_0xc08f('0x7d')]()));_0x347510['body'][_0xc08f('0x7e')]=_0x22d761;}return db[_0xc08f('0x35')][_0xc08f('0x48')]({'where':{'id':_0x347510[_0xc08f('0x3d')]['id']},'include':[{'model':db[_0xc08f('0x61')],'as':_0xc08f('0x7f'),'include':[{'model':db[_0xc08f('0x80')],'as':_0xc08f('0x80')}]}]})['then'](handleEntityNotFound(_0x16e90d,null))[_0xc08f('0x17')](saveUpdates(_0x347510[_0xc08f('0x32')],null))[_0xc08f('0x17')](function(_0x57c6fe){if(_0x57c6fe){_0x404e9e=_0x57c6fe;return db[_0xc08f('0x4d')][_0xc08f('0x48')]({'where':{'id':_0x404e9e[_0xc08f('0x4e')]}});}})['then'](function(_0x44f35f){if(_0x44f35f){_0x23e0bf=_0x44f35f;return db[_0xc08f('0x81')][_0xc08f('0x48')]({'where':{'id':_0x404e9e[_0xc08f('0x82')]}});}})['then'](function(_0x44f31e){if(_0x44f31e){if(_0x22d761){var _0x34cedc=null;for(var _0x4d4c89=0x1;_0x4d4c89<_0x404e9e[_0xc08f('0x7f')][_0xc08f('0x44')];++_0x4d4c89){_0x34cedc=_0x404e9e[_0xc08f('0x7f')][_0x4d4c89];var _0x36a3df=_0x34cedc[_0xc08f('0x68')]?util['format'](_0xc08f('0x83'),_0x23e0bf['agentAlias'],_0x34cedc['UserId']):_0xc08f('0x84');var _0x52eaa9=_0x347510[_0xc08f('0x32')][_0xc08f('0x85')]||util[_0xc08f('0x7b')]('%s%d',_0xc08f('0x86'),_0x34cedc['ContactId']);switch(_0x23e0bf[_0xc08f('0x87')]){case _0xc08f('0x88'):_0x36a3df=_0x34cedc['UserId']?util[_0xc08f('0x7b')](_0xc08f('0x83'),_0x23e0bf[_0xc08f('0x89')],_0x34cedc['UserId']):_0xc08f('0x84');break;case _0xc08f('0x8a'):_0x36a3df=_0x34cedc[_0xc08f('0x68')]?_0x34cedc[_0xc08f('0x80')]['alias']||_0x34cedc[_0xc08f('0x80')][_0xc08f('0x54')]:_0xc08f('0x84');break;case _0xc08f('0x8b'):_0x36a3df=_0x34cedc[_0xc08f('0x68')]?_0x34cedc['User']['fullname']:'System';break;default:_0x36a3df=_0x34cedc[_0xc08f('0x68')]?util['format'](_0xc08f('0x83'),_0x23e0bf[_0xc08f('0x89')],_0x34cedc[_0xc08f('0x68')]):'System';}var _0x156017=util['format'](_0xc08f('0x8c'),moment(_0x34cedc[_0xc08f('0x8d')])[_0xc08f('0x7b')](_0xc08f('0x8e')),_0x34cedc[_0xc08f('0x8f')]==='in'?_0x52eaa9:_0x36a3df,_0x34cedc[_0xc08f('0x32')]);if(!_0x34cedc[_0xc08f('0x90')]){fs['appendFileSync'](_0x22d761,_0x156017);}}return db[_0xc08f('0x91')][_0xc08f('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0xc08f('0x92')],'as':_0xc08f('0x93'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc08f('0x94'),'raw':!![]}]}]});}}})['then'](function(_0x523f9d){if(!_0x523f9d||!_0x523f9d[_0xc08f('0x93')]||!_0x347510[_0xc08f('0x32')])return _0x404e9e;var _0x56ed65=_0x523f9d[_0xc08f('0x95')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x56ed65,'message':{'from':util[_0xc08f('0x7b')](_0xc08f('0x96'),_0x523f9d[_0xc08f('0x2f')],_0x523f9d[_0xc08f('0x55')]||_0x523f9d[_0xc08f('0x93')]['user']),'to':_0x347510['body'][_0xc08f('0x79')],'subject':'Mail\x20Transcript','text':util[_0xc08f('0x7b')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x347510[_0xc08f('0x32')][_0xc08f('0x79')]),'attachments':[{'path':_0x22d761}]}})[_0xc08f('0x17')](function(){return _0x404e9e;})[_0xc08f('0x22')](function(_0x5494f6){logger[_0xc08f('0x1e')](_0x5494f6);});})[_0xc08f('0x17')](respondWithStatusCode(_0x16e90d,0xc8))[_0xc08f('0x22')](handleError(_0x16e90d,null));};exports[_0xc08f('0x97')]=function(_0x311487,_0x1e2e8d){return db[_0xc08f('0x61')][_0xc08f('0x48')]({'where':{'id':_0x311487['params']['id']}})[_0xc08f('0x17')](handleEntityNotFound(_0x1e2e8d,null))[_0xc08f('0x17')](function(_0x5dc4e8){if(_0x5dc4e8){return _0x5dc4e8[_0xc08f('0x97')](_0x311487[_0xc08f('0x32')][_0xc08f('0x98')],_[_0xc08f('0x99')](_0x311487[_0xc08f('0x32')],[_0xc08f('0x98'),'id'])||{});}})['then'](respondWithResult(_0x1e2e8d,null))[_0xc08f('0x22')](handleError(_0x1e2e8d,null));};exports[_0xc08f('0x9a')]=function(_0x4a9479,_0x1efacf){var _0x33510f={'raw':![],'where':{}};var _0x1302d5={};var _0x53471b={'count':0x0,'rows':[]};return db[_0xc08f('0x35')][_0xc08f('0x4c')]({'where':{'id':_0x4a9479[_0xc08f('0x3d')]['id']}})[_0xc08f('0x17')](handleEntityNotFound(_0x1efacf,null))[_0xc08f('0x17')](function(_0x21da2b){if(_0x21da2b){_0x1302d5[_0xc08f('0x3e')]=_[_0xc08f('0x3f')](db[_0xc08f('0x61')][_0xc08f('0x36')]);_0x1302d5[_0xc08f('0x3c')]=_[_0xc08f('0x3f')](_0x4a9479[_0xc08f('0x3c')]);_0x1302d5['filters']=_['intersection'](_0x1302d5['model'],_0x1302d5[_0xc08f('0x3c')]);_0x33510f[_0xc08f('0x42')]=_[_0xc08f('0x41')](_0x1302d5[_0xc08f('0x3e')],qs[_0xc08f('0x43')](_0x4a9479[_0xc08f('0x3c')][_0xc08f('0x43')]));_0x33510f[_0xc08f('0x42')]=_0x33510f[_0xc08f('0x42')]['length']?_0x33510f['attributes']:_0x1302d5[_0xc08f('0x3e')];if(!_0x4a9479[_0xc08f('0x3c')][_0xc08f('0x9b')](_0xc08f('0x9c'))){_0x33510f[_0xc08f('0x26')]=qs[_0xc08f('0x26')](_0x4a9479[_0xc08f('0x3c')]['limit']);_0x33510f[_0xc08f('0x28')]=qs['offset'](_0x4a9479[_0xc08f('0x3c')][_0xc08f('0x28')]);}_0x33510f[_0xc08f('0x9d')]=qs[_0xc08f('0x9e')](_0x4a9479[_0xc08f('0x3c')][_0xc08f('0x9e')]);_0x33510f['where']=qs[_0xc08f('0x40')](_[_0xc08f('0x9f')](_0x4a9479[_0xc08f('0x3c')],_0x1302d5['filters']));_0x33510f[_0xc08f('0xa0')][_0xc08f('0xa1')]=_0x21da2b['id'];if(_0x4a9479[_0xc08f('0x3c')][_0xc08f('0xa2')]){_0x33510f[_0xc08f('0xa0')]=_['merge'](_0x33510f[_0xc08f('0xa0')],{'$or':_[_0xc08f('0xa3')](_0x33510f[_0xc08f('0x42')],function(_0xf3fc16){var _0x101e9e={};_0x101e9e[_0xf3fc16]={'$like':'%'+_0x4a9479['query'][_0xc08f('0xa2')]+'%'};return _0x101e9e;})});}if(_0x4a9479[_0xc08f('0x3c')][_0xc08f('0xa4')]){var _0x18abf8=_0x4a9479['query'][_0xc08f('0xa4')][_0xc08f('0xa5')](',');var _0x4391c8={};_0x4391c8[_0x18abf8[0x0]]={'$gte':moment(_0x18abf8[0x1])[_0xc08f('0x7b')](_0xc08f('0xa6'))};_0x33510f[_0xc08f('0xa0')]=_[_0xc08f('0x31')](_0x33510f[_0xc08f('0xa0')],_0x4391c8);}_0x33510f=_[_0xc08f('0x31')]({},_0x33510f,_0x4a9479[_0xc08f('0x47')]);return db[_0xc08f('0x61')][_0xc08f('0x27')]({'where':_0x33510f[_0xc08f('0xa0')]})[_0xc08f('0x17')](function(_0x24c2f7){_0x53471b[_0xc08f('0x27')]=_0x24c2f7;if(_0x4a9479[_0xc08f('0x3c')][_0xc08f('0x45')]){_0x33510f[_0xc08f('0x46')]=[{'all':!![]}];}return db['ChatMessage'][_0xc08f('0x3a')](_0x33510f);})[_0xc08f('0x17')](function(_0x448ebe){_0x53471b['rows']=_0x448ebe;return _0x53471b;});}})[_0xc08f('0x17')](respondWithFilteredResult(_0x1efacf,_0x33510f))['catch'](handleError(_0x1efacf,null));};exports[_0xc08f('0xa7')]=function(_0x15269d,_0x5360c5){var _0x48e351={'where':{}},_0x51e8fe={},_0x3bd24a={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x15269d[_0xc08f('0x3d')]['id']}})[_0xc08f('0x17')](handleEntityNotFound(_0x5360c5,null))[_0xc08f('0x17')](function(_0x5a4746){if(_0x5a4746){_0x51e8fe[_0xc08f('0x3e')]=_[_0xc08f('0x3f')](db[_0xc08f('0x61')][_0xc08f('0x36')]);_0x51e8fe[_0xc08f('0x3c')]=_['keys'](_0x15269d['query']);_0x51e8fe[_0xc08f('0x40')]=_[_0xc08f('0x41')](_0x51e8fe[_0xc08f('0x3e')],_0x51e8fe['query']);_0x48e351[_0xc08f('0x42')]=_[_0xc08f('0x41')](_0x51e8fe[_0xc08f('0x3e')],qs[_0xc08f('0x43')](_0x15269d[_0xc08f('0x3c')][_0xc08f('0x43')]));_0x48e351[_0xc08f('0x42')]=_0x48e351['attributes'][_0xc08f('0x44')]?_0x48e351[_0xc08f('0x42')]:_0x51e8fe['model'];if(!_0x15269d['query'][_0xc08f('0x9b')](_0xc08f('0x9c'))){_0x48e351['limit']=qs[_0xc08f('0x26')](_0x15269d[_0xc08f('0x3c')][_0xc08f('0x26')]);_0x48e351[_0xc08f('0x28')]=qs[_0xc08f('0x28')](_0x15269d[_0xc08f('0x3c')][_0xc08f('0x28')]);}_0x48e351[_0xc08f('0x9d')]=qs[_0xc08f('0x9e')](_0x15269d[_0xc08f('0x3c')]['sort']);_0x48e351[_0xc08f('0xa0')]=qs[_0xc08f('0x40')](_['pick'](_0x15269d[_0xc08f('0x3c')],_0x51e8fe[_0xc08f('0x40')]));_0x48e351['where'][_0xc08f('0xa1')]=_0x5a4746['id'];if(_0x15269d['query'][_0xc08f('0xa2')]){_0x48e351[_0xc08f('0xa0')]=_[_0xc08f('0x31')](_0x48e351[_0xc08f('0xa0')],{'$or':_['map'](_0x48e351['attributes'],function(_0x581518){var _0x5e33ed={};_0x5e33ed[_0x581518]={'$like':'%'+_0x15269d[_0xc08f('0x3c')]['filter']+'%'};return _0x5e33ed;})});}_0x48e351[_0xc08f('0xa0')]['secret']=![];if(_0x15269d[_0xc08f('0x3c')]['id']){_0x48e351[_0xc08f('0xa0')]['id']={'$gt':_0x15269d[_0xc08f('0x3c')]['id']};}_0x48e351=_['merge']({},_0x48e351,_0x15269d[_0xc08f('0x47')]);return db[_0xc08f('0x61')][_0xc08f('0x27')]({'where':_0x48e351[_0xc08f('0xa0')]})[_0xc08f('0x17')](function(_0x5c006f){_0x3bd24a[_0xc08f('0x27')]=_0x5c006f;_0x48e351[_0xc08f('0x46')]=[];if(_0x15269d[_0xc08f('0x3c')][_0xc08f('0xa8')]){_0x48e351[_0xc08f('0x46')][_0xc08f('0xa9')]({'model':db[_0xc08f('0x80')],'as':_0xc08f('0x80'),'attributes':['id',_0xc08f('0x54'),_0xc08f('0xaa')]});}if(_0x15269d[_0xc08f('0x3c')]['includeAll']){_0x48e351['include']=[{'all':!![]}];}return db[_0xc08f('0x61')][_0xc08f('0x3a')](_0x48e351);})[_0xc08f('0x17')](function(_0x398966){_0x3bd24a[_0xc08f('0xab')]=_0x398966;return _0x3bd24a;});}})[_0xc08f('0x17')](respondWithFilteredResult(_0x5360c5,_0x48e351))[_0xc08f('0x22')](handleError(_0x5360c5,null));};exports[_0xc08f('0xac')]=function(_0x4fa221,_0x21a217){return db['ChatInteraction'][_0xc08f('0x48')]({'where':{'id':_0x4fa221[_0xc08f('0x3d')]['id']}})[_0xc08f('0x17')](handleEntityNotFound(_0x21a217,null))[_0xc08f('0x17')](function(_0x2d4845){if(_0x2d4845){return _0x2d4845[_0xc08f('0xad')](_0x4fa221[_0xc08f('0x32')]['ids'],_['omit'](_0x4fa221[_0xc08f('0x32')],[_0xc08f('0x98'),'id'])||{})[_0xc08f('0xae')](function(){return db[_0xc08f('0xaf')][_0xc08f('0x3a')]({'attributes':['id',_0xc08f('0x2f'),_0xc08f('0xb0')],'where':{'id':_0x4fa221[_0xc08f('0x32')][_0xc08f('0x98')]}});})[_0xc08f('0x17')](function(_0x684be4){socket[_0xc08f('0xb1')]('chatInteractionTags:save',{'id':Number(_0x4fa221[_0xc08f('0x3d')]['id']),'tags':_0x684be4||[]});return{'id':Number(_0x4fa221[_0xc08f('0x3d')]['id']),'tags':_0x684be4||[]};});}})['then'](respondWithResult(_0x21a217,null))[_0xc08f('0x22')](handleError(_0x21a217,null));};exports['removeTags']=function(_0x1d470a,_0x1a71db){return db[_0xc08f('0x35')]['find']({'where':{'id':_0x1d470a['params']['id']}})['then'](handleEntityNotFound(_0x1a71db,null))[_0xc08f('0x17')](function(_0x5753d8){if(_0x5753d8){return _0x5753d8[_0xc08f('0xb2')](_0x1d470a[_0xc08f('0x3c')]['ids']);}})[_0xc08f('0x17')](respondWithStatusCode(_0x1a71db,null))[_0xc08f('0x22')](handleError(_0x1a71db,null));};exports[_0xc08f('0x78')]=function(_0x4aa9ee,_0x230447){var _0x99458f=moment()[_0xc08f('0xb3')]()[_0xc08f('0xb4')]();var _0x295677=path['join'](config[_0xc08f('0x75')],_0xc08f('0xb5'),_0xc08f('0xb6'),'tmp');var _0x175f34=path['join'](config[_0xc08f('0x75')],_0xc08f('0xb5'),'files',_0xc08f('0xb7'));var _0x44e07f=path[_0xc08f('0x74')](_0x295677,_0x99458f);var _0x358e8a=util['format'](_0xc08f('0xb8'),_0x4aa9ee[_0xc08f('0x3d')]['id'],_0x99458f);var _0x463a6b=path[_0xc08f('0x74')](_0x295677,_0x358e8a);var _0x416c2e=[];_0x416c2e[_0xc08f('0xa9')]({'model':db['User'],'as':_0xc08f('0x80'),'attributes':['id',_0xc08f('0x54')],'raw':!![]});_0x416c2e['push']({'model':db[_0xc08f('0x81')],'as':'Contact','attributes':['id',_0xc08f('0xb9'),_0xc08f('0xba')],'raw':!![]});if(_0x4aa9ee['query']['attachments']){_0x416c2e[_0xc08f('0xa9')]({'model':db['Attachment'],'as':_0xc08f('0x6e'),'raw':!![]});}var _0x29ae67=[{'model':db['ChatMessage'],'as':_0xc08f('0x7f'),'attributes':['id',_0xc08f('0x32'),_0xc08f('0x8d'),'direction','secret',_0xc08f('0xbb')],'include':_0x416c2e}];_0x29ae67[_0xc08f('0xa9')]({'model':db[_0xc08f('0x4d')],'as':'Account','attributes':['id',_0xc08f('0x2f')]});_0x29ae67[_0xc08f('0xa9')]({'model':db[_0xc08f('0x80')],'as':_0xc08f('0xbc'),'attributes':['id','fullname']});return db[_0xc08f('0x35')][_0xc08f('0x48')]({'where':{'id':_0x4aa9ee['params']['id']},'include':_0x29ae67})['then'](handleEntityNotFound(_0x230447,null))[_0xc08f('0x17')](function(_0x8794ab){if(_0x8794ab){var _0x15f6b7=_0x8794ab[_0xc08f('0xbd')]({'plain':!![]});fs[_0xc08f('0xbe')](_0x44e07f);var _0x5a07fa={'channel':_0xc08f('0xbf'),'account':_0x15f6b7['Account'][_0xc08f('0x2f')],'agent':_0x15f6b7[_0xc08f('0xbc')]?_0x15f6b7[_0xc08f('0xbc')][_0xc08f('0x54')]:'N.A.','createdAt':moment(_0x15f6b7[_0xc08f('0x8d')])[_0xc08f('0x7b')](_0xc08f('0xa6'))[_0xc08f('0xb4')](),'closedAt':_0x15f6b7[_0xc08f('0x70')]?moment(_0x15f6b7[_0xc08f('0xc0')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xc08f('0xb4')]():'','disposition':_0x15f6b7[_0xc08f('0xc1')],'chatInfo':{'browser':_0x15f6b7['browserName'],'os':_0x15f6b7[_0xc08f('0xc2')],'referer':_0x15f6b7[_0xc08f('0xc3')],'customerIp':_0x15f6b7[_0xc08f('0xc4')],'customerPort':_0x15f6b7[_0xc08f('0xc5')]?_0x15f6b7[_0xc08f('0xc5')]:_0xc08f('0xc6')},'messages':_(_0x15f6b7[_0xc08f('0x7f')])[_0xc08f('0xc7')]()[_0xc08f('0xa2')]({'secret':![]})[_0xc08f('0xa3')](function(_0x4ad6e0){if(_0x4ad6e0['Attachment']){var _0x1a6d98=path[_0xc08f('0x74')](_0x175f34,_0x4ad6e0['Attachment'][_0xc08f('0x6c')]);if(fs[_0xc08f('0xc8')](_0x1a6d98)){fs[_0xc08f('0xc9')](_0x1a6d98)['pipe'](fs['createWriteStream'](path[_0xc08f('0x74')](_0x44e07f,_0x4ad6e0['Attachment'][_0xc08f('0x6c')])));}}return{'date':moment(_0x4ad6e0['createdAt'])[_0xc08f('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc08f('0xb4')](),'sender':_0x4ad6e0[_0xc08f('0x8f')]===_0xc08f('0xca')?_0x4ad6e0[_0xc08f('0x80')]?_0x4ad6e0[_0xc08f('0x80')]['fullname']:_0xc08f('0x84'):_0x4ad6e0[_0xc08f('0x65')][_0xc08f('0xb9')]+(_0x4ad6e0[_0xc08f('0x65')]['lastName']?'\x20'+_0x4ad6e0['Contact'][_0xc08f('0xba')]:''),'body':_0x4ad6e0[_0xc08f('0x6e')]?_0x4ad6e0['Attachment'][_0xc08f('0x6c')]:_0x4ad6e0['body'],'direction':_0x4ad6e0[_0xc08f('0x8f')]===_0xc08f('0xca')?'A':'C','secret':_0x4ad6e0[_0xc08f('0x90')],'read':_0x4ad6e0['read'],'attachment':_0x4ad6e0[_0xc08f('0x6e')]};})[_0xc08f('0xcb')]()};return ejs[_0xc08f('0xcc')](path[_0xc08f('0x74')](config['root'],_0xc08f('0xb5'),_0xc08f('0xcd'),_0xc08f('0xce')),{'interaction':_0x5a07fa})[_0xc08f('0x17')](function(_0x223c19){var _0x39111f=path[_0xc08f('0x74')](_0x44e07f,_0xc08f('0xcf')+_0x15f6b7['id']+'-'+_0x99458f+'.pdf');var _0x5ef730={'path':_0x39111f,'channel':'Chat','interactionId':_0x15f6b7['id']};return pdf['createPdfFromHTML'](_0x223c19,_0x5ef730);})[_0xc08f('0x17')](function(){return new Promise(function(_0x47de11,_0x5a248c){zipdir(_0x44e07f,{'saveTo':_0x463a6b},function(_0x2c7d29,_0x345000){if(_0x2c7d29)return _0x5a248c(_0x2c7d29);return _0x47de11(_0x345000);});})[_0xc08f('0x17')](function(){return new BPromise(function(_0x417375,_0x3baa39){rimraf(_0x44e07f,function(_0x2bfd35){if(_0x2bfd35)_0x3baa39(_0x2bfd35);return _0x417375();});});})[_0xc08f('0x17')](function(){return _0x230447[_0xc08f('0x78')](_0x463a6b,_0x358e8a,function(_0x28ed90){if(_0x28ed90){logger[_0xc08f('0x1e')](_0xc08f('0xd0'),_0x28ed90);}else{fs['unlinkSync'](_0x463a6b);}});});});}else{return _0x230447[_0xc08f('0x2e')](0xc8);}})[_0xc08f('0x22')](handleError(_0x230447,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 94630a8..e73446d 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 _0x12b0=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save'];(function(_0x102394,_0x106b73){var _0x4d3d85=function(_0x525637){while(--_0x525637){_0x102394['push'](_0x102394['shift']());}};_0x4d3d85(++_0x106b73);}(_0x12b0,0xc7));var _0x012b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x12b0[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0x012b('0x0'));var ChatInteraction=require(_0x012b('0x1'))['db'][_0x012b('0x2')];var ChatMessage=require(_0x012b('0x1'))['db'][_0x012b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x012b('0x4'),'afterUpdate':_0x012b('0x5'),'afterDestroy':_0x012b('0x6')};function emitEvent(_0x3eda62){return function(_0x4394ab,_0x2b326d,_0x16324f){_0x4394ab[_0x012b('0x7')]({'attributes':['id'],'raw':!![]})[_0x012b('0x8')](function(_0x6b7547){_0x4394ab[_0x012b('0x9')](_0x012b('0xa'),_0x6b7547[_0x012b('0xb')](function(_0x8494b6){return{'id':_0x8494b6['id']};}));return ChatMessage[_0x012b('0xc')]({'where':{'ChatInteractionId':_0x4394ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0x012b('0x8')](function(_0x5c2558){_0x4394ab[_0x012b('0x9')](_0x012b('0xd'),_0x5c2558[_0x012b('0xe')]);ChatInteractionEvents['emit'](_0x3eda62+':'+_0x4394ab['id'],_0x4394ab);ChatInteractionEvents[_0x012b('0xf')](_0x3eda62,_0x4394ab);_0x16324f(null);})['catch'](_0x16324f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x012b('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xcc0d=['exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','then','Users','map','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook'];(function(_0x3ebc04,_0xbd5a78){var _0x3754fc=function(_0xccbac9){while(--_0xccbac9){_0x3ebc04['push'](_0x3ebc04['shift']());}};_0x3754fc(++_0xbd5a78);}(_0xcc0d,0xa3));var _0xdcc0=function(_0x4a4fec,_0x9ee607){_0x4a4fec=_0x4a4fec-0x0;var _0x59cacc=_0xcc0d[_0x4a4fec];return _0x59cacc;};'use strict';var EventEmitter=require(_0xdcc0('0x0'));var ChatInteraction=require(_0xdcc0('0x1'))['db'][_0xdcc0('0x2')];var ChatMessage=require(_0xdcc0('0x1'))['db'][_0xdcc0('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdcc0('0x4'),'afterUpdate':_0xdcc0('0x5'),'afterDestroy':_0xdcc0('0x6')};function emitEvent(_0x5c8d8a){return function(_0x56b635,_0x5ba9de,_0x3f8571){_0x56b635['getUsers']({'attributes':['id'],'raw':!![]})[_0xdcc0('0x7')](function(_0x273999){_0x56b635['setDataValue'](_0xdcc0('0x8'),_0x273999[_0xdcc0('0x9')](function(_0x16f2e6){return{'id':_0x16f2e6['id']};}));return ChatMessage[_0xdcc0('0xa')]({'where':{'ChatInteractionId':_0x56b635['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdcc0('0x7')](function(_0x554d1f){_0x56b635[_0xdcc0('0xb')]('unreadMessages',_0x554d1f[_0xdcc0('0xc')]);ChatInteractionEvents[_0xdcc0('0xd')](_0x5c8d8a+':'+_0x56b635['id'],_0x56b635);ChatInteractionEvents[_0xdcc0('0xd')](_0x5c8d8a,_0x56b635);_0x3f8571(null);})[_0xdcc0('0xe')](_0x3f8571(null));};}for(var e in events){if(events[_0xdcc0('0xf')](e)){var event=events[e];ChatInteraction[_0xdcc0('0x10')](e,emitEvent(event));}}module[_0xdcc0('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 196d745..d5ff731 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 _0x0731=['moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0731,0x11a));var _0x1073=function(_0xebb7e,_0x51d3ad){_0xebb7e=_0xebb7e-0x0;var _0x26222d=_0x0731[_0xebb7e];return _0x26222d;};'use strict';var _=require(_0x1073('0x0'));var util=require(_0x1073('0x1'));var logger=require(_0x1073('0x2'))('api');var moment=require(_0x1073('0x3'));var BPromise=require(_0x1073('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1073('0x5'));var rimraf=require(_0x1073('0x6'));var config=require(_0x1073('0x7'));var attributes=require(_0x1073('0x8'));module[_0x1073('0x9')]=function(_0x486441,_0x477b3e){return _0x486441[_0x1073('0xa')](_0x1073('0xb'),attributes,{'tableName':_0x1073('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xed01c4,_0x1bc061,_0x2a17d4){if(_0xed01c4[_0x1073('0xd')](_0x1073('0xe'))){_0xed01c4[_0x1073('0xf')]=moment()[_0x1073('0x10')](_0x1073('0x11'));}_0x2a17d4(null,_0xed01c4);}},'charset':'utf8mb4','collate':_0x1073('0x12')});};
\ No newline at end of file
+var _0x135b=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','format'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x135b,0xec));var _0xb135=function(_0xa46cc9,_0x327f7d){_0xa46cc9=_0xa46cc9-0x0;var _0x5683ed=_0x135b[_0xa46cc9];return _0x5683ed;};'use strict';var _=require(_0xb135('0x0'));var util=require(_0xb135('0x1'));var logger=require(_0xb135('0x2'))(_0xb135('0x3'));var moment=require(_0xb135('0x4'));var BPromise=require(_0xb135('0x5'));var rp=require(_0xb135('0x6'));var fs=require('fs');var path=require(_0xb135('0x7'));var rimraf=require(_0xb135('0x8'));var config=require('../../config/environment');var attributes=require(_0xb135('0x9'));module[_0xb135('0xa')]=function(_0x294136,_0x1b6db6){return _0x294136['define'](_0xb135('0xb'),attributes,{'tableName':_0xb135('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x582e0d,_0x51027b,_0x5f2f9c){if(_0x582e0d[_0xb135('0xd')](_0xb135('0xe'))){_0x582e0d['closedAt']=moment()[_0xb135('0xf')](_0xb135('0x10'));}_0x5f2f9c(null,_0x582e0d);}},'charset':_0xb135('0x11'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index d601193..0b499bb 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 _0x5fde=['error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','limit','AddTagsToChatInteraction','addTags','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x143629,_0x56c3e3){var _0x14c8aa=function(_0x23f077){while(--_0x23f077){_0x143629['push'](_0x143629['shift']());}};_0x14c8aa(++_0x56c3e3);}(_0x5fde,0x1e4));var _0xe5fd=function(_0xd18de3,_0x5129ca){_0xd18de3=_0xd18de3-0x0;var _0xca6917=_0x5fde[_0xd18de3];return _0xca6917;};'use strict';var _=require(_0xe5fd('0x0'));var util=require(_0xe5fd('0x1'));var moment=require('moment');var BPromise=require(_0xe5fd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5fd('0x3'));var db=require(_0xe5fd('0x4'))['db'];var utils=require(_0xe5fd('0x5'));var logger=require(_0xe5fd('0x6'))(_0xe5fd('0x7'));var config=require(_0xe5fd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe5fd('0x9')][_0xe5fd('0xa')]({'port':0x232a});config[_0xe5fd('0xb')]=_[_0xe5fd('0xc')](config['redis'],{'host':_0xe5fd('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe5fd('0xb')]));require('./chatInteraction.socket')[_0xe5fd('0xe')](socket);function respondWithRpcPromise(_0x442489,_0x22eaed,_0x3d6f0b){return new BPromise(function(_0x4cca6b,_0x129c19){return client[_0xe5fd('0xf')](_0x442489,_0x3d6f0b)[_0xe5fd('0x10')](function(_0x5a7332){logger[_0xe5fd('0x11')](_0xe5fd('0x12'),_0x22eaed,_0xe5fd('0x13'));logger[_0xe5fd('0x14')](_0xe5fd('0x15'),_0x22eaed,_0xe5fd('0x13'),JSON[_0xe5fd('0x16')](_0x5a7332));if(_0x5a7332[_0xe5fd('0x17')]){if(_0x5a7332[_0xe5fd('0x17')][_0xe5fd('0x18')]===0x1f4){logger[_0xe5fd('0x17')](_0xe5fd('0x12'),_0x22eaed,_0x5a7332['error'][_0xe5fd('0x19')]);return _0x129c19(_0x5a7332[_0xe5fd('0x17')][_0xe5fd('0x19')]);}logger[_0xe5fd('0x17')](_0xe5fd('0x12'),_0x22eaed,_0x5a7332[_0xe5fd('0x17')][_0xe5fd('0x19')]);return _0x4cca6b(_0x5a7332[_0xe5fd('0x17')][_0xe5fd('0x19')]);}else{logger[_0xe5fd('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x22eaed,'request\x20sent');_0x4cca6b(_0x5a7332[_0xe5fd('0x1a')]['message']);}})[_0xe5fd('0x1b')](function(_0x3bce4a){logger[_0xe5fd('0x17')](_0xe5fd('0x12'),_0x22eaed,_0x3bce4a);_0x129c19(_0x3bce4a);});});}exports[_0xe5fd('0x1c')]=function(_0x4bfb33){var _0x1c6220=this;return new Promise(function(_0x4f51dd,_0xa560a3){return db[_0xe5fd('0x1d')]['update'](_0x4bfb33[_0xe5fd('0x1e')],{'raw':_0x4bfb33[_0xe5fd('0x1f')]?_0x4bfb33[_0xe5fd('0x1f')][_0xe5fd('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bfb33[_0xe5fd('0x1f')]?_0x4bfb33[_0xe5fd('0x1f')][_0xe5fd('0x21')]||null:null,'attributes':_0x4bfb33['options']?_0x4bfb33[_0xe5fd('0x1f')]['attributes']||null:null,'limit':_0x4bfb33['options']?_0x4bfb33[_0xe5fd('0x1f')][_0xe5fd('0x22')]||null:null})[_0xe5fd('0x10')](function(_0x27228f){logger[_0xe5fd('0x11')](_0xe5fd('0x1c'),_0x4bfb33);logger[_0xe5fd('0x14')](_0xe5fd('0x1c'),_0x4bfb33,JSON[_0xe5fd('0x16')](_0x27228f));_0x4f51dd(_0x27228f);})[_0xe5fd('0x1b')](function(_0x4744e5){logger[_0xe5fd('0x17')](_0xe5fd('0x1c'),_0x4744e5[_0xe5fd('0x19')],_0x4bfb33);_0xa560a3(_0x1c6220[_0xe5fd('0x17')](0x1f4,_0x4744e5['message']));});});};exports[_0xe5fd('0x23')]=function(_0x2fc30b){return new Promise(function(_0x3214a3,_0x385feb){return db[_0xe5fd('0x1d')]['find']({'where':_0x2fc30b['options']?_0x2fc30b[_0xe5fd('0x1f')][_0xe5fd('0x21')]||null:null})['then'](function(_0xc50b2a){if(_0xc50b2a){return _0xc50b2a[_0xe5fd('0x24')](_0x2fc30b[_0xe5fd('0x1e')]['ids'],_['omit'](_0x2fc30b[_0xe5fd('0x1e')],['ids','id'])||{});}})[_0xe5fd('0x25')](function(_0x46bf10){logger['info'](_0xe5fd('0x26'),_0x2fc30b);logger[_0xe5fd('0x14')](_0xe5fd('0x26'),_0x2fc30b,JSON[_0xe5fd('0x16')](_0x46bf10));_0x3214a3(_0x46bf10);})['catch'](function(_0x3ca365){logger['error'](_0xe5fd('0x26'),_0x3ca365[_0xe5fd('0x19')],_0x2fc30b);_0x385feb(_this[_0xe5fd('0x17')](0x1f4,_0x3ca365['message']));});});};
\ No newline at end of file
+var _0xe67d=['AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ChatInteraction','update','body','options','attributes','UpdateChatInteraction','catch'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xe67d,0x150));var _0xde67=function(_0x30597e,_0x3d3e66){_0x30597e=_0x30597e-0x0;var _0x17b1cf=_0xe67d[_0x30597e];return _0x17b1cf;};'use strict';var _=require(_0xde67('0x0'));var util=require(_0xde67('0x1'));var moment=require(_0xde67('0x2'));var BPromise=require(_0xde67('0x3'));var rs=require(_0xde67('0x4'));var fs=require('fs');var Redis=require(_0xde67('0x5'));var db=require(_0xde67('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xde67('0x7'));var config=require(_0xde67('0x8'));var jayson=require(_0xde67('0x9'));var client=jayson[_0xde67('0xa')][_0xde67('0xb')]({'port':0x232a});config[_0xde67('0xc')]=_[_0xde67('0xd')](config[_0xde67('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde67('0xc')]));require('./chatInteraction.socket')[_0xde67('0xe')](socket);function respondWithRpcPromise(_0x2f46d1,_0x4fafb2,_0x1ce2e2){return new BPromise(function(_0x469660,_0x14b4d9){return client[_0xde67('0xf')](_0x2f46d1,_0x1ce2e2)[_0xde67('0x10')](function(_0x29e160){logger[_0xde67('0x11')](_0xde67('0x12'),_0x4fafb2,_0xde67('0x13'));logger[_0xde67('0x14')](_0xde67('0x15'),_0x4fafb2,_0xde67('0x13'),JSON[_0xde67('0x16')](_0x29e160));if(_0x29e160['error']){if(_0x29e160[_0xde67('0x17')]['code']===0x1f4){logger[_0xde67('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x4fafb2,_0x29e160[_0xde67('0x17')][_0xde67('0x18')]);return _0x14b4d9(_0x29e160['error']['message']);}logger[_0xde67('0x17')](_0xde67('0x12'),_0x4fafb2,_0x29e160[_0xde67('0x17')][_0xde67('0x18')]);return _0x469660(_0x29e160['error'][_0xde67('0x18')]);}else{logger['info'](_0xde67('0x12'),_0x4fafb2,'request\x20sent');_0x469660(_0x29e160[_0xde67('0x19')][_0xde67('0x18')]);}})['catch'](function(_0x5c7180){logger['error'](_0xde67('0x12'),_0x4fafb2,_0x5c7180);_0x14b4d9(_0x5c7180);});});}exports['UpdateChatInteraction']=function(_0x45efcb){var _0x349df4=this;return new Promise(function(_0x148e45,_0x477897){return db[_0xde67('0x1a')][_0xde67('0x1b')](_0x45efcb[_0xde67('0x1c')],{'raw':_0x45efcb[_0xde67('0x1d')]?_0x45efcb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45efcb[_0xde67('0x1d')]?_0x45efcb[_0xde67('0x1d')]['where']||null:null,'attributes':_0x45efcb[_0xde67('0x1d')]?_0x45efcb['options'][_0xde67('0x1e')]||null:null,'limit':_0x45efcb[_0xde67('0x1d')]?_0x45efcb[_0xde67('0x1d')]['limit']||null:null})[_0xde67('0x10')](function(_0x489d92){logger[_0xde67('0x11')](_0xde67('0x1f'),_0x45efcb);logger[_0xde67('0x14')](_0xde67('0x1f'),_0x45efcb,JSON['stringify'](_0x489d92));_0x148e45(_0x489d92);})[_0xde67('0x20')](function(_0x19a33e){logger[_0xde67('0x17')](_0xde67('0x1f'),_0x19a33e[_0xde67('0x18')],_0x45efcb);_0x477897(_0x349df4[_0xde67('0x17')](0x1f4,_0x19a33e[_0xde67('0x18')]));});});};exports[_0xde67('0x21')]=function(_0x476244){return new Promise(function(_0x5038ba,_0xcb5e66){return db['ChatInteraction'][_0xde67('0x22')]({'where':_0x476244[_0xde67('0x1d')]?_0x476244['options'][_0xde67('0x23')]||null:null})[_0xde67('0x10')](function(_0x100099){if(_0x100099){return _0x100099[_0xde67('0x24')](_0x476244['body'][_0xde67('0x25')],_[_0xde67('0x26')](_0x476244['body'],[_0xde67('0x25'),'id'])||{});}})[_0xde67('0x27')](function(_0x4719c0){logger[_0xde67('0x11')](_0xde67('0x28'),_0x476244);logger[_0xde67('0x14')](_0xde67('0x28'),_0x476244,JSON[_0xde67('0x16')](_0x4719c0));_0x5038ba(_0x4719c0);})[_0xde67('0x20')](function(_0x26c2d8){logger[_0xde67('0x17')](_0xde67('0x28'),_0x26c2d8[_0xde67('0x18')],_0x476244);_0xcb5e66(_this[_0xde67('0x17')](0x1f4,_0x26c2d8[_0xde67('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 8f38497..df4e49a 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 _0x17af=['removeListener','register','length','chatInteraction:','./chatInteraction.events','remove','update','emit'];(function(_0x303d3e,_0x1330e9){var _0xb012e3=function(_0x1a66c5){while(--_0x1a66c5){_0x303d3e['push'](_0x303d3e['shift']());}};_0xb012e3(++_0x1330e9);}(_0x17af,0x19c));var _0xf17a=function(_0x395f9c,_0x1f6aa0){_0x395f9c=_0x395f9c-0x0;var _0x296560=_0x17af[_0x395f9c];return _0x296560;};'use strict';var ChatInteractionEvents=require(_0xf17a('0x0'));var events=['save',_0xf17a('0x1'),_0xf17a('0x2')];function createListener(_0x39574a,_0x47b60e){return function(_0x3cdc95){_0x47b60e[_0xf17a('0x3')](_0x39574a,_0x3cdc95);};}function removeListener(_0x36dafc,_0x33c1cc){return function(){ChatInteractionEvents[_0xf17a('0x4')](_0x36dafc,_0x33c1cc);};}exports[_0xf17a('0x5')]=function(_0x41a6b6){for(var _0x156cf8=0x0,_0x52cb8a=events[_0xf17a('0x6')];_0x156cf8<_0x52cb8a;_0x156cf8++){var _0x57f163=events[_0x156cf8];var _0x43f3a3=createListener(_0xf17a('0x7')+_0x57f163,_0x41a6b6);ChatInteractionEvents['on'](_0x57f163,_0x43f3a3);}};
\ No newline at end of file
+var _0x582f=['save','remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x2d97e4,_0x1ac3af){var _0x5eb7e1=function(_0x2bb817){while(--_0x2bb817){_0x2d97e4['push'](_0x2d97e4['shift']());}};_0x5eb7e1(++_0x1ac3af);}(_0x582f,0xce));var _0xf582=function(_0x276468,_0x29685a){_0x276468=_0x276468-0x0;var _0x36dc3a=_0x582f[_0x276468];return _0x36dc3a;};'use strict';var ChatInteractionEvents=require(_0xf582('0x0'));var events=[_0xf582('0x1'),_0xf582('0x2'),_0xf582('0x3')];function createListener(_0xea1913,_0x274bc7){return function(_0x3501b3){_0x274bc7[_0xf582('0x4')](_0xea1913,_0x3501b3);};}function removeListener(_0x71b9eb,_0x4581b8){return function(){ChatInteractionEvents[_0xf582('0x5')](_0x71b9eb,_0x4581b8);};}exports[_0xf582('0x6')]=function(_0x4e299c){for(var _0x28eb3a=0x0,_0x7158f9=events[_0xf582('0x7')];_0x28eb3a<_0x7158f9;_0x28eb3a++){var _0x4ace78=events[_0x28eb3a];var _0x449cd2=createListener(_0xf582('0x8')+_0x4ace78,_0x4e299c);ChatInteractionEvents['on'](_0x4ace78,_0x449cd2);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index c72bbea..2145b76 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 _0x0d0f=['chatinteraction:destroy','removeTags','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','isChatInteractionAuthorized','download','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0d0f,0xc7));var _0xf0d0=function(_0xa989f6,_0x1a950e){_0xa989f6=_0xa989f6-0x0;var _0x50e6c7=_0x0d0f[_0xa989f6];return _0x50e6c7;};'use strict';var multer=require(_0xf0d0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf0d0('0x1')]();var fs_extra=require(_0xf0d0('0x2'));var auth=require(_0xf0d0('0x3'));var interaction=require(_0xf0d0('0x4'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0xf0d0('0x5')]('/',auth[_0xf0d0('0x6')](),controller[_0xf0d0('0x7')]);router[_0xf0d0('0x5')](_0xf0d0('0x8'),auth[_0xf0d0('0x6')](),controller[_0xf0d0('0x9')]);router['get'](_0xf0d0('0xa'),auth['isChatInteractionAuthorized'](),controller[_0xf0d0('0xb')]);router[_0xf0d0('0x5')](_0xf0d0('0xc'),auth['isChatInteractionAuthorized'](),controller[_0xf0d0('0xd')]);router[_0xf0d0('0x5')](_0xf0d0('0xe'),auth[_0xf0d0('0x6')](),controller[_0xf0d0('0xf')]);router[_0xf0d0('0x5')]('/:id/my_messages',auth[_0xf0d0('0x10')](),controller['getMyMessages']);router[_0xf0d0('0x5')]('/:id/download',auth[_0xf0d0('0x6')](),controller[_0xf0d0('0x11')]);router[_0xf0d0('0x12')]('/',auth[_0xf0d0('0x6')](),controller[_0xf0d0('0x13')]);router['post'](_0xf0d0('0x14'),auth[_0xf0d0('0x6')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xf0d0('0x15')]({'destination':function(_0x412d1a,_0x4cb9f5,_0x59c094){_0x59c094(null,path[_0xf0d0('0x16')](config[_0xf0d0('0x17')],_0xf0d0('0x18')));},'filename':function(_0x277226,_0x483c17,_0x56e27f){_0x56e27f(null,util[_0xf0d0('0x19')](_0xf0d0('0x1a'),Date[_0xf0d0('0x1b')](),_0x483c17['originalname'][_0xf0d0('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf0d0('0x12')](_0xf0d0('0x1d'),upload[_0xf0d0('0x1e')](_0xf0d0('0x1f')),controller['attachmentUpload']);router[_0xf0d0('0x12')]('/:id/messages',auth[_0xf0d0('0x10')](),controller[_0xf0d0('0x20')]);router['post'](_0xf0d0('0x21'),auth[_0xf0d0('0x6')](),interaction[_0xf0d0('0x22')](_0xf0d0('0x23'),_0xf0d0('0x24')),controller[_0xf0d0('0x25')]);router[_0xf0d0('0x26')](_0xf0d0('0xa'),auth[_0xf0d0('0x6')](),interaction[_0xf0d0('0x22')](_0xf0d0('0x23'),_0xf0d0('0x27')),controller[_0xf0d0('0x28')]);router[_0xf0d0('0x26')](_0xf0d0('0x29'),controller[_0xf0d0('0x2a')]);router[_0xf0d0('0x26')]('/:id/abandon',auth[_0xf0d0('0x10')](),controller[_0xf0d0('0x2b')]);router['put'](_0xf0d0('0x2c'),controller[_0xf0d0('0x2d')]);router['delete'](_0xf0d0('0xa'),auth['isAuthenticated'](),interaction[_0xf0d0('0x22')](_0xf0d0('0x23'),_0xf0d0('0x2e')),controller['destroy']);router['delete'](_0xf0d0('0x21'),auth['isAuthenticated'](),controller[_0xf0d0('0x2f')]);module[_0xf0d0('0x30')]=router;
\ No newline at end of file
+var _0x5dd7=['put','chatinteraction:update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','format','%s-%s','now','originalname','/:id/attachment_upload','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags'];(function(_0x5ddfcc,_0x4c57f8){var _0x5cec79=function(_0xc93db5){while(--_0xc93db5){_0x5ddfcc['push'](_0x5ddfcc['shift']());}};_0x5cec79(++_0x4c57f8);}(_0x5dd7,0x9e));var _0x75dd=function(_0x52c3e1,_0x2107d0){_0x52c3e1=_0x52c3e1-0x0;var _0x4cf675=_0x5dd7[_0x52c3e1];return _0x4cf675;};'use strict';var multer=require(_0x75dd('0x0'));var util=require(_0x75dd('0x1'));var path=require(_0x75dd('0x2'));var timeout=require('connect-timeout');var express=require(_0x75dd('0x3'));var router=express['Router']();var fs_extra=require(_0x75dd('0x4'));var auth=require(_0x75dd('0x5'));var interaction=require(_0x75dd('0x6'));var config=require('../../config/environment');var controller=require(_0x75dd('0x7'));router[_0x75dd('0x8')]('/',auth[_0x75dd('0x9')](),controller['index']);router[_0x75dd('0x8')](_0x75dd('0xa'),auth[_0x75dd('0x9')](),controller['describe']);router[_0x75dd('0x8')]('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router['get'](_0x75dd('0xb'),auth[_0x75dd('0xc')](),controller[_0x75dd('0xd')]);router[_0x75dd('0x8')](_0x75dd('0xe'),auth[_0x75dd('0x9')](),controller[_0x75dd('0xf')]);router[_0x75dd('0x8')](_0x75dd('0x10'),auth[_0x75dd('0xc')](),controller[_0x75dd('0x11')]);router[_0x75dd('0x8')](_0x75dd('0x12'),auth[_0x75dd('0x9')](),controller[_0x75dd('0x13')]);router[_0x75dd('0x14')]('/',auth[_0x75dd('0x9')](),controller[_0x75dd('0x15')]);router[_0x75dd('0x14')](_0x75dd('0x16'),auth['isAuthenticated'](),controller[_0x75dd('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x235548,_0x4aee5d,_0x422b34){_0x422b34(null,path[_0x75dd('0x18')](config[_0x75dd('0x19')],'server/files/attachments/'));},'filename':function(_0x3f52f3,_0x3e4d98,_0x482b96){_0x482b96(null,util[_0x75dd('0x1a')](_0x75dd('0x1b'),Date[_0x75dd('0x1c')](),_0x3e4d98[_0x75dd('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x75dd('0x1e'),upload['single'](_0x75dd('0x1f')),controller[_0x75dd('0x20')]);router[_0x75dd('0x14')](_0x75dd('0xe'),auth[_0x75dd('0xc')](),controller[_0x75dd('0x21')]);router[_0x75dd('0x14')]('/:id/tags',auth[_0x75dd('0x9')](),interaction[_0x75dd('0x22')](_0x75dd('0x23'),_0x75dd('0x24')),controller[_0x75dd('0x25')]);router[_0x75dd('0x26')]('/:id',auth[_0x75dd('0x9')](),interaction[_0x75dd('0x22')](_0x75dd('0x23'),_0x75dd('0x27')),controller['update']);router[_0x75dd('0x26')]('/:id/custom_update',controller[_0x75dd('0x28')]);router[_0x75dd('0x26')](_0x75dd('0x29'),auth['isChatInteractionAuthorized'](),controller[_0x75dd('0x2a')]);router[_0x75dd('0x26')](_0x75dd('0x2b'),controller[_0x75dd('0x2c')]);router[_0x75dd('0x2d')]('/:id',auth[_0x75dd('0x9')](),interaction[_0x75dd('0x22')](_0x75dd('0x23'),_0x75dd('0x2e')),controller[_0x75dd('0x2f')]);router['delete']('/:id/tags',auth[_0x75dd('0x9')](),controller['removeTags']);module[_0x75dd('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index ebbaf01..24d3db3 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 _0x1d5b=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0x1d5b,0x1b2));var _0xb1d5=function(_0x2a0b50,_0x442dc8){_0x2a0b50=_0x2a0b50-0x0;var _0x15b700=_0x1d5b[_0x2a0b50];return _0x15b700;};'use strict';var Sequelize=require(_0xb1d5('0x0'));module['exports']={'body':{'type':Sequelize[_0xb1d5('0x1')](_0xb1d5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb1d5('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb1d5('0x4')]}};
\ No newline at end of file
+var _0x4ba5=['medium','exports'];(function(_0x2d9122,_0x227e82){var _0x9f5b3b=function(_0x5d23c4){while(--_0x5d23c4){_0x2d9122['push'](_0x2d9122['shift']());}};_0x9f5b3b(++_0x227e82);}(_0x4ba5,0x147));var _0x54ba=function(_0x2d9dfb,_0x2daffc){_0x2d9dfb=_0x2d9dfb-0x0;var _0x3a14cb=_0x4ba5[_0x2d9dfb];return _0x3a14cb;};'use strict';var Sequelize=require('sequelize');module[_0x54ba('0x0')]={'body':{'type':Sequelize['TEXT'](_0x54ba('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index f6e3056..01250f5 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 _0xb7b1=['internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','push','FromId','ToId','read','all','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','redis','register','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','then','include','findAll','catch','show','includeAll','find','create','body','params','describe','get','messages','createdAt','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','fullname','role','userpic'];(function(_0x8cffeb,_0x394925){var _0x197f90=function(_0x50166c){while(--_0x50166c){_0x8cffeb['push'](_0x8cffeb['shift']());}};_0x197f90(++_0x394925);}(_0xb7b1,0x1c6));var _0x1b7b=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xb7b1[_0x19b3f9];return _0x18c3f6;};'use strict';var emlformat=require(_0x1b7b('0x0'));var rimraf=require(_0x1b7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1b7b('0x2'));var rp=require('request-promise');var moment=require(_0x1b7b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b7b('0x4'));var path=require(_0x1b7b('0x5'));var sox=require(_0x1b7b('0x6'));var csv=require(_0x1b7b('0x7'));var ejs=require(_0x1b7b('0x8'));var fs=require('fs');var fs_extra=require(_0x1b7b('0x9'));var _=require('lodash');var squel=require(_0x1b7b('0xa'));var crypto=require('crypto');var jsforce=require(_0x1b7b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1b7b('0x7'));var querystring=require(_0x1b7b('0xc'));var Papa=require(_0x1b7b('0xd'));var Redis=require(_0x1b7b('0xe'));var authService=require(_0x1b7b('0xf'));var qs=require(_0x1b7b('0x10'));var as=require(_0x1b7b('0x11'));var hardwareService=require(_0x1b7b('0x12'));var logger=require(_0x1b7b('0x13'))(_0x1b7b('0x14'));var utils=require(_0x1b7b('0x15'));var config=require(_0x1b7b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b7b('0x17'))['db'];config['redis']=_[_0x1b7b('0x18')](config['redis'],{'host':_0x1b7b('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b7b('0x1a')]));require('./chatInternalMessage.socket')[_0x1b7b('0x1b')](socket);function respondWithStatusCode(_0x3f0b3f,_0x17689a){_0x17689a=_0x17689a||0xcc;return function(_0x473e7c){if(_0x473e7c){return _0x3f0b3f[_0x1b7b('0x1c')](_0x17689a);}return _0x3f0b3f['status'](_0x17689a)[_0x1b7b('0x1d')]();};}function respondWithResult(_0x38ae1c,_0x119334){_0x119334=_0x119334||0xc8;return function(_0x179b14){if(_0x179b14){return _0x38ae1c[_0x1b7b('0x1e')](_0x119334)[_0x1b7b('0x1f')](_0x179b14);}};}function respondWithFilteredResult(_0x54c22d,_0x33469e){return function(_0x29bde8){if(_0x29bde8){var _0x44b591=typeof _0x33469e[_0x1b7b('0x20')]===_0x1b7b('0x21')&&typeof _0x33469e['limit']===_0x1b7b('0x21');var _0x4d109d=_0x29bde8[_0x1b7b('0x22')];var _0x5f1895=_0x44b591?0x0:_0x33469e[_0x1b7b('0x20')];var _0x31483b=_0x44b591?_0x29bde8['count']:_0x33469e[_0x1b7b('0x20')]+_0x33469e[_0x1b7b('0x23')];var _0x590615;if(_0x31483b>=_0x4d109d){_0x31483b=_0x4d109d;_0x590615=0xc8;}else{_0x590615=0xce;}_0x54c22d[_0x1b7b('0x1e')](_0x590615);return _0x54c22d[_0x1b7b('0x24')]('Content-Range',_0x5f1895+'-'+_0x31483b+'/'+_0x4d109d)[_0x1b7b('0x1f')](_0x29bde8);}return null;};}function patchUpdates(_0x1ccaee){return function(_0xfffd9){try{jsonpatch[_0x1b7b('0x25')](_0xfffd9,_0x1ccaee,!![]);}catch(_0x5572ef){return BPromise[_0x1b7b('0x26')](_0x5572ef);}return _0xfffd9[_0x1b7b('0x27')]();};}function saveUpdates(_0x586cf2,_0x445858){return function(_0x2c9b19){if(_0x2c9b19){return _0x2c9b19[_0x1b7b('0x28')](_0x586cf2)['then'](function(_0x2b520c){return _0x2b520c;});}return null;};}function removeEntity(_0xb2e21b,_0x315f21){return function(_0x57029d){if(_0x57029d){return _0x57029d[_0x1b7b('0x29')]()['then'](function(){_0xb2e21b[_0x1b7b('0x1e')](0xcc)[_0x1b7b('0x1d')]();});}};}function handleEntityNotFound(_0xc107f,_0x35b5ae){return function(_0x43cfc8){if(!_0x43cfc8){_0xc107f[_0x1b7b('0x1c')](0x194);}return _0x43cfc8;};}function handleError(_0xa30e44,_0x5da732){_0x5da732=_0x5da732||0x1f4;return function(_0xe2fbc9){logger[_0x1b7b('0x2a')](_0xe2fbc9[_0x1b7b('0x2b')]);if(_0xe2fbc9[_0x1b7b('0x2c')]){delete _0xe2fbc9[_0x1b7b('0x2c')];}_0xa30e44['status'](_0x5da732)['send'](_0xe2fbc9);};}exports[_0x1b7b('0x2d')]=function(_0x47b2c6,_0x5c9ccb){var _0x3df440={},_0x59601a={},_0x39de23={'count':0x0,'rows':[]};var _0x48d5ba=_[_0x1b7b('0x2e')](db[_0x1b7b('0x2f')][_0x1b7b('0x30')],function(_0x1e9ef1){return{'name':_0x1e9ef1['fieldName'],'type':_0x1e9ef1['type'][_0x1b7b('0x31')]};});_0x59601a['model']=_[_0x1b7b('0x2e')](_0x48d5ba,_0x1b7b('0x2c'));_0x59601a[_0x1b7b('0x32')]=_[_0x1b7b('0x33')](_0x47b2c6[_0x1b7b('0x32')]);_0x59601a[_0x1b7b('0x34')]=_[_0x1b7b('0x35')](_0x59601a[_0x1b7b('0x36')],_0x59601a[_0x1b7b('0x32')]);_0x3df440[_0x1b7b('0x37')]=_[_0x1b7b('0x35')](_0x59601a[_0x1b7b('0x36')],qs[_0x1b7b('0x38')](_0x47b2c6[_0x1b7b('0x32')][_0x1b7b('0x38')]));_0x3df440[_0x1b7b('0x37')]=_0x3df440[_0x1b7b('0x37')][_0x1b7b('0x39')]?_0x3df440['attributes']:_0x59601a['model'];if(!_0x47b2c6[_0x1b7b('0x32')]['hasOwnProperty'](_0x1b7b('0x3a'))){_0x3df440[_0x1b7b('0x23')]=qs['limit'](_0x47b2c6[_0x1b7b('0x32')]['limit']);_0x3df440['offset']=qs[_0x1b7b('0x20')](_0x47b2c6[_0x1b7b('0x32')][_0x1b7b('0x20')]);}_0x3df440[_0x1b7b('0x3b')]=qs[_0x1b7b('0x3c')](_0x47b2c6['query'][_0x1b7b('0x3c')]);_0x3df440['where']=qs[_0x1b7b('0x34')](_[_0x1b7b('0x3d')](_0x47b2c6[_0x1b7b('0x32')],_0x59601a[_0x1b7b('0x34')]),_0x48d5ba);if(_0x47b2c6[_0x1b7b('0x32')]['filter']){_0x3df440[_0x1b7b('0x3e')]=_[_0x1b7b('0x3f')](_0x3df440[_0x1b7b('0x3e')],{'$or':_[_0x1b7b('0x2e')](_0x48d5ba,function(_0x279bd5){if(_0x279bd5[_0x1b7b('0x40')]!==_0x1b7b('0x41')){var _0x11adbd={};_0x11adbd[_0x279bd5['name']]={'$like':'%'+_0x47b2c6[_0x1b7b('0x32')][_0x1b7b('0x42')]+'%'};return _0x11adbd;}})});}_0x3df440=_[_0x1b7b('0x3f')]({},_0x3df440,_0x47b2c6[_0x1b7b('0x43')]);var _0x4d47c8={'where':_0x3df440[_0x1b7b('0x3e')]};return db[_0x1b7b('0x2f')][_0x1b7b('0x22')](_0x4d47c8)[_0x1b7b('0x44')](function(_0x4a3720){_0x39de23['count']=_0x4a3720;if(_0x47b2c6[_0x1b7b('0x32')]['includeAll']){_0x3df440[_0x1b7b('0x45')]=[{'all':!![]}];}return db[_0x1b7b('0x2f')][_0x1b7b('0x46')](_0x3df440);})['then'](function(_0x534908){_0x39de23['rows']=_0x534908;return _0x39de23;})[_0x1b7b('0x44')](respondWithFilteredResult(_0x5c9ccb,_0x3df440))[_0x1b7b('0x47')](handleError(_0x5c9ccb,null));};exports[_0x1b7b('0x48')]=function(_0x345c8f,_0x55ad6e){var _0x42c269={'raw':!![],'where':{'id':_0x345c8f['params']['id']}},_0x1b6009={};_0x1b6009[_0x1b7b('0x36')]=_[_0x1b7b('0x33')](db[_0x1b7b('0x2f')][_0x1b7b('0x30')]);_0x1b6009[_0x1b7b('0x32')]=_[_0x1b7b('0x33')](_0x345c8f['query']);_0x1b6009[_0x1b7b('0x34')]=_['intersection'](_0x1b6009['model'],_0x1b6009['query']);_0x42c269[_0x1b7b('0x37')]=_[_0x1b7b('0x35')](_0x1b6009[_0x1b7b('0x36')],qs['fields'](_0x345c8f[_0x1b7b('0x32')][_0x1b7b('0x38')]));_0x42c269[_0x1b7b('0x37')]=_0x42c269['attributes'][_0x1b7b('0x39')]?_0x42c269[_0x1b7b('0x37')]:_0x1b6009[_0x1b7b('0x36')];if(_0x345c8f['query'][_0x1b7b('0x49')]){_0x42c269[_0x1b7b('0x45')]=[{'all':!![]}];}_0x42c269=_[_0x1b7b('0x3f')]({},_0x42c269,_0x345c8f[_0x1b7b('0x43')]);return db[_0x1b7b('0x2f')][_0x1b7b('0x4a')](_0x42c269)[_0x1b7b('0x44')](handleEntityNotFound(_0x55ad6e,null))[_0x1b7b('0x44')](respondWithResult(_0x55ad6e,null))['catch'](handleError(_0x55ad6e,null));};exports['create']=function(_0x482ae7,_0x26bb27){return db[_0x1b7b('0x2f')][_0x1b7b('0x4b')](_0x482ae7[_0x1b7b('0x4c')],{})[_0x1b7b('0x44')](respondWithResult(_0x26bb27,0xc9))[_0x1b7b('0x47')](handleError(_0x26bb27,null));};exports['update']=function(_0x30b112,_0x39a34b){if(_0x30b112[_0x1b7b('0x4c')]['id']){delete _0x30b112[_0x1b7b('0x4c')]['id'];}return db[_0x1b7b('0x2f')][_0x1b7b('0x4a')]({'where':{'id':_0x30b112[_0x1b7b('0x4d')]['id']}})[_0x1b7b('0x44')](handleEntityNotFound(_0x39a34b,null))['then'](saveUpdates(_0x30b112[_0x1b7b('0x4c')],null))['then'](respondWithResult(_0x39a34b,null))[_0x1b7b('0x47')](handleError(_0x39a34b,null));};exports[_0x1b7b('0x29')]=function(_0x5e4da3,_0x433e0d){return db[_0x1b7b('0x2f')][_0x1b7b('0x4a')]({'where':{'id':_0x5e4da3[_0x1b7b('0x4d')]['id']}})[_0x1b7b('0x44')](handleEntityNotFound(_0x433e0d,null))[_0x1b7b('0x44')](removeEntity(_0x433e0d,null))['catch'](handleError(_0x433e0d,null));};exports[_0x1b7b('0x4e')]=function(_0x1ca7c8,_0x5a1f8f){return db['ChatInternalMessage']['describe']()[_0x1b7b('0x44')](respondWithResult(_0x5a1f8f,null))[_0x1b7b('0x47')](handleError(_0x5a1f8f,null));};function wrapUser(_0x337030){return function(_0x413f99){var _0x38b38d=_0x337030[_0x1b7b('0x4f')]({'plain':!![]});_0x38b38d[_0x1b7b('0x50')]=[];if(_0x413f99){_0x38b38d['lastMessageAt']=_0x413f99[_0x1b7b('0x51')];_0x38b38d['lastMessage']=_0x413f99;}else{_0x38b38d[_0x1b7b('0x52')]=moment(0x0)[_0x1b7b('0x53')](_0x1b7b('0x54'));_0x38b38d[_0x1b7b('0x55')]={};}return _0x38b38d;};}exports['getUsers']=function(_0x5ce501,_0x4cbef9,_0x7f4718){var _0x2cb568=[];return db[_0x1b7b('0x56')][_0x1b7b('0x46')]({'where':{'role':[_0x1b7b('0x57'),'admin','user']},'attributes':['id',_0x1b7b('0x58'),_0x1b7b('0x2c'),_0x1b7b('0x59'),_0x1b7b('0x5a'),_0x1b7b('0x5b'),_0x1b7b('0x5c'),_0x1b7b('0x5d'),_0x1b7b('0x5e'),_0x1b7b('0x5f')],'order':qs[_0x1b7b('0x3c')](_0x1b7b('0x60')),'include':[{'model':db['VoiceQueue'],'as':_0x1b7b('0x61'),'attributes':['id',_0x1b7b('0x2c'),_0x1b7b('0x40')],'through':{'attributes':[]}}]})[_0x1b7b('0x44')](function(_0x49a096){if(_0x49a096){var _0x447732=_0x5ce501[_0x1b7b('0x62')][_0x1b7b('0x4f')]({'plain':!![]});if(!_0x447732)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x447732[_0x1b7b('0x59')]===_0x1b7b('0x62')){return db[_0x1b7b('0x63')][_0x1b7b('0x4a')]({'where':{'name':_0x1b7b('0x64'),'userProfileId':_0x447732[_0x1b7b('0x65')]},'raw':!![]})[_0x1b7b('0x44')](function(_0x1a88e3){if(_0x1a88e3){if(_0x1a88e3[_0x1b7b('0x66')]===0x0){return db[_0x1b7b('0x67')][_0x1b7b('0x46')]({'where':{'sectionId':_0x1a88e3['id']},'raw':!![]})[_0x1b7b('0x44')](function(_0x4bfd46){var _0x5aeb36=[];if(_['isEmpty'](_0x4bfd46)){_0x5aeb36=_[_0x1b7b('0x42')](_0x49a096,function(_0xdbbde5){if(_0xdbbde5[_0x1b7b('0x59')]!=='agent'){return _0xdbbde5;}});return _0x5aeb36;}else{for(var _0x138176=0x0;_0x138176<_0x49a096['length'];_0x138176++){var _0x514f0c=_0x49a096[_0x138176];if(_0x514f0c['role']===_0x1b7b('0x57')){var _0x3d2679=_[_0x1b7b('0x4a')](_0x4bfd46,function(_0x3d8fc1){return _0x3d8fc1['resourceId']===_0x514f0c['id'];});if(_0x3d2679)_0x5aeb36[_0x1b7b('0x68')](_0x514f0c);}else{_0x5aeb36[_0x1b7b('0x68')](_0x514f0c);}}return _0x5aeb36;}});}else{return _0x49a096;}}else{var _0x162025=_[_0x1b7b('0x42')](_0x49a096,function(_0x329cc8){if(_0x329cc8[_0x1b7b('0x59')]!==_0x1b7b('0x57')){return _0x329cc8;}});return _0x162025;}});}else{return _0x49a096;}}})[_0x1b7b('0x44')](function(_0x5eafb2){var _0x4a415d=[];if(_0x5eafb2){_0x2cb568=_0x5eafb2;for(var _0x1cdad2=0x0;_0x1cdad2<_0x5eafb2[_0x1b7b('0x39')];_0x1cdad2+=0x1){_0x2cb568[_0x1cdad2]['messages']=[];_0x4a415d[_0x1b7b('0x68')](db[_0x1b7b('0x2f')][_0x1b7b('0x4a')]({'where':{'FromId':[_0x5ce501[_0x1b7b('0x62')]['id'],_0x5eafb2[_0x1cdad2]['id']],'ToId':[_0x5ce501[_0x1b7b('0x62')]['id'],_0x5eafb2[_0x1cdad2]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x1b7b('0x69'),_0x1b7b('0x6a'),_0x1b7b('0x6b'),'body'],'order':qs[_0x1b7b('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x5eafb2[_0x1cdad2])));}return BPromise[_0x1b7b('0x6c')](_0x4a415d);}return[];})[_0x1b7b('0x44')](function(_0x216f7c){return{'rows':_0x216f7c,'count':_0x216f7c['length']};})[_0x1b7b('0x44')](respondWithResult(_0x4cbef9,null))[_0x1b7b('0x47')](handleError(_0x4cbef9,null));};
\ No newline at end of file
+var _0xef32=['User','agent','admin','user','fullname','role','internal','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read','all','eml-format','zip-dir','moment','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ChatInternalMessage','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','body','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2a40b2,_0x35c0c1){var _0x6c4056=function(_0xa1a401){while(--_0xa1a401){_0x2a40b2['push'](_0x2a40b2['shift']());}};_0x6c4056(++_0x35c0c1);}(_0xef32,0x83));var _0x2ef3=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xef32[_0x47a7d0];return _0xb9bd08;};'use strict';var emlformat=require(_0x2ef3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2ef3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2ef3('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2ef3('0x3'));var path=require(_0x2ef3('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2ef3('0x5'));var fs=require('fs');var fs_extra=require(_0x2ef3('0x6'));var _=require(_0x2ef3('0x7'));var squel=require(_0x2ef3('0x8'));var crypto=require('crypto');var jsforce=require(_0x2ef3('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x2ef3('0xa'));var querystring=require(_0x2ef3('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2ef3('0xc'));var qs=require(_0x2ef3('0xd'));var as=require(_0x2ef3('0xe'));var hardwareService=require(_0x2ef3('0xf'));var logger=require(_0x2ef3('0x10'))(_0x2ef3('0x11'));var utils=require(_0x2ef3('0x12'));var config=require(_0x2ef3('0x13'));var licenseUtil=require(_0x2ef3('0x14'));var db=require(_0x2ef3('0x15'))['db'];config[_0x2ef3('0x16')]=_[_0x2ef3('0x17')](config[_0x2ef3('0x16')],{'host':_0x2ef3('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x2ef3('0x19')](socket);function respondWithStatusCode(_0x3c6134,_0x457348){_0x457348=_0x457348||0xcc;return function(_0x54653d){if(_0x54653d){return _0x3c6134['sendStatus'](_0x457348);}return _0x3c6134['status'](_0x457348)[_0x2ef3('0x1a')]();};}function respondWithResult(_0x537dea,_0x570804){_0x570804=_0x570804||0xc8;return function(_0x5db24c){if(_0x5db24c){return _0x537dea[_0x2ef3('0x1b')](_0x570804)[_0x2ef3('0x1c')](_0x5db24c);}};}function respondWithFilteredResult(_0x1a1eb4,_0x353872){return function(_0x9ebdac){if(_0x9ebdac){var _0x43027f=typeof _0x353872[_0x2ef3('0x1d')]==='undefined'&&typeof _0x353872['limit']===_0x2ef3('0x1e');var _0xb265a9=_0x9ebdac[_0x2ef3('0x1f')];var _0x3f376a=_0x43027f?0x0:_0x353872[_0x2ef3('0x1d')];var _0x2a48ee=_0x43027f?_0x9ebdac[_0x2ef3('0x1f')]:_0x353872[_0x2ef3('0x1d')]+_0x353872[_0x2ef3('0x20')];var _0x2e3fb1;if(_0x2a48ee>=_0xb265a9){_0x2a48ee=_0xb265a9;_0x2e3fb1=0xc8;}else{_0x2e3fb1=0xce;}_0x1a1eb4['status'](_0x2e3fb1);return _0x1a1eb4[_0x2ef3('0x21')](_0x2ef3('0x22'),_0x3f376a+'-'+_0x2a48ee+'/'+_0xb265a9)[_0x2ef3('0x1c')](_0x9ebdac);}return null;};}function patchUpdates(_0x3e26cc){return function(_0x4f1b7a){try{jsonpatch[_0x2ef3('0x23')](_0x4f1b7a,_0x3e26cc,!![]);}catch(_0x5f2056){return BPromise[_0x2ef3('0x24')](_0x5f2056);}return _0x4f1b7a[_0x2ef3('0x25')]();};}function saveUpdates(_0x165776,_0x40a5a8){return function(_0x3637a2){if(_0x3637a2){return _0x3637a2[_0x2ef3('0x26')](_0x165776)[_0x2ef3('0x27')](function(_0x5d3958){return _0x5d3958;});}return null;};}function removeEntity(_0x59cdc9,_0x1b1721){return function(_0x536e0f){if(_0x536e0f){return _0x536e0f[_0x2ef3('0x28')]()[_0x2ef3('0x27')](function(){_0x59cdc9[_0x2ef3('0x1b')](0xcc)[_0x2ef3('0x1a')]();});}};}function handleEntityNotFound(_0x32bd69,_0x224519){return function(_0x276691){if(!_0x276691){_0x32bd69[_0x2ef3('0x29')](0x194);}return _0x276691;};}function handleError(_0x405c3a,_0x504e83){_0x504e83=_0x504e83||0x1f4;return function(_0x110928){logger['error'](_0x110928[_0x2ef3('0x2a')]);if(_0x110928[_0x2ef3('0x2b')]){delete _0x110928[_0x2ef3('0x2b')];}_0x405c3a[_0x2ef3('0x1b')](_0x504e83)[_0x2ef3('0x2c')](_0x110928);};}exports[_0x2ef3('0x2d')]=function(_0x50912d,_0x1566f6){var _0x5c3af0={},_0x12a42d={},_0x7ca75e={'count':0x0,'rows':[]};var _0x29f8eb=_[_0x2ef3('0x2e')](db[_0x2ef3('0x2f')]['rawAttributes'],function(_0x566038){return{'name':_0x566038['fieldName'],'type':_0x566038[_0x2ef3('0x30')][_0x2ef3('0x31')]};});_0x12a42d[_0x2ef3('0x32')]=_[_0x2ef3('0x2e')](_0x29f8eb,'name');_0x12a42d['query']=_[_0x2ef3('0x33')](_0x50912d[_0x2ef3('0x34')]);_0x12a42d[_0x2ef3('0x35')]=_['intersection'](_0x12a42d[_0x2ef3('0x32')],_0x12a42d[_0x2ef3('0x34')]);_0x5c3af0[_0x2ef3('0x36')]=_[_0x2ef3('0x37')](_0x12a42d[_0x2ef3('0x32')],qs[_0x2ef3('0x38')](_0x50912d[_0x2ef3('0x34')][_0x2ef3('0x38')]));_0x5c3af0['attributes']=_0x5c3af0[_0x2ef3('0x36')][_0x2ef3('0x39')]?_0x5c3af0[_0x2ef3('0x36')]:_0x12a42d[_0x2ef3('0x32')];if(!_0x50912d[_0x2ef3('0x34')][_0x2ef3('0x3a')](_0x2ef3('0x3b'))){_0x5c3af0[_0x2ef3('0x20')]=qs['limit'](_0x50912d[_0x2ef3('0x34')]['limit']);_0x5c3af0[_0x2ef3('0x1d')]=qs[_0x2ef3('0x1d')](_0x50912d[_0x2ef3('0x34')][_0x2ef3('0x1d')]);}_0x5c3af0[_0x2ef3('0x3c')]=qs['sort'](_0x50912d[_0x2ef3('0x34')][_0x2ef3('0x3d')]);_0x5c3af0[_0x2ef3('0x3e')]=qs[_0x2ef3('0x35')](_[_0x2ef3('0x3f')](_0x50912d[_0x2ef3('0x34')],_0x12a42d['filters']),_0x29f8eb);if(_0x50912d[_0x2ef3('0x34')][_0x2ef3('0x40')]){_0x5c3af0[_0x2ef3('0x3e')]=_['merge'](_0x5c3af0[_0x2ef3('0x3e')],{'$or':_[_0x2ef3('0x2e')](_0x29f8eb,function(_0x2e3f94){if(_0x2e3f94['type']!==_0x2ef3('0x41')){var _0x15f729={};_0x15f729[_0x2e3f94[_0x2ef3('0x2b')]]={'$like':'%'+_0x50912d[_0x2ef3('0x34')][_0x2ef3('0x40')]+'%'};return _0x15f729;}})});}_0x5c3af0=_[_0x2ef3('0x42')]({},_0x5c3af0,_0x50912d['options']);var _0x3147b0={'where':_0x5c3af0[_0x2ef3('0x3e')]};return db[_0x2ef3('0x2f')]['count'](_0x3147b0)[_0x2ef3('0x27')](function(_0x5164b3){_0x7ca75e[_0x2ef3('0x1f')]=_0x5164b3;if(_0x50912d[_0x2ef3('0x34')][_0x2ef3('0x43')]){_0x5c3af0[_0x2ef3('0x44')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x2ef3('0x45')](_0x5c3af0);})[_0x2ef3('0x27')](function(_0x3d0e19){_0x7ca75e[_0x2ef3('0x46')]=_0x3d0e19;return _0x7ca75e;})['then'](respondWithFilteredResult(_0x1566f6,_0x5c3af0))['catch'](handleError(_0x1566f6,null));};exports[_0x2ef3('0x47')]=function(_0x10e4cb,_0x515340){var _0x597598={'raw':!![],'where':{'id':_0x10e4cb[_0x2ef3('0x48')]['id']}},_0x346c05={};_0x346c05[_0x2ef3('0x32')]=_[_0x2ef3('0x33')](db[_0x2ef3('0x2f')][_0x2ef3('0x49')]);_0x346c05[_0x2ef3('0x34')]=_[_0x2ef3('0x33')](_0x10e4cb[_0x2ef3('0x34')]);_0x346c05[_0x2ef3('0x35')]=_[_0x2ef3('0x37')](_0x346c05[_0x2ef3('0x32')],_0x346c05[_0x2ef3('0x34')]);_0x597598[_0x2ef3('0x36')]=_[_0x2ef3('0x37')](_0x346c05['model'],qs['fields'](_0x10e4cb['query'][_0x2ef3('0x38')]));_0x597598['attributes']=_0x597598[_0x2ef3('0x36')]['length']?_0x597598[_0x2ef3('0x36')]:_0x346c05[_0x2ef3('0x32')];if(_0x10e4cb['query'][_0x2ef3('0x43')]){_0x597598[_0x2ef3('0x44')]=[{'all':!![]}];}_0x597598=_[_0x2ef3('0x42')]({},_0x597598,_0x10e4cb[_0x2ef3('0x4a')]);return db[_0x2ef3('0x2f')][_0x2ef3('0x4b')](_0x597598)[_0x2ef3('0x27')](handleEntityNotFound(_0x515340,null))['then'](respondWithResult(_0x515340,null))[_0x2ef3('0x4c')](handleError(_0x515340,null));};exports['create']=function(_0xcc3b26,_0x456390){return db[_0x2ef3('0x2f')]['create'](_0xcc3b26[_0x2ef3('0x4d')],{})[_0x2ef3('0x27')](respondWithResult(_0x456390,0xc9))[_0x2ef3('0x4c')](handleError(_0x456390,null));};exports[_0x2ef3('0x26')]=function(_0x20c29e,_0x57645f){if(_0x20c29e[_0x2ef3('0x4d')]['id']){delete _0x20c29e[_0x2ef3('0x4d')]['id'];}return db['ChatInternalMessage'][_0x2ef3('0x4b')]({'where':{'id':_0x20c29e['params']['id']}})[_0x2ef3('0x27')](handleEntityNotFound(_0x57645f,null))['then'](saveUpdates(_0x20c29e[_0x2ef3('0x4d')],null))[_0x2ef3('0x27')](respondWithResult(_0x57645f,null))[_0x2ef3('0x4c')](handleError(_0x57645f,null));};exports[_0x2ef3('0x28')]=function(_0x47e204,_0x6bb6e3){return db[_0x2ef3('0x2f')][_0x2ef3('0x4b')]({'where':{'id':_0x47e204[_0x2ef3('0x48')]['id']}})[_0x2ef3('0x27')](handleEntityNotFound(_0x6bb6e3,null))['then'](removeEntity(_0x6bb6e3,null))[_0x2ef3('0x4c')](handleError(_0x6bb6e3,null));};exports[_0x2ef3('0x4e')]=function(_0xfabeec,_0x2f7098){return db['ChatInternalMessage']['describe']()[_0x2ef3('0x27')](respondWithResult(_0x2f7098,null))[_0x2ef3('0x4c')](handleError(_0x2f7098,null));};function wrapUser(_0x4a0526){return function(_0x320cd8){var _0x128039=_0x4a0526['get']({'plain':!![]});_0x128039[_0x2ef3('0x4f')]=[];if(_0x320cd8){_0x128039[_0x2ef3('0x50')]=_0x320cd8[_0x2ef3('0x51')];_0x128039[_0x2ef3('0x52')]=_0x320cd8;}else{_0x128039[_0x2ef3('0x50')]=moment(0x0)[_0x2ef3('0x53')](_0x2ef3('0x54'));_0x128039['lastMessage']={};}return _0x128039;};}exports['getUsers']=function(_0x2f1848,_0x4f0fc5,_0x3091b3){var _0x473e27=[];return db[_0x2ef3('0x55')]['findAll']({'where':{'role':[_0x2ef3('0x56'),_0x2ef3('0x57'),_0x2ef3('0x58')]},'attributes':['id',_0x2ef3('0x59'),_0x2ef3('0x2b'),_0x2ef3('0x5a'),'userpic',_0x2ef3('0x5b'),'online',_0x2ef3('0x5c'),'allowmessenger',_0x2ef3('0x5d')],'order':qs[_0x2ef3('0x3d')](_0x2ef3('0x5e')),'include':[{'model':db[_0x2ef3('0x5f')],'as':_0x2ef3('0x60'),'attributes':['id',_0x2ef3('0x2b'),_0x2ef3('0x30')],'through':{'attributes':[]}}]})['then'](function(_0x1d87c8){if(_0x1d87c8){var _0x4eba03=_0x2f1848[_0x2ef3('0x58')][_0x2ef3('0x61')]({'plain':!![]});if(!_0x4eba03)throw new Error(_0x2ef3('0x62'));if(_0x4eba03[_0x2ef3('0x5a')]===_0x2ef3('0x58')){return db['UserProfileSection'][_0x2ef3('0x4b')]({'where':{'name':'Agents','userProfileId':_0x4eba03[_0x2ef3('0x63')]},'raw':!![]})[_0x2ef3('0x27')](function(_0x53883c){if(_0x53883c){if(_0x53883c[_0x2ef3('0x64')]===0x0){return db[_0x2ef3('0x65')][_0x2ef3('0x45')]({'where':{'sectionId':_0x53883c['id']},'raw':!![]})[_0x2ef3('0x27')](function(_0x569bf9){var _0x55038f=[];if(_[_0x2ef3('0x66')](_0x569bf9)){_0x55038f=_[_0x2ef3('0x40')](_0x1d87c8,function(_0x3b3aca){if(_0x3b3aca[_0x2ef3('0x5a')]!==_0x2ef3('0x56')){return _0x3b3aca;}});return _0x55038f;}else{for(var _0xf452f4=0x0;_0xf452f4<_0x1d87c8[_0x2ef3('0x39')];_0xf452f4++){var _0x30a29a=_0x1d87c8[_0xf452f4];if(_0x30a29a['role']===_0x2ef3('0x56')){var _0xe6083f=_[_0x2ef3('0x4b')](_0x569bf9,function(_0x3b7274){return _0x3b7274[_0x2ef3('0x67')]===_0x30a29a['id'];});if(_0xe6083f)_0x55038f[_0x2ef3('0x68')](_0x30a29a);}else{_0x55038f[_0x2ef3('0x68')](_0x30a29a);}}return _0x55038f;}});}else{return _0x1d87c8;}}else{var _0x19fcaf=_[_0x2ef3('0x40')](_0x1d87c8,function(_0x53ba2c){if(_0x53ba2c[_0x2ef3('0x5a')]!==_0x2ef3('0x56')){return _0x53ba2c;}});return _0x19fcaf;}});}else{return _0x1d87c8;}}})['then'](function(_0x293cd2){var _0xc9dce0=[];if(_0x293cd2){_0x473e27=_0x293cd2;for(var _0x151261=0x0;_0x151261<_0x293cd2[_0x2ef3('0x39')];_0x151261+=0x1){_0x473e27[_0x151261]['messages']=[];_0xc9dce0['push'](db[_0x2ef3('0x2f')]['find']({'where':{'FromId':[_0x2f1848[_0x2ef3('0x58')]['id'],_0x293cd2[_0x151261]['id']],'ToId':[_0x2f1848[_0x2ef3('0x58')]['id'],_0x293cd2[_0x151261]['id']],'ChatGroupId':null},'attributes':['id',_0x2ef3('0x51'),_0x2ef3('0x69'),'ToId',_0x2ef3('0x6a'),_0x2ef3('0x4d')],'order':qs[_0x2ef3('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2ef3('0x27')](wrapUser(_0x293cd2[_0x151261])));}return BPromise[_0x2ef3('0x6b')](_0xc9dce0);}return[];})[_0x2ef3('0x27')](function(_0x2f7ed9){return{'rows':_0x2f7ed9,'count':_0x2f7ed9[_0x2ef3('0x39')]};})[_0x2ef3('0x27')](respondWithResult(_0x4f0fc5,null))[_0x2ef3('0x4c')](handleError(_0x4f0fc5,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index bb7b88a..7b341d0 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 _0xe7d2=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x5d5912,_0x184e28){var _0x3ca890=function(_0x2bbee2){while(--_0x2bbee2){_0x5d5912['push'](_0x5d5912['shift']());}};_0x3ca890(++_0x184e28);}(_0xe7d2,0x13c));var _0x2e7d=function(_0x45cd76,_0x2e2a5b){_0x45cd76=_0x45cd76-0x0;var _0x55918d=_0xe7d2[_0x45cd76];return _0x55918d;};'use strict';var EventEmitter=require(_0x2e7d('0x0'));var ChatInternalMessage=require(_0x2e7d('0x1'))['db'][_0x2e7d('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2e7d('0x3')](0x0);var events={'afterCreate':_0x2e7d('0x4'),'afterUpdate':_0x2e7d('0x5'),'afterDestroy':_0x2e7d('0x6')};function emitEvent(_0x34f2f0){return function(_0x428c15,_0x4df6e0,_0x2946dd){ChatInternalMessageEvents[_0x2e7d('0x7')](_0x34f2f0+':'+_0x428c15['id'],_0x428c15);ChatInternalMessageEvents['emit'](_0x34f2f0,_0x428c15);_0x2946dd(null);};}for(var e in events){if(events[_0x2e7d('0x8')](e)){var event=events[e];ChatInternalMessage[_0x2e7d('0x9')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe323=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0xe323,0x16c));var _0x3e32=function(_0x393785,_0x46c39e){_0x393785=_0x393785-0x0;var _0x5e47c8=_0xe323[_0x393785];return _0x5e47c8;};'use strict';var EventEmitter=require(_0x3e32('0x0'));var ChatInternalMessage=require(_0x3e32('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3e32('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3e32('0x3'),'afterDestroy':_0x3e32('0x4')};function emitEvent(_0x1d192d){return function(_0x1830a6,_0x1fa28e,_0x64dcb2){ChatInternalMessageEvents[_0x3e32('0x5')](_0x1d192d+':'+_0x1830a6['id'],_0x1830a6);ChatInternalMessageEvents['emit'](_0x1d192d,_0x1830a6);_0x64dcb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x3e32('0x6')](e,emitEvent(event));}}module[_0x3e32('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 1efdafe..1388cbd 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 _0x0573=['request-promise','path','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird'];(function(_0x571bbd,_0x36721f){var _0x3e157a=function(_0x1a41d8){while(--_0x1a41d8){_0x571bbd['push'](_0x571bbd['shift']());}};_0x3e157a(++_0x36721f);}(_0x0573,0x1b4));var _0x3057=function(_0x19c188,_0x5bb3d8){_0x19c188=_0x19c188-0x0;var _0x6b5daa=_0x0573[_0x19c188];return _0x6b5daa;};'use strict';var _=require('lodash');var util=require(_0x3057('0x0'));var logger=require(_0x3057('0x1'))('api');var moment=require(_0x3057('0x2'));var BPromise=require(_0x3057('0x3'));var rp=require(_0x3057('0x4'));var fs=require('fs');var path=require(_0x3057('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3057('0x6'));module[_0x3057('0x7')]=function(_0x415782,_0x44c357){return _0x415782['define'](_0x3057('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3057('0x9')});};
\ No newline at end of file
+var _0x907f=['moment','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x11c47b,_0x16a144){var _0x45cd0d=function(_0x26e72c){while(--_0x26e72c){_0x11c47b['push'](_0x11c47b['shift']());}};_0x45cd0d(++_0x16a144);}(_0x907f,0xdd));var _0xf907=function(_0x177cff,_0x579af1){_0x177cff=_0x177cff-0x0;var _0x57aa10=_0x907f[_0x177cff];return _0x57aa10;};'use strict';var _=require(_0xf907('0x0'));var util=require(_0xf907('0x1'));var logger=require('../../config/logger')(_0xf907('0x2'));var moment=require(_0xf907('0x3'));var BPromise=require(_0xf907('0x4'));var rp=require(_0xf907('0x5'));var fs=require('fs');var path=require(_0xf907('0x6'));var rimraf=require('rimraf');var config=require(_0xf907('0x7'));var attributes=require(_0xf907('0x8'));module[_0xf907('0x9')]=function(_0xcec59f,_0x723fee){return _0xcec59f[_0xf907('0xa')](_0xf907('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf907('0xc'),'collate':_0xf907('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 92c26fb..0c6c45d 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 _0x25fa=['defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x25fa,0x109));var _0xa25f=function(_0x87895a,_0x417b96){_0x87895a=_0x87895a-0x0;var _0x14ec4b=_0x25fa[_0x87895a];return _0x14ec4b;};'use strict';var _=require(_0xa25f('0x0'));var util=require('util');var moment=require(_0xa25f('0x1'));var BPromise=require(_0xa25f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa25f('0x3'));var db=require(_0xa25f('0x4'))['db'];var utils=require(_0xa25f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa25f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa25f('0x7')][_0xa25f('0x8')]({'port':0x232a});config[_0xa25f('0x9')]=_[_0xa25f('0xa')](config[_0xa25f('0x9')],{'host':_0xa25f('0xb'),'port':0x18eb});var socket=require(_0xa25f('0xc'))(new Redis(config[_0xa25f('0x9')]));require(_0xa25f('0xd'))['register'](socket);function respondWithRpcPromise(_0x1bca18,_0x31bd1d,_0x507a36){return new BPromise(function(_0x22b930,_0x12c861){return client[_0xa25f('0xe')](_0x1bca18,_0x507a36)[_0xa25f('0xf')](function(_0x5168c1){logger[_0xa25f('0x10')](_0xa25f('0x11'),_0x31bd1d,'request\x20sent');logger[_0xa25f('0x12')](_0xa25f('0x13'),_0x31bd1d,'request\x20sent',JSON[_0xa25f('0x14')](_0x5168c1));if(_0x5168c1[_0xa25f('0x15')]){if(_0x5168c1[_0xa25f('0x15')][_0xa25f('0x16')]===0x1f4){logger[_0xa25f('0x15')](_0xa25f('0x11'),_0x31bd1d,_0x5168c1[_0xa25f('0x15')][_0xa25f('0x17')]);return _0x12c861(_0x5168c1[_0xa25f('0x15')][_0xa25f('0x17')]);}logger[_0xa25f('0x15')](_0xa25f('0x11'),_0x31bd1d,_0x5168c1['error'][_0xa25f('0x17')]);return _0x22b930(_0x5168c1[_0xa25f('0x15')][_0xa25f('0x17')]);}else{logger[_0xa25f('0x10')](_0xa25f('0x11'),_0x31bd1d,_0xa25f('0x18'));_0x22b930(_0x5168c1['result'][_0xa25f('0x17')]);}})['catch'](function(_0x32b868){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x31bd1d,_0x32b868);_0x12c861(_0x32b868);});});}
\ No newline at end of file
+var _0xcaa7=['redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x22b28f,_0x466e3e){var _0x2aca97=function(_0x1bc77b){while(--_0x1bc77b){_0x22b28f['push'](_0x22b28f['shift']());}};_0x2aca97(++_0x466e3e);}(_0xcaa7,0x1a5));var _0x7caa=function(_0x38a4c9,_0x3045ca){_0x38a4c9=_0x38a4c9-0x0;var _0x5818c3=_0xcaa7[_0x38a4c9];return _0x5818c3;};'use strict';var _=require(_0x7caa('0x0'));var util=require(_0x7caa('0x1'));var moment=require('moment');var BPromise=require(_0x7caa('0x2'));var rs=require(_0x7caa('0x3'));var fs=require('fs');var Redis=require(_0x7caa('0x4'));var db=require(_0x7caa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7caa('0x6'))('rpc');var config=require(_0x7caa('0x7'));var jayson=require(_0x7caa('0x8'));var client=jayson[_0x7caa('0x9')][_0x7caa('0xa')]({'port':0x232a});config[_0x7caa('0xb')]=_[_0x7caa('0xc')](config['redis'],{'host':_0x7caa('0xd'),'port':0x18eb});var socket=require(_0x7caa('0xe'))(new Redis(config[_0x7caa('0xb')]));require(_0x7caa('0xf'))[_0x7caa('0x10')](socket);function respondWithRpcPromise(_0x3bceeb,_0x5c03e1,_0x194384){return new BPromise(function(_0x2e890c,_0x4f745f){return client[_0x7caa('0x11')](_0x3bceeb,_0x194384)['then'](function(_0x41649e){logger[_0x7caa('0x12')](_0x7caa('0x13'),_0x5c03e1,'request\x20sent');logger[_0x7caa('0x14')](_0x7caa('0x15'),_0x5c03e1,'request\x20sent',JSON[_0x7caa('0x16')](_0x41649e));if(_0x41649e['error']){if(_0x41649e[_0x7caa('0x17')][_0x7caa('0x18')]===0x1f4){logger[_0x7caa('0x17')](_0x7caa('0x13'),_0x5c03e1,_0x41649e[_0x7caa('0x17')][_0x7caa('0x19')]);return _0x4f745f(_0x41649e[_0x7caa('0x17')]['message']);}logger[_0x7caa('0x17')](_0x7caa('0x13'),_0x5c03e1,_0x41649e[_0x7caa('0x17')][_0x7caa('0x19')]);return _0x2e890c(_0x41649e[_0x7caa('0x17')]['message']);}else{logger[_0x7caa('0x12')](_0x7caa('0x13'),_0x5c03e1,'request\x20sent');_0x2e890c(_0x41649e['result']['message']);}})[_0x7caa('0x1a')](function(_0x310b35){logger[_0x7caa('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x5c03e1,_0x310b35);_0x4f745f(_0x310b35);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index fc14c94..22d6a8a 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 _0xde20=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x1a7f70,_0x297a0c){var _0x326c0a=function(_0x1e6bd8){while(--_0x1e6bd8){_0x1a7f70['push'](_0x1a7f70['shift']());}};_0x326c0a(++_0x297a0c);}(_0xde20,0x163));var _0x0de2=function(_0x4ff167,_0x770231){_0x4ff167=_0x4ff167-0x0;var _0x314f3f=_0xde20[_0x4ff167];return _0x314f3f;};'use strict';var ChatInternalMessageEvents=require(_0x0de2('0x0'));var events=[_0x0de2('0x1'),_0x0de2('0x2'),_0x0de2('0x3')];function createListener(_0x2e959f,_0x2334d9){return function(_0x4a9598){_0x2334d9[_0x0de2('0x4')](_0x2e959f,_0x4a9598);};}function removeListener(_0xb0c4f,_0x913186){return function(){ChatInternalMessageEvents[_0x0de2('0x5')](_0xb0c4f,_0x913186);};}exports[_0x0de2('0x6')]=function(_0x34adaf){for(var _0x27ea0c=0x0,_0x1149bd=events[_0x0de2('0x7')];_0x27ea0c<_0x1149bd;_0x27ea0c++){var _0x464a16=events[_0x27ea0c];var _0x1a5262=createListener(_0x0de2('0x8')+_0x464a16,_0x34adaf);ChatInternalMessageEvents['on'](_0x464a16,_0x1a5262);}};
\ No newline at end of file
+var _0xb272=['emit','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0x3e1c5e,_0x56d4cd){var _0x54df7a=function(_0x4e2f81){while(--_0x4e2f81){_0x3e1c5e['push'](_0x3e1c5e['shift']());}};_0x54df7a(++_0x56d4cd);}(_0xb272,0x1e0));var _0x2b27=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0xb272[_0x184759];return _0xf26d5f;};'use strict';var ChatInternalMessageEvents=require(_0x2b27('0x0'));var events=['save',_0x2b27('0x1'),_0x2b27('0x2')];function createListener(_0xf6ff52,_0x3df96f){return function(_0x9ca708){_0x3df96f[_0x2b27('0x3')](_0xf6ff52,_0x9ca708);};}function removeListener(_0x1756a2,_0xec2d5b){return function(){ChatInternalMessageEvents['removeListener'](_0x1756a2,_0xec2d5b);};}exports[_0x2b27('0x4')]=function(_0x457b5a){for(var _0x1cf6fa=0x0,_0x21ec1c=events[_0x2b27('0x5')];_0x1cf6fa<_0x21ec1c;_0x1cf6fa++){var _0x553ffa=events[_0x1cf6fa];var _0x4fb610=createListener(_0x2b27('0x6')+_0x553ffa,_0x457b5a);ChatInternalMessageEvents['on'](_0x553ffa,_0x4fb610);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index ea92d88..a3d6fcd 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 _0xd618=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/users','getUsers','/:id','put','delete','destroy','exports','multer','express','../../components/auth/service'];(function(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0xd618,0x1ad));var _0x8d61=function(_0x122d4d,_0x590e87){_0x122d4d=_0x122d4d-0x0;var _0x3668cf=_0xd618[_0x122d4d];return _0x3668cf;};'use strict';var multer=require(_0x8d61('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8d61('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8d61('0x2'));var interaction=require(_0x8d61('0x3'));var config=require(_0x8d61('0x4'));var controller=require('./chatInternalMessage.controller');router[_0x8d61('0x5')]('/',auth[_0x8d61('0x6')](),controller[_0x8d61('0x7')]);router[_0x8d61('0x5')](_0x8d61('0x8'),auth[_0x8d61('0x6')](),controller['describe']);router[_0x8d61('0x5')](_0x8d61('0x9'),auth[_0x8d61('0x6')](),controller[_0x8d61('0xa')]);router[_0x8d61('0x5')](_0x8d61('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x8d61('0x6')](),controller['create']);router[_0x8d61('0xc')]('/:id',controller['update']);router[_0x8d61('0xd')](_0x8d61('0xb'),auth[_0x8d61('0x6')](),controller[_0x8d61('0xe')]);module[_0x8d61('0xf')]=router;
\ No newline at end of file
+var _0x40ff=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','/users','getUsers','show','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x100b96,_0x1bac2c){var _0x44bbcf=function(_0x3ed853){while(--_0x3ed853){_0x100b96['push'](_0x100b96['shift']());}};_0x44bbcf(++_0x1bac2c);}(_0x40ff,0x10e));var _0xf40f=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x40ff[_0x2b5513];return _0x578fd2;};'use strict';var multer=require(_0xf40f('0x0'));var util=require('util');var path=require(_0xf40f('0x1'));var timeout=require(_0xf40f('0x2'));var express=require('express');var router=express[_0xf40f('0x3')]();var fs_extra=require(_0xf40f('0x4'));var auth=require(_0xf40f('0x5'));var interaction=require(_0xf40f('0x6'));var config=require('../../config/environment');var controller=require(_0xf40f('0x7'));router['get']('/',auth[_0xf40f('0x8')](),controller[_0xf40f('0x9')]);router[_0xf40f('0xa')](_0xf40f('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xf40f('0xa')](_0xf40f('0xc'),auth['isAuthenticated'](),controller[_0xf40f('0xd')]);router[_0xf40f('0xa')]('/:id',auth[_0xf40f('0x8')](),controller[_0xf40f('0xe')]);router['post']('/',auth[_0xf40f('0x8')](),controller[_0xf40f('0xf')]);router[_0xf40f('0x10')](_0xf40f('0x11'),controller['update']);router[_0xf40f('0x12')](_0xf40f('0x11'),auth[_0xf40f('0x8')](),controller[_0xf40f('0x13')]);module[_0xf40f('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index ce00510..37ca870 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 _0x6599=['out','DATE','exports','TEXT','medium','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6599,0xb0));var _0x9659=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0x6599[_0x30182f];return _0x5207db;};'use strict';var Sequelize=require('sequelize');module[_0x9659('0x0')]={'body':{'type':Sequelize[_0x9659('0x1')](_0x9659('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9659('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9659('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9659('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x9659('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9659('0x1')]}};
\ No newline at end of file
+var _0x3264=['STRING','exports','TEXT','medium','BOOLEAN','out'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3264,0x7f));var _0x4326=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x3264[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require('sequelize');module[_0x4326('0x0')]={'body':{'type':Sequelize[_0x4326('0x1')](_0x4326('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4326('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4326('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x4326('0x5')]},'providerResponse':{'type':Sequelize[_0x4326('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 95c4aa1..0d8dbf1 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 _0x4ef5=['crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','register','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','show','params','fields','find','create','body','destroy','describe','chat-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','agent','fullname','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','Sequelize','SELECT','internal','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel'];(function(_0x3d9412,_0x2bd2d6){var _0x3ca4d6=function(_0x21e927){while(--_0x21e927){_0x3d9412['push'](_0x3d9412['shift']());}};_0x3ca4d6(++_0x2bd2d6);}(_0x4ef5,0x6f));var _0x54ef=function(_0x294824,_0x1d55cd){_0x294824=_0x294824-0x0;var _0x5c0a92=_0x4ef5[_0x294824];return _0x5c0a92;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54ef('0x0'));var zipdir=require(_0x54ef('0x1'));var jsonpatch=require(_0x54ef('0x2'));var rp=require(_0x54ef('0x3'));var moment=require(_0x54ef('0x4'));var BPromise=require(_0x54ef('0x5'));var Mustache=require(_0x54ef('0x6'));var util=require(_0x54ef('0x7'));var path=require(_0x54ef('0x8'));var sox=require(_0x54ef('0x9'));var csv=require(_0x54ef('0xa'));var ejs=require(_0x54ef('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x54ef('0xc'));var crypto=require(_0x54ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x54ef('0xe'));var toCsv=require(_0x54ef('0xa'));var querystring=require(_0x54ef('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x54ef('0x10'));var as=require(_0x54ef('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x54ef('0x12'))(_0x54ef('0x13'));var utils=require('../../config/utils');var config=require(_0x54ef('0x14'));var licenseUtil=require(_0x54ef('0x15'));var db=require('../../mysqldb')['db'];config[_0x54ef('0x16')]=_[_0x54ef('0x17')](config[_0x54ef('0x16')],{'host':_0x54ef('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x54ef('0x16')]));require(_0x54ef('0x19'))[_0x54ef('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x54ef('0x1b')][_0x54ef('0x1c')]({'port':0x232c});var client9002=jayson[_0x54ef('0x1b')][_0x54ef('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x12d17a,_0x589303,_0x451269,_0x379116){return new BPromise(function(_0x430ec5,_0x7e495){var _0x448472=_0x379116||client;return _0x448472[_0x54ef('0x1d')](_0x12d17a,_0x451269)[_0x54ef('0x1e')](function(_0x943a7e){logger[_0x54ef('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x589303,_0x54ef('0x20'));logger[_0x54ef('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x589303,_0x54ef('0x20'),JSON[_0x54ef('0x22')](_0x943a7e));if(_0x943a7e['error']){if(_0x943a7e[_0x54ef('0x23')][_0x54ef('0x24')]===0x1f4){logger[_0x54ef('0x23')](_0x54ef('0x25'),_0x589303,_0x943a7e['error'][_0x54ef('0x26')]);return _0x7e495(_0x943a7e[_0x54ef('0x23')][_0x54ef('0x26')]);}logger[_0x54ef('0x23')](_0x54ef('0x25'),_0x589303,_0x943a7e[_0x54ef('0x23')]['message']);return _0x430ec5(_0x943a7e['error']['message']);}else{logger[_0x54ef('0x1f')](_0x54ef('0x25'),_0x589303,_0x54ef('0x20'));_0x430ec5(_0x943a7e['result']['message']);}})[_0x54ef('0x27')](function(_0x195c75){logger['error']('ChatMessage,\x20%s,\x20%s',_0x589303,_0x195c75);_0x7e495(_0x195c75);});});}function respondWithStatusCode(_0x4dc700,_0x426c61){_0x426c61=_0x426c61||0xcc;return function(_0x52ed82){if(_0x52ed82){return _0x4dc700['sendStatus'](_0x426c61);}return _0x4dc700[_0x54ef('0x28')](_0x426c61)[_0x54ef('0x29')]();};}function respondWithResult(_0x4a0557,_0x25ea3d){_0x25ea3d=_0x25ea3d||0xc8;return function(_0x5176d2){if(_0x5176d2){return _0x4a0557['status'](_0x25ea3d)[_0x54ef('0x2a')](_0x5176d2);}};}function respondWithFilteredResult(_0x916dc9,_0x3cb2e4){return function(_0x46c491){if(_0x46c491){var _0x118112=typeof _0x3cb2e4[_0x54ef('0x2b')]===_0x54ef('0x2c')&&typeof _0x3cb2e4[_0x54ef('0x2d')]===_0x54ef('0x2c');var _0x28a7b7=_0x46c491[_0x54ef('0x2e')];var _0xf6c35b=_0x118112?0x0:_0x3cb2e4[_0x54ef('0x2b')];var _0x4f2cb2=_0x118112?_0x46c491[_0x54ef('0x2e')]:_0x3cb2e4[_0x54ef('0x2b')]+_0x3cb2e4['limit'];var _0x377673;if(_0x4f2cb2>=_0x28a7b7){_0x4f2cb2=_0x28a7b7;_0x377673=0xc8;}else{_0x377673=0xce;}_0x916dc9['status'](_0x377673);return _0x916dc9['set'](_0x54ef('0x2f'),_0xf6c35b+'-'+_0x4f2cb2+'/'+_0x28a7b7)[_0x54ef('0x2a')](_0x46c491);}return null;};}function patchUpdates(_0x2d801e){return function(_0x501c86){try{jsonpatch[_0x54ef('0x30')](_0x501c86,_0x2d801e,!![]);}catch(_0x38be04){return BPromise[_0x54ef('0x31')](_0x38be04);}return _0x501c86['save']();};}function saveUpdates(_0x74f8cb,_0x337e71){return function(_0x14c58f){if(_0x14c58f){return _0x14c58f[_0x54ef('0x32')](_0x74f8cb)[_0x54ef('0x1e')](function(_0x33b254){return _0x33b254;});}return null;};}function removeEntity(_0x377ea2,_0x2b628e){return function(_0x3bd587){if(_0x3bd587){return _0x3bd587['destroy']()[_0x54ef('0x1e')](function(){_0x377ea2[_0x54ef('0x28')](0xcc)[_0x54ef('0x29')]();});}};}function handleEntityNotFound(_0x23a448,_0x1b8102){return function(_0xc0c6cf){if(!_0xc0c6cf){_0x23a448[_0x54ef('0x33')](0x194);}return _0xc0c6cf;};}function handleError(_0x3e2edb,_0x4801f1){_0x4801f1=_0x4801f1||0x1f4;return function(_0x200487){logger[_0x54ef('0x23')](_0x200487[_0x54ef('0x34')]);if(_0x200487[_0x54ef('0x35')]){delete _0x200487[_0x54ef('0x35')];}_0x3e2edb['status'](_0x4801f1)[_0x54ef('0x36')](_0x200487);};}exports[_0x54ef('0x37')]=function(_0x531342,_0x5ea323){var _0x482750={},_0x994a07={},_0x593365={'count':0x0,'rows':[]};var _0x319478=_[_0x54ef('0x38')](db[_0x54ef('0x39')][_0x54ef('0x3a')],function(_0x58c40a){return{'name':_0x58c40a[_0x54ef('0x3b')],'type':_0x58c40a[_0x54ef('0x3c')][_0x54ef('0x3d')]};});_0x994a07[_0x54ef('0x3e')]=_[_0x54ef('0x38')](_0x319478,'name');_0x994a07['query']=_[_0x54ef('0x3f')](_0x531342['query']);_0x994a07[_0x54ef('0x40')]=_[_0x54ef('0x41')](_0x994a07[_0x54ef('0x3e')],_0x994a07[_0x54ef('0x42')]);_0x482750[_0x54ef('0x43')]=_[_0x54ef('0x41')](_0x994a07[_0x54ef('0x3e')],qs['fields'](_0x531342[_0x54ef('0x42')]['fields']));_0x482750[_0x54ef('0x43')]=_0x482750['attributes']['length']?_0x482750[_0x54ef('0x43')]:_0x994a07[_0x54ef('0x3e')];if(!_0x531342[_0x54ef('0x42')]['hasOwnProperty'](_0x54ef('0x44'))){_0x482750[_0x54ef('0x2d')]=qs[_0x54ef('0x2d')](_0x531342[_0x54ef('0x42')][_0x54ef('0x2d')]);_0x482750[_0x54ef('0x2b')]=qs['offset'](_0x531342[_0x54ef('0x42')]['offset']);}_0x482750[_0x54ef('0x45')]=qs[_0x54ef('0x46')](_0x531342[_0x54ef('0x42')][_0x54ef('0x46')]);_0x482750[_0x54ef('0x47')]=qs['filters'](_[_0x54ef('0x48')](_0x531342[_0x54ef('0x42')],_0x994a07[_0x54ef('0x40')]),_0x319478);if(_0x531342[_0x54ef('0x42')]['filter']){_0x482750[_0x54ef('0x47')]=_[_0x54ef('0x49')](_0x482750[_0x54ef('0x47')],{'$or':_['map'](_0x319478,function(_0x3c61f9){if(_0x3c61f9[_0x54ef('0x3c')]!==_0x54ef('0x4a')){var _0x1be120={};_0x1be120[_0x3c61f9['name']]={'$like':'%'+_0x531342['query']['filter']+'%'};return _0x1be120;}})});}_0x482750=_[_0x54ef('0x49')]({},_0x482750,_0x531342[_0x54ef('0x4b')]);var _0x59b1aa={'where':_0x482750['where']};return db[_0x54ef('0x39')][_0x54ef('0x2e')](_0x59b1aa)['then'](function(_0x40acc4){_0x593365[_0x54ef('0x2e')]=_0x40acc4;if(_0x531342['query'][_0x54ef('0x4c')]){_0x482750[_0x54ef('0x4d')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x482750);})[_0x54ef('0x1e')](function(_0x3c1c00){_0x593365[_0x54ef('0x4e')]=_0x3c1c00;return _0x593365;})[_0x54ef('0x1e')](respondWithFilteredResult(_0x5ea323,_0x482750))[_0x54ef('0x27')](handleError(_0x5ea323,null));};exports[_0x54ef('0x4f')]=function(_0x24c3ec,_0x399c2c){var _0x459a68={'raw':!![],'where':{'id':_0x24c3ec[_0x54ef('0x50')]['id']}},_0x66d5db={};_0x66d5db['model']=_['keys'](db[_0x54ef('0x39')]['rawAttributes']);_0x66d5db[_0x54ef('0x42')]=_['keys'](_0x24c3ec[_0x54ef('0x42')]);_0x66d5db[_0x54ef('0x40')]=_[_0x54ef('0x41')](_0x66d5db[_0x54ef('0x3e')],_0x66d5db[_0x54ef('0x42')]);_0x459a68[_0x54ef('0x43')]=_[_0x54ef('0x41')](_0x66d5db[_0x54ef('0x3e')],qs[_0x54ef('0x51')](_0x24c3ec[_0x54ef('0x42')]['fields']));_0x459a68[_0x54ef('0x43')]=_0x459a68['attributes']['length']?_0x459a68[_0x54ef('0x43')]:_0x66d5db[_0x54ef('0x3e')];if(_0x24c3ec[_0x54ef('0x42')][_0x54ef('0x4c')]){_0x459a68[_0x54ef('0x4d')]=[{'all':!![]}];}_0x459a68=_[_0x54ef('0x49')]({},_0x459a68,_0x24c3ec[_0x54ef('0x4b')]);return db[_0x54ef('0x39')][_0x54ef('0x52')](_0x459a68)[_0x54ef('0x1e')](handleEntityNotFound(_0x399c2c,null))[_0x54ef('0x1e')](respondWithResult(_0x399c2c,null))[_0x54ef('0x27')](handleError(_0x399c2c,null));};exports[_0x54ef('0x53')]=function(_0x5791ea,_0x3a6400){return db['ChatMessage'][_0x54ef('0x53')](_0x5791ea[_0x54ef('0x54')],{})[_0x54ef('0x1e')](respondWithResult(_0x3a6400,0xc9))['catch'](handleError(_0x3a6400,null));};exports[_0x54ef('0x32')]=function(_0x240aa8,_0x386a61){if(_0x240aa8[_0x54ef('0x54')]['id']){delete _0x240aa8[_0x54ef('0x54')]['id'];}return db['ChatMessage'][_0x54ef('0x52')]({'where':{'id':_0x240aa8['params']['id']}})['then'](handleEntityNotFound(_0x386a61,null))['then'](saveUpdates(_0x240aa8[_0x54ef('0x54')],null))[_0x54ef('0x1e')](respondWithResult(_0x386a61,null))[_0x54ef('0x27')](handleError(_0x386a61,null));};exports[_0x54ef('0x55')]=function(_0x50a9f0,_0xbf2294){return db[_0x54ef('0x39')][_0x54ef('0x52')]({'where':{'id':_0x50a9f0[_0x54ef('0x50')]['id']}})[_0x54ef('0x1e')](handleEntityNotFound(_0xbf2294,null))[_0x54ef('0x1e')](removeEntity(_0xbf2294,null))['catch'](handleError(_0xbf2294,null));};exports['describe']=function(_0x5e730a,_0x84d0c1){return db[_0x54ef('0x39')][_0x54ef('0x56')]()[_0x54ef('0x1e')](respondWithResult(_0x84d0c1,null))[_0x54ef('0x27')](handleError(_0x84d0c1,null));};var interaction_log=require(_0x54ef('0x12'))(_0x54ef('0x57'));exports[_0x54ef('0x58')]=function(_0x51e1c6,_0x1b7efa,_0x2d8b70){var _0x428c7e={'agent':{},'channel':'chat'};if(_0x51e1c6['body']['id']){delete _0x51e1c6[_0x54ef('0x54')]['id'];}_0x51e1c6[_0x54ef('0x54')]['read']=!![];_0x51e1c6[_0x54ef('0x54')][_0x54ef('0x59')]=moment()[_0x54ef('0x5a')](_0x54ef('0x5b'));_0x51e1c6['body']['UserId']=_0x51e1c6[_0x54ef('0x54')][_0x54ef('0x5c')]||_0x51e1c6[_0x54ef('0x5d')]['id'];_0x428c7e['agent']['id']=_0x51e1c6['body'][_0x54ef('0x5c')];return db[_0x54ef('0x39')][_0x54ef('0x52')]({'where':{'id':_0x51e1c6['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1b7efa,null))[_0x54ef('0x1e')](saveUpdates(_0x51e1c6[_0x54ef('0x54')],null))['then'](function(_0x361150){if(_0x361150){_0x428c7e[_0x54ef('0x26')]=_0x361150[_0x54ef('0x5e')]({'plain':!![]});return db[_0x54ef('0x5f')][_0x54ef('0x52')]({'where':{'id':_0x361150[_0x54ef('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x1b7efa,null))[_0x54ef('0x1e')](function(_0x3110b2){if(_0x3110b2){return _0x3110b2[_0x54ef('0x32')]({'UserId':_0x51e1c6['body'][_0x54ef('0x5c')],'read1stAt':_['isNil'](_0x3110b2[_0x54ef('0x61')])?moment()[_0x54ef('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2c1325){if(_0x2c1325){_0x428c7e[_0x54ef('0x62')]=_0x2c1325['get']({'plain':!![]});interaction_log[_0x54ef('0x1f')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x51e1c6['user']['id'],_0x51e1c6[_0x54ef('0x5d')]['name'],_0x51e1c6[_0x54ef('0x5d')][_0x54ef('0x63')],_0x428c7e[_0x54ef('0x62')]['id'],_0x51e1c6['body']?JSON[_0x54ef('0x22')](_0x51e1c6[_0x54ef('0x54')]):'null');return respondWithRpcPromise('AcceptMessage',_0x54ef('0x64'),_0x428c7e);}return null;})['then'](function(_0x3de0b6){var _0x379053=_0x54ef('0x65')+_0x3de0b6[_0x54ef('0x26')][_0x54ef('0x66')];return db[_0x54ef('0x67')][_0x54ef('0x42')](_0x379053,{'type':db['Sequelize'][_0x54ef('0x68')]['SELECT'],'raw':!![]})[_0x54ef('0x1e')](function(_0x4fd365){return _0x4fd365;});})[_0x54ef('0x1e')](function(_0x521d0){if(_0x521d0){_0x428c7e[_0x54ef('0x26')][_0x54ef('0x69')]=_0x521d0[0x0];if(!_0x51e1c6[_0x54ef('0x54')][_0x54ef('0x5c')])return;return db[_0x54ef('0x6a')][_0x54ef('0x52')]({'where':{'id':_0x51e1c6[_0x54ef('0x54')][_0x54ef('0x5c')],'role':_0x54ef('0x6b')},'attributes':['id',_0x54ef('0x35'),_0x54ef('0x6c'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x77cd60){if(!_0x77cd60)return null;_0x428c7e[_0x54ef('0x26')][_0x54ef('0x6b')]=_0x77cd60;return _0x428c7e;})[_0x54ef('0x1e')](function(_0x3557b9){if(_0x3557b9){if(_0x51e1c6[_0x54ef('0x54')]['manual']){_0x428c7e[_0x54ef('0x26')][_0x54ef('0x6d')]=util[_0x54ef('0x5a')](_0x54ef('0x6e'),_0x51e1c6[_0x54ef('0x5d')]['name']);_0x428c7e[_0x54ef('0x26')]['channel']=_0x428c7e['channel'];_0x428c7e[_0x54ef('0x26')]['motionChannel']=_0x428c7e[_0x54ef('0x6f')];_0x428c7e[_0x54ef('0x26')][_0x54ef('0x70')]=_0x54ef('0x58');return respondWithRpcPromise(_0x54ef('0x71'),_0x54ef('0x71'),{'event':_0x54ef('0x72'),'message':_[_0x54ef('0x49')](_0x428c7e[_0x54ef('0x26')],JSON[_0x54ef('0x73')](_0x428c7e[_0x54ef('0x62')][_0x54ef('0x74')]))},client9002)[_0x54ef('0x1e')](function(){return _0x428c7e;});}return _0x428c7e;}return null;})[_0x54ef('0x1e')](respondWithResult(_0x1b7efa,null))[_0x54ef('0x27')](handleError(_0x1b7efa,null));};var interaction_log=require('../../config/logger')(_0x54ef('0x57'));exports[_0x54ef('0x31')]=function(_0xfda932,_0xffcc8,_0x4d23fc){var _0x399b3d={'agent':{},'channel':'chat'};if(_0xfda932[_0x54ef('0x54')]['id']){delete _0xfda932[_0x54ef('0x54')]['id'];}_0xfda932[_0x54ef('0x54')][_0x54ef('0x5c')]=_0xfda932[_0x54ef('0x54')][_0x54ef('0x5c')]||_0xfda932[_0x54ef('0x5d')]['id'];_0x399b3d['agent']['id']=_0xfda932[_0x54ef('0x54')]['UserId'];return db[_0x54ef('0x39')][_0x54ef('0x52')]({'where':{'id':_0xfda932[_0x54ef('0x50')]['id'],'UserId':null}})[_0x54ef('0x1e')](handleEntityNotFound(_0xffcc8,null))[_0x54ef('0x1e')](function(_0x1d016c){if(_0x1d016c){_0x399b3d[_0x54ef('0x26')]=_0x1d016c[_0x54ef('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x54ef('0x52')]({'where':{'id':_0x1d016c[_0x54ef('0x60')]}});}return null;})[_0x54ef('0x1e')](handleEntityNotFound(_0xffcc8,null))['then'](function(_0x1e8705){if(_0x1e8705){_0x399b3d[_0x54ef('0x62')]=_0x1e8705[_0x54ef('0x5e')]({'plain':!![]});interaction_log[_0x54ef('0x1f')](_0x54ef('0x75'),_0xfda932[_0x54ef('0x5d')]['id'],_0xfda932[_0x54ef('0x5d')][_0x54ef('0x35')],_0xfda932[_0x54ef('0x5d')][_0x54ef('0x63')],_0x399b3d[_0x54ef('0x62')]['id'],_0xfda932[_0x54ef('0x54')]?JSON['stringify'](_0xfda932[_0x54ef('0x54')]):_0x54ef('0x76'));return respondWithRpcPromise(_0x54ef('0x77'),_0x54ef('0x78'),_0x399b3d);}return null;})[_0x54ef('0x1e')](function(_0x1bed6e){var _0x5bc479=_0x54ef('0x65')+_0x1bed6e[_0x54ef('0x26')]['ContactId'];return db[_0x54ef('0x67')]['query'](_0x5bc479,{'type':db[_0x54ef('0x79')][_0x54ef('0x68')][_0x54ef('0x7a')],'raw':!![]})[_0x54ef('0x1e')](function(_0xdf0101){return _0xdf0101;});})[_0x54ef('0x1e')](function(_0x5069e5){if(_0x5069e5){_0x399b3d[_0x54ef('0x26')]['contact']=_0x5069e5[0x0];if(!_0xfda932[_0x54ef('0x54')][_0x54ef('0x5c')])return;return db[_0x54ef('0x6a')]['find']({'where':{'id':_0xfda932[_0x54ef('0x54')]['UserId'],'role':_0x54ef('0x6b')},'attributes':['id',_0x54ef('0x35'),'fullname','email',_0x54ef('0x7b')],'raw':!![]});}return null;})[_0x54ef('0x1e')](function(_0x48c757){if(!_0x48c757)return null;_0x399b3d['message'][_0x54ef('0x6b')]=_0x48c757;return _0x399b3d;})[_0x54ef('0x1e')](function(_0x4daa8c){if(_0x4daa8c){_0x4daa8c['message'][_0x54ef('0x6d')]=util['format'](_0x54ef('0x6e'),_0xfda932['user'][_0x54ef('0x35')]);_0x4daa8c[_0x54ef('0x26')][_0x54ef('0x6f')]=_0x399b3d[_0x54ef('0x6f')];_0x4daa8c[_0x54ef('0x26')]['motionChannel']=_0x399b3d[_0x54ef('0x6f')];_0x4daa8c[_0x54ef('0x26')][_0x54ef('0x70')]='reject';respondWithRpcPromise(_0x54ef('0x71'),_0x54ef('0x71'),{'event':'rejectmessage','message':_['merge'](_0x399b3d[_0x54ef('0x26')],JSON[_0x54ef('0x73')](_0x399b3d[_0x54ef('0x62')]['formData']))},client9002);return _0x399b3d;}return null;})[_0x54ef('0x1e')](respondWithResult(_0xffcc8,null))[_0x54ef('0x27')](handleError(_0xffcc8,null));};
\ No newline at end of file
+var _0xefa6=['rawAttributes','fieldName','keys','query','filters','intersection','model','fields','attributes','length','order','where','pick','merge','type','options','includeAll','include','findAll','rows','params','find','create','body','describe','../../config/logger','chat-interactions','accept','chat','readAt','format','UserId','user','agent','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','fullname','email','internal','manual','interface','channel','event','EventManager','acceptmessage','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','User','SIP/%s','motionChannel','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xefa6,0x140));var _0x6efa=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xefa6[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require(_0x6efa('0x0'));var rimraf=require(_0x6efa('0x1'));var zipdir=require(_0x6efa('0x2'));var jsonpatch=require(_0x6efa('0x3'));var rp=require('request-promise');var moment=require(_0x6efa('0x4'));var BPromise=require(_0x6efa('0x5'));var Mustache=require(_0x6efa('0x6'));var util=require(_0x6efa('0x7'));var path=require(_0x6efa('0x8'));var sox=require(_0x6efa('0x9'));var csv=require('to-csv');var ejs=require(_0x6efa('0xa'));var fs=require('fs');var fs_extra=require(_0x6efa('0xb'));var _=require(_0x6efa('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6efa('0xd'));var querystring=require(_0x6efa('0xe'));var Papa=require('papaparse');var Redis=require(_0x6efa('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6efa('0x10'));var hardwareService=require(_0x6efa('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6efa('0x12'));var licenseUtil=require(_0x6efa('0x13'));var db=require(_0x6efa('0x14'))['db'];config[_0x6efa('0x15')]=_[_0x6efa('0x16')](config['redis'],{'host':_0x6efa('0x17'),'port':0x18eb});var socket=require(_0x6efa('0x18'))(new Redis(config[_0x6efa('0x15')]));require(_0x6efa('0x19'))[_0x6efa('0x1a')](socket);var jayson=require(_0x6efa('0x1b'));var client=jayson[_0x6efa('0x1c')][_0x6efa('0x1d')]({'port':0x232c});var client9002=jayson[_0x6efa('0x1c')][_0x6efa('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x30d71d,_0x54404,_0x269438,_0x32f64b){return new BPromise(function(_0x23fc4e,_0x183bd9){var _0x2edec6=_0x32f64b||client;return _0x2edec6[_0x6efa('0x1e')](_0x30d71d,_0x269438)[_0x6efa('0x1f')](function(_0x475fbd){logger[_0x6efa('0x20')](_0x6efa('0x21'),_0x54404,_0x6efa('0x22'));logger[_0x6efa('0x23')](_0x6efa('0x24'),_0x54404,_0x6efa('0x22'),JSON['stringify'](_0x475fbd));if(_0x475fbd['error']){if(_0x475fbd[_0x6efa('0x25')]['code']===0x1f4){logger[_0x6efa('0x25')](_0x6efa('0x21'),_0x54404,_0x475fbd[_0x6efa('0x25')]['message']);return _0x183bd9(_0x475fbd['error'][_0x6efa('0x26')]);}logger[_0x6efa('0x25')](_0x6efa('0x21'),_0x54404,_0x475fbd[_0x6efa('0x25')][_0x6efa('0x26')]);return _0x23fc4e(_0x475fbd[_0x6efa('0x25')][_0x6efa('0x26')]);}else{logger[_0x6efa('0x20')](_0x6efa('0x21'),_0x54404,'request\x20sent');_0x23fc4e(_0x475fbd[_0x6efa('0x27')][_0x6efa('0x26')]);}})[_0x6efa('0x28')](function(_0x1ceecb){logger['error'](_0x6efa('0x21'),_0x54404,_0x1ceecb);_0x183bd9(_0x1ceecb);});});}function respondWithStatusCode(_0xeb5f08,_0xb1ae2f){_0xb1ae2f=_0xb1ae2f||0xcc;return function(_0x53fe3b){if(_0x53fe3b){return _0xeb5f08[_0x6efa('0x29')](_0xb1ae2f);}return _0xeb5f08[_0x6efa('0x2a')](_0xb1ae2f)[_0x6efa('0x2b')]();};}function respondWithResult(_0x36bf06,_0x102168){_0x102168=_0x102168||0xc8;return function(_0x3679a1){if(_0x3679a1){return _0x36bf06[_0x6efa('0x2a')](_0x102168)[_0x6efa('0x2c')](_0x3679a1);}};}function respondWithFilteredResult(_0x38f128,_0x36e4ee){return function(_0x17b70f){if(_0x17b70f){var _0x5eae10=typeof _0x36e4ee[_0x6efa('0x2d')]===_0x6efa('0x2e')&&typeof _0x36e4ee[_0x6efa('0x2f')]===_0x6efa('0x2e');var _0x3a6a91=_0x17b70f[_0x6efa('0x30')];var _0x2aad71=_0x5eae10?0x0:_0x36e4ee['offset'];var _0x52bfdc=_0x5eae10?_0x17b70f[_0x6efa('0x30')]:_0x36e4ee[_0x6efa('0x2d')]+_0x36e4ee[_0x6efa('0x2f')];var _0x45a01c;if(_0x52bfdc>=_0x3a6a91){_0x52bfdc=_0x3a6a91;_0x45a01c=0xc8;}else{_0x45a01c=0xce;}_0x38f128[_0x6efa('0x2a')](_0x45a01c);return _0x38f128['set'](_0x6efa('0x31'),_0x2aad71+'-'+_0x52bfdc+'/'+_0x3a6a91)[_0x6efa('0x2c')](_0x17b70f);}return null;};}function patchUpdates(_0x58a43f){return function(_0x43461c){try{jsonpatch[_0x6efa('0x32')](_0x43461c,_0x58a43f,!![]);}catch(_0x5b0796){return BPromise[_0x6efa('0x33')](_0x5b0796);}return _0x43461c[_0x6efa('0x34')]();};}function saveUpdates(_0x4ece68,_0x29541b){return function(_0x3068bc){if(_0x3068bc){return _0x3068bc[_0x6efa('0x35')](_0x4ece68)[_0x6efa('0x1f')](function(_0x3fa792){return _0x3fa792;});}return null;};}function removeEntity(_0x4503b6,_0x1dd16a){return function(_0x2058c4){if(_0x2058c4){return _0x2058c4[_0x6efa('0x36')]()[_0x6efa('0x1f')](function(){_0x4503b6['status'](0xcc)[_0x6efa('0x2b')]();});}};}function handleEntityNotFound(_0x339326,_0x29691e){return function(_0x1c40eb){if(!_0x1c40eb){_0x339326[_0x6efa('0x29')](0x194);}return _0x1c40eb;};}function handleError(_0x6d0a65,_0x24d26e){_0x24d26e=_0x24d26e||0x1f4;return function(_0x5f0a23){logger[_0x6efa('0x25')](_0x5f0a23[_0x6efa('0x37')]);if(_0x5f0a23[_0x6efa('0x38')]){delete _0x5f0a23['name'];}_0x6d0a65['status'](_0x24d26e)[_0x6efa('0x39')](_0x5f0a23);};}exports[_0x6efa('0x3a')]=function(_0x2f9197,_0x51cc49){var _0x44bb07={},_0x13380c={},_0x4e06c6={'count':0x0,'rows':[]};var _0x3576d7=_[_0x6efa('0x3b')](db[_0x6efa('0x3c')][_0x6efa('0x3d')],function(_0x477b54){return{'name':_0x477b54[_0x6efa('0x3e')],'type':_0x477b54['type']['key']};});_0x13380c['model']=_[_0x6efa('0x3b')](_0x3576d7,'name');_0x13380c['query']=_[_0x6efa('0x3f')](_0x2f9197[_0x6efa('0x40')]);_0x13380c[_0x6efa('0x41')]=_[_0x6efa('0x42')](_0x13380c[_0x6efa('0x43')],_0x13380c[_0x6efa('0x40')]);_0x44bb07['attributes']=_[_0x6efa('0x42')](_0x13380c[_0x6efa('0x43')],qs[_0x6efa('0x44')](_0x2f9197[_0x6efa('0x40')]['fields']));_0x44bb07[_0x6efa('0x45')]=_0x44bb07[_0x6efa('0x45')][_0x6efa('0x46')]?_0x44bb07[_0x6efa('0x45')]:_0x13380c[_0x6efa('0x43')];if(!_0x2f9197[_0x6efa('0x40')]['hasOwnProperty']('nolimit')){_0x44bb07[_0x6efa('0x2f')]=qs[_0x6efa('0x2f')](_0x2f9197[_0x6efa('0x40')][_0x6efa('0x2f')]);_0x44bb07[_0x6efa('0x2d')]=qs['offset'](_0x2f9197[_0x6efa('0x40')]['offset']);}_0x44bb07[_0x6efa('0x47')]=qs['sort'](_0x2f9197[_0x6efa('0x40')]['sort']);_0x44bb07[_0x6efa('0x48')]=qs['filters'](_[_0x6efa('0x49')](_0x2f9197[_0x6efa('0x40')],_0x13380c[_0x6efa('0x41')]),_0x3576d7);if(_0x2f9197[_0x6efa('0x40')]['filter']){_0x44bb07[_0x6efa('0x48')]=_[_0x6efa('0x4a')](_0x44bb07[_0x6efa('0x48')],{'$or':_['map'](_0x3576d7,function(_0x210fa5){if(_0x210fa5[_0x6efa('0x4b')]!=='VIRTUAL'){var _0x16a9d2={};_0x16a9d2[_0x210fa5[_0x6efa('0x38')]]={'$like':'%'+_0x2f9197[_0x6efa('0x40')]['filter']+'%'};return _0x16a9d2;}})});}_0x44bb07=_[_0x6efa('0x4a')]({},_0x44bb07,_0x2f9197[_0x6efa('0x4c')]);var _0x5d0316={'where':_0x44bb07[_0x6efa('0x48')]};return db[_0x6efa('0x3c')][_0x6efa('0x30')](_0x5d0316)[_0x6efa('0x1f')](function(_0x43779a){_0x4e06c6[_0x6efa('0x30')]=_0x43779a;if(_0x2f9197[_0x6efa('0x40')][_0x6efa('0x4d')]){_0x44bb07[_0x6efa('0x4e')]=[{'all':!![]}];}return db[_0x6efa('0x3c')][_0x6efa('0x4f')](_0x44bb07);})[_0x6efa('0x1f')](function(_0x568a9f){_0x4e06c6[_0x6efa('0x50')]=_0x568a9f;return _0x4e06c6;})[_0x6efa('0x1f')](respondWithFilteredResult(_0x51cc49,_0x44bb07))[_0x6efa('0x28')](handleError(_0x51cc49,null));};exports['show']=function(_0x1ca379,_0x3c3e7b){var _0x283efd={'raw':!![],'where':{'id':_0x1ca379[_0x6efa('0x51')]['id']}},_0x33a773={};_0x33a773[_0x6efa('0x43')]=_[_0x6efa('0x3f')](db[_0x6efa('0x3c')]['rawAttributes']);_0x33a773[_0x6efa('0x40')]=_['keys'](_0x1ca379[_0x6efa('0x40')]);_0x33a773[_0x6efa('0x41')]=_[_0x6efa('0x42')](_0x33a773[_0x6efa('0x43')],_0x33a773[_0x6efa('0x40')]);_0x283efd[_0x6efa('0x45')]=_['intersection'](_0x33a773[_0x6efa('0x43')],qs[_0x6efa('0x44')](_0x1ca379[_0x6efa('0x40')][_0x6efa('0x44')]));_0x283efd[_0x6efa('0x45')]=_0x283efd[_0x6efa('0x45')][_0x6efa('0x46')]?_0x283efd[_0x6efa('0x45')]:_0x33a773[_0x6efa('0x43')];if(_0x1ca379[_0x6efa('0x40')][_0x6efa('0x4d')]){_0x283efd[_0x6efa('0x4e')]=[{'all':!![]}];}_0x283efd=_[_0x6efa('0x4a')]({},_0x283efd,_0x1ca379['options']);return db[_0x6efa('0x3c')][_0x6efa('0x52')](_0x283efd)['then'](handleEntityNotFound(_0x3c3e7b,null))['then'](respondWithResult(_0x3c3e7b,null))[_0x6efa('0x28')](handleError(_0x3c3e7b,null));};exports[_0x6efa('0x53')]=function(_0x1d3557,_0x101609){return db['ChatMessage'][_0x6efa('0x53')](_0x1d3557[_0x6efa('0x54')],{})[_0x6efa('0x1f')](respondWithResult(_0x101609,0xc9))[_0x6efa('0x28')](handleError(_0x101609,null));};exports[_0x6efa('0x35')]=function(_0x4eb90a,_0x3b3f28){if(_0x4eb90a[_0x6efa('0x54')]['id']){delete _0x4eb90a[_0x6efa('0x54')]['id'];}return db['ChatMessage'][_0x6efa('0x52')]({'where':{'id':_0x4eb90a[_0x6efa('0x51')]['id']}})['then'](handleEntityNotFound(_0x3b3f28,null))[_0x6efa('0x1f')](saveUpdates(_0x4eb90a[_0x6efa('0x54')],null))['then'](respondWithResult(_0x3b3f28,null))['catch'](handleError(_0x3b3f28,null));};exports['destroy']=function(_0x3d8cac,_0x4df0d4){return db[_0x6efa('0x3c')][_0x6efa('0x52')]({'where':{'id':_0x3d8cac[_0x6efa('0x51')]['id']}})[_0x6efa('0x1f')](handleEntityNotFound(_0x4df0d4,null))[_0x6efa('0x1f')](removeEntity(_0x4df0d4,null))[_0x6efa('0x28')](handleError(_0x4df0d4,null));};exports[_0x6efa('0x55')]=function(_0x31789c,_0x3b2434){return db[_0x6efa('0x3c')][_0x6efa('0x55')]()[_0x6efa('0x1f')](respondWithResult(_0x3b2434,null))[_0x6efa('0x28')](handleError(_0x3b2434,null));};var interaction_log=require(_0x6efa('0x56'))(_0x6efa('0x57'));exports[_0x6efa('0x58')]=function(_0x28e87b,_0x227c19,_0x193d8d){var _0x3dd2b0={'agent':{},'channel':_0x6efa('0x59')};if(_0x28e87b[_0x6efa('0x54')]['id']){delete _0x28e87b[_0x6efa('0x54')]['id'];}_0x28e87b[_0x6efa('0x54')]['read']=!![];_0x28e87b[_0x6efa('0x54')][_0x6efa('0x5a')]=moment()[_0x6efa('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x28e87b['body'][_0x6efa('0x5c')]=_0x28e87b['body'][_0x6efa('0x5c')]||_0x28e87b[_0x6efa('0x5d')]['id'];_0x3dd2b0[_0x6efa('0x5e')]['id']=_0x28e87b[_0x6efa('0x54')][_0x6efa('0x5c')];return db['ChatMessage']['find']({'where':{'id':_0x28e87b[_0x6efa('0x51')]['id'],'UserId':null}})[_0x6efa('0x1f')](handleEntityNotFound(_0x227c19,null))['then'](saveUpdates(_0x28e87b[_0x6efa('0x54')],null))['then'](function(_0x15ca4c){if(_0x15ca4c){_0x3dd2b0['message']=_0x15ca4c['get']({'plain':!![]});return db['ChatInteraction'][_0x6efa('0x52')]({'where':{'id':_0x15ca4c['ChatInteractionId']}});}return null;})[_0x6efa('0x1f')](handleEntityNotFound(_0x227c19,null))[_0x6efa('0x1f')](function(_0x591638){if(_0x591638){return _0x591638[_0x6efa('0x35')]({'UserId':_0x28e87b['body'][_0x6efa('0x5c')],'read1stAt':_[_0x6efa('0x5f')](_0x591638[_0x6efa('0x60')])?moment()[_0x6efa('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6efa('0x1f')](function(_0x4567da){if(_0x4567da){_0x3dd2b0[_0x6efa('0x61')]=_0x4567da[_0x6efa('0x62')]({'plain':!![]});interaction_log['info'](_0x6efa('0x63'),_0x28e87b[_0x6efa('0x5d')]['id'],_0x28e87b['user'][_0x6efa('0x38')],_0x28e87b[_0x6efa('0x5d')][_0x6efa('0x64')],_0x3dd2b0[_0x6efa('0x61')]['id'],_0x28e87b[_0x6efa('0x54')]?JSON[_0x6efa('0x65')](_0x28e87b['body']):_0x6efa('0x66'));return respondWithRpcPromise(_0x6efa('0x67'),_0x6efa('0x68'),_0x3dd2b0);}return null;})[_0x6efa('0x1f')](function(_0x38482c){var _0x492fc2=_0x6efa('0x69')+_0x38482c[_0x6efa('0x26')][_0x6efa('0x6a')];return db[_0x6efa('0x6b')][_0x6efa('0x40')](_0x492fc2,{'type':db[_0x6efa('0x6c')]['QueryTypes'][_0x6efa('0x6d')],'raw':!![]})['then'](function(_0x27e583){return _0x27e583;});})[_0x6efa('0x1f')](function(_0x83e988){if(_0x83e988){_0x3dd2b0['message'][_0x6efa('0x6e')]=_0x83e988[0x0];if(!_0x28e87b[_0x6efa('0x54')][_0x6efa('0x5c')])return;return db['User']['find']({'where':{'id':_0x28e87b[_0x6efa('0x54')][_0x6efa('0x5c')],'role':_0x6efa('0x5e')},'attributes':['id',_0x6efa('0x38'),_0x6efa('0x6f'),_0x6efa('0x70'),_0x6efa('0x71')],'raw':!![]});}return null;})['then'](function(_0x5c0068){if(!_0x5c0068)return null;_0x3dd2b0[_0x6efa('0x26')][_0x6efa('0x5e')]=_0x5c0068;return _0x3dd2b0;})[_0x6efa('0x1f')](function(_0x29f6b5){if(_0x29f6b5){if(_0x28e87b['body'][_0x6efa('0x72')]){_0x3dd2b0[_0x6efa('0x26')][_0x6efa('0x73')]=util['format']('SIP/%s',_0x28e87b[_0x6efa('0x5d')]['name']);_0x3dd2b0[_0x6efa('0x26')][_0x6efa('0x74')]=_0x3dd2b0[_0x6efa('0x74')];_0x3dd2b0['message']['motionChannel']=_0x3dd2b0[_0x6efa('0x74')];_0x3dd2b0[_0x6efa('0x26')][_0x6efa('0x75')]='accept';return respondWithRpcPromise(_0x6efa('0x76'),'EventManager',{'event':_0x6efa('0x77'),'message':_[_0x6efa('0x4a')](_0x3dd2b0['message'],JSON[_0x6efa('0x78')](_0x3dd2b0[_0x6efa('0x61')][_0x6efa('0x79')]))},client9002)['then'](function(){return _0x3dd2b0;});}return _0x3dd2b0;}return null;})['then'](respondWithResult(_0x227c19,null))[_0x6efa('0x28')](handleError(_0x227c19,null));};var interaction_log=require(_0x6efa('0x56'))(_0x6efa('0x57'));exports[_0x6efa('0x33')]=function(_0x5450ab,_0x3569eb,_0x5af2e3){var _0x22726f={'agent':{},'channel':_0x6efa('0x59')};if(_0x5450ab[_0x6efa('0x54')]['id']){delete _0x5450ab[_0x6efa('0x54')]['id'];}_0x5450ab[_0x6efa('0x54')]['UserId']=_0x5450ab['body']['UserId']||_0x5450ab['user']['id'];_0x22726f[_0x6efa('0x5e')]['id']=_0x5450ab['body'][_0x6efa('0x5c')];return db[_0x6efa('0x3c')][_0x6efa('0x52')]({'where':{'id':_0x5450ab['params']['id'],'UserId':null}})[_0x6efa('0x1f')](handleEntityNotFound(_0x3569eb,null))[_0x6efa('0x1f')](function(_0x200b9d){if(_0x200b9d){_0x22726f[_0x6efa('0x26')]=_0x200b9d['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x200b9d[_0x6efa('0x7a')]}});}return null;})[_0x6efa('0x1f')](handleEntityNotFound(_0x3569eb,null))[_0x6efa('0x1f')](function(_0x22c976){if(_0x22c976){_0x22726f[_0x6efa('0x61')]=_0x22c976['get']({'plain':!![]});interaction_log['info'](_0x6efa('0x7b'),_0x5450ab[_0x6efa('0x5d')]['id'],_0x5450ab[_0x6efa('0x5d')][_0x6efa('0x38')],_0x5450ab['user'][_0x6efa('0x64')],_0x22726f['interaction']['id'],_0x5450ab[_0x6efa('0x54')]?JSON[_0x6efa('0x65')](_0x5450ab[_0x6efa('0x54')]):_0x6efa('0x66'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x22726f);}return null;})['then'](function(_0x3eb095){var _0x2c0c51='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3eb095['message'][_0x6efa('0x6a')];return db[_0x6efa('0x6b')][_0x6efa('0x40')](_0x2c0c51,{'type':db[_0x6efa('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0x6efa('0x1f')](function(_0x506d67){return _0x506d67;});})[_0x6efa('0x1f')](function(_0x3ad49d){if(_0x3ad49d){_0x22726f[_0x6efa('0x26')][_0x6efa('0x6e')]=_0x3ad49d[0x0];if(!_0x5450ab[_0x6efa('0x54')][_0x6efa('0x5c')])return;return db[_0x6efa('0x7c')][_0x6efa('0x52')]({'where':{'id':_0x5450ab[_0x6efa('0x54')][_0x6efa('0x5c')],'role':'agent'},'attributes':['id',_0x6efa('0x38'),_0x6efa('0x6f'),_0x6efa('0x70'),_0x6efa('0x71')],'raw':!![]});}return null;})[_0x6efa('0x1f')](function(_0x4d1541){if(!_0x4d1541)return null;_0x22726f[_0x6efa('0x26')][_0x6efa('0x5e')]=_0x4d1541;return _0x22726f;})['then'](function(_0x3fb84f){if(_0x3fb84f){_0x3fb84f[_0x6efa('0x26')][_0x6efa('0x73')]=util['format'](_0x6efa('0x7d'),_0x5450ab[_0x6efa('0x5d')][_0x6efa('0x38')]);_0x3fb84f['message'][_0x6efa('0x74')]=_0x22726f['channel'];_0x3fb84f[_0x6efa('0x26')][_0x6efa('0x7e')]=_0x22726f['channel'];_0x3fb84f['message'][_0x6efa('0x75')]='reject';respondWithRpcPromise(_0x6efa('0x76'),_0x6efa('0x76'),{'event':'rejectmessage','message':_[_0x6efa('0x4a')](_0x22726f[_0x6efa('0x26')],JSON[_0x6efa('0x78')](_0x22726f[_0x6efa('0x61')][_0x6efa('0x79')]))},client9002);return _0x22726f;}return null;})[_0x6efa('0x1f')](respondWithResult(_0x3569eb,null))[_0x6efa('0x28')](handleError(_0x3569eb,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index a7130f4..74fdb74 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 _0x7077=['ChatMessage','setMaxListeners','save','update','emit','exports','events'];(function(_0x4194e6,_0x5a7a50){var _0x2ac7dc=function(_0x5d905e){while(--_0x5d905e){_0x4194e6['push'](_0x4194e6['shift']());}};_0x2ac7dc(++_0x5a7a50);}(_0x7077,0xdf));var _0x7707=function(_0x188b20,_0x245fd8){_0x188b20=_0x188b20-0x0;var _0x5b3974=_0x7077[_0x188b20];return _0x5b3974;};'use strict';var EventEmitter=require(_0x7707('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x7707('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7707('0x2')](0x0);var events={'afterCreate':_0x7707('0x3'),'afterUpdate':_0x7707('0x4'),'afterDestroy':'remove'};function emitEvent(_0x157046){return function(_0x3a827c,_0x3138a6,_0x46b97a){ChatMessageEvents['emit'](_0x157046+':'+_0x3a827c['id'],_0x3a827c);ChatMessageEvents[_0x7707('0x5')](_0x157046,_0x3a827c);_0x46b97a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x7707('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x41b9=['hook','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x41b9,0x159));var _0x941b=function(_0x119f51,_0x4e3d7d){_0x119f51=_0x119f51-0x0;var _0x556951=_0x41b9[_0x119f51];return _0x556951;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x941b('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x941b('0x1')](0x0);var events={'afterCreate':_0x941b('0x2'),'afterUpdate':_0x941b('0x3'),'afterDestroy':_0x941b('0x4')};function emitEvent(_0x521d93){return function(_0x7f225f,_0x4e2e99,_0xc0177d){ChatMessageEvents['emit'](_0x521d93+':'+_0x7f225f['id'],_0x7f225f);ChatMessageEvents[_0x941b('0x5')](_0x521d93,_0x7f225f);_0xc0177d(null);};}for(var e in events){if(events[_0x941b('0x6')](e)){var event=events[e];ChatMessage[_0x941b('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 83556d4..a8a7464 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 _0xa2ad=['ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0xa2ad,0xa3));var _0xda2a=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0xa2ad[_0x5a7e78];return _0xa8d4a1;};'use strict';var _=require(_0xda2a('0x0'));var util=require(_0xda2a('0x1'));var logger=require(_0xda2a('0x2'))(_0xda2a('0x3'));var moment=require(_0xda2a('0x4'));var BPromise=require(_0xda2a('0x5'));var rp=require(_0xda2a('0x6'));var fs=require('fs');var path=require(_0xda2a('0x7'));var rimraf=require(_0xda2a('0x8'));var config=require(_0xda2a('0x9'));var attributes=require(_0xda2a('0xa'));module[_0xda2a('0xb')]=function(_0x23c0cd,_0x6ccbde){return _0x23c0cd[_0xda2a('0xc')]('ChatMessage',attributes,{'tableName':_0xda2a('0xd'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xda2a('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xcf07a6,_0x45419a,_0x560346){var _0x97de42=_0x23c0cd[_0xda2a('0xf')];var _0x38afdc=_0xcf07a6[_0xda2a('0x10')]({'plain':!![]});if(_0x38afdc[_0xda2a('0x11')]['toLowerCase']()==='in'||_0x38afdc[_0xda2a('0x11')][_0xda2a('0x12')]()===_0xda2a('0x13')&&!_0x38afdc[_0xda2a('0x14')]&&!_[_0xda2a('0x15')](_0x38afdc[_0xda2a('0x16')])){_0x97de42[_0xda2a('0x17')][_0xda2a('0x18')]({'where':{'id':_0x38afdc[_0xda2a('0x19')]}})[_0xda2a('0x1a')](function(_0x40ca2e){if(_0x40ca2e){_0x40ca2e[_0xda2a('0x1b')]({'lastMsgAt':_0x38afdc[_0xda2a('0x1c')],'lastMsgDirection':_0x38afdc['direction']['toLowerCase']()});}})['catch'](function(_0x2c8f25){console[_0xda2a('0x1d')](_0x2c8f25);});}_0x560346();}},'charset':_0xda2a('0x1e'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xf05b=['fti_chat_messages','FULLTEXT','models','direction','toLowerCase','out','secret','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','chat_messages'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xf05b,0xbd));var _0xbf05=function(_0x1f404a,_0xef86a5){_0x1f404a=_0x1f404a-0x0;var _0x550cc0=_0xf05b[_0x1f404a];return _0x550cc0;};'use strict';var _=require(_0xbf05('0x0'));var util=require(_0xbf05('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbf05('0x2'));var BPromise=require(_0xbf05('0x3'));var rp=require(_0xbf05('0x4'));var fs=require('fs');var path=require(_0xbf05('0x5'));var rimraf=require(_0xbf05('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf05('0x7'));module[_0xbf05('0x8')]=function(_0x3f9c35,_0x3a6f09){return _0x3f9c35[_0xbf05('0x9')]('ChatMessage',attributes,{'tableName':_0xbf05('0xa'),'paranoid':![],'indexes':[{'name':_0xbf05('0xb'),'fields':['body'],'type':_0xbf05('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x403655,_0x3da244,_0x5b143c){var _0x1b108c=_0x3f9c35[_0xbf05('0xd')];var _0x381f8c=_0x403655['get']({'plain':!![]});if(_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()==='in'||_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()===_0xbf05('0x10')&&!_0x381f8c[_0xbf05('0x11')]&&!_['isNil'](_0x381f8c['UserId'])){_0x1b108c['ChatInteraction']['findOne']({'where':{'id':_0x381f8c[_0xbf05('0x12')]}})[_0xbf05('0x13')](function(_0x194a9c){if(_0x194a9c){_0x194a9c[_0xbf05('0x14')]({'lastMsgAt':_0x381f8c[_0xbf05('0x15')],'lastMsgDirection':_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()});}})[_0xbf05('0x16')](function(_0x15ed51){console['error'](_0x15ed51);});}_0x5b143c();}},'charset':_0xbf05('0x17'),'collate':_0xbf05('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 5b61ff1..ffbeee6 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 _0xc824=['client','http','defaults','redis','localhost','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0xc824,0x1b0));var _0x4c82=function(_0x170078,_0x1e295c){_0x170078=_0x170078-0x0;var _0x5365c9=_0xc824[_0x170078];return _0x5365c9;};'use strict';var _=require(_0x4c82('0x0'));var util=require(_0x4c82('0x1'));var moment=require(_0x4c82('0x2'));var BPromise=require(_0x4c82('0x3'));var rs=require(_0x4c82('0x4'));var fs=require('fs');var Redis=require(_0x4c82('0x5'));var db=require(_0x4c82('0x6'))['db'];var utils=require(_0x4c82('0x7'));var logger=require('../../config/logger')(_0x4c82('0x8'));var config=require(_0x4c82('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4c82('0xa')][_0x4c82('0xb')]({'port':0x232a});config['redis']=_[_0x4c82('0xc')](config[_0x4c82('0xd')],{'host':_0x4c82('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c82('0xd')]));require('./chatMessage.socket')[_0x4c82('0xf')](socket);function respondWithRpcPromise(_0x57c99c,_0x21d56e,_0x5ac194){return new BPromise(function(_0x26c7c5,_0x2113ce){return client[_0x4c82('0x10')](_0x57c99c,_0x5ac194)[_0x4c82('0x11')](function(_0x44ffa9){logger[_0x4c82('0x12')](_0x4c82('0x13'),_0x21d56e,_0x4c82('0x14'));logger[_0x4c82('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x21d56e,_0x4c82('0x14'),JSON['stringify'](_0x44ffa9));if(_0x44ffa9[_0x4c82('0x16')]){if(_0x44ffa9[_0x4c82('0x16')][_0x4c82('0x17')]===0x1f4){logger[_0x4c82('0x16')]('ChatMessage,\x20%s,\x20%s',_0x21d56e,_0x44ffa9['error'][_0x4c82('0x18')]);return _0x2113ce(_0x44ffa9[_0x4c82('0x16')][_0x4c82('0x18')]);}logger['error'](_0x4c82('0x13'),_0x21d56e,_0x44ffa9['error']['message']);return _0x26c7c5(_0x44ffa9[_0x4c82('0x16')][_0x4c82('0x18')]);}else{logger['info'](_0x4c82('0x13'),_0x21d56e,_0x4c82('0x14'));_0x26c7c5(_0x44ffa9[_0x4c82('0x19')][_0x4c82('0x18')]);}})[_0x4c82('0x1a')](function(_0xa15486){logger[_0x4c82('0x16')](_0x4c82('0x13'),_0x21d56e,_0xa15486);_0x2113ce(_0xa15486);});});}exports[_0x4c82('0x1b')]=function(_0x2e29e5){var _0x4c7900=this;return new Promise(function(_0x45a3ae,_0x585f8a){return db[_0x4c82('0x1c')][_0x4c82('0x1d')](_0x2e29e5[_0x4c82('0x1e')],{'raw':_0x2e29e5[_0x4c82('0x1f')]?_0x2e29e5[_0x4c82('0x1f')][_0x4c82('0x20')]===undefined?!![]:![]:!![]})[_0x4c82('0x11')](function(_0x5bc953){logger[_0x4c82('0x12')](_0x4c82('0x1b'),_0x2e29e5);logger['debug']('CreateChatMessage',_0x2e29e5,JSON[_0x4c82('0x21')](_0x5bc953));_0x45a3ae(_0x5bc953);})[_0x4c82('0x1a')](function(_0xb689c3){logger[_0x4c82('0x16')](_0x4c82('0x1b'),_0xb689c3[_0x4c82('0x18')],_0x2e29e5);_0x585f8a(_0x4c7900['error'](0x1f4,_0xb689c3[_0x4c82('0x18')]));});});};
\ No newline at end of file
+var _0xb5ba=['jayson/promise','http','redis','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x34f974,_0x19260a){var _0xd90b31=function(_0x57ee2e){while(--_0x57ee2e){_0x34f974['push'](_0x34f974['shift']());}};_0xd90b31(++_0x19260a);}(_0xb5ba,0xe9));var _0xab5b=function(_0x2daef6,_0xcac228){_0x2daef6=_0x2daef6-0x0;var _0x62d030=_0xb5ba[_0x2daef6];return _0x62d030;};'use strict';var _=require(_0xab5b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xab5b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab5b('0x2'));var db=require(_0xab5b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xab5b('0x4'))(_0xab5b('0x5'));var config=require(_0xab5b('0x6'));var jayson=require(_0xab5b('0x7'));var client=jayson['client'][_0xab5b('0x8')]({'port':0x232a});config[_0xab5b('0x9')]=_['defaults'](config[_0xab5b('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab5b('0x9')]));require(_0xab5b('0xa'))[_0xab5b('0xb')](socket);function respondWithRpcPromise(_0x2f096e,_0x19ae9b,_0x4f75eb){return new BPromise(function(_0x44c76c,_0x54fbf8){return client[_0xab5b('0xc')](_0x2f096e,_0x4f75eb)[_0xab5b('0xd')](function(_0x217095){logger[_0xab5b('0xe')](_0xab5b('0xf'),_0x19ae9b,_0xab5b('0x10'));logger['debug'](_0xab5b('0x11'),_0x19ae9b,_0xab5b('0x10'),JSON[_0xab5b('0x12')](_0x217095));if(_0x217095[_0xab5b('0x13')]){if(_0x217095[_0xab5b('0x13')][_0xab5b('0x14')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x19ae9b,_0x217095['error'][_0xab5b('0x15')]);return _0x54fbf8(_0x217095['error'][_0xab5b('0x15')]);}logger[_0xab5b('0x13')](_0xab5b('0xf'),_0x19ae9b,_0x217095[_0xab5b('0x13')]['message']);return _0x44c76c(_0x217095['error']['message']);}else{logger[_0xab5b('0xe')](_0xab5b('0xf'),_0x19ae9b,'request\x20sent');_0x44c76c(_0x217095['result'][_0xab5b('0x15')]);}})[_0xab5b('0x16')](function(_0x3192c9){logger[_0xab5b('0x13')](_0xab5b('0xf'),_0x19ae9b,_0x3192c9);_0x54fbf8(_0x3192c9);});});}exports[_0xab5b('0x17')]=function(_0x5d4eaa){var _0x598751=this;return new Promise(function(_0x4851b5,_0x322681){return db[_0xab5b('0x18')][_0xab5b('0x19')](_0x5d4eaa[_0xab5b('0x1a')],{'raw':_0x5d4eaa[_0xab5b('0x1b')]?_0x5d4eaa[_0xab5b('0x1b')][_0xab5b('0x1c')]===undefined?!![]:![]:!![]})[_0xab5b('0xd')](function(_0x256369){logger['info'](_0xab5b('0x17'),_0x5d4eaa);logger[_0xab5b('0x1d')](_0xab5b('0x17'),_0x5d4eaa,JSON[_0xab5b('0x12')](_0x256369));_0x4851b5(_0x256369);})[_0xab5b('0x16')](function(_0x1fbdf2){logger[_0xab5b('0x13')](_0xab5b('0x17'),_0x1fbdf2[_0xab5b('0x15')],_0x5d4eaa);_0x322681(_0x598751[_0xab5b('0x13')](0x1f4,_0x1fbdf2['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 3be7079..33bdc92 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 _0x86f4=['length','chatMessage:','./chatMessage.events','save','remove','update','register'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x86f4,0x18a));var _0x486f=function(_0x160cc2,_0x20b3cd){_0x160cc2=_0x160cc2-0x0;var _0x244a11=_0x86f4[_0x160cc2];return _0x244a11;};'use strict';var ChatMessageEvents=require(_0x486f('0x0'));var events=[_0x486f('0x1'),_0x486f('0x2'),_0x486f('0x3')];function createListener(_0x3e0b4f,_0x10339c){return function(_0x45067a){_0x10339c['emit'](_0x3e0b4f,_0x45067a);};}function removeListener(_0xf8d50f,_0x1539b1){return function(){ChatMessageEvents['removeListener'](_0xf8d50f,_0x1539b1);};}exports[_0x486f('0x4')]=function(_0x1adb27){for(var _0x39f767=0x0,_0x207201=events[_0x486f('0x5')];_0x39f767<_0x207201;_0x39f767++){var _0x3a0791=events[_0x39f767];var _0x5bfabc=createListener(_0x486f('0x6')+_0x3a0791,_0x1adb27);ChatMessageEvents['on'](_0x3a0791,_0x5bfabc);}};
\ No newline at end of file
+var _0x1cb9=['update','emit','removeListener','register','length','./chatMessage.events','remove'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x1cb9,0x14e));var _0x91cb=function(_0x354d4b,_0x6a959f){_0x354d4b=_0x354d4b-0x0;var _0x4fec42=_0x1cb9[_0x354d4b];return _0x4fec42;};'use strict';var ChatMessageEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){ChatMessageEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('chatMessage:'+_0x4c1f56,_0x186dc3);ChatMessageEvents['on'](_0x4c1f56,_0x15c517);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index b7b9c5d..6e517e6 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 _0x78e2=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','/:id','show','post','tracked','chat','chatmessage:create','create','update','/:id/accept','accept','reject','delete'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x78e2,0x146));var _0x278e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78e2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x278e('0x0'));var util=require('util');var path=require(_0x278e('0x1'));var timeout=require(_0x278e('0x2'));var express=require(_0x278e('0x3'));var router=express[_0x278e('0x4')]();var fs_extra=require(_0x278e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x278e('0x6'));var config=require(_0x278e('0x7'));var controller=require(_0x278e('0x8'));router[_0x278e('0x9')]('/',auth[_0x278e('0xa')](),controller['index']);router[_0x278e('0x9')](_0x278e('0xb'),auth[_0x278e('0xa')](),controller['describe']);router[_0x278e('0x9')](_0x278e('0xc'),auth[_0x278e('0xa')](),controller[_0x278e('0xd')]);router[_0x278e('0xe')]('/',auth[_0x278e('0xa')](),interaction[_0x278e('0xf')](_0x278e('0x10'),_0x278e('0x11')),controller[_0x278e('0x12')]);router['put'](_0x278e('0xc'),controller[_0x278e('0x13')]);router['put'](_0x278e('0x14'),auth[_0x278e('0xa')](),controller[_0x278e('0x15')]);router['put']('/:id/reject',auth[_0x278e('0xa')](),controller[_0x278e('0x16')]);router[_0x278e('0x17')](_0x278e('0xc'),auth[_0x278e('0xa')](),controller['destroy']);module[_0x278e('0x18')]=router;
\ No newline at end of file
+var _0x34b5=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0x34b5,0x166));var _0x534b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34b5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x534b('0x0'));var util=require(_0x534b('0x1'));var path=require(_0x534b('0x2'));var timeout=require(_0x534b('0x3'));var express=require(_0x534b('0x4'));var router=express[_0x534b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x534b('0x6'));var interaction=require(_0x534b('0x7'));var config=require(_0x534b('0x8'));var controller=require(_0x534b('0x9'));router[_0x534b('0xa')]('/',auth['isAuthenticated'](),controller[_0x534b('0xb')]);router[_0x534b('0xa')](_0x534b('0xc'),auth[_0x534b('0xd')](),controller[_0x534b('0xe')]);router['get'](_0x534b('0xf'),auth[_0x534b('0xd')](),controller[_0x534b('0x10')]);router[_0x534b('0x11')]('/',auth['isAuthenticated'](),interaction[_0x534b('0x12')](_0x534b('0x13'),_0x534b('0x14')),controller[_0x534b('0x15')]);router[_0x534b('0x16')](_0x534b('0xf'),controller[_0x534b('0x17')]);router['put']('/:id/accept',auth[_0x534b('0xd')](),controller[_0x534b('0x18')]);router[_0x534b('0x16')](_0x534b('0x19'),auth[_0x534b('0xd')](),controller[_0x534b('0x1a')]);router[_0x534b('0x1b')](_0x534b('0xf'),auth[_0x534b('0xd')](),controller[_0x534b('0x1c')]);module[_0x534b('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index b1fa7b6..a8de5b9 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 _0xadb5=['medium','TEXT','exports'];(function(_0x4686cc,_0x472000){var _0x285b28=function(_0x3dbe23){while(--_0x3dbe23){_0x4686cc['push'](_0x4686cc['shift']());}};_0x285b28(++_0x472000);}(_0xadb5,0xad));var _0x5adb=function(_0x28a499,_0x15d4a2){_0x28a499=_0x28a499-0x0;var _0x496c0a=_0xadb5[_0x28a499];return _0x496c0a;};'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
+var _0x757a=['exports','TEXT'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x757a,0xde));var _0xa757=function(_0x23f19d,_0x11d528){_0x23f19d=_0x23f19d-0x0;var _0x2884fc=_0x757a[_0x23f19d];return _0x2884fc;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index cd34f86..c4ad7ba 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x7a54,0x106));var _0x47a5=function(_0x5e1475,_0x2cc517){_0x5e1475=_0x5e1475-0x0;var _0x837ff4=_0x7a54[_0x5e1475];return _0x837ff4;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x7a54,0x106));var _0x47a5=function(_0x11692a,_0x502b04){_0x11692a=_0x11692a-0x0;var _0xfa288e=_0x7a54[_0x11692a];return _0xfa288e;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 374a0da..5be84d6 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 _0x325f=['hasOwnProperty','hook','exports','events','ChatOfflineMessage','setMaxListeners','update','remove','emit'];(function(_0x35fe4e,_0xd77d10){var _0x2a3972=function(_0x5f3efd){while(--_0x5f3efd){_0x35fe4e['push'](_0x35fe4e['shift']());}};_0x2a3972(++_0xd77d10);}(_0x325f,0x174));var _0xf325=function(_0x738b87,_0x1e55d8){_0x738b87=_0x738b87-0x0;var _0x323848=_0x325f[_0x738b87];return _0x323848;};'use strict';var EventEmitter=require(_0xf325('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xf325('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xf325('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf325('0x3'),'afterDestroy':_0xf325('0x4')};function emitEvent(_0x3bc806){return function(_0x2d1193,_0x96ef39,_0x2b33bb){ChatOfflineMessageEvents[_0xf325('0x5')](_0x3bc806+':'+_0x2d1193['id'],_0x2d1193);ChatOfflineMessageEvents[_0xf325('0x5')](_0x3bc806,_0x2d1193);_0x2b33bb(null);};}for(var e in events){if(events[_0xf325('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xf325('0x7')](e,emitEvent(event));}}module[_0xf325('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xb515=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb515,0x1c2));var _0x5b51=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0xb515[_0xcd5a3d];return _0xd43207;};'use strict';var EventEmitter=require(_0x5b51('0x0'));var ChatOfflineMessage=require(_0x5b51('0x1'))['db'][_0x5b51('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x5b51('0x3')](0x0);var events={'afterCreate':_0x5b51('0x4'),'afterUpdate':'update','afterDestroy':_0x5b51('0x5')};function emitEvent(_0x4ac5e7){return function(_0x4c9cd0,_0x4965aa,_0x51e4be){ChatOfflineMessageEvents[_0x5b51('0x6')](_0x4ac5e7+':'+_0x4c9cd0['id'],_0x4c9cd0);ChatOfflineMessageEvents[_0x5b51('0x6')](_0x4ac5e7,_0x4c9cd0);_0x51e4be(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x5b51('0x7')](e,emitEvent(event));}}module[_0x5b51('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 226ad2a..3a8c71c 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 _0x702f=['exports','define','ChatOfflineMessage','utf8mb4','./chatOfflineMessage.attributes'];(function(_0x5aed69,_0x259b5e){var _0x48b0f9=function(_0x31e169){while(--_0x31e169){_0x5aed69['push'](_0x5aed69['shift']());}};_0x48b0f9(++_0x259b5e);}(_0x702f,0xd1));var _0xf702=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x702f[_0x321bb2];return _0x9c12ed;};'use strict';var attributes=require(_0xf702('0x0'));module[_0xf702('0x1')]=function(_0x34dcbe){return _0x34dcbe[_0xf702('0x2')](_0xf702('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf702('0x4'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1a78=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports','define'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x1a78,0x88));var _0x81a7=function(_0xb7c880,_0x5401d1){_0xb7c880=_0xb7c880-0x0;var _0x6a7663=_0x1a78[_0xb7c880];return _0x6a7663;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x81a7('0x0')]=function(_0x36961d){return _0x36961d[_0x81a7('0x1')](_0x81a7('0x2'),attributes,{'tableName':_0x81a7('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x81a7('0x4'),'collate':_0x81a7('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index df4d6ac..ee94161 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 _0xb2af=['request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0xcf1171,_0xe70ab7){var _0x4d34e9=function(_0xf1e062){while(--_0xf1e062){_0xcf1171['push'](_0xcf1171['shift']());}};_0x4d34e9(++_0xe70ab7);}(_0xb2af,0x137));var _0xfb2a=function(_0x330068,_0x26ebb8){_0x330068=_0x330068-0x0;var _0x12813f=_0xb2af[_0x330068];return _0x12813f;};'use strict';var _=require('lodash');var util=require(_0xfb2a('0x0'));var moment=require('moment');var BPromise=require(_0xfb2a('0x1'));var rs=require(_0xfb2a('0x2'));var fs=require('fs');var Redis=require(_0xfb2a('0x3'));var db=require(_0xfb2a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb2a('0x5'))(_0xfb2a('0x6'));var config=require('../../config/environment');var jayson=require(_0xfb2a('0x7'));var client=jayson['client'][_0xfb2a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39b2cb,_0x5c3cdf,_0x46fc38){return new BPromise(function(_0x3fae48,_0x42b8cb){return client[_0xfb2a('0x9')](_0x39b2cb,_0x46fc38)[_0xfb2a('0xa')](function(_0x27b300){logger[_0xfb2a('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5c3cdf,'request\x20sent');logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5c3cdf,_0xfb2a('0xc'),JSON[_0xfb2a('0xd')](_0x27b300));if(_0x27b300[_0xfb2a('0xe')]){if(_0x27b300[_0xfb2a('0xe')]['code']===0x1f4){logger['error'](_0xfb2a('0xf'),_0x5c3cdf,_0x27b300[_0xfb2a('0xe')][_0xfb2a('0x10')]);return _0x42b8cb(_0x27b300[_0xfb2a('0xe')][_0xfb2a('0x10')]);}logger[_0xfb2a('0xe')](_0xfb2a('0xf'),_0x5c3cdf,_0x27b300[_0xfb2a('0xe')][_0xfb2a('0x10')]);return _0x3fae48(_0x27b300[_0xfb2a('0xe')][_0xfb2a('0x10')]);}else{logger[_0xfb2a('0xb')](_0xfb2a('0xf'),_0x5c3cdf,_0xfb2a('0xc'));_0x3fae48(_0x27b300[_0xfb2a('0x11')][_0xfb2a('0x10')]);}})[_0xfb2a('0x12')](function(_0x145802){logger[_0xfb2a('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5c3cdf,_0x145802);_0x42b8cb(_0x145802);});});}
\ No newline at end of file
+var _0x8a25=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x1c3b6d,_0x22d627){var _0x14f446=function(_0x21e9d6){while(--_0x21e9d6){_0x1c3b6d['push'](_0x1c3b6d['shift']());}};_0x14f446(++_0x22d627);}(_0x8a25,0x1aa));var _0x58a2=function(_0x5be376,_0x2b5390){_0x5be376=_0x5be376-0x0;var _0xd1ac92=_0x8a25[_0x5be376];return _0xd1ac92;};'use strict';var _=require(_0x58a2('0x0'));var util=require(_0x58a2('0x1'));var moment=require(_0x58a2('0x2'));var BPromise=require(_0x58a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58a2('0x4'));var db=require(_0x58a2('0x5'))['db'];var utils=require(_0x58a2('0x6'));var logger=require(_0x58a2('0x7'))(_0x58a2('0x8'));var config=require(_0x58a2('0x9'));var jayson=require(_0x58a2('0xa'));var client=jayson[_0x58a2('0xb')][_0x58a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ac0c5,_0x151bc8,_0x2d9e1a){return new BPromise(function(_0x4796b4,_0x46e81d){return client['request'](_0x1ac0c5,_0x2d9e1a)[_0x58a2('0xd')](function(_0x43b581){logger[_0x58a2('0xe')](_0x58a2('0xf'),_0x151bc8,_0x58a2('0x10'));logger['debug'](_0x58a2('0x11'),_0x151bc8,_0x58a2('0x10'),JSON[_0x58a2('0x12')](_0x43b581));if(_0x43b581[_0x58a2('0x13')]){if(_0x43b581[_0x58a2('0x13')][_0x58a2('0x14')]===0x1f4){logger[_0x58a2('0x13')](_0x58a2('0xf'),_0x151bc8,_0x43b581[_0x58a2('0x13')][_0x58a2('0x15')]);return _0x46e81d(_0x43b581[_0x58a2('0x13')][_0x58a2('0x15')]);}logger[_0x58a2('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x151bc8,_0x43b581['error'][_0x58a2('0x15')]);return _0x4796b4(_0x43b581[_0x58a2('0x13')][_0x58a2('0x15')]);}else{logger[_0x58a2('0xe')](_0x58a2('0xf'),_0x151bc8,_0x58a2('0x10'));_0x4796b4(_0x43b581[_0x58a2('0x16')][_0x58a2('0x15')]);}})[_0x58a2('0x17')](function(_0x1f915e){logger['error'](_0x58a2('0xf'),_0x151bc8,_0x1f915e);_0x46e81d(_0x1f915e);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 47eaf59..5000289 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 _0x4df8=['../../config/environment','index','isAuthenticated','describe','/:id','show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x265f20,_0x49e16b){var _0x59d620=function(_0x12fa8f){while(--_0x12fa8f){_0x265f20['push'](_0x265f20['shift']());}};_0x59d620(++_0x49e16b);}(_0x4df8,0x106));var _0x84df=function(_0x1115af,_0x1a27c6){_0x1115af=_0x1115af-0x0;var _0x113b5a=_0x4df8[_0x1115af];return _0x113b5a;};'use strict';var multer=require(_0x84df('0x0'));var util=require(_0x84df('0x1'));var path=require(_0x84df('0x2'));var timeout=require('connect-timeout');var express=require(_0x84df('0x3'));var router=express[_0x84df('0x4')]();var fs_extra=require(_0x84df('0x5'));var auth=require(_0x84df('0x6'));var interaction=require(_0x84df('0x7'));var config=require(_0x84df('0x8'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x84df('0x9')]);router['get']('/describe',auth[_0x84df('0xa')](),controller[_0x84df('0xb')]);router['get'](_0x84df('0xc'),auth[_0x84df('0xa')](),controller[_0x84df('0xd')]);router['post']('/',auth[_0x84df('0xa')](),controller[_0x84df('0xe')]);router['put'](_0x84df('0xc'),auth[_0x84df('0xa')](),controller[_0x84df('0xf')]);router['delete'](_0x84df('0xc'),auth['isAuthenticated'](),controller[_0x84df('0x10')]);module[_0x84df('0x11')]=router;
\ No newline at end of file
+var _0xb125=['get','/describe','isAuthenticated','/:id','show','post','create','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller'];(function(_0x19c846,_0x386c4c){var _0x4eca2e=function(_0x38dbe9){while(--_0x38dbe9){_0x19c846['push'](_0x19c846['shift']());}};_0x4eca2e(++_0x386c4c);}(_0xb125,0x15f));var _0x5b12=function(_0x5e7331,_0x5d4ae1){_0x5e7331=_0x5e7331-0x0;var _0x3bdd15=_0xb125[_0x5e7331];return _0x3bdd15;};'use strict';var multer=require(_0x5b12('0x0'));var util=require(_0x5b12('0x1'));var path=require(_0x5b12('0x2'));var timeout=require(_0x5b12('0x3'));var express=require(_0x5b12('0x4'));var router=express[_0x5b12('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5b12('0x6'));var interaction=require(_0x5b12('0x7'));var config=require(_0x5b12('0x8'));var controller=require(_0x5b12('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5b12('0xa')](_0x5b12('0xb'),auth[_0x5b12('0xc')](),controller['describe']);router['get'](_0x5b12('0xd'),auth[_0x5b12('0xc')](),controller[_0x5b12('0xe')]);router[_0x5b12('0xf')]('/',auth[_0x5b12('0xc')](),controller[_0x5b12('0x10')]);router['put']('/:id',auth[_0x5b12('0xc')](),controller[_0x5b12('0x11')]);router[_0x5b12('0x12')](_0x5b12('0xd'),auth[_0x5b12('0xc')](),controller['destroy']);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 eff3125..c28a84b 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 _0x0c16=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c16,0x1a9));var _0x60c1=function(_0xd87a3e,_0x38af15){_0xd87a3e=_0xd87a3e-0x0;var _0x3ed8ff=_0x0c16[_0xd87a3e];return _0x3ed8ff;};'use strict';var Sequelize=require(_0x60c1('0x0'));module[_0x60c1('0x1')]={'name':{'type':Sequelize[_0x60c1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x60c1('0x3')](_0x60c1('0x4'),_0x60c1('0x5')),'defaultValue':_0x60c1('0x4')},'selector':{'type':Sequelize[_0x60c1('0x2')]},'timeout':{'type':Sequelize[_0x60c1('0x6')]}};
\ No newline at end of file
+var _0x3610=['INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0xdf5fc5,_0x37255b){var _0x52f5a5=function(_0x5e37aa){while(--_0x5e37aa){_0xdf5fc5['push'](_0xdf5fc5['shift']());}};_0x52f5a5(++_0x37255b);}(_0x3610,0x173));var _0x0361=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x3610[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0x0361('0x0'));module[_0x0361('0x1')]={'name':{'type':Sequelize[_0x0361('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0361('0x3'),'timeout'),'defaultValue':_0x0361('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0361('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 0279f9d..6cec47b 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 _0x303a=['model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','params'];(function(_0x3b77a2,_0x37703b){var _0x116849=function(_0x12c7c6){while(--_0x12c7c6){_0x3b77a2['push'](_0x3b77a2['shift']());}};_0x116849(++_0x37703b);}(_0x303a,0x1a0));var _0xa303=function(_0x2d015c,_0x31bb7e){_0x2d015c=_0x2d015c-0x0;var _0x403093=_0x303a[_0x2d015c];return _0x403093;};'use strict';var emlformat=require(_0xa303('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa303('0x1'));var jsonpatch=require(_0xa303('0x2'));var rp=require(_0xa303('0x3'));var moment=require(_0xa303('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa303('0x5'));var util=require(_0xa303('0x6'));var path=require(_0xa303('0x7'));var sox=require(_0xa303('0x8'));var csv=require(_0xa303('0x9'));var ejs=require(_0xa303('0xa'));var fs=require('fs');var fs_extra=require(_0xa303('0xb'));var _=require(_0xa303('0xc'));var squel=require(_0xa303('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa303('0x9'));var querystring=require(_0xa303('0xe'));var Papa=require('papaparse');var Redis=require(_0xa303('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa303('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa303('0x11'));var logger=require(_0xa303('0x12'))(_0xa303('0x13'));var utils=require(_0xa303('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa303('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf5df1e,_0x43a054){_0x43a054=_0x43a054||0xcc;return function(_0x2ed971){if(_0x2ed971){return _0xf5df1e['sendStatus'](_0x43a054);}return _0xf5df1e[_0xa303('0x16')](_0x43a054)[_0xa303('0x17')]();};}function respondWithResult(_0x28cd7f,_0xfa522c){_0xfa522c=_0xfa522c||0xc8;return function(_0xed0420){if(_0xed0420){return _0x28cd7f[_0xa303('0x16')](_0xfa522c)[_0xa303('0x18')](_0xed0420);}};}function respondWithFilteredResult(_0x2d1110,_0x4c8bc1){return function(_0x2c2939){if(_0x2c2939){var _0xd2e8ee=typeof _0x4c8bc1[_0xa303('0x19')]===_0xa303('0x1a')&&typeof _0x4c8bc1[_0xa303('0x1b')]===_0xa303('0x1a');var _0x5ec243=_0x2c2939[_0xa303('0x1c')];var _0x54ca49=_0xd2e8ee?0x0:_0x4c8bc1[_0xa303('0x19')];var _0x4cf535=_0xd2e8ee?_0x2c2939[_0xa303('0x1c')]:_0x4c8bc1['offset']+_0x4c8bc1[_0xa303('0x1b')];var _0xe263f9;if(_0x4cf535>=_0x5ec243){_0x4cf535=_0x5ec243;_0xe263f9=0xc8;}else{_0xe263f9=0xce;}_0x2d1110[_0xa303('0x16')](_0xe263f9);return _0x2d1110['set'](_0xa303('0x1d'),_0x54ca49+'-'+_0x4cf535+'/'+_0x5ec243)[_0xa303('0x18')](_0x2c2939);}return null;};}function patchUpdates(_0x1b0566){return function(_0x59e551){try{jsonpatch[_0xa303('0x1e')](_0x59e551,_0x1b0566,!![]);}catch(_0x3bc8c3){return BPromise[_0xa303('0x1f')](_0x3bc8c3);}return _0x59e551[_0xa303('0x20')]();};}function saveUpdates(_0x54b173,_0x14f9ab){return function(_0x2a2512){if(_0x2a2512){return _0x2a2512['update'](_0x54b173)[_0xa303('0x21')](function(_0x27c1d7){return _0x27c1d7;});}return null;};}function removeEntity(_0x25db9c,_0x122d1e){return function(_0x65ab0e){if(_0x65ab0e){return _0x65ab0e[_0xa303('0x22')]()[_0xa303('0x21')](function(){_0x25db9c[_0xa303('0x16')](0xcc)[_0xa303('0x17')]();});}};}function handleEntityNotFound(_0x57d584,_0x532d4d){return function(_0x4dad5b){if(!_0x4dad5b){_0x57d584['sendStatus'](0x194);}return _0x4dad5b;};}function handleError(_0x5da2d2,_0x34cd0d){_0x34cd0d=_0x34cd0d||0x1f4;return function(_0xc1fd3a){logger[_0xa303('0x23')](_0xc1fd3a[_0xa303('0x24')]);if(_0xc1fd3a[_0xa303('0x25')]){delete _0xc1fd3a['name'];}_0x5da2d2[_0xa303('0x16')](_0x34cd0d)[_0xa303('0x26')](_0xc1fd3a);};}exports['show']=function(_0x221f59,_0xef04b){var _0x355025={'raw':!![],'where':{'id':_0x221f59[_0xa303('0x27')]['id']}},_0x32dcfb={};_0x32dcfb[_0xa303('0x28')]=_[_0xa303('0x29')](db[_0xa303('0x2a')][_0xa303('0x2b')]);_0x32dcfb[_0xa303('0x2c')]=_[_0xa303('0x29')](_0x221f59[_0xa303('0x2c')]);_0x32dcfb[_0xa303('0x2d')]=_[_0xa303('0x2e')](_0x32dcfb[_0xa303('0x28')],_0x32dcfb[_0xa303('0x2c')]);_0x355025[_0xa303('0x2f')]=_['intersection'](_0x32dcfb['model'],qs[_0xa303('0x30')](_0x221f59[_0xa303('0x2c')][_0xa303('0x30')]));_0x355025[_0xa303('0x2f')]=_0x355025['attributes'][_0xa303('0x31')]?_0x355025[_0xa303('0x2f')]:_0x32dcfb[_0xa303('0x28')];if(_0x221f59[_0xa303('0x2c')]['includeAll']){_0x355025[_0xa303('0x32')]=[{'all':!![]}];}_0x355025=_[_0xa303('0x33')]({},_0x355025,_0x221f59[_0xa303('0x34')]);return db['ChatProactiveAction'][_0xa303('0x35')](_0x355025)[_0xa303('0x21')](handleEntityNotFound(_0xef04b,null))[_0xa303('0x21')](respondWithResult(_0xef04b,null))['catch'](handleError(_0xef04b,null));};exports[_0xa303('0x36')]=function(_0x190742,_0x3e432d){return db['ChatProactiveAction'][_0xa303('0x36')](_0x190742[_0xa303('0x37')],{})[_0xa303('0x21')](respondWithResult(_0x3e432d,0xc9))[_0xa303('0x38')](handleError(_0x3e432d,null));};exports['update']=function(_0x1835c2,_0x23c318){if(_0x1835c2[_0xa303('0x37')]['id']){delete _0x1835c2[_0xa303('0x37')]['id'];}return db['ChatProactiveAction'][_0xa303('0x35')]({'where':{'id':_0x1835c2[_0xa303('0x27')]['id']}})[_0xa303('0x21')](handleEntityNotFound(_0x23c318,null))[_0xa303('0x21')](saveUpdates(_0x1835c2[_0xa303('0x37')],null))['then'](respondWithResult(_0x23c318,null))['catch'](handleError(_0x23c318,null));};exports[_0xa303('0x22')]=function(_0x31c71e,_0x16a0ca){return db['ChatProactiveAction']['find']({'where':{'id':_0x31c71e[_0xa303('0x27')]['id']}})[_0xa303('0x21')](handleEntityNotFound(_0x16a0ca,null))[_0xa303('0x21')](removeEntity(_0x16a0ca,null))[_0xa303('0x38')](handleError(_0x16a0ca,null));};
\ No newline at end of file
+var _0x5fd1=['show','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0x5fd1,0x155));var _0x15fd=function(_0x5e57a4,_0x458c5d){_0x5e57a4=_0x5e57a4-0x0;var _0x5e35fd=_0x5fd1[_0x5e57a4];return _0x5e35fd;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={'raw':!![],'where':{'id':_0x27d2c4[_0x15fd('0x26')]['id']}},_0x218034={};_0x218034[_0x15fd('0x27')]=_[_0x15fd('0x28')](db[_0x15fd('0x29')]['rawAttributes']);_0x218034[_0x15fd('0x2a')]=_[_0x15fd('0x28')](_0x27d2c4['query']);_0x218034[_0x15fd('0x2b')]=_[_0x15fd('0x2c')](_0x218034['model'],_0x218034[_0x15fd('0x2a')]);_0x6c213b[_0x15fd('0x2d')]=_['intersection'](_0x218034[_0x15fd('0x27')],qs[_0x15fd('0x2e')](_0x27d2c4[_0x15fd('0x2a')][_0x15fd('0x2e')]));_0x6c213b[_0x15fd('0x2d')]=_0x6c213b[_0x15fd('0x2d')]['length']?_0x6c213b[_0x15fd('0x2d')]:_0x218034[_0x15fd('0x27')];if(_0x27d2c4[_0x15fd('0x2a')][_0x15fd('0x2f')]){_0x6c213b['include']=[{'all':!![]}];}_0x6c213b=_[_0x15fd('0x30')]({},_0x6c213b,_0x27d2c4[_0x15fd('0x31')]);return db[_0x15fd('0x29')][_0x15fd('0x32')](_0x6c213b)[_0x15fd('0x1f')](handleEntityNotFound(_0x233ed3,null))[_0x15fd('0x1f')](respondWithResult(_0x233ed3,null))['catch'](handleError(_0x233ed3,null));};exports[_0x15fd('0x33')]=function(_0xaae2d0,_0x57c118){return db[_0x15fd('0x29')][_0x15fd('0x33')](_0xaae2d0[_0x15fd('0x34')],{})['then'](respondWithResult(_0x57c118,0xc9))[_0x15fd('0x35')](handleError(_0x57c118,null));};exports[_0x15fd('0x1e')]=function(_0x1732bc,_0xbe50e7){if(_0x1732bc[_0x15fd('0x34')]['id']){delete _0x1732bc[_0x15fd('0x34')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x1732bc['params']['id']}})[_0x15fd('0x1f')](handleEntityNotFound(_0xbe50e7,null))[_0x15fd('0x1f')](saveUpdates(_0x1732bc[_0x15fd('0x34')],null))['then'](respondWithResult(_0xbe50e7,null))['catch'](handleError(_0xbe50e7,null));};exports[_0x15fd('0x20')]=function(_0x5962f5,_0x4f1c84){return db['ChatProactiveAction'][_0x15fd('0x32')]({'where':{'id':_0x5962f5[_0x15fd('0x26')]['id']}})[_0x15fd('0x1f')](handleEntityNotFound(_0x4f1c84,null))['then'](removeEntity(_0x4f1c84,null))[_0x15fd('0x35')](handleError(_0x4f1c84,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index d7bb4c1..402138e 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 _0x1001=['exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./chatProactiveAction.attributes'];(function(_0x2a5dca,_0x3d9f0a){var _0x440054=function(_0x2f2eae){while(--_0x2f2eae){_0x2a5dca['push'](_0x2a5dca['shift']());}};_0x440054(++_0x3d9f0a);}(_0x1001,0xdc));var _0x1100=function(_0x15a385,_0x5786fb){_0x15a385=_0x15a385-0x0;var _0xb433e8=_0x1001[_0x15a385];return _0xb433e8;};'use strict';var _=require(_0x1100('0x0'));var util=require(_0x1100('0x1'));var logger=require(_0x1100('0x2'))('api');var moment=require(_0x1100('0x3'));var BPromise=require(_0x1100('0x4'));var rp=require(_0x1100('0x5'));var fs=require('fs');var path=require(_0x1100('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1100('0x7'));module[_0x1100('0x8')]=function(_0x48f413,_0x56d2c0){return _0x48f413[_0x1100('0x9')](_0x1100('0xa'),attributes,{'tableName':_0x1100('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac5f=['rimraf','../../config/environment','exports','define','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x1d2403,_0x2eba5d){var _0x2cc8ca=function(_0x313eab){while(--_0x313eab){_0x1d2403['push'](_0x1d2403['shift']());}};_0x2cc8ca(++_0x2eba5d);}(_0xac5f,0x13f));var _0xfac5=function(_0x1964cc,_0x5fc581){_0x1964cc=_0x1964cc-0x0;var _0x211d71=_0xac5f[_0x1964cc];return _0x211d71;};'use strict';var _=require(_0xfac5('0x0'));var util=require('util');var logger=require(_0xfac5('0x1'))(_0xfac5('0x2'));var moment=require('moment');var BPromise=require(_0xfac5('0x3'));var rp=require(_0xfac5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfac5('0x5'));var config=require(_0xfac5('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0xfac5('0x7')]=function(_0x32eda9,_0x3b51ab){return _0x32eda9[_0xfac5('0x8')]('ChatProactiveAction',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 74cebdf..c4ee94d 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 _0x6201=['ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x272638,_0x42b993){var _0x19d027=function(_0x27ac44){while(--_0x27ac44){_0x272638['push'](_0x272638['shift']());}};_0x19d027(++_0x42b993);}(_0x6201,0xfa));var _0x1620=function(_0x25b719,_0x3864cf){_0x25b719=_0x25b719-0x0;var _0x27ea13=_0x6201[_0x25b719];return _0x27ea13;};'use strict';var _=require(_0x1620('0x0'));var util=require(_0x1620('0x1'));var moment=require('moment');var BPromise=require(_0x1620('0x2'));var rs=require(_0x1620('0x3'));var fs=require('fs');var Redis=require(_0x1620('0x4'));var db=require(_0x1620('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1620('0x6'))(_0x1620('0x7'));var config=require(_0x1620('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1620('0x9')][_0x1620('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bdb64,_0x21fac9,_0x23ef59){return new BPromise(function(_0x77edae,_0x4118a5){return client[_0x1620('0xb')](_0x2bdb64,_0x23ef59)[_0x1620('0xc')](function(_0x2c388e){logger[_0x1620('0xd')](_0x1620('0xe'),_0x21fac9,_0x1620('0xf'));logger[_0x1620('0x10')](_0x1620('0x11'),_0x21fac9,'request\x20sent',JSON[_0x1620('0x12')](_0x2c388e));if(_0x2c388e[_0x1620('0x13')]){if(_0x2c388e[_0x1620('0x13')]['code']===0x1f4){logger['error'](_0x1620('0xe'),_0x21fac9,_0x2c388e[_0x1620('0x13')][_0x1620('0x14')]);return _0x4118a5(_0x2c388e[_0x1620('0x13')][_0x1620('0x14')]);}logger[_0x1620('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x21fac9,_0x2c388e[_0x1620('0x13')][_0x1620('0x14')]);return _0x77edae(_0x2c388e['error'][_0x1620('0x14')]);}else{logger['info'](_0x1620('0xe'),_0x21fac9,_0x1620('0xf'));_0x77edae(_0x2c388e[_0x1620('0x15')]['message']);}})['catch'](function(_0x13ee1e){logger[_0x1620('0x13')](_0x1620('0xe'),_0x21fac9,_0x13ee1e);_0x4118a5(_0x13ee1e);});});}
\ No newline at end of file
+var _0xc960=['error','code','message','ChatProactiveAction,\x20%s,\x20%s','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0xfbec4a,_0x51a0b9){var _0x1796c0=function(_0x1b9ccb){while(--_0x1b9ccb){_0xfbec4a['push'](_0xfbec4a['shift']());}};_0x1796c0(++_0x51a0b9);}(_0xc960,0xcc));var _0x0c96=function(_0x41a105,_0x2a71d4){_0x41a105=_0x41a105-0x0;var _0x171641=_0xc960[_0x41a105];return _0x171641;};'use strict';var _=require(_0x0c96('0x0'));var util=require(_0x0c96('0x1'));var moment=require(_0x0c96('0x2'));var BPromise=require(_0x0c96('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c96('0x4'));var db=require(_0x0c96('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c96('0x6'))('rpc');var config=require(_0x0c96('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0c96('0x8')][_0x0c96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x769abf,_0x51b63d,_0x2b577d){return new BPromise(function(_0x582b2f,_0x3c9ac1){return client[_0x0c96('0xa')](_0x769abf,_0x2b577d)[_0x0c96('0xb')](function(_0x129d8a){logger[_0x0c96('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x51b63d,_0x0c96('0xd'));logger[_0x0c96('0xe')](_0x0c96('0xf'),_0x51b63d,_0x0c96('0xd'),JSON['stringify'](_0x129d8a));if(_0x129d8a[_0x0c96('0x10')]){if(_0x129d8a[_0x0c96('0x10')][_0x0c96('0x11')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x51b63d,_0x129d8a[_0x0c96('0x10')]['message']);return _0x3c9ac1(_0x129d8a[_0x0c96('0x10')]['message']);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x51b63d,_0x129d8a['error'][_0x0c96('0x12')]);return _0x582b2f(_0x129d8a[_0x0c96('0x10')][_0x0c96('0x12')]);}else{logger[_0x0c96('0xc')](_0x0c96('0x13'),_0x51b63d,_0x0c96('0xd'));_0x582b2f(_0x129d8a['result'][_0x0c96('0x12')]);}})['catch'](function(_0xd55313){logger['error'](_0x0c96('0x13'),_0x51b63d,_0xd55313);_0x3c9ac1(_0xd55313);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 297e1e7..9b802f8 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 _0x5075=['show','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','isAuthenticated'];(function(_0xa48ada,_0x2dc15b){var _0x36f484=function(_0xbaeae9){while(--_0xbaeae9){_0xa48ada['push'](_0xa48ada['shift']());}};_0x36f484(++_0x2dc15b);}(_0x5075,0x73));var _0x5507=function(_0x27472b,_0x1e5ca1){_0x27472b=_0x27472b-0x0;var _0x249243=_0x5075[_0x27472b];return _0x249243;};'use strict';var multer=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var timeout=require(_0x5507('0x3'));var express=require(_0x5507('0x4'));var router=express[_0x5507('0x5')]();var fs_extra=require(_0x5507('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var controller=require(_0x5507('0x9'));router['get']('/:id',auth[_0x5507('0xa')](),controller[_0x5507('0xb')]);router['post']('/',auth[_0x5507('0xa')](),controller[_0x5507('0xc')]);router[_0x5507('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x5507('0xe')]);router[_0x5507('0xf')](_0x5507('0x10'),auth[_0x5507('0xa')](),controller['destroy']);module[_0x5507('0x11')]=router;
\ No newline at end of file
+var _0xfdbd=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x7aa3c0,_0x2e824a){var _0x173b2f=function(_0x247e1c){while(--_0x247e1c){_0x7aa3c0['push'](_0x7aa3c0['shift']());}};_0x173b2f(++_0x2e824a);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2a2e72,_0x1de962){_0x2a2e72=_0x2a2e72-0x0;var _0x3cfb4a=_0xfdbd[_0x2a2e72];return _0x3cfb4a;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get'](_0xdfdb('0xa'),auth[_0xdfdb('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id',auth[_0xdfdb('0xb')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xf')](_0xdfdb('0xa'),auth[_0xdfdb('0xb')](),controller[_0xdfdb('0x10')]);module[_0xdfdb('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 4b80680..146d917 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 _0xd35f=['ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0xd35f,0x1ed));var _0xfd35=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0xd35f[_0x725a4c];return _0x37b2cc;};'use strict';var Sequelize=require(_0xfd35('0x0'));module[_0xfd35('0x1')]={'name':{'type':Sequelize[_0xfd35('0x2')],'unique':_0xfd35('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfd35('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfd35('0x4')](_0xfd35('0x5'),_0xfd35('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0xcb9f=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb9f,0x1e5));var _0xfcb9=function(_0x13d55f,_0x4805d4){_0x13d55f=_0x13d55f-0x0;var _0x57c230=_0xcb9f[_0x13d55f];return _0x57c230;};'use strict';var Sequelize=require(_0xfcb9('0x0'));module[_0xfcb9('0x1')]={'name':{'type':Sequelize[_0xfcb9('0x2')],'unique':_0xfcb9('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfcb9('0x2')]},'timeout':{'type':Sequelize[_0xfcb9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xfcb9('0x5'),'beepall',_0xfcb9('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index ab0de16..9021ded 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 _0x9eba=['findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','getTeams','Team','order','length','addTeams','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','ids','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','http','request','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueue','includeAll','include','rows','params','keys','rawAttributes','find','create','user','role','ChatQueues','UserProfileSection','autoAssociation','body','describe','getMembers','findOne','ChatQueueId','UserChatQueue','findAll','User'];(function(_0x560274,_0x1f1355){var _0x1bc78a=function(_0x325852){while(--_0x325852){_0x560274['push'](_0x560274['shift']());}};_0x1bc78a(++_0x1f1355);}(_0x9eba,0xc7));var _0xa9eb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9eba[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xa9eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9eb('0x1'));var jsonpatch=require(_0xa9eb('0x2'));var rp=require(_0xa9eb('0x3'));var moment=require(_0xa9eb('0x4'));var BPromise=require(_0xa9eb('0x5'));var Mustache=require('mustache');var util=require(_0xa9eb('0x6'));var path=require('path');var sox=require(_0xa9eb('0x7'));var csv=require(_0xa9eb('0x8'));var ejs=require(_0xa9eb('0x9'));var fs=require('fs');var fs_extra=require(_0xa9eb('0xa'));var _=require(_0xa9eb('0xb'));var squel=require(_0xa9eb('0xc'));var crypto=require(_0xa9eb('0xd'));var jsforce=require(_0xa9eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa9eb('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa9eb('0xf'));var authService=require(_0xa9eb('0x10'));var qs=require(_0xa9eb('0x11'));var as=require(_0xa9eb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9eb('0x13'))(_0xa9eb('0x14'));var utils=require(_0xa9eb('0x15'));var config=require(_0xa9eb('0x16'));var licenseUtil=require(_0xa9eb('0x17'));var db=require(_0xa9eb('0x18'))['db'];config[_0xa9eb('0x19')]=_[_0xa9eb('0x1a')](config[_0xa9eb('0x19')],{'host':_0xa9eb('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa9eb('0x19')]));require(_0xa9eb('0x1c'))[_0xa9eb('0x1d')](socket);var jayson=require(_0xa9eb('0x1e'));var client=jayson['client'][_0xa9eb('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5499ed,_0x271c32,_0x9c2ea,_0x1ede03){return new BPromise(function(_0x1a50d1,_0x242bab){var _0xd3e37d=_0x1ede03||client;return _0xd3e37d[_0xa9eb('0x20')](_0x5499ed,_0x9c2ea)['then'](function(_0x2487e2){logger[_0xa9eb('0x21')]('ChatQueue,\x20%s,\x20%s',_0x271c32,'request\x20sent');logger[_0xa9eb('0x22')](_0xa9eb('0x23'),_0x271c32,_0xa9eb('0x24'),JSON[_0xa9eb('0x25')](_0x2487e2));if(_0x2487e2[_0xa9eb('0x26')]){if(_0x2487e2['error']['code']===0x1f4){logger[_0xa9eb('0x26')](_0xa9eb('0x27'),_0x271c32,_0x2487e2['error'][_0xa9eb('0x28')]);return _0x242bab(_0x2487e2[_0xa9eb('0x26')][_0xa9eb('0x28')]);}logger[_0xa9eb('0x26')](_0xa9eb('0x27'),_0x271c32,_0x2487e2[_0xa9eb('0x26')][_0xa9eb('0x28')]);return _0x1a50d1(_0x2487e2[_0xa9eb('0x26')][_0xa9eb('0x28')]);}else{logger[_0xa9eb('0x21')]('ChatQueue,\x20%s,\x20%s',_0x271c32,'request\x20sent');_0x1a50d1(_0x2487e2[_0xa9eb('0x29')][_0xa9eb('0x28')]);}})[_0xa9eb('0x2a')](function(_0x472d79){logger[_0xa9eb('0x26')](_0xa9eb('0x27'),_0x271c32,_0x472d79);_0x242bab(_0x472d79);});});}function respondWithStatusCode(_0x48ffbb,_0x1c0d6b){_0x1c0d6b=_0x1c0d6b||0xcc;return function(_0x10ae09){if(_0x10ae09){return _0x48ffbb['sendStatus'](_0x1c0d6b);}return _0x48ffbb['status'](_0x1c0d6b)[_0xa9eb('0x2b')]();};}function respondWithResult(_0x27056f,_0x24139d){_0x24139d=_0x24139d||0xc8;return function(_0x206138){if(_0x206138){return _0x27056f[_0xa9eb('0x2c')](_0x24139d)['json'](_0x206138);}};}function respondWithFilteredResult(_0x1aa696,_0x314f60){return function(_0x260ec5){if(_0x260ec5){var _0x50bb67=typeof _0x314f60[_0xa9eb('0x2d')]===_0xa9eb('0x2e')&&typeof _0x314f60['limit']===_0xa9eb('0x2e');var _0x12bcc3=_0x260ec5[_0xa9eb('0x2f')];var _0x4ab368=_0x50bb67?0x0:_0x314f60[_0xa9eb('0x2d')];var _0x23a7ef=_0x50bb67?_0x260ec5[_0xa9eb('0x2f')]:_0x314f60['offset']+_0x314f60[_0xa9eb('0x30')];var _0x2b6ae2;if(_0x23a7ef>=_0x12bcc3){_0x23a7ef=_0x12bcc3;_0x2b6ae2=0xc8;}else{_0x2b6ae2=0xce;}_0x1aa696[_0xa9eb('0x2c')](_0x2b6ae2);return _0x1aa696[_0xa9eb('0x31')](_0xa9eb('0x32'),_0x4ab368+'-'+_0x23a7ef+'/'+_0x12bcc3)[_0xa9eb('0x33')](_0x260ec5);}return null;};}function patchUpdates(_0x57007a){return function(_0x55f74c){try{jsonpatch['apply'](_0x55f74c,_0x57007a,!![]);}catch(_0x16b475){return BPromise[_0xa9eb('0x34')](_0x16b475);}return _0x55f74c[_0xa9eb('0x35')]();};}function saveUpdates(_0x1c66f9,_0x247d02){return function(_0x329230){if(_0x329230){return _0x329230[_0xa9eb('0x36')](_0x1c66f9)[_0xa9eb('0x37')](function(_0x4b382b){return _0x4b382b;});}return null;};}function removeEntity(_0x1893c9,_0x473b50){return function(_0x5967a7){if(_0x5967a7){return _0x5967a7[_0xa9eb('0x38')]()[_0xa9eb('0x37')](function(){var _0x1765ca=_0x5967a7[_0xa9eb('0x39')]({'plain':!![]});var _0x12f94a='ChatQueues';return db[_0xa9eb('0x3a')][_0xa9eb('0x38')]({'where':{'type':_0x12f94a,'resourceId':_0x1765ca['id']}})[_0xa9eb('0x37')](function(){return _0x5967a7;});})['then'](function(){_0x1893c9['status'](0xcc)[_0xa9eb('0x2b')]();});}};}function handleEntityNotFound(_0x3363fd,_0x1e70a5){return function(_0x54ce7b){if(!_0x54ce7b){_0x3363fd[_0xa9eb('0x3b')](0x194);}return _0x54ce7b;};}function handleError(_0x1153ac,_0x2c13f0){_0x2c13f0=_0x2c13f0||0x1f4;return function(_0x4eace7){logger[_0xa9eb('0x26')](_0x4eace7[_0xa9eb('0x3c')]);if(_0x4eace7[_0xa9eb('0x3d')]){delete _0x4eace7['name'];}_0x1153ac[_0xa9eb('0x2c')](_0x2c13f0)['send'](_0x4eace7);};}exports['index']=function(_0x595205,_0x5d3784){var _0x26f983={},_0x5b2456={},_0x33e003={'count':0x0,'rows':[]};var _0x125ae3=_[_0xa9eb('0x3e')](db['ChatQueue']['rawAttributes'],function(_0x5a5812){return{'name':_0x5a5812[_0xa9eb('0x3f')],'type':_0x5a5812[_0xa9eb('0x40')][_0xa9eb('0x41')]};});_0x5b2456[_0xa9eb('0x42')]=_[_0xa9eb('0x3e')](_0x125ae3,'name');_0x5b2456[_0xa9eb('0x43')]=_['keys'](_0x595205[_0xa9eb('0x43')]);_0x5b2456[_0xa9eb('0x44')]=_[_0xa9eb('0x45')](_0x5b2456[_0xa9eb('0x42')],_0x5b2456[_0xa9eb('0x43')]);_0x26f983[_0xa9eb('0x46')]=_[_0xa9eb('0x45')](_0x5b2456[_0xa9eb('0x42')],qs[_0xa9eb('0x47')](_0x595205[_0xa9eb('0x43')][_0xa9eb('0x47')]));_0x26f983[_0xa9eb('0x46')]=_0x26f983[_0xa9eb('0x46')]['length']?_0x26f983[_0xa9eb('0x46')]:_0x5b2456[_0xa9eb('0x42')];if(!_0x595205[_0xa9eb('0x43')][_0xa9eb('0x48')](_0xa9eb('0x49'))){_0x26f983[_0xa9eb('0x30')]=qs[_0xa9eb('0x30')](_0x595205['query'][_0xa9eb('0x30')]);_0x26f983[_0xa9eb('0x2d')]=qs[_0xa9eb('0x2d')](_0x595205[_0xa9eb('0x43')]['offset']);}_0x26f983['order']=qs[_0xa9eb('0x4a')](_0x595205['query']['sort']);_0x26f983[_0xa9eb('0x4b')]=qs[_0xa9eb('0x44')](_[_0xa9eb('0x4c')](_0x595205[_0xa9eb('0x43')],_0x5b2456['filters']),_0x125ae3);if(_0x595205[_0xa9eb('0x43')][_0xa9eb('0x4d')]){_0x26f983[_0xa9eb('0x4b')]=_[_0xa9eb('0x4e')](_0x26f983[_0xa9eb('0x4b')],{'$or':_[_0xa9eb('0x3e')](_0x125ae3,function(_0x4cedcf){if(_0x4cedcf[_0xa9eb('0x40')]!==_0xa9eb('0x4f')){var _0x29911b={};_0x29911b[_0x4cedcf[_0xa9eb('0x3d')]]={'$like':'%'+_0x595205[_0xa9eb('0x43')][_0xa9eb('0x4d')]+'%'};return _0x29911b;}})});}_0x26f983=_['merge']({},_0x26f983,_0x595205[_0xa9eb('0x50')]);var _0x4e8c03={'where':_0x26f983['where']};return db[_0xa9eb('0x51')][_0xa9eb('0x2f')](_0x4e8c03)[_0xa9eb('0x37')](function(_0xe7fdfa){_0x33e003[_0xa9eb('0x2f')]=_0xe7fdfa;if(_0x595205[_0xa9eb('0x43')][_0xa9eb('0x52')]){_0x26f983[_0xa9eb('0x53')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x26f983);})[_0xa9eb('0x37')](function(_0xeca40e){_0x33e003[_0xa9eb('0x54')]=_0xeca40e;return _0x33e003;})['then'](respondWithFilteredResult(_0x5d3784,_0x26f983))['catch'](handleError(_0x5d3784,null));};exports['show']=function(_0x2bf47f,_0x115791){var _0x484415={'raw':!![],'where':{'id':_0x2bf47f[_0xa9eb('0x55')]['id']}},_0x280955={};_0x280955[_0xa9eb('0x42')]=_[_0xa9eb('0x56')](db['ChatQueue'][_0xa9eb('0x57')]);_0x280955['query']=_['keys'](_0x2bf47f[_0xa9eb('0x43')]);_0x280955['filters']=_[_0xa9eb('0x45')](_0x280955[_0xa9eb('0x42')],_0x280955[_0xa9eb('0x43')]);_0x484415[_0xa9eb('0x46')]=_['intersection'](_0x280955[_0xa9eb('0x42')],qs['fields'](_0x2bf47f[_0xa9eb('0x43')][_0xa9eb('0x47')]));_0x484415[_0xa9eb('0x46')]=_0x484415[_0xa9eb('0x46')]['length']?_0x484415[_0xa9eb('0x46')]:_0x280955[_0xa9eb('0x42')];if(_0x2bf47f['query'][_0xa9eb('0x52')]){_0x484415[_0xa9eb('0x53')]=[{'all':!![]}];}_0x484415=_[_0xa9eb('0x4e')]({},_0x484415,_0x2bf47f[_0xa9eb('0x50')]);return db[_0xa9eb('0x51')][_0xa9eb('0x58')](_0x484415)['then'](handleEntityNotFound(_0x115791,null))[_0xa9eb('0x37')](respondWithResult(_0x115791,null))[_0xa9eb('0x2a')](handleError(_0x115791,null));};exports[_0xa9eb('0x59')]=function(_0x5c21ca,_0x4f3cb4){return db[_0xa9eb('0x51')][_0xa9eb('0x59')](_0x5c21ca['body'],{})[_0xa9eb('0x37')](function(_0x5ecd3f){var _0x174b4c=_0x5c21ca[_0xa9eb('0x5a')][_0xa9eb('0x39')]({'plain':!![]});if(!_0x174b4c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x174b4c[_0xa9eb('0x5b')]===_0xa9eb('0x5a')){var _0x21f0be=_0x5ecd3f['get']({'plain':!![]});var _0x43c30a=_0xa9eb('0x5c');return db[_0xa9eb('0x5d')][_0xa9eb('0x58')]({'where':{'name':_0x43c30a,'userProfileId':_0x174b4c['userProfileId']},'raw':!![]})['then'](function(_0xa09fa2){if(_0xa09fa2&&_0xa09fa2[_0xa9eb('0x5e')]===0x0){return db[_0xa9eb('0x3a')][_0xa9eb('0x59')]({'name':_0x21f0be['name'],'resourceId':_0x21f0be['id'],'type':_0xa09fa2[_0xa9eb('0x3d')],'sectionId':_0xa09fa2['id']},{})[_0xa9eb('0x37')](function(){return _0x5ecd3f;});}else{return _0x5ecd3f;}})[_0xa9eb('0x2a')](function(_0x2aa71d){logger[_0xa9eb('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2aa71d);throw _0x2aa71d;});}return _0x5ecd3f;})[_0xa9eb('0x37')](respondWithResult(_0x4f3cb4,0xc9))[_0xa9eb('0x2a')](handleError(_0x4f3cb4,null));};exports[_0xa9eb('0x36')]=function(_0x4bfdfd,_0x474cc4){if(_0x4bfdfd[_0xa9eb('0x5f')]['id']){delete _0x4bfdfd[_0xa9eb('0x5f')]['id'];}return db['ChatQueue'][_0xa9eb('0x58')]({'where':{'id':_0x4bfdfd[_0xa9eb('0x55')]['id']}})['then'](handleEntityNotFound(_0x474cc4,null))['then'](saveUpdates(_0x4bfdfd[_0xa9eb('0x5f')],null))[_0xa9eb('0x37')](respondWithResult(_0x474cc4,null))[_0xa9eb('0x2a')](handleError(_0x474cc4,null));};exports[_0xa9eb('0x38')]=function(_0x1c368f,_0x3b2ea2){return db['ChatQueue'][_0xa9eb('0x58')]({'where':{'id':_0x1c368f['params']['id']}})['then'](handleEntityNotFound(_0x3b2ea2,null))[_0xa9eb('0x37')](removeEntity(_0x3b2ea2,null))[_0xa9eb('0x2a')](handleError(_0x3b2ea2,null));};exports[_0xa9eb('0x60')]=function(_0x4205b3,_0x49d924){return db[_0xa9eb('0x51')][_0xa9eb('0x60')]()[_0xa9eb('0x37')](respondWithResult(_0x49d924,null))[_0xa9eb('0x2a')](handleError(_0x49d924,null));};exports[_0xa9eb('0x61')]=function(_0x1cfc85,_0x158d31,_0xbc14cf){var _0x53e2c0={'raw':!![],'where':{}},_0x307303={},_0x195ed1;return db[_0xa9eb('0x51')][_0xa9eb('0x62')]({'where':{'id':_0x1cfc85[_0xa9eb('0x55')]['id']}})[_0xa9eb('0x37')](handleEntityNotFound(_0x158d31,null))[_0xa9eb('0x37')](function(_0x35557b){if(_0x35557b){_0x195ed1=_0x35557b[_0xa9eb('0x39')]({'plain':!![]});_0x307303[_0xa9eb('0x42')]=_[_0xa9eb('0x56')](db['UserChatQueue'][_0xa9eb('0x57')]);_0x307303['query']=_[_0xa9eb('0x56')](_0x1cfc85['query']);_0x307303['filters']=_[_0xa9eb('0x45')](_0x307303[_0xa9eb('0x42')],_0x307303['query']);_0x53e2c0[_0xa9eb('0x46')]=_[_0xa9eb('0x45')](_0x307303[_0xa9eb('0x42')],qs[_0xa9eb('0x47')](_0x1cfc85['query'][_0xa9eb('0x47')]));_0x53e2c0[_0xa9eb('0x46')]=_0x53e2c0[_0xa9eb('0x46')]['length']?_0x53e2c0['attributes']:_0x307303[_0xa9eb('0x42')];if(!_0x1cfc85[_0xa9eb('0x43')][_0xa9eb('0x48')]('nolimit')){_0x53e2c0[_0xa9eb('0x30')]=qs[_0xa9eb('0x30')](_0x1cfc85['query']['limit']);_0x53e2c0[_0xa9eb('0x2d')]=qs[_0xa9eb('0x2d')](_0x1cfc85[_0xa9eb('0x43')][_0xa9eb('0x2d')]);}_0x53e2c0['order']=qs['sort'](_0x1cfc85[_0xa9eb('0x43')][_0xa9eb('0x4a')]);_0x53e2c0['where']=qs[_0xa9eb('0x44')](_[_0xa9eb('0x4c')](_0x1cfc85[_0xa9eb('0x43')],_0x307303[_0xa9eb('0x44')]));_0x53e2c0[_0xa9eb('0x4b')][_0xa9eb('0x63')]=_0x35557b['id'];if(_0x1cfc85[_0xa9eb('0x43')][_0xa9eb('0x4d')]){_0x53e2c0['where']=_[_0xa9eb('0x4e')](_0x53e2c0[_0xa9eb('0x4b')],{'$or':_[_0xa9eb('0x3e')](_0x53e2c0[_0xa9eb('0x46')],function(_0x404a57){var _0x279aeb={};_0x279aeb[_0x404a57]={'$like':'%'+_0x1cfc85['query']['filter']+'%'};return _0x279aeb;})});}_0x53e2c0=_[_0xa9eb('0x4e')]({},_0x53e2c0,_0x1cfc85[_0xa9eb('0x50')]);return db[_0xa9eb('0x64')][_0xa9eb('0x65')](_0x53e2c0);}})[_0xa9eb('0x37')](function(_0x5936b2){if(_0x5936b2){return db[_0xa9eb('0x66')][_0xa9eb('0x67')]({'where':{'id':_[_0xa9eb('0x3e')](_0x5936b2,_0xa9eb('0x68')),'role':'agent'},'attributes':['id','name',_0xa9eb('0x69'),_0xa9eb('0x6a'),_0xa9eb('0x6b')]});}})[_0xa9eb('0x37')](function(_0x3da6a9){if(_0x3da6a9){return{'count':_0x3da6a9[_0xa9eb('0x2f')],'rows':_[_0xa9eb('0x3e')](_0x3da6a9[_0xa9eb('0x54')],function(_0x2494df){return{'membername':_0x2494df[_0xa9eb('0x3d')],'UserId':_0x2494df['id'],'queue_name':_0x195ed1[_0xa9eb('0x3d')],'ChatQueueId':_0x195ed1['id'],'interface':util[_0xa9eb('0x6c')]('%s/%s','SIP',_0x2494df[_0xa9eb('0x3d')]),'penalty':0x0,'paused':_0x2494df[_0xa9eb('0x69')],'createdAt':_0x2494df[_0xa9eb('0x6b')],'updatedAt':_0x2494df[_0xa9eb('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x158d31,_0x53e2c0))[_0xa9eb('0x2a')](handleError(_0x158d31,null));};exports[_0xa9eb('0x6d')]=function(_0x9b7bf0,_0x2ec3c0,_0x2c3a39){var _0x372319={};var _0x56e493={};var _0x3cf201;var _0x2a570f;return db[_0xa9eb('0x51')][_0xa9eb('0x62')]({'where':{'id':_0x9b7bf0['params']['id']}})[_0xa9eb('0x37')](handleEntityNotFound(_0x2ec3c0,null))[_0xa9eb('0x37')](function(_0x5407e1){if(_0x5407e1){_0x3cf201=_0x5407e1;_0x56e493[_0xa9eb('0x42')]=_[_0xa9eb('0x56')](db[_0xa9eb('0x6e')][_0xa9eb('0x57')]);_0x56e493[_0xa9eb('0x43')]=_[_0xa9eb('0x56')](_0x9b7bf0[_0xa9eb('0x43')]);_0x56e493[_0xa9eb('0x44')]=_[_0xa9eb('0x45')](_0x56e493[_0xa9eb('0x42')],_0x56e493[_0xa9eb('0x43')]);_0x372319[_0xa9eb('0x46')]=_[_0xa9eb('0x45')](_0x56e493[_0xa9eb('0x42')],qs['fields'](_0x9b7bf0['query'][_0xa9eb('0x47')]));_0x372319['attributes']=_0x372319[_0xa9eb('0x46')]['length']?_0x372319[_0xa9eb('0x46')]:_0x56e493[_0xa9eb('0x42')];_0x372319[_0xa9eb('0x6f')]=qs[_0xa9eb('0x4a')](_0x9b7bf0[_0xa9eb('0x43')][_0xa9eb('0x4a')]);_0x372319[_0xa9eb('0x4b')]=qs[_0xa9eb('0x44')](_[_0xa9eb('0x4c')](_0x9b7bf0[_0xa9eb('0x43')],_0x56e493[_0xa9eb('0x44')]));if(_0x9b7bf0['query'][_0xa9eb('0x4d')]){_0x372319[_0xa9eb('0x4b')]=_[_0xa9eb('0x4e')](_0x372319['where'],{'$or':_[_0xa9eb('0x3e')](_0x372319[_0xa9eb('0x46')],function(_0x1f0889){var _0x1cf72e={};_0x1cf72e[_0x1f0889]={'$like':'%'+_0x9b7bf0[_0xa9eb('0x43')]['filter']+'%'};return _0x1cf72e;})});}_0x372319=_[_0xa9eb('0x4e')]({},_0x372319,_0x9b7bf0[_0xa9eb('0x50')]);return _0x3cf201[_0xa9eb('0x6d')](_0x372319);}})[_0xa9eb('0x37')](function(_0x2407cc){if(_0x2407cc){_0x2a570f=_0x2407cc[_0xa9eb('0x70')];if(!_0x9b7bf0[_0xa9eb('0x43')][_0xa9eb('0x48')](_0xa9eb('0x49'))){_0x372319[_0xa9eb('0x30')]=qs[_0xa9eb('0x30')](_0x9b7bf0[_0xa9eb('0x43')]['limit']);_0x372319[_0xa9eb('0x2d')]=qs[_0xa9eb('0x2d')](_0x9b7bf0[_0xa9eb('0x43')][_0xa9eb('0x2d')]);}return _0x3cf201[_0xa9eb('0x6d')](_0x372319);}})['then'](function(_0x5b06d2){if(_0x5b06d2){return _0x5b06d2?{'count':_0x2a570f,'rows':_0x5b06d2}:null;}})[_0xa9eb('0x37')](respondWithResult(_0x2ec3c0,null))[_0xa9eb('0x2a')](handleError(_0x2ec3c0,null));};exports[_0xa9eb('0x71')]=function(_0x45b309,_0x10b216,_0x16a821){var _0x2b712d=_0x45b309[_0xa9eb('0x5f')]['ids'];return db['Team'][_0xa9eb('0x65')]({'where':{'id':_0x2b712d},'attributes':['id'],'include':[{'model':db[_0xa9eb('0x66')],'as':'Agents','attributes':['id',_0xa9eb('0x3d'),'online',_0xa9eb('0x72'),'interface'],'raw':!![]}]})[_0xa9eb('0x37')](function(_0x21f275){if(_0x21f275){var _0x59fe2e=_[_0xa9eb('0x73')](_0x21f275,function(_0x1ebeba){var _0x38ea46=_0x1ebeba['get']({'plain':!![]});return _0x38ea46[_0xa9eb('0x74')];});return db[_0xa9eb('0x51')][_0xa9eb('0x58')]({'where':{'id':_0x45b309[_0xa9eb('0x55')]['id']}})[_0xa9eb('0x37')](function(_0x17b60d){return db[_0xa9eb('0x75')][_0xa9eb('0x76')](function(_0xe82d42){return _0x17b60d[_0xa9eb('0x71')](_0x2b712d,{'transaction':_0xe82d42})[_0xa9eb('0x37')](function(){return BPromise[_0xa9eb('0x77')](_0x59fe2e,function(_0x5e508a){return db[_0xa9eb('0x64')][_0xa9eb('0x78')]({'where':{'UserId':_0x5e508a['id'],'ChatQueueId':_0x45b309[_0xa9eb('0x55')]['id']},'transaction':_0xe82d42});});})[_0xa9eb('0x37')](function(){_0x59fe2e['forEach'](function(_0x455c12){socket[_0xa9eb('0x79')](_0xa9eb('0x7a'),{'UserId':_0x455c12['id'],'ChatQueueId':_0x17b60d['id']});});});});});}})[_0xa9eb('0x37')](respondWithStatusCode(_0x10b216,null))[_0xa9eb('0x2a')](handleError(_0x10b216,null));};exports['removeTeams']=function(_0x2a1737,_0x3ce10e,_0x5c085c){return db[_0xa9eb('0x6e')][_0xa9eb('0x65')]({'where':{'id':_0x2a1737['query'][_0xa9eb('0x7b')]},'attributes':['id'],'include':[{'model':db[_0xa9eb('0x66')],'as':_0xa9eb('0x74'),'attributes':['id'],'raw':!![]}]})[_0xa9eb('0x37')](handleEntityNotFound(_0x3ce10e,null))['then'](function(_0x21a994){var _0x1b8c3d=_['map'](_0x21a994,'id');var _0x510b91=[];var _0x12d4a9=[];var _0x1cbcb5=squel[_0xa9eb('0x7c')]();_0x1cbcb5[_0xa9eb('0x7d')]('tq.TeamId')[_0xa9eb('0x7e')](_0xa9eb('0x7f'),'tq')[_0xa9eb('0x80')](_0xa9eb('0x81'),'ut',_0xa9eb('0x82'))[_0xa9eb('0x4b')](_0xa9eb('0x83'),_0x2a1737['params']['id']);for(var _0x316dee=0x0;_0x316dee<_0x21a994[_0xa9eb('0x70')];_0x316dee+=0x1){let _0x1ef500=_0x21a994[_0x316dee];for(var _0x583f34=0x0;_0x583f34<_0x1ef500[_0xa9eb('0x74')][_0xa9eb('0x70')];_0x583f34+=0x1){let _0x3e9f40=_0x1ef500[_0xa9eb('0x74')][_0x583f34];var _0x291de7=_0x1cbcb5[_0xa9eb('0x84')]();_0x291de7[_0xa9eb('0x4b')]('ut.UserId\x20=\x20?',_0x3e9f40['id']);_0x12d4a9[_0xa9eb('0x85')](db[_0xa9eb('0x75')][_0xa9eb('0x43')](_0x291de7[_0xa9eb('0x86')](),{'type':db[_0xa9eb('0x75')][_0xa9eb('0x87')][_0xa9eb('0x88')]})[_0xa9eb('0x37')](function(_0x16b9db){if(_0x16b9db[_0xa9eb('0x70')]===0x1){return _0x3e9f40['id'];}else{var _0x1aea9b=_[_0xa9eb('0x89')](_[_0xa9eb('0x3e')](_0x16b9db,_0xa9eb('0x8a')),function(_0x58bd2a){return _[_0xa9eb('0x8b')](_0x1b8c3d,_0x58bd2a);});if(_0x1aea9b){return _0x3e9f40['id'];}}}));}}return BPromise[_0xa9eb('0x8c')](_0x12d4a9)['then'](function(_0x574fd7){_0x510b91=_(_0x510b91)['union'](_0x574fd7)[_0xa9eb('0x8d')]()[_0xa9eb('0x8e')]();return db[_0xa9eb('0x51')][_0xa9eb('0x58')]({'where':{'id':_0x2a1737[_0xa9eb('0x55')]['id']}})[_0xa9eb('0x37')](function(_0x43f3d0){return db[_0xa9eb('0x75')][_0xa9eb('0x76')](function(_0x134315){return _0x43f3d0[_0xa9eb('0x8f')](_0x2a1737['query'][_0xa9eb('0x7b')],{'transaction':_0x134315})[_0xa9eb('0x37')](function(){if(!_[_0xa9eb('0x90')](_0x510b91)){return _0x43f3d0[_0xa9eb('0x91')](_0x510b91,{'transaction':_0x134315});}})['then'](function(){_0x510b91['forEach'](function(_0x4fe998){socket[_0xa9eb('0x79')](_0xa9eb('0x92'),{'UserId':_0x4fe998,'ChatQueueId':_0x43f3d0['id']});});});});});});})[_0xa9eb('0x37')](respondWithStatusCode(_0x3ce10e,null))[_0xa9eb('0x2a')](handleError(_0x3ce10e,null));};exports[_0xa9eb('0x93')]=function(_0x472909,_0x2dfaa3,_0x3a23e8){return db[_0xa9eb('0x51')][_0xa9eb('0x58')]({'where':{'id':_0x472909[_0xa9eb('0x55')]['id']}})[_0xa9eb('0x37')](handleEntityNotFound(_0x2dfaa3,null))[_0xa9eb('0x37')](function(_0x5f1f0c){if(_0x5f1f0c){return _0x5f1f0c[_0xa9eb('0x93')](_0x472909[_0xa9eb('0x5f')][_0xa9eb('0x7b')],_['omit'](_0x472909['body'],['ids','id'])||{})[_0xa9eb('0x94')](function(_0x8fa5d1){for(var _0x5c642f=0x0;_0x5c642f<_0x472909[_0xa9eb('0x5f')]['ids'][_0xa9eb('0x70')];_0x5c642f+=0x1){socket['emit'](_0xa9eb('0x7a'),{'UserId':Number(_0x472909[_0xa9eb('0x5f')][_0xa9eb('0x7b')][_0x5c642f]),'ChatQueueId':Number(_0x472909[_0xa9eb('0x55')]['id'])});}return _0x8fa5d1;});}})['then'](respondWithResult(_0x2dfaa3,null))[_0xa9eb('0x2a')](handleError(_0x2dfaa3,null));};exports[_0xa9eb('0x91')]=function(_0x572183,_0x5d6564,_0x2313b1){return db[_0xa9eb('0x51')]['find']({'where':{'id':_0x572183['params']['id']}})[_0xa9eb('0x37')](handleEntityNotFound(_0x5d6564,null))[_0xa9eb('0x37')](function(_0x47a7f8){if(_0x47a7f8){return _0x47a7f8['removeAgents'](_0x572183[_0xa9eb('0x43')]['ids'])[_0xa9eb('0x37')](function(){if(_[_0xa9eb('0x95')](_0x572183[_0xa9eb('0x43')]['ids'])){for(var _0x56eb76=0x0;_0x56eb76<_0x572183[_0xa9eb('0x43')]['ids'][_0xa9eb('0x70')];_0x56eb76+=0x1){socket[_0xa9eb('0x79')](_0xa9eb('0x92'),{'UserId':Number(_0x572183['query'][_0xa9eb('0x7b')][_0x56eb76]),'ChatQueueId':Number(_0x572183[_0xa9eb('0x55')]['id'])});}}else{socket[_0xa9eb('0x79')](_0xa9eb('0x92'),{'UserId':Number(_0x572183[_0xa9eb('0x43')]['ids']),'ChatQueueId':Number(_0x572183[_0xa9eb('0x55')]['id'])});}});}})[_0xa9eb('0x37')](respondWithStatusCode(_0x5d6564,null))[_0xa9eb('0x2a')](handleError(_0x5d6564,null));};exports[_0xa9eb('0x96')]=function(_0x519ca1,_0x2ccea3,_0x16d0d0){var _0x11bab7={};var _0x174922={};var _0x522149;var _0x3d2090;return db[_0xa9eb('0x51')][_0xa9eb('0x62')]({'where':{'id':_0x519ca1['params']['id']}})[_0xa9eb('0x37')](handleEntityNotFound(_0x2ccea3,null))[_0xa9eb('0x37')](function(_0x53ae33){if(_0x53ae33){_0x522149=_0x53ae33;_0x174922[_0xa9eb('0x42')]=_[_0xa9eb('0x56')](db['User'][_0xa9eb('0x57')]);_0x174922['query']=_[_0xa9eb('0x56')](_0x519ca1['query']);_0x174922[_0xa9eb('0x44')]=_[_0xa9eb('0x45')](_0x174922['model'],_0x174922[_0xa9eb('0x43')]);_0x11bab7['attributes']=_[_0xa9eb('0x45')](_0x174922[_0xa9eb('0x42')],qs[_0xa9eb('0x47')](_0x519ca1[_0xa9eb('0x43')][_0xa9eb('0x47')]));_0x11bab7[_0xa9eb('0x46')]=_0x11bab7[_0xa9eb('0x46')][_0xa9eb('0x70')]?_0x11bab7['attributes']:_0x174922[_0xa9eb('0x42')];_0x11bab7[_0xa9eb('0x6f')]=qs[_0xa9eb('0x4a')](_0x519ca1[_0xa9eb('0x43')][_0xa9eb('0x4a')]);_0x11bab7[_0xa9eb('0x4b')]=qs[_0xa9eb('0x44')](_[_0xa9eb('0x4c')](_0x519ca1[_0xa9eb('0x43')],_0x174922[_0xa9eb('0x44')]));if(_0x519ca1[_0xa9eb('0x43')]['filter']){_0x11bab7['where']=_[_0xa9eb('0x4e')](_0x11bab7[_0xa9eb('0x4b')],{'$or':_[_0xa9eb('0x3e')](_0x11bab7[_0xa9eb('0x46')],function(_0x126bc5){var _0x6af6d={};_0x6af6d[_0x126bc5]={'$like':'%'+_0x519ca1['query'][_0xa9eb('0x4d')]+'%'};return _0x6af6d;})});}_0x11bab7=_[_0xa9eb('0x4e')]({},_0x11bab7,_0x519ca1[_0xa9eb('0x50')]);return _0x522149['getAgents'](_0x11bab7);}})[_0xa9eb('0x37')](function(_0x378208){if(_0x378208){_0x3d2090=_0x378208[_0xa9eb('0x70')];if(!_0x519ca1[_0xa9eb('0x43')][_0xa9eb('0x48')](_0xa9eb('0x49'))){_0x11bab7[_0xa9eb('0x30')]=qs[_0xa9eb('0x30')](_0x519ca1[_0xa9eb('0x43')][_0xa9eb('0x30')]);_0x11bab7[_0xa9eb('0x2d')]=qs[_0xa9eb('0x2d')](_0x519ca1[_0xa9eb('0x43')][_0xa9eb('0x2d')]);}return _0x522149[_0xa9eb('0x96')](_0x11bab7);}})[_0xa9eb('0x37')](function(_0x5bdb8){if(_0x5bdb8){return _0x5bdb8?{'count':_0x3d2090,'rows':_0x5bdb8}:null;}})[_0xa9eb('0x37')](respondWithResult(_0x2ccea3,null))['catch'](handleError(_0x2ccea3,null));};
\ No newline at end of file
+var _0xde56=['union','compact','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','bluebird','util','sox','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','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','error','message','ChatQueue,\x20%s,\x20%s','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','UserProfileResource','destroy','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','createdAt','%s/%s','chatPause','Team','getTeams','addTeams','ids','online','interface','flatMap','sequelize','transaction','forEach','emit','select','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all'];(function(_0x5b38ef,_0x1a03eb){var _0x5c6368=function(_0x434ebd){while(--_0x434ebd){_0x5b38ef['push'](_0x5b38ef['shift']());}};_0x5c6368(++_0x1a03eb);}(_0xde56,0x13f));var _0x6de5=function(_0x484cac,_0x30ad3a){_0x484cac=_0x484cac-0x0;var _0x1d6e77=_0xde56[_0x484cac];return _0x1d6e77;};'use strict';var emlformat=require(_0x6de5('0x0'));var rimraf=require(_0x6de5('0x1'));var zipdir=require(_0x6de5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6de5('0x3'));var Mustache=require('mustache');var util=require(_0x6de5('0x4'));var path=require('path');var sox=require(_0x6de5('0x5'));var csv=require('to-csv');var ejs=require(_0x6de5('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6de5('0x7'));var squel=require(_0x6de5('0x8'));var crypto=require(_0x6de5('0x9'));var jsforce=require(_0x6de5('0xa'));var deskjs=require(_0x6de5('0xb'));var toCsv=require(_0x6de5('0xc'));var querystring=require(_0x6de5('0xd'));var Papa=require(_0x6de5('0xe'));var Redis=require(_0x6de5('0xf'));var authService=require(_0x6de5('0x10'));var qs=require(_0x6de5('0x11'));var as=require(_0x6de5('0x12'));var hardwareService=require(_0x6de5('0x13'));var logger=require(_0x6de5('0x14'))(_0x6de5('0x15'));var utils=require('../../config/utils');var config=require(_0x6de5('0x16'));var licenseUtil=require(_0x6de5('0x17'));var db=require(_0x6de5('0x18'))['db'];config[_0x6de5('0x19')]=_[_0x6de5('0x1a')](config[_0x6de5('0x19')],{'host':_0x6de5('0x1b'),'port':0x18eb});var socket=require(_0x6de5('0x1c'))(new Redis(config[_0x6de5('0x19')]));require(_0x6de5('0x1d'))[_0x6de5('0x1e')](socket);var jayson=require(_0x6de5('0x1f'));var client=jayson[_0x6de5('0x20')][_0x6de5('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4218a0,_0x4d476f,_0x4b5e50,_0x2373a2){return new BPromise(function(_0x403803,_0x2a7f02){var _0x585088=_0x2373a2||client;return _0x585088['request'](_0x4218a0,_0x4b5e50)[_0x6de5('0x22')](function(_0x11092b){logger[_0x6de5('0x23')]('ChatQueue,\x20%s,\x20%s',_0x4d476f,_0x6de5('0x24'));logger[_0x6de5('0x25')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4d476f,_0x6de5('0x24'),JSON['stringify'](_0x11092b));if(_0x11092b[_0x6de5('0x26')]){if(_0x11092b[_0x6de5('0x26')]['code']===0x1f4){logger[_0x6de5('0x26')]('ChatQueue,\x20%s,\x20%s',_0x4d476f,_0x11092b['error']['message']);return _0x2a7f02(_0x11092b[_0x6de5('0x26')][_0x6de5('0x27')]);}logger[_0x6de5('0x26')](_0x6de5('0x28'),_0x4d476f,_0x11092b[_0x6de5('0x26')]['message']);return _0x403803(_0x11092b[_0x6de5('0x26')][_0x6de5('0x27')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x4d476f,_0x6de5('0x24'));_0x403803(_0x11092b['result'][_0x6de5('0x27')]);}})[_0x6de5('0x29')](function(_0x3c0621){logger[_0x6de5('0x26')](_0x6de5('0x28'),_0x4d476f,_0x3c0621);_0x2a7f02(_0x3c0621);});});}function respondWithStatusCode(_0x3fede5,_0x2e8c46){_0x2e8c46=_0x2e8c46||0xcc;return function(_0x460561){if(_0x460561){return _0x3fede5[_0x6de5('0x2a')](_0x2e8c46);}return _0x3fede5[_0x6de5('0x2b')](_0x2e8c46)[_0x6de5('0x2c')]();};}function respondWithResult(_0x48decc,_0x5119f2){_0x5119f2=_0x5119f2||0xc8;return function(_0x2f877e){if(_0x2f877e){return _0x48decc[_0x6de5('0x2b')](_0x5119f2)['json'](_0x2f877e);}};}function respondWithFilteredResult(_0x585bc2,_0x1f121d){return function(_0x46dad9){if(_0x46dad9){var _0x41a6bd=typeof _0x1f121d[_0x6de5('0x2d')]===_0x6de5('0x2e')&&typeof _0x1f121d[_0x6de5('0x2f')]===_0x6de5('0x2e');var _0x1edef6=_0x46dad9['count'];var _0x50f59a=_0x41a6bd?0x0:_0x1f121d[_0x6de5('0x2d')];var _0x4fa2c4=_0x41a6bd?_0x46dad9[_0x6de5('0x30')]:_0x1f121d[_0x6de5('0x2d')]+_0x1f121d['limit'];var _0x99bf0f;if(_0x4fa2c4>=_0x1edef6){_0x4fa2c4=_0x1edef6;_0x99bf0f=0xc8;}else{_0x99bf0f=0xce;}_0x585bc2['status'](_0x99bf0f);return _0x585bc2[_0x6de5('0x31')](_0x6de5('0x32'),_0x50f59a+'-'+_0x4fa2c4+'/'+_0x1edef6)['json'](_0x46dad9);}return null;};}function patchUpdates(_0x7e9e74){return function(_0x315304){try{jsonpatch['apply'](_0x315304,_0x7e9e74,!![]);}catch(_0x1f8611){return BPromise[_0x6de5('0x33')](_0x1f8611);}return _0x315304[_0x6de5('0x34')]();};}function saveUpdates(_0x4fa130,_0x1e05bb){return function(_0x1ef921){if(_0x1ef921){return _0x1ef921[_0x6de5('0x35')](_0x4fa130)[_0x6de5('0x22')](function(_0x2e16f6){return _0x2e16f6;});}return null;};}function removeEntity(_0x53504a,_0x32c29b){return function(_0x9e84bc){if(_0x9e84bc){return _0x9e84bc['destroy']()[_0x6de5('0x22')](function(){var _0x715b2d=_0x9e84bc[_0x6de5('0x36')]({'plain':!![]});var _0xf4b971='ChatQueues';return db[_0x6de5('0x37')][_0x6de5('0x38')]({'where':{'type':_0xf4b971,'resourceId':_0x715b2d['id']}})['then'](function(){return _0x9e84bc;});})[_0x6de5('0x22')](function(){_0x53504a[_0x6de5('0x2b')](0xcc)[_0x6de5('0x2c')]();});}};}function handleEntityNotFound(_0x3eec3c,_0x387c1d){return function(_0x2e2506){if(!_0x2e2506){_0x3eec3c['sendStatus'](0x194);}return _0x2e2506;};}function handleError(_0x7e94d4,_0x152f6e){_0x152f6e=_0x152f6e||0x1f4;return function(_0x102409){logger['error'](_0x102409[_0x6de5('0x39')]);if(_0x102409[_0x6de5('0x3a')]){delete _0x102409['name'];}_0x7e94d4[_0x6de5('0x2b')](_0x152f6e)[_0x6de5('0x3b')](_0x102409);};}exports[_0x6de5('0x3c')]=function(_0xa7cc35,_0x5d8175){var _0x1fa8ac={},_0x232c77={},_0x20102c={'count':0x0,'rows':[]};var _0x46aed5=_[_0x6de5('0x3d')](db[_0x6de5('0x3e')][_0x6de5('0x3f')],function(_0x1d2a37){return{'name':_0x1d2a37[_0x6de5('0x40')],'type':_0x1d2a37['type'][_0x6de5('0x41')]};});_0x232c77[_0x6de5('0x42')]=_[_0x6de5('0x3d')](_0x46aed5,_0x6de5('0x3a'));_0x232c77[_0x6de5('0x43')]=_[_0x6de5('0x44')](_0xa7cc35[_0x6de5('0x43')]);_0x232c77[_0x6de5('0x45')]=_[_0x6de5('0x46')](_0x232c77['model'],_0x232c77['query']);_0x1fa8ac['attributes']=_['intersection'](_0x232c77[_0x6de5('0x42')],qs[_0x6de5('0x47')](_0xa7cc35['query'][_0x6de5('0x47')]));_0x1fa8ac[_0x6de5('0x48')]=_0x1fa8ac[_0x6de5('0x48')][_0x6de5('0x49')]?_0x1fa8ac[_0x6de5('0x48')]:_0x232c77[_0x6de5('0x42')];if(!_0xa7cc35[_0x6de5('0x43')][_0x6de5('0x4a')](_0x6de5('0x4b'))){_0x1fa8ac[_0x6de5('0x2f')]=qs['limit'](_0xa7cc35[_0x6de5('0x43')]['limit']);_0x1fa8ac[_0x6de5('0x2d')]=qs[_0x6de5('0x2d')](_0xa7cc35[_0x6de5('0x43')][_0x6de5('0x2d')]);}_0x1fa8ac['order']=qs[_0x6de5('0x4c')](_0xa7cc35[_0x6de5('0x43')]['sort']);_0x1fa8ac['where']=qs[_0x6de5('0x45')](_[_0x6de5('0x4d')](_0xa7cc35[_0x6de5('0x43')],_0x232c77[_0x6de5('0x45')]),_0x46aed5);if(_0xa7cc35[_0x6de5('0x43')][_0x6de5('0x4e')]){_0x1fa8ac[_0x6de5('0x4f')]=_[_0x6de5('0x50')](_0x1fa8ac[_0x6de5('0x4f')],{'$or':_[_0x6de5('0x3d')](_0x46aed5,function(_0x3aae84){if(_0x3aae84[_0x6de5('0x51')]!==_0x6de5('0x52')){var _0x2a56b7={};_0x2a56b7[_0x3aae84[_0x6de5('0x3a')]]={'$like':'%'+_0xa7cc35[_0x6de5('0x43')][_0x6de5('0x4e')]+'%'};return _0x2a56b7;}})});}_0x1fa8ac=_['merge']({},_0x1fa8ac,_0xa7cc35[_0x6de5('0x53')]);var _0xa9add6={'where':_0x1fa8ac['where']};return db['ChatQueue'][_0x6de5('0x30')](_0xa9add6)['then'](function(_0x6b2748){_0x20102c['count']=_0x6b2748;if(_0xa7cc35[_0x6de5('0x43')][_0x6de5('0x54')]){_0x1fa8ac[_0x6de5('0x55')]=[{'all':!![]}];}return db[_0x6de5('0x3e')]['findAll'](_0x1fa8ac);})['then'](function(_0x1af586){_0x20102c[_0x6de5('0x56')]=_0x1af586;return _0x20102c;})[_0x6de5('0x22')](respondWithFilteredResult(_0x5d8175,_0x1fa8ac))[_0x6de5('0x29')](handleError(_0x5d8175,null));};exports['show']=function(_0x59c244,_0x226781){var _0x3d7b50={'raw':!![],'where':{'id':_0x59c244[_0x6de5('0x57')]['id']}},_0x5c7d57={};_0x5c7d57[_0x6de5('0x42')]=_[_0x6de5('0x44')](db[_0x6de5('0x3e')][_0x6de5('0x3f')]);_0x5c7d57['query']=_[_0x6de5('0x44')](_0x59c244['query']);_0x5c7d57[_0x6de5('0x45')]=_[_0x6de5('0x46')](_0x5c7d57[_0x6de5('0x42')],_0x5c7d57[_0x6de5('0x43')]);_0x3d7b50[_0x6de5('0x48')]=_['intersection'](_0x5c7d57['model'],qs[_0x6de5('0x47')](_0x59c244[_0x6de5('0x43')][_0x6de5('0x47')]));_0x3d7b50[_0x6de5('0x48')]=_0x3d7b50[_0x6de5('0x48')][_0x6de5('0x49')]?_0x3d7b50[_0x6de5('0x48')]:_0x5c7d57[_0x6de5('0x42')];if(_0x59c244[_0x6de5('0x43')][_0x6de5('0x54')]){_0x3d7b50['include']=[{'all':!![]}];}_0x3d7b50=_[_0x6de5('0x50')]({},_0x3d7b50,_0x59c244[_0x6de5('0x53')]);return db[_0x6de5('0x3e')][_0x6de5('0x58')](_0x3d7b50)[_0x6de5('0x22')](handleEntityNotFound(_0x226781,null))[_0x6de5('0x22')](respondWithResult(_0x226781,null))[_0x6de5('0x29')](handleError(_0x226781,null));};exports[_0x6de5('0x59')]=function(_0x19c6d3,_0x1439ac){return db[_0x6de5('0x3e')][_0x6de5('0x59')](_0x19c6d3[_0x6de5('0x5a')],{})['then'](function(_0x570c28){var _0x16cb51=_0x19c6d3[_0x6de5('0x5b')][_0x6de5('0x36')]({'plain':!![]});if(!_0x16cb51)throw new Error(_0x6de5('0x5c'));if(_0x16cb51[_0x6de5('0x5d')]===_0x6de5('0x5b')){var _0x427314=_0x570c28[_0x6de5('0x36')]({'plain':!![]});var _0xa55cfd='ChatQueues';return db[_0x6de5('0x5e')][_0x6de5('0x58')]({'where':{'name':_0xa55cfd,'userProfileId':_0x16cb51['userProfileId']},'raw':!![]})[_0x6de5('0x22')](function(_0x4f1e62){if(_0x4f1e62&&_0x4f1e62[_0x6de5('0x5f')]===0x0){return db[_0x6de5('0x37')]['create']({'name':_0x427314[_0x6de5('0x3a')],'resourceId':_0x427314['id'],'type':_0x4f1e62[_0x6de5('0x3a')],'sectionId':_0x4f1e62['id']},{})[_0x6de5('0x22')](function(){return _0x570c28;});}else{return _0x570c28;}})[_0x6de5('0x29')](function(_0x16bbde){logger[_0x6de5('0x26')](_0x6de5('0x60'),_0x16bbde);throw _0x16bbde;});}return _0x570c28;})[_0x6de5('0x22')](respondWithResult(_0x1439ac,0xc9))[_0x6de5('0x29')](handleError(_0x1439ac,null));};exports['update']=function(_0x3e3236,_0x42a7aa){if(_0x3e3236[_0x6de5('0x5a')]['id']){delete _0x3e3236[_0x6de5('0x5a')]['id'];}return db[_0x6de5('0x3e')][_0x6de5('0x58')]({'where':{'id':_0x3e3236[_0x6de5('0x57')]['id']}})[_0x6de5('0x22')](handleEntityNotFound(_0x42a7aa,null))[_0x6de5('0x22')](saveUpdates(_0x3e3236['body'],null))[_0x6de5('0x22')](respondWithResult(_0x42a7aa,null))[_0x6de5('0x29')](handleError(_0x42a7aa,null));};exports[_0x6de5('0x38')]=function(_0x301473,_0x5b47a8){return db[_0x6de5('0x3e')][_0x6de5('0x58')]({'where':{'id':_0x301473['params']['id']}})[_0x6de5('0x22')](handleEntityNotFound(_0x5b47a8,null))[_0x6de5('0x22')](removeEntity(_0x5b47a8,null))[_0x6de5('0x29')](handleError(_0x5b47a8,null));};exports[_0x6de5('0x61')]=function(_0x89b1d6,_0x1e1e87){return db[_0x6de5('0x3e')][_0x6de5('0x61')]()['then'](respondWithResult(_0x1e1e87,null))[_0x6de5('0x29')](handleError(_0x1e1e87,null));};exports[_0x6de5('0x62')]=function(_0x49fa26,_0x2922e7,_0x5b5db1){var _0x1408e5={'raw':!![],'where':{}},_0x4ab0ba={},_0x3e7320;return db[_0x6de5('0x3e')][_0x6de5('0x63')]({'where':{'id':_0x49fa26['params']['id']}})['then'](handleEntityNotFound(_0x2922e7,null))[_0x6de5('0x22')](function(_0xae79e){if(_0xae79e){_0x3e7320=_0xae79e[_0x6de5('0x36')]({'plain':!![]});_0x4ab0ba[_0x6de5('0x42')]=_[_0x6de5('0x44')](db[_0x6de5('0x64')][_0x6de5('0x3f')]);_0x4ab0ba['query']=_['keys'](_0x49fa26[_0x6de5('0x43')]);_0x4ab0ba[_0x6de5('0x45')]=_[_0x6de5('0x46')](_0x4ab0ba[_0x6de5('0x42')],_0x4ab0ba[_0x6de5('0x43')]);_0x1408e5['attributes']=_[_0x6de5('0x46')](_0x4ab0ba[_0x6de5('0x42')],qs[_0x6de5('0x47')](_0x49fa26[_0x6de5('0x43')][_0x6de5('0x47')]));_0x1408e5[_0x6de5('0x48')]=_0x1408e5[_0x6de5('0x48')][_0x6de5('0x49')]?_0x1408e5['attributes']:_0x4ab0ba[_0x6de5('0x42')];if(!_0x49fa26['query'][_0x6de5('0x4a')](_0x6de5('0x4b'))){_0x1408e5[_0x6de5('0x2f')]=qs['limit'](_0x49fa26[_0x6de5('0x43')][_0x6de5('0x2f')]);_0x1408e5['offset']=qs[_0x6de5('0x2d')](_0x49fa26[_0x6de5('0x43')][_0x6de5('0x2d')]);}_0x1408e5[_0x6de5('0x65')]=qs[_0x6de5('0x4c')](_0x49fa26['query'][_0x6de5('0x4c')]);_0x1408e5[_0x6de5('0x4f')]=qs[_0x6de5('0x45')](_[_0x6de5('0x4d')](_0x49fa26['query'],_0x4ab0ba['filters']));_0x1408e5[_0x6de5('0x4f')][_0x6de5('0x66')]=_0xae79e['id'];if(_0x49fa26[_0x6de5('0x43')][_0x6de5('0x4e')]){_0x1408e5[_0x6de5('0x4f')]=_['merge'](_0x1408e5[_0x6de5('0x4f')],{'$or':_[_0x6de5('0x3d')](_0x1408e5[_0x6de5('0x48')],function(_0x44aff7){var _0x4fb860={};_0x4fb860[_0x44aff7]={'$like':'%'+_0x49fa26[_0x6de5('0x43')][_0x6de5('0x4e')]+'%'};return _0x4fb860;})});}_0x1408e5=_[_0x6de5('0x50')]({},_0x1408e5,_0x49fa26[_0x6de5('0x53')]);return db[_0x6de5('0x64')][_0x6de5('0x67')](_0x1408e5);}})[_0x6de5('0x22')](function(_0x224f1c){if(_0x224f1c){return db[_0x6de5('0x68')][_0x6de5('0x69')]({'where':{'id':_[_0x6de5('0x3d')](_0x224f1c,_0x6de5('0x6a')),'role':_0x6de5('0x6b')},'attributes':['id',_0x6de5('0x3a'),'chatPause','updatedAt',_0x6de5('0x6c')]});}})[_0x6de5('0x22')](function(_0x487b06){if(_0x487b06){return{'count':_0x487b06['count'],'rows':_['map'](_0x487b06[_0x6de5('0x56')],function(_0x2521c5){return{'membername':_0x2521c5[_0x6de5('0x3a')],'UserId':_0x2521c5['id'],'queue_name':_0x3e7320[_0x6de5('0x3a')],'ChatQueueId':_0x3e7320['id'],'interface':util['format'](_0x6de5('0x6d'),'SIP',_0x2521c5[_0x6de5('0x3a')]),'penalty':0x0,'paused':_0x2521c5[_0x6de5('0x6e')],'createdAt':_0x2521c5['createdAt'],'updatedAt':_0x2521c5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6de5('0x22')](respondWithFilteredResult(_0x2922e7,_0x1408e5))[_0x6de5('0x29')](handleError(_0x2922e7,null));};exports['getTeams']=function(_0x55a887,_0x5102db,_0x45258c){var _0x3c1938={};var _0x54f82d={};var _0x189426;var _0x3ee296;return db[_0x6de5('0x3e')][_0x6de5('0x63')]({'where':{'id':_0x55a887[_0x6de5('0x57')]['id']}})[_0x6de5('0x22')](handleEntityNotFound(_0x5102db,null))['then'](function(_0x1456ca){if(_0x1456ca){_0x189426=_0x1456ca;_0x54f82d[_0x6de5('0x42')]=_[_0x6de5('0x44')](db[_0x6de5('0x6f')][_0x6de5('0x3f')]);_0x54f82d[_0x6de5('0x43')]=_['keys'](_0x55a887[_0x6de5('0x43')]);_0x54f82d['filters']=_[_0x6de5('0x46')](_0x54f82d[_0x6de5('0x42')],_0x54f82d['query']);_0x3c1938[_0x6de5('0x48')]=_[_0x6de5('0x46')](_0x54f82d[_0x6de5('0x42')],qs[_0x6de5('0x47')](_0x55a887[_0x6de5('0x43')][_0x6de5('0x47')]));_0x3c1938[_0x6de5('0x48')]=_0x3c1938[_0x6de5('0x48')][_0x6de5('0x49')]?_0x3c1938['attributes']:_0x54f82d['model'];_0x3c1938['order']=qs[_0x6de5('0x4c')](_0x55a887[_0x6de5('0x43')][_0x6de5('0x4c')]);_0x3c1938[_0x6de5('0x4f')]=qs[_0x6de5('0x45')](_[_0x6de5('0x4d')](_0x55a887[_0x6de5('0x43')],_0x54f82d['filters']));if(_0x55a887[_0x6de5('0x43')]['filter']){_0x3c1938[_0x6de5('0x4f')]=_[_0x6de5('0x50')](_0x3c1938[_0x6de5('0x4f')],{'$or':_['map'](_0x3c1938[_0x6de5('0x48')],function(_0x5eff52){var _0x104d98={};_0x104d98[_0x5eff52]={'$like':'%'+_0x55a887[_0x6de5('0x43')][_0x6de5('0x4e')]+'%'};return _0x104d98;})});}_0x3c1938=_['merge']({},_0x3c1938,_0x55a887[_0x6de5('0x53')]);return _0x189426[_0x6de5('0x70')](_0x3c1938);}})[_0x6de5('0x22')](function(_0x10fb43){if(_0x10fb43){_0x3ee296=_0x10fb43[_0x6de5('0x49')];if(!_0x55a887[_0x6de5('0x43')][_0x6de5('0x4a')](_0x6de5('0x4b'))){_0x3c1938[_0x6de5('0x2f')]=qs[_0x6de5('0x2f')](_0x55a887[_0x6de5('0x43')][_0x6de5('0x2f')]);_0x3c1938[_0x6de5('0x2d')]=qs[_0x6de5('0x2d')](_0x55a887[_0x6de5('0x43')][_0x6de5('0x2d')]);}return _0x189426[_0x6de5('0x70')](_0x3c1938);}})[_0x6de5('0x22')](function(_0x350218){if(_0x350218){return _0x350218?{'count':_0x3ee296,'rows':_0x350218}:null;}})[_0x6de5('0x22')](respondWithResult(_0x5102db,null))[_0x6de5('0x29')](handleError(_0x5102db,null));};exports[_0x6de5('0x71')]=function(_0x10ddc2,_0x1b3067,_0x19f4de){var _0x132354=_0x10ddc2[_0x6de5('0x5a')][_0x6de5('0x72')];return db['Team'][_0x6de5('0x67')]({'where':{'id':_0x132354},'attributes':['id'],'include':[{'model':db[_0x6de5('0x68')],'as':'Agents','attributes':['id',_0x6de5('0x3a'),_0x6de5('0x73'),'voicePause',_0x6de5('0x74')],'raw':!![]}]})[_0x6de5('0x22')](function(_0x4b50bc){if(_0x4b50bc){var _0x55a615=_[_0x6de5('0x75')](_0x4b50bc,function(_0x2decc9){var _0x5764b0=_0x2decc9[_0x6de5('0x36')]({'plain':!![]});return _0x5764b0['Agents'];});return db[_0x6de5('0x3e')][_0x6de5('0x58')]({'where':{'id':_0x10ddc2[_0x6de5('0x57')]['id']}})[_0x6de5('0x22')](function(_0x141e0a){return db[_0x6de5('0x76')][_0x6de5('0x77')](function(_0x30b290){return _0x141e0a['addTeams'](_0x132354,{'transaction':_0x30b290})['then'](function(){return BPromise['each'](_0x55a615,function(_0x491aee){return db[_0x6de5('0x64')]['findOrCreate']({'where':{'UserId':_0x491aee['id'],'ChatQueueId':_0x10ddc2[_0x6de5('0x57')]['id']},'transaction':_0x30b290});});})[_0x6de5('0x22')](function(){_0x55a615[_0x6de5('0x78')](function(_0x4ef8f7){socket[_0x6de5('0x79')]('userChatQueue:save',{'UserId':_0x4ef8f7['id'],'ChatQueueId':_0x141e0a['id']});});});});});}})[_0x6de5('0x22')](respondWithStatusCode(_0x1b3067,null))[_0x6de5('0x29')](handleError(_0x1b3067,null));};exports['removeTeams']=function(_0x460fa7,_0x4afb9c,_0xb4186a){return db['Team']['findAll']({'where':{'id':_0x460fa7[_0x6de5('0x43')][_0x6de5('0x72')]},'attributes':['id'],'include':[{'model':db[_0x6de5('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4afb9c,null))['then'](function(_0x1b19d3){var _0x4fb1e7=_[_0x6de5('0x3d')](_0x1b19d3,'id');var _0x40e836=[];var _0x536e06=[];var _0x7fb98e=squel[_0x6de5('0x7a')]();_0x7fb98e[_0x6de5('0x7b')](_0x6de5('0x7c'))['from'](_0x6de5('0x7d'),'tq')['join'](_0x6de5('0x7e'),'ut',_0x6de5('0x7f'))[_0x6de5('0x4f')](_0x6de5('0x80'),_0x460fa7[_0x6de5('0x57')]['id']);for(var _0x33de64=0x0;_0x33de64<_0x1b19d3['length'];_0x33de64+=0x1){let _0x1ec346=_0x1b19d3[_0x33de64];for(var _0x26970e=0x0;_0x26970e<_0x1ec346['Agents'][_0x6de5('0x49')];_0x26970e+=0x1){let _0x41191a=_0x1ec346[_0x6de5('0x81')][_0x26970e];var _0x455c50=_0x7fb98e[_0x6de5('0x82')]();_0x455c50[_0x6de5('0x4f')](_0x6de5('0x83'),_0x41191a['id']);_0x536e06[_0x6de5('0x84')](db[_0x6de5('0x76')][_0x6de5('0x43')](_0x455c50[_0x6de5('0x85')](),{'type':db[_0x6de5('0x76')][_0x6de5('0x86')][_0x6de5('0x87')]})['then'](function(_0x30a08f){if(_0x30a08f[_0x6de5('0x49')]===0x1){return _0x41191a['id'];}else{var _0x3f92b6=_[_0x6de5('0x88')](_[_0x6de5('0x3d')](_0x30a08f,_0x6de5('0x89')),function(_0x2cc6d0){return _[_0x6de5('0x8a')](_0x4fb1e7,_0x2cc6d0);});if(_0x3f92b6){return _0x41191a['id'];}}}));}}return BPromise[_0x6de5('0x8b')](_0x536e06)[_0x6de5('0x22')](function(_0xb880e9){_0x40e836=_(_0x40e836)[_0x6de5('0x8c')](_0xb880e9)[_0x6de5('0x8d')]()[_0x6de5('0x8e')]();return db[_0x6de5('0x3e')][_0x6de5('0x58')]({'where':{'id':_0x460fa7[_0x6de5('0x57')]['id']}})['then'](function(_0x130a44){return db[_0x6de5('0x76')][_0x6de5('0x77')](function(_0x2a9d27){return _0x130a44[_0x6de5('0x8f')](_0x460fa7[_0x6de5('0x43')][_0x6de5('0x72')],{'transaction':_0x2a9d27})['then'](function(){if(!_[_0x6de5('0x90')](_0x40e836)){return _0x130a44[_0x6de5('0x91')](_0x40e836,{'transaction':_0x2a9d27});}})['then'](function(){_0x40e836[_0x6de5('0x78')](function(_0x21a519){socket['emit'](_0x6de5('0x92'),{'UserId':_0x21a519,'ChatQueueId':_0x130a44['id']});});});});});});})[_0x6de5('0x22')](respondWithStatusCode(_0x4afb9c,null))['catch'](handleError(_0x4afb9c,null));};exports[_0x6de5('0x93')]=function(_0x42cdae,_0x231736,_0x12eb89){return db[_0x6de5('0x3e')][_0x6de5('0x58')]({'where':{'id':_0x42cdae[_0x6de5('0x57')]['id']}})[_0x6de5('0x22')](handleEntityNotFound(_0x231736,null))['then'](function(_0xf48477){if(_0xf48477){return _0xf48477['addAgents'](_0x42cdae[_0x6de5('0x5a')][_0x6de5('0x72')],_[_0x6de5('0x94')](_0x42cdae[_0x6de5('0x5a')],[_0x6de5('0x72'),'id'])||{})[_0x6de5('0x95')](function(_0x2a80c3){for(var _0x477be6=0x0;_0x477be6<_0x42cdae[_0x6de5('0x5a')][_0x6de5('0x72')]['length'];_0x477be6+=0x1){socket[_0x6de5('0x79')](_0x6de5('0x96'),{'UserId':Number(_0x42cdae['body'][_0x6de5('0x72')][_0x477be6]),'ChatQueueId':Number(_0x42cdae[_0x6de5('0x57')]['id'])});}return _0x2a80c3;});}})[_0x6de5('0x22')](respondWithResult(_0x231736,null))[_0x6de5('0x29')](handleError(_0x231736,null));};exports[_0x6de5('0x91')]=function(_0x5b1b4e,_0x5f0904,_0xdac668){return db[_0x6de5('0x3e')][_0x6de5('0x58')]({'where':{'id':_0x5b1b4e['params']['id']}})[_0x6de5('0x22')](handleEntityNotFound(_0x5f0904,null))[_0x6de5('0x22')](function(_0x5349c3){if(_0x5349c3){return _0x5349c3[_0x6de5('0x91')](_0x5b1b4e['query'][_0x6de5('0x72')])[_0x6de5('0x22')](function(){if(_[_0x6de5('0x97')](_0x5b1b4e[_0x6de5('0x43')][_0x6de5('0x72')])){for(var _0x5cc764=0x0;_0x5cc764<_0x5b1b4e[_0x6de5('0x43')][_0x6de5('0x72')][_0x6de5('0x49')];_0x5cc764+=0x1){socket[_0x6de5('0x79')](_0x6de5('0x92'),{'UserId':Number(_0x5b1b4e[_0x6de5('0x43')]['ids'][_0x5cc764]),'ChatQueueId':Number(_0x5b1b4e[_0x6de5('0x57')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x5b1b4e[_0x6de5('0x43')][_0x6de5('0x72')]),'ChatQueueId':Number(_0x5b1b4e[_0x6de5('0x57')]['id'])});}});}})[_0x6de5('0x22')](respondWithStatusCode(_0x5f0904,null))[_0x6de5('0x29')](handleError(_0x5f0904,null));};exports['getAgents']=function(_0x5d658d,_0x13b16a,_0x3bda44){var _0x3a8a89={};var _0x374066={};var _0x551c01;var _0x122383;return db[_0x6de5('0x3e')]['findOne']({'where':{'id':_0x5d658d['params']['id']}})[_0x6de5('0x22')](handleEntityNotFound(_0x13b16a,null))[_0x6de5('0x22')](function(_0x53e436){if(_0x53e436){_0x551c01=_0x53e436;_0x374066[_0x6de5('0x42')]=_[_0x6de5('0x44')](db[_0x6de5('0x68')]['rawAttributes']);_0x374066[_0x6de5('0x43')]=_[_0x6de5('0x44')](_0x5d658d[_0x6de5('0x43')]);_0x374066[_0x6de5('0x45')]=_[_0x6de5('0x46')](_0x374066[_0x6de5('0x42')],_0x374066[_0x6de5('0x43')]);_0x3a8a89[_0x6de5('0x48')]=_[_0x6de5('0x46')](_0x374066[_0x6de5('0x42')],qs['fields'](_0x5d658d[_0x6de5('0x43')][_0x6de5('0x47')]));_0x3a8a89[_0x6de5('0x48')]=_0x3a8a89['attributes'][_0x6de5('0x49')]?_0x3a8a89[_0x6de5('0x48')]:_0x374066[_0x6de5('0x42')];_0x3a8a89[_0x6de5('0x65')]=qs[_0x6de5('0x4c')](_0x5d658d[_0x6de5('0x43')]['sort']);_0x3a8a89['where']=qs[_0x6de5('0x45')](_[_0x6de5('0x4d')](_0x5d658d['query'],_0x374066[_0x6de5('0x45')]));if(_0x5d658d['query'][_0x6de5('0x4e')]){_0x3a8a89[_0x6de5('0x4f')]=_[_0x6de5('0x50')](_0x3a8a89['where'],{'$or':_['map'](_0x3a8a89[_0x6de5('0x48')],function(_0x47212f){var _0x551d2a={};_0x551d2a[_0x47212f]={'$like':'%'+_0x5d658d['query'][_0x6de5('0x4e')]+'%'};return _0x551d2a;})});}_0x3a8a89=_['merge']({},_0x3a8a89,_0x5d658d[_0x6de5('0x53')]);return _0x551c01[_0x6de5('0x98')](_0x3a8a89);}})['then'](function(_0x374973){if(_0x374973){_0x122383=_0x374973['length'];if(!_0x5d658d[_0x6de5('0x43')]['hasOwnProperty']('nolimit')){_0x3a8a89[_0x6de5('0x2f')]=qs['limit'](_0x5d658d[_0x6de5('0x43')][_0x6de5('0x2f')]);_0x3a8a89[_0x6de5('0x2d')]=qs[_0x6de5('0x2d')](_0x5d658d[_0x6de5('0x43')][_0x6de5('0x2d')]);}return _0x551c01[_0x6de5('0x98')](_0x3a8a89);}})[_0x6de5('0x22')](function(_0x23c639){if(_0x23c639){return _0x23c639?{'count':_0x122383,'rows':_0x23c639}:null;}})[_0x6de5('0x22')](respondWithResult(_0x13b16a,null))[_0x6de5('0x29')](handleError(_0x13b16a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 454e092..508c2f3 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 _0xe94a=['emit','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xe94a,0x1b7));var _0xae94=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0xe94a[_0x1034bb];return _0x453fdb;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0xae94('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xae94('0x1')](0x0);var events={'afterCreate':_0xae94('0x2'),'afterUpdate':_0xae94('0x3'),'afterDestroy':_0xae94('0x4')};function emitEvent(_0x1f7eae){return function(_0x1912eb,_0x4dd52a,_0x44f40e){ChatQueueEvents[_0xae94('0x5')](_0x1f7eae+':'+_0x1912eb['id'],_0x1912eb);ChatQueueEvents[_0xae94('0x5')](_0x1f7eae,_0x1912eb);_0x44f40e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x81c3=['hook','exports','../../mysqldb','ChatQueue','save','update','emit','hasOwnProperty'];(function(_0x190730,_0x4ce4fe){var _0x271fbc=function(_0x4d8ac5){while(--_0x4d8ac5){_0x190730['push'](_0x190730['shift']());}};_0x271fbc(++_0x4ce4fe);}(_0x81c3,0xd2));var _0x381c=function(_0x289755,_0xa2a591){_0x289755=_0x289755-0x0;var _0x3b8130=_0x81c3[_0x289755];return _0x3b8130;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x381c('0x0'))['db'][_0x381c('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x381c('0x2'),'afterUpdate':_0x381c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x515774){return function(_0x1603d4,_0xd74826,_0x58939c){ChatQueueEvents[_0x381c('0x4')](_0x515774+':'+_0x1603d4['id'],_0x1603d4);ChatQueueEvents[_0x381c('0x4')](_0x515774,_0x1603d4);_0x58939c(null);};}for(var e in events){if(events[_0x381c('0x5')](e)){var event=events[e];ChatQueue[_0x381c('0x6')](e,emitEvent(event));}}module[_0x381c('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index c1df475..1d49bc0 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 _0x2999=['../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x54870e,_0x47161f){var _0x5199fa=function(_0x55ad3d){while(--_0x55ad3d){_0x54870e['push'](_0x54870e['shift']());}};_0x5199fa(++_0x47161f);}(_0x2999,0xf0));var _0x9299=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2999[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9299('0x0'));var util=require(_0x9299('0x1'));var logger=require(_0x9299('0x2'))(_0x9299('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9299('0x4'));var fs=require('fs');var path=require(_0x9299('0x5'));var rimraf=require(_0x9299('0x6'));var config=require(_0x9299('0x7'));var attributes=require(_0x9299('0x8'));module[_0x9299('0x9')]=function(_0x1e9ad7,_0x53883f){return _0x1e9ad7[_0x9299('0xa')](_0x9299('0xb'),attributes,{'tableName':_0x9299('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x08ae=['define','ChatQueue','chat_queues','util','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x08ae,0x1bb));var _0xe08a=function(_0x479035,_0xe90aad){_0x479035=_0x479035-0x0;var _0x458b43=_0x08ae[_0x479035];return _0x458b43;};'use strict';var _=require('lodash');var util=require(_0xe08a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe08a('0x1'));var BPromise=require('bluebird');var rp=require(_0xe08a('0x2'));var fs=require('fs');var path=require(_0xe08a('0x3'));var rimraf=require(_0xe08a('0x4'));var config=require(_0xe08a('0x5'));var attributes=require(_0xe08a('0x6'));module[_0xe08a('0x7')]=function(_0x1eed33,_0x1bd0b3){return _0x1eed33[_0xe08a('0x8')](_0xe08a('0x9'),attributes,{'tableName':_0xe08a('0xa'),'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 25fffdc..7ae4e7f 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 _0x4eb5=['client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','ChatQueue','findAll','options','where','attributes','limit','include','model','map','GetChatQueue','stringify','ShowChatQueue','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2df832,_0x240a8c){var _0x575133=function(_0x3e8606){while(--_0x3e8606){_0x2df832['push'](_0x2df832['shift']());}};_0x575133(++_0x240a8c);}(_0x4eb5,0x19a));var _0x54eb=function(_0x596797,_0x5b344a){_0x596797=_0x596797-0x0;var _0x332f84=_0x4eb5[_0x596797];return _0x332f84;};'use strict';var _=require(_0x54eb('0x0'));var util=require(_0x54eb('0x1'));var moment=require('moment');var BPromise=require(_0x54eb('0x2'));var rs=require(_0x54eb('0x3'));var fs=require('fs');var Redis=require(_0x54eb('0x4'));var db=require(_0x54eb('0x5'))['db'];var utils=require(_0x54eb('0x6'));var logger=require(_0x54eb('0x7'))(_0x54eb('0x8'));var config=require('../../config/environment');var jayson=require(_0x54eb('0x9'));var client=jayson[_0x54eb('0xa')][_0x54eb('0xb')]({'port':0x232a});config[_0x54eb('0xc')]=_[_0x54eb('0xd')](config[_0x54eb('0xc')],{'host':_0x54eb('0xe'),'port':0x18eb});var socket=require(_0x54eb('0xf'))(new Redis(config[_0x54eb('0xc')]));require(_0x54eb('0x10'))[_0x54eb('0x11')](socket);function respondWithRpcPromise(_0x1e9096,_0x740549,_0x52032c){return new BPromise(function(_0xc81060,_0x3c7c86){return client[_0x54eb('0x12')](_0x1e9096,_0x52032c)[_0x54eb('0x13')](function(_0x57f672){logger[_0x54eb('0x14')](_0x54eb('0x15'),_0x740549,_0x54eb('0x16'));logger[_0x54eb('0x17')](_0x54eb('0x18'),_0x740549,_0x54eb('0x16'),JSON['stringify'](_0x57f672));if(_0x57f672[_0x54eb('0x19')]){if(_0x57f672[_0x54eb('0x19')][_0x54eb('0x1a')]===0x1f4){logger[_0x54eb('0x19')](_0x54eb('0x15'),_0x740549,_0x57f672['error'][_0x54eb('0x1b')]);return _0x3c7c86(_0x57f672[_0x54eb('0x19')]['message']);}logger['error'](_0x54eb('0x15'),_0x740549,_0x57f672[_0x54eb('0x19')]['message']);return _0xc81060(_0x57f672[_0x54eb('0x19')]['message']);}else{logger[_0x54eb('0x14')](_0x54eb('0x15'),_0x740549,_0x54eb('0x16'));_0xc81060(_0x57f672['result'][_0x54eb('0x1b')]);}})[_0x54eb('0x1c')](function(_0x2a0d40){logger[_0x54eb('0x19')]('ChatQueue,\x20%s,\x20%s',_0x740549,_0x2a0d40);_0x3c7c86(_0x2a0d40);});});}exports['GetChatQueue']=function(_0x37f685){var _0x5b07c0=this;return new Promise(function(_0x49a7bf,_0x484b91){return db[_0x54eb('0x1d')][_0x54eb('0x1e')]({'raw':_0x37f685[_0x54eb('0x1f')]?_0x37f685['options']['raw']===undefined?!![]:![]:!![],'where':_0x37f685['options']?_0x37f685[_0x54eb('0x1f')][_0x54eb('0x20')]||null:null,'attributes':_0x37f685[_0x54eb('0x1f')]?_0x37f685[_0x54eb('0x1f')][_0x54eb('0x21')]||null:null,'limit':_0x37f685[_0x54eb('0x1f')]?_0x37f685[_0x54eb('0x1f')][_0x54eb('0x22')]||null:null,'include':_0x37f685[_0x54eb('0x1f')]?_0x37f685[_0x54eb('0x1f')][_0x54eb('0x23')]?_['map'](_0x37f685[_0x54eb('0x1f')]['include'],function(_0x319252){return{'model':db[_0x319252[_0x54eb('0x24')]],'as':_0x319252['as'],'attributes':_0x319252[_0x54eb('0x21')],'include':_0x319252[_0x54eb('0x23')]?_[_0x54eb('0x25')](_0x319252['include'],function(_0x5c0955){return{'model':db[_0x5c0955[_0x54eb('0x24')]],'as':_0x5c0955['as'],'attributes':_0x5c0955[_0x54eb('0x21')],'include':_0x5c0955[_0x54eb('0x23')]?_[_0x54eb('0x25')](_0x5c0955[_0x54eb('0x23')],function(_0x1e934d){return{'model':db[_0x1e934d['model']],'as':_0x1e934d['as'],'attributes':_0x1e934d[_0x54eb('0x21')]};}):[]};}):[]};}):[]:[]})[_0x54eb('0x13')](function(_0x39fd1e){logger[_0x54eb('0x14')](_0x54eb('0x26'),_0x37f685);logger[_0x54eb('0x17')](_0x54eb('0x26'),_0x37f685,JSON[_0x54eb('0x27')](_0x39fd1e));_0x49a7bf(_0x39fd1e);})['catch'](function(_0xf041e8){logger[_0x54eb('0x19')](_0x54eb('0x26'),_0xf041e8[_0x54eb('0x1b')],_0x37f685);_0x484b91(_0x5b07c0['error'](0x1f4,_0xf041e8[_0x54eb('0x1b')]));});});};exports[_0x54eb('0x28')]=function(_0x35256d){var _0x5f5a67=this;return new Promise(function(_0x498586,_0x1032b9){return db[_0x54eb('0x1d')]['find']({'raw':_0x35256d['options']?_0x35256d[_0x54eb('0x1f')][_0x54eb('0x29')]===undefined?!![]:![]:!![],'where':_0x35256d['options']?_0x35256d[_0x54eb('0x1f')][_0x54eb('0x20')]||null:null,'attributes':_0x35256d[_0x54eb('0x1f')]?_0x35256d[_0x54eb('0x1f')][_0x54eb('0x21')]||null:null,'include':_0x35256d[_0x54eb('0x1f')]?_0x35256d[_0x54eb('0x1f')][_0x54eb('0x23')]?_['map'](_0x35256d[_0x54eb('0x1f')]['include'],function(_0x591c24){return{'model':db[_0x591c24['model']],'as':_0x591c24['as'],'attributes':_0x591c24[_0x54eb('0x21')],'include':_0x591c24[_0x54eb('0x23')]?_['map'](_0x591c24[_0x54eb('0x23')],function(_0x19b9f6){return{'model':db[_0x19b9f6[_0x54eb('0x24')]],'as':_0x19b9f6['as'],'attributes':_0x19b9f6[_0x54eb('0x21')],'include':_0x19b9f6[_0x54eb('0x23')]?_[_0x54eb('0x25')](_0x19b9f6['include'],function(_0x210430){return{'model':db[_0x210430[_0x54eb('0x24')]],'as':_0x210430['as'],'attributes':_0x210430[_0x54eb('0x21')]};}):[]};}):[]};}):[]:[]})[_0x54eb('0x13')](function(_0x446530){logger[_0x54eb('0x14')]('ShowChatQueue',_0x35256d);logger[_0x54eb('0x17')]('ShowChatQueue',_0x35256d,JSON[_0x54eb('0x27')](_0x446530));_0x498586(_0x446530);})['catch'](function(_0x1ef17f){logger['error'](_0x54eb('0x28'),_0x1ef17f[_0x54eb('0x1b')],_0x35256d);_0x1032b9(_0x5f5a67[_0x54eb('0x19')](0x1f4,_0x1ef17f[_0x54eb('0x1b')]));});});};
\ No newline at end of file
+var _0xcabe=['ShowChatQueue','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','map','model'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0xcabe,0x1ef));var _0xecab=function(_0x27e5a1,_0x23309a){_0x27e5a1=_0x27e5a1-0x0;var _0x765786=_0xcabe[_0x27e5a1];return _0x765786;};'use strict';var _=require(_0xecab('0x0'));var util=require('util');var moment=require(_0xecab('0x1'));var BPromise=require(_0xecab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecab('0x3'));var db=require(_0xecab('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xecab('0x5'))(_0xecab('0x6'));var config=require(_0xecab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xecab('0x8')][_0xecab('0x9')]({'port':0x232a});config[_0xecab('0xa')]=_[_0xecab('0xb')](config[_0xecab('0xa')],{'host':_0xecab('0xc'),'port':0x18eb});var socket=require(_0xecab('0xd'))(new Redis(config[_0xecab('0xa')]));require(_0xecab('0xe'))['register'](socket);function respondWithRpcPromise(_0x4b1d26,_0x270fdd,_0x2550e9){return new BPromise(function(_0x52f26a,_0x445617){return client[_0xecab('0xf')](_0x4b1d26,_0x2550e9)[_0xecab('0x10')](function(_0xb7d084){logger[_0xecab('0x11')](_0xecab('0x12'),_0x270fdd,'request\x20sent');logger[_0xecab('0x13')](_0xecab('0x14'),_0x270fdd,_0xecab('0x15'),JSON[_0xecab('0x16')](_0xb7d084));if(_0xb7d084[_0xecab('0x17')]){if(_0xb7d084[_0xecab('0x17')]['code']===0x1f4){logger[_0xecab('0x17')]('ChatQueue,\x20%s,\x20%s',_0x270fdd,_0xb7d084['error'][_0xecab('0x18')]);return _0x445617(_0xb7d084[_0xecab('0x17')][_0xecab('0x18')]);}logger[_0xecab('0x17')]('ChatQueue,\x20%s,\x20%s',_0x270fdd,_0xb7d084[_0xecab('0x17')][_0xecab('0x18')]);return _0x52f26a(_0xb7d084[_0xecab('0x17')][_0xecab('0x18')]);}else{logger[_0xecab('0x11')]('ChatQueue,\x20%s,\x20%s',_0x270fdd,_0xecab('0x15'));_0x52f26a(_0xb7d084[_0xecab('0x19')]['message']);}})[_0xecab('0x1a')](function(_0x3bd6c0){logger[_0xecab('0x17')](_0xecab('0x12'),_0x270fdd,_0x3bd6c0);_0x445617(_0x3bd6c0);});});}exports[_0xecab('0x1b')]=function(_0xbafd2){var _0x4a450c=this;return new Promise(function(_0x1cfa2f,_0x2ec6fb){return db[_0xecab('0x1c')]['findAll']({'raw':_0xbafd2[_0xecab('0x1d')]?_0xbafd2['options'][_0xecab('0x1e')]===undefined?!![]:![]:!![],'where':_0xbafd2['options']?_0xbafd2[_0xecab('0x1d')][_0xecab('0x1f')]||null:null,'attributes':_0xbafd2[_0xecab('0x1d')]?_0xbafd2[_0xecab('0x1d')][_0xecab('0x20')]||null:null,'limit':_0xbafd2[_0xecab('0x1d')]?_0xbafd2[_0xecab('0x1d')][_0xecab('0x21')]||null:null,'include':_0xbafd2[_0xecab('0x1d')]?_0xbafd2[_0xecab('0x1d')][_0xecab('0x22')]?_[_0xecab('0x23')](_0xbafd2['options'][_0xecab('0x22')],function(_0x4a6240){return{'model':db[_0x4a6240[_0xecab('0x24')]],'as':_0x4a6240['as'],'attributes':_0x4a6240[_0xecab('0x20')],'include':_0x4a6240['include']?_[_0xecab('0x23')](_0x4a6240['include'],function(_0x56c98e){return{'model':db[_0x56c98e[_0xecab('0x24')]],'as':_0x56c98e['as'],'attributes':_0x56c98e[_0xecab('0x20')],'include':_0x56c98e[_0xecab('0x22')]?_[_0xecab('0x23')](_0x56c98e[_0xecab('0x22')],function(_0x30ca35){return{'model':db[_0x30ca35[_0xecab('0x24')]],'as':_0x30ca35['as'],'attributes':_0x30ca35['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x41df38){logger[_0xecab('0x11')](_0xecab('0x1b'),_0xbafd2);logger[_0xecab('0x13')](_0xecab('0x1b'),_0xbafd2,JSON[_0xecab('0x16')](_0x41df38));_0x1cfa2f(_0x41df38);})['catch'](function(_0x5501e9){logger[_0xecab('0x17')](_0xecab('0x1b'),_0x5501e9[_0xecab('0x18')],_0xbafd2);_0x2ec6fb(_0x4a450c[_0xecab('0x17')](0x1f4,_0x5501e9[_0xecab('0x18')]));});});};exports[_0xecab('0x25')]=function(_0x32955f){var _0x2a4661=this;return new Promise(function(_0x139a64,_0x4850b1){return db['ChatQueue']['find']({'raw':_0x32955f['options']?_0x32955f['options'][_0xecab('0x1e')]===undefined?!![]:![]:!![],'where':_0x32955f[_0xecab('0x1d')]?_0x32955f[_0xecab('0x1d')][_0xecab('0x1f')]||null:null,'attributes':_0x32955f[_0xecab('0x1d')]?_0x32955f[_0xecab('0x1d')][_0xecab('0x20')]||null:null,'include':_0x32955f[_0xecab('0x1d')]?_0x32955f[_0xecab('0x1d')][_0xecab('0x22')]?_['map'](_0x32955f[_0xecab('0x1d')]['include'],function(_0x543ea8){return{'model':db[_0x543ea8[_0xecab('0x24')]],'as':_0x543ea8['as'],'attributes':_0x543ea8['attributes'],'include':_0x543ea8[_0xecab('0x22')]?_[_0xecab('0x23')](_0x543ea8['include'],function(_0xafde3f){return{'model':db[_0xafde3f[_0xecab('0x24')]],'as':_0xafde3f['as'],'attributes':_0xafde3f[_0xecab('0x20')],'include':_0xafde3f[_0xecab('0x22')]?_['map'](_0xafde3f[_0xecab('0x22')],function(_0xf86a11){return{'model':db[_0xf86a11[_0xecab('0x24')]],'as':_0xf86a11['as'],'attributes':_0xf86a11['attributes']};}):[]};}):[]};}):[]:[]})[_0xecab('0x10')](function(_0xba2335){logger['info'](_0xecab('0x25'),_0x32955f);logger[_0xecab('0x13')](_0xecab('0x25'),_0x32955f,JSON['stringify'](_0xba2335));_0x139a64(_0xba2335);})['catch'](function(_0x58e0a8){logger[_0xecab('0x17')](_0xecab('0x25'),_0x58e0a8[_0xecab('0x18')],_0x32955f);_0x4850b1(_0x2a4661[_0xecab('0x17')](0x1f4,_0x58e0a8[_0xecab('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 4958dc9..42142fe 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 _0x0e85=['update','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x224a93,_0x5ef65b){var _0x27c59c=function(_0x434048){while(--_0x434048){_0x224a93['push'](_0x224a93['shift']());}};_0x27c59c(++_0x5ef65b);}(_0x0e85,0x7c));var _0x50e8=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x0e85[_0x4c445a];return _0x2f611c;};'use strict';var ChatQueueEvents=require(_0x50e8('0x0'));var events=[_0x50e8('0x1'),'remove',_0x50e8('0x2')];function createListener(_0x682d10,_0x55e515){return function(_0x55cba3){_0x55e515['emit'](_0x682d10,_0x55cba3);};}function removeListener(_0x236cf3,_0x4e90e7){return function(){ChatQueueEvents[_0x50e8('0x3')](_0x236cf3,_0x4e90e7);};}exports[_0x50e8('0x4')]=function(_0xe3151e){for(var _0xfde42=0x0,_0x5e8b01=events[_0x50e8('0x5')];_0xfde42<_0x5e8b01;_0xfde42++){var _0x108edc=events[_0xfde42];var _0x42665e=createListener(_0x50e8('0x6')+_0x108edc,_0xe3151e);ChatQueueEvents['on'](_0x108edc,_0x42665e);}};
\ No newline at end of file
+var _0xcea2=['chatQueue:','./chatQueue.events','remove','removeListener','length'];(function(_0x74115b,_0x31f752){var _0x57ebbd=function(_0x234873){while(--_0x234873){_0x74115b['push'](_0x74115b['shift']());}};_0x57ebbd(++_0x31f752);}(_0xcea2,0x15a));var _0x2cea=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xcea2[_0x1a36a5];return _0x746243;};'use strict';var ChatQueueEvents=require(_0x2cea('0x0'));var events=['save',_0x2cea('0x1'),'update'];function createListener(_0x3e22c2,_0x7f1f5a){return function(_0x60a793){_0x7f1f5a['emit'](_0x3e22c2,_0x60a793);};}function removeListener(_0x3ff73f,_0x46060b){return function(){ChatQueueEvents[_0x2cea('0x2')](_0x3ff73f,_0x46060b);};}exports['register']=function(_0x34f0f2){for(var _0x485c26=0x0,_0x2d69ff=events[_0x2cea('0x3')];_0x485c26<_0x2d69ff;_0x485c26++){var _0x805a1b=events[_0x485c26];var _0x160cca=createListener(_0x2cea('0x4')+_0x805a1b,_0x34f0f2);ChatQueueEvents['on'](_0x805a1b,_0x160cca);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 4aca0cf..f325d63 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 _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(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x5fc3,0xa8));var _0x35fc=function(_0xd8a8af,_0x1e93f0){_0xd8a8af=_0xd8a8af-0x0;var _0x5b7278=_0x5fc3[_0xd8a8af];return _0x5b7278;};'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
+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(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5c8827,_0x5bc5d7){_0x5c8827=_0x5c8827-0x0;var _0x50ffd5=_0x5fc3[_0x5c8827];return _0x50ffd5;};'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 f90fbdf..281f6ab 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 _0x4751=['DATE','moment','exports','STRING'];(function(_0x5e7933,_0x5487dd){var _0x1b9865=function(_0x44e56b){while(--_0x44e56b){_0x5e7933['push'](_0x5e7933['shift']());}};_0x1b9865(++_0x5487dd);}(_0x4751,0x85));var _0x1475=function(_0x222780,_0xed24cd){_0x222780=_0x222780-0x0;var _0x1699cb=_0x4751[_0x222780];return _0x1699cb;};'use strict';var moment=require(_0x1475('0x0'));var Sequelize=require('sequelize');module[_0x1475('0x1')]={'uniqueid':{'type':Sequelize[_0x1475('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1475('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1475('0x3')]},'exitAt':{'type':Sequelize[_0x1475('0x3')]},'reason':{'type':Sequelize[_0x1475('0x2')]}};
\ No newline at end of file
+var _0x845b=['moment','sequelize','exports','STRING','DATE'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x845b,0xaf));var _0xb845=function(_0x40e13e,_0x376d13){_0x40e13e=_0x40e13e-0x0;var _0x5db39e=_0x845b[_0x40e13e];return _0x5db39e;};'use strict';var moment=require(_0xb845('0x0'));var Sequelize=require(_0xb845('0x1'));module[_0xb845('0x2')]={'uniqueid':{'type':Sequelize[_0xb845('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb845('0x3')]},'joinAt':{'type':Sequelize[_0xb845('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb845('0x4')]},'exitAt':{'type':Sequelize[_0xb845('0x4')]},'reason':{'type':Sequelize[_0xb845('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 6d1cb6f..587f219 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 _0x4672=['fieldName','key','filters','intersection','model','query','fields','length','attributes','hasOwnProperty','order','sort','where','pick','merge','type','filter','options','then','findAll','catch','params','keys','includeAll','include','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','reject','update','error','name','send','index','map','ChatQueueReport','rawAttributes'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0x4672,0x18a));var _0x2467=function(_0x523a8b,_0x5a7f8d){_0x523a8b=_0x523a8b-0x0;var _0x45c38c=_0x4672[_0x523a8b];return _0x45c38c;};'use strict';var emlformat=require(_0x2467('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2467('0x1'));var jsonpatch=require(_0x2467('0x2'));var rp=require('request-promise');var moment=require(_0x2467('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2467('0x4'));var util=require(_0x2467('0x5'));var path=require(_0x2467('0x6'));var sox=require(_0x2467('0x7'));var csv=require('to-csv');var ejs=require(_0x2467('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2467('0x9'));var squel=require(_0x2467('0xa'));var crypto=require(_0x2467('0xb'));var jsforce=require(_0x2467('0xc'));var deskjs=require(_0x2467('0xd'));var toCsv=require(_0x2467('0xe'));var querystring=require(_0x2467('0xf'));var Papa=require(_0x2467('0x10'));var Redis=require(_0x2467('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2467('0x12'));var as=require(_0x2467('0x13'));var hardwareService=require(_0x2467('0x14'));var logger=require(_0x2467('0x15'))('api');var utils=require(_0x2467('0x16'));var config=require(_0x2467('0x17'));var licenseUtil=require(_0x2467('0x18'));var db=require(_0x2467('0x19'))['db'];function respondWithStatusCode(_0x348f51,_0x381f99){_0x381f99=_0x381f99||0xcc;return function(_0x5ac925){if(_0x5ac925){return _0x348f51[_0x2467('0x1a')](_0x381f99);}return _0x348f51[_0x2467('0x1b')](_0x381f99)[_0x2467('0x1c')]();};}function respondWithResult(_0xa9966d,_0x37df20){_0x37df20=_0x37df20||0xc8;return function(_0x265d7e){if(_0x265d7e){return _0xa9966d[_0x2467('0x1b')](_0x37df20)['json'](_0x265d7e);}};}function respondWithFilteredResult(_0x520ad9,_0x4eab72){return function(_0x2cab68){if(_0x2cab68){var _0xe72566=typeof _0x4eab72[_0x2467('0x1d')]==='undefined'&&typeof _0x4eab72[_0x2467('0x1e')]===_0x2467('0x1f');var _0x4abd91=_0x2cab68[_0x2467('0x20')];var _0x350ead=_0xe72566?0x0:_0x4eab72[_0x2467('0x1d')];var _0x468fb4=_0xe72566?_0x2cab68[_0x2467('0x20')]:_0x4eab72[_0x2467('0x1d')]+_0x4eab72[_0x2467('0x1e')];var _0x5ecb91;if(_0x468fb4>=_0x4abd91){_0x468fb4=_0x4abd91;_0x5ecb91=0xc8;}else{_0x5ecb91=0xce;}_0x520ad9['status'](_0x5ecb91);return _0x520ad9[_0x2467('0x21')]('Content-Range',_0x350ead+'-'+_0x468fb4+'/'+_0x4abd91)[_0x2467('0x22')](_0x2cab68);}return null;};}function patchUpdates(_0xa16c1a){return function(_0x50e555){try{jsonpatch['apply'](_0x50e555,_0xa16c1a,!![]);}catch(_0x2d7061){return BPromise[_0x2467('0x23')](_0x2d7061);}return _0x50e555['save']();};}function saveUpdates(_0x1217e0,_0x1ed72b){return function(_0xb35e27){if(_0xb35e27){return _0xb35e27[_0x2467('0x24')](_0x1217e0)['then'](function(_0x2ebd45){return _0x2ebd45;});}return null;};}function removeEntity(_0x51831c,_0x5e5621){return function(_0x3f600e){if(_0x3f600e){return _0x3f600e['destroy']()['then'](function(){_0x51831c['status'](0xcc)[_0x2467('0x1c')]();});}};}function handleEntityNotFound(_0x20e798,_0x52ba60){return function(_0xb8f34f){if(!_0xb8f34f){_0x20e798[_0x2467('0x1a')](0x194);}return _0xb8f34f;};}function handleError(_0x2cd7a6,_0x3224c2){_0x3224c2=_0x3224c2||0x1f4;return function(_0x18f045){logger[_0x2467('0x25')](_0x18f045['stack']);if(_0x18f045[_0x2467('0x26')]){delete _0x18f045[_0x2467('0x26')];}_0x2cd7a6[_0x2467('0x1b')](_0x3224c2)[_0x2467('0x27')](_0x18f045);};}exports[_0x2467('0x28')]=function(_0x327954,_0x201c31){var _0x42bc8e={},_0x4da106={},_0xa793b2={'count':0x0,'rows':[]};var _0x1de49c=_[_0x2467('0x29')](db[_0x2467('0x2a')][_0x2467('0x2b')],function(_0x36c94d){return{'name':_0x36c94d[_0x2467('0x2c')],'type':_0x36c94d['type'][_0x2467('0x2d')]};});_0x4da106['model']=_['map'](_0x1de49c,_0x2467('0x26'));_0x4da106['query']=_['keys'](_0x327954['query']);_0x4da106[_0x2467('0x2e')]=_[_0x2467('0x2f')](_0x4da106[_0x2467('0x30')],_0x4da106[_0x2467('0x31')]);_0x42bc8e['attributes']=_[_0x2467('0x2f')](_0x4da106[_0x2467('0x30')],qs[_0x2467('0x32')](_0x327954['query'][_0x2467('0x32')]));_0x42bc8e['attributes']=_0x42bc8e['attributes'][_0x2467('0x33')]?_0x42bc8e[_0x2467('0x34')]:_0x4da106[_0x2467('0x30')];if(!_0x327954[_0x2467('0x31')][_0x2467('0x35')]('nolimit')){_0x42bc8e['limit']=qs['limit'](_0x327954[_0x2467('0x31')][_0x2467('0x1e')]);_0x42bc8e[_0x2467('0x1d')]=qs[_0x2467('0x1d')](_0x327954[_0x2467('0x31')][_0x2467('0x1d')]);}_0x42bc8e[_0x2467('0x36')]=qs[_0x2467('0x37')](_0x327954[_0x2467('0x31')]['sort']);_0x42bc8e[_0x2467('0x38')]=qs[_0x2467('0x2e')](_[_0x2467('0x39')](_0x327954[_0x2467('0x31')],_0x4da106[_0x2467('0x2e')]),_0x1de49c);if(_0x327954[_0x2467('0x31')]['filter']){_0x42bc8e['where']=_[_0x2467('0x3a')](_0x42bc8e[_0x2467('0x38')],{'$or':_[_0x2467('0x29')](_0x1de49c,function(_0x8dc1da){if(_0x8dc1da[_0x2467('0x3b')]!=='VIRTUAL'){var _0x1f216d={};_0x1f216d[_0x8dc1da['name']]={'$like':'%'+_0x327954['query'][_0x2467('0x3c')]+'%'};return _0x1f216d;}})});}_0x42bc8e=_[_0x2467('0x3a')]({},_0x42bc8e,_0x327954[_0x2467('0x3d')]);var _0x19e39c={'where':_0x42bc8e[_0x2467('0x38')]};return db[_0x2467('0x2a')][_0x2467('0x20')](_0x19e39c)[_0x2467('0x3e')](function(_0xe6bae3){_0xa793b2['count']=_0xe6bae3;if(_0x327954[_0x2467('0x31')]['includeAll']){_0x42bc8e['include']=[{'all':!![]}];}return db[_0x2467('0x2a')][_0x2467('0x3f')](_0x42bc8e);})[_0x2467('0x3e')](function(_0x57fa85){_0xa793b2['rows']=_0x57fa85;return _0xa793b2;})['then'](respondWithFilteredResult(_0x201c31,_0x42bc8e))[_0x2467('0x40')](handleError(_0x201c31,null));};exports['show']=function(_0x7fd02f,_0x26ed4d){var _0x2f8b67={'raw':!![],'where':{'id':_0x7fd02f[_0x2467('0x41')]['id']}},_0x2f39c8={};_0x2f39c8[_0x2467('0x30')]=_[_0x2467('0x42')](db[_0x2467('0x2a')]['rawAttributes']);_0x2f39c8[_0x2467('0x31')]=_['keys'](_0x7fd02f[_0x2467('0x31')]);_0x2f39c8[_0x2467('0x2e')]=_['intersection'](_0x2f39c8[_0x2467('0x30')],_0x2f39c8[_0x2467('0x31')]);_0x2f8b67['attributes']=_[_0x2467('0x2f')](_0x2f39c8['model'],qs[_0x2467('0x32')](_0x7fd02f['query']['fields']));_0x2f8b67[_0x2467('0x34')]=_0x2f8b67[_0x2467('0x34')][_0x2467('0x33')]?_0x2f8b67[_0x2467('0x34')]:_0x2f39c8[_0x2467('0x30')];if(_0x7fd02f[_0x2467('0x31')][_0x2467('0x43')]){_0x2f8b67[_0x2467('0x44')]=[{'all':!![]}];}_0x2f8b67=_[_0x2467('0x3a')]({},_0x2f8b67,_0x7fd02f[_0x2467('0x3d')]);return db[_0x2467('0x2a')][_0x2467('0x45')](_0x2f8b67)['then'](handleEntityNotFound(_0x26ed4d,null))['then'](respondWithResult(_0x26ed4d,null))[_0x2467('0x40')](handleError(_0x26ed4d,null));};exports[_0x2467('0x46')]=function(_0x4417d1,_0x41c70d){return db[_0x2467('0x2a')][_0x2467('0x46')](_0x4417d1[_0x2467('0x47')],{})[_0x2467('0x3e')](respondWithResult(_0x41c70d,0xc9))['catch'](handleError(_0x41c70d,null));};exports[_0x2467('0x24')]=function(_0x42ca44,_0x554011){if(_0x42ca44[_0x2467('0x47')]['id']){delete _0x42ca44['body']['id'];}return db[_0x2467('0x2a')][_0x2467('0x45')]({'where':{'id':_0x42ca44[_0x2467('0x41')]['id']}})[_0x2467('0x3e')](handleEntityNotFound(_0x554011,null))[_0x2467('0x3e')](saveUpdates(_0x42ca44[_0x2467('0x47')],null))[_0x2467('0x3e')](respondWithResult(_0x554011,null))[_0x2467('0x40')](handleError(_0x554011,null));};exports[_0x2467('0x48')]=function(_0x22fae5,_0x14867b){return db['ChatQueueReport'][_0x2467('0x45')]({'where':{'id':_0x22fae5[_0x2467('0x41')]['id']}})[_0x2467('0x3e')](handleEntityNotFound(_0x14867b,null))['then'](removeEntity(_0x14867b,null))[_0x2467('0x40')](handleError(_0x14867b,null));};exports['describe']=function(_0x573396,_0x5d43ed){return db[_0x2467('0x2a')]['describe']()[_0x2467('0x3e')](respondWithResult(_0x5d43ed,null))['catch'](handleError(_0x5d43ed,null));};
\ No newline at end of file
+var _0xc891=['to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','name','send','ChatQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','params','create','body','find','catch','destroy','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox'];(function(_0x5641e3,_0x1437ae){var _0x4065e8=function(_0x55dbf9){while(--_0x55dbf9){_0x5641e3['push'](_0x5641e3['shift']());}};_0x4065e8(++_0x1437ae);}(_0xc891,0x152));var _0x1c89=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc891[_0x491a7f];return _0x3d8f44;};'use strict';var emlformat=require(_0x1c89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1c89('0x1'));var rp=require('request-promise');var moment=require(_0x1c89('0x2'));var BPromise=require(_0x1c89('0x3'));var Mustache=require(_0x1c89('0x4'));var util=require('util');var path=require(_0x1c89('0x5'));var sox=require(_0x1c89('0x6'));var csv=require(_0x1c89('0x7'));var ejs=require(_0x1c89('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c89('0x9'));var squel=require(_0x1c89('0xa'));var crypto=require('crypto');var jsforce=require(_0x1c89('0xb'));var deskjs=require(_0x1c89('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1c89('0xd'));var Papa=require('papaparse');var Redis=require(_0x1c89('0xe'));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(_0x1c89('0xf'))('api');var utils=require(_0x1c89('0x10'));var config=require(_0x1c89('0x11'));var licenseUtil=require(_0x1c89('0x12'));var db=require(_0x1c89('0x13'))['db'];function respondWithStatusCode(_0x7a4a2b,_0x27e7c0){_0x27e7c0=_0x27e7c0||0xcc;return function(_0x393b5f){if(_0x393b5f){return _0x7a4a2b[_0x1c89('0x14')](_0x27e7c0);}return _0x7a4a2b['status'](_0x27e7c0)[_0x1c89('0x15')]();};}function respondWithResult(_0x514e4d,_0x46be15){_0x46be15=_0x46be15||0xc8;return function(_0x424651){if(_0x424651){return _0x514e4d[_0x1c89('0x16')](_0x46be15)['json'](_0x424651);}};}function respondWithFilteredResult(_0x45354d,_0x29602e){return function(_0x2c9572){if(_0x2c9572){var _0x4af31b=typeof _0x29602e[_0x1c89('0x17')]===_0x1c89('0x18')&&typeof _0x29602e[_0x1c89('0x19')]===_0x1c89('0x18');var _0x33afcf=_0x2c9572[_0x1c89('0x1a')];var _0x2cb186=_0x4af31b?0x0:_0x29602e[_0x1c89('0x17')];var _0x166444=_0x4af31b?_0x2c9572[_0x1c89('0x1a')]:_0x29602e[_0x1c89('0x17')]+_0x29602e['limit'];var _0x18ce93;if(_0x166444>=_0x33afcf){_0x166444=_0x33afcf;_0x18ce93=0xc8;}else{_0x18ce93=0xce;}_0x45354d[_0x1c89('0x16')](_0x18ce93);return _0x45354d['set'](_0x1c89('0x1b'),_0x2cb186+'-'+_0x166444+'/'+_0x33afcf)[_0x1c89('0x1c')](_0x2c9572);}return null;};}function patchUpdates(_0x14121c){return function(_0x43a17a){try{jsonpatch['apply'](_0x43a17a,_0x14121c,!![]);}catch(_0x4ef155){return BPromise[_0x1c89('0x1d')](_0x4ef155);}return _0x43a17a[_0x1c89('0x1e')]();};}function saveUpdates(_0x253e07,_0x23def1){return function(_0x5b4fbc){if(_0x5b4fbc){return _0x5b4fbc[_0x1c89('0x1f')](_0x253e07)[_0x1c89('0x20')](function(_0x4fbd33){return _0x4fbd33;});}return null;};}function removeEntity(_0x45f604,_0x26a1cc){return function(_0x1ac0cc){if(_0x1ac0cc){return _0x1ac0cc['destroy']()[_0x1c89('0x20')](function(){_0x45f604[_0x1c89('0x16')](0xcc)[_0x1c89('0x15')]();});}};}function handleEntityNotFound(_0x59a87e,_0x22afe9){return function(_0x49f69b){if(!_0x49f69b){_0x59a87e['sendStatus'](0x194);}return _0x49f69b;};}function handleError(_0x35cc05,_0x352449){_0x352449=_0x352449||0x1f4;return function(_0x4c4694){logger['error'](_0x4c4694['stack']);if(_0x4c4694[_0x1c89('0x21')]){delete _0x4c4694['name'];}_0x35cc05['status'](_0x352449)[_0x1c89('0x22')](_0x4c4694);};}exports['index']=function(_0x193d8d,_0x51aa70){var _0x4dac46={},_0x25500d={},_0x10dc12={'count':0x0,'rows':[]};var _0x14f7cb=_['map'](db[_0x1c89('0x23')][_0x1c89('0x24')],function(_0x487916){return{'name':_0x487916[_0x1c89('0x25')],'type':_0x487916['type'][_0x1c89('0x26')]};});_0x25500d[_0x1c89('0x27')]=_[_0x1c89('0x28')](_0x14f7cb,_0x1c89('0x21'));_0x25500d[_0x1c89('0x29')]=_[_0x1c89('0x2a')](_0x193d8d[_0x1c89('0x29')]);_0x25500d[_0x1c89('0x2b')]=_[_0x1c89('0x2c')](_0x25500d[_0x1c89('0x27')],_0x25500d['query']);_0x4dac46[_0x1c89('0x2d')]=_['intersection'](_0x25500d['model'],qs[_0x1c89('0x2e')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x4dac46[_0x1c89('0x2d')]=_0x4dac46[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x4dac46[_0x1c89('0x2d')]:_0x25500d[_0x1c89('0x27')];if(!_0x193d8d[_0x1c89('0x29')][_0x1c89('0x30')](_0x1c89('0x31'))){_0x4dac46['limit']=qs['limit'](_0x193d8d[_0x1c89('0x29')]['limit']);_0x4dac46['offset']=qs[_0x1c89('0x17')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x17')]);}_0x4dac46[_0x1c89('0x32')]=qs[_0x1c89('0x33')](_0x193d8d[_0x1c89('0x29')][_0x1c89('0x33')]);_0x4dac46['where']=qs[_0x1c89('0x2b')](_[_0x1c89('0x34')](_0x193d8d['query'],_0x25500d[_0x1c89('0x2b')]),_0x14f7cb);if(_0x193d8d[_0x1c89('0x29')][_0x1c89('0x35')]){_0x4dac46[_0x1c89('0x36')]=_[_0x1c89('0x37')](_0x4dac46['where'],{'$or':_[_0x1c89('0x28')](_0x14f7cb,function(_0x2e6ebd){if(_0x2e6ebd[_0x1c89('0x38')]!=='VIRTUAL'){var _0xed5122={};_0xed5122[_0x2e6ebd['name']]={'$like':'%'+_0x193d8d[_0x1c89('0x29')]['filter']+'%'};return _0xed5122;}})});}_0x4dac46=_[_0x1c89('0x37')]({},_0x4dac46,_0x193d8d[_0x1c89('0x39')]);var _0x45152f={'where':_0x4dac46[_0x1c89('0x36')]};return db[_0x1c89('0x23')][_0x1c89('0x1a')](_0x45152f)[_0x1c89('0x20')](function(_0x1b8566){_0x10dc12[_0x1c89('0x1a')]=_0x1b8566;if(_0x193d8d['query'][_0x1c89('0x3a')]){_0x4dac46[_0x1c89('0x3b')]=[{'all':!![]}];}return db[_0x1c89('0x23')][_0x1c89('0x3c')](_0x4dac46);})['then'](function(_0x36e3a7){_0x10dc12[_0x1c89('0x3d')]=_0x36e3a7;return _0x10dc12;})[_0x1c89('0x20')](respondWithFilteredResult(_0x51aa70,_0x4dac46))['catch'](handleError(_0x51aa70,null));};exports['show']=function(_0xa1d4bb,_0x21fa5c){var _0x5f33c0={'raw':!![],'where':{'id':_0xa1d4bb[_0x1c89('0x3e')]['id']}},_0xebb4c3={};_0xebb4c3[_0x1c89('0x27')]=_[_0x1c89('0x2a')](db[_0x1c89('0x23')][_0x1c89('0x24')]);_0xebb4c3[_0x1c89('0x29')]=_['keys'](_0xa1d4bb[_0x1c89('0x29')]);_0xebb4c3['filters']=_['intersection'](_0xebb4c3[_0x1c89('0x27')],_0xebb4c3[_0x1c89('0x29')]);_0x5f33c0[_0x1c89('0x2d')]=_[_0x1c89('0x2c')](_0xebb4c3[_0x1c89('0x27')],qs[_0x1c89('0x2e')](_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x2e')]));_0x5f33c0[_0x1c89('0x2d')]=_0x5f33c0[_0x1c89('0x2d')][_0x1c89('0x2f')]?_0x5f33c0[_0x1c89('0x2d')]:_0xebb4c3[_0x1c89('0x27')];if(_0xa1d4bb[_0x1c89('0x29')][_0x1c89('0x3a')]){_0x5f33c0[_0x1c89('0x3b')]=[{'all':!![]}];}_0x5f33c0=_['merge']({},_0x5f33c0,_0xa1d4bb[_0x1c89('0x39')]);return db['ChatQueueReport']['find'](_0x5f33c0)[_0x1c89('0x20')](handleEntityNotFound(_0x21fa5c,null))['then'](respondWithResult(_0x21fa5c,null))['catch'](handleError(_0x21fa5c,null));};exports[_0x1c89('0x3f')]=function(_0x4b4d3f,_0x5f102d){return db['ChatQueueReport'][_0x1c89('0x3f')](_0x4b4d3f['body'],{})[_0x1c89('0x20')](respondWithResult(_0x5f102d,0xc9))['catch'](handleError(_0x5f102d,null));};exports[_0x1c89('0x1f')]=function(_0x5114bb,_0x36d5fc){if(_0x5114bb[_0x1c89('0x40')]['id']){delete _0x5114bb[_0x1c89('0x40')]['id'];}return db['ChatQueueReport'][_0x1c89('0x41')]({'where':{'id':_0x5114bb[_0x1c89('0x3e')]['id']}})['then'](handleEntityNotFound(_0x36d5fc,null))['then'](saveUpdates(_0x5114bb[_0x1c89('0x40')],null))[_0x1c89('0x20')](respondWithResult(_0x36d5fc,null))[_0x1c89('0x42')](handleError(_0x36d5fc,null));};exports[_0x1c89('0x43')]=function(_0x94f616,_0x392fdb){return db[_0x1c89('0x23')][_0x1c89('0x41')]({'where':{'id':_0x94f616[_0x1c89('0x3e')]['id']}})[_0x1c89('0x20')](handleEntityNotFound(_0x392fdb,null))[_0x1c89('0x20')](removeEntity(_0x392fdb,null))[_0x1c89('0x42')](handleError(_0x392fdb,null));};exports[_0x1c89('0x44')]=function(_0x111fb2,_0x190bf6){return db[_0x1c89('0x23')][_0x1c89('0x44')]()[_0x1c89('0x20')](respondWithResult(_0x190bf6,null))[_0x1c89('0x42')](handleError(_0x190bf6,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index f00bc63..129dc71 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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x378700,_0x12a40c){var _0x32cae8=function(_0x4ed271){while(--_0x4ed271){_0x378700['push'](_0x378700['shift']());}};_0x32cae8(++_0x12a40c);}(_0x757a,0xde));var _0xa757=function(_0x38bf77,_0x171cc1){_0x38bf77=_0x38bf77-0x0;var _0x45025d=_0x757a[_0x38bf77];return _0x45025d;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x20f756,_0x3b6c12){var _0xcf3c94=function(_0x1e9961){while(--_0x1e9961){_0x20f756['push'](_0x20f756['shift']());}};_0xcf3c94(++_0x3b6c12);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 8091ca0..f37b897 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 _0x589b=['attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','raw','debug','stringify','UpdateChatQueueReport','body','options','where'];(function(_0x13f729,_0x2689d0){var _0x5d1288=function(_0xd85899){while(--_0xd85899){_0x13f729['push'](_0x13f729['shift']());}};_0x5d1288(++_0x2689d0);}(_0x589b,0x97));var _0xb589=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x589b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb589('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb589('0x1'));var rs=require(_0xb589('0x2'));var fs=require('fs');var Redis=require(_0xb589('0x3'));var db=require(_0xb589('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb589('0x5'))('rpc');var config=require(_0xb589('0x6'));var jayson=require(_0xb589('0x7'));var client=jayson[_0xb589('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb4f0eb,_0x40b624,_0x2aa115){return new BPromise(function(_0xea2df5,_0x16e2eb){return client[_0xb589('0x9')](_0xb4f0eb,_0x2aa115)[_0xb589('0xa')](function(_0x985858){logger[_0xb589('0xb')](_0xb589('0xc'),_0x40b624,_0xb589('0xd'));logger['debug'](_0xb589('0xe'),_0x40b624,_0xb589('0xd'),JSON['stringify'](_0x985858));if(_0x985858[_0xb589('0xf')]){if(_0x985858['error']['code']===0x1f4){logger[_0xb589('0xf')](_0xb589('0xc'),_0x40b624,_0x985858['error'][_0xb589('0x10')]);return _0x16e2eb(_0x985858[_0xb589('0xf')]['message']);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x40b624,_0x985858[_0xb589('0xf')][_0xb589('0x10')]);return _0xea2df5(_0x985858['error'][_0xb589('0x10')]);}else{logger[_0xb589('0xb')](_0xb589('0xc'),_0x40b624,_0xb589('0xd'));_0xea2df5(_0x985858[_0xb589('0x11')]['message']);}})[_0xb589('0x12')](function(_0x458586){logger[_0xb589('0xf')](_0xb589('0xc'),_0x40b624,_0x458586);_0x16e2eb(_0x458586);});});}exports[_0xb589('0x13')]=function(_0x441e8b){var _0x4cab23=this;return new Promise(function(_0x340d7a,_0x682b56){return db[_0xb589('0x14')][_0xb589('0x15')](_0x441e8b['body'],{'raw':_0x441e8b['options']?_0x441e8b['options'][_0xb589('0x16')]===undefined?!![]:![]:!![]})[_0xb589('0xa')](function(_0x285f88){logger[_0xb589('0xb')](_0xb589('0x13'),_0x441e8b);logger[_0xb589('0x17')]('CreateChatQueueReport',_0x441e8b,JSON[_0xb589('0x18')](_0x285f88));_0x340d7a(_0x285f88);})['catch'](function(_0xd8b7ca){logger[_0xb589('0xf')](_0xb589('0x13'),_0xd8b7ca[_0xb589('0x10')],_0x441e8b);_0x682b56(_0x4cab23[_0xb589('0xf')](0x1f4,_0xd8b7ca[_0xb589('0x10')]));});});};exports[_0xb589('0x19')]=function(_0x48b2fd){var _0x252011=this;return new Promise(function(_0x44a8c8,_0x1e6248){return db[_0xb589('0x14')]['update'](_0x48b2fd[_0xb589('0x1a')],{'raw':_0x48b2fd[_0xb589('0x1b')]?_0x48b2fd[_0xb589('0x1b')][_0xb589('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48b2fd[_0xb589('0x1b')]?_0x48b2fd[_0xb589('0x1b')][_0xb589('0x1c')]||null:null,'attributes':_0x48b2fd[_0xb589('0x1b')]?_0x48b2fd[_0xb589('0x1b')][_0xb589('0x1d')]||null:null,'limit':_0x48b2fd['options']?_0x48b2fd['options']['limit']||null:null})['then'](function(_0x23e2fd){logger[_0xb589('0xb')](_0xb589('0x19'),_0x48b2fd);logger[_0xb589('0x17')](_0xb589('0x19'),_0x48b2fd,JSON[_0xb589('0x18')](_0x23e2fd));_0x44a8c8(_0x23e2fd);})[_0xb589('0x12')](function(_0x29e904){logger[_0xb589('0xf')](_0xb589('0x19'),_0x29e904[_0xb589('0x10')],_0x48b2fd);_0x1e6248(_0x252011[_0xb589('0xf')](0x1f4,_0x29e904[_0xb589('0x10')]));});});};
\ No newline at end of file
+var _0x1ec6=['error','message','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2731fa,_0x5c99ea){var _0x4bd4be=function(_0x397a7d){while(--_0x397a7d){_0x2731fa['push'](_0x2731fa['shift']());}};_0x4bd4be(++_0x5c99ea);}(_0x1ec6,0x158));var _0x61ec=function(_0x434323,_0x584fd5){_0x434323=_0x434323-0x0;var _0x2da586=_0x1ec6[_0x434323];return _0x2da586;};'use strict';var _=require(_0x61ec('0x0'));var util=require(_0x61ec('0x1'));var moment=require(_0x61ec('0x2'));var BPromise=require(_0x61ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61ec('0x4'));var db=require(_0x61ec('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x61ec('0x6'))(_0x61ec('0x7'));var config=require(_0x61ec('0x8'));var jayson=require(_0x61ec('0x9'));var client=jayson[_0x61ec('0xa')][_0x61ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38fa9e,_0x1f622f,_0x1ede63){return new BPromise(function(_0x477cb0,_0x4a95fa){return client['request'](_0x38fa9e,_0x1ede63)[_0x61ec('0xc')](function(_0x218c83){logger[_0x61ec('0xd')](_0x61ec('0xe'),_0x1f622f,_0x61ec('0xf'));logger[_0x61ec('0x10')](_0x61ec('0x11'),_0x1f622f,_0x61ec('0xf'),JSON[_0x61ec('0x12')](_0x218c83));if(_0x218c83[_0x61ec('0x13')]){if(_0x218c83[_0x61ec('0x13')]['code']===0x1f4){logger[_0x61ec('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x1f622f,_0x218c83['error'][_0x61ec('0x14')]);return _0x4a95fa(_0x218c83['error']['message']);}logger[_0x61ec('0x13')](_0x61ec('0xe'),_0x1f622f,_0x218c83[_0x61ec('0x13')][_0x61ec('0x14')]);return _0x477cb0(_0x218c83['error']['message']);}else{logger[_0x61ec('0xd')](_0x61ec('0xe'),_0x1f622f,_0x61ec('0xf'));_0x477cb0(_0x218c83['result'][_0x61ec('0x14')]);}})['catch'](function(_0x5ad163){logger[_0x61ec('0x13')](_0x61ec('0xe'),_0x1f622f,_0x5ad163);_0x4a95fa(_0x5ad163);});});}exports[_0x61ec('0x15')]=function(_0x331355){var _0x36079f=this;return new Promise(function(_0x55d2fb,_0x2c5e30){return db[_0x61ec('0x16')][_0x61ec('0x17')](_0x331355[_0x61ec('0x18')],{'raw':_0x331355[_0x61ec('0x19')]?_0x331355[_0x61ec('0x19')][_0x61ec('0x1a')]===undefined?!![]:![]:!![]})[_0x61ec('0xc')](function(_0x282358){logger[_0x61ec('0xd')](_0x61ec('0x15'),_0x331355);logger['debug']('CreateChatQueueReport',_0x331355,JSON[_0x61ec('0x12')](_0x282358));_0x55d2fb(_0x282358);})[_0x61ec('0x1b')](function(_0x214d70){logger[_0x61ec('0x13')](_0x61ec('0x15'),_0x214d70['message'],_0x331355);_0x2c5e30(_0x36079f[_0x61ec('0x13')](0x1f4,_0x214d70['message']));});});};exports[_0x61ec('0x1c')]=function(_0x4c154b){var _0x363136=this;return new Promise(function(_0x221ce4,_0x3fa159){return db[_0x61ec('0x16')][_0x61ec('0x1d')](_0x4c154b[_0x61ec('0x18')],{'raw':_0x4c154b[_0x61ec('0x19')]?_0x4c154b[_0x61ec('0x19')][_0x61ec('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c154b[_0x61ec('0x19')]?_0x4c154b['options'][_0x61ec('0x1e')]||null:null,'attributes':_0x4c154b[_0x61ec('0x19')]?_0x4c154b[_0x61ec('0x19')][_0x61ec('0x1f')]||null:null,'limit':_0x4c154b['options']?_0x4c154b[_0x61ec('0x19')][_0x61ec('0x20')]||null:null})[_0x61ec('0xc')](function(_0x4377de){logger[_0x61ec('0xd')](_0x61ec('0x1c'),_0x4c154b);logger[_0x61ec('0x10')](_0x61ec('0x1c'),_0x4c154b,JSON[_0x61ec('0x12')](_0x4377de));_0x221ce4(_0x4377de);})['catch'](function(_0x12a58e){logger[_0x61ec('0x13')](_0x61ec('0x1c'),_0x12a58e['message'],_0x4c154b);_0x3fa159(_0x363136[_0x61ec('0x13')](0x1f4,_0x12a58e[_0x61ec('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index e65073e..c2a9cf6 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 _0xe651=['/:id','show','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','get','/describe','isAuthenticated','describe'];(function(_0x1ef8d2,_0x43cf10){var _0x52fbdb=function(_0x18b2f5){while(--_0x18b2f5){_0x1ef8d2['push'](_0x1ef8d2['shift']());}};_0x52fbdb(++_0x43cf10);}(_0xe651,0x181));var _0x1e65=function(_0x3aeb9b,_0x3f3ff2){_0x3aeb9b=_0x3aeb9b-0x0;var _0x5e318f=_0xe651[_0x3aeb9b];return _0x5e318f;};'use strict';var multer=require(_0x1e65('0x0'));var util=require(_0x1e65('0x1'));var path=require(_0x1e65('0x2'));var timeout=require('connect-timeout');var express=require(_0x1e65('0x3'));var router=express[_0x1e65('0x4')]();var fs_extra=require(_0x1e65('0x5'));var auth=require(_0x1e65('0x6'));var interaction=require(_0x1e65('0x7'));var config=require(_0x1e65('0x8'));var controller=require(_0x1e65('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1e65('0xa')]);router[_0x1e65('0xb')](_0x1e65('0xc'),auth[_0x1e65('0xd')](),controller[_0x1e65('0xe')]);router['get'](_0x1e65('0xf'),auth['isAuthenticated'](),controller[_0x1e65('0x10')]);router['post']('/',auth[_0x1e65('0xd')](),controller['create']);router[_0x1e65('0x11')](_0x1e65('0xf'),auth[_0x1e65('0xd')](),controller['update']);router[_0x1e65('0x12')](_0x1e65('0xf'),auth[_0x1e65('0xd')](),controller['destroy']);module[_0x1e65('0x13')]=router;
\ No newline at end of file
+var _0x9fe7=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x34c4e1,_0x310387){var _0x5a11ef=function(_0x552f26){while(--_0x552f26){_0x34c4e1['push'](_0x34c4e1['shift']());}};_0x5a11ef(++_0x310387);}(_0x9fe7,0x127));var _0x79fe=function(_0x40a4ee,_0x515400){_0x40a4ee=_0x40a4ee-0x0;var _0x57c3cc=_0x9fe7[_0x40a4ee];return _0x57c3cc;};'use strict';var multer=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var path=require(_0x79fe('0x2'));var timeout=require(_0x79fe('0x3'));var express=require(_0x79fe('0x4'));var router=express[_0x79fe('0x5')]();var fs_extra=require(_0x79fe('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x79fe('0x7'));var config=require(_0x79fe('0x8'));var controller=require(_0x79fe('0x9'));router[_0x79fe('0xa')]('/',auth[_0x79fe('0xb')](),controller[_0x79fe('0xc')]);router[_0x79fe('0xa')]('/describe',auth[_0x79fe('0xb')](),controller[_0x79fe('0xd')]);router['get'](_0x79fe('0xe'),auth[_0x79fe('0xb')](),controller[_0x79fe('0xf')]);router['post']('/',auth[_0x79fe('0xb')](),controller['create']);router['put']('/:id',auth[_0x79fe('0xb')](),controller[_0x79fe('0x10')]);router[_0x79fe('0x11')](_0x79fe('0xe'),auth[_0x79fe('0xb')](),controller[_0x79fe('0x12')]);module[_0x79fe('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 8b3785b..2d8f1eb 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x244c80,_0x109821){var _0x1638c3=function(_0x441024){while(--_0x441024){_0x244c80['push'](_0x244c80['shift']());}};_0x1638c3(++_0x109821);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4dcd85,_0x26705e){_0x4dcd85=_0x4dcd85-0x0;var _0x13e45d=_0xf4eb[_0x4dcd85];return _0x13e45d;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x3a3b9e,_0xc59037){var _0x148103=function(_0x406731){while(--_0x406731){_0x3a3b9e['push'](_0x3a3b9e['shift']());}};_0x148103(++_0xc59037);}(_0x9bde,0xe1));var _0xe9bd=function(_0xe5263,_0x55fc4e){_0xe5263=_0xe5263-0x0;var _0x5bc69b=_0x9bde[_0xe5263];return _0x5bc69b;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 4b8c4e7..53dbb6f 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 _0x9ac4=['lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','map','ChatTransferReport','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','length','include','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','fs-extra'];(function(_0x1bfe2b,_0x34856e){var _0x1477d4=function(_0x1d558c){while(--_0x1d558c){_0x1bfe2b['push'](_0x1bfe2b['shift']());}};_0x1477d4(++_0x34856e);}(_0x9ac4,0x155));var _0x49ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ac4[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x49ac('0x0'));var rimraf=require(_0x49ac('0x1'));var zipdir=require(_0x49ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x49ac('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x49ac('0x4'));var util=require(_0x49ac('0x5'));var path=require(_0x49ac('0x6'));var sox=require('sox');var csv=require(_0x49ac('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x49ac('0x8'));var _=require(_0x49ac('0x9'));var squel=require(_0x49ac('0xa'));var crypto=require('crypto');var jsforce=require(_0x49ac('0xb'));var deskjs=require(_0x49ac('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x49ac('0xd'));var Redis=require(_0x49ac('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x49ac('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49ac('0x10'))(_0x49ac('0x11'));var utils=require('../../config/utils');var config=require(_0x49ac('0x12'));var licenseUtil=require(_0x49ac('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f32a3,_0x31a6c8){_0x31a6c8=_0x31a6c8||0xcc;return function(_0x57638c){if(_0x57638c){return _0x1f32a3[_0x49ac('0x14')](_0x31a6c8);}return _0x1f32a3[_0x49ac('0x15')](_0x31a6c8)[_0x49ac('0x16')]();};}function respondWithResult(_0x53c46b,_0x396106){_0x396106=_0x396106||0xc8;return function(_0x2862df){if(_0x2862df){return _0x53c46b[_0x49ac('0x15')](_0x396106)['json'](_0x2862df);}};}function respondWithFilteredResult(_0x20b903,_0x2bcae0){return function(_0x29ef86){if(_0x29ef86){var _0x255b52=typeof _0x2bcae0[_0x49ac('0x17')]===_0x49ac('0x18')&&typeof _0x2bcae0[_0x49ac('0x19')]===_0x49ac('0x18');var _0xa48071=_0x29ef86[_0x49ac('0x1a')];var _0xd7ea8a=_0x255b52?0x0:_0x2bcae0[_0x49ac('0x17')];var _0x9edd4a=_0x255b52?_0x29ef86['count']:_0x2bcae0[_0x49ac('0x17')]+_0x2bcae0[_0x49ac('0x19')];var _0x42c0be;if(_0x9edd4a>=_0xa48071){_0x9edd4a=_0xa48071;_0x42c0be=0xc8;}else{_0x42c0be=0xce;}_0x20b903[_0x49ac('0x15')](_0x42c0be);return _0x20b903[_0x49ac('0x1b')](_0x49ac('0x1c'),_0xd7ea8a+'-'+_0x9edd4a+'/'+_0xa48071)[_0x49ac('0x1d')](_0x29ef86);}return null;};}function patchUpdates(_0x485272){return function(_0x41eac7){try{jsonpatch[_0x49ac('0x1e')](_0x41eac7,_0x485272,!![]);}catch(_0xa13c42){return BPromise[_0x49ac('0x1f')](_0xa13c42);}return _0x41eac7['save']();};}function saveUpdates(_0x520a00,_0x244644){return function(_0xed01d5){if(_0xed01d5){return _0xed01d5[_0x49ac('0x20')](_0x520a00)['then'](function(_0xe436f0){return _0xe436f0;});}return null;};}function removeEntity(_0x726d0,_0x571186){return function(_0x3ed305){if(_0x3ed305){return _0x3ed305[_0x49ac('0x21')]()[_0x49ac('0x22')](function(){_0x726d0[_0x49ac('0x15')](0xcc)[_0x49ac('0x16')]();});}};}function handleEntityNotFound(_0x2677c2,_0x200bdc){return function(_0x489d73){if(!_0x489d73){_0x2677c2[_0x49ac('0x14')](0x194);}return _0x489d73;};}function handleError(_0x4700a5,_0x290e65){_0x290e65=_0x290e65||0x1f4;return function(_0x259986){logger[_0x49ac('0x23')](_0x259986[_0x49ac('0x24')]);if(_0x259986[_0x49ac('0x25')]){delete _0x259986[_0x49ac('0x25')];}_0x4700a5[_0x49ac('0x15')](_0x290e65)[_0x49ac('0x26')](_0x259986);};}exports['index']=function(_0x38d270,_0x15a533){var _0x2bfeca={},_0x3aeb7e={},_0x291143={'count':0x0,'rows':[]};var _0x14d254=_[_0x49ac('0x27')](db[_0x49ac('0x28')][_0x49ac('0x29')],function(_0x17e3cb){return{'name':_0x17e3cb['fieldName'],'type':_0x17e3cb[_0x49ac('0x2a')][_0x49ac('0x2b')]};});_0x3aeb7e['model']=_[_0x49ac('0x27')](_0x14d254,_0x49ac('0x25'));_0x3aeb7e[_0x49ac('0x2c')]=_[_0x49ac('0x2d')](_0x38d270[_0x49ac('0x2c')]);_0x3aeb7e[_0x49ac('0x2e')]=_['intersection'](_0x3aeb7e[_0x49ac('0x2f')],_0x3aeb7e[_0x49ac('0x2c')]);_0x2bfeca[_0x49ac('0x30')]=_[_0x49ac('0x31')](_0x3aeb7e[_0x49ac('0x2f')],qs[_0x49ac('0x32')](_0x38d270['query'][_0x49ac('0x32')]));_0x2bfeca[_0x49ac('0x30')]=_0x2bfeca[_0x49ac('0x30')]['length']?_0x2bfeca[_0x49ac('0x30')]:_0x3aeb7e[_0x49ac('0x2f')];if(!_0x38d270[_0x49ac('0x2c')]['hasOwnProperty'](_0x49ac('0x33'))){_0x2bfeca['limit']=qs[_0x49ac('0x19')](_0x38d270[_0x49ac('0x2c')]['limit']);_0x2bfeca['offset']=qs[_0x49ac('0x17')](_0x38d270[_0x49ac('0x2c')][_0x49ac('0x17')]);}_0x2bfeca['order']=qs[_0x49ac('0x34')](_0x38d270['query'][_0x49ac('0x34')]);_0x2bfeca[_0x49ac('0x35')]=qs[_0x49ac('0x2e')](_[_0x49ac('0x36')](_0x38d270[_0x49ac('0x2c')],_0x3aeb7e[_0x49ac('0x2e')]),_0x14d254);if(_0x38d270['query']['filter']){_0x2bfeca[_0x49ac('0x35')]=_[_0x49ac('0x37')](_0x2bfeca[_0x49ac('0x35')],{'$or':_[_0x49ac('0x27')](_0x14d254,function(_0xa4d0a4){if(_0xa4d0a4[_0x49ac('0x2a')]!==_0x49ac('0x38')){var _0x589828={};_0x589828[_0xa4d0a4[_0x49ac('0x25')]]={'$like':'%'+_0x38d270['query'][_0x49ac('0x39')]+'%'};return _0x589828;}})});}_0x2bfeca=_[_0x49ac('0x37')]({},_0x2bfeca,_0x38d270[_0x49ac('0x3a')]);var _0x38464c={'where':_0x2bfeca[_0x49ac('0x35')]};return db[_0x49ac('0x28')]['count'](_0x38464c)[_0x49ac('0x22')](function(_0x2dfd28){_0x291143[_0x49ac('0x1a')]=_0x2dfd28;if(_0x38d270[_0x49ac('0x2c')][_0x49ac('0x3b')]){_0x2bfeca['include']=[{'all':!![]}];}return db[_0x49ac('0x28')]['findAll'](_0x2bfeca);})[_0x49ac('0x22')](function(_0x25866c){_0x291143[_0x49ac('0x3c')]=_0x25866c;return _0x291143;})[_0x49ac('0x22')](respondWithFilteredResult(_0x15a533,_0x2bfeca))[_0x49ac('0x3d')](handleError(_0x15a533,null));};exports[_0x49ac('0x3e')]=function(_0x574cea,_0x3a667f){var _0x5459f9={'raw':!![],'where':{'id':_0x574cea[_0x49ac('0x3f')]['id']}},_0x529b03={};_0x529b03[_0x49ac('0x2f')]=_['keys'](db['ChatTransferReport'][_0x49ac('0x29')]);_0x529b03[_0x49ac('0x2c')]=_[_0x49ac('0x2d')](_0x574cea[_0x49ac('0x2c')]);_0x529b03[_0x49ac('0x2e')]=_[_0x49ac('0x31')](_0x529b03[_0x49ac('0x2f')],_0x529b03[_0x49ac('0x2c')]);_0x5459f9[_0x49ac('0x30')]=_['intersection'](_0x529b03[_0x49ac('0x2f')],qs['fields'](_0x574cea[_0x49ac('0x2c')][_0x49ac('0x32')]));_0x5459f9[_0x49ac('0x30')]=_0x5459f9[_0x49ac('0x30')][_0x49ac('0x40')]?_0x5459f9[_0x49ac('0x30')]:_0x529b03[_0x49ac('0x2f')];if(_0x574cea[_0x49ac('0x2c')][_0x49ac('0x3b')]){_0x5459f9[_0x49ac('0x41')]=[{'all':!![]}];}_0x5459f9=_['merge']({},_0x5459f9,_0x574cea[_0x49ac('0x3a')]);return db[_0x49ac('0x28')]['find'](_0x5459f9)[_0x49ac('0x22')](handleEntityNotFound(_0x3a667f,null))[_0x49ac('0x22')](respondWithResult(_0x3a667f,null))[_0x49ac('0x3d')](handleError(_0x3a667f,null));};exports['create']=function(_0x1d24f6,_0x51fc22){return db['ChatTransferReport'][_0x49ac('0x42')](_0x1d24f6['body'],{})['then'](respondWithResult(_0x51fc22,0xc9))[_0x49ac('0x3d')](handleError(_0x51fc22,null));};exports[_0x49ac('0x20')]=function(_0x44be05,_0x57ee4a){if(_0x44be05[_0x49ac('0x43')]['id']){delete _0x44be05[_0x49ac('0x43')]['id'];}return db[_0x49ac('0x28')][_0x49ac('0x44')]({'where':{'id':_0x44be05[_0x49ac('0x3f')]['id']}})[_0x49ac('0x22')](handleEntityNotFound(_0x57ee4a,null))[_0x49ac('0x22')](saveUpdates(_0x44be05[_0x49ac('0x43')],null))[_0x49ac('0x22')](respondWithResult(_0x57ee4a,null))[_0x49ac('0x3d')](handleError(_0x57ee4a,null));};exports[_0x49ac('0x21')]=function(_0x4d6ee3,_0x470016){return db[_0x49ac('0x28')]['find']({'where':{'id':_0x4d6ee3[_0x49ac('0x3f')]['id']}})[_0x49ac('0x22')](handleEntityNotFound(_0x470016,null))[_0x49ac('0x22')](removeEntity(_0x470016,null))[_0x49ac('0x3d')](handleError(_0x470016,null));};exports['describe']=function(_0xb4767f,_0x21992d){return db[_0x49ac('0x28')][_0x49ac('0x45')]()[_0x49ac('0x22')](respondWithResult(_0x21992d,null))['catch'](handleError(_0x21992d,null));};
\ No newline at end of file
+var _0x9471=['count','offset','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','filter','rows','catch','show','params','includeAll','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','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','json','undefined','limit'];(function(_0x4b5c29,_0x555621){var _0x1834ff=function(_0x5256f0){while(--_0x5256f0){_0x4b5c29['push'](_0x4b5c29['shift']());}};_0x1834ff(++_0x555621);}(_0x9471,0x1ad));var _0x1947=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9471[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1947('0x0'));var rimraf=require(_0x1947('0x1'));var zipdir=require(_0x1947('0x2'));var jsonpatch=require(_0x1947('0x3'));var rp=require(_0x1947('0x4'));var moment=require(_0x1947('0x5'));var BPromise=require(_0x1947('0x6'));var Mustache=require(_0x1947('0x7'));var util=require(_0x1947('0x8'));var path=require(_0x1947('0x9'));var sox=require(_0x1947('0xa'));var csv=require(_0x1947('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1947('0xc'));var _=require(_0x1947('0xd'));var squel=require(_0x1947('0xe'));var crypto=require(_0x1947('0xf'));var jsforce=require(_0x1947('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1947('0xb'));var querystring=require(_0x1947('0x11'));var Papa=require(_0x1947('0x12'));var Redis=require(_0x1947('0x13'));var authService=require(_0x1947('0x14'));var qs=require(_0x1947('0x15'));var as=require(_0x1947('0x16'));var hardwareService=require(_0x1947('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x1947('0x18'));var config=require(_0x1947('0x19'));var licenseUtil=require(_0x1947('0x1a'));var db=require(_0x1947('0x1b'))['db'];function respondWithStatusCode(_0x1d1577,_0x333851){_0x333851=_0x333851||0xcc;return function(_0x27beae){if(_0x27beae){return _0x1d1577[_0x1947('0x1c')](_0x333851);}return _0x1d1577[_0x1947('0x1d')](_0x333851)['end']();};}function respondWithResult(_0x738033,_0x15f2b4){_0x15f2b4=_0x15f2b4||0xc8;return function(_0x353f53){if(_0x353f53){return _0x738033[_0x1947('0x1d')](_0x15f2b4)[_0x1947('0x1e')](_0x353f53);}};}function respondWithFilteredResult(_0x58963c,_0x56a221){return function(_0x2abff4){if(_0x2abff4){var _0x41b26f=typeof _0x56a221['offset']===_0x1947('0x1f')&&typeof _0x56a221[_0x1947('0x20')]==='undefined';var _0x19bb3c=_0x2abff4[_0x1947('0x21')];var _0x80e9bc=_0x41b26f?0x0:_0x56a221[_0x1947('0x22')];var _0x4f6737=_0x41b26f?_0x2abff4['count']:_0x56a221[_0x1947('0x22')]+_0x56a221[_0x1947('0x20')];var _0x4dc72e;if(_0x4f6737>=_0x19bb3c){_0x4f6737=_0x19bb3c;_0x4dc72e=0xc8;}else{_0x4dc72e=0xce;}_0x58963c[_0x1947('0x1d')](_0x4dc72e);return _0x58963c['set'](_0x1947('0x23'),_0x80e9bc+'-'+_0x4f6737+'/'+_0x19bb3c)['json'](_0x2abff4);}return null;};}function patchUpdates(_0x5a5a46){return function(_0x47e8a6){try{jsonpatch[_0x1947('0x24')](_0x47e8a6,_0x5a5a46,!![]);}catch(_0x2bbe51){return BPromise[_0x1947('0x25')](_0x2bbe51);}return _0x47e8a6[_0x1947('0x26')]();};}function saveUpdates(_0x5c6576,_0x8d0357){return function(_0x5273f8){if(_0x5273f8){return _0x5273f8['update'](_0x5c6576)[_0x1947('0x27')](function(_0x5ed018){return _0x5ed018;});}return null;};}function removeEntity(_0x44a8f8,_0x1a3066){return function(_0x32137e){if(_0x32137e){return _0x32137e['destroy']()[_0x1947('0x27')](function(){_0x44a8f8['status'](0xcc)[_0x1947('0x28')]();});}};}function handleEntityNotFound(_0x323b1e,_0x6124f4){return function(_0x4fad0b){if(!_0x4fad0b){_0x323b1e['sendStatus'](0x194);}return _0x4fad0b;};}function handleError(_0x174566,_0x5bf602){_0x5bf602=_0x5bf602||0x1f4;return function(_0x2eb27d){logger[_0x1947('0x29')](_0x2eb27d[_0x1947('0x2a')]);if(_0x2eb27d[_0x1947('0x2b')]){delete _0x2eb27d[_0x1947('0x2b')];}_0x174566[_0x1947('0x1d')](_0x5bf602)[_0x1947('0x2c')](_0x2eb27d);};}exports[_0x1947('0x2d')]=function(_0x31ed42,_0x43cb75){var _0x56db17={},_0x2fe9ed={},_0x24d111={'count':0x0,'rows':[]};var _0x40a0a5=_[_0x1947('0x2e')](db[_0x1947('0x2f')][_0x1947('0x30')],function(_0xbc0a04){return{'name':_0xbc0a04[_0x1947('0x31')],'type':_0xbc0a04[_0x1947('0x32')]['key']};});_0x2fe9ed[_0x1947('0x33')]=_[_0x1947('0x2e')](_0x40a0a5,_0x1947('0x2b'));_0x2fe9ed[_0x1947('0x34')]=_[_0x1947('0x35')](_0x31ed42[_0x1947('0x34')]);_0x2fe9ed[_0x1947('0x36')]=_[_0x1947('0x37')](_0x2fe9ed[_0x1947('0x33')],_0x2fe9ed[_0x1947('0x34')]);_0x56db17['attributes']=_[_0x1947('0x37')](_0x2fe9ed['model'],qs['fields'](_0x31ed42[_0x1947('0x34')][_0x1947('0x38')]));_0x56db17[_0x1947('0x39')]=_0x56db17['attributes'][_0x1947('0x3a')]?_0x56db17[_0x1947('0x39')]:_0x2fe9ed[_0x1947('0x33')];if(!_0x31ed42[_0x1947('0x34')][_0x1947('0x3b')]('nolimit')){_0x56db17[_0x1947('0x20')]=qs[_0x1947('0x20')](_0x31ed42[_0x1947('0x34')]['limit']);_0x56db17[_0x1947('0x22')]=qs[_0x1947('0x22')](_0x31ed42[_0x1947('0x34')][_0x1947('0x22')]);}_0x56db17[_0x1947('0x3c')]=qs[_0x1947('0x3d')](_0x31ed42[_0x1947('0x34')][_0x1947('0x3d')]);_0x56db17[_0x1947('0x3e')]=qs['filters'](_[_0x1947('0x3f')](_0x31ed42[_0x1947('0x34')],_0x2fe9ed[_0x1947('0x36')]),_0x40a0a5);if(_0x31ed42[_0x1947('0x34')]['filter']){_0x56db17[_0x1947('0x3e')]=_[_0x1947('0x40')](_0x56db17['where'],{'$or':_['map'](_0x40a0a5,function(_0x5b0a24){if(_0x5b0a24[_0x1947('0x32')]!=='VIRTUAL'){var _0x3e95b0={};_0x3e95b0[_0x5b0a24['name']]={'$like':'%'+_0x31ed42['query'][_0x1947('0x41')]+'%'};return _0x3e95b0;}})});}_0x56db17=_[_0x1947('0x40')]({},_0x56db17,_0x31ed42['options']);var _0x15fc96={'where':_0x56db17[_0x1947('0x3e')]};return db[_0x1947('0x2f')][_0x1947('0x21')](_0x15fc96)[_0x1947('0x27')](function(_0xfe21ff){_0x24d111[_0x1947('0x21')]=_0xfe21ff;if(_0x31ed42['query']['includeAll']){_0x56db17['include']=[{'all':!![]}];}return db[_0x1947('0x2f')]['findAll'](_0x56db17);})[_0x1947('0x27')](function(_0x5542ff){_0x24d111[_0x1947('0x42')]=_0x5542ff;return _0x24d111;})[_0x1947('0x27')](respondWithFilteredResult(_0x43cb75,_0x56db17))[_0x1947('0x43')](handleError(_0x43cb75,null));};exports[_0x1947('0x44')]=function(_0x2299dc,_0x44b809){var _0x4c179c={'raw':!![],'where':{'id':_0x2299dc[_0x1947('0x45')]['id']}},_0x2934d2={};_0x2934d2[_0x1947('0x33')]=_[_0x1947('0x35')](db[_0x1947('0x2f')][_0x1947('0x30')]);_0x2934d2[_0x1947('0x34')]=_['keys'](_0x2299dc[_0x1947('0x34')]);_0x2934d2[_0x1947('0x36')]=_[_0x1947('0x37')](_0x2934d2[_0x1947('0x33')],_0x2934d2[_0x1947('0x34')]);_0x4c179c['attributes']=_[_0x1947('0x37')](_0x2934d2['model'],qs['fields'](_0x2299dc[_0x1947('0x34')][_0x1947('0x38')]));_0x4c179c[_0x1947('0x39')]=_0x4c179c[_0x1947('0x39')]['length']?_0x4c179c[_0x1947('0x39')]:_0x2934d2[_0x1947('0x33')];if(_0x2299dc['query'][_0x1947('0x46')]){_0x4c179c['include']=[{'all':!![]}];}_0x4c179c=_[_0x1947('0x40')]({},_0x4c179c,_0x2299dc[_0x1947('0x47')]);return db[_0x1947('0x2f')][_0x1947('0x48')](_0x4c179c)[_0x1947('0x27')](handleEntityNotFound(_0x44b809,null))['then'](respondWithResult(_0x44b809,null))[_0x1947('0x43')](handleError(_0x44b809,null));};exports[_0x1947('0x49')]=function(_0x5cfc3b,_0x575b52){return db[_0x1947('0x2f')][_0x1947('0x49')](_0x5cfc3b[_0x1947('0x4a')],{})['then'](respondWithResult(_0x575b52,0xc9))[_0x1947('0x43')](handleError(_0x575b52,null));};exports['update']=function(_0x4c1482,_0x5656b1){if(_0x4c1482['body']['id']){delete _0x4c1482[_0x1947('0x4a')]['id'];}return db[_0x1947('0x2f')]['find']({'where':{'id':_0x4c1482[_0x1947('0x45')]['id']}})[_0x1947('0x27')](handleEntityNotFound(_0x5656b1,null))[_0x1947('0x27')](saveUpdates(_0x4c1482[_0x1947('0x4a')],null))[_0x1947('0x27')](respondWithResult(_0x5656b1,null))[_0x1947('0x43')](handleError(_0x5656b1,null));};exports[_0x1947('0x4b')]=function(_0x205f48,_0x5a87ff){return db[_0x1947('0x2f')]['find']({'where':{'id':_0x205f48[_0x1947('0x45')]['id']}})['then'](handleEntityNotFound(_0x5a87ff,null))['then'](removeEntity(_0x5a87ff,null))[_0x1947('0x43')](handleError(_0x5a87ff,null));};exports[_0x1947('0x4c')]=function(_0x42407c,_0x1775b9){return db[_0x1947('0x2f')][_0x1947('0x4c')]()['then'](respondWithResult(_0x1775b9,null))[_0x1947('0x43')](handleError(_0x1775b9,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 720b968..0218ab3 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 _0x6ece=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define'];(function(_0x34f754,_0x278292){var _0x1aa043=function(_0x108886){while(--_0x108886){_0x34f754['push'](_0x34f754['shift']());}};_0x1aa043(++_0x278292);}(_0x6ece,0xc7));var _0xe6ec=function(_0xdfd02,_0xd54770){_0xdfd02=_0xdfd02-0x0;var _0x580054=_0x6ece[_0xdfd02];return _0x580054;};'use strict';var _=require(_0xe6ec('0x0'));var util=require(_0xe6ec('0x1'));var logger=require(_0xe6ec('0x2'))(_0xe6ec('0x3'));var moment=require(_0xe6ec('0x4'));var BPromise=require('bluebird');var rp=require(_0xe6ec('0x5'));var fs=require('fs');var path=require(_0xe6ec('0x6'));var rimraf=require(_0xe6ec('0x7'));var config=require('../../config/environment');var attributes=require(_0xe6ec('0x8'));module[_0xe6ec('0x9')]=function(_0x4f26ea,_0x55afda){return _0x4f26ea[_0xe6ec('0xa')](_0xe6ec('0xb'),attributes,{'tableName':_0xe6ec('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe6ec('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c2b=['ChatTransferReport','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports'];(function(_0x9ae292,_0x130cef){var _0xadefdd=function(_0x4506a0){while(--_0x4506a0){_0x9ae292['push'](_0x9ae292['shift']());}};_0xadefdd(++_0x130cef);}(_0x5c2b,0x137));var _0xb5c2=function(_0xf1579,_0x16ada1){_0xf1579=_0xf1579-0x0;var _0x588de2=_0x5c2b[_0xf1579];return _0x588de2;};'use strict';var _=require(_0xb5c2('0x0'));var util=require(_0xb5c2('0x1'));var logger=require(_0xb5c2('0x2'))(_0xb5c2('0x3'));var moment=require(_0xb5c2('0x4'));var BPromise=require('bluebird');var rp=require(_0xb5c2('0x5'));var fs=require('fs');var path=require(_0xb5c2('0x6'));var rimraf=require(_0xb5c2('0x7'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0xb5c2('0x8')]=function(_0x1de052,_0x4e0c73){return _0x1de052['define'](_0xb5c2('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 0019618..da43d93 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 _0xef7a=['jayson/promise','http','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x17a29e,_0x242d8c){var _0x26f32e=function(_0x504e74){while(--_0x504e74){_0x17a29e['push'](_0x17a29e['shift']());}};_0x26f32e(++_0x242d8c);}(_0xef7a,0x199));var _0xaef7=function(_0x5b323e,_0x137407){_0x5b323e=_0x5b323e-0x0;var _0x4fa5df=_0xef7a[_0x5b323e];return _0x4fa5df;};'use strict';var _=require(_0xaef7('0x0'));var util=require(_0xaef7('0x1'));var moment=require(_0xaef7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaef7('0x3'));var db=require(_0xaef7('0x4'))['db'];var utils=require(_0xaef7('0x5'));var logger=require(_0xaef7('0x6'))(_0xaef7('0x7'));var config=require(_0xaef7('0x8'));var jayson=require(_0xaef7('0x9'));var client=jayson['client'][_0xaef7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4949ed,_0x20270e,_0x30f729){return new BPromise(function(_0x486655,_0x34e89a){return client[_0xaef7('0xb')](_0x4949ed,_0x30f729)['then'](function(_0x1b0e87){logger['info'](_0xaef7('0xc'),_0x20270e,_0xaef7('0xd'));logger[_0xaef7('0xe')](_0xaef7('0xf'),_0x20270e,_0xaef7('0xd'),JSON['stringify'](_0x1b0e87));if(_0x1b0e87[_0xaef7('0x10')]){if(_0x1b0e87[_0xaef7('0x10')][_0xaef7('0x11')]===0x1f4){logger[_0xaef7('0x10')](_0xaef7('0xc'),_0x20270e,_0x1b0e87['error'][_0xaef7('0x12')]);return _0x34e89a(_0x1b0e87[_0xaef7('0x10')]['message']);}logger[_0xaef7('0x10')](_0xaef7('0xc'),_0x20270e,_0x1b0e87[_0xaef7('0x10')]['message']);return _0x486655(_0x1b0e87['error']['message']);}else{logger[_0xaef7('0x13')](_0xaef7('0xc'),_0x20270e,'request\x20sent');_0x486655(_0x1b0e87[_0xaef7('0x14')]['message']);}})[_0xaef7('0x15')](function(_0x5dd976){logger[_0xaef7('0x10')](_0xaef7('0xc'),_0x20270e,_0x5dd976);_0x34e89a(_0x5dd976);});});}
\ No newline at end of file
+var _0xa514=['request','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4dca38,_0x5dfae1){var _0x44656c=function(_0x538a62){while(--_0x538a62){_0x4dca38['push'](_0x4dca38['shift']());}};_0x44656c(++_0x5dfae1);}(_0xa514,0x1e3));var _0x4a51=function(_0x5bc14b,_0x1d00da){_0x5bc14b=_0x5bc14b-0x0;var _0x203e6d=_0xa514[_0x5bc14b];return _0x203e6d;};'use strict';var _=require(_0x4a51('0x0'));var util=require('util');var moment=require(_0x4a51('0x1'));var BPromise=require(_0x4a51('0x2'));var rs=require(_0x4a51('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a51('0x5'))(_0x4a51('0x6'));var config=require(_0x4a51('0x7'));var jayson=require(_0x4a51('0x8'));var client=jayson[_0x4a51('0x9')][_0x4a51('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x129ed2,_0x302143,_0x194da){return new BPromise(function(_0xbfe70b,_0x2761de){return client[_0x4a51('0xb')](_0x129ed2,_0x194da)['then'](function(_0x25a553){logger['info'](_0x4a51('0xc'),_0x302143,'request\x20sent');logger[_0x4a51('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x302143,_0x4a51('0xe'),JSON['stringify'](_0x25a553));if(_0x25a553[_0x4a51('0xf')]){if(_0x25a553[_0x4a51('0xf')]['code']===0x1f4){logger[_0x4a51('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x302143,_0x25a553[_0x4a51('0xf')][_0x4a51('0x10')]);return _0x2761de(_0x25a553[_0x4a51('0xf')][_0x4a51('0x10')]);}logger[_0x4a51('0xf')](_0x4a51('0xc'),_0x302143,_0x25a553[_0x4a51('0xf')][_0x4a51('0x10')]);return _0xbfe70b(_0x25a553[_0x4a51('0xf')]['message']);}else{logger[_0x4a51('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x302143,_0x4a51('0xe'));_0xbfe70b(_0x25a553[_0x4a51('0x12')]['message']);}})['catch'](function(_0x1285fc){logger[_0x4a51('0xf')](_0x4a51('0xc'),_0x302143,_0x1285fc);_0x2761de(_0x1285fc);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index a294765..4b9acdc 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 _0xbdc0=['isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x201d3d,_0x5e4db3){var _0x9b08db=function(_0x18b5ef){while(--_0x18b5ef){_0x201d3d['push'](_0x201d3d['shift']());}};_0x9b08db(++_0x5e4db3);}(_0xbdc0,0xfe));var _0x0bdc=function(_0x1461fd,_0x4a6c68){_0x1461fd=_0x1461fd-0x0;var _0xffefac=_0xbdc0[_0x1461fd];return _0xffefac;};'use strict';var multer=require(_0x0bdc('0x0'));var util=require(_0x0bdc('0x1'));var path=require(_0x0bdc('0x2'));var timeout=require(_0x0bdc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0bdc('0x4'));var auth=require(_0x0bdc('0x5'));var interaction=require(_0x0bdc('0x6'));var config=require(_0x0bdc('0x7'));var controller=require(_0x0bdc('0x8'));router[_0x0bdc('0x9')]('/',auth[_0x0bdc('0xa')](),controller[_0x0bdc('0xb')]);router[_0x0bdc('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x0bdc('0xc')]);router[_0x0bdc('0x9')](_0x0bdc('0xd'),auth['isAuthenticated'](),controller[_0x0bdc('0xe')]);router[_0x0bdc('0xf')]('/',auth[_0x0bdc('0xa')](),controller[_0x0bdc('0x10')]);router[_0x0bdc('0x11')](_0x0bdc('0xd'),auth[_0x0bdc('0xa')](),controller[_0x0bdc('0x12')]);router[_0x0bdc('0x13')](_0x0bdc('0xd'),auth['isAuthenticated'](),controller[_0x0bdc('0x14')]);module[_0x0bdc('0x15')]=router;
\ No newline at end of file
+var _0x0cb3=['delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','/:id','update'];(function(_0x3f8106,_0x6cccc0){var _0x12879b=function(_0x52739d){while(--_0x52739d){_0x3f8106['push'](_0x3f8106['shift']());}};_0x12879b(++_0x6cccc0);}(_0x0cb3,0x107));var _0x30cb=function(_0x2d0336,_0x391f39){_0x2d0336=_0x2d0336-0x0;var _0x3061e5=_0x0cb3[_0x2d0336];return _0x3061e5;};'use strict';var multer=require(_0x30cb('0x0'));var util=require(_0x30cb('0x1'));var path=require('path');var timeout=require(_0x30cb('0x2'));var express=require('express');var router=express[_0x30cb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x30cb('0x4'));var interaction=require(_0x30cb('0x5'));var config=require('../../config/environment');var controller=require(_0x30cb('0x6'));router['get']('/',auth[_0x30cb('0x7')](),controller[_0x30cb('0x8')]);router[_0x30cb('0x9')](_0x30cb('0xa'),auth[_0x30cb('0x7')](),controller[_0x30cb('0xb')]);router[_0x30cb('0x9')]('/:id',auth[_0x30cb('0x7')](),controller[_0x30cb('0xc')]);router[_0x30cb('0xd')]('/',auth[_0x30cb('0x7')](),controller[_0x30cb('0xe')]);router['put'](_0x30cb('0xf'),auth[_0x30cb('0x7')](),controller[_0x30cb('0x10')]);router[_0x30cb('0x11')](_0x30cb('0xf'),auth[_0x30cb('0x7')](),controller[_0x30cb('0x12')]);module[_0x30cb('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 99fcae5..1502a45 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 _0x153f=['Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us'];(function(_0xcea0a5,_0x3c5bae){var _0x5f07cc=function(_0x391b07){while(--_0x391b07){_0xcea0a5['push'](_0xcea0a5['shift']());}};_0x5f07cc(++_0x3c5bae);}(_0x153f,0x15b));var _0xf153=function(_0x2cd460,_0x213be7){_0x2cd460=_0x2cd460-0x0;var _0xed01b=_0x153f[_0x2cd460];return _0xed01b;};'use strict';var Sequelize=require(_0xf153('0x0'));var rs=require(_0xf153('0x1'));module[_0xf153('0x2')]={'name':{'type':Sequelize[_0xf153('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xf153('0x3')],'allowNull':![],'unique':_0xf153('0x4')},'description':{'type':Sequelize[_0xf153('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf153('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xf153('0x5')},'key':{'type':Sequelize[_0xf153('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x6')},'customerAlias':{'type':Sequelize[_0xf153('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf153('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf153('0x3')],'allowNull':![],'defaultValue':_0xf153('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf153('0x3')],'allowNull':![],'defaultValue':_0xf153('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xf153('0x3')],'allowNull':![],'defaultValue':_0xf153('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf153('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf153('0x3')]},'animation':{'type':Sequelize[_0xf153('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xf153('0xb'),_0xf153('0xc')),'defaultValue':_0xf153('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xf153('0xd')},'start_chat_button':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0xe')},'offline_chat_button':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0xf')},'header_offline':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x10')},'download_transcript':{'type':Sequelize[_0xf153('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf153('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xf153('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0xf153('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf153('0x12')]},'closingQuestion':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x14')},'formSubmitFailureMessage':{'type':Sequelize[_0xf153('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xf153('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x15')},'closingMessage':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf153('0xf')},'skipMessageButton':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x17')},'conditionAgreement':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x18')},'ratingType':{'type':Sequelize[_0xf153('0x19')](_0xf153('0x1a'),_0xf153('0x1b')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xf153('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf153('0x12')],'defaultValue':function(){return JSON[_0xf153('0x1c')]({'items':[{'type':_0xf153('0x1d'),'variable':null,'config':{'placeholder':_0xf153('0x1e'),'type':_0xf153('0x1f'),'required':!![]},'props':{'title':_0xf153('0x1e'),'helpText':''}},{'type':_0xf153('0x1d'),'props':{'title':_0xf153('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xf153('0x5'),'type':_0xf153('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf153('0x20')](_0xf153('0x21'))?JSON[_0xf153('0x22')](this[_0xf153('0x20')](_0xf153('0x21'))):{};},'set':function(_0x141ef4){return this[_0xf153('0x23')](_0xf153('0x21'),JSON[_0xf153('0x1c')](_0x141ef4));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf153('0x1c')]({'items':[{'type':_0xf153('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf153('0x5'),'type':_0xf153('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xf153('0x24')},'props':{'title':_0xf153('0x24'),'helpText':_0xf153('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0xf153('0x20')](_0xf153('0x26'))?JSON[_0xf153('0x22')](this[_0xf153('0x20')](_0xf153('0x26'))):{};},'set':function(_0x19a568){return this[_0xf153('0x23')](_0xf153('0x26'),JSON[_0xf153('0x1c')](_0x19a568));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf153('0x27')]();}},'autoclose':{'type':Sequelize[_0xf153('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf153('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xf153('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf153('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x29')},'skipUnmanaged':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x17')},'sendUnmanaged':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf153('0x3')]},'notificationTemplate':{'type':Sequelize[_0xf153('0x12')],'defaultValue':function(){return _0xf153('0x2a');}},'notificationSound':{'type':Sequelize[_0xf153('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf153('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xf153('0x2c')},'verticalAlignment':{'type':Sequelize[_0xf153('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x2d')},'messagesAlignment':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xf153('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf153('0x3')],'allowNull':![],'defaultValue':_0xf153('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf153('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf153('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf153('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xf153('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf153('0x9')],'comment':_0xf153('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![],'comment':_0xf153('0x31'),'set':function(_0x1ee606){if(!_0x1ee606)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xf153('0x23')]('mandatoryDisposition',_0x1ee606);}},'vidaooEscalation':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf153('0x3')]},'vidaooTopic':{'type':Sequelize[_0xf153('0x3')],'allowNull':![],'defaultValue':_0xf153('0x32')},'vidaooNote':{'type':Sequelize[_0xf153('0x3')],'defaultValue':function(){return _0xf153('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf153('0x12')]}};
\ No newline at end of file
+var _0x153f=['Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us'];(function(_0x3d934a,_0x56daac){var _0x22db26=function(_0x1c5a3f){while(--_0x1c5a3f){_0x3d934a['push'](_0x3d934a['shift']());}};_0x22db26(++_0x56daac);}(_0x153f,0x15b));var _0xf153=function(_0x1f2a49,_0x33b9b7){_0x1f2a49=_0x1f2a49-0x0;var _0x2df203=_0x153f[_0x1f2a49];return _0x2df203;};'use strict';var Sequelize=require(_0xf153('0x0'));var rs=require(_0xf153('0x1'));module[_0xf153('0x2')]={'name':{'type':Sequelize[_0xf153('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xf153('0x3')],'allowNull':![],'unique':_0xf153('0x4')},'description':{'type':Sequelize[_0xf153('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf153('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xf153('0x5')},'key':{'type':Sequelize[_0xf153('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x6')},'customerAlias':{'type':Sequelize[_0xf153('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf153('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf153('0x3')],'allowNull':![],'defaultValue':_0xf153('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf153('0x3')],'allowNull':![],'defaultValue':_0xf153('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xf153('0x3')],'allowNull':![],'defaultValue':_0xf153('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf153('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf153('0x3')]},'animation':{'type':Sequelize[_0xf153('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xf153('0xb'),_0xf153('0xc')),'defaultValue':_0xf153('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xf153('0xd')},'start_chat_button':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0xe')},'offline_chat_button':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0xf')},'header_offline':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x10')},'download_transcript':{'type':Sequelize[_0xf153('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf153('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xf153('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0xf153('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf153('0x12')]},'closingQuestion':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x14')},'formSubmitFailureMessage':{'type':Sequelize[_0xf153('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xf153('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x15')},'closingMessage':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf153('0xf')},'skipMessageButton':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x17')},'conditionAgreement':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x18')},'ratingType':{'type':Sequelize[_0xf153('0x19')](_0xf153('0x1a'),_0xf153('0x1b')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xf153('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf153('0x12')],'defaultValue':function(){return JSON[_0xf153('0x1c')]({'items':[{'type':_0xf153('0x1d'),'variable':null,'config':{'placeholder':_0xf153('0x1e'),'type':_0xf153('0x1f'),'required':!![]},'props':{'title':_0xf153('0x1e'),'helpText':''}},{'type':_0xf153('0x1d'),'props':{'title':_0xf153('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xf153('0x5'),'type':_0xf153('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf153('0x20')](_0xf153('0x21'))?JSON[_0xf153('0x22')](this[_0xf153('0x20')](_0xf153('0x21'))):{};},'set':function(_0x141ef4){return this[_0xf153('0x23')](_0xf153('0x21'),JSON[_0xf153('0x1c')](_0x141ef4));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf153('0x1c')]({'items':[{'type':_0xf153('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf153('0x5'),'type':_0xf153('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xf153('0x24')},'props':{'title':_0xf153('0x24'),'helpText':_0xf153('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0xf153('0x20')](_0xf153('0x26'))?JSON[_0xf153('0x22')](this[_0xf153('0x20')](_0xf153('0x26'))):{};},'set':function(_0x19a568){return this[_0xf153('0x23')](_0xf153('0x26'),JSON[_0xf153('0x1c')](_0x19a568));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf153('0x27')]();}},'autoclose':{'type':Sequelize[_0xf153('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf153('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xf153('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf153('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x29')},'skipUnmanaged':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x17')},'sendUnmanaged':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf153('0x3')]},'notificationTemplate':{'type':Sequelize[_0xf153('0x12')],'defaultValue':function(){return _0xf153('0x2a');}},'notificationSound':{'type':Sequelize[_0xf153('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf153('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xf153('0x2c')},'verticalAlignment':{'type':Sequelize[_0xf153('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x2d')},'messagesAlignment':{'type':Sequelize[_0xf153('0x3')],'defaultValue':_0xf153('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xf153('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf153('0x3')],'allowNull':![],'defaultValue':_0xf153('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf153('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf153('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf153('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xf153('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf153('0x9')],'comment':_0xf153('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![],'comment':_0xf153('0x31'),'set':function(_0x1ee606){if(!_0x1ee606)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xf153('0x23')]('mandatoryDisposition',_0x1ee606);}},'vidaooEscalation':{'type':Sequelize[_0xf153('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf153('0x3')]},'vidaooTopic':{'type':Sequelize[_0xf153('0x3')],'allowNull':![],'defaultValue':_0xf153('0x32')},'vidaooNote':{'type':Sequelize[_0xf153('0x3')],'defaultValue':function(){return _0xf153('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf153('0x12')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 7158eb3..0e701a1 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 _0xb49e=['MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Smtp','offlineMessageSubject','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','Contact','User','fullname','Tag','Tags','tag','rows','Command','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','timezone','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','all','some','utf8','URL','origin','remote','x-real-ip','connection','remoteAddress','replace','alignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','Transaction','READ_COMMITTED','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','removeAgents','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','url','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','type','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','params','includeAll','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ChatWebsiteId','create','getDispositions','findOne','Disposition','nolimit','removeDispositions','addAnswer','CannedAnswer','rawAttributes','hasOwnProperty','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','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','List','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','referer','version','%s\x20%s','browser','unknown','format','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','ContactId','interaction','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate'];(function(_0x237c32,_0x38ff3d){var _0x241ad9=function(_0x1f5bb8){while(--_0x1f5bb8){_0x237c32['push'](_0x237c32['shift']());}};_0x241ad9(++_0x38ff3d);}(_0xb49e,0x17e));var _0xeb49=function(_0x2aa4e1,_0x5a6994){_0x2aa4e1=_0x2aa4e1-0x0;var _0xd6ab97=_0xb49e[_0x2aa4e1];return _0xd6ab97;};'use strict';var BPromise=require(_0xeb49('0x0'));var Mustache=require(_0xeb49('0x1'));var util=require(_0xeb49('0x2'));var path=require(_0xeb49('0x3'));var ejs=require(_0xeb49('0x4'));var fs=require('fs');var fs_extra=require(_0xeb49('0x5'));var _=require('lodash');var querystring=require(_0xeb49('0x6'));var Redis=require(_0xeb49('0x7'));var qs=require(_0xeb49('0x8'));var logger=require('../../config/logger')(_0xeb49('0x9'));var config=require(_0xeb49('0xa'));var url=require(_0xeb49('0xb'));var db=require(_0xeb49('0xc'))['db'];config[_0xeb49('0xd')]=_['defaults'](config[_0xeb49('0xd')],{'host':_0xeb49('0xe'),'port':0x18eb});var socket=require(_0xeb49('0xf'))(new Redis(config['redis']));require(_0xeb49('0x10'))[_0xeb49('0x11')](socket);var htmlToText=require(_0xeb49('0x12'));var jayson=require(_0xeb49('0x13'));var client=jayson[_0xeb49('0x14')][_0xeb49('0x15')]({'port':0x232c});var client9002=jayson[_0xeb49('0x14')][_0xeb49('0x15')]({'port':0x232a});var client9003=jayson[_0xeb49('0x14')][_0xeb49('0x15')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x113bb7,_0x3d0ab1,_0x2e5b33,_0x154357){return new BPromise(function(_0x2ec9d7,_0x56b99f){var _0xe52731=_0x154357||client;return _0xe52731['request'](_0x113bb7,_0x2e5b33)[_0xeb49('0x16')](function(_0x2c5838){logger[_0xeb49('0x17')](_0xeb49('0x18'),_0x3d0ab1,_0xeb49('0x19'));logger[_0xeb49('0x1a')](_0xeb49('0x1b'),_0x3d0ab1,_0xeb49('0x19'),JSON[_0xeb49('0x1c')](_0x2c5838));if(_0x2c5838[_0xeb49('0x1d')]){if(_0x2c5838[_0xeb49('0x1d')][_0xeb49('0x1e')]===0x1f4){logger['error'](_0xeb49('0x18'),_0x3d0ab1,_0x2c5838[_0xeb49('0x1d')][_0xeb49('0x1f')]);return _0x56b99f(_0x2c5838['error'][_0xeb49('0x1f')]);}logger[_0xeb49('0x1d')](_0xeb49('0x18'),_0x3d0ab1,_0x2c5838['error'][_0xeb49('0x1f')]);return _0x2ec9d7(_0x2c5838['error']['message']);}else{logger['info'](_0xeb49('0x18'),_0x3d0ab1,_0xeb49('0x19'));_0x2ec9d7(_0x2c5838[_0xeb49('0x20')][_0xeb49('0x1f')]);}})[_0xeb49('0x21')](function(_0x16db18){logger[_0xeb49('0x1d')](_0xeb49('0x18'),_0x3d0ab1,_0x16db18);_0x56b99f(_0x16db18);});});}function respondWithStatusCode(_0x4d84ea,_0x550b45){_0x550b45=_0x550b45||0xcc;return function(_0xaebcdb){if(_0xaebcdb){return _0x4d84ea[_0xeb49('0x22')](_0x550b45);}return _0x4d84ea[_0xeb49('0x23')](_0x550b45)[_0xeb49('0x24')]();};}function respondWithResult(_0x4aeda6,_0x1373b9){_0x1373b9=_0x1373b9||0xc8;return function(_0x4778ba){if(_0x4778ba){return _0x4aeda6[_0xeb49('0x23')](_0x1373b9)[_0xeb49('0x25')](_0x4778ba);}};}function respondWithFilteredResult(_0x513fc3,_0x29fc73){return function(_0x35e5b6){if(_0x35e5b6){var _0x2cbf22=typeof _0x29fc73[_0xeb49('0x26')]===_0xeb49('0x27')&&typeof _0x29fc73[_0xeb49('0x28')]===_0xeb49('0x27');var _0x5bd77c=_0x35e5b6[_0xeb49('0x29')];var _0x40d49e=_0x2cbf22?0x0:_0x29fc73['offset'];var _0x33a0d2=_0x2cbf22?_0x35e5b6[_0xeb49('0x29')]:_0x29fc73[_0xeb49('0x26')]+_0x29fc73[_0xeb49('0x28')];var _0x34e455;if(_0x33a0d2>=_0x5bd77c){_0x33a0d2=_0x5bd77c;_0x34e455=0xc8;}else{_0x34e455=0xce;}_0x513fc3[_0xeb49('0x23')](_0x34e455);return _0x513fc3[_0xeb49('0x2a')]('Content-Range',_0x40d49e+'-'+_0x33a0d2+'/'+_0x5bd77c)[_0xeb49('0x25')](_0x35e5b6);}return null;};}function saveUpdates(_0x97e187){return function(_0x32f277){if(_0x32f277){return _0x32f277['update'](_0x97e187)[_0xeb49('0x16')](function(_0x5bd850){return _0x5bd850;});}return null;};}function removeEntity(_0x31eab5){return function(_0x16129d){if(_0x16129d){return _0x16129d[_0xeb49('0x2b')]()[_0xeb49('0x16')](function(){var _0x5bcd34=_0x16129d['get']({'plain':!![]});var _0x26f519=_0xeb49('0x2c');return db[_0xeb49('0x2d')][_0xeb49('0x2b')]({'where':{'type':_0x26f519,'resourceId':_0x5bcd34['id']}})[_0xeb49('0x16')](function(){return _0x16129d;});})[_0xeb49('0x16')](function(){_0x31eab5[_0xeb49('0x23')](0xcc)[_0xeb49('0x24')]();});}};}function handleEntityNotFound(_0x528057){return function(_0x218cd8){if(!_0x218cd8){_0x528057[_0xeb49('0x22')](0x194);}return _0x218cd8;};}function handleError(_0x212b6f,_0x22a35a){_0x22a35a=_0x22a35a||0x1f4;return function(_0x2ddaf6){logger['error'](_0x2ddaf6[_0xeb49('0x2e')]);if(_0x2ddaf6[_0xeb49('0x2f')]){delete _0x2ddaf6[_0xeb49('0x2f')];}_0x212b6f[_0xeb49('0x23')](_0x22a35a)['send'](_0x2ddaf6);};}exports[_0xeb49('0x30')]=function(_0x2c2137,_0x4094e8){var _0x5b7e61={'include':[{'model':db[_0xeb49('0x31')],'as':_0xeb49('0x32')}]},_0xe9664a={},_0x2c45de={'count':0x0,'rows':[]};var _0xbe6b8b=_[_0xeb49('0x33')](db[_0xeb49('0x34')]['rawAttributes'],function(_0x2419f8){return{'name':_0x2419f8['fieldName'],'type':_0x2419f8[_0xeb49('0x35')]['key']};});_0xe9664a[_0xeb49('0x36')]=_[_0xeb49('0x33')](_0xbe6b8b,_0xeb49('0x2f'));_0xe9664a[_0xeb49('0x37')]=_[_0xeb49('0x38')](_0x2c2137['query']);_0xe9664a['filters']=_[_0xeb49('0x39')](_0xe9664a['model'],_0xe9664a['query']);_0x5b7e61[_0xeb49('0x3a')]=_['intersection'](_0xe9664a[_0xeb49('0x36')],qs[_0xeb49('0x3b')](_0x2c2137[_0xeb49('0x37')][_0xeb49('0x3b')]));_0x5b7e61[_0xeb49('0x3a')]=_0x5b7e61[_0xeb49('0x3a')][_0xeb49('0x3c')]?_0x5b7e61[_0xeb49('0x3a')]:_0xe9664a[_0xeb49('0x36')];if(!_0x2c2137[_0xeb49('0x37')]['hasOwnProperty']('nolimit')){_0x5b7e61[_0xeb49('0x28')]=qs['limit'](_0x2c2137[_0xeb49('0x37')][_0xeb49('0x28')]);_0x5b7e61[_0xeb49('0x26')]=qs[_0xeb49('0x26')](_0x2c2137['query'][_0xeb49('0x26')]);}_0x5b7e61[_0xeb49('0x3d')]=qs[_0xeb49('0x3e')](_0x2c2137['query']['sort']);_0x5b7e61[_0xeb49('0x3f')]=qs[_0xeb49('0x40')](_[_0xeb49('0x41')](_0x2c2137[_0xeb49('0x37')],_0xe9664a[_0xeb49('0x40')]),_0xbe6b8b);if(_0x2c2137[_0xeb49('0x37')]['filter']){_0x5b7e61[_0xeb49('0x3f')]=_[_0xeb49('0x42')](_0x5b7e61[_0xeb49('0x3f')],{'$or':_[_0xeb49('0x33')](_0xbe6b8b,function(_0x508cbb){if(_0x508cbb['type']!==_0xeb49('0x43')){var _0x25644a={};_0x25644a[_0x508cbb['name']]={'$like':'%'+_0x2c2137[_0xeb49('0x37')][_0xeb49('0x44')]+'%'};return _0x25644a;}})});}_0x5b7e61=_['merge']({},_0x5b7e61,_0x2c2137[_0xeb49('0x45')]);var _0x424fd0={'where':_0x5b7e61['where']};return db[_0xeb49('0x34')]['count'](_0x424fd0)[_0xeb49('0x16')](function(_0x150f2e){_0x2c45de[_0xeb49('0x29')]=_0x150f2e;if(_0x2c2137[_0xeb49('0x37')]['includeAll']){_0x5b7e61[_0xeb49('0x46')]=[{'all':!![]}];}return db[_0xeb49('0x34')][_0xeb49('0x47')](_0x5b7e61);})['then'](function(_0x3c6314){_0x2c45de['rows']=_0x3c6314;return _0x2c45de;})[_0xeb49('0x16')](respondWithFilteredResult(_0x4094e8,_0x5b7e61))[_0xeb49('0x21')](handleError(_0x4094e8,null));};exports['show']=function(_0x539b78,_0x8704ce){var _0x4d71d5={'raw':![],'where':{'id':_0x539b78[_0xeb49('0x48')]['id']},'include':[{'model':db[_0xeb49('0x31')],'as':_0xeb49('0x32')}]},_0x227103={};_0x227103['model']=_[_0xeb49('0x38')](db[_0xeb49('0x34')]['rawAttributes']);_0x227103[_0xeb49('0x37')]=_['keys'](_0x539b78[_0xeb49('0x37')]);_0x227103['filters']=_[_0xeb49('0x39')](_0x227103['model'],_0x227103[_0xeb49('0x37')]);_0x4d71d5[_0xeb49('0x3a')]=_[_0xeb49('0x39')](_0x227103[_0xeb49('0x36')],qs['fields'](_0x539b78[_0xeb49('0x37')][_0xeb49('0x3b')]));_0x4d71d5[_0xeb49('0x3a')]=_0x4d71d5[_0xeb49('0x3a')][_0xeb49('0x3c')]?_0x4d71d5[_0xeb49('0x3a')]:_0x227103['model'];if(_0x539b78[_0xeb49('0x37')][_0xeb49('0x49')]){_0x4d71d5[_0xeb49('0x46')]=[{'all':!![]}];}_0x4d71d5=_[_0xeb49('0x42')]({},_0x4d71d5,_0x539b78[_0xeb49('0x45')]);return db[_0xeb49('0x34')][_0xeb49('0x4a')](_0x4d71d5)[_0xeb49('0x16')](handleEntityNotFound(_0x8704ce,null))[_0xeb49('0x16')](respondWithResult(_0x8704ce,null))[_0xeb49('0x21')](handleError(_0x8704ce,null));};exports['create']=function(_0x15a600,_0x3bac11){return db[_0xeb49('0x34')]['create'](_0x15a600[_0xeb49('0x4b')],{})[_0xeb49('0x16')](function(_0x9ecea3){var _0x2a7585=_0x15a600[_0xeb49('0x4c')][_0xeb49('0x4d')]({'plain':!![]});if(!_0x2a7585)throw new Error(_0xeb49('0x4e'));if(_0x2a7585[_0xeb49('0x4f')]===_0xeb49('0x4c')){var _0x2b01e0=_0x9ecea3['get']({'plain':!![]});var _0x507b11=_0xeb49('0x2c');return db[_0xeb49('0x50')][_0xeb49('0x4a')]({'where':{'name':_0x507b11,'userProfileId':_0x2a7585['userProfileId']},'raw':!![]})[_0xeb49('0x16')](function(_0x1069a8){if(_0x1069a8&&_0x1069a8['autoAssociation']===0x0){return db[_0xeb49('0x2d')]['create']({'name':_0x2b01e0[_0xeb49('0x2f')],'resourceId':_0x2b01e0['id'],'type':_0x1069a8[_0xeb49('0x2f')],'sectionId':_0x1069a8['id']},{})[_0xeb49('0x16')](function(){return _0x9ecea3;});}else{return _0x9ecea3;}})[_0xeb49('0x21')](function(_0x2a6874){logger[_0xeb49('0x1d')](_0xeb49('0x51'),_0x2a6874);throw _0x2a6874;});}return _0x9ecea3;})[_0xeb49('0x16')](respondWithResult(_0x3bac11,0xc9))[_0xeb49('0x21')](handleError(_0x3bac11,null));};exports[_0xeb49('0x52')]=function(_0x3e2bae,_0x2a76f6){if(_0x3e2bae[_0xeb49('0x4b')]['id']){delete _0x3e2bae[_0xeb49('0x4b')]['id'];}return db[_0xeb49('0x34')][_0xeb49('0x4a')]({'where':{'id':_0x3e2bae[_0xeb49('0x48')]['id']},'include':[{'model':db[_0xeb49('0x31')],'as':'mandatoryDispositionPause'}]})[_0xeb49('0x16')](handleEntityNotFound(_0x2a76f6,null))['then'](saveUpdates(_0x3e2bae[_0xeb49('0x4b')],null))[_0xeb49('0x16')](respondWithResult(_0x2a76f6,null))[_0xeb49('0x21')](handleError(_0x2a76f6,null));};exports[_0xeb49('0x2b')]=function(_0x4d429f,_0x2d538c){return db[_0xeb49('0x34')][_0xeb49('0x4a')]({'where':{'id':_0x4d429f[_0xeb49('0x48')]['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0x2d538c,null))[_0xeb49('0x16')](removeEntity(_0x2d538c,null))[_0xeb49('0x21')](handleError(_0x2d538c,null));};exports[_0xeb49('0x53')]=function(_0x3b0f55,_0x4c4476){return db[_0xeb49('0x34')][_0xeb49('0x53')]()[_0xeb49('0x16')](respondWithResult(_0x4c4476,null))[_0xeb49('0x21')](handleError(_0x4c4476,null));};exports['addDisposition']=function(_0x339a0f,_0x14642f){if(_0x339a0f[_0xeb49('0x4b')]['id']){delete _0x339a0f[_0xeb49('0x4b')]['id'];}return db[_0xeb49('0x34')][_0xeb49('0x4a')]({'where':{'id':_0x339a0f['params']['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0x14642f,null))[_0xeb49('0x16')](function(_0x11e79a){if(_0x11e79a){_0x339a0f[_0xeb49('0x4b')][_0xeb49('0x54')]=_0x11e79a['id'];return db['Disposition'][_0xeb49('0x55')](_0x339a0f['body']);}})['then'](respondWithResult(_0x14642f,null))['catch'](handleError(_0x14642f,null));};exports[_0xeb49('0x56')]=function(_0x1d69bb,_0x247782){var _0x5323af={'raw':![],'where':{}};var _0x5360aa={};var _0x2a83bf={'count':0x0,'rows':[]};return db[_0xeb49('0x34')][_0xeb49('0x57')]({'where':{'id':_0x1d69bb[_0xeb49('0x48')]['id']}})['then'](handleEntityNotFound(_0x247782,null))['then'](function(_0xfea1ce){if(_0xfea1ce){_0x5360aa[_0xeb49('0x36')]=_[_0xeb49('0x38')](db[_0xeb49('0x58')]['rawAttributes']);_0x5360aa[_0xeb49('0x37')]=_[_0xeb49('0x38')](_0x1d69bb[_0xeb49('0x37')]);_0x5360aa[_0xeb49('0x40')]=_[_0xeb49('0x39')](_0x5360aa[_0xeb49('0x36')],_0x5360aa[_0xeb49('0x37')]);_0x5323af[_0xeb49('0x3a')]=_[_0xeb49('0x39')](_0x5360aa['model'],qs[_0xeb49('0x3b')](_0x1d69bb['query'][_0xeb49('0x3b')]));_0x5323af[_0xeb49('0x3a')]=_0x5323af[_0xeb49('0x3a')][_0xeb49('0x3c')]?_0x5323af[_0xeb49('0x3a')]:_0x5360aa['model'];if(!_0x1d69bb['query']['hasOwnProperty'](_0xeb49('0x59'))){_0x5323af[_0xeb49('0x28')]=qs[_0xeb49('0x28')](_0x1d69bb[_0xeb49('0x37')][_0xeb49('0x28')]);_0x5323af['offset']=qs[_0xeb49('0x26')](_0x1d69bb[_0xeb49('0x37')]['offset']);}_0x5323af[_0xeb49('0x3d')]=qs[_0xeb49('0x3e')](_0x1d69bb['query'][_0xeb49('0x3e')]);_0x5323af['where']=qs[_0xeb49('0x40')](_[_0xeb49('0x41')](_0x1d69bb['query'],_0x5360aa[_0xeb49('0x40')]));_0x5323af[_0xeb49('0x3f')][_0xeb49('0x54')]=_0xfea1ce['id'];if(_0x1d69bb['query']['filter']){_0x5323af[_0xeb49('0x3f')]=_[_0xeb49('0x42')](_0x5323af[_0xeb49('0x3f')],{'$or':_[_0xeb49('0x33')](_0x5323af['attributes'],function(_0x3ecda8){var _0x11962b={};_0x11962b[_0x3ecda8]={'$like':'%'+_0x1d69bb[_0xeb49('0x37')][_0xeb49('0x44')]+'%'};return _0x11962b;})});}_0x5323af=_['merge']({},_0x5323af,_0x1d69bb[_0xeb49('0x45')]);return db['Disposition'][_0xeb49('0x29')]({'where':_0x5323af['where']})[_0xeb49('0x16')](function(_0x54ab17){_0x2a83bf[_0xeb49('0x29')]=_0x54ab17;if(_0x1d69bb[_0xeb49('0x37')][_0xeb49('0x49')]){_0x5323af[_0xeb49('0x46')]=[{'all':!![]}];}return db['Disposition'][_0xeb49('0x47')](_0x5323af);})[_0xeb49('0x16')](function(_0x548596){_0x2a83bf['rows']=_0x548596;return _0x2a83bf;});}})['then'](respondWithFilteredResult(_0x247782,_0x5323af))['catch'](handleError(_0x247782,null));};exports[_0xeb49('0x5a')]=function(_0x2adfec,_0x14d8f2){return db[_0xeb49('0x34')][_0xeb49('0x4a')]({'where':{'id':_0x2adfec[_0xeb49('0x48')]['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0x14d8f2,null))[_0xeb49('0x16')](function(_0x54c8d4){if(_0x54c8d4){return _0x54c8d4[_0xeb49('0x5a')](_0x2adfec[_0xeb49('0x37')]['ids']);}})['then'](respondWithStatusCode(_0x14d8f2,null))[_0xeb49('0x21')](handleError(_0x14d8f2,null));};exports[_0xeb49('0x5b')]=function(_0x2b4423,_0x332029){if(_0x2b4423['body']['id']){delete _0x2b4423[_0xeb49('0x4b')]['id'];}return db[_0xeb49('0x34')][_0xeb49('0x4a')]({'where':{'id':_0x2b4423[_0xeb49('0x48')]['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0x332029,null))[_0xeb49('0x16')](function(_0x1ce59b){if(_0x1ce59b){_0x2b4423[_0xeb49('0x4b')][_0xeb49('0x54')]=_0x1ce59b['id'];return db[_0xeb49('0x5c')][_0xeb49('0x55')](_0x2b4423[_0xeb49('0x4b')]);}})[_0xeb49('0x16')](respondWithResult(_0x332029,null))[_0xeb49('0x21')](handleError(_0x332029,null));};exports['getAnswers']=function(_0x54c87d,_0x130073){var _0x42fcff={'raw':![],'where':{}};var _0x4ec1f2={};var _0x508ce0={'count':0x0,'rows':[]};return db[_0xeb49('0x34')][_0xeb49('0x57')]({'where':{'id':_0x54c87d[_0xeb49('0x48')]['id']}})['then'](handleEntityNotFound(_0x130073,null))['then'](function(_0x2df7ed){if(_0x2df7ed){_0x4ec1f2['model']=_[_0xeb49('0x38')](db[_0xeb49('0x5c')][_0xeb49('0x5d')]);_0x4ec1f2[_0xeb49('0x37')]=_[_0xeb49('0x38')](_0x54c87d[_0xeb49('0x37')]);_0x4ec1f2[_0xeb49('0x40')]=_[_0xeb49('0x39')](_0x4ec1f2[_0xeb49('0x36')],_0x4ec1f2[_0xeb49('0x37')]);_0x42fcff[_0xeb49('0x3a')]=_[_0xeb49('0x39')](_0x4ec1f2[_0xeb49('0x36')],qs['fields'](_0x54c87d[_0xeb49('0x37')][_0xeb49('0x3b')]));_0x42fcff['attributes']=_0x42fcff[_0xeb49('0x3a')][_0xeb49('0x3c')]?_0x42fcff[_0xeb49('0x3a')]:_0x4ec1f2[_0xeb49('0x36')];if(!_0x54c87d[_0xeb49('0x37')][_0xeb49('0x5e')](_0xeb49('0x59'))){_0x42fcff[_0xeb49('0x28')]=qs[_0xeb49('0x28')](_0x54c87d[_0xeb49('0x37')][_0xeb49('0x28')]);_0x42fcff[_0xeb49('0x26')]=qs[_0xeb49('0x26')](_0x54c87d['query'][_0xeb49('0x26')]);}_0x42fcff[_0xeb49('0x3d')]=qs[_0xeb49('0x3e')](_0x54c87d[_0xeb49('0x37')][_0xeb49('0x3e')]);_0x42fcff['where']=qs[_0xeb49('0x40')](_['pick'](_0x54c87d[_0xeb49('0x37')],_0x4ec1f2['filters']));_0x42fcff['where'][_0xeb49('0x54')]=_0x2df7ed['id'];if(_0x54c87d[_0xeb49('0x37')][_0xeb49('0x44')]){_0x42fcff[_0xeb49('0x3f')]=_[_0xeb49('0x42')](_0x42fcff['where'],{'$or':_['map'](_0x42fcff['attributes'],function(_0x1c6dfb){var _0x2a44bd={};_0x2a44bd[_0x1c6dfb]={'$like':'%'+_0x54c87d[_0xeb49('0x37')][_0xeb49('0x44')]+'%'};return _0x2a44bd;})});}_0x42fcff=_[_0xeb49('0x42')]({},_0x42fcff,_0x54c87d['options']);return db['CannedAnswer'][_0xeb49('0x29')]({'where':_0x42fcff[_0xeb49('0x3f')]})[_0xeb49('0x16')](function(_0xa5468b){_0x508ce0[_0xeb49('0x29')]=_0xa5468b;if(_0x54c87d[_0xeb49('0x37')]['includeAll']){_0x42fcff[_0xeb49('0x46')]=[{'all':!![]}];}return db[_0xeb49('0x5c')][_0xeb49('0x47')](_0x42fcff);})['then'](function(_0x1dead3){_0x508ce0['rows']=_0x1dead3;return _0x508ce0;});}})[_0xeb49('0x16')](respondWithFilteredResult(_0x130073,_0x42fcff))[_0xeb49('0x21')](handleError(_0x130073,null));};exports[_0xeb49('0x5f')]=function(_0x377963,_0x4f452d){return db[_0xeb49('0x34')]['find']({'where':{'id':_0x377963['params']['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0x4f452d,null))[_0xeb49('0x16')](function(_0x381144){if(_0x381144){return _0x381144[_0xeb49('0x5f')](_0x377963[_0xeb49('0x37')]['ids']);}})[_0xeb49('0x16')](respondWithStatusCode(_0x4f452d,null))[_0xeb49('0x21')](handleError(_0x4f452d,null));};exports[_0xeb49('0x60')]=function(_0x780ff9,_0x306e53){_0x780ff9[_0xeb49('0x4b')]['sitepic']=_0x780ff9[_0xeb49('0x61')][_0xeb49('0x62')];return db[_0xeb49('0x34')]['find']({'where':{'id':_0x780ff9[_0xeb49('0x48')]['id']}})['then'](handleEntityNotFound(_0x306e53,null))[_0xeb49('0x16')](saveUpdates(_0x780ff9[_0xeb49('0x4b')],null))[_0xeb49('0x16')](respondWithResult(_0x306e53,null))[_0xeb49('0x21')](handleError(_0x306e53,null));};exports[_0xeb49('0x63')]=function(_0x31f23c,_0x38e908){_0x31f23c['body'][_0xeb49('0x64')]=_0x31f23c[_0xeb49('0x61')][_0xeb49('0x62')];return db[_0xeb49('0x34')][_0xeb49('0x4a')]({'where':{'id':_0x31f23c['params']['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0x38e908,null))[_0xeb49('0x16')](saveUpdates(_0x31f23c[_0xeb49('0x4b')],null))['then'](respondWithResult(_0x38e908,null))[_0xeb49('0x21')](handleError(_0x38e908,null));};exports[_0xeb49('0x65')]=function(_0x1a135b,_0x1e2c46){_0x1a135b[_0xeb49('0x4b')][_0xeb49('0x66')]=_0x1a135b[_0xeb49('0x61')][_0xeb49('0x62')];return db[_0xeb49('0x34')][_0xeb49('0x4a')]({'where':{'id':_0x1a135b[_0xeb49('0x48')]['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0x1e2c46,null))[_0xeb49('0x16')](saveUpdates(_0x1a135b[_0xeb49('0x4b')],null))['then'](respondWithResult(_0x1e2c46,null))[_0xeb49('0x21')](handleError(_0x1e2c46,null));};exports[_0xeb49('0x67')]=function(_0x2c31ed,_0x12b3e3){_0x2c31ed['body']['systemAvatar']=_0x2c31ed[_0xeb49('0x61')][_0xeb49('0x62')];return db[_0xeb49('0x34')][_0xeb49('0x4a')]({'where':{'id':_0x2c31ed['params']['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0x12b3e3,null))[_0xeb49('0x16')](saveUpdates(_0x2c31ed[_0xeb49('0x4b')],null))[_0xeb49('0x16')](respondWithResult(_0x12b3e3,null))[_0xeb49('0x21')](handleError(_0x12b3e3,null));};exports[_0xeb49('0x68')]=function(_0x4db072,_0x321682){var _0x2326da=path[_0xeb49('0x69')](config[_0xeb49('0x6a')],_0xeb49('0x6b'));var _0x20ba4a={'where':{'id':_0x4db072['params']['id']},'attributes':['id',_0xeb49('0x6c')],'raw':!![]};var _0x4ee532=![];return require(_0xeb49('0x6d'))['getLicense']()[_0xeb49('0x16')](function(_0x58b499){if(_0x58b499){_0x4ee532=_0x58b499[_0xeb49('0x6e')];}})[_0xeb49('0x16')](function(){return db['ChatWebsite'][_0xeb49('0x4a')](_0x20ba4a);})[_0xeb49('0x16')](handleEntityNotFound(_0x321682,null))['then'](function(_0x10dcdc){if(_0x10dcdc){if(!_[_0xeb49('0x6f')](_0x10dcdc['sitepic'])){if(fs[_0xeb49('0x70')](path[_0xeb49('0x69')](config['root'],_0xeb49('0x71'),_0x10dcdc[_0xeb49('0x6c')]))&&_0x4ee532){_0x2326da=path[_0xeb49('0x69')](config['root'],'server/files/images/logos/',_0x10dcdc[_0xeb49('0x6c')]);}}return _0x321682['download'](_0x2326da);}})[_0xeb49('0x21')](handleError(_0x321682,null));};exports['getAvatar']=function(_0x277c4e,_0x3c5a30){var _0x4ff520=path['join'](config[_0xeb49('0x6a')],'server/files/images/avatars/default_avatar.png');var _0x2443b9={'where':{'id':_0x277c4e[_0xeb49('0x48')]['id']},'attributes':['id',_0xeb49('0x64')],'raw':!![]};return db['ChatWebsite'][_0xeb49('0x4a')](_0x2443b9)[_0xeb49('0x16')](handleEntityNotFound(_0x3c5a30,null))['then'](function(_0x34573f){if(_0x34573f){if(!_[_0xeb49('0x6f')](_0x34573f[_0xeb49('0x64')])){if(fs[_0xeb49('0x70')](path[_0xeb49('0x69')](config[_0xeb49('0x6a')],'server/files/images/avatars/',_0x34573f[_0xeb49('0x64')]))){_0x4ff520=path[_0xeb49('0x69')](config[_0xeb49('0x6a')],_0xeb49('0x72'),_0x34573f[_0xeb49('0x64')]);}}return _0x3c5a30[_0xeb49('0x73')](_0x4ff520);}})[_0xeb49('0x21')](handleError(_0x3c5a30,null));};exports[_0xeb49('0x74')]=function(_0x19e2d2,_0x55d327){var _0x44e675=path[_0xeb49('0x69')](config[_0xeb49('0x6a')],'server/files/images/avatars/customer_avatar.png');var _0x2ca6ab={'where':{'id':_0x19e2d2[_0xeb49('0x48')]['id']},'attributes':['id',_0xeb49('0x66'),'showCustomerAvatar'],'raw':!![]};return db[_0xeb49('0x34')][_0xeb49('0x4a')](_0x2ca6ab)[_0xeb49('0x16')](handleEntityNotFound(_0x55d327,null))[_0xeb49('0x16')](function(_0x12b2b0){if(_0x12b2b0){if(!_['isNil'](_0x12b2b0[_0xeb49('0x66')])){if(fs['existsSync'](path[_0xeb49('0x69')](config[_0xeb49('0x6a')],_0xeb49('0x72'),_0x12b2b0[_0xeb49('0x66')]))&&_0x12b2b0[_0xeb49('0x75')]){_0x44e675=path[_0xeb49('0x69')](config['root'],_0xeb49('0x72'),_0x12b2b0[_0xeb49('0x66')]);}}return _0x55d327[_0xeb49('0x73')](_0x44e675);}})[_0xeb49('0x21')](handleError(_0x55d327,null));};exports[_0xeb49('0x76')]=function(_0xf9ce54,_0x8b1af5){var _0x4a6645=path[_0xeb49('0x69')](config['root'],_0xeb49('0x77'));var _0x438fdc={'where':{'id':_0xf9ce54[_0xeb49('0x48')]['id']},'attributes':['id',_0xeb49('0x78')],'raw':!![]};return db[_0xeb49('0x34')][_0xeb49('0x4a')](_0x438fdc)[_0xeb49('0x16')](handleEntityNotFound(_0x8b1af5,null))[_0xeb49('0x16')](function(_0x3c7f5f){if(_0x3c7f5f){if(!_[_0xeb49('0x6f')](_0x3c7f5f[_0xeb49('0x78')])){if(fs[_0xeb49('0x70')](path['join'](config[_0xeb49('0x6a')],'server/files/images/avatars/',_0x3c7f5f['systemAvatar']))){_0x4a6645=path['join'](config[_0xeb49('0x6a')],_0xeb49('0x72'),_0x3c7f5f[_0xeb49('0x78')]);}}return _0x8b1af5['download'](_0x4a6645);}})[_0xeb49('0x21')](handleError(_0x8b1af5,null));};exports['notify']=function(_0x36111c,_0x3c76d9){var _0x52bad9=require(_0xeb49('0x79'));var _0x4027bd=new _0x52bad9();var _0x424eb5=_0x4027bd[_0xeb49('0x7a')](_0x36111c[_0xeb49('0x7b')][_0xeb49('0x7c')])[_0xeb49('0x7d')]();var _0x39f320={'body':_0x36111c[_0xeb49('0x4b')],'channel':_0xeb49('0x7e')};var _0x5d6970=[];var _0x309772=[];var _0x3138db={};var _0x40cd5d=![];return db[_0xeb49('0x7f')]['describe']()[_0xeb49('0x16')](function(_0x1b7e54){if(!_0x1b7e54){throw new db['Sequelize'][(_0xeb49('0x80'))](_0xeb49('0x81'));}_0x5d6970=_[_0xeb49('0x82')](_[_0xeb49('0x38')](_0x1b7e54),['createdAt',_0xeb49('0x83')]);_0x309772=_['difference'](_[_0xeb49('0x38')](_0x1b7e54),[_0xeb49('0x84'),_0xeb49('0x83'),_0xeb49('0x85'),_0xeb49('0x86')]);if(_0x36111c[_0xeb49('0x4b')]['id']){delete _0x36111c[_0xeb49('0x4b')]['id'];}if(_[_0xeb49('0x6f')](_0x36111c[_0xeb49('0x4b')][_0xeb49('0x87')])){throw new db[(_0xeb49('0x88'))]['ValidationError'](_0xeb49('0x89'));}if(_[_0xeb49('0x6f')](_0x36111c[_0xeb49('0x4b')][_0xeb49('0x4b')])||_0x36111c[_0xeb49('0x4b')]['body']===''){throw new db['Sequelize'][(_0xeb49('0x80'))](_0xeb49('0x8a'));}if(_[_0xeb49('0x6f')](_0x36111c[_0xeb49('0x4b')][_0xeb49('0x8b')])){throw new db[(_0xeb49('0x88'))][(_0xeb49('0x80'))](_0xeb49('0x8c')+_0x309772);}if(!_['includes'](_0x309772,_0x36111c['body'][_0xeb49('0x8b')])){throw new db[(_0xeb49('0x88'))][(_0xeb49('0x80'))](_0xeb49('0x8d')+_0x309772);}_0x3138db[_0x36111c[_0xeb49('0x4b')][_0xeb49('0x8b')]]=_0x36111c[_0xeb49('0x4b')][_0xeb49('0x87')];})['then'](function(){return db[_0xeb49('0x34')]['find']({'where':{'id':_0x36111c[_0xeb49('0x48')]['id']},'include':[{'model':db['CmList'],'as':_0xeb49('0x8e'),'include':[{'model':db[_0xeb49('0x7f')],'as':'Contacts','where':_0x3138db,'limit':0x1,'order':[['updatedAt',_0xeb49('0x8f')]]}]},{'model':db[_0xeb49('0x90')],'as':_0xeb49('0x91')}]});})[_0xeb49('0x16')](handleEntityNotFound(_0x3c76d9,null))[_0xeb49('0x16')](function(_0x474362){if(_0x474362&&_0x474362[_0xeb49('0x8e')]){_0x39f320[_0xeb49('0x92')]=_0x474362;_0x39f320[_0xeb49('0x93')]=_0x474362['Applications'];_0x39f320['list']=_0x474362[_0xeb49('0x8e')];_0x39f320[_0xeb49('0x93')]=_[_0xeb49('0x94')](_0x39f320[_0xeb49('0x93')],[_0xeb49('0x95')],[_0xeb49('0x96')]);if(_0x39f320[_0xeb49('0x92')][_0xeb49('0x91')]){delete _0x39f320[_0xeb49('0x92')][_0xeb49('0x91')];}if(_0x39f320[_0xeb49('0x92')][_0xeb49('0x8e')]&&_0x39f320[_0xeb49('0x92')]['List']['Contacts'][_0xeb49('0x3c')]){return _0x39f320['account'][_0xeb49('0x8e')]['Contacts'][0x0];}var _0xf01fdb=_[_0xeb49('0x97')](_0x36111c[_0xeb49('0x4b')],{'firstName':_0x36111c[_0xeb49('0x4b')]['from'],'ListId':_0x474362['ListId']});_0xf01fdb[_0x36111c['body']['mapKey']]=_0x36111c[_0xeb49('0x4b')][_0xeb49('0x87')];return db[_0xeb49('0x7f')]['create'](_0xf01fdb,{'fields':_0x5d6970,'raw':!![]});}})[_0xeb49('0x16')](handleEntityNotFound(_0x3c76d9,null))[_0xeb49('0x16')](function(_0x273d8e){_0x39f320[_0xeb49('0x98')]=_0x273d8e;var _0x17ffb5=_0x36111c['body'][_0xeb49('0x99')];if(_0x36111c['headers']['cf-connecting-ip']){_0x17ffb5=_0x36111c['headers'][_0xeb49('0x9a')];}else if(_0x36111c[_0xeb49('0x7b')][_0xeb49('0x9b')]){_0x17ffb5=_[_0xeb49('0x9c')](_0x36111c['headers'][_0xeb49('0x9b')]['split'](','));}if(_0x273d8e){var _0xe93676={'ContactId':_0x273d8e['id'],'ChatWebsiteId':_0x36111c[_0xeb49('0x48')]['id'],'from':(_0x273d8e[_0xeb49('0x9d')]||'')+'\x20'+(_0x273d8e['lastName']||''),'customerIp':_0x17ffb5,'customerPort':_0x36111c[_0xeb49('0x7b')][_0xeb49('0x9e')]?_0x36111c[_0xeb49('0x7b')]['x-real-port']:null,'referer':_0x36111c[_0xeb49('0x4b')][_0xeb49('0x9f')],'browserName':_0x424eb5['browser'][_0xeb49('0x2f')]&&_0x424eb5['browser'][_0xeb49('0xa0')]?util['format'](_0xeb49('0xa1'),_0x424eb5[_0xeb49('0xa2')][_0xeb49('0x2f')],_0x424eb5['browser'][_0xeb49('0xa0')]):_0xeb49('0xa3'),'browserVersion':_0x424eb5['browser'][_0xeb49('0xa0')]||_0xeb49('0xa3'),'osName':util[_0xeb49('0xa4')](_0xeb49('0xa1'),_0x424eb5['os'][_0xeb49('0x2f')],_0x424eb5['os']['version']),'osVersion':_0x424eb5['os']['version'],'deviceModel':_0x424eb5[_0xeb49('0xa5')][_0xeb49('0x36')]&&_0x424eb5['device']['vendor']?util['format'](_0xeb49('0xa6'),_0x424eb5[_0xeb49('0xa5')][_0xeb49('0x36')],_0x424eb5[_0xeb49('0xa5')][_0xeb49('0xa7')],_0x424eb5[_0xeb49('0xa5')][_0xeb49('0x35')]):null,'deviceVendor':_0x424eb5[_0xeb49('0xa5')][_0xeb49('0xa7')],'deviceType':_0x424eb5['device'][_0xeb49('0x35')],'formData':JSON[_0xeb49('0x1c')](_0x36111c[_0xeb49('0x4b')])};var _0x5f1c63={'ChatWebsiteId':_0x36111c[_0xeb49('0x48')]['id'],'closed':![]};if(_0x36111c[_0xeb49('0x4b')][_0xeb49('0xa8')]){_0x5f1c63[_0xeb49('0xa8')]=_0x36111c[_0xeb49('0x4b')]['threadId'];return db[_0xeb49('0xa9')][_0xeb49('0x4a')]({'where':_0x5f1c63})[_0xeb49('0x16')](function(_0x2e6773){if(_0x2e6773){return[_0x2e6773,![]];}_0xe93676[_0xeb49('0xa8')]=_0x36111c[_0xeb49('0x4b')][_0xeb49('0xa8')];_0xe93676['externalUrl']=_0x36111c['body']['externalUrl'];return db[_0xeb49('0xa9')][_0xeb49('0x55')](_0xe93676)[_0xeb49('0x16')](function(_0x64c9ac){return[_0x64c9ac,!![]];});});}_0x5f1c63[_0xeb49('0xaa')]=_0x273d8e['id'];if(_0x36111c[_0xeb49('0x4b')][_0xeb49('0xab')]&&_0x36111c[_0xeb49('0x4b')][_0xeb49('0xab')]['id']){_0x5f1c63['id']=_0x36111c[_0xeb49('0x4b')]['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x5f1c63})['then'](function(_0x5ee14e){if(_0x5ee14e){return[_0x5ee14e,![]];}return db[_0xeb49('0xa9')][_0xeb49('0x55')](_0xe93676)[_0xeb49('0x16')](function(_0x5ec69f){return[_0x5ec69f,!![]];});});}return db[_0xeb49('0xa9')][_0xeb49('0x55')](_0xe93676)[_0xeb49('0x16')](function(_0xe1134d){return[_0xe1134d,!![]];});}})['spread'](function(_0x74205c,_0x2cbe82){if(_0x74205c){_0x40cd5d=_0x2cbe82;if(!_0x2cbe82){var _0x270adb={'from':(_0x39f320[_0xeb49('0x98')][_0xeb49('0x9d')]||'')+'\x20'+(_0x39f320[_0xeb49('0x98')][_0xeb49('0xac')]||'')};if(_0x36111c[_0xeb49('0x4b')][_0xeb49('0xa8')]&&_0x36111c[_0xeb49('0x4b')]['messageId']&&_0x36111c[_0xeb49('0x4b')][_0xeb49('0xa8')]!=_0x36111c['body'][_0xeb49('0xad')]){_0x270adb['threadId']=_0x36111c[_0xeb49('0x4b')]['messageId'];}return _0x74205c['update'](_0x270adb);}else{return _0x74205c;}}})[_0xeb49('0x16')](function(_0x37c1fd){_0x39f320[_0xeb49('0xab')]=_0x37c1fd[_0xeb49('0x4d')]({'plain':!![]});_0x39f320[_0xeb49('0xab')][_0xeb49('0xae')]=_0x40cd5d;if(_0x39f320['interaction'][_0xeb49('0xae')]){if(_0x39f320[_0xeb49('0x92')][_0xeb49('0xaf')]){_0x39f320['applications'][_0xeb49('0xb0')]({'id':0x0,'priority':_0x39f320[_0xeb49('0x93')][_0xeb49('0x3c')]+0x1,'app':_0xeb49('0xb1'),'appdata':_0xeb49('0xb2'),'interval':_0xeb49('0xb3')});}}return db[_0xeb49('0xb4')]['create']({'body':_0x36111c[_0xeb49('0x4b')][_0xeb49('0x4b')],'ChatWebsiteId':_0x36111c[_0xeb49('0x48')]['id'],'ChatInteractionId':_0x37c1fd['id'],'direction':'in','ContactId':_0x39f320[_0xeb49('0x98')]['id'],'AttachmentId':_0x36111c[_0xeb49('0x4b')][_0xeb49('0xb5')]});})[_0xeb49('0x16')](function(_0x188c95){_0x39f320[_0xeb49('0x1f')]=_0x188c95;if(_0x39f320[_0xeb49('0xab')][_0xeb49('0xb6')]){return db['User']['find']({'attributes':['id',_0xeb49('0x2f')],'where':{'id':_0x39f320[_0xeb49('0xab')][_0xeb49('0xb6')]}})['then'](function(_0x1afa8e){if(_0x1afa8e){_0x39f320[_0xeb49('0x93')][_0xeb49('0xb7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1afa8e[_0xeb49('0x2f')]+','+(_0x39f320[_0xeb49('0x92')][_0xeb49('0xb8')]||0xa),'interval':_0xeb49('0xb3')});_0x39f320[_0xeb49('0xb9')]=!![];}return respondWithRpcPromise(_0xeb49('0xba'),_0xeb49('0xbb'),_0x39f320);});}return respondWithRpcPromise(_0xeb49('0xba'),_0xeb49('0xbb'),_0x39f320);})[_0xeb49('0x16')](function(_0x566703){respondWithRpcPromise(_0xeb49('0xbc'),'EventManager',{'event':_0xeb49('0xbd'),'message':_0x566703},client9002);return _0x566703;})[_0xeb49('0x16')](respondWithResult(_0x3c76d9,null))[_0xeb49('0x21')](handleError(_0x3c76d9,null));};exports[_0xeb49('0xbe')]=function(_0x20b046,_0x3fd52c){var _0xb7e4f9,_0xeabc1a,_0x30d01e;var _0x1d3f82=[];var _0x53b88={};var _0x506b23=_0x20b046[_0xeb49('0xbf')]||[];var _0x2c4624=[];var _0x45afc2;return db['CmContact'][_0xeb49('0x53')]()[_0xeb49('0x16')](function(_0xba1c4a){if(!_0xba1c4a){throw new db[(_0xeb49('0x88'))][(_0xeb49('0x80'))](_0xeb49('0x81'));}_0x1d3f82=_[_0xeb49('0x82')](_[_0xeb49('0x38')](_0xba1c4a),[_0xeb49('0x84'),_0xeb49('0x83'),_0xeb49('0x85'),_0xeb49('0x86')]);if(_0x20b046['body']['id']){delete _0x20b046[_0xeb49('0x4b')]['id'];}if(_[_0xeb49('0x6f')](_0x20b046[_0xeb49('0x4b')]['from'])){throw _0x3fd52c['status'](0x1f4)[_0xeb49('0xc0')](new db[(_0xeb49('0x88'))][(_0xeb49('0x80'))](_0xeb49('0x89')));}if(_[_0xeb49('0x6f')](_0x20b046['body'][_0xeb49('0x4b')])||_0x20b046[_0xeb49('0x4b')]['body']===''){throw _0x3fd52c[_0xeb49('0x23')](0x1f4)[_0xeb49('0xc0')](new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xeb49('0x6f')](_0x20b046[_0xeb49('0x4b')][_0xeb49('0xc1')])){throw _0x3fd52c[_0xeb49('0x23')](0x1f4)[_0xeb49('0xc0')](new db['Sequelize'][(_0xeb49('0x80'))](_0xeb49('0xc2')+_0x1d3f82));}if(!_[_0xeb49('0xc3')](_0x1d3f82,_0x20b046[_0xeb49('0x4b')][_0xeb49('0xc1')])){throw _0x3fd52c[_0xeb49('0x23')](0x1f4)['send'](new db[(_0xeb49('0x88'))][(_0xeb49('0x80'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1d3f82));}_0x53b88[_0x20b046[_0xeb49('0x4b')]['mapKeyOffline']]=_0x20b046[_0xeb49('0x4b')][_0xeb49('0x87')];})[_0xeb49('0x16')](function(){return db[_0xeb49('0x34')][_0xeb49('0x4a')]({'where':{'id':_0x20b046[_0xeb49('0x48')]['id']},'include':[{'model':db[_0xeb49('0xc4')],'as':_0xeb49('0x8e')},{'model':db[_0xeb49('0xc5')],'as':_0xeb49('0xc5')}]});})[_0xeb49('0x16')](handleEntityNotFound(_0x3fd52c,null))[_0xeb49('0x16')](function(_0x5d299c){if(_0x5d299c&&_0x5d299c['List']){_0xeabc1a=_0x5d299c;var _0x5dba5b=_[_0xeb49('0x97')](_0x20b046['body'],{'firstName':_0x20b046[_0xeb49('0x4b')][_0xeb49('0x87')],'phone':_0x20b046[_0xeb49('0x4b')][_0xeb49('0x87')],'ListId':_0x5d299c[_0xeb49('0x86')]});_0x5dba5b[_0x20b046[_0xeb49('0x4b')][_0xeb49('0xc1')]]=_0x20b046[_0xeb49('0x4b')][_0xeb49('0x87')];return db[_0xeb49('0x7f')][_0xeb49('0xc6')]({'where':_0x53b88,'defaults':_0x5dba5b});}})[_0xeb49('0xc7')](function(_0x2369a9){if(_0x2369a9){_0x30d01e=_0x2369a9;var _0x483d34=fs[_0xeb49('0xc8')](path[_0xeb49('0x69')](config['root'],_0xeb49('0xc9')),'utf8');var _0x52a99d=ejs[_0xeb49('0xca')](_0x483d34,{'body':_[_0xeb49('0xcb')](_0x20b046[_0xeb49('0x4b')]['body']),'bodyTitle':_0xeabc1a[_0xeb49('0xcc')]});return db[_0xeb49('0xcd')][_0xeb49('0x55')]({'body':_0x52a99d,'plainBody':htmlToText[_0xeb49('0xce')](_0x52a99d),'ContactId':_0x2369a9['id'],'ChatWebsiteId':_0xeabc1a['id']});}})['then'](function(_0x14b8f0){_0x45afc2=_0x14b8f0;if(_0x506b23['length']){var _0x27d468=_0x506b23[_0xeb49('0x33')](function(_0x1eb2d7){return{'name':_0x1eb2d7[_0xeb49('0xcf')],'basename':_0x1eb2d7[_0xeb49('0x62')],'type':_0x1eb2d7[_0xeb49('0xd0')],'ChatOfflineMessageId':_0x14b8f0['id']};});_0x2c4624=_0x27d468[_0xeb49('0x33')](_0x3f51a4=>{var _0x4e809c={'filename':_0x3f51a4['name'],'path':path[_0xeb49('0x69')](config['root'],_0xeb49('0xd1'),_0xeb49('0xbf'),'attachments',_0xeb49('0xd2'),_0x3f51a4[_0xeb49('0xd3')])};return _0x4e809c;});if(!_0xeabc1a[_0xeb49('0xd4')]){return db['sequelize'][_0xeb49('0xd5')](function(_0x29f14c){return db[_0xeb49('0xd6')][_0xeb49('0xd7')](_0x27d468,{'transaction':_0x29f14c});});}}})[_0xeb49('0x16')](function(){if(_0x45afc2){_0xb7e4f9=_0x45afc2;return db[_0xeb49('0xc5')][_0xeb49('0x57')]({'where':{'service':!![]},'include':[{'model':db[_0xeb49('0xd8')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xeb49('0xd9')],'as':_0xeb49('0xd9'),'raw':!![]}]}]});}})['then'](function(_0x14bf65){if(_0x14bf65&&_0x14bf65['Smtp']&&_0xeabc1a[_0xeb49('0xda')]&&_0xeabc1a[_0xeb49('0xdb')]){var _0x5f0890=_0x14bf65[_0xeb49('0xdc')]();return respondWithRpcPromise(_0xeb49('0xdd'),_0xeb49('0xde'),{'account':_0x5f0890,'message':{'from':util[_0xeb49('0xa4')](_0xeb49('0xdf'),_0x14bf65['name'],_0x14bf65[_0xeb49('0xe0')]||_0x14bf65[_0xeb49('0xe1')][_0xeb49('0x4c')]),'to':_0xeabc1a[_0xeb49('0xdb')],'subject':_0xeabc1a[_0xeb49('0xe2')],'html':_0xb7e4f9[_0xeb49('0x4b')],'attachments':_0x2c4624}},client9003)[_0xeb49('0x16')](function(){return _0xb7e4f9;})[_0xeb49('0x21')](function(_0x242ed5){logger[_0xeb49('0x1d')](_0x242ed5);});}})[_0xeb49('0x16')](function(){if(_0xeabc1a&&_0xeabc1a[_0xeb49('0xd4')]&&_0xeabc1a['MailAccountId']){var _0x1559d3=[];if(_0x506b23[_0xeb49('0x3c')]){_0x1559d3=_0x506b23[_0xeb49('0x33')](function(_0x809f39){return{'name':_0x809f39[_0xeb49('0xcf')],'basename':_0x809f39[_0xeb49('0x62')],'type':_0x809f39[_0xeb49('0xd0')],'ChatOfflineMessageId':_0x45afc2['id']};});}var _0x4acb4c;if(!_[_0xeb49('0x6f')](_0xeabc1a['subjectOffline'])){var _0x11d045=_[_0xeb49('0x33')](_0x20b046[_0xeb49('0x4b')],function(_0x4c697e){return _0x4c697e;});var _0x3af7fe=_[_0xeb49('0xe3')](_0x11d045)[0x0];var _0x10361d=_[_0xeb49('0xe4')](_0x3af7fe,function(_0x2ed51c){return _0x2ed51c;});_0x4acb4c=_0x10361d[0x1][_0xeabc1a['subjectOffline']];}var _0x58ffa6={'from':_0x30d01e['email'],'firstName':_0x30d01e[_0xeb49('0x9d')],'lastName':_0x30d01e[_0xeb49('0xac')],'mapKey':_0xeb49('0xe0'),'message':{'from':_0x30d01e[_0xeb49('0xe0')],'to':_0xeabc1a['MailAccount'][_0xeb49('0xe0')],'cc':'','subject':_[_0xeb49('0x6f')](_0x4acb4c)?_0xeabc1a['offlineMessageSubject']:_0x4acb4c,'messageId':'','sentAt':new Date(),'attach':_0x1559d3['length'],'attachments':_0x1559d3,'originChannel':_0xeb49('0xe5'),'ChatWebsiteId':_0xeabc1a['id'],'ChatOfflineMessageId':_0xb7e4f9['id'],'originTo':_0xeabc1a['MailAccount'][_0xeb49('0xe0')]},'body':_0xb7e4f9[_0xeb49('0x4b')]};var _0x461d10={'account':{'id':_0xeabc1a[_0xeb49('0xe6')]},'body':_0x58ffa6,'log':_0xeb49('0xe7')};return respondWithRpcPromise(_0xeb49('0xe7'),'notifyMail',_0x461d10,client9001)[_0xeb49('0x16')](function(){return _0xb7e4f9;})['catch'](function(_0x29a658){logger[_0xeb49('0x1d')](_0x29a658);});}return;})[_0xeb49('0x16')](function(){if(_0xb7e4f9){return _0xb7e4f9;}})['then'](respondWithResult(_0x3fd52c,null))[_0xeb49('0x21')](function(_0x3655a6){logger[_0xeb49('0x1d')](_0xeb49('0x21'),_0x3655a6);for(var _0x5ad99a of _0x506b23){var _0x37cbcd=path[_0xeb49('0x69')](config[_0xeb49('0x6a')],'server','files','attachments',_0xeb49('0xd2'),_0x5ad99a[_0xeb49('0x62')]);fs_extra['remove'](_0x37cbcd)[_0xeb49('0x21')](function(_0x130947){logger[_0xeb49('0x1d')](_0xeb49('0xe8'),_0x37cbcd,_0x130947);});}});};exports[_0xeb49('0xe9')]=function(_0x2e0264,_0x1571b6){return db[_0xeb49('0xa9')]['find']({'where':{'id':_0x2e0264[_0xeb49('0x48')]['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0x1571b6,null))[_0xeb49('0x16')](function(_0x587b51){if(_0x587b51){return _0x587b51['addInteraction'](_0x2e0264[_0xeb49('0x4b')][_0xeb49('0xea')],_['omit'](_0x2e0264[_0xeb49('0x4b')],[_0xeb49('0xea'),'id'])||{});}})['then'](respondWithResult(_0x1571b6,null))[_0xeb49('0x21')](handleError(_0x1571b6,null));};exports['getInteractions']=function(_0x40c46a,_0xd3705f){var _0x62d5a={'raw':![],'where':{}};var _0x1720b9={};var _0x4b2105={'count':0x0,'rows':[]};return db[_0xeb49('0x34')]['findOne']({'where':{'id':_0x40c46a[_0xeb49('0x48')]['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0xd3705f,null))[_0xeb49('0x16')](function(_0x4c279c){if(_0x4c279c){_0x1720b9['model']=_[_0xeb49('0x38')](db['ChatInteraction'][_0xeb49('0x5d')]);_0x1720b9['query']=_[_0xeb49('0x38')](_0x40c46a[_0xeb49('0x37')]);_0x1720b9['filters']=_['intersection'](_0x1720b9['model'],_0x1720b9[_0xeb49('0x37')]);_0x62d5a[_0xeb49('0x3a')]=_[_0xeb49('0x39')](_0x1720b9[_0xeb49('0x36')],qs[_0xeb49('0x3b')](_0x40c46a[_0xeb49('0x37')][_0xeb49('0x3b')]));_0x62d5a[_0xeb49('0x3a')]=_0x62d5a['attributes']['length']?_0x62d5a[_0xeb49('0x3a')]:_0x1720b9[_0xeb49('0x36')];if(!_0x40c46a[_0xeb49('0x37')]['hasOwnProperty'](_0xeb49('0x59'))){_0x62d5a[_0xeb49('0x28')]=qs[_0xeb49('0x28')](_0x40c46a[_0xeb49('0x37')][_0xeb49('0x28')]);_0x62d5a['offset']=qs[_0xeb49('0x26')](_0x40c46a[_0xeb49('0x37')]['offset']);}_0x62d5a[_0xeb49('0x3d')]=qs['sort'](_0x40c46a[_0xeb49('0x37')][_0xeb49('0x3e')]);_0x62d5a[_0xeb49('0x3f')]=qs[_0xeb49('0x40')](_[_0xeb49('0x41')](_0x40c46a[_0xeb49('0x37')],_0x1720b9['filters']));_0x62d5a[_0xeb49('0x3f')][_0xeb49('0x54')]=_0x4c279c['id'];if(_0x40c46a[_0xeb49('0x37')]['filter']){_0x62d5a[_0xeb49('0x3f')]=_[_0xeb49('0x42')](_0x62d5a['where'],{'$or':_[_0xeb49('0x33')](_0x62d5a['attributes'],function(_0x4acb53){var _0x4d11a2={};_0x4d11a2[_0x4acb53]={'$like':'%'+_0x40c46a[_0xeb49('0x37')]['filter']+'%'};return _0x4d11a2;})});}_0x62d5a=_[_0xeb49('0x42')]({},_0x62d5a,_0x40c46a[_0xeb49('0x45')]);return db[_0xeb49('0xa9')]['count']({'where':_0x62d5a[_0xeb49('0x3f')]})[_0xeb49('0x16')](function(_0x424fcd){_0x4b2105[_0xeb49('0x29')]=_0x424fcd;if(_0x40c46a['query'][_0xeb49('0x49')]){_0x62d5a['include']=[{'model':db[_0xeb49('0x7f')],'as':_0xeb49('0xeb'),'required':![]},{'model':db[_0xeb49('0xec')],'as':'Owner','attributes':[_0xeb49('0x2f'),_0xeb49('0xed'),'internal'],'required':![]},{'model':db[_0xeb49('0xee')],'as':_0xeb49('0xef'),'attributes':['id',_0xeb49('0x2f'),'color'],'where':_0x40c46a['query'][_0xeb49('0xf0')]?{'id':_0x40c46a[_0xeb49('0x37')][_0xeb49('0xf0')]}:undefined,'required':_0x40c46a[_0xeb49('0x37')][_0xeb49('0xf0')]?!![]:![]}];}return db[_0xeb49('0xa9')][_0xeb49('0x47')](_0x62d5a);})[_0xeb49('0x16')](function(_0x1be39a){_0x4b2105[_0xeb49('0xf1')]=_0x1be39a;return _0x4b2105;});}})[_0xeb49('0x16')](respondWithFilteredResult(_0xd3705f,_0x62d5a))['catch'](handleError(_0xd3705f,null));};function iftimePromise(_0xa9d5b,_0x4f9ad6){return respondWithRpcPromise(_0xeb49('0xf2'),_0xeb49('0xf3'),{'command':_0x4f9ad6['timezone']?util[_0xeb49('0xa4')](_0xeb49('0xf4'),_0xa9d5b[_0xeb49('0xf5')],_0x4f9ad6['timezone']):util[_0xeb49('0xa4')](_0xeb49('0xf6'),_0xa9d5b[_0xeb49('0xf5')])},client9002)[_0xeb49('0x16')](function(_0x1a9832){var _0x2dca27=_0x1a9832&&_0x1a9832[_0xeb49('0xf7')]('true')>=0x0?!![]:![];logger[_0xeb49('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4f9ad6['id'],_0xa9d5b['id'],_0xa9d5b[_0xeb49('0xf5')],_0x2dca27?_0xeb49('0xf8'):'OFFLINE',_0x4f9ad6[_0xeb49('0xf9')]?_0x4f9ad6[_0xeb49('0xf9')]:_0xeb49('0xfa'));return _0x2dca27;})['catch'](function(_0x21a298){logger[_0xeb49('0x1d')](_0xeb49('0xfb'),_0x4f9ad6['id'],_0xa9d5b['id'],_0xa9d5b[_0xeb49('0xf5')],util[_0xeb49('0xfc')](_0x21a298,{'showHidden':![],'depth':null}),_0x4f9ad6['timezone']?_0x4f9ad6[_0xeb49('0xf9')]:'No\x20timezone');return![];});}exports[_0xeb49('0xf3')]=function(_0x15af37,_0x40fa23){var _0x855247=0x0;var _0x1c306a=0x0;var _0x34d3b4=![];var _0x4b249d;var _0x13cc3e;return db[_0xeb49('0x34')]['find']({'where':{'id':_0x15af37['params']['id']},'include':[{'model':db[_0xeb49('0xfd')],'as':_0xeb49('0xfd'),'include':[{'model':db[_0xeb49('0xfd')],'as':_0xeb49('0xfe'),'attributes':['id',_0xeb49('0xf5')],'raw':!![]}]}]})[_0xeb49('0x16')](handleEntityNotFound(_0x40fa23,null))[_0xeb49('0x16')](function(_0x33849b){if(_0x33849b){_0x4b249d=_0x33849b;return _0x33849b[_0xeb49('0xff')]({'raw':!![]});}})[_0xeb49('0x16')](function(_0x511ef5){if(_0x4b249d){if(_0x511ef5){_0x13cc3e=_0x511ef5;}}return require(_0xeb49('0x6d'))[_0xeb49('0x100')]();})[_0xeb49('0x16')](function(_0xf793e2){if(_0xf793e2){_0x1c306a=_0xf793e2[_0xeb49('0x101')];_0x34d3b4=_0xf793e2[_0xeb49('0x6e')];}})[_0xeb49('0x16')](function(){return db[_0xeb49('0xa9')][_0xeb49('0x29')]({'where':{'closed':![]}});})[_0xeb49('0x16')](function(_0x2839b2){_0x855247=_0x2839b2;if(_0x1c306a&&_0x2839b2>_0x1c306a){return db[_0xeb49('0x102')][_0xeb49('0x57')]({'where':{'id':0x1}})[_0xeb49('0x16')](function(_0x287303){if(_0x287303){_0x287303[_0xeb49('0x103')](_0xeb49('0x104'));}});}})[_0xeb49('0x16')](function(){if(_0x4b249d[_0xeb49('0xfd')]&&_0x4b249d['Interval'][_0xeb49('0xfe')]){var _0x5c9406=[];for(var _0x5ee4e4=0x0;_0x5ee4e4<_0x4b249d[_0xeb49('0xfd')][_0xeb49('0xfe')]['length'];_0x5ee4e4++){var _0x1f0fec=_0x4b249d[_0xeb49('0xfd')][_0xeb49('0xfe')][_0x5ee4e4]['get']({'plain':!![]});_0x5c9406['push'](iftimePromise(_0x1f0fec,_0x4b249d));}return BPromise[_0xeb49('0x105')](_0x5c9406)['then'](function(_0x2babc1){return _[_0xeb49('0x106')](_0x2babc1);});}else{return!![];}})[_0xeb49('0x16')](function(_0x2f7ed1){var _0xfce85a=fs[_0xeb49('0xc8')](path[_0xeb49('0x69')](config[_0xeb49('0x6a')],'server/files/chat/iframe.ejs'),_0xeb49('0x107'));var _0x2d6d3b=new url[(_0xeb49('0x108'))](_0x4b249d['address'])[_0xeb49('0x109')];var _0x126a62='3.1.0';var _0xcd91a5=![];var _0x411c7c={'chatVersion':_0x126a62,'chatWebsiteAddressOrigin':_0x2d6d3b,'remote':_0x4b249d[_0xeb49('0x10a')],'query':querystring[_0xeb49('0x1c')](_['merge'](_0x4b249d[_0xeb49('0x4d')]({'plain':!![]}),{'customerIp':_0x15af37[_0xeb49('0x7b')]['x-forwarded-for']||_0x15af37[_0xeb49('0x7b')][_0xeb49('0x10b')]||_0x15af37[_0xeb49('0x10c')][_0xeb49('0x10d')]||_0x15af37['ip'],'referer':_0x15af37['headers'][_0xeb49('0x9f')],'openedInteractions':_0x855247,'maxInteractions':_0x1c306a,'virtual':_0x34d3b4[_0xeb49('0x101')],'online':_0x2f7ed1,'custom':_0x34d3b4}))[_0xeb49('0x10e')](/'/g,'\x5c\x27')};_0x40fa23[_0xeb49('0xc0')](ejs[_0xeb49('0xca')](Mustache[_0xeb49('0xca')](_0xfce85a,_0x411c7c),{'proactiveActions':_0x13cc3e,'alignment':_0x4b249d[_0xeb49('0x10f')],'verticalAlignment':_0x4b249d['verticalAlignment'],'div_color':_0x4b249d['color'],'labelText':_0x4b249d[_0xeb49('0x110')],'text_color':_0x4b249d[_0xeb49('0x111')],'text_button_color':_0x4b249d[_0xeb49('0x112')],'button_color':_0x4b249d[_0xeb49('0x113')],'background_color':_0x4b249d[_0xeb49('0x114')],'hideWhenOffline':_0x4b249d[_0xeb49('0x115')],'intervalId':_0x4b249d['IntervalId'],'isDevelopment':_0xcd91a5,'chatVersion':_0x126a62}));})[_0xeb49('0x21')](handleError(_0x40fa23,null));};exports['addApplications']=function(_0x133ac2,_0x1144e9){var _0x4a06a6=_0x133ac2[_0xeb49('0x48')]['id'];var _0x4d5742=_0x133ac2[_0xeb49('0x4b')];var _0x374355=0xc8;var _0x724b03=null;return db['sequelize'][_0xeb49('0xd5')]({'isolationLevel':db['sequelize'][_0xeb49('0x116')]['ISOLATION_LEVELS'][_0xeb49('0x117')]},function(_0x9757a5){return db[_0xeb49('0x34')]['findOne']({'where':{'id':_0x4a06a6},'transaction':_0x9757a5})[_0xeb49('0x16')](function(_0x367ef){if(_0x367ef){return db['ChatApplication'][_0xeb49('0x2b')]({'where':{'ChatWebsiteId':_0x4a06a6},'transaction':_0x9757a5})[_0xeb49('0x16')](function(){var _0x1a1eda=_['map'](_0x4d5742,function(_0x1ff5f1){_0x1ff5f1[_0xeb49('0x54')]=_0x4a06a6;return _0x1ff5f1;});return db[_0xeb49('0x90')][_0xeb49('0xd7')](_0x1a1eda,{'transaction':_0x9757a5});});}else{_0x374355=0x194;_0x724b03=[];}});})[_0xeb49('0x16')](function(){if(_0x374355!==0x194){return db[_0xeb49('0x90')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4a06a6},'order':_0xeb49('0x95')})[_0xeb49('0x16')](function(_0x1bd6ab){_0x724b03=_0x1bd6ab;});}})[_0xeb49('0x21')](function(_0x1ed709){_0x374355=0x1f4;logger[_0xeb49('0x1d')](_0x1ed709[_0xeb49('0x2e')]);if(_0x1ed709[_0xeb49('0x2f')]){delete _0x1ed709['name'];}_0x724b03=_0x1ed709;})['finally'](function(){if(_0x724b03===null){_0x1144e9[_0xeb49('0x22')](_0x374355);}else{if(_0x374355===0x1f4){_0x1144e9[_0xeb49('0x23')](_0x374355)[_0xeb49('0xc0')](_0x724b03);}else{_0x1144e9[_0xeb49('0x23')](_0x374355)[_0xeb49('0x25')](_0x724b03);}}});};exports[_0xeb49('0x118')]=function(_0x15e375,_0x1d165c){var _0xedb23e={};var _0xe82b3c={};var _0x2c8d17;var _0x555b57;return db['ChatWebsite']['findOne']({'where':{'id':_0x15e375['params']['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0x1d165c,null))['then'](function(_0x537fbc){if(_0x537fbc){_0x2c8d17=_0x537fbc;_0xe82b3c[_0xeb49('0x36')]=_[_0xeb49('0x38')](db['ChatApplication'][_0xeb49('0x5d')]);_0xe82b3c[_0xeb49('0x37')]=_[_0xeb49('0x38')](_0x15e375['query']);_0xe82b3c[_0xeb49('0x40')]=_[_0xeb49('0x39')](_0xe82b3c[_0xeb49('0x36')],_0xe82b3c[_0xeb49('0x37')]);_0xedb23e[_0xeb49('0x3a')]=_[_0xeb49('0x39')](_0xe82b3c[_0xeb49('0x36')],qs[_0xeb49('0x3b')](_0x15e375['query'][_0xeb49('0x3b')]));_0xedb23e[_0xeb49('0x3a')]=_0xedb23e[_0xeb49('0x3a')][_0xeb49('0x3c')]?_0xedb23e[_0xeb49('0x3a')]:_0xe82b3c['model'];_0xedb23e[_0xeb49('0x3d')]=qs[_0xeb49('0x3e')](_0x15e375[_0xeb49('0x37')][_0xeb49('0x3e')]);_0xedb23e['where']=qs[_0xeb49('0x40')](_[_0xeb49('0x41')](_0x15e375['query'],_0xe82b3c[_0xeb49('0x40')]));if(_0x15e375[_0xeb49('0x37')][_0xeb49('0x44')]){_0xedb23e[_0xeb49('0x3f')]=_[_0xeb49('0x42')](_0xedb23e[_0xeb49('0x3f')],{'$or':_['map'](_0xedb23e[_0xeb49('0x3a')],function(_0x4b4064){var _0x31e5ec={};_0x31e5ec[_0x4b4064]={'$like':'%'+_0x15e375[_0xeb49('0x37')][_0xeb49('0x44')]+'%'};return _0x31e5ec;})});}_0xedb23e=_[_0xeb49('0x42')]({},_0xedb23e,_0x15e375['options']);return _0x2c8d17[_0xeb49('0x118')](_0xedb23e);}})[_0xeb49('0x16')](function(_0x40f884){if(_0x40f884){_0x555b57=_0x40f884[_0xeb49('0x3c')];if(!_0x15e375['query']['hasOwnProperty'](_0xeb49('0x59'))){_0xedb23e[_0xeb49('0x28')]=qs[_0xeb49('0x28')](_0x15e375[_0xeb49('0x37')][_0xeb49('0x28')]);_0xedb23e['offset']=qs[_0xeb49('0x26')](_0x15e375['query'][_0xeb49('0x26')]);}return _0x2c8d17['getApplications'](_0xedb23e);}})[_0xeb49('0x16')](function(_0x86c16c){if(_0x86c16c){return _0x86c16c?{'count':_0x555b57,'rows':_0x86c16c}:null;}})[_0xeb49('0x16')](respondWithResult(_0x1d165c,null))[_0xeb49('0x21')](handleError(_0x1d165c,null));};exports[_0xeb49('0x119')]=function(_0xe5875,_0x126a33){return db[_0xeb49('0x11a')][_0xeb49('0x4a')]({'where':{'id':_0xe5875[_0xeb49('0x48')]['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0x126a33,null))[_0xeb49('0x16')](function(_0x587e32){if(_0x587e32){return _0x587e32[_0xeb49('0x119')](_0xe5875[_0xeb49('0x4b')]['ids'],_[_0xeb49('0x11b')](_0xe5875[_0xeb49('0x4b')],[_0xeb49('0xea'),'id'])||{});}})[_0xeb49('0x16')](respondWithResult(_0x126a33,null))[_0xeb49('0x21')](handleError(_0x126a33,null));};exports[_0xeb49('0xff')]=function(_0x34103f,_0x5822ce){var _0xeb7578={};var _0x39d379={};var _0x1f27aa;var _0x33898e;return db[_0xeb49('0x34')]['findOne']({'where':{'id':_0x34103f[_0xeb49('0x48')]['id']}})['then'](handleEntityNotFound(_0x5822ce,null))['then'](function(_0x57a997){if(_0x57a997){_0x1f27aa=_0x57a997;_0x39d379[_0xeb49('0x36')]=_[_0xeb49('0x38')](db[_0xeb49('0x11c')][_0xeb49('0x5d')]);_0x39d379[_0xeb49('0x37')]=_[_0xeb49('0x38')](_0x34103f[_0xeb49('0x37')]);_0x39d379[_0xeb49('0x40')]=_[_0xeb49('0x39')](_0x39d379[_0xeb49('0x36')],_0x39d379[_0xeb49('0x37')]);_0xeb7578[_0xeb49('0x3a')]=_[_0xeb49('0x39')](_0x39d379[_0xeb49('0x36')],qs[_0xeb49('0x3b')](_0x34103f[_0xeb49('0x37')]['fields']));_0xeb7578[_0xeb49('0x3a')]=_0xeb7578[_0xeb49('0x3a')]['length']?_0xeb7578['attributes']:_0x39d379[_0xeb49('0x36')];_0xeb7578[_0xeb49('0x3d')]=qs[_0xeb49('0x3e')](_0x34103f[_0xeb49('0x37')][_0xeb49('0x3e')]);_0xeb7578[_0xeb49('0x3f')]=qs[_0xeb49('0x40')](_['pick'](_0x34103f[_0xeb49('0x37')],_0x39d379[_0xeb49('0x40')]));if(_0x34103f['query'][_0xeb49('0x44')]){_0xeb7578[_0xeb49('0x3f')]=_[_0xeb49('0x42')](_0xeb7578['where'],{'$or':_['map'](_0xeb7578[_0xeb49('0x3a')],function(_0x2b462c){var _0x1c9540={};_0x1c9540[_0x2b462c]={'$like':'%'+_0x34103f[_0xeb49('0x37')][_0xeb49('0x44')]+'%'};return _0x1c9540;})});}_0xeb7578=_[_0xeb49('0x42')]({},_0xeb7578,_0x34103f[_0xeb49('0x45')]);return _0x1f27aa[_0xeb49('0xff')](_0xeb7578);}})['then'](function(_0xfea1e4){if(_0xfea1e4){_0x33898e=_0xfea1e4[_0xeb49('0x3c')];if(!_0x34103f[_0xeb49('0x37')][_0xeb49('0x5e')](_0xeb49('0x59'))){_0xeb7578[_0xeb49('0x28')]=qs[_0xeb49('0x28')](_0x34103f[_0xeb49('0x37')][_0xeb49('0x28')]);_0xeb7578['offset']=qs[_0xeb49('0x26')](_0x34103f[_0xeb49('0x37')]['offset']);}return _0x1f27aa['getProactiveActions'](_0xeb7578);}})[_0xeb49('0x16')](function(_0x4387b8){if(_0x4387b8){return _0x4387b8?{'count':_0x33898e,'rows':_0x4387b8}:null;}})[_0xeb49('0x16')](respondWithResult(_0x5822ce,null))[_0xeb49('0x21')](handleError(_0x5822ce,null));};exports[_0xeb49('0x11d')]=function(_0xfdf7cc,_0xc75388){var _0x2ad09=_0xfdf7cc[_0xeb49('0x37')][_0xeb49('0x11e')]===_0xeb49('0x11f')?_0xeb49('0x120'):_0xeb49('0x121');return db[_0xeb49('0x34')]['find']({'attributes':['id',_0x2ad09],'where':{'id':_0xfdf7cc[_0xeb49('0x48')]['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0xc75388,null))[_0xeb49('0x16')](function(_0x3608aa){if(_0x3608aa){var _0x4e4ba2=_0x3608aa[_0x2ad09];var _0x4132c8=_0x4e4ba2&&_0x4e4ba2[_0xeb49('0x122')]?_0x4e4ba2[_0xeb49('0x122')]:[];_0xc75388[_0xeb49('0xc0')]({'fromKey':_[_0xeb49('0x6f')](_0x4e4ba2[_0xeb49('0x123')])?undefined:_0x4e4ba2[_0xeb49('0x123')],'count':_0x4132c8[_0xeb49('0x3c')],'rows':_0x4132c8});}})[_0xeb49('0x21')](handleError(_0xc75388,null));};exports[_0xeb49('0x124')]=function(_0x29cdf3,_0x5ce6ab){var _0x398834={'raw':![],'where':{}};var _0xd240d5={};var _0x380882={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x29cdf3[_0xeb49('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ce6ab,null))[_0xeb49('0x16')](function(_0x3cdd91){if(_0x3cdd91){_0xd240d5[_0xeb49('0x36')]=_[_0xeb49('0x38')](db[_0xeb49('0xcd')][_0xeb49('0x5d')]);_0xd240d5['query']=_['keys'](_0x29cdf3[_0xeb49('0x37')]);_0xd240d5[_0xeb49('0x40')]=_[_0xeb49('0x39')](_0xd240d5[_0xeb49('0x36')],_0xd240d5[_0xeb49('0x37')]);_0x398834[_0xeb49('0x3a')]=_[_0xeb49('0x39')](_0xd240d5['model'],qs[_0xeb49('0x3b')](_0x29cdf3[_0xeb49('0x37')][_0xeb49('0x3b')]));_0x398834[_0xeb49('0x3a')]=_0x398834[_0xeb49('0x3a')]['length']?_0x398834[_0xeb49('0x3a')]:_0xd240d5['model'];if(!_0x29cdf3[_0xeb49('0x37')][_0xeb49('0x5e')](_0xeb49('0x59'))){_0x398834[_0xeb49('0x28')]=qs[_0xeb49('0x28')](_0x29cdf3['query'][_0xeb49('0x28')]);_0x398834[_0xeb49('0x26')]=qs[_0xeb49('0x26')](_0x29cdf3[_0xeb49('0x37')][_0xeb49('0x26')]);}_0x398834[_0xeb49('0x3d')]=qs['sort'](_0x29cdf3['query']['sort']);_0x398834[_0xeb49('0x3f')]=qs[_0xeb49('0x40')](_[_0xeb49('0x41')](_0x29cdf3[_0xeb49('0x37')],_0xd240d5[_0xeb49('0x40')]));_0x398834['where'][_0xeb49('0x54')]=_0x3cdd91['id'];if(_0x29cdf3['query'][_0xeb49('0x44')]){_0x398834[_0xeb49('0x3f')]=_[_0xeb49('0x42')](_0x398834['where'],{'$or':_['map'](_0x398834[_0xeb49('0x3a')],function(_0xa96857){var _0x4c86d7={};_0x4c86d7[_0xa96857]={'$like':'%'+_0x29cdf3['query'][_0xeb49('0x44')]+'%'};return _0x4c86d7;})});}_0x398834=_[_0xeb49('0x42')]({},_0x398834,_0x29cdf3[_0xeb49('0x45')]);return db['ChatOfflineMessage']['count']({'where':_0x398834['where']})[_0xeb49('0x16')](function(_0x51d6ce){_0x380882['count']=_0x51d6ce;if(_0x29cdf3['query']['includeAll']){_0x398834[_0xeb49('0x46')]=[{'all':!![]}];}else{_0x398834[_0xeb49('0x46')]=[{'model':db[_0xeb49('0x7f')],'as':_0xeb49('0xeb'),'required':![]},{'model':db[_0xeb49('0xd6')],'as':_0xeb49('0x125'),'required':![]}];}return db['ChatOfflineMessage'][_0xeb49('0x47')](_0x398834);})[_0xeb49('0x16')](function(_0x16b856){_0x380882['rows']=_0x16b856;return _0x380882;});}})[_0xeb49('0x16')](respondWithFilteredResult(_0x5ce6ab,_0x398834))[_0xeb49('0x21')](handleError(_0x5ce6ab,null));};exports[_0xeb49('0x126')]=function(_0x5684b0,_0x3673a4){return db[_0xeb49('0x34')][_0xeb49('0x4a')]({'where':{'id':_0x5684b0[_0xeb49('0x48')]['id']}})['then'](handleEntityNotFound(_0x3673a4,null))[_0xeb49('0x16')](function(_0x32ad40){if(_0x32ad40){return _0x32ad40[_0xeb49('0x126')](_0x5684b0[_0xeb49('0x4b')][_0xeb49('0xea')],_['omit'](_0x5684b0[_0xeb49('0x4b')],[_0xeb49('0xea'),'id'])||{})[_0xeb49('0xc7')](function(_0x1b5997){for(var _0x11d73d=0x0;_0x11d73d<_0x5684b0[_0xeb49('0x4b')]['ids'][_0xeb49('0x3c')];_0x11d73d+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x5684b0[_0xeb49('0x4b')][_0xeb49('0xea')][_0x11d73d]),'ChatWebsiteId':Number(_0x5684b0[_0xeb49('0x48')]['id'])});}return _0x1b5997;});}})[_0xeb49('0x16')](respondWithResult(_0x3673a4,null))['catch'](handleError(_0x3673a4,null));};exports['removeAgents']=function(_0x5e4277,_0x22dae6){return db['ChatWebsite']['find']({'where':{'id':_0x5e4277['params']['id']}})[_0xeb49('0x16')](handleEntityNotFound(_0x22dae6,null))[_0xeb49('0x16')](function(_0x59dab5){if(_0x59dab5){return _0x59dab5[_0xeb49('0x127')](_0x5e4277[_0xeb49('0x37')][_0xeb49('0xea')])['then'](function(){if(_['isArray'](_0x5e4277[_0xeb49('0x37')][_0xeb49('0xea')])){for(var _0x19e16a=0x0;_0x19e16a<_0x5e4277[_0xeb49('0x37')]['ids'][_0xeb49('0x3c')];_0x19e16a+=0x1){socket[_0xeb49('0x128')](_0xeb49('0x129'),{'UserId':Number(_0x5e4277[_0xeb49('0x37')][_0xeb49('0xea')][_0x19e16a]),'ChatWebsiteId':Number(_0x5e4277[_0xeb49('0x48')]['id'])});}}else{socket[_0xeb49('0x128')]('userChatWebsite:remove',{'UserId':Number(_0x5e4277['query']['ids']),'ChatWebsiteId':Number(_0x5e4277[_0xeb49('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x22dae6,null))['catch'](handleError(_0x22dae6,null));};exports[_0xeb49('0x12a')]=function(_0x317db8,_0x2b7b33){var _0x5dedf8={};var _0x4145f0={};var _0x181c6b;var _0x5dab59;return db[_0xeb49('0x34')][_0xeb49('0x57')]({'where':{'id':_0x317db8['params']['id']}})['then'](handleEntityNotFound(_0x2b7b33,null))[_0xeb49('0x16')](function(_0x281886){if(_0x281886){_0x181c6b=_0x281886;_0x4145f0[_0xeb49('0x36')]=_[_0xeb49('0x38')](db[_0xeb49('0xec')]['rawAttributes']);_0x4145f0['query']=_['keys'](_0x317db8[_0xeb49('0x37')]);_0x4145f0[_0xeb49('0x40')]=_[_0xeb49('0x39')](_0x4145f0[_0xeb49('0x36')],_0x4145f0[_0xeb49('0x37')]);_0x5dedf8[_0xeb49('0x3a')]=_[_0xeb49('0x39')](_0x4145f0[_0xeb49('0x36')],qs[_0xeb49('0x3b')](_0x317db8[_0xeb49('0x37')][_0xeb49('0x3b')]));_0x5dedf8[_0xeb49('0x3a')]=_0x5dedf8[_0xeb49('0x3a')]['length']?_0x5dedf8['attributes']:_0x4145f0[_0xeb49('0x36')];_0x5dedf8[_0xeb49('0x3d')]=qs[_0xeb49('0x3e')](_0x317db8[_0xeb49('0x37')]['sort']);_0x5dedf8[_0xeb49('0x3f')]=qs['filters'](_[_0xeb49('0x41')](_0x317db8['query'],_0x4145f0[_0xeb49('0x40')]));if(_0x317db8[_0xeb49('0x37')][_0xeb49('0x44')]){_0x5dedf8[_0xeb49('0x3f')]=_['merge'](_0x5dedf8[_0xeb49('0x3f')],{'$or':_[_0xeb49('0x33')](_0x5dedf8[_0xeb49('0x3a')],function(_0x21bc77){var _0x54d652={};_0x54d652[_0x21bc77]={'$like':'%'+_0x317db8[_0xeb49('0x37')][_0xeb49('0x44')]+'%'};return _0x54d652;})});}_0x5dedf8=_[_0xeb49('0x42')]({},_0x5dedf8,_0x317db8[_0xeb49('0x45')]);return _0x181c6b[_0xeb49('0x12a')](_0x5dedf8);}})[_0xeb49('0x16')](function(_0x4ef6d9){if(_0x4ef6d9){_0x5dab59=_0x4ef6d9[_0xeb49('0x3c')];if(!_0x317db8[_0xeb49('0x37')]['hasOwnProperty'](_0xeb49('0x59'))){_0x5dedf8[_0xeb49('0x28')]=qs[_0xeb49('0x28')](_0x317db8[_0xeb49('0x37')]['limit']);_0x5dedf8['offset']=qs[_0xeb49('0x26')](_0x317db8['query'][_0xeb49('0x26')]);}return _0x181c6b['getAgents'](_0x5dedf8);}})[_0xeb49('0x16')](function(_0x12b918){if(_0x12b918){return _0x12b918?{'count':_0x5dab59,'rows':_0x12b918}:null;}})[_0xeb49('0x16')](respondWithResult(_0x2b7b33,null))['catch'](handleError(_0x2b7b33,null));};
\ No newline at end of file
+var _0xdcae=['filename','agentAvatar','file','addCustomerAvatar','customerAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','ChatApplication','Applications','account','applications','list','List','asc','Contacts','defaults','contact','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','forcedOwnership','Start','startRouting','EventManager','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','toPairsIn','mapValues','subjectOffline','offlineMessageSubject','Chat','MailAccountId','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','utf8','address','origin','remote','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','transaction','Transaction','READ_COMMITTED','priority','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','url','redis','./chatWebsite.socket','register','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','ChatWebsites','UserProfileResource','destroy','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','Pause','describe','Disposition','findOne','order','ChatWebsiteId','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic'];(function(_0x348c2e,_0x2f7125){var _0x43c95c=function(_0x501bd0){while(--_0x501bd0){_0x348c2e['push'](_0x348c2e['shift']());}};_0x43c95c(++_0x2f7125);}(_0xdcae,0x1f2));var _0xedca=function(_0x48ce56,_0x213bea){_0x48ce56=_0x48ce56-0x0;var _0x25e8a1=_0xdcae[_0x48ce56];return _0x25e8a1;};'use strict';var BPromise=require(_0xedca('0x0'));var Mustache=require(_0xedca('0x1'));var util=require(_0xedca('0x2'));var path=require(_0xedca('0x3'));var ejs=require(_0xedca('0x4'));var fs=require('fs');var fs_extra=require(_0xedca('0x5'));var _=require(_0xedca('0x6'));var querystring=require(_0xedca('0x7'));var Redis=require(_0xedca('0x8'));var qs=require(_0xedca('0x9'));var logger=require(_0xedca('0xa'))('api');var config=require(_0xedca('0xb'));var url=require(_0xedca('0xc'));var db=require('../../mysqldb')['db'];config[_0xedca('0xd')]=_['defaults'](config[_0xedca('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xedca('0xe'))[_0xedca('0xf')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson['client'][_0xedca('0x10')]({'port':0x232c});var client9002=jayson[_0xedca('0x11')][_0xedca('0x10')]({'port':0x232a});var client9003=jayson[_0xedca('0x11')][_0xedca('0x10')]({'port':0x232b});var client9001=jayson['client'][_0xedca('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x4e06f2,_0x312086,_0x223002,_0x40cd8e){return new BPromise(function(_0x2e2075,_0x482a42){var _0x1c81c1=_0x40cd8e||client;return _0x1c81c1[_0xedca('0x12')](_0x4e06f2,_0x223002)[_0xedca('0x13')](function(_0x4095b7){logger[_0xedca('0x14')](_0xedca('0x15'),_0x312086,_0xedca('0x16'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x312086,_0xedca('0x16'),JSON[_0xedca('0x17')](_0x4095b7));if(_0x4095b7['error']){if(_0x4095b7[_0xedca('0x18')][_0xedca('0x19')]===0x1f4){logger[_0xedca('0x18')](_0xedca('0x15'),_0x312086,_0x4095b7[_0xedca('0x18')][_0xedca('0x1a')]);return _0x482a42(_0x4095b7[_0xedca('0x18')][_0xedca('0x1a')]);}logger['error'](_0xedca('0x15'),_0x312086,_0x4095b7[_0xedca('0x18')]['message']);return _0x2e2075(_0x4095b7[_0xedca('0x18')]['message']);}else{logger['info'](_0xedca('0x15'),_0x312086,_0xedca('0x16'));_0x2e2075(_0x4095b7['result']['message']);}})[_0xedca('0x1b')](function(_0x128948){logger[_0xedca('0x18')](_0xedca('0x15'),_0x312086,_0x128948);_0x482a42(_0x128948);});});}function respondWithStatusCode(_0x5f4fe5,_0x3f3c61){_0x3f3c61=_0x3f3c61||0xcc;return function(_0xa2dc3c){if(_0xa2dc3c){return _0x5f4fe5[_0xedca('0x1c')](_0x3f3c61);}return _0x5f4fe5[_0xedca('0x1d')](_0x3f3c61)[_0xedca('0x1e')]();};}function respondWithResult(_0x411607,_0x59b9bc){_0x59b9bc=_0x59b9bc||0xc8;return function(_0x28a6ea){if(_0x28a6ea){return _0x411607['status'](_0x59b9bc)[_0xedca('0x1f')](_0x28a6ea);}};}function respondWithFilteredResult(_0x57e68a,_0x2814d3){return function(_0x16c42e){if(_0x16c42e){var _0x4801e5=typeof _0x2814d3[_0xedca('0x20')]==='undefined'&&typeof _0x2814d3[_0xedca('0x21')]==='undefined';var _0x4ea135=_0x16c42e[_0xedca('0x22')];var _0x91e817=_0x4801e5?0x0:_0x2814d3[_0xedca('0x20')];var _0xb7cf72=_0x4801e5?_0x16c42e[_0xedca('0x22')]:_0x2814d3[_0xedca('0x20')]+_0x2814d3[_0xedca('0x21')];var _0x551da5;if(_0xb7cf72>=_0x4ea135){_0xb7cf72=_0x4ea135;_0x551da5=0xc8;}else{_0x551da5=0xce;}_0x57e68a[_0xedca('0x1d')](_0x551da5);return _0x57e68a[_0xedca('0x23')](_0xedca('0x24'),_0x91e817+'-'+_0xb7cf72+'/'+_0x4ea135)[_0xedca('0x1f')](_0x16c42e);}return null;};}function saveUpdates(_0x2effe2){return function(_0x2fd74c){if(_0x2fd74c){return _0x2fd74c['update'](_0x2effe2)[_0xedca('0x13')](function(_0x57cd03){return _0x57cd03;});}return null;};}function removeEntity(_0x4bfd80){return function(_0x18f6a1){if(_0x18f6a1){return _0x18f6a1['destroy']()[_0xedca('0x13')](function(){var _0x2d09d3=_0x18f6a1['get']({'plain':!![]});var _0x588efa=_0xedca('0x25');return db[_0xedca('0x26')][_0xedca('0x27')]({'where':{'type':_0x588efa,'resourceId':_0x2d09d3['id']}})[_0xedca('0x13')](function(){return _0x18f6a1;});})[_0xedca('0x13')](function(){_0x4bfd80[_0xedca('0x1d')](0xcc)[_0xedca('0x1e')]();});}};}function handleEntityNotFound(_0x510e63){return function(_0x40d2a2){if(!_0x40d2a2){_0x510e63['sendStatus'](0x194);}return _0x40d2a2;};}function handleError(_0x1b20d8,_0x11b97a){_0x11b97a=_0x11b97a||0x1f4;return function(_0x14498b){logger['error'](_0x14498b[_0xedca('0x28')]);if(_0x14498b[_0xedca('0x29')]){delete _0x14498b[_0xedca('0x29')];}_0x1b20d8['status'](_0x11b97a)[_0xedca('0x2a')](_0x14498b);};}exports[_0xedca('0x2b')]=function(_0x8ef63d,_0x5b5019){var _0x413c67={'include':[{'model':db['Pause'],'as':_0xedca('0x2c')}]},_0x3eca09={},_0x42c501={'count':0x0,'rows':[]};var _0x4ba1ed=_[_0xedca('0x2d')](db[_0xedca('0x2e')]['rawAttributes'],function(_0x30500){return{'name':_0x30500['fieldName'],'type':_0x30500[_0xedca('0x2f')][_0xedca('0x30')]};});_0x3eca09[_0xedca('0x31')]=_[_0xedca('0x2d')](_0x4ba1ed,_0xedca('0x29'));_0x3eca09['query']=_[_0xedca('0x32')](_0x8ef63d[_0xedca('0x33')]);_0x3eca09[_0xedca('0x34')]=_[_0xedca('0x35')](_0x3eca09[_0xedca('0x31')],_0x3eca09[_0xedca('0x33')]);_0x413c67[_0xedca('0x36')]=_['intersection'](_0x3eca09['model'],qs[_0xedca('0x37')](_0x8ef63d[_0xedca('0x33')][_0xedca('0x37')]));_0x413c67[_0xedca('0x36')]=_0x413c67[_0xedca('0x36')][_0xedca('0x38')]?_0x413c67[_0xedca('0x36')]:_0x3eca09['model'];if(!_0x8ef63d[_0xedca('0x33')][_0xedca('0x39')](_0xedca('0x3a'))){_0x413c67['limit']=qs[_0xedca('0x21')](_0x8ef63d['query'][_0xedca('0x21')]);_0x413c67['offset']=qs[_0xedca('0x20')](_0x8ef63d['query'][_0xedca('0x20')]);}_0x413c67['order']=qs[_0xedca('0x3b')](_0x8ef63d[_0xedca('0x33')][_0xedca('0x3b')]);_0x413c67[_0xedca('0x3c')]=qs[_0xedca('0x34')](_[_0xedca('0x3d')](_0x8ef63d['query'],_0x3eca09[_0xedca('0x34')]),_0x4ba1ed);if(_0x8ef63d['query'][_0xedca('0x3e')]){_0x413c67[_0xedca('0x3c')]=_[_0xedca('0x3f')](_0x413c67[_0xedca('0x3c')],{'$or':_[_0xedca('0x2d')](_0x4ba1ed,function(_0xe67d3e){if(_0xe67d3e[_0xedca('0x2f')]!=='VIRTUAL'){var _0x4992f2={};_0x4992f2[_0xe67d3e[_0xedca('0x29')]]={'$like':'%'+_0x8ef63d[_0xedca('0x33')][_0xedca('0x3e')]+'%'};return _0x4992f2;}})});}_0x413c67=_['merge']({},_0x413c67,_0x8ef63d[_0xedca('0x40')]);var _0x10df5e={'where':_0x413c67[_0xedca('0x3c')]};return db[_0xedca('0x2e')][_0xedca('0x22')](_0x10df5e)[_0xedca('0x13')](function(_0x3f905b){_0x42c501[_0xedca('0x22')]=_0x3f905b;if(_0x8ef63d[_0xedca('0x33')]['includeAll']){_0x413c67[_0xedca('0x41')]=[{'all':!![]}];}return db[_0xedca('0x2e')][_0xedca('0x42')](_0x413c67);})['then'](function(_0x4119a8){_0x42c501[_0xedca('0x43')]=_0x4119a8;return _0x42c501;})[_0xedca('0x13')](respondWithFilteredResult(_0x5b5019,_0x413c67))[_0xedca('0x1b')](handleError(_0x5b5019,null));};exports['show']=function(_0x1f2ce0,_0x1c260c){var _0x3aff69={'raw':![],'where':{'id':_0x1f2ce0[_0xedca('0x44')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x43c383={};_0x43c383[_0xedca('0x31')]=_[_0xedca('0x32')](db[_0xedca('0x2e')][_0xedca('0x45')]);_0x43c383[_0xedca('0x33')]=_['keys'](_0x1f2ce0[_0xedca('0x33')]);_0x43c383[_0xedca('0x34')]=_['intersection'](_0x43c383['model'],_0x43c383[_0xedca('0x33')]);_0x3aff69['attributes']=_[_0xedca('0x35')](_0x43c383[_0xedca('0x31')],qs[_0xedca('0x37')](_0x1f2ce0['query'][_0xedca('0x37')]));_0x3aff69['attributes']=_0x3aff69[_0xedca('0x36')][_0xedca('0x38')]?_0x3aff69[_0xedca('0x36')]:_0x43c383[_0xedca('0x31')];if(_0x1f2ce0[_0xedca('0x33')][_0xedca('0x46')]){_0x3aff69[_0xedca('0x41')]=[{'all':!![]}];}_0x3aff69=_[_0xedca('0x3f')]({},_0x3aff69,_0x1f2ce0[_0xedca('0x40')]);return db[_0xedca('0x2e')][_0xedca('0x47')](_0x3aff69)[_0xedca('0x13')](handleEntityNotFound(_0x1c260c,null))['then'](respondWithResult(_0x1c260c,null))[_0xedca('0x1b')](handleError(_0x1c260c,null));};exports[_0xedca('0x48')]=function(_0x2d57bf,_0x2ca5c2){return db[_0xedca('0x2e')][_0xedca('0x48')](_0x2d57bf[_0xedca('0x49')],{})['then'](function(_0x9d3d0c){var _0x3b69a4=_0x2d57bf[_0xedca('0x4a')][_0xedca('0x4b')]({'plain':!![]});if(!_0x3b69a4)throw new Error(_0xedca('0x4c'));if(_0x3b69a4['role']===_0xedca('0x4a')){var _0x232197=_0x9d3d0c[_0xedca('0x4b')]({'plain':!![]});var _0x36cc88='ChatWebsites';return db[_0xedca('0x4d')][_0xedca('0x47')]({'where':{'name':_0x36cc88,'userProfileId':_0x3b69a4[_0xedca('0x4e')]},'raw':!![]})[_0xedca('0x13')](function(_0x1b5a3e){if(_0x1b5a3e&&_0x1b5a3e['autoAssociation']===0x0){return db[_0xedca('0x26')][_0xedca('0x48')]({'name':_0x232197['name'],'resourceId':_0x232197['id'],'type':_0x1b5a3e[_0xedca('0x29')],'sectionId':_0x1b5a3e['id']},{})[_0xedca('0x13')](function(){return _0x9d3d0c;});}else{return _0x9d3d0c;}})['catch'](function(_0x12efdd){logger['error'](_0xedca('0x4f'),_0x12efdd);throw _0x12efdd;});}return _0x9d3d0c;})['then'](respondWithResult(_0x2ca5c2,0xc9))[_0xedca('0x1b')](handleError(_0x2ca5c2,null));};exports[_0xedca('0x50')]=function(_0x4279a0,_0x50c5c6){if(_0x4279a0[_0xedca('0x49')]['id']){delete _0x4279a0['body']['id'];}return db[_0xedca('0x2e')]['find']({'where':{'id':_0x4279a0['params']['id']},'include':[{'model':db[_0xedca('0x51')],'as':_0xedca('0x2c')}]})[_0xedca('0x13')](handleEntityNotFound(_0x50c5c6,null))['then'](saveUpdates(_0x4279a0[_0xedca('0x49')],null))['then'](respondWithResult(_0x50c5c6,null))[_0xedca('0x1b')](handleError(_0x50c5c6,null));};exports['destroy']=function(_0xf6ef65,_0x1598ad){return db[_0xedca('0x2e')][_0xedca('0x47')]({'where':{'id':_0xf6ef65['params']['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x1598ad,null))[_0xedca('0x13')](removeEntity(_0x1598ad,null))['catch'](handleError(_0x1598ad,null));};exports[_0xedca('0x52')]=function(_0x5f0488,_0x523185){return db['ChatWebsite']['describe']()[_0xedca('0x13')](respondWithResult(_0x523185,null))[_0xedca('0x1b')](handleError(_0x523185,null));};exports['addDisposition']=function(_0x53cc70,_0x4332e9){if(_0x53cc70['body']['id']){delete _0x53cc70[_0xedca('0x49')]['id'];}return db[_0xedca('0x2e')][_0xedca('0x47')]({'where':{'id':_0x53cc70[_0xedca('0x44')]['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x4332e9,null))[_0xedca('0x13')](function(_0x39e055){if(_0x39e055){_0x53cc70[_0xedca('0x49')]['ChatWebsiteId']=_0x39e055['id'];return db[_0xedca('0x53')]['create'](_0x53cc70[_0xedca('0x49')]);}})[_0xedca('0x13')](respondWithResult(_0x4332e9,null))['catch'](handleError(_0x4332e9,null));};exports['getDispositions']=function(_0x427bd8,_0x4a9409){var _0x316dfe={'raw':![],'where':{}};var _0x8bbeb9={};var _0x505178={'count':0x0,'rows':[]};return db[_0xedca('0x2e')][_0xedca('0x54')]({'where':{'id':_0x427bd8['params']['id']}})['then'](handleEntityNotFound(_0x4a9409,null))[_0xedca('0x13')](function(_0x30620e){if(_0x30620e){_0x8bbeb9[_0xedca('0x31')]=_[_0xedca('0x32')](db[_0xedca('0x53')][_0xedca('0x45')]);_0x8bbeb9[_0xedca('0x33')]=_[_0xedca('0x32')](_0x427bd8[_0xedca('0x33')]);_0x8bbeb9[_0xedca('0x34')]=_['intersection'](_0x8bbeb9[_0xedca('0x31')],_0x8bbeb9[_0xedca('0x33')]);_0x316dfe[_0xedca('0x36')]=_[_0xedca('0x35')](_0x8bbeb9['model'],qs[_0xedca('0x37')](_0x427bd8[_0xedca('0x33')]['fields']));_0x316dfe['attributes']=_0x316dfe[_0xedca('0x36')][_0xedca('0x38')]?_0x316dfe[_0xedca('0x36')]:_0x8bbeb9[_0xedca('0x31')];if(!_0x427bd8[_0xedca('0x33')][_0xedca('0x39')](_0xedca('0x3a'))){_0x316dfe[_0xedca('0x21')]=qs[_0xedca('0x21')](_0x427bd8['query'][_0xedca('0x21')]);_0x316dfe[_0xedca('0x20')]=qs[_0xedca('0x20')](_0x427bd8[_0xedca('0x33')][_0xedca('0x20')]);}_0x316dfe[_0xedca('0x55')]=qs[_0xedca('0x3b')](_0x427bd8[_0xedca('0x33')][_0xedca('0x3b')]);_0x316dfe[_0xedca('0x3c')]=qs[_0xedca('0x34')](_[_0xedca('0x3d')](_0x427bd8[_0xedca('0x33')],_0x8bbeb9[_0xedca('0x34')]));_0x316dfe[_0xedca('0x3c')][_0xedca('0x56')]=_0x30620e['id'];if(_0x427bd8[_0xedca('0x33')][_0xedca('0x3e')]){_0x316dfe[_0xedca('0x3c')]=_[_0xedca('0x3f')](_0x316dfe['where'],{'$or':_[_0xedca('0x2d')](_0x316dfe['attributes'],function(_0x1a6f12){var _0x465530={};_0x465530[_0x1a6f12]={'$like':'%'+_0x427bd8[_0xedca('0x33')][_0xedca('0x3e')]+'%'};return _0x465530;})});}_0x316dfe=_[_0xedca('0x3f')]({},_0x316dfe,_0x427bd8[_0xedca('0x40')]);return db[_0xedca('0x53')][_0xedca('0x22')]({'where':_0x316dfe[_0xedca('0x3c')]})[_0xedca('0x13')](function(_0x1f73d5){_0x505178[_0xedca('0x22')]=_0x1f73d5;if(_0x427bd8[_0xedca('0x33')][_0xedca('0x46')]){_0x316dfe[_0xedca('0x41')]=[{'all':!![]}];}return db[_0xedca('0x53')][_0xedca('0x42')](_0x316dfe);})[_0xedca('0x13')](function(_0x5a260b){_0x505178[_0xedca('0x43')]=_0x5a260b;return _0x505178;});}})['then'](respondWithFilteredResult(_0x4a9409,_0x316dfe))['catch'](handleError(_0x4a9409,null));};exports[_0xedca('0x57')]=function(_0x33a371,_0x4b4def){return db[_0xedca('0x2e')][_0xedca('0x47')]({'where':{'id':_0x33a371[_0xedca('0x44')]['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x4b4def,null))[_0xedca('0x13')](function(_0x618e6a){if(_0x618e6a){return _0x618e6a[_0xedca('0x57')](_0x33a371['query'][_0xedca('0x58')]);}})['then'](respondWithStatusCode(_0x4b4def,null))[_0xedca('0x1b')](handleError(_0x4b4def,null));};exports['addAnswer']=function(_0x3a5e32,_0x3d01a5){if(_0x3a5e32['body']['id']){delete _0x3a5e32['body']['id'];}return db[_0xedca('0x2e')][_0xedca('0x47')]({'where':{'id':_0x3a5e32[_0xedca('0x44')]['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x3d01a5,null))[_0xedca('0x13')](function(_0x3b61d9){if(_0x3b61d9){_0x3a5e32[_0xedca('0x49')][_0xedca('0x56')]=_0x3b61d9['id'];return db[_0xedca('0x59')]['create'](_0x3a5e32[_0xedca('0x49')]);}})[_0xedca('0x13')](respondWithResult(_0x3d01a5,null))['catch'](handleError(_0x3d01a5,null));};exports[_0xedca('0x5a')]=function(_0x9fb5c6,_0x55360a){var _0x16b8a2={'raw':![],'where':{}};var _0x52a85e={};var _0x31f90b={'count':0x0,'rows':[]};return db[_0xedca('0x2e')][_0xedca('0x54')]({'where':{'id':_0x9fb5c6[_0xedca('0x44')]['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x55360a,null))['then'](function(_0x42f20e){if(_0x42f20e){_0x52a85e[_0xedca('0x31')]=_['keys'](db[_0xedca('0x59')]['rawAttributes']);_0x52a85e[_0xedca('0x33')]=_['keys'](_0x9fb5c6['query']);_0x52a85e[_0xedca('0x34')]=_[_0xedca('0x35')](_0x52a85e[_0xedca('0x31')],_0x52a85e['query']);_0x16b8a2[_0xedca('0x36')]=_['intersection'](_0x52a85e[_0xedca('0x31')],qs[_0xedca('0x37')](_0x9fb5c6['query'][_0xedca('0x37')]));_0x16b8a2[_0xedca('0x36')]=_0x16b8a2[_0xedca('0x36')][_0xedca('0x38')]?_0x16b8a2[_0xedca('0x36')]:_0x52a85e['model'];if(!_0x9fb5c6[_0xedca('0x33')][_0xedca('0x39')](_0xedca('0x3a'))){_0x16b8a2[_0xedca('0x21')]=qs['limit'](_0x9fb5c6[_0xedca('0x33')][_0xedca('0x21')]);_0x16b8a2[_0xedca('0x20')]=qs[_0xedca('0x20')](_0x9fb5c6[_0xedca('0x33')]['offset']);}_0x16b8a2[_0xedca('0x55')]=qs[_0xedca('0x3b')](_0x9fb5c6[_0xedca('0x33')][_0xedca('0x3b')]);_0x16b8a2[_0xedca('0x3c')]=qs['filters'](_[_0xedca('0x3d')](_0x9fb5c6[_0xedca('0x33')],_0x52a85e[_0xedca('0x34')]));_0x16b8a2['where'][_0xedca('0x56')]=_0x42f20e['id'];if(_0x9fb5c6[_0xedca('0x33')][_0xedca('0x3e')]){_0x16b8a2[_0xedca('0x3c')]=_[_0xedca('0x3f')](_0x16b8a2[_0xedca('0x3c')],{'$or':_['map'](_0x16b8a2[_0xedca('0x36')],function(_0x327608){var _0x4414c7={};_0x4414c7[_0x327608]={'$like':'%'+_0x9fb5c6[_0xedca('0x33')][_0xedca('0x3e')]+'%'};return _0x4414c7;})});}_0x16b8a2=_[_0xedca('0x3f')]({},_0x16b8a2,_0x9fb5c6[_0xedca('0x40')]);return db['CannedAnswer'][_0xedca('0x22')]({'where':_0x16b8a2[_0xedca('0x3c')]})['then'](function(_0x24f3b8){_0x31f90b[_0xedca('0x22')]=_0x24f3b8;if(_0x9fb5c6[_0xedca('0x33')][_0xedca('0x46')]){_0x16b8a2[_0xedca('0x41')]=[{'all':!![]}];}return db['CannedAnswer'][_0xedca('0x42')](_0x16b8a2);})[_0xedca('0x13')](function(_0x505290){_0x31f90b[_0xedca('0x43')]=_0x505290;return _0x31f90b;});}})[_0xedca('0x13')](respondWithFilteredResult(_0x55360a,_0x16b8a2))['catch'](handleError(_0x55360a,null));};exports[_0xedca('0x5b')]=function(_0x383622,_0x24e2b3){return db[_0xedca('0x2e')][_0xedca('0x47')]({'where':{'id':_0x383622[_0xedca('0x44')]['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x24e2b3,null))['then'](function(_0x21acc9){if(_0x21acc9){return _0x21acc9[_0xedca('0x5b')](_0x383622[_0xedca('0x33')][_0xedca('0x58')]);}})[_0xedca('0x13')](respondWithStatusCode(_0x24e2b3,null))[_0xedca('0x1b')](handleError(_0x24e2b3,null));};exports[_0xedca('0x5c')]=function(_0x5932af,_0x2ae220){_0x5932af[_0xedca('0x49')][_0xedca('0x5d')]=_0x5932af['file'][_0xedca('0x5e')];return db[_0xedca('0x2e')][_0xedca('0x47')]({'where':{'id':_0x5932af[_0xedca('0x44')]['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x2ae220,null))[_0xedca('0x13')](saveUpdates(_0x5932af[_0xedca('0x49')],null))[_0xedca('0x13')](respondWithResult(_0x2ae220,null))[_0xedca('0x1b')](handleError(_0x2ae220,null));};exports['addAvatar']=function(_0xca5857,_0x2a1c30){_0xca5857[_0xedca('0x49')][_0xedca('0x5f')]=_0xca5857[_0xedca('0x60')]['filename'];return db[_0xedca('0x2e')][_0xedca('0x47')]({'where':{'id':_0xca5857['params']['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x2a1c30,null))['then'](saveUpdates(_0xca5857[_0xedca('0x49')],null))[_0xedca('0x13')](respondWithResult(_0x2a1c30,null))[_0xedca('0x1b')](handleError(_0x2a1c30,null));};exports[_0xedca('0x61')]=function(_0x1a7470,_0x1d193c){_0x1a7470['body'][_0xedca('0x62')]=_0x1a7470[_0xedca('0x60')][_0xedca('0x5e')];return db[_0xedca('0x2e')][_0xedca('0x47')]({'where':{'id':_0x1a7470['params']['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x1d193c,null))[_0xedca('0x13')](saveUpdates(_0x1a7470[_0xedca('0x49')],null))[_0xedca('0x13')](respondWithResult(_0x1d193c,null))[_0xedca('0x1b')](handleError(_0x1d193c,null));};exports['addSystemAvatar']=function(_0x360ac7,_0x26cdee){_0x360ac7[_0xedca('0x49')][_0xedca('0x63')]=_0x360ac7['file'][_0xedca('0x5e')];return db[_0xedca('0x2e')][_0xedca('0x47')]({'where':{'id':_0x360ac7[_0xedca('0x44')]['id']}})['then'](handleEntityNotFound(_0x26cdee,null))['then'](saveUpdates(_0x360ac7[_0xedca('0x49')],null))[_0xedca('0x13')](respondWithResult(_0x26cdee,null))[_0xedca('0x1b')](handleError(_0x26cdee,null));};exports['getLogo']=function(_0x5330a7,_0x4a172b){var _0x59a2ed=path[_0xedca('0x64')](config['root'],_0xedca('0x65'));var _0x3ab202={'where':{'id':_0x5330a7['params']['id']},'attributes':['id',_0xedca('0x5d')],'raw':!![]};var _0x1cb4da=![];return require(_0xedca('0x66'))[_0xedca('0x67')]()['then'](function(_0x235f6f){if(_0x235f6f){_0x1cb4da=_0x235f6f[_0xedca('0x68')];}})[_0xedca('0x13')](function(){return db['ChatWebsite'][_0xedca('0x47')](_0x3ab202);})[_0xedca('0x13')](handleEntityNotFound(_0x4a172b,null))['then'](function(_0x1fcbfa){if(_0x1fcbfa){if(!_[_0xedca('0x69')](_0x1fcbfa['sitepic'])){if(fs[_0xedca('0x6a')](path[_0xedca('0x64')](config[_0xedca('0x6b')],'server/files/images/logos/',_0x1fcbfa['sitepic']))&&_0x1cb4da){_0x59a2ed=path[_0xedca('0x64')](config[_0xedca('0x6b')],_0xedca('0x6c'),_0x1fcbfa['sitepic']);}}return _0x4a172b[_0xedca('0x6d')](_0x59a2ed);}})[_0xedca('0x1b')](handleError(_0x4a172b,null));};exports[_0xedca('0x6e')]=function(_0xb64249,_0x19d24f){var _0x3de884=path[_0xedca('0x64')](config[_0xedca('0x6b')],_0xedca('0x6f'));var _0x958c6a={'where':{'id':_0xb64249['params']['id']},'attributes':['id',_0xedca('0x5f')],'raw':!![]};return db[_0xedca('0x2e')][_0xedca('0x47')](_0x958c6a)[_0xedca('0x13')](handleEntityNotFound(_0x19d24f,null))['then'](function(_0x367ac5){if(_0x367ac5){if(!_[_0xedca('0x69')](_0x367ac5[_0xedca('0x5f')])){if(fs['existsSync'](path[_0xedca('0x64')](config['root'],'server/files/images/avatars/',_0x367ac5[_0xedca('0x5f')]))){_0x3de884=path['join'](config[_0xedca('0x6b')],'server/files/images/avatars/',_0x367ac5['agentAvatar']);}}return _0x19d24f[_0xedca('0x6d')](_0x3de884);}})['catch'](handleError(_0x19d24f,null));};exports[_0xedca('0x70')]=function(_0x590ecc,_0x5eded4){var _0x3a61e3=path[_0xedca('0x64')](config['root'],_0xedca('0x71'));var _0x138927={'where':{'id':_0x590ecc[_0xedca('0x44')]['id']},'attributes':['id',_0xedca('0x62'),'showCustomerAvatar'],'raw':!![]};return db[_0xedca('0x2e')][_0xedca('0x47')](_0x138927)[_0xedca('0x13')](handleEntityNotFound(_0x5eded4,null))[_0xedca('0x13')](function(_0x5d966c){if(_0x5d966c){if(!_[_0xedca('0x69')](_0x5d966c[_0xedca('0x62')])){if(fs[_0xedca('0x6a')](path['join'](config['root'],'server/files/images/avatars/',_0x5d966c[_0xedca('0x62')]))&&_0x5d966c[_0xedca('0x72')]){_0x3a61e3=path[_0xedca('0x64')](config[_0xedca('0x6b')],_0xedca('0x73'),_0x5d966c['customerAvatar']);}}return _0x5eded4['download'](_0x3a61e3);}})['catch'](handleError(_0x5eded4,null));};exports[_0xedca('0x74')]=function(_0x3e9a74,_0x4846d8){var _0x41887b=path[_0xedca('0x64')](config[_0xedca('0x6b')],'server/files/images/avatars/system_avatar.png');var _0x12b17e={'where':{'id':_0x3e9a74[_0xedca('0x44')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xedca('0x2e')][_0xedca('0x47')](_0x12b17e)[_0xedca('0x13')](handleEntityNotFound(_0x4846d8,null))['then'](function(_0x2a50b4){if(_0x2a50b4){if(!_[_0xedca('0x69')](_0x2a50b4['systemAvatar'])){if(fs[_0xedca('0x6a')](path[_0xedca('0x64')](config['root'],_0xedca('0x73'),_0x2a50b4[_0xedca('0x63')]))){_0x41887b=path[_0xedca('0x64')](config[_0xedca('0x6b')],_0xedca('0x73'),_0x2a50b4[_0xedca('0x63')]);}}return _0x4846d8[_0xedca('0x6d')](_0x41887b);}})[_0xedca('0x1b')](handleError(_0x4846d8,null));};exports[_0xedca('0x75')]=function(_0x3176d4,_0x563cfe){var _0x5d22bf=require(_0xedca('0x76'));var _0x5584a8=new _0x5d22bf();var _0x1b95d0=_0x5584a8[_0xedca('0x77')](_0x3176d4[_0xedca('0x78')][_0xedca('0x79')])[_0xedca('0x7a')]();var _0x1c40a0={'body':_0x3176d4[_0xedca('0x49')],'channel':_0xedca('0x7b')};var _0xadf3cc=[];var _0x3a4585=[];var _0x124e03={};var _0x41b387=![];return db[_0xedca('0x7c')][_0xedca('0x52')]()[_0xedca('0x13')](function(_0x4a26a3){if(!_0x4a26a3){throw new db[(_0xedca('0x7d'))][(_0xedca('0x7e'))](_0xedca('0x7f'));}_0xadf3cc=_['difference'](_['keys'](_0x4a26a3),[_0xedca('0x80'),_0xedca('0x81')]);_0x3a4585=_[_0xedca('0x82')](_[_0xedca('0x32')](_0x4a26a3),[_0xedca('0x80'),_0xedca('0x81'),_0xedca('0x83'),_0xedca('0x84')]);if(_0x3176d4[_0xedca('0x49')]['id']){delete _0x3176d4[_0xedca('0x49')]['id'];}if(_['isNil'](_0x3176d4[_0xedca('0x49')][_0xedca('0x85')])){throw new db[(_0xedca('0x7d'))][(_0xedca('0x7e'))](_0xedca('0x86'));}if(_[_0xedca('0x69')](_0x3176d4['body'][_0xedca('0x49')])||_0x3176d4[_0xedca('0x49')][_0xedca('0x49')]===''){throw new db[(_0xedca('0x7d'))][(_0xedca('0x7e'))](_0xedca('0x87'));}if(_[_0xedca('0x69')](_0x3176d4[_0xedca('0x49')][_0xedca('0x88')])){throw new db['Sequelize'][(_0xedca('0x7e'))](_0xedca('0x89')+_0x3a4585);}if(!_[_0xedca('0x8a')](_0x3a4585,_0x3176d4['body'][_0xedca('0x88')])){throw new db[(_0xedca('0x7d'))][(_0xedca('0x7e'))](_0xedca('0x8b')+_0x3a4585);}_0x124e03[_0x3176d4[_0xedca('0x49')][_0xedca('0x88')]]=_0x3176d4[_0xedca('0x49')]['from'];})[_0xedca('0x13')](function(){return db['ChatWebsite'][_0xedca('0x47')]({'where':{'id':_0x3176d4[_0xedca('0x44')]['id']},'include':[{'model':db[_0xedca('0x8c')],'as':'List','include':[{'model':db[_0xedca('0x7c')],'as':'Contacts','where':_0x124e03,'limit':0x1,'order':[[_0xedca('0x81'),_0xedca('0x8d')]]}]},{'model':db[_0xedca('0x8e')],'as':_0xedca('0x8f')}]});})[_0xedca('0x13')](handleEntityNotFound(_0x563cfe,null))[_0xedca('0x13')](function(_0x1b6c0c){if(_0x1b6c0c&&_0x1b6c0c['List']){_0x1c40a0[_0xedca('0x90')]=_0x1b6c0c;_0x1c40a0[_0xedca('0x91')]=_0x1b6c0c['Applications'];_0x1c40a0[_0xedca('0x92')]=_0x1b6c0c[_0xedca('0x93')];_0x1c40a0[_0xedca('0x91')]=_['orderBy'](_0x1c40a0[_0xedca('0x91')],['priority'],[_0xedca('0x94')]);if(_0x1c40a0[_0xedca('0x90')][_0xedca('0x8f')]){delete _0x1c40a0['account'][_0xedca('0x8f')];}if(_0x1c40a0['account']['List']&&_0x1c40a0[_0xedca('0x90')]['List'][_0xedca('0x95')][_0xedca('0x38')]){return _0x1c40a0[_0xedca('0x90')][_0xedca('0x93')]['Contacts'][0x0];}var _0x3c600b=_[_0xedca('0x96')](_0x3176d4[_0xedca('0x49')],{'firstName':_0x3176d4[_0xedca('0x49')][_0xedca('0x85')],'ListId':_0x1b6c0c[_0xedca('0x84')]});_0x3c600b[_0x3176d4[_0xedca('0x49')][_0xedca('0x88')]]=_0x3176d4['body'][_0xedca('0x85')];return db[_0xedca('0x7c')][_0xedca('0x48')](_0x3c600b,{'fields':_0xadf3cc,'raw':!![]});}})['then'](handleEntityNotFound(_0x563cfe,null))[_0xedca('0x13')](function(_0x274e3a){_0x1c40a0[_0xedca('0x97')]=_0x274e3a;var _0x2fdcc4=_0x3176d4['body']['customerIp'];if(_0x3176d4['headers'][_0xedca('0x98')]){_0x2fdcc4=_0x3176d4[_0xedca('0x78')]['cf-connecting-ip'];}else if(_0x3176d4[_0xedca('0x78')]['x-forwarded-for']){_0x2fdcc4=_[_0xedca('0x99')](_0x3176d4[_0xedca('0x78')][_0xedca('0x9a')][_0xedca('0x9b')](','));}if(_0x274e3a){var _0x540d84={'ContactId':_0x274e3a['id'],'ChatWebsiteId':_0x3176d4[_0xedca('0x44')]['id'],'from':(_0x274e3a[_0xedca('0x9c')]||'')+'\x20'+(_0x274e3a[_0xedca('0x9d')]||''),'customerIp':_0x2fdcc4,'customerPort':_0x3176d4[_0xedca('0x78')][_0xedca('0x9e')]?_0x3176d4['headers'][_0xedca('0x9e')]:null,'referer':_0x3176d4[_0xedca('0x49')][_0xedca('0x9f')],'browserName':_0x1b95d0[_0xedca('0xa0')][_0xedca('0x29')]&&_0x1b95d0[_0xedca('0xa0')][_0xedca('0xa1')]?util[_0xedca('0xa2')](_0xedca('0xa3'),_0x1b95d0[_0xedca('0xa0')][_0xedca('0x29')],_0x1b95d0[_0xedca('0xa0')][_0xedca('0xa1')]):_0xedca('0xa4'),'browserVersion':_0x1b95d0[_0xedca('0xa0')]['version']||_0xedca('0xa4'),'osName':util[_0xedca('0xa2')]('%s\x20%s',_0x1b95d0['os'][_0xedca('0x29')],_0x1b95d0['os'][_0xedca('0xa1')]),'osVersion':_0x1b95d0['os'][_0xedca('0xa1')],'deviceModel':_0x1b95d0[_0xedca('0xa5')][_0xedca('0x31')]&&_0x1b95d0[_0xedca('0xa5')]['vendor']?util['format'](_0xedca('0xa6'),_0x1b95d0['device'][_0xedca('0x31')],_0x1b95d0[_0xedca('0xa5')][_0xedca('0xa7')],_0x1b95d0[_0xedca('0xa5')][_0xedca('0x2f')]):null,'deviceVendor':_0x1b95d0['device'][_0xedca('0xa7')],'deviceType':_0x1b95d0['device']['type'],'formData':JSON['stringify'](_0x3176d4[_0xedca('0x49')])};var _0x4c3d27={'ChatWebsiteId':_0x3176d4['params']['id'],'closed':![]};if(_0x3176d4[_0xedca('0x49')][_0xedca('0xa8')]){_0x4c3d27[_0xedca('0xa8')]=_0x3176d4[_0xedca('0x49')]['threadId'];return db[_0xedca('0xa9')][_0xedca('0x47')]({'where':_0x4c3d27})[_0xedca('0x13')](function(_0x33aa35){if(_0x33aa35){return[_0x33aa35,![]];}_0x540d84[_0xedca('0xa8')]=_0x3176d4[_0xedca('0x49')][_0xedca('0xa8')];_0x540d84[_0xedca('0xaa')]=_0x3176d4[_0xedca('0x49')][_0xedca('0xaa')];return db[_0xedca('0xa9')]['create'](_0x540d84)[_0xedca('0x13')](function(_0x173028){return[_0x173028,!![]];});});}_0x4c3d27[_0xedca('0xab')]=_0x274e3a['id'];if(_0x3176d4[_0xedca('0x49')][_0xedca('0xac')]&&_0x3176d4[_0xedca('0x49')][_0xedca('0xac')]['id']){_0x4c3d27['id']=_0x3176d4[_0xedca('0x49')][_0xedca('0xac')]['id'];return db['ChatInteraction'][_0xedca('0x47')]({'where':_0x4c3d27})[_0xedca('0x13')](function(_0x33c50a){if(_0x33c50a){return[_0x33c50a,![]];}return db[_0xedca('0xa9')]['create'](_0x540d84)[_0xedca('0x13')](function(_0x22c739){return[_0x22c739,!![]];});});}return db[_0xedca('0xa9')]['create'](_0x540d84)[_0xedca('0x13')](function(_0x4fd17e){return[_0x4fd17e,!![]];});}})[_0xedca('0xad')](function(_0x173ab2,_0x4a9887){if(_0x173ab2){_0x41b387=_0x4a9887;if(!_0x4a9887){var _0x557372={'from':(_0x1c40a0[_0xedca('0x97')]['firstName']||'')+'\x20'+(_0x1c40a0['contact'][_0xedca('0x9d')]||'')};if(_0x3176d4[_0xedca('0x49')][_0xedca('0xa8')]&&_0x3176d4[_0xedca('0x49')][_0xedca('0xae')]&&_0x3176d4[_0xedca('0x49')][_0xedca('0xa8')]!=_0x3176d4['body'][_0xedca('0xae')]){_0x557372[_0xedca('0xa8')]=_0x3176d4[_0xedca('0x49')][_0xedca('0xae')];}return _0x173ab2[_0xedca('0x50')](_0x557372);}else{return _0x173ab2;}}})[_0xedca('0x13')](function(_0x442ef8){_0x1c40a0[_0xedca('0xac')]=_0x442ef8[_0xedca('0x4b')]({'plain':!![]});_0x1c40a0[_0xedca('0xac')][_0xedca('0xaf')]=_0x41b387;if(_0x1c40a0['interaction'][_0xedca('0xaf')]){if(_0x1c40a0[_0xedca('0x90')][_0xedca('0xb0')]){_0x1c40a0['applications'][_0xedca('0xb1')]({'id':0x0,'priority':_0x1c40a0[_0xedca('0x91')][_0xedca('0x38')]+0x1,'app':_0xedca('0xb2'),'appdata':'unmanaged','interval':_0xedca('0xb3')});}}return db[_0xedca('0xb4')][_0xedca('0x48')]({'body':_0x3176d4[_0xedca('0x49')]['body'],'ChatWebsiteId':_0x3176d4['params']['id'],'ChatInteractionId':_0x442ef8['id'],'direction':'in','ContactId':_0x1c40a0[_0xedca('0x97')]['id'],'AttachmentId':_0x3176d4[_0xedca('0x49')][_0xedca('0xb5')]});})[_0xedca('0x13')](function(_0x2f0590){_0x1c40a0[_0xedca('0x1a')]=_0x2f0590;if(_0x1c40a0[_0xedca('0xac')][_0xedca('0xb6')]){return db[_0xedca('0xb7')][_0xedca('0x47')]({'attributes':['id','name'],'where':{'id':_0x1c40a0['interaction'][_0xedca('0xb6')]}})[_0xedca('0x13')](function(_0x30c370){if(_0x30c370){_0x1c40a0[_0xedca('0x91')][_0xedca('0xb8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x30c370[_0xedca('0x29')]+','+(_0x1c40a0[_0xedca('0x90')]['waitForTheAssignedAgent']||0xa),'interval':_0xedca('0xb3')});_0x1c40a0[_0xedca('0xb9')]=!![];}return respondWithRpcPromise(_0xedca('0xba'),'startRouting',_0x1c40a0);});}return respondWithRpcPromise('Start',_0xedca('0xbb'),_0x1c40a0);})[_0xedca('0x13')](function(_0x442c58){respondWithRpcPromise(_0xedca('0xbc'),_0xedca('0xbc'),{'event':_0xedca('0x75'),'message':_0x442c58},client9002);return _0x442c58;})[_0xedca('0x13')](respondWithResult(_0x563cfe,null))[_0xedca('0x1b')](handleError(_0x563cfe,null));};exports['offline']=function(_0x2a6eee,_0x512896){var _0x4eb863,_0x2029fc,_0x413f0c;var _0x1004ed=[];var _0x47377d={};var _0x2e12d6=_0x2a6eee[_0xedca('0xbd')]||[];var _0x38128f=[];var _0x22938f;return db[_0xedca('0x7c')][_0xedca('0x52')]()[_0xedca('0x13')](function(_0x41bbde){if(!_0x41bbde){throw new db['Sequelize']['ValidationError'](_0xedca('0x7f'));}_0x1004ed=_[_0xedca('0x82')](_[_0xedca('0x32')](_0x41bbde),[_0xedca('0x80'),_0xedca('0x81'),_0xedca('0x83'),'ListId']);if(_0x2a6eee[_0xedca('0x49')]['id']){delete _0x2a6eee[_0xedca('0x49')]['id'];}if(_[_0xedca('0x69')](_0x2a6eee[_0xedca('0x49')][_0xedca('0x85')])){throw _0x512896[_0xedca('0x1d')](0x1f4)[_0xedca('0x2a')](new db[(_0xedca('0x7d'))][(_0xedca('0x7e'))](_0xedca('0x86')));}if(_[_0xedca('0x69')](_0x2a6eee['body'][_0xedca('0x49')])||_0x2a6eee[_0xedca('0x49')][_0xedca('0x49')]===''){throw _0x512896['status'](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0xedca('0x87')));}if(_[_0xedca('0x69')](_0x2a6eee[_0xedca('0x49')]['mapKeyOffline'])){throw _0x512896[_0xedca('0x1d')](0x1f4)[_0xedca('0x2a')](new db[(_0xedca('0x7d'))][(_0xedca('0x7e'))](_0xedca('0xbe')+_0x1004ed));}if(!_['includes'](_0x1004ed,_0x2a6eee[_0xedca('0x49')][_0xedca('0xbf')])){throw _0x512896[_0xedca('0x1d')](0x1f4)[_0xedca('0x2a')](new db[(_0xedca('0x7d'))][(_0xedca('0x7e'))](_0xedca('0xc0')+_0x1004ed));}_0x47377d[_0x2a6eee[_0xedca('0x49')][_0xedca('0xbf')]]=_0x2a6eee['body'][_0xedca('0x85')];})[_0xedca('0x13')](function(){return db[_0xedca('0x2e')][_0xedca('0x47')]({'where':{'id':_0x2a6eee[_0xedca('0x44')]['id']},'include':[{'model':db['CmList'],'as':_0xedca('0x93')},{'model':db[_0xedca('0xc1')],'as':_0xedca('0xc1')}]});})['then'](handleEntityNotFound(_0x512896,null))[_0xedca('0x13')](function(_0x5a6659){if(_0x5a6659&&_0x5a6659[_0xedca('0x93')]){_0x2029fc=_0x5a6659;var _0x147304=_[_0xedca('0x96')](_0x2a6eee[_0xedca('0x49')],{'firstName':_0x2a6eee[_0xedca('0x49')]['from'],'phone':_0x2a6eee['body'][_0xedca('0x85')],'ListId':_0x5a6659[_0xedca('0x84')]});_0x147304[_0x2a6eee[_0xedca('0x49')][_0xedca('0xbf')]]=_0x2a6eee['body']['from'];return db['CmContact'][_0xedca('0xc2')]({'where':_0x47377d,'defaults':_0x147304});}})['spread'](function(_0x250930){if(_0x250930){_0x413f0c=_0x250930;var _0x4ed8c4=fs[_0xedca('0xc3')](path[_0xedca('0x64')](config[_0xedca('0x6b')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x1cefa1=ejs[_0xedca('0xc4')](_0x4ed8c4,{'body':_[_0xedca('0xc5')](_0x2a6eee[_0xedca('0x49')][_0xedca('0x49')]),'bodyTitle':_0x2029fc[_0xedca('0xc6')]});return db[_0xedca('0xc7')][_0xedca('0x48')]({'body':_0x1cefa1,'plainBody':htmlToText[_0xedca('0xc8')](_0x1cefa1),'ContactId':_0x250930['id'],'ChatWebsiteId':_0x2029fc['id']});}})[_0xedca('0x13')](function(_0x39f286){_0x22938f=_0x39f286;if(_0x2e12d6['length']){var _0xf3af48=_0x2e12d6[_0xedca('0x2d')](function(_0x55f482){return{'name':_0x55f482[_0xedca('0xc9')],'basename':_0x55f482['filename'],'type':_0x55f482[_0xedca('0xca')],'ChatOfflineMessageId':_0x39f286['id']};});_0x38128f=_0xf3af48['map'](_0x388a14=>{var _0x56c4fd={'filename':_0x388a14['name'],'path':path[_0xedca('0x64')](config[_0xedca('0x6b')],_0xedca('0xcb'),_0xedca('0xbd'),_0xedca('0xcc'),_0xedca('0xcd'),_0x388a14[_0xedca('0xce')])};return _0x56c4fd;});if(!_0x2029fc[_0xedca('0xcf')]){return db[_0xedca('0xd0')]['transaction'](function(_0x89336e){return db[_0xedca('0xd1')][_0xedca('0xd2')](_0xf3af48,{'transaction':_0x89336e});});}}})[_0xedca('0x13')](function(){if(_0x22938f){_0x4eb863=_0x22938f;return db[_0xedca('0xc1')][_0xedca('0x54')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xedca('0xd3'),'raw':!![],'include':[{'model':db[_0xedca('0xd4')],'as':_0xedca('0xd4'),'raw':!![]}]}]});}})[_0xedca('0x13')](function(_0x289649){if(_0x289649&&_0x289649[_0xedca('0xd3')]&&_0x2029fc[_0xedca('0xd5')]&&_0x2029fc[_0xedca('0xd6')]){var _0x552c33=_0x289649[_0xedca('0xd7')]();return respondWithRpcPromise(_0xedca('0xd8'),'sendMail',{'account':_0x552c33,'message':{'from':util['format'](_0xedca('0xd9'),_0x289649[_0xedca('0x29')],_0x289649[_0xedca('0xda')]||_0x289649[_0xedca('0xd3')][_0xedca('0x4a')]),'to':_0x2029fc[_0xedca('0xd6')],'subject':_0x2029fc['offlineMessageSubject'],'html':_0x4eb863[_0xedca('0x49')],'attachments':_0x38128f}},client9003)[_0xedca('0x13')](function(){return _0x4eb863;})[_0xedca('0x1b')](function(_0x155dd4){logger[_0xedca('0x18')](_0x155dd4);});}})['then'](function(){if(_0x2029fc&&_0x2029fc['openNewInteraction']&&_0x2029fc['MailAccountId']){var _0x557586=[];if(_0x2e12d6[_0xedca('0x38')]){_0x557586=_0x2e12d6[_0xedca('0x2d')](function(_0x5df606){return{'name':_0x5df606[_0xedca('0xc9')],'basename':_0x5df606['filename'],'type':_0x5df606[_0xedca('0xca')],'ChatOfflineMessageId':_0x22938f['id']};});}var _0x4649bd;if(!_[_0xedca('0x69')](_0x2029fc['subjectOffline'])){var _0x4a26bb=_[_0xedca('0x2d')](_0x2a6eee[_0xedca('0x49')],function(_0x173ea8){return _0x173ea8;});var _0x5e6932=_[_0xedca('0xdb')](_0x4a26bb)[0x0];var _0x82ffb5=_[_0xedca('0xdc')](_0x5e6932,function(_0x4e1b8b){return _0x4e1b8b;});_0x4649bd=_0x82ffb5[0x1][_0x2029fc[_0xedca('0xdd')]];}var _0x26cf38={'from':_0x413f0c[_0xedca('0xda')],'firstName':_0x413f0c[_0xedca('0x9c')],'lastName':_0x413f0c[_0xedca('0x9d')],'mapKey':_0xedca('0xda'),'message':{'from':_0x413f0c[_0xedca('0xda')],'to':_0x2029fc['MailAccount'][_0xedca('0xda')],'cc':'','subject':_['isNil'](_0x4649bd)?_0x2029fc[_0xedca('0xde')]:_0x4649bd,'messageId':'','sentAt':new Date(),'attach':_0x557586[_0xedca('0x38')],'attachments':_0x557586,'originChannel':_0xedca('0xdf'),'ChatWebsiteId':_0x2029fc['id'],'ChatOfflineMessageId':_0x4eb863['id'],'originTo':_0x2029fc[_0xedca('0xc1')][_0xedca('0xda')]},'body':_0x4eb863[_0xedca('0x49')]};var _0x254c42={'account':{'id':_0x2029fc[_0xedca('0xe0')]},'body':_0x26cf38,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x254c42,client9001)[_0xedca('0x13')](function(){return _0x4eb863;})[_0xedca('0x1b')](function(_0x3315da){logger[_0xedca('0x18')](_0x3315da);});}return;})[_0xedca('0x13')](function(){if(_0x4eb863){return _0x4eb863;}})[_0xedca('0x13')](respondWithResult(_0x512896,null))[_0xedca('0x1b')](function(_0x14a41d){logger['error'](_0xedca('0x1b'),_0x14a41d);for(var _0x10f009 of _0x2e12d6){var _0x35696d=path[_0xedca('0x64')](config[_0xedca('0x6b')],_0xedca('0xcb'),_0xedca('0xbd'),'attachments',_0xedca('0xcd'),_0x10f009[_0xedca('0x5e')]);fs_extra[_0xedca('0xe1')](_0x35696d)[_0xedca('0x1b')](function(_0x1c2328){logger[_0xedca('0x18')](_0xedca('0xe2'),_0x35696d,_0x1c2328);});}});};exports[_0xedca('0xe3')]=function(_0x19f1f0,_0x305a6f){return db[_0xedca('0xa9')][_0xedca('0x47')]({'where':{'id':_0x19f1f0[_0xedca('0x44')]['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x305a6f,null))[_0xedca('0x13')](function(_0x49b39e){if(_0x49b39e){return _0x49b39e[_0xedca('0xe3')](_0x19f1f0[_0xedca('0x49')]['ids'],_[_0xedca('0xe4')](_0x19f1f0['body'],[_0xedca('0x58'),'id'])||{});}})[_0xedca('0x13')](respondWithResult(_0x305a6f,null))[_0xedca('0x1b')](handleError(_0x305a6f,null));};exports[_0xedca('0xe5')]=function(_0x461b3b,_0x5121c8){var _0x402350={'raw':![],'where':{}};var _0x20af29={};var _0x4daa28={'count':0x0,'rows':[]};return db[_0xedca('0x2e')]['findOne']({'where':{'id':_0x461b3b[_0xedca('0x44')]['id']}})['then'](handleEntityNotFound(_0x5121c8,null))[_0xedca('0x13')](function(_0x5e0793){if(_0x5e0793){_0x20af29['model']=_[_0xedca('0x32')](db[_0xedca('0xa9')]['rawAttributes']);_0x20af29[_0xedca('0x33')]=_[_0xedca('0x32')](_0x461b3b[_0xedca('0x33')]);_0x20af29[_0xedca('0x34')]=_[_0xedca('0x35')](_0x20af29[_0xedca('0x31')],_0x20af29['query']);_0x402350['attributes']=_[_0xedca('0x35')](_0x20af29[_0xedca('0x31')],qs['fields'](_0x461b3b['query'][_0xedca('0x37')]));_0x402350[_0xedca('0x36')]=_0x402350['attributes'][_0xedca('0x38')]?_0x402350[_0xedca('0x36')]:_0x20af29['model'];if(!_0x461b3b['query'][_0xedca('0x39')]('nolimit')){_0x402350[_0xedca('0x21')]=qs[_0xedca('0x21')](_0x461b3b['query'][_0xedca('0x21')]);_0x402350[_0xedca('0x20')]=qs[_0xedca('0x20')](_0x461b3b['query'][_0xedca('0x20')]);}_0x402350['order']=qs[_0xedca('0x3b')](_0x461b3b['query'][_0xedca('0x3b')]);_0x402350['where']=qs['filters'](_[_0xedca('0x3d')](_0x461b3b[_0xedca('0x33')],_0x20af29[_0xedca('0x34')]));_0x402350[_0xedca('0x3c')][_0xedca('0x56')]=_0x5e0793['id'];if(_0x461b3b[_0xedca('0x33')]['filter']){_0x402350[_0xedca('0x3c')]=_[_0xedca('0x3f')](_0x402350[_0xedca('0x3c')],{'$or':_[_0xedca('0x2d')](_0x402350[_0xedca('0x36')],function(_0x4e929c){var _0x318efe={};_0x318efe[_0x4e929c]={'$like':'%'+_0x461b3b[_0xedca('0x33')]['filter']+'%'};return _0x318efe;})});}_0x402350=_[_0xedca('0x3f')]({},_0x402350,_0x461b3b[_0xedca('0x40')]);return db[_0xedca('0xa9')][_0xedca('0x22')]({'where':_0x402350[_0xedca('0x3c')]})[_0xedca('0x13')](function(_0x594940){_0x4daa28[_0xedca('0x22')]=_0x594940;if(_0x461b3b[_0xedca('0x33')][_0xedca('0x46')]){_0x402350['include']=[{'model':db[_0xedca('0x7c')],'as':_0xedca('0xe6'),'required':![]},{'model':db[_0xedca('0xb7')],'as':_0xedca('0xe7'),'attributes':[_0xedca('0x29'),_0xedca('0xe8'),_0xedca('0xe9')],'required':![]},{'model':db['Tag'],'as':_0xedca('0xea'),'attributes':['id',_0xedca('0x29'),_0xedca('0xeb')],'where':_0x461b3b[_0xedca('0x33')]['tag']?{'id':_0x461b3b[_0xedca('0x33')][_0xedca('0xec')]}:undefined,'required':_0x461b3b[_0xedca('0x33')][_0xedca('0xec')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x402350);})[_0xedca('0x13')](function(_0x5c70ec){_0x4daa28[_0xedca('0x43')]=_0x5c70ec;return _0x4daa28;});}})['then'](respondWithFilteredResult(_0x5121c8,_0x402350))[_0xedca('0x1b')](handleError(_0x5121c8,null));};function iftimePromise(_0x13fb40,_0x5c2905){return respondWithRpcPromise(_0xedca('0xed'),_0xedca('0xee'),{'command':_0x5c2905[_0xedca('0xef')]?util[_0xedca('0xa2')](_0xedca('0xf0'),_0x13fb40['interval'],_0x5c2905[_0xedca('0xef')]):util['format'](_0xedca('0xf1'),_0x13fb40[_0xedca('0xf2')])},client9002)[_0xedca('0x13')](function(_0x2e96cf){var _0x1c03ba=_0x2e96cf&&_0x2e96cf[_0xedca('0xf3')](_0xedca('0xf4'))>=0x0?!![]:![];logger[_0xedca('0x14')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5c2905['id'],_0x13fb40['id'],_0x13fb40[_0xedca('0xf2')],_0x1c03ba?_0xedca('0xf5'):'OFFLINE',_0x5c2905[_0xedca('0xef')]?_0x5c2905[_0xedca('0xef')]:_0xedca('0xf6'));return _0x1c03ba;})[_0xedca('0x1b')](function(_0x3983e2){logger['error'](_0xedca('0xf7'),_0x5c2905['id'],_0x13fb40['id'],_0x13fb40['interval'],util['inspect'](_0x3983e2,{'showHidden':![],'depth':null}),_0x5c2905[_0xedca('0xef')]?_0x5c2905[_0xedca('0xef')]:'No\x20timezone');return![];});}exports[_0xedca('0xee')]=function(_0x15cec7,_0x1f3eda){var _0x3969fa=0x0;var _0x39b2c3=0x0;var _0x11146e=![];var _0x56c2f1;var _0x613614;return db[_0xedca('0x2e')][_0xedca('0x47')]({'where':{'id':_0x15cec7[_0xedca('0x44')]['id']},'include':[{'model':db['Interval'],'as':_0xedca('0xf8'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1f3eda,null))['then'](function(_0xb9b41e){if(_0xb9b41e){_0x56c2f1=_0xb9b41e;return _0xb9b41e[_0xedca('0xf9')]({'raw':!![]});}})[_0xedca('0x13')](function(_0x56a624){if(_0x56c2f1){if(_0x56a624){_0x613614=_0x56a624;}}return require(_0xedca('0x66'))[_0xedca('0x67')]();})[_0xedca('0x13')](function(_0x2e0d12){if(_0x2e0d12){_0x39b2c3=_0x2e0d12[_0xedca('0xfa')];_0x11146e=_0x2e0d12[_0xedca('0x68')];}})[_0xedca('0x13')](function(){return db[_0xedca('0xa9')]['count']({'where':{'closed':![]}});})[_0xedca('0x13')](function(_0x4260bc){_0x3969fa=_0x4260bc;if(_0x39b2c3&&_0x4260bc>_0x39b2c3){return db[_0xedca('0xfb')]['findOne']({'where':{'id':0x1}})[_0xedca('0x13')](function(_0x1aff1a){if(_0x1aff1a){_0x1aff1a[_0xedca('0xfc')](_0xedca('0xfd'));}});}})[_0xedca('0x13')](function(){if(_0x56c2f1[_0xedca('0xf8')]&&_0x56c2f1[_0xedca('0xf8')][_0xedca('0xfe')]){var _0x1c4189=[];for(var _0x4b20c9=0x0;_0x4b20c9<_0x56c2f1[_0xedca('0xf8')][_0xedca('0xfe')]['length'];_0x4b20c9++){var _0x4e79b6=_0x56c2f1[_0xedca('0xf8')][_0xedca('0xfe')][_0x4b20c9][_0xedca('0x4b')]({'plain':!![]});_0x1c4189[_0xedca('0xb1')](iftimePromise(_0x4e79b6,_0x56c2f1));}return BPromise[_0xedca('0xff')](_0x1c4189)[_0xedca('0x13')](function(_0x5980f9){return _[_0xedca('0x100')](_0x5980f9);});}else{return!![];}})[_0xedca('0x13')](function(_0x12eb07){var _0x33156d=fs['readFileSync'](path[_0xedca('0x64')](config['root'],_0xedca('0x101')),_0xedca('0x102'));var _0x570741=new url['URL'](_0x56c2f1[_0xedca('0x103')])[_0xedca('0x104')];var _0x426782='3.1.0';var _0x10f40d=![];var _0x557d79={'chatVersion':_0x426782,'chatWebsiteAddressOrigin':_0x570741,'remote':_0x56c2f1[_0xedca('0x105')],'query':querystring['stringify'](_['merge'](_0x56c2f1[_0xedca('0x4b')]({'plain':!![]}),{'customerIp':_0x15cec7[_0xedca('0x78')][_0xedca('0x9a')]||_0x15cec7[_0xedca('0x78')][_0xedca('0x106')]||_0x15cec7['connection'][_0xedca('0x107')]||_0x15cec7['ip'],'referer':_0x15cec7[_0xedca('0x78')][_0xedca('0x9f')],'openedInteractions':_0x3969fa,'maxInteractions':_0x39b2c3,'virtual':_0x11146e['virtual'],'online':_0x12eb07,'custom':_0x11146e}))[_0xedca('0x108')](/'/g,'\x5c\x27')};_0x1f3eda[_0xedca('0x2a')](ejs[_0xedca('0xc4')](Mustache[_0xedca('0xc4')](_0x33156d,_0x557d79),{'proactiveActions':_0x613614,'alignment':_0x56c2f1[_0xedca('0x109')],'verticalAlignment':_0x56c2f1[_0xedca('0x10a')],'div_color':_0x56c2f1[_0xedca('0xeb')],'labelText':_0x56c2f1[_0xedca('0x10b')],'text_color':_0x56c2f1[_0xedca('0x10c')],'text_button_color':_0x56c2f1[_0xedca('0x10d')],'button_color':_0x56c2f1['color_button'],'background_color':_0x56c2f1[_0xedca('0x10e')],'hideWhenOffline':_0x56c2f1[_0xedca('0x10f')],'intervalId':_0x56c2f1[_0xedca('0x110')],'isDevelopment':_0x10f40d,'chatVersion':_0x426782}));})[_0xedca('0x1b')](handleError(_0x1f3eda,null));};exports['addApplications']=function(_0x3f2bec,_0x184db1){var _0x54d3fa=_0x3f2bec[_0xedca('0x44')]['id'];var _0x406c48=_0x3f2bec[_0xedca('0x49')];var _0x14728a=0xc8;var _0x29509f=null;return db['sequelize'][_0xedca('0x111')]({'isolationLevel':db[_0xedca('0xd0')][_0xedca('0x112')]['ISOLATION_LEVELS'][_0xedca('0x113')]},function(_0x5843bb){return db[_0xedca('0x2e')]['findOne']({'where':{'id':_0x54d3fa},'transaction':_0x5843bb})[_0xedca('0x13')](function(_0x37ab29){if(_0x37ab29){return db[_0xedca('0x8e')]['destroy']({'where':{'ChatWebsiteId':_0x54d3fa},'transaction':_0x5843bb})[_0xedca('0x13')](function(){var _0x463321=_[_0xedca('0x2d')](_0x406c48,function(_0x423353){_0x423353['ChatWebsiteId']=_0x54d3fa;return _0x423353;});return db['ChatApplication'][_0xedca('0xd2')](_0x463321,{'transaction':_0x5843bb});});}else{_0x14728a=0x194;_0x29509f=[];}});})[_0xedca('0x13')](function(){if(_0x14728a!==0x194){return db[_0xedca('0x8e')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x54d3fa},'order':_0xedca('0x114')})['then'](function(_0x44e866){_0x29509f=_0x44e866;});}})[_0xedca('0x1b')](function(_0x2c8d7b){_0x14728a=0x1f4;logger[_0xedca('0x18')](_0x2c8d7b[_0xedca('0x28')]);if(_0x2c8d7b[_0xedca('0x29')]){delete _0x2c8d7b['name'];}_0x29509f=_0x2c8d7b;})[_0xedca('0x115')](function(){if(_0x29509f===null){_0x184db1[_0xedca('0x1c')](_0x14728a);}else{if(_0x14728a===0x1f4){_0x184db1[_0xedca('0x1d')](_0x14728a)[_0xedca('0x2a')](_0x29509f);}else{_0x184db1[_0xedca('0x1d')](_0x14728a)[_0xedca('0x1f')](_0x29509f);}}});};exports[_0xedca('0x116')]=function(_0x48a0f9,_0x114a61){var _0x552d23={};var _0x153774={};var _0x7e30e5;var _0x3aa42f;return db[_0xedca('0x2e')][_0xedca('0x54')]({'where':{'id':_0x48a0f9[_0xedca('0x44')]['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x114a61,null))[_0xedca('0x13')](function(_0xcbe744){if(_0xcbe744){_0x7e30e5=_0xcbe744;_0x153774[_0xedca('0x31')]=_['keys'](db[_0xedca('0x8e')][_0xedca('0x45')]);_0x153774[_0xedca('0x33')]=_['keys'](_0x48a0f9[_0xedca('0x33')]);_0x153774[_0xedca('0x34')]=_['intersection'](_0x153774[_0xedca('0x31')],_0x153774['query']);_0x552d23[_0xedca('0x36')]=_[_0xedca('0x35')](_0x153774[_0xedca('0x31')],qs[_0xedca('0x37')](_0x48a0f9['query'][_0xedca('0x37')]));_0x552d23[_0xedca('0x36')]=_0x552d23[_0xedca('0x36')]['length']?_0x552d23[_0xedca('0x36')]:_0x153774['model'];_0x552d23[_0xedca('0x55')]=qs[_0xedca('0x3b')](_0x48a0f9['query']['sort']);_0x552d23[_0xedca('0x3c')]=qs[_0xedca('0x34')](_['pick'](_0x48a0f9['query'],_0x153774['filters']));if(_0x48a0f9[_0xedca('0x33')]['filter']){_0x552d23[_0xedca('0x3c')]=_['merge'](_0x552d23['where'],{'$or':_[_0xedca('0x2d')](_0x552d23[_0xedca('0x36')],function(_0x4ef153){var _0x3e10b1={};_0x3e10b1[_0x4ef153]={'$like':'%'+_0x48a0f9['query'][_0xedca('0x3e')]+'%'};return _0x3e10b1;})});}_0x552d23=_[_0xedca('0x3f')]({},_0x552d23,_0x48a0f9[_0xedca('0x40')]);return _0x7e30e5[_0xedca('0x116')](_0x552d23);}})[_0xedca('0x13')](function(_0x4c4aaf){if(_0x4c4aaf){_0x3aa42f=_0x4c4aaf[_0xedca('0x38')];if(!_0x48a0f9[_0xedca('0x33')][_0xedca('0x39')](_0xedca('0x3a'))){_0x552d23[_0xedca('0x21')]=qs['limit'](_0x48a0f9['query'][_0xedca('0x21')]);_0x552d23[_0xedca('0x20')]=qs['offset'](_0x48a0f9[_0xedca('0x33')][_0xedca('0x20')]);}return _0x7e30e5[_0xedca('0x116')](_0x552d23);}})['then'](function(_0x219d72){if(_0x219d72){return _0x219d72?{'count':_0x3aa42f,'rows':_0x219d72}:null;}})[_0xedca('0x13')](respondWithResult(_0x114a61,null))[_0xedca('0x1b')](handleError(_0x114a61,null));};exports[_0xedca('0x117')]=function(_0x19da3d,_0x1283b4){return db[_0xedca('0x118')][_0xedca('0x47')]({'where':{'id':_0x19da3d[_0xedca('0x44')]['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x1283b4,null))[_0xedca('0x13')](function(_0x2be4e9){if(_0x2be4e9){return _0x2be4e9['addProactiveActions'](_0x19da3d[_0xedca('0x49')][_0xedca('0x58')],_[_0xedca('0xe4')](_0x19da3d[_0xedca('0x49')],[_0xedca('0x58'),'id'])||{});}})[_0xedca('0x13')](respondWithResult(_0x1283b4,null))[_0xedca('0x1b')](handleError(_0x1283b4,null));};exports[_0xedca('0xf9')]=function(_0x3740c1,_0x4e6fe6){var _0x190c71={};var _0x5b64b7={};var _0xe8cc37;var _0x331229;return db[_0xedca('0x2e')][_0xedca('0x54')]({'where':{'id':_0x3740c1[_0xedca('0x44')]['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x4e6fe6,null))[_0xedca('0x13')](function(_0x5da18){if(_0x5da18){_0xe8cc37=_0x5da18;_0x5b64b7[_0xedca('0x31')]=_['keys'](db['ChatProactiveAction'][_0xedca('0x45')]);_0x5b64b7['query']=_[_0xedca('0x32')](_0x3740c1[_0xedca('0x33')]);_0x5b64b7[_0xedca('0x34')]=_[_0xedca('0x35')](_0x5b64b7[_0xedca('0x31')],_0x5b64b7['query']);_0x190c71[_0xedca('0x36')]=_[_0xedca('0x35')](_0x5b64b7['model'],qs[_0xedca('0x37')](_0x3740c1[_0xedca('0x33')][_0xedca('0x37')]));_0x190c71['attributes']=_0x190c71['attributes'][_0xedca('0x38')]?_0x190c71[_0xedca('0x36')]:_0x5b64b7[_0xedca('0x31')];_0x190c71[_0xedca('0x55')]=qs[_0xedca('0x3b')](_0x3740c1[_0xedca('0x33')]['sort']);_0x190c71[_0xedca('0x3c')]=qs[_0xedca('0x34')](_[_0xedca('0x3d')](_0x3740c1[_0xedca('0x33')],_0x5b64b7[_0xedca('0x34')]));if(_0x3740c1[_0xedca('0x33')][_0xedca('0x3e')]){_0x190c71[_0xedca('0x3c')]=_[_0xedca('0x3f')](_0x190c71[_0xedca('0x3c')],{'$or':_[_0xedca('0x2d')](_0x190c71[_0xedca('0x36')],function(_0x272cf9){var _0x48a6b7={};_0x48a6b7[_0x272cf9]={'$like':'%'+_0x3740c1['query'][_0xedca('0x3e')]+'%'};return _0x48a6b7;})});}_0x190c71=_[_0xedca('0x3f')]({},_0x190c71,_0x3740c1['options']);return _0xe8cc37[_0xedca('0xf9')](_0x190c71);}})['then'](function(_0x566796){if(_0x566796){_0x331229=_0x566796['length'];if(!_0x3740c1[_0xedca('0x33')][_0xedca('0x39')](_0xedca('0x3a'))){_0x190c71['limit']=qs[_0xedca('0x21')](_0x3740c1[_0xedca('0x33')][_0xedca('0x21')]);_0x190c71[_0xedca('0x20')]=qs[_0xedca('0x20')](_0x3740c1['query'][_0xedca('0x20')]);}return _0xe8cc37['getProactiveActions'](_0x190c71);}})[_0xedca('0x13')](function(_0x367ea3){if(_0x367ea3){return _0x367ea3?{'count':_0x331229,'rows':_0x367ea3}:null;}})['then'](respondWithResult(_0x4e6fe6,null))[_0xedca('0x1b')](handleError(_0x4e6fe6,null));};exports[_0xedca('0x119')]=function(_0x334c45,_0xf54966){var _0x304a1c=_0x334c45['query'][_0xedca('0x11a')]===_0xedca('0x11b')?_0xedca('0x11c'):'onlineForm';return db[_0xedca('0x2e')][_0xedca('0x47')]({'attributes':['id',_0x304a1c],'where':{'id':_0x334c45['params']['id']}})['then'](handleEntityNotFound(_0xf54966,null))[_0xedca('0x13')](function(_0x1e1bdc){if(_0x1e1bdc){var _0x68dca3=_0x1e1bdc[_0x304a1c];var _0x1513ba=_0x68dca3&&_0x68dca3[_0xedca('0x11d')]?_0x68dca3[_0xedca('0x11d')]:[];_0xf54966['send']({'fromKey':_[_0xedca('0x69')](_0x68dca3[_0xedca('0x11e')])?undefined:_0x68dca3[_0xedca('0x11e')],'count':_0x1513ba['length'],'rows':_0x1513ba});}})[_0xedca('0x1b')](handleError(_0xf54966,null));};exports[_0xedca('0x11f')]=function(_0x553643,_0x349f5d){var _0x48ab96={'raw':![],'where':{}};var _0x27f24a={};var _0x300580={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xedca('0x54')]({'where':{'id':_0x553643['params']['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x349f5d,null))['then'](function(_0x21d40f){if(_0x21d40f){_0x27f24a[_0xedca('0x31')]=_[_0xedca('0x32')](db['ChatOfflineMessage'][_0xedca('0x45')]);_0x27f24a['query']=_[_0xedca('0x32')](_0x553643[_0xedca('0x33')]);_0x27f24a['filters']=_['intersection'](_0x27f24a['model'],_0x27f24a[_0xedca('0x33')]);_0x48ab96['attributes']=_[_0xedca('0x35')](_0x27f24a['model'],qs[_0xedca('0x37')](_0x553643[_0xedca('0x33')][_0xedca('0x37')]));_0x48ab96[_0xedca('0x36')]=_0x48ab96[_0xedca('0x36')][_0xedca('0x38')]?_0x48ab96[_0xedca('0x36')]:_0x27f24a['model'];if(!_0x553643[_0xedca('0x33')][_0xedca('0x39')](_0xedca('0x3a'))){_0x48ab96[_0xedca('0x21')]=qs[_0xedca('0x21')](_0x553643['query'][_0xedca('0x21')]);_0x48ab96[_0xedca('0x20')]=qs[_0xedca('0x20')](_0x553643['query'][_0xedca('0x20')]);}_0x48ab96[_0xedca('0x55')]=qs[_0xedca('0x3b')](_0x553643[_0xedca('0x33')][_0xedca('0x3b')]);_0x48ab96[_0xedca('0x3c')]=qs['filters'](_['pick'](_0x553643[_0xedca('0x33')],_0x27f24a['filters']));_0x48ab96['where'][_0xedca('0x56')]=_0x21d40f['id'];if(_0x553643[_0xedca('0x33')][_0xedca('0x3e')]){_0x48ab96[_0xedca('0x3c')]=_[_0xedca('0x3f')](_0x48ab96['where'],{'$or':_['map'](_0x48ab96[_0xedca('0x36')],function(_0x13360a){var _0x4a306={};_0x4a306[_0x13360a]={'$like':'%'+_0x553643['query']['filter']+'%'};return _0x4a306;})});}_0x48ab96=_[_0xedca('0x3f')]({},_0x48ab96,_0x553643[_0xedca('0x40')]);return db[_0xedca('0xc7')]['count']({'where':_0x48ab96[_0xedca('0x3c')]})['then'](function(_0x46d143){_0x300580[_0xedca('0x22')]=_0x46d143;if(_0x553643[_0xedca('0x33')][_0xedca('0x46')]){_0x48ab96[_0xedca('0x41')]=[{'all':!![]}];}else{_0x48ab96['include']=[{'model':db[_0xedca('0x7c')],'as':_0xedca('0xe6'),'required':![]},{'model':db[_0xedca('0xd1')],'as':_0xedca('0x120'),'required':![]}];}return db['ChatOfflineMessage'][_0xedca('0x42')](_0x48ab96);})[_0xedca('0x13')](function(_0x18c503){_0x300580[_0xedca('0x43')]=_0x18c503;return _0x300580;});}})[_0xedca('0x13')](respondWithFilteredResult(_0x349f5d,_0x48ab96))['catch'](handleError(_0x349f5d,null));};exports[_0xedca('0x121')]=function(_0x22c043,_0x422b4f){return db[_0xedca('0x2e')]['find']({'where':{'id':_0x22c043['params']['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x422b4f,null))[_0xedca('0x13')](function(_0x215002){if(_0x215002){return _0x215002[_0xedca('0x121')](_0x22c043[_0xedca('0x49')][_0xedca('0x58')],_[_0xedca('0xe4')](_0x22c043[_0xedca('0x49')],[_0xedca('0x58'),'id'])||{})[_0xedca('0xad')](function(_0x1811be){for(var _0xa3b7fc=0x0;_0xa3b7fc<_0x22c043[_0xedca('0x49')][_0xedca('0x58')][_0xedca('0x38')];_0xa3b7fc+=0x1){socket[_0xedca('0x122')](_0xedca('0x123'),{'UserId':Number(_0x22c043[_0xedca('0x49')][_0xedca('0x58')][_0xa3b7fc]),'ChatWebsiteId':Number(_0x22c043[_0xedca('0x44')]['id'])});}return _0x1811be;});}})[_0xedca('0x13')](respondWithResult(_0x422b4f,null))[_0xedca('0x1b')](handleError(_0x422b4f,null));};exports[_0xedca('0x124')]=function(_0x579f6f,_0x35fae3){return db[_0xedca('0x2e')][_0xedca('0x47')]({'where':{'id':_0x579f6f[_0xedca('0x44')]['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x35fae3,null))[_0xedca('0x13')](function(_0x238276){if(_0x238276){return _0x238276[_0xedca('0x124')](_0x579f6f[_0xedca('0x33')][_0xedca('0x58')])[_0xedca('0x13')](function(){if(_[_0xedca('0x125')](_0x579f6f['query']['ids'])){for(var _0x554056=0x0;_0x554056<_0x579f6f['query'][_0xedca('0x58')][_0xedca('0x38')];_0x554056+=0x1){socket[_0xedca('0x122')](_0xedca('0x126'),{'UserId':Number(_0x579f6f[_0xedca('0x33')][_0xedca('0x58')][_0x554056]),'ChatWebsiteId':Number(_0x579f6f[_0xedca('0x44')]['id'])});}}else{socket['emit'](_0xedca('0x126'),{'UserId':Number(_0x579f6f[_0xedca('0x33')][_0xedca('0x58')]),'ChatWebsiteId':Number(_0x579f6f[_0xedca('0x44')]['id'])});}});}})[_0xedca('0x13')](respondWithStatusCode(_0x35fae3,null))[_0xedca('0x1b')](handleError(_0x35fae3,null));};exports[_0xedca('0x127')]=function(_0x4907d4,_0x3a223f){var _0x1a016e={};var _0x2f3e91={};var _0x270a52;var _0x1a9312;return db[_0xedca('0x2e')][_0xedca('0x54')]({'where':{'id':_0x4907d4[_0xedca('0x44')]['id']}})[_0xedca('0x13')](handleEntityNotFound(_0x3a223f,null))[_0xedca('0x13')](function(_0x458ede){if(_0x458ede){_0x270a52=_0x458ede;_0x2f3e91[_0xedca('0x31')]=_[_0xedca('0x32')](db[_0xedca('0xb7')][_0xedca('0x45')]);_0x2f3e91['query']=_[_0xedca('0x32')](_0x4907d4[_0xedca('0x33')]);_0x2f3e91[_0xedca('0x34')]=_[_0xedca('0x35')](_0x2f3e91[_0xedca('0x31')],_0x2f3e91[_0xedca('0x33')]);_0x1a016e[_0xedca('0x36')]=_[_0xedca('0x35')](_0x2f3e91['model'],qs['fields'](_0x4907d4[_0xedca('0x33')][_0xedca('0x37')]));_0x1a016e[_0xedca('0x36')]=_0x1a016e['attributes'][_0xedca('0x38')]?_0x1a016e[_0xedca('0x36')]:_0x2f3e91[_0xedca('0x31')];_0x1a016e['order']=qs[_0xedca('0x3b')](_0x4907d4[_0xedca('0x33')][_0xedca('0x3b')]);_0x1a016e[_0xedca('0x3c')]=qs[_0xedca('0x34')](_[_0xedca('0x3d')](_0x4907d4[_0xedca('0x33')],_0x2f3e91['filters']));if(_0x4907d4[_0xedca('0x33')]['filter']){_0x1a016e['where']=_['merge'](_0x1a016e['where'],{'$or':_[_0xedca('0x2d')](_0x1a016e[_0xedca('0x36')],function(_0x3a0788){var _0x50a532={};_0x50a532[_0x3a0788]={'$like':'%'+_0x4907d4[_0xedca('0x33')]['filter']+'%'};return _0x50a532;})});}_0x1a016e=_[_0xedca('0x3f')]({},_0x1a016e,_0x4907d4[_0xedca('0x40')]);return _0x270a52[_0xedca('0x127')](_0x1a016e);}})['then'](function(_0x32c0ba){if(_0x32c0ba){_0x1a9312=_0x32c0ba[_0xedca('0x38')];if(!_0x4907d4[_0xedca('0x33')][_0xedca('0x39')]('nolimit')){_0x1a016e[_0xedca('0x21')]=qs[_0xedca('0x21')](_0x4907d4[_0xedca('0x33')][_0xedca('0x21')]);_0x1a016e[_0xedca('0x20')]=qs['offset'](_0x4907d4[_0xedca('0x33')][_0xedca('0x20')]);}return _0x270a52[_0xedca('0x127')](_0x1a016e);}})[_0xedca('0x13')](function(_0x4c1699){if(_0x4c1699){return _0x4c1699?{'count':_0x1a9312,'rows':_0x4c1699}:null;}})['then'](respondWithResult(_0x3a223f,null))['catch'](handleError(_0x3a223f,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 0fd6983..c8ef7ac 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 _0x5b7f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x2ba3c3,_0xbe09fc){var _0x274a7e=function(_0x32b6c3){while(--_0x32b6c3){_0x2ba3c3['push'](_0x2ba3c3['shift']());}};_0x274a7e(++_0xbe09fc);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x276a57,_0x4f525c){_0x276a57=_0x276a57-0x0;var _0x5f0e81=_0x5b7f[_0x276a57];return _0x5f0e81;};'use strict';var EventEmitter=require(_0xf5b7('0x0'));var ChatWebsite=require(_0xf5b7('0x1'))['db'][_0xf5b7('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf5b7('0x3')](0x0);var events={'afterCreate':_0xf5b7('0x4'),'afterUpdate':_0xf5b7('0x5'),'afterDestroy':_0xf5b7('0x6')};function emitEvent(_0x2ae04f){return function(_0x2c5439,_0x2dfb67,_0x3c1efc){ChatWebsiteEvents[_0xf5b7('0x7')](_0x2ae04f+':'+_0x2c5439['id'],_0x2c5439);ChatWebsiteEvents[_0xf5b7('0x7')](_0x2ae04f,_0x2c5439);_0x3c1efc(null);};}for(var e in events){if(events[_0xf5b7('0x8')](e)){var event=events[e];ChatWebsite[_0xf5b7('0x9')](e,emitEvent(event));}}module[_0xf5b7('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x3148=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0xd2dfeb,_0x51aa27){var _0x313172=function(_0x4cc2ba){while(--_0x4cc2ba){_0xd2dfeb['push'](_0xd2dfeb['shift']());}};_0x313172(++_0x51aa27);}(_0x3148,0x1d3));var _0x8314=function(_0x9ab282,_0x224526){_0x9ab282=_0x9ab282-0x0;var _0x3ae406=_0x3148[_0x9ab282];return _0x3ae406;};'use strict';var EventEmitter=require(_0x8314('0x0'));var ChatWebsite=require(_0x8314('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8314('0x2')](0x0);var events={'afterCreate':_0x8314('0x3'),'afterUpdate':_0x8314('0x4'),'afterDestroy':_0x8314('0x5')};function emitEvent(_0x58f818){return function(_0x35ee55,_0x41e9fd,_0x62c506){ChatWebsiteEvents[_0x8314('0x6')](_0x58f818+':'+_0x35ee55['id'],_0x35ee55);ChatWebsiteEvents[_0x8314('0x6')](_0x58f818,_0x35ee55);_0x62c506(null);};}for(var e in events){if(events[_0x8314('0x7')](e)){var event=events[e];ChatWebsite[_0x8314('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 4764343..b1dc877 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 _0x985e=['bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','ChatWebsite','lodash','../../config/logger','api','moment'];(function(_0x5bb974,_0x100ef1){var _0x4b607c=function(_0x92f321){while(--_0x92f321){_0x5bb974['push'](_0x5bb974['shift']());}};_0x4b607c(++_0x100ef1);}(_0x985e,0xd8));var _0xe985=function(_0x295ece,_0x55ed2d){_0x295ece=_0x295ece-0x0;var _0x47a60e=_0x985e[_0x295ece];return _0x47a60e;};'use strict';var _=require(_0xe985('0x0'));var util=require('util');var logger=require(_0xe985('0x1'))(_0xe985('0x2'));var moment=require(_0xe985('0x3'));var BPromise=require(_0xe985('0x4'));var rp=require(_0xe985('0x5'));var fs=require('fs');var path=require(_0xe985('0x6'));var rimraf=require(_0xe985('0x7'));var config=require('../../config/environment');var attributes=require(_0xe985('0x8'));module[_0xe985('0x9')]=function(_0xd82472,_0x1d706f){return _0xd82472['define'](_0xe985('0xa'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdde=['chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite'];(function(_0x28f026,_0x37c2bc){var _0x40fe6a=function(_0x4db87c){while(--_0x4db87c){_0x28f026['push'](_0x28f026['shift']());}};_0x40fe6a(++_0x37c2bc);}(_0xfdde,0x135));var _0xefdd=function(_0x425969,_0x5efd79){_0x425969=_0x425969-0x0;var _0x56b57f=_0xfdde[_0x425969];return _0x56b57f;};'use strict';var _=require(_0xefdd('0x0'));var util=require(_0xefdd('0x1'));var logger=require(_0xefdd('0x2'))(_0xefdd('0x3'));var moment=require(_0xefdd('0x4'));var BPromise=require(_0xefdd('0x5'));var rp=require(_0xefdd('0x6'));var fs=require('fs');var path=require(_0xefdd('0x7'));var rimraf=require(_0xefdd('0x8'));var config=require(_0xefdd('0x9'));var attributes=require(_0xefdd('0xa'));module['exports']=function(_0x584d24,_0xdacbdd){return _0x584d24[_0xefdd('0xb')](_0xefdd('0xc'),attributes,{'tableName':_0xefdd('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 4897240..a0e01cf 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 _0x8420=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x51487f,_0x508c4b){var _0x6d0523=function(_0x44c049){while(--_0x44c049){_0x51487f['push'](_0x51487f['shift']());}};_0x6d0523(++_0x508c4b);}(_0x8420,0x1e3));var _0x0842=function(_0x5b809a,_0x146c71){_0x5b809a=_0x5b809a-0x0;var _0x34ed89=_0x8420[_0x5b809a];return _0x34ed89;};'use strict';var _=require(_0x0842('0x0'));var util=require(_0x0842('0x1'));var moment=require(_0x0842('0x2'));var BPromise=require(_0x0842('0x3'));var rs=require(_0x0842('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0842('0x5'))['db'];var utils=require(_0x0842('0x6'));var logger=require(_0x0842('0x7'))(_0x0842('0x8'));var config=require(_0x0842('0x9'));var jayson=require(_0x0842('0xa'));var client=jayson['client'][_0x0842('0xb')]({'port':0x232a});config[_0x0842('0xc')]=_[_0x0842('0xd')](config[_0x0842('0xc')],{'host':_0x0842('0xe'),'port':0x18eb});var socket=require(_0x0842('0xf'))(new Redis(config[_0x0842('0xc')]));require(_0x0842('0x10'))[_0x0842('0x11')](socket);function respondWithRpcPromise(_0x327414,_0x124c9a,_0x4c4320){return new BPromise(function(_0x5a4688,_0x30465c){return client['request'](_0x327414,_0x4c4320)[_0x0842('0x12')](function(_0x4a7bc8){logger[_0x0842('0x13')](_0x0842('0x14'),_0x124c9a,_0x0842('0x15'));logger[_0x0842('0x16')](_0x0842('0x17'),_0x124c9a,_0x0842('0x15'),JSON['stringify'](_0x4a7bc8));if(_0x4a7bc8['error']){if(_0x4a7bc8[_0x0842('0x18')][_0x0842('0x19')]===0x1f4){logger[_0x0842('0x18')](_0x0842('0x14'),_0x124c9a,_0x4a7bc8[_0x0842('0x18')]['message']);return _0x30465c(_0x4a7bc8[_0x0842('0x18')][_0x0842('0x1a')]);}logger[_0x0842('0x18')](_0x0842('0x14'),_0x124c9a,_0x4a7bc8[_0x0842('0x18')]['message']);return _0x5a4688(_0x4a7bc8[_0x0842('0x18')][_0x0842('0x1a')]);}else{logger['info'](_0x0842('0x14'),_0x124c9a,_0x0842('0x15'));_0x5a4688(_0x4a7bc8[_0x0842('0x1b')][_0x0842('0x1a')]);}})[_0x0842('0x1c')](function(_0xb33835){logger[_0x0842('0x18')](_0x0842('0x14'),_0x124c9a,_0xb33835);_0x30465c(_0xb33835);});});}
\ No newline at end of file
+var _0x7aa0=['error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1ce6ff,_0x296af8){var _0x3c8af9=function(_0xc6568f){while(--_0xc6568f){_0x1ce6ff['push'](_0x1ce6ff['shift']());}};_0x3c8af9(++_0x296af8);}(_0x7aa0,0x18c));var _0x07aa=function(_0x4c1e2e,_0x4d77c2){_0x4c1e2e=_0x4c1e2e-0x0;var _0xac939c=_0x7aa0[_0x4c1e2e];return _0xac939c;};'use strict';var _=require(_0x07aa('0x0'));var util=require(_0x07aa('0x1'));var moment=require(_0x07aa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x07aa('0x3'))['db'];var utils=require(_0x07aa('0x4'));var logger=require(_0x07aa('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x07aa('0x6'));var client=jayson['client'][_0x07aa('0x7')]({'port':0x232a});config[_0x07aa('0x8')]=_[_0x07aa('0x9')](config['redis'],{'host':_0x07aa('0xa'),'port':0x18eb});var socket=require(_0x07aa('0xb'))(new Redis(config[_0x07aa('0x8')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x481ab5,_0x58701a,_0x228420){return new BPromise(function(_0x2ea744,_0x247edf){return client[_0x07aa('0xc')](_0x481ab5,_0x228420)['then'](function(_0x4d3824){logger[_0x07aa('0xd')](_0x07aa('0xe'),_0x58701a,'request\x20sent');logger[_0x07aa('0xf')](_0x07aa('0x10'),_0x58701a,_0x07aa('0x11'),JSON['stringify'](_0x4d3824));if(_0x4d3824[_0x07aa('0x12')]){if(_0x4d3824[_0x07aa('0x12')][_0x07aa('0x13')]===0x1f4){logger[_0x07aa('0x12')](_0x07aa('0xe'),_0x58701a,_0x4d3824[_0x07aa('0x12')][_0x07aa('0x14')]);return _0x247edf(_0x4d3824['error']['message']);}logger[_0x07aa('0x12')](_0x07aa('0xe'),_0x58701a,_0x4d3824[_0x07aa('0x12')][_0x07aa('0x14')]);return _0x2ea744(_0x4d3824[_0x07aa('0x12')][_0x07aa('0x14')]);}else{logger[_0x07aa('0xd')](_0x07aa('0xe'),_0x58701a,_0x07aa('0x11'));_0x2ea744(_0x4d3824[_0x07aa('0x15')]['message']);}})[_0x07aa('0x16')](function(_0x29a8e1){logger[_0x07aa('0x12')](_0x07aa('0xe'),_0x58701a,_0x29a8e1);_0x247edf(_0x29a8e1);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 8f367e7..427df9d 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 _0x3051=['./chatWebsite.events','save','update','emit','removeListener','register','chatWebsite:'];(function(_0x4d3835,_0x4f5f50){var _0x823439=function(_0x25a5c6){while(--_0x25a5c6){_0x4d3835['push'](_0x4d3835['shift']());}};_0x823439(++_0x4f5f50);}(_0x3051,0xa8));var _0x1305=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3051[_0x20a584];return _0x4b41a8;};'use strict';var ChatWebsiteEvents=require(_0x1305('0x0'));var events=[_0x1305('0x1'),'remove',_0x1305('0x2')];function createListener(_0x3014f9,_0x56d8f6){return function(_0x43b181){_0x56d8f6[_0x1305('0x3')](_0x3014f9,_0x43b181);};}function removeListener(_0x410990,_0x182c53){return function(){ChatWebsiteEvents[_0x1305('0x4')](_0x410990,_0x182c53);};}exports[_0x1305('0x5')]=function(_0x23340f){for(var _0x550a3a=0x0,_0x35f960=events['length'];_0x550a3a<_0x35f960;_0x550a3a++){var _0x41e24f=events[_0x550a3a];var _0x4529c0=createListener(_0x1305('0x6')+_0x41e24f,_0x23340f);ChatWebsiteEvents['on'](_0x41e24f,_0x4529c0);}};
\ No newline at end of file
+var _0x5171=['chatWebsite:','update','emit','register'];(function(_0x56751a,_0x143ba2){var _0x2ec86e=function(_0x480727){while(--_0x480727){_0x56751a['push'](_0x56751a['shift']());}};_0x2ec86e(++_0x143ba2);}(_0x5171,0x99));var _0x1517=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x5171[_0x51c819];return _0x15c5d2;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save','remove',_0x1517('0x0')];function createListener(_0x2154d8,_0x355cd6){return function(_0x3f5efb){_0x355cd6[_0x1517('0x1')](_0x2154d8,_0x3f5efb);};}function removeListener(_0x117492,_0xa2af7a){return function(){ChatWebsiteEvents['removeListener'](_0x117492,_0xa2af7a);};}exports[_0x1517('0x2')]=function(_0x251c7a){for(var _0x42645c=0x0,_0x474b47=events['length'];_0x42645c<_0x474b47;_0x42645c++){var _0x10685d=events[_0x42645c];var _0x6122f0=createListener(_0x1517('0x3')+_0x10685d,_0x251c7a);ChatWebsiteEvents['on'](_0x10685d,_0x6122f0);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index d90ff5f..dd0868c 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 _0xd0a7=['delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','addLogo','now','file','addAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','offline-chat','ensureDir','replace','offline','/:id/interactions','addApplications','addProactiveActions','put','/:id','update'];(function(_0x4b42e2,_0x5d4f5e){var _0x43f52f=function(_0x537c2e){while(--_0x537c2e){_0x4b42e2['push'](_0x4b42e2['shift']());}};_0x43f52f(++_0x5d4f5e);}(_0xd0a7,0x1a9));var _0x7d0a=function(_0xa9a034,_0x50b7cd){_0xa9a034=_0xa9a034-0x0;var _0x82cdcb=_0xd0a7[_0xa9a034];return _0x82cdcb;};'use strict';var multer=require(_0x7d0a('0x0'));var util=require(_0x7d0a('0x1'));var path=require(_0x7d0a('0x2'));var timeout=require(_0x7d0a('0x3'));var express=require(_0x7d0a('0x4'));var router=express[_0x7d0a('0x5')]();var fs_extra=require(_0x7d0a('0x6'));var auth=require(_0x7d0a('0x7'));var interaction=require(_0x7d0a('0x8'));var config=require(_0x7d0a('0x9'));var controller=require('./chatWebsite.controller');router[_0x7d0a('0xa')]('/',auth[_0x7d0a('0xb')](),controller[_0x7d0a('0xc')]);router['get'](_0x7d0a('0xd'),auth[_0x7d0a('0xb')](),controller[_0x7d0a('0xe')]);router[_0x7d0a('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7d0a('0xf')]);router[_0x7d0a('0xa')](_0x7d0a('0x10'),auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x11')]);router['get'](_0x7d0a('0x12'),auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x13')]);router[_0x7d0a('0xa')](_0x7d0a('0x14'),controller['getLogo']);router[_0x7d0a('0xa')](_0x7d0a('0x15'),controller['getAvatar']);router[_0x7d0a('0xa')]('/:id/customer_avatar',controller[_0x7d0a('0x16')]);router[_0x7d0a('0xa')](_0x7d0a('0x17'),controller[_0x7d0a('0x18')]);router[_0x7d0a('0xa')]('/:id/interactions',auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x19')]);router[_0x7d0a('0xa')](_0x7d0a('0x1a'),controller['getSnippet']);router[_0x7d0a('0xa')](_0x7d0a('0x1b'),auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x1c')]);router[_0x7d0a('0xa')](_0x7d0a('0x1d'),auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x1e')]);router['get']('/:id/fields',controller[_0x7d0a('0x1f')]);router[_0x7d0a('0xa')](_0x7d0a('0x20'),auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x21')]);router[_0x7d0a('0xa')](_0x7d0a('0x22'),auth['isAuthenticated'](),controller[_0x7d0a('0x23')]);router[_0x7d0a('0x24')]('/',auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x25')]);router['post'](_0x7d0a('0x10'),auth[_0x7d0a('0xb')](),controller['addDisposition']);router['post'](_0x7d0a('0x12'),auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x26')]);var upload=multer({'storage':multer[_0x7d0a('0x27')]({'destination':function(_0x4d88ff,_0x2eac2d,_0xa4390a){_0xa4390a(null,path[_0x7d0a('0x28')](config[_0x7d0a('0x29')],_0x7d0a('0x2a')));},'filename':function(_0x1310c2,_0x2110ee,_0x1d29dc){_0x1d29dc(null,util[_0x7d0a('0x2b')](_0x7d0a('0x2c'),Date['now'](),_0x2110ee[_0x7d0a('0x2d')]));}})});router[_0x7d0a('0x24')](_0x7d0a('0x14'),upload[_0x7d0a('0x2e')]('file'),controller[_0x7d0a('0x2f')]);var upload=multer({'storage':multer[_0x7d0a('0x27')]({'destination':function(_0x573e6b,_0x2bc9dc,_0x52f181){_0x52f181(null,path['join'](config[_0x7d0a('0x29')],'server/files/images/avatars/'));},'filename':function(_0x35bef7,_0x1f6934,_0x525c2e){_0x525c2e(null,util[_0x7d0a('0x2b')](_0x7d0a('0x2c'),Date[_0x7d0a('0x30')](),_0x1f6934[_0x7d0a('0x2d')]));}})});router[_0x7d0a('0x24')](_0x7d0a('0x15'),upload['single'](_0x7d0a('0x31')),controller[_0x7d0a('0x32')]);var upload=multer({'storage':multer[_0x7d0a('0x27')]({'destination':function(_0x23eff0,_0x28c825,_0xd67aee){_0xd67aee(null,path[_0x7d0a('0x28')](config[_0x7d0a('0x29')],_0x7d0a('0x33')));},'filename':function(_0x52a569,_0x1aea64,_0x4f879f){_0x4f879f(null,util['format'](_0x7d0a('0x2c'),Date['now'](),_0x1aea64[_0x7d0a('0x2d')]));}})});router[_0x7d0a('0x24')]('/:id/customer_avatar',upload['single'](_0x7d0a('0x31')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x376980,_0x45dd70,_0x511a3b){_0x511a3b(null,path[_0x7d0a('0x28')](config[_0x7d0a('0x29')],_0x7d0a('0x33')));},'filename':function(_0x179737,_0x2ce478,_0x1e5078){_0x1e5078(null,util[_0x7d0a('0x2b')](_0x7d0a('0x2c'),Date[_0x7d0a('0x30')](),_0x2ce478[_0x7d0a('0x2d')]));}})});router['post'](_0x7d0a('0x17'),upload['single'](_0x7d0a('0x31')),controller[_0x7d0a('0x34')]);router[_0x7d0a('0x24')](_0x7d0a('0x35'),controller[_0x7d0a('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x7d0a('0x27')]({'destination':function(_0x5b6039,_0x32a16a,_0x5d763f){const _0x35a616=path[_0x7d0a('0x28')](config[_0x7d0a('0x29')],'server/files','attachments',_0x7d0a('0x37'));fs_extra[_0x7d0a('0x38')](_0x35a616,function(){_0x5d763f(null,_0x35a616);});},'filename':function(_0x1e1734,_0x49209d,_0x169be9){const _0x4e2d37=_0x49209d[_0x7d0a('0x2d')][_0x7d0a('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x141f53=path['extname'](_0x4e2d37);const _0x293942=Date[_0x7d0a('0x30')]()+'-'+_0x4e2d37[_0x7d0a('0x39')](_0x141f53,'')+_0x141f53;_0x169be9(null,_0x293942);}})});router[_0x7d0a('0x24')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x7d0a('0x3a')]);router[_0x7d0a('0x24')](_0x7d0a('0x3b'),auth[_0x7d0a('0xb')](),controller['addInteraction']);router[_0x7d0a('0x24')](_0x7d0a('0x1b'),auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x3c')]);router[_0x7d0a('0x24')](_0x7d0a('0x1d'),auth['isAuthenticated'](),controller[_0x7d0a('0x3d')]);router[_0x7d0a('0x24')](_0x7d0a('0x22'),auth[_0x7d0a('0xb')](),controller['addAgents']);router[_0x7d0a('0x3e')](_0x7d0a('0x3f'),auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x40')]);router[_0x7d0a('0x41')](_0x7d0a('0x3f'),auth[_0x7d0a('0xb')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x42')]);router[_0x7d0a('0x41')](_0x7d0a('0x12'),auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x43')]);router['delete'](_0x7d0a('0x22'),auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x44')]);module[_0x7d0a('0x45')]=router;
\ No newline at end of file
+var _0x6851=['isAuthenticated','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','root','server/files/images/avatars/','now','addCustomerAvatar','/:id/notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','index','/:id'];(function(_0x8c0bf5,_0x2456ab){var _0x447387=function(_0x4c2469){while(--_0x4c2469){_0x8c0bf5['push'](_0x8c0bf5['shift']());}};_0x447387(++_0x2456ab);}(_0x6851,0x1ca));var _0x1685=function(_0x2a053a,_0xf7e06f){_0x2a053a=_0x2a053a-0x0;var _0x33adb2=_0x6851[_0x2a053a];return _0x33adb2;};'use strict';var multer=require('multer');var util=require(_0x1685('0x0'));var path=require(_0x1685('0x1'));var timeout=require(_0x1685('0x2'));var express=require('express');var router=express[_0x1685('0x3')]();var fs_extra=require(_0x1685('0x4'));var auth=require(_0x1685('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1685('0x6'));var controller=require(_0x1685('0x7'));router[_0x1685('0x8')]('/',auth['isAuthenticated'](),controller[_0x1685('0x9')]);router[_0x1685('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x1685('0xa'),auth[_0x1685('0xb')](),controller['show']);router[_0x1685('0x8')](_0x1685('0xc'),auth[_0x1685('0xb')](),controller[_0x1685('0xd')]);router[_0x1685('0x8')](_0x1685('0xe'),auth[_0x1685('0xb')](),controller[_0x1685('0xf')]);router[_0x1685('0x8')](_0x1685('0x10'),controller[_0x1685('0x11')]);router['get'](_0x1685('0x12'),controller[_0x1685('0x13')]);router[_0x1685('0x8')](_0x1685('0x14'),controller[_0x1685('0x15')]);router[_0x1685('0x8')](_0x1685('0x16'),controller[_0x1685('0x17')]);router['get'](_0x1685('0x18'),auth[_0x1685('0xb')](),controller['getInteractions']);router[_0x1685('0x8')](_0x1685('0x19'),controller['getSnippet']);router[_0x1685('0x8')](_0x1685('0x1a'),auth[_0x1685('0xb')](),controller[_0x1685('0x1b')]);router[_0x1685('0x8')](_0x1685('0x1c'),auth[_0x1685('0xb')](),controller['getProactiveActions']);router['get']('/:id/fields',controller['getFields']);router[_0x1685('0x8')](_0x1685('0x1d'),auth[_0x1685('0xb')](),controller[_0x1685('0x1e')]);router[_0x1685('0x8')](_0x1685('0x1f'),auth[_0x1685('0xb')](),controller[_0x1685('0x20')]);router[_0x1685('0x21')]('/',auth[_0x1685('0xb')](),controller[_0x1685('0x22')]);router['post'](_0x1685('0xc'),auth[_0x1685('0xb')](),controller[_0x1685('0x23')]);router[_0x1685('0x21')](_0x1685('0xe'),auth[_0x1685('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x1685('0x24')]({'destination':function(_0x138098,_0x44f7ef,_0x3a7152){_0x3a7152(null,path[_0x1685('0x25')](config['root'],_0x1685('0x26')));},'filename':function(_0x2d4d21,_0x517fe5,_0x53949f){_0x53949f(null,util[_0x1685('0x27')](_0x1685('0x28'),Date['now'](),_0x517fe5[_0x1685('0x29')]));}})});router[_0x1685('0x21')](_0x1685('0x10'),upload[_0x1685('0x2a')](_0x1685('0x2b')),controller[_0x1685('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x32fe88,_0x2bcefb,_0x3c44ee){_0x3c44ee(null,path[_0x1685('0x25')](config[_0x1685('0x2d')],_0x1685('0x2e')));},'filename':function(_0x431771,_0x47de90,_0x3505bb){_0x3505bb(null,util[_0x1685('0x27')](_0x1685('0x28'),Date[_0x1685('0x2f')](),_0x47de90[_0x1685('0x29')]));}})});router[_0x1685('0x21')]('/:id/avatar',upload[_0x1685('0x2a')]('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x16ab22,_0x4ef169,_0x1d285a){_0x1d285a(null,path[_0x1685('0x25')](config[_0x1685('0x2d')],'server/files/images/avatars/'));},'filename':function(_0x51911e,_0xe0d162,_0x3449d0){_0x3449d0(null,util[_0x1685('0x27')](_0x1685('0x28'),Date[_0x1685('0x2f')](),_0xe0d162[_0x1685('0x29')]));}})});router[_0x1685('0x21')]('/:id/customer_avatar',upload['single']('file'),controller[_0x1685('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x51d805,_0x5f29f3,_0x382405){_0x382405(null,path[_0x1685('0x25')](config[_0x1685('0x2d')],_0x1685('0x2e')));},'filename':function(_0x309dca,_0x4f7536,_0x4b4ddf){_0x4b4ddf(null,util[_0x1685('0x27')]('%s-%s',Date[_0x1685('0x2f')](),_0x4f7536[_0x1685('0x29')]));}})});router[_0x1685('0x21')](_0x1685('0x16'),upload['single'](_0x1685('0x2b')),controller['addSystemAvatar']);router[_0x1685('0x21')](_0x1685('0x31'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x1685('0x24')]({'destination':function(_0x582a5e,_0x37c73b,_0x417fd6){const _0x561967=path[_0x1685('0x25')](config[_0x1685('0x2d')],_0x1685('0x32'),_0x1685('0x33'),_0x1685('0x34'));fs_extra['ensureDir'](_0x561967,function(){_0x417fd6(null,_0x561967);});},'filename':function(_0x226ccb,_0x55181a,_0x4b96d1){const _0x558876=_0x55181a[_0x1685('0x29')][_0x1685('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x26d001=path[_0x1685('0x36')](_0x558876);const _0x1ccb4f=Date['now']()+'-'+_0x558876[_0x1685('0x35')](_0x26d001,'')+_0x26d001;_0x4b96d1(null,_0x1ccb4f);}})});router['post'](_0x1685('0x37'),offlineUploadMulter[_0x1685('0x38')](),controller[_0x1685('0x39')]);router[_0x1685('0x21')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x1685('0x3a')]);router[_0x1685('0x21')](_0x1685('0x1a'),auth[_0x1685('0xb')](),controller[_0x1685('0x3b')]);router[_0x1685('0x21')](_0x1685('0x1c'),auth[_0x1685('0xb')](),controller['addProactiveActions']);router[_0x1685('0x21')]('/:id/users',auth[_0x1685('0xb')](),controller['addAgents']);router[_0x1685('0x3c')]('/:id',auth[_0x1685('0xb')](),controller[_0x1685('0x3d')]);router['delete'](_0x1685('0xa'),auth[_0x1685('0xb')](),controller[_0x1685('0x3e')]);router[_0x1685('0x3f')](_0x1685('0xc'),auth['isAuthenticated'](),controller[_0x1685('0x40')]);router[_0x1685('0x3f')](_0x1685('0xe'),auth[_0x1685('0xb')](),controller[_0x1685('0x41')]);router[_0x1685('0x3f')](_0x1685('0x1f'),auth[_0x1685('0xb')](),controller[_0x1685('0x42')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index a2fa006..c399e04 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 _0xe9bc=['production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','../config/environment'];(function(_0x5eb4af,_0x5a73fb){var _0x2107cc=function(_0x53ddc1){while(--_0x53ddc1){_0x5eb4af['push'](_0x5eb4af['shift']());}};_0x2107cc(++_0x5a73fb);}(_0xe9bc,0x1c5));var _0xce9b=function(_0x42a571,_0x57321c){_0x42a571=_0x42a571-0x0;var _0x32afaf=_0xe9bc[_0x42a571];return _0x32afaf;};var beaverLogger=require('beaver-logger/server');var express=require(_0xce9b('0x0'));var auth=require(_0xce9b('0x1'));var config=require(_0xce9b('0x2'));var router=express['Router']();var isProduction=config['env']===_0xce9b('0x3')||![];function clientSideLogs(_0x4ae37a,_0x434b8c,_0x2f80df){var _0x191036=_0x4ae37a[_0xce9b('0x4')][_0xce9b('0x5')](_0xce9b('0x6'));if(!_0x191036){throw new Error(_0xce9b('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0xce9b('0x8'),'logger':_0x191036,'enableCors':!isProduction})(_0x4ae37a,_0x434b8c,_0x2f80df);}router[_0xce9b('0x9')](auth[_0xce9b('0xa')](),clientSideLogs);module[_0xce9b('0xb')]=router;
\ No newline at end of file
+var _0xa59d=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../config/environment','env','production','app','client-side-logger'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xa59d,0xc9));var _0xda59=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa59d[_0x2641f9];return _0x585741;};var beaverLogger=require(_0xda59('0x0'));var express=require(_0xda59('0x1'));var auth=require('../components/auth/service');var config=require(_0xda59('0x2'));var router=express['Router']();var isProduction=config[_0xda59('0x3')]===_0xda59('0x4')||![];function clientSideLogs(_0x42f5d0,_0x268d2e,_0x553e84){var _0x1ed26b=_0x42f5d0[_0xda59('0x5')]['get'](_0xda59('0x6'));if(!_0x1ed26b){throw new Error(_0xda59('0x7'));}return beaverLogger[_0xda59('0x8')]({'uri':_0xda59('0x9'),'logger':_0x1ed26b,'enableCors':!isProduction})(_0x42f5d0,_0x268d2e,_0x553e84);}router[_0xda59('0xa')](auth[_0xda59('0xb')](),clientSideLogs);module[_0xda59('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 6080c85..280b66c 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 _0xbdf9=['sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xbdf9,0x126));var _0x9bdf=function(_0xb6b285,_0x596e01){_0xb6b285=_0xb6b285-0x0;var _0x11393c=_0xbdf9[_0xb6b285];return _0x11393c;};'use strict';var Sequelize=require(_0x9bdf('0x0'));module[_0x9bdf('0x1')]={'name':{'type':Sequelize[_0x9bdf('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9bdf('0x3')](_0x9bdf('0x4'),_0x9bdf('0x5'),_0x9bdf('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x9bdf('0x3')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0x9bdf('0x2')],'comment':_0x9bdf('0x7')},'data2':{'type':Sequelize[_0x9bdf('0x2')],'comment':_0x9bdf('0x8')},'data3':{'type':Sequelize[_0x9bdf('0x2')],'comment':_0x9bdf('0x9')},'data4':{'type':Sequelize[_0x9bdf('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x9bdf('0xa')],'comment':_0x9bdf('0xb')},'data6':{'type':Sequelize[_0x9bdf('0xa')],'comment':_0x9bdf('0xc')},'data7':{'type':Sequelize[_0x9bdf('0xa')],'comment':_0x9bdf('0xd')}};
\ No newline at end of file
+var _0xabfc=['sequelize','STRING','ENUM','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x18474f,_0x51e0f9){var _0xab5297=function(_0x4b2327){while(--_0x4b2327){_0x18474f['push'](_0x18474f['shift']());}};_0xab5297(++_0x51e0f9);}(_0xabfc,0x1c7));var _0xcabf=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0xabfc[_0x3d4ef1];return _0x409423;};'use strict';var Sequelize=require(_0xcabf('0x0'));module['exports']={'name':{'type':Sequelize[_0xcabf('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xcabf('0x2')]('AmazonAWS',_0xcabf('0x3'),_0xcabf('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xcabf('0x2')]('Outlook365',_0xcabf('0x5'))},'data1':{'type':Sequelize[_0xcabf('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xcabf('0x1')],'comment':_0xcabf('0x6')},'data3':{'type':Sequelize[_0xcabf('0x1')],'comment':_0xcabf('0x7')},'data4':{'type':Sequelize[_0xcabf('0x1')],'comment':_0xcabf('0x8')},'data5':{'type':Sequelize[_0xcabf('0x9')],'comment':_0xcabf('0xa')},'data6':{'type':Sequelize['TEXT'],'comment':_0xcabf('0xb')},'data7':{'type':Sequelize[_0xcabf('0x9')],'comment':_0xcabf('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index be1d406..9172d6c 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 _0x4502=['join','encryptString','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','isValidIdToken','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','emit','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','update','destroy','then','name','send','slice','index','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','params','CloudProvider','rawAttributes','find','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'];(function(_0x3431fb,_0x8bf9e1){var _0x9c6a02=function(_0xf096d0){while(--_0xf096d0){_0x3431fb['push'](_0x3431fb['shift']());}};_0x9c6a02(++_0x8bf9e1);}(_0x4502,0x17d));var _0x2450=function(_0x4f8f80,_0x1eed30){_0x4f8f80=_0x4f8f80-0x0;var _0x5af93f=_0x4502[_0x4f8f80];return _0x5af93f;};'use strict';var _=require('lodash');var Redis=require(_0x2450('0x0'));var qs=require(_0x2450('0x1'));var encryptor=require(_0x2450('0x2'));var config=require(_0x2450('0x3'));var logger=require('../../config/logger')(_0x2450('0x4'));var db=require(_0x2450('0x5'))['db'];var oauth=require(_0x2450('0x6'));config[_0x2450('0x7')]=_['defaults'](config[_0x2450('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x2450('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x2450('0x7')]);function respondWithStatusCode(_0x3103a9,_0x3ab97f){_0x3ab97f=_0x3ab97f||0xcc;return function(_0x4d6d49){if(_0x4d6d49){return _0x3103a9[_0x2450('0x9')](_0x3ab97f);}return _0x3103a9[_0x2450('0xa')](_0x3ab97f)[_0x2450('0xb')]();};}function respondWithResult(_0x46aaba,_0xd3e073){_0xd3e073=_0xd3e073||0xc8;return function(_0x132536){if(_0x132536){return _0x46aaba[_0x2450('0xa')](_0xd3e073)[_0x2450('0xc')](_0x132536);}};}function respondWithFilteredResult(_0x5133dc,_0x35fc3e){return function(_0x515b8d){if(_0x515b8d){var _0x33f189=typeof _0x35fc3e[_0x2450('0xd')]===_0x2450('0xe')&&typeof _0x35fc3e[_0x2450('0xf')]===_0x2450('0xe');var _0x2e163e=_0x515b8d['count'];var _0x386e0c=_0x33f189?0x0:_0x35fc3e[_0x2450('0xd')];var _0x42940d=_0x33f189?_0x515b8d[_0x2450('0x10')]:_0x35fc3e['offset']+_0x35fc3e[_0x2450('0xf')];var _0x5e7ca5;if(_0x42940d>=_0x2e163e){_0x42940d=_0x2e163e;_0x5e7ca5=0xc8;}else{_0x5e7ca5=0xce;}_0x5133dc['status'](_0x5e7ca5);return _0x5133dc['set']('Content-Range',_0x386e0c+'-'+_0x42940d+'/'+_0x2e163e)[_0x2450('0xc')](_0x515b8d);}return null;};}function saveUpdates(_0x4d1b8){return function(_0xdebf9b){if(_0xdebf9b){return _0xdebf9b[_0x2450('0x11')](_0x4d1b8)['then'](function(_0xd4ab18){return _0xd4ab18;});}return null;};}function removeEntity(_0x2cc3ce){return function(_0x4c0ecb){if(_0x4c0ecb){return _0x4c0ecb[_0x2450('0x12')]()[_0x2450('0x13')](function(){_0x2cc3ce[_0x2450('0xa')](0xcc)[_0x2450('0xb')]();});}};}function handleEntityNotFound(_0x37be2d){return function(_0xca1461){if(!_0xca1461){_0x37be2d[_0x2450('0x9')](0x194);}return _0xca1461;};}function handleError(_0x2a2c13,_0x38e7cc){_0x38e7cc=_0x38e7cc||0x1f4;return function(_0x40cec3){logger['error'](_0x40cec3['stack']);if(_0x40cec3[_0x2450('0x14')]){delete _0x40cec3[_0x2450('0x14')];}_0x2a2c13[_0x2450('0xa')](_0x38e7cc)[_0x2450('0x15')](_0x40cec3);};}function maskClientSecret(_0x2ac35c){return _['padEnd'](_0x2ac35c[_0x2450('0x16')](0x0,0x3),0x14,'*');}exports[_0x2450('0x17')]=function(_0x245eb2,_0x254375){var _0x6587a7={},_0x2cca12={},_0x5e0259={'count':0x0,'rows':[]};var _0x5f4906=_[_0x2450('0x18')](db['CloudProvider']['rawAttributes'],function(_0x4d2be6){return{'name':_0x4d2be6[_0x2450('0x19')],'type':_0x4d2be6[_0x2450('0x1a')]['key']};});_0x2cca12[_0x2450('0x1b')]=_[_0x2450('0x18')](_0x5f4906,_0x2450('0x14'));_0x2cca12[_0x2450('0x1c')]=_[_0x2450('0x1d')](_0x245eb2[_0x2450('0x1c')]);_0x2cca12[_0x2450('0x1e')]=_[_0x2450('0x1f')](_0x2cca12[_0x2450('0x1b')],_0x2cca12[_0x2450('0x1c')]);_0x6587a7['attributes']=_[_0x2450('0x1f')](_0x2cca12[_0x2450('0x1b')],qs[_0x2450('0x20')](_0x245eb2[_0x2450('0x1c')][_0x2450('0x20')]));_0x6587a7['attributes']=_0x6587a7[_0x2450('0x21')][_0x2450('0x22')]?_0x6587a7[_0x2450('0x21')]:_0x2cca12[_0x2450('0x1b')];if(!_0x245eb2[_0x2450('0x1c')][_0x2450('0x23')](_0x2450('0x24'))){_0x6587a7['limit']=qs[_0x2450('0xf')](_0x245eb2['query']['limit']);_0x6587a7['offset']=qs[_0x2450('0xd')](_0x245eb2[_0x2450('0x1c')][_0x2450('0xd')]);}_0x6587a7[_0x2450('0x25')]=qs[_0x2450('0x26')](_0x245eb2['query'][_0x2450('0x26')]);_0x6587a7[_0x2450('0x27')]=qs[_0x2450('0x1e')](_[_0x2450('0x28')](_0x245eb2['query'],_0x2cca12[_0x2450('0x1e')]),_0x5f4906);if(_0x245eb2[_0x2450('0x1c')][_0x2450('0x29')]){_0x6587a7[_0x2450('0x27')]=_[_0x2450('0x2a')](_0x6587a7[_0x2450('0x27')],{'$or':_[_0x2450('0x18')](_0x5f4906,function(_0x5046cf){if(_0x5046cf[_0x2450('0x1a')]!==_0x2450('0x2b')){var _0x431169={};_0x431169[_0x5046cf[_0x2450('0x14')]]={'$like':'%'+_0x245eb2[_0x2450('0x1c')][_0x2450('0x29')]+'%'};return _0x431169;}})});}_0x6587a7=_[_0x2450('0x2a')]({},_0x6587a7,_0x245eb2[_0x2450('0x2c')]);var _0x9877fe={'where':_0x6587a7[_0x2450('0x27')]};return db['CloudProvider'][_0x2450('0x10')](_0x9877fe)[_0x2450('0x13')](function(_0x491a11){_0x5e0259[_0x2450('0x10')]=_0x491a11;if(_0x245eb2['query'][_0x2450('0x2d')]){_0x6587a7[_0x2450('0x2e')]=[{'all':!![]}];}return db['CloudProvider'][_0x2450('0x2f')](_0x6587a7);})[_0x2450('0x13')](function(_0x5ed1d7){_0x5e0259[_0x2450('0x30')]=_[_0x2450('0x18')](_0x5ed1d7,function(_0x197f1d){if(_0x197f1d[_0x2450('0x31')]===_0x2450('0x32')){var _0x3de9b6=encryptor[_0x2450('0x33')](_0x197f1d[_0x2450('0x34')]);_0x197f1d[_0x2450('0x34')]=maskClientSecret(_0x3de9b6);}return _0x197f1d;});return _0x5e0259;})['then'](respondWithFilteredResult(_0x254375,_0x6587a7))[_0x2450('0x35')](handleError(_0x254375,null));};exports['show']=function(_0x1d78d2,_0x156c0c){var _0xa1b7bf={'raw':!![],'where':{'id':_0x1d78d2[_0x2450('0x36')]['id']}},_0x35b21b={};_0x35b21b[_0x2450('0x1b')]=_[_0x2450('0x1d')](db[_0x2450('0x37')][_0x2450('0x38')]);_0x35b21b[_0x2450('0x1c')]=_[_0x2450('0x1d')](_0x1d78d2[_0x2450('0x1c')]);_0x35b21b[_0x2450('0x1e')]=_[_0x2450('0x1f')](_0x35b21b[_0x2450('0x1b')],_0x35b21b['query']);_0xa1b7bf['attributes']=_['intersection'](_0x35b21b[_0x2450('0x1b')],qs[_0x2450('0x20')](_0x1d78d2[_0x2450('0x1c')][_0x2450('0x20')]));_0xa1b7bf['attributes']=_0xa1b7bf[_0x2450('0x21')][_0x2450('0x22')]?_0xa1b7bf[_0x2450('0x21')]:_0x35b21b[_0x2450('0x1b')];if(_0x1d78d2[_0x2450('0x1c')][_0x2450('0x2d')]){_0xa1b7bf[_0x2450('0x2e')]=[{'all':!![]}];}_0xa1b7bf=_['merge']({},_0xa1b7bf,_0x1d78d2[_0x2450('0x2c')]);return db[_0x2450('0x37')][_0x2450('0x39')](_0xa1b7bf)[_0x2450('0x13')](handleEntityNotFound(_0x156c0c,null))['then'](function(_0x2fc160){if(_0x2fc160[_0x2450('0x31')]===_0x2450('0x32')){var _0x8a1159=encryptor['decryptString'](_0x2fc160[_0x2450('0x34')]);_0x2fc160[_0x2450('0x34')]=maskClientSecret(_0x8a1159);}return _0x2fc160;})[_0x2450('0x13')](respondWithResult(_0x156c0c,null))[_0x2450('0x35')](handleError(_0x156c0c,null));};exports[_0x2450('0x3a')]=function(_0xaed84c,_0x5d611e){if(!_0xaed84c['body'][_0x2450('0x14')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0xaed84c[_0x2450('0x3b')]['service'])throw new Error(_0x2450('0x3c'));var _0x3f83ca=db[_0x2450('0x37')][_0x2450('0x38')][_0x2450('0x31')][_0x2450('0x3d')];if(!_0x3f83ca[_0x2450('0x3e')](_0xaed84c[_0x2450('0x3b')][_0x2450('0x31')]))throw new Error(_0x2450('0x3f')+_0x3f83ca[_0x2450('0x40')](',\x20'));if(_0xaed84c['body'][_0x2450('0x31')]===_0x2450('0x32')&&_0xaed84c['body'][_0x2450('0x34')]){_0xaed84c[_0x2450('0x3b')][_0x2450('0x34')]=encryptor[_0x2450('0x41')](_0xaed84c[_0x2450('0x3b')][_0x2450('0x34')]);}return db[_0x2450('0x37')][_0x2450('0x3a')](_0xaed84c[_0x2450('0x3b')],{})[_0x2450('0x13')](respondWithResult(_0x5d611e,0xc9))[_0x2450('0x35')](handleError(_0x5d611e,null));};exports[_0x2450('0x11')]=function(_0x563d7f,_0x29f0f9){if(_0x563d7f[_0x2450('0x3b')]['id']){delete _0x563d7f[_0x2450('0x3b')]['id'];}return db[_0x2450('0x37')][_0x2450('0x39')]({'where':{'id':_0x563d7f[_0x2450('0x36')]['id']}})['then'](handleEntityNotFound(_0x29f0f9,null))['then'](function(_0x10a943){if(_0x10a943[_0x2450('0x31')]===_0x2450('0x32')&&_0x563d7f[_0x2450('0x3b')][_0x2450('0x34')]){_0x563d7f[_0x2450('0x3b')][_0x2450('0x34')]=encryptor[_0x2450('0x41')](_0x563d7f[_0x2450('0x3b')][_0x2450('0x34')]);}return _0x10a943;})[_0x2450('0x13')](saveUpdates(_0x563d7f[_0x2450('0x3b')],null))[_0x2450('0x13')](respondWithResult(_0x29f0f9,null))[_0x2450('0x35')](handleError(_0x29f0f9,null));};exports[_0x2450('0x12')]=function(_0x585ca9,_0x30be46){return db['CloudProvider'][_0x2450('0x39')]({'where':{'id':_0x585ca9[_0x2450('0x36')]['id']}})[_0x2450('0x13')](handleEntityNotFound(_0x30be46,null))[_0x2450('0x13')](removeEntity(_0x30be46,null))[_0x2450('0x35')](handleError(_0x30be46,null));};exports[_0x2450('0x42')]=function(_0x57dad8,_0x16c7fc){return db['CloudProvider']['findOne']({'where':{'id':_0x57dad8[_0x2450('0x36')]['id']},'raw':!![]})['then'](function(_0x54d847){if(!_0x54d847)return _0x16c7fc[_0x2450('0x9')](0x194);return{'url':oauth[_0x2450('0x43')](_0x54d847,_0x57dad8['user']['id'])};})['then'](respondWithResult(_0x16c7fc,null))[_0x2450('0x35')](handleError(_0x16c7fc,null));};exports[_0x2450('0x44')]=function(_0x46d388,_0x282d30){var _0x2bce5f=_0x46d388[_0x2450('0x3b')];var _0x24a0f0;var _0x5a6aa7;if(_0x2bce5f[_0x2450('0x45')])throw _0x2bce5f;redis[_0x2450('0x46')](_0x2bce5f[_0x2450('0x47')])[_0x2450('0x13')](function(_0x1524cc){if(!_0x1524cc)throw new Error(_0x2450('0x48'));_0x24a0f0=JSON[_0x2450('0x49')](_0x1524cc);var _0x488036=Buffer[_0x2450('0x4a')](_0x2bce5f[_0x2450('0x47')],_0x2450('0x4b'))['toString'](_0x2450('0x4c'));_0x5a6aa7=JSON[_0x2450('0x49')](_0x488036);if(!oauth[_0x2450('0x4d')](_0x2bce5f['id_token'],_0x24a0f0[_0x2450('0x4e')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x2bce5f[_0x2450('0x47')]);return oauth[_0x2450('0x4f')](_0x2bce5f[_0x2450('0x50')],_0x24a0f0);})[_0x2450('0x13')](function(_0x126b62){_0x24a0f0[_0x2450('0x51')]=_0x126b62[_0x2450('0x52')];_0x24a0f0['data6']=_0x126b62[_0x2450('0x53')];return db['CloudProvider'][_0x2450('0x11')]({'data5':_0x24a0f0[_0x2450('0x51')],'data6':_0x24a0f0[_0x2450('0x54')]},{'where':{'id':_0x24a0f0['id']}});})[_0x2450('0x13')](function(){oauth['startRefreshInterval'](_0x24a0f0);socket[_0x2450('0x55')]('microsoftAuthorization:success',{'id':_0x5a6aa7['id']});return;})['then'](respondWithStatusCode(_0x282d30,null))[_0x2450('0x35')](function(_0x1fa8af){if(_0x5a6aa7){socket[_0x2450('0x55')]('microsoftAuthorization:error',{'id':_0x5a6aa7['id']});}if(!_0x24a0f0){logger[_0x2450('0x45')]('Invalid\x20authentication\x20state\x20parameter',_0x1fa8af);return _0x282d30[_0x2450('0xa')](0x1f4)[_0x2450('0x15')](_0x1fa8af[_0x2450('0x56')]);}logger[_0x2450('0x45')](_0x2450('0x57'),_0x24a0f0['id'],JSON[_0x2450('0x58')](_0x1fa8af));});};
\ No newline at end of file
+var _0xc641=['oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','send','message','stringify','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','update','then','destroy','error','name','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','offset','sort','where','filters','pick','filter','merge','options','include','findAll','service','MicrosoftAzure','decryptString','data3','catch','params','fields','includeAll','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0xc641,0x72));var _0x1c64=function(_0x430f93,_0xfea284){_0x430f93=_0x430f93-0x0;var _0x24cd20=_0xc641[_0x430f93];return _0x24cd20;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x1c64('0x0'));var encryptor=require(_0x1c64('0x1'));var config=require(_0x1c64('0x2'));var logger=require('../../config/logger')(_0x1c64('0x3'));var db=require(_0x1c64('0x4'))['db'];var oauth=require(_0x1c64('0x5'));config[_0x1c64('0x6')]=_['defaults'](config[_0x1c64('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x1c64('0x7'))(new Redis(config[_0x1c64('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x51fcda,_0x417a18){_0x417a18=_0x417a18||0xcc;return function(_0x4768c4){if(_0x4768c4){return _0x51fcda[_0x1c64('0x8')](_0x417a18);}return _0x51fcda[_0x1c64('0x9')](_0x417a18)[_0x1c64('0xa')]();};}function respondWithResult(_0x1b7f42,_0x3c4acb){_0x3c4acb=_0x3c4acb||0xc8;return function(_0x2bfc0a){if(_0x2bfc0a){return _0x1b7f42[_0x1c64('0x9')](_0x3c4acb)[_0x1c64('0xb')](_0x2bfc0a);}};}function respondWithFilteredResult(_0x33bb0c,_0x23e445){return function(_0x1a71cf){if(_0x1a71cf){var _0x3ccc46=typeof _0x23e445['offset']===_0x1c64('0xc')&&typeof _0x23e445[_0x1c64('0xd')]===_0x1c64('0xc');var _0x48d3d4=_0x1a71cf[_0x1c64('0xe')];var _0x3d5e7d=_0x3ccc46?0x0:_0x23e445['offset'];var _0x27478e=_0x3ccc46?_0x1a71cf[_0x1c64('0xe')]:_0x23e445['offset']+_0x23e445['limit'];var _0xbe2f47;if(_0x27478e>=_0x48d3d4){_0x27478e=_0x48d3d4;_0xbe2f47=0xc8;}else{_0xbe2f47=0xce;}_0x33bb0c['status'](_0xbe2f47);return _0x33bb0c[_0x1c64('0xf')](_0x1c64('0x10'),_0x3d5e7d+'-'+_0x27478e+'/'+_0x48d3d4)['json'](_0x1a71cf);}return null;};}function saveUpdates(_0x4e2415){return function(_0x32fb39){if(_0x32fb39){return _0x32fb39[_0x1c64('0x11')](_0x4e2415)[_0x1c64('0x12')](function(_0x8a9b53){return _0x8a9b53;});}return null;};}function removeEntity(_0x26dc11){return function(_0x5e5255){if(_0x5e5255){return _0x5e5255[_0x1c64('0x13')]()[_0x1c64('0x12')](function(){_0x26dc11['status'](0xcc)[_0x1c64('0xa')]();});}};}function handleEntityNotFound(_0x4b0723){return function(_0x2b2a4){if(!_0x2b2a4){_0x4b0723[_0x1c64('0x8')](0x194);}return _0x2b2a4;};}function handleError(_0x3afb15,_0x5067dc){_0x5067dc=_0x5067dc||0x1f4;return function(_0x3f0b7c){logger[_0x1c64('0x14')](_0x3f0b7c['stack']);if(_0x3f0b7c[_0x1c64('0x15')]){delete _0x3f0b7c[_0x1c64('0x15')];}_0x3afb15[_0x1c64('0x9')](_0x5067dc)['send'](_0x3f0b7c);};}function maskClientSecret(_0x175d0b){return _['padEnd'](_0x175d0b[_0x1c64('0x16')](0x0,0x3),0x14,'*');}exports[_0x1c64('0x17')]=function(_0x270296,_0x4d4b04){var _0x54b4dc={},_0x1ce87c={},_0xd4ae7f={'count':0x0,'rows':[]};var _0x4fdd5f=_[_0x1c64('0x18')](db[_0x1c64('0x19')][_0x1c64('0x1a')],function(_0x65a74d){return{'name':_0x65a74d[_0x1c64('0x1b')],'type':_0x65a74d[_0x1c64('0x1c')][_0x1c64('0x1d')]};});_0x1ce87c[_0x1c64('0x1e')]=_[_0x1c64('0x18')](_0x4fdd5f,_0x1c64('0x15'));_0x1ce87c['query']=_[_0x1c64('0x1f')](_0x270296[_0x1c64('0x20')]);_0x1ce87c['filters']=_[_0x1c64('0x21')](_0x1ce87c[_0x1c64('0x1e')],_0x1ce87c[_0x1c64('0x20')]);_0x54b4dc[_0x1c64('0x22')]=_[_0x1c64('0x21')](_0x1ce87c[_0x1c64('0x1e')],qs['fields'](_0x270296[_0x1c64('0x20')]['fields']));_0x54b4dc[_0x1c64('0x22')]=_0x54b4dc[_0x1c64('0x22')][_0x1c64('0x23')]?_0x54b4dc[_0x1c64('0x22')]:_0x1ce87c[_0x1c64('0x1e')];if(!_0x270296['query'][_0x1c64('0x24')](_0x1c64('0x25'))){_0x54b4dc['limit']=qs[_0x1c64('0xd')](_0x270296[_0x1c64('0x20')][_0x1c64('0xd')]);_0x54b4dc[_0x1c64('0x26')]=qs['offset'](_0x270296['query'][_0x1c64('0x26')]);}_0x54b4dc['order']=qs[_0x1c64('0x27')](_0x270296[_0x1c64('0x20')]['sort']);_0x54b4dc[_0x1c64('0x28')]=qs[_0x1c64('0x29')](_[_0x1c64('0x2a')](_0x270296[_0x1c64('0x20')],_0x1ce87c[_0x1c64('0x29')]),_0x4fdd5f);if(_0x270296['query'][_0x1c64('0x2b')]){_0x54b4dc[_0x1c64('0x28')]=_['merge'](_0x54b4dc[_0x1c64('0x28')],{'$or':_[_0x1c64('0x18')](_0x4fdd5f,function(_0x342fa0){if(_0x342fa0[_0x1c64('0x1c')]!=='VIRTUAL'){var _0x1e2284={};_0x1e2284[_0x342fa0['name']]={'$like':'%'+_0x270296[_0x1c64('0x20')][_0x1c64('0x2b')]+'%'};return _0x1e2284;}})});}_0x54b4dc=_[_0x1c64('0x2c')]({},_0x54b4dc,_0x270296[_0x1c64('0x2d')]);var _0x4513e8={'where':_0x54b4dc['where']};return db['CloudProvider'][_0x1c64('0xe')](_0x4513e8)['then'](function(_0x519192){_0xd4ae7f[_0x1c64('0xe')]=_0x519192;if(_0x270296[_0x1c64('0x20')]['includeAll']){_0x54b4dc[_0x1c64('0x2e')]=[{'all':!![]}];}return db[_0x1c64('0x19')][_0x1c64('0x2f')](_0x54b4dc);})[_0x1c64('0x12')](function(_0x35a816){_0xd4ae7f['rows']=_[_0x1c64('0x18')](_0x35a816,function(_0x443a80){if(_0x443a80[_0x1c64('0x30')]===_0x1c64('0x31')){var _0x50258c=encryptor[_0x1c64('0x32')](_0x443a80[_0x1c64('0x33')]);_0x443a80[_0x1c64('0x33')]=maskClientSecret(_0x50258c);}return _0x443a80;});return _0xd4ae7f;})[_0x1c64('0x12')](respondWithFilteredResult(_0x4d4b04,_0x54b4dc))[_0x1c64('0x34')](handleError(_0x4d4b04,null));};exports['show']=function(_0x11496f,_0x2e9648){var _0x35b34b={'raw':!![],'where':{'id':_0x11496f[_0x1c64('0x35')]['id']}},_0x3a5c88={};_0x3a5c88[_0x1c64('0x1e')]=_[_0x1c64('0x1f')](db['CloudProvider'][_0x1c64('0x1a')]);_0x3a5c88[_0x1c64('0x20')]=_[_0x1c64('0x1f')](_0x11496f[_0x1c64('0x20')]);_0x3a5c88[_0x1c64('0x29')]=_[_0x1c64('0x21')](_0x3a5c88[_0x1c64('0x1e')],_0x3a5c88['query']);_0x35b34b[_0x1c64('0x22')]=_[_0x1c64('0x21')](_0x3a5c88[_0x1c64('0x1e')],qs[_0x1c64('0x36')](_0x11496f[_0x1c64('0x20')][_0x1c64('0x36')]));_0x35b34b[_0x1c64('0x22')]=_0x35b34b[_0x1c64('0x22')][_0x1c64('0x23')]?_0x35b34b[_0x1c64('0x22')]:_0x3a5c88[_0x1c64('0x1e')];if(_0x11496f[_0x1c64('0x20')][_0x1c64('0x37')]){_0x35b34b[_0x1c64('0x2e')]=[{'all':!![]}];}_0x35b34b=_['merge']({},_0x35b34b,_0x11496f[_0x1c64('0x2d')]);return db[_0x1c64('0x19')][_0x1c64('0x38')](_0x35b34b)['then'](handleEntityNotFound(_0x2e9648,null))['then'](function(_0x3cda64){if(_0x3cda64[_0x1c64('0x30')]===_0x1c64('0x31')){var _0xa1f259=encryptor[_0x1c64('0x32')](_0x3cda64['data3']);_0x3cda64[_0x1c64('0x33')]=maskClientSecret(_0xa1f259);}return _0x3cda64;})[_0x1c64('0x12')](respondWithResult(_0x2e9648,null))[_0x1c64('0x34')](handleError(_0x2e9648,null));};exports[_0x1c64('0x39')]=function(_0x3825f4,_0x8ee76d){if(!_0x3825f4[_0x1c64('0x3a')][_0x1c64('0x15')])throw new Error(_0x1c64('0x3b'));if(!_0x3825f4[_0x1c64('0x3a')][_0x1c64('0x30')])throw new Error(_0x1c64('0x3c'));var _0x2e0707=db['CloudProvider'][_0x1c64('0x1a')][_0x1c64('0x30')][_0x1c64('0x3d')];if(!_0x2e0707[_0x1c64('0x3e')](_0x3825f4['body'][_0x1c64('0x30')]))throw new Error(_0x1c64('0x3f')+_0x2e0707[_0x1c64('0x40')](',\x20'));if(_0x3825f4['body'][_0x1c64('0x30')]==='MicrosoftAzure'&&_0x3825f4[_0x1c64('0x3a')][_0x1c64('0x33')]){_0x3825f4['body'][_0x1c64('0x33')]=encryptor[_0x1c64('0x41')](_0x3825f4[_0x1c64('0x3a')][_0x1c64('0x33')]);}return db[_0x1c64('0x19')][_0x1c64('0x39')](_0x3825f4[_0x1c64('0x3a')],{})[_0x1c64('0x12')](respondWithResult(_0x8ee76d,0xc9))['catch'](handleError(_0x8ee76d,null));};exports[_0x1c64('0x11')]=function(_0x5c6ea5,_0x69e6bd){if(_0x5c6ea5[_0x1c64('0x3a')]['id']){delete _0x5c6ea5[_0x1c64('0x3a')]['id'];}return db[_0x1c64('0x19')][_0x1c64('0x38')]({'where':{'id':_0x5c6ea5[_0x1c64('0x35')]['id']}})[_0x1c64('0x12')](handleEntityNotFound(_0x69e6bd,null))[_0x1c64('0x12')](function(_0x19cb70){if(_0x19cb70['service']===_0x1c64('0x31')&&_0x5c6ea5['body'][_0x1c64('0x33')]){_0x5c6ea5['body']['data3']=encryptor['encryptString'](_0x5c6ea5[_0x1c64('0x3a')]['data3']);}return _0x19cb70;})[_0x1c64('0x12')](saveUpdates(_0x5c6ea5[_0x1c64('0x3a')],null))[_0x1c64('0x12')](respondWithResult(_0x69e6bd,null))[_0x1c64('0x34')](handleError(_0x69e6bd,null));};exports[_0x1c64('0x13')]=function(_0x59ef2f,_0x29f328){return db['CloudProvider']['find']({'where':{'id':_0x59ef2f[_0x1c64('0x35')]['id']}})[_0x1c64('0x12')](handleEntityNotFound(_0x29f328,null))[_0x1c64('0x12')](removeEntity(_0x29f328,null))[_0x1c64('0x34')](handleError(_0x29f328,null));};exports[_0x1c64('0x42')]=function(_0x4fa413,_0x2cc821){return db['CloudProvider'][_0x1c64('0x43')]({'where':{'id':_0x4fa413[_0x1c64('0x35')]['id']},'raw':!![]})['then'](function(_0x3e464e){if(!_0x3e464e)return _0x2cc821[_0x1c64('0x8')](0x194);return{'url':oauth[_0x1c64('0x44')](_0x3e464e,_0x4fa413[_0x1c64('0x45')]['id'])};})['then'](respondWithResult(_0x2cc821,null))[_0x1c64('0x34')](handleError(_0x2cc821,null));};exports[_0x1c64('0x46')]=function(_0x36b9af,_0x2b6c0a){var _0x14cd3e=_0x36b9af[_0x1c64('0x3a')];var _0x3c374a;var _0x513490;if(_0x14cd3e[_0x1c64('0x14')])throw _0x14cd3e;redis[_0x1c64('0x47')](_0x14cd3e[_0x1c64('0x48')])[_0x1c64('0x12')](function(_0x56214e){if(!_0x56214e)throw new Error(_0x1c64('0x49'));_0x3c374a=JSON[_0x1c64('0x4a')](_0x56214e);var _0x1015f6=Buffer[_0x1c64('0x4b')](_0x14cd3e[_0x1c64('0x48')],_0x1c64('0x4c'))[_0x1c64('0x4d')](_0x1c64('0x4e'));_0x513490=JSON[_0x1c64('0x4a')](_0x1015f6);if(!oauth['isValidIdToken'](_0x14cd3e[_0x1c64('0x4f')],_0x3c374a['oauth2Claims']))throw new Error(_0x1c64('0x50'));redis[_0x1c64('0x51')](_0x14cd3e[_0x1c64('0x48')]);return oauth[_0x1c64('0x52')](_0x14cd3e['code'],_0x3c374a);})['then'](function(_0x1950ec){_0x3c374a[_0x1c64('0x53')]=_0x1950ec['access_token'];_0x3c374a[_0x1c64('0x54')]=_0x1950ec[_0x1c64('0x55')];return db['CloudProvider'][_0x1c64('0x11')]({'data5':_0x3c374a['data5'],'data6':_0x3c374a[_0x1c64('0x54')]},{'where':{'id':_0x3c374a['id']}});})[_0x1c64('0x12')](function(){oauth['startRefreshInterval'](_0x3c374a);socket[_0x1c64('0x56')](_0x1c64('0x57'),{'id':_0x513490['id']});return;})[_0x1c64('0x12')](respondWithStatusCode(_0x2b6c0a,null))[_0x1c64('0x34')](function(_0x330d65){if(_0x513490){socket[_0x1c64('0x56')](_0x1c64('0x58'),{'id':_0x513490['id']});}if(!_0x3c374a){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x330d65);return _0x2b6c0a[_0x1c64('0x9')](0x1f4)[_0x1c64('0x59')](_0x330d65[_0x1c64('0x5a')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x3c374a['id'],JSON[_0x1c64('0x5b')](_0x330d65));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 75db286..040d0f6 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 _0x9dbd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers'];(function(_0x4ca06e,_0xad0e25){var _0xee3ea2=function(_0x1503d5){while(--_0x1503d5){_0x4ca06e['push'](_0x4ca06e['shift']());}};_0xee3ea2(++_0xad0e25);}(_0x9dbd,0x177));var _0xd9db=function(_0x26a3ad,_0x12b751){_0x26a3ad=_0x26a3ad-0x0;var _0x51e755=_0x9dbd[_0x26a3ad];return _0x51e755;};'use strict';var _=require(_0xd9db('0x0'));var util=require(_0xd9db('0x1'));var logger=require(_0xd9db('0x2'))(_0xd9db('0x3'));var moment=require(_0xd9db('0x4'));var BPromise=require(_0xd9db('0x5'));var rp=require(_0xd9db('0x6'));var fs=require('fs');var path=require(_0xd9db('0x7'));var rimraf=require(_0xd9db('0x8'));var config=require(_0xd9db('0x9'));var attributes=require(_0xd9db('0xa'));module[_0xd9db('0xb')]=function(_0x292a07,_0x3b7a40){return _0x292a07[_0xd9db('0xc')](_0xd9db('0xd'),attributes,{'tableName':_0xd9db('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7821=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x16f3e9,_0x42c9a1){var _0x571fec=function(_0x4f9ba4){while(--_0x4f9ba4){_0x16f3e9['push'](_0x16f3e9['shift']());}};_0x571fec(++_0x42c9a1);}(_0x7821,0x125));var _0x1782=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0x7821[_0x343090];return _0x3ff3e8;};'use strict';var _=require('lodash');var util=require(_0x1782('0x0'));var logger=require(_0x1782('0x1'))('api');var moment=require(_0x1782('0x2'));var BPromise=require(_0x1782('0x3'));var rp=require(_0x1782('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1782('0x5'));var config=require(_0x1782('0x6'));var attributes=require(_0x1782('0x7'));module[_0x1782('0x8')]=function(_0x4e7a08,_0x502b5e){return _0x4e7a08[_0x1782('0x9')](_0x1782('0xa'),attributes,{'tableName':_0x1782('0xb'),'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 c8721f9..0d60be3 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 _0x488b=['id_token','from','base64','toString','client_id','data1','response_type','redirect_uri','data4','prompt','login','key','value','oauth2Claims','oauth2/','set','stringify','decode','aud','audience','nonce','isAfter','exp','resolve','then','CloudProvider','findOne','data6','decryptString','data3','POST','data2','access_token','refresh_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','offline_access','/authorize','/token','map','type','Dynamics365','data7','join','Outlook365','/.default','replace','{TENANT_ID}','code'];(function(_0x21cb7f,_0x48cd16){var _0x5a079a=function(_0x569a4f){while(--_0x569a4f){_0x21cb7f['push'](_0x21cb7f['shift']());}};_0x5a079a(++_0x48cd16);}(_0x488b,0x197));var _0xb488=function(_0x4aea1b,_0x10caff){_0x4aea1b=_0x4aea1b-0x0;var _0x5f59d2=_0x488b[_0x4aea1b];return _0x5f59d2;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xb488('0x0'));var Redis=require(_0xb488('0x1'));var rp=require(_0xb488('0x2'));var util=require(_0xb488('0x3'));var encryptor=require(_0xb488('0x4'));var config=require(_0xb488('0x5'));var logger=require(_0xb488('0x6'))(_0xb488('0x7'));var schedule=require(_0xb488('0x8'));var db=require(_0xb488('0x9'))['db'];config[_0xb488('0xa')]=_[_0xb488('0xb')](config[_0xb488('0xa')],{'host':_0xb488('0xc'),'port':0x18eb});var redis=new Redis(config[_0xb488('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xb488('0xd'),_0xb488('0xe'),_0xb488('0xf'),'offline_access',_0xb488('0x10'),_0xb488('0x11'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xb488('0xd'),_0xb488('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0xb488('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xb488('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x589c50){var _0x1141ee=_[_0xb488('0x15')](AZURE_AUTH_SCOPES[_0x589c50[_0xb488('0x16')]]);if(_0x589c50[_0xb488('0x16')]===_0xb488('0x17'))_0x1141ee['push'](_0x589c50[_0xb488('0x18')]+'/.default');return _0x1141ee[_0xb488('0x19')]('\x20');}function getAccessTokenScope(_0x419415){if(_0x419415['type']===_0xb488('0x1a'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x419415[_0xb488('0x16')]===_0xb488('0x17'))return _0x419415[_0xb488('0x18')]+_0xb488('0x1b');}function generateMicrosoftAuthorizationUrl(_0x3ad39e,_0xe8db41){var _0x147ee2=MICROSOFT_AUTH_URL[_0xb488('0x1c')](_0xb488('0x1d'),_0x3ad39e['data2']);var _0x582fce=[_0xb488('0x1e'),_0xb488('0x1f')];var _0x4453f1=Buffer[_0xb488('0x20')](JSON['stringify']({'id':_0xe8db41}))['toString'](_0xb488('0x21'));var _0x3c396b=crypto['randomBytes'](0x10)[_0xb488('0x22')]('hex');var _0x146cd5=getAuthorizationScopes(_0x3ad39e);var _0x5a3eff=[{'key':_0xb488('0x23'),'value':_0x3ad39e[_0xb488('0x24')]},{'key':_0xb488('0x25'),'value':encodeURIComponent(_0x582fce[_0xb488('0x19')]('\x20'))},{'key':_0xb488('0x26'),'value':_0x3ad39e[_0xb488('0x27')]},{'key':'response_mode','value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x146cd5)},{'key':'state','value':_0x4453f1},{'key':'nonce','value':_0x3c396b},{'key':_0xb488('0x28'),'value':_0xb488('0x29')}];var _0x106c8c=_0x147ee2+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb488('0x15')](_0x5a3eff,function(_0x5afe3e){return _0x5afe3e[_0xb488('0x2a')]+'='+_0x5afe3e[_0xb488('0x2b')];})[_0xb488('0x19')]('&');_0x3ad39e[_0xb488('0x2c')]={'issuer':_0x147ee2[_0xb488('0x1c')](_0xb488('0x2d'),''),'audience':_0x3ad39e[_0xb488('0x24')],'state':_0x4453f1,'nonce':_0x3c396b};redis[_0xb488('0x2e')](_0x4453f1,JSON[_0xb488('0x2f')](_0x3ad39e));return _0x106c8c;}function isValidIdToken(_0x17a18e,_0x3d496a){try{var _0x5cd6bf=jwt[_0xb488('0x30')](_0x17a18e,{'complete':!![]});var _0x39a248=_0x5cd6bf['payload'];if(_0x39a248['iss']!==_0x3d496a['issuer'])return![];if(_0x39a248[_0xb488('0x31')]!==_0x3d496a[_0xb488('0x32')])return![];if(_0x39a248[_0xb488('0x33')]!==_0x3d496a[_0xb488('0x33')])return![];if(moment()[_0xb488('0x34')](moment['unix'](_0x39a248[_0xb488('0x35')])))return![];return!![];}catch(_0x428477){throw _0x428477;}}function refreshOauth2MicrosoftAccessToken(_0x5e8a3e){return Promise[_0xb488('0x36')]()[_0xb488('0x37')](function(){if(_0x5e8a3e['data3'])return _0x5e8a3e;return db[_0xb488('0x38')][_0xb488('0x39')]({'where':{'id':_0x5e8a3e['id']},'raw':!![]});})[_0xb488('0x37')](function(_0x381dc9){var _0x5b339e={'grant_type':'refresh_token','refresh_token':_0x381dc9[_0xb488('0x3a')],'scope':getAccessTokenScope(_0x381dc9),'redirect_uri':_0x381dc9[_0xb488('0x27')],'client_id':_0x381dc9['data1'],'client_secret':encryptor[_0xb488('0x3b')](_0x381dc9[_0xb488('0x3c')])};var _0x6f2efa={'method':_0xb488('0x3d'),'uri':MICROSOFT_AUTH_URL[_0xb488('0x1c')](_0xb488('0x1d'),_0x381dc9[_0xb488('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5b339e,'json':!![]};return rp(_0x6f2efa);})['then'](function(_0x1d1f64){_0x5e8a3e['data5']=_0x1d1f64[_0xb488('0x3f')];_0x5e8a3e['data6']=_0x1d1f64[_0xb488('0x40')];return db[_0xb488('0x38')]['update']({'data5':_0x5e8a3e['data5'],'data6':_0x5e8a3e['data6']},{'where':{'id':_0x5e8a3e['id']}});})[_0xb488('0x37')](function(){return _0x5e8a3e;})[_0xb488('0x41')](function(_0x1a2aa5){logger[_0xb488('0x42')](_0xb488('0x43'),_0x5e8a3e['id'],_0x1a2aa5);});}function getOauth2MicrosoftAccessToken(_0x51ae04,_0x4d6637){var _0x144356={'grant_type':_0xb488('0x44'),'code':_0x51ae04,'scope':getAccessTokenScope(_0x4d6637),'redirect_uri':_0x4d6637[_0xb488('0x27')],'client_id':_0x4d6637[_0xb488('0x24')],'client_secret':encryptor[_0xb488('0x3b')](_0x4d6637[_0xb488('0x3c')])};var _0x1becd4={'method':_0xb488('0x3d'),'uri':MICROSOFT_AUTH_URL[_0xb488('0x1c')](_0xb488('0x1d'),_0x4d6637['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x144356,'json':!![]};return rp(_0x1becd4);}function startRefreshInterval(_0x38c252){var _0x149f9d=schedule['intervals'];if(_0x149f9d[_0x38c252['id']])clearInterval(_0x149f9d[_0x38c252['id']]);_0x149f9d[_0x38c252['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x38c252['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb488('0x45')]=_0x149f9d;}function startAllRefreshIntervals(){return db[_0xb488('0x38')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x523dc9){var _0x1e3e67=_0x523dc9[_0xb488('0x15')](function(_0x3d1084){return refreshOauth2MicrosoftAccessToken(_0x3d1084)['then'](function(_0x235af8){startRefreshInterval(_0x235af8);});});return Promise[_0xb488('0x46')](_0x1e3e67);})['catch'](function(_0x2af58f){var _0x436633=_0x2af58f?util['inspect'](_0x2af58f,{'showHidden':![],'depth':null}):'';logger['error'](_0xb488('0x47'),_0x436633);});}module[_0xb488('0x48')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x953a=['offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','toString','base64','randomBytes','hex','client_id','data1','scope','state','nonce','prompt','key','value','oauth2/','set','decode','payload','iss','issuer','aud','audience','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','access_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data4','intervals','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x953a,0x85));var _0xa953=function(_0x5a988e,_0x2072fd){_0x5a988e=_0x5a988e-0x0;var _0x124c21=_0x953a[_0x5a988e];return _0x124c21;};'use strict';var _=require(_0xa953('0x0'));var crypto=require('crypto');var jwt=require(_0xa953('0x1'));var moment=require(_0xa953('0x2'));var Redis=require(_0xa953('0x3'));var rp=require(_0xa953('0x4'));var util=require(_0xa953('0x5'));var encryptor=require(_0xa953('0x6'));var config=require(_0xa953('0x7'));var logger=require(_0xa953('0x8'))(_0xa953('0x9'));var schedule=require(_0xa953('0xa'));var db=require(_0xa953('0xb'))['db'];config[_0xa953('0xc')]=_[_0xa953('0xd')](config[_0xa953('0xc')],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xa953('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa953('0xf'),_0xa953('0x10'),'email',_0xa953('0x11'),_0xa953('0x12'),_0xa953('0x13'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xa953('0xf'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xa953('0x14');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3ff5ac){var _0x332577=_[_0xa953('0x15')](AZURE_AUTH_SCOPES[_0x3ff5ac[_0xa953('0x16')]]);if(_0x3ff5ac[_0xa953('0x16')]===_0xa953('0x17'))_0x332577[_0xa953('0x18')](_0x3ff5ac[_0xa953('0x19')]+_0xa953('0x1a'));return _0x332577[_0xa953('0x1b')]('\x20');}function getAccessTokenScope(_0x15549c){if(_0x15549c[_0xa953('0x16')]===_0xa953('0x1c'))return _0xa953('0x12');if(_0x15549c[_0xa953('0x16')]==='Dynamics365')return _0x15549c['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x5e8ef9,_0x215b7c){var _0x215d44=MICROSOFT_AUTH_URL[_0xa953('0x1d')](_0xa953('0x1e'),_0x5e8ef9[_0xa953('0x1f')]);var _0x9a448c=[_0xa953('0x20'),'id_token'];var _0x3ddf48=Buffer[_0xa953('0x21')](JSON['stringify']({'id':_0x215b7c}))[_0xa953('0x22')](_0xa953('0x23'));var _0x4d138d=crypto[_0xa953('0x24')](0x10)[_0xa953('0x22')](_0xa953('0x25'));var _0x3f8688=getAuthorizationScopes(_0x5e8ef9);var _0x2512e4=[{'key':_0xa953('0x26'),'value':_0x5e8ef9[_0xa953('0x27')]},{'key':'response_type','value':encodeURIComponent(_0x9a448c[_0xa953('0x1b')]('\x20'))},{'key':'redirect_uri','value':_0x5e8ef9['data4']},{'key':'response_mode','value':'form_post'},{'key':_0xa953('0x28'),'value':encodeURIComponent(_0x3f8688)},{'key':_0xa953('0x29'),'value':_0x3ddf48},{'key':_0xa953('0x2a'),'value':_0x4d138d},{'key':_0xa953('0x2b'),'value':'login'}];var _0x3049a9=_0x215d44+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa953('0x15')](_0x2512e4,function(_0x5902fb){return _0x5902fb[_0xa953('0x2c')]+'='+_0x5902fb[_0xa953('0x2d')];})[_0xa953('0x1b')]('&');_0x5e8ef9['oauth2Claims']={'issuer':_0x215d44[_0xa953('0x1d')](_0xa953('0x2e'),''),'audience':_0x5e8ef9[_0xa953('0x27')],'state':_0x3ddf48,'nonce':_0x4d138d};redis[_0xa953('0x2f')](_0x3ddf48,JSON['stringify'](_0x5e8ef9));return _0x3049a9;}function isValidIdToken(_0x370581,_0x573c3c){try{var _0x29c82a=jwt[_0xa953('0x30')](_0x370581,{'complete':!![]});var _0x1c8b93=_0x29c82a[_0xa953('0x31')];if(_0x1c8b93[_0xa953('0x32')]!==_0x573c3c[_0xa953('0x33')])return![];if(_0x1c8b93[_0xa953('0x34')]!==_0x573c3c[_0xa953('0x35')])return![];if(_0x1c8b93[_0xa953('0x2a')]!==_0x573c3c['nonce'])return![];if(moment()['isAfter'](moment['unix'](_0x1c8b93['exp'])))return![];return!![];}catch(_0x4be21b){throw _0x4be21b;}}function refreshOauth2MicrosoftAccessToken(_0x43266f){return Promise[_0xa953('0x36')]()[_0xa953('0x37')](function(){if(_0x43266f[_0xa953('0x38')])return _0x43266f;return db[_0xa953('0x39')][_0xa953('0x3a')]({'where':{'id':_0x43266f['id']},'raw':!![]});})[_0xa953('0x37')](function(_0x5ea51f){var _0x350379={'grant_type':_0xa953('0x3b'),'refresh_token':_0x5ea51f[_0xa953('0x3c')],'scope':getAccessTokenScope(_0x5ea51f),'redirect_uri':_0x5ea51f['data4'],'client_id':_0x5ea51f[_0xa953('0x27')],'client_secret':encryptor[_0xa953('0x3d')](_0x5ea51f['data3'])};var _0x5ad97d={'method':_0xa953('0x3e'),'uri':MICROSOFT_AUTH_URL['replace'](_0xa953('0x1e'),_0x5ea51f[_0xa953('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x350379,'json':!![]};return rp(_0x5ad97d);})[_0xa953('0x37')](function(_0x155aa9){_0x43266f[_0xa953('0x3f')]=_0x155aa9[_0xa953('0x40')];_0x43266f[_0xa953('0x3c')]=_0x155aa9[_0xa953('0x3b')];return db[_0xa953('0x39')][_0xa953('0x41')]({'data5':_0x43266f[_0xa953('0x3f')],'data6':_0x43266f[_0xa953('0x3c')]},{'where':{'id':_0x43266f['id']}});})['then'](function(){return _0x43266f;})['catch'](function(_0x52bd0e){logger[_0xa953('0x42')](_0xa953('0x43'),_0x43266f['id'],_0x52bd0e);});}function getOauth2MicrosoftAccessToken(_0x1bce3f,_0x66d622){var _0x2dfcef={'grant_type':'authorization_code','code':_0x1bce3f,'scope':getAccessTokenScope(_0x66d622),'redirect_uri':_0x66d622[_0xa953('0x44')],'client_id':_0x66d622[_0xa953('0x27')],'client_secret':encryptor[_0xa953('0x3d')](_0x66d622[_0xa953('0x38')])};var _0x1e939c={'method':_0xa953('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xa953('0x1d')](_0xa953('0x1e'),_0x66d622[_0xa953('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2dfcef,'json':!![]};return rp(_0x1e939c);}function startRefreshInterval(_0x3b38df){var _0x5129c6=schedule[_0xa953('0x45')];if(_0x5129c6[_0x3b38df['id']])clearInterval(_0x5129c6[_0x3b38df['id']]);_0x5129c6[_0x3b38df['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x3b38df['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xa953('0x45')]=_0x5129c6;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa953('0x37')](function(_0x543db0){var _0x47fc9e=_0x543db0['map'](function(_0x17373a){return refreshOauth2MicrosoftAccessToken(_0x17373a)[_0xa953('0x37')](function(_0x23c5ee){startRefreshInterval(_0x23c5ee);});});return Promise[_0xa953('0x46')](_0x47fc9e);})[_0xa953('0x47')](function(_0xe793a8){var _0x132ebd=_0xe793a8?util[_0xa953('0x48')](_0xe793a8,{'showHidden':![],'depth':null}):'';logger[_0xa953('0x42')](_0xa953('0x49'),_0x132ebd);});}module[_0xa953('0x4a')]={'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 9fc9f0f..78b5d25 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 _0x7c71=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x5deeb0,_0x5d96f2){var _0x1093bc=function(_0x2e5fd4){while(--_0x2e5fd4){_0x5deeb0['push'](_0x5deeb0['shift']());}};_0x1093bc(++_0x5d96f2);}(_0x7c71,0x177));var _0x17c7=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0x7c71[_0x51674a];return _0x13fca6;};'use strict';var _=require(_0x17c7('0x0'));var util=require(_0x17c7('0x1'));var moment=require(_0x17c7('0x2'));var BPromise=require(_0x17c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17c7('0x4'));var db=require(_0x17c7('0x5'))['db'];var utils=require(_0x17c7('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x17c7('0x7'));var jayson=require(_0x17c7('0x8'));var client=jayson[_0x17c7('0x9')][_0x17c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c061b,_0xf284a2,_0x1ff4ec){return new BPromise(function(_0x50feb0,_0x13fdad){return client[_0x17c7('0xb')](_0x3c061b,_0x1ff4ec)[_0x17c7('0xc')](function(_0xdb3575){logger[_0x17c7('0xd')](_0x17c7('0xe'),_0xf284a2,_0x17c7('0xf'));logger[_0x17c7('0x10')](_0x17c7('0x11'),_0xf284a2,_0x17c7('0xf'),JSON['stringify'](_0xdb3575));if(_0xdb3575['error']){if(_0xdb3575[_0x17c7('0x12')][_0x17c7('0x13')]===0x1f4){logger['error'](_0x17c7('0xe'),_0xf284a2,_0xdb3575[_0x17c7('0x12')]['message']);return _0x13fdad(_0xdb3575[_0x17c7('0x12')][_0x17c7('0x14')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0xf284a2,_0xdb3575[_0x17c7('0x12')][_0x17c7('0x14')]);return _0x50feb0(_0xdb3575[_0x17c7('0x12')][_0x17c7('0x14')]);}else{logger[_0x17c7('0xd')](_0x17c7('0xe'),_0xf284a2,_0x17c7('0xf'));_0x50feb0(_0xdb3575[_0x17c7('0x15')][_0x17c7('0x14')]);}})[_0x17c7('0x16')](function(_0x296f9c){logger[_0x17c7('0x12')]('CloudProvider,\x20%s,\x20%s',_0xf284a2,_0x296f9c);_0x13fdad(_0x296f9c);});});}
\ No newline at end of file
+var _0x5236=['http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x5edc3b,_0x21995d){var _0x82275=function(_0x3ff620){while(--_0x3ff620){_0x5edc3b['push'](_0x5edc3b['shift']());}};_0x82275(++_0x21995d);}(_0x5236,0x109));var _0x6523=function(_0x20d39d,_0x5e8fd4){_0x20d39d=_0x20d39d-0x0;var _0xf75618=_0x5236[_0x20d39d];return _0xf75618;};'use strict';var _=require(_0x6523('0x0'));var util=require(_0x6523('0x1'));var moment=require(_0x6523('0x2'));var BPromise=require(_0x6523('0x3'));var rs=require(_0x6523('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6523('0x5'))['db'];var utils=require(_0x6523('0x6'));var logger=require('../../config/logger')(_0x6523('0x7'));var config=require(_0x6523('0x8'));var jayson=require(_0x6523('0x9'));var client=jayson[_0x6523('0xa')][_0x6523('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53548c,_0x32e99c,_0x17b335){return new BPromise(function(_0x24550b,_0x514e29){return client[_0x6523('0xc')](_0x53548c,_0x17b335)[_0x6523('0xd')](function(_0x2afd63){logger[_0x6523('0xe')](_0x6523('0xf'),_0x32e99c,_0x6523('0x10'));logger['debug'](_0x6523('0x11'),_0x32e99c,_0x6523('0x10'),JSON[_0x6523('0x12')](_0x2afd63));if(_0x2afd63[_0x6523('0x13')]){if(_0x2afd63[_0x6523('0x13')]['code']===0x1f4){logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x2afd63['error'][_0x6523('0x14')]);return _0x514e29(_0x2afd63['error']['message']);}logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x2afd63[_0x6523('0x13')][_0x6523('0x14')]);return _0x24550b(_0x2afd63[_0x6523('0x13')][_0x6523('0x14')]);}else{logger['info'](_0x6523('0xf'),_0x32e99c,'request\x20sent');_0x24550b(_0x2afd63[_0x6523('0x15')][_0x6523('0x14')]);}})[_0x6523('0x16')](function(_0x34acbe){logger[_0x6523('0x13')](_0x6523('0xf'),_0x32e99c,_0x34acbe);_0x514e29(_0x34acbe);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index f4ab3c7..a5cff78 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x7a54,0x106));var _0x47a5=function(_0x55d224,_0xbd2e16){_0x55d224=_0x55d224-0x0;var _0x1cfd77=_0x7a54[_0x55d224];return _0x1cfd77;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
+var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4780ae,_0x3b5c2f){_0x4780ae=_0x4780ae-0x0;var _0x3b6849=_0x5f2f[_0x4780ae];return _0x3b6849;};'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 3fcdefd..ae0c675 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 _0x748f=['name','STRING','sequelize','exports'];(function(_0x89fd51,_0x6d935d){var _0xb3c267=function(_0x12fca0){while(--_0x12fca0){_0x89fd51['push'](_0x89fd51['shift']());}};_0xb3c267(++_0x6d935d);}(_0x748f,0x76));var _0xf748=function(_0x6ff3a9,_0x13b9c2){_0x6ff3a9=_0x6ff3a9-0x0;var _0x249066=_0x748f[_0x6ff3a9];return _0x249066;};'use strict';var Sequelize=require(_0xf748('0x0'));module[_0xf748('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf748('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf748('0x3')]},'companyId':{'type':Sequelize[_0xf748('0x3')]},'website':{'type':Sequelize[_0xf748('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf748('0x3')]},'street':{'type':Sequelize[_0xf748('0x3')]},'postalCode':{'type':Sequelize[_0xf748('0x3')]},'city':{'type':Sequelize[_0xf748('0x3')]},'country':{'type':Sequelize[_0xf748('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf748('0x3')]},'sStreet':{'type':Sequelize[_0xf748('0x3')]},'sPostalCode':{'type':Sequelize[_0xf748('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xf748('0x3')]},'description':{'type':Sequelize[_0xf748('0x3')]}};
\ No newline at end of file
+var _0xcb4d=['name','exports','STRING'];(function(_0x5cb96f,_0x49f52a){var _0x75a267=function(_0x584e1d){while(--_0x584e1d){_0x5cb96f['push'](_0x5cb96f['shift']());}};_0x75a267(++_0x49f52a);}(_0xcb4d,0xcd));var _0xdcb4=function(_0x485b70,_0x179af7){_0x485b70=_0x485b70-0x0;var _0x4dc80f=_0xcb4d[_0x485b70];return _0x4dc80f;};'use strict';var Sequelize=require('sequelize');module[_0xdcb4('0x0')]={'name':{'type':Sequelize[_0xdcb4('0x1')],'unique':_0xdcb4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xdcb4('0x1')]},'companyId':{'type':Sequelize[_0xdcb4('0x1')]},'website':{'type':Sequelize[_0xdcb4('0x1')]},'phone':{'type':Sequelize[_0xdcb4('0x1')]},'fax':{'type':Sequelize[_0xdcb4('0x1')]},'type':{'type':Sequelize[_0xdcb4('0x1')]},'street':{'type':Sequelize[_0xdcb4('0x1')]},'postalCode':{'type':Sequelize[_0xdcb4('0x1')]},'city':{'type':Sequelize[_0xdcb4('0x1')]},'country':{'type':Sequelize[_0xdcb4('0x1')]},'email':{'type':Sequelize[_0xdcb4('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xdcb4('0x1')]},'sStreet':{'type':Sequelize[_0xdcb4('0x1')]},'sPostalCode':{'type':Sequelize[_0xdcb4('0x1')]},'sCity':{'type':Sequelize[_0xdcb4('0x1')]},'sCountry':{'type':Sequelize[_0xdcb4('0x1')]},'description':{'type':Sequelize[_0xdcb4('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 2da95a9..f70cdaf 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 _0x4dd9=['squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Companies','UserProfileResource','end','error','stack','name','send','index','describe','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','CmCompany','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0x4dd9,0x100));var _0x94dd=function(_0xc7d00e,_0x53faef){_0xc7d00e=_0xc7d00e-0x0;var _0x39bf39=_0x4dd9[_0xc7d00e];return _0x39bf39;};'use strict';var emlformat=require(_0x94dd('0x0'));var rimraf=require(_0x94dd('0x1'));var zipdir=require(_0x94dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x94dd('0x3'));var moment=require(_0x94dd('0x4'));var BPromise=require(_0x94dd('0x5'));var Mustache=require(_0x94dd('0x6'));var util=require(_0x94dd('0x7'));var path=require(_0x94dd('0x8'));var sox=require(_0x94dd('0x9'));var csv=require(_0x94dd('0xa'));var ejs=require(_0x94dd('0xb'));var fs=require('fs');var fs_extra=require(_0x94dd('0xc'));var _=require(_0x94dd('0xd'));var squel=require(_0x94dd('0xe'));var crypto=require(_0x94dd('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x94dd('0xa'));var querystring=require('querystring');var Papa=require(_0x94dd('0x10'));var Redis=require('ioredis');var authService=require(_0x94dd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x94dd('0x12'));var hardwareService=require(_0x94dd('0x13'));var logger=require(_0x94dd('0x14'))('api');var utils=require(_0x94dd('0x15'));var config=require(_0x94dd('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x94dd('0x17'))['db'];function respondWithStatusCode(_0x24dda1,_0x318e96){_0x318e96=_0x318e96||0xcc;return function(_0x40ff81){if(_0x40ff81){return _0x24dda1[_0x94dd('0x18')](_0x318e96);}return _0x24dda1[_0x94dd('0x19')](_0x318e96)['end']();};}function respondWithResult(_0x23db2a,_0x3d04e9){_0x3d04e9=_0x3d04e9||0xc8;return function(_0x54ce9c){if(_0x54ce9c){return _0x23db2a[_0x94dd('0x19')](_0x3d04e9)[_0x94dd('0x1a')](_0x54ce9c);}};}function respondWithFilteredResult(_0x2c544f,_0x5adeba){return function(_0x5ebfd2){if(_0x5ebfd2){var _0x5db617=typeof _0x5adeba[_0x94dd('0x1b')]===_0x94dd('0x1c')&&typeof _0x5adeba[_0x94dd('0x1d')]===_0x94dd('0x1c');var _0x2c5ec1=_0x5ebfd2[_0x94dd('0x1e')];var _0x4cf8ba=_0x5db617?0x0:_0x5adeba['offset'];var _0x4a40b9=_0x5db617?_0x5ebfd2[_0x94dd('0x1e')]:_0x5adeba[_0x94dd('0x1b')]+_0x5adeba[_0x94dd('0x1d')];var _0x2ff5fe;if(_0x4a40b9>=_0x2c5ec1){_0x4a40b9=_0x2c5ec1;_0x2ff5fe=0xc8;}else{_0x2ff5fe=0xce;}_0x2c544f[_0x94dd('0x19')](_0x2ff5fe);return _0x2c544f[_0x94dd('0x1f')](_0x94dd('0x20'),_0x4cf8ba+'-'+_0x4a40b9+'/'+_0x2c5ec1)['json'](_0x5ebfd2);}return null;};}function patchUpdates(_0x9c9cbf){return function(_0x1d2789){try{jsonpatch[_0x94dd('0x21')](_0x1d2789,_0x9c9cbf,!![]);}catch(_0x1e95de){return BPromise['reject'](_0x1e95de);}return _0x1d2789[_0x94dd('0x22')]();};}function saveUpdates(_0x2cab26,_0x40d024){return function(_0x2cd2d9){if(_0x2cd2d9){return _0x2cd2d9[_0x94dd('0x23')](_0x2cab26)['then'](function(_0x1ffaae){return _0x1ffaae;});}return null;};}function removeEntity(_0xdf03b0,_0xa0b638){return function(_0x5007d7){if(_0x5007d7){return _0x5007d7[_0x94dd('0x24')]()[_0x94dd('0x25')](function(){var _0x55c8ff=_0x5007d7[_0x94dd('0x26')]({'plain':!![]});var _0x1dd3e9=_0x94dd('0x27');return db[_0x94dd('0x28')][_0x94dd('0x24')]({'where':{'type':_0x1dd3e9,'resourceId':_0x55c8ff['id']}})['then'](function(){return _0x5007d7;});})['then'](function(){_0xdf03b0[_0x94dd('0x19')](0xcc)[_0x94dd('0x29')]();});}};}function handleEntityNotFound(_0x50ff00,_0x1f6b90){return function(_0x5bdf44){if(!_0x5bdf44){_0x50ff00[_0x94dd('0x18')](0x194);}return _0x5bdf44;};}function handleError(_0x232dd4,_0x33e37e){_0x33e37e=_0x33e37e||0x1f4;return function(_0x1298c6){logger[_0x94dd('0x2a')](_0x1298c6[_0x94dd('0x2b')]);if(_0x1298c6[_0x94dd('0x2c')]){delete _0x1298c6[_0x94dd('0x2c')];}_0x232dd4[_0x94dd('0x19')](_0x33e37e)[_0x94dd('0x2d')](_0x1298c6);};}exports[_0x94dd('0x2e')]=function(_0x3f8789,_0x2508b6){var _0x2ecd50={},_0x36a868={},_0x5c8fdd={'count':0x0,'rows':[]};return db['CmCompany'][_0x94dd('0x2f')]()[_0x94dd('0x25')](function(_0x1f3b5b){_0x36a868[_0x94dd('0x30')]=_['keys'](_0x1f3b5b);_0x36a868[_0x94dd('0x31')]=_[_0x94dd('0x32')](_0x3f8789['query']);_0x36a868[_0x94dd('0x33')]=_[_0x94dd('0x34')](_0x36a868[_0x94dd('0x30')],_0x36a868[_0x94dd('0x31')]);_0x2ecd50[_0x94dd('0x35')]=_[_0x94dd('0x34')](_0x36a868['model'],qs[_0x94dd('0x36')](_0x3f8789['query'][_0x94dd('0x36')]));_0x2ecd50[_0x94dd('0x35')]=_0x2ecd50[_0x94dd('0x35')][_0x94dd('0x37')]?_0x2ecd50[_0x94dd('0x35')]:_0x36a868['model'];if(!_0x3f8789['query'][_0x94dd('0x38')](_0x94dd('0x39'))){_0x2ecd50[_0x94dd('0x1d')]=qs[_0x94dd('0x1d')](_0x3f8789['query']['limit']);_0x2ecd50[_0x94dd('0x1b')]=qs[_0x94dd('0x1b')](_0x3f8789['query'][_0x94dd('0x1b')]);}_0x2ecd50[_0x94dd('0x3a')]=qs[_0x94dd('0x3b')](_0x3f8789[_0x94dd('0x31')][_0x94dd('0x3b')]);_0x2ecd50[_0x94dd('0x3c')]=qs[_0x94dd('0x33')](_[_0x94dd('0x3d')](_0x3f8789[_0x94dd('0x31')],_0x36a868['filters']),_0x1f3b5b);if(_0x3f8789['query'][_0x94dd('0x3e')]){_0x2ecd50[_0x94dd('0x3c')]=_[_0x94dd('0x3f')](_0x2ecd50[_0x94dd('0x3c')],{'$or':_[_0x94dd('0x40')](_0x2ecd50[_0x94dd('0x35')],function(_0x52bdcf){var _0x35e3b2={};_0x35e3b2[_0x52bdcf]={'$like':'%'+_0x3f8789[_0x94dd('0x31')]['filter']+'%'};return _0x35e3b2;})});}_0x2ecd50=_['merge']({},_0x2ecd50,_0x3f8789[_0x94dd('0x41')]);var _0x46fecc={'where':_0x2ecd50[_0x94dd('0x3c')]};return db[_0x94dd('0x42')][_0x94dd('0x1e')](_0x46fecc)[_0x94dd('0x25')](function(_0x1343b0){_0x5c8fdd[_0x94dd('0x1e')]=_0x1343b0;if(_0x3f8789[_0x94dd('0x31')][_0x94dd('0x43')]){_0x2ecd50[_0x94dd('0x44')]=[{'all':!![]}];}return db[_0x94dd('0x42')][_0x94dd('0x45')](_0x2ecd50);})['then'](function(_0x2416c4){_0x5c8fdd[_0x94dd('0x46')]=_0x2416c4;return _0x5c8fdd;})[_0x94dd('0x25')](respondWithFilteredResult(_0x2508b6,_0x2ecd50))[_0x94dd('0x47')](handleError(_0x2508b6,null));})['catch'](handleError(_0x2508b6,null));};exports[_0x94dd('0x48')]=function(_0x5cac09,_0x5b4a54){var _0x42d372={'raw':![],'where':{'id':_0x5cac09['params']['id']}},_0x16bbf6={};_0x16bbf6[_0x94dd('0x30')]=_[_0x94dd('0x32')](db[_0x94dd('0x42')][_0x94dd('0x49')]);_0x16bbf6[_0x94dd('0x31')]=_[_0x94dd('0x32')](_0x5cac09['query']);_0x16bbf6[_0x94dd('0x33')]=_[_0x94dd('0x34')](_0x16bbf6['model'],_0x16bbf6[_0x94dd('0x31')]);_0x42d372[_0x94dd('0x35')]=_[_0x94dd('0x34')](_0x16bbf6['model'],qs['fields'](_0x5cac09[_0x94dd('0x31')][_0x94dd('0x36')]));_0x42d372[_0x94dd('0x35')]=_0x42d372['attributes']['length']?_0x42d372[_0x94dd('0x35')]:_0x16bbf6[_0x94dd('0x30')];if(_0x5cac09[_0x94dd('0x31')][_0x94dd('0x43')]){_0x42d372[_0x94dd('0x44')]=[{'all':!![]}];}_0x42d372=_[_0x94dd('0x3f')]({},_0x42d372,_0x5cac09[_0x94dd('0x41')]);return db[_0x94dd('0x42')][_0x94dd('0x4a')](_0x42d372)[_0x94dd('0x25')](handleEntityNotFound(_0x5b4a54,null))[_0x94dd('0x25')](respondWithResult(_0x5b4a54,null))[_0x94dd('0x47')](handleError(_0x5b4a54,null));};exports[_0x94dd('0x4b')]=function(_0x48d946,_0x71b03a){return db[_0x94dd('0x42')][_0x94dd('0x4b')](_0x48d946[_0x94dd('0x4c')],{})[_0x94dd('0x25')](function(_0x228e42){var _0x5b059a=_0x48d946[_0x94dd('0x4d')][_0x94dd('0x26')]({'plain':!![]});if(!_0x5b059a)throw new Error(_0x94dd('0x4e'));if(_0x5b059a[_0x94dd('0x4f')]==='user'){var _0x274160=_0x228e42['get']({'plain':!![]});var _0x31a4ef=_0x94dd('0x27');return db[_0x94dd('0x50')]['find']({'where':{'name':_0x31a4ef,'userProfileId':_0x5b059a[_0x94dd('0x51')]},'raw':!![]})[_0x94dd('0x25')](function(_0x775528){if(_0x775528&&_0x775528[_0x94dd('0x52')]===0x0){return db[_0x94dd('0x28')][_0x94dd('0x4b')]({'name':_0x274160[_0x94dd('0x2c')],'resourceId':_0x274160['id'],'type':_0x775528[_0x94dd('0x2c')],'sectionId':_0x775528['id']},{})[_0x94dd('0x25')](function(){return _0x228e42;});}else{return _0x228e42;}})[_0x94dd('0x47')](function(_0x5d14d3){logger[_0x94dd('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d14d3);throw _0x5d14d3;});}return _0x228e42;})[_0x94dd('0x25')](respondWithResult(_0x71b03a,0xc9))[_0x94dd('0x47')](handleError(_0x71b03a,null));};exports[_0x94dd('0x23')]=function(_0x13362f,_0x39e3f4){if(_0x13362f[_0x94dd('0x4c')]['id']){delete _0x13362f[_0x94dd('0x4c')]['id'];}return db[_0x94dd('0x42')][_0x94dd('0x4a')]({'where':{'id':_0x13362f['params']['id']}})['then'](handleEntityNotFound(_0x39e3f4,null))[_0x94dd('0x25')](saveUpdates(_0x13362f[_0x94dd('0x4c')],null))['then'](respondWithResult(_0x39e3f4,null))[_0x94dd('0x47')](handleError(_0x39e3f4,null));};exports[_0x94dd('0x24')]=function(_0xc79489,_0x37fec5){return db[_0x94dd('0x42')][_0x94dd('0x4a')]({'where':{'id':_0xc79489[_0x94dd('0x53')]['id']}})[_0x94dd('0x25')](handleEntityNotFound(_0x37fec5,null))[_0x94dd('0x25')](removeEntity(_0x37fec5,null))['catch'](handleError(_0x37fec5,null));};exports[_0x94dd('0x2f')]=function(_0x716d11,_0xa232d2){return db[_0x94dd('0x42')]['describe']()[_0x94dd('0x25')](respondWithResult(_0xa232d2,null))[_0x94dd('0x47')](handleError(_0xa232d2,null));};exports[_0x94dd('0x54')]=function(_0x4fc336,_0x128f13,_0x4cc047){return db[_0x94dd('0x55')][_0x94dd('0x4a')]({'where':{'id':_0x4fc336['params']['id']}})[_0x94dd('0x25')](handleEntityNotFound(_0x128f13,null))[_0x94dd('0x25')](function(_0x246228){if(_0x246228){return _0x246228['addContacts'](_0x4fc336[_0x94dd('0x4c')][_0x94dd('0x56')],_[_0x94dd('0x57')](_0x4fc336['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x128f13,null))[_0x94dd('0x47')](handleError(_0x128f13,null));};exports[_0x94dd('0x58')]=function(_0x185e36,_0x4edc61,_0x5754f1){var _0x5610d2={};var _0x34c541={};var _0x304759;var _0x43d6df;return db[_0x94dd('0x42')][_0x94dd('0x59')]({'where':{'id':_0x185e36[_0x94dd('0x53')]['id']}})[_0x94dd('0x25')](handleEntityNotFound(_0x4edc61,null))['then'](function(_0x5fbde3){if(_0x5fbde3){_0x304759=_0x5fbde3;_0x34c541[_0x94dd('0x30')]=_[_0x94dd('0x32')](db['CmContact']['rawAttributes']);_0x34c541[_0x94dd('0x31')]=_[_0x94dd('0x32')](_0x185e36[_0x94dd('0x31')]);_0x34c541[_0x94dd('0x33')]=_[_0x94dd('0x34')](_0x34c541[_0x94dd('0x30')],_0x34c541[_0x94dd('0x31')]);_0x5610d2[_0x94dd('0x35')]=_[_0x94dd('0x34')](_0x34c541[_0x94dd('0x30')],qs[_0x94dd('0x36')](_0x185e36[_0x94dd('0x31')][_0x94dd('0x36')]));_0x5610d2[_0x94dd('0x35')]=_0x5610d2[_0x94dd('0x35')][_0x94dd('0x37')]?_0x5610d2[_0x94dd('0x35')]:_0x34c541[_0x94dd('0x30')];_0x5610d2['order']=qs['sort'](_0x185e36[_0x94dd('0x31')][_0x94dd('0x3b')]);_0x5610d2[_0x94dd('0x3c')]=qs[_0x94dd('0x33')](_['pick'](_0x185e36[_0x94dd('0x31')],_0x34c541['filters']));if(_0x185e36[_0x94dd('0x31')][_0x94dd('0x3e')]){_0x5610d2[_0x94dd('0x3c')]=_[_0x94dd('0x3f')](_0x5610d2[_0x94dd('0x3c')],{'$or':_[_0x94dd('0x40')](_0x5610d2[_0x94dd('0x35')],function(_0x2d466c){var _0x25f319={};_0x25f319[_0x2d466c]={'$like':'%'+_0x185e36[_0x94dd('0x31')][_0x94dd('0x3e')]+'%'};return _0x25f319;})});}_0x5610d2=_['merge']({},_0x5610d2,_0x185e36[_0x94dd('0x41')]);return _0x304759[_0x94dd('0x58')](_0x5610d2);}})[_0x94dd('0x25')](function(_0x1e3531){if(_0x1e3531){_0x43d6df=_0x1e3531[_0x94dd('0x37')];if(!_0x185e36[_0x94dd('0x31')][_0x94dd('0x38')](_0x94dd('0x39'))){_0x5610d2['limit']=qs[_0x94dd('0x1d')](_0x185e36[_0x94dd('0x31')][_0x94dd('0x1d')]);_0x5610d2[_0x94dd('0x1b')]=qs[_0x94dd('0x1b')](_0x185e36[_0x94dd('0x31')]['offset']);}return _0x304759[_0x94dd('0x58')](_0x5610d2);}})[_0x94dd('0x25')](function(_0x469064){if(_0x469064){return _0x469064?{'count':_0x43d6df,'rows':_0x469064}:null;}})['then'](respondWithResult(_0x4edc61,null))[_0x94dd('0x47')](handleError(_0x4edc61,null));};
\ No newline at end of file
+var _0x4c8a=['save','update','then','destroy','get','Companies','UserProfileResource','stack','name','index','CmCompany','describe','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','options','includeAll','include','findAll','rows','catch','intersection','find','create','body','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','findOne','rawAttributes','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject'];(function(_0x52085a,_0x3717ca){var _0x5afc1a=function(_0x2aa175){while(--_0x2aa175){_0x52085a['push'](_0x52085a['shift']());}};_0x5afc1a(++_0x3717ca);}(_0x4c8a,0x130));var _0xa4c8=function(_0x3e7014,_0x55046a){_0x3e7014=_0x3e7014-0x0;var _0x457fb8=_0x4c8a[_0x3e7014];return _0x457fb8;};'use strict';var emlformat=require(_0xa4c8('0x0'));var rimraf=require(_0xa4c8('0x1'));var zipdir=require(_0xa4c8('0x2'));var jsonpatch=require(_0xa4c8('0x3'));var rp=require(_0xa4c8('0x4'));var moment=require(_0xa4c8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa4c8('0x6'));var util=require(_0xa4c8('0x7'));var path=require(_0xa4c8('0x8'));var sox=require(_0xa4c8('0x9'));var csv=require(_0xa4c8('0xa'));var ejs=require(_0xa4c8('0xb'));var fs=require('fs');var fs_extra=require(_0xa4c8('0xc'));var _=require('lodash');var squel=require(_0xa4c8('0xd'));var crypto=require(_0xa4c8('0xe'));var jsforce=require(_0xa4c8('0xf'));var deskjs=require(_0xa4c8('0x10'));var toCsv=require(_0xa4c8('0xa'));var querystring=require(_0xa4c8('0x11'));var Papa=require(_0xa4c8('0x12'));var Redis=require('ioredis');var authService=require(_0xa4c8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa4c8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4c8('0x15'))(_0xa4c8('0x16'));var utils=require(_0xa4c8('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa4c8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52de1f,_0x171d4b){_0x171d4b=_0x171d4b||0xcc;return function(_0x12afaf){if(_0x12afaf){return _0x52de1f[_0xa4c8('0x19')](_0x171d4b);}return _0x52de1f[_0xa4c8('0x1a')](_0x171d4b)[_0xa4c8('0x1b')]();};}function respondWithResult(_0x317607,_0x4928f4){_0x4928f4=_0x4928f4||0xc8;return function(_0x3bcc02){if(_0x3bcc02){return _0x317607[_0xa4c8('0x1a')](_0x4928f4)[_0xa4c8('0x1c')](_0x3bcc02);}};}function respondWithFilteredResult(_0x4a1da9,_0x586d45){return function(_0x2047d8){if(_0x2047d8){var _0xac92c4=typeof _0x586d45['offset']===_0xa4c8('0x1d')&&typeof _0x586d45[_0xa4c8('0x1e')]===_0xa4c8('0x1d');var _0x111b1d=_0x2047d8['count'];var _0x466fbe=_0xac92c4?0x0:_0x586d45[_0xa4c8('0x1f')];var _0x189fff=_0xac92c4?_0x2047d8[_0xa4c8('0x20')]:_0x586d45[_0xa4c8('0x1f')]+_0x586d45[_0xa4c8('0x1e')];var _0x533855;if(_0x189fff>=_0x111b1d){_0x189fff=_0x111b1d;_0x533855=0xc8;}else{_0x533855=0xce;}_0x4a1da9[_0xa4c8('0x1a')](_0x533855);return _0x4a1da9['set'](_0xa4c8('0x21'),_0x466fbe+'-'+_0x189fff+'/'+_0x111b1d)[_0xa4c8('0x1c')](_0x2047d8);}return null;};}function patchUpdates(_0x246c5c){return function(_0x2fac0f){try{jsonpatch[_0xa4c8('0x22')](_0x2fac0f,_0x246c5c,!![]);}catch(_0x5417f7){return BPromise[_0xa4c8('0x23')](_0x5417f7);}return _0x2fac0f[_0xa4c8('0x24')]();};}function saveUpdates(_0x205927,_0x16d3f2){return function(_0x5d7901){if(_0x5d7901){return _0x5d7901[_0xa4c8('0x25')](_0x205927)[_0xa4c8('0x26')](function(_0x4e0a03){return _0x4e0a03;});}return null;};}function removeEntity(_0x165684,_0xba64f7){return function(_0x2ef20e){if(_0x2ef20e){return _0x2ef20e[_0xa4c8('0x27')]()[_0xa4c8('0x26')](function(){var _0x449ab9=_0x2ef20e[_0xa4c8('0x28')]({'plain':!![]});var _0xfa272a=_0xa4c8('0x29');return db[_0xa4c8('0x2a')][_0xa4c8('0x27')]({'where':{'type':_0xfa272a,'resourceId':_0x449ab9['id']}})[_0xa4c8('0x26')](function(){return _0x2ef20e;});})['then'](function(){_0x165684[_0xa4c8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cafe1,_0xcffd34){return function(_0x175115){if(!_0x175115){_0x1cafe1[_0xa4c8('0x19')](0x194);}return _0x175115;};}function handleError(_0x571e9f,_0x46ee4c){_0x46ee4c=_0x46ee4c||0x1f4;return function(_0x4e4df7){logger['error'](_0x4e4df7[_0xa4c8('0x2b')]);if(_0x4e4df7[_0xa4c8('0x2c')]){delete _0x4e4df7[_0xa4c8('0x2c')];}_0x571e9f['status'](_0x46ee4c)['send'](_0x4e4df7);};}exports[_0xa4c8('0x2d')]=function(_0x1eabfb,_0x1cdc46){var _0x4bc591={},_0x415ca3={},_0x1f271d={'count':0x0,'rows':[]};return db[_0xa4c8('0x2e')][_0xa4c8('0x2f')]()[_0xa4c8('0x26')](function(_0x1f3a5e){_0x415ca3['model']=_[_0xa4c8('0x30')](_0x1f3a5e);_0x415ca3[_0xa4c8('0x31')]=_['keys'](_0x1eabfb[_0xa4c8('0x31')]);_0x415ca3[_0xa4c8('0x32')]=_['intersection'](_0x415ca3[_0xa4c8('0x33')],_0x415ca3['query']);_0x4bc591[_0xa4c8('0x34')]=_['intersection'](_0x415ca3['model'],qs[_0xa4c8('0x35')](_0x1eabfb['query']['fields']));_0x4bc591[_0xa4c8('0x34')]=_0x4bc591[_0xa4c8('0x34')][_0xa4c8('0x36')]?_0x4bc591['attributes']:_0x415ca3[_0xa4c8('0x33')];if(!_0x1eabfb[_0xa4c8('0x31')][_0xa4c8('0x37')](_0xa4c8('0x38'))){_0x4bc591[_0xa4c8('0x1e')]=qs[_0xa4c8('0x1e')](_0x1eabfb[_0xa4c8('0x31')][_0xa4c8('0x1e')]);_0x4bc591['offset']=qs[_0xa4c8('0x1f')](_0x1eabfb[_0xa4c8('0x31')]['offset']);}_0x4bc591[_0xa4c8('0x39')]=qs[_0xa4c8('0x3a')](_0x1eabfb[_0xa4c8('0x31')][_0xa4c8('0x3a')]);_0x4bc591[_0xa4c8('0x3b')]=qs[_0xa4c8('0x32')](_[_0xa4c8('0x3c')](_0x1eabfb[_0xa4c8('0x31')],_0x415ca3['filters']),_0x1f3a5e);if(_0x1eabfb[_0xa4c8('0x31')]['filter']){_0x4bc591[_0xa4c8('0x3b')]=_[_0xa4c8('0x3d')](_0x4bc591['where'],{'$or':_[_0xa4c8('0x3e')](_0x4bc591['attributes'],function(_0xff148){var _0x56a7df={};_0x56a7df[_0xff148]={'$like':'%'+_0x1eabfb[_0xa4c8('0x31')]['filter']+'%'};return _0x56a7df;})});}_0x4bc591=_[_0xa4c8('0x3d')]({},_0x4bc591,_0x1eabfb[_0xa4c8('0x3f')]);var _0x435961={'where':_0x4bc591[_0xa4c8('0x3b')]};return db[_0xa4c8('0x2e')][_0xa4c8('0x20')](_0x435961)[_0xa4c8('0x26')](function(_0x22cfc5){_0x1f271d[_0xa4c8('0x20')]=_0x22cfc5;if(_0x1eabfb[_0xa4c8('0x31')][_0xa4c8('0x40')]){_0x4bc591[_0xa4c8('0x41')]=[{'all':!![]}];}return db[_0xa4c8('0x2e')][_0xa4c8('0x42')](_0x4bc591);})[_0xa4c8('0x26')](function(_0x57696b){_0x1f271d[_0xa4c8('0x43')]=_0x57696b;return _0x1f271d;})['then'](respondWithFilteredResult(_0x1cdc46,_0x4bc591))[_0xa4c8('0x44')](handleError(_0x1cdc46,null));})[_0xa4c8('0x44')](handleError(_0x1cdc46,null));};exports['show']=function(_0x3e7a9e,_0x33575e){var _0x518810={'raw':![],'where':{'id':_0x3e7a9e['params']['id']}},_0x3cbb4d={};_0x3cbb4d[_0xa4c8('0x33')]=_[_0xa4c8('0x30')](db['CmCompany']['rawAttributes']);_0x3cbb4d[_0xa4c8('0x31')]=_[_0xa4c8('0x30')](_0x3e7a9e[_0xa4c8('0x31')]);_0x3cbb4d[_0xa4c8('0x32')]=_[_0xa4c8('0x45')](_0x3cbb4d[_0xa4c8('0x33')],_0x3cbb4d[_0xa4c8('0x31')]);_0x518810[_0xa4c8('0x34')]=_['intersection'](_0x3cbb4d[_0xa4c8('0x33')],qs[_0xa4c8('0x35')](_0x3e7a9e[_0xa4c8('0x31')][_0xa4c8('0x35')]));_0x518810[_0xa4c8('0x34')]=_0x518810[_0xa4c8('0x34')][_0xa4c8('0x36')]?_0x518810[_0xa4c8('0x34')]:_0x3cbb4d['model'];if(_0x3e7a9e['query'][_0xa4c8('0x40')]){_0x518810[_0xa4c8('0x41')]=[{'all':!![]}];}_0x518810=_[_0xa4c8('0x3d')]({},_0x518810,_0x3e7a9e[_0xa4c8('0x3f')]);return db[_0xa4c8('0x2e')][_0xa4c8('0x46')](_0x518810)[_0xa4c8('0x26')](handleEntityNotFound(_0x33575e,null))[_0xa4c8('0x26')](respondWithResult(_0x33575e,null))[_0xa4c8('0x44')](handleError(_0x33575e,null));};exports[_0xa4c8('0x47')]=function(_0x40a8ab,_0x5f4223){return db['CmCompany'][_0xa4c8('0x47')](_0x40a8ab[_0xa4c8('0x48')],{})[_0xa4c8('0x26')](function(_0xf003bf){var _0x316074=_0x40a8ab[_0xa4c8('0x49')][_0xa4c8('0x28')]({'plain':!![]});if(!_0x316074)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x316074['role']===_0xa4c8('0x49')){var _0x37adf9=_0xf003bf['get']({'plain':!![]});var _0x3ae80c=_0xa4c8('0x29');return db[_0xa4c8('0x4a')][_0xa4c8('0x46')]({'where':{'name':_0x3ae80c,'userProfileId':_0x316074['userProfileId']},'raw':!![]})[_0xa4c8('0x26')](function(_0x24449a){if(_0x24449a&&_0x24449a[_0xa4c8('0x4b')]===0x0){return db[_0xa4c8('0x2a')][_0xa4c8('0x47')]({'name':_0x37adf9['name'],'resourceId':_0x37adf9['id'],'type':_0x24449a[_0xa4c8('0x2c')],'sectionId':_0x24449a['id']},{})['then'](function(){return _0xf003bf;});}else{return _0xf003bf;}})[_0xa4c8('0x44')](function(_0x3b1533){logger[_0xa4c8('0x4c')](_0xa4c8('0x4d'),_0x3b1533);throw _0x3b1533;});}return _0xf003bf;})[_0xa4c8('0x26')](respondWithResult(_0x5f4223,0xc9))[_0xa4c8('0x44')](handleError(_0x5f4223,null));};exports[_0xa4c8('0x25')]=function(_0x83a3f0,_0x1a6700){if(_0x83a3f0[_0xa4c8('0x48')]['id']){delete _0x83a3f0[_0xa4c8('0x48')]['id'];}return db[_0xa4c8('0x2e')][_0xa4c8('0x46')]({'where':{'id':_0x83a3f0[_0xa4c8('0x4e')]['id']}})[_0xa4c8('0x26')](handleEntityNotFound(_0x1a6700,null))[_0xa4c8('0x26')](saveUpdates(_0x83a3f0[_0xa4c8('0x48')],null))[_0xa4c8('0x26')](respondWithResult(_0x1a6700,null))[_0xa4c8('0x44')](handleError(_0x1a6700,null));};exports[_0xa4c8('0x27')]=function(_0x36a421,_0x4c04c1){return db[_0xa4c8('0x2e')][_0xa4c8('0x46')]({'where':{'id':_0x36a421[_0xa4c8('0x4e')]['id']}})[_0xa4c8('0x26')](handleEntityNotFound(_0x4c04c1,null))['then'](removeEntity(_0x4c04c1,null))[_0xa4c8('0x44')](handleError(_0x4c04c1,null));};exports['describe']=function(_0x470df5,_0x3483ba){return db[_0xa4c8('0x2e')][_0xa4c8('0x2f')]()[_0xa4c8('0x26')](respondWithResult(_0x3483ba,null))[_0xa4c8('0x44')](handleError(_0x3483ba,null));};exports[_0xa4c8('0x4f')]=function(_0x2156a3,_0x57f2b1,_0x232ff6){return db[_0xa4c8('0x50')][_0xa4c8('0x46')]({'where':{'id':_0x2156a3[_0xa4c8('0x4e')]['id']}})[_0xa4c8('0x26')](handleEntityNotFound(_0x57f2b1,null))['then'](function(_0x1705d1){if(_0x1705d1){return _0x1705d1[_0xa4c8('0x4f')](_0x2156a3[_0xa4c8('0x48')]['ids'],_['omit'](_0x2156a3[_0xa4c8('0x48')],[_0xa4c8('0x51'),'id'])||{});}})['then'](respondWithResult(_0x57f2b1,null))[_0xa4c8('0x44')](handleError(_0x57f2b1,null));};exports['getContacts']=function(_0x4417de,_0xab5b70,_0x20e189){var _0x42b731={};var _0x3829f3={};var _0x55f729;var _0x203cb5;return db[_0xa4c8('0x2e')][_0xa4c8('0x52')]({'where':{'id':_0x4417de[_0xa4c8('0x4e')]['id']}})[_0xa4c8('0x26')](handleEntityNotFound(_0xab5b70,null))[_0xa4c8('0x26')](function(_0x93cce4){if(_0x93cce4){_0x55f729=_0x93cce4;_0x3829f3['model']=_['keys'](db[_0xa4c8('0x50')][_0xa4c8('0x53')]);_0x3829f3[_0xa4c8('0x31')]=_[_0xa4c8('0x30')](_0x4417de[_0xa4c8('0x31')]);_0x3829f3[_0xa4c8('0x32')]=_[_0xa4c8('0x45')](_0x3829f3[_0xa4c8('0x33')],_0x3829f3[_0xa4c8('0x31')]);_0x42b731[_0xa4c8('0x34')]=_[_0xa4c8('0x45')](_0x3829f3[_0xa4c8('0x33')],qs[_0xa4c8('0x35')](_0x4417de[_0xa4c8('0x31')][_0xa4c8('0x35')]));_0x42b731[_0xa4c8('0x34')]=_0x42b731['attributes'][_0xa4c8('0x36')]?_0x42b731['attributes']:_0x3829f3[_0xa4c8('0x33')];_0x42b731[_0xa4c8('0x39')]=qs[_0xa4c8('0x3a')](_0x4417de[_0xa4c8('0x31')]['sort']);_0x42b731['where']=qs[_0xa4c8('0x32')](_[_0xa4c8('0x3c')](_0x4417de[_0xa4c8('0x31')],_0x3829f3[_0xa4c8('0x32')]));if(_0x4417de[_0xa4c8('0x31')][_0xa4c8('0x54')]){_0x42b731[_0xa4c8('0x3b')]=_[_0xa4c8('0x3d')](_0x42b731[_0xa4c8('0x3b')],{'$or':_['map'](_0x42b731[_0xa4c8('0x34')],function(_0x819b0b){var _0x39da9e={};_0x39da9e[_0x819b0b]={'$like':'%'+_0x4417de['query'][_0xa4c8('0x54')]+'%'};return _0x39da9e;})});}_0x42b731=_[_0xa4c8('0x3d')]({},_0x42b731,_0x4417de['options']);return _0x55f729['getContacts'](_0x42b731);}})[_0xa4c8('0x26')](function(_0x355b53){if(_0x355b53){_0x203cb5=_0x355b53['length'];if(!_0x4417de[_0xa4c8('0x31')][_0xa4c8('0x37')](_0xa4c8('0x38'))){_0x42b731['limit']=qs[_0xa4c8('0x1e')](_0x4417de[_0xa4c8('0x31')][_0xa4c8('0x1e')]);_0x42b731[_0xa4c8('0x1f')]=qs[_0xa4c8('0x1f')](_0x4417de[_0xa4c8('0x31')][_0xa4c8('0x1f')]);}return _0x55f729['getContacts'](_0x42b731);}})[_0xa4c8('0x26')](function(_0x35436c){if(_0x35436c){return _0x35436c?{'count':_0x203cb5,'rows':_0x35436c}:null;}})[_0xa4c8('0x26')](respondWithResult(_0xab5b70,null))[_0xa4c8('0x44')](handleError(_0xab5b70,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 4572314..bfbebb9 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 _0x0ea2=['cm_companies','lodash','util','moment','bluebird','request-promise','rimraf','./cmCompany.attributes','exports'];(function(_0x3ff3f0,_0x1a866e){var _0x4bcd45=function(_0x133dae){while(--_0x133dae){_0x3ff3f0['push'](_0x3ff3f0['shift']());}};_0x4bcd45(++_0x1a866e);}(_0x0ea2,0x1d5));var _0x20ea=function(_0xbca5f7,_0x7f833a){_0xbca5f7=_0xbca5f7-0x0;var _0x2eb4c0=_0x0ea2[_0xbca5f7];return _0x2eb4c0;};'use strict';var _=require(_0x20ea('0x0'));var util=require(_0x20ea('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x20ea('0x2'));var BPromise=require(_0x20ea('0x3'));var rp=require(_0x20ea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20ea('0x5'));var config=require('../../config/environment');var attributes=require(_0x20ea('0x6'));module[_0x20ea('0x7')]=function(_0x329b4a,_0x3ff6d1){return _0x329b4a['define']('CmCompany',attributes,{'tableName':_0x20ea('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0caa=['request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','moment','bluebird'];(function(_0x32635d,_0x587671){var _0x1d1225=function(_0x281b1b){while(--_0x281b1b){_0x32635d['push'](_0x32635d['shift']());}};_0x1d1225(++_0x587671);}(_0x0caa,0x140));var _0xa0ca=function(_0x4bd0b1,_0x56f9e1){_0x4bd0b1=_0x4bd0b1-0x0;var _0x201417=_0x0caa[_0x4bd0b1];return _0x201417;};'use strict';var _=require(_0xa0ca('0x0'));var util=require(_0xa0ca('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa0ca('0x2'));var BPromise=require(_0xa0ca('0x3'));var rp=require(_0xa0ca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0ca('0x5'));var config=require(_0xa0ca('0x6'));var attributes=require(_0xa0ca('0x7'));module[_0xa0ca('0x8')]=function(_0x23e215,_0x4ab396){return _0x23e215[_0xa0ca('0x9')](_0xa0ca('0xa'),attributes,{'tableName':_0xa0ca('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 800a2d4..f34e005 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 _0xbffe=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4eddca,_0x144171){var _0x161ac0=function(_0x3d0b12){while(--_0x3d0b12){_0x4eddca['push'](_0x4eddca['shift']());}};_0x161ac0(++_0x144171);}(_0xbffe,0x141));var _0xebff=function(_0x4ddc4f,_0x4182b5){_0x4ddc4f=_0x4ddc4f-0x0;var _0x1fb8ba=_0xbffe[_0x4ddc4f];return _0x1fb8ba;};'use strict';var _=require(_0xebff('0x0'));var util=require(_0xebff('0x1'));var moment=require(_0xebff('0x2'));var BPromise=require(_0xebff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebff('0x4'))['db'];var utils=require(_0xebff('0x5'));var logger=require(_0xebff('0x6'))('rpc');var config=require(_0xebff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xebff('0x8')][_0xebff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441055,_0x13848c,_0x504237){return new BPromise(function(_0x55c7e5,_0x4425e3){return client[_0xebff('0xa')](_0x441055,_0x504237)[_0xebff('0xb')](function(_0x19dbdc){logger['info'](_0xebff('0xc'),_0x13848c,_0xebff('0xd'));logger[_0xebff('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x13848c,_0xebff('0xd'),JSON[_0xebff('0xf')](_0x19dbdc));if(_0x19dbdc[_0xebff('0x10')]){if(_0x19dbdc[_0xebff('0x10')]['code']===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x13848c,_0x19dbdc['error'][_0xebff('0x11')]);return _0x4425e3(_0x19dbdc[_0xebff('0x10')][_0xebff('0x11')]);}logger[_0xebff('0x10')](_0xebff('0xc'),_0x13848c,_0x19dbdc[_0xebff('0x10')][_0xebff('0x11')]);return _0x55c7e5(_0x19dbdc[_0xebff('0x10')][_0xebff('0x11')]);}else{logger[_0xebff('0x12')](_0xebff('0xc'),_0x13848c,'request\x20sent');_0x55c7e5(_0x19dbdc[_0xebff('0x13')][_0xebff('0x11')]);}})[_0xebff('0x14')](function(_0x291af5){logger[_0xebff('0x10')]('CmCompany,\x20%s,\x20%s',_0x13848c,_0x291af5);_0x4425e3(_0x291af5);});});}
\ No newline at end of file
+var _0xa198=['message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0xa198,0x1b8));var _0x8a19=function(_0x1db0a,_0x2b3284){_0x1db0a=_0x1db0a-0x0;var _0x18d203=_0xa198[_0x1db0a];return _0x18d203;};'use strict';var _=require(_0x8a19('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8a19('0x1'));var rs=require(_0x8a19('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a19('0x3'))['db'];var utils=require(_0x8a19('0x4'));var logger=require(_0x8a19('0x5'))(_0x8a19('0x6'));var config=require(_0x8a19('0x7'));var jayson=require(_0x8a19('0x8'));var client=jayson[_0x8a19('0x9')][_0x8a19('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x577249,_0x1b6bc6,_0x1ce778){return new BPromise(function(_0xae0a7,_0x58410c){return client[_0x8a19('0xb')](_0x577249,_0x1ce778)[_0x8a19('0xc')](function(_0x3c1636){logger[_0x8a19('0xd')](_0x8a19('0xe'),_0x1b6bc6,'request\x20sent');logger[_0x8a19('0xf')](_0x8a19('0x10'),_0x1b6bc6,_0x8a19('0x11'),JSON[_0x8a19('0x12')](_0x3c1636));if(_0x3c1636[_0x8a19('0x13')]){if(_0x3c1636[_0x8a19('0x13')]['code']===0x1f4){logger[_0x8a19('0x13')](_0x8a19('0xe'),_0x1b6bc6,_0x3c1636[_0x8a19('0x13')][_0x8a19('0x14')]);return _0x58410c(_0x3c1636[_0x8a19('0x13')][_0x8a19('0x14')]);}logger[_0x8a19('0x13')](_0x8a19('0xe'),_0x1b6bc6,_0x3c1636['error']['message']);return _0xae0a7(_0x3c1636[_0x8a19('0x13')][_0x8a19('0x14')]);}else{logger['info'](_0x8a19('0xe'),_0x1b6bc6,'request\x20sent');_0xae0a7(_0x3c1636[_0x8a19('0x15')][_0x8a19('0x14')]);}})[_0x8a19('0x16')](function(_0x3a21b5){logger['error'](_0x8a19('0xe'),_0x1b6bc6,_0x3a21b5);_0x58410c(_0x3a21b5);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 46f77d0..690ceef 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 _0x897e=['show','/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x13187b,_0xdb9234){var _0xc7e2f6=function(_0xe4b1b6){while(--_0xe4b1b6){_0x13187b['push'](_0x13187b['shift']());}};_0xc7e2f6(++_0xdb9234);}(_0x897e,0x1d6));var _0xe897=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x897e[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0xe897('0x0'));var util=require('util');var path=require(_0xe897('0x1'));var timeout=require('connect-timeout');var express=require(_0xe897('0x2'));var router=express[_0xe897('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe897('0x4'));var interaction=require(_0xe897('0x5'));var config=require(_0xe897('0x6'));var controller=require(_0xe897('0x7'));router[_0xe897('0x8')]('/',auth[_0xe897('0x9')](),controller[_0xe897('0xa')]);router[_0xe897('0x8')]('/describe',auth[_0xe897('0x9')](),controller[_0xe897('0xb')]);router[_0xe897('0x8')](_0xe897('0xc'),auth[_0xe897('0x9')](),controller[_0xe897('0xd')]);router[_0xe897('0x8')](_0xe897('0xe'),auth[_0xe897('0x9')](),controller[_0xe897('0xf')]);router[_0xe897('0x10')]('/',auth[_0xe897('0x9')](),controller['create']);router[_0xe897('0x10')](_0xe897('0xe'),auth[_0xe897('0x9')](),controller[_0xe897('0x11')]);router[_0xe897('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xe897('0x13')]);router[_0xe897('0x14')]('/:id',auth[_0xe897('0x9')](),controller[_0xe897('0x15')]);module[_0xe897('0x16')]=router;
\ No newline at end of file
+var _0xea32=['getContacts','post','create','addContacts','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts'];(function(_0x1e7d0b,_0x395352){var _0x261b3d=function(_0x500a1f){while(--_0x500a1f){_0x1e7d0b['push'](_0x1e7d0b['shift']());}};_0x261b3d(++_0x395352);}(_0xea32,0xf8));var _0x2ea3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xea32[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x2ea3('0x0'));var util=require('util');var path=require(_0x2ea3('0x1'));var timeout=require(_0x2ea3('0x2'));var express=require(_0x2ea3('0x3'));var router=express[_0x2ea3('0x4')]();var fs_extra=require(_0x2ea3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2ea3('0x6'));var config=require(_0x2ea3('0x7'));var controller=require(_0x2ea3('0x8'));router[_0x2ea3('0x9')]('/',auth[_0x2ea3('0xa')](),controller['index']);router['get'](_0x2ea3('0xb'),auth['isAuthenticated'](),controller[_0x2ea3('0xc')]);router['get'](_0x2ea3('0xd'),auth[_0x2ea3('0xa')](),controller[_0x2ea3('0xe')]);router[_0x2ea3('0x9')](_0x2ea3('0xf'),auth[_0x2ea3('0xa')](),controller[_0x2ea3('0x10')]);router[_0x2ea3('0x11')]('/',auth['isAuthenticated'](),controller[_0x2ea3('0x12')]);router['post'](_0x2ea3('0xf'),auth[_0x2ea3('0xa')](),controller[_0x2ea3('0x13')]);router['put'](_0x2ea3('0xd'),auth[_0x2ea3('0xa')](),controller[_0x2ea3('0x14')]);router[_0x2ea3('0x15')](_0x2ea3('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 6847d54..456f636 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 _0x10ef=['DATE','lodash','sequelize','exports','STRING','INTEGER','UNSIGNED'];(function(_0x3767f1,_0x2ca0fa){var _0x183d7e=function(_0x443363){while(--_0x443363){_0x3767f1['push'](_0x3767f1['shift']());}};_0x183d7e(++_0x2ca0fa);}(_0x10ef,0x1c1));var _0xf10e=function(_0xbbdf14,_0x1c0bca){_0xbbdf14=_0xbbdf14-0x0;var _0x1545a3=_0x10ef[_0xbbdf14];return _0x1545a3;};'use strict';var _=require(_0xf10e('0x0'));var Sequelize=require(_0xf10e('0x1'));module[_0xf10e('0x2')]={'firstName':{'type':Sequelize[_0xf10e('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf10e('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xf10e('0x3')]},'city':{'type':Sequelize[_0xf10e('0x3')]},'country':{'type':Sequelize[_0xf10e('0x3')]},'dateOfBirth':{'type':Sequelize[_0xf10e('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xf10e('0x3')]},'mobile':{'type':Sequelize[_0xf10e('0x3')]},'fax':{'type':Sequelize[_0xf10e('0x3')]},'email':{'type':Sequelize[_0xf10e('0x3')]},'url':{'type':Sequelize[_0xf10e('0x3')]},'facebook':{'type':Sequelize[_0xf10e('0x3')]},'fb_data':{'type':Sequelize[_0xf10e('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xf10e('0x3')]},'viber':{'type':Sequelize[_0xf10e('0x3')]},'line':{'type':Sequelize[_0xf10e('0x3')]},'wechat':{'type':Sequelize[_0xf10e('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xf10e('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xf10e('0x3')]},'priority':{'type':Sequelize[_0xf10e('0x4')](0x2)[_0xf10e('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf10e('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xf10e('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xab68=['TEXT','INTEGER','UNSIGNED','NOW','sequelize','exports','STRING'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xab68,0x123));var _0x8ab6=function(_0x3d7c5f,_0x2fc46c){_0x3d7c5f=_0x3d7c5f-0x0;var _0x4a74ad=_0xab68[_0x3d7c5f];return _0x4a74ad;};'use strict';var _=require('lodash');var Sequelize=require(_0x8ab6('0x0'));module[_0x8ab6('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x8ab6('0x2')]},'street':{'type':Sequelize[_0x8ab6('0x2')]},'postalCode':{'type':Sequelize[_0x8ab6('0x2')]},'city':{'type':Sequelize[_0x8ab6('0x2')]},'country':{'type':Sequelize[_0x8ab6('0x2')]},'dateOfBirth':{'type':Sequelize[_0x8ab6('0x2')]},'description':{'type':Sequelize[_0x8ab6('0x3')]},'phone':{'type':Sequelize[_0x8ab6('0x2')]},'mobile':{'type':Sequelize[_0x8ab6('0x2')]},'fax':{'type':Sequelize[_0x8ab6('0x2')]},'email':{'type':Sequelize[_0x8ab6('0x2')]},'url':{'type':Sequelize[_0x8ab6('0x2')]},'facebook':{'type':Sequelize[_0x8ab6('0x2')]},'fb_data':{'type':Sequelize[_0x8ab6('0x2')]},'twitter':{'type':Sequelize[_0x8ab6('0x2')]},'skype':{'type':Sequelize[_0x8ab6('0x2')]},'teams':{'type':Sequelize[_0x8ab6('0x2')]},'viber':{'type':Sequelize[_0x8ab6('0x2')]},'line':{'type':Sequelize[_0x8ab6('0x2')]},'wechat':{'type':Sequelize[_0x8ab6('0x2')]},'telegram':{'type':Sequelize[_0x8ab6('0x2')]},'UserId':{'type':Sequelize[_0x8ab6('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x8ab6('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8ab6('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8ab6('0x6')]},'dialTimezone':{'type':Sequelize[_0x8ab6('0x2')]},'utcOffset':{'type':Sequelize[_0x8ab6('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 00ab739..247de2c 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(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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
','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','base64','path','util','node-tnef'];(function(_0x3d34da,_0x3abcc1){var _0xcf6af8=function(_0x300a53){while(--_0x300a53){_0x3d34da['push'](_0x3d34da['shift']());}};_0xcf6af8(++_0x3abcc1);}(_0x962e,0x1ee));var _0xe962=function(_0x1f058b,_0x4a47cf){_0x1f058b=_0x1f058b-0x0;var _0x5c5232=_0x962e[_0x1f058b];return _0x5c5232;};'use strict';var _=require('lodash');var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xe962('0x0'));var util=require(_0xe962('0x1'));var tnef=require(_0xe962('0x2'));var logger=require(_0xe962('0x3'))(_0xe962('0x4'));var config=require('../../../config/environment');function getAddress(_0x535a12){var _0x1aaf25=_[_0xe962('0x5')](_0x535a12[_0xe962('0x6')]);return _0x1aaf25&&_0x1aaf25[_0xe962('0x7')]?_0x1aaf25['address']:'anonymous'+random[_0xe962('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x253c3b){var _0x56b2f7=_[_0xe962('0x5')](_0x253c3b[_0xe962('0x6')]);if(_0x56b2f7&&_0x56b2f7[_0xe962('0x9')]){if(_0x56b2f7[_0xe962('0x9')]==_0x56b2f7[_0xe962('0x7')]){return _0x56b2f7[_0xe962('0x9')][_0xe962('0xa')](0x0,_0x56b2f7[_0xe962('0x9')][_0xe962('0xb')]('@'));}var _0x27682d=_0x56b2f7[_0xe962('0x9')][_0xe962('0xc')](/\s+/);return _0x27682d[_0xe962('0xd')]>0x1?_0x27682d[_0xe962('0xe')](0x0,-0x1)[_0xe962('0xf')]('\x20'):_0x56b2f7[_0xe962('0x9')];}return _0xe962('0x10');}function getLastName(_0x5c3de8){var _0x14cb0b=_[_0xe962('0x5')](_0x5c3de8[_0xe962('0x6')]);if(_0x14cb0b&&_0x14cb0b[_0xe962('0x9')]){var _0x2f901d=_0x14cb0b[_0xe962('0x9')][_0xe962('0xc')](/\s+/);return _0x2f901d[_0xe962('0xd')]>0x1?_0x2f901d[_0xe962('0x11')]():'';}return'';}function getMails(_0x294779,_0xf2cdae){var _0x25451d='';for(var _0x44390f=0x0;_0x44390f<_0xf2cdae[_0xe962('0x6')]['length'];_0x44390f+=0x1){if(_0xf2cdae['value'][_0x44390f][_0xe962('0x7')]!==_0x294779){if(!_[_0xe962('0x12')](_0x25451d)){_0x25451d+=',';}_0x25451d+=_0xf2cdae['value'][_0x44390f][_0xe962('0x9')]||_0xf2cdae[_0xe962('0x6')][_0x44390f][_0xe962('0x7')]||'';_0x25451d+='\x20<';_0x25451d+=_0xf2cdae[_0xe962('0x6')][_0x44390f][_0xe962('0x7')]?_0xf2cdae[_0xe962('0x6')][_0x44390f][_0xe962('0x7')]:_0xe962('0x13')+random[_0xe962('0x8')](0x6)+_0xe962('0x14');_0x25451d+='>';}}return _0x25451d;}function parseEmail(_0x236c30,_0xcc97d9,_0x3e26b0){if(_0xcc97d9[_0xe962('0x15')]){var _0x5d193a=/