From: support
Date: Thu, 30 Jun 2022 17:06:23 +0000 (+0000)
Subject: Built motion from commit 1330cc62.|2.6.11
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22https:/fonts.googleapis.com/icon?a=commitdiff_plain;h=cb3a3cae0a6b0bc8443f643a1c1f8c98b075416a;p=motion2.git
Built motion from commit 1330cc62.|2.6.11
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index e0810d4..bee3919 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-06-29T15:17:52.204Z",
+ "time": "2022-06-30T16:58:01.439Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 6a4fc39..2734535 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-06-29T15:17:52.204Z",
+ "time": "2022-06-30T16:58:01.439Z",
"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 e770602..beb0e1a 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 _0x886e=['urlForward[body]','sequelize','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0xc74312,_0x3d8ef0){var _0x3a9838=function(_0x49cfac){while(--_0x49cfac){_0xc74312['push'](_0xc74312['shift']());}};_0x3a9838(++_0x3d8ef0);}(_0x886e,0x157));var _0xe886=function(_0xdb7f25,_0x170636){_0xdb7f25=_0xdb7f25-0x0;var _0xce7457=_0x886e[_0xdb7f25];return _0xce7457;};'use strict';var Sequelize=require(_0xe886('0x0'));module['exports']={'name':{'type':Sequelize[_0xe886('0x1')],'get':function(_0x55e572){return this[_0xe886('0x2')](_0xe886('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xe886('0x4'),_0xe886('0x5'),_0xe886('0x6'),_0xe886('0x7'),_0xe886('0x8'),_0xe886('0x9'),_0xe886('0xa'),_0xe886('0xb')]],'msg':_0xe886('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xe886('0xd')](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['STRING'](0x1000),'comment':_0xe886('0xe')},'data3':{'type':Sequelize[_0xe886('0xd')](0x1000),'comment':_0xe886('0xf')},'data4':{'type':Sequelize[_0xe886('0xd')](0x1000),'comments':_0xe886('0x10')},'data5':{'type':Sequelize[_0xe886('0xd')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xe886('0xd')],'comments':_0xe886('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0xe886('0x12')}};
\ No newline at end of file
+var _0x04b7=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','TEXT','urlForward[body]','getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x04b7,0x105));var _0x704b=function(_0x76a7ae,_0x490d47){_0x76a7ae=_0x76a7ae-0x0;var _0x12eeb4=_0x04b7[_0x76a7ae];return _0x12eeb4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4814e0){return this[_0x704b('0x0')](_0x704b('0x1'));}},'action':{'type':Sequelize[_0x704b('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x704b('0x3'),_0x704b('0x4'),_0x704b('0x5'),'jscripty',_0x704b('0x6'),'browser',_0x704b('0x7'),_0x704b('0x8')]],'msg':_0x704b('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x704b('0x2')](0x1000),'comment':_0x704b('0xa')},'data2':{'type':Sequelize[_0x704b('0x2')](0x1000),'comment':_0x704b('0xb')},'data3':{'type':Sequelize[_0x704b('0x2')](0x1000),'comment':_0x704b('0xc')},'data4':{'type':Sequelize[_0x704b('0x2')](0x1000),'comments':_0x704b('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x704b('0x2')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x704b('0xe')],'comments':_0x704b('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index eee7359..7539178 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 _0x9d0e=['fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','error','stack','name','body','find','params','catch','zip-dir'];(function(_0x53d4dd,_0xabedc2){var _0x5d4700=function(_0x11e98c){while(--_0x11e98c){_0x53d4dd['push'](_0x53d4dd['shift']());}};_0x5d4700(++_0xabedc2);}(_0x9d0e,0x1cd));var _0xe9d0=function(_0x512bfc,_0x26f639){_0x512bfc=_0x512bfc-0x0;var _0x386bcc=_0x9d0e[_0x512bfc];return _0x386bcc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe9d0('0x0'));var jsonpatch=require(_0xe9d0('0x1'));var rp=require(_0xe9d0('0x2'));var moment=require('moment');var BPromise=require(_0xe9d0('0x3'));var Mustache=require(_0xe9d0('0x4'));var util=require('util');var path=require(_0xe9d0('0x5'));var sox=require(_0xe9d0('0x6'));var csv=require(_0xe9d0('0x7'));var ejs=require(_0xe9d0('0x8'));var fs=require('fs');var fs_extra=require(_0xe9d0('0x9'));var _=require(_0xe9d0('0xa'));var squel=require(_0xe9d0('0xb'));var crypto=require(_0xe9d0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9d0('0xd'));var toCsv=require(_0xe9d0('0x7'));var querystring=require(_0xe9d0('0xe'));var Papa=require(_0xe9d0('0xf'));var Redis=require(_0xe9d0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe9d0('0x11'));var as=require(_0xe9d0('0x12'));var hardwareService=require(_0xe9d0('0x13'));var logger=require('../../config/logger')(_0xe9d0('0x14'));var utils=require(_0xe9d0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe9d0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28de9e,_0xcb1d63){_0xcb1d63=_0xcb1d63||0xcc;return function(_0x45071b){if(_0x45071b){return _0x28de9e['sendStatus'](_0xcb1d63);}return _0x28de9e[_0xe9d0('0x17')](_0xcb1d63)[_0xe9d0('0x18')]();};}function respondWithResult(_0x10b9bd,_0x3266ab){_0x3266ab=_0x3266ab||0xc8;return function(_0x58f81b){if(_0x58f81b){return _0x10b9bd[_0xe9d0('0x17')](_0x3266ab)['json'](_0x58f81b);}};}function respondWithFilteredResult(_0x6d64f,_0x12f3c7){return function(_0x5bd829){if(_0x5bd829){var _0x584508=typeof _0x12f3c7[_0xe9d0('0x19')]===_0xe9d0('0x1a')&&typeof _0x12f3c7[_0xe9d0('0x1b')]===_0xe9d0('0x1a');var _0x2de380=_0x5bd829[_0xe9d0('0x1c')];var _0x25e433=_0x584508?0x0:_0x12f3c7[_0xe9d0('0x19')];var _0x5c6b65=_0x584508?_0x5bd829[_0xe9d0('0x1c')]:_0x12f3c7[_0xe9d0('0x19')]+_0x12f3c7[_0xe9d0('0x1b')];var _0x4ae0bd;if(_0x5c6b65>=_0x2de380){_0x5c6b65=_0x2de380;_0x4ae0bd=0xc8;}else{_0x4ae0bd=0xce;}_0x6d64f[_0xe9d0('0x17')](_0x4ae0bd);return _0x6d64f[_0xe9d0('0x1d')](_0xe9d0('0x1e'),_0x25e433+'-'+_0x5c6b65+'/'+_0x2de380)[_0xe9d0('0x1f')](_0x5bd829);}return null;};}function patchUpdates(_0x288b21){return function(_0x58bb1f){try{jsonpatch[_0xe9d0('0x20')](_0x58bb1f,_0x288b21,!![]);}catch(_0x4da68c){return BPromise['reject'](_0x4da68c);}return _0x58bb1f['save']();};}function saveUpdates(_0xcedbb7,_0x2d04fc){return function(_0x407e72){if(_0x407e72){return _0x407e72['update'](_0xcedbb7)[_0xe9d0('0x21')](function(_0x18c004){return _0x18c004;});}return null;};}function removeEntity(_0x1d8577,_0x547cc7){return function(_0x8f25c8){if(_0x8f25c8){return _0x8f25c8[_0xe9d0('0x22')]()[_0xe9d0('0x21')](function(){_0x1d8577[_0xe9d0('0x17')](0xcc)[_0xe9d0('0x18')]();});}};}function handleEntityNotFound(_0x24dc4e,_0x22cc74){return function(_0x57d855){if(!_0x57d855){_0x24dc4e['sendStatus'](0x194);}return _0x57d855;};}function handleError(_0x5681c8,_0x50e883){_0x50e883=_0x50e883||0x1f4;return function(_0x3ebf8f){logger[_0xe9d0('0x23')](_0x3ebf8f[_0xe9d0('0x24')]);if(_0x3ebf8f[_0xe9d0('0x25')]){delete _0x3ebf8f[_0xe9d0('0x25')];}_0x5681c8[_0xe9d0('0x17')](_0x50e883)['send'](_0x3ebf8f);};}exports['update']=function(_0x32c41c,_0xe07350){if(_0x32c41c[_0xe9d0('0x26')]['id']){delete _0x32c41c['body']['id'];}return db['Action'][_0xe9d0('0x27')]({'where':{'id':_0x32c41c[_0xe9d0('0x28')]['id']}})[_0xe9d0('0x21')](handleEntityNotFound(_0xe07350,null))[_0xe9d0('0x21')](saveUpdates(_0x32c41c[_0xe9d0('0x26')],null))[_0xe9d0('0x21')](respondWithResult(_0xe07350,null))[_0xe9d0('0x29')](handleError(_0xe07350,null));};exports['destroy']=function(_0x33353a,_0x293b20){return db['Action'][_0xe9d0('0x27')]({'where':{'id':_0x33353a[_0xe9d0('0x28')]['id']}})[_0xe9d0('0x21')](handleEntityNotFound(_0x293b20,null))[_0xe9d0('0x21')](removeEntity(_0x293b20,null))['catch'](handleError(_0x293b20,null));};
\ No newline at end of file
+var _0xa35e=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','body','Action','params','catch','destroy','find'];(function(_0x517456,_0x18c8d2){var _0x239445=function(_0x1f8d73){while(--_0x1f8d73){_0x517456['push'](_0x517456['shift']());}};_0x239445(++_0x18c8d2);}(_0xa35e,0xdc));var _0xea35=function(_0x4ba3c4,_0x24842d){_0x4ba3c4=_0x4ba3c4-0x0;var _0x2b6605=_0xa35e[_0x4ba3c4];return _0x2b6605;};'use strict';var emlformat=require(_0xea35('0x0'));var rimraf=require(_0xea35('0x1'));var zipdir=require(_0xea35('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea35('0x3'));var moment=require(_0xea35('0x4'));var BPromise=require(_0xea35('0x5'));var Mustache=require('mustache');var util=require(_0xea35('0x6'));var path=require(_0xea35('0x7'));var sox=require(_0xea35('0x8'));var csv=require('to-csv');var ejs=require(_0xea35('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea35('0xa'));var squel=require(_0xea35('0xb'));var crypto=require(_0xea35('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xea35('0xd'));var toCsv=require(_0xea35('0xe'));var querystring=require('querystring');var Papa=require(_0xea35('0xf'));var Redis=require(_0xea35('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xea35('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea35('0x12'));var logger=require(_0xea35('0x13'))('api');var utils=require(_0xea35('0x14'));var config=require(_0xea35('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3be1a7,_0x559c04){_0x559c04=_0x559c04||0xcc;return function(_0x2276d1){if(_0x2276d1){return _0x3be1a7['sendStatus'](_0x559c04);}return _0x3be1a7[_0xea35('0x16')](_0x559c04)['end']();};}function respondWithResult(_0x30db14,_0x58fd48){_0x58fd48=_0x58fd48||0xc8;return function(_0x256d1d){if(_0x256d1d){return _0x30db14['status'](_0x58fd48)[_0xea35('0x17')](_0x256d1d);}};}function respondWithFilteredResult(_0x4d210e,_0x18972e){return function(_0x4fc442){if(_0x4fc442){var _0x23a2b5=typeof _0x18972e['offset']===_0xea35('0x18')&&typeof _0x18972e[_0xea35('0x19')]===_0xea35('0x18');var _0x5d1800=_0x4fc442['count'];var _0x50b25b=_0x23a2b5?0x0:_0x18972e[_0xea35('0x1a')];var _0x48cc66=_0x23a2b5?_0x4fc442[_0xea35('0x1b')]:_0x18972e[_0xea35('0x1a')]+_0x18972e[_0xea35('0x19')];var _0x45b6f4;if(_0x48cc66>=_0x5d1800){_0x48cc66=_0x5d1800;_0x45b6f4=0xc8;}else{_0x45b6f4=0xce;}_0x4d210e[_0xea35('0x16')](_0x45b6f4);return _0x4d210e['set'](_0xea35('0x1c'),_0x50b25b+'-'+_0x48cc66+'/'+_0x5d1800)['json'](_0x4fc442);}return null;};}function patchUpdates(_0x449974){return function(_0x58c96b){try{jsonpatch[_0xea35('0x1d')](_0x58c96b,_0x449974,!![]);}catch(_0x1d5c9f){return BPromise['reject'](_0x1d5c9f);}return _0x58c96b[_0xea35('0x1e')]();};}function saveUpdates(_0x29b2ec,_0x1eba7b){return function(_0x2d0942){if(_0x2d0942){return _0x2d0942[_0xea35('0x1f')](_0x29b2ec)[_0xea35('0x20')](function(_0xeec05d){return _0xeec05d;});}return null;};}function removeEntity(_0x5c804f,_0x5ccb22){return function(_0x50b637){if(_0x50b637){return _0x50b637['destroy']()[_0xea35('0x20')](function(){_0x5c804f[_0xea35('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xef1cb8,_0x45cc7e){return function(_0x4f632d){if(!_0x4f632d){_0xef1cb8[_0xea35('0x21')](0x194);}return _0x4f632d;};}function handleError(_0x62ed25,_0x50bb77){_0x50bb77=_0x50bb77||0x1f4;return function(_0x1a5b04){logger[_0xea35('0x22')](_0x1a5b04[_0xea35('0x23')]);if(_0x1a5b04[_0xea35('0x24')]){delete _0x1a5b04[_0xea35('0x24')];}_0x62ed25['status'](_0x50bb77)[_0xea35('0x25')](_0x1a5b04);};}exports[_0xea35('0x1f')]=function(_0x4016a3,_0x29afd4){if(_0x4016a3[_0xea35('0x26')]['id']){delete _0x4016a3[_0xea35('0x26')]['id'];}return db[_0xea35('0x27')]['find']({'where':{'id':_0x4016a3[_0xea35('0x28')]['id']}})[_0xea35('0x20')](handleEntityNotFound(_0x29afd4,null))[_0xea35('0x20')](saveUpdates(_0x4016a3[_0xea35('0x26')],null))['then'](respondWithResult(_0x29afd4,null))[_0xea35('0x29')](handleError(_0x29afd4,null));};exports[_0xea35('0x2a')]=function(_0x26d8b2,_0x481199){return db[_0xea35('0x27')][_0xea35('0x2b')]({'where':{'id':_0x26d8b2[_0xea35('0x28')]['id']}})[_0xea35('0x20')](handleEntityNotFound(_0x481199,null))['then'](removeEntity(_0x481199,null))['catch'](handleError(_0x481199,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 1d242a4..b3b32ba 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 _0x2be2=['bluebird','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','api'];(function(_0x3219f9,_0x31182b){var _0x194d4c=function(_0x27ca41){while(--_0x27ca41){_0x3219f9['push'](_0x3219f9['shift']());}};_0x194d4c(++_0x31182b);}(_0x2be2,0x129));var _0x22be=function(_0xde4150,_0x5ca59d){_0xde4150=_0xde4150-0x0;var _0x31f571=_0x2be2[_0xde4150];return _0x31f571;};'use strict';var _=require(_0x22be('0x0'));var util=require(_0x22be('0x1'));var logger=require('../../config/logger')(_0x22be('0x2'));var moment=require('moment');var BPromise=require(_0x22be('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22be('0x4'));var rimraf=require(_0x22be('0x5'));var config=require(_0x22be('0x6'));var attributes=require(_0x22be('0x7'));module[_0x22be('0x8')]=function(_0x4fb41e,_0x19ea2f){return _0x4fb41e[_0x22be('0x9')](_0x22be('0xa'),attributes,{'tableName':_0x22be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc901=['Action','tools_actions','lodash','bluebird','request-promise','rimraf','../../config/environment','./action.attributes','exports','define'];(function(_0x5625e4,_0x211bb2){var _0x16b519=function(_0x5dcf93){while(--_0x5dcf93){_0x5625e4['push'](_0x5625e4['shift']());}};_0x16b519(++_0x211bb2);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1c90('0x1'));var rp=require(_0x1c90('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c90('0x3'));var config=require(_0x1c90('0x4'));var attributes=require(_0x1c90('0x5'));module[_0x1c90('0x6')]=function(_0x1c9021,_0x14eb4f){return _0x1c9021[_0x1c90('0x7')](_0x1c90('0x8'),attributes,{'tableName':_0x1c90('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 0fb427f..8a7d45b 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x51c726,_0x332b95){var _0x23fe86=function(_0x3145c8){while(--_0x3145c8){_0x51c726['push'](_0x51c726['shift']());}};_0x23fe86(++_0x332b95);}(_0x5fab,0x177));var _0xb5fa=function(_0x192cbe,_0x3b4b43){_0x192cbe=_0x192cbe-0x0;var _0x4ce395=_0x5fab[_0x192cbe];return _0x4ce395;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ 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(_0x288e27,_0x5c4b2a){var _0x2aec5b=function(_0x564edf){while(--_0x564edf){_0x288e27['push'](_0x288e27['shift']());}};_0x2aec5b(++_0x5c4b2a);}(_0xabce,0x103));var _0xeabc=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xabce[_0x1facfa];return _0x9ec701;};'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 78405b9..1268b12 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 _0x0a7e=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x4303e1,_0x492c81){var _0x548ec9=function(_0x26e6c3){while(--_0x26e6c3){_0x4303e1['push'](_0x4303e1['shift']());}};_0x548ec9(++_0x492c81);}(_0x0a7e,0x1f0));var _0xe0a7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0a7e[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xe0a7('0x0'));var util=require(_0xe0a7('0x1'));var path=require(_0xe0a7('0x2'));var timeout=require('connect-timeout');var express=require(_0xe0a7('0x3'));var router=express['Router']();var fs_extra=require(_0xe0a7('0x4'));var auth=require(_0xe0a7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0a7('0x6'));var controller=require(_0xe0a7('0x7'));router[_0xe0a7('0x8')](_0xe0a7('0x9'),auth[_0xe0a7('0xa')](),controller[_0xe0a7('0xb')]);router[_0xe0a7('0xc')](_0xe0a7('0x9'),auth[_0xe0a7('0xa')](),controller[_0xe0a7('0xd')]);module[_0xe0a7('0xe')]=router;
\ No newline at end of file
+var _0x80f8=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','update'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x80f8,0x133));var _0x880f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x80f8[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x880f('0x0'));var util=require(_0x880f('0x1'));var path=require(_0x880f('0x2'));var timeout=require(_0x880f('0x3'));var express=require('express');var router=express[_0x880f('0x4')]();var fs_extra=require(_0x880f('0x5'));var auth=require(_0x880f('0x6'));var interaction=require(_0x880f('0x7'));var config=require('../../config/environment');var controller=require(_0x880f('0x8'));router[_0x880f('0x9')](_0x880f('0xa'),auth[_0x880f('0xb')](),controller[_0x880f('0xc')]);router[_0x880f('0xd')](_0x880f('0xa'),auth[_0x880f('0xb')](),controller[_0x880f('0xe')]);module[_0x880f('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 00f9e59..0d7dc4b 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x315b20,_0x38ff12){var _0x3503c8=function(_0x3e9f9c){while(--_0x3e9f9c){_0x315b20['push'](_0x315b20['shift']());}};_0x3503c8(++_0x38ff12);}(_0x7217,0x19e));var _0x7721=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x7217[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x3ccb44,_0x49574f){var _0x35e22f=function(_0xa27a0e){while(--_0xa27a0e){_0x3ccb44['push'](_0x3ccb44['shift']());}};_0x35e22f(++_0x49574f);}(_0xac9d,0x14d));var _0xdac9=function(_0x8962d6,_0x503ed6){_0x8962d6=_0x8962d6-0x0;var _0x566f25=_0xac9d[_0x8962d6];return _0x566f25;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index f4313af..e25287e 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 _0xb477=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','set','json','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','offset','order','sort','filter','merge','where','AnalyticCustomReport','count','includeAll','include','findAll','rows','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','MAX(%s)','AVG(%s)','keyBy','metric','clone','web','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20NULL','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3ed01b,_0x388890){var _0x59170b=function(_0x278185){while(--_0x278185){_0x3ed01b['push'](_0x3ed01b['shift']());}};_0x59170b(++_0x388890);}(_0xb477,0x8f));var _0x7b47=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xb477[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b47('0x0'));var zipdir=require(_0x7b47('0x1'));var jsonpatch=require(_0x7b47('0x2'));var rp=require('request-promise');var moment=require(_0x7b47('0x3'));var BPromise=require(_0x7b47('0x4'));var Mustache=require(_0x7b47('0x5'));var util=require('util');var path=require(_0x7b47('0x6'));var sox=require(_0x7b47('0x7'));var csv=require(_0x7b47('0x8'));var ejs=require(_0x7b47('0x9'));var fs=require('fs');var fs_extra=require(_0x7b47('0xa'));var _=require('lodash');var squel=require(_0x7b47('0xb'));var crypto=require(_0x7b47('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7b47('0xd'));var toCsv=require(_0x7b47('0x8'));var querystring=require(_0x7b47('0xe'));var Papa=require(_0x7b47('0xf'));var Redis=require(_0x7b47('0x10'));var authService=require(_0x7b47('0x11'));var qs=require(_0x7b47('0x12'));var as=require(_0x7b47('0x13'));var hardwareService=require(_0x7b47('0x14'));var logger=require(_0x7b47('0x15'))(_0x7b47('0x16'));var utils=require(_0x7b47('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7b47('0x18'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x1e4e3d,_0x201a9e){_0x201a9e=_0x201a9e||0xcc;return function(_0x55f8e0){if(_0x55f8e0){return _0x1e4e3d[_0x7b47('0x19')](_0x201a9e);}return _0x1e4e3d[_0x7b47('0x1a')](_0x201a9e)[_0x7b47('0x1b')]();};}function respondWithResult(_0x5923fd,_0x3e3ef3){_0x3e3ef3=_0x3e3ef3||0xc8;return function(_0x227cca){if(_0x227cca){return _0x5923fd[_0x7b47('0x1a')](_0x3e3ef3)['json'](_0x227cca);}};}function respondWithFilteredResult(_0x11be4f,_0x124db3){return function(_0x379182){if(_0x379182){var _0x283cd2=typeof _0x124db3['offset']===_0x7b47('0x1c')&&typeof _0x124db3[_0x7b47('0x1d')]===_0x7b47('0x1c');var _0x1f5972=_0x379182['count'];var _0x2ba858=_0x283cd2?0x0:_0x124db3['offset'];var _0x13e959=_0x283cd2?_0x379182['count']:_0x124db3['offset']+_0x124db3['limit'];var _0x13c673;if(_0x13e959>=_0x1f5972){_0x13e959=_0x1f5972;_0x13c673=0xc8;}else{_0x13c673=0xce;}_0x11be4f['status'](_0x13c673);return _0x11be4f[_0x7b47('0x1e')]('Content-Range',_0x2ba858+'-'+_0x13e959+'/'+_0x1f5972)[_0x7b47('0x1f')](_0x379182);}return null;};}function patchUpdates(_0x443333){return function(_0x57a2a2){try{jsonpatch[_0x7b47('0x20')](_0x57a2a2,_0x443333,!![]);}catch(_0x13f121){return BPromise[_0x7b47('0x21')](_0x13f121);}return _0x57a2a2[_0x7b47('0x22')]();};}function saveUpdates(_0x2e6a15,_0x4555d0){return function(_0x2176b0){if(_0x2176b0){return _0x2176b0[_0x7b47('0x23')](_0x2e6a15)[_0x7b47('0x24')](function(_0x56886b){return _0x56886b;});}return null;};}function removeEntity(_0x9aedc8,_0x13b56f){return function(_0xcfc6c8){if(_0xcfc6c8){return _0xcfc6c8[_0x7b47('0x25')]()[_0x7b47('0x24')](function(){var _0x2f960d=_0xcfc6c8[_0x7b47('0x26')]({'plain':!![]});var _0x9db41f=_0x7b47('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x9db41f,'resourceId':_0x2f960d['id']}})['then'](function(){return _0xcfc6c8;});})['then'](function(){_0x9aedc8[_0x7b47('0x1a')](0xcc)[_0x7b47('0x1b')]();});}};}function handleEntityNotFound(_0x1ea575,_0x331229){return function(_0x5705e2){if(!_0x5705e2){_0x1ea575[_0x7b47('0x19')](0x194);}return _0x5705e2;};}function handleError(_0x285e12,_0x107953){_0x107953=_0x107953||0x1f4;return function(_0xc291c1){logger[_0x7b47('0x28')](_0xc291c1[_0x7b47('0x29')]);if(_0xc291c1[_0x7b47('0x2a')]){delete _0xc291c1[_0x7b47('0x2a')];}_0x285e12[_0x7b47('0x1a')](_0x107953)['send'](_0xc291c1);};}exports['index']=function(_0x592b98,_0x345016){var _0xd56a68={},_0x469970={},_0x102d32={'count':0x0,'rows':[]};var _0x3ceafc=_[_0x7b47('0x2b')](db['AnalyticCustomReport'][_0x7b47('0x2c')],function(_0x136811){return{'name':_0x136811[_0x7b47('0x2d')],'type':_0x136811[_0x7b47('0x2e')]['key']};});_0x469970[_0x7b47('0x2f')]=_[_0x7b47('0x2b')](_0x3ceafc,'name');_0x469970[_0x7b47('0x30')]=_[_0x7b47('0x31')](_0x592b98[_0x7b47('0x30')]);_0x469970[_0x7b47('0x32')]=_[_0x7b47('0x33')](_0x469970[_0x7b47('0x2f')],_0x469970[_0x7b47('0x30')]);_0xd56a68['attributes']=_['intersection'](_0x469970[_0x7b47('0x2f')],qs['fields'](_0x592b98[_0x7b47('0x30')][_0x7b47('0x34')]));_0xd56a68[_0x7b47('0x35')]=_0xd56a68[_0x7b47('0x35')][_0x7b47('0x36')]?_0xd56a68[_0x7b47('0x35')]:_0x469970[_0x7b47('0x2f')];if(!_0x592b98['query'][_0x7b47('0x37')]('nolimit')){_0xd56a68['limit']=qs[_0x7b47('0x1d')](_0x592b98[_0x7b47('0x30')]['limit']);_0xd56a68[_0x7b47('0x38')]=qs[_0x7b47('0x38')](_0x592b98[_0x7b47('0x30')][_0x7b47('0x38')]);}_0xd56a68[_0x7b47('0x39')]=qs[_0x7b47('0x3a')](_0x592b98[_0x7b47('0x30')][_0x7b47('0x3a')]);_0xd56a68['where']=qs[_0x7b47('0x32')](_['pick'](_0x592b98[_0x7b47('0x30')],_0x469970[_0x7b47('0x32')]),_0x3ceafc);if(_0x592b98[_0x7b47('0x30')][_0x7b47('0x3b')]){_0xd56a68['where']=_[_0x7b47('0x3c')](_0xd56a68[_0x7b47('0x3d')],{'$or':_[_0x7b47('0x2b')](_0x3ceafc,function(_0x4018d2){if(_0x4018d2[_0x7b47('0x2e')]!=='VIRTUAL'){var _0x4823fd={};_0x4823fd[_0x4018d2['name']]={'$like':'%'+_0x592b98['query'][_0x7b47('0x3b')]+'%'};return _0x4823fd;}})});}_0xd56a68=_[_0x7b47('0x3c')]({},_0xd56a68,_0x592b98['options']);var _0x918d84={'where':_0xd56a68[_0x7b47('0x3d')]};return db[_0x7b47('0x3e')][_0x7b47('0x3f')](_0x918d84)[_0x7b47('0x24')](function(_0x4f659b){_0x102d32[_0x7b47('0x3f')]=_0x4f659b;if(_0x592b98['query'][_0x7b47('0x40')]){_0xd56a68[_0x7b47('0x41')]=[{'all':!![]}];}return db[_0x7b47('0x3e')][_0x7b47('0x42')](_0xd56a68);})[_0x7b47('0x24')](function(_0x155c21){_0x102d32[_0x7b47('0x43')]=_0x155c21;return _0x102d32;})[_0x7b47('0x24')](respondWithFilteredResult(_0x345016,_0xd56a68))['catch'](handleError(_0x345016,null));};exports[_0x7b47('0x44')]=function(_0x98c66d,_0x125a1e){var _0x58ff30={'raw':![],'where':{'id':_0x98c66d[_0x7b47('0x45')]['id']}},_0xca5375={};_0xca5375[_0x7b47('0x2f')]=_[_0x7b47('0x31')](db['AnalyticCustomReport'][_0x7b47('0x2c')]);_0xca5375[_0x7b47('0x30')]=_[_0x7b47('0x31')](_0x98c66d['query']);_0xca5375[_0x7b47('0x32')]=_[_0x7b47('0x33')](_0xca5375[_0x7b47('0x2f')],_0xca5375['query']);_0x58ff30[_0x7b47('0x35')]=_[_0x7b47('0x33')](_0xca5375[_0x7b47('0x2f')],qs[_0x7b47('0x34')](_0x98c66d[_0x7b47('0x30')][_0x7b47('0x34')]));_0x58ff30[_0x7b47('0x35')]=_0x58ff30['attributes'][_0x7b47('0x36')]?_0x58ff30[_0x7b47('0x35')]:_0xca5375['model'];if(_0x98c66d[_0x7b47('0x30')][_0x7b47('0x40')]){_0x58ff30[_0x7b47('0x41')]=[{'all':!![]}];}_0x58ff30=_['merge']({},_0x58ff30,_0x98c66d[_0x7b47('0x46')]);return db[_0x7b47('0x3e')][_0x7b47('0x47')](_0x58ff30)['then'](handleEntityNotFound(_0x125a1e,null))[_0x7b47('0x24')](respondWithResult(_0x125a1e,null))['catch'](handleError(_0x125a1e,null));};exports[_0x7b47('0x48')]=function(_0x2662dc,_0x2dd796){return db[_0x7b47('0x3e')]['create'](_0x2662dc[_0x7b47('0x49')],{})['then'](function(_0x12d170){var _0x5079b0=_0x2662dc[_0x7b47('0x4a')][_0x7b47('0x26')]({'plain':!![]});if(!_0x5079b0)throw new Error(_0x7b47('0x4b'));if(_0x5079b0['role']===_0x7b47('0x4a')){var _0x1e2dc8=_0x12d170[_0x7b47('0x26')]({'plain':!![]});var _0x5b3352='Reports';return db['UserProfileSection'][_0x7b47('0x47')]({'where':{'name':_0x5b3352,'userProfileId':_0x5079b0['userProfileId']},'raw':!![]})[_0x7b47('0x24')](function(_0x3a8d37){if(_0x3a8d37&&_0x3a8d37[_0x7b47('0x4c')]===0x0){return db[_0x7b47('0x4d')]['create']({'name':_0x1e2dc8['name'],'resourceId':_0x1e2dc8['id'],'type':_0x7b47('0x27'),'sectionId':_0x3a8d37['id']},{})['then'](function(){return _0x12d170;});}else{return _0x12d170;}})[_0x7b47('0x4e')](function(_0x39d811){logger[_0x7b47('0x28')](_0x7b47('0x4f'),_0x39d811);throw _0x39d811;});}return _0x12d170;})[_0x7b47('0x24')](respondWithResult(_0x2dd796,0xc9))[_0x7b47('0x4e')](handleError(_0x2dd796,null));};exports[_0x7b47('0x23')]=function(_0x3d2953,_0x42bdef){if(_0x3d2953['body']['id']){delete _0x3d2953[_0x7b47('0x49')]['id'];}return db[_0x7b47('0x3e')][_0x7b47('0x47')]({'where':{'id':_0x3d2953[_0x7b47('0x45')]['id']}})[_0x7b47('0x24')](handleEntityNotFound(_0x42bdef,null))[_0x7b47('0x24')](saveUpdates(_0x3d2953['body'],null))[_0x7b47('0x24')](respondWithResult(_0x42bdef,null))[_0x7b47('0x4e')](handleError(_0x42bdef,null));};exports[_0x7b47('0x25')]=function(_0x462cf0,_0x2402eb){return db[_0x7b47('0x3e')][_0x7b47('0x47')]({'where':{'id':_0x462cf0[_0x7b47('0x45')]['id']}})['then'](handleEntityNotFound(_0x2402eb,null))[_0x7b47('0x24')](removeEntity(_0x2402eb,null))[_0x7b47('0x4e')](handleError(_0x2402eb,null));};exports['preview']=function(_0x483a13,_0x33449b){var _0x3d3421=0xa;var _0x354511=[_0x7b47('0x50'),_0x7b47('0x51'),_0x7b47('0x52'),'cross_join'];var _0x50e059={'SUM':_0x7b47('0x53'),'COUNT':_0x7b47('0x54'),'COUNT DISTINCT':_0x7b47('0x55'),'MAX':'MAX(%s)','MIN':_0x7b47('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7b47('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1bc631={'SEC_TO_TIME':_0x7b47('0x58'),'DATE':_0x7b47('0x59'),'HOUR':_0x7b47('0x5a'),'ROUND':_0x7b47('0x5b'),'UNIX_TIMESTAMP':_0x7b47('0x5c')};var _0x1379a6=function(_0x493a65){return!_[_0x7b47('0x5d')]([_0x7b47('0x5e'),'IS\x20NOT\x20NULL',_0x7b47('0x5f'),_0x7b47('0x60')],_0x493a65);};var _0x25bdc3=function(_0x5cdca6){if(!_0x5cdca6||!_0x5cdca6[_0x7b47('0x61')][_0x7b47('0x36')]){return'';}for(var _0x120066='(',_0x5d6458=0x0;_0x5d6458<_0x5cdca6['rules'][_0x7b47('0x36')];_0x5d6458+=0x1){_0x5d6458>0x0&&(_0x120066+='\x20'+_0x5cdca6[_0x7b47('0x62')]+'\x20');_0x120066+=_0x5cdca6['rules'][_0x5d6458][_0x7b47('0x63')]?_0x25bdc3(_0x5cdca6['rules'][_0x5d6458]['group']):_0x5cdca6[_0x7b47('0x61')][_0x5d6458]['field']+'\x20'+_0x5cdca6[_0x7b47('0x61')][_0x5d6458]['condition']+(_0x1379a6(_0x5cdca6[_0x7b47('0x61')][_0x5d6458][_0x7b47('0x64')])?'\x20'+_0x5cdca6[_0x7b47('0x61')][_0x5d6458][_0x7b47('0x65')]:'');}return _0x120066+')';};var _0x4fe891={'where':{'id':_0x483a13['params']['id']}},_0x5b7537,_0x9b8b5e,_0x15c30a,_0x3b40bc,_0x54dfe5;_0x4fe891=_[_0x7b47('0x3c')]({},_0x4fe891,_0x483a13[_0x7b47('0x46')]);return db[_0x7b47('0x3e')][_0x7b47('0x47')](_0x4fe891)[_0x7b47('0x24')](function(_0x54c437){if(_0x54c437){_0x5b7537=_0x54c437;return _0x54c437[_0x7b47('0x66')]();}return null;})['then'](function(_0x23f36b){if(_0x23f36b){if(!_0x23f36b[_0x7b47('0x36')]){throw new db[(_0x7b47('0x67'))][(_0x7b47('0x68'))](_0x7b47('0x69'),0x193);}_0x9b8b5e=_0x23f36b;return db[_0x7b47('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x7b47('0x24')](function(_0x459cb5){if(_0x459cb5){_0x15c30a=_['keyBy'](_0x459cb5,'id');var _0x41dc89;var _0x3d81b6=squel[_0x7b47('0x6b')]();_0x3d81b6[_0x7b47('0x6c')](_0x5b7537[_0x7b47('0x6d')]);for(var _0x5919eb=0x0;_0x5919eb<_0x9b8b5e[_0x7b47('0x36')];_0x5919eb+=0x1){_0x41dc89=_0x9b8b5e[_0x5919eb][_0x7b47('0x6e')]?_0x15c30a[_0x9b8b5e[_0x5919eb]['MetricId']]['metric']:_0x9b8b5e[_0x5919eb][_0x7b47('0x6f')];_0x41dc89=_0x9b8b5e[_0x5919eb][_0x7b47('0x70')]?_[_0x7b47('0x71')](_0x50e059[_0x9b8b5e[_0x5919eb][_0x7b47('0x70')]],'%s',_0x41dc89):_0x41dc89;_0x41dc89=_0x9b8b5e[_0x5919eb][_0x7b47('0x72')]?_[_0x7b47('0x71')](_0x1bc631[_0x9b8b5e[_0x5919eb][_0x7b47('0x72')]],'%s',_0x41dc89):_0x41dc89;if(_0x9b8b5e[_0x5919eb][_0x7b47('0x73')]){_0x3d81b6['group'](_0x41dc89);}_0x9b8b5e[_0x5919eb][_0x7b47('0x74')]&&_0x3d81b6[_0x7b47('0x39')](_0x41dc89,_0x9b8b5e[_0x5919eb][_0x7b47('0x74')]===_0x7b47('0x75')?![]:!![]);_0x3d81b6[_0x7b47('0x6f')](_0x41dc89,_0x9b8b5e[_0x5919eb][_0x7b47('0x76')]||_0x41dc89);}if(_0x5b7537['joins']){_0x5b7537[_0x7b47('0x77')]=JSON[_0x7b47('0x78')](_0x5b7537[_0x7b47('0x77')]);for(var _0x4e553b=0x0;_0x4e553b<_0x5b7537['joins'][_0x7b47('0x36')];_0x4e553b+=0x1){if(_0x5b7537[_0x7b47('0x77')][_0x4e553b][_0x7b47('0x2e')]&&_[_0x7b47('0x5d')](_0x354511,_0x5b7537[_0x7b47('0x77')][_0x4e553b][_0x7b47('0x2e')])&&_0x5b7537[_0x7b47('0x77')][_0x4e553b][_0x7b47('0x79')]&&_0x5b7537[_0x7b47('0x77')][_0x4e553b]['foreignTable']&&_0x5b7537[_0x7b47('0x77')][_0x4e553b][_0x7b47('0x7a')]){_0x3d81b6[_0x5b7537[_0x7b47('0x77')][_0x4e553b]['type']](_0x5b7537[_0x7b47('0x77')][_0x4e553b][_0x7b47('0x7b')],null,util[_0x7b47('0x72')](_0x7b47('0x7c'),_0x5b7537[_0x7b47('0x6d')],_0x5b7537[_0x7b47('0x77')][_0x4e553b]['parentKey'],_0x5b7537[_0x7b47('0x77')][_0x4e553b][_0x7b47('0x7b')],_0x5b7537['joins'][_0x4e553b][_0x7b47('0x7a')]));}}}if(_0x5b7537[_0x7b47('0x7d')]){_0x5b7537['conditions']=JSON['parse'](_0x5b7537[_0x7b47('0x7d')]);_0x3d81b6['where'](_0x25bdc3(_0x5b7537['conditions'][_0x7b47('0x63')]));}_0x54dfe5=_0x3d81b6['clone']();_0x3d81b6[_0x7b47('0x1d')](_0x3d3421);_0x3d81b6[_0x7b47('0x38')](0x0);logger[_0x7b47('0x7e')](_0x7b47('0x7f'),_0x3d81b6[_0x7b47('0x80')]());return dbH[_0x7b47('0x81')][_0x7b47('0x30')](_0x3d81b6['toString'](),{'type':dbH[_0x7b47('0x81')][_0x7b47('0x82')][_0x7b47('0x83')]});}})[_0x7b47('0x24')](respondWithResult(_0x33449b,null))[_0x7b47('0x4e')](handleError(_0x33449b,null));};function runReport(_0x13e4db,_0x593c7e,_0x18794a){var _0x15f5eb=_0x593c7e[_0x7b47('0x2a')];var _0x29a7a3=0xa;var _0x27de31=[_0x7b47('0x50'),_0x7b47('0x51'),'right_join',_0x7b47('0x84')];var _0x426ee2={'SUM':_0x7b47('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7b47('0x55'),'MAX':_0x7b47('0x85'),'MIN':_0x7b47('0x56'),'AVG':_0x7b47('0x86'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7b47('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x569e3c={'SEC_TO_TIME':_0x7b47('0x58'),'DATE':_0x7b47('0x59'),'HOUR':_0x7b47('0x5a'),'ROUND':_0x7b47('0x5b'),'UNIX_TIMESTAMP':_0x7b47('0x5c')};var _0x1cbf78=function(_0x1fee6f){return!_[_0x7b47('0x5d')]([_0x7b47('0x5e'),'IS\x20NOT\x20NULL',_0x7b47('0x5f'),_0x7b47('0x60')],_0x1fee6f);};var _0x3b5809=function(_0x5dca3a){if(!_0x5dca3a||!_0x5dca3a[_0x7b47('0x61')][_0x7b47('0x36')]){return'';}for(var _0x36d138='(',_0x5a630f=0x0;_0x5a630f<_0x5dca3a[_0x7b47('0x61')][_0x7b47('0x36')];_0x5a630f+=0x1){_0x5a630f>0x0&&(_0x36d138+='\x20'+_0x5dca3a[_0x7b47('0x62')]+'\x20');_0x36d138+=_0x5dca3a[_0x7b47('0x61')][_0x5a630f]['group']?_0x3b5809(_0x5dca3a['rules'][_0x5a630f][_0x7b47('0x63')]):_0x5dca3a['rules'][_0x5a630f]['field']+'\x20'+_0x5dca3a[_0x7b47('0x61')][_0x5a630f][_0x7b47('0x64')]+(_0x1cbf78(_0x5dca3a['rules'][_0x5a630f][_0x7b47('0x64')])?'\x20'+_0x5dca3a[_0x7b47('0x61')][_0x5a630f][_0x7b47('0x65')]:'');}return _0x36d138+')';};var _0x55810e={'where':{'id':_0x13e4db['id']}},_0xf3cbea,_0x58e458,_0x166ce2,_0x5bf97e,_0x5b6a92;_0x55810e=_[_0x7b47('0x3c')]({},_0x55810e,_0x18794a);return db['AnalyticCustomReport'][_0x7b47('0x47')](_0x55810e)[_0x7b47('0x24')](function(_0x3a4128){if(_0x3a4128){_0xf3cbea=_0x3a4128;return _0x3a4128[_0x7b47('0x66')]();}return null;})[_0x7b47('0x24')](function(_0x5bda28){if(_0x5bda28){if(!_0x5bda28[_0x7b47('0x36')]){throw new db[(_0x7b47('0x67'))][(_0x7b47('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x58e458=_0x5bda28;return db[_0x7b47('0x6a')][_0x7b47('0x42')]({'raw':!![]});}return null;})[_0x7b47('0x24')](function(_0x44aa9f){if(_0x44aa9f){_0x166ce2=_[_0x7b47('0x87')](_0x44aa9f,'id');var _0x43dcd1;var _0x3c6584=squel['select']();_0x3c6584[_0x7b47('0x6c')](_0xf3cbea[_0x7b47('0x6d')]);for(var _0x1c169e=0x0;_0x1c169e<_0x58e458[_0x7b47('0x36')];_0x1c169e+=0x1){_0x43dcd1=_0x58e458[_0x1c169e][_0x7b47('0x6e')]?_0x166ce2[_0x58e458[_0x1c169e][_0x7b47('0x6e')]][_0x7b47('0x88')]:_0x58e458[_0x1c169e][_0x7b47('0x6f')];_0x43dcd1=_0x58e458[_0x1c169e][_0x7b47('0x70')]?_['replace'](_0x426ee2[_0x58e458[_0x1c169e][_0x7b47('0x70')]],'%s',_0x43dcd1):_0x43dcd1;_0x43dcd1=_0x58e458[_0x1c169e]['format']?_['replace'](_0x569e3c[_0x58e458[_0x1c169e][_0x7b47('0x72')]],'%s',_0x43dcd1):_0x43dcd1;if(_0x58e458[_0x1c169e][_0x7b47('0x73')]){_0x3c6584['group'](_0x43dcd1);}_0x58e458[_0x1c169e][_0x7b47('0x74')]&&_0x3c6584[_0x7b47('0x39')](_0x43dcd1,_0x58e458[_0x1c169e][_0x7b47('0x74')]===_0x7b47('0x75')?![]:!![]);_0x3c6584[_0x7b47('0x6f')](_0x43dcd1,_0x58e458[_0x1c169e]['alias']||_0x43dcd1);}if(_0xf3cbea[_0x7b47('0x77')]){_0xf3cbea['joins']=JSON['parse'](_0xf3cbea[_0x7b47('0x77')]);for(var _0x53dce4=0x0;_0x53dce4<_0xf3cbea[_0x7b47('0x77')][_0x7b47('0x36')];_0x53dce4+=0x1){if(_0xf3cbea['joins'][_0x53dce4][_0x7b47('0x2e')]&&_['includes'](_0x27de31,_0xf3cbea[_0x7b47('0x77')][_0x53dce4][_0x7b47('0x2e')])&&_0xf3cbea['joins'][_0x53dce4][_0x7b47('0x79')]&&_0xf3cbea[_0x7b47('0x77')][_0x53dce4][_0x7b47('0x7b')]&&_0xf3cbea[_0x7b47('0x77')][_0x53dce4]['foreignKey']){_0x3c6584[_0xf3cbea[_0x7b47('0x77')][_0x53dce4][_0x7b47('0x2e')]](_0xf3cbea[_0x7b47('0x77')][_0x53dce4][_0x7b47('0x7b')],null,util['format'](_0x7b47('0x7c'),_0xf3cbea[_0x7b47('0x6d')],_0xf3cbea[_0x7b47('0x77')][_0x53dce4]['parentKey'],_0xf3cbea[_0x7b47('0x77')][_0x53dce4][_0x7b47('0x7b')],_0xf3cbea[_0x7b47('0x77')][_0x53dce4]['foreignKey']));}}}if(_0xf3cbea['conditions']){_0xf3cbea[_0x7b47('0x7d')]=JSON[_0x7b47('0x78')](_0xf3cbea['conditions']);_0x3c6584[_0x7b47('0x3d')](_0x3b5809(_0xf3cbea[_0x7b47('0x7d')][_0x7b47('0x63')]));}_0x5b6a92=_0x3c6584[_0x7b47('0x89')]();_0x3c6584[_0x7b47('0x1d')](_0x29a7a3);_0x3c6584[_0x7b47('0x38')](0x0);return;}})['then'](function(){if(_0x593c7e['output']===_0x7b47('0x8a')){return null;}var _0x470e16=_['merge'](_0x593c7e,{'name':_0x593c7e['fullPath']||_0x593c7e[_0x7b47('0x2a')]||_0xf3cbea[_0x7b47('0x2a')],'basename':_0x15f5eb,'savename':util[_0x7b47('0x72')](_0x7b47('0x8b'),_0x593c7e[_0x7b47('0x2a')]||_0xf3cbea[_0x7b47('0x2a')],require('randomstring')[_0x7b47('0x8c')](0x4),_0x593c7e[_0x7b47('0x8d')]||_0x7b47('0x8e')),'reportId':_0xf3cbea['id'],'reportType':_0x7b47('0x8f')});return db[_0x7b47('0x90')]['create'](_0x470e16,{'raw':!![]});})['then'](function(_0x1e7bfc){if(_0xf3cbea[_0x7b47('0x6d')]===_0x7b47('0x91')){_0x5b6a92['where'](_0xf3cbea[_0x7b47('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x593c7e[_0x7b47('0x92')],_0x593c7e['endDate']);}else{_0x5b6a92[_0x7b47('0x3d')](_0xf3cbea[_0x7b47('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x593c7e[_0x7b47('0x92')],_0x593c7e[_0x7b47('0x93')]);}if(_0x1e7bfc){logger[_0x7b47('0x94')](_0x7b47('0x95'),_0x5b6a92['toString']());require(_0x7b47('0x96'))[_0x7b47('0x97')](path[_0x7b47('0x50')](__dirname,_0x7b47('0x98'),_0x1e7bfc[_0x7b47('0x8d')]),[_0x1e7bfc['id'],_0x5b6a92[_0x7b47('0x80')](),path[_0x7b47('0x50')](__dirname,_0x7b47('0x99'),_0x1e7bfc[_0x7b47('0x9a')]),_0x15f5eb]);return _0x1e7bfc;}else{var _0x57dd50=squel[_0x7b47('0x6b')]();_0x57dd50[_0x7b47('0x6c')]('('+_0x5b6a92[_0x7b47('0x80')]()+')','countTable');_0x57dd50[_0x7b47('0x6f')](_0x7b47('0x9b'),_0x7b47('0x3f'));_0x5b6a92['limit'](_0x593c7e['limit']||_0x29a7a3);_0x5b6a92[_0x7b47('0x38')](_0x593c7e[_0x7b47('0x38')]||0x0);return dbH[_0x7b47('0x81')][_0x7b47('0x30')](_0x57dd50[_0x7b47('0x80')](),{'type':dbH['sequelize'][_0x7b47('0x82')]['SELECT']})['then'](function(_0x38f07a){if(!_0x38f07a[_0x7b47('0x36')]){_0x5bf97e=0x0;}else{_0x5bf97e=_0x38f07a[0x0][_0x7b47('0x3f')]||0x0;}return dbH['sequelize']['query'](_0x5b6a92[_0x7b47('0x80')](),{'type':dbH[_0x7b47('0x81')][_0x7b47('0x82')]['SELECT']});})[_0x7b47('0x24')](function(_0x3bf3a0){return{'rows':_0x3bf3a0||[],'count':_0x5bf97e};});}});}exports[_0x7b47('0x9c')]=function(_0x25053f,_0x5194cb){return runReport(_0x25053f[_0x7b47('0x45')],_0x25053f[_0x7b47('0x30')],_0x25053f[_0x7b47('0x46')])[_0x7b47('0x24')](respondWithResult(_0x5194cb,null))[_0x7b47('0x4e')](handleError(_0x5194cb,null));};exports[_0x7b47('0x9d')]=runReport;exports[_0x7b47('0x30')]=function(_0x451b0b,_0xfe194e){var _0x1e0d76=0xa;var _0x28913c=[_0x7b47('0x50'),_0x7b47('0x51'),'right_join','cross_join'];var _0x5ce728={'SUM':_0x7b47('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7b47('0x55'),'MAX':_0x7b47('0x85'),'MIN':'MIN(%s)','AVG':_0x7b47('0x86'),'GROUP_CONCAT':_0x7b47('0x9e'),'GROUP_CONCAT ASC':_0x7b47('0x57'),'GROUP_CONCAT DESC':_0x7b47('0x9f')};var _0x38ea40={'SEC_TO_TIME':_0x7b47('0x58'),'DATE':_0x7b47('0x59'),'HOUR':'HOUR(%s)','ROUND':_0x7b47('0x5b'),'UNIX_TIMESTAMP':_0x7b47('0x5c')};var _0x5567c6=function(_0xe5c35b){return!_[_0x7b47('0x5d')]([_0x7b47('0x5e'),_0x7b47('0xa0'),_0x7b47('0x5f'),_0x7b47('0x60')],_0xe5c35b);};var _0x51e2d8=function(_0x4df3f6){if(!_0x4df3f6||!_0x4df3f6['rules'][_0x7b47('0x36')]){return'';}for(var _0x2a0025='(',_0x92d807=0x0;_0x92d807<_0x4df3f6[_0x7b47('0x61')][_0x7b47('0x36')];_0x92d807+=0x1){_0x92d807>0x0&&(_0x2a0025+='\x20'+_0x4df3f6['operator']+'\x20');_0x2a0025+=_0x4df3f6[_0x7b47('0x61')][_0x92d807][_0x7b47('0x63')]?_0x51e2d8(_0x4df3f6[_0x7b47('0x61')][_0x92d807][_0x7b47('0x63')]):_0x4df3f6[_0x7b47('0x61')][_0x92d807][_0x7b47('0x6f')]+'\x20'+_0x4df3f6[_0x7b47('0x61')][_0x92d807][_0x7b47('0x64')]+(_0x5567c6(_0x4df3f6[_0x7b47('0x61')][_0x92d807][_0x7b47('0x64')])?'\x20'+_0x4df3f6[_0x7b47('0x61')][_0x92d807][_0x7b47('0x65')]:'');}return _0x2a0025+')';};var _0x45f31f={'where':{'id':_0x451b0b[_0x7b47('0x45')]['id']}},_0x222933,_0x5d8e86,_0xa673f,_0x5088ce,_0x19319e;_0x45f31f=_[_0x7b47('0x3c')]({},_0x45f31f,_0x451b0b['options']);return db[_0x7b47('0x3e')][_0x7b47('0x47')](_0x45f31f)['then'](function(_0x4004c5){if(_0x4004c5){_0x222933=_0x4004c5;return _0x4004c5['getFields']();}return null;})[_0x7b47('0x24')](function(_0x45f8b3){if(_0x45f8b3){if(!_0x45f8b3[_0x7b47('0x36')]){throw new db[(_0x7b47('0x67'))][(_0x7b47('0x68'))](_0x7b47('0x69'),0x193);}_0x5d8e86=_0x45f8b3;return db['AnalyticMetric'][_0x7b47('0x42')]({'raw':!![]});}return null;})[_0x7b47('0x24')](function(_0x221d6f){if(_0x221d6f){_0xa673f=_[_0x7b47('0x87')](_0x221d6f,'id');var _0x101fdc;var _0x46a963=squel[_0x7b47('0x6b')]();_0x46a963[_0x7b47('0x6c')](_0x222933['table']);for(var _0x5c1e97=0x0;_0x5c1e97<_0x5d8e86[_0x7b47('0x36')];_0x5c1e97+=0x1){_0x101fdc=_0x5d8e86[_0x5c1e97][_0x7b47('0x6e')]?_0xa673f[_0x5d8e86[_0x5c1e97][_0x7b47('0x6e')]][_0x7b47('0x88')]:_0x5d8e86[_0x5c1e97][_0x7b47('0x6f')];_0x101fdc=_0x5d8e86[_0x5c1e97][_0x7b47('0x70')]?_[_0x7b47('0x71')](_0x5ce728[_0x5d8e86[_0x5c1e97][_0x7b47('0x70')]],'%s',_0x101fdc):_0x101fdc;_0x101fdc=_0x5d8e86[_0x5c1e97][_0x7b47('0x72')]?_[_0x7b47('0x71')](_0x38ea40[_0x5d8e86[_0x5c1e97][_0x7b47('0x72')]],'%s',_0x101fdc):_0x101fdc;if(_0x5d8e86[_0x5c1e97]['groupBy']){_0x46a963['group'](_0x101fdc);}_0x5d8e86[_0x5c1e97][_0x7b47('0x74')]&&_0x46a963[_0x7b47('0x39')](_0x101fdc,_0x5d8e86[_0x5c1e97][_0x7b47('0x74')]===_0x7b47('0x75')?![]:!![]);_0x46a963[_0x7b47('0x6f')](_0x101fdc,_0x5d8e86[_0x5c1e97][_0x7b47('0x76')]||_0x101fdc);}if(_0x222933[_0x7b47('0x77')]){_0x222933[_0x7b47('0x77')]=JSON['parse'](_0x222933['joins']);for(var _0x236291=0x0;_0x236291<_0x222933[_0x7b47('0x77')][_0x7b47('0x36')];_0x236291+=0x1){if(_0x222933[_0x7b47('0x77')][_0x236291][_0x7b47('0x2e')]&&_[_0x7b47('0x5d')](_0x28913c,_0x222933['joins'][_0x236291][_0x7b47('0x2e')])&&_0x222933[_0x7b47('0x77')][_0x236291][_0x7b47('0x79')]&&_0x222933['joins'][_0x236291][_0x7b47('0x7b')]&&_0x222933[_0x7b47('0x77')][_0x236291][_0x7b47('0x7a')]){_0x46a963[_0x222933[_0x7b47('0x77')][_0x236291][_0x7b47('0x2e')]](_0x222933[_0x7b47('0x77')][_0x236291][_0x7b47('0x7b')],null,util['format'](_0x7b47('0x7c'),_0x222933[_0x7b47('0x6d')],_0x222933[_0x7b47('0x77')][_0x236291]['parentKey'],_0x222933[_0x7b47('0x77')][_0x236291][_0x7b47('0x7b')],_0x222933[_0x7b47('0x77')][_0x236291]['foreignKey']));}}}if(_0x222933[_0x7b47('0x7d')]){_0x222933[_0x7b47('0x7d')]=JSON['parse'](_0x222933[_0x7b47('0x7d')]);_0x46a963[_0x7b47('0x3d')](_0x51e2d8(_0x222933['conditions'][_0x7b47('0x63')]));}_0x19319e=_0x46a963['clone']();_0x46a963[_0x7b47('0x1d')](_0x1e0d76);_0x46a963[_0x7b47('0x38')](0x0);logger[_0x7b47('0x7e')](_0x7b47('0x7f'),_0x46a963[_0x7b47('0x80')]());return dbH[_0x7b47('0x81')]['query'](_0x46a963[_0x7b47('0x80')](),{'type':dbH[_0x7b47('0x81')]['QueryTypes'][_0x7b47('0x83')]});}})['then'](function(){return{'sql':_0x19319e['toString']()};})[_0x7b47('0x24')](respondWithResult(_0xfe194e,null))[_0x7b47('0x4e')](handleError(_0xfe194e,null));};
\ No newline at end of file
+var _0xe0e4=['AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','function','format','orderBy','DESC','joins','parse','includes','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','cross_join','AVG(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','replace','groupBy','alias','output','fullPath','csv','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','ROUND(%s)','Sequelize','metric','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','CustomReports','UserProfileResource','destroy','sendStatus','error','stack','name','map'];(function(_0x5a7608,_0x47294d){var _0x45cd56=function(_0x4723b3){while(--_0x4723b3){_0x5a7608['push'](_0x5a7608['shift']());}};_0x45cd56(++_0x47294d);}(_0xe0e4,0x1b1));var _0x4e0e=function(_0x592c18,_0x383f9f){_0x592c18=_0x592c18-0x0;var _0x29d0e5=_0xe0e4[_0x592c18];return _0x29d0e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e0e('0x0'));var zipdir=require(_0x4e0e('0x1'));var jsonpatch=require(_0x4e0e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4e0e('0x3'));var Mustache=require('mustache');var util=require(_0x4e0e('0x4'));var path=require(_0x4e0e('0x5'));var sox=require(_0x4e0e('0x6'));var csv=require(_0x4e0e('0x7'));var ejs=require(_0x4e0e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4e0e('0x9'));var crypto=require(_0x4e0e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4e0e('0xb'));var toCsv=require(_0x4e0e('0x7'));var querystring=require('querystring');var Papa=require(_0x4e0e('0xc'));var Redis=require(_0x4e0e('0xd'));var authService=require(_0x4e0e('0xe'));var qs=require(_0x4e0e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e0e('0x10'));var logger=require('../../config/logger')(_0x4e0e('0x11'));var utils=require(_0x4e0e('0x12'));var config=require(_0x4e0e('0x13'));var licenseUtil=require(_0x4e0e('0x14'));var db=require(_0x4e0e('0x15'))['db'];var dbH=require(_0x4e0e('0x15'))[_0x4e0e('0x16')];function respondWithStatusCode(_0x53ff5,_0x448617){_0x448617=_0x448617||0xcc;return function(_0xa57007){if(_0xa57007){return _0x53ff5['sendStatus'](_0x448617);}return _0x53ff5[_0x4e0e('0x17')](_0x448617)[_0x4e0e('0x18')]();};}function respondWithResult(_0x389abd,_0x163b60){_0x163b60=_0x163b60||0xc8;return function(_0x2d05fa){if(_0x2d05fa){return _0x389abd[_0x4e0e('0x17')](_0x163b60)[_0x4e0e('0x19')](_0x2d05fa);}};}function respondWithFilteredResult(_0x4b48cc,_0x53d021){return function(_0x1a1c64){if(_0x1a1c64){var _0x1de3fb=typeof _0x53d021['offset']===_0x4e0e('0x1a')&&typeof _0x53d021['limit']===_0x4e0e('0x1a');var _0x876756=_0x1a1c64[_0x4e0e('0x1b')];var _0x149da5=_0x1de3fb?0x0:_0x53d021[_0x4e0e('0x1c')];var _0x4a3682=_0x1de3fb?_0x1a1c64[_0x4e0e('0x1b')]:_0x53d021[_0x4e0e('0x1c')]+_0x53d021[_0x4e0e('0x1d')];var _0x5b1939;if(_0x4a3682>=_0x876756){_0x4a3682=_0x876756;_0x5b1939=0xc8;}else{_0x5b1939=0xce;}_0x4b48cc[_0x4e0e('0x17')](_0x5b1939);return _0x4b48cc[_0x4e0e('0x1e')](_0x4e0e('0x1f'),_0x149da5+'-'+_0x4a3682+'/'+_0x876756)['json'](_0x1a1c64);}return null;};}function patchUpdates(_0x18252e){return function(_0xf1a97e){try{jsonpatch[_0x4e0e('0x20')](_0xf1a97e,_0x18252e,!![]);}catch(_0x1c4a8b){return BPromise[_0x4e0e('0x21')](_0x1c4a8b);}return _0xf1a97e['save']();};}function saveUpdates(_0x49174b,_0x121749){return function(_0xf9c0ed){if(_0xf9c0ed){return _0xf9c0ed[_0x4e0e('0x22')](_0x49174b)[_0x4e0e('0x23')](function(_0x1c0f0f){return _0x1c0f0f;});}return null;};}function removeEntity(_0x4728e2,_0x95d7e2){return function(_0x55467e){if(_0x55467e){return _0x55467e['destroy']()[_0x4e0e('0x23')](function(){var _0x5b6fd4=_0x55467e['get']({'plain':!![]});var _0x130161=_0x4e0e('0x24');return db[_0x4e0e('0x25')][_0x4e0e('0x26')]({'where':{'type':_0x130161,'resourceId':_0x5b6fd4['id']}})['then'](function(){return _0x55467e;});})[_0x4e0e('0x23')](function(){_0x4728e2[_0x4e0e('0x17')](0xcc)[_0x4e0e('0x18')]();});}};}function handleEntityNotFound(_0x270a3e,_0x29c64f){return function(_0x20daf5){if(!_0x20daf5){_0x270a3e[_0x4e0e('0x27')](0x194);}return _0x20daf5;};}function handleError(_0x35c1c9,_0x36143a){_0x36143a=_0x36143a||0x1f4;return function(_0x445ffc){logger[_0x4e0e('0x28')](_0x445ffc[_0x4e0e('0x29')]);if(_0x445ffc[_0x4e0e('0x2a')]){delete _0x445ffc[_0x4e0e('0x2a')];}_0x35c1c9[_0x4e0e('0x17')](_0x36143a)['send'](_0x445ffc);};}exports['index']=function(_0x3c5e71,_0x35ae34){var _0x26f6e1={},_0x9f3d21={},_0x519f91={'count':0x0,'rows':[]};var _0xff0d29=_[_0x4e0e('0x2b')](db[_0x4e0e('0x2c')][_0x4e0e('0x2d')],function(_0x33cbc2){return{'name':_0x33cbc2[_0x4e0e('0x2e')],'type':_0x33cbc2[_0x4e0e('0x2f')][_0x4e0e('0x30')]};});_0x9f3d21[_0x4e0e('0x31')]=_[_0x4e0e('0x2b')](_0xff0d29,_0x4e0e('0x2a'));_0x9f3d21[_0x4e0e('0x32')]=_[_0x4e0e('0x33')](_0x3c5e71[_0x4e0e('0x32')]);_0x9f3d21[_0x4e0e('0x34')]=_[_0x4e0e('0x35')](_0x9f3d21[_0x4e0e('0x31')],_0x9f3d21['query']);_0x26f6e1['attributes']=_[_0x4e0e('0x35')](_0x9f3d21[_0x4e0e('0x31')],qs[_0x4e0e('0x36')](_0x3c5e71['query']['fields']));_0x26f6e1['attributes']=_0x26f6e1[_0x4e0e('0x37')][_0x4e0e('0x38')]?_0x26f6e1['attributes']:_0x9f3d21[_0x4e0e('0x31')];if(!_0x3c5e71[_0x4e0e('0x32')][_0x4e0e('0x39')](_0x4e0e('0x3a'))){_0x26f6e1[_0x4e0e('0x1d')]=qs[_0x4e0e('0x1d')](_0x3c5e71['query'][_0x4e0e('0x1d')]);_0x26f6e1[_0x4e0e('0x1c')]=qs[_0x4e0e('0x1c')](_0x3c5e71[_0x4e0e('0x32')]['offset']);}_0x26f6e1[_0x4e0e('0x3b')]=qs[_0x4e0e('0x3c')](_0x3c5e71[_0x4e0e('0x32')][_0x4e0e('0x3c')]);_0x26f6e1[_0x4e0e('0x3d')]=qs[_0x4e0e('0x34')](_['pick'](_0x3c5e71['query'],_0x9f3d21[_0x4e0e('0x34')]),_0xff0d29);if(_0x3c5e71[_0x4e0e('0x32')][_0x4e0e('0x3e')]){_0x26f6e1[_0x4e0e('0x3d')]=_['merge'](_0x26f6e1[_0x4e0e('0x3d')],{'$or':_[_0x4e0e('0x2b')](_0xff0d29,function(_0x57512b){if(_0x57512b['type']!==_0x4e0e('0x3f')){var _0x15b402={};_0x15b402[_0x57512b[_0x4e0e('0x2a')]]={'$like':'%'+_0x3c5e71[_0x4e0e('0x32')]['filter']+'%'};return _0x15b402;}})});}_0x26f6e1=_[_0x4e0e('0x40')]({},_0x26f6e1,_0x3c5e71[_0x4e0e('0x41')]);var _0x2a1757={'where':_0x26f6e1[_0x4e0e('0x3d')]};return db[_0x4e0e('0x2c')][_0x4e0e('0x1b')](_0x2a1757)[_0x4e0e('0x23')](function(_0x5e9538){_0x519f91[_0x4e0e('0x1b')]=_0x5e9538;if(_0x3c5e71['query'][_0x4e0e('0x42')]){_0x26f6e1[_0x4e0e('0x43')]=[{'all':!![]}];}return db[_0x4e0e('0x2c')][_0x4e0e('0x44')](_0x26f6e1);})[_0x4e0e('0x23')](function(_0x49e2b4){_0x519f91['rows']=_0x49e2b4;return _0x519f91;})[_0x4e0e('0x23')](respondWithFilteredResult(_0x35ae34,_0x26f6e1))[_0x4e0e('0x45')](handleError(_0x35ae34,null));};exports['show']=function(_0xf37659,_0x211eaa){var _0x5b6149={'raw':![],'where':{'id':_0xf37659[_0x4e0e('0x46')]['id']}},_0x7c9ffa={};_0x7c9ffa['model']=_['keys'](db[_0x4e0e('0x2c')][_0x4e0e('0x2d')]);_0x7c9ffa[_0x4e0e('0x32')]=_[_0x4e0e('0x33')](_0xf37659[_0x4e0e('0x32')]);_0x7c9ffa[_0x4e0e('0x34')]=_[_0x4e0e('0x35')](_0x7c9ffa[_0x4e0e('0x31')],_0x7c9ffa[_0x4e0e('0x32')]);_0x5b6149['attributes']=_[_0x4e0e('0x35')](_0x7c9ffa[_0x4e0e('0x31')],qs['fields'](_0xf37659[_0x4e0e('0x32')][_0x4e0e('0x36')]));_0x5b6149[_0x4e0e('0x37')]=_0x5b6149['attributes']['length']?_0x5b6149[_0x4e0e('0x37')]:_0x7c9ffa[_0x4e0e('0x31')];if(_0xf37659[_0x4e0e('0x32')][_0x4e0e('0x42')]){_0x5b6149[_0x4e0e('0x43')]=[{'all':!![]}];}_0x5b6149=_[_0x4e0e('0x40')]({},_0x5b6149,_0xf37659[_0x4e0e('0x41')]);return db['AnalyticCustomReport'][_0x4e0e('0x47')](_0x5b6149)[_0x4e0e('0x23')](handleEntityNotFound(_0x211eaa,null))[_0x4e0e('0x23')](respondWithResult(_0x211eaa,null))[_0x4e0e('0x45')](handleError(_0x211eaa,null));};exports['create']=function(_0x2435ff,_0x314930){return db['AnalyticCustomReport'][_0x4e0e('0x48')](_0x2435ff['body'],{})['then'](function(_0x140616){var _0x203f53=_0x2435ff[_0x4e0e('0x49')]['get']({'plain':!![]});if(!_0x203f53)throw new Error(_0x4e0e('0x4a'));if(_0x203f53['role']===_0x4e0e('0x49')){var _0x327c20=_0x140616[_0x4e0e('0x4b')]({'plain':!![]});var _0x3e2cfd=_0x4e0e('0x4c');return db[_0x4e0e('0x4d')][_0x4e0e('0x47')]({'where':{'name':_0x3e2cfd,'userProfileId':_0x203f53[_0x4e0e('0x4e')]},'raw':!![]})['then'](function(_0x35d157){if(_0x35d157&&_0x35d157[_0x4e0e('0x4f')]===0x0){return db['UserProfileResource'][_0x4e0e('0x48')]({'name':_0x327c20[_0x4e0e('0x2a')],'resourceId':_0x327c20['id'],'type':'CustomReports','sectionId':_0x35d157['id']},{})['then'](function(){return _0x140616;});}else{return _0x140616;}})['catch'](function(_0x3d5510){logger[_0x4e0e('0x28')](_0x4e0e('0x50'),_0x3d5510);throw _0x3d5510;});}return _0x140616;})[_0x4e0e('0x23')](respondWithResult(_0x314930,0xc9))[_0x4e0e('0x45')](handleError(_0x314930,null));};exports[_0x4e0e('0x22')]=function(_0x2537a2,_0x49143a){if(_0x2537a2['body']['id']){delete _0x2537a2['body']['id'];}return db[_0x4e0e('0x2c')][_0x4e0e('0x47')]({'where':{'id':_0x2537a2[_0x4e0e('0x46')]['id']}})[_0x4e0e('0x23')](handleEntityNotFound(_0x49143a,null))['then'](saveUpdates(_0x2537a2[_0x4e0e('0x51')],null))[_0x4e0e('0x23')](respondWithResult(_0x49143a,null))[_0x4e0e('0x45')](handleError(_0x49143a,null));};exports[_0x4e0e('0x26')]=function(_0x2d856c,_0x2a1933){return db[_0x4e0e('0x2c')][_0x4e0e('0x47')]({'where':{'id':_0x2d856c['params']['id']}})[_0x4e0e('0x23')](handleEntityNotFound(_0x2a1933,null))['then'](removeEntity(_0x2a1933,null))['catch'](handleError(_0x2a1933,null));};exports['preview']=function(_0x5c1dd8,_0x40fc89){var _0x2fefdf=0xa;var _0x26766f=[_0x4e0e('0x52'),'left_join',_0x4e0e('0x53'),'cross_join'];var _0x1bdb27={'SUM':_0x4e0e('0x54'),'COUNT':_0x4e0e('0x55'),'COUNT DISTINCT':_0x4e0e('0x56'),'MAX':_0x4e0e('0x57'),'MIN':_0x4e0e('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4e0e('0x59'),'GROUP_CONCAT ASC':_0x4e0e('0x5a'),'GROUP_CONCAT DESC':_0x4e0e('0x5b')};var _0x42a652={'SEC_TO_TIME':_0x4e0e('0x5c'),'DATE':_0x4e0e('0x5d'),'HOUR':_0x4e0e('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x405696=function(_0x2a23be){return!_['includes'](['IS\x20NULL',_0x4e0e('0x5f'),_0x4e0e('0x60'),_0x4e0e('0x61')],_0x2a23be);};var _0x32d612=function(_0x31be0f){if(!_0x31be0f||!_0x31be0f[_0x4e0e('0x62')]['length']){return'';}for(var _0x21860a='(',_0x4bc301=0x0;_0x4bc301<_0x31be0f[_0x4e0e('0x62')][_0x4e0e('0x38')];_0x4bc301+=0x1){_0x4bc301>0x0&&(_0x21860a+='\x20'+_0x31be0f[_0x4e0e('0x63')]+'\x20');_0x21860a+=_0x31be0f[_0x4e0e('0x62')][_0x4bc301][_0x4e0e('0x64')]?_0x32d612(_0x31be0f[_0x4e0e('0x62')][_0x4bc301][_0x4e0e('0x64')]):_0x31be0f['rules'][_0x4bc301][_0x4e0e('0x65')]+'\x20'+_0x31be0f['rules'][_0x4bc301]['condition']+(_0x405696(_0x31be0f[_0x4e0e('0x62')][_0x4bc301][_0x4e0e('0x66')])?'\x20'+_0x31be0f['rules'][_0x4bc301][_0x4e0e('0x67')]:'');}return _0x21860a+')';};var _0x58ba97={'where':{'id':_0x5c1dd8[_0x4e0e('0x46')]['id']}},_0x42d5f3,_0x11e60e,_0x2a09d0,_0x3d17e4,_0xfc0dc2;_0x58ba97=_['merge']({},_0x58ba97,_0x5c1dd8[_0x4e0e('0x41')]);return db[_0x4e0e('0x2c')][_0x4e0e('0x47')](_0x58ba97)[_0x4e0e('0x23')](function(_0x2bbb35){if(_0x2bbb35){_0x42d5f3=_0x2bbb35;return _0x2bbb35[_0x4e0e('0x68')]();}return null;})['then'](function(_0x4922a6){if(_0x4922a6){if(!_0x4922a6['length']){throw new db['Sequelize'][(_0x4e0e('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x11e60e=_0x4922a6;return db[_0x4e0e('0x6a')][_0x4e0e('0x44')]({'raw':!![]});}return null;})[_0x4e0e('0x23')](function(_0x4412f2){if(_0x4412f2){_0x2a09d0=_[_0x4e0e('0x6b')](_0x4412f2,'id');var _0x3a24ac;var _0x48d7b6=squel[_0x4e0e('0x6c')]();_0x48d7b6[_0x4e0e('0x6d')](_0x42d5f3[_0x4e0e('0x6e')]);for(var _0x5f03a4=0x0;_0x5f03a4<_0x11e60e['length'];_0x5f03a4+=0x1){_0x3a24ac=_0x11e60e[_0x5f03a4][_0x4e0e('0x6f')]?_0x2a09d0[_0x11e60e[_0x5f03a4][_0x4e0e('0x6f')]]['metric']:_0x11e60e[_0x5f03a4][_0x4e0e('0x65')];_0x3a24ac=_0x11e60e[_0x5f03a4]['function']?_['replace'](_0x1bdb27[_0x11e60e[_0x5f03a4][_0x4e0e('0x70')]],'%s',_0x3a24ac):_0x3a24ac;_0x3a24ac=_0x11e60e[_0x5f03a4]['format']?_['replace'](_0x42a652[_0x11e60e[_0x5f03a4][_0x4e0e('0x71')]],'%s',_0x3a24ac):_0x3a24ac;if(_0x11e60e[_0x5f03a4]['groupBy']){_0x48d7b6[_0x4e0e('0x64')](_0x3a24ac);}_0x11e60e[_0x5f03a4][_0x4e0e('0x72')]&&_0x48d7b6[_0x4e0e('0x3b')](_0x3a24ac,_0x11e60e[_0x5f03a4][_0x4e0e('0x72')]===_0x4e0e('0x73')?![]:!![]);_0x48d7b6[_0x4e0e('0x65')](_0x3a24ac,_0x11e60e[_0x5f03a4]['alias']||_0x3a24ac);}if(_0x42d5f3['joins']){_0x42d5f3[_0x4e0e('0x74')]=JSON[_0x4e0e('0x75')](_0x42d5f3[_0x4e0e('0x74')]);for(var _0x45ce1e=0x0;_0x45ce1e<_0x42d5f3[_0x4e0e('0x74')][_0x4e0e('0x38')];_0x45ce1e+=0x1){if(_0x42d5f3[_0x4e0e('0x74')][_0x45ce1e][_0x4e0e('0x2f')]&&_[_0x4e0e('0x76')](_0x26766f,_0x42d5f3[_0x4e0e('0x74')][_0x45ce1e]['type'])&&_0x42d5f3['joins'][_0x45ce1e]['parentKey']&&_0x42d5f3[_0x4e0e('0x74')][_0x45ce1e][_0x4e0e('0x77')]&&_0x42d5f3[_0x4e0e('0x74')][_0x45ce1e][_0x4e0e('0x78')]){_0x48d7b6[_0x42d5f3[_0x4e0e('0x74')][_0x45ce1e][_0x4e0e('0x2f')]](_0x42d5f3['joins'][_0x45ce1e][_0x4e0e('0x77')],null,util[_0x4e0e('0x71')](_0x4e0e('0x79'),_0x42d5f3['table'],_0x42d5f3[_0x4e0e('0x74')][_0x45ce1e][_0x4e0e('0x7a')],_0x42d5f3[_0x4e0e('0x74')][_0x45ce1e][_0x4e0e('0x77')],_0x42d5f3[_0x4e0e('0x74')][_0x45ce1e][_0x4e0e('0x78')]));}}}if(_0x42d5f3[_0x4e0e('0x7b')]){_0x42d5f3[_0x4e0e('0x7b')]=JSON[_0x4e0e('0x75')](_0x42d5f3[_0x4e0e('0x7b')]);_0x48d7b6[_0x4e0e('0x3d')](_0x32d612(_0x42d5f3[_0x4e0e('0x7b')][_0x4e0e('0x64')]));}_0xfc0dc2=_0x48d7b6[_0x4e0e('0x7c')]();_0x48d7b6['limit'](_0x2fefdf);_0x48d7b6[_0x4e0e('0x1c')](0x0);logger[_0x4e0e('0x7d')](_0x4e0e('0x7e'),_0x48d7b6[_0x4e0e('0x7f')]());return dbH[_0x4e0e('0x80')]['query'](_0x48d7b6[_0x4e0e('0x7f')](),{'type':dbH['sequelize'][_0x4e0e('0x81')]['SELECT']});}})[_0x4e0e('0x23')](respondWithResult(_0x40fc89,null))[_0x4e0e('0x45')](handleError(_0x40fc89,null));};function runReport(_0x3624d2,_0x574a43,_0x2eb55c){var _0x224f7d=_0x574a43[_0x4e0e('0x2a')];var _0x18bdd7=0xa;var _0x1599ec=[_0x4e0e('0x52'),_0x4e0e('0x82'),_0x4e0e('0x53'),_0x4e0e('0x83')];var _0x49ab51={'SUM':_0x4e0e('0x54'),'COUNT':_0x4e0e('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x4e0e('0x57'),'MIN':'MIN(%s)','AVG':_0x4e0e('0x84'),'GROUP_CONCAT':_0x4e0e('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4e0e('0x5b')};var _0x4cb6e2={'SEC_TO_TIME':_0x4e0e('0x5c'),'DATE':'DATE(%s)','HOUR':_0x4e0e('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4e0e('0x85')};var _0x1a3263=function(_0x4d4035){return!_['includes']([_0x4e0e('0x86'),_0x4e0e('0x5f'),_0x4e0e('0x60'),_0x4e0e('0x61')],_0x4d4035);};var _0x4ac8b5=function(_0x31ae3f){if(!_0x31ae3f||!_0x31ae3f[_0x4e0e('0x62')][_0x4e0e('0x38')]){return'';}for(var _0xd38b25='(',_0x509e49=0x0;_0x509e49<_0x31ae3f['rules'][_0x4e0e('0x38')];_0x509e49+=0x1){_0x509e49>0x0&&(_0xd38b25+='\x20'+_0x31ae3f[_0x4e0e('0x63')]+'\x20');_0xd38b25+=_0x31ae3f[_0x4e0e('0x62')][_0x509e49]['group']?_0x4ac8b5(_0x31ae3f[_0x4e0e('0x62')][_0x509e49][_0x4e0e('0x64')]):_0x31ae3f['rules'][_0x509e49][_0x4e0e('0x65')]+'\x20'+_0x31ae3f[_0x4e0e('0x62')][_0x509e49]['condition']+(_0x1a3263(_0x31ae3f['rules'][_0x509e49][_0x4e0e('0x66')])?'\x20'+_0x31ae3f['rules'][_0x509e49][_0x4e0e('0x67')]:'');}return _0xd38b25+')';};var _0x138421={'where':{'id':_0x3624d2['id']}},_0x7c8928,_0x49a356,_0x2f35cf,_0x26f141,_0x11350c;_0x138421=_[_0x4e0e('0x40')]({},_0x138421,_0x2eb55c);return db['AnalyticCustomReport'][_0x4e0e('0x47')](_0x138421)[_0x4e0e('0x23')](function(_0x593736){if(_0x593736){_0x7c8928=_0x593736;return _0x593736[_0x4e0e('0x68')]();}return null;})[_0x4e0e('0x23')](function(_0x33860d){if(_0x33860d){if(!_0x33860d[_0x4e0e('0x38')]){throw new db['Sequelize']['ValidationErrorItem'](_0x4e0e('0x87'),0x193);}_0x49a356=_0x33860d;return db[_0x4e0e('0x6a')][_0x4e0e('0x44')]({'raw':!![]});}return null;})['then'](function(_0x1f0b64){if(_0x1f0b64){_0x2f35cf=_['keyBy'](_0x1f0b64,'id');var _0xa98b2c;var _0x447469=squel['select']();_0x447469[_0x4e0e('0x6d')](_0x7c8928[_0x4e0e('0x6e')]);for(var _0x1984ed=0x0;_0x1984ed<_0x49a356[_0x4e0e('0x38')];_0x1984ed+=0x1){_0xa98b2c=_0x49a356[_0x1984ed][_0x4e0e('0x6f')]?_0x2f35cf[_0x49a356[_0x1984ed][_0x4e0e('0x6f')]]['metric']:_0x49a356[_0x1984ed][_0x4e0e('0x65')];_0xa98b2c=_0x49a356[_0x1984ed][_0x4e0e('0x70')]?_[_0x4e0e('0x88')](_0x49ab51[_0x49a356[_0x1984ed][_0x4e0e('0x70')]],'%s',_0xa98b2c):_0xa98b2c;_0xa98b2c=_0x49a356[_0x1984ed]['format']?_['replace'](_0x4cb6e2[_0x49a356[_0x1984ed]['format']],'%s',_0xa98b2c):_0xa98b2c;if(_0x49a356[_0x1984ed][_0x4e0e('0x89')]){_0x447469[_0x4e0e('0x64')](_0xa98b2c);}_0x49a356[_0x1984ed]['orderBy']&&_0x447469[_0x4e0e('0x3b')](_0xa98b2c,_0x49a356[_0x1984ed][_0x4e0e('0x72')]==='DESC'?![]:!![]);_0x447469[_0x4e0e('0x65')](_0xa98b2c,_0x49a356[_0x1984ed][_0x4e0e('0x8a')]||_0xa98b2c);}if(_0x7c8928['joins']){_0x7c8928[_0x4e0e('0x74')]=JSON['parse'](_0x7c8928[_0x4e0e('0x74')]);for(var _0x53d824=0x0;_0x53d824<_0x7c8928['joins'][_0x4e0e('0x38')];_0x53d824+=0x1){if(_0x7c8928['joins'][_0x53d824][_0x4e0e('0x2f')]&&_['includes'](_0x1599ec,_0x7c8928[_0x4e0e('0x74')][_0x53d824]['type'])&&_0x7c8928[_0x4e0e('0x74')][_0x53d824][_0x4e0e('0x7a')]&&_0x7c8928[_0x4e0e('0x74')][_0x53d824][_0x4e0e('0x77')]&&_0x7c8928[_0x4e0e('0x74')][_0x53d824][_0x4e0e('0x78')]){_0x447469[_0x7c8928['joins'][_0x53d824]['type']](_0x7c8928[_0x4e0e('0x74')][_0x53d824][_0x4e0e('0x77')],null,util[_0x4e0e('0x71')](_0x4e0e('0x79'),_0x7c8928[_0x4e0e('0x6e')],_0x7c8928[_0x4e0e('0x74')][_0x53d824]['parentKey'],_0x7c8928[_0x4e0e('0x74')][_0x53d824][_0x4e0e('0x77')],_0x7c8928[_0x4e0e('0x74')][_0x53d824][_0x4e0e('0x78')]));}}}if(_0x7c8928[_0x4e0e('0x7b')]){_0x7c8928[_0x4e0e('0x7b')]=JSON['parse'](_0x7c8928[_0x4e0e('0x7b')]);_0x447469[_0x4e0e('0x3d')](_0x4ac8b5(_0x7c8928[_0x4e0e('0x7b')][_0x4e0e('0x64')]));}_0x11350c=_0x447469['clone']();_0x447469['limit'](_0x18bdd7);_0x447469[_0x4e0e('0x1c')](0x0);return;}})[_0x4e0e('0x23')](function(){if(_0x574a43[_0x4e0e('0x8b')]==='web'){return null;}var _0x149f36=_[_0x4e0e('0x40')](_0x574a43,{'name':_0x574a43[_0x4e0e('0x8c')]||_0x574a43[_0x4e0e('0x2a')]||_0x7c8928[_0x4e0e('0x2a')],'basename':_0x224f7d,'savename':util[_0x4e0e('0x71')]('%s-%s.%s',_0x574a43[_0x4e0e('0x2a')]||_0x7c8928[_0x4e0e('0x2a')],require('randomstring')['generate'](0x4),_0x574a43[_0x4e0e('0x8b')]||_0x4e0e('0x8d')),'reportId':_0x7c8928['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x4e0e('0x48')](_0x149f36,{'raw':!![]});})[_0x4e0e('0x23')](function(_0x24daf0){if(_0x7c8928['table']==='cdr'){_0x11350c[_0x4e0e('0x3d')](_0x7c8928[_0x4e0e('0x6e')]+_0x4e0e('0x8e'),_0x574a43['startDate'],_0x574a43[_0x4e0e('0x8f')]);}else{_0x11350c[_0x4e0e('0x3d')](_0x7c8928[_0x4e0e('0x6e')]+_0x4e0e('0x90'),_0x574a43[_0x4e0e('0x91')],_0x574a43['endDate']);}if(_0x24daf0){logger[_0x4e0e('0x92')]('Run\x20Query:',_0x11350c[_0x4e0e('0x7f')]());require(_0x4e0e('0x93'))[_0x4e0e('0x94')](path[_0x4e0e('0x52')](__dirname,_0x4e0e('0x95'),_0x24daf0['output']),[_0x24daf0['id'],_0x11350c[_0x4e0e('0x7f')](),path['join'](__dirname,_0x4e0e('0x96'),_0x24daf0[_0x4e0e('0x97')]),_0x224f7d]);return _0x24daf0;}else{var _0x131641=squel[_0x4e0e('0x6c')]();_0x131641[_0x4e0e('0x6d')]('('+_0x11350c['toString']()+')',_0x4e0e('0x98'));_0x131641[_0x4e0e('0x65')](_0x4e0e('0x99'),_0x4e0e('0x1b'));_0x11350c[_0x4e0e('0x1d')](_0x574a43[_0x4e0e('0x1d')]||_0x18bdd7);_0x11350c[_0x4e0e('0x1c')](_0x574a43[_0x4e0e('0x1c')]||0x0);return dbH[_0x4e0e('0x80')][_0x4e0e('0x32')](_0x131641['toString'](),{'type':dbH[_0x4e0e('0x80')][_0x4e0e('0x81')][_0x4e0e('0x9a')]})[_0x4e0e('0x23')](function(_0xd3c7a0){if(!_0xd3c7a0[_0x4e0e('0x38')]){_0x26f141=0x0;}else{_0x26f141=_0xd3c7a0[0x0][_0x4e0e('0x1b')]||0x0;}return dbH[_0x4e0e('0x80')][_0x4e0e('0x32')](_0x11350c['toString'](),{'type':dbH['sequelize'][_0x4e0e('0x81')][_0x4e0e('0x9a')]});})[_0x4e0e('0x23')](function(_0xd2bdfb){return{'rows':_0xd2bdfb||[],'count':_0x26f141};});}});}exports[_0x4e0e('0x9b')]=function(_0x1ea203,_0x39c345){return runReport(_0x1ea203[_0x4e0e('0x46')],_0x1ea203[_0x4e0e('0x32')],_0x1ea203[_0x4e0e('0x41')])[_0x4e0e('0x23')](respondWithResult(_0x39c345,null))[_0x4e0e('0x45')](handleError(_0x39c345,null));};exports['runReport']=runReport;exports[_0x4e0e('0x32')]=function(_0x44b370,_0x508c31){var _0x57f554=0xa;var _0x341269=[_0x4e0e('0x52'),_0x4e0e('0x82'),'right_join',_0x4e0e('0x83')];var _0x335571={'SUM':'SUM(%s)','COUNT':_0x4e0e('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4e0e('0x84'),'GROUP_CONCAT':_0x4e0e('0x59'),'GROUP_CONCAT ASC':_0x4e0e('0x5a'),'GROUP_CONCAT DESC':_0x4e0e('0x5b')};var _0x26f5b3={'SEC_TO_TIME':_0x4e0e('0x5c'),'DATE':_0x4e0e('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0x4e0e('0x9c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5a96f=function(_0x30a625){return!_[_0x4e0e('0x76')]([_0x4e0e('0x86'),_0x4e0e('0x5f'),_0x4e0e('0x60'),_0x4e0e('0x61')],_0x30a625);};var _0x4ec8ff=function(_0xd0f86a){if(!_0xd0f86a||!_0xd0f86a[_0x4e0e('0x62')][_0x4e0e('0x38')]){return'';}for(var _0x42b1cb='(',_0x45516b=0x0;_0x45516b<_0xd0f86a['rules'][_0x4e0e('0x38')];_0x45516b+=0x1){_0x45516b>0x0&&(_0x42b1cb+='\x20'+_0xd0f86a['operator']+'\x20');_0x42b1cb+=_0xd0f86a[_0x4e0e('0x62')][_0x45516b][_0x4e0e('0x64')]?_0x4ec8ff(_0xd0f86a[_0x4e0e('0x62')][_0x45516b][_0x4e0e('0x64')]):_0xd0f86a[_0x4e0e('0x62')][_0x45516b]['field']+'\x20'+_0xd0f86a['rules'][_0x45516b][_0x4e0e('0x66')]+(_0x5a96f(_0xd0f86a[_0x4e0e('0x62')][_0x45516b]['condition'])?'\x20'+_0xd0f86a['rules'][_0x45516b][_0x4e0e('0x67')]:'');}return _0x42b1cb+')';};var _0x468984={'where':{'id':_0x44b370['params']['id']}},_0x13745d,_0x5d29b1,_0x1efdcc,_0x51251f,_0x1e1d7d;_0x468984=_[_0x4e0e('0x40')]({},_0x468984,_0x44b370[_0x4e0e('0x41')]);return db[_0x4e0e('0x2c')][_0x4e0e('0x47')](_0x468984)[_0x4e0e('0x23')](function(_0x304cce){if(_0x304cce){_0x13745d=_0x304cce;return _0x304cce[_0x4e0e('0x68')]();}return null;})[_0x4e0e('0x23')](function(_0x4eb60d){if(_0x4eb60d){if(!_0x4eb60d[_0x4e0e('0x38')]){throw new db[(_0x4e0e('0x9d'))]['ValidationErrorItem'](_0x4e0e('0x87'),0x193);}_0x5d29b1=_0x4eb60d;return db[_0x4e0e('0x6a')][_0x4e0e('0x44')]({'raw':!![]});}return null;})[_0x4e0e('0x23')](function(_0xb8430b){if(_0xb8430b){_0x1efdcc=_[_0x4e0e('0x6b')](_0xb8430b,'id');var _0x5b912f;var _0x1534fb=squel[_0x4e0e('0x6c')]();_0x1534fb[_0x4e0e('0x6d')](_0x13745d[_0x4e0e('0x6e')]);for(var _0x206595=0x0;_0x206595<_0x5d29b1[_0x4e0e('0x38')];_0x206595+=0x1){_0x5b912f=_0x5d29b1[_0x206595][_0x4e0e('0x6f')]?_0x1efdcc[_0x5d29b1[_0x206595][_0x4e0e('0x6f')]][_0x4e0e('0x9e')]:_0x5d29b1[_0x206595][_0x4e0e('0x65')];_0x5b912f=_0x5d29b1[_0x206595][_0x4e0e('0x70')]?_['replace'](_0x335571[_0x5d29b1[_0x206595][_0x4e0e('0x70')]],'%s',_0x5b912f):_0x5b912f;_0x5b912f=_0x5d29b1[_0x206595][_0x4e0e('0x71')]?_[_0x4e0e('0x88')](_0x26f5b3[_0x5d29b1[_0x206595][_0x4e0e('0x71')]],'%s',_0x5b912f):_0x5b912f;if(_0x5d29b1[_0x206595][_0x4e0e('0x89')]){_0x1534fb[_0x4e0e('0x64')](_0x5b912f);}_0x5d29b1[_0x206595][_0x4e0e('0x72')]&&_0x1534fb[_0x4e0e('0x3b')](_0x5b912f,_0x5d29b1[_0x206595][_0x4e0e('0x72')]==='DESC'?![]:!![]);_0x1534fb['field'](_0x5b912f,_0x5d29b1[_0x206595][_0x4e0e('0x8a')]||_0x5b912f);}if(_0x13745d[_0x4e0e('0x74')]){_0x13745d[_0x4e0e('0x74')]=JSON[_0x4e0e('0x75')](_0x13745d[_0x4e0e('0x74')]);for(var _0x457392=0x0;_0x457392<_0x13745d[_0x4e0e('0x74')]['length'];_0x457392+=0x1){if(_0x13745d['joins'][_0x457392][_0x4e0e('0x2f')]&&_[_0x4e0e('0x76')](_0x341269,_0x13745d[_0x4e0e('0x74')][_0x457392][_0x4e0e('0x2f')])&&_0x13745d[_0x4e0e('0x74')][_0x457392][_0x4e0e('0x7a')]&&_0x13745d['joins'][_0x457392][_0x4e0e('0x77')]&&_0x13745d[_0x4e0e('0x74')][_0x457392][_0x4e0e('0x78')]){_0x1534fb[_0x13745d[_0x4e0e('0x74')][_0x457392]['type']](_0x13745d[_0x4e0e('0x74')][_0x457392][_0x4e0e('0x77')],null,util['format'](_0x4e0e('0x79'),_0x13745d[_0x4e0e('0x6e')],_0x13745d['joins'][_0x457392][_0x4e0e('0x7a')],_0x13745d[_0x4e0e('0x74')][_0x457392][_0x4e0e('0x77')],_0x13745d[_0x4e0e('0x74')][_0x457392][_0x4e0e('0x78')]));}}}if(_0x13745d['conditions']){_0x13745d[_0x4e0e('0x7b')]=JSON[_0x4e0e('0x75')](_0x13745d[_0x4e0e('0x7b')]);_0x1534fb['where'](_0x4ec8ff(_0x13745d['conditions'][_0x4e0e('0x64')]));}_0x1e1d7d=_0x1534fb[_0x4e0e('0x7c')]();_0x1534fb[_0x4e0e('0x1d')](_0x57f554);_0x1534fb[_0x4e0e('0x1c')](0x0);logger[_0x4e0e('0x7d')](_0x4e0e('0x7e'),_0x1534fb[_0x4e0e('0x7f')]());return dbH[_0x4e0e('0x80')][_0x4e0e('0x32')](_0x1534fb[_0x4e0e('0x7f')](),{'type':dbH[_0x4e0e('0x80')][_0x4e0e('0x81')][_0x4e0e('0x9a')]});}})[_0x4e0e('0x23')](function(){return{'sql':_0x1e1d7d[_0x4e0e('0x7f')]()};})['then'](respondWithResult(_0x508c31,null))['catch'](handleError(_0x508c31,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 8a2c8a1..71f3e91 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 _0xa583=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment','bluebird'];(function(_0x3ff5de,_0x1c0844){var _0x323b7a=function(_0x14fd47){while(--_0x14fd47){_0x3ff5de['push'](_0x3ff5de['shift']());}};_0x323b7a(++_0x1c0844);}(_0xa583,0x14d));var _0x3a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa583[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3a58('0x0'));var logger=require(_0x3a58('0x1'))(_0x3a58('0x2'));var moment=require(_0x3a58('0x3'));var BPromise=require(_0x3a58('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a58('0x5'));var rimraf=require(_0x3a58('0x6'));var config=require(_0x3a58('0x7'));var attributes=require(_0x3a58('0x8'));module[_0x3a58('0x9')]=function(_0x1d26e4,_0x15e42e){return _0x1d26e4[_0x3a58('0xa')](_0x3a58('0xb'),attributes,{'tableName':_0x3a58('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9750=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','request-promise','path','./analyticCustomReport.attributes','exports','define'];(function(_0x54e7cd,_0x58ab5){var _0x410f18=function(_0x33f7d1){while(--_0x33f7d1){_0x54e7cd['push'](_0x54e7cd['shift']());}};_0x410f18(++_0x58ab5);}(_0x9750,0x156));var _0x0975=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9750[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0975('0x0'));var util=require(_0x0975('0x1'));var logger=require(_0x0975('0x2'))(_0x0975('0x3'));var moment=require(_0x0975('0x4'));var BPromise=require('bluebird');var rp=require(_0x0975('0x5'));var fs=require('fs');var path=require(_0x0975('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0975('0x7'));module[_0x0975('0x8')]=function(_0x5a1aac,_0x3df05a){return _0x5a1aac[_0x0975('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x0975('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 460bba0..df04631 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 _0x1e01=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','lodash','util','moment','randomstring','ioredis'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x1e01,0xd7));var _0x11e0=function(_0x3f2355,_0x2ce267){_0x3f2355=_0x3f2355-0x0;var _0x3f622c=_0x1e01[_0x3f2355];return _0x3f622c;};'use strict';var _=require(_0x11e0('0x0'));var util=require(_0x11e0('0x1'));var moment=require(_0x11e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x11e0('0x3'));var fs=require('fs');var Redis=require(_0x11e0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x11e0('0x5'));var logger=require(_0x11e0('0x6'))(_0x11e0('0x7'));var config=require(_0x11e0('0x8'));var jayson=require(_0x11e0('0x9'));var client=jayson[_0x11e0('0xa')][_0x11e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1cf6b4,_0x27b6c7,_0x379780){return new BPromise(function(_0x3ea9ab,_0x58c419){return client[_0x11e0('0xc')](_0x1cf6b4,_0x379780)[_0x11e0('0xd')](function(_0x35369e){logger['info'](_0x11e0('0xe'),_0x27b6c7,_0x11e0('0xf'));logger[_0x11e0('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x27b6c7,_0x11e0('0xf'),JSON[_0x11e0('0x11')](_0x35369e));if(_0x35369e[_0x11e0('0x12')]){if(_0x35369e[_0x11e0('0x12')]['code']===0x1f4){logger[_0x11e0('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x27b6c7,_0x35369e['error'][_0x11e0('0x13')]);return _0x58c419(_0x35369e[_0x11e0('0x12')][_0x11e0('0x13')]);}logger[_0x11e0('0x12')](_0x11e0('0xe'),_0x27b6c7,_0x35369e[_0x11e0('0x12')]['message']);return _0x3ea9ab(_0x35369e[_0x11e0('0x12')][_0x11e0('0x13')]);}else{logger[_0x11e0('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0x27b6c7,_0x11e0('0xf'));_0x3ea9ab(_0x35369e[_0x11e0('0x15')][_0x11e0('0x13')]);}})['catch'](function(_0x4d36d7){logger[_0x11e0('0x12')](_0x11e0('0xe'),_0x27b6c7,_0x4d36d7);_0x58c419(_0x4d36d7);});});}
\ No newline at end of file
+var _0x36de=['rpc','../../config/environment','jayson/promise','client','http','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x14b0f4,_0x4b32e2){var _0x8e120e=function(_0xbf796a){while(--_0xbf796a){_0x14b0f4['push'](_0x14b0f4['shift']());}};_0x8e120e(++_0x4b32e2);}(_0x36de,0x186));var _0xe36d=function(_0x141abe,_0xf01280){_0x141abe=_0x141abe-0x0;var _0x5ee689=_0x36de[_0x141abe];return _0x5ee689;};'use strict';var _=require(_0xe36d('0x0'));var util=require('util');var moment=require(_0xe36d('0x1'));var BPromise=require(_0xe36d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe36d('0x3'))['db'];var utils=require(_0xe36d('0x4'));var logger=require(_0xe36d('0x5'))(_0xe36d('0x6'));var config=require(_0xe36d('0x7'));var jayson=require(_0xe36d('0x8'));var client=jayson[_0xe36d('0x9')][_0xe36d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x514f03,_0x22d73d,_0x55b7ac){return new BPromise(function(_0xa8c7e7,_0x1d185c){return client['request'](_0x514f03,_0x55b7ac)['then'](function(_0x1600ec){logger[_0xe36d('0xb')](_0xe36d('0xc'),_0x22d73d,'request\x20sent');logger[_0xe36d('0xd')](_0xe36d('0xe'),_0x22d73d,_0xe36d('0xf'),JSON[_0xe36d('0x10')](_0x1600ec));if(_0x1600ec[_0xe36d('0x11')]){if(_0x1600ec[_0xe36d('0x11')][_0xe36d('0x12')]===0x1f4){logger[_0xe36d('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x22d73d,_0x1600ec['error'][_0xe36d('0x13')]);return _0x1d185c(_0x1600ec[_0xe36d('0x11')]['message']);}logger[_0xe36d('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x22d73d,_0x1600ec[_0xe36d('0x11')][_0xe36d('0x13')]);return _0xa8c7e7(_0x1600ec[_0xe36d('0x11')][_0xe36d('0x13')]);}else{logger[_0xe36d('0xb')](_0xe36d('0xc'),_0x22d73d,_0xe36d('0xf'));_0xa8c7e7(_0x1600ec[_0xe36d('0x14')][_0xe36d('0x13')]);}})[_0xe36d('0x15')](function(_0x1de21a){logger['error'](_0xe36d('0xc'),_0x22d73d,_0x1de21a);_0x1d185c(_0x1de21a);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index f0833d0..ef532c5 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 _0x4e6d=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','exports','multer'];(function(_0x5bd677,_0x4341b0){var _0x2dbd6a=function(_0x3d7a8a){while(--_0x3d7a8a){_0x5bd677['push'](_0x5bd677['shift']());}};_0x2dbd6a(++_0x4341b0);}(_0x4e6d,0xf2));var _0xd4e6=function(_0x3e4285,_0x83a4f0){_0x3e4285=_0x3e4285-0x0;var _0xce09e7=_0x4e6d[_0x3e4285];return _0xce09e7;};'use strict';var multer=require(_0xd4e6('0x0'));var util=require(_0xd4e6('0x1'));var path=require(_0xd4e6('0x2'));var timeout=require(_0xd4e6('0x3'));var express=require(_0xd4e6('0x4'));var router=express[_0xd4e6('0x5')]();var fs_extra=require(_0xd4e6('0x6'));var auth=require(_0xd4e6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd4e6('0x8'));var controller=require(_0xd4e6('0x9'));router['get']('/',auth[_0xd4e6('0xa')](),controller[_0xd4e6('0xb')]);router[_0xd4e6('0xc')](_0xd4e6('0xd'),auth['isAuthenticated'](),controller[_0xd4e6('0xe')]);router[_0xd4e6('0xc')](_0xd4e6('0xf'),auth['isAuthenticated'](),controller[_0xd4e6('0x10')]);router[_0xd4e6('0xc')](_0xd4e6('0x11'),auth[_0xd4e6('0xa')](),controller[_0xd4e6('0x12')]);router[_0xd4e6('0xc')](_0xd4e6('0x13'),auth[_0xd4e6('0xa')](),controller['query']);router[_0xd4e6('0x14')]('/',auth['isAuthenticated'](),controller[_0xd4e6('0x15')]);router[_0xd4e6('0x16')](_0xd4e6('0xd'),auth[_0xd4e6('0xa')](),controller[_0xd4e6('0x17')]);router[_0xd4e6('0x18')](_0xd4e6('0xd'),auth['isAuthenticated'](),controller[_0xd4e6('0x19')]);module[_0xd4e6('0x1a')]=router;
\ No newline at end of file
+var _0xacb3=['/:id','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','update','delete','destroy','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0xd24b43,_0x11caa4){var _0x2b1b44=function(_0x5b84af){while(--_0x5b84af){_0xd24b43['push'](_0xd24b43['shift']());}};_0x2b1b44(++_0x11caa4);}(_0xacb3,0x90));var _0x3acb=function(_0x550a61,_0x1c5d8c){_0x550a61=_0x550a61-0x0;var _0x248bfc=_0xacb3[_0x550a61];return _0x248bfc;};'use strict';var multer=require(_0x3acb('0x0'));var util=require(_0x3acb('0x1'));var path=require(_0x3acb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3acb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3acb('0x4'));var config=require(_0x3acb('0x5'));var controller=require(_0x3acb('0x6'));router[_0x3acb('0x7')]('/',auth[_0x3acb('0x8')](),controller[_0x3acb('0x9')]);router[_0x3acb('0x7')](_0x3acb('0xa'),auth[_0x3acb('0x8')](),controller['show']);router[_0x3acb('0x7')](_0x3acb('0xb'),auth['isAuthenticated'](),controller[_0x3acb('0xc')]);router[_0x3acb('0x7')](_0x3acb('0xd'),auth[_0x3acb('0x8')](),controller['run']);router[_0x3acb('0x7')](_0x3acb('0xe'),auth[_0x3acb('0x8')](),controller[_0x3acb('0xf')]);router[_0x3acb('0x10')]('/',auth['isAuthenticated'](),controller[_0x3acb('0x11')]);router[_0x3acb('0x12')](_0x3acb('0xa'),auth['isAuthenticated'](),controller[_0x3acb('0x13')]);router[_0x3acb('0x14')](_0x3acb('0xa'),auth[_0x3acb('0x8')](),controller[_0x3acb('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 7c69e35..de3b8b9 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x36979f,_0x2b8951){var _0x462c6d=function(_0x3e8027){while(--_0x3e8027){_0x36979f['push'](_0x36979f['shift']());}};_0x462c6d(++_0x2b8951);}(_0x7217,0x19e));var _0x7721=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x7217[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x2460df,_0xc9e7d9){var _0x5b5cd1=function(_0x3d2d32){while(--_0x3d2d32){_0x2460df['push'](_0x2460df['shift']());}};_0x5b5cd1(++_0xc9e7d9);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 094b1b2..c0147d1 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 _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x2ef3,0xba));var _0x32ef=function(_0x5eccb6,_0x3c4f00){_0x5eccb6=_0x5eccb6-0x0;var _0x5ab220=_0x2ef3[_0x5eccb6];return _0x5ab220;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));};
\ No newline at end of file
+var _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x4bd89a,_0x55a58f){var _0x35454f=function(_0x512f23){while(--_0x512f23){_0x4bd89a['push'](_0x4bd89a['shift']());}};_0x35454f(++_0x55a58f);}(_0xf494,0x1c6));var _0x4f49=function(_0x2f023d,_0x4ea17a){_0x2f023d=_0x2f023d-0x0;var _0x17557d=_0xf494[_0x2f023d];return _0x17557d;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 8c16589..8d93638 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 _0x3abf=['request-promise','path','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','api','moment','bluebird'];(function(_0x2be9a5,_0x1363e5){var _0x3b07a4=function(_0x58b56b){while(--_0x58b56b){_0x2be9a5['push'](_0x2be9a5['shift']());}};_0x3b07a4(++_0x1363e5);}(_0x3abf,0x15c));var _0xf3ab=function(_0x217838,_0x43466a){_0x217838=_0x217838-0x0;var _0x4ae0fd=_0x3abf[_0x217838];return _0x4ae0fd;};'use strict';var _=require('lodash');var util=require(_0xf3ab('0x0'));var logger=require('../../config/logger')(_0xf3ab('0x1'));var moment=require(_0xf3ab('0x2'));var BPromise=require(_0xf3ab('0x3'));var rp=require(_0xf3ab('0x4'));var fs=require('fs');var path=require(_0xf3ab('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf3ab('0x6'));module[_0xf3ab('0x7')]=function(_0x110652,_0x21eb54){return _0x110652[_0xf3ab('0x8')](_0xf3ab('0x9'),attributes,{'tableName':_0xf3ab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ddf=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ddf,0xa1));var _0xf8dd=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x8ddf[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0xf8dd('0x0'));var util=require('util');var logger=require(_0xf8dd('0x1'))('api');var moment=require(_0xf8dd('0x2'));var BPromise=require(_0xf8dd('0x3'));var rp=require(_0xf8dd('0x4'));var fs=require('fs');var path=require(_0xf8dd('0x5'));var rimraf=require(_0xf8dd('0x6'));var config=require(_0xf8dd('0x7'));var attributes=require(_0xf8dd('0x8'));module[_0xf8dd('0x9')]=function(_0x5ed349,_0x442677){return _0x5ed349[_0xf8dd('0xa')](_0xf8dd('0xb'),attributes,{'tableName':_0xf8dd('0xc'),'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 cd87234..e2a56cf 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 _0xb210=['../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1f641b,_0x2f15a1){var _0x2fb99b=function(_0x2f1ab2){while(--_0x2f1ab2){_0x1f641b['push'](_0x1f641b['shift']());}};_0x2fb99b(++_0x2f15a1);}(_0xb210,0x19d));var _0x0b21=function(_0x2a8d9d,_0x11e582){_0x2a8d9d=_0x2a8d9d-0x0;var _0x451659=_0xb210[_0x2a8d9d];return _0x451659;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0b21('0x0'));var rs=require(_0x0b21('0x1'));var fs=require('fs');var Redis=require(_0x0b21('0x2'));var db=require(_0x0b21('0x3'))['db'];var utils=require(_0x0b21('0x4'));var logger=require(_0x0b21('0x5'))('rpc');var config=require(_0x0b21('0x6'));var jayson=require(_0x0b21('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29a25f,_0xdab92b,_0x295d47){return new BPromise(function(_0x4864ed,_0x5f4565){return client[_0x0b21('0x8')](_0x29a25f,_0x295d47)[_0x0b21('0x9')](function(_0x15f639){logger[_0x0b21('0xa')](_0x0b21('0xb'),_0xdab92b,_0x0b21('0xc'));logger[_0x0b21('0xd')](_0x0b21('0xe'),_0xdab92b,'request\x20sent',JSON['stringify'](_0x15f639));if(_0x15f639[_0x0b21('0xf')]){if(_0x15f639['error'][_0x0b21('0x10')]===0x1f4){logger[_0x0b21('0xf')](_0x0b21('0xb'),_0xdab92b,_0x15f639['error'][_0x0b21('0x11')]);return _0x5f4565(_0x15f639['error'][_0x0b21('0x11')]);}logger[_0x0b21('0xf')](_0x0b21('0xb'),_0xdab92b,_0x15f639[_0x0b21('0xf')][_0x0b21('0x11')]);return _0x4864ed(_0x15f639['error']['message']);}else{logger['info'](_0x0b21('0xb'),_0xdab92b,_0x0b21('0xc'));_0x4864ed(_0x15f639[_0x0b21('0x12')][_0x0b21('0x11')]);}})['catch'](function(_0x5cc436){logger[_0x0b21('0xf')](_0x0b21('0xb'),_0xdab92b,_0x5cc436);_0x5f4565(_0x5cc436);});});}
\ No newline at end of file
+var _0x7d25=['stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x378222,_0x23ee64){var _0x4dc43f=function(_0xa074ac){while(--_0xa074ac){_0x378222['push'](_0x378222['shift']());}};_0x4dc43f(++_0x23ee64);}(_0x7d25,0x10d));var _0x57d2=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x7d25[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0x57d2('0x0'));var util=require(_0x57d2('0x1'));var moment=require(_0x57d2('0x2'));var BPromise=require(_0x57d2('0x3'));var rs=require(_0x57d2('0x4'));var fs=require('fs');var Redis=require(_0x57d2('0x5'));var db=require(_0x57d2('0x6'))['db'];var utils=require(_0x57d2('0x7'));var logger=require('../../config/logger')(_0x57d2('0x8'));var config=require(_0x57d2('0x9'));var jayson=require(_0x57d2('0xa'));var client=jayson[_0x57d2('0xb')][_0x57d2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32b1ce,_0x4ed5aa,_0x2baef3){return new BPromise(function(_0x4f82f2,_0x5d1b72){return client[_0x57d2('0xd')](_0x32b1ce,_0x2baef3)[_0x57d2('0xe')](function(_0x16bd33){logger[_0x57d2('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4ed5aa,_0x57d2('0x10'));logger[_0x57d2('0x11')](_0x57d2('0x12'),_0x4ed5aa,'request\x20sent',JSON[_0x57d2('0x13')](_0x16bd33));if(_0x16bd33['error']){if(_0x16bd33[_0x57d2('0x14')]['code']===0x1f4){logger['error'](_0x57d2('0x15'),_0x4ed5aa,_0x16bd33['error'][_0x57d2('0x16')]);return _0x5d1b72(_0x16bd33[_0x57d2('0x14')][_0x57d2('0x16')]);}logger[_0x57d2('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4ed5aa,_0x16bd33[_0x57d2('0x14')][_0x57d2('0x16')]);return _0x4f82f2(_0x16bd33[_0x57d2('0x14')]['message']);}else{logger['info'](_0x57d2('0x15'),_0x4ed5aa,_0x57d2('0x10'));_0x4f82f2(_0x16bd33['result'][_0x57d2('0x16')]);}})[_0x57d2('0x17')](function(_0x156800){logger['error'](_0x57d2('0x15'),_0x4ed5aa,_0x156800);_0x5d1b72(_0x156800);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 657f98f..47c83ee 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 _0xaa65=['get','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','index'];(function(_0x141993,_0x5cd8c2){var _0x55203a=function(_0x1797cd){while(--_0x1797cd){_0x141993['push'](_0x141993['shift']());}};_0x55203a(++_0x5cd8c2);}(_0xaa65,0x108));var _0x5aa6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa65[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x5aa6('0x0'));var util=require(_0x5aa6('0x1'));var path=require(_0x5aa6('0x2'));var timeout=require(_0x5aa6('0x3'));var express=require('express');var router=express[_0x5aa6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5aa6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5aa6('0x6'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x5aa6('0x7')](),controller[_0x5aa6('0x8')]);router[_0x5aa6('0x9')](_0x5aa6('0xa'),auth[_0x5aa6('0x7')](),controller[_0x5aa6('0xb')]);router[_0x5aa6('0x9')](_0x5aa6('0xc'),auth[_0x5aa6('0x7')](),controller[_0x5aa6('0xd')]);router[_0x5aa6('0x9')](_0x5aa6('0xe'),auth[_0x5aa6('0x7')](),controller['run']);router['get'](_0x5aa6('0xf'),auth[_0x5aa6('0x7')](),controller[_0x5aa6('0x10')]);router[_0x5aa6('0x11')]('/',auth[_0x5aa6('0x7')](),controller[_0x5aa6('0x12')]);router['put'](_0x5aa6('0xa'),auth[_0x5aa6('0x7')](),controller[_0x5aa6('0x13')]);router['delete'](_0x5aa6('0xa'),auth[_0x5aa6('0x7')](),controller['destroy']);module[_0x5aa6('0x14')]=router;
\ No newline at end of file
+var _0xa7be=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy'];(function(_0x2b743c,_0x315030){var _0x41de89=function(_0xc11f6a){while(--_0xc11f6a){_0x2b743c['push'](_0x2b743c['shift']());}};_0x41de89(++_0x315030);}(_0xa7be,0xfd));var _0xea7b=function(_0x5d58c8,_0x4eab3c){_0x5d58c8=_0x5d58c8-0x0;var _0xfbbd9c=_0xa7be[_0x5d58c8];return _0xfbbd9c;};'use strict';var multer=require(_0xea7b('0x0'));var util=require(_0xea7b('0x1'));var path=require(_0xea7b('0x2'));var timeout=require(_0xea7b('0x3'));var express=require(_0xea7b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xea7b('0x5'));var interaction=require(_0xea7b('0x6'));var config=require(_0xea7b('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xea7b('0x8')]('/',auth[_0xea7b('0x9')](),controller[_0xea7b('0xa')]);router[_0xea7b('0x8')](_0xea7b('0xb'),auth[_0xea7b('0x9')](),controller[_0xea7b('0xc')]);router[_0xea7b('0x8')](_0xea7b('0xd'),auth[_0xea7b('0x9')](),controller['preview']);router[_0xea7b('0x8')](_0xea7b('0xe'),auth[_0xea7b('0x9')](),controller[_0xea7b('0xf')]);router['get'](_0xea7b('0x10'),auth[_0xea7b('0x9')](),controller['query']);router[_0xea7b('0x11')]('/',auth[_0xea7b('0x9')](),controller[_0xea7b('0x12')]);router[_0xea7b('0x13')](_0xea7b('0xb'),auth[_0xea7b('0x9')](),controller[_0xea7b('0x14')]);router[_0xea7b('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xea7b('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 3a0e9b4..1d0143e 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 _0xcb6b=['csv','DATE','scheduled','manual','UNSIGNED','sequelize','moment','exports','STRING','pdf'];(function(_0x243d54,_0x116cc8){var _0x18bb09=function(_0x3cde25){while(--_0x3cde25){_0x243d54['push'](_0x243d54['shift']());}};_0x18bb09(++_0x116cc8);}(_0xcb6b,0x11d));var _0xbcb6=function(_0x2e20f4,_0x410781){_0x2e20f4=_0x2e20f4-0x0;var _0x2d98f1=_0xcb6b[_0x2e20f4];return _0x2d98f1;};'use strict';var Sequelize=require(_0xbcb6('0x0'));var moment=require(_0xbcb6('0x1'));module[_0xbcb6('0x2')]={'name':{'type':Sequelize[_0xbcb6('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xbcb6('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xbcb6('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0xbcb6('0x5')},'savename':{'type':Sequelize[_0xbcb6('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xbcb6('0x6')]},'endDate':{'type':Sequelize[_0xbcb6('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0xbcb6('0x7')),'allowNull':![],'defaultValue':_0xbcb6('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xbcb6('0x9')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7224=['UNSIGNED','sequelize','exports','STRING','ENUM','csv','pdf','xlsx','DATE','scheduled','manual','INTEGER'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0x7224,0xa9));var _0x4722=function(_0x4b5dbf,_0x286263){_0x4b5dbf=_0x4b5dbf-0x0;var _0x1a202d=_0x7224[_0x4b5dbf];return _0x1a202d;};'use strict';var Sequelize=require(_0x4722('0x0'));var moment=require('moment');module[_0x4722('0x1')]={'name':{'type':Sequelize[_0x4722('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x4722('0x3')](_0x4722('0x4'),_0x4722('0x5'),_0x4722('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x4722('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x4722('0x7')]},'endDate':{'type':Sequelize[_0x4722('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x4722('0x3')]('manual',_0x4722('0x8')),'allowNull':![],'defaultValue':_0x4722('0x9')},'reportId':{'type':Sequelize[_0x4722('0xa')](0xb)[_0x4722('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 2496332..8309630 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 _0x72da=['end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','ExtractedReports','error','stack','name','send','index','map','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','AnalyticExtractedReport','includeAll','findAll','rows','catch','show','params','keys','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status'];(function(_0x3e9c60,_0x4582ae){var _0x569f61=function(_0x43db1a){while(--_0x43db1a){_0x3e9c60['push'](_0x3e9c60['shift']());}};_0x569f61(++_0x4582ae);}(_0x72da,0x15d));var _0xa72d=function(_0x4d8764,_0xd13d7b){_0x4d8764=_0x4d8764-0x0;var _0x4e0b49=_0x72da[_0x4d8764];return _0x4e0b49;};'use strict';var emlformat=require(_0xa72d('0x0'));var rimraf=require(_0xa72d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa72d('0x2'));var rp=require(_0xa72d('0x3'));var moment=require(_0xa72d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa72d('0x5'));var util=require(_0xa72d('0x6'));var path=require(_0xa72d('0x7'));var sox=require(_0xa72d('0x8'));var csv=require(_0xa72d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa72d('0xa'));var _=require(_0xa72d('0xb'));var squel=require(_0xa72d('0xc'));var crypto=require(_0xa72d('0xd'));var jsforce=require(_0xa72d('0xe'));var deskjs=require(_0xa72d('0xf'));var toCsv=require(_0xa72d('0x9'));var querystring=require('querystring');var Papa=require(_0xa72d('0x10'));var Redis=require(_0xa72d('0x11'));var authService=require(_0xa72d('0x12'));var qs=require(_0xa72d('0x13'));var as=require(_0xa72d('0x14'));var hardwareService=require(_0xa72d('0x15'));var logger=require(_0xa72d('0x16'))(_0xa72d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa72d('0x18'))['db'];function respondWithStatusCode(_0x1f7ef7,_0x2b4d73){_0x2b4d73=_0x2b4d73||0xcc;return function(_0xf6cff2){if(_0xf6cff2){return _0x1f7ef7[_0xa72d('0x19')](_0x2b4d73);}return _0x1f7ef7[_0xa72d('0x1a')](_0x2b4d73)[_0xa72d('0x1b')]();};}function respondWithResult(_0x33b831,_0x58c626){_0x58c626=_0x58c626||0xc8;return function(_0x346bcf){if(_0x346bcf){return _0x33b831[_0xa72d('0x1a')](_0x58c626)[_0xa72d('0x1c')](_0x346bcf);}};}function respondWithFilteredResult(_0x5d7ada,_0x51e847){return function(_0x260210){if(_0x260210){var _0x3b2647=typeof _0x51e847[_0xa72d('0x1d')]===_0xa72d('0x1e')&&typeof _0x51e847[_0xa72d('0x1f')]===_0xa72d('0x1e');var _0x49dfbb=_0x260210[_0xa72d('0x20')];var _0x5a496c=_0x3b2647?0x0:_0x51e847['offset'];var _0x3714ba=_0x3b2647?_0x260210['count']:_0x51e847[_0xa72d('0x1d')]+_0x51e847['limit'];var _0x5b20cd;if(_0x3714ba>=_0x49dfbb){_0x3714ba=_0x49dfbb;_0x5b20cd=0xc8;}else{_0x5b20cd=0xce;}_0x5d7ada[_0xa72d('0x1a')](_0x5b20cd);return _0x5d7ada[_0xa72d('0x21')](_0xa72d('0x22'),_0x5a496c+'-'+_0x3714ba+'/'+_0x49dfbb)[_0xa72d('0x1c')](_0x260210);}return null;};}function patchUpdates(_0x5d074e){return function(_0x3c9913){try{jsonpatch['apply'](_0x3c9913,_0x5d074e,!![]);}catch(_0x5296b0){return BPromise['reject'](_0x5296b0);}return _0x3c9913['save']();};}function saveUpdates(_0x5058c6,_0x504b8d){return function(_0x2d9557){if(_0x2d9557){return _0x2d9557['update'](_0x5058c6)[_0xa72d('0x23')](function(_0xb01880){return _0xb01880;});}return null;};}function removeEntity(_0x4a67f2,_0x364b9c){return function(_0x5b2daa){if(_0x5b2daa){return _0x5b2daa[_0xa72d('0x24')]()[_0xa72d('0x23')](function(){var _0x231d8=_0x5b2daa[_0xa72d('0x25')]({'plain':!![]});var _0x4e945b=_0xa72d('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x4e945b,'resourceId':_0x231d8['id']}})['then'](function(){return _0x5b2daa;});})[_0xa72d('0x23')](function(){_0x4a67f2[_0xa72d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cb1a4,_0x49d49b){return function(_0x1d2407){if(!_0x1d2407){_0x4cb1a4[_0xa72d('0x19')](0x194);}return _0x1d2407;};}function handleError(_0x593f4c,_0x39664b){_0x39664b=_0x39664b||0x1f4;return function(_0x1114d6){logger[_0xa72d('0x27')](_0x1114d6[_0xa72d('0x28')]);if(_0x1114d6[_0xa72d('0x29')]){delete _0x1114d6[_0xa72d('0x29')];}_0x593f4c[_0xa72d('0x1a')](_0x39664b)[_0xa72d('0x2a')](_0x1114d6);};}exports[_0xa72d('0x2b')]=function(_0x33b12e,_0x1e21ab){var _0x40e262={},_0x4900f6={},_0x63e634={'count':0x0,'rows':[]};var _0x52220a=_[_0xa72d('0x2c')](db['AnalyticExtractedReport'][_0xa72d('0x2d')],function(_0x354d31){return{'name':_0x354d31['fieldName'],'type':_0x354d31['type'][_0xa72d('0x2e')]};});_0x4900f6[_0xa72d('0x2f')]=_[_0xa72d('0x2c')](_0x52220a,_0xa72d('0x29'));_0x4900f6['query']=_['keys'](_0x33b12e[_0xa72d('0x30')]);_0x4900f6['filters']=_[_0xa72d('0x31')](_0x4900f6[_0xa72d('0x2f')],_0x4900f6[_0xa72d('0x30')]);_0x40e262[_0xa72d('0x32')]=_['intersection'](_0x4900f6[_0xa72d('0x2f')],qs[_0xa72d('0x33')](_0x33b12e[_0xa72d('0x30')]['fields']));_0x40e262['attributes']=_0x40e262[_0xa72d('0x32')][_0xa72d('0x34')]?_0x40e262[_0xa72d('0x32')]:_0x4900f6[_0xa72d('0x2f')];if(!_0x33b12e[_0xa72d('0x30')][_0xa72d('0x35')]('nolimit')){_0x40e262[_0xa72d('0x1f')]=qs[_0xa72d('0x1f')](_0x33b12e[_0xa72d('0x30')][_0xa72d('0x1f')]);_0x40e262['offset']=qs['offset'](_0x33b12e[_0xa72d('0x30')]['offset']);}_0x40e262[_0xa72d('0x36')]=qs[_0xa72d('0x37')](_0x33b12e[_0xa72d('0x30')]['sort']);_0x40e262[_0xa72d('0x38')]=qs[_0xa72d('0x39')](_[_0xa72d('0x3a')](_0x33b12e[_0xa72d('0x30')],_0x4900f6[_0xa72d('0x39')]),_0x52220a);if(_0x33b12e['query'][_0xa72d('0x3b')]){_0x40e262[_0xa72d('0x38')]=_['merge'](_0x40e262[_0xa72d('0x38')],{'$or':_[_0xa72d('0x2c')](_0x52220a,function(_0x2ffe16){if(_0x2ffe16[_0xa72d('0x3c')]!==_0xa72d('0x3d')){var _0x2b4a7b={};_0x2b4a7b[_0x2ffe16[_0xa72d('0x29')]]={'$like':'%'+_0x33b12e[_0xa72d('0x30')][_0xa72d('0x3b')]+'%'};return _0x2b4a7b;}})});}_0x40e262=_[_0xa72d('0x3e')]({},_0x40e262,_0x33b12e[_0xa72d('0x3f')]);var _0x3eebe0={'where':_0x40e262[_0xa72d('0x38')]};return db[_0xa72d('0x40')][_0xa72d('0x20')](_0x3eebe0)[_0xa72d('0x23')](function(_0x4b65e0){_0x63e634[_0xa72d('0x20')]=_0x4b65e0;if(_0x33b12e['query'][_0xa72d('0x41')]){_0x40e262['include']=[{'all':!![]}];}return db[_0xa72d('0x40')][_0xa72d('0x42')](_0x40e262);})[_0xa72d('0x23')](function(_0x4f814d){_0x63e634[_0xa72d('0x43')]=_0x4f814d;return _0x63e634;})[_0xa72d('0x23')](respondWithFilteredResult(_0x1e21ab,_0x40e262))[_0xa72d('0x44')](handleError(_0x1e21ab,null));};exports[_0xa72d('0x45')]=function(_0x588cc9,_0x3aa15c){var _0x45d1ba={'raw':!![],'where':{'id':_0x588cc9[_0xa72d('0x46')]['id']}},_0x4ac6ab={};_0x4ac6ab[_0xa72d('0x2f')]=_[_0xa72d('0x47')](db[_0xa72d('0x40')][_0xa72d('0x2d')]);_0x4ac6ab[_0xa72d('0x30')]=_[_0xa72d('0x47')](_0x588cc9['query']);_0x4ac6ab['filters']=_[_0xa72d('0x31')](_0x4ac6ab[_0xa72d('0x2f')],_0x4ac6ab['query']);_0x45d1ba[_0xa72d('0x32')]=_[_0xa72d('0x31')](_0x4ac6ab['model'],qs[_0xa72d('0x33')](_0x588cc9['query']['fields']));_0x45d1ba[_0xa72d('0x32')]=_0x45d1ba[_0xa72d('0x32')]['length']?_0x45d1ba[_0xa72d('0x32')]:_0x4ac6ab[_0xa72d('0x2f')];if(_0x588cc9['query'][_0xa72d('0x41')]){_0x45d1ba[_0xa72d('0x48')]=[{'all':!![]}];}_0x45d1ba=_[_0xa72d('0x3e')]({},_0x45d1ba,_0x588cc9[_0xa72d('0x3f')]);return db[_0xa72d('0x40')]['find'](_0x45d1ba)[_0xa72d('0x23')](handleEntityNotFound(_0x3aa15c,null))['then'](respondWithResult(_0x3aa15c,null))[_0xa72d('0x44')](handleError(_0x3aa15c,null));};exports[_0xa72d('0x49')]=function(_0x1b8506,_0x25b082){return db[_0xa72d('0x40')][_0xa72d('0x49')](_0x1b8506[_0xa72d('0x4a')],{})['then'](function(_0x5044d4){var _0x2a9b21=_0x1b8506['user']['get']({'plain':!![]});if(!_0x2a9b21)throw new Error(_0xa72d('0x4b'));if(_0x2a9b21[_0xa72d('0x4c')]==='user'){var _0x4c711e=_0x5044d4[_0xa72d('0x25')]({'plain':!![]});var _0x30269e=_0xa72d('0x26');return db[_0xa72d('0x4d')][_0xa72d('0x4e')]({'where':{'name':_0x30269e,'userProfileId':_0x2a9b21[_0xa72d('0x4f')]},'raw':!![]})[_0xa72d('0x23')](function(_0x593f1e){if(_0x593f1e&&_0x593f1e['autoAssociation']===0x0){return db['UserProfileResource'][_0xa72d('0x49')]({'name':_0x4c711e[_0xa72d('0x29')],'resourceId':_0x4c711e['id'],'type':_0x593f1e['name'],'sectionId':_0x593f1e['id']},{})[_0xa72d('0x23')](function(){return _0x5044d4;});}else{return _0x5044d4;}})[_0xa72d('0x44')](function(_0x528ac7){logger[_0xa72d('0x27')](_0xa72d('0x50'),_0x528ac7);throw _0x528ac7;});}return _0x5044d4;})[_0xa72d('0x23')](respondWithResult(_0x25b082,0xc9))['catch'](handleError(_0x25b082,null));};exports['update']=function(_0x20633c,_0x24f6a1){if(_0x20633c[_0xa72d('0x4a')]['id']){delete _0x20633c[_0xa72d('0x4a')]['id'];}return db[_0xa72d('0x40')][_0xa72d('0x4e')]({'where':{'id':_0x20633c['params']['id']}})[_0xa72d('0x23')](handleEntityNotFound(_0x24f6a1,null))[_0xa72d('0x23')](saveUpdates(_0x20633c[_0xa72d('0x4a')],null))[_0xa72d('0x23')](respondWithResult(_0x24f6a1,null))['catch'](handleError(_0x24f6a1,null));};exports[_0xa72d('0x24')]=function(_0x1b5ca4,_0x3aadfe){return db[_0xa72d('0x40')][_0xa72d('0x4e')]({'where':{'id':_0x1b5ca4[_0xa72d('0x46')]['id']}})[_0xa72d('0x23')](handleEntityNotFound(_0x3aadfe,null))['then'](removeEntity(_0x3aadfe,null))[_0xa72d('0x44')](handleError(_0x3aadfe,null));};exports[_0xa72d('0x51')]=function(_0x11ec12,_0x452e71,_0x36fc6b){return db[_0xa72d('0x40')][_0xa72d('0x4e')]({'where':{'id':_0x11ec12[_0xa72d('0x46')]['id']},'attributes':[_0xa72d('0x29'),_0xa72d('0x52'),_0xa72d('0x53'),_0xa72d('0x54')],'raw':!![]})[_0xa72d('0x23')](handleEntityNotFound(_0x452e71,null))[_0xa72d('0x23')](function(_0x56f11e){if(_0x56f11e){if(!fs[_0xa72d('0x55')](path[_0xa72d('0x56')](config[_0xa72d('0x57')],_0xa72d('0x58'),_0x56f11e[_0xa72d('0x53')]))){throw new db[(_0xa72d('0x59'))][(_0xa72d('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x11ec12[_0xa72d('0x30')][_0xa72d('0x5b')]){return _0x452e71['sendStatus'](0xc8);}return _0x452e71['download'](path[_0xa72d('0x56')](config[_0xa72d('0x57')],_0xa72d('0x58'),_0x56f11e['savename']),util['format'](_0xa72d('0x5c'),_0x56f11e[_0xa72d('0x52')]||_0x56f11e[_0xa72d('0x29')],_0x56f11e[_0xa72d('0x54')][_0xa72d('0x5d')]()));}})[_0xa72d('0x44')](handleError(_0x452e71,null));};
\ No newline at end of file
+var _0x2854=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','AnalyticExtractedReport','findAll','catch','show','keys','find','create','user','role','ExtractedReports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','basename','savename','output','join','root','server/files/reports','Sequelize','exists','download','format','toLowerCase','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis'];(function(_0x546ac5,_0x59e59b){var _0x56a6d8=function(_0x2aff07){while(--_0x2aff07){_0x546ac5['push'](_0x546ac5['shift']());}};_0x56a6d8(++_0x59e59b);}(_0x2854,0xaf));var _0x4285=function(_0x45d70e,_0x189ca1){_0x45d70e=_0x45d70e-0x0;var _0x13de9a=_0x2854[_0x45d70e];return _0x13de9a;};'use strict';var emlformat=require(_0x4285('0x0'));var rimraf=require(_0x4285('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4285('0x2'));var rp=require('request-promise');var moment=require(_0x4285('0x3'));var BPromise=require(_0x4285('0x4'));var Mustache=require('mustache');var util=require(_0x4285('0x5'));var path=require(_0x4285('0x6'));var sox=require(_0x4285('0x7'));var csv=require(_0x4285('0x8'));var ejs=require(_0x4285('0x9'));var fs=require('fs');var fs_extra=require(_0x4285('0xa'));var _=require('lodash');var squel=require(_0x4285('0xb'));var crypto=require('crypto');var jsforce=require(_0x4285('0xc'));var deskjs=require(_0x4285('0xd'));var toCsv=require(_0x4285('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4285('0xe'));var authService=require(_0x4285('0xf'));var qs=require(_0x4285('0x10'));var as=require(_0x4285('0x11'));var hardwareService=require(_0x4285('0x12'));var logger=require(_0x4285('0x13'))(_0x4285('0x14'));var utils=require(_0x4285('0x15'));var config=require(_0x4285('0x16'));var licenseUtil=require(_0x4285('0x17'));var db=require(_0x4285('0x18'))['db'];function respondWithStatusCode(_0x34531c,_0x4de38d){_0x4de38d=_0x4de38d||0xcc;return function(_0x3fc8eb){if(_0x3fc8eb){return _0x34531c[_0x4285('0x19')](_0x4de38d);}return _0x34531c[_0x4285('0x1a')](_0x4de38d)[_0x4285('0x1b')]();};}function respondWithResult(_0xd4dab3,_0x2083c4){_0x2083c4=_0x2083c4||0xc8;return function(_0x33422d){if(_0x33422d){return _0xd4dab3[_0x4285('0x1a')](_0x2083c4)['json'](_0x33422d);}};}function respondWithFilteredResult(_0x3b2c07,_0x432af9){return function(_0x89c146){if(_0x89c146){var _0x1b142f=typeof _0x432af9[_0x4285('0x1c')]===_0x4285('0x1d')&&typeof _0x432af9[_0x4285('0x1e')]===_0x4285('0x1d');var _0x126c22=_0x89c146[_0x4285('0x1f')];var _0x1ca928=_0x1b142f?0x0:_0x432af9['offset'];var _0x19e42f=_0x1b142f?_0x89c146[_0x4285('0x1f')]:_0x432af9['offset']+_0x432af9[_0x4285('0x1e')];var _0x1a4b1e;if(_0x19e42f>=_0x126c22){_0x19e42f=_0x126c22;_0x1a4b1e=0xc8;}else{_0x1a4b1e=0xce;}_0x3b2c07[_0x4285('0x1a')](_0x1a4b1e);return _0x3b2c07['set']('Content-Range',_0x1ca928+'-'+_0x19e42f+'/'+_0x126c22)[_0x4285('0x20')](_0x89c146);}return null;};}function patchUpdates(_0x1296e9){return function(_0x3ec038){try{jsonpatch[_0x4285('0x21')](_0x3ec038,_0x1296e9,!![]);}catch(_0x335958){return BPromise[_0x4285('0x22')](_0x335958);}return _0x3ec038[_0x4285('0x23')]();};}function saveUpdates(_0x2aaa4e,_0x4b426e){return function(_0x30ff1d){if(_0x30ff1d){return _0x30ff1d['update'](_0x2aaa4e)[_0x4285('0x24')](function(_0x33599e){return _0x33599e;});}return null;};}function removeEntity(_0x942ed1,_0x501da9){return function(_0x171bc2){if(_0x171bc2){return _0x171bc2[_0x4285('0x25')]()['then'](function(){var _0x5b76de=_0x171bc2[_0x4285('0x26')]({'plain':!![]});var _0x22fce2='ExtractedReports';return db[_0x4285('0x27')][_0x4285('0x25')]({'where':{'type':_0x22fce2,'resourceId':_0x5b76de['id']}})[_0x4285('0x24')](function(){return _0x171bc2;});})[_0x4285('0x24')](function(){_0x942ed1[_0x4285('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x427446,_0x1ea1d1){return function(_0x284a08){if(!_0x284a08){_0x427446[_0x4285('0x19')](0x194);}return _0x284a08;};}function handleError(_0x17c99b,_0xbdfa0b){_0xbdfa0b=_0xbdfa0b||0x1f4;return function(_0x1822c9){logger[_0x4285('0x28')](_0x1822c9[_0x4285('0x29')]);if(_0x1822c9[_0x4285('0x2a')]){delete _0x1822c9[_0x4285('0x2a')];}_0x17c99b[_0x4285('0x1a')](_0xbdfa0b)[_0x4285('0x2b')](_0x1822c9);};}exports[_0x4285('0x2c')]=function(_0x25d274,_0x254658){var _0x1b9e56={},_0x576b49={},_0xbcf8={'count':0x0,'rows':[]};var _0x17ae08=_[_0x4285('0x2d')](db['AnalyticExtractedReport'][_0x4285('0x2e')],function(_0x4436be){return{'name':_0x4436be[_0x4285('0x2f')],'type':_0x4436be[_0x4285('0x30')][_0x4285('0x31')]};});_0x576b49[_0x4285('0x32')]=_['map'](_0x17ae08,'name');_0x576b49[_0x4285('0x33')]=_['keys'](_0x25d274[_0x4285('0x33')]);_0x576b49['filters']=_[_0x4285('0x34')](_0x576b49[_0x4285('0x32')],_0x576b49['query']);_0x1b9e56['attributes']=_[_0x4285('0x34')](_0x576b49[_0x4285('0x32')],qs[_0x4285('0x35')](_0x25d274[_0x4285('0x33')][_0x4285('0x35')]));_0x1b9e56[_0x4285('0x36')]=_0x1b9e56[_0x4285('0x36')][_0x4285('0x37')]?_0x1b9e56[_0x4285('0x36')]:_0x576b49[_0x4285('0x32')];if(!_0x25d274[_0x4285('0x33')][_0x4285('0x38')](_0x4285('0x39'))){_0x1b9e56[_0x4285('0x1e')]=qs[_0x4285('0x1e')](_0x25d274[_0x4285('0x33')][_0x4285('0x1e')]);_0x1b9e56[_0x4285('0x1c')]=qs[_0x4285('0x1c')](_0x25d274[_0x4285('0x33')][_0x4285('0x1c')]);}_0x1b9e56[_0x4285('0x3a')]=qs[_0x4285('0x3b')](_0x25d274[_0x4285('0x33')][_0x4285('0x3b')]);_0x1b9e56['where']=qs[_0x4285('0x3c')](_[_0x4285('0x3d')](_0x25d274[_0x4285('0x33')],_0x576b49[_0x4285('0x3c')]),_0x17ae08);if(_0x25d274['query'][_0x4285('0x3e')]){_0x1b9e56['where']=_[_0x4285('0x3f')](_0x1b9e56[_0x4285('0x40')],{'$or':_[_0x4285('0x2d')](_0x17ae08,function(_0x4fdee0){if(_0x4fdee0['type']!==_0x4285('0x41')){var _0x17e233={};_0x17e233[_0x4fdee0[_0x4285('0x2a')]]={'$like':'%'+_0x25d274[_0x4285('0x33')][_0x4285('0x3e')]+'%'};return _0x17e233;}})});}_0x1b9e56=_['merge']({},_0x1b9e56,_0x25d274[_0x4285('0x42')]);var _0x31ccd1={'where':_0x1b9e56[_0x4285('0x40')]};return db['AnalyticExtractedReport'][_0x4285('0x1f')](_0x31ccd1)['then'](function(_0x344a3d){_0xbcf8[_0x4285('0x1f')]=_0x344a3d;if(_0x25d274['query'][_0x4285('0x43')]){_0x1b9e56[_0x4285('0x44')]=[{'all':!![]}];}return db[_0x4285('0x45')][_0x4285('0x46')](_0x1b9e56);})[_0x4285('0x24')](function(_0x532d87){_0xbcf8['rows']=_0x532d87;return _0xbcf8;})[_0x4285('0x24')](respondWithFilteredResult(_0x254658,_0x1b9e56))[_0x4285('0x47')](handleError(_0x254658,null));};exports[_0x4285('0x48')]=function(_0x3347fc,_0x5403bd){var _0x20ffd8={'raw':!![],'where':{'id':_0x3347fc['params']['id']}},_0x3851f8={};_0x3851f8[_0x4285('0x32')]=_[_0x4285('0x49')](db[_0x4285('0x45')]['rawAttributes']);_0x3851f8[_0x4285('0x33')]=_['keys'](_0x3347fc[_0x4285('0x33')]);_0x3851f8[_0x4285('0x3c')]=_['intersection'](_0x3851f8['model'],_0x3851f8[_0x4285('0x33')]);_0x20ffd8[_0x4285('0x36')]=_['intersection'](_0x3851f8[_0x4285('0x32')],qs[_0x4285('0x35')](_0x3347fc[_0x4285('0x33')][_0x4285('0x35')]));_0x20ffd8['attributes']=_0x20ffd8[_0x4285('0x36')][_0x4285('0x37')]?_0x20ffd8[_0x4285('0x36')]:_0x3851f8[_0x4285('0x32')];if(_0x3347fc[_0x4285('0x33')]['includeAll']){_0x20ffd8[_0x4285('0x44')]=[{'all':!![]}];}_0x20ffd8=_[_0x4285('0x3f')]({},_0x20ffd8,_0x3347fc[_0x4285('0x42')]);return db[_0x4285('0x45')][_0x4285('0x4a')](_0x20ffd8)[_0x4285('0x24')](handleEntityNotFound(_0x5403bd,null))[_0x4285('0x24')](respondWithResult(_0x5403bd,null))['catch'](handleError(_0x5403bd,null));};exports['create']=function(_0x4aa47d,_0x590f49){return db[_0x4285('0x45')][_0x4285('0x4b')](_0x4aa47d['body'],{})['then'](function(_0x1c353f){var _0x36ca20=_0x4aa47d[_0x4285('0x4c')][_0x4285('0x26')]({'plain':!![]});if(!_0x36ca20)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36ca20[_0x4285('0x4d')]===_0x4285('0x4c')){var _0x43f813=_0x1c353f[_0x4285('0x26')]({'plain':!![]});var _0x587817=_0x4285('0x4e');return db[_0x4285('0x4f')][_0x4285('0x4a')]({'where':{'name':_0x587817,'userProfileId':_0x36ca20['userProfileId']},'raw':!![]})[_0x4285('0x24')](function(_0x31b000){if(_0x31b000&&_0x31b000['autoAssociation']===0x0){return db[_0x4285('0x27')][_0x4285('0x4b')]({'name':_0x43f813[_0x4285('0x2a')],'resourceId':_0x43f813['id'],'type':_0x31b000[_0x4285('0x2a')],'sectionId':_0x31b000['id']},{})[_0x4285('0x24')](function(){return _0x1c353f;});}else{return _0x1c353f;}})[_0x4285('0x47')](function(_0x3b5bf5){logger[_0x4285('0x28')](_0x4285('0x50'),_0x3b5bf5);throw _0x3b5bf5;});}return _0x1c353f;})['then'](respondWithResult(_0x590f49,0xc9))[_0x4285('0x47')](handleError(_0x590f49,null));};exports[_0x4285('0x51')]=function(_0x1893a0,_0x4cbbbe){if(_0x1893a0[_0x4285('0x52')]['id']){delete _0x1893a0['body']['id'];}return db[_0x4285('0x45')][_0x4285('0x4a')]({'where':{'id':_0x1893a0[_0x4285('0x53')]['id']}})[_0x4285('0x24')](handleEntityNotFound(_0x4cbbbe,null))[_0x4285('0x24')](saveUpdates(_0x1893a0[_0x4285('0x52')],null))[_0x4285('0x24')](respondWithResult(_0x4cbbbe,null))[_0x4285('0x47')](handleError(_0x4cbbbe,null));};exports[_0x4285('0x25')]=function(_0x2e948a,_0x1271b0){return db['AnalyticExtractedReport'][_0x4285('0x4a')]({'where':{'id':_0x2e948a[_0x4285('0x53')]['id']}})[_0x4285('0x24')](handleEntityNotFound(_0x1271b0,null))[_0x4285('0x24')](removeEntity(_0x1271b0,null))[_0x4285('0x47')](handleError(_0x1271b0,null));};exports['download']=function(_0x1c5a17,_0x424cd4,_0x1332ed){return db[_0x4285('0x45')][_0x4285('0x4a')]({'where':{'id':_0x1c5a17['params']['id']},'attributes':[_0x4285('0x2a'),_0x4285('0x54'),_0x4285('0x55'),_0x4285('0x56')],'raw':!![]})[_0x4285('0x24')](handleEntityNotFound(_0x424cd4,null))['then'](function(_0x24ad9c){if(_0x24ad9c){if(!fs['existsSync'](path[_0x4285('0x57')](config[_0x4285('0x58')],_0x4285('0x59'),_0x24ad9c[_0x4285('0x55')]))){throw new db[(_0x4285('0x5a'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x1c5a17[_0x4285('0x33')][_0x4285('0x5b')]){return _0x424cd4['sendStatus'](0xc8);}return _0x424cd4[_0x4285('0x5c')](path[_0x4285('0x57')](config['root'],_0x4285('0x59'),_0x24ad9c[_0x4285('0x55')]),util[_0x4285('0x5d')]('%s.%s',_0x24ad9c[_0x4285('0x54')]||_0x24ad9c['name'],_0x24ad9c[_0x4285('0x56')][_0x4285('0x5e')]()));}})[_0x4285('0x47')](handleError(_0x424cd4,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 8a9c34c..fde2002 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 _0xc487=['api','bluebird','request-promise','path','./analyticExtractedReport.attributes','exports','define'];(function(_0x12d6d1,_0x468f27){var _0x3c85de=function(_0x532c43){while(--_0x532c43){_0x12d6d1['push'](_0x12d6d1['shift']());}};_0x3c85de(++_0x468f27);}(_0xc487,0x181));var _0x7c48=function(_0x58b647,_0xe24336){_0x58b647=_0x58b647-0x0;var _0x233b67=_0xc487[_0x58b647];return _0x233b67;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7c48('0x0'));var moment=require('moment');var BPromise=require(_0x7c48('0x1'));var rp=require(_0x7c48('0x2'));var fs=require('fs');var path=require(_0x7c48('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7c48('0x4'));module[_0x7c48('0x5')]=function(_0x28a5c1,_0x106709){return _0x28a5c1[_0x7c48('0x6')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x230d=['moment','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x55cd7d,_0x37cb9c){var _0x177358=function(_0x47f589){while(--_0x47f589){_0x55cd7d['push'](_0x55cd7d['shift']());}};_0x177358(++_0x37cb9c);}(_0x230d,0x120));var _0xd230=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x230d[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xd230('0x0'));var util=require(_0xd230('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd230('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd230('0x3'));var rimraf=require(_0xd230('0x4'));var config=require(_0xd230('0x5'));var attributes=require(_0xd230('0x6'));module[_0xd230('0x7')]=function(_0x4e347c,_0x689c9d){return _0x4e347c['define'](_0xd230('0x8'),attributes,{'tableName':_0xd230('0x9'),'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 efdcea0..8db2498 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 _0x05ca=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x258d11,_0xc62302){var _0x230fd2=function(_0x3239e1){while(--_0x3239e1){_0x258d11['push'](_0x258d11['shift']());}};_0x230fd2(++_0xc62302);}(_0x05ca,0xbf));var _0xa05c=function(_0x1fdda9,_0x5c74bd){_0x1fdda9=_0x1fdda9-0x0;var _0x25e192=_0x05ca[_0x1fdda9];return _0x25e192;};'use strict';var _=require(_0xa05c('0x0'));var util=require('util');var moment=require(_0xa05c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa05c('0x2'));var fs=require('fs');var Redis=require(_0xa05c('0x3'));var db=require(_0xa05c('0x4'))['db'];var utils=require(_0xa05c('0x5'));var logger=require('../../config/logger')(_0xa05c('0x6'));var config=require(_0xa05c('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x424e34,_0xb06377,_0x256dc0){return new BPromise(function(_0x1cc047,_0x430a98){return client['request'](_0x424e34,_0x256dc0)[_0xa05c('0x8')](function(_0x508187){logger[_0xa05c('0x9')](_0xa05c('0xa'),_0xb06377,'request\x20sent');logger[_0xa05c('0xb')](_0xa05c('0xc'),_0xb06377,_0xa05c('0xd'),JSON['stringify'](_0x508187));if(_0x508187[_0xa05c('0xe')]){if(_0x508187[_0xa05c('0xe')][_0xa05c('0xf')]===0x1f4){logger[_0xa05c('0xe')](_0xa05c('0xa'),_0xb06377,_0x508187['error'][_0xa05c('0x10')]);return _0x430a98(_0x508187['error']['message']);}logger[_0xa05c('0xe')](_0xa05c('0xa'),_0xb06377,_0x508187[_0xa05c('0xe')][_0xa05c('0x10')]);return _0x1cc047(_0x508187['error'][_0xa05c('0x10')]);}else{logger['info'](_0xa05c('0xa'),_0xb06377,_0xa05c('0xd'));_0x1cc047(_0x508187[_0xa05c('0x11')][_0xa05c('0x10')]);}})[_0xa05c('0x12')](function(_0x40fcdf){logger[_0xa05c('0xe')](_0xa05c('0xa'),_0xb06377,_0x40fcdf);_0x430a98(_0x40fcdf);});});}
\ No newline at end of file
+var _0x5c69=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','lodash'];(function(_0x2c25cf,_0x367e03){var _0x585d17=function(_0x54b545){while(--_0x54b545){_0x2c25cf['push'](_0x2c25cf['shift']());}};_0x585d17(++_0x367e03);}(_0x5c69,0xa0));var _0x95c6=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x5c69[_0x411017];return _0x2adeea;};'use strict';var _=require(_0x95c6('0x0'));var util=require('util');var moment=require(_0x95c6('0x1'));var BPromise=require(_0x95c6('0x2'));var rs=require(_0x95c6('0x3'));var fs=require('fs');var Redis=require(_0x95c6('0x4'));var db=require(_0x95c6('0x5'))['db'];var utils=require(_0x95c6('0x6'));var logger=require(_0x95c6('0x7'))(_0x95c6('0x8'));var config=require(_0x95c6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x95c6('0xa')][_0x95c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e858a,_0x1f4ac1,_0x4dfddc){return new BPromise(function(_0x2c2ab2,_0x55b728){return client[_0x95c6('0xc')](_0x5e858a,_0x4dfddc)[_0x95c6('0xd')](function(_0x23cfec){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f4ac1,_0x95c6('0xe'));logger[_0x95c6('0xf')](_0x95c6('0x10'),_0x1f4ac1,_0x95c6('0xe'),JSON[_0x95c6('0x11')](_0x23cfec));if(_0x23cfec['error']){if(_0x23cfec[_0x95c6('0x12')][_0x95c6('0x13')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f4ac1,_0x23cfec['error'][_0x95c6('0x14')]);return _0x55b728(_0x23cfec[_0x95c6('0x12')][_0x95c6('0x14')]);}logger[_0x95c6('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f4ac1,_0x23cfec[_0x95c6('0x12')][_0x95c6('0x14')]);return _0x2c2ab2(_0x23cfec['error'][_0x95c6('0x14')]);}else{logger['info'](_0x95c6('0x15'),_0x1f4ac1,_0x95c6('0xe'));_0x2c2ab2(_0x23cfec[_0x95c6('0x16')][_0x95c6('0x14')]);}})['catch'](function(_0x8c8783){logger[_0x95c6('0x12')](_0x95c6('0x15'),_0x1f4ac1,_0x8c8783);_0x55b728(_0x8c8783);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 709c697..32adfde 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 _0x22d8=['exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete','destroy'];(function(_0x30dbe6,_0x22e984){var _0x56bb53=function(_0x1ec502){while(--_0x1ec502){_0x30dbe6['push'](_0x30dbe6['shift']());}};_0x56bb53(++_0x22e984);}(_0x22d8,0xfd));var _0x822d=function(_0x547c55,_0x9ad851){_0x547c55=_0x547c55-0x0;var _0x266042=_0x22d8[_0x547c55];return _0x266042;};'use strict';var multer=require('multer');var util=require(_0x822d('0x0'));var path=require(_0x822d('0x1'));var timeout=require('connect-timeout');var express=require(_0x822d('0x2'));var router=express['Router']();var fs_extra=require(_0x822d('0x3'));var auth=require(_0x822d('0x4'));var interaction=require(_0x822d('0x5'));var config=require(_0x822d('0x6'));var controller=require(_0x822d('0x7'));router[_0x822d('0x8')]('/',auth[_0x822d('0x9')](),controller[_0x822d('0xa')]);router[_0x822d('0x8')](_0x822d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x822d('0x8')](_0x822d('0xc'),auth[_0x822d('0x9')](),controller[_0x822d('0xd')]);router[_0x822d('0xe')]('/',auth['isAuthenticated'](),controller[_0x822d('0xf')]);router[_0x822d('0x10')](_0x822d('0xb'),auth[_0x822d('0x9')](),controller[_0x822d('0x11')]);router[_0x822d('0x12')]('/:id',auth[_0x822d('0x9')](),controller[_0x822d('0x13')]);module[_0x822d('0x14')]=router;
\ No newline at end of file
+var _0xae42=['fs-extra','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','update','delete','destroy','multer','util','connect-timeout'];(function(_0x1177d5,_0x22b649){var _0xc3ddc2=function(_0x43ff95){while(--_0x43ff95){_0x1177d5['push'](_0x1177d5['shift']());}};_0xc3ddc2(++_0x22b649);}(_0xae42,0x8d));var _0x2ae4=function(_0x460404,_0x16622a){_0x460404=_0x460404-0x0;var _0x1ee60c=_0xae42[_0x460404];return _0x1ee60c;};'use strict';var multer=require(_0x2ae4('0x0'));var util=require(_0x2ae4('0x1'));var path=require('path');var timeout=require(_0x2ae4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2ae4('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2ae4('0x4'));var controller=require(_0x2ae4('0x5'));router[_0x2ae4('0x6')]('/',auth[_0x2ae4('0x7')](),controller[_0x2ae4('0x8')]);router[_0x2ae4('0x6')]('/:id',auth[_0x2ae4('0x7')](),controller[_0x2ae4('0x9')]);router[_0x2ae4('0x6')](_0x2ae4('0xa'),auth[_0x2ae4('0x7')](),controller[_0x2ae4('0xb')]);router[_0x2ae4('0xc')]('/',auth[_0x2ae4('0x7')](),controller[_0x2ae4('0xd')]);router['put'](_0x2ae4('0xe'),auth[_0x2ae4('0x7')](),controller[_0x2ae4('0xf')]);router[_0x2ae4('0x10')]('/:id',auth[_0x2ae4('0x7')](),controller[_0x2ae4('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index edf4d60..1e3be0f 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 _0x2945=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x2c9b79,_0x7cf58b){var _0x265032=function(_0x188a92){while(--_0x188a92){_0x2c9b79['push'](_0x2c9b79['shift']());}};_0x265032(++_0x7cf58b);}(_0x2945,0xf3));var _0x5294=function(_0x1c9fc4,_0x240343){_0x1c9fc4=_0x1c9fc4-0x0;var _0x2efcba=_0x2945[_0x1c9fc4];return _0x2efcba;};'use strict';var Sequelize=require(_0x5294('0x0'));module[_0x5294('0x1')]={'field':{'type':Sequelize[_0x5294('0x2')]},'alias':{'type':Sequelize[_0x5294('0x3')]},'function':{'type':Sequelize[_0x5294('0x3')]},'format':{'type':Sequelize[_0x5294('0x3')]},'groupBy':{'type':Sequelize[_0x5294('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x6ce1=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6ce1,0xaa));var _0x16ce=function(_0x6540ce,_0x401528){_0x6540ce=_0x6540ce-0x0;var _0x58d2e3=_0x6ce1[_0x6540ce];return _0x58d2e3;};'use strict';var Sequelize=require(_0x16ce('0x0'));module['exports']={'field':{'type':Sequelize[_0x16ce('0x1')]},'alias':{'type':Sequelize[_0x16ce('0x2')]},'function':{'type':Sequelize[_0x16ce('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x16ce('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x16ce('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index fb1e937..e856bfe 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 _0xb057=['fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','then','includeAll','include','catch','show','params','find','bulkCreate','body','addFields','AnalyticCustomReport','findOne','sequelize','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','error','name','index','map','AnalyticFieldReport','rawAttributes'];(function(_0x229776,_0x13732d){var _0x4f32b5=function(_0x48958d){while(--_0x48958d){_0x229776['push'](_0x229776['shift']());}};_0x4f32b5(++_0x13732d);}(_0xb057,0x1f0));var _0x7b05=function(_0x226a19,_0x4a2fde){_0x226a19=_0x226a19-0x0;var _0x1dd55d=_0xb057[_0x226a19];return _0x1dd55d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b05('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b05('0x1'));var BPromise=require(_0x7b05('0x2'));var Mustache=require(_0x7b05('0x3'));var util=require(_0x7b05('0x4'));var path=require(_0x7b05('0x5'));var sox=require(_0x7b05('0x6'));var csv=require(_0x7b05('0x7'));var ejs=require(_0x7b05('0x8'));var fs=require('fs');var fs_extra=require(_0x7b05('0x9'));var _=require(_0x7b05('0xa'));var squel=require(_0x7b05('0xb'));var crypto=require(_0x7b05('0xc'));var jsforce=require(_0x7b05('0xd'));var deskjs=require(_0x7b05('0xe'));var toCsv=require(_0x7b05('0x7'));var querystring=require(_0x7b05('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7b05('0x10'));var as=require(_0x7b05('0x11'));var hardwareService=require(_0x7b05('0x12'));var logger=require(_0x7b05('0x13'))(_0x7b05('0x14'));var utils=require('../../config/utils');var config=require(_0x7b05('0x15'));var licenseUtil=require(_0x7b05('0x16'));var db=require(_0x7b05('0x17'))['db'];function respondWithStatusCode(_0x125f37,_0x3772be){_0x3772be=_0x3772be||0xcc;return function(_0x3f338c){if(_0x3f338c){return _0x125f37[_0x7b05('0x18')](_0x3772be);}return _0x125f37['status'](_0x3772be)[_0x7b05('0x19')]();};}function respondWithResult(_0x4b76b4,_0x245122){_0x245122=_0x245122||0xc8;return function(_0xf65800){if(_0xf65800){return _0x4b76b4[_0x7b05('0x1a')](_0x245122)[_0x7b05('0x1b')](_0xf65800);}};}function respondWithFilteredResult(_0x3869ee,_0x1eb53c){return function(_0x223de7){if(_0x223de7){var _0x145685=typeof _0x1eb53c[_0x7b05('0x1c')]===_0x7b05('0x1d')&&typeof _0x1eb53c[_0x7b05('0x1e')]===_0x7b05('0x1d');var _0x3dd197=_0x223de7[_0x7b05('0x1f')];var _0x4517a5=_0x145685?0x0:_0x1eb53c[_0x7b05('0x1c')];var _0x1f1fa9=_0x145685?_0x223de7[_0x7b05('0x1f')]:_0x1eb53c[_0x7b05('0x1c')]+_0x1eb53c[_0x7b05('0x1e')];var _0x322762;if(_0x1f1fa9>=_0x3dd197){_0x1f1fa9=_0x3dd197;_0x322762=0xc8;}else{_0x322762=0xce;}_0x3869ee[_0x7b05('0x1a')](_0x322762);return _0x3869ee[_0x7b05('0x20')](_0x7b05('0x21'),_0x4517a5+'-'+_0x1f1fa9+'/'+_0x3dd197)[_0x7b05('0x1b')](_0x223de7);}return null;};}function patchUpdates(_0x5c990a){return function(_0x3bc51d){try{jsonpatch[_0x7b05('0x22')](_0x3bc51d,_0x5c990a,!![]);}catch(_0x10b127){return BPromise['reject'](_0x10b127);}return _0x3bc51d['save']();};}function saveUpdates(_0x7c6f3b,_0x1fe941){return function(_0x52dc10){if(_0x52dc10){return _0x52dc10[_0x7b05('0x23')](_0x7c6f3b)['then'](function(_0x264ae8){return _0x264ae8;});}return null;};}function removeEntity(_0x166757,_0x3ef78a){return function(_0x10a869){if(_0x10a869){return _0x10a869[_0x7b05('0x24')]()['then'](function(){_0x166757['status'](0xcc)[_0x7b05('0x19')]();});}};}function handleEntityNotFound(_0x8a4ab3,_0x2537f5){return function(_0x5d709b){if(!_0x5d709b){_0x8a4ab3[_0x7b05('0x18')](0x194);}return _0x5d709b;};}function handleError(_0x5529a5,_0x580b96){_0x580b96=_0x580b96||0x1f4;return function(_0x232e28){logger[_0x7b05('0x25')](_0x232e28['stack']);if(_0x232e28[_0x7b05('0x26')]){delete _0x232e28[_0x7b05('0x26')];}_0x5529a5['status'](_0x580b96)['send'](_0x232e28);};}exports[_0x7b05('0x27')]=function(_0x19fe71,_0x364b8e){var _0x4e058e={},_0x1e6510={},_0x3a72ac={'count':0x0,'rows':[]};var _0x2674d8=_[_0x7b05('0x28')](db[_0x7b05('0x29')][_0x7b05('0x2a')],function(_0x39ea16){return{'name':_0x39ea16[_0x7b05('0x2b')],'type':_0x39ea16['type'][_0x7b05('0x2c')]};});_0x1e6510[_0x7b05('0x2d')]=_['map'](_0x2674d8,_0x7b05('0x26'));_0x1e6510[_0x7b05('0x2e')]=_[_0x7b05('0x2f')](_0x19fe71[_0x7b05('0x2e')]);_0x1e6510[_0x7b05('0x30')]=_[_0x7b05('0x31')](_0x1e6510[_0x7b05('0x2d')],_0x1e6510[_0x7b05('0x2e')]);_0x4e058e['attributes']=_['intersection'](_0x1e6510[_0x7b05('0x2d')],qs[_0x7b05('0x32')](_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x32')]));_0x4e058e['attributes']=_0x4e058e[_0x7b05('0x33')][_0x7b05('0x34')]?_0x4e058e[_0x7b05('0x33')]:_0x1e6510['model'];if(!_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x35')](_0x7b05('0x36'))){_0x4e058e[_0x7b05('0x1e')]=qs[_0x7b05('0x1e')](_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x1e')]);_0x4e058e[_0x7b05('0x1c')]=qs['offset'](_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x1c')]);}_0x4e058e[_0x7b05('0x37')]=qs['sort'](_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x38')]);_0x4e058e[_0x7b05('0x39')]=qs['filters'](_[_0x7b05('0x3a')](_0x19fe71[_0x7b05('0x2e')],_0x1e6510['filters']),_0x2674d8);if(_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x3b')]){_0x4e058e[_0x7b05('0x39')]=_['merge'](_0x4e058e[_0x7b05('0x39')],{'$or':_[_0x7b05('0x28')](_0x2674d8,function(_0x18954e){if(_0x18954e[_0x7b05('0x3c')]!==_0x7b05('0x3d')){var _0x1d961c={};_0x1d961c[_0x18954e[_0x7b05('0x26')]]={'$like':'%'+_0x19fe71[_0x7b05('0x2e')]['filter']+'%'};return _0x1d961c;}})});}_0x4e058e=_[_0x7b05('0x3e')]({},_0x4e058e,_0x19fe71[_0x7b05('0x3f')]);var _0x1af6f3={'where':_0x4e058e['where']};return db[_0x7b05('0x29')][_0x7b05('0x1f')](_0x1af6f3)[_0x7b05('0x40')](function(_0x3434b6){_0x3a72ac[_0x7b05('0x1f')]=_0x3434b6;if(_0x19fe71[_0x7b05('0x2e')][_0x7b05('0x41')]){_0x4e058e[_0x7b05('0x42')]=[{'all':!![]}];}return db[_0x7b05('0x29')]['findAll'](_0x4e058e);})[_0x7b05('0x40')](function(_0x32183d){_0x3a72ac['rows']=_0x32183d;return _0x3a72ac;})['then'](respondWithFilteredResult(_0x364b8e,_0x4e058e))[_0x7b05('0x43')](handleError(_0x364b8e,null));};exports[_0x7b05('0x44')]=function(_0x1d516d,_0x220477){var _0x1d0c00={'raw':![],'where':{'id':_0x1d516d[_0x7b05('0x45')]['id']}},_0x350e1d={};_0x350e1d[_0x7b05('0x2d')]=_['keys'](db[_0x7b05('0x29')][_0x7b05('0x2a')]);_0x350e1d[_0x7b05('0x2e')]=_[_0x7b05('0x2f')](_0x1d516d['query']);_0x350e1d[_0x7b05('0x30')]=_['intersection'](_0x350e1d[_0x7b05('0x2d')],_0x350e1d['query']);_0x1d0c00[_0x7b05('0x33')]=_['intersection'](_0x350e1d['model'],qs[_0x7b05('0x32')](_0x1d516d[_0x7b05('0x2e')][_0x7b05('0x32')]));_0x1d0c00[_0x7b05('0x33')]=_0x1d0c00[_0x7b05('0x33')]['length']?_0x1d0c00['attributes']:_0x350e1d[_0x7b05('0x2d')];if(_0x1d516d[_0x7b05('0x2e')][_0x7b05('0x41')]){_0x1d0c00['include']=[{'all':!![]}];}_0x1d0c00=_['merge']({},_0x1d0c00,_0x1d516d['options']);return db[_0x7b05('0x29')][_0x7b05('0x46')](_0x1d0c00)['then'](handleEntityNotFound(_0x220477,null))[_0x7b05('0x40')](respondWithResult(_0x220477,null))[_0x7b05('0x43')](handleError(_0x220477,null));};exports['create']=function(_0x2ae07a,_0x14d2c1){return db[_0x7b05('0x29')]['create'](_0x2ae07a['body'],{})[_0x7b05('0x40')](respondWithResult(_0x14d2c1,0xc9))[_0x7b05('0x43')](handleError(_0x14d2c1,null));};exports[_0x7b05('0x47')]=function(_0x7a5928,_0x4258db){return db[_0x7b05('0x29')][_0x7b05('0x47')](_0x7a5928[_0x7b05('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4258db,0xc9))[_0x7b05('0x43')](handleError(_0x4258db,null));};exports[_0x7b05('0x23')]=function(_0x779944,_0x4b2646){if(_0x779944[_0x7b05('0x48')]['id']){delete _0x779944[_0x7b05('0x48')]['id'];}return db[_0x7b05('0x29')][_0x7b05('0x46')]({'where':{'id':_0x779944[_0x7b05('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b2646,null))[_0x7b05('0x40')](saveUpdates(_0x779944[_0x7b05('0x48')],null))[_0x7b05('0x40')](respondWithResult(_0x4b2646,null))[_0x7b05('0x43')](handleError(_0x4b2646,null));};exports[_0x7b05('0x24')]=function(_0x2380da,_0x5f494d){return db[_0x7b05('0x29')]['find']({'where':{'id':_0x2380da[_0x7b05('0x45')]['id']}})[_0x7b05('0x40')](handleEntityNotFound(_0x5f494d,null))[_0x7b05('0x40')](removeEntity(_0x5f494d,null))[_0x7b05('0x43')](handleError(_0x5f494d,null));};exports['bulkDestroy']=function(_0x51b28a,_0x1bef95){return db[_0x7b05('0x29')]['destroy']({'where':{'id':_0x51b28a[_0x7b05('0x2e')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1bef95,0xcc))[_0x7b05('0x43')](handleError(_0x1bef95,null));};exports[_0x7b05('0x49')]=function(_0x48e860,_0x3988b1,_0x59d71e){return db[_0x7b05('0x4a')][_0x7b05('0x4b')]({'where':{'id':_0x48e860['params']['id']}})[_0x7b05('0x40')](handleEntityNotFound(_0x3988b1,null))['then'](function(_0x27b656){if(_0x27b656){return db[_0x7b05('0x4c')]['transaction'](function(_0x2e958e){return db['AnalyticFieldReport'][_0x7b05('0x24')]({'where':{'CustomReportId':_0x48e860['params']['id']},'transaction':_0x2e958e})['then'](function(_0x6a821a){var _0x394d6e=_['map'](_0x48e860['body'],function(_0x3ba940){delete _0x3ba940['id'];_0x3ba940['CustomReportId']=_0x48e860[_0x7b05('0x45')]['id'];return _0x3ba940;});return db[_0x7b05('0x29')][_0x7b05('0x47')](_0x394d6e,{'transaction':_0x2e958e});});})[_0x7b05('0x40')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x48e860[_0x7b05('0x45')]['id']}});});}})[_0x7b05('0x40')](respondWithResult(_0x3988b1,null))[_0x7b05('0x43')](handleError(_0x3988b1,null));};
\ No newline at end of file
+var _0xc391=['findAll','rows','show','params','keys','rawAttributes','intersection','include','options','catch','create','body','bulkCreate','find','bulkDestroy','destroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','status','error','stack','name','send','index','map','AnalyticFieldReport','type','model','query','filters','fields','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll'];(function(_0xec1b0,_0x3e6c72){var _0x86aab1=function(_0xacfda){while(--_0xacfda){_0xec1b0['push'](_0xec1b0['shift']());}};_0x86aab1(++_0x3e6c72);}(_0xc391,0x115));var _0x1c39=function(_0x345902,_0x7bd064){_0x345902=_0x345902-0x0;var _0x397297=_0xc391[_0x345902];return _0x397297;};'use strict';var emlformat=require(_0x1c39('0x0'));var rimraf=require(_0x1c39('0x1'));var zipdir=require(_0x1c39('0x2'));var jsonpatch=require(_0x1c39('0x3'));var rp=require('request-promise');var moment=require(_0x1c39('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1c39('0x5'));var util=require('util');var path=require(_0x1c39('0x6'));var sox=require(_0x1c39('0x7'));var csv=require('to-csv');var ejs=require(_0x1c39('0x8'));var fs=require('fs');var fs_extra=require(_0x1c39('0x9'));var _=require(_0x1c39('0xa'));var squel=require(_0x1c39('0xb'));var crypto=require(_0x1c39('0xc'));var jsforce=require(_0x1c39('0xd'));var deskjs=require(_0x1c39('0xe'));var toCsv=require(_0x1c39('0xf'));var querystring=require(_0x1c39('0x10'));var Papa=require(_0x1c39('0x11'));var Redis=require('ioredis');var authService=require(_0x1c39('0x12'));var qs=require(_0x1c39('0x13'));var as=require(_0x1c39('0x14'));var hardwareService=require(_0x1c39('0x15'));var logger=require(_0x1c39('0x16'))(_0x1c39('0x17'));var utils=require(_0x1c39('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1c39('0x19'))['db'];function respondWithStatusCode(_0x13ddf1,_0x4745da){_0x4745da=_0x4745da||0xcc;return function(_0x314498){if(_0x314498){return _0x13ddf1[_0x1c39('0x1a')](_0x4745da);}return _0x13ddf1['status'](_0x4745da)[_0x1c39('0x1b')]();};}function respondWithResult(_0x322041,_0x5f3c1c){_0x5f3c1c=_0x5f3c1c||0xc8;return function(_0x3964a6){if(_0x3964a6){return _0x322041['status'](_0x5f3c1c)['json'](_0x3964a6);}};}function respondWithFilteredResult(_0x2de445,_0x6ebb82){return function(_0x30fb3a){if(_0x30fb3a){var _0x30f522=typeof _0x6ebb82['offset']===_0x1c39('0x1c')&&typeof _0x6ebb82[_0x1c39('0x1d')]==='undefined';var _0x10240b=_0x30fb3a[_0x1c39('0x1e')];var _0x40050e=_0x30f522?0x0:_0x6ebb82['offset'];var _0x57878d=_0x30f522?_0x30fb3a['count']:_0x6ebb82['offset']+_0x6ebb82[_0x1c39('0x1d')];var _0x45ff86;if(_0x57878d>=_0x10240b){_0x57878d=_0x10240b;_0x45ff86=0xc8;}else{_0x45ff86=0xce;}_0x2de445['status'](_0x45ff86);return _0x2de445[_0x1c39('0x1f')](_0x1c39('0x20'),_0x40050e+'-'+_0x57878d+'/'+_0x10240b)['json'](_0x30fb3a);}return null;};}function patchUpdates(_0x14fd7f){return function(_0x131161){try{jsonpatch[_0x1c39('0x21')](_0x131161,_0x14fd7f,!![]);}catch(_0x102223){return BPromise[_0x1c39('0x22')](_0x102223);}return _0x131161[_0x1c39('0x23')]();};}function saveUpdates(_0x1770bc,_0x350d72){return function(_0x437be6){if(_0x437be6){return _0x437be6[_0x1c39('0x24')](_0x1770bc)[_0x1c39('0x25')](function(_0x2ff992){return _0x2ff992;});}return null;};}function removeEntity(_0x1b8224,_0xe3c8d4){return function(_0x1cd7f7){if(_0x1cd7f7){return _0x1cd7f7['destroy']()[_0x1c39('0x25')](function(){_0x1b8224[_0x1c39('0x26')](0xcc)[_0x1c39('0x1b')]();});}};}function handleEntityNotFound(_0x430202,_0x369689){return function(_0x1aafb4){if(!_0x1aafb4){_0x430202['sendStatus'](0x194);}return _0x1aafb4;};}function handleError(_0x1e656c,_0x133c7a){_0x133c7a=_0x133c7a||0x1f4;return function(_0x517552){logger[_0x1c39('0x27')](_0x517552[_0x1c39('0x28')]);if(_0x517552[_0x1c39('0x29')]){delete _0x517552[_0x1c39('0x29')];}_0x1e656c[_0x1c39('0x26')](_0x133c7a)[_0x1c39('0x2a')](_0x517552);};}exports[_0x1c39('0x2b')]=function(_0x301ab4,_0x327d54){var _0x349c39={},_0xfb2cb5={},_0x4743e7={'count':0x0,'rows':[]};var _0x1335ae=_[_0x1c39('0x2c')](db[_0x1c39('0x2d')]['rawAttributes'],function(_0x4f5d22){return{'name':_0x4f5d22['fieldName'],'type':_0x4f5d22[_0x1c39('0x2e')]['key']};});_0xfb2cb5[_0x1c39('0x2f')]=_['map'](_0x1335ae,'name');_0xfb2cb5['query']=_['keys'](_0x301ab4[_0x1c39('0x30')]);_0xfb2cb5[_0x1c39('0x31')]=_['intersection'](_0xfb2cb5[_0x1c39('0x2f')],_0xfb2cb5[_0x1c39('0x30')]);_0x349c39['attributes']=_['intersection'](_0xfb2cb5['model'],qs[_0x1c39('0x32')](_0x301ab4[_0x1c39('0x30')][_0x1c39('0x32')]));_0x349c39[_0x1c39('0x33')]=_0x349c39[_0x1c39('0x33')][_0x1c39('0x34')]?_0x349c39[_0x1c39('0x33')]:_0xfb2cb5[_0x1c39('0x2f')];if(!_0x301ab4[_0x1c39('0x30')][_0x1c39('0x35')]('nolimit')){_0x349c39[_0x1c39('0x1d')]=qs[_0x1c39('0x1d')](_0x301ab4[_0x1c39('0x30')][_0x1c39('0x1d')]);_0x349c39[_0x1c39('0x36')]=qs[_0x1c39('0x36')](_0x301ab4[_0x1c39('0x30')][_0x1c39('0x36')]);}_0x349c39[_0x1c39('0x37')]=qs['sort'](_0x301ab4[_0x1c39('0x30')][_0x1c39('0x38')]);_0x349c39[_0x1c39('0x39')]=qs[_0x1c39('0x31')](_[_0x1c39('0x3a')](_0x301ab4['query'],_0xfb2cb5['filters']),_0x1335ae);if(_0x301ab4['query'][_0x1c39('0x3b')]){_0x349c39[_0x1c39('0x39')]=_[_0x1c39('0x3c')](_0x349c39['where'],{'$or':_[_0x1c39('0x2c')](_0x1335ae,function(_0x47e421){if(_0x47e421[_0x1c39('0x2e')]!==_0x1c39('0x3d')){var _0x576b0e={};_0x576b0e[_0x47e421[_0x1c39('0x29')]]={'$like':'%'+_0x301ab4['query']['filter']+'%'};return _0x576b0e;}})});}_0x349c39=_[_0x1c39('0x3c')]({},_0x349c39,_0x301ab4['options']);var _0x1956ca={'where':_0x349c39[_0x1c39('0x39')]};return db['AnalyticFieldReport'][_0x1c39('0x1e')](_0x1956ca)[_0x1c39('0x25')](function(_0x490694){_0x4743e7['count']=_0x490694;if(_0x301ab4[_0x1c39('0x30')][_0x1c39('0x3e')]){_0x349c39['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x1c39('0x3f')](_0x349c39);})[_0x1c39('0x25')](function(_0x314579){_0x4743e7[_0x1c39('0x40')]=_0x314579;return _0x4743e7;})[_0x1c39('0x25')](respondWithFilteredResult(_0x327d54,_0x349c39))['catch'](handleError(_0x327d54,null));};exports[_0x1c39('0x41')]=function(_0x51b145,_0x4cab8e){var _0x46ff99={'raw':![],'where':{'id':_0x51b145[_0x1c39('0x42')]['id']}},_0x297077={};_0x297077['model']=_[_0x1c39('0x43')](db[_0x1c39('0x2d')][_0x1c39('0x44')]);_0x297077[_0x1c39('0x30')]=_[_0x1c39('0x43')](_0x51b145[_0x1c39('0x30')]);_0x297077[_0x1c39('0x31')]=_[_0x1c39('0x45')](_0x297077[_0x1c39('0x2f')],_0x297077[_0x1c39('0x30')]);_0x46ff99[_0x1c39('0x33')]=_['intersection'](_0x297077['model'],qs['fields'](_0x51b145['query']['fields']));_0x46ff99[_0x1c39('0x33')]=_0x46ff99[_0x1c39('0x33')][_0x1c39('0x34')]?_0x46ff99['attributes']:_0x297077[_0x1c39('0x2f')];if(_0x51b145[_0x1c39('0x30')][_0x1c39('0x3e')]){_0x46ff99[_0x1c39('0x46')]=[{'all':!![]}];}_0x46ff99=_[_0x1c39('0x3c')]({},_0x46ff99,_0x51b145[_0x1c39('0x47')]);return db[_0x1c39('0x2d')]['find'](_0x46ff99)[_0x1c39('0x25')](handleEntityNotFound(_0x4cab8e,null))['then'](respondWithResult(_0x4cab8e,null))[_0x1c39('0x48')](handleError(_0x4cab8e,null));};exports[_0x1c39('0x49')]=function(_0x4ad0c0,_0x4a7f08){return db[_0x1c39('0x2d')][_0x1c39('0x49')](_0x4ad0c0[_0x1c39('0x4a')],{})[_0x1c39('0x25')](respondWithResult(_0x4a7f08,0xc9))[_0x1c39('0x48')](handleError(_0x4a7f08,null));};exports['bulkCreate']=function(_0x2d096f,_0x321ea0){return db['AnalyticFieldReport'][_0x1c39('0x4b')](_0x2d096f[_0x1c39('0x4a')],{'raw':![],'individualHooks':!![]})[_0x1c39('0x25')](respondWithResult(_0x321ea0,0xc9))[_0x1c39('0x48')](handleError(_0x321ea0,null));};exports[_0x1c39('0x24')]=function(_0x2fef77,_0x1e58c0){if(_0x2fef77[_0x1c39('0x4a')]['id']){delete _0x2fef77[_0x1c39('0x4a')]['id'];}return db[_0x1c39('0x2d')][_0x1c39('0x4c')]({'where':{'id':_0x2fef77['params']['id']}})['then'](handleEntityNotFound(_0x1e58c0,null))['then'](saveUpdates(_0x2fef77['body'],null))[_0x1c39('0x25')](respondWithResult(_0x1e58c0,null))[_0x1c39('0x48')](handleError(_0x1e58c0,null));};exports['destroy']=function(_0x111a89,_0x23c57d){return db[_0x1c39('0x2d')][_0x1c39('0x4c')]({'where':{'id':_0x111a89[_0x1c39('0x42')]['id']}})['then'](handleEntityNotFound(_0x23c57d,null))[_0x1c39('0x25')](removeEntity(_0x23c57d,null))[_0x1c39('0x48')](handleError(_0x23c57d,null));};exports[_0x1c39('0x4d')]=function(_0x1b9c6f,_0x910a61){return db[_0x1c39('0x2d')][_0x1c39('0x4e')]({'where':{'id':_0x1b9c6f[_0x1c39('0x30')][_0x1c39('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x1c39('0x25')](respondWithResult(_0x910a61,0xcc))[_0x1c39('0x48')](handleError(_0x910a61,null));};exports['addFields']=function(_0x1428c5,_0x54506d,_0x536cb2){return db[_0x1c39('0x50')][_0x1c39('0x51')]({'where':{'id':_0x1428c5[_0x1c39('0x42')]['id']}})['then'](handleEntityNotFound(_0x54506d,null))[_0x1c39('0x25')](function(_0xbdd5e2){if(_0xbdd5e2){return db[_0x1c39('0x52')][_0x1c39('0x53')](function(_0x727524){return db['AnalyticFieldReport'][_0x1c39('0x4e')]({'where':{'CustomReportId':_0x1428c5[_0x1c39('0x42')]['id']},'transaction':_0x727524})[_0x1c39('0x25')](function(_0x517293){var _0x100a0c=_[_0x1c39('0x2c')](_0x1428c5['body'],function(_0x289eaf){delete _0x289eaf['id'];_0x289eaf[_0x1c39('0x54')]=_0x1428c5['params']['id'];return _0x289eaf;});return db[_0x1c39('0x2d')][_0x1c39('0x4b')](_0x100a0c,{'transaction':_0x727524});});})['then'](function(){return db['AnalyticFieldReport'][_0x1c39('0x3f')]({'where':{'CustomReportId':_0x1428c5['params']['id']}});});}})['then'](respondWithResult(_0x54506d,null))[_0x1c39('0x48')](handleError(_0x54506d,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index b3f756c..5e2e008 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 _0x19f8=['define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','path','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0x19f8,0xad));var _0x819f=function(_0x3acb67,_0xbe0faa){_0x3acb67=_0x3acb67-0x0;var _0x534936=_0x19f8[_0x3acb67];return _0x534936;};'use strict';var _=require(_0x819f('0x0'));var util=require(_0x819f('0x1'));var logger=require(_0x819f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x819f('0x3'));var rimraf=require('rimraf');var config=require(_0x819f('0x4'));var attributes=require(_0x819f('0x5'));module[_0x819f('0x6')]=function(_0x398af0,_0x29f4c3){return _0x398af0[_0x819f('0x7')](_0x819f('0x8'),attributes,{'tableName':_0x819f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x10dc=['path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','bluebird','request-promise'];(function(_0x319df2,_0x4085fb){var _0x41f9df=function(_0x8b9a53){while(--_0x8b9a53){_0x319df2['push'](_0x319df2['shift']());}};_0x41f9df(++_0x4085fb);}(_0x10dc,0x1ce));var _0xc10d=function(_0x493c7a,_0x30ea93){_0x493c7a=_0x493c7a-0x0;var _0x1ad499=_0x10dc[_0x493c7a];return _0x1ad499;};'use strict';var _=require(_0xc10d('0x0'));var util=require(_0xc10d('0x1'));var logger=require('../../config/logger')(_0xc10d('0x2'));var moment=require(_0xc10d('0x3'));var BPromise=require(_0xc10d('0x4'));var rp=require(_0xc10d('0x5'));var fs=require('fs');var path=require(_0xc10d('0x6'));var rimraf=require('rimraf');var config=require(_0xc10d('0x7'));var attributes=require(_0xc10d('0x8'));module[_0xc10d('0x9')]=function(_0x50dc39,_0xd5a77a){return _0x50dc39[_0xc10d('0xa')](_0xc10d('0xb'),attributes,{'tableName':_0xc10d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 6a23bfe..368c674 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 _0xb517=['error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x21eb73,_0x2816ef){var _0x15817a=function(_0x109cc7){while(--_0x109cc7){_0x21eb73['push'](_0x21eb73['shift']());}};_0x15817a(++_0x2816ef);}(_0xb517,0x1d0));var _0x7b51=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0xb517[_0x291f8b];return _0x275171;};'use strict';var _=require('lodash');var util=require(_0x7b51('0x0'));var moment=require(_0x7b51('0x1'));var BPromise=require(_0x7b51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b51('0x3'));var db=require(_0x7b51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b51('0x5'))(_0x7b51('0x6'));var config=require('../../config/environment');var jayson=require(_0x7b51('0x7'));var client=jayson[_0x7b51('0x8')][_0x7b51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1da9f5,_0x113422,_0x52d9ea){return new BPromise(function(_0x164a25,_0x4dcda8){return client[_0x7b51('0xa')](_0x1da9f5,_0x52d9ea)[_0x7b51('0xb')](function(_0x2da363){logger[_0x7b51('0xc')](_0x7b51('0xd'),_0x113422,_0x7b51('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x113422,_0x7b51('0xe'),JSON[_0x7b51('0xf')](_0x2da363));if(_0x2da363[_0x7b51('0x10')]){if(_0x2da363[_0x7b51('0x10')]['code']===0x1f4){logger[_0x7b51('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x113422,_0x2da363[_0x7b51('0x10')]['message']);return _0x4dcda8(_0x2da363[_0x7b51('0x10')]['message']);}logger[_0x7b51('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x113422,_0x2da363['error'][_0x7b51('0x11')]);return _0x164a25(_0x2da363[_0x7b51('0x10')][_0x7b51('0x11')]);}else{logger['info'](_0x7b51('0xd'),_0x113422,_0x7b51('0xe'));_0x164a25(_0x2da363[_0x7b51('0x12')][_0x7b51('0x11')]);}})[_0x7b51('0x13')](function(_0x244cb9){logger[_0x7b51('0x10')](_0x7b51('0xd'),_0x113422,_0x244cb9);_0x4dcda8(_0x244cb9);});});}
\ No newline at end of file
+var _0x1f51=['message','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x265562,_0x1c42a8){var _0x120af5=function(_0x165f0d){while(--_0x165f0d){_0x265562['push'](_0x265562['shift']());}};_0x120af5(++_0x1c42a8);}(_0x1f51,0x1ea));var _0x11f5=function(_0x5b5641,_0x439102){_0x5b5641=_0x5b5641-0x0;var _0xb51db1=_0x1f51[_0x5b5641];return _0xb51db1;};'use strict';var _=require(_0x11f5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x11f5('0x1'));var rs=require(_0x11f5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11f5('0x3'))['db'];var utils=require(_0x11f5('0x4'));var logger=require('../../config/logger')(_0x11f5('0x5'));var config=require(_0x11f5('0x6'));var jayson=require(_0x11f5('0x7'));var client=jayson['client'][_0x11f5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33c5bf,_0x1c0f1a,_0x369397){return new BPromise(function(_0x3b452f,_0x5eda88){return client['request'](_0x33c5bf,_0x369397)['then'](function(_0x1532fb){logger['info'](_0x11f5('0x9'),_0x1c0f1a,_0x11f5('0xa'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1c0f1a,_0x11f5('0xa'),JSON[_0x11f5('0xb')](_0x1532fb));if(_0x1532fb[_0x11f5('0xc')]){if(_0x1532fb[_0x11f5('0xc')][_0x11f5('0xd')]===0x1f4){logger[_0x11f5('0xc')](_0x11f5('0x9'),_0x1c0f1a,_0x1532fb[_0x11f5('0xc')][_0x11f5('0xe')]);return _0x5eda88(_0x1532fb[_0x11f5('0xc')][_0x11f5('0xe')]);}logger['error'](_0x11f5('0x9'),_0x1c0f1a,_0x1532fb[_0x11f5('0xc')]['message']);return _0x3b452f(_0x1532fb[_0x11f5('0xc')]['message']);}else{logger[_0x11f5('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1c0f1a,_0x11f5('0xa'));_0x3b452f(_0x1532fb[_0x11f5('0x10')]['message']);}})[_0x11f5('0x11')](function(_0x1a675b){logger['error'](_0x11f5('0x9'),_0x1c0f1a,_0x1a675b);_0x5eda88(_0x1a675b);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 8e0f766..dbb0e5c 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(_0x31b812,_0x212b99){var _0x15a5c9=function(_0x5a6088){while(--_0x5a6088){_0x31b812['push'](_0x31b812['shift']());}};_0x15a5c9(++_0x212b99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x1c8caf,_0x49bd2a){var _0x1ff482=function(_0x470261){while(--_0x470261){_0x1c8caf['push'](_0x1c8caf['shift']());}};_0x1ff482(++_0x49bd2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 2772bcd..7d85aab 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 _0x639a=['exports','STRING','name','TEXT'];(function(_0x243e90,_0xf6cb71){var _0x3f2699=function(_0x38f76a){while(--_0x38f76a){_0x243e90['push'](_0x243e90['shift']());}};_0x3f2699(++_0xf6cb71);}(_0x639a,0xec));var _0xa639=function(_0x2c339b,_0x153b16){_0x2c339b=_0x2c339b-0x0;var _0x558a46=_0x639a[_0x2c339b];return _0x558a46;};'use strict';var Sequelize=require('sequelize');module[_0xa639('0x0')]={'name':{'type':Sequelize[_0xa639('0x1')],'allowNull':![],'unique':_0xa639('0x2')},'table':{'type':Sequelize[_0xa639('0x1')]},'metric':{'type':Sequelize[_0xa639('0x3')]},'description':{'type':Sequelize[_0xa639('0x1')]}};
\ No newline at end of file
+var _0x3a79=['TEXT','exports','STRING'];(function(_0x8c8eb7,_0x12393f){var _0x15b190=function(_0x5f14a7){while(--_0x5f14a7){_0x8c8eb7['push'](_0x8c8eb7['shift']());}};_0x15b190(++_0x12393f);}(_0x3a79,0xca));var _0x93a7=function(_0x4433db,_0x42d308){_0x4433db=_0x4433db-0x0;var _0x38bbe9=_0x3a79[_0x4433db];return _0x38bbe9;};'use strict';var Sequelize=require('sequelize');module[_0x93a7('0x0')]={'name':{'type':Sequelize[_0x93a7('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x93a7('0x1')]},'metric':{'type':Sequelize[_0x93a7('0x2')]},'description':{'type':Sequelize[_0x93a7('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index ccccfb9..491d86a 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 _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x20bf8b,_0xd36fdc){var _0x1a9de7=function(_0x1d0dff){while(--_0x1d0dff){_0x20bf8b['push'](_0x20bf8b['shift']());}};_0x1a9de7(++_0xd36fdc);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x34c2d4,_0x418ed2){_0x34c2d4=_0x34c2d4-0x0;var _0x38796a=_0x7fbe[_0x34c2d4];return _0x38796a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
+var _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x3163ec,_0x45662c){var _0x4e6b04=function(_0x387051){while(--_0x387051){_0x3163ec['push'](_0x3163ec['shift']());}};_0x4e6b04(++_0x45662c);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x00bb[_0x4e9628];return _0x27bc8c;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 729a830..7ca6289 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 _0x3f1c=['AnalyticMetric','analytics_metrics','lodash','api','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','define'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x2ea0a2,_0xeadd1a){_0x2ea0a2=_0x2ea0a2-0x0;var _0x3d8b3c=_0x3f1c[_0x2ea0a2];return _0x3d8b3c;};'use strict';var _=require(_0xc3f1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3f1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc3f1('0x2'));var fs=require('fs');var path=require(_0xc3f1('0x3'));var rimraf=require(_0xc3f1('0x4'));var config=require(_0xc3f1('0x5'));var attributes=require(_0xc3f1('0x6'));module['exports']=function(_0x12e78a,_0x4ebd4c){return _0x12e78a[_0xc3f1('0x7')](_0xc3f1('0x8'),attributes,{'tableName':_0xc3f1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a14=['define','AnalyticMetric','analytics_metrics','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a14,0xa8));var _0x49a1=function(_0x24282f,_0xdec5f4){_0x24282f=_0x24282f-0x0;var _0x4d6c63=_0x9a14[_0x24282f];return _0x4d6c63;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49a1('0x0'))(_0x49a1('0x1'));var moment=require(_0x49a1('0x2'));var BPromise=require(_0x49a1('0x3'));var rp=require(_0x49a1('0x4'));var fs=require('fs');var path=require(_0x49a1('0x5'));var rimraf=require(_0x49a1('0x6'));var config=require(_0x49a1('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x479018,_0x5283aa){return _0x479018[_0x49a1('0x8')](_0x49a1('0x9'),attributes,{'tableName':_0x49a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 78b5178..4adcf7c 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 _0x6b30=['error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x35e083,_0x3ba806){var _0x555a8a=function(_0x5a32a0){while(--_0x5a32a0){_0x35e083['push'](_0x35e083['shift']());}};_0x555a8a(++_0x3ba806);}(_0x6b30,0x14b));var _0x06b3=function(_0x30bd01,_0x557a2c){_0x30bd01=_0x30bd01-0x0;var _0x44cdc3=_0x6b30[_0x30bd01];return _0x44cdc3;};'use strict';var _=require(_0x06b3('0x0'));var util=require(_0x06b3('0x1'));var moment=require(_0x06b3('0x2'));var BPromise=require(_0x06b3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x06b3('0x5'));var logger=require(_0x06b3('0x6'))(_0x06b3('0x7'));var config=require(_0x06b3('0x8'));var jayson=require(_0x06b3('0x9'));var client=jayson[_0x06b3('0xa')][_0x06b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b228c,_0x5ca309,_0x4406d1){return new BPromise(function(_0x11f583,_0x259fe7){return client[_0x06b3('0xc')](_0x1b228c,_0x4406d1)[_0x06b3('0xd')](function(_0xf92b2e){logger[_0x06b3('0xe')](_0x06b3('0xf'),_0x5ca309,'request\x20sent');logger[_0x06b3('0x10')](_0x06b3('0x11'),_0x5ca309,'request\x20sent',JSON[_0x06b3('0x12')](_0xf92b2e));if(_0xf92b2e[_0x06b3('0x13')]){if(_0xf92b2e[_0x06b3('0x13')][_0x06b3('0x14')]===0x1f4){logger['error'](_0x06b3('0xf'),_0x5ca309,_0xf92b2e['error'][_0x06b3('0x15')]);return _0x259fe7(_0xf92b2e[_0x06b3('0x13')][_0x06b3('0x15')]);}logger[_0x06b3('0x13')](_0x06b3('0xf'),_0x5ca309,_0xf92b2e[_0x06b3('0x13')]['message']);return _0x11f583(_0xf92b2e[_0x06b3('0x13')]['message']);}else{logger[_0x06b3('0xe')](_0x06b3('0xf'),_0x5ca309,_0x06b3('0x16'));_0x11f583(_0xf92b2e[_0x06b3('0x17')][_0x06b3('0x15')]);}})[_0x06b3('0x18')](function(_0x1eb777){logger['error'](_0x06b3('0xf'),_0x5ca309,_0x1eb777);_0x259fe7(_0x1eb777);});});}
\ No newline at end of file
+var _0x4347=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2d96aa,_0x302227){var _0xba1fa1=function(_0x21ed52){while(--_0x21ed52){_0x2d96aa['push'](_0x2d96aa['shift']());}};_0xba1fa1(++_0x302227);}(_0x4347,0x13f));var _0x7434=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0x4347[_0x498334];return _0x13bb70;};'use strict';var _=require(_0x7434('0x0'));var util=require(_0x7434('0x1'));var moment=require(_0x7434('0x2'));var BPromise=require(_0x7434('0x3'));var rs=require(_0x7434('0x4'));var fs=require('fs');var Redis=require(_0x7434('0x5'));var db=require(_0x7434('0x6'))['db'];var utils=require(_0x7434('0x7'));var logger=require(_0x7434('0x8'))(_0x7434('0x9'));var config=require('../../config/environment');var jayson=require(_0x7434('0xa'));var client=jayson[_0x7434('0xb')][_0x7434('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52272f,_0x445768,_0x3f986b){return new BPromise(function(_0x31ed6c,_0x1dfa88){return client['request'](_0x52272f,_0x3f986b)[_0x7434('0xd')](function(_0x2e4f47){logger[_0x7434('0xe')](_0x7434('0xf'),_0x445768,'request\x20sent');logger[_0x7434('0x10')](_0x7434('0x11'),_0x445768,_0x7434('0x12'),JSON[_0x7434('0x13')](_0x2e4f47));if(_0x2e4f47[_0x7434('0x14')]){if(_0x2e4f47[_0x7434('0x14')][_0x7434('0x15')]===0x1f4){logger['error'](_0x7434('0xf'),_0x445768,_0x2e4f47['error'][_0x7434('0x16')]);return _0x1dfa88(_0x2e4f47[_0x7434('0x14')][_0x7434('0x16')]);}logger[_0x7434('0x14')](_0x7434('0xf'),_0x445768,_0x2e4f47[_0x7434('0x14')][_0x7434('0x16')]);return _0x31ed6c(_0x2e4f47['error'][_0x7434('0x16')]);}else{logger[_0x7434('0xe')](_0x7434('0xf'),_0x445768,_0x7434('0x12'));_0x31ed6c(_0x2e4f47[_0x7434('0x17')][_0x7434('0x16')]);}})[_0x7434('0x18')](function(_0x4a83f5){logger['error'](_0x7434('0xf'),_0x445768,_0x4a83f5);_0x1dfa88(_0x4a83f5);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index e92edff..a69d04d 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 _0x3eea=['get','isAuthenticated','/:id','show','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x54a25e,_0x10311c){var _0x4f4d2b=function(_0x4f587a){while(--_0x4f587a){_0x54a25e['push'](_0x54a25e['shift']());}};_0x4f4d2b(++_0x10311c);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x19df14,_0x15cd6e){_0x19df14=_0x19df14-0x0;var _0x143c54=_0x3eea[_0x19df14];return _0x143c54;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')]('/',auth[_0xa3ee('0xb')](),controller['index']);router['get'](_0xa3ee('0xc'),auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['post']('/',auth[_0xa3ee('0xb')](),controller['create']);router[_0xa3ee('0xe')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0xf')]);router[_0xa3ee('0x10')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x861a=['put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x47df54,_0x1aeb61){var _0x261b87=function(_0x54bc77){while(--_0x54bc77){_0x47df54['push'](_0x47df54['shift']());}};_0x261b87(++_0x1aeb61);}(_0x861a,0x194));var _0xa861=function(_0x95ec8a,_0x2acf88){_0x95ec8a=_0x95ec8a-0x0;var _0x5e17b0=_0x861a[_0x95ec8a];return _0x5e17b0;};'use strict';var multer=require(_0xa861('0x0'));var util=require('util');var path=require(_0xa861('0x1'));var timeout=require(_0xa861('0x2'));var express=require(_0xa861('0x3'));var router=express[_0xa861('0x4')]();var fs_extra=require(_0xa861('0x5'));var auth=require(_0xa861('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa861('0x7'));var controller=require(_0xa861('0x8'));router[_0xa861('0x9')]('/',auth[_0xa861('0xa')](),controller[_0xa861('0xb')]);router['get'](_0xa861('0xc'),auth[_0xa861('0xa')](),controller[_0xa861('0xd')]);router[_0xa861('0xe')]('/',auth[_0xa861('0xa')](),controller[_0xa861('0xf')]);router[_0xa861('0x10')](_0xa861('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa861('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa861('0x12')]);module[_0xa861('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 1285a37..2338178 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 _0xbf9a=['exports','TEXT'];(function(_0x4c4c86,_0x28a958){var _0x282ef8=function(_0x2f50f7){while(--_0x2f50f7){_0x4c4c86['push'](_0x4c4c86['shift']());}};_0x282ef8(++_0x28a958);}(_0xbf9a,0x18c));var _0xabf9=function(_0x2998db,_0x3424f1){_0x2998db=_0x2998db-0x0;var _0x115fea=_0xbf9a[_0x2998db];return _0x115fea;};'use strict';var Sequelize=require('sequelize');module[_0xabf9('0x0')]={'tree':{'type':Sequelize[_0xabf9('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x613c=['exports','sequelize'];(function(_0x5b4191,_0x127ecd){var _0x6da169=function(_0x18d387){while(--_0x18d387){_0x5b4191['push'](_0x5b4191['shift']());}};_0x6da169(++_0x127ecd);}(_0x613c,0xd9));var _0xc613=function(_0x1aa726,_0x2f4234){_0x1aa726=_0x1aa726-0x0;var _0x704281=_0x613c[_0x1aa726];return _0x704281;};'use strict';var Sequelize=require(_0xc613('0x0'));module[_0xc613('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 1663d95..18d8bf7 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 _0x9057=['destroy','then','error','stack','name','send','map','fieldName','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','params','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','update'];(function(_0x29f2e7,_0x31287f){var _0x382f7b=function(_0x5bf241){while(--_0x5bf241){_0x29f2e7['push'](_0x29f2e7['shift']());}};_0x382f7b(++_0x31287f);}(_0x9057,0x154));var _0x7905=function(_0x101134,_0x1ed1d3){_0x101134=_0x101134-0x0;var _0xc47acc=_0x9057[_0x101134];return _0xc47acc;};'use strict';var emlformat=require(_0x7905('0x0'));var rimraf=require(_0x7905('0x1'));var zipdir=require(_0x7905('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7905('0x3'));var moment=require(_0x7905('0x4'));var BPromise=require(_0x7905('0x5'));var Mustache=require(_0x7905('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7905('0x7'));var csv=require(_0x7905('0x8'));var ejs=require(_0x7905('0x9'));var fs=require('fs');var fs_extra=require(_0x7905('0xa'));var _=require(_0x7905('0xb'));var squel=require('squel');var crypto=require(_0x7905('0xc'));var jsforce=require(_0x7905('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7905('0x8'));var querystring=require('querystring');var Papa=require(_0x7905('0xe'));var Redis=require(_0x7905('0xf'));var authService=require(_0x7905('0x10'));var qs=require(_0x7905('0x11'));var as=require(_0x7905('0x12'));var hardwareService=require(_0x7905('0x13'));var logger=require(_0x7905('0x14'))(_0x7905('0x15'));var utils=require(_0x7905('0x16'));var config=require(_0x7905('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bd483,_0x180c13){_0x180c13=_0x180c13||0xcc;return function(_0x2fb1dd){if(_0x2fb1dd){return _0x3bd483[_0x7905('0x18')](_0x180c13);}return _0x3bd483[_0x7905('0x19')](_0x180c13)[_0x7905('0x1a')]();};}function respondWithResult(_0x37f885,_0x49916c){_0x49916c=_0x49916c||0xc8;return function(_0x31725f){if(_0x31725f){return _0x37f885[_0x7905('0x19')](_0x49916c)[_0x7905('0x1b')](_0x31725f);}};}function respondWithFilteredResult(_0x425ae6,_0x40db76){return function(_0x1daf8a){if(_0x1daf8a){var _0x3e5b0c=typeof _0x40db76[_0x7905('0x1c')]==='undefined'&&typeof _0x40db76[_0x7905('0x1d')]===_0x7905('0x1e');var _0x5670a6=_0x1daf8a[_0x7905('0x1f')];var _0x57cd80=_0x3e5b0c?0x0:_0x40db76[_0x7905('0x1c')];var _0x6eb6f4=_0x3e5b0c?_0x1daf8a[_0x7905('0x1f')]:_0x40db76[_0x7905('0x1c')]+_0x40db76[_0x7905('0x1d')];var _0x157c22;if(_0x6eb6f4>=_0x5670a6){_0x6eb6f4=_0x5670a6;_0x157c22=0xc8;}else{_0x157c22=0xce;}_0x425ae6[_0x7905('0x19')](_0x157c22);return _0x425ae6['set'](_0x7905('0x20'),_0x57cd80+'-'+_0x6eb6f4+'/'+_0x5670a6)[_0x7905('0x1b')](_0x1daf8a);}return null;};}function patchUpdates(_0x2f72a5){return function(_0x555d37){try{jsonpatch['apply'](_0x555d37,_0x2f72a5,!![]);}catch(_0x53e719){return BPromise[_0x7905('0x21')](_0x53e719);}return _0x555d37['save']();};}function saveUpdates(_0x2e08c9,_0x136a2a){return function(_0x152f55){if(_0x152f55){return _0x152f55[_0x7905('0x22')](_0x2e08c9)['then'](function(_0x3dfdb3){return _0x3dfdb3;});}return null;};}function removeEntity(_0x2c1f85,_0x5daa8e){return function(_0x103a1b){if(_0x103a1b){return _0x103a1b[_0x7905('0x23')]()[_0x7905('0x24')](function(){_0x2c1f85[_0x7905('0x19')](0xcc)[_0x7905('0x1a')]();});}};}function handleEntityNotFound(_0x5daac2,_0x5a884e){return function(_0x2d0bc0){if(!_0x2d0bc0){_0x5daac2['sendStatus'](0x194);}return _0x2d0bc0;};}function handleError(_0x2a7619,_0x3c5b22){_0x3c5b22=_0x3c5b22||0x1f4;return function(_0x301785){logger[_0x7905('0x25')](_0x301785[_0x7905('0x26')]);if(_0x301785['name']){delete _0x301785[_0x7905('0x27')];}_0x2a7619['status'](_0x3c5b22)[_0x7905('0x28')](_0x301785);};}exports['index']=function(_0x5975ff,_0x3ddaf7){var _0x25ecce={},_0x54ac26={},_0x2401fb={'count':0x0,'rows':[]};var _0x2c81c0=_[_0x7905('0x29')](db['AnalyticTreeReport']['rawAttributes'],function(_0x5a03a8){return{'name':_0x5a03a8[_0x7905('0x2a')],'type':_0x5a03a8['type'][_0x7905('0x2b')]};});_0x54ac26['model']=_['map'](_0x2c81c0,_0x7905('0x27'));_0x54ac26[_0x7905('0x2c')]=_[_0x7905('0x2d')](_0x5975ff[_0x7905('0x2c')]);_0x54ac26[_0x7905('0x2e')]=_[_0x7905('0x2f')](_0x54ac26['model'],_0x54ac26[_0x7905('0x2c')]);_0x25ecce[_0x7905('0x30')]=_[_0x7905('0x2f')](_0x54ac26['model'],qs[_0x7905('0x31')](_0x5975ff[_0x7905('0x2c')][_0x7905('0x31')]));_0x25ecce[_0x7905('0x30')]=_0x25ecce['attributes'][_0x7905('0x32')]?_0x25ecce['attributes']:_0x54ac26[_0x7905('0x33')];if(!_0x5975ff[_0x7905('0x2c')][_0x7905('0x34')](_0x7905('0x35'))){_0x25ecce['limit']=qs['limit'](_0x5975ff[_0x7905('0x2c')][_0x7905('0x1d')]);_0x25ecce[_0x7905('0x1c')]=qs[_0x7905('0x1c')](_0x5975ff[_0x7905('0x2c')][_0x7905('0x1c')]);}_0x25ecce[_0x7905('0x36')]=qs[_0x7905('0x37')](_0x5975ff['query'][_0x7905('0x37')]);_0x25ecce[_0x7905('0x38')]=qs[_0x7905('0x2e')](_[_0x7905('0x39')](_0x5975ff[_0x7905('0x2c')],_0x54ac26[_0x7905('0x2e')]),_0x2c81c0);if(_0x5975ff['query'][_0x7905('0x3a')]){_0x25ecce['where']=_[_0x7905('0x3b')](_0x25ecce[_0x7905('0x38')],{'$or':_[_0x7905('0x29')](_0x2c81c0,function(_0x539424){if(_0x539424[_0x7905('0x3c')]!==_0x7905('0x3d')){var _0x2280c4={};_0x2280c4[_0x539424[_0x7905('0x27')]]={'$like':'%'+_0x5975ff[_0x7905('0x2c')]['filter']+'%'};return _0x2280c4;}})});}_0x25ecce=_[_0x7905('0x3b')]({},_0x25ecce,_0x5975ff[_0x7905('0x3e')]);var _0x4b5704={'where':_0x25ecce[_0x7905('0x38')]};return db[_0x7905('0x3f')][_0x7905('0x1f')](_0x4b5704)[_0x7905('0x24')](function(_0x1e62ec){_0x2401fb[_0x7905('0x1f')]=_0x1e62ec;if(_0x5975ff[_0x7905('0x2c')][_0x7905('0x40')]){_0x25ecce[_0x7905('0x41')]=[{'all':!![]}];}return db[_0x7905('0x3f')][_0x7905('0x42')](_0x25ecce);})['then'](function(_0xf05f56){_0x2401fb[_0x7905('0x43')]=_0xf05f56;return _0x2401fb;})[_0x7905('0x24')](respondWithFilteredResult(_0x3ddaf7,_0x25ecce))[_0x7905('0x44')](handleError(_0x3ddaf7,null));};exports[_0x7905('0x45')]=function(_0xd3d0f,_0x2c137a){var _0x362f68={'raw':!![],'where':{'id':_0xd3d0f['params']['id']}},_0x5369be={};_0x5369be[_0x7905('0x33')]=_[_0x7905('0x2d')](db['AnalyticTreeReport'][_0x7905('0x46')]);_0x5369be[_0x7905('0x2c')]=_['keys'](_0xd3d0f[_0x7905('0x2c')]);_0x5369be[_0x7905('0x2e')]=_[_0x7905('0x2f')](_0x5369be['model'],_0x5369be[_0x7905('0x2c')]);_0x362f68[_0x7905('0x30')]=_[_0x7905('0x2f')](_0x5369be[_0x7905('0x33')],qs['fields'](_0xd3d0f['query']['fields']));_0x362f68[_0x7905('0x30')]=_0x362f68[_0x7905('0x30')][_0x7905('0x32')]?_0x362f68[_0x7905('0x30')]:_0x5369be[_0x7905('0x33')];if(_0xd3d0f['query'][_0x7905('0x40')]){_0x362f68[_0x7905('0x41')]=[{'all':!![]}];}_0x362f68=_[_0x7905('0x3b')]({},_0x362f68,_0xd3d0f['options']);return db[_0x7905('0x3f')]['find'](_0x362f68)[_0x7905('0x24')](handleEntityNotFound(_0x2c137a,null))['then'](respondWithResult(_0x2c137a,null))[_0x7905('0x44')](handleError(_0x2c137a,null));};exports['create']=function(_0x382ea6,_0x1ecf31){return db['AnalyticTreeReport'][_0x7905('0x47')](_0x382ea6[_0x7905('0x48')],{})[_0x7905('0x24')](respondWithResult(_0x1ecf31,0xc9))[_0x7905('0x44')](handleError(_0x1ecf31,null));};exports[_0x7905('0x22')]=function(_0x118e2b,_0x577724){if(_0x118e2b[_0x7905('0x48')]['id']){delete _0x118e2b['body']['id'];}return db[_0x7905('0x3f')]['find']({'where':{'id':_0x118e2b[_0x7905('0x49')]['id']}})[_0x7905('0x24')](handleEntityNotFound(_0x577724,null))['then'](saveUpdates(_0x118e2b[_0x7905('0x48')],null))[_0x7905('0x24')](respondWithResult(_0x577724,null))[_0x7905('0x44')](handleError(_0x577724,null));};exports[_0x7905('0x23')]=function(_0x5c0988,_0x247325){return db[_0x7905('0x3f')][_0x7905('0x4a')]({'where':{'id':_0x5c0988[_0x7905('0x49')]['id']}})['then'](handleEntityNotFound(_0x247325,null))['then'](removeEntity(_0x247325,null))[_0x7905('0x44')](handleError(_0x247325,null));};
\ No newline at end of file
+var _0xf8b8=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','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','end','status','undefined','limit','offset','count','set','Content-Range','json','apply','then','destroy','stack','name','map','rawAttributes','fieldName','type','keys','filters','intersection','model','attributes','fields','query','hasOwnProperty','nolimit','pick','filter','merge','where','VIRTUAL','options','AnalyticTreeReport','includeAll','findAll','rows','catch','params','length','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x3b2244,_0x54873f){var _0x2dcc14=function(_0x53d73f){while(--_0x53d73f){_0x3b2244['push'](_0x3b2244['shift']());}};_0x2dcc14(++_0x54873f);}(_0xf8b8,0x165));var _0x8f8b=function(_0x5bf57f,_0x246334){_0x5bf57f=_0x5bf57f-0x0;var _0x114587=_0xf8b8[_0x5bf57f];return _0x114587;};'use strict';var emlformat=require(_0x8f8b('0x0'));var rimraf=require(_0x8f8b('0x1'));var zipdir=require(_0x8f8b('0x2'));var jsonpatch=require(_0x8f8b('0x3'));var rp=require(_0x8f8b('0x4'));var moment=require('moment');var BPromise=require(_0x8f8b('0x5'));var Mustache=require(_0x8f8b('0x6'));var util=require(_0x8f8b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8f8b('0x8'));var ejs=require(_0x8f8b('0x9'));var fs=require('fs');var fs_extra=require(_0x8f8b('0xa'));var _=require(_0x8f8b('0xb'));var squel=require('squel');var crypto=require(_0x8f8b('0xc'));var jsforce=require(_0x8f8b('0xd'));var deskjs=require(_0x8f8b('0xe'));var toCsv=require(_0x8f8b('0x8'));var querystring=require(_0x8f8b('0xf'));var Papa=require(_0x8f8b('0x10'));var Redis=require(_0x8f8b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8f8b('0x12'));var as=require(_0x8f8b('0x13'));var hardwareService=require(_0x8f8b('0x14'));var logger=require(_0x8f8b('0x15'))(_0x8f8b('0x16'));var utils=require(_0x8f8b('0x17'));var config=require(_0x8f8b('0x18'));var licenseUtil=require(_0x8f8b('0x19'));var db=require(_0x8f8b('0x1a'))['db'];function respondWithStatusCode(_0x41a1aa,_0xbc6acf){_0xbc6acf=_0xbc6acf||0xcc;return function(_0x3ed435){if(_0x3ed435){return _0x41a1aa[_0x8f8b('0x1b')](_0xbc6acf);}return _0x41a1aa['status'](_0xbc6acf)[_0x8f8b('0x1c')]();};}function respondWithResult(_0x16174e,_0x2c527f){_0x2c527f=_0x2c527f||0xc8;return function(_0x5f342f){if(_0x5f342f){return _0x16174e[_0x8f8b('0x1d')](_0x2c527f)['json'](_0x5f342f);}};}function respondWithFilteredResult(_0x20bdc9,_0x1b2814){return function(_0x16073b){if(_0x16073b){var _0x3bb2ca=typeof _0x1b2814['offset']===_0x8f8b('0x1e')&&typeof _0x1b2814[_0x8f8b('0x1f')]===_0x8f8b('0x1e');var _0x36a3e1=_0x16073b['count'];var _0x55a467=_0x3bb2ca?0x0:_0x1b2814[_0x8f8b('0x20')];var _0x2ded88=_0x3bb2ca?_0x16073b[_0x8f8b('0x21')]:_0x1b2814[_0x8f8b('0x20')]+_0x1b2814['limit'];var _0x53f169;if(_0x2ded88>=_0x36a3e1){_0x2ded88=_0x36a3e1;_0x53f169=0xc8;}else{_0x53f169=0xce;}_0x20bdc9[_0x8f8b('0x1d')](_0x53f169);return _0x20bdc9[_0x8f8b('0x22')](_0x8f8b('0x23'),_0x55a467+'-'+_0x2ded88+'/'+_0x36a3e1)[_0x8f8b('0x24')](_0x16073b);}return null;};}function patchUpdates(_0x39d965){return function(_0x25b412){try{jsonpatch[_0x8f8b('0x25')](_0x25b412,_0x39d965,!![]);}catch(_0x5551b2){return BPromise['reject'](_0x5551b2);}return _0x25b412['save']();};}function saveUpdates(_0x3e11b9,_0x409916){return function(_0x2c40e3){if(_0x2c40e3){return _0x2c40e3['update'](_0x3e11b9)[_0x8f8b('0x26')](function(_0x2c3db2){return _0x2c3db2;});}return null;};}function removeEntity(_0xc6b6a,_0x43c6f4){return function(_0x1fdf48){if(_0x1fdf48){return _0x1fdf48[_0x8f8b('0x27')]()['then'](function(){_0xc6b6a[_0x8f8b('0x1d')](0xcc)[_0x8f8b('0x1c')]();});}};}function handleEntityNotFound(_0xf7ea3c,_0x5a2983){return function(_0x21b896){if(!_0x21b896){_0xf7ea3c[_0x8f8b('0x1b')](0x194);}return _0x21b896;};}function handleError(_0x525597,_0x58bcb6){_0x58bcb6=_0x58bcb6||0x1f4;return function(_0x1d521c){logger['error'](_0x1d521c[_0x8f8b('0x28')]);if(_0x1d521c[_0x8f8b('0x29')]){delete _0x1d521c[_0x8f8b('0x29')];}_0x525597[_0x8f8b('0x1d')](_0x58bcb6)['send'](_0x1d521c);};}exports['index']=function(_0x4b80f2,_0x7718ab){var _0x924e86={},_0x6f9d1d={},_0x5efcd0={'count':0x0,'rows':[]};var _0x36e38d=_[_0x8f8b('0x2a')](db['AnalyticTreeReport'][_0x8f8b('0x2b')],function(_0x169b57){return{'name':_0x169b57[_0x8f8b('0x2c')],'type':_0x169b57[_0x8f8b('0x2d')]['key']};});_0x6f9d1d['model']=_[_0x8f8b('0x2a')](_0x36e38d,_0x8f8b('0x29'));_0x6f9d1d['query']=_[_0x8f8b('0x2e')](_0x4b80f2['query']);_0x6f9d1d[_0x8f8b('0x2f')]=_[_0x8f8b('0x30')](_0x6f9d1d[_0x8f8b('0x31')],_0x6f9d1d['query']);_0x924e86[_0x8f8b('0x32')]=_[_0x8f8b('0x30')](_0x6f9d1d[_0x8f8b('0x31')],qs[_0x8f8b('0x33')](_0x4b80f2[_0x8f8b('0x34')][_0x8f8b('0x33')]));_0x924e86['attributes']=_0x924e86[_0x8f8b('0x32')]['length']?_0x924e86[_0x8f8b('0x32')]:_0x6f9d1d['model'];if(!_0x4b80f2[_0x8f8b('0x34')][_0x8f8b('0x35')](_0x8f8b('0x36'))){_0x924e86[_0x8f8b('0x1f')]=qs[_0x8f8b('0x1f')](_0x4b80f2[_0x8f8b('0x34')][_0x8f8b('0x1f')]);_0x924e86[_0x8f8b('0x20')]=qs[_0x8f8b('0x20')](_0x4b80f2[_0x8f8b('0x34')]['offset']);}_0x924e86['order']=qs['sort'](_0x4b80f2['query']['sort']);_0x924e86['where']=qs[_0x8f8b('0x2f')](_[_0x8f8b('0x37')](_0x4b80f2['query'],_0x6f9d1d[_0x8f8b('0x2f')]),_0x36e38d);if(_0x4b80f2['query'][_0x8f8b('0x38')]){_0x924e86['where']=_[_0x8f8b('0x39')](_0x924e86[_0x8f8b('0x3a')],{'$or':_[_0x8f8b('0x2a')](_0x36e38d,function(_0x9b475f){if(_0x9b475f[_0x8f8b('0x2d')]!==_0x8f8b('0x3b')){var _0x2c9c35={};_0x2c9c35[_0x9b475f[_0x8f8b('0x29')]]={'$like':'%'+_0x4b80f2[_0x8f8b('0x34')][_0x8f8b('0x38')]+'%'};return _0x2c9c35;}})});}_0x924e86=_[_0x8f8b('0x39')]({},_0x924e86,_0x4b80f2[_0x8f8b('0x3c')]);var _0x26fd0b={'where':_0x924e86[_0x8f8b('0x3a')]};return db[_0x8f8b('0x3d')]['count'](_0x26fd0b)[_0x8f8b('0x26')](function(_0x46e34a){_0x5efcd0[_0x8f8b('0x21')]=_0x46e34a;if(_0x4b80f2[_0x8f8b('0x34')][_0x8f8b('0x3e')]){_0x924e86['include']=[{'all':!![]}];}return db[_0x8f8b('0x3d')][_0x8f8b('0x3f')](_0x924e86);})[_0x8f8b('0x26')](function(_0x3b74fb){_0x5efcd0[_0x8f8b('0x40')]=_0x3b74fb;return _0x5efcd0;})[_0x8f8b('0x26')](respondWithFilteredResult(_0x7718ab,_0x924e86))[_0x8f8b('0x41')](handleError(_0x7718ab,null));};exports['show']=function(_0x16e6b6,_0xa8901a){var _0x5f4b95={'raw':!![],'where':{'id':_0x16e6b6[_0x8f8b('0x42')]['id']}},_0x599db0={};_0x599db0[_0x8f8b('0x31')]=_[_0x8f8b('0x2e')](db[_0x8f8b('0x3d')][_0x8f8b('0x2b')]);_0x599db0[_0x8f8b('0x34')]=_[_0x8f8b('0x2e')](_0x16e6b6[_0x8f8b('0x34')]);_0x599db0['filters']=_['intersection'](_0x599db0[_0x8f8b('0x31')],_0x599db0['query']);_0x5f4b95[_0x8f8b('0x32')]=_[_0x8f8b('0x30')](_0x599db0[_0x8f8b('0x31')],qs[_0x8f8b('0x33')](_0x16e6b6[_0x8f8b('0x34')][_0x8f8b('0x33')]));_0x5f4b95[_0x8f8b('0x32')]=_0x5f4b95[_0x8f8b('0x32')][_0x8f8b('0x43')]?_0x5f4b95[_0x8f8b('0x32')]:_0x599db0[_0x8f8b('0x31')];if(_0x16e6b6[_0x8f8b('0x34')][_0x8f8b('0x3e')]){_0x5f4b95[_0x8f8b('0x44')]=[{'all':!![]}];}_0x5f4b95=_[_0x8f8b('0x39')]({},_0x5f4b95,_0x16e6b6[_0x8f8b('0x3c')]);return db[_0x8f8b('0x3d')][_0x8f8b('0x45')](_0x5f4b95)[_0x8f8b('0x26')](handleEntityNotFound(_0xa8901a,null))[_0x8f8b('0x26')](respondWithResult(_0xa8901a,null))['catch'](handleError(_0xa8901a,null));};exports[_0x8f8b('0x46')]=function(_0x526bfa,_0x27b6a9){return db[_0x8f8b('0x3d')][_0x8f8b('0x46')](_0x526bfa[_0x8f8b('0x47')],{})[_0x8f8b('0x26')](respondWithResult(_0x27b6a9,0xc9))[_0x8f8b('0x41')](handleError(_0x27b6a9,null));};exports[_0x8f8b('0x48')]=function(_0x23cf3b,_0x2c623f){if(_0x23cf3b[_0x8f8b('0x47')]['id']){delete _0x23cf3b[_0x8f8b('0x47')]['id'];}return db[_0x8f8b('0x3d')]['find']({'where':{'id':_0x23cf3b[_0x8f8b('0x42')]['id']}})[_0x8f8b('0x26')](handleEntityNotFound(_0x2c623f,null))[_0x8f8b('0x26')](saveUpdates(_0x23cf3b[_0x8f8b('0x47')],null))[_0x8f8b('0x26')](respondWithResult(_0x2c623f,null))[_0x8f8b('0x41')](handleError(_0x2c623f,null));};exports['destroy']=function(_0x190bc6,_0x102f8c){return db[_0x8f8b('0x3d')]['find']({'where':{'id':_0x190bc6[_0x8f8b('0x42')]['id']}})['then'](handleEntityNotFound(_0x102f8c,null))[_0x8f8b('0x26')](removeEntity(_0x102f8c,null))['catch'](handleError(_0x102f8c,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 6c2ff7d..38126b3 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 _0x3aec=['AnalyticTreeReport','analytics_report_trees','../../config/logger','api','moment','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x14f445,_0x2b24f9){var _0x3d4951=function(_0x2a5573){while(--_0x2a5573){_0x14f445['push'](_0x14f445['shift']());}};_0x3d4951(++_0x2b24f9);}(_0x3aec,0xfe));var _0xc3ae=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0x3aec[_0x22f85a];return _0xaa717;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc3ae('0x0'))(_0xc3ae('0x1'));var moment=require(_0xc3ae('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc3ae('0x3'));var attributes=require(_0xc3ae('0x4'));module[_0xc3ae('0x5')]=function(_0x5d58a1,_0x7240de){return _0x5d58a1[_0xc3ae('0x6')](_0xc3ae('0x7'),attributes,{'tableName':_0xc3ae('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xda57=['bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','moment'];(function(_0x27d66e,_0x1eeff6){var _0x2f7081=function(_0x2f8d23){while(--_0x2f8d23){_0x27d66e['push'](_0x27d66e['shift']());}};_0x2f7081(++_0x1eeff6);}(_0xda57,0x105));var _0x7da5=function(_0x5a7883,_0x384049){_0x5a7883=_0x5a7883-0x0;var _0x17c8da=_0xda57[_0x5a7883];return _0x17c8da;};'use strict';var _=require(_0x7da5('0x0'));var util=require(_0x7da5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7da5('0x2'));var BPromise=require(_0x7da5('0x3'));var rp=require(_0x7da5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7da5('0x5'));var config=require(_0x7da5('0x6'));var attributes=require(_0x7da5('0x7'));module[_0x7da5('0x8')]=function(_0x4692f4,_0x9f6bc7){return _0x4692f4[_0x7da5('0x9')](_0x7da5('0xa'),attributes,{'tableName':'analytics_report_trees','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 094494b..de3c876 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1ed791,_0x3c86aa){var _0xea6482=function(_0x168cc9){while(--_0x168cc9){_0x1ed791['push'](_0x1ed791['shift']());}};_0xea6482(++_0x3c86aa);}(_0x2ef3,0xba));var _0x32ef=function(_0x22afde,_0x4ae892){_0x22afde=_0x22afde-0x0;var _0x19651b=_0x2ef3[_0x22afde];return _0x19651b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+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(_0x5f47c0,_0x30671c){var _0x52639d=function(_0x35cfd7){while(--_0x35cfd7){_0x5f47c0['push'](_0x5f47c0['shift']());}};_0x52639d(++_0x30671c);}(_0x1261,0x144));var _0x1126=function(_0x1265ed,_0x4b85e8){_0x1265ed=_0x1265ed-0x0;var _0x5ac459=_0x1261[_0x1265ed];return _0x5ac459;};'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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 510bc05..b5ecef3 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 _0x3dc2=['create','put','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post'];(function(_0x1121db,_0x54f0a1){var _0x54dae0=function(_0x46e738){while(--_0x46e738){_0x1121db['push'](_0x1121db['shift']());}};_0x54dae0(++_0x54f0a1);}(_0x3dc2,0x1f2));var _0x23dc=function(_0x5dc3b2,_0x4a4d7f){_0x5dc3b2=_0x5dc3b2-0x0;var _0x4e3382=_0x3dc2[_0x5dc3b2];return _0x4e3382;};'use strict';var multer=require(_0x23dc('0x0'));var util=require(_0x23dc('0x1'));var path=require('path');var timeout=require(_0x23dc('0x2'));var express=require('express');var router=express[_0x23dc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x23dc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x23dc('0x5'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x23dc('0x6')](),controller[_0x23dc('0x7')]);router[_0x23dc('0x8')](_0x23dc('0x9'),auth['isAuthenticated'](),controller[_0x23dc('0xa')]);router[_0x23dc('0xb')]('/',auth[_0x23dc('0x6')](),controller[_0x23dc('0xc')]);router[_0x23dc('0xd')](_0x23dc('0x9'),auth[_0x23dc('0x6')](),controller['update']);router[_0x23dc('0xe')](_0x23dc('0x9'),auth[_0x23dc('0x6')](),controller[_0x23dc('0xf')]);module[_0x23dc('0x10')]=router;
\ No newline at end of file
+var _0x7d7b=['/:id','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index'];(function(_0x52138f,_0x18dbd6){var _0x3b1572=function(_0x56fa7f){while(--_0x56fa7f){_0x52138f['push'](_0x52138f['shift']());}};_0x3b1572(++_0x18dbd6);}(_0x7d7b,0xd3));var _0xb7d7=function(_0x24f03d,_0x128f52){_0x24f03d=_0x24f03d-0x0;var _0xa80509=_0x7d7b[_0x24f03d];return _0xa80509;};'use strict';var multer=require('multer');var util=require(_0xb7d7('0x0'));var path=require(_0xb7d7('0x1'));var timeout=require(_0xb7d7('0x2'));var express=require(_0xb7d7('0x3'));var router=express[_0xb7d7('0x4')]();var fs_extra=require(_0xb7d7('0x5'));var auth=require(_0xb7d7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0xb7d7('0x7')]('/',auth[_0xb7d7('0x8')](),controller[_0xb7d7('0x9')]);router['get'](_0xb7d7('0xa'),auth[_0xb7d7('0x8')](),controller[_0xb7d7('0xb')]);router['post']('/',auth[_0xb7d7('0x8')](),controller['create']);router[_0xb7d7('0xc')]('/:id',auth[_0xb7d7('0x8')](),controller[_0xb7d7('0xd')]);router[_0xb7d7('0xe')](_0xb7d7('0xa'),auth[_0xb7d7('0x8')](),controller[_0xb7d7('0xf')]);module[_0xb7d7('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index f5ed718..3dfd8a9 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 _0x46fc=['STRING','sequelize','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x46fc,0x103));var _0xc46f=function(_0x4ca26c,_0x44d6f1){_0x4ca26c=_0x4ca26c-0x0;var _0x25b914=_0x46fc[_0x4ca26c];return _0x25b914;};'use strict';var Sequelize=require(_0xc46f('0x0'));module[_0xc46f('0x1')]={'name':{'type':Sequelize[_0xc46f('0x2')]},'basename':{'type':Sequelize[_0xc46f('0x2')]},'type':{'type':Sequelize[_0xc46f('0x2')]}};
\ No newline at end of file
+var _0x0a9a=['STRING','exports'];(function(_0x19212f,_0x2307be){var _0x4fc573=function(_0x55827f){while(--_0x55827f){_0x19212f['push'](_0x19212f['shift']());}};_0x4fc573(++_0x2307be);}(_0x0a9a,0x183));var _0xa0a9=function(_0x1bfe4c,_0x58522c){_0x1bfe4c=_0x1bfe4c-0x0;var _0x538345=_0x0a9a[_0x1bfe4c];return _0x538345;};'use strict';var Sequelize=require('sequelize');module[_0xa0a9('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xa0a9('0x1')]},'type':{'type':Sequelize[_0xa0a9('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index aa57b50..1f430da 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 _0xc2e9=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','update','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName','key','keys','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','include','catch','show','params','intersection','options','find','clone','get','omit','updatedAt','body','createdAt','create','file','originalname','filename','mimetype','download','findOne','server/files/attachments/','join','offline-chat/','basename','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xc2e9,0x1f4));var _0x9c2e=function(_0x47db8d,_0x268411){_0x47db8d=_0x47db8d-0x0;var _0x3283ef=_0xc2e9[_0x47db8d];return _0x3283ef;};'use strict';var emlformat=require(_0x9c2e('0x0'));var rimraf=require(_0x9c2e('0x1'));var zipdir=require(_0x9c2e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9c2e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9c2e('0x4'));var util=require(_0x9c2e('0x5'));var path=require(_0x9c2e('0x6'));var sox=require(_0x9c2e('0x7'));var csv=require(_0x9c2e('0x8'));var ejs=require(_0x9c2e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9c2e('0xa'));var squel=require(_0x9c2e('0xb'));var crypto=require('crypto');var jsforce=require(_0x9c2e('0xc'));var deskjs=require(_0x9c2e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9c2e('0xe'));var Papa=require(_0x9c2e('0xf'));var Redis=require(_0x9c2e('0x10'));var authService=require(_0x9c2e('0x11'));var qs=require(_0x9c2e('0x12'));var as=require(_0x9c2e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9c2e('0x14'));var licenseUtil=require(_0x9c2e('0x15'));var db=require(_0x9c2e('0x16'))['db'];function respondWithStatusCode(_0x31a719,_0xe1a4d){_0xe1a4d=_0xe1a4d||0xcc;return function(_0x5571b1){if(_0x5571b1){return _0x31a719[_0x9c2e('0x17')](_0xe1a4d);}return _0x31a719['status'](_0xe1a4d)[_0x9c2e('0x18')]();};}function respondWithResult(_0x4aa843,_0x39e132){_0x39e132=_0x39e132||0xc8;return function(_0x19d144){if(_0x19d144){return _0x4aa843['status'](_0x39e132)[_0x9c2e('0x19')](_0x19d144);}};}function respondWithFilteredResult(_0x3a5e8d,_0x91b655){return function(_0xb8a614){if(_0xb8a614){var _0xa2a9b=typeof _0x91b655[_0x9c2e('0x1a')]===_0x9c2e('0x1b')&&typeof _0x91b655[_0x9c2e('0x1c')]==='undefined';var _0x56c9d9=_0xb8a614[_0x9c2e('0x1d')];var _0x55d7b6=_0xa2a9b?0x0:_0x91b655[_0x9c2e('0x1a')];var _0x1961b7=_0xa2a9b?_0xb8a614['count']:_0x91b655[_0x9c2e('0x1a')]+_0x91b655[_0x9c2e('0x1c')];var _0x58c911;if(_0x1961b7>=_0x56c9d9){_0x1961b7=_0x56c9d9;_0x58c911=0xc8;}else{_0x58c911=0xce;}_0x3a5e8d[_0x9c2e('0x1e')](_0x58c911);return _0x3a5e8d['set']('Content-Range',_0x55d7b6+'-'+_0x1961b7+'/'+_0x56c9d9)['json'](_0xb8a614);}return null;};}function patchUpdates(_0x1fff81){return function(_0x462130){try{jsonpatch[_0x9c2e('0x1f')](_0x462130,_0x1fff81,!![]);}catch(_0x2edf21){return BPromise[_0x9c2e('0x20')](_0x2edf21);}return _0x462130['save']();};}function saveUpdates(_0x4910ef,_0x389102){return function(_0xfd9df6){if(_0xfd9df6){return _0xfd9df6[_0x9c2e('0x21')](_0x4910ef)[_0x9c2e('0x22')](function(_0x318395){return _0x318395;});}return null;};}function removeEntity(_0x48ba09,_0x2dd314){return function(_0x29fb74){if(_0x29fb74){return _0x29fb74[_0x9c2e('0x23')]()['then'](function(){_0x48ba09[_0x9c2e('0x1e')](0xcc)[_0x9c2e('0x18')]();});}};}function handleEntityNotFound(_0x3f03dc,_0x157630){return function(_0xda0f54){if(!_0xda0f54){_0x3f03dc[_0x9c2e('0x17')](0x194);}return _0xda0f54;};}function handleError(_0x6cfc13,_0x5cc656){_0x5cc656=_0x5cc656||0x1f4;return function(_0x4ecf1c){logger[_0x9c2e('0x24')](_0x4ecf1c[_0x9c2e('0x25')]);if(_0x4ecf1c[_0x9c2e('0x26')]){delete _0x4ecf1c[_0x9c2e('0x26')];}_0x6cfc13['status'](_0x5cc656)['send'](_0x4ecf1c);};}exports[_0x9c2e('0x27')]=function(_0x44f003,_0x411254){var _0x1e5b38={},_0x519601={},_0x2b5949={'count':0x0,'rows':[]};var _0x4b4cfa=_[_0x9c2e('0x28')](db[_0x9c2e('0x29')][_0x9c2e('0x2a')],function(_0x23bd4c){return{'name':_0x23bd4c[_0x9c2e('0x2b')],'type':_0x23bd4c['type'][_0x9c2e('0x2c')]};});_0x519601['model']=_[_0x9c2e('0x28')](_0x4b4cfa,_0x9c2e('0x26'));_0x519601['query']=_[_0x9c2e('0x2d')](_0x44f003[_0x9c2e('0x2e')]);_0x519601[_0x9c2e('0x2f')]=_['intersection'](_0x519601[_0x9c2e('0x30')],_0x519601[_0x9c2e('0x2e')]);_0x1e5b38[_0x9c2e('0x31')]=_['intersection'](_0x519601[_0x9c2e('0x30')],qs['fields'](_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x32')]));_0x1e5b38[_0x9c2e('0x31')]=_0x1e5b38[_0x9c2e('0x31')][_0x9c2e('0x33')]?_0x1e5b38['attributes']:_0x519601[_0x9c2e('0x30')];if(!_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x34')]('nolimit')){_0x1e5b38[_0x9c2e('0x1c')]=qs[_0x9c2e('0x1c')](_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x1c')]);_0x1e5b38[_0x9c2e('0x1a')]=qs[_0x9c2e('0x1a')](_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x1a')]);}_0x1e5b38[_0x9c2e('0x35')]=qs[_0x9c2e('0x36')](_0x44f003['query'][_0x9c2e('0x36')]);_0x1e5b38[_0x9c2e('0x37')]=qs[_0x9c2e('0x2f')](_[_0x9c2e('0x38')](_0x44f003[_0x9c2e('0x2e')],_0x519601[_0x9c2e('0x2f')]),_0x4b4cfa);if(_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x39')]){_0x1e5b38[_0x9c2e('0x37')]=_[_0x9c2e('0x3a')](_0x1e5b38[_0x9c2e('0x37')],{'$or':_[_0x9c2e('0x28')](_0x4b4cfa,function(_0x493e84){if(_0x493e84[_0x9c2e('0x3b')]!=='VIRTUAL'){var _0xd9a530={};_0xd9a530[_0x493e84[_0x9c2e('0x26')]]={'$like':'%'+_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x39')]+'%'};return _0xd9a530;}})});}_0x1e5b38=_[_0x9c2e('0x3a')]({},_0x1e5b38,_0x44f003['options']);var _0x31eb42={'where':_0x1e5b38[_0x9c2e('0x37')]};return db[_0x9c2e('0x29')][_0x9c2e('0x1d')](_0x31eb42)[_0x9c2e('0x22')](function(_0x3eade4){_0x2b5949[_0x9c2e('0x1d')]=_0x3eade4;if(_0x44f003[_0x9c2e('0x2e')][_0x9c2e('0x3c')]){_0x1e5b38[_0x9c2e('0x3d')]=[{'all':!![]}];}return db[_0x9c2e('0x29')]['findAll'](_0x1e5b38);})[_0x9c2e('0x22')](function(_0x3d3ac0){_0x2b5949['rows']=_0x3d3ac0;return _0x2b5949;})[_0x9c2e('0x22')](respondWithFilteredResult(_0x411254,_0x1e5b38))[_0x9c2e('0x3e')](handleError(_0x411254,null));};exports[_0x9c2e('0x3f')]=function(_0x31ce09,_0x542de2){var _0x519fd1={'raw':!![],'where':{'id':_0x31ce09[_0x9c2e('0x40')]['id']}},_0x3dc042={};_0x3dc042['model']=_[_0x9c2e('0x2d')](db[_0x9c2e('0x29')][_0x9c2e('0x2a')]);_0x3dc042['query']=_[_0x9c2e('0x2d')](_0x31ce09[_0x9c2e('0x2e')]);_0x3dc042[_0x9c2e('0x2f')]=_['intersection'](_0x3dc042[_0x9c2e('0x30')],_0x3dc042[_0x9c2e('0x2e')]);_0x519fd1[_0x9c2e('0x31')]=_[_0x9c2e('0x41')](_0x3dc042[_0x9c2e('0x30')],qs[_0x9c2e('0x32')](_0x31ce09[_0x9c2e('0x2e')][_0x9c2e('0x32')]));_0x519fd1['attributes']=_0x519fd1[_0x9c2e('0x31')]['length']?_0x519fd1[_0x9c2e('0x31')]:_0x3dc042[_0x9c2e('0x30')];if(_0x31ce09[_0x9c2e('0x2e')]['includeAll']){_0x519fd1[_0x9c2e('0x3d')]=[{'all':!![]}];}_0x519fd1=_[_0x9c2e('0x3a')]({},_0x519fd1,_0x31ce09[_0x9c2e('0x42')]);return db['Attachment'][_0x9c2e('0x43')](_0x519fd1)['then'](handleEntityNotFound(_0x542de2,null))[_0x9c2e('0x22')](respondWithResult(_0x542de2,null))[_0x9c2e('0x3e')](handleError(_0x542de2,null));};exports[_0x9c2e('0x44')]=function(_0x3cfa39,_0x1b36c6){var _0x45ac9e={'where':{'id':_0x3cfa39[_0x9c2e('0x40')]['id']}},_0x10a379={};_0x10a379[_0x9c2e('0x30')]=_[_0x9c2e('0x2d')](db[_0x9c2e('0x29')]['rawAttributes']);_0x45ac9e['attributes']=_['intersection'](_0x10a379['model'],qs['fields'](_0x3cfa39['query'][_0x9c2e('0x32')]));_0x45ac9e['attributes']=_0x45ac9e[_0x9c2e('0x31')][_0x9c2e('0x33')]?_0x45ac9e[_0x9c2e('0x31')]:_0x10a379[_0x9c2e('0x30')];if(_0x3cfa39[_0x9c2e('0x2e')][_0x9c2e('0x3c')]){_0x45ac9e[_0x9c2e('0x3d')]=[{'all':!![]}];}_0x45ac9e=_[_0x9c2e('0x3a')]({},_0x45ac9e,_0x3cfa39['options']);return db['Attachment']['find'](_0x45ac9e)[_0x9c2e('0x22')](handleEntityNotFound(_0x1b36c6,null))[_0x9c2e('0x22')](function(_0x164462){if(_0x164462){var _0x7cc16d=_0x164462[_0x9c2e('0x45')]({'plain':!![]});_0x7cc16d=qs[_0x9c2e('0x46')](_0x7cc16d,['id','createdAt',_0x9c2e('0x47')]);_0x3cfa39['body']=_[_0x9c2e('0x46')](_0x3cfa39[_0x9c2e('0x48')],['id',_0x9c2e('0x49'),_0x9c2e('0x47')]);return db[_0x9c2e('0x29')]['create'](_[_0x9c2e('0x3a')](_0x7cc16d,_0x3cfa39[_0x9c2e('0x48')]),{'include':_0x3cfa39[_0x9c2e('0x2e')][_0x9c2e('0x3c')]?[{'all':!![]}]:undefined});}})[_0x9c2e('0x22')](respondWithResult(_0x1b36c6,0xc9))[_0x9c2e('0x3e')](handleError(_0x1b36c6,null));};exports[_0x9c2e('0x21')]=function(_0xed4b5d,_0x55c0c5){if(_0xed4b5d['body']['id']){delete _0xed4b5d[_0x9c2e('0x48')]['id'];}return db['Attachment'][_0x9c2e('0x43')]({'where':{'id':_0xed4b5d['params']['id']}})[_0x9c2e('0x22')](handleEntityNotFound(_0x55c0c5,null))[_0x9c2e('0x22')](saveUpdates(_0xed4b5d[_0x9c2e('0x48')],null))['then'](respondWithResult(_0x55c0c5,null))[_0x9c2e('0x3e')](handleError(_0x55c0c5,null));};exports[_0x9c2e('0x23')]=function(_0x2df3c5,_0x2a6914){return db['Attachment'][_0x9c2e('0x43')]({'where':{'id':_0x2df3c5[_0x9c2e('0x40')]['id']}})[_0x9c2e('0x22')](handleEntityNotFound(_0x2a6914,null))[_0x9c2e('0x22')](removeEntity(_0x2a6914,null))[_0x9c2e('0x3e')](handleError(_0x2a6914,null));};exports[_0x9c2e('0x4a')]=function(_0xa5a0a7,_0x454ad1,_0x535b6a){_0xa5a0a7['body'][_0x9c2e('0x26')]=_0xa5a0a7[_0x9c2e('0x4b')][_0x9c2e('0x4c')];_0xa5a0a7[_0x9c2e('0x48')]['basename']=_0xa5a0a7[_0x9c2e('0x4b')][_0x9c2e('0x4d')];_0xa5a0a7['body']['type']=_0xa5a0a7[_0x9c2e('0x4b')][_0x9c2e('0x4e')];return db[_0x9c2e('0x29')][_0x9c2e('0x4a')](_0xa5a0a7[_0x9c2e('0x48')])[_0x9c2e('0x22')](respondWithResult(_0x454ad1,0xc9))[_0x9c2e('0x3e')](handleError(_0x454ad1,null));};exports[_0x9c2e('0x4f')]=function(_0x3cace5,_0x473680,_0x1b87f9){return db['Attachment'][_0x9c2e('0x50')]({'where':{'id':_0x3cace5[_0x9c2e('0x40')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x473680,null))[_0x9c2e('0x22')](function(_0x1e14d9){if(_0x1e14d9){var _0x45073a=_0x1e14d9['ChatOfflineMessageId']!==null;var _0x10db42=path['join'](config['root'],_0x9c2e('0x51'));if(_0x45073a){_0x10db42=path[_0x9c2e('0x52')](_0x10db42,_0x9c2e('0x53'));}var _0x286fba=path[_0x9c2e('0x52')](_0x10db42,_0x1e14d9[_0x9c2e('0x54')]);return _0x473680[_0x9c2e('0x4f')](_0x286fba);}})[_0x9c2e('0x3e')](handleError(_0x473680,null));};
\ No newline at end of file
+var _0x9340=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','set','json','apply','reject','save','update','then','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','VIRTUAL','filter','includeAll','include','rows','show','length','merge','find','catch','params','options','omit','createdAt','updatedAt','body','create','destroy','file','originalname','basename','download','join','root','offline-chat/','rimraf'];(function(_0xa32cab,_0x560f06){var _0x1f42be=function(_0x90b22b){while(--_0x90b22b){_0xa32cab['push'](_0xa32cab['shift']());}};_0x1f42be(++_0x560f06);}(_0x9340,0x1d9));var _0x0934=function(_0x198f48,_0x773f96){_0x198f48=_0x198f48-0x0;var _0x26428e=_0x9340[_0x198f48];return _0x26428e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0934('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0934('0x1'));var moment=require(_0x0934('0x2'));var BPromise=require(_0x0934('0x3'));var Mustache=require(_0x0934('0x4'));var util=require(_0x0934('0x5'));var path=require(_0x0934('0x6'));var sox=require('sox');var csv=require(_0x0934('0x7'));var ejs=require(_0x0934('0x8'));var fs=require('fs');var fs_extra=require(_0x0934('0x9'));var _=require('lodash');var squel=require(_0x0934('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0934('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0934('0xc'));var Papa=require(_0x0934('0xd'));var Redis=require('ioredis');var authService=require(_0x0934('0xe'));var qs=require(_0x0934('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0934('0x10'))('api');var utils=require(_0x0934('0x11'));var config=require(_0x0934('0x12'));var licenseUtil=require(_0x0934('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48bce3,_0x446410){_0x446410=_0x446410||0xcc;return function(_0x5e87d2){if(_0x5e87d2){return _0x48bce3[_0x0934('0x14')](_0x446410);}return _0x48bce3[_0x0934('0x15')](_0x446410)['end']();};}function respondWithResult(_0x181ec6,_0xcf763e){_0xcf763e=_0xcf763e||0xc8;return function(_0x5ddde0){if(_0x5ddde0){return _0x181ec6['status'](_0xcf763e)['json'](_0x5ddde0);}};}function respondWithFilteredResult(_0x32a1ba,_0x517e8f){return function(_0x35a806){if(_0x35a806){var _0x4ce586=typeof _0x517e8f[_0x0934('0x16')]===_0x0934('0x17')&&typeof _0x517e8f['limit']===_0x0934('0x17');var _0x57df0d=_0x35a806[_0x0934('0x18')];var _0x4fbc1a=_0x4ce586?0x0:_0x517e8f[_0x0934('0x16')];var _0x12e6d0=_0x4ce586?_0x35a806[_0x0934('0x18')]:_0x517e8f[_0x0934('0x16')]+_0x517e8f['limit'];var _0x1ab386;if(_0x12e6d0>=_0x57df0d){_0x12e6d0=_0x57df0d;_0x1ab386=0xc8;}else{_0x1ab386=0xce;}_0x32a1ba[_0x0934('0x15')](_0x1ab386);return _0x32a1ba[_0x0934('0x19')]('Content-Range',_0x4fbc1a+'-'+_0x12e6d0+'/'+_0x57df0d)[_0x0934('0x1a')](_0x35a806);}return null;};}function patchUpdates(_0x20ac3e){return function(_0x54122d){try{jsonpatch[_0x0934('0x1b')](_0x54122d,_0x20ac3e,!![]);}catch(_0x310f02){return BPromise[_0x0934('0x1c')](_0x310f02);}return _0x54122d[_0x0934('0x1d')]();};}function saveUpdates(_0x28993e,_0x3454be){return function(_0x148051){if(_0x148051){return _0x148051[_0x0934('0x1e')](_0x28993e)[_0x0934('0x1f')](function(_0x36780c){return _0x36780c;});}return null;};}function removeEntity(_0x446723,_0x354191){return function(_0x18f303){if(_0x18f303){return _0x18f303['destroy']()[_0x0934('0x1f')](function(){_0x446723[_0x0934('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13d925,_0x133e7f){return function(_0x5f85fb){if(!_0x5f85fb){_0x13d925['sendStatus'](0x194);}return _0x5f85fb;};}function handleError(_0x57237b,_0x1e2814){_0x1e2814=_0x1e2814||0x1f4;return function(_0x3dbdeb){logger['error'](_0x3dbdeb[_0x0934('0x20')]);if(_0x3dbdeb[_0x0934('0x21')]){delete _0x3dbdeb['name'];}_0x57237b[_0x0934('0x15')](_0x1e2814)['send'](_0x3dbdeb);};}exports[_0x0934('0x22')]=function(_0x3b095,_0x2fd0d3){var _0x475934={},_0x16dcdf={},_0x46b49d={'count':0x0,'rows':[]};var _0x2faabb=_[_0x0934('0x23')](db[_0x0934('0x24')][_0x0934('0x25')],function(_0x380c84){return{'name':_0x380c84[_0x0934('0x26')],'type':_0x380c84[_0x0934('0x27')][_0x0934('0x28')]};});_0x16dcdf['model']=_[_0x0934('0x23')](_0x2faabb,_0x0934('0x21'));_0x16dcdf[_0x0934('0x29')]=_[_0x0934('0x2a')](_0x3b095[_0x0934('0x29')]);_0x16dcdf[_0x0934('0x2b')]=_['intersection'](_0x16dcdf[_0x0934('0x2c')],_0x16dcdf[_0x0934('0x29')]);_0x475934[_0x0934('0x2d')]=_[_0x0934('0x2e')](_0x16dcdf['model'],qs[_0x0934('0x2f')](_0x3b095[_0x0934('0x29')][_0x0934('0x2f')]));_0x475934[_0x0934('0x2d')]=_0x475934[_0x0934('0x2d')]['length']?_0x475934['attributes']:_0x16dcdf[_0x0934('0x2c')];if(!_0x3b095[_0x0934('0x29')][_0x0934('0x30')](_0x0934('0x31'))){_0x475934['limit']=qs[_0x0934('0x32')](_0x3b095['query'][_0x0934('0x32')]);_0x475934['offset']=qs[_0x0934('0x16')](_0x3b095['query'][_0x0934('0x16')]);}_0x475934[_0x0934('0x33')]=qs[_0x0934('0x34')](_0x3b095[_0x0934('0x29')][_0x0934('0x34')]);_0x475934[_0x0934('0x35')]=qs[_0x0934('0x2b')](_['pick'](_0x3b095[_0x0934('0x29')],_0x16dcdf['filters']),_0x2faabb);if(_0x3b095['query']['filter']){_0x475934['where']=_['merge'](_0x475934[_0x0934('0x35')],{'$or':_[_0x0934('0x23')](_0x2faabb,function(_0xf6f147){if(_0xf6f147['type']!==_0x0934('0x36')){var _0x9d31d3={};_0x9d31d3[_0xf6f147[_0x0934('0x21')]]={'$like':'%'+_0x3b095[_0x0934('0x29')][_0x0934('0x37')]+'%'};return _0x9d31d3;}})});}_0x475934=_['merge']({},_0x475934,_0x3b095['options']);var _0x4ebde4={'where':_0x475934['where']};return db[_0x0934('0x24')][_0x0934('0x18')](_0x4ebde4)['then'](function(_0x2b24c6){_0x46b49d[_0x0934('0x18')]=_0x2b24c6;if(_0x3b095[_0x0934('0x29')][_0x0934('0x38')]){_0x475934[_0x0934('0x39')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x475934);})[_0x0934('0x1f')](function(_0x21fb51){_0x46b49d[_0x0934('0x3a')]=_0x21fb51;return _0x46b49d;})[_0x0934('0x1f')](respondWithFilteredResult(_0x2fd0d3,_0x475934))['catch'](handleError(_0x2fd0d3,null));};exports[_0x0934('0x3b')]=function(_0x248d06,_0x5523c2){var _0x3cb1ce={'raw':!![],'where':{'id':_0x248d06['params']['id']}},_0xedb3ad={};_0xedb3ad[_0x0934('0x2c')]=_['keys'](db[_0x0934('0x24')]['rawAttributes']);_0xedb3ad['query']=_[_0x0934('0x2a')](_0x248d06[_0x0934('0x29')]);_0xedb3ad['filters']=_[_0x0934('0x2e')](_0xedb3ad[_0x0934('0x2c')],_0xedb3ad[_0x0934('0x29')]);_0x3cb1ce[_0x0934('0x2d')]=_['intersection'](_0xedb3ad[_0x0934('0x2c')],qs[_0x0934('0x2f')](_0x248d06['query'][_0x0934('0x2f')]));_0x3cb1ce[_0x0934('0x2d')]=_0x3cb1ce[_0x0934('0x2d')][_0x0934('0x3c')]?_0x3cb1ce[_0x0934('0x2d')]:_0xedb3ad[_0x0934('0x2c')];if(_0x248d06[_0x0934('0x29')][_0x0934('0x38')]){_0x3cb1ce[_0x0934('0x39')]=[{'all':!![]}];}_0x3cb1ce=_[_0x0934('0x3d')]({},_0x3cb1ce,_0x248d06['options']);return db[_0x0934('0x24')][_0x0934('0x3e')](_0x3cb1ce)[_0x0934('0x1f')](handleEntityNotFound(_0x5523c2,null))['then'](respondWithResult(_0x5523c2,null))[_0x0934('0x3f')](handleError(_0x5523c2,null));};exports['clone']=function(_0x13effd,_0x46f2a9){var _0x810045={'where':{'id':_0x13effd[_0x0934('0x40')]['id']}},_0x117d5a={};_0x117d5a[_0x0934('0x2c')]=_[_0x0934('0x2a')](db['Attachment']['rawAttributes']);_0x810045['attributes']=_[_0x0934('0x2e')](_0x117d5a[_0x0934('0x2c')],qs[_0x0934('0x2f')](_0x13effd[_0x0934('0x29')]['fields']));_0x810045[_0x0934('0x2d')]=_0x810045['attributes']['length']?_0x810045[_0x0934('0x2d')]:_0x117d5a['model'];if(_0x13effd[_0x0934('0x29')][_0x0934('0x38')]){_0x810045[_0x0934('0x39')]=[{'all':!![]}];}_0x810045=_[_0x0934('0x3d')]({},_0x810045,_0x13effd[_0x0934('0x41')]);return db[_0x0934('0x24')][_0x0934('0x3e')](_0x810045)[_0x0934('0x1f')](handleEntityNotFound(_0x46f2a9,null))[_0x0934('0x1f')](function(_0x57f6da){if(_0x57f6da){var _0x59193a=_0x57f6da['get']({'plain':!![]});_0x59193a=qs[_0x0934('0x42')](_0x59193a,['id',_0x0934('0x43'),_0x0934('0x44')]);_0x13effd[_0x0934('0x45')]=_['omit'](_0x13effd['body'],['id',_0x0934('0x43'),'updatedAt']);return db[_0x0934('0x24')][_0x0934('0x46')](_[_0x0934('0x3d')](_0x59193a,_0x13effd['body']),{'include':_0x13effd[_0x0934('0x29')][_0x0934('0x38')]?[{'all':!![]}]:undefined});}})[_0x0934('0x1f')](respondWithResult(_0x46f2a9,0xc9))['catch'](handleError(_0x46f2a9,null));};exports[_0x0934('0x1e')]=function(_0x3e23ab,_0x521e15){if(_0x3e23ab[_0x0934('0x45')]['id']){delete _0x3e23ab[_0x0934('0x45')]['id'];}return db[_0x0934('0x24')][_0x0934('0x3e')]({'where':{'id':_0x3e23ab[_0x0934('0x40')]['id']}})[_0x0934('0x1f')](handleEntityNotFound(_0x521e15,null))[_0x0934('0x1f')](saveUpdates(_0x3e23ab[_0x0934('0x45')],null))[_0x0934('0x1f')](respondWithResult(_0x521e15,null))[_0x0934('0x3f')](handleError(_0x521e15,null));};exports[_0x0934('0x47')]=function(_0x50e899,_0x5a1955){return db[_0x0934('0x24')][_0x0934('0x3e')]({'where':{'id':_0x50e899[_0x0934('0x40')]['id']}})['then'](handleEntityNotFound(_0x5a1955,null))[_0x0934('0x1f')](removeEntity(_0x5a1955,null))[_0x0934('0x3f')](handleError(_0x5a1955,null));};exports[_0x0934('0x46')]=function(_0x25ee3f,_0xab34ee,_0x27c0ad){_0x25ee3f[_0x0934('0x45')][_0x0934('0x21')]=_0x25ee3f[_0x0934('0x48')][_0x0934('0x49')];_0x25ee3f[_0x0934('0x45')][_0x0934('0x4a')]=_0x25ee3f[_0x0934('0x48')]['filename'];_0x25ee3f['body'][_0x0934('0x27')]=_0x25ee3f['file']['mimetype'];return db['Attachment'][_0x0934('0x46')](_0x25ee3f[_0x0934('0x45')])[_0x0934('0x1f')](respondWithResult(_0xab34ee,0xc9))[_0x0934('0x3f')](handleError(_0xab34ee,null));};exports[_0x0934('0x4b')]=function(_0x330026,_0x2c7a9f,_0x5be7fb){return db[_0x0934('0x24')]['findOne']({'where':{'id':_0x330026['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2c7a9f,null))[_0x0934('0x1f')](function(_0x58a3b1){if(_0x58a3b1){var _0x4fb5a7=_0x58a3b1['ChatOfflineMessageId']!==null;var _0x597188=path[_0x0934('0x4c')](config[_0x0934('0x4d')],'server/files/attachments/');if(_0x4fb5a7){_0x597188=path[_0x0934('0x4c')](_0x597188,_0x0934('0x4e'));}var _0x49f4fc=path[_0x0934('0x4c')](_0x597188,_0x58a3b1['basename']);return _0x2c7a9f[_0x0934('0x4b')](_0x49f4fc);}})[_0x0934('0x3f')](handleError(_0x2c7a9f,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 704f186..3f374f0 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 _0xf957=['rimraf','../../config/environment','./attachment.attributes','Attachment','attachments','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5004ed,_0x2b1ab6){var _0x467590=function(_0x495ada){while(--_0x495ada){_0x5004ed['push'](_0x5004ed['shift']());}};_0x467590(++_0x2b1ab6);}(_0xf957,0xaa));var _0x7f95=function(_0x421612,_0x1ed085){_0x421612=_0x421612-0x0;var _0x5a4787=_0xf957[_0x421612];return _0x5a4787;};'use strict';var _=require(_0x7f95('0x0'));var util=require('util');var logger=require(_0x7f95('0x1'))(_0x7f95('0x2'));var moment=require('moment');var BPromise=require(_0x7f95('0x3'));var rp=require(_0x7f95('0x4'));var fs=require('fs');var path=require(_0x7f95('0x5'));var rimraf=require(_0x7f95('0x6'));var config=require(_0x7f95('0x7'));var attributes=require(_0x7f95('0x8'));module['exports']=function(_0x512ae0,_0x523ffd){return _0x512ae0['define'](_0x7f95('0x9'),attributes,{'tableName':_0x7f95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8a9c=['rimraf','../../config/environment','exports','define','attachments','lodash','util','api','moment','request-promise','path'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x8a9c,0x144));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8a9('0x0'));var util=require(_0xc8a9('0x1'));var logger=require('../../config/logger')(_0xc8a9('0x2'));var moment=require(_0xc8a9('0x3'));var BPromise=require('bluebird');var rp=require(_0xc8a9('0x4'));var fs=require('fs');var path=require(_0xc8a9('0x5'));var rimraf=require(_0xc8a9('0x6'));var config=require(_0xc8a9('0x7'));var attributes=require('./attachment.attributes');module[_0xc8a9('0x8')]=function(_0xb06e5b,_0x23ea5d){return _0xb06e5b[_0xc8a9('0x9')]('Attachment',attributes,{'tableName':_0xc8a9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 7ed8503..7a7c8c7 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 _0x4c6d=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','then'];(function(_0xe2e672,_0x1263c9){var _0x4d8e80=function(_0x2811e9){while(--_0x2811e9){_0xe2e672['push'](_0xe2e672['shift']());}};_0x4d8e80(++_0x1263c9);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0xfea29f,_0x1d2f22){_0xfea29f=_0xfea29f-0x0;var _0x2935ba=_0x4c6d[_0xfea29f];return _0x2935ba;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var moment=require(_0xd4c6('0x2'));var BPromise=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c6('0x5'))['db'];var utils=require(_0xd4c6('0x6'));var logger=require(_0xd4c6('0x7'))('rpc');var config=require(_0xd4c6('0x8'));var jayson=require(_0xd4c6('0x9'));var client=jayson['client'][_0xd4c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x316314,_0x4329e3,_0x5d4fce){return new BPromise(function(_0x440ee3,_0x19ce1c){return client[_0xd4c6('0xb')](_0x316314,_0x5d4fce)['then'](function(_0xe2f90b){logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,'request\x20sent');logger[_0xd4c6('0xe')](_0xd4c6('0xf'),_0x4329e3,_0xd4c6('0x10'),JSON[_0xd4c6('0x11')](_0xe2f90b));if(_0xe2f90b[_0xd4c6('0x12')]){if(_0xe2f90b[_0xd4c6('0x12')]['code']===0x1f4){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b['error'][_0xd4c6('0x13')]);return _0x19ce1c(_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);}logger[_0xd4c6('0x12')](_0xd4c6('0xd'),_0x4329e3,_0xe2f90b[_0xd4c6('0x12')][_0xd4c6('0x13')]);return _0x440ee3(_0xe2f90b['error']['message']);}else{logger[_0xd4c6('0xc')](_0xd4c6('0xd'),_0x4329e3,_0xd4c6('0x10'));_0x440ee3(_0xe2f90b[_0xd4c6('0x14')][_0xd4c6('0x13')]);}})[_0xd4c6('0x15')](function(_0xe52075){logger['error'](_0xd4c6('0xd'),_0x4329e3,_0xe52075);_0x19ce1c(_0xe52075);});});}exports[_0xd4c6('0x16')]=function(_0x23a16f){var _0x2c97b=this;return new Promise(function(_0x31f328,_0x54e0a5){return db[_0xd4c6('0x17')][_0xd4c6('0x18')](_0x23a16f[_0xd4c6('0x19')],{'raw':_0x23a16f['options']?_0x23a16f[_0xd4c6('0x1a')][_0xd4c6('0x1b')]===undefined?!![]:![]:!![]})[_0xd4c6('0x1c')](function(_0x3b1658){logger['info'](_0xd4c6('0x16'),_0x23a16f);logger['debug'](_0xd4c6('0x16'),_0x23a16f,JSON[_0xd4c6('0x11')](_0x3b1658));_0x31f328(_0x3b1658);})[_0xd4c6('0x15')](function(_0x222813){logger[_0xd4c6('0x12')](_0xd4c6('0x16'),_0x222813[_0xd4c6('0x13')],_0x23a16f);_0x54e0a5(_0x2c97b[_0xd4c6('0x12')](0x1f4,_0x222813[_0xd4c6('0x13')]));});});};
\ No newline at end of file
+var _0xdab2=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreateAttachment','Attachment','create','options','raw','lodash','util','bluebird','randomstring'];(function(_0x114920,_0x4fbd50){var _0x3f13ce=function(_0x47c2c7){while(--_0x47c2c7){_0x114920['push'](_0x114920['shift']());}};_0x3f13ce(++_0x4fbd50);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var moment=require('moment');var BPromise=require(_0x2dab('0x2'));var rs=require(_0x2dab('0x3'));var fs=require('fs');var Redis=require(_0x2dab('0x4'));var db=require(_0x2dab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2dab('0x6'))(_0x2dab('0x7'));var config=require(_0x2dab('0x8'));var jayson=require(_0x2dab('0x9'));var client=jayson[_0x2dab('0xa')][_0x2dab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11da80,_0x627cdb,_0x218d6b){return new BPromise(function(_0x188cef,_0x215faa){return client[_0x2dab('0xc')](_0x11da80,_0x218d6b)[_0x2dab('0xd')](function(_0x533046){logger['info'](_0x2dab('0xe'),_0x627cdb,_0x2dab('0xf'));logger[_0x2dab('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0x627cdb,'request\x20sent',JSON[_0x2dab('0x11')](_0x533046));if(_0x533046[_0x2dab('0x12')]){if(_0x533046[_0x2dab('0x12')][_0x2dab('0x13')]===0x1f4){logger[_0x2dab('0x12')]('Attachment,\x20%s,\x20%s',_0x627cdb,_0x533046[_0x2dab('0x12')][_0x2dab('0x14')]);return _0x215faa(_0x533046['error'][_0x2dab('0x14')]);}logger[_0x2dab('0x12')](_0x2dab('0xe'),_0x627cdb,_0x533046['error'][_0x2dab('0x14')]);return _0x188cef(_0x533046[_0x2dab('0x12')]['message']);}else{logger[_0x2dab('0x15')](_0x2dab('0xe'),_0x627cdb,_0x2dab('0xf'));_0x188cef(_0x533046[_0x2dab('0x16')][_0x2dab('0x14')]);}})['catch'](function(_0x128004){logger[_0x2dab('0x12')](_0x2dab('0xe'),_0x627cdb,_0x128004);_0x215faa(_0x128004);});});}exports[_0x2dab('0x17')]=function(_0x30bbde){var _0x2a86b5=this;return new Promise(function(_0x4ff9be,_0x9436f0){return db[_0x2dab('0x18')][_0x2dab('0x19')](_0x30bbde['body'],{'raw':_0x30bbde[_0x2dab('0x1a')]?_0x30bbde[_0x2dab('0x1a')][_0x2dab('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x477494){logger[_0x2dab('0x15')](_0x2dab('0x17'),_0x30bbde);logger[_0x2dab('0x10')](_0x2dab('0x17'),_0x30bbde,JSON[_0x2dab('0x11')](_0x477494));_0x4ff9be(_0x477494);})['catch'](function(_0x343bfc){logger[_0x2dab('0x12')]('CreateAttachment',_0x343bfc[_0x2dab('0x14')],_0x30bbde);_0x9436f0(_0x2a86b5[_0x2dab('0x12')](0x1f4,_0x343bfc[_0x2dab('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index a947f6d..0641795 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x823b63,_0x57f919){_0x823b63=_0x823b63-0x0;var _0x359766=_0xdb28[_0x823b63];return _0x359766;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+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(_0x295e5c,_0x4e2760){var _0x1705e6=function(_0x606be4){while(--_0x606be4){_0x295e5c['push'](_0x295e5c['shift']());}};_0x1705e6(++_0x4e2760);}(_0x2032,0xd9));var _0x2203=function(_0x303ba3,_0x4e2b10){_0x303ba3=_0x303ba3-0x0;var _0x469e41=_0x2032[_0x303ba3];return _0x469e41;};'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
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 5addbd7..aac2cba 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 _0x5fba=['use','User','passport','passport-local','Strategy','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../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.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','disabled','blocked','blockedAt','online','user','agent','then','add','minutes','clearBlockUser','getLicense','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken'];(function(_0x15a3e4,_0x1287d7){var _0x1b8205=function(_0x406982){while(--_0x406982){_0x15a3e4['push'](_0x15a3e4['shift']());}};_0x1b8205(++_0x1287d7);}(_0x5fba,0x128));var _0xa5fb=function(_0x331c5d,_0x3a6652){_0x331c5d=_0x331c5d-0x0;var _0x808c40=_0x5fba[_0x331c5d];return _0x808c40;};'use strict';var passport=require(_0xa5fb('0x0'));var LocalStrategy=require(_0xa5fb('0x1'))[_0xa5fb('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xa5fb('0x3'));var util=require(_0xa5fb('0x4'));var db=require(_0xa5fb('0x5'))['db'];var authService=require(_0xa5fb('0x6'));var utils=require(_0xa5fb('0x7'));var config=require('../../config/environment');var logger=require(_0xa5fb('0x8'))(_0xa5fb('0x9'));function isActiveDirectoryConfigured(_0x34d189){var _0x287d0b=![];if(typeof _0x34d189[_0xa5fb('0xa')]!==_0xa5fb('0xb')){_0x287d0b=_0x34d189[_0xa5fb('0xa')]['baseDN']&&_0x34d189[_0xa5fb('0xa')][_0xa5fb('0xc')]&&_0x34d189[_0xa5fb('0xa')][_0xa5fb('0xd')];}return _0x287d0b;}function adAuthenticate(_0x20e590,_0x30fb7a,_0x18e80c){return new BPromise(function(_0x3e5393,_0x59e5c9){try{var _0x27258e=new ActiveDirectory(_0x20e590);_0x27258e[_0xa5fb('0xe')](_0x30fb7a,_0x18e80c,function(_0xb6b38f,_0x16c6c0){if(_0xb6b38f){logger[_0xa5fb('0xf')](_0xa5fb('0x10'),_0x30fb7a,util[_0xa5fb('0x11')](_0xb6b38f,{'showHidden':![],'depth':null}));_0x59e5c9(_0xa5fb('0x12'));}else if(!_0x16c6c0){logger[_0xa5fb('0xf')](_0xa5fb('0x13'),_0x30fb7a);_0x59e5c9(_0xa5fb('0x12'));}else{_0x3e5393(_0x16c6c0);}});}catch(_0x7fce84){_0x59e5c9(_0x7fce84);}});}function ActiveDirectoryAuthenticate(_0x20818d,_0x262c07,_0x1553ad,_0x7b18d9){var _0x493099,_0x2712d2;if(!isActiveDirectoryConfigured(config)){logger[_0xa5fb('0xf')](_0xa5fb('0x14'),_0x262c07);return _0x7b18d9(null,![],{'message':_0xa5fb('0x12')});}return db[_0xa5fb('0x15')]['findOne']({'where':{'id':0x1},'attributes':[_0xa5fb('0x16'),_0xa5fb('0x17')],'raw':!![]})['then'](function(_0x3b4d4f){_0x493099=_0x3b4d4f;if(!_0x493099['adSsoEnabled']){logger[_0xa5fb('0xf')](_0xa5fb('0x18'),_0x262c07);throw new Error(_0xa5fb('0x12'));}return _0x20818d[_0xa5fb('0x19')]({'attributes':['id',_0xa5fb('0x1a'),_0xa5fb('0x1b'),_0xa5fb('0x1c'),'role',_0xa5fb('0x1d'),_0xa5fb('0x1e'),_0xa5fb('0x1f'),_0xa5fb('0x20')],'where':{'name':_0x262c07,'role':{'$or':['admin',_0xa5fb('0x21'),_0xa5fb('0x22')]},'adSsoEnabled':!![]}});})[_0xa5fb('0x23')](function(_0x5b01b0){if(!_0x5b01b0||_0x5b01b0&&_0x5b01b0[_0xa5fb('0x1a')]!==_0x262c07){throw new Error(_0xa5fb('0x12'));}_0x2712d2=_0x5b01b0;var _0x33d50b=_0x2712d2[_0xa5fb('0x1a')]+'@'+config['activedirectory'][_0xa5fb('0xd')];return adAuthenticate(config['activedirectory'],_0x33d50b,_0x1553ad);})[_0xa5fb('0x23')](function(_0x169a4e){if(_0x2712d2['disabled']){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x493099[_0xa5fb('0x17')]>0x0){if(_0x2712d2[_0xa5fb('0x1e')]){if(moment(_0x2712d2['blockedAt'])[_0xa5fb('0x24')](_0x493099[_0xa5fb('0x17')],_0xa5fb('0x25'))>moment()){throw new Error(_0xa5fb('0x12'));}return utils[_0xa5fb('0x26')](_0x2712d2,0x0,![],null)[_0xa5fb('0x23')](function(){return utils[_0xa5fb('0x27')](_0x2712d2);})['then'](function(){return _0x7b18d9(null,_0x2712d2);});}else{return utils[_0xa5fb('0x27')](_0x2712d2)[_0xa5fb('0x23')](function(){return _0x7b18d9(null,_0x2712d2);});}}else{return utils[_0xa5fb('0x27')](_0x2712d2)[_0xa5fb('0x23')](function(){return _0x7b18d9(null,_0x2712d2);});}})['catch'](function(_0x1036e7){return _0x7b18d9(null,![],_0x1036e7);});}function handleError(_0x27ebe3,_0x318b4c,_0x2a2e60){return _0x27ebe3[_0xa5fb('0x28')](_0x318b4c||0x1f4)['send']({'message':_0x2a2e60?_0x2a2e60[_0xa5fb('0x29')]||_0x2a2e60:''});}exports[_0xa5fb('0x2a')]=function(_0x719a70,_0x27a19c,_0x20f5be){passport[_0xa5fb('0xe')](_0xa5fb('0x2b'),function(_0x5bcd59,_0x1a9eaa,_0x184066){var _0x2649f8=_0x5bcd59||_0x184066;if(_0x2649f8){return handleError(_0x27a19c,0x191,_0x2649f8);}if(!_0x1a9eaa){return handleError(_0x27a19c,0x194,{'message':_0xa5fb('0x2c')});}else{var _0x4cad41={'payload':{'id':_0x1a9eaa['id'],'role':_0x1a9eaa[_0xa5fb('0x2d')]},'options':{'expiresIn':0x15180}};return authService[_0xa5fb('0x2e')](_0x4cad41)[_0xa5fb('0x23')](function(_0x380e68){_0x27a19c['json']({'id':_0x1a9eaa['id'],'token':_0x380e68,'statusCall':'','isAlreadyLogged':_0x1a9eaa['online']});});}})(_0x719a70,_0x27a19c,_0x20f5be);};passport[_0xa5fb('0x2f')]('ad-login',new LocalStrategy({'usernameField':_0xa5fb('0x1a'),'passwordField':_0xa5fb('0x1b')},function(_0x1210ea,_0x1ca235,_0x4ab884){return ActiveDirectoryAuthenticate(db[_0xa5fb('0x30')],_0x1210ea,_0x1ca235,_0x4ab884);}));
\ No newline at end of file
+var _0x354e=['send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','use','passport','passport-local','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','online','user','agent','disabled','blockedAt','add','minutes','clearBlockUser','getLicense','catch','status'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x354e,0x186));var _0xe354=function(_0x5cbdc2,_0x408ffe){_0x5cbdc2=_0x5cbdc2-0x0;var _0x5ade03=_0x354e[_0x5cbdc2];return _0x5ade03;};'use strict';var passport=require(_0xe354('0x0'));var LocalStrategy=require(_0xe354('0x1'))['Strategy'];var moment=require(_0xe354('0x2'));var ActiveDirectory=require(_0xe354('0x3'));var BPromise=require('bluebird');var util=require(_0xe354('0x4'));var db=require(_0xe354('0x5'))['db'];var authService=require(_0xe354('0x6'));var utils=require('../../config/utils');var config=require(_0xe354('0x7'));var logger=require(_0xe354('0x8'))(_0xe354('0x9'));function isActiveDirectoryConfigured(_0x4b908a){var _0x7b4018=![];if(typeof _0x4b908a[_0xe354('0xa')]!==_0xe354('0xb')){_0x7b4018=_0x4b908a['activedirectory']['baseDN']&&_0x4b908a[_0xe354('0xa')][_0xe354('0xc')]&&_0x4b908a[_0xe354('0xa')][_0xe354('0xd')];}return _0x7b4018;}function adAuthenticate(_0x5391ed,_0x3aa277,_0x3e99e0){return new BPromise(function(_0xb958c0,_0x345cd5){try{var _0x89fc6c=new ActiveDirectory(_0x5391ed);_0x89fc6c['authenticate'](_0x3aa277,_0x3e99e0,function(_0x5221be,_0x344624){if(_0x5221be){logger[_0xe354('0xe')](_0xe354('0xf'),_0x3aa277,util[_0xe354('0x10')](_0x5221be,{'showHidden':![],'depth':null}));_0x345cd5(_0xe354('0x11'));}else if(!_0x344624){logger[_0xe354('0xe')](_0xe354('0x12'),_0x3aa277);_0x345cd5('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xb958c0(_0x344624);}});}catch(_0x4f49a7){_0x345cd5(_0x4f49a7);}});}function ActiveDirectoryAuthenticate(_0x201aa8,_0x16ff7d,_0x58ec4a,_0x398db4){var _0x4e271e,_0x56076e;if(!isActiveDirectoryConfigured(config)){logger[_0xe354('0xe')](_0xe354('0x13'),_0x16ff7d);return _0x398db4(null,![],{'message':_0xe354('0x11')});}return db[_0xe354('0x14')][_0xe354('0x15')]({'where':{'id':0x1},'attributes':[_0xe354('0x16'),_0xe354('0x17')],'raw':!![]})[_0xe354('0x18')](function(_0x53e05f){_0x4e271e=_0x53e05f;if(!_0x4e271e[_0xe354('0x16')]){logger['error'](_0xe354('0x19'),_0x16ff7d);throw new Error(_0xe354('0x11'));}return _0x201aa8[_0xe354('0x15')]({'attributes':['id',_0xe354('0x1a'),_0xe354('0x1b'),_0xe354('0x1c'),_0xe354('0x1d'),'disabled',_0xe354('0x1e'),'blockedAt',_0xe354('0x1f')],'where':{'name':_0x16ff7d,'role':{'$or':['admin',_0xe354('0x20'),_0xe354('0x21')]},'adSsoEnabled':!![]}});})[_0xe354('0x18')](function(_0x25bde4){if(!_0x25bde4||_0x25bde4&&_0x25bde4[_0xe354('0x1a')]!==_0x16ff7d){throw new Error(_0xe354('0x11'));}_0x56076e=_0x25bde4;var _0x3f22b7=_0x56076e[_0xe354('0x1a')]+'@'+config[_0xe354('0xa')]['domain'];return adAuthenticate(config['activedirectory'],_0x3f22b7,_0x58ec4a);})[_0xe354('0x18')](function(_0x58acee){if(_0x56076e[_0xe354('0x22')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x4e271e['blockDuration']>0x0){if(_0x56076e['blocked']){if(moment(_0x56076e[_0xe354('0x23')])[_0xe354('0x24')](_0x4e271e[_0xe354('0x17')],_0xe354('0x25'))>moment()){throw new Error(_0xe354('0x11'));}return utils[_0xe354('0x26')](_0x56076e,0x0,![],null)['then'](function(){return utils['getLicense'](_0x56076e);})[_0xe354('0x18')](function(){return _0x398db4(null,_0x56076e);});}else{return utils[_0xe354('0x27')](_0x56076e)[_0xe354('0x18')](function(){return _0x398db4(null,_0x56076e);});}}else{return utils[_0xe354('0x27')](_0x56076e)[_0xe354('0x18')](function(){return _0x398db4(null,_0x56076e);});}})[_0xe354('0x28')](function(_0x3d0f1f){return _0x398db4(null,![],_0x3d0f1f);});}function handleError(_0x456c99,_0xe3088a,_0x1d1af5){return _0x456c99[_0xe354('0x29')](_0xe3088a||0x1f4)[_0xe354('0x2a')]({'message':_0x1d1af5?_0x1d1af5[_0xe354('0x2b')]||_0x1d1af5:''});}exports[_0xe354('0x2c')]=function(_0x501e5c,_0x7fffe8,_0x126254){passport['authenticate'](_0xe354('0x2d'),function(_0x538f86,_0x57c359,_0x4d689d){var _0x3a6034=_0x538f86||_0x4d689d;if(_0x3a6034){return handleError(_0x7fffe8,0x191,_0x3a6034);}if(!_0x57c359){return handleError(_0x7fffe8,0x194,{'message':_0xe354('0x2e')});}else{var _0x406063={'payload':{'id':_0x57c359['id'],'role':_0x57c359[_0xe354('0x1d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x406063)[_0xe354('0x18')](function(_0x4af644){_0x7fffe8['json']({'id':_0x57c359['id'],'token':_0x4af644,'statusCall':'','isAlreadyLogged':_0x57c359['online']});});}})(_0x501e5c,_0x7fffe8,_0x126254);};passport[_0xe354('0x2f')](_0xe354('0x2d'),new LocalStrategy({'usernameField':_0xe354('0x1a'),'passwordField':_0xe354('0x1b')},function(_0x26a3c7,_0x231181,_0x295186){return ActiveDirectoryAuthenticate(db['User'],_0x26a3c7,_0x231181,_0x295186);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 849e8b0..513d58d 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 _0x501c=['login','express','Router','./authActiveDirectory.controller','post'];(function(_0x554e66,_0x4c7936){var _0x487a08=function(_0x3e43ba){while(--_0x3e43ba){_0x554e66['push'](_0x554e66['shift']());}};_0x487a08(++_0x4c7936);}(_0x501c,0xbf));var _0xc501=function(_0x4ad5d9,_0x18b357){_0x4ad5d9=_0x4ad5d9-0x0;var _0x1730c7=_0x501c[_0x4ad5d9];return _0x1730c7;};'use strict';var express=require(_0xc501('0x0'));var router=express[_0xc501('0x1')]();var controller=require(_0xc501('0x2'));router[_0xc501('0x3')]('/',controller[_0xc501('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0xc176=['post','login','exports','express'];(function(_0x568cf0,_0x1a44cb){var _0x360f81=function(_0x414953){while(--_0x414953){_0x568cf0['push'](_0x568cf0['shift']());}};_0x360f81(++_0x1a44cb);}(_0xc176,0xc7));var _0x6c17=function(_0x2fd0f0,_0x4b634e){_0x2fd0f0=_0x2fd0f0-0x0;var _0x57f71a=_0xc176[_0x2fd0f0];return _0x57f71a;};'use strict';var express=require(_0x6c17('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0x6c17('0x1')]('/',controller[_0x6c17('0x2')]);module[_0x6c17('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 963b5b9..3311ded 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x576425,_0x966e28){var _0x1c3685=function(_0x4930d2){while(--_0x4930d2){_0x576425['push'](_0x576425['shift']());}};_0x1c3685(++_0x966e28);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x7a54,0x106));var _0x47a5=function(_0x249811,_0x5562c6){_0x249811=_0x249811-0x0;var _0xbbdb64=_0x7a54[_0x249811];return _0xbbdb64;};'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 0571d07..71d3091 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 _0x93da=['login','setTokenCookie','exports','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','/callback','callback','isMiddleware'];(function(_0x41ca35,_0x93d92a){var _0x36ef98=function(_0x302c7f){while(--_0x302c7f){_0x41ca35['push'](_0x41ca35['shift']());}};_0x36ef98(++_0x93d92a);}(_0x93da,0x92));var _0xa93d=function(_0x4886d7,_0x5a6dbc){_0x4886d7=_0x4886d7-0x0;var _0x161122=_0x93da[_0x4886d7];return _0x161122;};'use strict';var express=require(_0xa93d('0x0'));var passport=require('passport');var router=express[_0xa93d('0x1')]();var controller=require(_0xa93d('0x2'));var userController=require(_0xa93d('0x3'));var authService=require(_0xa93d('0x4'));router['get']('/',controller['login']);router['get'](_0xa93d('0x5'),controller[_0xa93d('0x6')],authService[_0xa93d('0x7')],userController[_0xa93d('0x8')],authService[_0xa93d('0x9')]);module[_0xa93d('0xa')]=router;
\ No newline at end of file
+var _0x52fa=['/callback','callback','setTokenCookie','exports','express','passport','Router','../../components/auth/service','get'];(function(_0x3dde18,_0x11bdb0){var _0x436d04=function(_0x3f86ba){while(--_0x3f86ba){_0x3dde18['push'](_0x3dde18['shift']());}};_0x436d04(++_0x11bdb0);}(_0x52fa,0x82));var _0xa52f=function(_0xe49d0e,_0x2b6b0){_0xe49d0e=_0xe49d0e-0x0;var _0x104867=_0x52fa[_0xe49d0e];return _0x104867;};'use strict';var express=require(_0xa52f('0x0'));var passport=require(_0xa52f('0x1'));var router=express[_0xa52f('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0xa52f('0x3'));router[_0xa52f('0x4')]('/',controller['login']);router['get'](_0xa52f('0x5'),controller[_0xa52f('0x6')],authService['isMiddleware'],userController['login'],authService[_0xa52f('0x7')]);module[_0xa52f('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 69d2f20..99be649 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 _0x8869=['getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','message','status','send','login','local-login','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','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://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','previousPasswords','resetPasswordToken','resetPasswordExpires','save','Password\x20reset!','use','User','util','passport-local','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','findOne','allowedLoginAttempts','then','name','password','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','blockDuration','minutes','clearBlockUser','blocked','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!'];(function(_0xd58267,_0x3a7366){var _0x8b24ca=function(_0x200808){while(--_0x200808){_0xd58267['push'](_0xd58267['shift']());}};_0x8b24ca(++_0x3a7366);}(_0x8869,0x1c2));var _0x9886=function(_0x324e6d,_0x1dfa19){_0x324e6d=_0x324e6d-0x0;var _0x8fba28=_0x8869[_0x324e6d];return _0x8fba28;};'use strict';var util=require(_0x9886('0x0'));var passport=require('passport');var LocalStrategy=require(_0x9886('0x1'))['Strategy'];var jayson=require(_0x9886('0x2'));var _=require(_0x9886('0x3'));var rs=require(_0x9886('0x4'));var moment=require(_0x9886('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x9886('0x6'));var utils=require(_0x9886('0x7'));var client=jayson[_0x9886('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x90dfb1,_0x2139fd,_0x1fdda7,_0x392fb6){var _0x328a42,_0x4f7fab;return db['Setting'][_0x9886('0x9')]({'where':{'id':0x1},'attributes':[_0x9886('0xa'),'blockDuration'],'raw':!![]})[_0x9886('0xb')](function(_0x249ead){_0x328a42=_0x249ead;return _0x90dfb1['findOne']({'attributes':['id',_0x9886('0xc'),_0x9886('0xd'),'salt',_0x9886('0xe'),_0x9886('0xf'),'blocked',_0x9886('0x10'),_0x9886('0x11')],'where':{'name':_0x2139fd,'role':{'$or':[_0x9886('0x12'),_0x9886('0x13'),_0x9886('0x14')]}}});})[_0x9886('0xb')](function(_0x428ed4){if(!_0x428ed4||_0x428ed4&&_0x428ed4['name']!==_0x2139fd){throw new Error(_0x9886('0x15'));}else{_0x4f7fab=_0x428ed4;return _0x4f7fab;}})['then'](function(){_0x4f7fab[_0x9886('0x16')](_0x1fdda7,function(_0x56c427,_0x3348a9){var _0x240012=_0x4f7fab['loginAttempts']+0x1;if(_0x56c427){return _0x392fb6(_0x56c427);}else if(!_0x3348a9){if(_0x4f7fab[_0x9886('0xf')]){return _0x392fb6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x328a42[_0x9886('0xa')]>0x0){if(_0x4f7fab['blocked']){if(_0x328a42['blockDuration']>0x0){if(moment(_0x4f7fab[_0x9886('0x10')])[_0x9886('0x17')](_0x328a42[_0x9886('0x18')],_0x9886('0x19'))>moment()){return _0x392fb6(null,![],{'message':_0x9886('0x15')});}else{return utils[_0x9886('0x1a')](_0x4f7fab,_0x240012,![],null)['then'](function(){return _0x392fb6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x392fb6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x240012>=_0x328a42[_0x9886('0xa')]){return utils[_0x9886('0x1a')](_0x4f7fab,0x0,!![],moment())[_0x9886('0xb')](function(){return _0x392fb6(null,![],{'message':_0x9886('0x15')});});}else{return utils[_0x9886('0x1a')](_0x4f7fab,_0x240012,![],null)[_0x9886('0xb')](function(){return _0x392fb6(null,![],{'message':_0x9886('0x15')});});}}}else{return _0x392fb6(null,![],{'message':_0x9886('0x15')});}}else{if(_0x4f7fab[_0x9886('0xf')]){return _0x392fb6(null,![],{'message':_0x9886('0x15')});}else if(_0x328a42['allowedLoginAttempts']>0x0){if(_0x4f7fab['blocked']){if(_0x328a42[_0x9886('0x18')]>0x0){if(moment(_0x4f7fab[_0x9886('0x10')])['add'](_0x328a42[_0x9886('0x18')],_0x9886('0x19'))>moment()){return _0x392fb6(null,![],{'message':_0x9886('0x15')});}else{return utils[_0x9886('0x1a')](_0x4f7fab,0x0,![],null)['then'](function(){return utils['getLicense'](_0x4f7fab);})[_0x9886('0xb')](function(){return _0x392fb6(null,_0x4f7fab);});}}else{return _0x392fb6(null,![],{'message':_0x9886('0x15')});}}else{return utils[_0x9886('0x1a')](_0x4f7fab,0x0,![],null)[_0x9886('0xb')](function(){return utils['getLicense'](_0x4f7fab);})[_0x9886('0xb')](function(){return _0x392fb6(null,_0x4f7fab);})['catch'](function(_0x47b2cf){return _0x392fb6(null,![],_0x47b2cf);});}}else{if(_0x4f7fab[_0x9886('0x1b')]){return _0x392fb6(null,![],{'message':_0x9886('0x15')});}else{return utils[_0x9886('0x1c')](_0x4f7fab)[_0x9886('0xb')](function(){return _0x392fb6(null,_0x4f7fab);});}}}});})[_0x9886('0x1d')](function(_0x3512f8){return _0x392fb6(null,![],_0x3512f8);});}function sendServiceMail(_0x405d9a){return db[_0x9886('0x1e')][_0x9886('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x9886('0xc'),'email'],'include':[{'model':db[_0x9886('0x20')],'as':_0x9886('0x21'),'include':[{'model':db[_0x9886('0x22')],'as':_0x9886('0x22')}]}]})[_0x9886('0xb')](function(_0x3d6d82){if(!_0x3d6d82){throw new Error(_0x9886('0x23'));}var _0x19ab8d=_0x3d6d82[_0x9886('0x24')]();var _0x5f334d={'account':_0x19ab8d,'message':_[_0x9886('0x25')]({'from':util[_0x9886('0x26')](_0x9886('0x27'),_0x3d6d82[_0x9886('0xc')],_0x3d6d82[_0x9886('0x28')]||_0x3d6d82['Smtp'][_0x9886('0x13')])},_0x405d9a)};return client[_0x9886('0x29')](_0x9886('0x2a'),_0x5f334d);})['then'](function(_0x47a8db){if(_0x47a8db[_0x9886('0x2b')]){throw new Error(util[_0x9886('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x47a8db[_0x9886('0x2b')][_0x9886('0x2c')]||JSON['stringify'](_0x47a8db[_0x9886('0x2b')])));}return!![];});}function handleError(_0x47338c,_0x4e79a9,_0x13cf08){return _0x47338c[_0x9886('0x2d')](_0x4e79a9||0x1f4)[_0x9886('0x2e')]({'message':_0x13cf08?_0x13cf08[_0x9886('0x2c')]||_0x13cf08:''});}exports[_0x9886('0x2f')]=function(_0x923878,_0x3b0e37,_0x4f96c3){passport[_0x9886('0x16')](_0x9886('0x30'),function(_0x229f06,_0x413250,_0x5801cb){var _0x531ea4=_0x229f06||_0x5801cb;if(_0x531ea4){return handleError(_0x3b0e37,0x191,_0x531ea4);}if(!_0x413250){return handleError(_0x3b0e37,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x282302={'payload':{'id':_0x413250['id'],'role':_0x413250[_0x9886('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x9886('0x31')](_0x282302)[_0x9886('0xb')](function(_0x12d7de){_0x3b0e37[_0x9886('0x32')]({'id':_0x413250['id'],'token':_0x12d7de,'statusCall':'','isAlreadyLogged':_0x413250['online']});});}})(_0x923878,_0x3b0e37,_0x4f96c3);};exports[_0x9886('0x33')]=function(_0x1ef82e,_0x20b616){if(!_0x1ef82e[_0x9886('0x34')][_0x9886('0x28')]){return handleError(_0x20b616,0x1f4,{'message':_0x9886('0x35')});}var _0x1ae1dc=rs[_0x9886('0x36')]();_0x1ef82e[_0x9886('0x34')]['email']=_0x1ef82e[_0x9886('0x34')][_0x9886('0x28')]['trim']()[_0x9886('0x37')]();var _0x2f4cf5;return db[_0x9886('0x38')][_0x9886('0x9')]({'where':{'id':0x1},'attributes':[_0x9886('0xa'),_0x9886('0x18')],'raw':!![]})[_0x9886('0xb')](function(_0x1ad3d2){_0x2f4cf5=_0x1ad3d2;return db['User'][_0x9886('0x1f')]({'where':{'email':_0x1ef82e[_0x9886('0x34')][_0x9886('0x28')]}});})[_0x9886('0xb')](function(_0x5a396b){if(!_0x5a396b){throw new Error(_0x9886('0x39'));}if(_0x5a396b['disabled']){throw new Error(_0x9886('0x3a'));}if(_0x5a396b[_0x9886('0x1b')]){if(moment(_0x5a396b[_0x9886('0x10')])[_0x9886('0x17')](_0x2f4cf5[_0x9886('0x18')],'minutes')>moment()){throw new Error(_0x9886('0x3b'));}else{_0x5a396b[_0x9886('0x1b')]=![];_0x5a396b[_0x9886('0x10')]=null;}}_0x5a396b['resetPasswordToken']=_0x1ae1dc;_0x5a396b['resetPasswordExpires']=Date[_0x9886('0x3c')]()+0x36ee80;return _0x5a396b['save']();})[_0x9886('0xb')](function(){return sendServiceMail({'to':_0x1ef82e[_0x9886('0x34')][_0x9886('0x28')],'subject':_0x9886('0x3d'),'text':_0x9886('0x3e')+_0x9886('0x3f')+_0x9886('0x40')+_0x1ef82e[_0x9886('0x41')][_0x9886('0x42')]+'/reset/'+_0x1ae1dc+'\x0a\x0a'+_0x9886('0x43')});})[_0x9886('0xb')](function(){_0x20b616['status'](0xc8)[_0x9886('0x2e')]({'message':_0x9886('0x44')});})[_0x9886('0x1d')](function(_0x5d34eb){return handleError(_0x20b616,0x1f4,_0x5d34eb);});};exports[_0x9886('0x45')]=function(_0x1b71e8,_0xdbefe){return db['User']['find']({'where':{'resetPasswordToken':_0x1b71e8[_0x9886('0x46')]['token'],'resetPasswordExpires':{'$gt':Date[_0x9886('0x3c')]()}}})[_0x9886('0xb')](function(_0x53ab05){if(!_0x53ab05){throw new Error(_0x9886('0x47'));}return db[_0x9886('0x38')][_0x9886('0x9')]({'attributes':['id',_0x9886('0x48'),'enforcePasswordHistory',_0x9886('0x49')]})[_0x9886('0xb')](function(_0x1e413d){if(_0x1e413d[_0x9886('0x48')])authService['validatePasswordPattern'](_0x1b71e8[_0x9886('0x34')][_0x9886('0xd')]);if(!_0x1e413d['enforcePasswordHistory']||!_0x53ab05[_0x9886('0x4a')])return _0x53ab05;authService['validatePasswordHistory'](_0x1b71e8[_0x9886('0x34')][_0x9886('0xd')],_0x53ab05[_0x9886('0x4a')],_0x1e413d[_0x9886('0x49')]);return _0x53ab05;})[_0x9886('0xb')](function(){_0x53ab05['password']=_0x1b71e8[_0x9886('0x34')][_0x9886('0xd')];_0x53ab05[_0x9886('0x4b')]=null;_0x53ab05[_0x9886('0x4c')]=null;return _0x53ab05[_0x9886('0x4d')]();});})[_0x9886('0xb')](function(){_0xdbefe['status'](0xc8)[_0x9886('0x2e')]({'message':_0x9886('0x4e')});})[_0x9886('0x1d')](function(_0x515b3a){return handleError(_0xdbefe,0x1f4,_0x515b3a);});};passport[_0x9886('0x4f')](_0x9886('0x30'),new LocalStrategy({'usernameField':'name','passwordField':_0x9886('0xd')},function(_0x4d9d74,_0x2ace2e,_0x37c058){return localAuthenticate(db[_0x9886('0x50')],_0x4d9d74,_0x2ace2e,_0x37c058);}));
\ No newline at end of file
+var _0xc466=['error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','password','previousPasswords','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','blocked','blockedAt','loginAttempts','admin','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xc466,0xc1));var _0x6c46=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xc466[_0x1cb18a];return _0x22442e;};'use strict';var util=require(_0x6c46('0x0'));var passport=require(_0x6c46('0x1'));var LocalStrategy=require(_0x6c46('0x2'))[_0x6c46('0x3')];var jayson=require(_0x6c46('0x4'));var _=require('lodash');var rs=require(_0x6c46('0x5'));var moment=require(_0x6c46('0x6'));var db=require(_0x6c46('0x7'))['db'];var authService=require(_0x6c46('0x8'));var utils=require('../../config/utils');var client=jayson[_0x6c46('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x103400,_0x3bbdab,_0xd1ef03,_0x1d1a52){var _0x157487,_0x576680;return db[_0x6c46('0xa')][_0x6c46('0xb')]({'where':{'id':0x1},'attributes':[_0x6c46('0xc'),_0x6c46('0xd')],'raw':!![]})[_0x6c46('0xe')](function(_0x1b1a5b){_0x157487=_0x1b1a5b;return _0x103400[_0x6c46('0xb')]({'attributes':['id','name','password','salt','role','disabled',_0x6c46('0xf'),_0x6c46('0x10'),_0x6c46('0x11')],'where':{'name':_0x3bbdab,'role':{'$or':[_0x6c46('0x12'),_0x6c46('0x13'),'agent']}}});})[_0x6c46('0xe')](function(_0x2a6cd8){if(!_0x2a6cd8||_0x2a6cd8&&_0x2a6cd8[_0x6c46('0x14')]!==_0x3bbdab){throw new Error(_0x6c46('0x15'));}else{_0x576680=_0x2a6cd8;return _0x576680;}})[_0x6c46('0xe')](function(){_0x576680[_0x6c46('0x16')](_0xd1ef03,function(_0x27bc7f,_0x2d2bb3){var _0xf41867=_0x576680[_0x6c46('0x11')]+0x1;if(_0x27bc7f){return _0x1d1a52(_0x27bc7f);}else if(!_0x2d2bb3){if(_0x576680[_0x6c46('0x17')]){return _0x1d1a52(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x157487[_0x6c46('0xc')]>0x0){if(_0x576680[_0x6c46('0xf')]){if(_0x157487[_0x6c46('0xd')]>0x0){if(moment(_0x576680[_0x6c46('0x10')])[_0x6c46('0x18')](_0x157487[_0x6c46('0xd')],_0x6c46('0x19'))>moment()){return _0x1d1a52(null,![],{'message':_0x6c46('0x15')});}else{return utils[_0x6c46('0x1a')](_0x576680,_0xf41867,![],null)[_0x6c46('0xe')](function(){return _0x1d1a52(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x1d1a52(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xf41867>=_0x157487[_0x6c46('0xc')]){return utils[_0x6c46('0x1a')](_0x576680,0x0,!![],moment())[_0x6c46('0xe')](function(){return _0x1d1a52(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x6c46('0x1a')](_0x576680,_0xf41867,![],null)[_0x6c46('0xe')](function(){return _0x1d1a52(null,![],{'message':_0x6c46('0x15')});});}}}else{return _0x1d1a52(null,![],{'message':_0x6c46('0x15')});}}else{if(_0x576680[_0x6c46('0x17')]){return _0x1d1a52(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x157487['allowedLoginAttempts']>0x0){if(_0x576680[_0x6c46('0xf')]){if(_0x157487[_0x6c46('0xd')]>0x0){if(moment(_0x576680[_0x6c46('0x10')])[_0x6c46('0x18')](_0x157487[_0x6c46('0xd')],_0x6c46('0x19'))>moment()){return _0x1d1a52(null,![],{'message':_0x6c46('0x15')});}else{return utils['clearBlockUser'](_0x576680,0x0,![],null)[_0x6c46('0xe')](function(){return utils[_0x6c46('0x1b')](_0x576680);})['then'](function(){return _0x1d1a52(null,_0x576680);});}}else{return _0x1d1a52(null,![],{'message':_0x6c46('0x15')});}}else{return utils['clearBlockUser'](_0x576680,0x0,![],null)['then'](function(){return utils[_0x6c46('0x1b')](_0x576680);})[_0x6c46('0xe')](function(){return _0x1d1a52(null,_0x576680);})[_0x6c46('0x1c')](function(_0xa6f436){return _0x1d1a52(null,![],_0xa6f436);});}}else{if(_0x576680[_0x6c46('0xf')]){return _0x1d1a52(null,![],{'message':_0x6c46('0x15')});}else{return utils['getLicense'](_0x576680)['then'](function(){return _0x1d1a52(null,_0x576680);});}}}});})[_0x6c46('0x1c')](function(_0xbfbf54){return _0x1d1a52(null,![],_0xbfbf54);});}function sendServiceMail(_0x1b24b2){return db[_0x6c46('0x1d')][_0x6c46('0x1e')]({'where':{'service':!![]},'attributes':['id','name',_0x6c46('0x1f')],'include':[{'model':db[_0x6c46('0x20')],'as':_0x6c46('0x21'),'include':[{'model':db['CloudProvider'],'as':_0x6c46('0x22')}]}]})[_0x6c46('0xe')](function(_0x53af26){if(!_0x53af26){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x575508=_0x53af26[_0x6c46('0x23')]();var _0x18a464={'account':_0x575508,'message':_[_0x6c46('0x24')]({'from':util[_0x6c46('0x25')](_0x6c46('0x26'),_0x53af26[_0x6c46('0x14')],_0x53af26['email']||_0x53af26[_0x6c46('0x21')][_0x6c46('0x13')])},_0x1b24b2)};return client[_0x6c46('0x27')](_0x6c46('0x28'),_0x18a464);})[_0x6c46('0xe')](function(_0x22ec33){if(_0x22ec33[_0x6c46('0x29')]){throw new Error(util[_0x6c46('0x25')](_0x6c46('0x2a'),_0x22ec33[_0x6c46('0x29')]['message']||JSON[_0x6c46('0x2b')](_0x22ec33[_0x6c46('0x29')])));}return!![];});}function handleError(_0x5e8dcd,_0x3c429b,_0xe6416d){return _0x5e8dcd[_0x6c46('0x2c')](_0x3c429b||0x1f4)['send']({'message':_0xe6416d?_0xe6416d[_0x6c46('0x2d')]||_0xe6416d:''});}exports[_0x6c46('0x2e')]=function(_0x1ca7b9,_0x58cc10,_0x123ac0){passport[_0x6c46('0x16')](_0x6c46('0x2f'),function(_0x11c6ed,_0x594ae8,_0x2cf523){var _0x52043f=_0x11c6ed||_0x2cf523;if(_0x52043f){return handleError(_0x58cc10,0x191,_0x52043f);}if(!_0x594ae8){return handleError(_0x58cc10,0x194,{'message':_0x6c46('0x30')});}else{var _0x24bae2={'payload':{'id':_0x594ae8['id'],'role':_0x594ae8['role']},'options':{'expiresIn':0x15180}};return authService[_0x6c46('0x31')](_0x24bae2)[_0x6c46('0xe')](function(_0xe181){_0x58cc10[_0x6c46('0x32')]({'id':_0x594ae8['id'],'token':_0xe181,'statusCall':'','isAlreadyLogged':_0x594ae8[_0x6c46('0x33')]});});}})(_0x1ca7b9,_0x58cc10,_0x123ac0);};exports['forgot']=function(_0x2ad470,_0x2a1f0b){if(!_0x2ad470[_0x6c46('0x34')][_0x6c46('0x1f')]){return handleError(_0x2a1f0b,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x322ea5=rs[_0x6c46('0x35')]();_0x2ad470['body'][_0x6c46('0x1f')]=_0x2ad470[_0x6c46('0x34')][_0x6c46('0x1f')][_0x6c46('0x36')]()[_0x6c46('0x37')]();var _0x2d7a0e;return db[_0x6c46('0xa')][_0x6c46('0xb')]({'where':{'id':0x1},'attributes':[_0x6c46('0xc'),'blockDuration'],'raw':!![]})[_0x6c46('0xe')](function(_0x500ce4){_0x2d7a0e=_0x500ce4;return db[_0x6c46('0x38')][_0x6c46('0x1e')]({'where':{'email':_0x2ad470['body'][_0x6c46('0x1f')]}});})[_0x6c46('0xe')](function(_0x473c80){if(!_0x473c80){throw new Error(_0x6c46('0x39'));}if(_0x473c80[_0x6c46('0x17')]){throw new Error(_0x6c46('0x3a'));}if(_0x473c80['blocked']){if(moment(_0x473c80[_0x6c46('0x10')])[_0x6c46('0x18')](_0x2d7a0e[_0x6c46('0xd')],_0x6c46('0x19'))>moment()){throw new Error(_0x6c46('0x3b'));}else{_0x473c80[_0x6c46('0xf')]=![];_0x473c80[_0x6c46('0x10')]=null;}}_0x473c80[_0x6c46('0x3c')]=_0x322ea5;_0x473c80[_0x6c46('0x3d')]=Date[_0x6c46('0x3e')]()+0x36ee80;return _0x473c80[_0x6c46('0x3f')]();})[_0x6c46('0xe')](function(){return sendServiceMail({'to':_0x2ad470[_0x6c46('0x34')][_0x6c46('0x1f')],'subject':_0x6c46('0x40'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x6c46('0x41')+_0x6c46('0x42')+_0x2ad470[_0x6c46('0x43')][_0x6c46('0x44')]+'/reset/'+_0x322ea5+'\x0a\x0a'+_0x6c46('0x45')});})[_0x6c46('0xe')](function(){_0x2a1f0b[_0x6c46('0x2c')](0xc8)[_0x6c46('0x46')]({'message':'Reset\x20Email\x20sent!'});})[_0x6c46('0x1c')](function(_0x4aebe4){return handleError(_0x2a1f0b,0x1f4,_0x4aebe4);});};exports['reset']=function(_0xef45c8,_0x52fd01){return db[_0x6c46('0x38')]['find']({'where':{'resetPasswordToken':_0xef45c8['params'][_0x6c46('0x47')],'resetPasswordExpires':{'$gt':Date[_0x6c46('0x3e')]()}}})[_0x6c46('0xe')](function(_0x1f37de){if(!_0x1f37de){throw new Error(_0x6c46('0x48'));}return db[_0x6c46('0xa')][_0x6c46('0xb')]({'attributes':['id','securePassword',_0x6c46('0x49'),_0x6c46('0x4a')]})[_0x6c46('0xe')](function(_0x370a7f){if(_0x370a7f[_0x6c46('0x4b')])authService['validatePasswordPattern'](_0xef45c8[_0x6c46('0x34')][_0x6c46('0x4c')]);if(!_0x370a7f[_0x6c46('0x49')]||!_0x1f37de[_0x6c46('0x4d')])return _0x1f37de;authService['validatePasswordHistory'](_0xef45c8[_0x6c46('0x34')][_0x6c46('0x4c')],_0x1f37de[_0x6c46('0x4d')],_0x370a7f[_0x6c46('0x4a')]);return _0x1f37de;})[_0x6c46('0xe')](function(){_0x1f37de['password']=_0xef45c8[_0x6c46('0x34')][_0x6c46('0x4c')];_0x1f37de['resetPasswordToken']=null;_0x1f37de[_0x6c46('0x3d')]=null;return _0x1f37de[_0x6c46('0x3f')]();});})[_0x6c46('0xe')](function(){_0x52fd01['status'](0xc8)[_0x6c46('0x46')]({'message':'Password\x20reset!'});})[_0x6c46('0x1c')](function(_0x404e5b){return handleError(_0x52fd01,0x1f4,_0x404e5b);});};passport['use'](_0x6c46('0x2f'),new LocalStrategy({'usernameField':_0x6c46('0x14'),'passwordField':_0x6c46('0x4c')},function(_0x139ca0,_0x23419e,_0x348365){return localAuthenticate(db[_0x6c46('0x38')],_0x139ca0,_0x23419e,_0x348365);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index a521eaf..3120af4 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 _0xc253=['forgot','exports','express','Router','./authLocal.controller','post','/forgot'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xc253,0x167));var _0x3c25=function(_0x466f51,_0x1393ed){_0x466f51=_0x466f51-0x0;var _0x2db305=_0xc253[_0x466f51];return _0x2db305;};'use strict';var express=require(_0x3c25('0x0'));var router=express[_0x3c25('0x1')]();var controller=require(_0x3c25('0x2'));router[_0x3c25('0x3')]('/',controller['login']);router[_0x3c25('0x3')](_0x3c25('0x4'),controller[_0x3c25('0x5')]);router[_0x3c25('0x3')]('/reset/:token',controller['reset']);module[_0x3c25('0x6')]=router;
\ No newline at end of file
+var _0x4308=['reset','exports','post','login','/forgot','forgot','/reset/:token'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4308,0x6b));var _0x8430=function(_0x583996,_0x151400){_0x583996=_0x583996-0x0;var _0x2d95a4=_0x4308[_0x583996];return _0x2d95a4;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authLocal.controller');router[_0x8430('0x0')]('/',controller[_0x8430('0x1')]);router[_0x8430('0x0')](_0x8430('0x2'),controller[_0x8430('0x3')]);router[_0x8430('0x0')](_0x8430('0x4'),controller[_0x8430('0x5')]);module[_0x8430('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index c0b4836..21b1fef 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 _0xd896=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xd896,0x9a));var _0x6d89=function(_0x270a2a,_0x572ead){_0x270a2a=_0x270a2a-0x0;var _0x1eeeb3=_0xd896[_0x270a2a];return _0x1eeeb3;};'use strict';var Sequelize=require(_0x6d89('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6d89('0x1')]},'status':{'type':Sequelize[_0x6d89('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6d89('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x255d=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x4d2993,_0x1c9473){var _0x427374=function(_0x149dfd){while(--_0x149dfd){_0x4d2993['push'](_0x4d2993['shift']());}};_0x427374(++_0x1c9473);}(_0x255d,0x8b));var _0xd255=function(_0x5302a8,_0x1d8fe2){_0x5302a8=_0x5302a8-0x0;var _0x182feb=_0x255d[_0x5302a8];return _0x182feb;};'use strict';var Sequelize=require(_0xd255('0x0'));module[_0xd255('0x1')]={'name':{'type':Sequelize[_0xd255('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xd255('0x2')]},'description':{'type':Sequelize[_0xd255('0x2')]},'status':{'type':Sequelize[_0xd255('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd255('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 037b108..1e0797c 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 _0x2315=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','Automation','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','show','params','keys','options','find','create','body','catch','addConditions','Condition','ids','omit','getConditions','findOne','pick','addActions','Action','getActions','hasOwnProperty'];(function(_0x19aee6,_0xcb2918){var _0x511975=function(_0x4fbb42){while(--_0x4fbb42){_0x19aee6['push'](_0x19aee6['shift']());}};_0x511975(++_0xcb2918);}(_0x2315,0xaa));var _0x5231=function(_0x4b089b,_0x4cdc48){_0x4b089b=_0x4b089b-0x0;var _0xcf02fc=_0x2315[_0x4b089b];return _0xcf02fc;};'use strict';var emlformat=require(_0x5231('0x0'));var rimraf=require(_0x5231('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5231('0x2'));var rp=require(_0x5231('0x3'));var moment=require(_0x5231('0x4'));var BPromise=require(_0x5231('0x5'));var Mustache=require('mustache');var util=require(_0x5231('0x6'));var path=require(_0x5231('0x7'));var sox=require(_0x5231('0x8'));var csv=require(_0x5231('0x9'));var ejs=require(_0x5231('0xa'));var fs=require('fs');var fs_extra=require(_0x5231('0xb'));var _=require(_0x5231('0xc'));var squel=require(_0x5231('0xd'));var crypto=require(_0x5231('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5231('0xf'));var toCsv=require(_0x5231('0x9'));var querystring=require('querystring');var Papa=require(_0x5231('0x10'));var Redis=require(_0x5231('0x11'));var authService=require(_0x5231('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5231('0x13'));var logger=require(_0x5231('0x14'))(_0x5231('0x15'));var utils=require(_0x5231('0x16'));var config=require(_0x5231('0x17'));var licenseUtil=require(_0x5231('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d3a84,_0x347c83){_0x347c83=_0x347c83||0xcc;return function(_0x3bd735){if(_0x3bd735){return _0x5d3a84[_0x5231('0x19')](_0x347c83);}return _0x5d3a84[_0x5231('0x1a')](_0x347c83)[_0x5231('0x1b')]();};}function respondWithResult(_0x2bf88b,_0x4ea529){_0x4ea529=_0x4ea529||0xc8;return function(_0x30f763){if(_0x30f763){return _0x2bf88b['status'](_0x4ea529)['json'](_0x30f763);}};}function respondWithFilteredResult(_0x57a1b5,_0xb9ae4b){return function(_0x59f7d8){if(_0x59f7d8){var _0x2596ed=typeof _0xb9ae4b[_0x5231('0x1c')]===_0x5231('0x1d')&&typeof _0xb9ae4b[_0x5231('0x1e')]===_0x5231('0x1d');var _0x3bc1a1=_0x59f7d8['count'];var _0x2f808e=_0x2596ed?0x0:_0xb9ae4b[_0x5231('0x1c')];var _0x1d61ff=_0x2596ed?_0x59f7d8[_0x5231('0x1f')]:_0xb9ae4b[_0x5231('0x1c')]+_0xb9ae4b[_0x5231('0x1e')];var _0x433dc2;if(_0x1d61ff>=_0x3bc1a1){_0x1d61ff=_0x3bc1a1;_0x433dc2=0xc8;}else{_0x433dc2=0xce;}_0x57a1b5['status'](_0x433dc2);return _0x57a1b5[_0x5231('0x20')](_0x5231('0x21'),_0x2f808e+'-'+_0x1d61ff+'/'+_0x3bc1a1)[_0x5231('0x22')](_0x59f7d8);}return null;};}function patchUpdates(_0x205723){return function(_0x336ffe){try{jsonpatch[_0x5231('0x23')](_0x336ffe,_0x205723,!![]);}catch(_0x52f545){return BPromise[_0x5231('0x24')](_0x52f545);}return _0x336ffe[_0x5231('0x25')]();};}function saveUpdates(_0x54167d,_0x4165b8){return function(_0x25f3af){if(_0x25f3af){return _0x25f3af[_0x5231('0x26')](_0x54167d)[_0x5231('0x27')](function(_0x271031){return _0x271031;});}return null;};}function removeEntity(_0x346031,_0x54bff7){return function(_0xd946a0){if(_0xd946a0){return _0xd946a0[_0x5231('0x28')]()[_0x5231('0x27')](function(){_0x346031[_0x5231('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x110e9f,_0x3151b0){return function(_0x150144){if(!_0x150144){_0x110e9f[_0x5231('0x19')](0x194);}return _0x150144;};}function handleError(_0x1dbba5,_0x5d739d){_0x5d739d=_0x5d739d||0x1f4;return function(_0x5199a6){logger['error'](_0x5199a6[_0x5231('0x29')]);if(_0x5199a6[_0x5231('0x2a')]){delete _0x5199a6['name'];}_0x1dbba5[_0x5231('0x1a')](_0x5d739d)[_0x5231('0x2b')](_0x5199a6);};}exports[_0x5231('0x2c')]=function(_0x5a6b00,_0x645513){var _0x1e0107={},_0x96cd44={},_0x137604={'count':0x0,'rows':[]};var _0x245b23=_[_0x5231('0x2d')](db[_0x5231('0x2e')][_0x5231('0x2f')],function(_0x3fef33){return{'name':_0x3fef33[_0x5231('0x30')],'type':_0x3fef33['type']['key']};});_0x96cd44[_0x5231('0x31')]=_[_0x5231('0x2d')](_0x245b23,_0x5231('0x2a'));_0x96cd44['query']=_['keys'](_0x5a6b00[_0x5231('0x32')]);_0x96cd44[_0x5231('0x33')]=_[_0x5231('0x34')](_0x96cd44[_0x5231('0x31')],_0x96cd44[_0x5231('0x32')]);_0x1e0107[_0x5231('0x35')]=_[_0x5231('0x34')](_0x96cd44[_0x5231('0x31')],qs[_0x5231('0x36')](_0x5a6b00[_0x5231('0x32')][_0x5231('0x36')]));_0x1e0107[_0x5231('0x35')]=_0x1e0107[_0x5231('0x35')][_0x5231('0x37')]?_0x1e0107[_0x5231('0x35')]:_0x96cd44['model'];if(!_0x5a6b00['query']['hasOwnProperty'](_0x5231('0x38'))){_0x1e0107[_0x5231('0x1e')]=qs[_0x5231('0x1e')](_0x5a6b00[_0x5231('0x32')][_0x5231('0x1e')]);_0x1e0107[_0x5231('0x1c')]=qs[_0x5231('0x1c')](_0x5a6b00['query'][_0x5231('0x1c')]);}_0x1e0107[_0x5231('0x39')]=qs[_0x5231('0x3a')](_0x5a6b00[_0x5231('0x32')]['sort']);_0x1e0107[_0x5231('0x3b')]=qs[_0x5231('0x33')](_['pick'](_0x5a6b00[_0x5231('0x32')],_0x96cd44[_0x5231('0x33')]),_0x245b23);if(_0x5a6b00[_0x5231('0x32')][_0x5231('0x3c')]){_0x1e0107['where']=_[_0x5231('0x3d')](_0x1e0107[_0x5231('0x3b')],{'$or':_[_0x5231('0x2d')](_0x245b23,function(_0x227d78){if(_0x227d78[_0x5231('0x3e')]!==_0x5231('0x3f')){var _0x5cb845={};_0x5cb845[_0x227d78[_0x5231('0x2a')]]={'$like':'%'+_0x5a6b00[_0x5231('0x32')]['filter']+'%'};return _0x5cb845;}})});}_0x1e0107=_[_0x5231('0x3d')]({},_0x1e0107,_0x5a6b00['options']);var _0x9c001b={'where':_0x1e0107[_0x5231('0x3b')]};return db[_0x5231('0x2e')][_0x5231('0x1f')](_0x9c001b)['then'](function(_0x2245aa){_0x137604['count']=_0x2245aa;if(_0x5a6b00['query'][_0x5231('0x40')]){_0x1e0107['include']=[{'all':!![]}];}return db['Automation'][_0x5231('0x41')](_0x1e0107);})['then'](function(_0x4da311){_0x137604['rows']=_0x4da311;return _0x137604;})[_0x5231('0x27')](respondWithFilteredResult(_0x645513,_0x1e0107))['catch'](handleError(_0x645513,null));};exports[_0x5231('0x42')]=function(_0x1c9309,_0x39a275){var _0x1190f6={'raw':![],'where':{'id':_0x1c9309[_0x5231('0x43')]['id']}},_0x390660={};_0x390660['model']=_[_0x5231('0x44')](db[_0x5231('0x2e')][_0x5231('0x2f')]);_0x390660[_0x5231('0x32')]=_[_0x5231('0x44')](_0x1c9309['query']);_0x390660['filters']=_[_0x5231('0x34')](_0x390660[_0x5231('0x31')],_0x390660[_0x5231('0x32')]);_0x1190f6[_0x5231('0x35')]=_['intersection'](_0x390660[_0x5231('0x31')],qs[_0x5231('0x36')](_0x1c9309[_0x5231('0x32')][_0x5231('0x36')]));_0x1190f6['attributes']=_0x1190f6[_0x5231('0x35')][_0x5231('0x37')]?_0x1190f6[_0x5231('0x35')]:_0x390660[_0x5231('0x31')];if(_0x1c9309[_0x5231('0x32')]['includeAll']){_0x1190f6['include']=[{'all':!![]}];}_0x1190f6=_[_0x5231('0x3d')]({},_0x1190f6,_0x1c9309[_0x5231('0x45')]);return db['Automation'][_0x5231('0x46')](_0x1190f6)[_0x5231('0x27')](handleEntityNotFound(_0x39a275,null))[_0x5231('0x27')](respondWithResult(_0x39a275,null))['catch'](handleError(_0x39a275,null));};exports[_0x5231('0x47')]=function(_0x1c45b7,_0x4e1a3b){return db[_0x5231('0x2e')][_0x5231('0x47')](_0x1c45b7[_0x5231('0x48')],{})[_0x5231('0x27')](respondWithResult(_0x4e1a3b,0xc9))[_0x5231('0x49')](handleError(_0x4e1a3b,null));};exports['update']=function(_0x148335,_0xbff6f1){if(_0x148335[_0x5231('0x48')]['id']){delete _0x148335[_0x5231('0x48')]['id'];}return db[_0x5231('0x2e')][_0x5231('0x46')]({'where':{'id':_0x148335[_0x5231('0x43')]['id']}})[_0x5231('0x27')](handleEntityNotFound(_0xbff6f1,null))[_0x5231('0x27')](saveUpdates(_0x148335[_0x5231('0x48')],null))['then'](respondWithResult(_0xbff6f1,null))[_0x5231('0x49')](handleError(_0xbff6f1,null));};exports[_0x5231('0x28')]=function(_0x3d0979,_0x12922a){return db['Automation'][_0x5231('0x46')]({'where':{'id':_0x3d0979['params']['id']}})[_0x5231('0x27')](handleEntityNotFound(_0x12922a,null))['then'](removeEntity(_0x12922a,null))['catch'](handleError(_0x12922a,null));};exports[_0x5231('0x4a')]=function(_0x2e54e7,_0x1a8be2,_0x38b5fa){return db[_0x5231('0x4b')]['find']({'where':{'id':_0x2e54e7[_0x5231('0x43')]['id']}})['then'](handleEntityNotFound(_0x1a8be2,null))['then'](function(_0x237758){if(_0x237758){return _0x237758[_0x5231('0x4a')](_0x2e54e7[_0x5231('0x48')][_0x5231('0x4c')],_[_0x5231('0x4d')](_0x2e54e7[_0x5231('0x48')],[_0x5231('0x4c'),'id'])||{});}})[_0x5231('0x27')](respondWithResult(_0x1a8be2,null))['catch'](handleError(_0x1a8be2,null));};exports[_0x5231('0x4e')]=function(_0x16f820,_0xeef87a,_0x4f1fe1){var _0x3badbf={};var _0x407d20={};var _0x429d8c;var _0x90ffc7;return db['Automation'][_0x5231('0x4f')]({'where':{'id':_0x16f820[_0x5231('0x43')]['id']}})[_0x5231('0x27')](handleEntityNotFound(_0xeef87a,null))[_0x5231('0x27')](function(_0x138311){if(_0x138311){_0x429d8c=_0x138311;_0x407d20[_0x5231('0x31')]=_['keys'](db[_0x5231('0x4b')][_0x5231('0x2f')]);_0x407d20[_0x5231('0x32')]=_[_0x5231('0x44')](_0x16f820['query']);_0x407d20[_0x5231('0x33')]=_[_0x5231('0x34')](_0x407d20[_0x5231('0x31')],_0x407d20[_0x5231('0x32')]);_0x3badbf[_0x5231('0x35')]=_[_0x5231('0x34')](_0x407d20[_0x5231('0x31')],qs[_0x5231('0x36')](_0x16f820['query']['fields']));_0x3badbf[_0x5231('0x35')]=_0x3badbf['attributes'][_0x5231('0x37')]?_0x3badbf[_0x5231('0x35')]:_0x407d20[_0x5231('0x31')];_0x3badbf[_0x5231('0x39')]=qs[_0x5231('0x3a')](_0x16f820[_0x5231('0x32')]['sort']);_0x3badbf['where']=qs[_0x5231('0x33')](_[_0x5231('0x50')](_0x16f820[_0x5231('0x32')],_0x407d20[_0x5231('0x33')]));if(_0x16f820[_0x5231('0x32')][_0x5231('0x3c')]){_0x3badbf[_0x5231('0x3b')]=_[_0x5231('0x3d')](_0x3badbf[_0x5231('0x3b')],{'$or':_[_0x5231('0x2d')](_0x3badbf['attributes'],function(_0x5493d6){var _0x1f97e0={};_0x1f97e0[_0x5493d6]={'$like':'%'+_0x16f820['query'][_0x5231('0x3c')]+'%'};return _0x1f97e0;})});}_0x3badbf=_[_0x5231('0x3d')]({},_0x3badbf,_0x16f820[_0x5231('0x45')]);return _0x429d8c[_0x5231('0x4e')](_0x3badbf);}})[_0x5231('0x27')](function(_0x3e4aac){if(_0x3e4aac){_0x90ffc7=_0x3e4aac[_0x5231('0x37')];if(!_0x16f820[_0x5231('0x32')]['hasOwnProperty'](_0x5231('0x38'))){_0x3badbf['limit']=qs['limit'](_0x16f820[_0x5231('0x32')][_0x5231('0x1e')]);_0x3badbf['offset']=qs[_0x5231('0x1c')](_0x16f820[_0x5231('0x32')][_0x5231('0x1c')]);}return _0x429d8c['getConditions'](_0x3badbf);}})[_0x5231('0x27')](function(_0xfed704){if(_0xfed704){return _0xfed704?{'count':_0x90ffc7,'rows':_0xfed704}:null;}})[_0x5231('0x27')](respondWithResult(_0xeef87a,null))['catch'](handleError(_0xeef87a,null));};exports[_0x5231('0x51')]=function(_0x2e3712,_0x74aebb,_0x26275c){return db[_0x5231('0x52')][_0x5231('0x46')]({'where':{'id':_0x2e3712[_0x5231('0x43')]['id']}})[_0x5231('0x27')](handleEntityNotFound(_0x74aebb,null))[_0x5231('0x27')](function(_0x4c6a25){if(_0x4c6a25){return _0x4c6a25[_0x5231('0x51')](_0x2e3712[_0x5231('0x48')][_0x5231('0x4c')],_[_0x5231('0x4d')](_0x2e3712[_0x5231('0x48')],[_0x5231('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x74aebb,null))['catch'](handleError(_0x74aebb,null));};exports[_0x5231('0x53')]=function(_0x5cfebc,_0x2c37cd,_0x2b7a61){var _0x4f6e80={};var _0x212150={};var _0x5642d2;var _0x2ab520;return db[_0x5231('0x2e')]['findOne']({'where':{'id':_0x5cfebc[_0x5231('0x43')]['id']}})['then'](handleEntityNotFound(_0x2c37cd,null))[_0x5231('0x27')](function(_0x12397d){if(_0x12397d){_0x5642d2=_0x12397d;_0x212150[_0x5231('0x31')]=_[_0x5231('0x44')](db[_0x5231('0x52')]['rawAttributes']);_0x212150[_0x5231('0x32')]=_[_0x5231('0x44')](_0x5cfebc[_0x5231('0x32')]);_0x212150[_0x5231('0x33')]=_[_0x5231('0x34')](_0x212150[_0x5231('0x31')],_0x212150[_0x5231('0x32')]);_0x4f6e80[_0x5231('0x35')]=_[_0x5231('0x34')](_0x212150[_0x5231('0x31')],qs[_0x5231('0x36')](_0x5cfebc[_0x5231('0x32')]['fields']));_0x4f6e80[_0x5231('0x35')]=_0x4f6e80[_0x5231('0x35')][_0x5231('0x37')]?_0x4f6e80['attributes']:_0x212150[_0x5231('0x31')];_0x4f6e80[_0x5231('0x39')]=qs[_0x5231('0x3a')](_0x5cfebc[_0x5231('0x32')][_0x5231('0x3a')]);_0x4f6e80[_0x5231('0x3b')]=qs[_0x5231('0x33')](_[_0x5231('0x50')](_0x5cfebc[_0x5231('0x32')],_0x212150[_0x5231('0x33')]));if(_0x5cfebc['query'][_0x5231('0x3c')]){_0x4f6e80[_0x5231('0x3b')]=_['merge'](_0x4f6e80['where'],{'$or':_[_0x5231('0x2d')](_0x4f6e80[_0x5231('0x35')],function(_0x1a2473){var _0x56e39b={};_0x56e39b[_0x1a2473]={'$like':'%'+_0x5cfebc['query'][_0x5231('0x3c')]+'%'};return _0x56e39b;})});}_0x4f6e80=_[_0x5231('0x3d')]({},_0x4f6e80,_0x5cfebc['options']);return _0x5642d2['getActions'](_0x4f6e80);}})[_0x5231('0x27')](function(_0x2b7cac){if(_0x2b7cac){_0x2ab520=_0x2b7cac[_0x5231('0x37')];if(!_0x5cfebc['query'][_0x5231('0x54')]('nolimit')){_0x4f6e80[_0x5231('0x1e')]=qs[_0x5231('0x1e')](_0x5cfebc['query'][_0x5231('0x1e')]);_0x4f6e80['offset']=qs[_0x5231('0x1c')](_0x5cfebc['query'][_0x5231('0x1c')]);}return _0x5642d2[_0x5231('0x53')](_0x4f6e80);}})['then'](function(_0x537d57){if(_0x537d57){return _0x537d57?{'count':_0x2ab520,'rows':_0x537d57}:null;}})[_0x5231('0x27')](respondWithResult(_0x2c37cd,null))[_0x5231('0x49')](handleError(_0x2c37cd,null));};
\ No newline at end of file
+var _0x99ea=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','limit','undefined','count','offset','status','set','json','apply','reject','then','destroy','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','params','options','find','create','body','update','addConditions','Condition','omit','getConditions','findOne','order','nolimit','addActions','ids','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse'];(function(_0x258240,_0x70c624){var _0x31cefd=function(_0x163dac){while(--_0x163dac){_0x258240['push'](_0x258240['shift']());}};_0x31cefd(++_0x70c624);}(_0x99ea,0xe5));var _0xa99e=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x99ea[_0x266618];return _0x54dbf5;};'use strict';var emlformat=require(_0xa99e('0x0'));var rimraf=require(_0xa99e('0x1'));var zipdir=require(_0xa99e('0x2'));var jsonpatch=require(_0xa99e('0x3'));var rp=require(_0xa99e('0x4'));var moment=require(_0xa99e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa99e('0x6'));var util=require(_0xa99e('0x7'));var path=require(_0xa99e('0x8'));var sox=require(_0xa99e('0x9'));var csv=require(_0xa99e('0xa'));var ejs=require(_0xa99e('0xb'));var fs=require('fs');var fs_extra=require(_0xa99e('0xc'));var _=require(_0xa99e('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa99e('0xe'));var toCsv=require(_0xa99e('0xa'));var querystring=require(_0xa99e('0xf'));var Papa=require(_0xa99e('0x10'));var Redis=require(_0xa99e('0x11'));var authService=require(_0xa99e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa99e('0x13'));var hardwareService=require(_0xa99e('0x14'));var logger=require(_0xa99e('0x15'))(_0xa99e('0x16'));var utils=require(_0xa99e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa99e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b3453,_0x17ab69){_0x17ab69=_0x17ab69||0xcc;return function(_0x5733bf){if(_0x5733bf){return _0x2b3453[_0xa99e('0x19')](_0x17ab69);}return _0x2b3453['status'](_0x17ab69)['end']();};}function respondWithResult(_0x3e54d4,_0xd0771){_0xd0771=_0xd0771||0xc8;return function(_0x6c142e){if(_0x6c142e){return _0x3e54d4['status'](_0xd0771)['json'](_0x6c142e);}};}function respondWithFilteredResult(_0x45d7ad,_0x561de2){return function(_0x121852){if(_0x121852){var _0x1c461b=typeof _0x561de2['offset']==='undefined'&&typeof _0x561de2[_0xa99e('0x1a')]===_0xa99e('0x1b');var _0x15d572=_0x121852[_0xa99e('0x1c')];var _0x1bd427=_0x1c461b?0x0:_0x561de2[_0xa99e('0x1d')];var _0x2cd5ab=_0x1c461b?_0x121852[_0xa99e('0x1c')]:_0x561de2[_0xa99e('0x1d')]+_0x561de2[_0xa99e('0x1a')];var _0x54c8b0;if(_0x2cd5ab>=_0x15d572){_0x2cd5ab=_0x15d572;_0x54c8b0=0xc8;}else{_0x54c8b0=0xce;}_0x45d7ad[_0xa99e('0x1e')](_0x54c8b0);return _0x45d7ad[_0xa99e('0x1f')]('Content-Range',_0x1bd427+'-'+_0x2cd5ab+'/'+_0x15d572)[_0xa99e('0x20')](_0x121852);}return null;};}function patchUpdates(_0x5b36e0){return function(_0x2281a7){try{jsonpatch[_0xa99e('0x21')](_0x2281a7,_0x5b36e0,!![]);}catch(_0xb4cb0c){return BPromise[_0xa99e('0x22')](_0xb4cb0c);}return _0x2281a7['save']();};}function saveUpdates(_0x342d56,_0x2a382f){return function(_0xa7ed16){if(_0xa7ed16){return _0xa7ed16['update'](_0x342d56)[_0xa99e('0x23')](function(_0x262312){return _0x262312;});}return null;};}function removeEntity(_0x1f5ee8,_0x40896e){return function(_0x52d010){if(_0x52d010){return _0x52d010[_0xa99e('0x24')]()[_0xa99e('0x23')](function(){_0x1f5ee8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a06b4,_0x4922e4){return function(_0x2cc548){if(!_0x2cc548){_0x1a06b4[_0xa99e('0x19')](0x194);}return _0x2cc548;};}function handleError(_0x2b273f,_0x3ab4e1){_0x3ab4e1=_0x3ab4e1||0x1f4;return function(_0x23ebe6){logger[_0xa99e('0x25')](_0x23ebe6[_0xa99e('0x26')]);if(_0x23ebe6[_0xa99e('0x27')]){delete _0x23ebe6[_0xa99e('0x27')];}_0x2b273f[_0xa99e('0x1e')](_0x3ab4e1)['send'](_0x23ebe6);};}exports[_0xa99e('0x28')]=function(_0x3d31a7,_0x168bbf){var _0xdcfe91={},_0x216a15={},_0x4c62b5={'count':0x0,'rows':[]};var _0x23e779=_[_0xa99e('0x29')](db[_0xa99e('0x2a')][_0xa99e('0x2b')],function(_0x200722){return{'name':_0x200722[_0xa99e('0x2c')],'type':_0x200722[_0xa99e('0x2d')][_0xa99e('0x2e')]};});_0x216a15['model']=_[_0xa99e('0x29')](_0x23e779,_0xa99e('0x27'));_0x216a15['query']=_[_0xa99e('0x2f')](_0x3d31a7[_0xa99e('0x30')]);_0x216a15[_0xa99e('0x31')]=_[_0xa99e('0x32')](_0x216a15[_0xa99e('0x33')],_0x216a15[_0xa99e('0x30')]);_0xdcfe91[_0xa99e('0x34')]=_['intersection'](_0x216a15[_0xa99e('0x33')],qs[_0xa99e('0x35')](_0x3d31a7['query'][_0xa99e('0x35')]));_0xdcfe91['attributes']=_0xdcfe91['attributes'][_0xa99e('0x36')]?_0xdcfe91[_0xa99e('0x34')]:_0x216a15[_0xa99e('0x33')];if(!_0x3d31a7['query'][_0xa99e('0x37')]('nolimit')){_0xdcfe91['limit']=qs[_0xa99e('0x1a')](_0x3d31a7[_0xa99e('0x30')][_0xa99e('0x1a')]);_0xdcfe91[_0xa99e('0x1d')]=qs[_0xa99e('0x1d')](_0x3d31a7[_0xa99e('0x30')][_0xa99e('0x1d')]);}_0xdcfe91['order']=qs[_0xa99e('0x38')](_0x3d31a7[_0xa99e('0x30')][_0xa99e('0x38')]);_0xdcfe91[_0xa99e('0x39')]=qs[_0xa99e('0x31')](_[_0xa99e('0x3a')](_0x3d31a7[_0xa99e('0x30')],_0x216a15[_0xa99e('0x31')]),_0x23e779);if(_0x3d31a7['query'][_0xa99e('0x3b')]){_0xdcfe91[_0xa99e('0x39')]=_[_0xa99e('0x3c')](_0xdcfe91['where'],{'$or':_[_0xa99e('0x29')](_0x23e779,function(_0x23c92a){if(_0x23c92a[_0xa99e('0x2d')]!==_0xa99e('0x3d')){var _0x2a71ff={};_0x2a71ff[_0x23c92a['name']]={'$like':'%'+_0x3d31a7[_0xa99e('0x30')][_0xa99e('0x3b')]+'%'};return _0x2a71ff;}})});}_0xdcfe91=_[_0xa99e('0x3c')]({},_0xdcfe91,_0x3d31a7['options']);var _0x33012c={'where':_0xdcfe91['where']};return db['Automation']['count'](_0x33012c)['then'](function(_0x35b9fc){_0x4c62b5[_0xa99e('0x1c')]=_0x35b9fc;if(_0x3d31a7['query'][_0xa99e('0x3e')]){_0xdcfe91['include']=[{'all':!![]}];}return db[_0xa99e('0x2a')][_0xa99e('0x3f')](_0xdcfe91);})[_0xa99e('0x23')](function(_0x1bc317){_0x4c62b5['rows']=_0x1bc317;return _0x4c62b5;})['then'](respondWithFilteredResult(_0x168bbf,_0xdcfe91))[_0xa99e('0x40')](handleError(_0x168bbf,null));};exports['show']=function(_0x44d0d1,_0x5cea38){var _0x38d29b={'raw':![],'where':{'id':_0x44d0d1[_0xa99e('0x41')]['id']}},_0x5a9d89={};_0x5a9d89[_0xa99e('0x33')]=_[_0xa99e('0x2f')](db[_0xa99e('0x2a')][_0xa99e('0x2b')]);_0x5a9d89['query']=_['keys'](_0x44d0d1['query']);_0x5a9d89[_0xa99e('0x31')]=_[_0xa99e('0x32')](_0x5a9d89['model'],_0x5a9d89['query']);_0x38d29b['attributes']=_['intersection'](_0x5a9d89[_0xa99e('0x33')],qs[_0xa99e('0x35')](_0x44d0d1[_0xa99e('0x30')][_0xa99e('0x35')]));_0x38d29b['attributes']=_0x38d29b[_0xa99e('0x34')][_0xa99e('0x36')]?_0x38d29b[_0xa99e('0x34')]:_0x5a9d89[_0xa99e('0x33')];if(_0x44d0d1['query']['includeAll']){_0x38d29b['include']=[{'all':!![]}];}_0x38d29b=_[_0xa99e('0x3c')]({},_0x38d29b,_0x44d0d1[_0xa99e('0x42')]);return db[_0xa99e('0x2a')][_0xa99e('0x43')](_0x38d29b)[_0xa99e('0x23')](handleEntityNotFound(_0x5cea38,null))[_0xa99e('0x23')](respondWithResult(_0x5cea38,null))[_0xa99e('0x40')](handleError(_0x5cea38,null));};exports[_0xa99e('0x44')]=function(_0x5a0199,_0xd6993){return db[_0xa99e('0x2a')][_0xa99e('0x44')](_0x5a0199[_0xa99e('0x45')],{})['then'](respondWithResult(_0xd6993,0xc9))[_0xa99e('0x40')](handleError(_0xd6993,null));};exports[_0xa99e('0x46')]=function(_0x2a04df,_0x52f7ff){if(_0x2a04df['body']['id']){delete _0x2a04df[_0xa99e('0x45')]['id'];}return db[_0xa99e('0x2a')]['find']({'where':{'id':_0x2a04df['params']['id']}})[_0xa99e('0x23')](handleEntityNotFound(_0x52f7ff,null))[_0xa99e('0x23')](saveUpdates(_0x2a04df[_0xa99e('0x45')],null))[_0xa99e('0x23')](respondWithResult(_0x52f7ff,null))[_0xa99e('0x40')](handleError(_0x52f7ff,null));};exports[_0xa99e('0x24')]=function(_0x2b93ff,_0x45e207){return db['Automation'][_0xa99e('0x43')]({'where':{'id':_0x2b93ff[_0xa99e('0x41')]['id']}})['then'](handleEntityNotFound(_0x45e207,null))[_0xa99e('0x23')](removeEntity(_0x45e207,null))[_0xa99e('0x40')](handleError(_0x45e207,null));};exports[_0xa99e('0x47')]=function(_0x34dd91,_0x12baf8,_0x45a8af){return db[_0xa99e('0x48')][_0xa99e('0x43')]({'where':{'id':_0x34dd91[_0xa99e('0x41')]['id']}})[_0xa99e('0x23')](handleEntityNotFound(_0x12baf8,null))['then'](function(_0x2a6339){if(_0x2a6339){return _0x2a6339['addConditions'](_0x34dd91[_0xa99e('0x45')]['ids'],_[_0xa99e('0x49')](_0x34dd91[_0xa99e('0x45')],['ids','id'])||{});}})[_0xa99e('0x23')](respondWithResult(_0x12baf8,null))['catch'](handleError(_0x12baf8,null));};exports[_0xa99e('0x4a')]=function(_0x10c7b4,_0x27624f,_0x458f48){var _0xfb7b32={};var _0x27abd1={};var _0x4d92a0;var _0x1345d8;return db[_0xa99e('0x2a')][_0xa99e('0x4b')]({'where':{'id':_0x10c7b4[_0xa99e('0x41')]['id']}})[_0xa99e('0x23')](handleEntityNotFound(_0x27624f,null))[_0xa99e('0x23')](function(_0x4c8716){if(_0x4c8716){_0x4d92a0=_0x4c8716;_0x27abd1['model']=_['keys'](db['Condition'][_0xa99e('0x2b')]);_0x27abd1[_0xa99e('0x30')]=_['keys'](_0x10c7b4[_0xa99e('0x30')]);_0x27abd1[_0xa99e('0x31')]=_[_0xa99e('0x32')](_0x27abd1[_0xa99e('0x33')],_0x27abd1[_0xa99e('0x30')]);_0xfb7b32[_0xa99e('0x34')]=_[_0xa99e('0x32')](_0x27abd1[_0xa99e('0x33')],qs[_0xa99e('0x35')](_0x10c7b4[_0xa99e('0x30')][_0xa99e('0x35')]));_0xfb7b32[_0xa99e('0x34')]=_0xfb7b32[_0xa99e('0x34')]['length']?_0xfb7b32[_0xa99e('0x34')]:_0x27abd1[_0xa99e('0x33')];_0xfb7b32[_0xa99e('0x4c')]=qs[_0xa99e('0x38')](_0x10c7b4[_0xa99e('0x30')][_0xa99e('0x38')]);_0xfb7b32[_0xa99e('0x39')]=qs['filters'](_['pick'](_0x10c7b4[_0xa99e('0x30')],_0x27abd1['filters']));if(_0x10c7b4['query'][_0xa99e('0x3b')]){_0xfb7b32[_0xa99e('0x39')]=_[_0xa99e('0x3c')](_0xfb7b32['where'],{'$or':_[_0xa99e('0x29')](_0xfb7b32[_0xa99e('0x34')],function(_0x2518d6){var _0x50a212={};_0x50a212[_0x2518d6]={'$like':'%'+_0x10c7b4[_0xa99e('0x30')][_0xa99e('0x3b')]+'%'};return _0x50a212;})});}_0xfb7b32=_[_0xa99e('0x3c')]({},_0xfb7b32,_0x10c7b4[_0xa99e('0x42')]);return _0x4d92a0[_0xa99e('0x4a')](_0xfb7b32);}})[_0xa99e('0x23')](function(_0x1d5dd5){if(_0x1d5dd5){_0x1345d8=_0x1d5dd5[_0xa99e('0x36')];if(!_0x10c7b4[_0xa99e('0x30')][_0xa99e('0x37')](_0xa99e('0x4d'))){_0xfb7b32['limit']=qs['limit'](_0x10c7b4[_0xa99e('0x30')][_0xa99e('0x1a')]);_0xfb7b32['offset']=qs['offset'](_0x10c7b4[_0xa99e('0x30')][_0xa99e('0x1d')]);}return _0x4d92a0[_0xa99e('0x4a')](_0xfb7b32);}})[_0xa99e('0x23')](function(_0x19016a){if(_0x19016a){return _0x19016a?{'count':_0x1345d8,'rows':_0x19016a}:null;}})[_0xa99e('0x23')](respondWithResult(_0x27624f,null))[_0xa99e('0x40')](handleError(_0x27624f,null));};exports[_0xa99e('0x4e')]=function(_0x3c1140,_0x3c65b3,_0x2c209d){return db['Action']['find']({'where':{'id':_0x3c1140['params']['id']}})[_0xa99e('0x23')](handleEntityNotFound(_0x3c65b3,null))['then'](function(_0x487dd3){if(_0x487dd3){return _0x487dd3[_0xa99e('0x4e')](_0x3c1140[_0xa99e('0x45')]['ids'],_[_0xa99e('0x49')](_0x3c1140[_0xa99e('0x45')],[_0xa99e('0x4f'),'id'])||{});}})[_0xa99e('0x23')](respondWithResult(_0x3c65b3,null))[_0xa99e('0x40')](handleError(_0x3c65b3,null));};exports[_0xa99e('0x50')]=function(_0x4b44cd,_0x1d4218,_0x57056f){var _0x56cd0d={};var _0x10525f={};var _0x3aef37;var _0x37a334;return db[_0xa99e('0x2a')][_0xa99e('0x4b')]({'where':{'id':_0x4b44cd['params']['id']}})['then'](handleEntityNotFound(_0x1d4218,null))[_0xa99e('0x23')](function(_0x2f5cad){if(_0x2f5cad){_0x3aef37=_0x2f5cad;_0x10525f[_0xa99e('0x33')]=_[_0xa99e('0x2f')](db[_0xa99e('0x51')]['rawAttributes']);_0x10525f[_0xa99e('0x30')]=_[_0xa99e('0x2f')](_0x4b44cd[_0xa99e('0x30')]);_0x10525f[_0xa99e('0x31')]=_[_0xa99e('0x32')](_0x10525f[_0xa99e('0x33')],_0x10525f[_0xa99e('0x30')]);_0x56cd0d[_0xa99e('0x34')]=_[_0xa99e('0x32')](_0x10525f['model'],qs[_0xa99e('0x35')](_0x4b44cd[_0xa99e('0x30')][_0xa99e('0x35')]));_0x56cd0d[_0xa99e('0x34')]=_0x56cd0d[_0xa99e('0x34')]['length']?_0x56cd0d[_0xa99e('0x34')]:_0x10525f[_0xa99e('0x33')];_0x56cd0d[_0xa99e('0x4c')]=qs[_0xa99e('0x38')](_0x4b44cd[_0xa99e('0x30')][_0xa99e('0x38')]);_0x56cd0d[_0xa99e('0x39')]=qs[_0xa99e('0x31')](_[_0xa99e('0x3a')](_0x4b44cd[_0xa99e('0x30')],_0x10525f[_0xa99e('0x31')]));if(_0x4b44cd['query'][_0xa99e('0x3b')]){_0x56cd0d[_0xa99e('0x39')]=_['merge'](_0x56cd0d[_0xa99e('0x39')],{'$or':_[_0xa99e('0x29')](_0x56cd0d[_0xa99e('0x34')],function(_0x42989e){var _0x3645fc={};_0x3645fc[_0x42989e]={'$like':'%'+_0x4b44cd[_0xa99e('0x30')][_0xa99e('0x3b')]+'%'};return _0x3645fc;})});}_0x56cd0d=_[_0xa99e('0x3c')]({},_0x56cd0d,_0x4b44cd[_0xa99e('0x42')]);return _0x3aef37['getActions'](_0x56cd0d);}})['then'](function(_0x16aa40){if(_0x16aa40){_0x37a334=_0x16aa40[_0xa99e('0x36')];if(!_0x4b44cd[_0xa99e('0x30')][_0xa99e('0x37')](_0xa99e('0x4d'))){_0x56cd0d[_0xa99e('0x1a')]=qs[_0xa99e('0x1a')](_0x4b44cd[_0xa99e('0x30')]['limit']);_0x56cd0d[_0xa99e('0x1d')]=qs[_0xa99e('0x1d')](_0x4b44cd[_0xa99e('0x30')][_0xa99e('0x1d')]);}return _0x3aef37[_0xa99e('0x50')](_0x56cd0d);}})['then'](function(_0x2c60ec){if(_0x2c60ec){return _0x2c60ec?{'count':_0x37a334,'rows':_0x2c60ec}:null;}})[_0xa99e('0x23')](respondWithResult(_0x1d4218,null))[_0xa99e('0x40')](handleError(_0x1d4218,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 4a00df1..9dc985f 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 _0xbfae=['path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1073ad,_0x44bf0b){var _0x528474=function(_0x3450f7){while(--_0x3450f7){_0x1073ad['push'](_0x1073ad['shift']());}};_0x528474(++_0x44bf0b);}(_0xbfae,0x1b4));var _0xebfa=function(_0xdf4182,_0xd869ff){_0xdf4182=_0xdf4182-0x0;var _0x1d10c7=_0xbfae[_0xdf4182];return _0x1d10c7;};'use strict';var _=require(_0xebfa('0x0'));var util=require(_0xebfa('0x1'));var logger=require(_0xebfa('0x2'))(_0xebfa('0x3'));var moment=require(_0xebfa('0x4'));var BPromise=require('bluebird');var rp=require(_0xebfa('0x5'));var fs=require('fs');var path=require(_0xebfa('0x6'));var rimraf=require(_0xebfa('0x7'));var config=require('../../config/environment');var attributes=require(_0xebfa('0x8'));module[_0xebfa('0x9')]=function(_0x5f15c0,_0x2577d4){return _0x5f15c0[_0xebfa('0xa')](_0xebfa('0xb'),attributes,{'tableName':_0xebfa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb5d5=['rimraf','./automation.attributes','exports','define','tools_automations','util','api','moment','bluebird','request-promise','path'];(function(_0xdd0303,_0x2ea293){var _0x3fe337=function(_0x20e271){while(--_0x20e271){_0xdd0303['push'](_0xdd0303['shift']());}};_0x3fe337(++_0x2ea293);}(_0xb5d5,0x12e));var _0x5b5d=function(_0x1844c8,_0x2078b8){_0x1844c8=_0x1844c8-0x0;var _0x3628bd=_0xb5d5[_0x1844c8];return _0x3628bd;};'use strict';var _=require('lodash');var util=require(_0x5b5d('0x0'));var logger=require('../../config/logger')(_0x5b5d('0x1'));var moment=require(_0x5b5d('0x2'));var BPromise=require(_0x5b5d('0x3'));var rp=require(_0x5b5d('0x4'));var fs=require('fs');var path=require(_0x5b5d('0x5'));var rimraf=require(_0x5b5d('0x6'));var config=require('../../config/environment');var attributes=require(_0x5b5d('0x7'));module[_0x5b5d('0x8')]=function(_0x4119fb,_0x299802){return _0x4119fb[_0x5b5d('0x9')]('Automation',attributes,{'tableName':_0x5b5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 9f9d123..fcb0e6a 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 _0xb2af=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb2af,0xd2));var _0xfb2a=function(_0x26b69c,_0x94157c){_0x26b69c=_0x26b69c-0x0;var _0x27bbda=_0xb2af[_0x26b69c];return _0x27bbda;};'use strict';var _=require(_0xfb2a('0x0'));var util=require(_0xfb2a('0x1'));var moment=require(_0xfb2a('0x2'));var BPromise=require(_0xfb2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb2a('0x4'));var db=require(_0xfb2a('0x5'))['db'];var utils=require(_0xfb2a('0x6'));var logger=require(_0xfb2a('0x7'))(_0xfb2a('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb2a('0x9'));var client=jayson[_0xfb2a('0xa')][_0xfb2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55cf25,_0x715404,_0x3e20de){return new BPromise(function(_0x1f3315,_0x55bb4e){return client[_0xfb2a('0xc')](_0x55cf25,_0x3e20de)[_0xfb2a('0xd')](function(_0x3d3333){logger[_0xfb2a('0xe')](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));logger[_0xfb2a('0x11')](_0xfb2a('0x12'),_0x715404,_0xfb2a('0x10'),JSON[_0xfb2a('0x13')](_0x3d3333));if(_0x3d3333[_0xfb2a('0x14')]){if(_0x3d3333[_0xfb2a('0x14')]['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x715404,_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);return _0x55bb4e(_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);}logger['error'](_0xfb2a('0xf'),_0x715404,_0x3d3333['error']['message']);return _0x1f3315(_0x3d3333[_0xfb2a('0x14')]['message']);}else{logger['info'](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));_0x1f3315(_0x3d3333[_0xfb2a('0x16')][_0xfb2a('0x15')]);}})[_0xfb2a('0x17')](function(_0xc85abf){logger[_0xfb2a('0x14')](_0xfb2a('0xf'),_0x715404,_0xc85abf);_0x55bb4e(_0xc85abf);});});}
\ No newline at end of file
+var _0x594d=['Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Automation,\x20%s,\x20%s','debug'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x594d,0x92));var _0xd594=function(_0x277757,_0x7a3eb6){_0x277757=_0x277757-0x0;var _0x4cdeac=_0x594d[_0x277757];return _0x4cdeac;};'use strict';var _=require(_0xd594('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd594('0x1'));var rs=require(_0xd594('0x2'));var fs=require('fs');var Redis=require(_0xd594('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd594('0x4'));var logger=require(_0xd594('0x5'))(_0xd594('0x6'));var config=require(_0xd594('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd594('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b1c64,_0x446711,_0xeedad0){return new BPromise(function(_0x20325a,_0x20718a){return client[_0xd594('0x9')](_0x3b1c64,_0xeedad0)[_0xd594('0xa')](function(_0xf3043e){logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');logger[_0xd594('0xd')](_0xd594('0xe'),_0x446711,_0xd594('0xf'),JSON['stringify'](_0xf3043e));if(_0xf3043e[_0xd594('0x10')]){if(_0xf3043e[_0xd594('0x10')][_0xd594('0x11')]===0x1f4){logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e[_0xd594('0x10')][_0xd594('0x12')]);return _0x20718a(_0xf3043e['error']['message']);}logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e['error'][_0xd594('0x12')]);return _0x20325a(_0xf3043e['error'][_0xd594('0x12')]);}else{logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');_0x20325a(_0xf3043e[_0xd594('0x13')]['message']);}})['catch'](function(_0x2a5f17){logger[_0xd594('0x10')]('Automation,\x20%s,\x20%s',_0x446711,_0x2a5f17);_0x20718a(_0x2a5f17);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 946713f..c13e797 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 _0x9860=['show','/:id/conditions','getConditions','getActions','post','create','/:id/actions','addActions','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x579c34,_0x743122){var _0x28a925=function(_0x537efe){while(--_0x537efe){_0x579c34['push'](_0x579c34['shift']());}};_0x28a925(++_0x743122);}(_0x9860,0x15f));var _0x0986=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9860[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x0986('0x0'));var path=require(_0x0986('0x1'));var timeout=require(_0x0986('0x2'));var express=require(_0x0986('0x3'));var router=express[_0x0986('0x4')]();var fs_extra=require(_0x0986('0x5'));var auth=require(_0x0986('0x6'));var interaction=require(_0x0986('0x7'));var config=require(_0x0986('0x8'));var controller=require('./automation.controller');router[_0x0986('0x9')]('/',auth[_0x0986('0xa')](),controller[_0x0986('0xb')]);router['get'](_0x0986('0xc'),auth[_0x0986('0xa')](),controller[_0x0986('0xd')]);router[_0x0986('0x9')](_0x0986('0xe'),auth['isAuthenticated'](),controller[_0x0986('0xf')]);router[_0x0986('0x9')]('/:id/actions',auth[_0x0986('0xa')](),controller[_0x0986('0x10')]);router[_0x0986('0x11')]('/',auth[_0x0986('0xa')](),controller[_0x0986('0x12')]);router['post'](_0x0986('0xe'),auth[_0x0986('0xa')](),controller['addConditions']);router['post'](_0x0986('0x13'),auth[_0x0986('0xa')](),controller[_0x0986('0x14')]);router[_0x0986('0x15')](_0x0986('0xc'),auth['isAuthenticated'](),controller[_0x0986('0x16')]);router[_0x0986('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x0986('0x18')]);module[_0x0986('0x19')]=router;
\ No newline at end of file
+var _0x567c=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','update','delete','destroy'];(function(_0x1ee3d1,_0x417375){var _0xef85fb=function(_0x3d8e65){while(--_0x3d8e65){_0x1ee3d1['push'](_0x1ee3d1['shift']());}};_0xef85fb(++_0x417375);}(_0x567c,0x8d));var _0xc567=function(_0x497c50,_0x46afa1){_0x497c50=_0x497c50-0x0;var _0x302a37=_0x567c[_0x497c50];return _0x302a37;};'use strict';var multer=require(_0xc567('0x0'));var util=require(_0xc567('0x1'));var path=require(_0xc567('0x2'));var timeout=require(_0xc567('0x3'));var express=require(_0xc567('0x4'));var router=express[_0xc567('0x5')]();var fs_extra=require(_0xc567('0x6'));var auth=require(_0xc567('0x7'));var interaction=require(_0xc567('0x8'));var config=require(_0xc567('0x9'));var controller=require(_0xc567('0xa'));router[_0xc567('0xb')]('/',auth[_0xc567('0xc')](),controller[_0xc567('0xd')]);router[_0xc567('0xb')](_0xc567('0xe'),auth[_0xc567('0xc')](),controller[_0xc567('0xf')]);router[_0xc567('0xb')](_0xc567('0x10'),auth[_0xc567('0xc')](),controller[_0xc567('0x11')]);router['get'](_0xc567('0x12'),auth['isAuthenticated'](),controller[_0xc567('0x13')]);router[_0xc567('0x14')]('/',auth[_0xc567('0xc')](),controller['create']);router[_0xc567('0x14')]('/:id/conditions',auth[_0xc567('0xc')](),controller[_0xc567('0x15')]);router[_0xc567('0x14')](_0xc567('0x12'),auth['isAuthenticated'](),controller[_0xc567('0x16')]);router[_0xc567('0x17')](_0xc567('0xe'),auth['isAuthenticated'](),controller[_0xc567('0x18')]);router[_0xc567('0x19')](_0xc567('0xe'),auth['isAuthenticated'](),controller[_0xc567('0x1a')]);module[_0xc567('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index a388e33..485aeff 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 _0x1ecf=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ivr','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','INTEGER','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,*,*,*','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'];(function(_0x2d03d0,_0x529ee7){var _0x43b480=function(_0x10a2bc){while(--_0x10a2bc){_0x2d03d0['push'](_0x2d03d0['shift']());}};_0x43b480(++_0x529ee7);}(_0x1ecf,0x15d));var _0xf1ec=function(_0x118139,_0x7ce965){_0x118139=_0x118139-0x0;var _0x2fece9=_0x1ecf[_0x118139];return _0x2fece9;};'use strict';var Sequelize=require('sequelize');module[_0xf1ec('0x0')]={'name':{'type':Sequelize[_0xf1ec('0x1')],'unique':_0xf1ec('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xf1ec('0x3')),'allowNull':![],'defaultValue':_0xf1ec('0x3')},'description':{'type':Sequelize[_0xf1ec('0x1')]},'active':{'type':Sequelize[_0xf1ec('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xf1ec('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf1ec('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf1ec('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf1ec('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)[_0xf1ec('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'defaultValue':0x3,'comment':_0xf1ec('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf1ec('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf1ec('0xf')},'dialTimezone':{'type':Sequelize[_0xf1ec('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf1ec('0x1')],'defaultValue':_0xf1ec('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xf1ec('0x11')](_0xf1ec('0x12'),'never',_0xf1ec('0x13')),'defaultValue':_0xf1ec('0x12')},'dialAMDActive':{'type':Sequelize[_0xf1ec('0x4')],'defaultValue':0x0,'comment':_0xf1ec('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xf1ec('0x7')](0x9)[_0xf1ec('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xf1ec('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf1ec('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf1ec('0x7')](0x9)[_0xf1ec('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf1ec('0x7')](0x9)[_0xf1ec('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf1ec('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xf1ec('0x7')](0x9)[_0xf1ec('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf1ec('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf1ec('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf1ec('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf1ec('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf1ec('0x7')](0x5)[_0xf1ec('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf1ec('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf1ec('0x7')](0x9)[_0xf1ec('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf1ec('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf1ec('0x11')](_0xf1ec('0x1b'),'ASC'),'defaultValue':_0xf1ec('0x1b')},'dialPrefix':{'type':Sequelize[_0xf1ec('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf1ec('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf1ec('0x1c')},'dialCutDigit':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf1ec('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0xf1ec('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf1ec('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)[_0xf1ec('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xf1ec('0x7')](0x3)[_0xf1ec('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)[_0xf1ec('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf1ec('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf1ec('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf1ec('0x7')](0x5)[_0xf1ec('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf1ec('0x25')}};
\ No newline at end of file
+var _0x712f=['ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name'];(function(_0x3ac95e,_0x43eefa){var _0x11c624=function(_0x302809){while(--_0x302809){_0x3ac95e['push'](_0x3ac95e['shift']());}};_0x11c624(++_0x43eefa);}(_0x712f,0x71));var _0xf712=function(_0x3f17cc,_0x1d8133){_0x3f17cc=_0x3f17cc-0x0;var _0x5085d3=_0x712f[_0x3f17cc];return _0x5085d3;};'use strict';var Sequelize=require(_0xf712('0x0'));module[_0xf712('0x1')]={'name':{'type':Sequelize[_0xf712('0x2')],'unique':_0xf712('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf712('0x4')](_0xf712('0x5')),'allowNull':![],'defaultValue':_0xf712('0x5')},'description':{'type':Sequelize[_0xf712('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf712('0x6')},'limitCalls':{'type':Sequelize[_0xf712('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf712('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf712('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf712('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xf712('0x7')](0x3)[_0xf712('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf712('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf712('0x7')](0x3)[_0xf712('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf712('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf712('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xf712('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf712('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf712('0x7')](0x3)[_0xf712('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf712('0x7')](0x5)[_0xf712('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf712('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf712('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf712('0xe')},'dialTimezone':{'type':Sequelize[_0xf712('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf712('0x2')],'defaultValue':_0xf712('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xf712('0x4')](_0xf712('0x10'),'never',_0xf712('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xf712('0x12')],'defaultValue':0x0,'comment':_0xf712('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xf712('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf712('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf712('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf712('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf712('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf712('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf712('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xf712('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf712('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf712('0x7')](0x9)[_0xf712('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf712('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xf712('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf712('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf712('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf712('0x7')](0x9)[_0xf712('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf712('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf712('0x4')](_0xf712('0x1c'),_0xf712('0x1d')),'defaultValue':_0xf712('0x1c')},'dialPrefix':{'type':Sequelize[_0xf712('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf712('0x7')](0x3)[_0xf712('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf712('0x1e')},'dialCutDigit':{'type':Sequelize[_0xf712('0x7')](0x3)[_0xf712('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf712('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf712('0x7')](0x3)[_0xf712('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf712('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf712('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf712('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xf712('0x7')](0x3)[_0xf712('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf712('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0xf712('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf712('0x7')](0x3)[_0xf712('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf712('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf712('0x7')](0x5)[_0xf712('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xf712('0x7')](0x3)[_0xf712('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf712('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf712('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf712('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf712('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf712('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf712('0x26')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 1dd2d7d..9a99a6b 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 _0xe5b5=['apply','reject','then','error','name','send','index','map','Campaign','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','order','sort','filters','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','params','find','create','body','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','clone','get','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','update','destroy','getHoppers','CmHopper','nolimit','pick','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','hasOwnProperty','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper','insert','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=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x1a9bce,_0x4d25b2){var _0x23724d=function(_0x2502d6){while(--_0x2502d6){_0x1a9bce['push'](_0x1a9bce['shift']());}};_0x23724d(++_0x4d25b2);}(_0xe5b5,0x73));var _0x5e5b=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0xe5b5[_0x4b4b0e];return _0x4c2d91;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e5b('0x0'));var zipdir=require(_0x5e5b('0x1'));var jsonpatch=require(_0x5e5b('0x2'));var rp=require(_0x5e5b('0x3'));var moment=require(_0x5e5b('0x4'));var BPromise=require(_0x5e5b('0x5'));var Mustache=require(_0x5e5b('0x6'));var util=require(_0x5e5b('0x7'));var path=require(_0x5e5b('0x8'));var sox=require(_0x5e5b('0x9'));var csv=require(_0x5e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e5b('0xb'));var _=require(_0x5e5b('0xc'));var squel=require(_0x5e5b('0xd'));var crypto=require(_0x5e5b('0xe'));var jsforce=require(_0x5e5b('0xf'));var deskjs=require(_0x5e5b('0x10'));var toCsv=require(_0x5e5b('0xa'));var querystring=require(_0x5e5b('0x11'));var Papa=require('papaparse');var Redis=require(_0x5e5b('0x12'));var authService=require(_0x5e5b('0x13'));var qs=require(_0x5e5b('0x14'));var as=require(_0x5e5b('0x15'));var hardwareService=require(_0x5e5b('0x16'));var logger=require(_0x5e5b('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x5e5b('0x18'));var licenseUtil=require(_0x5e5b('0x19'));var db=require(_0x5e5b('0x1a'))['db'];function respondWithStatusCode(_0x28668a,_0x42e548){_0x42e548=_0x42e548||0xcc;return function(_0x3e0cbe){if(_0x3e0cbe){return _0x28668a['sendStatus'](_0x42e548);}return _0x28668a[_0x5e5b('0x1b')](_0x42e548)[_0x5e5b('0x1c')]();};}function respondWithResult(_0x38dabd,_0x492ef7){_0x492ef7=_0x492ef7||0xc8;return function(_0x18bd59){if(_0x18bd59){return _0x38dabd[_0x5e5b('0x1b')](_0x492ef7)[_0x5e5b('0x1d')](_0x18bd59);}};}function respondWithFilteredResult(_0x4512c4,_0x2639d6){return function(_0x3d8b7f){if(_0x3d8b7f){var _0xa17e55=typeof _0x2639d6[_0x5e5b('0x1e')]==='undefined'&&typeof _0x2639d6[_0x5e5b('0x1f')]===_0x5e5b('0x20');var _0x3ed951=_0x3d8b7f[_0x5e5b('0x21')];var _0x498d68=_0xa17e55?0x0:_0x2639d6[_0x5e5b('0x1e')];var _0xe24365=_0xa17e55?_0x3d8b7f[_0x5e5b('0x21')]:_0x2639d6[_0x5e5b('0x1e')]+_0x2639d6['limit'];var _0x55ffae;if(_0xe24365>=_0x3ed951){_0xe24365=_0x3ed951;_0x55ffae=0xc8;}else{_0x55ffae=0xce;}_0x4512c4[_0x5e5b('0x1b')](_0x55ffae);return _0x4512c4[_0x5e5b('0x22')](_0x5e5b('0x23'),_0x498d68+'-'+_0xe24365+'/'+_0x3ed951)[_0x5e5b('0x1d')](_0x3d8b7f);}return null;};}function patchUpdates(_0x479ae5){return function(_0x2f85e5){try{jsonpatch[_0x5e5b('0x24')](_0x2f85e5,_0x479ae5,!![]);}catch(_0x4f1524){return BPromise[_0x5e5b('0x25')](_0x4f1524);}return _0x2f85e5['save']();};}function saveUpdates(_0x216e80,_0x36cce7){return function(_0x3680a3){if(_0x3680a3){return _0x3680a3['update'](_0x216e80)[_0x5e5b('0x26')](function(_0x53b56b){return _0x53b56b;});}return null;};}function removeEntity(_0x1a06e1,_0x18deec){return function(_0x49b15b){if(_0x49b15b){return _0x49b15b['destroy']()['then'](function(){var _0x5558b3=_0x49b15b['get']({'plain':!![]});var _0x32d94c='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x32d94c,'resourceId':_0x5558b3['id']}})['then'](function(){return _0x49b15b;});})[_0x5e5b('0x26')](function(){_0x1a06e1[_0x5e5b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308009,_0x1f76db){return function(_0x5b8b6f){if(!_0x5b8b6f){_0x308009['sendStatus'](0x194);}return _0x5b8b6f;};}function handleError(_0x28290c,_0x2c5e1a){_0x2c5e1a=_0x2c5e1a||0x1f4;return function(_0x545062){logger[_0x5e5b('0x27')](_0x545062['stack']);if(_0x545062[_0x5e5b('0x28')]){delete _0x545062[_0x5e5b('0x28')];}_0x28290c[_0x5e5b('0x1b')](_0x2c5e1a)[_0x5e5b('0x29')](_0x545062);};}exports[_0x5e5b('0x2a')]=function(_0x7c84a4,_0x1a40ba){var _0x1b6cdf={},_0x38bc88={},_0x545a86={'count':0x0,'rows':[]};var _0x543622=_[_0x5e5b('0x2b')](db[_0x5e5b('0x2c')][_0x5e5b('0x2d')],function(_0xd5928){return{'name':_0xd5928['fieldName'],'type':_0xd5928[_0x5e5b('0x2e')]['key']};});_0x38bc88[_0x5e5b('0x2f')]=_[_0x5e5b('0x2b')](_0x543622,'name');_0x38bc88[_0x5e5b('0x30')]=_[_0x5e5b('0x31')](_0x7c84a4[_0x5e5b('0x30')]);_0x38bc88['filters']=_[_0x5e5b('0x32')](_0x38bc88['model'],_0x38bc88[_0x5e5b('0x30')]);_0x1b6cdf[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x38bc88[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x7c84a4[_0x5e5b('0x30')][_0x5e5b('0x34')]));_0x1b6cdf[_0x5e5b('0x33')]=_0x1b6cdf[_0x5e5b('0x33')][_0x5e5b('0x35')]?_0x1b6cdf[_0x5e5b('0x33')]:_0x38bc88[_0x5e5b('0x2f')];if(!_0x7c84a4[_0x5e5b('0x30')]['hasOwnProperty']('nolimit')){_0x1b6cdf['limit']=qs[_0x5e5b('0x1f')](_0x7c84a4['query'][_0x5e5b('0x1f')]);_0x1b6cdf['offset']=qs[_0x5e5b('0x1e')](_0x7c84a4[_0x5e5b('0x30')][_0x5e5b('0x1e')]);}_0x1b6cdf[_0x5e5b('0x36')]=qs[_0x5e5b('0x37')](_0x7c84a4[_0x5e5b('0x30')][_0x5e5b('0x37')]);_0x1b6cdf['where']=qs[_0x5e5b('0x38')](_['pick'](_0x7c84a4[_0x5e5b('0x30')],_0x38bc88[_0x5e5b('0x38')]),_0x543622);if(_0x7c84a4[_0x5e5b('0x30')][_0x5e5b('0x39')]){_0x1b6cdf['where']=_[_0x5e5b('0x3a')](_0x1b6cdf['where'],{'$or':_[_0x5e5b('0x2b')](_0x543622,function(_0x28d50e){if(_0x28d50e[_0x5e5b('0x2e')]!==_0x5e5b('0x3b')){var _0x423fe6={};_0x423fe6[_0x28d50e['name']]={'$like':'%'+_0x7c84a4['query'][_0x5e5b('0x39')]+'%'};return _0x423fe6;}})});}_0x1b6cdf=_[_0x5e5b('0x3a')]({},_0x1b6cdf,_0x7c84a4[_0x5e5b('0x3c')]);var _0x410ca9={'where':_0x1b6cdf[_0x5e5b('0x3d')]};return db[_0x5e5b('0x2c')]['count'](_0x410ca9)[_0x5e5b('0x26')](function(_0x560a6e){_0x545a86[_0x5e5b('0x21')]=_0x560a6e;if(_0x7c84a4[_0x5e5b('0x30')][_0x5e5b('0x3e')]){_0x1b6cdf[_0x5e5b('0x3f')]=[{'all':!![]}];}return db[_0x5e5b('0x2c')][_0x5e5b('0x40')](_0x1b6cdf);})['then'](function(_0x7ebcbd){_0x545a86[_0x5e5b('0x41')]=_0x7ebcbd;return _0x545a86;})[_0x5e5b('0x26')](respondWithFilteredResult(_0x1a40ba,_0x1b6cdf))[_0x5e5b('0x42')](handleError(_0x1a40ba,null));};exports['show']=function(_0x11d0ce,_0x5eb00b){var _0x45612b={'raw':![],'where':{'id':_0x11d0ce[_0x5e5b('0x43')]['id']}},_0x4a1c79={};_0x4a1c79[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db[_0x5e5b('0x2c')]['rawAttributes']);_0x4a1c79['query']=_['keys'](_0x11d0ce[_0x5e5b('0x30')]);_0x4a1c79['filters']=_[_0x5e5b('0x32')](_0x4a1c79[_0x5e5b('0x2f')],_0x4a1c79['query']);_0x45612b[_0x5e5b('0x33')]=_['intersection'](_0x4a1c79['model'],qs[_0x5e5b('0x34')](_0x11d0ce[_0x5e5b('0x30')]['fields']));_0x45612b['attributes']=_0x45612b[_0x5e5b('0x33')][_0x5e5b('0x35')]?_0x45612b['attributes']:_0x4a1c79[_0x5e5b('0x2f')];if(_0x11d0ce[_0x5e5b('0x30')][_0x5e5b('0x3e')]){_0x45612b[_0x5e5b('0x3f')]=[{'all':!![]}];}_0x45612b=_['merge']({},_0x45612b,_0x11d0ce['options']);return db[_0x5e5b('0x2c')][_0x5e5b('0x44')](_0x45612b)[_0x5e5b('0x26')](handleEntityNotFound(_0x5eb00b,null))[_0x5e5b('0x26')](respondWithResult(_0x5eb00b,null))[_0x5e5b('0x42')](handleError(_0x5eb00b,null));};exports[_0x5e5b('0x45')]=function(_0x560132,_0xbcdaad){return db[_0x5e5b('0x2c')][_0x5e5b('0x45')](_0x560132[_0x5e5b('0x46')],{})[_0x5e5b('0x26')](function(_0x3ed7ee){var _0x30fb7c=_0x560132[_0x5e5b('0x47')]['get']({'plain':!![]});if(!_0x30fb7c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30fb7c['role']==='user'){var _0x22cc1f=_0x3ed7ee['get']({'plain':!![]});var _0x59c28b=_0x5e5b('0x48');return db[_0x5e5b('0x49')]['find']({'where':{'name':_0x59c28b,'userProfileId':_0x30fb7c[_0x5e5b('0x4a')]},'raw':!![]})[_0x5e5b('0x26')](function(_0x4060f6){if(_0x4060f6&&_0x4060f6[_0x5e5b('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x22cc1f[_0x5e5b('0x28')],'resourceId':_0x22cc1f['id'],'type':_0x4060f6[_0x5e5b('0x28')],'sectionId':_0x4060f6['id']},{})[_0x5e5b('0x26')](function(){return _0x3ed7ee;});}else{return _0x3ed7ee;}})[_0x5e5b('0x42')](function(_0x1281b2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1281b2);throw _0x1281b2;});}return _0x3ed7ee;})['then'](respondWithResult(_0xbcdaad,0xc9))['catch'](handleError(_0xbcdaad,null));};exports[_0x5e5b('0x4c')]=function(_0x3c19a5,_0x5b3fe0){var _0x2b924d={'where':{'id':_0x3c19a5[_0x5e5b('0x43')]['id']}},_0x1ce1a6={};_0x1ce1a6[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db['Campaign'][_0x5e5b('0x2d')]);_0x2b924d[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x1ce1a6[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x3c19a5[_0x5e5b('0x30')]['fields']));_0x2b924d['attributes']=_0x2b924d[_0x5e5b('0x33')][_0x5e5b('0x35')]?_0x2b924d['attributes']:_0x1ce1a6[_0x5e5b('0x2f')];if(_0x3c19a5[_0x5e5b('0x30')][_0x5e5b('0x3e')]){_0x2b924d['include']=[{'all':!![]}];}_0x2b924d=_[_0x5e5b('0x3a')]({},_0x2b924d,_0x3c19a5[_0x5e5b('0x3c')]);return db['Campaign']['find'](_0x2b924d)[_0x5e5b('0x26')](handleEntityNotFound(_0x5b3fe0,null))['then'](function(_0x158082){if(_0x158082){var _0x5d6488=_0x158082[_0x5e5b('0x4d')]({'plain':!![]});_0x5d6488=qs[_0x5e5b('0x4e')](_0x5d6488,['id','createdAt',_0x5e5b('0x4f')]);_0x3c19a5[_0x5e5b('0x46')]=_['omit'](_0x3c19a5[_0x5e5b('0x46')],['id',_0x5e5b('0x50'),'updatedAt']);return db[_0x5e5b('0x2c')][_0x5e5b('0x45')](_[_0x5e5b('0x3a')](_0x5d6488,_0x3c19a5[_0x5e5b('0x46')]),{'include':_0x3c19a5['query'][_0x5e5b('0x3e')]?[{'all':!![]}]:undefined})[_0x5e5b('0x26')](function(_0x37495d){var _0x582fdc=_0x3c19a5[_0x5e5b('0x47')][_0x5e5b('0x4d')]({'plain':!![]});if(!_0x582fdc)throw new Error(_0x5e5b('0x51'));if(_0x582fdc[_0x5e5b('0x52')]===_0x5e5b('0x47')){var _0x28c8f1=_0x37495d[_0x5e5b('0x4d')]({'plain':!![]});var _0x458342=_0x5e5b('0x48');return db['UserProfileSection'][_0x5e5b('0x44')]({'where':{'name':_0x458342,'userProfileId':_0x582fdc[_0x5e5b('0x4a')]},'raw':!![]})[_0x5e5b('0x26')](function(_0x4e1744){if(_0x4e1744&&_0x4e1744['autoAssociation']===0x0){return db[_0x5e5b('0x53')][_0x5e5b('0x45')]({'name':_0x28c8f1[_0x5e5b('0x28')],'resourceId':_0x28c8f1['id'],'type':_0x4e1744['name'],'sectionId':_0x4e1744['id']},{})[_0x5e5b('0x26')](function(){return _0x37495d;});}else{return _0x37495d;}})[_0x5e5b('0x42')](function(_0x2ca87c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca87c);throw _0x2ca87c;});}return _0x37495d;});}})[_0x5e5b('0x26')](respondWithResult(_0x5b3fe0,0xc9))[_0x5e5b('0x42')](handleError(_0x5b3fe0,null));};exports[_0x5e5b('0x54')]=function(_0x23257c,_0x1f9233){if(_0x23257c[_0x5e5b('0x46')]['id']){delete _0x23257c[_0x5e5b('0x46')]['id'];}return db[_0x5e5b('0x2c')][_0x5e5b('0x44')]({'where':{'id':_0x23257c[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x1f9233,null))['then'](saveUpdates(_0x23257c[_0x5e5b('0x46')],null))[_0x5e5b('0x26')](respondWithResult(_0x1f9233,null))[_0x5e5b('0x42')](handleError(_0x1f9233,null));};exports[_0x5e5b('0x55')]=function(_0x129141,_0x3588cf){return db['Campaign']['find']({'where':{'id':_0x129141['params']['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x3588cf,null))['then'](removeEntity(_0x3588cf,null))[_0x5e5b('0x42')](handleError(_0x3588cf,null));};exports[_0x5e5b('0x56')]=function(_0xcce46d,_0x543f38,_0xbceca6){var _0x53f1cc={'raw':!![],'where':{}};var _0x3a8923={};var _0x2ad7f8={'count':0x0,'rows':[]};return db[_0x5e5b('0x2c')]['findOne']({'where':{'id':_0xcce46d[_0x5e5b('0x43')]['id']}})['then'](handleEntityNotFound(_0x543f38,null))['then'](function(_0x430c1a){if(_0x430c1a){_0x3a8923[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db[_0x5e5b('0x57')][_0x5e5b('0x2d')]);_0x3a8923[_0x5e5b('0x30')]=_['keys'](_0xcce46d[_0x5e5b('0x30')]);_0x3a8923['filters']=_[_0x5e5b('0x32')](_0x3a8923['model'],_0x3a8923['query']);_0x53f1cc[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x3a8923[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0xcce46d[_0x5e5b('0x30')][_0x5e5b('0x34')]));_0x53f1cc[_0x5e5b('0x33')]=_0x53f1cc['attributes'][_0x5e5b('0x35')]?_0x53f1cc[_0x5e5b('0x33')]:_0x3a8923[_0x5e5b('0x2f')];if(!_0xcce46d[_0x5e5b('0x30')]['hasOwnProperty'](_0x5e5b('0x58'))){_0x53f1cc['limit']=qs[_0x5e5b('0x1f')](_0xcce46d[_0x5e5b('0x30')][_0x5e5b('0x1f')]);_0x53f1cc[_0x5e5b('0x1e')]=qs[_0x5e5b('0x1e')](_0xcce46d[_0x5e5b('0x30')][_0x5e5b('0x1e')]);}_0x53f1cc[_0x5e5b('0x36')]=qs[_0x5e5b('0x37')](_0xcce46d['query'][_0x5e5b('0x37')]);_0x53f1cc[_0x5e5b('0x3d')]=qs[_0x5e5b('0x38')](_[_0x5e5b('0x59')](_0xcce46d[_0x5e5b('0x30')],_0x3a8923[_0x5e5b('0x38')]));_0x53f1cc['where'][_0x5e5b('0x5a')]=_0x430c1a['id'];if(_0xcce46d[_0x5e5b('0x30')][_0x5e5b('0x39')]){_0x53f1cc[_0x5e5b('0x3d')]=_[_0x5e5b('0x3a')](_0x53f1cc[_0x5e5b('0x3d')],{'$or':_[_0x5e5b('0x2b')](_0x53f1cc['attributes'],function(_0x1cab47){var _0x4f69ff={};_0x4f69ff[_0x1cab47]={'$like':'%'+_0xcce46d[_0x5e5b('0x30')][_0x5e5b('0x39')]+'%'};return _0x4f69ff;})});}_0x53f1cc=_[_0x5e5b('0x3a')]({},_0x53f1cc,_0xcce46d[_0x5e5b('0x3c')]);return db[_0x5e5b('0x57')][_0x5e5b('0x21')]({'where':_0x53f1cc[_0x5e5b('0x3d')]})['then'](function(_0x15214c){_0x2ad7f8[_0x5e5b('0x21')]=_0x15214c;if(_0xcce46d[_0x5e5b('0x30')][_0x5e5b('0x3e')]){_0x53f1cc[_0x5e5b('0x3f')]=[{'all':!![]}];}return db[_0x5e5b('0x57')][_0x5e5b('0x40')](_0x53f1cc);})[_0x5e5b('0x26')](function(_0x1d1367){_0x2ad7f8[_0x5e5b('0x41')]=_0x1d1367;return _0x2ad7f8;});}})[_0x5e5b('0x26')](respondWithFilteredResult(_0x543f38,_0x53f1cc))[_0x5e5b('0x42')](handleError(_0x543f38,null));};exports[_0x5e5b('0x5b')]=function(_0x4c1068,_0x127872,_0x218935){var _0x3d8c79={'raw':!![],'where':{}};var _0x386a9f={};var _0x565477={'count':0x0,'rows':[]};return db[_0x5e5b('0x2c')][_0x5e5b('0x5c')]({'where':{'id':_0x4c1068[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x127872,null))[_0x5e5b('0x26')](function(_0x220103){if(_0x220103){_0x386a9f[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db[_0x5e5b('0x5d')]['rawAttributes']);_0x386a9f[_0x5e5b('0x30')]=_[_0x5e5b('0x31')](_0x4c1068[_0x5e5b('0x30')]);_0x386a9f[_0x5e5b('0x38')]=_['intersection'](_0x386a9f[_0x5e5b('0x2f')],_0x386a9f['query']);_0x3d8c79[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x386a9f[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x4c1068[_0x5e5b('0x30')]['fields']));_0x3d8c79[_0x5e5b('0x33')]=_0x3d8c79[_0x5e5b('0x33')]['length']?_0x3d8c79[_0x5e5b('0x33')]:_0x386a9f[_0x5e5b('0x2f')];if(!_0x4c1068['query']['hasOwnProperty'](_0x5e5b('0x58'))){_0x3d8c79[_0x5e5b('0x1f')]=qs[_0x5e5b('0x1f')](_0x4c1068[_0x5e5b('0x30')][_0x5e5b('0x1f')]);_0x3d8c79[_0x5e5b('0x1e')]=qs[_0x5e5b('0x1e')](_0x4c1068[_0x5e5b('0x30')][_0x5e5b('0x1e')]);}_0x3d8c79[_0x5e5b('0x36')]=qs[_0x5e5b('0x37')](_0x4c1068[_0x5e5b('0x30')][_0x5e5b('0x37')]);_0x3d8c79[_0x5e5b('0x3d')]=qs[_0x5e5b('0x38')](_[_0x5e5b('0x59')](_0x4c1068[_0x5e5b('0x30')],_0x386a9f[_0x5e5b('0x38')]));_0x3d8c79['where']['CampaignId']=_0x220103['id'];if(_0x4c1068[_0x5e5b('0x30')][_0x5e5b('0x39')]){_0x3d8c79[_0x5e5b('0x3d')]=_['merge'](_0x3d8c79['where'],{'$or':_[_0x5e5b('0x2b')](_0x3d8c79[_0x5e5b('0x33')],function(_0x35cbc4){var _0x34e34a={};_0x34e34a[_0x35cbc4]={'$like':'%'+_0x4c1068[_0x5e5b('0x30')][_0x5e5b('0x39')]+'%'};return _0x34e34a;})});}_0x3d8c79=_['merge']({},_0x3d8c79,_0x4c1068[_0x5e5b('0x3c')]);return db[_0x5e5b('0x5d')][_0x5e5b('0x21')]({'where':_0x3d8c79[_0x5e5b('0x3d')]})[_0x5e5b('0x26')](function(_0x384e0c){_0x565477[_0x5e5b('0x21')]=_0x384e0c;if(_0x4c1068[_0x5e5b('0x30')]['includeAll']){_0x3d8c79[_0x5e5b('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x5e5b('0x40')](_0x3d8c79);})[_0x5e5b('0x26')](function(_0x12ecfe){_0x565477[_0x5e5b('0x41')]=_0x12ecfe;return _0x565477;});}})['then'](respondWithFilteredResult(_0x127872,_0x3d8c79))[_0x5e5b('0x42')](handleError(_0x127872,null));};exports[_0x5e5b('0x5e')]=function(_0x91b57e,_0x556a4b,_0x2590d1){var _0x59e36e={'raw':!![],'where':{}};var _0x308c1b={};var _0x4298e5={'count':0x0,'rows':[]};return db[_0x5e5b('0x2c')][_0x5e5b('0x5c')]({'where':{'id':_0x91b57e[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x556a4b,null))[_0x5e5b('0x26')](function(_0x43dd42){if(_0x43dd42){_0x308c1b[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db[_0x5e5b('0x5f')]['rawAttributes']);_0x308c1b[_0x5e5b('0x30')]=_[_0x5e5b('0x31')](_0x91b57e[_0x5e5b('0x30')]);_0x308c1b[_0x5e5b('0x38')]=_[_0x5e5b('0x32')](_0x308c1b[_0x5e5b('0x2f')],_0x308c1b[_0x5e5b('0x30')]);_0x59e36e[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x308c1b[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x91b57e['query'][_0x5e5b('0x34')]));_0x59e36e['attributes']=_0x59e36e[_0x5e5b('0x33')][_0x5e5b('0x35')]?_0x59e36e['attributes']:_0x308c1b[_0x5e5b('0x2f')];if(!_0x91b57e[_0x5e5b('0x30')]['hasOwnProperty']('nolimit')){_0x59e36e['limit']=qs[_0x5e5b('0x1f')](_0x91b57e[_0x5e5b('0x30')][_0x5e5b('0x1f')]);_0x59e36e[_0x5e5b('0x1e')]=qs[_0x5e5b('0x1e')](_0x91b57e[_0x5e5b('0x30')]['offset']);}_0x59e36e[_0x5e5b('0x36')]=qs[_0x5e5b('0x37')](_0x91b57e[_0x5e5b('0x30')][_0x5e5b('0x37')]);_0x59e36e[_0x5e5b('0x3d')]=qs[_0x5e5b('0x38')](_['pick'](_0x91b57e[_0x5e5b('0x30')],_0x308c1b[_0x5e5b('0x38')]));_0x59e36e[_0x5e5b('0x3d')][_0x5e5b('0x5a')]=_0x43dd42['id'];if(_0x91b57e['query'][_0x5e5b('0x39')]){_0x59e36e[_0x5e5b('0x3d')]=_['merge'](_0x59e36e[_0x5e5b('0x3d')],{'$or':_[_0x5e5b('0x2b')](_0x59e36e[_0x5e5b('0x33')],function(_0x546510){var _0x49ea11={};_0x49ea11[_0x546510]={'$like':'%'+_0x91b57e[_0x5e5b('0x30')][_0x5e5b('0x39')]+'%'};return _0x49ea11;})});}_0x59e36e=_[_0x5e5b('0x3a')]({},_0x59e36e,_0x91b57e[_0x5e5b('0x3c')]);return db[_0x5e5b('0x5f')]['count']({'where':_0x59e36e[_0x5e5b('0x3d')]})['then'](function(_0xd9a6ee){_0x4298e5['count']=_0xd9a6ee;if(_0x91b57e[_0x5e5b('0x30')][_0x5e5b('0x3e')]){_0x59e36e['include']=[{'all':!![]}];}return db[_0x5e5b('0x5f')][_0x5e5b('0x40')](_0x59e36e);})[_0x5e5b('0x26')](function(_0x430291){_0x4298e5['rows']=_0x430291;return _0x4298e5;});}})[_0x5e5b('0x26')](respondWithFilteredResult(_0x556a4b,_0x59e36e))[_0x5e5b('0x42')](handleError(_0x556a4b,null));};exports[_0x5e5b('0x60')]=function(_0x2401f9,_0x46c8b4,_0xb8f0fd){var _0x2cfff0={'raw':!![],'where':{}};var _0x4d9562={};var _0xc8adfb={'count':0x0,'rows':[]};return db[_0x5e5b('0x2c')][_0x5e5b('0x5c')]({'where':{'id':_0x2401f9[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x46c8b4,null))['then'](function(_0x499d4b){if(_0x499d4b){_0x4d9562[_0x5e5b('0x2f')]=_['keys'](db[_0x5e5b('0x61')][_0x5e5b('0x2d')]);_0x4d9562[_0x5e5b('0x30')]=_[_0x5e5b('0x31')](_0x2401f9['query']);_0x4d9562[_0x5e5b('0x38')]=_['intersection'](_0x4d9562[_0x5e5b('0x2f')],_0x4d9562[_0x5e5b('0x30')]);_0x2cfff0[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x4d9562[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x2401f9[_0x5e5b('0x30')][_0x5e5b('0x34')]));_0x2cfff0[_0x5e5b('0x33')]=_0x2cfff0[_0x5e5b('0x33')]['length']?_0x2cfff0[_0x5e5b('0x33')]:_0x4d9562[_0x5e5b('0x2f')];if(!_0x2401f9[_0x5e5b('0x30')]['hasOwnProperty'](_0x5e5b('0x58'))){_0x2cfff0[_0x5e5b('0x1f')]=qs[_0x5e5b('0x1f')](_0x2401f9[_0x5e5b('0x30')][_0x5e5b('0x1f')]);_0x2cfff0[_0x5e5b('0x1e')]=qs[_0x5e5b('0x1e')](_0x2401f9[_0x5e5b('0x30')][_0x5e5b('0x1e')]);}_0x2cfff0[_0x5e5b('0x36')]=qs[_0x5e5b('0x37')](_0x2401f9[_0x5e5b('0x30')]['sort']);_0x2cfff0[_0x5e5b('0x3d')]=qs[_0x5e5b('0x38')](_[_0x5e5b('0x59')](_0x2401f9['query'],_0x4d9562['filters']));_0x2cfff0[_0x5e5b('0x3d')][_0x5e5b('0x5a')]=_0x499d4b['id'];if(_0x2401f9['query'][_0x5e5b('0x39')]){_0x2cfff0['where']=_[_0x5e5b('0x3a')](_0x2cfff0[_0x5e5b('0x3d')],{'$or':_[_0x5e5b('0x2b')](_0x2cfff0[_0x5e5b('0x33')],function(_0x429084){var _0x4c07f0={};_0x4c07f0[_0x429084]={'$like':'%'+_0x2401f9[_0x5e5b('0x30')][_0x5e5b('0x39')]+'%'};return _0x4c07f0;})});}_0x2cfff0=_['merge']({},_0x2cfff0,_0x2401f9[_0x5e5b('0x3c')]);return db[_0x5e5b('0x61')]['count']({'where':_0x2cfff0[_0x5e5b('0x3d')]})[_0x5e5b('0x26')](function(_0x416941){_0xc8adfb['count']=_0x416941;if(_0x2401f9['query'][_0x5e5b('0x3e')]){_0x2cfff0[_0x5e5b('0x3f')]=[{'all':!![]}];}return db[_0x5e5b('0x61')][_0x5e5b('0x40')](_0x2cfff0);})[_0x5e5b('0x26')](function(_0x47c605){_0xc8adfb['rows']=_0x47c605;return _0xc8adfb;});}})[_0x5e5b('0x26')](respondWithFilteredResult(_0x46c8b4,_0x2cfff0))[_0x5e5b('0x42')](handleError(_0x46c8b4,null));};exports['getLists']=function(_0x1da4af,_0x2a691f,_0x440b4c){var _0x2e047b={};var _0xc9ea89={};var _0x381744;var _0x1026e0;return db['Campaign']['findOne']({'where':{'id':_0x1da4af[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x2a691f,null))[_0x5e5b('0x26')](function(_0x4113a4){if(_0x4113a4){_0x381744=_0x4113a4;_0xc9ea89[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db[_0x5e5b('0x62')]['rawAttributes']);_0xc9ea89['query']=_[_0x5e5b('0x31')](_0x1da4af[_0x5e5b('0x30')]);_0xc9ea89['filters']=_[_0x5e5b('0x32')](_0xc9ea89[_0x5e5b('0x2f')],_0xc9ea89['query']);_0x2e047b[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0xc9ea89[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x1da4af['query'][_0x5e5b('0x34')]));_0x2e047b[_0x5e5b('0x33')]=_0x2e047b[_0x5e5b('0x33')][_0x5e5b('0x35')]?_0x2e047b['attributes']:_0xc9ea89['model'];_0x2e047b['order']=qs[_0x5e5b('0x37')](_0x1da4af[_0x5e5b('0x30')][_0x5e5b('0x37')]);_0x2e047b[_0x5e5b('0x3d')]=qs[_0x5e5b('0x38')](_[_0x5e5b('0x59')](_0x1da4af['query'],_0xc9ea89['filters']));if(_0x1da4af[_0x5e5b('0x30')][_0x5e5b('0x39')]){_0x2e047b['where']=_[_0x5e5b('0x3a')](_0x2e047b[_0x5e5b('0x3d')],{'$or':_[_0x5e5b('0x2b')](_0x2e047b[_0x5e5b('0x33')],function(_0x5b3157){var _0x115a42={};_0x115a42[_0x5b3157]={'$like':'%'+_0x1da4af[_0x5e5b('0x30')][_0x5e5b('0x39')]+'%'};return _0x115a42;})});}_0x2e047b=_[_0x5e5b('0x3a')]({},_0x2e047b,_0x1da4af[_0x5e5b('0x3c')]);return _0x381744[_0x5e5b('0x63')](_0x2e047b);}})[_0x5e5b('0x26')](function(_0x36bcc7){if(_0x36bcc7){_0x1026e0=_0x36bcc7[_0x5e5b('0x35')];if(!_0x1da4af[_0x5e5b('0x30')][_0x5e5b('0x64')](_0x5e5b('0x58'))){_0x2e047b[_0x5e5b('0x1f')]=qs['limit'](_0x1da4af['query'][_0x5e5b('0x1f')]);_0x2e047b[_0x5e5b('0x1e')]=qs['offset'](_0x1da4af[_0x5e5b('0x30')][_0x5e5b('0x1e')]);}return _0x381744[_0x5e5b('0x63')](_0x2e047b);}})[_0x5e5b('0x26')](function(_0x423e75){if(_0x423e75){return _0x423e75?{'count':_0x1026e0,'rows':_0x423e75}:null;}})[_0x5e5b('0x26')](respondWithResult(_0x2a691f,null))['catch'](handleError(_0x2a691f,null));};exports[_0x5e5b('0x65')]=function(_0x3453d2,_0x45931e,_0x2c5a23){var _0x10b74d,_0x3b03e9;var _0x3e0b30=[];var _0xa31f34=moment()[_0x5e5b('0x66')](_0x5e5b('0x67'));return db[_0x5e5b('0x2c')][_0x5e5b('0x44')]({'where':{'id':_0x3453d2[_0x5e5b('0x43')]['id']}})['then'](handleEntityNotFound(_0x45931e,null))[_0x5e5b('0x26')](function(_0x59187b){if(_0x59187b){_0x3b03e9=_0x59187b;return _0x59187b['addLists'](_0x3453d2[_0x5e5b('0x46')][_0x5e5b('0x68')],_[_0x5e5b('0x4e')](_0x3453d2[_0x5e5b('0x46')],[_0x5e5b('0x68'),'id'])||{});}return null;})[_0x5e5b('0x69')](function(_0x538256){var _0x248069;var _0x806763;_0x10b74d=_0x538256||[];var _0x1632c4=[];if(_0x538256){for(var _0x19dfb2=0x0;_0x19dfb2<_0x538256[_0x5e5b('0x35')];_0x19dfb2+=0x1){var _0xd5a993=_0x538256[_0x19dfb2][_0x5e5b('0x4d')]({'plain':!![]});_0x3b03e9[_0x5e5b('0x6a')]=_0x3453d2[_0x5e5b('0x46')][_0x5e5b('0x6a')]?_0x3453d2[_0x5e5b('0x46')]['dialCheckDuplicateType']:_0x3b03e9[_0x5e5b('0x6a')];switch(_0x3b03e9[_0x5e5b('0x6a')]){case _0x5e5b('0x6b'):_0x248069=squel['insert']()[_0x5e5b('0x6c')]('cm_hopper')[_0x5e5b('0x6d')]([_0x5e5b('0x6e'),_0x5e5b('0x6f'),_0x5e5b('0x70'),_0x5e5b('0x71'),_0x5e5b('0x5a'),_0x5e5b('0x50'),_0x5e5b('0x4f')],squel[_0x5e5b('0x72')]()[_0x5e5b('0x73')]('phone',_0x5e5b('0x6e'))[_0x5e5b('0x73')](_0x5e5b('0x74'),_0x5e5b('0x6f'))[_0x5e5b('0x73')]('id',_0x5e5b('0x70'))[_0x5e5b('0x73')](_0xd5a993[_0x5e5b('0x75')][_0x5e5b('0x76')](),_0x5e5b('0x71'))['field'](_0x3453d2[_0x5e5b('0x43')]['id']['toString'](),_0x5e5b('0x5a'))[_0x5e5b('0x73')]('\x27'+_0xa31f34+'\x27',_0x5e5b('0x50'))[_0x5e5b('0x73')]('\x27'+_0xa31f34+'\x27','updatedAt')[_0x5e5b('0x77')](_0x5e5b('0x78'))[_0x5e5b('0x3d')](_0x5e5b('0x79'))[_0x5e5b('0x3d')](_0x5e5b('0x7a'),_0xd5a993[_0x5e5b('0x75')]['toString']())[_0x5e5b('0x3d')](_0x5e5b('0x7b'))['where'](_0x5e5b('0x7c'),squel[_0x5e5b('0x72')]()['field'](_0x5e5b('0x7d'))[_0x5e5b('0x77')](_0x5e5b('0x7e'))[_0x5e5b('0x3d')](_0x5e5b('0x7f'),_0x3453d2['params']['id'][_0x5e5b('0x76')]()))[_0x5e5b('0x3d')](_0x5e5b('0x7c'),squel[_0x5e5b('0x72')]()[_0x5e5b('0x73')](_0x5e5b('0x80'))[_0x5e5b('0x77')]('cm_hopper')[_0x5e5b('0x3d')](_0x5e5b('0x7f'),_0x3453d2[_0x5e5b('0x43')]['id'][_0x5e5b('0x76')]())))[_0x5e5b('0x76')]();break;case _0x5e5b('0x81'):_0x248069=squel['insert']()[_0x5e5b('0x6c')](_0x5e5b('0x82'))[_0x5e5b('0x6d')](['phone',_0x5e5b('0x6f'),'ContactId',_0x5e5b('0x71'),_0x5e5b('0x5a'),_0x5e5b('0x50'),_0x5e5b('0x4f')],squel['select']()[_0x5e5b('0x73')]('phone','phone')[_0x5e5b('0x73')](_0x5e5b('0x74'),_0x5e5b('0x6f'))[_0x5e5b('0x73')]('id',_0x5e5b('0x70'))[_0x5e5b('0x73')](_0xd5a993['CmListId'][_0x5e5b('0x76')](),'ListId')[_0x5e5b('0x73')](_0x3453d2[_0x5e5b('0x43')]['id'][_0x5e5b('0x76')](),_0x5e5b('0x5a'))[_0x5e5b('0x73')]('\x27'+_0xa31f34+'\x27',_0x5e5b('0x50'))['field']('\x27'+_0xa31f34+'\x27',_0x5e5b('0x4f'))['from'](_0x5e5b('0x78'))[_0x5e5b('0x3d')](_0x5e5b('0x79'))['where']('ListId\x20=\x20?',_0xd5a993['CmListId'][_0x5e5b('0x76')]())[_0x5e5b('0x3d')](_0x5e5b('0x7b'))[_0x5e5b('0x3d')](_0x5e5b('0x7c'),squel[_0x5e5b('0x72')]()['field'](_0x5e5b('0x80'))[_0x5e5b('0x77')](_0x5e5b('0x82'))[_0x5e5b('0x3d')](_0x5e5b('0x7f'),_0x3453d2[_0x5e5b('0x43')]['id'][_0x5e5b('0x76')]())))[_0x5e5b('0x76')]();break;default:_0x248069=squel['insert']()[_0x5e5b('0x6c')](_0x5e5b('0x82'))[_0x5e5b('0x6d')]([_0x5e5b('0x6e'),'scheduledAt',_0x5e5b('0x70'),'ListId',_0x5e5b('0x5a'),_0x5e5b('0x50'),_0x5e5b('0x4f')],squel[_0x5e5b('0x72')]()['field'](_0x5e5b('0x6e'),_0x5e5b('0x6e'))[_0x5e5b('0x73')]('NOW()',_0x5e5b('0x6f'))[_0x5e5b('0x73')]('id',_0x5e5b('0x70'))['field'](_0xd5a993[_0x5e5b('0x75')][_0x5e5b('0x76')](),_0x5e5b('0x71'))[_0x5e5b('0x73')](_0x3453d2[_0x5e5b('0x43')]['id'][_0x5e5b('0x76')](),_0x5e5b('0x5a'))['field']('\x27'+_0xa31f34+'\x27',_0x5e5b('0x50'))[_0x5e5b('0x73')]('\x27'+_0xa31f34+'\x27','updatedAt')['from'](_0x5e5b('0x78'))[_0x5e5b('0x3d')]('deletedAt\x20IS\x20NULL')[_0x5e5b('0x3d')](_0x5e5b('0x7a'),_0xd5a993['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x5e5b('0x76')]();}_0x806763=squel[_0x5e5b('0x83')]()['into'](_0x5e5b('0x84'))[_0x5e5b('0x6d')]([_0x5e5b('0x85'),_0x5e5b('0x6f'),_0x5e5b('0x6e'),_0x5e5b('0x86'),_0x5e5b('0x50'),_0x5e5b('0x4f')],squel[_0x5e5b('0x72')]()['field'](_0x5e5b('0x87'),'id')[_0x5e5b('0x73')]('NOW()',_0x5e5b('0x6f'))['field'](_0x5e5b('0x88'),_0x5e5b('0x6e'))[_0x5e5b('0x73')](_0x5e5b('0x89'),_0x5e5b('0x86'))[_0x5e5b('0x73')]('\x27'+_0xa31f34+'\x27','createdAt')[_0x5e5b('0x73')]('\x27'+_0xa31f34+'\x27',_0x5e5b('0x4f'))[_0x5e5b('0x77')](_0x5e5b('0x8a'),'ci')[_0x5e5b('0x8b')](_0x5e5b('0x82'),'h',_0x5e5b('0x8c'))[_0x5e5b('0x3d')](_0x5e5b('0x8d'),_0xd5a993[_0x5e5b('0x75')][_0x5e5b('0x76')]())[_0x5e5b('0x3d')](_0x5e5b('0x8e'),_0x3453d2[_0x5e5b('0x43')]['id'][_0x5e5b('0x76')]())['where']('h.createdAt\x20=\x20?',_0xa31f34))[_0x5e5b('0x76')]();_0x1632c4[_0x5e5b('0x8f')](db[_0x5e5b('0x90')][_0x5e5b('0x30')](_0x248069));_0x3e0b30['push'](db[_0x5e5b('0x90')][_0x5e5b('0x30')](_0x806763));}return BPromise[_0x5e5b('0x91')](_0x1632c4);}})[_0x5e5b('0x26')](function(){return BPromise[_0x5e5b('0x91')](_0x3e0b30);})['then'](function(){return _0x10b74d;})[_0x5e5b('0x26')](respondWithResult(_0x45931e,null))[_0x5e5b('0x42')](handleError(_0x45931e,null));};exports[_0x5e5b('0x92')]=function(_0xb5293a,_0x1eb268,_0xb7925b){return db['Campaign'][_0x5e5b('0x44')]({'where':{'id':_0xb5293a[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x1eb268,null))[_0x5e5b('0x26')](function(_0x3b561f){if(_0x3b561f){return _0x3b561f[_0x5e5b('0x92')](_0xb5293a[_0x5e5b('0x30')][_0x5e5b('0x68')]);}})[_0x5e5b('0x26')](function(_0x20479e){if(_0x20479e){return db['CmHopper']['destroy']({'where':{'ListId':_0xb5293a[_0x5e5b('0x30')]['ids'],'CampaignId':_0xb5293a[_0x5e5b('0x43')]['id']}})['then'](function(){return _0x20479e;});}})['then'](respondWithStatusCode(_0x1eb268,null))[_0x5e5b('0x42')](handleError(_0x1eb268,null));};exports[_0x5e5b('0x93')]=function(_0x93f950,_0x4804c6,_0x2e66fa){var _0x2fb482={};var _0x20956f={};var _0x2f4279;var _0x1e4dd0;return db[_0x5e5b('0x2c')][_0x5e5b('0x5c')]({'where':{'id':_0x93f950[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x4804c6,null))['then'](function(_0x1186b3){if(_0x1186b3){_0x2f4279=_0x1186b3;_0x20956f[_0x5e5b('0x2f')]=_[_0x5e5b('0x31')](db['CmList']['rawAttributes']);_0x20956f[_0x5e5b('0x30')]=_[_0x5e5b('0x31')](_0x93f950[_0x5e5b('0x30')]);_0x20956f[_0x5e5b('0x38')]=_[_0x5e5b('0x32')](_0x20956f[_0x5e5b('0x2f')],_0x20956f[_0x5e5b('0x30')]);_0x2fb482[_0x5e5b('0x33')]=_[_0x5e5b('0x32')](_0x20956f[_0x5e5b('0x2f')],qs[_0x5e5b('0x34')](_0x93f950[_0x5e5b('0x30')][_0x5e5b('0x34')]));_0x2fb482[_0x5e5b('0x33')]=_0x2fb482[_0x5e5b('0x33')][_0x5e5b('0x35')]?_0x2fb482['attributes']:_0x20956f['model'];_0x2fb482['order']=qs[_0x5e5b('0x37')](_0x93f950['query'][_0x5e5b('0x37')]);_0x2fb482['where']=qs[_0x5e5b('0x38')](_[_0x5e5b('0x59')](_0x93f950[_0x5e5b('0x30')],_0x20956f[_0x5e5b('0x38')]));if(_0x93f950['query']['filter']){_0x2fb482[_0x5e5b('0x3d')]=_[_0x5e5b('0x3a')](_0x2fb482[_0x5e5b('0x3d')],{'$or':_[_0x5e5b('0x2b')](_0x2fb482[_0x5e5b('0x33')],function(_0x38025e){var _0x37f714={};_0x37f714[_0x38025e]={'$like':'%'+_0x93f950[_0x5e5b('0x30')]['filter']+'%'};return _0x37f714;})});}_0x2fb482=_[_0x5e5b('0x3a')]({},_0x2fb482,_0x93f950['options']);return _0x2f4279[_0x5e5b('0x93')](_0x2fb482);}})['then'](function(_0x5bfd97){if(_0x5bfd97){_0x1e4dd0=_0x5bfd97[_0x5e5b('0x35')];if(!_0x93f950[_0x5e5b('0x30')]['hasOwnProperty']('nolimit')){_0x2fb482['limit']=qs[_0x5e5b('0x1f')](_0x93f950[_0x5e5b('0x30')][_0x5e5b('0x1f')]);_0x2fb482[_0x5e5b('0x1e')]=qs[_0x5e5b('0x1e')](_0x93f950[_0x5e5b('0x30')][_0x5e5b('0x1e')]);}return _0x2f4279[_0x5e5b('0x93')](_0x2fb482);}})[_0x5e5b('0x26')](function(_0x2301da){if(_0x2301da){return _0x2301da?{'count':_0x1e4dd0,'rows':_0x2301da}:null;}})[_0x5e5b('0x26')](respondWithResult(_0x4804c6,null))['catch'](handleError(_0x4804c6,null));};exports['addBlackLists']=function(_0x1da201,_0x3bee32,_0x185c84){var _0x4b170b,_0x4c1025;var _0x2dddeb=[];var _0x25a887=moment()[_0x5e5b('0x66')](_0x5e5b('0x67'));return db[_0x5e5b('0x2c')][_0x5e5b('0x44')]({'where':{'id':_0x1da201[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x3bee32,null))[_0x5e5b('0x26')](function(_0x15fb75){if(_0x15fb75){_0x4c1025=_0x15fb75;return _0x15fb75[_0x5e5b('0x94')](_0x1da201['body'][_0x5e5b('0x68')],_[_0x5e5b('0x4e')](_0x1da201[_0x5e5b('0x46')],[_0x5e5b('0x68'),'id'])||{});}return null;})[_0x5e5b('0x69')](function(_0x28e0ad){var _0x25495f;var _0xb45473;_0x4b170b=_0x28e0ad||[];var _0x4e7801=[];if(_0x28e0ad){for(var _0x11d758=0x0;_0x11d758<_0x28e0ad[_0x5e5b('0x35')];_0x11d758+=0x1){var _0x5401cc=_0x28e0ad[_0x11d758][_0x5e5b('0x4d')]({'plain':!![]});_0x25495f=squel[_0x5e5b('0x83')]()[_0x5e5b('0x6c')](_0x5e5b('0x95'))[_0x5e5b('0x6d')]([_0x5e5b('0x6e'),_0x5e5b('0x70'),_0x5e5b('0x71'),_0x5e5b('0x5a'),_0x5e5b('0x50'),_0x5e5b('0x4f')],squel[_0x5e5b('0x72')]()['field'](_0x5e5b('0x6e'),_0x5e5b('0x6e'))[_0x5e5b('0x73')]('id',_0x5e5b('0x70'))[_0x5e5b('0x73')](_0x5401cc[_0x5e5b('0x75')]['toString'](),_0x5e5b('0x71'))[_0x5e5b('0x73')](_0x1da201['params']['id'][_0x5e5b('0x76')](),_0x5e5b('0x5a'))[_0x5e5b('0x73')]('NOW()','createdAt')[_0x5e5b('0x73')](_0x5e5b('0x74'),_0x5e5b('0x4f'))['from'](_0x5e5b('0x78'))[_0x5e5b('0x3d')]('deletedAt\x20IS\x20NULL')['where'](_0x5e5b('0x7a'),_0x5401cc[_0x5e5b('0x75')][_0x5e5b('0x76')]())['where'](_0x5e5b('0x7b')))[_0x5e5b('0x76')]();_0x4e7801[_0x5e5b('0x8f')](db['sequelize'][_0x5e5b('0x30')](_0x25495f));}return BPromise[_0x5e5b('0x91')](_0x4e7801);}})['then'](function(){return _0x4b170b;})[_0x5e5b('0x26')](respondWithResult(_0x3bee32,null))['catch'](handleError(_0x3bee32,null));};exports['removeBlackLists']=function(_0x32a261,_0x5ef810,_0x407a96){return db['Campaign']['find']({'where':{'id':_0x32a261['params']['id']}})[_0x5e5b('0x26')](handleEntityNotFound(_0x5ef810,null))[_0x5e5b('0x26')](function(_0x6b0cae){if(_0x6b0cae){return _0x6b0cae[_0x5e5b('0x96')](_0x32a261['query']['ids']);}})[_0x5e5b('0x26')](function(_0x49d076){if(_0x49d076){return db[_0x5e5b('0x61')][_0x5e5b('0x55')]({'where':{'ListId':_0x32a261['query'][_0x5e5b('0x68')],'CampaignId':_0x32a261[_0x5e5b('0x43')]['id']}})[_0x5e5b('0x26')](function(){return _0x49d076;});}})[_0x5e5b('0x26')](respondWithStatusCode(_0x5ef810,null))[_0x5e5b('0x42')](handleError(_0x5ef810,null));};
\ No newline at end of file
+var _0x9d26=['intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','rows','params','length','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','CampaignId','findAll','getHopperHistories','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','fromQuery','scheduledAt','ContactId','ListId','select','phone','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','insert','into','NOW()','cm_hopper_additional_phones','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','ids','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','send','Campaign','rawAttributes','type','key','model','map','query','keys','filters','attributes'];(function(_0x30986c,_0x39ce58){var _0x57c209=function(_0x557c36){while(--_0x557c36){_0x30986c['push'](_0x30986c['shift']());}};_0x57c209(++_0x39ce58);}(_0x9d26,0x17d));var _0x69d2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9d26[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x69d2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x69d2('0x1'));var jsonpatch=require(_0x69d2('0x2'));var rp=require(_0x69d2('0x3'));var moment=require(_0x69d2('0x4'));var BPromise=require(_0x69d2('0x5'));var Mustache=require('mustache');var util=require(_0x69d2('0x6'));var path=require('path');var sox=require(_0x69d2('0x7'));var csv=require(_0x69d2('0x8'));var ejs=require(_0x69d2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69d2('0xa'));var squel=require(_0x69d2('0xb'));var crypto=require(_0x69d2('0xc'));var jsforce=require(_0x69d2('0xd'));var deskjs=require(_0x69d2('0xe'));var toCsv=require(_0x69d2('0x8'));var querystring=require(_0x69d2('0xf'));var Papa=require(_0x69d2('0x10'));var Redis=require(_0x69d2('0x11'));var authService=require(_0x69d2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x69d2('0x13'));var hardwareService=require(_0x69d2('0x14'));var logger=require(_0x69d2('0x15'))(_0x69d2('0x16'));var utils=require(_0x69d2('0x17'));var config=require(_0x69d2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x69d2('0x19'))['db'];function respondWithStatusCode(_0x372181,_0x31093c){_0x31093c=_0x31093c||0xcc;return function(_0x21379a){if(_0x21379a){return _0x372181[_0x69d2('0x1a')](_0x31093c);}return _0x372181[_0x69d2('0x1b')](_0x31093c)[_0x69d2('0x1c')]();};}function respondWithResult(_0x2b91be,_0x510f1e){_0x510f1e=_0x510f1e||0xc8;return function(_0x3a4a66){if(_0x3a4a66){return _0x2b91be[_0x69d2('0x1b')](_0x510f1e)['json'](_0x3a4a66);}};}function respondWithFilteredResult(_0x41ed13,_0x1e0013){return function(_0x1b169f){if(_0x1b169f){var _0x4b45b7=typeof _0x1e0013['offset']==='undefined'&&typeof _0x1e0013[_0x69d2('0x1d')]===_0x69d2('0x1e');var _0x2d65a3=_0x1b169f[_0x69d2('0x1f')];var _0xc38f9=_0x4b45b7?0x0:_0x1e0013[_0x69d2('0x20')];var _0x36f445=_0x4b45b7?_0x1b169f[_0x69d2('0x1f')]:_0x1e0013[_0x69d2('0x20')]+_0x1e0013[_0x69d2('0x1d')];var _0x372e7c;if(_0x36f445>=_0x2d65a3){_0x36f445=_0x2d65a3;_0x372e7c=0xc8;}else{_0x372e7c=0xce;}_0x41ed13[_0x69d2('0x1b')](_0x372e7c);return _0x41ed13[_0x69d2('0x21')](_0x69d2('0x22'),_0xc38f9+'-'+_0x36f445+'/'+_0x2d65a3)['json'](_0x1b169f);}return null;};}function patchUpdates(_0x459dbd){return function(_0x4a20ec){try{jsonpatch[_0x69d2('0x23')](_0x4a20ec,_0x459dbd,!![]);}catch(_0x3e2d05){return BPromise[_0x69d2('0x24')](_0x3e2d05);}return _0x4a20ec[_0x69d2('0x25')]();};}function saveUpdates(_0x240723,_0x234bb3){return function(_0x2327ef){if(_0x2327ef){return _0x2327ef[_0x69d2('0x26')](_0x240723)[_0x69d2('0x27')](function(_0x35fff6){return _0x35fff6;});}return null;};}function removeEntity(_0x25550c,_0x44f9ac){return function(_0xd4a95f){if(_0xd4a95f){return _0xd4a95f[_0x69d2('0x28')]()['then'](function(){var _0x115e46=_0xd4a95f[_0x69d2('0x29')]({'plain':!![]});var _0x563c5f=_0x69d2('0x2a');return db[_0x69d2('0x2b')]['destroy']({'where':{'type':_0x563c5f,'resourceId':_0x115e46['id']}})[_0x69d2('0x27')](function(){return _0xd4a95f;});})[_0x69d2('0x27')](function(){_0x25550c[_0x69d2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ca4ae,_0x2f6e7a){return function(_0x474268){if(!_0x474268){_0x4ca4ae[_0x69d2('0x1a')](0x194);}return _0x474268;};}function handleError(_0x410418,_0xa680d7){_0xa680d7=_0xa680d7||0x1f4;return function(_0x22a1ad){logger[_0x69d2('0x2c')](_0x22a1ad['stack']);if(_0x22a1ad['name']){delete _0x22a1ad[_0x69d2('0x2d')];}_0x410418[_0x69d2('0x1b')](_0xa680d7)[_0x69d2('0x2e')](_0x22a1ad);};}exports['index']=function(_0xe8e147,_0x25bc5e){var _0x5349f0={},_0x1c237d={},_0x478e16={'count':0x0,'rows':[]};var _0x4d8831=_['map'](db[_0x69d2('0x2f')][_0x69d2('0x30')],function(_0x3a335b){return{'name':_0x3a335b['fieldName'],'type':_0x3a335b[_0x69d2('0x31')][_0x69d2('0x32')]};});_0x1c237d[_0x69d2('0x33')]=_[_0x69d2('0x34')](_0x4d8831,'name');_0x1c237d[_0x69d2('0x35')]=_[_0x69d2('0x36')](_0xe8e147[_0x69d2('0x35')]);_0x1c237d[_0x69d2('0x37')]=_['intersection'](_0x1c237d[_0x69d2('0x33')],_0x1c237d[_0x69d2('0x35')]);_0x5349f0[_0x69d2('0x38')]=_[_0x69d2('0x39')](_0x1c237d[_0x69d2('0x33')],qs[_0x69d2('0x3a')](_0xe8e147[_0x69d2('0x35')][_0x69d2('0x3a')]));_0x5349f0[_0x69d2('0x38')]=_0x5349f0[_0x69d2('0x38')]['length']?_0x5349f0['attributes']:_0x1c237d[_0x69d2('0x33')];if(!_0xe8e147['query'][_0x69d2('0x3b')](_0x69d2('0x3c'))){_0x5349f0[_0x69d2('0x1d')]=qs[_0x69d2('0x1d')](_0xe8e147[_0x69d2('0x35')][_0x69d2('0x1d')]);_0x5349f0['offset']=qs[_0x69d2('0x20')](_0xe8e147[_0x69d2('0x35')][_0x69d2('0x20')]);}_0x5349f0[_0x69d2('0x3d')]=qs[_0x69d2('0x3e')](_0xe8e147[_0x69d2('0x35')]['sort']);_0x5349f0['where']=qs[_0x69d2('0x37')](_[_0x69d2('0x3f')](_0xe8e147['query'],_0x1c237d[_0x69d2('0x37')]),_0x4d8831);if(_0xe8e147[_0x69d2('0x35')]['filter']){_0x5349f0[_0x69d2('0x40')]=_['merge'](_0x5349f0['where'],{'$or':_[_0x69d2('0x34')](_0x4d8831,function(_0x396e2){if(_0x396e2[_0x69d2('0x31')]!==_0x69d2('0x41')){var _0x36f615={};_0x36f615[_0x396e2['name']]={'$like':'%'+_0xe8e147[_0x69d2('0x35')][_0x69d2('0x42')]+'%'};return _0x36f615;}})});}_0x5349f0=_[_0x69d2('0x43')]({},_0x5349f0,_0xe8e147[_0x69d2('0x44')]);var _0x20fcd7={'where':_0x5349f0['where']};return db[_0x69d2('0x2f')][_0x69d2('0x1f')](_0x20fcd7)[_0x69d2('0x27')](function(_0x266483){_0x478e16[_0x69d2('0x1f')]=_0x266483;if(_0xe8e147['query'][_0x69d2('0x45')]){_0x5349f0['include']=[{'all':!![]}];}return db[_0x69d2('0x2f')]['findAll'](_0x5349f0);})['then'](function(_0x2df0b2){_0x478e16[_0x69d2('0x46')]=_0x2df0b2;return _0x478e16;})[_0x69d2('0x27')](respondWithFilteredResult(_0x25bc5e,_0x5349f0))['catch'](handleError(_0x25bc5e,null));};exports['show']=function(_0x3fa70f,_0x4d58ca){var _0x4e95be={'raw':![],'where':{'id':_0x3fa70f[_0x69d2('0x47')]['id']}},_0x3d5ca8={};_0x3d5ca8[_0x69d2('0x33')]=_[_0x69d2('0x36')](db[_0x69d2('0x2f')][_0x69d2('0x30')]);_0x3d5ca8['query']=_[_0x69d2('0x36')](_0x3fa70f[_0x69d2('0x35')]);_0x3d5ca8[_0x69d2('0x37')]=_[_0x69d2('0x39')](_0x3d5ca8[_0x69d2('0x33')],_0x3d5ca8[_0x69d2('0x35')]);_0x4e95be[_0x69d2('0x38')]=_[_0x69d2('0x39')](_0x3d5ca8['model'],qs[_0x69d2('0x3a')](_0x3fa70f[_0x69d2('0x35')][_0x69d2('0x3a')]));_0x4e95be[_0x69d2('0x38')]=_0x4e95be[_0x69d2('0x38')][_0x69d2('0x48')]?_0x4e95be[_0x69d2('0x38')]:_0x3d5ca8['model'];if(_0x3fa70f[_0x69d2('0x35')][_0x69d2('0x45')]){_0x4e95be[_0x69d2('0x49')]=[{'all':!![]}];}_0x4e95be=_['merge']({},_0x4e95be,_0x3fa70f[_0x69d2('0x44')]);return db[_0x69d2('0x2f')][_0x69d2('0x4a')](_0x4e95be)[_0x69d2('0x27')](handleEntityNotFound(_0x4d58ca,null))['then'](respondWithResult(_0x4d58ca,null))[_0x69d2('0x4b')](handleError(_0x4d58ca,null));};exports[_0x69d2('0x4c')]=function(_0x5c4a6d,_0x40db70){return db[_0x69d2('0x2f')]['create'](_0x5c4a6d[_0x69d2('0x4d')],{})[_0x69d2('0x27')](function(_0x67d8af){var _0x80fcbd=_0x5c4a6d['user'][_0x69d2('0x29')]({'plain':!![]});if(!_0x80fcbd)throw new Error(_0x69d2('0x4e'));if(_0x80fcbd[_0x69d2('0x4f')]===_0x69d2('0x50')){var _0x581923=_0x67d8af[_0x69d2('0x29')]({'plain':!![]});var _0x29ebc9=_0x69d2('0x2a');return db[_0x69d2('0x51')][_0x69d2('0x4a')]({'where':{'name':_0x29ebc9,'userProfileId':_0x80fcbd[_0x69d2('0x52')]},'raw':!![]})[_0x69d2('0x27')](function(_0x17f448){if(_0x17f448&&_0x17f448[_0x69d2('0x53')]===0x0){return db['UserProfileResource'][_0x69d2('0x4c')]({'name':_0x581923[_0x69d2('0x2d')],'resourceId':_0x581923['id'],'type':_0x17f448[_0x69d2('0x2d')],'sectionId':_0x17f448['id']},{})[_0x69d2('0x27')](function(){return _0x67d8af;});}else{return _0x67d8af;}})[_0x69d2('0x4b')](function(_0x58ee5f){logger[_0x69d2('0x2c')](_0x69d2('0x54'),_0x58ee5f);throw _0x58ee5f;});}return _0x67d8af;})[_0x69d2('0x27')](respondWithResult(_0x40db70,0xc9))[_0x69d2('0x4b')](handleError(_0x40db70,null));};exports[_0x69d2('0x55')]=function(_0x54af82,_0x230388){var _0x4eb84b={'where':{'id':_0x54af82[_0x69d2('0x47')]['id']}},_0x410c31={};_0x410c31[_0x69d2('0x33')]=_['keys'](db[_0x69d2('0x2f')][_0x69d2('0x30')]);_0x4eb84b[_0x69d2('0x38')]=_[_0x69d2('0x39')](_0x410c31['model'],qs[_0x69d2('0x3a')](_0x54af82[_0x69d2('0x35')][_0x69d2('0x3a')]));_0x4eb84b[_0x69d2('0x38')]=_0x4eb84b[_0x69d2('0x38')][_0x69d2('0x48')]?_0x4eb84b[_0x69d2('0x38')]:_0x410c31[_0x69d2('0x33')];if(_0x54af82[_0x69d2('0x35')]['includeAll']){_0x4eb84b[_0x69d2('0x49')]=[{'all':!![]}];}_0x4eb84b=_[_0x69d2('0x43')]({},_0x4eb84b,_0x54af82[_0x69d2('0x44')]);return db[_0x69d2('0x2f')][_0x69d2('0x4a')](_0x4eb84b)[_0x69d2('0x27')](handleEntityNotFound(_0x230388,null))['then'](function(_0x1957da){if(_0x1957da){var _0x74e01f=_0x1957da[_0x69d2('0x29')]({'plain':!![]});_0x74e01f=qs[_0x69d2('0x56')](_0x74e01f,['id',_0x69d2('0x57'),_0x69d2('0x58')]);_0x54af82[_0x69d2('0x4d')]=_[_0x69d2('0x56')](_0x54af82[_0x69d2('0x4d')],['id',_0x69d2('0x57'),_0x69d2('0x58')]);return db[_0x69d2('0x2f')][_0x69d2('0x4c')](_[_0x69d2('0x43')](_0x74e01f,_0x54af82[_0x69d2('0x4d')]),{'include':_0x54af82[_0x69d2('0x35')][_0x69d2('0x45')]?[{'all':!![]}]:undefined})[_0x69d2('0x27')](function(_0x12ba41){var _0x1d3cc1=_0x54af82[_0x69d2('0x50')]['get']({'plain':!![]});if(!_0x1d3cc1)throw new Error(_0x69d2('0x4e'));if(_0x1d3cc1[_0x69d2('0x4f')]===_0x69d2('0x50')){var _0x2938e1=_0x12ba41[_0x69d2('0x29')]({'plain':!![]});var _0x5de2a7=_0x69d2('0x2a');return db[_0x69d2('0x51')][_0x69d2('0x4a')]({'where':{'name':_0x5de2a7,'userProfileId':_0x1d3cc1[_0x69d2('0x52')]},'raw':!![]})[_0x69d2('0x27')](function(_0x46599b){if(_0x46599b&&_0x46599b[_0x69d2('0x53')]===0x0){return db['UserProfileResource'][_0x69d2('0x4c')]({'name':_0x2938e1[_0x69d2('0x2d')],'resourceId':_0x2938e1['id'],'type':_0x46599b[_0x69d2('0x2d')],'sectionId':_0x46599b['id']},{})[_0x69d2('0x27')](function(){return _0x12ba41;});}else{return _0x12ba41;}})[_0x69d2('0x4b')](function(_0x51c226){logger[_0x69d2('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51c226);throw _0x51c226;});}return _0x12ba41;});}})[_0x69d2('0x27')](respondWithResult(_0x230388,0xc9))[_0x69d2('0x4b')](handleError(_0x230388,null));};exports[_0x69d2('0x26')]=function(_0xeb8f9b,_0x4ecbb3){if(_0xeb8f9b['body']['id']){delete _0xeb8f9b[_0x69d2('0x4d')]['id'];}return db[_0x69d2('0x2f')]['find']({'where':{'id':_0xeb8f9b[_0x69d2('0x47')]['id']}})[_0x69d2('0x27')](handleEntityNotFound(_0x4ecbb3,null))[_0x69d2('0x27')](saveUpdates(_0xeb8f9b['body'],null))[_0x69d2('0x27')](respondWithResult(_0x4ecbb3,null))[_0x69d2('0x4b')](handleError(_0x4ecbb3,null));};exports['destroy']=function(_0x47e48f,_0x524e12){return db[_0x69d2('0x2f')][_0x69d2('0x4a')]({'where':{'id':_0x47e48f[_0x69d2('0x47')]['id']}})[_0x69d2('0x27')](handleEntityNotFound(_0x524e12,null))[_0x69d2('0x27')](removeEntity(_0x524e12,null))[_0x69d2('0x4b')](handleError(_0x524e12,null));};exports[_0x69d2('0x59')]=function(_0x33f213,_0x62ead,_0x115986){var _0x504a42={'raw':!![],'where':{}};var _0x49ce4f={};var _0x575fea={'count':0x0,'rows':[]};return db['Campaign'][_0x69d2('0x5a')]({'where':{'id':_0x33f213[_0x69d2('0x47')]['id']}})[_0x69d2('0x27')](handleEntityNotFound(_0x62ead,null))['then'](function(_0x31ab91){if(_0x31ab91){_0x49ce4f[_0x69d2('0x33')]=_[_0x69d2('0x36')](db[_0x69d2('0x5b')][_0x69d2('0x30')]);_0x49ce4f['query']=_['keys'](_0x33f213[_0x69d2('0x35')]);_0x49ce4f[_0x69d2('0x37')]=_[_0x69d2('0x39')](_0x49ce4f[_0x69d2('0x33')],_0x49ce4f[_0x69d2('0x35')]);_0x504a42[_0x69d2('0x38')]=_[_0x69d2('0x39')](_0x49ce4f[_0x69d2('0x33')],qs[_0x69d2('0x3a')](_0x33f213[_0x69d2('0x35')][_0x69d2('0x3a')]));_0x504a42[_0x69d2('0x38')]=_0x504a42[_0x69d2('0x38')][_0x69d2('0x48')]?_0x504a42[_0x69d2('0x38')]:_0x49ce4f[_0x69d2('0x33')];if(!_0x33f213[_0x69d2('0x35')][_0x69d2('0x3b')](_0x69d2('0x3c'))){_0x504a42[_0x69d2('0x1d')]=qs[_0x69d2('0x1d')](_0x33f213['query'][_0x69d2('0x1d')]);_0x504a42['offset']=qs[_0x69d2('0x20')](_0x33f213[_0x69d2('0x35')][_0x69d2('0x20')]);}_0x504a42[_0x69d2('0x3d')]=qs[_0x69d2('0x3e')](_0x33f213[_0x69d2('0x35')][_0x69d2('0x3e')]);_0x504a42[_0x69d2('0x40')]=qs[_0x69d2('0x37')](_[_0x69d2('0x3f')](_0x33f213['query'],_0x49ce4f['filters']));_0x504a42['where'][_0x69d2('0x5c')]=_0x31ab91['id'];if(_0x33f213['query'][_0x69d2('0x42')]){_0x504a42[_0x69d2('0x40')]=_[_0x69d2('0x43')](_0x504a42[_0x69d2('0x40')],{'$or':_[_0x69d2('0x34')](_0x504a42['attributes'],function(_0x334a8a){var _0x4c6c90={};_0x4c6c90[_0x334a8a]={'$like':'%'+_0x33f213[_0x69d2('0x35')][_0x69d2('0x42')]+'%'};return _0x4c6c90;})});}_0x504a42=_[_0x69d2('0x43')]({},_0x504a42,_0x33f213[_0x69d2('0x44')]);return db[_0x69d2('0x5b')]['count']({'where':_0x504a42[_0x69d2('0x40')]})[_0x69d2('0x27')](function(_0x4f0618){_0x575fea[_0x69d2('0x1f')]=_0x4f0618;if(_0x33f213[_0x69d2('0x35')][_0x69d2('0x45')]){_0x504a42[_0x69d2('0x49')]=[{'all':!![]}];}return db['CmHopper'][_0x69d2('0x5d')](_0x504a42);})[_0x69d2('0x27')](function(_0x36de48){_0x575fea['rows']=_0x36de48;return _0x575fea;});}})[_0x69d2('0x27')](respondWithFilteredResult(_0x62ead,_0x504a42))[_0x69d2('0x4b')](handleError(_0x62ead,null));};exports[_0x69d2('0x5e')]=function(_0x4601e5,_0x2aa92d,_0x3f023f){var _0x2d749f={'raw':!![],'where':{}};var _0x512748={};var _0x51e5b6={'count':0x0,'rows':[]};return db[_0x69d2('0x2f')][_0x69d2('0x5a')]({'where':{'id':_0x4601e5[_0x69d2('0x47')]['id']}})[_0x69d2('0x27')](handleEntityNotFound(_0x2aa92d,null))['then'](function(_0x4a0617){if(_0x4a0617){_0x512748[_0x69d2('0x33')]=_[_0x69d2('0x36')](db['CmHopperHistory'][_0x69d2('0x30')]);_0x512748[_0x69d2('0x35')]=_[_0x69d2('0x36')](_0x4601e5[_0x69d2('0x35')]);_0x512748[_0x69d2('0x37')]=_[_0x69d2('0x39')](_0x512748[_0x69d2('0x33')],_0x512748['query']);_0x2d749f[_0x69d2('0x38')]=_['intersection'](_0x512748[_0x69d2('0x33')],qs[_0x69d2('0x3a')](_0x4601e5['query']['fields']));_0x2d749f[_0x69d2('0x38')]=_0x2d749f[_0x69d2('0x38')][_0x69d2('0x48')]?_0x2d749f[_0x69d2('0x38')]:_0x512748[_0x69d2('0x33')];if(!_0x4601e5['query'][_0x69d2('0x3b')](_0x69d2('0x3c'))){_0x2d749f[_0x69d2('0x1d')]=qs[_0x69d2('0x1d')](_0x4601e5[_0x69d2('0x35')]['limit']);_0x2d749f[_0x69d2('0x20')]=qs[_0x69d2('0x20')](_0x4601e5['query'][_0x69d2('0x20')]);}_0x2d749f[_0x69d2('0x3d')]=qs['sort'](_0x4601e5['query'][_0x69d2('0x3e')]);_0x2d749f[_0x69d2('0x40')]=qs[_0x69d2('0x37')](_['pick'](_0x4601e5[_0x69d2('0x35')],_0x512748[_0x69d2('0x37')]));_0x2d749f[_0x69d2('0x40')][_0x69d2('0x5c')]=_0x4a0617['id'];if(_0x4601e5['query'][_0x69d2('0x42')]){_0x2d749f[_0x69d2('0x40')]=_[_0x69d2('0x43')](_0x2d749f[_0x69d2('0x40')],{'$or':_['map'](_0x2d749f[_0x69d2('0x38')],function(_0x17e2e0){var _0x4e2e63={};_0x4e2e63[_0x17e2e0]={'$like':'%'+_0x4601e5[_0x69d2('0x35')]['filter']+'%'};return _0x4e2e63;})});}_0x2d749f=_['merge']({},_0x2d749f,_0x4601e5['options']);return db['CmHopperHistory'][_0x69d2('0x1f')]({'where':_0x2d749f[_0x69d2('0x40')]})['then'](function(_0x18f008){_0x51e5b6['count']=_0x18f008;if(_0x4601e5['query'][_0x69d2('0x45')]){_0x2d749f[_0x69d2('0x49')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x69d2('0x5d')](_0x2d749f);})['then'](function(_0x51799e){_0x51e5b6['rows']=_0x51799e;return _0x51e5b6;});}})[_0x69d2('0x27')](respondWithFilteredResult(_0x2aa92d,_0x2d749f))['catch'](handleError(_0x2aa92d,null));};exports[_0x69d2('0x5f')]=function(_0x1c6e12,_0x3eed6c,_0x1225e2){var _0x105ac1={'raw':!![],'where':{}};var _0x2c1d53={};var _0x4633ae={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x1c6e12[_0x69d2('0x47')]['id']}})[_0x69d2('0x27')](handleEntityNotFound(_0x3eed6c,null))[_0x69d2('0x27')](function(_0x189036){if(_0x189036){_0x2c1d53[_0x69d2('0x33')]=_[_0x69d2('0x36')](db[_0x69d2('0x60')][_0x69d2('0x30')]);_0x2c1d53['query']=_[_0x69d2('0x36')](_0x1c6e12[_0x69d2('0x35')]);_0x2c1d53['filters']=_['intersection'](_0x2c1d53['model'],_0x2c1d53[_0x69d2('0x35')]);_0x105ac1[_0x69d2('0x38')]=_[_0x69d2('0x39')](_0x2c1d53['model'],qs[_0x69d2('0x3a')](_0x1c6e12[_0x69d2('0x35')][_0x69d2('0x3a')]));_0x105ac1[_0x69d2('0x38')]=_0x105ac1['attributes'][_0x69d2('0x48')]?_0x105ac1[_0x69d2('0x38')]:_0x2c1d53[_0x69d2('0x33')];if(!_0x1c6e12[_0x69d2('0x35')][_0x69d2('0x3b')](_0x69d2('0x3c'))){_0x105ac1[_0x69d2('0x1d')]=qs[_0x69d2('0x1d')](_0x1c6e12['query']['limit']);_0x105ac1[_0x69d2('0x20')]=qs['offset'](_0x1c6e12[_0x69d2('0x35')]['offset']);}_0x105ac1[_0x69d2('0x3d')]=qs[_0x69d2('0x3e')](_0x1c6e12[_0x69d2('0x35')]['sort']);_0x105ac1['where']=qs[_0x69d2('0x37')](_[_0x69d2('0x3f')](_0x1c6e12['query'],_0x2c1d53[_0x69d2('0x37')]));_0x105ac1[_0x69d2('0x40')][_0x69d2('0x5c')]=_0x189036['id'];if(_0x1c6e12['query']['filter']){_0x105ac1[_0x69d2('0x40')]=_[_0x69d2('0x43')](_0x105ac1[_0x69d2('0x40')],{'$or':_[_0x69d2('0x34')](_0x105ac1[_0x69d2('0x38')],function(_0x3b0b8e){var _0x3bfe0e={};_0x3bfe0e[_0x3b0b8e]={'$like':'%'+_0x1c6e12[_0x69d2('0x35')][_0x69d2('0x42')]+'%'};return _0x3bfe0e;})});}_0x105ac1=_[_0x69d2('0x43')]({},_0x105ac1,_0x1c6e12[_0x69d2('0x44')]);return db['CmHopperFinal'][_0x69d2('0x1f')]({'where':_0x105ac1[_0x69d2('0x40')]})[_0x69d2('0x27')](function(_0x3b35bf){_0x4633ae[_0x69d2('0x1f')]=_0x3b35bf;if(_0x1c6e12['query']['includeAll']){_0x105ac1[_0x69d2('0x49')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x69d2('0x5d')](_0x105ac1);})[_0x69d2('0x27')](function(_0x1292d9){_0x4633ae['rows']=_0x1292d9;return _0x4633ae;});}})['then'](respondWithFilteredResult(_0x3eed6c,_0x105ac1))[_0x69d2('0x4b')](handleError(_0x3eed6c,null));};exports[_0x69d2('0x61')]=function(_0x45c534,_0x1ee037,_0x377dcd){var _0x5df7b9={'raw':!![],'where':{}};var _0xfe2b3b={};var _0x1b3b1f={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x45c534[_0x69d2('0x47')]['id']}})[_0x69d2('0x27')](handleEntityNotFound(_0x1ee037,null))[_0x69d2('0x27')](function(_0x34bce9){if(_0x34bce9){_0xfe2b3b['model']=_[_0x69d2('0x36')](db[_0x69d2('0x62')][_0x69d2('0x30')]);_0xfe2b3b[_0x69d2('0x35')]=_[_0x69d2('0x36')](_0x45c534[_0x69d2('0x35')]);_0xfe2b3b[_0x69d2('0x37')]=_['intersection'](_0xfe2b3b[_0x69d2('0x33')],_0xfe2b3b[_0x69d2('0x35')]);_0x5df7b9['attributes']=_[_0x69d2('0x39')](_0xfe2b3b[_0x69d2('0x33')],qs[_0x69d2('0x3a')](_0x45c534[_0x69d2('0x35')][_0x69d2('0x3a')]));_0x5df7b9[_0x69d2('0x38')]=_0x5df7b9[_0x69d2('0x38')]['length']?_0x5df7b9[_0x69d2('0x38')]:_0xfe2b3b[_0x69d2('0x33')];if(!_0x45c534[_0x69d2('0x35')][_0x69d2('0x3b')]('nolimit')){_0x5df7b9['limit']=qs[_0x69d2('0x1d')](_0x45c534[_0x69d2('0x35')][_0x69d2('0x1d')]);_0x5df7b9['offset']=qs[_0x69d2('0x20')](_0x45c534[_0x69d2('0x35')][_0x69d2('0x20')]);}_0x5df7b9[_0x69d2('0x3d')]=qs[_0x69d2('0x3e')](_0x45c534['query'][_0x69d2('0x3e')]);_0x5df7b9['where']=qs[_0x69d2('0x37')](_['pick'](_0x45c534[_0x69d2('0x35')],_0xfe2b3b[_0x69d2('0x37')]));_0x5df7b9['where'][_0x69d2('0x5c')]=_0x34bce9['id'];if(_0x45c534[_0x69d2('0x35')][_0x69d2('0x42')]){_0x5df7b9['where']=_[_0x69d2('0x43')](_0x5df7b9['where'],{'$or':_[_0x69d2('0x34')](_0x5df7b9[_0x69d2('0x38')],function(_0x3a43e4){var _0x3d897f={};_0x3d897f[_0x3a43e4]={'$like':'%'+_0x45c534[_0x69d2('0x35')][_0x69d2('0x42')]+'%'};return _0x3d897f;})});}_0x5df7b9=_[_0x69d2('0x43')]({},_0x5df7b9,_0x45c534[_0x69d2('0x44')]);return db[_0x69d2('0x62')][_0x69d2('0x1f')]({'where':_0x5df7b9['where']})['then'](function(_0x32307b){_0x1b3b1f[_0x69d2('0x1f')]=_0x32307b;if(_0x45c534[_0x69d2('0x35')][_0x69d2('0x45')]){_0x5df7b9[_0x69d2('0x49')]=[{'all':!![]}];}return db[_0x69d2('0x62')][_0x69d2('0x5d')](_0x5df7b9);})[_0x69d2('0x27')](function(_0x10b896){_0x1b3b1f[_0x69d2('0x46')]=_0x10b896;return _0x1b3b1f;});}})['then'](respondWithFilteredResult(_0x1ee037,_0x5df7b9))[_0x69d2('0x4b')](handleError(_0x1ee037,null));};exports[_0x69d2('0x63')]=function(_0x35144d,_0x30f318,_0x4068d3){var _0x19a591={};var _0x44150b={};var _0x213e00;var _0x22f3af;return db[_0x69d2('0x2f')][_0x69d2('0x5a')]({'where':{'id':_0x35144d['params']['id']}})[_0x69d2('0x27')](handleEntityNotFound(_0x30f318,null))[_0x69d2('0x27')](function(_0x58d5e0){if(_0x58d5e0){_0x213e00=_0x58d5e0;_0x44150b[_0x69d2('0x33')]=_[_0x69d2('0x36')](db[_0x69d2('0x64')]['rawAttributes']);_0x44150b[_0x69d2('0x35')]=_[_0x69d2('0x36')](_0x35144d[_0x69d2('0x35')]);_0x44150b[_0x69d2('0x37')]=_[_0x69d2('0x39')](_0x44150b[_0x69d2('0x33')],_0x44150b[_0x69d2('0x35')]);_0x19a591[_0x69d2('0x38')]=_[_0x69d2('0x39')](_0x44150b[_0x69d2('0x33')],qs[_0x69d2('0x3a')](_0x35144d[_0x69d2('0x35')][_0x69d2('0x3a')]));_0x19a591['attributes']=_0x19a591[_0x69d2('0x38')][_0x69d2('0x48')]?_0x19a591[_0x69d2('0x38')]:_0x44150b['model'];_0x19a591[_0x69d2('0x3d')]=qs[_0x69d2('0x3e')](_0x35144d['query']['sort']);_0x19a591[_0x69d2('0x40')]=qs[_0x69d2('0x37')](_['pick'](_0x35144d['query'],_0x44150b[_0x69d2('0x37')]));if(_0x35144d[_0x69d2('0x35')]['filter']){_0x19a591[_0x69d2('0x40')]=_[_0x69d2('0x43')](_0x19a591['where'],{'$or':_[_0x69d2('0x34')](_0x19a591[_0x69d2('0x38')],function(_0x44ea0d){var _0x4b9cb2={};_0x4b9cb2[_0x44ea0d]={'$like':'%'+_0x35144d[_0x69d2('0x35')][_0x69d2('0x42')]+'%'};return _0x4b9cb2;})});}_0x19a591=_[_0x69d2('0x43')]({},_0x19a591,_0x35144d[_0x69d2('0x44')]);return _0x213e00['getLists'](_0x19a591);}})['then'](function(_0x3c8bd7){if(_0x3c8bd7){_0x22f3af=_0x3c8bd7[_0x69d2('0x48')];if(!_0x35144d['query'][_0x69d2('0x3b')](_0x69d2('0x3c'))){_0x19a591['limit']=qs[_0x69d2('0x1d')](_0x35144d['query'][_0x69d2('0x1d')]);_0x19a591[_0x69d2('0x20')]=qs[_0x69d2('0x20')](_0x35144d['query']['offset']);}return _0x213e00[_0x69d2('0x63')](_0x19a591);}})[_0x69d2('0x27')](function(_0x342193){if(_0x342193){return _0x342193?{'count':_0x22f3af,'rows':_0x342193}:null;}})[_0x69d2('0x27')](respondWithResult(_0x30f318,null))[_0x69d2('0x4b')](handleError(_0x30f318,null));};exports[_0x69d2('0x65')]=function(_0x49215b,_0x57201d,_0x4fb049){var _0x28cacb,_0x268d2d;var _0x56ebe4=[];var _0x54c6bb=moment()[_0x69d2('0x66')](_0x69d2('0x67'));return db[_0x69d2('0x2f')]['find']({'where':{'id':_0x49215b[_0x69d2('0x47')]['id']}})['then'](handleEntityNotFound(_0x57201d,null))[_0x69d2('0x27')](function(_0x292d11){if(_0x292d11){_0x268d2d=_0x292d11;return _0x292d11['addLists'](_0x49215b[_0x69d2('0x4d')]['ids'],_[_0x69d2('0x56')](_0x49215b[_0x69d2('0x4d')],['ids','id'])||{});}return null;})[_0x69d2('0x68')](function(_0x4e3a9d){var _0x384cbe;var _0x3c2532;_0x28cacb=_0x4e3a9d||[];var _0x4b2ede=[];if(_0x4e3a9d){for(var _0x4b266a=0x0;_0x4b266a<_0x4e3a9d['length'];_0x4b266a+=0x1){var _0xfd0a13=_0x4e3a9d[_0x4b266a][_0x69d2('0x29')]({'plain':!![]});_0x268d2d['dialCheckDuplicateType']=_0x49215b[_0x69d2('0x4d')][_0x69d2('0x69')]?_0x49215b[_0x69d2('0x4d')][_0x69d2('0x69')]:_0x268d2d[_0x69d2('0x69')];switch(_0x268d2d[_0x69d2('0x69')]){case _0x69d2('0x6a'):_0x384cbe=squel['insert']()['into']('cm_hopper')[_0x69d2('0x6b')](['phone',_0x69d2('0x6c'),_0x69d2('0x6d'),_0x69d2('0x6e'),_0x69d2('0x5c'),_0x69d2('0x57'),_0x69d2('0x58')],squel[_0x69d2('0x6f')]()['field'](_0x69d2('0x70'),_0x69d2('0x70'))['field']('NOW()','scheduledAt')['field']('id',_0x69d2('0x6d'))[_0x69d2('0x71')](_0xfd0a13[_0x69d2('0x72')][_0x69d2('0x73')](),_0x69d2('0x6e'))[_0x69d2('0x71')](_0x49215b[_0x69d2('0x47')]['id'][_0x69d2('0x73')](),_0x69d2('0x5c'))[_0x69d2('0x71')]('\x27'+_0x54c6bb+'\x27',_0x69d2('0x57'))[_0x69d2('0x71')]('\x27'+_0x54c6bb+'\x27',_0x69d2('0x58'))[_0x69d2('0x74')](_0x69d2('0x75'))['where'](_0x69d2('0x76'))[_0x69d2('0x40')](_0x69d2('0x77'),_0xfd0a13[_0x69d2('0x72')][_0x69d2('0x73')]())[_0x69d2('0x40')](_0x69d2('0x78'))[_0x69d2('0x40')](_0x69d2('0x79'),squel[_0x69d2('0x6f')]()[_0x69d2('0x71')]('COALESCE(calleridnum,\x27\x27)')[_0x69d2('0x74')](_0x69d2('0x7a'))[_0x69d2('0x40')](_0x69d2('0x7b'),_0x49215b['params']['id'][_0x69d2('0x73')]()))[_0x69d2('0x40')](_0x69d2('0x79'),squel[_0x69d2('0x6f')]()[_0x69d2('0x71')](_0x69d2('0x7c'))[_0x69d2('0x74')](_0x69d2('0x7d'))['where'](_0x69d2('0x7b'),_0x49215b[_0x69d2('0x47')]['id'][_0x69d2('0x73')]())))[_0x69d2('0x73')]();break;case'onlyIfOpen':_0x384cbe=squel[_0x69d2('0x7e')]()[_0x69d2('0x7f')](_0x69d2('0x7d'))[_0x69d2('0x6b')]([_0x69d2('0x70'),_0x69d2('0x6c'),'ContactId',_0x69d2('0x6e'),_0x69d2('0x5c'),_0x69d2('0x57'),_0x69d2('0x58')],squel[_0x69d2('0x6f')]()['field'](_0x69d2('0x70'),_0x69d2('0x70'))[_0x69d2('0x71')]('NOW()',_0x69d2('0x6c'))[_0x69d2('0x71')]('id',_0x69d2('0x6d'))[_0x69d2('0x71')](_0xfd0a13['CmListId'][_0x69d2('0x73')](),_0x69d2('0x6e'))[_0x69d2('0x71')](_0x49215b[_0x69d2('0x47')]['id'][_0x69d2('0x73')](),_0x69d2('0x5c'))[_0x69d2('0x71')]('\x27'+_0x54c6bb+'\x27',_0x69d2('0x57'))[_0x69d2('0x71')]('\x27'+_0x54c6bb+'\x27',_0x69d2('0x58'))[_0x69d2('0x74')](_0x69d2('0x75'))[_0x69d2('0x40')](_0x69d2('0x76'))['where'](_0x69d2('0x77'),_0xfd0a13[_0x69d2('0x72')]['toString']())[_0x69d2('0x40')](_0x69d2('0x78'))['where'](_0x69d2('0x79'),squel[_0x69d2('0x6f')]()['field'](_0x69d2('0x7c'))['from'](_0x69d2('0x7d'))[_0x69d2('0x40')]('CampaignId\x20=\x20?',_0x49215b[_0x69d2('0x47')]['id'][_0x69d2('0x73')]())))[_0x69d2('0x73')]();break;default:_0x384cbe=squel[_0x69d2('0x7e')]()[_0x69d2('0x7f')]('cm_hopper')['fromQuery'](['phone',_0x69d2('0x6c'),_0x69d2('0x6d'),_0x69d2('0x6e'),'CampaignId',_0x69d2('0x57'),'updatedAt'],squel[_0x69d2('0x6f')]()[_0x69d2('0x71')](_0x69d2('0x70'),_0x69d2('0x70'))[_0x69d2('0x71')](_0x69d2('0x80'),_0x69d2('0x6c'))[_0x69d2('0x71')]('id','ContactId')[_0x69d2('0x71')](_0xfd0a13[_0x69d2('0x72')]['toString'](),_0x69d2('0x6e'))[_0x69d2('0x71')](_0x49215b[_0x69d2('0x47')]['id'][_0x69d2('0x73')](),_0x69d2('0x5c'))['field']('\x27'+_0x54c6bb+'\x27','createdAt')[_0x69d2('0x71')]('\x27'+_0x54c6bb+'\x27',_0x69d2('0x58'))[_0x69d2('0x74')](_0x69d2('0x75'))[_0x69d2('0x40')](_0x69d2('0x76'))['where']('ListId\x20=\x20?',_0xfd0a13[_0x69d2('0x72')]['toString']())[_0x69d2('0x40')](_0x69d2('0x78')))['toString']();}_0x3c2532=squel['insert']()[_0x69d2('0x7f')](_0x69d2('0x81'))[_0x69d2('0x6b')](['cmHopperId','scheduledAt','phone','OrderBy',_0x69d2('0x57'),'updatedAt'],squel['select']()[_0x69d2('0x71')]('h.id','id')[_0x69d2('0x71')](_0x69d2('0x80'),_0x69d2('0x6c'))[_0x69d2('0x71')](_0x69d2('0x82'),_0x69d2('0x70'))[_0x69d2('0x71')](_0x69d2('0x83'),_0x69d2('0x84'))[_0x69d2('0x71')]('\x27'+_0x54c6bb+'\x27',_0x69d2('0x57'))[_0x69d2('0x71')]('\x27'+_0x54c6bb+'\x27',_0x69d2('0x58'))['from'](_0x69d2('0x85'),'ci')[_0x69d2('0x86')](_0x69d2('0x7d'),'h',_0x69d2('0x87'))[_0x69d2('0x40')]('h.ListId\x20=\x20?',_0xfd0a13['CmListId']['toString']())[_0x69d2('0x40')]('h.CampaignId=?',_0x49215b[_0x69d2('0x47')]['id']['toString']())[_0x69d2('0x40')](_0x69d2('0x88'),_0x54c6bb))[_0x69d2('0x73')]();_0x4b2ede['push'](db[_0x69d2('0x89')][_0x69d2('0x35')](_0x384cbe));_0x56ebe4[_0x69d2('0x8a')](db[_0x69d2('0x89')][_0x69d2('0x35')](_0x3c2532));}return BPromise[_0x69d2('0x8b')](_0x4b2ede);}})[_0x69d2('0x27')](function(){return BPromise[_0x69d2('0x8b')](_0x56ebe4);})[_0x69d2('0x27')](function(){return _0x28cacb;})[_0x69d2('0x27')](respondWithResult(_0x57201d,null))[_0x69d2('0x4b')](handleError(_0x57201d,null));};exports['removeLists']=function(_0x1dc638,_0x59874d,_0x89d7d){return db['Campaign'][_0x69d2('0x4a')]({'where':{'id':_0x1dc638[_0x69d2('0x47')]['id']}})[_0x69d2('0x27')](handleEntityNotFound(_0x59874d,null))[_0x69d2('0x27')](function(_0x50bf5a){if(_0x50bf5a){return _0x50bf5a[_0x69d2('0x8c')](_0x1dc638[_0x69d2('0x35')]['ids']);}})[_0x69d2('0x27')](function(_0x455805){if(_0x455805){return db['CmHopper']['destroy']({'where':{'ListId':_0x1dc638[_0x69d2('0x35')]['ids'],'CampaignId':_0x1dc638['params']['id']}})[_0x69d2('0x27')](function(){return _0x455805;});}})[_0x69d2('0x27')](respondWithStatusCode(_0x59874d,null))[_0x69d2('0x4b')](handleError(_0x59874d,null));};exports[_0x69d2('0x8d')]=function(_0x263db7,_0x3f156d,_0x21f682){var _0x4debe2={};var _0x39ee3c={};var _0x1003e0;var _0x14421a;return db[_0x69d2('0x2f')][_0x69d2('0x5a')]({'where':{'id':_0x263db7[_0x69d2('0x47')]['id']}})[_0x69d2('0x27')](handleEntityNotFound(_0x3f156d,null))[_0x69d2('0x27')](function(_0x2f760f){if(_0x2f760f){_0x1003e0=_0x2f760f;_0x39ee3c['model']=_[_0x69d2('0x36')](db[_0x69d2('0x64')][_0x69d2('0x30')]);_0x39ee3c[_0x69d2('0x35')]=_['keys'](_0x263db7[_0x69d2('0x35')]);_0x39ee3c[_0x69d2('0x37')]=_['intersection'](_0x39ee3c[_0x69d2('0x33')],_0x39ee3c[_0x69d2('0x35')]);_0x4debe2[_0x69d2('0x38')]=_[_0x69d2('0x39')](_0x39ee3c[_0x69d2('0x33')],qs[_0x69d2('0x3a')](_0x263db7[_0x69d2('0x35')][_0x69d2('0x3a')]));_0x4debe2['attributes']=_0x4debe2[_0x69d2('0x38')][_0x69d2('0x48')]?_0x4debe2[_0x69d2('0x38')]:_0x39ee3c[_0x69d2('0x33')];_0x4debe2[_0x69d2('0x3d')]=qs[_0x69d2('0x3e')](_0x263db7['query'][_0x69d2('0x3e')]);_0x4debe2['where']=qs['filters'](_['pick'](_0x263db7[_0x69d2('0x35')],_0x39ee3c[_0x69d2('0x37')]));if(_0x263db7[_0x69d2('0x35')][_0x69d2('0x42')]){_0x4debe2['where']=_[_0x69d2('0x43')](_0x4debe2[_0x69d2('0x40')],{'$or':_[_0x69d2('0x34')](_0x4debe2[_0x69d2('0x38')],function(_0x12a4fb){var _0x4d1738={};_0x4d1738[_0x12a4fb]={'$like':'%'+_0x263db7[_0x69d2('0x35')][_0x69d2('0x42')]+'%'};return _0x4d1738;})});}_0x4debe2=_[_0x69d2('0x43')]({},_0x4debe2,_0x263db7[_0x69d2('0x44')]);return _0x1003e0['getBlackLists'](_0x4debe2);}})[_0x69d2('0x27')](function(_0x28f570){if(_0x28f570){_0x14421a=_0x28f570[_0x69d2('0x48')];if(!_0x263db7[_0x69d2('0x35')][_0x69d2('0x3b')](_0x69d2('0x3c'))){_0x4debe2[_0x69d2('0x1d')]=qs[_0x69d2('0x1d')](_0x263db7[_0x69d2('0x35')][_0x69d2('0x1d')]);_0x4debe2[_0x69d2('0x20')]=qs[_0x69d2('0x20')](_0x263db7[_0x69d2('0x35')][_0x69d2('0x20')]);}return _0x1003e0[_0x69d2('0x8d')](_0x4debe2);}})[_0x69d2('0x27')](function(_0x4c4e0d){if(_0x4c4e0d){return _0x4c4e0d?{'count':_0x14421a,'rows':_0x4c4e0d}:null;}})['then'](respondWithResult(_0x3f156d,null))[_0x69d2('0x4b')](handleError(_0x3f156d,null));};exports[_0x69d2('0x8e')]=function(_0x200f41,_0x378176,_0x2a3e1d){var _0x395130,_0x400da2;var _0x12273e=[];var _0x3105ae=moment()[_0x69d2('0x66')](_0x69d2('0x67'));return db[_0x69d2('0x2f')][_0x69d2('0x4a')]({'where':{'id':_0x200f41[_0x69d2('0x47')]['id']}})[_0x69d2('0x27')](handleEntityNotFound(_0x378176,null))[_0x69d2('0x27')](function(_0x3ac3ad){if(_0x3ac3ad){_0x400da2=_0x3ac3ad;return _0x3ac3ad[_0x69d2('0x8e')](_0x200f41[_0x69d2('0x4d')][_0x69d2('0x8f')],_['omit'](_0x200f41['body'],['ids','id'])||{});}return null;})[_0x69d2('0x68')](function(_0x3aa0c4){var _0x2a5f79;var _0x1d1908;_0x395130=_0x3aa0c4||[];var _0x4ec8a7=[];if(_0x3aa0c4){for(var _0xd3bbe6=0x0;_0xd3bbe6<_0x3aa0c4['length'];_0xd3bbe6+=0x1){var _0x309e88=_0x3aa0c4[_0xd3bbe6]['get']({'plain':!![]});_0x2a5f79=squel[_0x69d2('0x7e')]()[_0x69d2('0x7f')](_0x69d2('0x90'))[_0x69d2('0x6b')]([_0x69d2('0x70'),_0x69d2('0x6d'),_0x69d2('0x6e'),'CampaignId',_0x69d2('0x57'),'updatedAt'],squel[_0x69d2('0x6f')]()[_0x69d2('0x71')](_0x69d2('0x70'),_0x69d2('0x70'))['field']('id',_0x69d2('0x6d'))['field'](_0x309e88[_0x69d2('0x72')][_0x69d2('0x73')](),_0x69d2('0x6e'))['field'](_0x200f41['params']['id']['toString'](),_0x69d2('0x5c'))['field'](_0x69d2('0x80'),_0x69d2('0x57'))[_0x69d2('0x71')](_0x69d2('0x80'),'updatedAt')['from']('cm_contacts')[_0x69d2('0x40')](_0x69d2('0x76'))[_0x69d2('0x40')](_0x69d2('0x77'),_0x309e88[_0x69d2('0x72')][_0x69d2('0x73')]())[_0x69d2('0x40')](_0x69d2('0x78')))[_0x69d2('0x73')]();_0x4ec8a7[_0x69d2('0x8a')](db[_0x69d2('0x89')][_0x69d2('0x35')](_0x2a5f79));}return BPromise[_0x69d2('0x8b')](_0x4ec8a7);}})[_0x69d2('0x27')](function(){return _0x395130;})[_0x69d2('0x27')](respondWithResult(_0x378176,null))[_0x69d2('0x4b')](handleError(_0x378176,null));};exports['removeBlackLists']=function(_0xacf402,_0x17ae39,_0x51be91){return db[_0x69d2('0x2f')]['find']({'where':{'id':_0xacf402[_0x69d2('0x47')]['id']}})['then'](handleEntityNotFound(_0x17ae39,null))['then'](function(_0x2b30b3){if(_0x2b30b3){return _0x2b30b3[_0x69d2('0x91')](_0xacf402[_0x69d2('0x35')]['ids']);}})[_0x69d2('0x27')](function(_0x3ae890){if(_0x3ae890){return db[_0x69d2('0x62')][_0x69d2('0x28')]({'where':{'ListId':_0xacf402[_0x69d2('0x35')][_0x69d2('0x8f')],'CampaignId':_0xacf402[_0x69d2('0x47')]['id']}})[_0x69d2('0x27')](function(){return _0x3ae890;});}})['then'](respondWithStatusCode(_0x17ae39,null))[_0x69d2('0x4b')](handleError(_0x17ae39,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index f04a187..86e5d7e 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(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xbf23b4,_0x14c39c){var _0x24dfb2=function(_0x5abaac){while(--_0x5abaac){_0xbf23b4['push'](_0xbf23b4['shift']());}};_0x24dfb2(++_0x14c39c);}(_0x7a54,0x106));var _0x47a5=function(_0x36f724,_0x231b6e){_0x36f724=_0x36f724-0x0;var _0x146537=_0x7a54[_0x36f724];return _0x146537;};'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 b1fe5c5..fddb991 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 _0x19ea=['where','attributes','limit','include','map','model','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','findAll','raw','options'];(function(_0x1e2327,_0x52e463){var _0x33ef71=function(_0x34f7f1){while(--_0x34f7f1){_0x1e2327['push'](_0x1e2327['shift']());}};_0x33ef71(++_0x52e463);}(_0x19ea,0xfe));var _0xa19e=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x19ea[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require(_0xa19e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa19e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19e('0x2'));var db=require(_0xa19e('0x3'))['db'];var utils=require(_0xa19e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa19e('0x5'));var jayson=require(_0xa19e('0x6'));var client=jayson[_0xa19e('0x7')][_0xa19e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1087e7,_0x30fd4a,_0x336e23){return new BPromise(function(_0x1867cb,_0x44e468){return client[_0xa19e('0x9')](_0x1087e7,_0x336e23)[_0xa19e('0xa')](function(_0x59b907){logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));logger[_0xa19e('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x30fd4a,_0xa19e('0xd'),JSON[_0xa19e('0xf')](_0x59b907));if(_0x59b907[_0xa19e('0x10')]){if(_0x59b907['error'][_0xa19e('0x11')]===0x1f4){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x44e468(_0x59b907['error'][_0xa19e('0x12')]);}logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x1867cb(_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);}else{logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));_0x1867cb(_0x59b907[_0xa19e('0x13')]['message']);}})[_0xa19e('0x14')](function(_0x34066a){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x34066a);_0x44e468(_0x34066a);});});}exports[_0xa19e('0x15')]=function(_0x38e398){var _0x1f37c4=this;return new Promise(function(_0x530a75,_0xd3e0ff){return db['Campaign'][_0xa19e('0x16')]({'raw':_0x38e398['options']?_0x38e398['options'][_0xa19e('0x17')]===undefined?!![]:![]:!![],'where':_0x38e398[_0xa19e('0x18')]?_0x38e398['options'][_0xa19e('0x19')]||null:null,'attributes':_0x38e398[_0xa19e('0x18')]?_0x38e398[_0xa19e('0x18')][_0xa19e('0x1a')]||null:null,'limit':_0x38e398['options']?_0x38e398[_0xa19e('0x18')][_0xa19e('0x1b')]||null:null,'include':_0x38e398[_0xa19e('0x18')]?_0x38e398[_0xa19e('0x18')][_0xa19e('0x1c')]?_[_0xa19e('0x1d')](_0x38e398[_0xa19e('0x18')][_0xa19e('0x1c')],function(_0xc16a44){return{'model':db[_0xc16a44['model']],'as':_0xc16a44['as'],'attributes':_0xc16a44[_0xa19e('0x1a')],'include':_0xc16a44[_0xa19e('0x1c')]?_['map'](_0xc16a44[_0xa19e('0x1c')],function(_0x1d3ce6){return{'model':db[_0x1d3ce6['model']],'as':_0x1d3ce6['as'],'attributes':_0x1d3ce6[_0xa19e('0x1a')],'include':_0x1d3ce6[_0xa19e('0x1c')]?_['map'](_0x1d3ce6[_0xa19e('0x1c')],function(_0x10682d){return{'model':db[_0x10682d[_0xa19e('0x1e')]],'as':_0x10682d['as'],'attributes':_0x10682d[_0xa19e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa19e('0xa')](function(_0x180407){logger[_0xa19e('0xb')](_0xa19e('0x15'),_0x38e398);logger[_0xa19e('0xe')](_0xa19e('0x15'),_0x38e398,JSON[_0xa19e('0xf')](_0x180407));_0x530a75(_0x180407);})[_0xa19e('0x14')](function(_0x1ce643){logger[_0xa19e('0x10')](_0xa19e('0x15'),_0x1ce643[_0xa19e('0x12')],_0x38e398);_0xd3e0ff(_0x1f37c4[_0xa19e('0x10')](0x1f4,_0x1ce643[_0xa19e('0x12')]));});});};
\ No newline at end of file
+var _0xecd5=['options','raw','where','limit','map','include','model','attributes','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetCampaign','Campaign','findAll'];(function(_0x4f0931,_0x508249){var _0x2d6d8b=function(_0x5514d5){while(--_0x5514d5){_0x4f0931['push'](_0x4f0931['shift']());}};_0x2d6d8b(++_0x508249);}(_0xecd5,0x110));var _0x5ecd=function(_0x24a181,_0x13a535){_0x24a181=_0x24a181-0x0;var _0xce80fe=_0xecd5[_0x24a181];return _0xce80fe;};'use strict';var _=require('lodash');var util=require(_0x5ecd('0x0'));var moment=require(_0x5ecd('0x1'));var BPromise=require(_0x5ecd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ecd('0x3'));var db=require(_0x5ecd('0x4'))['db'];var utils=require(_0x5ecd('0x5'));var logger=require(_0x5ecd('0x6'))('rpc');var config=require(_0x5ecd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ecd('0x8')][_0x5ecd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a1870,_0x42c752,_0x26d951){return new BPromise(function(_0x2cb71b,_0x946412){return client[_0x5ecd('0xa')](_0x4a1870,_0x26d951)[_0x5ecd('0xb')](function(_0x305f1b){logger[_0x5ecd('0xc')](_0x5ecd('0xd'),_0x42c752,_0x5ecd('0xe'));logger[_0x5ecd('0xf')](_0x5ecd('0x10'),_0x42c752,'request\x20sent',JSON[_0x5ecd('0x11')](_0x305f1b));if(_0x305f1b['error']){if(_0x305f1b['error'][_0x5ecd('0x12')]===0x1f4){logger[_0x5ecd('0x13')]('Campaign,\x20%s,\x20%s',_0x42c752,_0x305f1b['error'][_0x5ecd('0x14')]);return _0x946412(_0x305f1b[_0x5ecd('0x13')][_0x5ecd('0x14')]);}logger[_0x5ecd('0x13')]('Campaign,\x20%s,\x20%s',_0x42c752,_0x305f1b[_0x5ecd('0x13')][_0x5ecd('0x14')]);return _0x2cb71b(_0x305f1b['error'][_0x5ecd('0x14')]);}else{logger[_0x5ecd('0xc')]('Campaign,\x20%s,\x20%s',_0x42c752,_0x5ecd('0xe'));_0x2cb71b(_0x305f1b['result'][_0x5ecd('0x14')]);}})[_0x5ecd('0x15')](function(_0x1e8e64){logger[_0x5ecd('0x13')](_0x5ecd('0xd'),_0x42c752,_0x1e8e64);_0x946412(_0x1e8e64);});});}exports[_0x5ecd('0x16')]=function(_0x231da2){var _0x189c3b=this;return new Promise(function(_0x3078ea,_0x1f7309){return db[_0x5ecd('0x17')][_0x5ecd('0x18')]({'raw':_0x231da2['options']?_0x231da2[_0x5ecd('0x19')][_0x5ecd('0x1a')]===undefined?!![]:![]:!![],'where':_0x231da2[_0x5ecd('0x19')]?_0x231da2[_0x5ecd('0x19')][_0x5ecd('0x1b')]||null:null,'attributes':_0x231da2['options']?_0x231da2[_0x5ecd('0x19')]['attributes']||null:null,'limit':_0x231da2[_0x5ecd('0x19')]?_0x231da2[_0x5ecd('0x19')][_0x5ecd('0x1c')]||null:null,'include':_0x231da2[_0x5ecd('0x19')]?_0x231da2[_0x5ecd('0x19')]['include']?_[_0x5ecd('0x1d')](_0x231da2[_0x5ecd('0x19')][_0x5ecd('0x1e')],function(_0x57168b){return{'model':db[_0x57168b[_0x5ecd('0x1f')]],'as':_0x57168b['as'],'attributes':_0x57168b[_0x5ecd('0x20')],'include':_0x57168b[_0x5ecd('0x1e')]?_[_0x5ecd('0x1d')](_0x57168b[_0x5ecd('0x1e')],function(_0x20f134){return{'model':db[_0x20f134[_0x5ecd('0x1f')]],'as':_0x20f134['as'],'attributes':_0x20f134[_0x5ecd('0x20')],'include':_0x20f134['include']?_[_0x5ecd('0x1d')](_0x20f134['include'],function(_0x12a109){return{'model':db[_0x12a109[_0x5ecd('0x1f')]],'as':_0x12a109['as'],'attributes':_0x12a109[_0x5ecd('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5ecd('0xb')](function(_0x1729c2){logger['info'](_0x5ecd('0x16'),_0x231da2);logger[_0x5ecd('0xf')](_0x5ecd('0x16'),_0x231da2,JSON[_0x5ecd('0x11')](_0x1729c2));_0x3078ea(_0x1729c2);})[_0x5ecd('0x15')](function(_0x1c3eb8){logger[_0x5ecd('0x13')](_0x5ecd('0x16'),_0x1c3eb8[_0x5ecd('0x14')],_0x231da2);_0x1f7309(_0x189c3b[_0x5ecd('0x13')](0x1f4,_0x1c3eb8[_0x5ecd('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 88fed46..33627e2 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 _0x0d4e=['/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','/:id','update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists'];(function(_0x413ab5,_0x25fe01){var _0x482c24=function(_0x11c1e1){while(--_0x11c1e1){_0x413ab5['push'](_0x413ab5['shift']());}};_0x482c24(++_0x25fe01);}(_0x0d4e,0x1ca));var _0xe0d4=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x0d4e[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0xe0d4('0x0'));var util=require(_0xe0d4('0x1'));var path=require(_0xe0d4('0x2'));var timeout=require(_0xe0d4('0x3'));var express=require(_0xe0d4('0x4'));var router=express[_0xe0d4('0x5')]();var fs_extra=require(_0xe0d4('0x6'));var auth=require(_0xe0d4('0x7'));var interaction=require(_0xe0d4('0x8'));var config=require('../../config/environment');var controller=require(_0xe0d4('0x9'));router[_0xe0d4('0xa')]('/',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0xc')]);router['get']('/:id',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0xd')]);router[_0xe0d4('0xa')](_0xe0d4('0xe'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0xf')]);router[_0xe0d4('0xa')](_0xe0d4('0x10'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x11')]);router[_0xe0d4('0xa')](_0xe0d4('0x12'),auth[_0xe0d4('0xb')](),controller['getHopperFinals']);router[_0xe0d4('0xa')](_0xe0d4('0x13'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x14')]);router[_0xe0d4('0xa')](_0xe0d4('0x15'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x16')]);router[_0xe0d4('0xa')](_0xe0d4('0x17'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x18')]);router[_0xe0d4('0x19')]('/',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x1a')]);router['post'](_0xe0d4('0x1b'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x1c')]);router['post']('/:id/lists',auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x1d')]);router[_0xe0d4('0x19')](_0xe0d4('0x17'),auth[_0xe0d4('0xb')](),controller['addBlackLists']);router[_0xe0d4('0x1e')](_0xe0d4('0x1f'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x20')]);router[_0xe0d4('0x21')]('/:id',auth[_0xe0d4('0xb')](),controller['destroy']);router['delete'](_0xe0d4('0x15'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x22')]);router['delete'](_0xe0d4('0x17'),auth[_0xe0d4('0xb')](),controller[_0xe0d4('0x23')]);module[_0xe0d4('0x24')]=router;
\ No newline at end of file
+var _0x083e=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','getBlackLists','post','create','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists'];(function(_0x4e82ff,_0x3cbf4b){var _0x495205=function(_0x21bc88){while(--_0x21bc88){_0x4e82ff['push'](_0x4e82ff['shift']());}};_0x495205(++_0x3cbf4b);}(_0x083e,0x140));var _0xe083=function(_0x2da45d,_0x35397b){_0x2da45d=_0x2da45d-0x0;var _0x1012a0=_0x083e[_0x2da45d];return _0x1012a0;};'use strict';var multer=require(_0xe083('0x0'));var util=require(_0xe083('0x1'));var path=require('path');var timeout=require(_0xe083('0x2'));var express=require('express');var router=express[_0xe083('0x3')]();var fs_extra=require(_0xe083('0x4'));var auth=require(_0xe083('0x5'));var interaction=require(_0xe083('0x6'));var config=require(_0xe083('0x7'));var controller=require(_0xe083('0x8'));router[_0xe083('0x9')]('/',auth['isAuthenticated'](),controller[_0xe083('0xa')]);router[_0xe083('0x9')](_0xe083('0xb'),auth[_0xe083('0xc')](),controller[_0xe083('0xd')]);router[_0xe083('0x9')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0xe083('0xe')]);router[_0xe083('0x9')]('/:id/hopper_histories',auth[_0xe083('0xc')](),controller[_0xe083('0xf')]);router[_0xe083('0x9')](_0xe083('0x10'),auth[_0xe083('0xc')](),controller[_0xe083('0x11')]);router[_0xe083('0x9')](_0xe083('0x12'),auth['isAuthenticated'](),controller['getHopperBlacks']);router['get'](_0xe083('0x13'),auth[_0xe083('0xc')](),controller[_0xe083('0x14')]);router[_0xe083('0x9')]('/:id/blacklists',auth[_0xe083('0xc')](),controller[_0xe083('0x15')]);router[_0xe083('0x16')]('/',auth['isAuthenticated'](),controller[_0xe083('0x17')]);router[_0xe083('0x16')]('/:id/clone',auth[_0xe083('0xc')](),controller['clone']);router[_0xe083('0x16')]('/:id/lists',auth[_0xe083('0xc')](),controller['addLists']);router[_0xe083('0x16')](_0xe083('0x18'),auth[_0xe083('0xc')](),controller[_0xe083('0x19')]);router[_0xe083('0x1a')]('/:id',auth[_0xe083('0xc')](),controller[_0xe083('0x1b')]);router[_0xe083('0x1c')](_0xe083('0xb'),auth[_0xe083('0xc')](),controller[_0xe083('0x1d')]);router[_0xe083('0x1c')](_0xe083('0x13'),auth[_0xe083('0xc')](),controller[_0xe083('0x1e')]);router['delete']('/:id/blacklists',auth[_0xe083('0xc')](),controller[_0xe083('0x1f')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index f0a826b..7fc57b1 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 _0x65eb=['TEXT','getDataValue','key','sequelize','exports','STRING'];(function(_0x4bc035,_0x46da0a){var _0x588288=function(_0x5d2a40){while(--_0x5d2a40){_0x4bc035['push'](_0x4bc035['shift']());}};_0x588288(++_0x46da0a);}(_0x65eb,0x17d));var _0xb65e=function(_0x105d03,_0x488b95){_0x105d03=_0x105d03-0x0;var _0x2dd889=_0x65eb[_0x105d03];return _0x2dd889;};'use strict';var Sequelize=require(_0xb65e('0x0'));module[_0xb65e('0x1')]={'key':{'type':Sequelize[_0xb65e('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb65e('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xb65e('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb65e('0x4')](_0xb65e('0x5'));}}};
\ No newline at end of file
+var _0x52fd=['key','sequelize','exports','STRING','TEXT','getDataValue'];(function(_0x5d52a4,_0x54e8d1){var _0x55dfcd=function(_0x38a301){while(--_0x38a301){_0x5d52a4['push'](_0x5d52a4['shift']());}};_0x55dfcd(++_0x54e8d1);}(_0x52fd,0xa9));var _0xd52f=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x52fd[_0x6cf19c];return _0xce14f3;};'use strict';var Sequelize=require(_0xd52f('0x0'));module[_0xd52f('0x1')]={'key':{'type':Sequelize[_0xd52f('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xd52f('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd52f('0x4')](_0xd52f('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 2eef8c9..bf8ed4c 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 _0x7d25=['params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','limit','count','set','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','length','options','find','body'];(function(_0x80b36e,_0x4d4528){var _0x1eacc5=function(_0x3b032f){while(--_0x3b032f){_0x80b36e['push'](_0x80b36e['shift']());}};_0x1eacc5(++_0x4d4528);}(_0x7d25,0x177));var _0x57d2=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x7d25[_0x40a825];return _0x273a54;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x57d2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57d2('0x1'));var moment=require(_0x57d2('0x2'));var BPromise=require(_0x57d2('0x3'));var Mustache=require(_0x57d2('0x4'));var util=require(_0x57d2('0x5'));var path=require(_0x57d2('0x6'));var sox=require(_0x57d2('0x7'));var csv=require(_0x57d2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57d2('0x9'));var _=require(_0x57d2('0xa'));var squel=require(_0x57d2('0xb'));var crypto=require(_0x57d2('0xc'));var jsforce=require(_0x57d2('0xd'));var deskjs=require(_0x57d2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x57d2('0xf'));var Redis=require(_0x57d2('0x10'));var authService=require(_0x57d2('0x11'));var qs=require(_0x57d2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57d2('0x13'));var logger=require('../../config/logger')(_0x57d2('0x14'));var utils=require(_0x57d2('0x15'));var config=require(_0x57d2('0x16'));var licenseUtil=require(_0x57d2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ac070,_0x4a535d){_0x4a535d=_0x4a535d||0xcc;return function(_0x3f74f2){if(_0x3f74f2){return _0x1ac070[_0x57d2('0x18')](_0x4a535d);}return _0x1ac070['status'](_0x4a535d)[_0x57d2('0x19')]();};}function respondWithResult(_0x60e547,_0x343c40){_0x343c40=_0x343c40||0xc8;return function(_0x2c9bda){if(_0x2c9bda){return _0x60e547[_0x57d2('0x1a')](_0x343c40)['json'](_0x2c9bda);}};}function respondWithFilteredResult(_0xad5a39,_0x27b719){return function(_0xb75974){if(_0xb75974){var _0x5325c=typeof _0x27b719[_0x57d2('0x1b')]==='undefined'&&typeof _0x27b719[_0x57d2('0x1c')]==='undefined';var _0xfb2f45=_0xb75974[_0x57d2('0x1d')];var _0x39c099=_0x5325c?0x0:_0x27b719[_0x57d2('0x1b')];var _0xe8b091=_0x5325c?_0xb75974[_0x57d2('0x1d')]:_0x27b719[_0x57d2('0x1b')]+_0x27b719[_0x57d2('0x1c')];var _0x31a657;if(_0xe8b091>=_0xfb2f45){_0xe8b091=_0xfb2f45;_0x31a657=0xc8;}else{_0x31a657=0xce;}_0xad5a39[_0x57d2('0x1a')](_0x31a657);return _0xad5a39[_0x57d2('0x1e')]('Content-Range',_0x39c099+'-'+_0xe8b091+'/'+_0xfb2f45)['json'](_0xb75974);}return null;};}function patchUpdates(_0x21322d){return function(_0x25d0b3){try{jsonpatch[_0x57d2('0x1f')](_0x25d0b3,_0x21322d,!![]);}catch(_0x12710e){return BPromise['reject'](_0x12710e);}return _0x25d0b3[_0x57d2('0x20')]();};}function saveUpdates(_0x3ee7d1,_0x3ba13b){return function(_0x1dc2c3){if(_0x1dc2c3){return _0x1dc2c3[_0x57d2('0x21')](_0x3ee7d1)[_0x57d2('0x22')](function(_0x49d363){return _0x49d363;});}return null;};}function removeEntity(_0x33a88b,_0x5ea78a){return function(_0x30674f){if(_0x30674f){return _0x30674f[_0x57d2('0x23')]()[_0x57d2('0x22')](function(){var _0x2d7ebf=_0x30674f[_0x57d2('0x24')]({'plain':!![]});var _0x2766c1=_0x57d2('0x25');return db[_0x57d2('0x26')][_0x57d2('0x23')]({'where':{'type':_0x2766c1,'resourceId':_0x2d7ebf['id']}})['then'](function(){return _0x30674f;});})[_0x57d2('0x22')](function(){_0x33a88b[_0x57d2('0x1a')](0xcc)[_0x57d2('0x19')]();});}};}function handleEntityNotFound(_0x3fb40b,_0x5e22ca){return function(_0x533868){if(!_0x533868){_0x3fb40b['sendStatus'](0x194);}return _0x533868;};}function handleError(_0x30fb95,_0x3c9f61){_0x3c9f61=_0x3c9f61||0x1f4;return function(_0x454a10){logger[_0x57d2('0x27')](_0x454a10[_0x57d2('0x28')]);if(_0x454a10[_0x57d2('0x29')]){delete _0x454a10[_0x57d2('0x29')];}_0x30fb95[_0x57d2('0x1a')](_0x3c9f61)[_0x57d2('0x2a')](_0x454a10);};}exports[_0x57d2('0x2b')]=function(_0x5c69fe,_0x48f987){var _0xdd1e3f={},_0x12d23f={},_0x28c3ee={'count':0x0,'rows':[]};var _0x1e56fa=_[_0x57d2('0x2c')](db[_0x57d2('0x2d')][_0x57d2('0x2e')],function(_0x21cdca){return{'name':_0x21cdca[_0x57d2('0x2f')],'type':_0x21cdca[_0x57d2('0x30')][_0x57d2('0x31')]};});_0x12d23f[_0x57d2('0x32')]=_[_0x57d2('0x2c')](_0x1e56fa,'name');_0x12d23f[_0x57d2('0x33')]=_[_0x57d2('0x34')](_0x5c69fe[_0x57d2('0x33')]);_0x12d23f[_0x57d2('0x35')]=_[_0x57d2('0x36')](_0x12d23f[_0x57d2('0x32')],_0x12d23f[_0x57d2('0x33')]);_0xdd1e3f[_0x57d2('0x37')]=_[_0x57d2('0x36')](_0x12d23f[_0x57d2('0x32')],qs['fields'](_0x5c69fe['query'][_0x57d2('0x38')]));_0xdd1e3f['attributes']=_0xdd1e3f[_0x57d2('0x37')]['length']?_0xdd1e3f[_0x57d2('0x37')]:_0x12d23f['model'];if(!_0x5c69fe[_0x57d2('0x33')][_0x57d2('0x39')](_0x57d2('0x3a'))){_0xdd1e3f[_0x57d2('0x1c')]=qs[_0x57d2('0x1c')](_0x5c69fe['query'][_0x57d2('0x1c')]);_0xdd1e3f[_0x57d2('0x1b')]=qs[_0x57d2('0x1b')](_0x5c69fe[_0x57d2('0x33')]['offset']);}_0xdd1e3f[_0x57d2('0x3b')]=qs['sort'](_0x5c69fe[_0x57d2('0x33')][_0x57d2('0x3c')]);_0xdd1e3f[_0x57d2('0x3d')]=qs[_0x57d2('0x35')](_[_0x57d2('0x3e')](_0x5c69fe[_0x57d2('0x33')],_0x12d23f[_0x57d2('0x35')]),_0x1e56fa);if(_0x5c69fe[_0x57d2('0x33')][_0x57d2('0x3f')]){_0xdd1e3f[_0x57d2('0x3d')]=_[_0x57d2('0x40')](_0xdd1e3f[_0x57d2('0x3d')],{'$or':[{'key':{'$like':'%'+_0x5c69fe[_0x57d2('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x5c69fe[_0x57d2('0x33')][_0x57d2('0x3f')]+'%'}}]});}_0xdd1e3f=_[_0x57d2('0x40')]({},_0xdd1e3f,_0x5c69fe['options']);var _0x52a35f={'where':_0xdd1e3f['where']};return db[_0x57d2('0x2d')][_0x57d2('0x1d')](_0x52a35f)['then'](function(_0x383e0a){_0x28c3ee[_0x57d2('0x1d')]=_0x383e0a;if(_0x5c69fe['query'][_0x57d2('0x41')]){_0xdd1e3f[_0x57d2('0x42')]=[{'all':!![]}];}return db[_0x57d2('0x2d')][_0x57d2('0x43')](_0xdd1e3f);})[_0x57d2('0x22')](function(_0xdeb288){_0x28c3ee[_0x57d2('0x44')]=_0xdeb288;return _0x28c3ee;})[_0x57d2('0x22')](respondWithFilteredResult(_0x48f987,_0xdd1e3f))[_0x57d2('0x45')](handleError(_0x48f987,null));};exports[_0x57d2('0x46')]=function(_0x4f7ff0,_0x38c46e){var _0x42d618={'raw':!![],'where':{'id':_0x4f7ff0['params']['id']}},_0x50d687={};_0x50d687['model']=_['keys'](db[_0x57d2('0x2d')][_0x57d2('0x2e')]);_0x50d687[_0x57d2('0x33')]=_[_0x57d2('0x34')](_0x4f7ff0[_0x57d2('0x33')]);_0x50d687['filters']=_[_0x57d2('0x36')](_0x50d687[_0x57d2('0x32')],_0x50d687[_0x57d2('0x33')]);_0x42d618[_0x57d2('0x37')]=_['intersection'](_0x50d687['model'],qs[_0x57d2('0x38')](_0x4f7ff0[_0x57d2('0x33')]['fields']));_0x42d618[_0x57d2('0x37')]=_0x42d618[_0x57d2('0x37')][_0x57d2('0x47')]?_0x42d618[_0x57d2('0x37')]:_0x50d687['model'];if(_0x4f7ff0[_0x57d2('0x33')][_0x57d2('0x41')]){_0x42d618[_0x57d2('0x42')]=[{'all':!![]}];}_0x42d618=_[_0x57d2('0x40')]({},_0x42d618,_0x4f7ff0[_0x57d2('0x48')]);return db['CannedAnswer'][_0x57d2('0x49')](_0x42d618)[_0x57d2('0x22')](handleEntityNotFound(_0x38c46e,null))[_0x57d2('0x22')](respondWithResult(_0x38c46e,null))['catch'](handleError(_0x38c46e,null));};exports[_0x57d2('0x21')]=function(_0x1d82f2,_0x166275){if(_0x1d82f2[_0x57d2('0x4a')]['id']){delete _0x1d82f2['body']['id'];}return db[_0x57d2('0x2d')][_0x57d2('0x49')]({'where':{'id':_0x1d82f2[_0x57d2('0x4b')]['id']}})[_0x57d2('0x22')](handleEntityNotFound(_0x166275,null))[_0x57d2('0x22')](saveUpdates(_0x1d82f2['body'],null))[_0x57d2('0x22')](respondWithResult(_0x166275,null))[_0x57d2('0x45')](handleError(_0x166275,null));};exports[_0x57d2('0x23')]=function(_0x493f59,_0x597c11){return db[_0x57d2('0x2d')]['find']({'where':{'id':_0x493f59[_0x57d2('0x4b')]['id']}})[_0x57d2('0x22')](handleEntityNotFound(_0x597c11,null))['then'](removeEntity(_0x597c11,null))[_0x57d2('0x45')](handleError(_0x597c11,null));};exports[_0x57d2('0x4c')]=function(_0x32e6b9,_0xf0f816){var _0x163e37={'key':_0x32e6b9[_0x57d2('0x4a')][_0x57d2('0x31')]};if(_0x32e6b9[_0x57d2('0x4a')]['MailAccountId']){_0x163e37[_0x57d2('0x4d')]=_0x32e6b9[_0x57d2('0x4a')][_0x57d2('0x4d')];}else if(_0x32e6b9[_0x57d2('0x4a')][_0x57d2('0x4e')]){_0x163e37[_0x57d2('0x4e')]=_0x32e6b9['body'][_0x57d2('0x4e')];}else if(_0x32e6b9['body'][_0x57d2('0x4f')]){_0x163e37[_0x57d2('0x4f')]=_0x32e6b9['body'][_0x57d2('0x4f')];}else if(_0x32e6b9[_0x57d2('0x4a')][_0x57d2('0x50')]){_0x163e37[_0x57d2('0x50')]=_0x32e6b9[_0x57d2('0x4a')][_0x57d2('0x50')];}return db[_0x57d2('0x2d')][_0x57d2('0x49')]({'where':_0x163e37})[_0x57d2('0x22')](function(_0x5a9766){if(_0x5a9766){throw new db[(_0x57d2('0x51'))][(_0x57d2('0x52'))](_0x57d2('0x53'));}return db[_0x57d2('0x2d')][_0x57d2('0x4c')](_0x32e6b9[_0x57d2('0x4a')]);})[_0x57d2('0x22')](function(_0x59564f){var _0x5ca95e=_0x32e6b9[_0x57d2('0x54')][_0x57d2('0x24')]({'plain':!![]});if(!_0x5ca95e)throw new Error(_0x57d2('0x55'));if(_0x5ca95e[_0x57d2('0x56')]===_0x57d2('0x54')){var _0x5e9b6a=_0x59564f[_0x57d2('0x24')]({'plain':!![]});return db[_0x57d2('0x57')][_0x57d2('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x5ca95e[_0x57d2('0x58')]},'raw':!![]})['then'](function(_0x4eb3f0){if(_0x4eb3f0&&_0x4eb3f0[_0x57d2('0x59')]===0x0){return db[_0x57d2('0x26')][_0x57d2('0x4c')]({'name':_0x5e9b6a[_0x57d2('0x29')],'resourceId':_0x5e9b6a['id'],'type':_0x4eb3f0[_0x57d2('0x29')],'sectionId':_0x4eb3f0['id']},{})['then'](function(){return _0x59564f;});}else{return _0x59564f;}})[_0x57d2('0x45')](function(_0x17dd8f){logger[_0x57d2('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17dd8f);throw _0x17dd8f;});}return _0x59564f;})[_0x57d2('0x22')](respondWithResult(_0xf0f816,0xc9))[_0x57d2('0x45')](handleError(_0xf0f816,null));};
\ No newline at end of file
+var _0x6215=['rawAttributes','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','CannedAnswer','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x6215,0xcf));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5621('0x0'));var zipdir=require(_0x5621('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5621('0x2'));var moment=require(_0x5621('0x3'));var BPromise=require(_0x5621('0x4'));var Mustache=require('mustache');var util=require(_0x5621('0x5'));var path=require(_0x5621('0x6'));var sox=require('sox');var csv=require(_0x5621('0x7'));var ejs=require(_0x5621('0x8'));var fs=require('fs');var fs_extra=require(_0x5621('0x9'));var _=require(_0x5621('0xa'));var squel=require(_0x5621('0xb'));var crypto=require(_0x5621('0xc'));var jsforce=require(_0x5621('0xd'));var deskjs=require(_0x5621('0xe'));var toCsv=require(_0x5621('0x7'));var querystring=require(_0x5621('0xf'));var Papa=require(_0x5621('0x10'));var Redis=require(_0x5621('0x11'));var authService=require(_0x5621('0x12'));var qs=require(_0x5621('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5621('0x14'));var logger=require('../../config/logger')(_0x5621('0x15'));var utils=require(_0x5621('0x16'));var config=require(_0x5621('0x17'));var licenseUtil=require(_0x5621('0x18'));var db=require(_0x5621('0x19'))['db'];function respondWithStatusCode(_0x565a90,_0x433f03){_0x433f03=_0x433f03||0xcc;return function(_0x579995){if(_0x579995){return _0x565a90[_0x5621('0x1a')](_0x433f03);}return _0x565a90['status'](_0x433f03)['end']();};}function respondWithResult(_0x2b9742,_0x501524){_0x501524=_0x501524||0xc8;return function(_0x2425c1){if(_0x2425c1){return _0x2b9742[_0x5621('0x1b')](_0x501524)[_0x5621('0x1c')](_0x2425c1);}};}function respondWithFilteredResult(_0x43ddd2,_0x43d692){return function(_0x5cf979){if(_0x5cf979){var _0x28fbb0=typeof _0x43d692['offset']===_0x5621('0x1d')&&typeof _0x43d692[_0x5621('0x1e')]===_0x5621('0x1d');var _0x56a726=_0x5cf979['count'];var _0x4873c6=_0x28fbb0?0x0:_0x43d692['offset'];var _0x183918=_0x28fbb0?_0x5cf979[_0x5621('0x1f')]:_0x43d692[_0x5621('0x20')]+_0x43d692[_0x5621('0x1e')];var _0x50b4a6;if(_0x183918>=_0x56a726){_0x183918=_0x56a726;_0x50b4a6=0xc8;}else{_0x50b4a6=0xce;}_0x43ddd2[_0x5621('0x1b')](_0x50b4a6);return _0x43ddd2[_0x5621('0x21')](_0x5621('0x22'),_0x4873c6+'-'+_0x183918+'/'+_0x56a726)[_0x5621('0x1c')](_0x5cf979);}return null;};}function patchUpdates(_0x597eb1){return function(_0xa5f502){try{jsonpatch['apply'](_0xa5f502,_0x597eb1,!![]);}catch(_0x1384a5){return BPromise[_0x5621('0x23')](_0x1384a5);}return _0xa5f502[_0x5621('0x24')]();};}function saveUpdates(_0xd97922,_0x270f27){return function(_0x37d96f){if(_0x37d96f){return _0x37d96f[_0x5621('0x25')](_0xd97922)[_0x5621('0x26')](function(_0x38c2a8){return _0x38c2a8;});}return null;};}function removeEntity(_0x4ec41e,_0x5dabad){return function(_0x1c33a9){if(_0x1c33a9){return _0x1c33a9[_0x5621('0x27')]()['then'](function(){var _0x447a74=_0x1c33a9[_0x5621('0x28')]({'plain':!![]});var _0x47fa54=_0x5621('0x29');return db[_0x5621('0x2a')][_0x5621('0x27')]({'where':{'type':_0x47fa54,'resourceId':_0x447a74['id']}})[_0x5621('0x26')](function(){return _0x1c33a9;});})[_0x5621('0x26')](function(){_0x4ec41e[_0x5621('0x1b')](0xcc)[_0x5621('0x2b')]();});}};}function handleEntityNotFound(_0x59d009,_0x31cd4a){return function(_0xc00f4d){if(!_0xc00f4d){_0x59d009['sendStatus'](0x194);}return _0xc00f4d;};}function handleError(_0x552a0e,_0x1b44d7){_0x1b44d7=_0x1b44d7||0x1f4;return function(_0x2adab7){logger[_0x5621('0x2c')](_0x2adab7[_0x5621('0x2d')]);if(_0x2adab7[_0x5621('0x2e')]){delete _0x2adab7['name'];}_0x552a0e[_0x5621('0x1b')](_0x1b44d7)[_0x5621('0x2f')](_0x2adab7);};}exports[_0x5621('0x30')]=function(_0x1e561f,_0x591736){var _0xa8dfd6={},_0x425ac5={},_0x4e6359={'count':0x0,'rows':[]};var _0x5c7f58=_['map'](db[_0x5621('0x31')]['rawAttributes'],function(_0x156214){return{'name':_0x156214[_0x5621('0x32')],'type':_0x156214['type'][_0x5621('0x33')]};});_0x425ac5[_0x5621('0x34')]=_[_0x5621('0x35')](_0x5c7f58,_0x5621('0x2e'));_0x425ac5['query']=_[_0x5621('0x36')](_0x1e561f[_0x5621('0x37')]);_0x425ac5[_0x5621('0x38')]=_[_0x5621('0x39')](_0x425ac5[_0x5621('0x34')],_0x425ac5['query']);_0xa8dfd6[_0x5621('0x3a')]=_[_0x5621('0x39')](_0x425ac5['model'],qs[_0x5621('0x3b')](_0x1e561f[_0x5621('0x37')][_0x5621('0x3b')]));_0xa8dfd6[_0x5621('0x3a')]=_0xa8dfd6[_0x5621('0x3a')][_0x5621('0x3c')]?_0xa8dfd6[_0x5621('0x3a')]:_0x425ac5[_0x5621('0x34')];if(!_0x1e561f[_0x5621('0x37')][_0x5621('0x3d')](_0x5621('0x3e'))){_0xa8dfd6[_0x5621('0x1e')]=qs[_0x5621('0x1e')](_0x1e561f['query'][_0x5621('0x1e')]);_0xa8dfd6['offset']=qs[_0x5621('0x20')](_0x1e561f[_0x5621('0x37')][_0x5621('0x20')]);}_0xa8dfd6[_0x5621('0x3f')]=qs['sort'](_0x1e561f[_0x5621('0x37')][_0x5621('0x40')]);_0xa8dfd6[_0x5621('0x41')]=qs[_0x5621('0x38')](_['pick'](_0x1e561f['query'],_0x425ac5['filters']),_0x5c7f58);if(_0x1e561f[_0x5621('0x37')][_0x5621('0x42')]){_0xa8dfd6[_0x5621('0x41')]=_['merge'](_0xa8dfd6['where'],{'$or':[{'key':{'$like':'%'+_0x1e561f[_0x5621('0x37')][_0x5621('0x42')]+'%'}},{'value':{'$like':'%'+_0x1e561f[_0x5621('0x37')][_0x5621('0x42')]+'%'}}]});}_0xa8dfd6=_[_0x5621('0x43')]({},_0xa8dfd6,_0x1e561f[_0x5621('0x44')]);var _0x2462f1={'where':_0xa8dfd6['where']};return db['CannedAnswer'][_0x5621('0x1f')](_0x2462f1)[_0x5621('0x26')](function(_0x2f8879){_0x4e6359['count']=_0x2f8879;if(_0x1e561f[_0x5621('0x37')][_0x5621('0x45')]){_0xa8dfd6[_0x5621('0x46')]=[{'all':!![]}];}return db[_0x5621('0x31')][_0x5621('0x47')](_0xa8dfd6);})['then'](function(_0x445f44){_0x4e6359[_0x5621('0x48')]=_0x445f44;return _0x4e6359;})[_0x5621('0x26')](respondWithFilteredResult(_0x591736,_0xa8dfd6))[_0x5621('0x49')](handleError(_0x591736,null));};exports[_0x5621('0x4a')]=function(_0x5cfcf5,_0x2f2fce){var _0x4205b6={'raw':!![],'where':{'id':_0x5cfcf5['params']['id']}},_0x5de99c={};_0x5de99c[_0x5621('0x34')]=_[_0x5621('0x36')](db[_0x5621('0x31')][_0x5621('0x4b')]);_0x5de99c['query']=_['keys'](_0x5cfcf5['query']);_0x5de99c[_0x5621('0x38')]=_[_0x5621('0x39')](_0x5de99c[_0x5621('0x34')],_0x5de99c[_0x5621('0x37')]);_0x4205b6[_0x5621('0x3a')]=_[_0x5621('0x39')](_0x5de99c[_0x5621('0x34')],qs[_0x5621('0x3b')](_0x5cfcf5['query'][_0x5621('0x3b')]));_0x4205b6[_0x5621('0x3a')]=_0x4205b6['attributes'][_0x5621('0x3c')]?_0x4205b6['attributes']:_0x5de99c[_0x5621('0x34')];if(_0x5cfcf5[_0x5621('0x37')]['includeAll']){_0x4205b6[_0x5621('0x46')]=[{'all':!![]}];}_0x4205b6=_['merge']({},_0x4205b6,_0x5cfcf5[_0x5621('0x44')]);return db[_0x5621('0x31')][_0x5621('0x4c')](_0x4205b6)[_0x5621('0x26')](handleEntityNotFound(_0x2f2fce,null))[_0x5621('0x26')](respondWithResult(_0x2f2fce,null))[_0x5621('0x49')](handleError(_0x2f2fce,null));};exports['update']=function(_0x2ab23c,_0x4199d3){if(_0x2ab23c[_0x5621('0x4d')]['id']){delete _0x2ab23c['body']['id'];}return db['CannedAnswer'][_0x5621('0x4c')]({'where':{'id':_0x2ab23c[_0x5621('0x4e')]['id']}})[_0x5621('0x26')](handleEntityNotFound(_0x4199d3,null))[_0x5621('0x26')](saveUpdates(_0x2ab23c[_0x5621('0x4d')],null))['then'](respondWithResult(_0x4199d3,null))[_0x5621('0x49')](handleError(_0x4199d3,null));};exports[_0x5621('0x27')]=function(_0x4ab046,_0x1370df){return db[_0x5621('0x31')][_0x5621('0x4c')]({'where':{'id':_0x4ab046['params']['id']}})[_0x5621('0x26')](handleEntityNotFound(_0x1370df,null))[_0x5621('0x26')](removeEntity(_0x1370df,null))['catch'](handleError(_0x1370df,null));};exports[_0x5621('0x4f')]=function(_0x556b96,_0x2e6dab){var _0x54223c={'key':_0x556b96['body']['key']};if(_0x556b96[_0x5621('0x4d')][_0x5621('0x50')]){_0x54223c[_0x5621('0x50')]=_0x556b96[_0x5621('0x4d')][_0x5621('0x50')];}else if(_0x556b96[_0x5621('0x4d')]['SmsAccountId']){_0x54223c[_0x5621('0x51')]=_0x556b96[_0x5621('0x4d')][_0x5621('0x51')];}else if(_0x556b96[_0x5621('0x4d')][_0x5621('0x52')]){_0x54223c[_0x5621('0x52')]=_0x556b96['body'][_0x5621('0x52')];}else if(_0x556b96['body'][_0x5621('0x53')]){_0x54223c['ChatWebsiteId']=_0x556b96[_0x5621('0x4d')][_0x5621('0x53')];}return db['CannedAnswer'][_0x5621('0x4c')]({'where':_0x54223c})[_0x5621('0x26')](function(_0x920fea){if(_0x920fea){throw new db[(_0x5621('0x54'))][(_0x5621('0x55'))](_0x5621('0x56'));}return db[_0x5621('0x31')][_0x5621('0x4f')](_0x556b96[_0x5621('0x4d')]);})['then'](function(_0x9467b1){var _0x238203=_0x556b96['user'][_0x5621('0x28')]({'plain':!![]});if(!_0x238203)throw new Error(_0x5621('0x57'));if(_0x238203[_0x5621('0x58')]===_0x5621('0x59')){var _0x17baaf=_0x9467b1[_0x5621('0x28')]({'plain':!![]});return db[_0x5621('0x5a')]['find']({'where':{'name':_0x5621('0x29'),'userProfileId':_0x238203[_0x5621('0x5b')]},'raw':!![]})[_0x5621('0x26')](function(_0x1e6261){if(_0x1e6261&&_0x1e6261[_0x5621('0x5c')]===0x0){return db['UserProfileResource'][_0x5621('0x4f')]({'name':_0x17baaf[_0x5621('0x2e')],'resourceId':_0x17baaf['id'],'type':_0x1e6261[_0x5621('0x2e')],'sectionId':_0x1e6261['id']},{})[_0x5621('0x26')](function(){return _0x9467b1;});}else{return _0x9467b1;}})[_0x5621('0x49')](function(_0x4551f8){logger['error'](_0x5621('0x5d'),_0x4551f8);throw _0x4551f8;});}return _0x9467b1;})[_0x5621('0x26')](respondWithResult(_0x2e6dab,0xc9))[_0x5621('0x49')](handleError(_0x2e6dab,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 6831e28..38758fe 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 _0xfa70=['define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xfa70,0x156));var _0x0fa7=function(_0x330f00,_0x2208d8){_0x330f00=_0x330f00-0x0;var _0x3c79d8=_0xfa70[_0x330f00];return _0x3c79d8;};'use strict';var _=require(_0x0fa7('0x0'));var util=require(_0x0fa7('0x1'));var logger=require(_0x0fa7('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0fa7('0x3'));var fs=require('fs');var path=require(_0x0fa7('0x4'));var rimraf=require(_0x0fa7('0x5'));var config=require(_0x0fa7('0x6'));var attributes=require(_0x0fa7('0x7'));module[_0x0fa7('0x8')]=function(_0x24ee39,_0x46ef20){return _0x24ee39[_0x0fa7('0x9')](_0x0fa7('0xa'),attributes,{'tableName':_0x0fa7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0fa7('0xc')});};
\ No newline at end of file
+var _0x0be6=['request-promise','rimraf','../../config/environment','exports','tools_canned_answers','utf8mb4','../../config/logger','api','moment'];(function(_0x3d7fc1,_0x12f61d){var _0x58c4f9=function(_0x250b01){while(--_0x250b01){_0x3d7fc1['push'](_0x3d7fc1['shift']());}};_0x58c4f9(++_0x12f61d);}(_0x0be6,0xa8));var _0x60be=function(_0x5f2d01,_0x146735){_0x5f2d01=_0x5f2d01-0x0;var _0x32b232=_0x0be6[_0x5f2d01];return _0x32b232;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x60be('0x0'))(_0x60be('0x1'));var moment=require(_0x60be('0x2'));var BPromise=require('bluebird');var rp=require(_0x60be('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x60be('0x4'));var config=require(_0x60be('0x5'));var attributes=require('./cannedAnswer.attributes');module[_0x60be('0x6')]=function(_0x3c717e,_0x1a53c9){return _0x3c717e['define']('CannedAnswer',attributes,{'tableName':_0x60be('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x60be('0x8'),'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 1a6527e..e234bff 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(_0x5f472e,_0x563808){var _0x4adebc=function(_0x54edad){while(--_0x54edad){_0x5f472e['push'](_0x5f472e['shift']());}};_0x4adebc(++_0x563808);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x20d398,_0x1845cb){var _0x26e881=function(_0xc6cda8){while(--_0xc6cda8){_0x20d398['push'](_0x20d398['shift']());}};_0x26e881(++_0x1845cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 335aa52..9d4f887 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 _0xbfd6=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x2047eb,_0x563c6b){var _0x4a2123=function(_0x11142d){while(--_0x11142d){_0x2047eb['push'](_0x2047eb['shift']());}};_0x4a2123(++_0x563c6b);}(_0xbfd6,0x16b));var _0x6bfd=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbfd6[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x6bfd('0x0'));var util=require(_0x6bfd('0x1'));var path=require(_0x6bfd('0x2'));var timeout=require(_0x6bfd('0x3'));var express=require(_0x6bfd('0x4'));var router=express[_0x6bfd('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6bfd('0x6'));var config=require('../../config/environment');var controller=require(_0x6bfd('0x7'));router['get']('/',auth[_0x6bfd('0x8')](),controller[_0x6bfd('0x9')]);router['get'](_0x6bfd('0xa'),auth[_0x6bfd('0x8')](),controller[_0x6bfd('0xb')]);router[_0x6bfd('0xc')]('/',auth[_0x6bfd('0x8')](),controller['create']);router[_0x6bfd('0xd')](_0x6bfd('0xa'),auth[_0x6bfd('0x8')](),controller[_0x6bfd('0xe')]);router[_0x6bfd('0xf')](_0x6bfd('0xa'),auth[_0x6bfd('0x8')](),controller[_0x6bfd('0x10')]);module[_0x6bfd('0x11')]=router;
\ No newline at end of file
+var _0x0fa9=['get','index','show','post','put','/:id','delete','isAuthenticated','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller'];(function(_0x144728,_0x11b05b){var _0x54cde2=function(_0x532b8b){while(--_0x532b8b){_0x144728['push'](_0x144728['shift']());}};_0x54cde2(++_0x11b05b);}(_0x0fa9,0x1a8));var _0x90fa=function(_0xcb5360,_0x5efb60){_0xcb5360=_0xcb5360-0x0;var _0x37d0d4=_0x0fa9[_0xcb5360];return _0x37d0d4;};'use strict';var multer=require(_0x90fa('0x0'));var util=require(_0x90fa('0x1'));var path=require(_0x90fa('0x2'));var timeout=require('connect-timeout');var express=require(_0x90fa('0x3'));var router=express['Router']();var fs_extra=require(_0x90fa('0x4'));var auth=require(_0x90fa('0x5'));var interaction=require(_0x90fa('0x6'));var config=require('../../config/environment');var controller=require(_0x90fa('0x7'));router[_0x90fa('0x8')]('/',auth['isAuthenticated'](),controller[_0x90fa('0x9')]);router[_0x90fa('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x90fa('0xa')]);router[_0x90fa('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x90fa('0xc')](_0x90fa('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x90fa('0xe')](_0x90fa('0xd'),auth[_0x90fa('0xf')](),controller[_0x90fa('0x10')]);module[_0x90fa('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 e037559..9c7e8cd 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 _0x3d15=['DATE','STRING','INTEGER','exports'];(function(_0x502d72,_0x22d8f5){var _0x4cbe7c=function(_0x5ecad5){while(--_0x5ecad5){_0x502d72['push'](_0x502d72['shift']());}};_0x4cbe7c(++_0x22d8f5);}(_0x3d15,0x127));var _0x53d1=function(_0x5b2809,_0x48b226){_0x5b2809=_0x5b2809-0x0;var _0x572dee=_0x3d15[_0x5b2809];return _0x572dee;};'use strict';var Sequelize=require('sequelize');module[_0x53d1('0x0')]={'calldate':{'type':Sequelize[_0x53d1('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x53d1('0x2')]},'src':{'type':Sequelize[_0x53d1('0x2')]},'dst':{'type':Sequelize[_0x53d1('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x53d1('0x2')]},'dstchannel':{'type':Sequelize[_0x53d1('0x2')]},'lastapp':{'type':Sequelize[_0x53d1('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x53d1('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x53d1('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x53d1('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x53d1('0x2')]},'userfield':{'type':Sequelize[_0x53d1('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x53d1('0x2')]},'sequence':{'type':Sequelize[_0x53d1('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x53d1('0x2')]}};
\ No newline at end of file
+var _0xa25d=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x3083ef,_0x258404){var _0x4aff52=function(_0x49fb2d){while(--_0x49fb2d){_0x3083ef['push'](_0x3083ef['shift']());}};_0x4aff52(++_0x258404);}(_0xa25d,0x194));var _0xda25=function(_0xd0cd54,_0x613e58){_0xd0cd54=_0xd0cd54-0x0;var _0x5f3f4f=_0xa25d[_0xd0cd54];return _0x5f3f4f;};'use strict';var Sequelize=require(_0xda25('0x0'));module[_0xda25('0x1')]={'calldate':{'type':Sequelize[_0xda25('0x2')],'allowNull':![],'defaultValue':_0xda25('0x3')},'clid':{'type':Sequelize[_0xda25('0x4')]},'src':{'type':Sequelize[_0xda25('0x4')]},'dst':{'type':Sequelize[_0xda25('0x4')]},'dcontext':{'type':Sequelize[_0xda25('0x4')]},'channel':{'type':Sequelize[_0xda25('0x4')]},'dstchannel':{'type':Sequelize[_0xda25('0x4')]},'lastapp':{'type':Sequelize[_0xda25('0x4')]},'lastdata':{'type':Sequelize[_0xda25('0x4')]},'duration':{'type':Sequelize[_0xda25('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xda25('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xda25('0x4')]},'amaflags':{'type':Sequelize[_0xda25('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xda25('0x4')]},'userfield':{'type':Sequelize[_0xda25('0x4')]},'uniqueid':{'type':Sequelize[_0xda25('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xda25('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 56151ed..20a25a5 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 _0xe14b=['rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','error','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','eml-format'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xe14b,0x93));var _0xbe14=function(_0x522710,_0x35be54){_0x522710=_0x522710-0x0;var _0x4845b4=_0xe14b[_0x522710];return _0x4845b4;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){_0x3d3608['status'](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x5fa043,_0x1ee9c1){return function(_0x39cc81){if(!_0x39cc81){_0x5fa043[_0xbe14('0x16')](0x194);}return _0x39cc81;};}function handleError(_0x2703f5,_0x55d001){_0x55d001=_0x55d001||0x1f4;return function(_0x1822e0){logger[_0xbe14('0x23')](_0x1822e0[_0xbe14('0x24')]);if(_0x1822e0[_0xbe14('0x25')]){delete _0x1822e0['name'];}_0x2703f5[_0xbe14('0x17')](_0x55d001)[_0xbe14('0x26')](_0x1822e0);};}exports['index']=function(_0x3c3613,_0x3b3e84){var _0x1c7cc7={},_0x19252f={},_0x34d648={'count':0x0,'rows':[]};var _0x36d4b2=_[_0xbe14('0x27')](db[_0xbe14('0x28')][_0xbe14('0x29')],function(_0x16a159){return{'name':_0x16a159[_0xbe14('0x2a')],'type':_0x16a159[_0xbe14('0x2b')][_0xbe14('0x2c')]};});_0x19252f[_0xbe14('0x2d')]=_[_0xbe14('0x27')](_0x36d4b2,_0xbe14('0x25'));_0x19252f[_0xbe14('0x2e')]=_[_0xbe14('0x2f')](_0x3c3613[_0xbe14('0x2e')]);_0x19252f[_0xbe14('0x30')]=_['intersection'](_0x19252f[_0xbe14('0x2d')],_0x19252f['query']);_0x1c7cc7['attributes']=_[_0xbe14('0x31')](_0x19252f['model'],qs[_0xbe14('0x32')](_0x3c3613[_0xbe14('0x2e')]['fields']));_0x1c7cc7['attributes']=_0x1c7cc7['attributes'][_0xbe14('0x33')]?_0x1c7cc7[_0xbe14('0x34')]:_0x19252f['model'];if(!_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x35')](_0xbe14('0x36'))){_0x1c7cc7[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x3c3613['query']['limit']);_0x1c7cc7[_0xbe14('0x1c')]=qs['offset'](_0x3c3613['query']['offset']);}_0x1c7cc7[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x38')]);_0x1c7cc7[_0xbe14('0x39')]=qs[_0xbe14('0x30')](_[_0xbe14('0x3a')](_0x3c3613[_0xbe14('0x2e')],_0x19252f[_0xbe14('0x30')]),_0x36d4b2);if(_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x3b')]){_0x1c7cc7[_0xbe14('0x39')]=_['merge'](_0x1c7cc7['where'],{'$or':_[_0xbe14('0x27')](_0x36d4b2,function(_0x2951e1){if(_0x2951e1[_0xbe14('0x2b')]!=='VIRTUAL'){var _0x326329={};_0x326329[_0x2951e1[_0xbe14('0x25')]]={'$like':'%'+_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x3b')]+'%'};return _0x326329;}})});}_0x1c7cc7=_[_0xbe14('0x3c')]({},_0x1c7cc7,_0x3c3613[_0xbe14('0x3d')]);var _0x19fa30={'where':_0x1c7cc7[_0xbe14('0x39')]};return db[_0xbe14('0x28')]['count'](_0x19fa30)[_0xbe14('0x22')](function(_0x841b71){_0x34d648[_0xbe14('0x1b')]=_0x841b71;if(_0x3c3613[_0xbe14('0x2e')][_0xbe14('0x3e')]){_0x1c7cc7[_0xbe14('0x3f')]=[{'all':!![]}];}return db['Cdr'][_0xbe14('0x40')](_0x1c7cc7);})[_0xbe14('0x22')](function(_0x1220c9){_0x34d648[_0xbe14('0x41')]=_0x1220c9;return _0x34d648;})['then'](respondWithFilteredResult(_0x3b3e84,_0x1c7cc7))['catch'](handleError(_0x3b3e84,null));};exports[_0xbe14('0x42')]=function(_0xe417b,_0x3272ae){var _0x51c859={'raw':!![],'where':{'id':_0xe417b[_0xbe14('0x43')]['id']}},_0x5d5318={};_0x5d5318['model']=_['keys'](db[_0xbe14('0x28')][_0xbe14('0x29')]);_0x5d5318[_0xbe14('0x2e')]=_['keys'](_0xe417b['query']);_0x5d5318['filters']=_[_0xbe14('0x31')](_0x5d5318[_0xbe14('0x2d')],_0x5d5318[_0xbe14('0x2e')]);_0x51c859['attributes']=_[_0xbe14('0x31')](_0x5d5318[_0xbe14('0x2d')],qs[_0xbe14('0x32')](_0xe417b[_0xbe14('0x2e')]['fields']));_0x51c859['attributes']=_0x51c859[_0xbe14('0x34')][_0xbe14('0x33')]?_0x51c859[_0xbe14('0x34')]:_0x5d5318[_0xbe14('0x2d')];if(_0xe417b[_0xbe14('0x2e')]['includeAll']){_0x51c859['include']=[{'all':!![]}];}_0x51c859=_[_0xbe14('0x3c')]({},_0x51c859,_0xe417b[_0xbe14('0x3d')]);return db[_0xbe14('0x28')][_0xbe14('0x44')](_0x51c859)['then'](handleEntityNotFound(_0x3272ae,null))[_0xbe14('0x22')](respondWithResult(_0x3272ae,null))[_0xbe14('0x45')](handleError(_0x3272ae,null));};exports['create']=function(_0x396e40,_0x2a35e5){return db[_0xbe14('0x28')][_0xbe14('0x46')](_0x396e40['body'],{})['then'](respondWithResult(_0x2a35e5,0xc9))[_0xbe14('0x45')](handleError(_0x2a35e5,null));};exports[_0xbe14('0x21')]=function(_0x4a1a37,_0x5acf90){if(_0x4a1a37[_0xbe14('0x47')]['id']){delete _0x4a1a37[_0xbe14('0x47')]['id'];}return db[_0xbe14('0x28')][_0xbe14('0x44')]({'where':{'id':_0x4a1a37[_0xbe14('0x43')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x5acf90,null))[_0xbe14('0x22')](saveUpdates(_0x4a1a37['body'],null))[_0xbe14('0x22')](respondWithResult(_0x5acf90,null))[_0xbe14('0x45')](handleError(_0x5acf90,null));};exports[_0xbe14('0x48')]=function(_0x22b1f8,_0x2fc073){return db['Cdr'][_0xbe14('0x44')]({'where':{'id':_0x22b1f8[_0xbe14('0x43')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x2fc073,null))[_0xbe14('0x22')](removeEntity(_0x2fc073,null))[_0xbe14('0x45')](handleError(_0x2fc073,null));};exports[_0xbe14('0x49')]=function(_0x505829,_0x5aeea9){return db[_0xbe14('0x28')][_0xbe14('0x49')]()[_0xbe14('0x22')](respondWithResult(_0x5aeea9,null))['catch'](handleError(_0x5aeea9,null));};
\ No newline at end of file
+var _0xbacd=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','Cdr','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x174b89,_0x3b749f){var _0x353e87=function(_0x1fc19c){while(--_0x1fc19c){_0x174b89['push'](_0x174b89['shift']());}};_0x353e87(++_0x3b749f);}(_0xbacd,0x1c5));var _0xdbac=function(_0x1e99f0,_0x32f11b){_0x1e99f0=_0x1e99f0-0x0;var _0x575377=_0xbacd[_0x1e99f0];return _0x575377;};'use strict';var emlformat=require(_0xdbac('0x0'));var rimraf=require(_0xdbac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdbac('0x2'));var rp=require(_0xdbac('0x3'));var moment=require(_0xdbac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdbac('0x5'));var util=require(_0xdbac('0x6'));var path=require(_0xdbac('0x7'));var sox=require(_0xdbac('0x8'));var csv=require(_0xdbac('0x9'));var ejs=require(_0xdbac('0xa'));var fs=require('fs');var fs_extra=require(_0xdbac('0xb'));var _=require(_0xdbac('0xc'));var squel=require(_0xdbac('0xd'));var crypto=require(_0xdbac('0xe'));var jsforce=require(_0xdbac('0xf'));var deskjs=require(_0xdbac('0x10'));var toCsv=require(_0xdbac('0x9'));var querystring=require(_0xdbac('0x11'));var Papa=require(_0xdbac('0x12'));var Redis=require('ioredis');var authService=require(_0xdbac('0x13'));var qs=require(_0xdbac('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdbac('0x15'));var logger=require('../../config/logger')(_0xdbac('0x16'));var utils=require(_0xdbac('0x17'));var config=require(_0xdbac('0x18'));var licenseUtil=require(_0xdbac('0x19'));var db=require(_0xdbac('0x1a'))['db'];function respondWithStatusCode(_0x1ebee0,_0xd9ec70){_0xd9ec70=_0xd9ec70||0xcc;return function(_0x2c7f44){if(_0x2c7f44){return _0x1ebee0[_0xdbac('0x1b')](_0xd9ec70);}return _0x1ebee0['status'](_0xd9ec70)[_0xdbac('0x1c')]();};}function respondWithResult(_0x1793b9,_0x1eed36){_0x1eed36=_0x1eed36||0xc8;return function(_0x14ebaa){if(_0x14ebaa){return _0x1793b9[_0xdbac('0x1d')](_0x1eed36)[_0xdbac('0x1e')](_0x14ebaa);}};}function respondWithFilteredResult(_0x94a61,_0x176da6){return function(_0x574e58){if(_0x574e58){var _0x2694ef=typeof _0x176da6[_0xdbac('0x1f')]===_0xdbac('0x20')&&typeof _0x176da6['limit']===_0xdbac('0x20');var _0x36e0de=_0x574e58[_0xdbac('0x21')];var _0x252fc1=_0x2694ef?0x0:_0x176da6[_0xdbac('0x1f')];var _0x1a9690=_0x2694ef?_0x574e58[_0xdbac('0x21')]:_0x176da6[_0xdbac('0x1f')]+_0x176da6[_0xdbac('0x22')];var _0x1301d2;if(_0x1a9690>=_0x36e0de){_0x1a9690=_0x36e0de;_0x1301d2=0xc8;}else{_0x1301d2=0xce;}_0x94a61[_0xdbac('0x1d')](_0x1301d2);return _0x94a61[_0xdbac('0x23')]('Content-Range',_0x252fc1+'-'+_0x1a9690+'/'+_0x36e0de)[_0xdbac('0x1e')](_0x574e58);}return null;};}function patchUpdates(_0x323801){return function(_0x4e4af9){try{jsonpatch[_0xdbac('0x24')](_0x4e4af9,_0x323801,!![]);}catch(_0x582c0b){return BPromise[_0xdbac('0x25')](_0x582c0b);}return _0x4e4af9['save']();};}function saveUpdates(_0x1ead7b,_0x2bcf69){return function(_0x20642c){if(_0x20642c){return _0x20642c[_0xdbac('0x26')](_0x1ead7b)[_0xdbac('0x27')](function(_0x4148fc){return _0x4148fc;});}return null;};}function removeEntity(_0x28393a,_0x4e68b0){return function(_0x361930){if(_0x361930){return _0x361930[_0xdbac('0x28')]()[_0xdbac('0x27')](function(){_0x28393a[_0xdbac('0x1d')](0xcc)[_0xdbac('0x1c')]();});}};}function handleEntityNotFound(_0x2b4cda,_0x3a0f3f){return function(_0x15653d){if(!_0x15653d){_0x2b4cda[_0xdbac('0x1b')](0x194);}return _0x15653d;};}function handleError(_0x175ebc,_0x2cb8b4){_0x2cb8b4=_0x2cb8b4||0x1f4;return function(_0x1ea3c3){logger[_0xdbac('0x29')](_0x1ea3c3[_0xdbac('0x2a')]);if(_0x1ea3c3[_0xdbac('0x2b')]){delete _0x1ea3c3[_0xdbac('0x2b')];}_0x175ebc[_0xdbac('0x1d')](_0x2cb8b4)[_0xdbac('0x2c')](_0x1ea3c3);};}exports[_0xdbac('0x2d')]=function(_0xe744cc,_0x1caa18){var _0x4e7ef9={},_0x446a32={},_0x397f3d={'count':0x0,'rows':[]};var _0x43c0a3=_[_0xdbac('0x2e')](db['Cdr']['rawAttributes'],function(_0x10c3c8){return{'name':_0x10c3c8[_0xdbac('0x2f')],'type':_0x10c3c8[_0xdbac('0x30')][_0xdbac('0x31')]};});_0x446a32['model']=_[_0xdbac('0x2e')](_0x43c0a3,_0xdbac('0x2b'));_0x446a32[_0xdbac('0x32')]=_[_0xdbac('0x33')](_0xe744cc[_0xdbac('0x32')]);_0x446a32[_0xdbac('0x34')]=_[_0xdbac('0x35')](_0x446a32[_0xdbac('0x36')],_0x446a32['query']);_0x4e7ef9['attributes']=_[_0xdbac('0x35')](_0x446a32[_0xdbac('0x36')],qs[_0xdbac('0x37')](_0xe744cc[_0xdbac('0x32')]['fields']));_0x4e7ef9['attributes']=_0x4e7ef9[_0xdbac('0x38')][_0xdbac('0x39')]?_0x4e7ef9[_0xdbac('0x38')]:_0x446a32[_0xdbac('0x36')];if(!_0xe744cc[_0xdbac('0x32')][_0xdbac('0x3a')](_0xdbac('0x3b'))){_0x4e7ef9[_0xdbac('0x22')]=qs[_0xdbac('0x22')](_0xe744cc[_0xdbac('0x32')][_0xdbac('0x22')]);_0x4e7ef9[_0xdbac('0x1f')]=qs[_0xdbac('0x1f')](_0xe744cc['query'][_0xdbac('0x1f')]);}_0x4e7ef9['order']=qs[_0xdbac('0x3c')](_0xe744cc[_0xdbac('0x32')][_0xdbac('0x3c')]);_0x4e7ef9[_0xdbac('0x3d')]=qs['filters'](_[_0xdbac('0x3e')](_0xe744cc[_0xdbac('0x32')],_0x446a32['filters']),_0x43c0a3);if(_0xe744cc['query'][_0xdbac('0x3f')]){_0x4e7ef9['where']=_['merge'](_0x4e7ef9[_0xdbac('0x3d')],{'$or':_[_0xdbac('0x2e')](_0x43c0a3,function(_0x6c5ecc){if(_0x6c5ecc['type']!==_0xdbac('0x40')){var _0x35f8b7={};_0x35f8b7[_0x6c5ecc[_0xdbac('0x2b')]]={'$like':'%'+_0xe744cc[_0xdbac('0x32')]['filter']+'%'};return _0x35f8b7;}})});}_0x4e7ef9=_['merge']({},_0x4e7ef9,_0xe744cc[_0xdbac('0x41')]);var _0x124904={'where':_0x4e7ef9[_0xdbac('0x3d')]};return db[_0xdbac('0x42')][_0xdbac('0x21')](_0x124904)['then'](function(_0x1a27a4){_0x397f3d[_0xdbac('0x21')]=_0x1a27a4;if(_0xe744cc['query'][_0xdbac('0x43')]){_0x4e7ef9[_0xdbac('0x44')]=[{'all':!![]}];}return db[_0xdbac('0x42')][_0xdbac('0x45')](_0x4e7ef9);})[_0xdbac('0x27')](function(_0x575b59){_0x397f3d[_0xdbac('0x46')]=_0x575b59;return _0x397f3d;})[_0xdbac('0x27')](respondWithFilteredResult(_0x1caa18,_0x4e7ef9))[_0xdbac('0x47')](handleError(_0x1caa18,null));};exports[_0xdbac('0x48')]=function(_0x726ba4,_0x25344a){var _0x2589e1={'raw':!![],'where':{'id':_0x726ba4[_0xdbac('0x49')]['id']}},_0x3c1894={};_0x3c1894[_0xdbac('0x36')]=_[_0xdbac('0x33')](db[_0xdbac('0x42')]['rawAttributes']);_0x3c1894['query']=_['keys'](_0x726ba4['query']);_0x3c1894[_0xdbac('0x34')]=_[_0xdbac('0x35')](_0x3c1894[_0xdbac('0x36')],_0x3c1894[_0xdbac('0x32')]);_0x2589e1[_0xdbac('0x38')]=_[_0xdbac('0x35')](_0x3c1894[_0xdbac('0x36')],qs[_0xdbac('0x37')](_0x726ba4[_0xdbac('0x32')]['fields']));_0x2589e1['attributes']=_0x2589e1['attributes'][_0xdbac('0x39')]?_0x2589e1[_0xdbac('0x38')]:_0x3c1894['model'];if(_0x726ba4['query']['includeAll']){_0x2589e1[_0xdbac('0x44')]=[{'all':!![]}];}_0x2589e1=_[_0xdbac('0x4a')]({},_0x2589e1,_0x726ba4[_0xdbac('0x41')]);return db['Cdr'][_0xdbac('0x4b')](_0x2589e1)[_0xdbac('0x27')](handleEntityNotFound(_0x25344a,null))[_0xdbac('0x27')](respondWithResult(_0x25344a,null))[_0xdbac('0x47')](handleError(_0x25344a,null));};exports[_0xdbac('0x4c')]=function(_0x5b8aca,_0x35696f){return db[_0xdbac('0x42')][_0xdbac('0x4c')](_0x5b8aca[_0xdbac('0x4d')],{})['then'](respondWithResult(_0x35696f,0xc9))[_0xdbac('0x47')](handleError(_0x35696f,null));};exports[_0xdbac('0x26')]=function(_0x1463ca,_0x5d6e86){if(_0x1463ca[_0xdbac('0x4d')]['id']){delete _0x1463ca[_0xdbac('0x4d')]['id'];}return db[_0xdbac('0x42')][_0xdbac('0x4b')]({'where':{'id':_0x1463ca[_0xdbac('0x49')]['id']}})[_0xdbac('0x27')](handleEntityNotFound(_0x5d6e86,null))['then'](saveUpdates(_0x1463ca[_0xdbac('0x4d')],null))[_0xdbac('0x27')](respondWithResult(_0x5d6e86,null))['catch'](handleError(_0x5d6e86,null));};exports[_0xdbac('0x28')]=function(_0x12b600,_0x26ee2e){return db[_0xdbac('0x42')]['find']({'where':{'id':_0x12b600['params']['id']}})[_0xdbac('0x27')](handleEntityNotFound(_0x26ee2e,null))[_0xdbac('0x27')](removeEntity(_0x26ee2e,null))['catch'](handleError(_0x26ee2e,null));};exports['describe']=function(_0x3f0b35,_0x538747){return db[_0xdbac('0x42')][_0xdbac('0x4e')]()[_0xdbac('0x27')](respondWithResult(_0x538747,null))['catch'](handleError(_0x538747,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 4249787..1ef2143 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5b987b,_0x127cbc){var _0xa973b9=function(_0x17a9f4){while(--_0x17a9f4){_0x5b987b['push'](_0x5b987b['shift']());}};_0xa973b9(++_0x127cbc);}(_0x7a54,0x106));var _0x47a5=function(_0x3e049e,_0x3a63b6){_0x3e049e=_0x3e049e-0x0;var _0x59e196=_0x7a54[_0x3e049e];return _0x59e196;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x40369e,_0x1a7a0c){var _0x2945af=function(_0x4f11ef){while(--_0x4f11ef){_0x40369e['push'](_0x40369e['shift']());}};_0x2945af(++_0x1a7a0c);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 6534b6b..cde9931 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 _0x8155=['then','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x48aaca,_0x140945){var _0xac5ed9=function(_0x180b19){while(--_0x180b19){_0x48aaca['push'](_0x48aaca['shift']());}};_0xac5ed9(++_0x140945);}(_0x8155,0x196));var _0x5815=function(_0xd4d59a,_0x524fc0){_0xd4d59a=_0xd4d59a-0x0;var _0x52eacc=_0x8155[_0xd4d59a];return _0x52eacc;};'use strict';var _=require(_0x5815('0x0'));var util=require(_0x5815('0x1'));var moment=require(_0x5815('0x2'));var BPromise=require('bluebird');var rs=require(_0x5815('0x3'));var fs=require('fs');var Redis=require(_0x5815('0x4'));var db=require(_0x5815('0x5'))['db'];var utils=require(_0x5815('0x6'));var logger=require(_0x5815('0x7'))(_0x5815('0x8'));var config=require(_0x5815('0x9'));var jayson=require(_0x5815('0xa'));var client=jayson[_0x5815('0xb')][_0x5815('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x298927,_0x478e67,_0xd3a605){return new BPromise(function(_0x5ece98,_0x417ae5){return client[_0x5815('0xd')](_0x298927,_0xd3a605)[_0x5815('0xe')](function(_0x6ee732){logger['info'](_0x5815('0xf'),_0x478e67,_0x5815('0x10'));logger['debug'](_0x5815('0x11'),_0x478e67,_0x5815('0x10'),JSON['stringify'](_0x6ee732));if(_0x6ee732[_0x5815('0x12')]){if(_0x6ee732['error']['code']===0x1f4){logger[_0x5815('0x12')](_0x5815('0xf'),_0x478e67,_0x6ee732['error'][_0x5815('0x13')]);return _0x417ae5(_0x6ee732[_0x5815('0x12')][_0x5815('0x13')]);}logger[_0x5815('0x12')](_0x5815('0xf'),_0x478e67,_0x6ee732['error'][_0x5815('0x13')]);return _0x5ece98(_0x6ee732['error'][_0x5815('0x13')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x478e67,_0x5815('0x10'));_0x5ece98(_0x6ee732['result']['message']);}})[_0x5815('0x14')](function(_0x3ecb7e){logger[_0x5815('0x12')]('Cdr,\x20%s,\x20%s',_0x478e67,_0x3ecb7e);_0x417ae5(_0x3ecb7e);});});}
\ No newline at end of file
+var _0xc2a7=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5f382f,_0x3f1432){var _0x3bb11b=function(_0x4daf9b){while(--_0x4daf9b){_0x5f382f['push'](_0x5f382f['shift']());}};_0x3bb11b(++_0x3f1432);}(_0xc2a7,0x1aa));var _0x7c2a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc2a7[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x7c2a('0x0'));var util=require(_0x7c2a('0x1'));var moment=require('moment');var BPromise=require(_0x7c2a('0x2'));var rs=require(_0x7c2a('0x3'));var fs=require('fs');var Redis=require(_0x7c2a('0x4'));var db=require(_0x7c2a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c2a('0x6'))(_0x7c2a('0x7'));var config=require(_0x7c2a('0x8'));var jayson=require(_0x7c2a('0x9'));var client=jayson[_0x7c2a('0xa')][_0x7c2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e2b70,_0x4cc237,_0x2368ca){return new BPromise(function(_0xc444e7,_0x1fae5a){return client[_0x7c2a('0xc')](_0x4e2b70,_0x2368ca)[_0x7c2a('0xd')](function(_0x4c450b){logger[_0x7c2a('0xe')](_0x7c2a('0xf'),_0x4cc237,'request\x20sent');logger[_0x7c2a('0x10')](_0x7c2a('0x11'),_0x4cc237,_0x7c2a('0x12'),JSON['stringify'](_0x4c450b));if(_0x4c450b[_0x7c2a('0x13')]){if(_0x4c450b['error'][_0x7c2a('0x14')]===0x1f4){logger[_0x7c2a('0x13')](_0x7c2a('0xf'),_0x4cc237,_0x4c450b[_0x7c2a('0x13')][_0x7c2a('0x15')]);return _0x1fae5a(_0x4c450b['error'][_0x7c2a('0x15')]);}logger[_0x7c2a('0x13')](_0x7c2a('0xf'),_0x4cc237,_0x4c450b[_0x7c2a('0x13')][_0x7c2a('0x15')]);return _0xc444e7(_0x4c450b['error'][_0x7c2a('0x15')]);}else{logger[_0x7c2a('0xe')]('Cdr,\x20%s,\x20%s',_0x4cc237,_0x7c2a('0x12'));_0xc444e7(_0x4c450b[_0x7c2a('0x16')][_0x7c2a('0x15')]);}})[_0x7c2a('0x17')](function(_0x43a36a){logger[_0x7c2a('0x13')](_0x7c2a('0xf'),_0x4cc237,_0x43a36a);_0x1fae5a(_0x43a36a);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 952dcc2..93e519c 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+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(_0x254040,_0x10a23a){var _0xab5fa5=function(_0x18f9fd){while(--_0x18f9fd){_0x254040['push'](_0x254040['shift']());}};_0xab5fa5(++_0x10a23a);}(_0xb10b,0x12a));var _0xbb10=function(_0x5e9b23,_0x3069fd){_0x5e9b23=_0x5e9b23-0x0;var _0x27501f=_0xb10b[_0x5e9b23];return _0x27501f;};'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
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 0996ad2..9c062d0 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 _0xa87a=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x33aeff,_0x5ca889){var _0xa1f400=function(_0x25cf9a){while(--_0x25cf9a){_0x33aeff['push'](_0x33aeff['shift']());}};_0xa1f400(++_0x5ca889);}(_0xa87a,0xfe));var _0xaa87=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0xa87a[_0x18abd2];return _0x1dcad6;};'use strict';var Sequelize=require(_0xaa87('0x0'));module[_0xaa87('0x1')]={'priority':{'type':Sequelize[_0xaa87('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xaa87('0x3')},'appdata':{'type':Sequelize[_0xaa87('0x4')]()},'description':{'type':Sequelize[_0xaa87('0x5')]},'interval':{'type':Sequelize[_0xaa87('0x5')],'defaultValue':_0xaa87('0x6')}};
\ No newline at end of file
+var _0xa0cb=['TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x524e39,_0x5b9fb6){var _0xd0aeb5=function(_0x4e5e08){while(--_0x4e5e08){_0x524e39['push'](_0x524e39['shift']());}};_0xd0aeb5(++_0x5b9fb6);}(_0xa0cb,0x70));var _0xba0c=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xa0cb[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require('sequelize');module[_0xba0c('0x0')]={'priority':{'type':Sequelize[_0xba0c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xba0c('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xba0c('0x3')]()},'description':{'type':Sequelize[_0xba0c('0x2')]},'interval':{'type':Sequelize[_0xba0c('0x2')],'defaultValue':_0xba0c('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index f06fea8..0cc14c4 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 _0x4e5c=['merge','options','then','catch','body','eml-format','zip-dir','request-promise','moment','bluebird','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','status','offset','undefined','limit','count','set','save','update','destroy','error','stack','name','send','params','keys','ChatApplication','query','intersection','model','fields','attributes','length','includeAll','include'];(function(_0x3cbd16,_0x452307){var _0x41f5eb=function(_0x3bfe89){while(--_0x3bfe89){_0x3cbd16['push'](_0x3cbd16['shift']());}};_0x41f5eb(++_0x452307);}(_0x4e5c,0x149));var _0xc4e5=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x4e5c[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0xc4e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4e5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc4e5('0x2'));var moment=require(_0xc4e5('0x3'));var BPromise=require(_0xc4e5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc4e5('0x5'));var csv=require(_0xc4e5('0x6'));var ejs=require(_0xc4e5('0x7'));var fs=require('fs');var fs_extra=require(_0xc4e5('0x8'));var _=require(_0xc4e5('0x9'));var squel=require(_0xc4e5('0xa'));var crypto=require(_0xc4e5('0xb'));var jsforce=require(_0xc4e5('0xc'));var deskjs=require(_0xc4e5('0xd'));var toCsv=require(_0xc4e5('0x6'));var querystring=require(_0xc4e5('0xe'));var Papa=require(_0xc4e5('0xf'));var Redis=require('ioredis');var authService=require(_0xc4e5('0x10'));var qs=require(_0xc4e5('0x11'));var as=require(_0xc4e5('0x12'));var hardwareService=require(_0xc4e5('0x13'));var logger=require('../../config/logger')(_0xc4e5('0x14'));var utils=require(_0xc4e5('0x15'));var config=require(_0xc4e5('0x16'));var licenseUtil=require(_0xc4e5('0x17'));var db=require(_0xc4e5('0x18'))['db'];function respondWithStatusCode(_0x418b8b,_0x3fa318){_0x3fa318=_0x3fa318||0xcc;return function(_0x54c5a7){if(_0x54c5a7){return _0x418b8b['sendStatus'](_0x3fa318);}return _0x418b8b[_0xc4e5('0x19')](_0x3fa318)['end']();};}function respondWithResult(_0x3f8150,_0x7cd002){_0x7cd002=_0x7cd002||0xc8;return function(_0x303037){if(_0x303037){return _0x3f8150[_0xc4e5('0x19')](_0x7cd002)['json'](_0x303037);}};}function respondWithFilteredResult(_0x1b7d62,_0x528de4){return function(_0x338c37){if(_0x338c37){var _0x3beb59=typeof _0x528de4[_0xc4e5('0x1a')]===_0xc4e5('0x1b')&&typeof _0x528de4[_0xc4e5('0x1c')]===_0xc4e5('0x1b');var _0x228232=_0x338c37[_0xc4e5('0x1d')];var _0x170c0c=_0x3beb59?0x0:_0x528de4['offset'];var _0x252b5a=_0x3beb59?_0x338c37[_0xc4e5('0x1d')]:_0x528de4['offset']+_0x528de4[_0xc4e5('0x1c')];var _0x33eef8;if(_0x252b5a>=_0x228232){_0x252b5a=_0x228232;_0x33eef8=0xc8;}else{_0x33eef8=0xce;}_0x1b7d62['status'](_0x33eef8);return _0x1b7d62[_0xc4e5('0x1e')]('Content-Range',_0x170c0c+'-'+_0x252b5a+'/'+_0x228232)['json'](_0x338c37);}return null;};}function patchUpdates(_0x2f2970){return function(_0x7dbe6d){try{jsonpatch['apply'](_0x7dbe6d,_0x2f2970,!![]);}catch(_0x34f4e8){return BPromise['reject'](_0x34f4e8);}return _0x7dbe6d[_0xc4e5('0x1f')]();};}function saveUpdates(_0x37e869,_0x505078){return function(_0x546949){if(_0x546949){return _0x546949[_0xc4e5('0x20')](_0x37e869)['then'](function(_0x69cb24){return _0x69cb24;});}return null;};}function removeEntity(_0x41467f,_0x4bb973){return function(_0x4ed1ff){if(_0x4ed1ff){return _0x4ed1ff[_0xc4e5('0x21')]()['then'](function(){_0x41467f[_0xc4e5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x460fd8,_0x234b31){return function(_0x53f7cd){if(!_0x53f7cd){_0x460fd8['sendStatus'](0x194);}return _0x53f7cd;};}function handleError(_0x4b379b,_0x23889c){_0x23889c=_0x23889c||0x1f4;return function(_0x183ec7){logger[_0xc4e5('0x22')](_0x183ec7[_0xc4e5('0x23')]);if(_0x183ec7[_0xc4e5('0x24')]){delete _0x183ec7[_0xc4e5('0x24')];}_0x4b379b[_0xc4e5('0x19')](_0x23889c)[_0xc4e5('0x25')](_0x183ec7);};}exports['show']=function(_0x1cd4d9,_0x2ad4be){var _0x261b88={'raw':!![],'where':{'id':_0x1cd4d9[_0xc4e5('0x26')]['id']}},_0x23383b={};_0x23383b['model']=_[_0xc4e5('0x27')](db[_0xc4e5('0x28')]['rawAttributes']);_0x23383b[_0xc4e5('0x29')]=_['keys'](_0x1cd4d9[_0xc4e5('0x29')]);_0x23383b['filters']=_[_0xc4e5('0x2a')](_0x23383b['model'],_0x23383b[_0xc4e5('0x29')]);_0x261b88['attributes']=_['intersection'](_0x23383b[_0xc4e5('0x2b')],qs[_0xc4e5('0x2c')](_0x1cd4d9[_0xc4e5('0x29')][_0xc4e5('0x2c')]));_0x261b88['attributes']=_0x261b88[_0xc4e5('0x2d')][_0xc4e5('0x2e')]?_0x261b88[_0xc4e5('0x2d')]:_0x23383b[_0xc4e5('0x2b')];if(_0x1cd4d9['query'][_0xc4e5('0x2f')]){_0x261b88[_0xc4e5('0x30')]=[{'all':!![]}];}_0x261b88=_[_0xc4e5('0x31')]({},_0x261b88,_0x1cd4d9[_0xc4e5('0x32')]);return db[_0xc4e5('0x28')]['find'](_0x261b88)[_0xc4e5('0x33')](handleEntityNotFound(_0x2ad4be,null))[_0xc4e5('0x33')](respondWithResult(_0x2ad4be,null))[_0xc4e5('0x34')](handleError(_0x2ad4be,null));};exports['update']=function(_0x44551b,_0x1c78ec){if(_0x44551b[_0xc4e5('0x35')]['id']){delete _0x44551b[_0xc4e5('0x35')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x44551b[_0xc4e5('0x26')]['id']}})[_0xc4e5('0x33')](handleEntityNotFound(_0x1c78ec,null))[_0xc4e5('0x33')](saveUpdates(_0x44551b[_0xc4e5('0x35')],null))[_0xc4e5('0x33')](respondWithResult(_0x1c78ec,null))[_0xc4e5('0x34')](handleError(_0x1c78ec,null));};exports[_0xc4e5('0x21')]=function(_0x2439ee,_0x20bbce){return db['ChatApplication']['find']({'where':{'id':_0x2439ee[_0xc4e5('0x26')]['id']}})[_0xc4e5('0x33')](handleEntityNotFound(_0x20bbce,null))[_0xc4e5('0x33')](removeEntity(_0x20bbce,null))[_0xc4e5('0x34')](handleError(_0x20bbce,null));};
\ No newline at end of file
+var _0xd3a0=['ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','show','params','model','rawAttributes','query','keys','intersection','attributes','length','includeAll','include','merge','options','ChatApplication','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv'];(function(_0x490321,_0x4fc6f7){var _0x40c642=function(_0x51c643){while(--_0x51c643){_0x490321['push'](_0x490321['shift']());}};_0x40c642(++_0x4fc6f7);}(_0xd3a0,0xaa));var _0x0d3a=function(_0x4dbcf9,_0x60c00){_0x4dbcf9=_0x4dbcf9-0x0;var _0x15fea7=_0xd3a0[_0x4dbcf9];return _0x15fea7;};'use strict';var emlformat=require(_0x0d3a('0x0'));var rimraf=require(_0x0d3a('0x1'));var zipdir=require(_0x0d3a('0x2'));var jsonpatch=require(_0x0d3a('0x3'));var rp=require('request-promise');var moment=require(_0x0d3a('0x4'));var BPromise=require(_0x0d3a('0x5'));var Mustache=require(_0x0d3a('0x6'));var util=require(_0x0d3a('0x7'));var path=require(_0x0d3a('0x8'));var sox=require('sox');var csv=require(_0x0d3a('0x9'));var ejs=require(_0x0d3a('0xa'));var fs=require('fs');var fs_extra=require(_0x0d3a('0xb'));var _=require(_0x0d3a('0xc'));var squel=require(_0x0d3a('0xd'));var crypto=require('crypto');var jsforce=require(_0x0d3a('0xe'));var deskjs=require(_0x0d3a('0xf'));var toCsv=require(_0x0d3a('0x9'));var querystring=require(_0x0d3a('0x10'));var Papa=require(_0x0d3a('0x11'));var Redis=require(_0x0d3a('0x12'));var authService=require(_0x0d3a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0d3a('0x14'));var hardwareService=require(_0x0d3a('0x15'));var logger=require('../../config/logger')(_0x0d3a('0x16'));var utils=require(_0x0d3a('0x17'));var config=require(_0x0d3a('0x18'));var licenseUtil=require(_0x0d3a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47f5a8,_0x1d5f00){_0x1d5f00=_0x1d5f00||0xcc;return function(_0x36f478){if(_0x36f478){return _0x47f5a8[_0x0d3a('0x1a')](_0x1d5f00);}return _0x47f5a8[_0x0d3a('0x1b')](_0x1d5f00)[_0x0d3a('0x1c')]();};}function respondWithResult(_0x744a13,_0x2aa44b){_0x2aa44b=_0x2aa44b||0xc8;return function(_0x18a590){if(_0x18a590){return _0x744a13[_0x0d3a('0x1b')](_0x2aa44b)[_0x0d3a('0x1d')](_0x18a590);}};}function respondWithFilteredResult(_0x220f73,_0x5cadf7){return function(_0x516451){if(_0x516451){var _0x37c833=typeof _0x5cadf7[_0x0d3a('0x1e')]===_0x0d3a('0x1f')&&typeof _0x5cadf7[_0x0d3a('0x20')]===_0x0d3a('0x1f');var _0x2c8cd9=_0x516451[_0x0d3a('0x21')];var _0x456db7=_0x37c833?0x0:_0x5cadf7['offset'];var _0x1aad89=_0x37c833?_0x516451['count']:_0x5cadf7[_0x0d3a('0x1e')]+_0x5cadf7[_0x0d3a('0x20')];var _0x44413a;if(_0x1aad89>=_0x2c8cd9){_0x1aad89=_0x2c8cd9;_0x44413a=0xc8;}else{_0x44413a=0xce;}_0x220f73['status'](_0x44413a);return _0x220f73[_0x0d3a('0x22')]('Content-Range',_0x456db7+'-'+_0x1aad89+'/'+_0x2c8cd9)['json'](_0x516451);}return null;};}function patchUpdates(_0x31412f){return function(_0x4b9ca4){try{jsonpatch[_0x0d3a('0x23')](_0x4b9ca4,_0x31412f,!![]);}catch(_0x34278e){return BPromise[_0x0d3a('0x24')](_0x34278e);}return _0x4b9ca4[_0x0d3a('0x25')]();};}function saveUpdates(_0x339ffb,_0x1a2524){return function(_0x2ec7c8){if(_0x2ec7c8){return _0x2ec7c8[_0x0d3a('0x26')](_0x339ffb)[_0x0d3a('0x27')](function(_0x69e26d){return _0x69e26d;});}return null;};}function removeEntity(_0x4c54f9,_0x56f062){return function(_0x1b20d4){if(_0x1b20d4){return _0x1b20d4['destroy']()['then'](function(){_0x4c54f9[_0x0d3a('0x1b')](0xcc)[_0x0d3a('0x1c')]();});}};}function handleEntityNotFound(_0x1e8873,_0xd3d2bc){return function(_0xd4af83){if(!_0xd4af83){_0x1e8873[_0x0d3a('0x1a')](0x194);}return _0xd4af83;};}function handleError(_0x1ead03,_0x13bc05){_0x13bc05=_0x13bc05||0x1f4;return function(_0x2eeaf0){logger['error'](_0x2eeaf0[_0x0d3a('0x28')]);if(_0x2eeaf0[_0x0d3a('0x29')]){delete _0x2eeaf0['name'];}_0x1ead03[_0x0d3a('0x1b')](_0x13bc05)[_0x0d3a('0x2a')](_0x2eeaf0);};}exports[_0x0d3a('0x2b')]=function(_0x19ada3,_0x222c56){var _0x4ab37b={'raw':!![],'where':{'id':_0x19ada3[_0x0d3a('0x2c')]['id']}},_0x3b1875={};_0x3b1875[_0x0d3a('0x2d')]=_['keys'](db['ChatApplication'][_0x0d3a('0x2e')]);_0x3b1875[_0x0d3a('0x2f')]=_[_0x0d3a('0x30')](_0x19ada3[_0x0d3a('0x2f')]);_0x3b1875['filters']=_[_0x0d3a('0x31')](_0x3b1875[_0x0d3a('0x2d')],_0x3b1875[_0x0d3a('0x2f')]);_0x4ab37b['attributes']=_[_0x0d3a('0x31')](_0x3b1875[_0x0d3a('0x2d')],qs['fields'](_0x19ada3[_0x0d3a('0x2f')]['fields']));_0x4ab37b[_0x0d3a('0x32')]=_0x4ab37b[_0x0d3a('0x32')][_0x0d3a('0x33')]?_0x4ab37b[_0x0d3a('0x32')]:_0x3b1875[_0x0d3a('0x2d')];if(_0x19ada3[_0x0d3a('0x2f')][_0x0d3a('0x34')]){_0x4ab37b[_0x0d3a('0x35')]=[{'all':!![]}];}_0x4ab37b=_[_0x0d3a('0x36')]({},_0x4ab37b,_0x19ada3[_0x0d3a('0x37')]);return db[_0x0d3a('0x38')]['find'](_0x4ab37b)[_0x0d3a('0x27')](handleEntityNotFound(_0x222c56,null))[_0x0d3a('0x27')](respondWithResult(_0x222c56,null))[_0x0d3a('0x39')](handleError(_0x222c56,null));};exports[_0x0d3a('0x26')]=function(_0x579134,_0x5d9e43){if(_0x579134[_0x0d3a('0x3a')]['id']){delete _0x579134['body']['id'];}return db[_0x0d3a('0x38')]['find']({'where':{'id':_0x579134[_0x0d3a('0x2c')]['id']}})[_0x0d3a('0x27')](handleEntityNotFound(_0x5d9e43,null))['then'](saveUpdates(_0x579134[_0x0d3a('0x3a')],null))[_0x0d3a('0x27')](respondWithResult(_0x5d9e43,null))[_0x0d3a('0x39')](handleError(_0x5d9e43,null));};exports['destroy']=function(_0x164b1c,_0x47edc5){return db[_0x0d3a('0x38')][_0x0d3a('0x3b')]({'where':{'id':_0x164b1c[_0x0d3a('0x2c')]['id']}})[_0x0d3a('0x27')](handleEntityNotFound(_0x47edc5,null))['then'](removeEntity(_0x47edc5,null))[_0x0d3a('0x39')](handleError(_0x47edc5,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 4d281ec..47b34e0 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 _0xf0cc=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','lodash','api','request-promise','path'];(function(_0x4b91a7,_0x3a9a0b){var _0x598700=function(_0x2465aa){while(--_0x2465aa){_0x4b91a7['push'](_0x4b91a7['shift']());}};_0x598700(++_0x3a9a0b);}(_0xf0cc,0xa7));var _0xcf0c=function(_0x477b32,_0x5135ca){_0x477b32=_0x477b32-0x0;var _0x1d99be=_0xf0cc[_0x477b32];return _0x1d99be;};'use strict';var _=require(_0xcf0c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcf0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcf0c('0x2'));var fs=require('fs');var path=require(_0xcf0c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf0c('0x4'));module[_0xcf0c('0x5')]=function(_0x1a6003,_0x497363){return _0x1a6003[_0xcf0c('0x6')](_0xcf0c('0x7'),attributes,{'tableName':_0xcf0c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x3617=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications'];(function(_0x4818d1,_0x5f58bb){var _0x509563=function(_0x2f2768){while(--_0x2f2768){_0x4818d1['push'](_0x4818d1['shift']());}};_0x509563(++_0x5f58bb);}(_0x3617,0xec));var _0x7361=function(_0x497441,_0x4bdf27){_0x497441=_0x497441-0x0;var _0x59dd2e=_0x3617[_0x497441];return _0x59dd2e;};'use strict';var _=require(_0x7361('0x0'));var util=require(_0x7361('0x1'));var logger=require(_0x7361('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7361('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7361('0x4'));var rimraf=require(_0x7361('0x5'));var config=require(_0x7361('0x6'));var attributes=require(_0x7361('0x7'));module[_0x7361('0x8')]=function(_0x5de3a6,_0x414815){return _0x5de3a6[_0x7361('0x9')]('ChatApplication',attributes,{'tableName':_0x7361('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7361('0xb'),'collate':_0x7361('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 6d34a8a..91c01ad 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 _0x06a9=['../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','request\x20sent','result','util','moment','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0x06a9,0x144));var _0x906a=function(_0x4e8224,_0x3d9649){_0x4e8224=_0x4e8224-0x0;var _0x78c86e=_0x06a9[_0x4e8224];return _0x78c86e;};'use strict';var _=require('lodash');var util=require(_0x906a('0x0'));var moment=require(_0x906a('0x1'));var BPromise=require('bluebird');var rs=require(_0x906a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x906a('0x3'));var logger=require(_0x906a('0x4'))(_0x906a('0x5'));var config=require(_0x906a('0x6'));var jayson=require(_0x906a('0x7'));var client=jayson[_0x906a('0x8')][_0x906a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a1a6d,_0x184d27,_0x19de5b){return new BPromise(function(_0x417f21,_0x3c9341){return client[_0x906a('0xa')](_0x4a1a6d,_0x19de5b)[_0x906a('0xb')](function(_0x56e6a7){logger[_0x906a('0xc')]('ChatApplication,\x20%s,\x20%s',_0x184d27,'request\x20sent');logger[_0x906a('0xd')](_0x906a('0xe'),_0x184d27,'request\x20sent',JSON[_0x906a('0xf')](_0x56e6a7));if(_0x56e6a7[_0x906a('0x10')]){if(_0x56e6a7['error'][_0x906a('0x11')]===0x1f4){logger[_0x906a('0x10')](_0x906a('0x12'),_0x184d27,_0x56e6a7[_0x906a('0x10')]['message']);return _0x3c9341(_0x56e6a7[_0x906a('0x10')][_0x906a('0x13')]);}logger[_0x906a('0x10')](_0x906a('0x12'),_0x184d27,_0x56e6a7[_0x906a('0x10')]['message']);return _0x417f21(_0x56e6a7['error'][_0x906a('0x13')]);}else{logger[_0x906a('0xc')](_0x906a('0x12'),_0x184d27,_0x906a('0x14'));_0x417f21(_0x56e6a7[_0x906a('0x15')][_0x906a('0x13')]);}})['catch'](function(_0x3a9c80){logger[_0x906a('0x10')](_0x906a('0x12'),_0x184d27,_0x3a9c80);_0x3c9341(_0x3a9c80);});});}
\ No newline at end of file
+var _0xc46c=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','ChatApplication,\x20%s,\x20%s'];(function(_0x5193ea,_0x37ba91){var _0xe71de=function(_0x4de0d5){while(--_0x4de0d5){_0x5193ea['push'](_0x5193ea['shift']());}};_0xe71de(++_0x37ba91);}(_0xc46c,0x17c));var _0xcc46=function(_0x172948,_0x4262cc){_0x172948=_0x172948-0x0;var _0x4aeaa9=_0xc46c[_0x172948];return _0x4aeaa9;};'use strict';var _=require(_0xcc46('0x0'));var util=require('util');var moment=require(_0xcc46('0x1'));var BPromise=require(_0xcc46('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc46('0x3'));var db=require(_0xcc46('0x4'))['db'];var utils=require(_0xcc46('0x5'));var logger=require('../../config/logger')(_0xcc46('0x6'));var config=require(_0xcc46('0x7'));var jayson=require(_0xcc46('0x8'));var client=jayson['client'][_0xcc46('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x318c0b,_0x27aaa8,_0xeead76){return new BPromise(function(_0x2a40aa,_0x6a062e){return client['request'](_0x318c0b,_0xeead76)[_0xcc46('0xa')](function(_0x1fb3e2){logger['info']('ChatApplication,\x20%s,\x20%s',_0x27aaa8,_0xcc46('0xb'));logger[_0xcc46('0xc')](_0xcc46('0xd'),_0x27aaa8,_0xcc46('0xb'),JSON[_0xcc46('0xe')](_0x1fb3e2));if(_0x1fb3e2[_0xcc46('0xf')]){if(_0x1fb3e2[_0xcc46('0xf')]['code']===0x1f4){logger[_0xcc46('0xf')]('ChatApplication,\x20%s,\x20%s',_0x27aaa8,_0x1fb3e2[_0xcc46('0xf')][_0xcc46('0x10')]);return _0x6a062e(_0x1fb3e2[_0xcc46('0xf')][_0xcc46('0x10')]);}logger[_0xcc46('0xf')]('ChatApplication,\x20%s,\x20%s',_0x27aaa8,_0x1fb3e2[_0xcc46('0xf')][_0xcc46('0x10')]);return _0x2a40aa(_0x1fb3e2[_0xcc46('0xf')][_0xcc46('0x10')]);}else{logger[_0xcc46('0x11')]('ChatApplication,\x20%s,\x20%s',_0x27aaa8,'request\x20sent');_0x2a40aa(_0x1fb3e2['result'][_0xcc46('0x10')]);}})[_0xcc46('0x12')](function(_0x21b8f3){logger[_0xcc46('0xf')](_0xcc46('0x13'),_0x27aaa8,_0x21b8f3);_0x6a062e(_0x21b8f3);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 1d94d94..865c79d 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 _0xf5c9=['multer','path','express','Router','fs-extra','../../components/interaction/service','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','exports'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xf5c9,0x69));var _0x9f5c=function(_0x2200c6,_0x45b748){_0x2200c6=_0x2200c6-0x0;var _0x156997=_0xf5c9[_0x2200c6];return _0x156997;};'use strict';var multer=require(_0x9f5c('0x0'));var util=require('util');var path=require(_0x9f5c('0x1'));var timeout=require('connect-timeout');var express=require(_0x9f5c('0x2'));var router=express[_0x9f5c('0x3')]();var fs_extra=require(_0x9f5c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9f5c('0x5'));var config=require('../../config/environment');var controller=require(_0x9f5c('0x6'));router['get'](_0x9f5c('0x7'),auth[_0x9f5c('0x8')](),controller[_0x9f5c('0x9')]);router[_0x9f5c('0xa')](_0x9f5c('0x7'),auth[_0x9f5c('0x8')](),controller[_0x9f5c('0xb')]);router[_0x9f5c('0xc')](_0x9f5c('0x7'),auth[_0x9f5c('0x8')](),controller[_0x9f5c('0xd')]);module[_0x9f5c('0xe')]=router;
\ No newline at end of file
+var _0x31db=['../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x160182,_0x4cf21a){var _0x1c1e78=function(_0x248245){while(--_0x248245){_0x160182['push'](_0x160182['shift']());}};_0x1c1e78(++_0x4cf21a);}(_0x31db,0xe4));var _0xb31d=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x31db[_0x13187a];return _0x65b85f;};'use strict';var multer=require('multer');var util=require(_0xb31d('0x0'));var path=require(_0xb31d('0x1'));var timeout=require(_0xb31d('0x2'));var express=require(_0xb31d('0x3'));var router=express['Router']();var fs_extra=require(_0xb31d('0x4'));var auth=require(_0xb31d('0x5'));var interaction=require(_0xb31d('0x6'));var config=require(_0xb31d('0x7'));var controller=require(_0xb31d('0x8'));router[_0xb31d('0x9')](_0xb31d('0xa'),auth[_0xb31d('0xb')](),controller[_0xb31d('0xc')]);router[_0xb31d('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xb31d('0xe')]);router[_0xb31d('0xf')](_0xb31d('0xa'),auth[_0xb31d('0xb')](),controller[_0xb31d('0x10')]);module[_0xb31d('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index c851f13..1e86822 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 _0xbd54=['exports','STRING','BOOLEAN','sequelize'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xbd54,0x67));var _0x4bd5=function(_0x5d990e,_0x4ba9f5){_0x5d990e=_0x5d990e-0x0;var _0x36c763=_0xbd54[_0x5d990e];return _0x36c763;};'use strict';var Sequelize=require(_0x4bd5('0x0'));module[_0x4bd5('0x1')]={'name':{'type':Sequelize[_0x4bd5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4bd5('0x2')]},'write':{'type':Sequelize[_0x4bd5('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xb1c5=['STRING','BOOLEAN','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb1c5,0x182));var _0x5b1c=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xb1c5[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require('sequelize');module[_0x5b1c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5b1c('0x1')]},'write':{'type':Sequelize[_0x5b1c('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 05258d6..cc2707c 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 _0xcb85=['ids','addMessage','ChatGroupId','$gte','format','getMessages','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','ChatGroup','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','catch','keys','find','create','body','params','describe','getUnread','ChatInternalMessage','toInteger','addMembers','omit','getMembers','findOne','User','removeMembers'];(function(_0x59a436,_0x196b36){var _0x36554d=function(_0x3676dd){while(--_0x3676dd){_0x59a436['push'](_0x59a436['shift']());}};_0x36554d(++_0x196b36);}(_0xcb85,0x18a));var _0x5cb8=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xcb85[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require(_0x5cb8('0x0'));var rimraf=require(_0x5cb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5cb8('0x2'));var rp=require(_0x5cb8('0x3'));var moment=require(_0x5cb8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5cb8('0x5'));var util=require(_0x5cb8('0x6'));var path=require(_0x5cb8('0x7'));var sox=require('sox');var csv=require(_0x5cb8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cb8('0x9'));var _=require(_0x5cb8('0xa'));var squel=require('squel');var crypto=require(_0x5cb8('0xb'));var jsforce=require(_0x5cb8('0xc'));var deskjs=require(_0x5cb8('0xd'));var toCsv=require(_0x5cb8('0x8'));var querystring=require('querystring');var Papa=require(_0x5cb8('0xe'));var Redis=require(_0x5cb8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5cb8('0x10'));var as=require(_0x5cb8('0x11'));var hardwareService=require(_0x5cb8('0x12'));var logger=require(_0x5cb8('0x13'))(_0x5cb8('0x14'));var utils=require('../../config/utils');var config=require(_0x5cb8('0x15'));var licenseUtil=require(_0x5cb8('0x16'));var db=require(_0x5cb8('0x17'))['db'];config[_0x5cb8('0x18')]=_[_0x5cb8('0x19')](config['redis'],{'host':_0x5cb8('0x1a'),'port':0x18eb});var socket=require(_0x5cb8('0x1b'))(new Redis(config[_0x5cb8('0x18')]));require(_0x5cb8('0x1c'))[_0x5cb8('0x1d')](socket);function respondWithStatusCode(_0x13625a,_0x5735da){_0x5735da=_0x5735da||0xcc;return function(_0xc890ab){if(_0xc890ab){return _0x13625a[_0x5cb8('0x1e')](_0x5735da);}return _0x13625a[_0x5cb8('0x1f')](_0x5735da)[_0x5cb8('0x20')]();};}function respondWithResult(_0x17bfae,_0xddf22c){_0xddf22c=_0xddf22c||0xc8;return function(_0x2d3328){if(_0x2d3328){return _0x17bfae[_0x5cb8('0x1f')](_0xddf22c)['json'](_0x2d3328);}};}function respondWithFilteredResult(_0x11c70c,_0x1f94d5){return function(_0x3a7f9a){if(_0x3a7f9a){var _0x5919ad=typeof _0x1f94d5[_0x5cb8('0x21')]===_0x5cb8('0x22')&&typeof _0x1f94d5['limit']===_0x5cb8('0x22');var _0x425693=_0x3a7f9a[_0x5cb8('0x23')];var _0x479f29=_0x5919ad?0x0:_0x1f94d5[_0x5cb8('0x21')];var _0x1f6bae=_0x5919ad?_0x3a7f9a[_0x5cb8('0x23')]:_0x1f94d5[_0x5cb8('0x21')]+_0x1f94d5[_0x5cb8('0x24')];var _0x5287c0;if(_0x1f6bae>=_0x425693){_0x1f6bae=_0x425693;_0x5287c0=0xc8;}else{_0x5287c0=0xce;}_0x11c70c[_0x5cb8('0x1f')](_0x5287c0);return _0x11c70c[_0x5cb8('0x25')](_0x5cb8('0x26'),_0x479f29+'-'+_0x1f6bae+'/'+_0x425693)[_0x5cb8('0x27')](_0x3a7f9a);}return null;};}function patchUpdates(_0x48af23){return function(_0x54f124){try{jsonpatch[_0x5cb8('0x28')](_0x54f124,_0x48af23,!![]);}catch(_0x2e707d){return BPromise[_0x5cb8('0x29')](_0x2e707d);}return _0x54f124[_0x5cb8('0x2a')]();};}function saveUpdates(_0x571215,_0x431482){return function(_0x3b29e4){if(_0x3b29e4){return _0x3b29e4[_0x5cb8('0x2b')](_0x571215)[_0x5cb8('0x2c')](function(_0x4a0c7e){return _0x4a0c7e;});}return null;};}function removeEntity(_0x3926ce,_0x2bd69f){return function(_0x4287b4){if(_0x4287b4){return _0x4287b4[_0x5cb8('0x2d')]()[_0x5cb8('0x2c')](function(){_0x3926ce[_0x5cb8('0x1f')](0xcc)[_0x5cb8('0x20')]();});}};}function handleEntityNotFound(_0x2945d9,_0x150f9e){return function(_0x4b3c73){if(!_0x4b3c73){_0x2945d9[_0x5cb8('0x1e')](0x194);}return _0x4b3c73;};}function handleError(_0x1a5125,_0x14dfaf){_0x14dfaf=_0x14dfaf||0x1f4;return function(_0xf5b7b9){logger[_0x5cb8('0x2e')](_0xf5b7b9['stack']);if(_0xf5b7b9[_0x5cb8('0x2f')]){delete _0xf5b7b9[_0x5cb8('0x2f')];}_0x1a5125['status'](_0x14dfaf)[_0x5cb8('0x30')](_0xf5b7b9);};}exports[_0x5cb8('0x31')]=function(_0x3be227,_0x150a36){var _0x50ef98={},_0x33fa36={},_0x40ee08={'count':0x0,'rows':[]};var _0x5206ec=_['map'](db[_0x5cb8('0x32')][_0x5cb8('0x33')],function(_0xf50cb3){return{'name':_0xf50cb3[_0x5cb8('0x34')],'type':_0xf50cb3['type'][_0x5cb8('0x35')]};});_0x33fa36[_0x5cb8('0x36')]=_[_0x5cb8('0x37')](_0x5206ec,_0x5cb8('0x2f'));_0x33fa36[_0x5cb8('0x38')]=_['keys'](_0x3be227['query']);_0x33fa36['filters']=_[_0x5cb8('0x39')](_0x33fa36[_0x5cb8('0x36')],_0x33fa36['query']);_0x50ef98[_0x5cb8('0x3a')]=_[_0x5cb8('0x39')](_0x33fa36[_0x5cb8('0x36')],qs[_0x5cb8('0x3b')](_0x3be227[_0x5cb8('0x38')]['fields']));_0x50ef98[_0x5cb8('0x3a')]=_0x50ef98[_0x5cb8('0x3a')][_0x5cb8('0x3c')]?_0x50ef98['attributes']:_0x33fa36[_0x5cb8('0x36')];if(!_0x3be227['query'][_0x5cb8('0x3d')](_0x5cb8('0x3e'))){_0x50ef98[_0x5cb8('0x24')]=qs[_0x5cb8('0x24')](_0x3be227[_0x5cb8('0x38')]['limit']);_0x50ef98[_0x5cb8('0x21')]=qs[_0x5cb8('0x21')](_0x3be227['query'][_0x5cb8('0x21')]);}_0x50ef98[_0x5cb8('0x3f')]=qs[_0x5cb8('0x40')](_0x3be227['query'][_0x5cb8('0x40')]);_0x50ef98['where']=qs[_0x5cb8('0x41')](_[_0x5cb8('0x42')](_0x3be227[_0x5cb8('0x38')],_0x33fa36[_0x5cb8('0x41')]),_0x5206ec);if(_0x3be227[_0x5cb8('0x38')][_0x5cb8('0x43')]){_0x50ef98[_0x5cb8('0x44')]=_[_0x5cb8('0x45')](_0x50ef98['where'],{'$or':_[_0x5cb8('0x37')](_0x5206ec,function(_0x2985db){if(_0x2985db[_0x5cb8('0x46')]!==_0x5cb8('0x47')){var _0x22ec17={};_0x22ec17[_0x2985db[_0x5cb8('0x2f')]]={'$like':'%'+_0x3be227[_0x5cb8('0x38')][_0x5cb8('0x43')]+'%'};return _0x22ec17;}})});}_0x50ef98=_[_0x5cb8('0x45')]({},_0x50ef98,_0x3be227[_0x5cb8('0x48')]);var _0x3caf50={'where':_0x50ef98['where']};return db[_0x5cb8('0x32')][_0x5cb8('0x23')](_0x3caf50)[_0x5cb8('0x2c')](function(_0x28890c){_0x40ee08[_0x5cb8('0x23')]=_0x28890c;if(_0x3be227['query'][_0x5cb8('0x49')]){_0x50ef98['include']=[{'all':!![]}];}return db[_0x5cb8('0x32')][_0x5cb8('0x4a')](_0x50ef98);})[_0x5cb8('0x2c')](function(_0x3d285b){_0x40ee08['rows']=_0x3d285b;return _0x40ee08;})[_0x5cb8('0x2c')](respondWithFilteredResult(_0x150a36,_0x50ef98))[_0x5cb8('0x4b')](handleError(_0x150a36,null));};exports['show']=function(_0x2897d4,_0x39fc58){var _0x787cc9={'raw':!![],'where':{'id':_0x2897d4['params']['id']}},_0x4cd878={};_0x4cd878[_0x5cb8('0x36')]=_[_0x5cb8('0x4c')](db[_0x5cb8('0x32')]['rawAttributes']);_0x4cd878[_0x5cb8('0x38')]=_[_0x5cb8('0x4c')](_0x2897d4[_0x5cb8('0x38')]);_0x4cd878[_0x5cb8('0x41')]=_[_0x5cb8('0x39')](_0x4cd878['model'],_0x4cd878['query']);_0x787cc9[_0x5cb8('0x3a')]=_[_0x5cb8('0x39')](_0x4cd878['model'],qs[_0x5cb8('0x3b')](_0x2897d4[_0x5cb8('0x38')]['fields']));_0x787cc9[_0x5cb8('0x3a')]=_0x787cc9[_0x5cb8('0x3a')]['length']?_0x787cc9[_0x5cb8('0x3a')]:_0x4cd878[_0x5cb8('0x36')];if(_0x2897d4[_0x5cb8('0x38')][_0x5cb8('0x49')]){_0x787cc9['include']=[{'all':!![]}];}_0x787cc9=_[_0x5cb8('0x45')]({},_0x787cc9,_0x2897d4[_0x5cb8('0x48')]);return db[_0x5cb8('0x32')][_0x5cb8('0x4d')](_0x787cc9)[_0x5cb8('0x2c')](handleEntityNotFound(_0x39fc58,null))[_0x5cb8('0x2c')](respondWithResult(_0x39fc58,null))[_0x5cb8('0x4b')](handleError(_0x39fc58,null));};exports[_0x5cb8('0x4e')]=function(_0x1394f0,_0x8efd67){return db[_0x5cb8('0x32')][_0x5cb8('0x4e')](_0x1394f0[_0x5cb8('0x4f')],{})[_0x5cb8('0x2c')](respondWithResult(_0x8efd67,0xc9))[_0x5cb8('0x4b')](handleError(_0x8efd67,null));};exports['update']=function(_0x4b48b4,_0x103b06){if(_0x4b48b4[_0x5cb8('0x4f')]['id']){delete _0x4b48b4[_0x5cb8('0x4f')]['id'];}return db[_0x5cb8('0x32')]['find']({'where':{'id':_0x4b48b4[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x103b06,null))['then'](saveUpdates(_0x4b48b4[_0x5cb8('0x4f')],null))[_0x5cb8('0x2c')](respondWithResult(_0x103b06,null))[_0x5cb8('0x4b')](handleError(_0x103b06,null));};exports[_0x5cb8('0x2d')]=function(_0x5a327a,_0x43cb0b){return db[_0x5cb8('0x32')][_0x5cb8('0x4d')]({'where':{'id':_0x5a327a[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x43cb0b,null))['then'](removeEntity(_0x43cb0b,null))['catch'](handleError(_0x43cb0b,null));};exports[_0x5cb8('0x51')]=function(_0x4535ba,_0x37db9c){return db[_0x5cb8('0x32')][_0x5cb8('0x51')]()[_0x5cb8('0x2c')](respondWithResult(_0x37db9c,null))[_0x5cb8('0x4b')](handleError(_0x37db9c,null));};exports[_0x5cb8('0x52')]=function(_0x4d9f9c,_0x4f0bf2,_0x4dafc9){return db[_0x5cb8('0x53')][_0x5cb8('0x23')]({'where':{'ChatGroupId':_0x4d9f9c[_0x5cb8('0x50')]['id'],'ToId':_0x4d9f9c['user']['id'],'read':![]}})[_0x5cb8('0x2c')](function(_0x1e4466){return{'id':_[_0x5cb8('0x54')](_0x4d9f9c['params']['id']),'count':_0x1e4466};})[_0x5cb8('0x2c')](respondWithResult(_0x4f0bf2,null))[_0x5cb8('0x4b')](handleError(_0x4f0bf2,null));};exports[_0x5cb8('0x55')]=function(_0x3a0ce6,_0x52b48f,_0x4dd5c6){return db['ChatGroup']['find']({'where':{'id':_0x3a0ce6[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x52b48f,null))['then'](function(_0x437742){if(_0x437742){return _0x437742[_0x5cb8('0x55')](_0x3a0ce6[_0x5cb8('0x4f')]['ids'],_[_0x5cb8('0x56')](_0x3a0ce6[_0x5cb8('0x4f')],['ids','id'])||{});}})[_0x5cb8('0x2c')](respondWithResult(_0x52b48f,null))['catch'](handleError(_0x52b48f,null));};exports[_0x5cb8('0x57')]=function(_0x2b25fd,_0x22a642,_0x3d920b){var _0x12b014={};var _0x39f8a={};var _0x12e3f9;var _0x44370b;return db[_0x5cb8('0x32')][_0x5cb8('0x58')]({'where':{'id':_0x2b25fd[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x22a642,null))[_0x5cb8('0x2c')](function(_0x146d6c){if(_0x146d6c){_0x12e3f9=_0x146d6c;_0x39f8a[_0x5cb8('0x36')]=_[_0x5cb8('0x4c')](db[_0x5cb8('0x59')][_0x5cb8('0x33')]);_0x39f8a[_0x5cb8('0x38')]=_[_0x5cb8('0x4c')](_0x2b25fd[_0x5cb8('0x38')]);_0x39f8a[_0x5cb8('0x41')]=_[_0x5cb8('0x39')](_0x39f8a['model'],_0x39f8a[_0x5cb8('0x38')]);_0x12b014['attributes']=_[_0x5cb8('0x39')](_0x39f8a[_0x5cb8('0x36')],qs[_0x5cb8('0x3b')](_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x3b')]));_0x12b014['attributes']=_0x12b014[_0x5cb8('0x3a')]['length']?_0x12b014[_0x5cb8('0x3a')]:_0x39f8a[_0x5cb8('0x36')];_0x12b014[_0x5cb8('0x3f')]=qs[_0x5cb8('0x40')](_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x40')]);_0x12b014[_0x5cb8('0x44')]=qs['filters'](_['pick'](_0x2b25fd['query'],_0x39f8a['filters']));if(_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x43')]){_0x12b014[_0x5cb8('0x44')]=_[_0x5cb8('0x45')](_0x12b014[_0x5cb8('0x44')],{'$or':_[_0x5cb8('0x37')](_0x12b014[_0x5cb8('0x3a')],function(_0x265733){var _0x279875={};_0x279875[_0x265733]={'$like':'%'+_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x43')]+'%'};return _0x279875;})});}_0x12b014=_['merge']({},_0x12b014,_0x2b25fd[_0x5cb8('0x48')]);return _0x12e3f9['getMembers'](_0x12b014);}})[_0x5cb8('0x2c')](function(_0x59425){if(_0x59425){_0x44370b=_0x59425[_0x5cb8('0x3c')];if(!_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x3d')](_0x5cb8('0x3e'))){_0x12b014[_0x5cb8('0x24')]=qs[_0x5cb8('0x24')](_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x24')]);_0x12b014['offset']=qs['offset'](_0x2b25fd[_0x5cb8('0x38')][_0x5cb8('0x21')]);}return _0x12e3f9[_0x5cb8('0x57')](_0x12b014);}})[_0x5cb8('0x2c')](function(_0x488f25){if(_0x488f25){return _0x488f25?{'count':_0x44370b,'rows':_0x488f25}:null;}})['then'](respondWithResult(_0x22a642,null))[_0x5cb8('0x4b')](handleError(_0x22a642,null));};exports[_0x5cb8('0x5a')]=function(_0xa0ba4,_0x193682,_0x2a2c43){return db['ChatGroup'][_0x5cb8('0x4d')]({'where':{'id':_0xa0ba4[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x193682,null))[_0x5cb8('0x2c')](function(_0x81bbf2){if(_0x81bbf2){return _0x81bbf2[_0x5cb8('0x5a')](_0xa0ba4['query'][_0x5cb8('0x5b')]);}})['then'](respondWithStatusCode(_0x193682,null))[_0x5cb8('0x4b')](handleError(_0x193682,null));};exports[_0x5cb8('0x5c')]=function(_0x3c6997,_0x21b4d1,_0x3369fc){if(_0x3c6997[_0x5cb8('0x4f')]['id']){delete _0x3c6997[_0x5cb8('0x4f')]['id'];}return db[_0x5cb8('0x32')]['find']({'where':{'id':_0x3c6997[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x21b4d1,null))[_0x5cb8('0x2c')](function(_0x1459b3){if(_0x1459b3){_0x3c6997[_0x5cb8('0x4f')][_0x5cb8('0x5d')]=_0x1459b3['id'];return db['ChatInternalMessage'][_0x5cb8('0x4e')](_0x3c6997[_0x5cb8('0x4f')]);}})[_0x5cb8('0x2c')](respondWithResult(_0x21b4d1,null))[_0x5cb8('0x4b')](handleError(_0x21b4d1,null));};exports['getMessages']=function(_0x5b6763,_0x36446b,_0x1f2513){var _0x4644de={};var _0x211f6a={};var _0x514fc8;var _0x17c3a8;return db[_0x5cb8('0x32')]['findOne']({'where':{'id':_0x5b6763[_0x5cb8('0x50')]['id']}})[_0x5cb8('0x2c')](handleEntityNotFound(_0x36446b,null))[_0x5cb8('0x2c')](function(_0x2ea703){if(_0x2ea703){_0x514fc8=_0x2ea703;_0x211f6a[_0x5cb8('0x36')]=_[_0x5cb8('0x4c')](db['ChatInternalMessage'][_0x5cb8('0x33')]);_0x211f6a[_0x5cb8('0x38')]=_['keys'](_0x5b6763[_0x5cb8('0x38')]);_0x211f6a['filters']=_['intersection'](_0x211f6a[_0x5cb8('0x36')],_0x211f6a[_0x5cb8('0x38')]);_0x4644de[_0x5cb8('0x3a')]=_[_0x5cb8('0x39')](_0x211f6a['model'],qs[_0x5cb8('0x3b')](_0x5b6763[_0x5cb8('0x38')][_0x5cb8('0x3b')]));_0x4644de[_0x5cb8('0x3a')]=_0x4644de['attributes']['length']?_0x4644de['attributes']:_0x211f6a['model'];_0x4644de['order']=qs[_0x5cb8('0x40')](_0x5b6763['query'][_0x5cb8('0x40')]);_0x4644de[_0x5cb8('0x44')]=qs['filters'](_[_0x5cb8('0x42')](_0x5b6763[_0x5cb8('0x38')],_0x211f6a[_0x5cb8('0x41')]));if(_0x5b6763['query'][_0x5cb8('0x43')]){_0x4644de[_0x5cb8('0x44')]=_[_0x5cb8('0x45')](_0x4644de['where'],{'$or':_[_0x5cb8('0x37')](_0x4644de['attributes'],function(_0x6fb61b){var _0x3020e5={};_0x3020e5[_0x6fb61b]={'$like':'%'+_0x5b6763['query'][_0x5cb8('0x43')]+'%'};return _0x3020e5;})});}if(_0x5b6763[_0x5cb8('0x38')][_0x5cb8('0x5e')]){var _0x2947b5=_0x5b6763[_0x5cb8('0x38')][_0x5cb8('0x5e')]['split'](',');var _0x3d8c59={};_0x3d8c59[_0x2947b5[0x0]]={'$gte':moment(_0x2947b5[0x1])[_0x5cb8('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4644de[_0x5cb8('0x44')]=_[_0x5cb8('0x45')](_0x4644de[_0x5cb8('0x44')],_0x3d8c59);}_0x4644de=_['merge']({},_0x4644de,_0x5b6763['options']);return _0x514fc8['getMessages'](_0x4644de);}})[_0x5cb8('0x2c')](function(_0x3852d){if(_0x3852d){_0x17c3a8=_0x3852d[_0x5cb8('0x3c')];if(!_0x5b6763[_0x5cb8('0x38')][_0x5cb8('0x3d')](_0x5cb8('0x3e'))){_0x4644de[_0x5cb8('0x24')]=qs[_0x5cb8('0x24')](_0x5b6763[_0x5cb8('0x38')]['limit']);_0x4644de[_0x5cb8('0x21')]=qs[_0x5cb8('0x21')](_0x5b6763[_0x5cb8('0x38')]['offset']);}return _0x514fc8[_0x5cb8('0x60')](_0x4644de);}})[_0x5cb8('0x2c')](function(_0x2acf93){if(_0x2acf93){return _0x2acf93?{'count':_0x17c3a8,'rows':_0x2acf93}:null;}})[_0x5cb8('0x2c')](respondWithResult(_0x36446b,null))[_0x5cb8('0x4b')](handleError(_0x36446b,null));};
\ No newline at end of file
+var _0x4c97=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params','keys','intersection','find','create','update','body','describe','getUnread','ChatInternalMessage','user','toInteger','ids','omit','getMembers','findOne','User','options','removeMembers','addMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages'];(function(_0x126bd2,_0x2bab5b){var _0x3b806b=function(_0x9c2f74){while(--_0x9c2f74){_0x126bd2['push'](_0x126bd2['shift']());}};_0x3b806b(++_0x2bab5b);}(_0x4c97,0x184));var _0x74c9=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x4c97[_0x15bc81];return _0x59440e;};'use strict';var emlformat=require(_0x74c9('0x0'));var rimraf=require(_0x74c9('0x1'));var zipdir=require(_0x74c9('0x2'));var jsonpatch=require(_0x74c9('0x3'));var rp=require('request-promise');var moment=require(_0x74c9('0x4'));var BPromise=require(_0x74c9('0x5'));var Mustache=require(_0x74c9('0x6'));var util=require(_0x74c9('0x7'));var path=require('path');var sox=require(_0x74c9('0x8'));var csv=require(_0x74c9('0x9'));var ejs=require(_0x74c9('0xa'));var fs=require('fs');var fs_extra=require(_0x74c9('0xb'));var _=require(_0x74c9('0xc'));var squel=require(_0x74c9('0xd'));var crypto=require(_0x74c9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x74c9('0x9'));var querystring=require(_0x74c9('0xf'));var Papa=require(_0x74c9('0x10'));var Redis=require(_0x74c9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x74c9('0x12'));var as=require(_0x74c9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74c9('0x14'))('api');var utils=require(_0x74c9('0x15'));var config=require(_0x74c9('0x16'));var licenseUtil=require(_0x74c9('0x17'));var db=require(_0x74c9('0x18'))['db'];config[_0x74c9('0x19')]=_[_0x74c9('0x1a')](config[_0x74c9('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x74c9('0x1b'))(new Redis(config[_0x74c9('0x19')]));require('./chatGroup.socket')[_0x74c9('0x1c')](socket);function respondWithStatusCode(_0x1a1319,_0x2589cd){_0x2589cd=_0x2589cd||0xcc;return function(_0x56c0b2){if(_0x56c0b2){return _0x1a1319[_0x74c9('0x1d')](_0x2589cd);}return _0x1a1319[_0x74c9('0x1e')](_0x2589cd)[_0x74c9('0x1f')]();};}function respondWithResult(_0x90287b,_0x506df4){_0x506df4=_0x506df4||0xc8;return function(_0x9f201c){if(_0x9f201c){return _0x90287b['status'](_0x506df4)[_0x74c9('0x20')](_0x9f201c);}};}function respondWithFilteredResult(_0x3198f8,_0x5838a5){return function(_0x5a19d6){if(_0x5a19d6){var _0x3118b1=typeof _0x5838a5['offset']===_0x74c9('0x21')&&typeof _0x5838a5['limit']==='undefined';var _0x1c9790=_0x5a19d6[_0x74c9('0x22')];var _0x11b9e6=_0x3118b1?0x0:_0x5838a5[_0x74c9('0x23')];var _0x51bb35=_0x3118b1?_0x5a19d6[_0x74c9('0x22')]:_0x5838a5['offset']+_0x5838a5[_0x74c9('0x24')];var _0x345e60;if(_0x51bb35>=_0x1c9790){_0x51bb35=_0x1c9790;_0x345e60=0xc8;}else{_0x345e60=0xce;}_0x3198f8[_0x74c9('0x1e')](_0x345e60);return _0x3198f8[_0x74c9('0x25')](_0x74c9('0x26'),_0x11b9e6+'-'+_0x51bb35+'/'+_0x1c9790)[_0x74c9('0x20')](_0x5a19d6);}return null;};}function patchUpdates(_0x35ded6){return function(_0x4971f6){try{jsonpatch[_0x74c9('0x27')](_0x4971f6,_0x35ded6,!![]);}catch(_0x28bee5){return BPromise['reject'](_0x28bee5);}return _0x4971f6[_0x74c9('0x28')]();};}function saveUpdates(_0xdbce7d,_0x2c3a08){return function(_0x253fac){if(_0x253fac){return _0x253fac['update'](_0xdbce7d)[_0x74c9('0x29')](function(_0x4ef1c0){return _0x4ef1c0;});}return null;};}function removeEntity(_0x1b47b0,_0x9b4e8a){return function(_0x46e708){if(_0x46e708){return _0x46e708[_0x74c9('0x2a')]()[_0x74c9('0x29')](function(){_0x1b47b0[_0x74c9('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33ea5c,_0x5cfef3){return function(_0x25f562){if(!_0x25f562){_0x33ea5c[_0x74c9('0x1d')](0x194);}return _0x25f562;};}function handleError(_0x1602ab,_0x498ed2){_0x498ed2=_0x498ed2||0x1f4;return function(_0x4d5c35){logger[_0x74c9('0x2b')](_0x4d5c35[_0x74c9('0x2c')]);if(_0x4d5c35[_0x74c9('0x2d')]){delete _0x4d5c35['name'];}_0x1602ab[_0x74c9('0x1e')](_0x498ed2)[_0x74c9('0x2e')](_0x4d5c35);};}exports[_0x74c9('0x2f')]=function(_0x199733,_0x52acc4){var _0xeb5b7b={},_0x459681={},_0x5ab246={'count':0x0,'rows':[]};var _0x691a97=_[_0x74c9('0x30')](db[_0x74c9('0x31')][_0x74c9('0x32')],function(_0x4ad505){return{'name':_0x4ad505['fieldName'],'type':_0x4ad505[_0x74c9('0x33')][_0x74c9('0x34')]};});_0x459681[_0x74c9('0x35')]=_[_0x74c9('0x30')](_0x691a97,_0x74c9('0x2d'));_0x459681[_0x74c9('0x36')]=_['keys'](_0x199733[_0x74c9('0x36')]);_0x459681[_0x74c9('0x37')]=_['intersection'](_0x459681['model'],_0x459681[_0x74c9('0x36')]);_0xeb5b7b[_0x74c9('0x38')]=_['intersection'](_0x459681[_0x74c9('0x35')],qs[_0x74c9('0x39')](_0x199733[_0x74c9('0x36')][_0x74c9('0x39')]));_0xeb5b7b[_0x74c9('0x38')]=_0xeb5b7b[_0x74c9('0x38')][_0x74c9('0x3a')]?_0xeb5b7b[_0x74c9('0x38')]:_0x459681[_0x74c9('0x35')];if(!_0x199733[_0x74c9('0x36')][_0x74c9('0x3b')](_0x74c9('0x3c'))){_0xeb5b7b['limit']=qs[_0x74c9('0x24')](_0x199733[_0x74c9('0x36')][_0x74c9('0x24')]);_0xeb5b7b[_0x74c9('0x23')]=qs[_0x74c9('0x23')](_0x199733[_0x74c9('0x36')][_0x74c9('0x23')]);}_0xeb5b7b[_0x74c9('0x3d')]=qs[_0x74c9('0x3e')](_0x199733['query']['sort']);_0xeb5b7b[_0x74c9('0x3f')]=qs[_0x74c9('0x37')](_[_0x74c9('0x40')](_0x199733['query'],_0x459681[_0x74c9('0x37')]),_0x691a97);if(_0x199733[_0x74c9('0x36')][_0x74c9('0x41')]){_0xeb5b7b[_0x74c9('0x3f')]=_[_0x74c9('0x42')](_0xeb5b7b[_0x74c9('0x3f')],{'$or':_[_0x74c9('0x30')](_0x691a97,function(_0x27c590){if(_0x27c590[_0x74c9('0x33')]!==_0x74c9('0x43')){var _0x5cd6cd={};_0x5cd6cd[_0x27c590['name']]={'$like':'%'+_0x199733[_0x74c9('0x36')]['filter']+'%'};return _0x5cd6cd;}})});}_0xeb5b7b=_[_0x74c9('0x42')]({},_0xeb5b7b,_0x199733['options']);var _0x295b72={'where':_0xeb5b7b[_0x74c9('0x3f')]};return db[_0x74c9('0x31')][_0x74c9('0x22')](_0x295b72)['then'](function(_0x2497ce){_0x5ab246['count']=_0x2497ce;if(_0x199733[_0x74c9('0x36')][_0x74c9('0x44')]){_0xeb5b7b[_0x74c9('0x45')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0xeb5b7b);})[_0x74c9('0x29')](function(_0x4da3c0){_0x5ab246['rows']=_0x4da3c0;return _0x5ab246;})['then'](respondWithFilteredResult(_0x52acc4,_0xeb5b7b))[_0x74c9('0x46')](handleError(_0x52acc4,null));};exports[_0x74c9('0x47')]=function(_0x3d624e,_0x674c92){var _0x366467={'raw':!![],'where':{'id':_0x3d624e[_0x74c9('0x48')]['id']}},_0x420afa={};_0x420afa[_0x74c9('0x35')]=_[_0x74c9('0x49')](db[_0x74c9('0x31')]['rawAttributes']);_0x420afa[_0x74c9('0x36')]=_['keys'](_0x3d624e['query']);_0x420afa[_0x74c9('0x37')]=_['intersection'](_0x420afa[_0x74c9('0x35')],_0x420afa[_0x74c9('0x36')]);_0x366467[_0x74c9('0x38')]=_[_0x74c9('0x4a')](_0x420afa[_0x74c9('0x35')],qs['fields'](_0x3d624e[_0x74c9('0x36')]['fields']));_0x366467[_0x74c9('0x38')]=_0x366467[_0x74c9('0x38')]['length']?_0x366467['attributes']:_0x420afa['model'];if(_0x3d624e[_0x74c9('0x36')][_0x74c9('0x44')]){_0x366467[_0x74c9('0x45')]=[{'all':!![]}];}_0x366467=_[_0x74c9('0x42')]({},_0x366467,_0x3d624e['options']);return db['ChatGroup'][_0x74c9('0x4b')](_0x366467)['then'](handleEntityNotFound(_0x674c92,null))[_0x74c9('0x29')](respondWithResult(_0x674c92,null))[_0x74c9('0x46')](handleError(_0x674c92,null));};exports['create']=function(_0x4baa9b,_0x25f7ee){return db[_0x74c9('0x31')][_0x74c9('0x4c')](_0x4baa9b['body'],{})[_0x74c9('0x29')](respondWithResult(_0x25f7ee,0xc9))[_0x74c9('0x46')](handleError(_0x25f7ee,null));};exports[_0x74c9('0x4d')]=function(_0x471afb,_0x313848){if(_0x471afb[_0x74c9('0x4e')]['id']){delete _0x471afb[_0x74c9('0x4e')]['id'];}return db[_0x74c9('0x31')]['find']({'where':{'id':_0x471afb[_0x74c9('0x48')]['id']}})[_0x74c9('0x29')](handleEntityNotFound(_0x313848,null))[_0x74c9('0x29')](saveUpdates(_0x471afb['body'],null))[_0x74c9('0x29')](respondWithResult(_0x313848,null))[_0x74c9('0x46')](handleError(_0x313848,null));};exports[_0x74c9('0x2a')]=function(_0x58040b,_0xeb39e0){return db[_0x74c9('0x31')]['find']({'where':{'id':_0x58040b[_0x74c9('0x48')]['id']}})[_0x74c9('0x29')](handleEntityNotFound(_0xeb39e0,null))[_0x74c9('0x29')](removeEntity(_0xeb39e0,null))[_0x74c9('0x46')](handleError(_0xeb39e0,null));};exports[_0x74c9('0x4f')]=function(_0x528374,_0x2323d8){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x2323d8,null))[_0x74c9('0x46')](handleError(_0x2323d8,null));};exports[_0x74c9('0x50')]=function(_0x162655,_0x5110d9,_0xfddc3e){return db[_0x74c9('0x51')][_0x74c9('0x22')]({'where':{'ChatGroupId':_0x162655[_0x74c9('0x48')]['id'],'ToId':_0x162655[_0x74c9('0x52')]['id'],'read':![]}})['then'](function(_0x2fa1b0){return{'id':_[_0x74c9('0x53')](_0x162655[_0x74c9('0x48')]['id']),'count':_0x2fa1b0};})[_0x74c9('0x29')](respondWithResult(_0x5110d9,null))[_0x74c9('0x46')](handleError(_0x5110d9,null));};exports['addMembers']=function(_0x4f0d34,_0x27c1c3,_0xbf3cff){return db[_0x74c9('0x31')]['find']({'where':{'id':_0x4f0d34[_0x74c9('0x48')]['id']}})[_0x74c9('0x29')](handleEntityNotFound(_0x27c1c3,null))[_0x74c9('0x29')](function(_0x4efccd){if(_0x4efccd){return _0x4efccd['addMembers'](_0x4f0d34['body'][_0x74c9('0x54')],_[_0x74c9('0x55')](_0x4f0d34[_0x74c9('0x4e')],[_0x74c9('0x54'),'id'])||{});}})[_0x74c9('0x29')](respondWithResult(_0x27c1c3,null))['catch'](handleError(_0x27c1c3,null));};exports[_0x74c9('0x56')]=function(_0x437137,_0x37d502,_0x38f108){var _0x2d120e={};var _0x1a689c={};var _0x1b54b5;var _0x3193ae;return db[_0x74c9('0x31')][_0x74c9('0x57')]({'where':{'id':_0x437137[_0x74c9('0x48')]['id']}})[_0x74c9('0x29')](handleEntityNotFound(_0x37d502,null))[_0x74c9('0x29')](function(_0x178af5){if(_0x178af5){_0x1b54b5=_0x178af5;_0x1a689c[_0x74c9('0x35')]=_[_0x74c9('0x49')](db[_0x74c9('0x58')]['rawAttributes']);_0x1a689c[_0x74c9('0x36')]=_['keys'](_0x437137[_0x74c9('0x36')]);_0x1a689c['filters']=_['intersection'](_0x1a689c[_0x74c9('0x35')],_0x1a689c[_0x74c9('0x36')]);_0x2d120e['attributes']=_[_0x74c9('0x4a')](_0x1a689c[_0x74c9('0x35')],qs[_0x74c9('0x39')](_0x437137[_0x74c9('0x36')][_0x74c9('0x39')]));_0x2d120e['attributes']=_0x2d120e[_0x74c9('0x38')][_0x74c9('0x3a')]?_0x2d120e['attributes']:_0x1a689c[_0x74c9('0x35')];_0x2d120e[_0x74c9('0x3d')]=qs[_0x74c9('0x3e')](_0x437137['query'][_0x74c9('0x3e')]);_0x2d120e['where']=qs[_0x74c9('0x37')](_[_0x74c9('0x40')](_0x437137['query'],_0x1a689c[_0x74c9('0x37')]));if(_0x437137[_0x74c9('0x36')][_0x74c9('0x41')]){_0x2d120e[_0x74c9('0x3f')]=_[_0x74c9('0x42')](_0x2d120e['where'],{'$or':_[_0x74c9('0x30')](_0x2d120e[_0x74c9('0x38')],function(_0x1ff015){var _0x46f4e1={};_0x46f4e1[_0x1ff015]={'$like':'%'+_0x437137[_0x74c9('0x36')]['filter']+'%'};return _0x46f4e1;})});}_0x2d120e=_['merge']({},_0x2d120e,_0x437137[_0x74c9('0x59')]);return _0x1b54b5[_0x74c9('0x56')](_0x2d120e);}})[_0x74c9('0x29')](function(_0x3cab18){if(_0x3cab18){_0x3193ae=_0x3cab18[_0x74c9('0x3a')];if(!_0x437137[_0x74c9('0x36')][_0x74c9('0x3b')]('nolimit')){_0x2d120e['limit']=qs['limit'](_0x437137[_0x74c9('0x36')][_0x74c9('0x24')]);_0x2d120e['offset']=qs['offset'](_0x437137[_0x74c9('0x36')][_0x74c9('0x23')]);}return _0x1b54b5['getMembers'](_0x2d120e);}})[_0x74c9('0x29')](function(_0x32bdef){if(_0x32bdef){return _0x32bdef?{'count':_0x3193ae,'rows':_0x32bdef}:null;}})[_0x74c9('0x29')](respondWithResult(_0x37d502,null))['catch'](handleError(_0x37d502,null));};exports[_0x74c9('0x5a')]=function(_0x169e66,_0x81ae0,_0x5ed52a){return db[_0x74c9('0x31')][_0x74c9('0x4b')]({'where':{'id':_0x169e66[_0x74c9('0x48')]['id']}})[_0x74c9('0x29')](handleEntityNotFound(_0x81ae0,null))[_0x74c9('0x29')](function(_0x15f49f){if(_0x15f49f){return _0x15f49f[_0x74c9('0x5a')](_0x169e66[_0x74c9('0x36')][_0x74c9('0x54')]);}})[_0x74c9('0x29')](respondWithStatusCode(_0x81ae0,null))[_0x74c9('0x46')](handleError(_0x81ae0,null));};exports[_0x74c9('0x5b')]=function(_0x72298c,_0x2bd2c7,_0x5d114d){if(_0x72298c[_0x74c9('0x4e')]['id']){delete _0x72298c[_0x74c9('0x4e')]['id'];}return db[_0x74c9('0x31')][_0x74c9('0x4b')]({'where':{'id':_0x72298c['params']['id']}})[_0x74c9('0x29')](handleEntityNotFound(_0x2bd2c7,null))[_0x74c9('0x29')](function(_0x2428fe){if(_0x2428fe){_0x72298c[_0x74c9('0x4e')]['ChatGroupId']=_0x2428fe['id'];return db[_0x74c9('0x51')][_0x74c9('0x4c')](_0x72298c[_0x74c9('0x4e')]);}})[_0x74c9('0x29')](respondWithResult(_0x2bd2c7,null))['catch'](handleError(_0x2bd2c7,null));};exports['getMessages']=function(_0x7e85c5,_0x318c8b,_0x3fd6b1){var _0x2ae3cd={};var _0x3cd213={};var _0x1908e4;var _0x24f33a;return db['ChatGroup'][_0x74c9('0x57')]({'where':{'id':_0x7e85c5['params']['id']}})['then'](handleEntityNotFound(_0x318c8b,null))['then'](function(_0xc3e524){if(_0xc3e524){_0x1908e4=_0xc3e524;_0x3cd213['model']=_[_0x74c9('0x49')](db[_0x74c9('0x51')]['rawAttributes']);_0x3cd213[_0x74c9('0x36')]=_[_0x74c9('0x49')](_0x7e85c5[_0x74c9('0x36')]);_0x3cd213[_0x74c9('0x37')]=_[_0x74c9('0x4a')](_0x3cd213['model'],_0x3cd213[_0x74c9('0x36')]);_0x2ae3cd[_0x74c9('0x38')]=_[_0x74c9('0x4a')](_0x3cd213[_0x74c9('0x35')],qs[_0x74c9('0x39')](_0x7e85c5[_0x74c9('0x36')][_0x74c9('0x39')]));_0x2ae3cd[_0x74c9('0x38')]=_0x2ae3cd['attributes'][_0x74c9('0x3a')]?_0x2ae3cd[_0x74c9('0x38')]:_0x3cd213[_0x74c9('0x35')];_0x2ae3cd['order']=qs['sort'](_0x7e85c5[_0x74c9('0x36')]['sort']);_0x2ae3cd[_0x74c9('0x3f')]=qs[_0x74c9('0x37')](_['pick'](_0x7e85c5[_0x74c9('0x36')],_0x3cd213[_0x74c9('0x37')]));if(_0x7e85c5['query'][_0x74c9('0x41')]){_0x2ae3cd[_0x74c9('0x3f')]=_[_0x74c9('0x42')](_0x2ae3cd[_0x74c9('0x3f')],{'$or':_[_0x74c9('0x30')](_0x2ae3cd['attributes'],function(_0x4e63e9){var _0x2d26c8={};_0x2d26c8[_0x4e63e9]={'$like':'%'+_0x7e85c5[_0x74c9('0x36')][_0x74c9('0x41')]+'%'};return _0x2d26c8;})});}if(_0x7e85c5[_0x74c9('0x36')][_0x74c9('0x5c')]){var _0x3c1014=_0x7e85c5['query']['$gte'][_0x74c9('0x5d')](',');var _0x39ab25={};_0x39ab25[_0x3c1014[0x0]]={'$gte':moment(_0x3c1014[0x1])[_0x74c9('0x5e')](_0x74c9('0x5f'))};_0x2ae3cd[_0x74c9('0x3f')]=_[_0x74c9('0x42')](_0x2ae3cd[_0x74c9('0x3f')],_0x39ab25);}_0x2ae3cd=_[_0x74c9('0x42')]({},_0x2ae3cd,_0x7e85c5['options']);return _0x1908e4[_0x74c9('0x60')](_0x2ae3cd);}})['then'](function(_0x39d64e){if(_0x39d64e){_0x24f33a=_0x39d64e[_0x74c9('0x3a')];if(!_0x7e85c5['query'][_0x74c9('0x3b')](_0x74c9('0x3c'))){_0x2ae3cd[_0x74c9('0x24')]=qs['limit'](_0x7e85c5[_0x74c9('0x36')][_0x74c9('0x24')]);_0x2ae3cd[_0x74c9('0x23')]=qs['offset'](_0x7e85c5[_0x74c9('0x36')][_0x74c9('0x23')]);}return _0x1908e4['getMessages'](_0x2ae3cd);}})['then'](function(_0x18ce49){if(_0x18ce49){return _0x18ce49?{'count':_0x24f33a,'rows':_0x18ce49}:null;}})[_0x74c9('0x29')](respondWithResult(_0x318c8b,null))[_0x74c9('0x46')](handleError(_0x318c8b,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index ecee113..0de0caa 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 _0x4a9f=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','save','update','remove','emit'];(function(_0x1702b8,_0x28c7da){var _0x50028a=function(_0x4135b1){while(--_0x4135b1){_0x1702b8['push'](_0x1702b8['shift']());}};_0x50028a(++_0x28c7da);}(_0x4a9f,0x67));var _0xf4a9=function(_0x593310,_0x17b9e9){_0x593310=_0x593310-0x0;var _0x1ea007=_0x4a9f[_0x593310];return _0x1ea007;};'use strict';var EventEmitter=require(_0xf4a9('0x0'));var ChatGroup=require(_0xf4a9('0x1'))['db'][_0xf4a9('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf4a9('0x3'),'afterUpdate':_0xf4a9('0x4'),'afterDestroy':_0xf4a9('0x5')};function emitEvent(_0x39a5a3){return function(_0x3995a4,_0x27327f,_0x12e29d){ChatGroupEvents[_0xf4a9('0x6')](_0x39a5a3+':'+_0x3995a4['id'],_0x3995a4);ChatGroupEvents['emit'](_0x39a5a3,_0x3995a4);_0x12e29d(null);};}for(var e in events){if(events[_0xf4a9('0x7')](e)){var event=events[e];ChatGroup[_0xf4a9('0x8')](e,emitEvent(event));}}module[_0xf4a9('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0xcf2e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xcf2e,0x197));var _0xecf2=function(_0x11bf38,_0x213d7f){_0x11bf38=_0x11bf38-0x0;var _0x202699=_0xcf2e[_0x11bf38];return _0x202699;};'use strict';var EventEmitter=require(_0xecf2('0x0'));var ChatGroup=require(_0xecf2('0x1'))['db'][_0xecf2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xecf2('0x3')](0x0);var events={'afterCreate':_0xecf2('0x4'),'afterUpdate':_0xecf2('0x5'),'afterDestroy':_0xecf2('0x6')};function emitEvent(_0x26b249){return function(_0x4306cc,_0x57f63f,_0x14a022){ChatGroupEvents[_0xecf2('0x7')](_0x26b249+':'+_0x4306cc['id'],_0x4306cc);ChatGroupEvents[_0xecf2('0x7')](_0x26b249,_0x4306cc);_0x14a022(null);};}for(var e in events){if(events[_0xecf2('0x8')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xecf2('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 75aaa25..8a06c27 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 _0x6f1d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6f1d,0x108));var _0xd6f1=function(_0x5f5755,_0x16da30){_0x5f5755=_0x5f5755-0x0;var _0x37443b=_0x6f1d[_0x5f5755];return _0x37443b;};'use strict';var _=require(_0xd6f1('0x0'));var util=require(_0xd6f1('0x1'));var logger=require(_0xd6f1('0x2'))(_0xd6f1('0x3'));var moment=require(_0xd6f1('0x4'));var BPromise=require(_0xd6f1('0x5'));var rp=require(_0xd6f1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd6f1('0x7'));var config=require(_0xd6f1('0x8'));var attributes=require(_0xd6f1('0x9'));module['exports']=function(_0xd253d8,_0x5055eb){return _0xd253d8[_0xd6f1('0xa')](_0xd6f1('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x59e5=['path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger','api','moment','request-promise'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x59e5,0x167));var _0x559e=function(_0xee7df5,_0x90827c){_0xee7df5=_0xee7df5-0x0;var _0x149d03=_0x59e5[_0xee7df5];return _0x149d03;};'use strict';var _=require('lodash');var util=require(_0x559e('0x0'));var logger=require(_0x559e('0x1'))(_0x559e('0x2'));var moment=require(_0x559e('0x3'));var BPromise=require('bluebird');var rp=require(_0x559e('0x4'));var fs=require('fs');var path=require(_0x559e('0x5'));var rimraf=require(_0x559e('0x6'));var config=require(_0x559e('0x7'));var attributes=require(_0x559e('0x8'));module[_0x559e('0x9')]=function(_0xf192c5,_0x3b6229){return _0xf192c5[_0x559e('0xa')](_0x559e('0xb'),attributes,{'tableName':_0x559e('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 612399f..463f501 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 _0xe002=['localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x317a57,_0x132716){var _0x12ac0f=function(_0xdc6529){while(--_0xdc6529){_0x317a57['push'](_0x317a57['shift']());}};_0x12ac0f(++_0x132716);}(_0xe002,0xf7));var _0x2e00=function(_0x628eee,_0x3f3fba){_0x628eee=_0x628eee-0x0;var _0x447718=_0xe002[_0x628eee];return _0x447718;};'use strict';var _=require(_0x2e00('0x0'));var util=require(_0x2e00('0x1'));var moment=require(_0x2e00('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e00('0x3'));var fs=require('fs');var Redis=require(_0x2e00('0x4'));var db=require(_0x2e00('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e00('0x6'))(_0x2e00('0x7'));var config=require(_0x2e00('0x8'));var jayson=require(_0x2e00('0x9'));var client=jayson[_0x2e00('0xa')][_0x2e00('0xb')]({'port':0x232a});config[_0x2e00('0xc')]=_[_0x2e00('0xd')](config['redis'],{'host':_0x2e00('0xe'),'port':0x18eb});var socket=require(_0x2e00('0xf'))(new Redis(config['redis']));require(_0x2e00('0x10'))[_0x2e00('0x11')](socket);function respondWithRpcPromise(_0x1797c4,_0x2e5f9d,_0x4ad57e){return new BPromise(function(_0x5dc42f,_0x3841a0){return client[_0x2e00('0x12')](_0x1797c4,_0x4ad57e)[_0x2e00('0x13')](function(_0x4963cc){logger[_0x2e00('0x14')](_0x2e00('0x15'),_0x2e5f9d,_0x2e00('0x16'));logger[_0x2e00('0x17')](_0x2e00('0x18'),_0x2e5f9d,'request\x20sent',JSON['stringify'](_0x4963cc));if(_0x4963cc[_0x2e00('0x19')]){if(_0x4963cc[_0x2e00('0x19')][_0x2e00('0x1a')]===0x1f4){logger[_0x2e00('0x19')](_0x2e00('0x15'),_0x2e5f9d,_0x4963cc['error'][_0x2e00('0x1b')]);return _0x3841a0(_0x4963cc['error'][_0x2e00('0x1b')]);}logger[_0x2e00('0x19')]('ChatGroup,\x20%s,\x20%s',_0x2e5f9d,_0x4963cc[_0x2e00('0x19')][_0x2e00('0x1b')]);return _0x5dc42f(_0x4963cc[_0x2e00('0x19')][_0x2e00('0x1b')]);}else{logger['info'](_0x2e00('0x15'),_0x2e5f9d,_0x2e00('0x16'));_0x5dc42f(_0x4963cc['result'][_0x2e00('0x1b')]);}})[_0x2e00('0x1c')](function(_0x1620ec){logger['error'](_0x2e00('0x15'),_0x2e5f9d,_0x1620ec);_0x3841a0(_0x1620ec);});});}
\ No newline at end of file
+var _0x639d=['code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x639d,0xbb));var _0xd639=function(_0xcb140d,_0x29ceca){_0xcb140d=_0xcb140d-0x0;var _0x3cf4b7=_0x639d[_0xcb140d];return _0x3cf4b7;};'use strict';var _=require(_0xd639('0x0'));var util=require(_0xd639('0x1'));var moment=require(_0xd639('0x2'));var BPromise=require('bluebird');var rs=require(_0xd639('0x3'));var fs=require('fs');var Redis=require(_0xd639('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd639('0x5'));var logger=require('../../config/logger')(_0xd639('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd639('0x7')][_0xd639('0x8')]({'port':0x232a});config[_0xd639('0x9')]=_[_0xd639('0xa')](config[_0xd639('0x9')],{'host':_0xd639('0xb'),'port':0x18eb});var socket=require(_0xd639('0xc'))(new Redis(config[_0xd639('0x9')]));require('./chatGroup.socket')[_0xd639('0xd')](socket);function respondWithRpcPromise(_0x2a48dc,_0x1f12aa,_0x44bcb1){return new BPromise(function(_0x135268,_0x2a6bf5){return client[_0xd639('0xe')](_0x2a48dc,_0x44bcb1)[_0xd639('0xf')](function(_0x3d93dc){logger['info'](_0xd639('0x10'),_0x1f12aa,_0xd639('0x11'));logger[_0xd639('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1f12aa,_0xd639('0x11'),JSON[_0xd639('0x13')](_0x3d93dc));if(_0x3d93dc[_0xd639('0x14')]){if(_0x3d93dc['error'][_0xd639('0x15')]===0x1f4){logger[_0xd639('0x14')]('ChatGroup,\x20%s,\x20%s',_0x1f12aa,_0x3d93dc[_0xd639('0x14')][_0xd639('0x16')]);return _0x2a6bf5(_0x3d93dc['error'][_0xd639('0x16')]);}logger[_0xd639('0x14')](_0xd639('0x10'),_0x1f12aa,_0x3d93dc[_0xd639('0x14')][_0xd639('0x16')]);return _0x135268(_0x3d93dc['error'][_0xd639('0x16')]);}else{logger[_0xd639('0x17')](_0xd639('0x10'),_0x1f12aa,'request\x20sent');_0x135268(_0x3d93dc[_0xd639('0x18')][_0xd639('0x16')]);}})[_0xd639('0x19')](function(_0x5cc42a){logger[_0xd639('0x14')](_0xd639('0x10'),_0x1f12aa,_0x5cc42a);_0x2a6bf5(_0x5cc42a);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index bf65403..8baa742 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 _0x0221=['removeListener','register','length','chatGroup:','remove','update'];(function(_0x3c4a7c,_0x2f4e3c){var _0xf13d1e=function(_0x24cb78){while(--_0x24cb78){_0x3c4a7c['push'](_0x3c4a7c['shift']());}};_0xf13d1e(++_0x2f4e3c);}(_0x0221,0x13c));var _0x1022=function(_0x294934,_0x502e35){_0x294934=_0x294934-0x0;var _0x2aa538=_0x0221[_0x294934];return _0x2aa538;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x1022('0x0'),_0x1022('0x1')];function createListener(_0x6398f6,_0x4f2565){return function(_0x41ac37){_0x4f2565['emit'](_0x6398f6,_0x41ac37);};}function removeListener(_0x358672,_0x92c096){return function(){ChatGroupEvents[_0x1022('0x2')](_0x358672,_0x92c096);};}exports[_0x1022('0x3')]=function(_0x5eebba){for(var _0x5a295f=0x0,_0x39e0ad=events[_0x1022('0x4')];_0x5a295f<_0x39e0ad;_0x5a295f++){var _0x2863f9=events[_0x5a295f];var _0x2907ec=createListener(_0x1022('0x5')+_0x2863f9,_0x5eebba);ChatGroupEvents['on'](_0x2863f9,_0x2907ec);}};
\ No newline at end of file
+var _0x1887=['emit','removeListener','length','chatGroup:','./chatGroup.events','remove','update'];(function(_0x3dfa3e,_0x293558){var _0x3ff9ed=function(_0x400e9b){while(--_0x400e9b){_0x3dfa3e['push'](_0x3dfa3e['shift']());}};_0x3ff9ed(++_0x293558);}(_0x1887,0x1a1));var _0x7188=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1887[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0x7188('0x0'));var events=['save',_0x7188('0x1'),_0x7188('0x2')];function createListener(_0x1715f8,_0x1ec03c){return function(_0x826126){_0x1ec03c[_0x7188('0x3')](_0x1715f8,_0x826126);};}function removeListener(_0x4f6016,_0x2876d3){return function(){ChatGroupEvents[_0x7188('0x4')](_0x4f6016,_0x2876d3);};}exports['register']=function(_0x185bbc){for(var _0x1b1796=0x0,_0x891264=events[_0x7188('0x5')];_0x1b1796<_0x891264;_0x1b1796++){var _0x8d33cc=events[_0x1b1796];var _0x56137d=createListener(_0x7188('0x6')+_0x8d33cc,_0x185bbc);ChatGroupEvents['on'](_0x8d33cc,_0x56137d);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 0a58198..7857e1a 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 _0xa968=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','put'];(function(_0x263f4c,_0x438626){var _0x3a78d3=function(_0xbdb00f){while(--_0xbdb00f){_0x263f4c['push'](_0x263f4c['shift']());}};_0x3a78d3(++_0x438626);}(_0xa968,0xe2));var _0x8a96=function(_0x356f0b,_0x3cc06a){_0x356f0b=_0x356f0b-0x0;var _0x3b0910=_0xa968[_0x356f0b];return _0x3b0910;};'use strict';var multer=require(_0x8a96('0x0'));var util=require(_0x8a96('0x1'));var path=require(_0x8a96('0x2'));var timeout=require(_0x8a96('0x3'));var express=require(_0x8a96('0x4'));var router=express[_0x8a96('0x5')]();var fs_extra=require(_0x8a96('0x6'));var auth=require(_0x8a96('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8a96('0x8'));var controller=require('./chatGroup.controller');router[_0x8a96('0x9')]('/',auth['isAuthenticated'](),controller[_0x8a96('0xa')]);router[_0x8a96('0x9')](_0x8a96('0xb'),auth[_0x8a96('0xc')](),controller[_0x8a96('0xd')]);router[_0x8a96('0x9')](_0x8a96('0xe'),auth[_0x8a96('0xc')](),controller[_0x8a96('0xf')]);router['get'](_0x8a96('0x10'),auth[_0x8a96('0xc')](),controller['getUnread']);router['get']('/:id/members',auth[_0x8a96('0xc')](),controller[_0x8a96('0x11')]);router[_0x8a96('0x9')](_0x8a96('0x12'),auth[_0x8a96('0xc')](),controller[_0x8a96('0x13')]);router[_0x8a96('0x14')]('/',auth[_0x8a96('0xc')](),controller[_0x8a96('0x15')]);router['post'](_0x8a96('0x16'),auth[_0x8a96('0xc')](),controller[_0x8a96('0x17')]);router[_0x8a96('0x14')](_0x8a96('0x12'),auth[_0x8a96('0xc')](),controller[_0x8a96('0x18')]);router[_0x8a96('0x19')](_0x8a96('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x8a96('0x1a')](_0x8a96('0xe'),auth[_0x8a96('0xc')](),controller[_0x8a96('0x1b')]);router[_0x8a96('0x1a')](_0x8a96('0x16'),auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0x485b=['delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','put','update'];(function(_0x8b83dd,_0x495e25){var _0x456f0f=function(_0x20b0bf){while(--_0x20b0bf){_0x8b83dd['push'](_0x8b83dd['shift']());}};_0x456f0f(++_0x495e25);}(_0x485b,0x6b));var _0xb485=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x485b[_0x1b349a];return _0x5d1f7c;};'use strict';var multer=require(_0xb485('0x0'));var util=require('util');var path=require(_0xb485('0x1'));var timeout=require(_0xb485('0x2'));var express=require('express');var router=express[_0xb485('0x3')]();var fs_extra=require(_0xb485('0x4'));var auth=require(_0xb485('0x5'));var interaction=require(_0xb485('0x6'));var config=require(_0xb485('0x7'));var controller=require('./chatGroup.controller');router[_0xb485('0x8')]('/',auth[_0xb485('0x9')](),controller[_0xb485('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xb485('0x8')](_0xb485('0xb'),auth['isAuthenticated'](),controller[_0xb485('0xc')]);router[_0xb485('0x8')](_0xb485('0xd'),auth[_0xb485('0x9')](),controller[_0xb485('0xe')]);router[_0xb485('0x8')](_0xb485('0xf'),auth[_0xb485('0x9')](),controller[_0xb485('0x10')]);router[_0xb485('0x8')](_0xb485('0x11'),auth[_0xb485('0x9')](),controller[_0xb485('0x12')]);router['post']('/',auth[_0xb485('0x9')](),controller[_0xb485('0x13')]);router[_0xb485('0x14')](_0xb485('0xf'),auth[_0xb485('0x9')](),controller['addMembers']);router['post'](_0xb485('0x11'),auth[_0xb485('0x9')](),controller['addMessage']);router[_0xb485('0x15')](_0xb485('0xb'),auth[_0xb485('0x9')](),controller[_0xb485('0x16')]);router[_0xb485('0x17')](_0xb485('0xb'),auth[_0xb485('0x9')](),controller[_0xb485('0x18')]);router['delete'](_0xb485('0xf'),auth[_0xb485('0x9')](),controller['removeMembers']);module[_0xb485('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 0ad5cb9..4c40118 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 _0x6947=['DATE','long','out','BOOLEAN','exports','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x5eb5ce,_0xeb9b44){var _0xaa7cf8=function(_0x379535){while(--_0x379535){_0x5eb5ce['push'](_0x5eb5ce['shift']());}};_0xaa7cf8(++_0xeb9b44);}(_0x6947,0x72));var _0x7694=function(_0x2c9a9a,_0xeadcbb){_0x2c9a9a=_0x2c9a9a-0x0;var _0x4210d8=_0x6947[_0x2c9a9a];return _0x4210d8;};'use strict';var Sequelize=require('sequelize');module[_0x7694('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7694('0x1')]},'ratingType':{'type':Sequelize[_0x7694('0x2')](_0x7694('0x3'),_0x7694('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x7694('0x5')]},'mailTranscript':{'type':Sequelize[_0x7694('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7694('0x7')]},'disposition':{'type':Sequelize[_0x7694('0x6')]},'secondDisposition':{'type':Sequelize[_0x7694('0x6')]},'thirdDisposition':{'type':Sequelize[_0x7694('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x7694('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x7694('0x6')]},'osVersion':{'type':Sequelize[_0x7694('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x7694('0x6')]},'deviceType':{'type':Sequelize[_0x7694('0x6')]},'referer':{'type':Sequelize[_0x7694('0x5')]},'customerIp':{'type':Sequelize[_0x7694('0x6')]},'formData':{'type':Sequelize[_0x7694('0x5')](_0x7694('0x8'))},'read1stAt':{'type':Sequelize[_0x7694('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7694('0x2')]('in',_0x7694('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x7694('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x7694('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x7694('0xa')],'defaultValue':![]}};
\ No newline at end of file
+var _0x97f5=['STRING','DATE','ENUM','out','sequelize','exports','BOOLEAN','star','thumb','TEXT'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x97f5,0x72));var _0x597f=function(_0x5a759d,_0xaf657){_0x5a759d=_0x5a759d-0x0;var _0x8c003=_0x97f5[_0x5a759d];return _0x8c003;};'use strict';var Sequelize=require(_0x597f('0x0'));module[_0x597f('0x1')]={'closed':{'type':Sequelize[_0x597f('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x597f('0x3'),_0x597f('0x4')),'defaultValue':_0x597f('0x3')},'ratingMessage':{'type':Sequelize[_0x597f('0x5')]},'pathTranscript':{'type':Sequelize[_0x597f('0x5')]},'mailTranscript':{'type':Sequelize[_0x597f('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x597f('0x7')]},'disposition':{'type':Sequelize[_0x597f('0x6')]},'secondDisposition':{'type':Sequelize[_0x597f('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x597f('0x6')]},'browserName':{'type':Sequelize[_0x597f('0x6')]},'browserVersion':{'type':Sequelize[_0x597f('0x6')]},'osName':{'type':Sequelize[_0x597f('0x6')]},'osVersion':{'type':Sequelize[_0x597f('0x6')]},'deviceModel':{'type':Sequelize[_0x597f('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x597f('0x6')]},'referer':{'type':Sequelize[_0x597f('0x5')]},'customerIp':{'type':Sequelize[_0x597f('0x6')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x597f('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x597f('0x8')]('in',_0x597f('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x597f('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x597f('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x597f('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index d265e23..757ed4a 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 _0x461a=['filters','attributes','intersection','fields','length','includeAll','include','merge','options','create','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','ValidationError','Sequelize','Error\x20in\x20Vidaoo\x20configuration','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','attachmentDownload','closed','json','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','server/files/chat/upload/','format','transcript-%s.txt','Messages','User','ContactId','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ChatMessage','ids','order','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','hasOwnProperty','nolimit','includeAgent','push','findAll','addTags','omit','spread','Tag','chatInteractionTags:save','removeTags','unix','toString','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','Account','Owner','get','Chat','N.A.','closedAt','disposition','browserName','osName','referer','customerPort','Attachment','existsSync','createReadStream','pipe','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','stack','name','send','render','body','contact','agent','index','map','ChatInteraction','fieldName','type','getOptions','chat','query','user','show','params','model','rawAttributes','keys'];(function(_0x5d8133,_0x584a11){var _0x495ad6=function(_0x4c5f9b){while(--_0x4c5f9b){_0x5d8133['push'](_0x5d8133['shift']());}};_0x495ad6(++_0x584a11);}(_0x461a,0x15c));var _0xa461=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x461a[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0xa461('0x0'));var zipdir=require(_0xa461('0x1'));var rp=require(_0xa461('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa461('0x3'));var ejs=require(_0xa461('0x4'));var fs=require('fs');var _=require(_0xa461('0x5'));var Redis=require('ioredis');var interaction=require(_0xa461('0x6'));var qs=require(_0xa461('0x7'));var pdf=require(_0xa461('0x8'));var logger=require(_0xa461('0x9'))(_0xa461('0xa'));var config=require(_0xa461('0xb'));var db=require(_0xa461('0xc'))['db'];config['redis']=_['defaults'](config[_0xa461('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa461('0xe'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xa461('0xf')](socket);var jayson=require(_0xa461('0x10'));var client=jayson[_0xa461('0x11')]['http']({'port':0x232b});var client9004=jayson[_0xa461('0x11')][_0xa461('0x12')]({'port':0x232c});function respondWithRpcPromise(_0xd9d1ef,_0x406168,_0x13dc55,_0x415348){return new BPromise(function(_0x1ce701,_0x4b9c1f){var _0x24cbf3=_0x415348||client;return _0x24cbf3[_0xa461('0x13')](_0xd9d1ef,_0x13dc55)[_0xa461('0x14')](function(_0x2e1cb4){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x406168,_0xa461('0x15'));logger[_0xa461('0x16')](_0xa461('0x17'),_0x406168,_0xa461('0x15'),JSON['stringify'](_0x2e1cb4));if(_0x2e1cb4[_0xa461('0x18')]){if(_0x2e1cb4[_0xa461('0x18')][_0xa461('0x19')]===0x1f4){logger[_0xa461('0x18')](_0xa461('0x1a'),_0x406168,_0x2e1cb4[_0xa461('0x18')]['message']);return _0x4b9c1f(_0x2e1cb4['error'][_0xa461('0x1b')]);}logger[_0xa461('0x18')](_0xa461('0x1a'),_0x406168,_0x2e1cb4[_0xa461('0x18')][_0xa461('0x1b')]);return _0x1ce701(_0x2e1cb4[_0xa461('0x18')][_0xa461('0x1b')]);}else{logger[_0xa461('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x406168,_0xa461('0x15'));_0x1ce701(_0x2e1cb4[_0xa461('0x1d')][_0xa461('0x1b')]);}})[_0xa461('0x1e')](function(_0x2ed32f){logger[_0xa461('0x18')](_0xa461('0x1a'),_0x406168,_0x2ed32f);_0x4b9c1f(_0x2ed32f);});});}function respondWithStatusCode(_0x1f3331,_0x53552f){_0x53552f=_0x53552f||0xcc;return function(_0x2639aa){if(_0x2639aa){return _0x1f3331[_0xa461('0x1f')](_0x53552f);}return _0x1f3331[_0xa461('0x20')](_0x53552f)[_0xa461('0x21')]();};}function respondWithResult(_0x15e173,_0xfe6d8f){_0xfe6d8f=_0xfe6d8f||0xc8;return function(_0x38a646){if(_0x38a646){return _0x15e173[_0xa461('0x20')](_0xfe6d8f)['json'](_0x38a646);}};}function respondWithFilteredResult(_0x13d01f,_0x2f8d4a){return function(_0x49cab5){if(_0x49cab5){var _0x3efec0=typeof _0x2f8d4a[_0xa461('0x22')]===_0xa461('0x23')&&typeof _0x2f8d4a[_0xa461('0x24')]==='undefined';var _0x556589=_0x49cab5[_0xa461('0x25')];var _0x48877c=_0x3efec0?0x0:_0x2f8d4a[_0xa461('0x22')];var _0x5f267e=_0x3efec0?_0x49cab5['count']:_0x2f8d4a[_0xa461('0x22')]+_0x2f8d4a['limit'];var _0x2fd0f9;if(_0x5f267e>=_0x556589){_0x5f267e=_0x556589;_0x2fd0f9=0xc8;}else{_0x2fd0f9=0xce;}_0x13d01f[_0xa461('0x20')](_0x2fd0f9);return _0x13d01f[_0xa461('0x26')](_0xa461('0x27'),_0x48877c+'-'+_0x5f267e+'/'+_0x556589)['json'](_0x49cab5);}return null;};}function saveUpdates(_0x11a6fe){return function(_0x1c172d){if(_0x1c172d){return _0x1c172d[_0xa461('0x28')](_0x11a6fe)[_0xa461('0x14')](function(_0x18078b){return _0x18078b;});}return null;};}function removeEntity(_0x42d127){return function(_0x37f844){if(_0x37f844){return _0x37f844['destroy']()[_0xa461('0x14')](function(){_0x42d127['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x591f9b){return function(_0xe2631f){if(!_0xe2631f){_0x591f9b[_0xa461('0x1f')](0x194);}return _0xe2631f;};}function handleError(_0x1d46af,_0x3c6767){_0x3c6767=_0x3c6767||0x1f4;return function(_0x2a61c3){logger['error'](_0x2a61c3[_0xa461('0x29')]);if(_0x2a61c3['name']){delete _0x2a61c3[_0xa461('0x2a')];}_0x1d46af['status'](_0x3c6767)[_0xa461('0x2b')](_0x2a61c3);};}function getMustacheRender(_0x1b1854,_0x117521){return Mustache[_0xa461('0x2c')](_0x1b1854,_['merge'](_0x117521[_0xa461('0x2d')],{'contact':_0x117521[_0xa461('0x2e')],'message':_0x117521[_0xa461('0x1b')],'agent':_0x117521[_0xa461('0x2f')],'interaction':_0x117521['interaction'],'account':_0x117521['account']}))||'';}exports[_0xa461('0x30')]=function(_0x3461b8,_0xd42b6){var _0x2e490f={};var _0x5950d8=_[_0xa461('0x31')](db[_0xa461('0x32')]['rawAttributes'],function(_0x3dd64e){return{'name':_0x3dd64e[_0xa461('0x33')],'type':_0x3dd64e[_0xa461('0x34')]['key']};});_0x2e490f=qs[_0xa461('0x35')](_0x5950d8,_0x3461b8);return interaction['findAll'](_0xa461('0x36'),_0x3461b8[_0xa461('0x37')],_0x3461b8[_0xa461('0x38')],_0x2e490f,_0x5950d8)[_0xa461('0x14')](respondWithFilteredResult(_0xd42b6,_0x2e490f))[_0xa461('0x1e')](handleError(_0xd42b6,null));};exports[_0xa461('0x39')]=function(_0x1ba84b,_0x48593f){var _0x44646a={'raw':![],'where':{'id':_0x1ba84b[_0xa461('0x3a')]['id']}},_0x322c9d={};_0x322c9d[_0xa461('0x3b')]=_['keys'](db[_0xa461('0x32')][_0xa461('0x3c')]);_0x322c9d[_0xa461('0x37')]=_[_0xa461('0x3d')](_0x1ba84b[_0xa461('0x37')]);_0x322c9d[_0xa461('0x3e')]=_['intersection'](_0x322c9d['model'],_0x322c9d[_0xa461('0x37')]);_0x44646a[_0xa461('0x3f')]=_[_0xa461('0x40')](_0x322c9d[_0xa461('0x3b')],qs[_0xa461('0x41')](_0x1ba84b[_0xa461('0x37')][_0xa461('0x41')]));_0x44646a[_0xa461('0x3f')]=_0x44646a[_0xa461('0x3f')][_0xa461('0x42')]?_0x44646a[_0xa461('0x3f')]:_0x322c9d['model'];if(_0x1ba84b[_0xa461('0x37')][_0xa461('0x43')]){_0x44646a[_0xa461('0x44')]=[{'all':!![]}];}_0x44646a=_[_0xa461('0x45')]({},_0x44646a,_0x1ba84b[_0xa461('0x46')]);return db[_0xa461('0x32')]['find'](_0x44646a)[_0xa461('0x14')](handleEntityNotFound(_0x48593f,null))[_0xa461('0x14')](respondWithResult(_0x48593f,null))[_0xa461('0x1e')](handleError(_0x48593f,null));};exports[_0xa461('0x47')]=function(_0x42909d,_0x38023b){return db['ChatInteraction'][_0xa461('0x47')](_0x42909d[_0xa461('0x2d')],{})[_0xa461('0x14')](respondWithResult(_0x38023b,0xc9))[_0xa461('0x1e')](handleError(_0x38023b,null));};exports['update']=function(_0x3e48c3,_0x272d49){if(_0x3e48c3[_0xa461('0x2d')]['id']){delete _0x3e48c3[_0xa461('0x2d')]['id'];}return db[_0xa461('0x32')][_0xa461('0x48')]({'where':{'id':_0x3e48c3[_0xa461('0x3a')]['id']}})[_0xa461('0x14')](handleEntityNotFound(_0x272d49,null))[_0xa461('0x14')](saveUpdates(_0x3e48c3['body'],null))[_0xa461('0x14')](respondWithResult(_0x272d49,null))[_0xa461('0x1e')](handleError(_0x272d49,null));};exports[_0xa461('0x49')]=function(_0xbf7a,_0x249979){return db['ChatInteraction']['find']({'where':{'id':_0xbf7a[_0xa461('0x3a')]['id']}})[_0xa461('0x14')](handleEntityNotFound(_0x249979,null))[_0xa461('0x14')](removeEntity(_0x249979,null))['catch'](handleError(_0x249979,null));};exports[_0xa461('0x4a')]=function(_0x194a6a,_0x481203){return db[_0xa461('0x32')][_0xa461('0x4a')]()['then'](respondWithResult(_0x481203,null))['catch'](handleError(_0x481203,null));};exports[_0xa461('0x4b')]=function(_0x503d46,_0x475dc1){var _0x2116ac=_0x503d46[_0xa461('0x3a')]['id'];var _0x321742;var _0x3704e8;var _0x585d7f;return db[_0xa461('0x32')][_0xa461('0x4c')]({'where':{'id':_0x2116ac}})['then'](function(_0x30aed1){_0x321742=_0x30aed1;return db[_0xa461('0x4d')][_0xa461('0x4c')]({'where':{'id':_0x30aed1[_0xa461('0x4e')]},'attributes':['id',_0xa461('0x4f'),_0xa461('0x50'),_0xa461('0x51'),_0xa461('0x52'),_0xa461('0x53')],'raw':!![]});})[_0xa461('0x14')](function(_0x265931){if(_0x265931&&_0x265931[_0xa461('0x4f')]&&_0x265931[_0xa461('0x50')]){_0x3704e8=_0x265931;var _0x4f7fa4={'interaction':{'id':_0x2116ac},'agent':{'id':_0x503d46[_0xa461('0x38')]['id'],'name':_0x503d46[_0xa461('0x38')][_0xa461('0x2a')],'fullname':_0x503d46['user'][_0xa461('0x54')],'email':_0x503d46[_0xa461('0x38')][_0xa461('0x55')]},'contact':_0x503d46[_0xa461('0x2d')][_0xa461('0x2e')],'account':_0x503d46[_0xa461('0x2d')][_0xa461('0x56')]};var _0x976fa6={'rejectUnauthorized':![],'method':_0xa461('0x57'),'url':_0xa461('0x58'),'headers':{'X-APIKEY':_0x265931[_0xa461('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x503d46[_0xa461('0x38')]['email']],'buttons':null,'topic':_0x3704e8[_0xa461('0x51')],'note':_[_0xa461('0x59')](_0x3704e8[_0xa461('0x52')])?null:getMustacheRender(_0x3704e8[_0xa461('0x52')],_0x4f7fa4),'metadata':null},'redirect':_0xa461('0x5a'),'json':!![]};try{if(!_[_0xa461('0x59')](_0x3704e8[_0xa461('0x53')])){var _0x2f045c=getMustacheRender(_0x3704e8[_0xa461('0x53')],_0x4f7fa4);var _0x52f389=JSON[_0xa461('0x5b')](_0x2f045c);_0x976fa6['body'][_0xa461('0x5c')]=_0x52f389;}}catch(_0x3b4e4b){throw new db['Sequelize'][(_0xa461('0x5d'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x976fa6);}else{throw new db[(_0xa461('0x5e'))][(_0xa461('0x5d'))](_0xa461('0x5f'));}})['then'](function(_0x4bf773){_0x585d7f=_0x4bf773;if(_0x585d7f['id']){var _0x456626={'body':_0x585d7f['join_url'],'ChatWebsiteId':_0x3704e8['id'],'ChatInteractionId':_0x321742['id'],'direction':'out','UserId':_0x503d46[_0xa461('0x38')]['id']};return db['ChatMessage'][_0xa461('0x47')](_0x456626,{});}else{throw new db[(_0xa461('0x5e'))]['ValidationError'](_0xa461('0x60'));}})[_0xa461('0x14')](function(){return _0x321742['updateAttributes']({'vidaooSessionId':_0x585d7f['id']});})[_0xa461('0x14')](respondWithResult(_0x475dc1,null))[_0xa461('0x1e')](handleError(_0x475dc1,null));};exports[_0xa461('0x61')]=function(_0x27c96b,_0x37c078){if(_0x27c96b[_0xa461('0x2d')]['id']){delete _0x27c96b[_0xa461('0x2d')]['id'];}return db[_0xa461('0x32')][_0xa461('0x48')]({'where':{'id':_0x27c96b[_0xa461('0x3a')]['id']},'include':[{'model':db[_0xa461('0x62')],'as':_0xa461('0x63')}]})[_0xa461('0x14')](handleEntityNotFound(_0x37c078,null))['then'](saveUpdates(_0x27c96b[_0xa461('0x2d')],null))[_0xa461('0x14')](respondWithResult(_0x37c078,null))[_0xa461('0x1e')](handleError(_0x37c078,null));};exports[_0xa461('0x64')]=function(_0x467219,_0x51ea9d){if(_0x467219[_0xa461('0x2d')]['id']){delete _0x467219['body']['id'];}return db['ChatInteraction'][_0xa461('0x48')]({'where':{'id':_0x467219[_0xa461('0x3a')]['id']}})['then'](function(_0x5ac78f){if(!_0x5ac78f){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xa461('0x64'),0x194,_0xa461('0x65'));_0x51ea9d[_0xa461('0x1f')](0x194);}else{if(_0x5ac78f[_0xa461('0x66')]){throw new db['Sequelize'][(_0xa461('0x5d'))]('Interaction\x20already\x20assigned');}}return _0x5ac78f;})[_0xa461('0x14')](function(_0x532475){if(_0x532475){return _0x532475[_0xa461('0x28')]({'closed':_0x467219['body']['closed'],'disposition':_0x467219['body']['disposition']})[_0xa461('0x14')](function(_0x3d28f3){return _0x3d28f3;});}})[_0xa461('0x14')](function(){return respondWithRpcPromise(_0xa461('0x67'),_0xa461('0x64'),_0x467219[_0xa461('0x2d')],client9004);})[_0xa461('0x14')](respondWithResult(_0x51ea9d,null))['catch'](handleError(_0x51ea9d,null));};exports[_0xa461('0x68')]=function(_0x3ed16a,_0x9e7c60){_0x3ed16a[_0xa461('0x2d')][_0xa461('0x2a')]=_0x3ed16a['file'][_0xa461('0x69')];_0x3ed16a[_0xa461('0x2d')][_0xa461('0x6a')]=_0x3ed16a[_0xa461('0x6b')][_0xa461('0x6c')];_0x3ed16a[_0xa461('0x2d')][_0xa461('0x34')]=_0x3ed16a[_0xa461('0x6b')][_0xa461('0x6d')];return db['Attachment'][_0xa461('0x47')](_0x3ed16a[_0xa461('0x2d')])['then'](respondWithResult(_0x9e7c60,0xc9))[_0xa461('0x1e')](handleError(_0x9e7c60,null));};exports[_0xa461('0x6e')]=function(_0xa530c9,_0x1e4914){return db[_0xa461('0x32')]['findOne']({'where':{'id':_0xa530c9[_0xa461('0x3a')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1e4914,null))[_0xa461('0x14')](function(_0x510a63){if(_0x510a63){if(_0x510a63[_0xa461('0x6f')]){return _0x1e4914[_0xa461('0x20')](0x193)[_0xa461('0x70')]({'status':0x193,'message':_0xa461('0x71')});}return db['Attachment'][_0xa461('0x4c')]({'where':{'id':_0xa530c9['query'][_0xa461('0x72')]},'raw':!![]})['then'](handleEntityNotFound(_0x1e4914,null));}})[_0xa461('0x14')](function(_0xfe02b8){if(_0xfe02b8){var _0x5b0c4b=_0xfe02b8[_0xa461('0x73')]!==null;var _0x26dea0=path[_0xa461('0x74')](config[_0xa461('0x75')],'server/files/attachments/');if(_0x5b0c4b){_0x26dea0=path[_0xa461('0x74')](_0x26dea0,_0xa461('0x76'));}var _0x32fefb=path[_0xa461('0x74')](_0x26dea0,_0xfe02b8[_0xa461('0x6a')]);return _0x1e4914[_0xa461('0x77')](_0x32fefb);}})['catch'](handleError(_0x1e4914,null));};exports['close']=function(_0x303a20,_0x1a9a95){var _0x560fee=null;var _0x4a7e89=null;var _0x3b643f=null;if(_0x303a20[_0xa461('0x2d')]['id']){delete _0x303a20[_0xa461('0x2d')]['id'];}if(_0x303a20['body']['mailTranscript']){_0x3b643f=path['join'](config[_0xa461('0x75')],_0xa461('0x78'),util[_0xa461('0x79')](_0xa461('0x7a'),Date['now']()));_0x303a20[_0xa461('0x2d')]['pathTranscript']=_0x3b643f;}return db['ChatInteraction'][_0xa461('0x48')]({'where':{'id':_0x303a20['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0xa461('0x7b'),'include':[{'model':db[_0xa461('0x7c')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x1a9a95,null))['then'](saveUpdates(_0x303a20['body'],null))[_0xa461('0x14')](function(_0x4dafc9){if(_0x4dafc9){_0x560fee=_0x4dafc9;return db[_0xa461('0x4d')][_0xa461('0x48')]({'where':{'id':_0x560fee['ChatWebsiteId']}});}})[_0xa461('0x14')](function(_0x172870){if(_0x172870){_0x4a7e89=_0x172870;return db[_0xa461('0x62')][_0xa461('0x48')]({'where':{'id':_0x560fee[_0xa461('0x7d')]}});}})[_0xa461('0x14')](function(_0x370542){if(_0x370542){if(_0x3b643f){var _0x511404=null;for(var _0xff84ff=0x1;_0xff84ff<_0x560fee['Messages'][_0xa461('0x42')];++_0xff84ff){_0x511404=_0x560fee[_0xa461('0x7b')][_0xff84ff];var _0x398da2=_0x511404['UserId']?util[_0xa461('0x79')](_0xa461('0x7e'),_0x4a7e89[_0xa461('0x7f')],_0x511404[_0xa461('0x66')]):_0xa461('0x80');var _0x219fe7=_0x303a20[_0xa461('0x2d')]['customer']||util['format']('%s%d',_0xa461('0x81'),_0x511404[_0xa461('0x7d')]);switch(_0x4a7e89[_0xa461('0x82')]){case _0xa461('0x83'):_0x398da2=_0x511404[_0xa461('0x66')]?util[_0xa461('0x79')](_0xa461('0x7e'),_0x4a7e89[_0xa461('0x7f')],_0x511404[_0xa461('0x66')]):'System';break;case _0xa461('0x84'):_0x398da2=_0x511404[_0xa461('0x66')]?_0x511404[_0xa461('0x7c')]['alias']||_0x511404[_0xa461('0x7c')][_0xa461('0x54')]:_0xa461('0x80');break;case _0xa461('0x85'):_0x398da2=_0x511404[_0xa461('0x66')]?_0x511404[_0xa461('0x7c')]['fullname']:_0xa461('0x80');break;default:_0x398da2=_0x511404[_0xa461('0x66')]?util[_0xa461('0x79')](_0xa461('0x7e'),_0x4a7e89['agentAlias'],_0x511404[_0xa461('0x66')]):'System';}var _0x2c927c=util[_0xa461('0x79')](_0xa461('0x86'),moment(_0x511404['createdAt'])[_0xa461('0x79')]('MM/DD/YYYY\x20HH:mm:ss'),_0x511404[_0xa461('0x87')]==='in'?_0x219fe7:_0x398da2,_0x511404['body']);if(!_0x511404[_0xa461('0x88')]){fs[_0xa461('0x89')](_0x3b643f,_0x2c927c);}}return db[_0xa461('0x8a')][_0xa461('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0xa461('0x8b')],'as':_0xa461('0x8c'),'raw':!![],'include':[{'model':db[_0xa461('0x8d')],'as':_0xa461('0x8d'),'raw':!![]}]}]});}}})['then'](function(_0x2d8016){if(!_0x2d8016||!_0x2d8016[_0xa461('0x8c')]||!_0x303a20[_0xa461('0x2d')])return _0x560fee;var _0x52fd9e=_0x2d8016[_0xa461('0x8e')]();return respondWithRpcPromise(_0xa461('0x8f'),'sendMail',{'account':_0x52fd9e,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2d8016['name'],_0x2d8016[_0xa461('0x55')]||_0x2d8016['Smtp'][_0xa461('0x38')]),'to':_0x303a20[_0xa461('0x2d')]['mailTranscript'],'subject':_0xa461('0x90'),'text':util['format'](_0xa461('0x91'),_0x303a20[_0xa461('0x2d')][_0xa461('0x92')]),'attachments':[{'path':_0x3b643f}]}})['then'](function(){return _0x560fee;})[_0xa461('0x1e')](function(_0x53bf68){logger[_0xa461('0x18')](_0x53bf68);});})[_0xa461('0x14')](respondWithStatusCode(_0x1a9a95,0xc8))[_0xa461('0x1e')](handleError(_0x1a9a95,null));};exports[_0xa461('0x93')]=function(_0x5c45b9,_0x137d67){return db[_0xa461('0x94')][_0xa461('0x48')]({'where':{'id':_0x5c45b9['params']['id']}})['then'](handleEntityNotFound(_0x137d67,null))['then'](function(_0x2fe6f6){if(_0x2fe6f6){return _0x2fe6f6[_0xa461('0x93')](_0x5c45b9[_0xa461('0x2d')][_0xa461('0x95')],_['omit'](_0x5c45b9['body'],[_0xa461('0x95'),'id'])||{});}})['then'](respondWithResult(_0x137d67,null))['catch'](handleError(_0x137d67,null));};exports['getMessages']=function(_0x545bbf,_0x1e8a14){var _0x3ea0a3={'raw':![],'where':{}};var _0x3ab62d={};var _0x5687bc={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa461('0x4c')]({'where':{'id':_0x545bbf[_0xa461('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1e8a14,null))[_0xa461('0x14')](function(_0x3df986){if(_0x3df986){_0x3ab62d[_0xa461('0x3b')]=_['keys'](db[_0xa461('0x94')]['rawAttributes']);_0x3ab62d[_0xa461('0x37')]=_[_0xa461('0x3d')](_0x545bbf[_0xa461('0x37')]);_0x3ab62d['filters']=_[_0xa461('0x40')](_0x3ab62d[_0xa461('0x3b')],_0x3ab62d['query']);_0x3ea0a3[_0xa461('0x3f')]=_[_0xa461('0x40')](_0x3ab62d[_0xa461('0x3b')],qs[_0xa461('0x41')](_0x545bbf[_0xa461('0x37')][_0xa461('0x41')]));_0x3ea0a3['attributes']=_0x3ea0a3['attributes'][_0xa461('0x42')]?_0x3ea0a3['attributes']:_0x3ab62d['model'];if(!_0x545bbf['query']['hasOwnProperty']('nolimit')){_0x3ea0a3['limit']=qs[_0xa461('0x24')](_0x545bbf[_0xa461('0x37')][_0xa461('0x24')]);_0x3ea0a3['offset']=qs[_0xa461('0x22')](_0x545bbf['query']['offset']);}_0x3ea0a3[_0xa461('0x96')]=qs[_0xa461('0x97')](_0x545bbf[_0xa461('0x37')]['sort']);_0x3ea0a3['where']=qs[_0xa461('0x3e')](_[_0xa461('0x98')](_0x545bbf['query'],_0x3ab62d['filters']));_0x3ea0a3[_0xa461('0x99')][_0xa461('0x9a')]=_0x3df986['id'];if(_0x545bbf[_0xa461('0x37')][_0xa461('0x9b')]){_0x3ea0a3[_0xa461('0x99')]=_[_0xa461('0x45')](_0x3ea0a3[_0xa461('0x99')],{'$or':_[_0xa461('0x31')](_0x3ea0a3[_0xa461('0x3f')],function(_0x4c2402){var _0x5e5195={};_0x5e5195[_0x4c2402]={'$like':'%'+_0x545bbf[_0xa461('0x37')][_0xa461('0x9b')]+'%'};return _0x5e5195;})});}if(_0x545bbf[_0xa461('0x37')][_0xa461('0x9c')]){var _0x5466fa=_0x545bbf['query'][_0xa461('0x9c')][_0xa461('0x9d')](',');var _0x1cafad={};_0x1cafad[_0x5466fa[0x0]]={'$gte':moment(_0x5466fa[0x1])['format'](_0xa461('0x9e'))};_0x3ea0a3[_0xa461('0x99')]=_['merge'](_0x3ea0a3[_0xa461('0x99')],_0x1cafad);}_0x3ea0a3=_[_0xa461('0x45')]({},_0x3ea0a3,_0x545bbf[_0xa461('0x46')]);return db['ChatMessage'][_0xa461('0x25')]({'where':_0x3ea0a3[_0xa461('0x99')]})[_0xa461('0x14')](function(_0x4ae074){_0x5687bc[_0xa461('0x25')]=_0x4ae074;if(_0x545bbf['query'][_0xa461('0x43')]){_0x3ea0a3['include']=[{'all':!![]}];}return db[_0xa461('0x94')]['findAll'](_0x3ea0a3);})['then'](function(_0x47f7b4){_0x5687bc[_0xa461('0x9f')]=_0x47f7b4;return _0x5687bc;});}})[_0xa461('0x14')](respondWithFilteredResult(_0x1e8a14,_0x3ea0a3))[_0xa461('0x1e')](handleError(_0x1e8a14,null));};exports[_0xa461('0xa0')]=function(_0x4f5635,_0xe4ac20){var _0x22095f={'where':{}},_0x1d56b9={},_0x3012e7={'count':0x0,'rows':[]};return db[_0xa461('0x32')][_0xa461('0x4c')]({'where':{'id':_0x4f5635[_0xa461('0x3a')]['id']}})['then'](handleEntityNotFound(_0xe4ac20,null))['then'](function(_0x59d381){if(_0x59d381){_0x1d56b9[_0xa461('0x3b')]=_['keys'](db[_0xa461('0x94')][_0xa461('0x3c')]);_0x1d56b9[_0xa461('0x37')]=_[_0xa461('0x3d')](_0x4f5635[_0xa461('0x37')]);_0x1d56b9['filters']=_[_0xa461('0x40')](_0x1d56b9['model'],_0x1d56b9[_0xa461('0x37')]);_0x22095f[_0xa461('0x3f')]=_[_0xa461('0x40')](_0x1d56b9[_0xa461('0x3b')],qs['fields'](_0x4f5635[_0xa461('0x37')][_0xa461('0x41')]));_0x22095f['attributes']=_0x22095f[_0xa461('0x3f')][_0xa461('0x42')]?_0x22095f[_0xa461('0x3f')]:_0x1d56b9[_0xa461('0x3b')];if(!_0x4f5635[_0xa461('0x37')][_0xa461('0xa1')](_0xa461('0xa2'))){_0x22095f[_0xa461('0x24')]=qs[_0xa461('0x24')](_0x4f5635['query'][_0xa461('0x24')]);_0x22095f[_0xa461('0x22')]=qs[_0xa461('0x22')](_0x4f5635[_0xa461('0x37')][_0xa461('0x22')]);}_0x22095f[_0xa461('0x96')]=qs[_0xa461('0x97')](_0x4f5635[_0xa461('0x37')]['sort']);_0x22095f['where']=qs[_0xa461('0x3e')](_[_0xa461('0x98')](_0x4f5635['query'],_0x1d56b9['filters']));_0x22095f[_0xa461('0x99')][_0xa461('0x9a')]=_0x59d381['id'];if(_0x4f5635[_0xa461('0x37')]['filter']){_0x22095f[_0xa461('0x99')]=_[_0xa461('0x45')](_0x22095f[_0xa461('0x99')],{'$or':_['map'](_0x22095f['attributes'],function(_0x4e256f){var _0x575a7e={};_0x575a7e[_0x4e256f]={'$like':'%'+_0x4f5635[_0xa461('0x37')]['filter']+'%'};return _0x575a7e;})});}_0x22095f[_0xa461('0x99')][_0xa461('0x88')]=![];if(_0x4f5635[_0xa461('0x37')]['id']){_0x22095f[_0xa461('0x99')]['id']={'$gt':_0x4f5635[_0xa461('0x37')]['id']};}_0x22095f=_[_0xa461('0x45')]({},_0x22095f,_0x4f5635[_0xa461('0x46')]);return db['ChatMessage'][_0xa461('0x25')]({'where':_0x22095f[_0xa461('0x99')]})[_0xa461('0x14')](function(_0x354c78){_0x3012e7[_0xa461('0x25')]=_0x354c78;_0x22095f[_0xa461('0x44')]=[];if(_0x4f5635['query'][_0xa461('0xa3')]){_0x22095f[_0xa461('0x44')][_0xa461('0xa4')]({'model':db[_0xa461('0x7c')],'as':_0xa461('0x7c'),'attributes':['id',_0xa461('0x54'),'alias']});}if(_0x4f5635[_0xa461('0x37')][_0xa461('0x43')]){_0x22095f[_0xa461('0x44')]=[{'all':!![]}];}return db[_0xa461('0x94')][_0xa461('0xa5')](_0x22095f);})[_0xa461('0x14')](function(_0x5d2386){_0x3012e7[_0xa461('0x9f')]=_0x5d2386;return _0x3012e7;});}})[_0xa461('0x14')](respondWithFilteredResult(_0xe4ac20,_0x22095f))[_0xa461('0x1e')](handleError(_0xe4ac20,null));};exports[_0xa461('0xa6')]=function(_0x2acf74,_0x5d13e7){return db[_0xa461('0x32')][_0xa461('0x48')]({'where':{'id':_0x2acf74[_0xa461('0x3a')]['id']}})[_0xa461('0x14')](handleEntityNotFound(_0x5d13e7,null))[_0xa461('0x14')](function(_0x505c8a){if(_0x505c8a){return _0x505c8a['setTags'](_0x2acf74['body'][_0xa461('0x95')],_[_0xa461('0xa7')](_0x2acf74[_0xa461('0x2d')],[_0xa461('0x95'),'id'])||{})[_0xa461('0xa8')](function(){return db[_0xa461('0xa9')][_0xa461('0xa5')]({'attributes':['id',_0xa461('0x2a'),'color'],'where':{'id':_0x2acf74[_0xa461('0x2d')][_0xa461('0x95')]}});})[_0xa461('0x14')](function(_0xc05b98){socket['emit'](_0xa461('0xaa'),{'id':Number(_0x2acf74[_0xa461('0x3a')]['id']),'tags':_0xc05b98||[]});return{'id':Number(_0x2acf74[_0xa461('0x3a')]['id']),'tags':_0xc05b98||[]};});}})[_0xa461('0x14')](respondWithResult(_0x5d13e7,null))[_0xa461('0x1e')](handleError(_0x5d13e7,null));};exports['removeTags']=function(_0x4dbe98,_0x4c6797){return db[_0xa461('0x32')][_0xa461('0x48')]({'where':{'id':_0x4dbe98['params']['id']}})[_0xa461('0x14')](handleEntityNotFound(_0x4c6797,null))[_0xa461('0x14')](function(_0x147089){if(_0x147089){return _0x147089[_0xa461('0xab')](_0x4dbe98[_0xa461('0x37')][_0xa461('0x95')]);}})['then'](respondWithStatusCode(_0x4c6797,null))[_0xa461('0x1e')](handleError(_0x4c6797,null));};exports[_0xa461('0x77')]=function(_0x21eb16,_0x22134e){var _0x41288d=moment()[_0xa461('0xac')]()[_0xa461('0xad')]();var _0xe7ee4a=path[_0xa461('0x74')](config[_0xa461('0x75')],_0xa461('0xae'),'files',_0xa461('0xaf'));var _0x1d0abe=path['join'](config['root'],_0xa461('0xae'),_0xa461('0xb0'),_0xa461('0xb1'));var _0xab220c=path[_0xa461('0x74')](_0xe7ee4a,_0x41288d);var _0x390b9f=util[_0xa461('0x79')](_0xa461('0xb2'),_0x21eb16[_0xa461('0x3a')]['id'],_0x41288d);var _0x34285b=path[_0xa461('0x74')](_0xe7ee4a,_0x390b9f);var _0x50b21c=[];_0x50b21c[_0xa461('0xa4')]({'model':db[_0xa461('0x7c')],'as':_0xa461('0x7c'),'attributes':['id',_0xa461('0x54')],'raw':!![]});_0x50b21c[_0xa461('0xa4')]({'model':db[_0xa461('0x62')],'as':_0xa461('0x63'),'attributes':['id',_0xa461('0xb3'),_0xa461('0xb4')],'raw':!![]});if(_0x21eb16['query'][_0xa461('0xb1')]){_0x50b21c[_0xa461('0xa4')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x54611b=[{'model':db[_0xa461('0x94')],'as':_0xa461('0x7b'),'attributes':['id','body',_0xa461('0xb5'),'direction','secret','read'],'include':_0x50b21c}];_0x54611b['push']({'model':db[_0xa461('0x4d')],'as':_0xa461('0xb6'),'attributes':['id',_0xa461('0x2a')]});_0x54611b['push']({'model':db[_0xa461('0x7c')],'as':_0xa461('0xb7'),'attributes':['id',_0xa461('0x54')]});return db[_0xa461('0x32')][_0xa461('0x48')]({'where':{'id':_0x21eb16[_0xa461('0x3a')]['id']},'include':_0x54611b})[_0xa461('0x14')](handleEntityNotFound(_0x22134e,null))[_0xa461('0x14')](function(_0x3b98c6){if(_0x3b98c6){var _0x3abe5d=_0x3b98c6[_0xa461('0xb8')]({'plain':!![]});fs['mkdirSync'](_0xab220c);var _0x5e2774={'channel':_0xa461('0xb9'),'account':_0x3abe5d[_0xa461('0xb6')][_0xa461('0x2a')],'agent':_0x3abe5d[_0xa461('0xb7')]?_0x3abe5d[_0xa461('0xb7')][_0xa461('0x54')]:_0xa461('0xba'),'createdAt':moment(_0x3abe5d[_0xa461('0xb5')])['format'](_0xa461('0x9e'))[_0xa461('0xad')](),'closedAt':_0x3abe5d[_0xa461('0x6f')]?moment(_0x3abe5d[_0xa461('0xbb')])[_0xa461('0x79')](_0xa461('0x9e'))[_0xa461('0xad')]():'','disposition':_0x3abe5d[_0xa461('0xbc')],'chatInfo':{'browser':_0x3abe5d[_0xa461('0xbd')],'os':_0x3abe5d[_0xa461('0xbe')],'referer':_0x3abe5d[_0xa461('0xbf')],'customerIp':_0x3abe5d['customerIp'],'customerPort':_0x3abe5d['customerPort']?_0x3abe5d[_0xa461('0xc0')]:_0xa461('0xba')},'messages':_(_0x3abe5d[_0xa461('0x7b')])['tail']()['filter']({'secret':![]})['map'](function(_0x5ea11b){if(_0x5ea11b['Attachment']){var _0x4f0300=path[_0xa461('0x74')](_0x1d0abe,_0x5ea11b[_0xa461('0xc1')][_0xa461('0x6a')]);if(fs[_0xa461('0xc2')](_0x4f0300)){fs[_0xa461('0xc3')](_0x4f0300)[_0xa461('0xc4')](fs['createWriteStream'](path[_0xa461('0x74')](_0xab220c,_0x5ea11b['Attachment'][_0xa461('0x6a')])));}}return{'date':moment(_0x5ea11b['createdAt'])['format'](_0xa461('0x9e'))[_0xa461('0xad')](),'sender':_0x5ea11b[_0xa461('0x87')]===_0xa461('0xc5')?_0x5ea11b[_0xa461('0x7c')]?_0x5ea11b[_0xa461('0x7c')][_0xa461('0x54')]:_0xa461('0x80'):_0x5ea11b[_0xa461('0x63')][_0xa461('0xb3')]+(_0x5ea11b['Contact'][_0xa461('0xb4')]?'\x20'+_0x5ea11b['Contact'][_0xa461('0xb4')]:''),'body':_0x5ea11b[_0xa461('0xc1')]?_0x5ea11b[_0xa461('0xc1')][_0xa461('0x6a')]:_0x5ea11b[_0xa461('0x2d')],'direction':_0x5ea11b['direction']===_0xa461('0xc5')?'A':'C','secret':_0x5ea11b[_0xa461('0x88')],'read':_0x5ea11b['read'],'attachment':_0x5ea11b[_0xa461('0xc1')]};})['value']()};return ejs[_0xa461('0xc6')](path[_0xa461('0x74')](config[_0xa461('0x75')],'server','views',_0xa461('0xc7')),{'interaction':_0x5e2774})[_0xa461('0x14')](function(_0x14d4e6){var _0x2ce271=path[_0xa461('0x74')](_0xab220c,_0xa461('0xc8')+_0x3abe5d['id']+'-'+_0x41288d+_0xa461('0xc9'));var _0x44e43c={'path':_0x2ce271,'channel':_0xa461('0xb9'),'interactionId':_0x3abe5d['id']};return pdf[_0xa461('0xca')](_0x14d4e6,_0x44e43c);})[_0xa461('0x14')](function(){return new Promise(function(_0x4088f7,_0xfd88f3){zipdir(_0xab220c,{'saveTo':_0x34285b},function(_0x38dc7b,_0x5b0360){if(_0x38dc7b)return _0xfd88f3(_0x38dc7b);return _0x4088f7(_0x5b0360);});})[_0xa461('0x14')](function(){return new BPromise(function(_0x52cb13,_0x547869){rimraf(_0xab220c,function(_0x137949){if(_0x137949)_0x547869(_0x137949);return _0x52cb13();});});})[_0xa461('0x14')](function(){return _0x22134e[_0xa461('0x77')](_0x34285b,_0x390b9f,function(_0x505513){if(_0x505513){logger[_0xa461('0x18')](_0xa461('0xcb'),_0x505513);}else{fs[_0xa461('0xcc')](_0x34285b);}});});});}else{return _0x22134e[_0xa461('0x1f')](0xc8);}})['catch'](handleError(_0x22134e,null));};
\ No newline at end of file
+var _0x1b4e=['../../config/environment','../../mysqldb','localhost','redis','./chatInteraction.socket','register','jayson/promise','http','client','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','update','destroy','end','stack','name','send','render','merge','contact','agent','interaction','index','map','ChatInteraction','rawAttributes','fieldName','type','key','findAll','chat','query','catch','show','model','keys','filters','intersection','attributes','fields','length','options','create','body','find','params','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','Attachment','join','server/files/attachments/','offline-chat/','download','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ContactId','Messages','UserId','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','User','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','getMyMessages','ChatInteractionId','include','push','alias','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','files','firstName','lastName','Owner','mkdirSync','Chat','Account','toString','closedAt','browserName','osName','customerIp','customerPort','N.A.','tail','createReadStream','pipe','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api'];(function(_0x4f0da3,_0x133007){var _0x1f92f1=function(_0x5f52db){while(--_0x5f52db){_0x4f0da3['push'](_0x4f0da3['shift']());}};_0x1f92f1(++_0x133007);}(_0x1b4e,0xc6));var _0xe1b4=function(_0x3287c0,_0x36471c){_0x3287c0=_0x3287c0-0x0;var _0x343575=_0x1b4e[_0x3287c0];return _0x343575;};'use strict';var rimraf=require(_0xe1b4('0x0'));var zipdir=require(_0xe1b4('0x1'));var rp=require(_0xe1b4('0x2'));var moment=require(_0xe1b4('0x3'));var BPromise=require(_0xe1b4('0x4'));var Mustache=require(_0xe1b4('0x5'));var util=require('util');var path=require(_0xe1b4('0x6'));var ejs=require(_0xe1b4('0x7'));var fs=require('fs');var _=require(_0xe1b4('0x8'));var Redis=require(_0xe1b4('0x9'));var interaction=require(_0xe1b4('0xa'));var qs=require(_0xe1b4('0xb'));var pdf=require(_0xe1b4('0xc'));var logger=require(_0xe1b4('0xd'))(_0xe1b4('0xe'));var config=require(_0xe1b4('0xf'));var db=require(_0xe1b4('0x10'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xe1b4('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe1b4('0x12')]));require(_0xe1b4('0x13'))[_0xe1b4('0x14')](socket);var jayson=require(_0xe1b4('0x15'));var client=jayson['client'][_0xe1b4('0x16')]({'port':0x232b});var client9004=jayson[_0xe1b4('0x17')][_0xe1b4('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x28617b,_0x55edff,_0x2d4719,_0x310c44){return new BPromise(function(_0x64b892,_0x9c41b6){var _0x5ca195=_0x310c44||client;return _0x5ca195[_0xe1b4('0x18')](_0x28617b,_0x2d4719)[_0xe1b4('0x19')](function(_0x4854b4){logger['info'](_0xe1b4('0x1a'),_0x55edff,_0xe1b4('0x1b'));logger[_0xe1b4('0x1c')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x55edff,'request\x20sent',JSON['stringify'](_0x4854b4));if(_0x4854b4[_0xe1b4('0x1d')]){if(_0x4854b4['error'][_0xe1b4('0x1e')]===0x1f4){logger[_0xe1b4('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x55edff,_0x4854b4['error'][_0xe1b4('0x1f')]);return _0x9c41b6(_0x4854b4[_0xe1b4('0x1d')][_0xe1b4('0x1f')]);}logger['error'](_0xe1b4('0x1a'),_0x55edff,_0x4854b4[_0xe1b4('0x1d')][_0xe1b4('0x1f')]);return _0x64b892(_0x4854b4[_0xe1b4('0x1d')][_0xe1b4('0x1f')]);}else{logger[_0xe1b4('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x55edff,_0xe1b4('0x1b'));_0x64b892(_0x4854b4[_0xe1b4('0x21')][_0xe1b4('0x1f')]);}})['catch'](function(_0x5a1c5e){logger[_0xe1b4('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x55edff,_0x5a1c5e);_0x9c41b6(_0x5a1c5e);});});}function respondWithStatusCode(_0x193854,_0x1446d6){_0x1446d6=_0x1446d6||0xcc;return function(_0x46edfb){if(_0x46edfb){return _0x193854[_0xe1b4('0x22')](_0x1446d6);}return _0x193854[_0xe1b4('0x23')](_0x1446d6)['end']();};}function respondWithResult(_0x19f216,_0x159ad6){_0x159ad6=_0x159ad6||0xc8;return function(_0x524aca){if(_0x524aca){return _0x19f216['status'](_0x159ad6)['json'](_0x524aca);}};}function respondWithFilteredResult(_0x4022a0,_0x141aa0){return function(_0x2ff756){if(_0x2ff756){var _0x5bf4f7=typeof _0x141aa0[_0xe1b4('0x24')]==='undefined'&&typeof _0x141aa0[_0xe1b4('0x25')]===_0xe1b4('0x26');var _0x46659c=_0x2ff756[_0xe1b4('0x27')];var _0x3f2e13=_0x5bf4f7?0x0:_0x141aa0['offset'];var _0x2038d1=_0x5bf4f7?_0x2ff756[_0xe1b4('0x27')]:_0x141aa0['offset']+_0x141aa0['limit'];var _0x41c18b;if(_0x2038d1>=_0x46659c){_0x2038d1=_0x46659c;_0x41c18b=0xc8;}else{_0x41c18b=0xce;}_0x4022a0['status'](_0x41c18b);return _0x4022a0[_0xe1b4('0x28')](_0xe1b4('0x29'),_0x3f2e13+'-'+_0x2038d1+'/'+_0x46659c)[_0xe1b4('0x2a')](_0x2ff756);}return null;};}function saveUpdates(_0x282af5){return function(_0x43c79f){if(_0x43c79f){return _0x43c79f[_0xe1b4('0x2b')](_0x282af5)[_0xe1b4('0x19')](function(_0x26e9dd){return _0x26e9dd;});}return null;};}function removeEntity(_0x4bb2ef){return function(_0x1939db){if(_0x1939db){return _0x1939db[_0xe1b4('0x2c')]()['then'](function(){_0x4bb2ef[_0xe1b4('0x23')](0xcc)[_0xe1b4('0x2d')]();});}};}function handleEntityNotFound(_0x4bc134){return function(_0x52ba04){if(!_0x52ba04){_0x4bc134[_0xe1b4('0x22')](0x194);}return _0x52ba04;};}function handleError(_0x30704b,_0x3f799d){_0x3f799d=_0x3f799d||0x1f4;return function(_0x3fad69){logger['error'](_0x3fad69[_0xe1b4('0x2e')]);if(_0x3fad69[_0xe1b4('0x2f')]){delete _0x3fad69[_0xe1b4('0x2f')];}_0x30704b['status'](_0x3f799d)[_0xe1b4('0x30')](_0x3fad69);};}function getMustacheRender(_0x1a1b56,_0x10dbc1){return Mustache[_0xe1b4('0x31')](_0x1a1b56,_[_0xe1b4('0x32')](_0x10dbc1['body'],{'contact':_0x10dbc1[_0xe1b4('0x33')],'message':_0x10dbc1['message'],'agent':_0x10dbc1[_0xe1b4('0x34')],'interaction':_0x10dbc1[_0xe1b4('0x35')],'account':_0x10dbc1['account']}))||'';}exports[_0xe1b4('0x36')]=function(_0x283723,_0x1df736){var _0xba3be7={};var _0x48dbdd=_[_0xe1b4('0x37')](db[_0xe1b4('0x38')][_0xe1b4('0x39')],function(_0x103614){return{'name':_0x103614[_0xe1b4('0x3a')],'type':_0x103614[_0xe1b4('0x3b')][_0xe1b4('0x3c')]};});_0xba3be7=qs['getOptions'](_0x48dbdd,_0x283723);return interaction[_0xe1b4('0x3d')](_0xe1b4('0x3e'),_0x283723[_0xe1b4('0x3f')],_0x283723['user'],_0xba3be7,_0x48dbdd)['then'](respondWithFilteredResult(_0x1df736,_0xba3be7))[_0xe1b4('0x40')](handleError(_0x1df736,null));};exports[_0xe1b4('0x41')]=function(_0x156050,_0x510ec6){var _0x9e3bc0={'raw':![],'where':{'id':_0x156050['params']['id']}},_0x211daa={};_0x211daa[_0xe1b4('0x42')]=_[_0xe1b4('0x43')](db[_0xe1b4('0x38')][_0xe1b4('0x39')]);_0x211daa[_0xe1b4('0x3f')]=_['keys'](_0x156050['query']);_0x211daa[_0xe1b4('0x44')]=_[_0xe1b4('0x45')](_0x211daa[_0xe1b4('0x42')],_0x211daa[_0xe1b4('0x3f')]);_0x9e3bc0[_0xe1b4('0x46')]=_[_0xe1b4('0x45')](_0x211daa[_0xe1b4('0x42')],qs[_0xe1b4('0x47')](_0x156050[_0xe1b4('0x3f')][_0xe1b4('0x47')]));_0x9e3bc0[_0xe1b4('0x46')]=_0x9e3bc0['attributes'][_0xe1b4('0x48')]?_0x9e3bc0[_0xe1b4('0x46')]:_0x211daa['model'];if(_0x156050[_0xe1b4('0x3f')]['includeAll']){_0x9e3bc0['include']=[{'all':!![]}];}_0x9e3bc0=_[_0xe1b4('0x32')]({},_0x9e3bc0,_0x156050[_0xe1b4('0x49')]);return db[_0xe1b4('0x38')]['find'](_0x9e3bc0)[_0xe1b4('0x19')](handleEntityNotFound(_0x510ec6,null))[_0xe1b4('0x19')](respondWithResult(_0x510ec6,null))[_0xe1b4('0x40')](handleError(_0x510ec6,null));};exports[_0xe1b4('0x4a')]=function(_0x2efbcb,_0xd53cbc){return db[_0xe1b4('0x38')][_0xe1b4('0x4a')](_0x2efbcb[_0xe1b4('0x4b')],{})[_0xe1b4('0x19')](respondWithResult(_0xd53cbc,0xc9))['catch'](handleError(_0xd53cbc,null));};exports['update']=function(_0x309de3,_0x2e8ff3){if(_0x309de3[_0xe1b4('0x4b')]['id']){delete _0x309de3[_0xe1b4('0x4b')]['id'];}return db[_0xe1b4('0x38')][_0xe1b4('0x4c')]({'where':{'id':_0x309de3[_0xe1b4('0x4d')]['id']}})[_0xe1b4('0x19')](handleEntityNotFound(_0x2e8ff3,null))[_0xe1b4('0x19')](saveUpdates(_0x309de3['body'],null))[_0xe1b4('0x19')](respondWithResult(_0x2e8ff3,null))[_0xe1b4('0x40')](handleError(_0x2e8ff3,null));};exports[_0xe1b4('0x2c')]=function(_0x46ac09,_0x43b2fe){return db[_0xe1b4('0x38')][_0xe1b4('0x4c')]({'where':{'id':_0x46ac09[_0xe1b4('0x4d')]['id']}})[_0xe1b4('0x19')](handleEntityNotFound(_0x43b2fe,null))[_0xe1b4('0x19')](removeEntity(_0x43b2fe,null))[_0xe1b4('0x40')](handleError(_0x43b2fe,null));};exports['describe']=function(_0x5e8cfa,_0x2cd966){return db[_0xe1b4('0x38')][_0xe1b4('0x4e')]()[_0xe1b4('0x19')](respondWithResult(_0x2cd966,null))[_0xe1b4('0x40')](handleError(_0x2cd966,null));};exports[_0xe1b4('0x4f')]=function(_0x57e833,_0x3fa28b){var _0x2cfaf2=_0x57e833[_0xe1b4('0x4d')]['id'];var _0x4a4088;var _0x14d581;var _0x359ee8;return db[_0xe1b4('0x38')][_0xe1b4('0x50')]({'where':{'id':_0x2cfaf2}})[_0xe1b4('0x19')](function(_0x58a6d8){_0x4a4088=_0x58a6d8;return db[_0xe1b4('0x51')][_0xe1b4('0x50')]({'where':{'id':_0x58a6d8[_0xe1b4('0x52')]},'attributes':['id','vidaooApiKey',_0xe1b4('0x53'),_0xe1b4('0x54'),_0xe1b4('0x55'),_0xe1b4('0x56')],'raw':!![]});})[_0xe1b4('0x19')](function(_0x4229e8){if(_0x4229e8&&_0x4229e8[_0xe1b4('0x57')]&&_0x4229e8[_0xe1b4('0x53')]){_0x14d581=_0x4229e8;var _0x238844={'interaction':{'id':_0x2cfaf2},'agent':{'id':_0x57e833['user']['id'],'name':_0x57e833[_0xe1b4('0x58')][_0xe1b4('0x2f')],'fullname':_0x57e833['user'][_0xe1b4('0x59')],'email':_0x57e833[_0xe1b4('0x58')][_0xe1b4('0x5a')]},'contact':_0x57e833[_0xe1b4('0x4b')]['contact'],'account':_0x57e833[_0xe1b4('0x4b')][_0xe1b4('0x5b')]};var _0x3a5d38={'rejectUnauthorized':![],'method':_0xe1b4('0x5c'),'url':_0xe1b4('0x5d'),'headers':{'X-APIKEY':_0x4229e8[_0xe1b4('0x57')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x57e833[_0xe1b4('0x58')][_0xe1b4('0x5a')]],'buttons':null,'topic':_0x14d581[_0xe1b4('0x54')],'note':_[_0xe1b4('0x5e')](_0x14d581[_0xe1b4('0x55')])?null:getMustacheRender(_0x14d581[_0xe1b4('0x55')],_0x238844),'metadata':null},'redirect':_0xe1b4('0x5f'),'json':!![]};try{if(!_[_0xe1b4('0x5e')](_0x14d581[_0xe1b4('0x56')])){var _0x1cdfe3=getMustacheRender(_0x14d581[_0xe1b4('0x56')],_0x238844);var _0x9c307c=JSON[_0xe1b4('0x60')](_0x1cdfe3);_0x3a5d38[_0xe1b4('0x4b')][_0xe1b4('0x61')]=_0x9c307c;}}catch(_0x26b4a6){throw new db['Sequelize']['ValidationError'](_0xe1b4('0x62'));}return rp(_0x3a5d38);}else{throw new db[(_0xe1b4('0x63'))][(_0xe1b4('0x64'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xe1b4('0x19')](function(_0x15f286){_0x359ee8=_0x15f286;if(_0x359ee8['id']){var _0x28f7eb={'body':_0x359ee8[_0xe1b4('0x65')],'ChatWebsiteId':_0x14d581['id'],'ChatInteractionId':_0x4a4088['id'],'direction':_0xe1b4('0x66'),'UserId':_0x57e833[_0xe1b4('0x58')]['id']};return db[_0xe1b4('0x67')]['create'](_0x28f7eb,{});}else{throw new db[(_0xe1b4('0x63'))]['ValidationError'](_0xe1b4('0x68'));}})['then'](function(){return _0x4a4088[_0xe1b4('0x69')]({'vidaooSessionId':_0x359ee8['id']});})[_0xe1b4('0x19')](respondWithResult(_0x3fa28b,null))['catch'](handleError(_0x3fa28b,null));};exports[_0xe1b4('0x6a')]=function(_0x621a3c,_0x1d70b0){if(_0x621a3c[_0xe1b4('0x4b')]['id']){delete _0x621a3c['body']['id'];}return db[_0xe1b4('0x38')][_0xe1b4('0x4c')]({'where':{'id':_0x621a3c[_0xe1b4('0x4d')]['id']},'include':[{'model':db[_0xe1b4('0x6b')],'as':_0xe1b4('0x6c')}]})[_0xe1b4('0x19')](handleEntityNotFound(_0x1d70b0,null))[_0xe1b4('0x19')](saveUpdates(_0x621a3c[_0xe1b4('0x4b')],null))['then'](respondWithResult(_0x1d70b0,null))[_0xe1b4('0x40')](handleError(_0x1d70b0,null));};exports[_0xe1b4('0x6d')]=function(_0x38ef05,_0x5e6c6a){if(_0x38ef05[_0xe1b4('0x4b')]['id']){delete _0x38ef05[_0xe1b4('0x4b')]['id'];}return db[_0xe1b4('0x38')]['find']({'where':{'id':_0x38ef05['params']['id']}})['then'](function(_0x7138ef){if(!_0x7138ef){logger[_0xe1b4('0x1d')](_0xe1b4('0x6e'),_0xe1b4('0x6d'),0x194,'entity\x20not\x20found');_0x5e6c6a[_0xe1b4('0x22')](0x194);}else{if(_0x7138ef['UserId']){throw new db[(_0xe1b4('0x63'))][(_0xe1b4('0x64'))](_0xe1b4('0x6f'));}}return _0x7138ef;})['then'](function(_0x48bed9){if(_0x48bed9){return _0x48bed9[_0xe1b4('0x2b')]({'closed':_0x38ef05['body'][_0xe1b4('0x70')],'disposition':_0x38ef05['body'][_0xe1b4('0x71')]})[_0xe1b4('0x19')](function(_0x4064e3){return _0x4064e3;});}})['then'](function(){return respondWithRpcPromise(_0xe1b4('0x72'),_0xe1b4('0x6d'),_0x38ef05[_0xe1b4('0x4b')],client9004);})['then'](respondWithResult(_0x5e6c6a,null))['catch'](handleError(_0x5e6c6a,null));};exports[_0xe1b4('0x73')]=function(_0xed1fc0,_0x4637e7){_0xed1fc0[_0xe1b4('0x4b')][_0xe1b4('0x2f')]=_0xed1fc0[_0xe1b4('0x74')]['originalname'];_0xed1fc0[_0xe1b4('0x4b')][_0xe1b4('0x75')]=_0xed1fc0[_0xe1b4('0x74')][_0xe1b4('0x76')];_0xed1fc0['body'][_0xe1b4('0x3b')]=_0xed1fc0[_0xe1b4('0x74')]['mimetype'];return db[_0xe1b4('0x77')]['create'](_0xed1fc0[_0xe1b4('0x4b')])['then'](respondWithResult(_0x4637e7,0xc9))[_0xe1b4('0x40')](handleError(_0x4637e7,null));};exports['attachmentDownload']=function(_0x4ff322,_0x1e0d2c){return db[_0xe1b4('0x38')][_0xe1b4('0x50')]({'where':{'id':_0x4ff322[_0xe1b4('0x4d')]['id']},'raw':!![]})[_0xe1b4('0x19')](handleEntityNotFound(_0x1e0d2c,null))['then'](function(_0x416061){if(_0x416061){if(_0x416061[_0xe1b4('0x70')]){return _0x1e0d2c['status'](0x193)[_0xe1b4('0x2a')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0xe1b4('0x50')]({'where':{'id':_0x4ff322[_0xe1b4('0x3f')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x1e0d2c,null));}})[_0xe1b4('0x19')](function(_0x1743c0){if(_0x1743c0){var _0x3d0e30=_0x1743c0['ChatOfflineMessageId']!==null;var _0x7f4d25=path[_0xe1b4('0x78')](config['root'],_0xe1b4('0x79'));if(_0x3d0e30){_0x7f4d25=path['join'](_0x7f4d25,_0xe1b4('0x7a'));}var _0x5b5063=path[_0xe1b4('0x78')](_0x7f4d25,_0x1743c0[_0xe1b4('0x75')]);return _0x1e0d2c[_0xe1b4('0x7b')](_0x5b5063);}})[_0xe1b4('0x40')](handleError(_0x1e0d2c,null));};exports['close']=function(_0x309b98,_0x2bc5f7){var _0x5a98f1=null;var _0x4e4d34=null;var _0x2b46bc=null;if(_0x309b98['body']['id']){delete _0x309b98[_0xe1b4('0x4b')]['id'];}if(_0x309b98[_0xe1b4('0x4b')][_0xe1b4('0x7c')]){_0x2b46bc=path[_0xe1b4('0x78')](config[_0xe1b4('0x7d')],_0xe1b4('0x7e'),util[_0xe1b4('0x7f')](_0xe1b4('0x80'),Date[_0xe1b4('0x81')]()));_0x309b98[_0xe1b4('0x4b')][_0xe1b4('0x82')]=_0x2b46bc;}return db['ChatInteraction']['find']({'where':{'id':_0x309b98[_0xe1b4('0x4d')]['id']},'include':[{'model':db[_0xe1b4('0x67')],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})[_0xe1b4('0x19')](handleEntityNotFound(_0x2bc5f7,null))[_0xe1b4('0x19')](saveUpdates(_0x309b98[_0xe1b4('0x4b')],null))[_0xe1b4('0x19')](function(_0x525fd9){if(_0x525fd9){_0x5a98f1=_0x525fd9;return db[_0xe1b4('0x51')][_0xe1b4('0x4c')]({'where':{'id':_0x5a98f1[_0xe1b4('0x52')]}});}})[_0xe1b4('0x19')](function(_0x3787e0){if(_0x3787e0){_0x4e4d34=_0x3787e0;return db[_0xe1b4('0x6b')][_0xe1b4('0x4c')]({'where':{'id':_0x5a98f1[_0xe1b4('0x83')]}});}})[_0xe1b4('0x19')](function(_0x2877a0){if(_0x2877a0){if(_0x2b46bc){var _0x3439cf=null;for(var _0x1ffe97=0x1;_0x1ffe97<_0x5a98f1['Messages']['length'];++_0x1ffe97){_0x3439cf=_0x5a98f1[_0xe1b4('0x84')][_0x1ffe97];var _0x31572c=_0x3439cf[_0xe1b4('0x85')]?util[_0xe1b4('0x7f')](_0xe1b4('0x86'),_0x4e4d34[_0xe1b4('0x87')],_0x3439cf[_0xe1b4('0x85')]):_0xe1b4('0x88');var _0x389a04=_0x309b98[_0xe1b4('0x4b')][_0xe1b4('0x89')]||util[_0xe1b4('0x7f')]('%s%d','Visitor',_0x3439cf[_0xe1b4('0x83')]);switch(_0x4e4d34[_0xe1b4('0x8a')]){case _0xe1b4('0x8b'):_0x31572c=_0x3439cf[_0xe1b4('0x85')]?util['format'](_0xe1b4('0x86'),_0x4e4d34[_0xe1b4('0x87')],_0x3439cf['UserId']):'System';break;case _0xe1b4('0x8c'):_0x31572c=_0x3439cf[_0xe1b4('0x85')]?_0x3439cf[_0xe1b4('0x8d')]['alias']||_0x3439cf[_0xe1b4('0x8d')][_0xe1b4('0x59')]:_0xe1b4('0x88');break;case'agent_fullname':_0x31572c=_0x3439cf['UserId']?_0x3439cf['User'][_0xe1b4('0x59')]:_0xe1b4('0x88');break;default:_0x31572c=_0x3439cf[_0xe1b4('0x85')]?util[_0xe1b4('0x7f')]('%s%d',_0x4e4d34['agentAlias'],_0x3439cf[_0xe1b4('0x85')]):_0xe1b4('0x88');}var _0x1916ea=util[_0xe1b4('0x7f')](_0xe1b4('0x8e'),moment(_0x3439cf[_0xe1b4('0x8f')])[_0xe1b4('0x7f')](_0xe1b4('0x90')),_0x3439cf[_0xe1b4('0x91')]==='in'?_0x389a04:_0x31572c,_0x3439cf[_0xe1b4('0x4b')]);if(!_0x3439cf[_0xe1b4('0x92')]){fs[_0xe1b4('0x93')](_0x2b46bc,_0x1916ea);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xe1b4('0x94')],'as':_0xe1b4('0x95'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xe1b4('0x96'),'raw':!![]}]}]});}}})[_0xe1b4('0x19')](function(_0x3538f6){if(!_0x3538f6||!_0x3538f6['Smtp']||!_0x309b98[_0xe1b4('0x4b')])return _0x5a98f1;var _0x13c787=_0x3538f6[_0xe1b4('0x97')]();return respondWithRpcPromise(_0xe1b4('0x98'),'sendMail',{'account':_0x13c787,'message':{'from':util[_0xe1b4('0x7f')](_0xe1b4('0x99'),_0x3538f6[_0xe1b4('0x2f')],_0x3538f6[_0xe1b4('0x5a')]||_0x3538f6[_0xe1b4('0x95')][_0xe1b4('0x58')]),'to':_0x309b98[_0xe1b4('0x4b')][_0xe1b4('0x7c')],'subject':_0xe1b4('0x9a'),'text':util[_0xe1b4('0x7f')](_0xe1b4('0x9b'),_0x309b98[_0xe1b4('0x4b')][_0xe1b4('0x7c')]),'attachments':[{'path':_0x2b46bc}]}})[_0xe1b4('0x19')](function(){return _0x5a98f1;})['catch'](function(_0x4bf704){logger[_0xe1b4('0x1d')](_0x4bf704);});})['then'](respondWithStatusCode(_0x2bc5f7,0xc8))[_0xe1b4('0x40')](handleError(_0x2bc5f7,null));};exports[_0xe1b4('0x9c')]=function(_0x3fed61,_0x427b25){return db[_0xe1b4('0x67')][_0xe1b4('0x4c')]({'where':{'id':_0x3fed61[_0xe1b4('0x4d')]['id']}})[_0xe1b4('0x19')](handleEntityNotFound(_0x427b25,null))['then'](function(_0x4f3c17){if(_0x4f3c17){return _0x4f3c17[_0xe1b4('0x9c')](_0x3fed61['body'][_0xe1b4('0x9d')],_[_0xe1b4('0x9e')](_0x3fed61[_0xe1b4('0x4b')],[_0xe1b4('0x9d'),'id'])||{});}})['then'](respondWithResult(_0x427b25,null))[_0xe1b4('0x40')](handleError(_0x427b25,null));};exports[_0xe1b4('0x9f')]=function(_0x1c5dde,_0x297982){var _0x450d5c={'raw':![],'where':{}};var _0xe829e2={};var _0x4d99e3={'count':0x0,'rows':[]};return db[_0xe1b4('0x38')][_0xe1b4('0x50')]({'where':{'id':_0x1c5dde[_0xe1b4('0x4d')]['id']}})[_0xe1b4('0x19')](handleEntityNotFound(_0x297982,null))[_0xe1b4('0x19')](function(_0x795bde){if(_0x795bde){_0xe829e2[_0xe1b4('0x42')]=_[_0xe1b4('0x43')](db[_0xe1b4('0x67')][_0xe1b4('0x39')]);_0xe829e2[_0xe1b4('0x3f')]=_[_0xe1b4('0x43')](_0x1c5dde[_0xe1b4('0x3f')]);_0xe829e2[_0xe1b4('0x44')]=_['intersection'](_0xe829e2[_0xe1b4('0x42')],_0xe829e2[_0xe1b4('0x3f')]);_0x450d5c['attributes']=_[_0xe1b4('0x45')](_0xe829e2[_0xe1b4('0x42')],qs[_0xe1b4('0x47')](_0x1c5dde['query'][_0xe1b4('0x47')]));_0x450d5c[_0xe1b4('0x46')]=_0x450d5c[_0xe1b4('0x46')][_0xe1b4('0x48')]?_0x450d5c[_0xe1b4('0x46')]:_0xe829e2[_0xe1b4('0x42')];if(!_0x1c5dde[_0xe1b4('0x3f')][_0xe1b4('0xa0')](_0xe1b4('0xa1'))){_0x450d5c['limit']=qs[_0xe1b4('0x25')](_0x1c5dde['query']['limit']);_0x450d5c[_0xe1b4('0x24')]=qs[_0xe1b4('0x24')](_0x1c5dde['query'][_0xe1b4('0x24')]);}_0x450d5c[_0xe1b4('0xa2')]=qs[_0xe1b4('0xa3')](_0x1c5dde[_0xe1b4('0x3f')][_0xe1b4('0xa3')]);_0x450d5c['where']=qs[_0xe1b4('0x44')](_[_0xe1b4('0xa4')](_0x1c5dde[_0xe1b4('0x3f')],_0xe829e2[_0xe1b4('0x44')]));_0x450d5c['where']['ChatInteractionId']=_0x795bde['id'];if(_0x1c5dde['query']['filter']){_0x450d5c[_0xe1b4('0xa5')]=_['merge'](_0x450d5c[_0xe1b4('0xa5')],{'$or':_['map'](_0x450d5c[_0xe1b4('0x46')],function(_0x207afb){var _0x30b888={};_0x30b888[_0x207afb]={'$like':'%'+_0x1c5dde[_0xe1b4('0x3f')][_0xe1b4('0xa6')]+'%'};return _0x30b888;})});}if(_0x1c5dde[_0xe1b4('0x3f')][_0xe1b4('0xa7')]){var _0x1442c1=_0x1c5dde[_0xe1b4('0x3f')]['$gte'][_0xe1b4('0xa8')](',');var _0xb63c0={};_0xb63c0[_0x1442c1[0x0]]={'$gte':moment(_0x1442c1[0x1])[_0xe1b4('0x7f')](_0xe1b4('0xa9'))};_0x450d5c[_0xe1b4('0xa5')]=_[_0xe1b4('0x32')](_0x450d5c[_0xe1b4('0xa5')],_0xb63c0);}_0x450d5c=_['merge']({},_0x450d5c,_0x1c5dde[_0xe1b4('0x49')]);return db[_0xe1b4('0x67')][_0xe1b4('0x27')]({'where':_0x450d5c[_0xe1b4('0xa5')]})[_0xe1b4('0x19')](function(_0x428ccb){_0x4d99e3['count']=_0x428ccb;if(_0x1c5dde['query'][_0xe1b4('0xaa')]){_0x450d5c['include']=[{'all':!![]}];}return db[_0xe1b4('0x67')][_0xe1b4('0x3d')](_0x450d5c);})[_0xe1b4('0x19')](function(_0xa13344){_0x4d99e3[_0xe1b4('0xab')]=_0xa13344;return _0x4d99e3;});}})[_0xe1b4('0x19')](respondWithFilteredResult(_0x297982,_0x450d5c))[_0xe1b4('0x40')](handleError(_0x297982,null));};exports[_0xe1b4('0xac')]=function(_0x39ac0f,_0x43eb88){var _0x50bc87={'where':{}},_0x57c791={},_0x59f7a5={'count':0x0,'rows':[]};return db[_0xe1b4('0x38')][_0xe1b4('0x50')]({'where':{'id':_0x39ac0f['params']['id']}})[_0xe1b4('0x19')](handleEntityNotFound(_0x43eb88,null))[_0xe1b4('0x19')](function(_0x3fad96){if(_0x3fad96){_0x57c791['model']=_[_0xe1b4('0x43')](db[_0xe1b4('0x67')][_0xe1b4('0x39')]);_0x57c791[_0xe1b4('0x3f')]=_[_0xe1b4('0x43')](_0x39ac0f[_0xe1b4('0x3f')]);_0x57c791[_0xe1b4('0x44')]=_[_0xe1b4('0x45')](_0x57c791['model'],_0x57c791[_0xe1b4('0x3f')]);_0x50bc87[_0xe1b4('0x46')]=_[_0xe1b4('0x45')](_0x57c791[_0xe1b4('0x42')],qs[_0xe1b4('0x47')](_0x39ac0f[_0xe1b4('0x3f')][_0xe1b4('0x47')]));_0x50bc87[_0xe1b4('0x46')]=_0x50bc87[_0xe1b4('0x46')]['length']?_0x50bc87[_0xe1b4('0x46')]:_0x57c791['model'];if(!_0x39ac0f[_0xe1b4('0x3f')]['hasOwnProperty'](_0xe1b4('0xa1'))){_0x50bc87[_0xe1b4('0x25')]=qs['limit'](_0x39ac0f[_0xe1b4('0x3f')][_0xe1b4('0x25')]);_0x50bc87['offset']=qs[_0xe1b4('0x24')](_0x39ac0f[_0xe1b4('0x3f')][_0xe1b4('0x24')]);}_0x50bc87[_0xe1b4('0xa2')]=qs[_0xe1b4('0xa3')](_0x39ac0f[_0xe1b4('0x3f')]['sort']);_0x50bc87[_0xe1b4('0xa5')]=qs[_0xe1b4('0x44')](_[_0xe1b4('0xa4')](_0x39ac0f[_0xe1b4('0x3f')],_0x57c791[_0xe1b4('0x44')]));_0x50bc87[_0xe1b4('0xa5')][_0xe1b4('0xad')]=_0x3fad96['id'];if(_0x39ac0f[_0xe1b4('0x3f')][_0xe1b4('0xa6')]){_0x50bc87[_0xe1b4('0xa5')]=_[_0xe1b4('0x32')](_0x50bc87[_0xe1b4('0xa5')],{'$or':_['map'](_0x50bc87[_0xe1b4('0x46')],function(_0x58d00b){var _0x416ea2={};_0x416ea2[_0x58d00b]={'$like':'%'+_0x39ac0f[_0xe1b4('0x3f')][_0xe1b4('0xa6')]+'%'};return _0x416ea2;})});}_0x50bc87[_0xe1b4('0xa5')][_0xe1b4('0x92')]=![];if(_0x39ac0f[_0xe1b4('0x3f')]['id']){_0x50bc87['where']['id']={'$gt':_0x39ac0f[_0xe1b4('0x3f')]['id']};}_0x50bc87=_[_0xe1b4('0x32')]({},_0x50bc87,_0x39ac0f[_0xe1b4('0x49')]);return db[_0xe1b4('0x67')][_0xe1b4('0x27')]({'where':_0x50bc87[_0xe1b4('0xa5')]})[_0xe1b4('0x19')](function(_0x2fee16){_0x59f7a5[_0xe1b4('0x27')]=_0x2fee16;_0x50bc87[_0xe1b4('0xae')]=[];if(_0x39ac0f[_0xe1b4('0x3f')]['includeAgent']){_0x50bc87[_0xe1b4('0xae')][_0xe1b4('0xaf')]({'model':db[_0xe1b4('0x8d')],'as':'User','attributes':['id',_0xe1b4('0x59'),_0xe1b4('0xb0')]});}if(_0x39ac0f[_0xe1b4('0x3f')][_0xe1b4('0xaa')]){_0x50bc87[_0xe1b4('0xae')]=[{'all':!![]}];}return db[_0xe1b4('0x67')]['findAll'](_0x50bc87);})['then'](function(_0x1d5a03){_0x59f7a5[_0xe1b4('0xab')]=_0x1d5a03;return _0x59f7a5;});}})['then'](respondWithFilteredResult(_0x43eb88,_0x50bc87))[_0xe1b4('0x40')](handleError(_0x43eb88,null));};exports[_0xe1b4('0xb1')]=function(_0x255078,_0x278297){return db[_0xe1b4('0x38')][_0xe1b4('0x4c')]({'where':{'id':_0x255078[_0xe1b4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x278297,null))['then'](function(_0x45e832){if(_0x45e832){return _0x45e832[_0xe1b4('0xb2')](_0x255078[_0xe1b4('0x4b')][_0xe1b4('0x9d')],_[_0xe1b4('0x9e')](_0x255078[_0xe1b4('0x4b')],[_0xe1b4('0x9d'),'id'])||{})[_0xe1b4('0xb3')](function(){return db[_0xe1b4('0xb4')]['findAll']({'attributes':['id',_0xe1b4('0x2f'),_0xe1b4('0xb5')],'where':{'id':_0x255078[_0xe1b4('0x4b')][_0xe1b4('0x9d')]}});})[_0xe1b4('0x19')](function(_0x5225a9){socket[_0xe1b4('0xb6')](_0xe1b4('0xb7'),{'id':Number(_0x255078['params']['id']),'tags':_0x5225a9||[]});return{'id':Number(_0x255078[_0xe1b4('0x4d')]['id']),'tags':_0x5225a9||[]};});}})[_0xe1b4('0x19')](respondWithResult(_0x278297,null))[_0xe1b4('0x40')](handleError(_0x278297,null));};exports['removeTags']=function(_0x58dccf,_0x245a9f){return db['ChatInteraction'][_0xe1b4('0x4c')]({'where':{'id':_0x58dccf[_0xe1b4('0x4d')]['id']}})[_0xe1b4('0x19')](handleEntityNotFound(_0x245a9f,null))[_0xe1b4('0x19')](function(_0x30ab55){if(_0x30ab55){return _0x30ab55[_0xe1b4('0xb8')](_0x58dccf['query'][_0xe1b4('0x9d')]);}})[_0xe1b4('0x19')](respondWithStatusCode(_0x245a9f,null))[_0xe1b4('0x40')](handleError(_0x245a9f,null));};exports[_0xe1b4('0x7b')]=function(_0x30606c,_0x52d53e){var _0x7b6a3a=moment()[_0xe1b4('0xb9')]()['toString']();var _0xa3f2a7=path['join'](config[_0xe1b4('0x7d')],_0xe1b4('0xba'),_0xe1b4('0xbb'),'tmp');var _0xcd6951=path[_0xe1b4('0x78')](config[_0xe1b4('0x7d')],'server','files','attachments');var _0x43e574=path['join'](_0xa3f2a7,_0x7b6a3a);var _0x338697=util[_0xe1b4('0x7f')]('transcript-%d-%s.zip',_0x30606c[_0xe1b4('0x4d')]['id'],_0x7b6a3a);var _0x5568e9=path[_0xe1b4('0x78')](_0xa3f2a7,_0x338697);var _0x544c6a=[];_0x544c6a[_0xe1b4('0xaf')]({'model':db[_0xe1b4('0x8d')],'as':_0xe1b4('0x8d'),'attributes':['id','fullname'],'raw':!![]});_0x544c6a[_0xe1b4('0xaf')]({'model':db['CmContact'],'as':_0xe1b4('0x6c'),'attributes':['id',_0xe1b4('0xbc'),_0xe1b4('0xbd')],'raw':!![]});if(_0x30606c[_0xe1b4('0x3f')]['attachments']){_0x544c6a[_0xe1b4('0xaf')]({'model':db[_0xe1b4('0x77')],'as':_0xe1b4('0x77'),'raw':!![]});}var _0x1ae1ae=[{'model':db[_0xe1b4('0x67')],'as':_0xe1b4('0x84'),'attributes':['id',_0xe1b4('0x4b'),_0xe1b4('0x8f'),_0xe1b4('0x91'),_0xe1b4('0x92'),'read'],'include':_0x544c6a}];_0x1ae1ae[_0xe1b4('0xaf')]({'model':db[_0xe1b4('0x51')],'as':'Account','attributes':['id',_0xe1b4('0x2f')]});_0x1ae1ae['push']({'model':db[_0xe1b4('0x8d')],'as':_0xe1b4('0xbe'),'attributes':['id','fullname']});return db[_0xe1b4('0x38')][_0xe1b4('0x4c')]({'where':{'id':_0x30606c[_0xe1b4('0x4d')]['id']},'include':_0x1ae1ae})[_0xe1b4('0x19')](handleEntityNotFound(_0x52d53e,null))[_0xe1b4('0x19')](function(_0x5d1e8b){if(_0x5d1e8b){var _0x506167=_0x5d1e8b['get']({'plain':!![]});fs[_0xe1b4('0xbf')](_0x43e574);var _0x29b200={'channel':_0xe1b4('0xc0'),'account':_0x506167[_0xe1b4('0xc1')]['name'],'agent':_0x506167['Owner']?_0x506167[_0xe1b4('0xbe')][_0xe1b4('0x59')]:'N.A.','createdAt':moment(_0x506167[_0xe1b4('0x8f')])[_0xe1b4('0x7f')](_0xe1b4('0xa9'))[_0xe1b4('0xc2')](),'closedAt':_0x506167[_0xe1b4('0x70')]?moment(_0x506167[_0xe1b4('0xc3')])['format'](_0xe1b4('0xa9'))[_0xe1b4('0xc2')]():'','disposition':_0x506167['disposition'],'chatInfo':{'browser':_0x506167[_0xe1b4('0xc4')],'os':_0x506167[_0xe1b4('0xc5')],'referer':_0x506167['referer'],'customerIp':_0x506167[_0xe1b4('0xc6')],'customerPort':_0x506167[_0xe1b4('0xc7')]?_0x506167[_0xe1b4('0xc7')]:_0xe1b4('0xc8')},'messages':_(_0x506167[_0xe1b4('0x84')])[_0xe1b4('0xc9')]()[_0xe1b4('0xa6')]({'secret':![]})[_0xe1b4('0x37')](function(_0x4f8161){if(_0x4f8161[_0xe1b4('0x77')]){var _0x1ea161=path[_0xe1b4('0x78')](_0xcd6951,_0x4f8161[_0xe1b4('0x77')][_0xe1b4('0x75')]);if(fs['existsSync'](_0x1ea161)){fs[_0xe1b4('0xca')](_0x1ea161)[_0xe1b4('0xcb')](fs['createWriteStream'](path['join'](_0x43e574,_0x4f8161[_0xe1b4('0x77')][_0xe1b4('0x75')])));}}return{'date':moment(_0x4f8161['createdAt'])['format'](_0xe1b4('0xa9'))[_0xe1b4('0xc2')](),'sender':_0x4f8161['direction']===_0xe1b4('0x66')?_0x4f8161[_0xe1b4('0x8d')]?_0x4f8161['User'][_0xe1b4('0x59')]:_0xe1b4('0x88'):_0x4f8161[_0xe1b4('0x6c')]['firstName']+(_0x4f8161[_0xe1b4('0x6c')][_0xe1b4('0xbd')]?'\x20'+_0x4f8161[_0xe1b4('0x6c')]['lastName']:''),'body':_0x4f8161['Attachment']?_0x4f8161[_0xe1b4('0x77')]['basename']:_0x4f8161[_0xe1b4('0x4b')],'direction':_0x4f8161[_0xe1b4('0x91')]===_0xe1b4('0x66')?'A':'C','secret':_0x4f8161['secret'],'read':_0x4f8161[_0xe1b4('0xcc')],'attachment':_0x4f8161['Attachment']};})[_0xe1b4('0xcd')]()};return ejs[_0xe1b4('0xce')](path[_0xe1b4('0x78')](config[_0xe1b4('0x7d')],_0xe1b4('0xba'),_0xe1b4('0xcf'),_0xe1b4('0xd0')),{'interaction':_0x29b200})[_0xe1b4('0x19')](function(_0xd373a2){var _0x2f8fbd=path['join'](_0x43e574,_0xe1b4('0xd1')+_0x506167['id']+'-'+_0x7b6a3a+_0xe1b4('0xd2'));var _0x467c7e={'path':_0x2f8fbd,'channel':_0xe1b4('0xc0'),'interactionId':_0x506167['id']};return pdf[_0xe1b4('0xd3')](_0xd373a2,_0x467c7e);})[_0xe1b4('0x19')](function(){return new Promise(function(_0x23c517,_0x1ab3b3){zipdir(_0x43e574,{'saveTo':_0x5568e9},function(_0x16d6e1,_0x4e5077){if(_0x16d6e1)return _0x1ab3b3(_0x16d6e1);return _0x23c517(_0x4e5077);});})[_0xe1b4('0x19')](function(){return new BPromise(function(_0x37b709,_0x54626d){rimraf(_0x43e574,function(_0x4aeb7e){if(_0x4aeb7e)_0x54626d(_0x4aeb7e);return _0x37b709();});});})[_0xe1b4('0x19')](function(){return _0x52d53e[_0xe1b4('0x7b')](_0x5568e9,_0x338697,function(_0x569e7e){if(_0x569e7e){logger[_0xe1b4('0x1d')](_0xe1b4('0xd4'),_0x569e7e);}else{fs['unlinkSync'](_0x5568e9);}});});});}else{return _0x52d53e['sendStatus'](0xc8);}})[_0xe1b4('0x40')](handleError(_0x52d53e,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 83a48f7..453a0c2 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 _0x105f=['map','findAll','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x3b4eae,_0x5c57e7){var _0xe52993=function(_0x348aab){while(--_0x348aab){_0x3b4eae['push'](_0x3b4eae['shift']());}};_0xe52993(++_0x5c57e7);}(_0x105f,0xfe));var _0xf105=function(_0x274c52,_0x90ac0e){_0x274c52=_0x274c52-0x0;var _0x47c672=_0x105f[_0x274c52];return _0x47c672;};'use strict';var EventEmitter=require(_0xf105('0x0'));var ChatInteraction=require(_0xf105('0x1'))['db'][_0xf105('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xf105('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf105('0x4')](0x0);var events={'afterCreate':_0xf105('0x5'),'afterUpdate':_0xf105('0x6'),'afterDestroy':_0xf105('0x7')};function emitEvent(_0x277e9c){return function(_0x270e17,_0x3e5fc4,_0x3f308d){_0x270e17[_0xf105('0x8')]({'attributes':['id'],'raw':!![]})[_0xf105('0x9')](function(_0x368445){_0x270e17[_0xf105('0xa')](_0xf105('0xb'),_0x368445[_0xf105('0xc')](function(_0x38ff66){return{'id':_0x38ff66['id']};}));return ChatMessage[_0xf105('0xd')]({'where':{'ChatInteractionId':_0x270e17['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf105('0x9')](function(_0x19cef6){_0x270e17['setDataValue']('unreadMessages',_0x19cef6[_0xf105('0xe')]);ChatInteractionEvents['emit'](_0x277e9c+':'+_0x270e17['id'],_0x270e17);ChatInteractionEvents[_0xf105('0xf')](_0x277e9c,_0x270e17);_0x3f308d(null);})[_0xf105('0x10')](_0x3f308d(null));};}for(var e in events){if(events[_0xf105('0x11')](e)){var event=events[e];ChatInteraction[_0xf105('0x12')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x4cbb=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x2c8744,_0x3d30a2){var _0x529aab=function(_0x5402ad){while(--_0x5402ad){_0x2c8744['push'](_0x2c8744['shift']());}};_0x529aab(++_0x3d30a2);}(_0x4cbb,0x1d0));var _0xb4cb=function(_0x32ddd2,_0xe0f618){_0x32ddd2=_0x32ddd2-0x0;var _0x48de30=_0x4cbb[_0x32ddd2];return _0x48de30;};'use strict';var EventEmitter=require(_0xb4cb('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0xb4cb('0x1'))['db'][_0xb4cb('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb4cb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb4cb('0x4'),'afterDestroy':_0xb4cb('0x5')};function emitEvent(_0x38d8e4){return function(_0x167a2f,_0x1b70cf,_0x4396dc){_0x167a2f[_0xb4cb('0x6')]({'attributes':['id'],'raw':!![]})[_0xb4cb('0x7')](function(_0x47c85c){_0x167a2f[_0xb4cb('0x8')](_0xb4cb('0x9'),_0x47c85c[_0xb4cb('0xa')](function(_0xfbfaf6){return{'id':_0xfbfaf6['id']};}));return ChatMessage[_0xb4cb('0xb')]({'where':{'ChatInteractionId':_0x167a2f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb4cb('0x7')](function(_0x3cf4a7){_0x167a2f[_0xb4cb('0x8')](_0xb4cb('0xc'),_0x3cf4a7[_0xb4cb('0xd')]);ChatInteractionEvents['emit'](_0x38d8e4+':'+_0x167a2f['id'],_0x167a2f);ChatInteractionEvents[_0xb4cb('0xe')](_0x38d8e4,_0x167a2f);_0x4396dc(null);})[_0xb4cb('0xf')](_0x4396dc(null));};}for(var e in events){if(events[_0xb4cb('0x10')](e)){var event=events[e];ChatInteraction[_0xb4cb('0x11')](e,emitEvent(event));}}module[_0xb4cb('0x12')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index c965377..7e16fe9 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 _0x67ed=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closedAt','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x67ed,0x192));var _0xd67e=function(_0xdaf26a,_0x149dd0){_0xdaf26a=_0xdaf26a-0x0;var _0x9baf92=_0x67ed[_0xdaf26a];return _0x9baf92;};'use strict';var _=require(_0xd67e('0x0'));var util=require('util');var logger=require(_0xd67e('0x1'))(_0xd67e('0x2'));var moment=require(_0xd67e('0x3'));var BPromise=require(_0xd67e('0x4'));var rp=require(_0xd67e('0x5'));var fs=require('fs');var path=require(_0xd67e('0x6'));var rimraf=require(_0xd67e('0x7'));var config=require(_0xd67e('0x8'));var attributes=require(_0xd67e('0x9'));module[_0xd67e('0xa')]=function(_0x35289d,_0xd66c23){return _0x35289d[_0xd67e('0xb')](_0xd67e('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42dcbc,_0x17c2af,_0x53e964){if(_0x42dcbc[_0xd67e('0xd')]('closed')){_0x42dcbc[_0xd67e('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x53e964(null,_0x42dcbc);}},'charset':_0xd67e('0xf'),'collate':_0xd67e('0x10')});};
\ No newline at end of file
+var _0x3201=['define','chat_interactions','changed','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x590984,_0x235ed5){var _0x173db0=function(_0x26e8f5){while(--_0x26e8f5){_0x590984['push'](_0x590984['shift']());}};_0x173db0(++_0x235ed5);}(_0x3201,0xab));var _0x1320=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x3201[_0x3b3cc6];return _0x1161e4;};'use strict';var _=require(_0x1320('0x0'));var util=require(_0x1320('0x1'));var logger=require(_0x1320('0x2'))(_0x1320('0x3'));var moment=require(_0x1320('0x4'));var BPromise=require(_0x1320('0x5'));var rp=require(_0x1320('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1320('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x1320('0x8')]=function(_0x2b5489,_0x4eaa6d){return _0x2b5489[_0x1320('0x9')]('ChatInteraction',attributes,{'tableName':_0x1320('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46569e,_0x590db8,_0x50e3a8){if(_0x46569e[_0x1320('0xb')]('closed')){_0x46569e['closedAt']=moment()[_0x1320('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x50e3a8(null,_0x46569e);}},'charset':_0x1320('0xd'),'collate':_0x1320('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 70d1414..e158a19 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 _0x864a=['redis','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','catch','AddTagsToChatInteraction','find','omit','ids','spread','debug','AddTags','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x864a,0xbd));var _0xa864=function(_0x109cad,_0x45a0c2){_0x109cad=_0x109cad-0x0;var _0x452543=_0x864a[_0x109cad];return _0x452543;};'use strict';var _=require(_0xa864('0x0'));var util=require(_0xa864('0x1'));var moment=require(_0xa864('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa864('0x3'));var db=require(_0xa864('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa864('0x5'))(_0xa864('0x6'));var config=require(_0xa864('0x7'));var jayson=require(_0xa864('0x8'));var client=jayson['client'][_0xa864('0x9')]({'port':0x232a});config['redis']=_[_0xa864('0xa')](config[_0xa864('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa864('0xc'))(new Redis(config[_0xa864('0xb')]));require('./chatInteraction.socket')[_0xa864('0xd')](socket);function respondWithRpcPromise(_0x4deec9,_0x28ee21,_0x1b35c2){return new BPromise(function(_0xa668bb,_0x8d28df){return client[_0xa864('0xe')](_0x4deec9,_0x1b35c2)[_0xa864('0xf')](function(_0x57957f){logger[_0xa864('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x28ee21,'request\x20sent');logger['debug'](_0xa864('0x11'),_0x28ee21,_0xa864('0x12'),JSON['stringify'](_0x57957f));if(_0x57957f['error']){if(_0x57957f[_0xa864('0x13')][_0xa864('0x14')]===0x1f4){logger[_0xa864('0x13')](_0xa864('0x15'),_0x28ee21,_0x57957f[_0xa864('0x13')][_0xa864('0x16')]);return _0x8d28df(_0x57957f[_0xa864('0x13')]['message']);}logger['error'](_0xa864('0x15'),_0x28ee21,_0x57957f[_0xa864('0x13')][_0xa864('0x16')]);return _0xa668bb(_0x57957f[_0xa864('0x13')][_0xa864('0x16')]);}else{logger[_0xa864('0x10')](_0xa864('0x15'),_0x28ee21,_0xa864('0x12'));_0xa668bb(_0x57957f[_0xa864('0x17')][_0xa864('0x16')]);}})['catch'](function(_0x2510dc){logger[_0xa864('0x13')](_0xa864('0x15'),_0x28ee21,_0x2510dc);_0x8d28df(_0x2510dc);});});}exports[_0xa864('0x18')]=function(_0xb23557){var _0x53457a=this;return new Promise(function(_0x470afd,_0x34f5bf){return db[_0xa864('0x19')][_0xa864('0x1a')](_0xb23557[_0xa864('0x1b')],{'raw':_0xb23557['options']?_0xb23557[_0xa864('0x1c')][_0xa864('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb23557[_0xa864('0x1c')]?_0xb23557['options']['where']||null:null,'attributes':_0xb23557['options']?_0xb23557[_0xa864('0x1c')][_0xa864('0x1e')]||null:null,'limit':_0xb23557[_0xa864('0x1c')]?_0xb23557[_0xa864('0x1c')]['limit']||null:null})[_0xa864('0xf')](function(_0x3d08b3){logger[_0xa864('0x10')]('UpdateChatInteraction',_0xb23557);logger['debug'](_0xa864('0x18'),_0xb23557,JSON['stringify'](_0x3d08b3));_0x470afd(_0x3d08b3);})[_0xa864('0x1f')](function(_0x53e252){logger[_0xa864('0x13')](_0xa864('0x18'),_0x53e252['message'],_0xb23557);_0x34f5bf(_0x53457a[_0xa864('0x13')](0x1f4,_0x53e252['message']));});});};exports[_0xa864('0x20')]=function(_0x14e180){return new Promise(function(_0x371643,_0x3f5624){return db[_0xa864('0x19')][_0xa864('0x21')]({'where':_0x14e180[_0xa864('0x1c')]?_0x14e180[_0xa864('0x1c')]['where']||null:null})[_0xa864('0xf')](function(_0x9eaf6b){if(_0x9eaf6b){return _0x9eaf6b['addTags'](_0x14e180[_0xa864('0x1b')]['ids'],_[_0xa864('0x22')](_0x14e180[_0xa864('0x1b')],[_0xa864('0x23'),'id'])||{});}})[_0xa864('0x24')](function(_0x147e53){logger['info']('AddTags',_0x14e180);logger[_0xa864('0x25')](_0xa864('0x26'),_0x14e180,JSON[_0xa864('0x27')](_0x147e53));_0x371643(_0x147e53);})[_0xa864('0x1f')](function(_0x339466){logger[_0xa864('0x13')](_0xa864('0x26'),_0x339466[_0xa864('0x16')],_0x14e180);_0x3f5624(_this[_0xa864('0x13')](0x1f4,_0x339466['message']));});});};
\ No newline at end of file
+var _0xaaab=['request\x20sent','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','find','addTags','body','ids','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x29893f,_0x539454){var _0x421957=function(_0xade56b){while(--_0xade56b){_0x29893f['push'](_0x29893f['shift']());}};_0x421957(++_0x539454);}(_0xaaab,0x1f3));var _0xbaaa=function(_0x55eb0f,_0x4321fb){_0x55eb0f=_0x55eb0f-0x0;var _0x159100=_0xaaab[_0x55eb0f];return _0x159100;};'use strict';var _=require(_0xbaaa('0x0'));var util=require(_0xbaaa('0x1'));var moment=require(_0xbaaa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbaaa('0x3'));var db=require(_0xbaaa('0x4'))['db'];var utils=require(_0xbaaa('0x5'));var logger=require(_0xbaaa('0x6'))(_0xbaaa('0x7'));var config=require('../../config/environment');var jayson=require(_0xbaaa('0x8'));var client=jayson['client'][_0xbaaa('0x9')]({'port':0x232a});config[_0xbaaa('0xa')]=_['defaults'](config[_0xbaaa('0xa')],{'host':_0xbaaa('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbaaa('0xa')]));require(_0xbaaa('0xc'))[_0xbaaa('0xd')](socket);function respondWithRpcPromise(_0x1e8d0b,_0x2abc59,_0x5f1691){return new BPromise(function(_0x538708,_0x10dc13){return client['request'](_0x1e8d0b,_0x5f1691)[_0xbaaa('0xe')](function(_0x41a959){logger[_0xbaaa('0xf')](_0xbaaa('0x10'),_0x2abc59,'request\x20sent');logger[_0xbaaa('0x11')](_0xbaaa('0x12'),_0x2abc59,_0xbaaa('0x13'),JSON[_0xbaaa('0x14')](_0x41a959));if(_0x41a959[_0xbaaa('0x15')]){if(_0x41a959['error']['code']===0x1f4){logger['error'](_0xbaaa('0x10'),_0x2abc59,_0x41a959[_0xbaaa('0x15')]['message']);return _0x10dc13(_0x41a959[_0xbaaa('0x15')][_0xbaaa('0x16')]);}logger[_0xbaaa('0x15')](_0xbaaa('0x10'),_0x2abc59,_0x41a959[_0xbaaa('0x15')]['message']);return _0x538708(_0x41a959['error']['message']);}else{logger[_0xbaaa('0xf')](_0xbaaa('0x10'),_0x2abc59,_0xbaaa('0x13'));_0x538708(_0x41a959[_0xbaaa('0x17')][_0xbaaa('0x16')]);}})[_0xbaaa('0x18')](function(_0x5ba9a5){logger['error'](_0xbaaa('0x10'),_0x2abc59,_0x5ba9a5);_0x10dc13(_0x5ba9a5);});});}exports[_0xbaaa('0x19')]=function(_0xb967b2){var _0x1e3205=this;return new Promise(function(_0x1dd03c,_0x36379a){return db[_0xbaaa('0x1a')][_0xbaaa('0x1b')](_0xb967b2['body'],{'raw':_0xb967b2['options']?_0xb967b2[_0xbaaa('0x1c')][_0xbaaa('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb967b2['options']?_0xb967b2[_0xbaaa('0x1c')][_0xbaaa('0x1e')]||null:null,'attributes':_0xb967b2[_0xbaaa('0x1c')]?_0xb967b2[_0xbaaa('0x1c')]['attributes']||null:null,'limit':_0xb967b2['options']?_0xb967b2[_0xbaaa('0x1c')]['limit']||null:null})[_0xbaaa('0xe')](function(_0x540131){logger['info'](_0xbaaa('0x19'),_0xb967b2);logger['debug'](_0xbaaa('0x19'),_0xb967b2,JSON[_0xbaaa('0x14')](_0x540131));_0x1dd03c(_0x540131);})[_0xbaaa('0x18')](function(_0xb35f6c){logger[_0xbaaa('0x15')](_0xbaaa('0x19'),_0xb35f6c[_0xbaaa('0x16')],_0xb967b2);_0x36379a(_0x1e3205[_0xbaaa('0x15')](0x1f4,_0xb35f6c[_0xbaaa('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x3d5b4e){return new Promise(function(_0x2cd210,_0x448f51){return db[_0xbaaa('0x1a')][_0xbaaa('0x1f')]({'where':_0x3d5b4e[_0xbaaa('0x1c')]?_0x3d5b4e['options'][_0xbaaa('0x1e')]||null:null})[_0xbaaa('0xe')](function(_0x574743){if(_0x574743){return _0x574743[_0xbaaa('0x20')](_0x3d5b4e[_0xbaaa('0x21')]['ids'],_['omit'](_0x3d5b4e['body'],[_0xbaaa('0x22'),'id'])||{});}})[_0xbaaa('0x23')](function(_0x383487){logger[_0xbaaa('0xf')]('AddTags',_0x3d5b4e);logger[_0xbaaa('0x11')](_0xbaaa('0x24'),_0x3d5b4e,JSON['stringify'](_0x383487));_0x2cd210(_0x383487);})[_0xbaaa('0x18')](function(_0x490c1c){logger[_0xbaaa('0x15')]('AddTags',_0x490c1c[_0xbaaa('0x16')],_0x3d5b4e);_0x448f51(_this['error'](0x1f4,_0x490c1c[_0xbaaa('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index ff9016a..c3fecb0 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 _0xa41a=['emit','removeListener','./chatInteraction.events','save','update'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xa41a,0x6b));var _0xaa41=function(_0xcb0779,_0x53b03c){_0xcb0779=_0xcb0779-0x0;var _0x4155e3=_0xa41a[_0xcb0779];return _0x4155e3;};'use strict';var ChatInteractionEvents=require(_0xaa41('0x0'));var events=[_0xaa41('0x1'),'remove',_0xaa41('0x2')];function createListener(_0x2a96ba,_0x43654a){return function(_0xc5ce74){_0x43654a[_0xaa41('0x3')](_0x2a96ba,_0xc5ce74);};}function removeListener(_0x3168be,_0x42896b){return function(){ChatInteractionEvents[_0xaa41('0x4')](_0x3168be,_0x42896b);};}exports['register']=function(_0x2122a0){for(var _0x1ec9d4=0x0,_0x54bc5a=events['length'];_0x1ec9d4<_0x54bc5a;_0x1ec9d4++){var _0x179545=events[_0x1ec9d4];var _0x202cce=createListener('chatInteraction:'+_0x179545,_0x2122a0);ChatInteractionEvents['on'](_0x179545,_0x202cce);}};
\ No newline at end of file
+var _0xd4cc=['removeListener','register','chatInteraction:','./chatInteraction.events','save','remove','emit'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd4cc,0x114));var _0xcd4c=function(_0x219a37,_0x228c2a){_0x219a37=_0x219a37-0x0;var _0x1e4a9b=_0xd4cc[_0x219a37];return _0x1e4a9b;};'use strict';var ChatInteractionEvents=require(_0xcd4c('0x0'));var events=[_0xcd4c('0x1'),_0xcd4c('0x2'),'update'];function createListener(_0x9125b,_0x542769){return function(_0xcce4f5){_0x542769[_0xcd4c('0x3')](_0x9125b,_0xcce4f5);};}function removeListener(_0x115f6c,_0x2c95e5){return function(){ChatInteractionEvents[_0xcd4c('0x4')](_0x115f6c,_0x2c95e5);};}exports[_0xcd4c('0x5')]=function(_0x2d7040){for(var _0x10dd24=0x0,_0x2a39b6=events['length'];_0x10dd24<_0x2a39b6;_0x10dd24++){var _0x20d0f3=events[_0x10dd24];var _0x18948b=createListener(_0xcd4c('0x6')+_0x20d0f3,_0x2d7040);ChatInteractionEvents['on'](_0x20d0f3,_0x18948b);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 1e3c946..aee25c3 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 _0x34c1=['/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','removeTags','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update'];(function(_0x55bf40,_0x3a12f0){var _0x1b5930=function(_0x545e8e){while(--_0x545e8e){_0x55bf40['push'](_0x55bf40['shift']());}};_0x1b5930(++_0x3a12f0);}(_0x34c1,0x15a));var _0x134c=function(_0x4e8e68,_0x52a7b8){_0x4e8e68=_0x4e8e68-0x0;var _0x3c1398=_0x34c1[_0x4e8e68];return _0x3c1398;};'use strict';var multer=require(_0x134c('0x0'));var util=require(_0x134c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x134c('0x2'));var router=express[_0x134c('0x3')]();var fs_extra=require(_0x134c('0x4'));var auth=require(_0x134c('0x5'));var interaction=require(_0x134c('0x6'));var config=require(_0x134c('0x7'));var controller=require(_0x134c('0x8'));router[_0x134c('0x9')]('/',auth[_0x134c('0xa')](),controller[_0x134c('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x134c('0xc')]);router[_0x134c('0x9')](_0x134c('0xd'),auth[_0x134c('0xe')](),controller['show']);router['get'](_0x134c('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x134c('0x10')]);router[_0x134c('0x9')](_0x134c('0x11'),auth[_0x134c('0xa')](),controller[_0x134c('0x12')]);router['get'](_0x134c('0x13'),auth[_0x134c('0xe')](),controller[_0x134c('0x14')]);router[_0x134c('0x9')](_0x134c('0x15'),auth[_0x134c('0xa')](),controller[_0x134c('0x16')]);router[_0x134c('0x17')]('/',auth[_0x134c('0xa')](),controller[_0x134c('0x18')]);router['post'](_0x134c('0x19'),auth[_0x134c('0xa')](),controller[_0x134c('0x1a')]);var upload=multer({'storage':multer[_0x134c('0x1b')]({'destination':function(_0x4bd467,_0xd33fd3,_0x207f8d){_0x207f8d(null,path[_0x134c('0x1c')](config[_0x134c('0x1d')],_0x134c('0x1e')));},'filename':function(_0x26f316,_0x40e503,_0x5c3d3e){_0x5c3d3e(null,util[_0x134c('0x1f')](_0x134c('0x20'),Date[_0x134c('0x21')](),_0x40e503['originalname'][_0x134c('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x134c('0x17')](_0x134c('0x23'),upload[_0x134c('0x24')]('file'),controller[_0x134c('0x25')]);router[_0x134c('0x17')]('/:id/messages',auth[_0x134c('0xe')](),controller[_0x134c('0x26')]);router[_0x134c('0x17')](_0x134c('0x27'),auth['isAuthenticated'](),interaction[_0x134c('0x28')](_0x134c('0x29'),'chatinteraction:addtags'),controller[_0x134c('0x2a')]);router[_0x134c('0x2b')](_0x134c('0xd'),auth['isAuthenticated'](),interaction[_0x134c('0x28')]('chat',_0x134c('0x2c')),controller[_0x134c('0x2d')]);router[_0x134c('0x2b')](_0x134c('0x2e'),controller[_0x134c('0x2f')]);router[_0x134c('0x2b')](_0x134c('0x30'),auth['isChatInteractionAuthorized'](),controller[_0x134c('0x31')]);router[_0x134c('0x2b')](_0x134c('0x32'),controller[_0x134c('0x33')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x134c('0x28')](_0x134c('0x29'),_0x134c('0x34')),controller[_0x134c('0x35')]);router['delete'](_0x134c('0x27'),auth[_0x134c('0xa')](),controller[_0x134c('0x36')]);module[_0x134c('0x37')]=router;
\ No newline at end of file
+var _0x4ec9=['server/files/attachments/','%s-%s','originalname','/:id/attachment_upload','single','file','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/my_messages','/:id/download','isAuthenticated','post','create','createVidaooSession','join','root'];(function(_0x4c1979,_0x240528){var _0x522dcd=function(_0xe8291b){while(--_0xe8291b){_0x4c1979['push'](_0x4c1979['shift']());}};_0x522dcd(++_0x240528);}(_0x4ec9,0xa4));var _0x94ec=function(_0x371d15,_0xd98587){_0x371d15=_0x371d15-0x0;var _0x32afdf=_0x4ec9[_0x371d15];return _0x32afdf;};'use strict';var multer=require(_0x94ec('0x0'));var util=require(_0x94ec('0x1'));var path=require('path');var timeout=require(_0x94ec('0x2'));var express=require(_0x94ec('0x3'));var router=express[_0x94ec('0x4')]();var fs_extra=require(_0x94ec('0x5'));var auth=require(_0x94ec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x94ec('0x7'));var controller=require(_0x94ec('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x94ec('0x9')](_0x94ec('0xa'),auth['isAuthenticated'](),controller[_0x94ec('0xb')]);router[_0x94ec('0x9')](_0x94ec('0xc'),auth[_0x94ec('0xd')](),controller['show']);router[_0x94ec('0x9')](_0x94ec('0xe'),auth[_0x94ec('0xd')](),controller[_0x94ec('0xf')]);router[_0x94ec('0x9')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x94ec('0x10'),auth[_0x94ec('0xd')](),controller['getMyMessages']);router['get'](_0x94ec('0x11'),auth[_0x94ec('0x12')](),controller['download']);router[_0x94ec('0x13')]('/',auth[_0x94ec('0x12')](),controller[_0x94ec('0x14')]);router['post']('/:id/vidaoo',auth[_0x94ec('0x12')](),controller[_0x94ec('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d6156,_0x5630a0,_0x1eec71){_0x1eec71(null,path[_0x94ec('0x16')](config[_0x94ec('0x17')],_0x94ec('0x18')));},'filename':function(_0x3006e4,_0xa1256e,_0x44bbea){_0x44bbea(null,util['format'](_0x94ec('0x19'),Date['now'](),_0xa1256e[_0x94ec('0x1a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x94ec('0x1b'),upload[_0x94ec('0x1c')](_0x94ec('0x1d')),controller['attachmentUpload']);router[_0x94ec('0x13')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x94ec('0x13')](_0x94ec('0x1e'),auth['isAuthenticated'](),interaction['tracked'](_0x94ec('0x1f'),_0x94ec('0x20')),controller[_0x94ec('0x21')]);router[_0x94ec('0x22')]('/:id',auth[_0x94ec('0x12')](),interaction[_0x94ec('0x23')](_0x94ec('0x1f'),_0x94ec('0x24')),controller[_0x94ec('0x25')]);router['put'](_0x94ec('0x26'),controller[_0x94ec('0x27')]);router[_0x94ec('0x22')](_0x94ec('0x28'),auth[_0x94ec('0xd')](),controller[_0x94ec('0x29')]);router[_0x94ec('0x22')]('/:id/close',controller[_0x94ec('0x2a')]);router[_0x94ec('0x2b')](_0x94ec('0xc'),auth[_0x94ec('0x12')](),interaction[_0x94ec('0x23')](_0x94ec('0x1f'),_0x94ec('0x2c')),controller[_0x94ec('0x2d')]);router[_0x94ec('0x2b')]('/:id/tags',auth['isAuthenticated'](),controller[_0x94ec('0x2e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 86ee7e4..e0a077f 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 _0x7f53=['INTEGER','sequelize','exports','BOOLEAN'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x7f53,0x1b1));var _0x37f5=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x7f53[_0x4c7b20];return _0x4872bd;};'use strict';var Sequelize=require(_0x37f5('0x0'));module[_0x37f5('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x37f5('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x37f5('0x3')]}};
\ No newline at end of file
+var _0xbdbe=['exports','TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x4d1ab8,_0x11f0a5){var _0x38bd2a=function(_0x54e64c){while(--_0x54e64c){_0x4d1ab8['push'](_0x4d1ab8['shift']());}};_0x38bd2a(++_0x11f0a5);}(_0xbdbe,0xbf));var _0xebdb=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xbdbe[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0xebdb('0x0'));module[_0xebdb('0x1')]={'body':{'type':Sequelize[_0xebdb('0x2')](_0xebdb('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xebdb('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xebdb('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 7488e85..e2c5585 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 _0xaca4=['push','createdAt','FromId','ToId','read','-createdAt','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','map','ChatInternalMessage','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','destroy','describe','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueue','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','resourceId'];(function(_0x4dc53f,_0x2c7147){var _0x2751cf=function(_0x19a40b){while(--_0x19a40b){_0x4dc53f['push'](_0x4dc53f['shift']());}};_0x2751cf(++_0x2c7147);}(_0xaca4,0x74));var _0x4aca=function(_0x33918f,_0x50acbc){_0x33918f=_0x33918f-0x0;var _0x12ab51=_0xaca4[_0x33918f];return _0x12ab51;};'use strict';var emlformat=require(_0x4aca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4aca('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4aca('0x2'));var moment=require(_0x4aca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4aca('0x4'));var util=require(_0x4aca('0x5'));var path=require(_0x4aca('0x6'));var sox=require(_0x4aca('0x7'));var csv=require('to-csv');var ejs=require(_0x4aca('0x8'));var fs=require('fs');var fs_extra=require(_0x4aca('0x9'));var _=require(_0x4aca('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4aca('0xb'));var deskjs=require(_0x4aca('0xc'));var toCsv=require(_0x4aca('0xd'));var querystring=require(_0x4aca('0xe'));var Papa=require(_0x4aca('0xf'));var Redis=require(_0x4aca('0x10'));var authService=require(_0x4aca('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4aca('0x12'));var hardwareService=require(_0x4aca('0x13'));var logger=require(_0x4aca('0x14'))(_0x4aca('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4aca('0x16'));var db=require(_0x4aca('0x17'))['db'];config[_0x4aca('0x18')]=_[_0x4aca('0x19')](config[_0x4aca('0x18')],{'host':_0x4aca('0x1a'),'port':0x18eb});var socket=require(_0x4aca('0x1b'))(new Redis(config[_0x4aca('0x18')]));require('./chatInternalMessage.socket')[_0x4aca('0x1c')](socket);function respondWithStatusCode(_0x48054a,_0x433e9e){_0x433e9e=_0x433e9e||0xcc;return function(_0x51b189){if(_0x51b189){return _0x48054a[_0x4aca('0x1d')](_0x433e9e);}return _0x48054a[_0x4aca('0x1e')](_0x433e9e)[_0x4aca('0x1f')]();};}function respondWithResult(_0x3cfd18,_0x177fa1){_0x177fa1=_0x177fa1||0xc8;return function(_0x1f4f7f){if(_0x1f4f7f){return _0x3cfd18[_0x4aca('0x1e')](_0x177fa1)['json'](_0x1f4f7f);}};}function respondWithFilteredResult(_0x446542,_0x34a704){return function(_0x432fa7){if(_0x432fa7){var _0x29c053=typeof _0x34a704['offset']===_0x4aca('0x20')&&typeof _0x34a704[_0x4aca('0x21')]==='undefined';var _0x28e29d=_0x432fa7[_0x4aca('0x22')];var _0x29647c=_0x29c053?0x0:_0x34a704['offset'];var _0x2b214d=_0x29c053?_0x432fa7[_0x4aca('0x22')]:_0x34a704[_0x4aca('0x23')]+_0x34a704['limit'];var _0x2c7730;if(_0x2b214d>=_0x28e29d){_0x2b214d=_0x28e29d;_0x2c7730=0xc8;}else{_0x2c7730=0xce;}_0x446542[_0x4aca('0x1e')](_0x2c7730);return _0x446542[_0x4aca('0x24')](_0x4aca('0x25'),_0x29647c+'-'+_0x2b214d+'/'+_0x28e29d)[_0x4aca('0x26')](_0x432fa7);}return null;};}function patchUpdates(_0xd9a3af){return function(_0x4cd117){try{jsonpatch[_0x4aca('0x27')](_0x4cd117,_0xd9a3af,!![]);}catch(_0x92856c){return BPromise[_0x4aca('0x28')](_0x92856c);}return _0x4cd117[_0x4aca('0x29')]();};}function saveUpdates(_0x40b810,_0x1bc4e1){return function(_0x143f8e){if(_0x143f8e){return _0x143f8e[_0x4aca('0x2a')](_0x40b810)[_0x4aca('0x2b')](function(_0xdc9ff9){return _0xdc9ff9;});}return null;};}function removeEntity(_0x5589ea,_0x5c7a79){return function(_0x371e44){if(_0x371e44){return _0x371e44['destroy']()[_0x4aca('0x2b')](function(){_0x5589ea['status'](0xcc)[_0x4aca('0x1f')]();});}};}function handleEntityNotFound(_0x5eac7d,_0x46a442){return function(_0x25f81a){if(!_0x25f81a){_0x5eac7d[_0x4aca('0x1d')](0x194);}return _0x25f81a;};}function handleError(_0x16eed8,_0x276c56){_0x276c56=_0x276c56||0x1f4;return function(_0x2b56ed){logger[_0x4aca('0x2c')](_0x2b56ed[_0x4aca('0x2d')]);if(_0x2b56ed[_0x4aca('0x2e')]){delete _0x2b56ed[_0x4aca('0x2e')];}_0x16eed8[_0x4aca('0x1e')](_0x276c56)[_0x4aca('0x2f')](_0x2b56ed);};}exports['index']=function(_0x407f82,_0x56bbea){var _0x1f6146={},_0x398a53={},_0x4acef9={'count':0x0,'rows':[]};var _0x1e3718=_[_0x4aca('0x30')](db[_0x4aca('0x31')]['rawAttributes'],function(_0xa50997){return{'name':_0xa50997[_0x4aca('0x32')],'type':_0xa50997['type']['key']};});_0x398a53['model']=_[_0x4aca('0x30')](_0x1e3718,_0x4aca('0x2e'));_0x398a53[_0x4aca('0x33')]=_[_0x4aca('0x34')](_0x407f82[_0x4aca('0x33')]);_0x398a53[_0x4aca('0x35')]=_[_0x4aca('0x36')](_0x398a53[_0x4aca('0x37')],_0x398a53[_0x4aca('0x33')]);_0x1f6146[_0x4aca('0x38')]=_[_0x4aca('0x36')](_0x398a53[_0x4aca('0x37')],qs[_0x4aca('0x39')](_0x407f82['query'][_0x4aca('0x39')]));_0x1f6146[_0x4aca('0x38')]=_0x1f6146[_0x4aca('0x38')][_0x4aca('0x3a')]?_0x1f6146[_0x4aca('0x38')]:_0x398a53[_0x4aca('0x37')];if(!_0x407f82['query'][_0x4aca('0x3b')]('nolimit')){_0x1f6146[_0x4aca('0x21')]=qs['limit'](_0x407f82[_0x4aca('0x33')]['limit']);_0x1f6146[_0x4aca('0x23')]=qs[_0x4aca('0x23')](_0x407f82[_0x4aca('0x33')][_0x4aca('0x23')]);}_0x1f6146[_0x4aca('0x3c')]=qs[_0x4aca('0x3d')](_0x407f82[_0x4aca('0x33')][_0x4aca('0x3d')]);_0x1f6146[_0x4aca('0x3e')]=qs[_0x4aca('0x35')](_['pick'](_0x407f82[_0x4aca('0x33')],_0x398a53['filters']),_0x1e3718);if(_0x407f82['query'][_0x4aca('0x3f')]){_0x1f6146[_0x4aca('0x3e')]=_[_0x4aca('0x40')](_0x1f6146[_0x4aca('0x3e')],{'$or':_[_0x4aca('0x30')](_0x1e3718,function(_0x2e671c){if(_0x2e671c[_0x4aca('0x41')]!=='VIRTUAL'){var _0x770d35={};_0x770d35[_0x2e671c[_0x4aca('0x2e')]]={'$like':'%'+_0x407f82[_0x4aca('0x33')][_0x4aca('0x3f')]+'%'};return _0x770d35;}})});}_0x1f6146=_[_0x4aca('0x40')]({},_0x1f6146,_0x407f82[_0x4aca('0x42')]);var _0x1d21ff={'where':_0x1f6146[_0x4aca('0x3e')]};return db[_0x4aca('0x31')][_0x4aca('0x22')](_0x1d21ff)['then'](function(_0x527c2a){_0x4acef9[_0x4aca('0x22')]=_0x527c2a;if(_0x407f82[_0x4aca('0x33')][_0x4aca('0x43')]){_0x1f6146[_0x4aca('0x44')]=[{'all':!![]}];}return db[_0x4aca('0x31')][_0x4aca('0x45')](_0x1f6146);})[_0x4aca('0x2b')](function(_0x400f1c){_0x4acef9[_0x4aca('0x46')]=_0x400f1c;return _0x4acef9;})[_0x4aca('0x2b')](respondWithFilteredResult(_0x56bbea,_0x1f6146))[_0x4aca('0x47')](handleError(_0x56bbea,null));};exports[_0x4aca('0x48')]=function(_0x379af9,_0x3f729a){var _0x4d245b={'raw':!![],'where':{'id':_0x379af9['params']['id']}},_0x116bd3={};_0x116bd3[_0x4aca('0x37')]=_[_0x4aca('0x34')](db[_0x4aca('0x31')][_0x4aca('0x49')]);_0x116bd3['query']=_[_0x4aca('0x34')](_0x379af9[_0x4aca('0x33')]);_0x116bd3[_0x4aca('0x35')]=_[_0x4aca('0x36')](_0x116bd3[_0x4aca('0x37')],_0x116bd3[_0x4aca('0x33')]);_0x4d245b[_0x4aca('0x38')]=_[_0x4aca('0x36')](_0x116bd3[_0x4aca('0x37')],qs[_0x4aca('0x39')](_0x379af9['query'][_0x4aca('0x39')]));_0x4d245b[_0x4aca('0x38')]=_0x4d245b['attributes'][_0x4aca('0x3a')]?_0x4d245b['attributes']:_0x116bd3[_0x4aca('0x37')];if(_0x379af9[_0x4aca('0x33')]['includeAll']){_0x4d245b['include']=[{'all':!![]}];}_0x4d245b=_[_0x4aca('0x40')]({},_0x4d245b,_0x379af9[_0x4aca('0x42')]);return db['ChatInternalMessage'][_0x4aca('0x4a')](_0x4d245b)[_0x4aca('0x2b')](handleEntityNotFound(_0x3f729a,null))['then'](respondWithResult(_0x3f729a,null))[_0x4aca('0x47')](handleError(_0x3f729a,null));};exports[_0x4aca('0x4b')]=function(_0x5924e6,_0xf23ad9){return db[_0x4aca('0x31')][_0x4aca('0x4b')](_0x5924e6[_0x4aca('0x4c')],{})[_0x4aca('0x2b')](respondWithResult(_0xf23ad9,0xc9))[_0x4aca('0x47')](handleError(_0xf23ad9,null));};exports['update']=function(_0x4ea6c7,_0x5e0839){if(_0x4ea6c7[_0x4aca('0x4c')]['id']){delete _0x4ea6c7[_0x4aca('0x4c')]['id'];}return db[_0x4aca('0x31')][_0x4aca('0x4a')]({'where':{'id':_0x4ea6c7[_0x4aca('0x4d')]['id']}})[_0x4aca('0x2b')](handleEntityNotFound(_0x5e0839,null))['then'](saveUpdates(_0x4ea6c7[_0x4aca('0x4c')],null))['then'](respondWithResult(_0x5e0839,null))[_0x4aca('0x47')](handleError(_0x5e0839,null));};exports[_0x4aca('0x4e')]=function(_0x137d19,_0x477131){return db[_0x4aca('0x31')]['find']({'where':{'id':_0x137d19[_0x4aca('0x4d')]['id']}})[_0x4aca('0x2b')](handleEntityNotFound(_0x477131,null))['then'](removeEntity(_0x477131,null))[_0x4aca('0x47')](handleError(_0x477131,null));};exports[_0x4aca('0x4f')]=function(_0x3df672,_0x45659e){return db[_0x4aca('0x31')][_0x4aca('0x4f')]()['then'](respondWithResult(_0x45659e,null))[_0x4aca('0x47')](handleError(_0x45659e,null));};function wrapUser(_0x39108c){return function(_0xbdd59f){var _0x4d7b4b=_0x39108c['get']({'plain':!![]});_0x4d7b4b[_0x4aca('0x50')]=[];if(_0xbdd59f){_0x4d7b4b[_0x4aca('0x51')]=_0xbdd59f['createdAt'];_0x4d7b4b[_0x4aca('0x52')]=_0xbdd59f;}else{_0x4d7b4b[_0x4aca('0x51')]=moment(0x0)[_0x4aca('0x53')](_0x4aca('0x54'));_0x4d7b4b[_0x4aca('0x52')]={};}return _0x4d7b4b;};}exports[_0x4aca('0x55')]=function(_0x466ea2,_0x4d0258,_0x13680e){var _0x1271c7=[];return db[_0x4aca('0x56')][_0x4aca('0x45')]({'where':{'role':[_0x4aca('0x57'),_0x4aca('0x58'),_0x4aca('0x59')]},'attributes':['id',_0x4aca('0x5a'),'name',_0x4aca('0x5b'),_0x4aca('0x5c'),_0x4aca('0x5d'),_0x4aca('0x5e'),_0x4aca('0x5f'),'allowmessenger',_0x4aca('0x60')],'order':qs[_0x4aca('0x3d')]('-online'),'include':[{'model':db[_0x4aca('0x61')],'as':'VoiceQueues','attributes':['id',_0x4aca('0x2e'),_0x4aca('0x41')],'through':{'attributes':[]}}]})['then'](function(_0x542ac){if(_0x542ac){var _0x3b463a=_0x466ea2[_0x4aca('0x59')][_0x4aca('0x62')]({'plain':!![]});if(!_0x3b463a)throw new Error(_0x4aca('0x63'));if(_0x3b463a[_0x4aca('0x5b')]==='user'){return db[_0x4aca('0x64')][_0x4aca('0x4a')]({'where':{'name':_0x4aca('0x65'),'userProfileId':_0x3b463a['userProfileId']},'raw':!![]})[_0x4aca('0x2b')](function(_0x1c1675){if(_0x1c1675){if(_0x1c1675[_0x4aca('0x66')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x1c1675['id']},'raw':!![]})[_0x4aca('0x2b')](function(_0x166a59){var _0x64fc6b=[];if(_['isEmpty'](_0x166a59)){_0x64fc6b=_[_0x4aca('0x3f')](_0x542ac,function(_0x2841d9){if(_0x2841d9[_0x4aca('0x5b')]!==_0x4aca('0x57')){return _0x2841d9;}});return _0x64fc6b;}else{for(var _0x5bc9a2=0x0;_0x5bc9a2<_0x542ac['length'];_0x5bc9a2++){var _0x5cb600=_0x542ac[_0x5bc9a2];if(_0x5cb600[_0x4aca('0x5b')]===_0x4aca('0x57')){var _0x357eaa=_[_0x4aca('0x4a')](_0x166a59,function(_0x1aedb4){return _0x1aedb4[_0x4aca('0x67')]===_0x5cb600['id'];});if(_0x357eaa)_0x64fc6b[_0x4aca('0x68')](_0x5cb600);}else{_0x64fc6b[_0x4aca('0x68')](_0x5cb600);}}return _0x64fc6b;}});}else{return _0x542ac;}}else{var _0x54a0ca=_[_0x4aca('0x3f')](_0x542ac,function(_0xbe5e3c){if(_0xbe5e3c[_0x4aca('0x5b')]!=='agent'){return _0xbe5e3c;}});return _0x54a0ca;}});}else{return _0x542ac;}}})['then'](function(_0x3a9f4a){var _0x3ea84f=[];if(_0x3a9f4a){_0x1271c7=_0x3a9f4a;for(var _0x44b2ad=0x0;_0x44b2ad<_0x3a9f4a[_0x4aca('0x3a')];_0x44b2ad+=0x1){_0x1271c7[_0x44b2ad]['messages']=[];_0x3ea84f[_0x4aca('0x68')](db[_0x4aca('0x31')]['find']({'where':{'FromId':[_0x466ea2[_0x4aca('0x59')]['id'],_0x3a9f4a[_0x44b2ad]['id']],'ToId':[_0x466ea2['user']['id'],_0x3a9f4a[_0x44b2ad]['id']],'ChatGroupId':null},'attributes':['id',_0x4aca('0x69'),_0x4aca('0x6a'),_0x4aca('0x6b'),_0x4aca('0x6c'),_0x4aca('0x4c')],'order':qs[_0x4aca('0x3d')](_0x4aca('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4aca('0x2b')](wrapUser(_0x3a9f4a[_0x44b2ad])));}return BPromise['all'](_0x3ea84f);}return[];})[_0x4aca('0x2b')](function(_0x10a14b){return{'rows':_0x10a14b,'count':_0x10a14b[_0x4aca('0x3a')]};})[_0x4aca('0x2b')](respondWithResult(_0x4d0258,null))[_0x4aca('0x47')](handleError(_0x4d0258,null));};
\ No newline at end of file
+var _0x8d84=['type','model','map','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','push','FromId','ToId','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','ChatInternalMessage','rawAttributes','fieldName'];(function(_0xffcd4e,_0x2dc043){var _0x4d0f3e=function(_0xa27f){while(--_0xa27f){_0xffcd4e['push'](_0xffcd4e['shift']());}};_0x4d0f3e(++_0x2dc043);}(_0x8d84,0x18b));var _0x48d8=function(_0x2c6032,_0x16d4db){_0x2c6032=_0x2c6032-0x0;var _0x1aa461=_0x8d84[_0x2c6032];return _0x1aa461;};'use strict';var emlformat=require(_0x48d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48d8('0x1'));var jsonpatch=require(_0x48d8('0x2'));var rp=require(_0x48d8('0x3'));var moment=require(_0x48d8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x48d8('0x5'));var util=require('util');var path=require('path');var sox=require(_0x48d8('0x6'));var csv=require(_0x48d8('0x7'));var ejs=require(_0x48d8('0x8'));var fs=require('fs');var fs_extra=require(_0x48d8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x48d8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x48d8('0x7'));var querystring=require(_0x48d8('0xb'));var Papa=require(_0x48d8('0xc'));var Redis=require(_0x48d8('0xd'));var authService=require(_0x48d8('0xe'));var qs=require(_0x48d8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x48d8('0x10'));var logger=require(_0x48d8('0x11'))(_0x48d8('0x12'));var utils=require(_0x48d8('0x13'));var config=require(_0x48d8('0x14'));var licenseUtil=require(_0x48d8('0x15'));var db=require(_0x48d8('0x16'))['db'];config[_0x48d8('0x17')]=_[_0x48d8('0x18')](config[_0x48d8('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x48d8('0x19'))(new Redis(config[_0x48d8('0x17')]));require('./chatInternalMessage.socket')[_0x48d8('0x1a')](socket);function respondWithStatusCode(_0x26f5fc,_0x4201ac){_0x4201ac=_0x4201ac||0xcc;return function(_0x1b90e9){if(_0x1b90e9){return _0x26f5fc[_0x48d8('0x1b')](_0x4201ac);}return _0x26f5fc['status'](_0x4201ac)[_0x48d8('0x1c')]();};}function respondWithResult(_0x45ddf4,_0x43840a){_0x43840a=_0x43840a||0xc8;return function(_0x3fea00){if(_0x3fea00){return _0x45ddf4[_0x48d8('0x1d')](_0x43840a)[_0x48d8('0x1e')](_0x3fea00);}};}function respondWithFilteredResult(_0x55d62b,_0x503096){return function(_0x2192de){if(_0x2192de){var _0x1593df=typeof _0x503096[_0x48d8('0x1f')]===_0x48d8('0x20')&&typeof _0x503096['limit']===_0x48d8('0x20');var _0x22dbad=_0x2192de['count'];var _0x1c81ac=_0x1593df?0x0:_0x503096[_0x48d8('0x1f')];var _0x2c46eb=_0x1593df?_0x2192de[_0x48d8('0x21')]:_0x503096['offset']+_0x503096[_0x48d8('0x22')];var _0x21a258;if(_0x2c46eb>=_0x22dbad){_0x2c46eb=_0x22dbad;_0x21a258=0xc8;}else{_0x21a258=0xce;}_0x55d62b[_0x48d8('0x1d')](_0x21a258);return _0x55d62b[_0x48d8('0x23')]('Content-Range',_0x1c81ac+'-'+_0x2c46eb+'/'+_0x22dbad)[_0x48d8('0x1e')](_0x2192de);}return null;};}function patchUpdates(_0x5020b5){return function(_0x1a0c3b){try{jsonpatch[_0x48d8('0x24')](_0x1a0c3b,_0x5020b5,!![]);}catch(_0x5195c8){return BPromise[_0x48d8('0x25')](_0x5195c8);}return _0x1a0c3b[_0x48d8('0x26')]();};}function saveUpdates(_0x2abf27,_0x3d9935){return function(_0x159153){if(_0x159153){return _0x159153[_0x48d8('0x27')](_0x2abf27)[_0x48d8('0x28')](function(_0x2a4306){return _0x2a4306;});}return null;};}function removeEntity(_0x21285b,_0x36048a){return function(_0x374a86){if(_0x374a86){return _0x374a86[_0x48d8('0x29')]()['then'](function(){_0x21285b[_0x48d8('0x1d')](0xcc)[_0x48d8('0x1c')]();});}};}function handleEntityNotFound(_0x12cd4d,_0xd13967){return function(_0x4604e1){if(!_0x4604e1){_0x12cd4d[_0x48d8('0x1b')](0x194);}return _0x4604e1;};}function handleError(_0x1fe9c3,_0x57ce72){_0x57ce72=_0x57ce72||0x1f4;return function(_0x5623da){logger[_0x48d8('0x2a')](_0x5623da['stack']);if(_0x5623da[_0x48d8('0x2b')]){delete _0x5623da[_0x48d8('0x2b')];}_0x1fe9c3[_0x48d8('0x1d')](_0x57ce72)[_0x48d8('0x2c')](_0x5623da);};}exports[_0x48d8('0x2d')]=function(_0x11c4df,_0x187932){var _0x252625={},_0x1c4139={},_0x5d45be={'count':0x0,'rows':[]};var _0x59c27d=_['map'](db[_0x48d8('0x2e')][_0x48d8('0x2f')],function(_0x170e0c){return{'name':_0x170e0c[_0x48d8('0x30')],'type':_0x170e0c[_0x48d8('0x31')]['key']};});_0x1c4139[_0x48d8('0x32')]=_[_0x48d8('0x33')](_0x59c27d,_0x48d8('0x2b'));_0x1c4139['query']=_[_0x48d8('0x34')](_0x11c4df['query']);_0x1c4139[_0x48d8('0x35')]=_['intersection'](_0x1c4139[_0x48d8('0x32')],_0x1c4139[_0x48d8('0x36')]);_0x252625['attributes']=_[_0x48d8('0x37')](_0x1c4139['model'],qs['fields'](_0x11c4df[_0x48d8('0x36')][_0x48d8('0x38')]));_0x252625[_0x48d8('0x39')]=_0x252625['attributes'][_0x48d8('0x3a')]?_0x252625[_0x48d8('0x39')]:_0x1c4139[_0x48d8('0x32')];if(!_0x11c4df[_0x48d8('0x36')][_0x48d8('0x3b')](_0x48d8('0x3c'))){_0x252625[_0x48d8('0x22')]=qs[_0x48d8('0x22')](_0x11c4df[_0x48d8('0x36')]['limit']);_0x252625[_0x48d8('0x1f')]=qs[_0x48d8('0x1f')](_0x11c4df['query'][_0x48d8('0x1f')]);}_0x252625[_0x48d8('0x3d')]=qs['sort'](_0x11c4df['query'][_0x48d8('0x3e')]);_0x252625[_0x48d8('0x3f')]=qs['filters'](_[_0x48d8('0x40')](_0x11c4df[_0x48d8('0x36')],_0x1c4139['filters']),_0x59c27d);if(_0x11c4df[_0x48d8('0x36')][_0x48d8('0x41')]){_0x252625[_0x48d8('0x3f')]=_[_0x48d8('0x42')](_0x252625[_0x48d8('0x3f')],{'$or':_['map'](_0x59c27d,function(_0xde591b){if(_0xde591b[_0x48d8('0x31')]!==_0x48d8('0x43')){var _0x556ce9={};_0x556ce9[_0xde591b[_0x48d8('0x2b')]]={'$like':'%'+_0x11c4df[_0x48d8('0x36')][_0x48d8('0x41')]+'%'};return _0x556ce9;}})});}_0x252625=_[_0x48d8('0x42')]({},_0x252625,_0x11c4df[_0x48d8('0x44')]);var _0x14762e={'where':_0x252625[_0x48d8('0x3f')]};return db[_0x48d8('0x2e')][_0x48d8('0x21')](_0x14762e)[_0x48d8('0x28')](function(_0x33d5bf){_0x5d45be[_0x48d8('0x21')]=_0x33d5bf;if(_0x11c4df[_0x48d8('0x36')][_0x48d8('0x45')]){_0x252625['include']=[{'all':!![]}];}return db[_0x48d8('0x2e')][_0x48d8('0x46')](_0x252625);})[_0x48d8('0x28')](function(_0xd32ddc){_0x5d45be[_0x48d8('0x47')]=_0xd32ddc;return _0x5d45be;})[_0x48d8('0x28')](respondWithFilteredResult(_0x187932,_0x252625))['catch'](handleError(_0x187932,null));};exports[_0x48d8('0x48')]=function(_0x2fd7d8,_0x1b4e7f){var _0x298c44={'raw':!![],'where':{'id':_0x2fd7d8[_0x48d8('0x49')]['id']}},_0x58b42e={};_0x58b42e['model']=_[_0x48d8('0x34')](db[_0x48d8('0x2e')][_0x48d8('0x2f')]);_0x58b42e[_0x48d8('0x36')]=_[_0x48d8('0x34')](_0x2fd7d8['query']);_0x58b42e[_0x48d8('0x35')]=_[_0x48d8('0x37')](_0x58b42e[_0x48d8('0x32')],_0x58b42e['query']);_0x298c44[_0x48d8('0x39')]=_['intersection'](_0x58b42e[_0x48d8('0x32')],qs[_0x48d8('0x38')](_0x2fd7d8['query'][_0x48d8('0x38')]));_0x298c44['attributes']=_0x298c44['attributes'][_0x48d8('0x3a')]?_0x298c44['attributes']:_0x58b42e['model'];if(_0x2fd7d8[_0x48d8('0x36')][_0x48d8('0x45')]){_0x298c44[_0x48d8('0x4a')]=[{'all':!![]}];}_0x298c44=_[_0x48d8('0x42')]({},_0x298c44,_0x2fd7d8[_0x48d8('0x44')]);return db[_0x48d8('0x2e')][_0x48d8('0x4b')](_0x298c44)[_0x48d8('0x28')](handleEntityNotFound(_0x1b4e7f,null))['then'](respondWithResult(_0x1b4e7f,null))[_0x48d8('0x4c')](handleError(_0x1b4e7f,null));};exports[_0x48d8('0x4d')]=function(_0x3746d1,_0x590b8d){return db['ChatInternalMessage'][_0x48d8('0x4d')](_0x3746d1['body'],{})['then'](respondWithResult(_0x590b8d,0xc9))[_0x48d8('0x4c')](handleError(_0x590b8d,null));};exports[_0x48d8('0x27')]=function(_0x8d5674,_0x10c088){if(_0x8d5674[_0x48d8('0x4e')]['id']){delete _0x8d5674[_0x48d8('0x4e')]['id'];}return db[_0x48d8('0x2e')]['find']({'where':{'id':_0x8d5674[_0x48d8('0x49')]['id']}})[_0x48d8('0x28')](handleEntityNotFound(_0x10c088,null))[_0x48d8('0x28')](saveUpdates(_0x8d5674[_0x48d8('0x4e')],null))['then'](respondWithResult(_0x10c088,null))[_0x48d8('0x4c')](handleError(_0x10c088,null));};exports['destroy']=function(_0x500cd1,_0x241c95){return db[_0x48d8('0x2e')][_0x48d8('0x4b')]({'where':{'id':_0x500cd1[_0x48d8('0x49')]['id']}})['then'](handleEntityNotFound(_0x241c95,null))[_0x48d8('0x28')](removeEntity(_0x241c95,null))[_0x48d8('0x4c')](handleError(_0x241c95,null));};exports[_0x48d8('0x4f')]=function(_0x15ff8a,_0x4e1a7b){return db[_0x48d8('0x2e')]['describe']()[_0x48d8('0x28')](respondWithResult(_0x4e1a7b,null))[_0x48d8('0x4c')](handleError(_0x4e1a7b,null));};function wrapUser(_0x44cc57){return function(_0x4cc02a){var _0x5c7b23=_0x44cc57[_0x48d8('0x50')]({'plain':!![]});_0x5c7b23[_0x48d8('0x51')]=[];if(_0x4cc02a){_0x5c7b23[_0x48d8('0x52')]=_0x4cc02a[_0x48d8('0x53')];_0x5c7b23['lastMessage']=_0x4cc02a;}else{_0x5c7b23[_0x48d8('0x52')]=moment(0x0)[_0x48d8('0x54')](_0x48d8('0x55'));_0x5c7b23[_0x48d8('0x56')]={};}return _0x5c7b23;};}exports['getUsers']=function(_0x4febbb,_0x1d8c11,_0x539949){var _0x5cddd1=[];return db[_0x48d8('0x57')][_0x48d8('0x46')]({'where':{'role':[_0x48d8('0x58'),_0x48d8('0x59'),_0x48d8('0x5a')]},'attributes':['id',_0x48d8('0x5b'),'name',_0x48d8('0x5c'),_0x48d8('0x5d'),_0x48d8('0x5e'),_0x48d8('0x5f'),_0x48d8('0x60'),_0x48d8('0x61'),'showWebBar'],'order':qs['sort'](_0x48d8('0x62')),'include':[{'model':db[_0x48d8('0x63')],'as':_0x48d8('0x64'),'attributes':['id','name',_0x48d8('0x31')],'through':{'attributes':[]}}]})[_0x48d8('0x28')](function(_0x3fb397){if(_0x3fb397){var _0x5a29b9=_0x4febbb[_0x48d8('0x5a')][_0x48d8('0x50')]({'plain':!![]});if(!_0x5a29b9)throw new Error(_0x48d8('0x65'));if(_0x5a29b9[_0x48d8('0x5c')]===_0x48d8('0x5a')){return db[_0x48d8('0x66')]['find']({'where':{'name':_0x48d8('0x67'),'userProfileId':_0x5a29b9[_0x48d8('0x68')]},'raw':!![]})[_0x48d8('0x28')](function(_0x20719){if(_0x20719){if(_0x20719[_0x48d8('0x69')]===0x0){return db['UserProfileResource'][_0x48d8('0x46')]({'where':{'sectionId':_0x20719['id']},'raw':!![]})['then'](function(_0x3a5d79){var _0x32a9e4=[];if(_[_0x48d8('0x6a')](_0x3a5d79)){_0x32a9e4=_[_0x48d8('0x41')](_0x3fb397,function(_0x414102){if(_0x414102[_0x48d8('0x5c')]!==_0x48d8('0x58')){return _0x414102;}});return _0x32a9e4;}else{for(var _0x53c9a4=0x0;_0x53c9a4<_0x3fb397[_0x48d8('0x3a')];_0x53c9a4++){var _0x55f15f=_0x3fb397[_0x53c9a4];if(_0x55f15f[_0x48d8('0x5c')]===_0x48d8('0x58')){var _0x2ecfb4=_['find'](_0x3a5d79,function(_0x52bec2){return _0x52bec2['resourceId']===_0x55f15f['id'];});if(_0x2ecfb4)_0x32a9e4[_0x48d8('0x6b')](_0x55f15f);}else{_0x32a9e4[_0x48d8('0x6b')](_0x55f15f);}}return _0x32a9e4;}});}else{return _0x3fb397;}}else{var _0x374080=_[_0x48d8('0x41')](_0x3fb397,function(_0x43bcf8){if(_0x43bcf8[_0x48d8('0x5c')]!=='agent'){return _0x43bcf8;}});return _0x374080;}});}else{return _0x3fb397;}}})[_0x48d8('0x28')](function(_0x51d5ad){var _0x15495b=[];if(_0x51d5ad){_0x5cddd1=_0x51d5ad;for(var _0x132996=0x0;_0x132996<_0x51d5ad[_0x48d8('0x3a')];_0x132996+=0x1){_0x5cddd1[_0x132996][_0x48d8('0x51')]=[];_0x15495b[_0x48d8('0x6b')](db[_0x48d8('0x2e')]['find']({'where':{'FromId':[_0x4febbb[_0x48d8('0x5a')]['id'],_0x51d5ad[_0x132996]['id']],'ToId':[_0x4febbb[_0x48d8('0x5a')]['id'],_0x51d5ad[_0x132996]['id']],'ChatGroupId':null},'attributes':['id',_0x48d8('0x53'),_0x48d8('0x6c'),_0x48d8('0x6d'),'read',_0x48d8('0x4e')],'order':qs[_0x48d8('0x3e')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x48d8('0x28')](wrapUser(_0x51d5ad[_0x132996])));}return BPromise[_0x48d8('0x6e')](_0x15495b);}return[];})[_0x48d8('0x28')](function(_0x3904de){return{'rows':_0x3904de,'count':_0x3904de[_0x48d8('0x3a')]};})[_0x48d8('0x28')](respondWithResult(_0x1d8c11,null))[_0x48d8('0x4c')](handleError(_0x1d8c11,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index ab9e707..3e2b76a 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 _0x78ca=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4b9b14,_0x4e226b){var _0x26ccdc=function(_0x14f5f6){while(--_0x14f5f6){_0x4b9b14['push'](_0x4b9b14['shift']());}};_0x26ccdc(++_0x4e226b);}(_0x78ca,0xee));var _0xa78c=function(_0x492832,_0x311a6d){_0x492832=_0x492832-0x0;var _0x5c41c8=_0x78ca[_0x492832];return _0x5c41c8;};'use strict';var EventEmitter=require(_0xa78c('0x0'));var ChatInternalMessage=require(_0xa78c('0x1'))['db'][_0xa78c('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xa78c('0x3')](0x0);var events={'afterCreate':_0xa78c('0x4'),'afterUpdate':_0xa78c('0x5'),'afterDestroy':_0xa78c('0x6')};function emitEvent(_0x228a95){return function(_0x4e51b6,_0x438ade,_0x572ae7){ChatInternalMessageEvents[_0xa78c('0x7')](_0x228a95+':'+_0x4e51b6['id'],_0x4e51b6);ChatInternalMessageEvents[_0xa78c('0x7')](_0x228a95,_0x4e51b6);_0x572ae7(null);};}for(var e in events){if(events[_0xa78c('0x8')](e)){var event=events[e];ChatInternalMessage[_0xa78c('0x9')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xeb5e=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x327184,_0x1ed5b2){var _0x309f8c=function(_0x4ae254){while(--_0x4ae254){_0x327184['push'](_0x327184['shift']());}};_0x309f8c(++_0x1ed5b2);}(_0xeb5e,0x134));var _0xeeb5=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xeb5e[_0x12d033];return _0x3b4e80;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xeeb5('0x0'))['db'][_0xeeb5('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xeeb5('0x2')](0x0);var events={'afterCreate':_0xeeb5('0x3'),'afterUpdate':_0xeeb5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x35fb67){return function(_0x2ed705,_0x565a2a,_0x286f77){ChatInternalMessageEvents[_0xeeb5('0x5')](_0x35fb67+':'+_0x2ed705['id'],_0x2ed705);ChatInternalMessageEvents[_0xeeb5('0x5')](_0x35fb67,_0x2ed705);_0x286f77(null);};}for(var e in events){if(events[_0xeeb5('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index f5a91d1..13ec684 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 _0x7c58=['../../config/environment','./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4a919f,_0x553927){var _0x2cd4ab=function(_0x568811){while(--_0x568811){_0x4a919f['push'](_0x4a919f['shift']());}};_0x2cd4ab(++_0x553927);}(_0x7c58,0xea));var _0x87c5=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x7c58[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x87c5('0x0'));var util=require(_0x87c5('0x1'));var logger=require(_0x87c5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x87c5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x87c5('0x4'));var rimraf=require(_0x87c5('0x5'));var config=require(_0x87c5('0x6'));var attributes=require(_0x87c5('0x7'));module[_0x87c5('0x8')]=function(_0x35b89a,_0x2cac93){return _0x35b89a[_0x87c5('0x9')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x87c5('0xa'),'collate':_0x87c5('0xb')});};
\ No newline at end of file
+var _0xe2da=['request-promise','path','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x9c79b3,_0x5c5ac0){var _0x2b897a=function(_0x13cdc8){while(--_0x13cdc8){_0x9c79b3['push'](_0x9c79b3['shift']());}};_0x2b897a(++_0x5c5ac0);}(_0xe2da,0xf8));var _0xae2d=function(_0x414c40,_0x515d1d){_0x414c40=_0x414c40-0x0;var _0x3c0c6a=_0xe2da[_0x414c40];return _0x3c0c6a;};'use strict';var _=require(_0xae2d('0x0'));var util=require(_0xae2d('0x1'));var logger=require('../../config/logger')(_0xae2d('0x2'));var moment=require(_0xae2d('0x3'));var BPromise=require('bluebird');var rp=require(_0xae2d('0x4'));var fs=require('fs');var path=require(_0xae2d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xae2d('0x6'));module[_0xae2d('0x7')]=function(_0x395326,_0x4aeb1a){return _0x395326[_0xae2d('0x8')](_0xae2d('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xae2d('0xa'),'collate':_0xae2d('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index ba91830..ea0bc91 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 _0x59f1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x59f1,0x199));var _0x159f=function(_0x2cd48f,_0x5c8878){_0x2cd48f=_0x2cd48f-0x0;var _0x194fa6=_0x59f1[_0x2cd48f];return _0x194fa6;};'use strict';var _=require('lodash');var util=require(_0x159f('0x0'));var moment=require('moment');var BPromise=require(_0x159f('0x1'));var rs=require(_0x159f('0x2'));var fs=require('fs');var Redis=require(_0x159f('0x3'));var db=require(_0x159f('0x4'))['db'];var utils=require(_0x159f('0x5'));var logger=require(_0x159f('0x6'))(_0x159f('0x7'));var config=require(_0x159f('0x8'));var jayson=require(_0x159f('0x9'));var client=jayson[_0x159f('0xa')][_0x159f('0xb')]({'port':0x232a});config['redis']=_[_0x159f('0xc')](config[_0x159f('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x159f('0xd')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0xa44380,_0x4a48a3,_0x2d2493){return new BPromise(function(_0x5b9471,_0xb62b49){return client[_0x159f('0xe')](_0xa44380,_0x2d2493)[_0x159f('0xf')](function(_0x1b1c4b){logger[_0x159f('0x10')](_0x159f('0x11'),_0x4a48a3,_0x159f('0x12'));logger[_0x159f('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4a48a3,_0x159f('0x12'),JSON['stringify'](_0x1b1c4b));if(_0x1b1c4b[_0x159f('0x14')]){if(_0x1b1c4b[_0x159f('0x14')][_0x159f('0x15')]===0x1f4){logger[_0x159f('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x4a48a3,_0x1b1c4b['error']['message']);return _0xb62b49(_0x1b1c4b['error'][_0x159f('0x16')]);}logger[_0x159f('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x4a48a3,_0x1b1c4b[_0x159f('0x14')]['message']);return _0x5b9471(_0x1b1c4b[_0x159f('0x14')][_0x159f('0x16')]);}else{logger['info'](_0x159f('0x11'),_0x4a48a3,_0x159f('0x12'));_0x5b9471(_0x1b1c4b['result'][_0x159f('0x16')]);}})['catch'](function(_0xbd59fe){logger[_0x159f('0x14')](_0x159f('0x11'),_0x4a48a3,_0xbd59fe);_0xb62b49(_0xbd59fe);});});}
\ No newline at end of file
+var _0x37f5=['jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x37f5,0x7b));var _0x537f=function(_0x1c1a54,_0xae9d1a){_0x1c1a54=_0x1c1a54-0x0;var _0x466397=_0x37f5[_0x1c1a54];return _0x466397;};'use strict';var _=require('lodash');var util=require(_0x537f('0x0'));var moment=require('moment');var BPromise=require(_0x537f('0x1'));var rs=require(_0x537f('0x2'));var fs=require('fs');var Redis=require(_0x537f('0x3'));var db=require(_0x537f('0x4'))['db'];var utils=require(_0x537f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x537f('0x6'));var jayson=require(_0x537f('0x7'));var client=jayson[_0x537f('0x8')][_0x537f('0x9')]({'port':0x232a});config['redis']=_[_0x537f('0xa')](config[_0x537f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x537f('0xc'))(new Redis(config[_0x537f('0xb')]));require(_0x537f('0xd'))['register'](socket);function respondWithRpcPromise(_0x17ca0e,_0x58c9f0,_0x4515c6){return new BPromise(function(_0xbfcb97,_0x2e7e57){return client[_0x537f('0xe')](_0x17ca0e,_0x4515c6)[_0x537f('0xf')](function(_0x1d0bc7){logger[_0x537f('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x58c9f0,_0x537f('0x11'));logger[_0x537f('0x12')](_0x537f('0x13'),_0x58c9f0,_0x537f('0x11'),JSON[_0x537f('0x14')](_0x1d0bc7));if(_0x1d0bc7[_0x537f('0x15')]){if(_0x1d0bc7[_0x537f('0x15')]['code']===0x1f4){logger[_0x537f('0x15')](_0x537f('0x16'),_0x58c9f0,_0x1d0bc7[_0x537f('0x15')][_0x537f('0x17')]);return _0x2e7e57(_0x1d0bc7[_0x537f('0x15')][_0x537f('0x17')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x58c9f0,_0x1d0bc7['error']['message']);return _0xbfcb97(_0x1d0bc7[_0x537f('0x15')][_0x537f('0x17')]);}else{logger[_0x537f('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x58c9f0,_0x537f('0x11'));_0xbfcb97(_0x1d0bc7[_0x537f('0x18')][_0x537f('0x17')]);}})[_0x537f('0x19')](function(_0x5e8179){logger[_0x537f('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x58c9f0,_0x5e8179);_0x2e7e57(_0x5e8179);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index f848768..d67179c 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 _0x4ce4=['register','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','removeListener'];(function(_0xdab12a,_0x4012b9){var _0x4fb77d=function(_0x48ab41){while(--_0x48ab41){_0xdab12a['push'](_0xdab12a['shift']());}};_0x4fb77d(++_0x4012b9);}(_0x4ce4,0xa3));var _0x44ce=function(_0x24c14e,_0x55fc09){_0x24c14e=_0x24c14e-0x0;var _0x589035=_0x4ce4[_0x24c14e];return _0x589035;};'use strict';var ChatInternalMessageEvents=require(_0x44ce('0x0'));var events=['save',_0x44ce('0x1'),_0x44ce('0x2')];function createListener(_0x69cb87,_0x53fcb3){return function(_0x2b7008){_0x53fcb3[_0x44ce('0x3')](_0x69cb87,_0x2b7008);};}function removeListener(_0x5e6fa3,_0x1e141a){return function(){ChatInternalMessageEvents[_0x44ce('0x4')](_0x5e6fa3,_0x1e141a);};}exports[_0x44ce('0x5')]=function(_0x3cb381){for(var _0x2bebb0=0x0,_0xba961a=events['length'];_0x2bebb0<_0xba961a;_0x2bebb0++){var _0x8ea18d=events[_0x2bebb0];var _0x40da3f=createListener(_0x44ce('0x6')+_0x8ea18d,_0x3cb381);ChatInternalMessageEvents['on'](_0x8ea18d,_0x40da3f);}};
\ No newline at end of file
+var _0x2255=['save','remove','emit','chatInternalMessage:','./chatInternalMessage.events'];(function(_0xf1751e,_0x30f07c){var _0x28c90d=function(_0x2fed2b){while(--_0x2fed2b){_0xf1751e['push'](_0xf1751e['shift']());}};_0x28c90d(++_0x30f07c);}(_0x2255,0x153));var _0x5225=function(_0x4262d3,_0x2bd0ce){_0x4262d3=_0x4262d3-0x0;var _0x5042fa=_0x2255[_0x4262d3];return _0x5042fa;};'use strict';var ChatInternalMessageEvents=require(_0x5225('0x0'));var events=[_0x5225('0x1'),_0x5225('0x2'),'update'];function createListener(_0x2b7a79,_0x5da9b9){return function(_0x34ed07){_0x5da9b9[_0x5225('0x3')](_0x2b7a79,_0x34ed07);};}function removeListener(_0x365d45,_0x2159c6){return function(){ChatInternalMessageEvents['removeListener'](_0x365d45,_0x2159c6);};}exports['register']=function(_0x1811ec){for(var _0x59e6d0=0x0,_0x44d53e=events['length'];_0x59e6d0<_0x44d53e;_0x59e6d0++){var _0x594140=events[_0x59e6d0];var _0x2562a8=createListener(_0x5225('0x4')+_0x594140,_0x1811ec);ChatInternalMessageEvents['on'](_0x594140,_0x2562a8);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 529296f..c06a24f 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 _0x27f0=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id','put','update','delete','exports','multer','util'];(function(_0x3cd2ee,_0x363ab7){var _0x4a7208=function(_0x26e9b9){while(--_0x26e9b9){_0x3cd2ee['push'](_0x3cd2ee['shift']());}};_0x4a7208(++_0x363ab7);}(_0x27f0,0x8a));var _0x027f=function(_0x54df31,_0x56de20){_0x54df31=_0x54df31-0x0;var _0x3636ed=_0x27f0[_0x54df31];return _0x3636ed;};'use strict';var multer=require(_0x027f('0x0'));var util=require(_0x027f('0x1'));var path=require(_0x027f('0x2'));var timeout=require('connect-timeout');var express=require(_0x027f('0x3'));var router=express[_0x027f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x027f('0x5'));var interaction=require(_0x027f('0x6'));var config=require(_0x027f('0x7'));var controller=require(_0x027f('0x8'));router[_0x027f('0x9')]('/',auth[_0x027f('0xa')](),controller[_0x027f('0xb')]);router['get'](_0x027f('0xc'),auth['isAuthenticated'](),controller[_0x027f('0xd')]);router[_0x027f('0x9')](_0x027f('0xe'),auth[_0x027f('0xa')](),controller['getUsers']);router['get'](_0x027f('0xf'),auth[_0x027f('0xa')](),controller['show']);router['post']('/',auth[_0x027f('0xa')](),controller['create']);router[_0x027f('0x10')](_0x027f('0xf'),controller[_0x027f('0x11')]);router[_0x027f('0x12')](_0x027f('0xf'),auth[_0x027f('0xa')](),controller['destroy']);module[_0x027f('0x13')]=router;
\ No newline at end of file
+var _0x6d53=['/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers'];(function(_0x351a91,_0x2b78e3){var _0x58c94d=function(_0x49839b){while(--_0x49839b){_0x351a91['push'](_0x351a91['shift']());}};_0x58c94d(++_0x2b78e3);}(_0x6d53,0x68));var _0x36d5=function(_0x402d17,_0x3ee054){_0x402d17=_0x402d17-0x0;var _0x5b791b=_0x6d53[_0x402d17];return _0x5b791b;};'use strict';var multer=require(_0x36d5('0x0'));var util=require(_0x36d5('0x1'));var path=require('path');var timeout=require(_0x36d5('0x2'));var express=require(_0x36d5('0x3'));var router=express[_0x36d5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x36d5('0x5'));var interaction=require(_0x36d5('0x6'));var config=require(_0x36d5('0x7'));var controller=require(_0x36d5('0x8'));router[_0x36d5('0x9')]('/',auth[_0x36d5('0xa')](),controller[_0x36d5('0xb')]);router[_0x36d5('0x9')](_0x36d5('0xc'),auth[_0x36d5('0xa')](),controller[_0x36d5('0xd')]);router['get'](_0x36d5('0xe'),auth['isAuthenticated'](),controller[_0x36d5('0xf')]);router[_0x36d5('0x9')](_0x36d5('0x10'),auth['isAuthenticated'](),controller[_0x36d5('0x11')]);router[_0x36d5('0x12')]('/',auth[_0x36d5('0xa')](),controller[_0x36d5('0x13')]);router[_0x36d5('0x14')](_0x36d5('0x10'),controller['update']);router[_0x36d5('0x15')](_0x36d5('0x10'),auth['isAuthenticated'](),controller[_0x36d5('0x16')]);module[_0x36d5('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index b0ef19c..e04f41c 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 _0x578c=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x332740,_0x267c85){var _0x2681ed=function(_0x31c35c){while(--_0x31c35c){_0x332740['push'](_0x332740['shift']());}};_0x2681ed(++_0x267c85);}(_0x578c,0x158));var _0xc578=function(_0x21cf68,_0x264c24){_0x21cf68=_0x21cf68-0x0;var _0x250910=_0x578c[_0x21cf68];return _0x250910;};'use strict';var Sequelize=require(_0xc578('0x0'));module[_0xc578('0x1')]={'body':{'type':Sequelize[_0xc578('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc578('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc578('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc578('0x4')]('in','out'),'defaultValue':_0xc578('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc578('0x6')]},'providerName':{'type':Sequelize[_0xc578('0x7')]},'providerResponse':{'type':Sequelize[_0xc578('0x2')]}};
\ No newline at end of file
+var _0xf894=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf894,0xfd));var _0x4f89=function(_0x2ec238,_0x5abc41){_0x2ec238=_0x2ec238-0x0;var _0x2c0424=_0xf894[_0x2ec238];return _0x2c0424;};'use strict';var Sequelize=require(_0x4f89('0x0'));module[_0x4f89('0x1')]={'body':{'type':Sequelize[_0x4f89('0x2')](_0x4f89('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4f89('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4f89('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4f89('0x5')]('in',_0x4f89('0x6')),'defaultValue':_0x4f89('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4f89('0x7')]},'providerName':{'type':Sequelize[_0x4f89('0x8')]},'providerResponse':{'type':Sequelize[_0x4f89('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index bee64e9..46d8304 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 _0x433d=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','stack','name','index','ChatMessage','rawAttributes','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','create','body','describe','../../config/logger','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','params','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','EventManager','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','contact','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1ad0c1,_0x35a3f1){var _0x5e6656=function(_0x866c27){while(--_0x866c27){_0x1ad0c1['push'](_0x1ad0c1['shift']());}};_0x5e6656(++_0x35a3f1);}(_0x433d,0xe9));var _0xd433=function(_0x5e9d35,_0x382c91){_0x5e9d35=_0x5e9d35-0x0;var _0x3beb2e=_0x433d[_0x5e9d35];return _0x3beb2e;};'use strict';var emlformat=require(_0xd433('0x0'));var rimraf=require(_0xd433('0x1'));var zipdir=require(_0xd433('0x2'));var jsonpatch=require(_0xd433('0x3'));var rp=require('request-promise');var moment=require(_0xd433('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd433('0x5'));var util=require(_0xd433('0x6'));var path=require(_0xd433('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd433('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd433('0x9'));var squel=require(_0xd433('0xa'));var crypto=require(_0xd433('0xb'));var jsforce=require(_0xd433('0xc'));var deskjs=require(_0xd433('0xd'));var toCsv=require(_0xd433('0xe'));var querystring=require(_0xd433('0xf'));var Papa=require(_0xd433('0x10'));var Redis=require(_0xd433('0x11'));var authService=require(_0xd433('0x12'));var qs=require(_0xd433('0x13'));var as=require(_0xd433('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd433('0x15'))['db'];config[_0xd433('0x16')]=_[_0xd433('0x17')](config[_0xd433('0x16')],{'host':_0xd433('0x18'),'port':0x18eb});var socket=require(_0xd433('0x19'))(new Redis(config[_0xd433('0x16')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xd433('0x1a')][_0xd433('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xd433('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x320f5f,_0x1fa0c9,_0x133b35,_0x38931a){return new BPromise(function(_0x56eb37,_0x570ed1){var _0x41a44c=_0x38931a||client;return _0x41a44c['request'](_0x320f5f,_0x133b35)[_0xd433('0x1c')](function(_0x1cafd0){logger[_0xd433('0x1d')](_0xd433('0x1e'),_0x1fa0c9,_0xd433('0x1f'));logger['debug'](_0xd433('0x20'),_0x1fa0c9,_0xd433('0x1f'),JSON[_0xd433('0x21')](_0x1cafd0));if(_0x1cafd0[_0xd433('0x22')]){if(_0x1cafd0['error'][_0xd433('0x23')]===0x1f4){logger[_0xd433('0x22')](_0xd433('0x1e'),_0x1fa0c9,_0x1cafd0['error']['message']);return _0x570ed1(_0x1cafd0[_0xd433('0x22')][_0xd433('0x24')]);}logger['error'](_0xd433('0x1e'),_0x1fa0c9,_0x1cafd0[_0xd433('0x22')][_0xd433('0x24')]);return _0x56eb37(_0x1cafd0[_0xd433('0x22')][_0xd433('0x24')]);}else{logger[_0xd433('0x1d')](_0xd433('0x1e'),_0x1fa0c9,'request\x20sent');_0x56eb37(_0x1cafd0['result'][_0xd433('0x24')]);}})[_0xd433('0x25')](function(_0x2aaf1a){logger['error'](_0xd433('0x1e'),_0x1fa0c9,_0x2aaf1a);_0x570ed1(_0x2aaf1a);});});}function respondWithStatusCode(_0x5df057,_0x4dde8c){_0x4dde8c=_0x4dde8c||0xcc;return function(_0x43d589){if(_0x43d589){return _0x5df057['sendStatus'](_0x4dde8c);}return _0x5df057[_0xd433('0x26')](_0x4dde8c)[_0xd433('0x27')]();};}function respondWithResult(_0x32091d,_0x52d047){_0x52d047=_0x52d047||0xc8;return function(_0x24717e){if(_0x24717e){return _0x32091d[_0xd433('0x26')](_0x52d047)[_0xd433('0x28')](_0x24717e);}};}function respondWithFilteredResult(_0x22cc1c,_0x389167){return function(_0x724d36){if(_0x724d36){var _0x44d51a=typeof _0x389167[_0xd433('0x29')]===_0xd433('0x2a')&&typeof _0x389167['limit']===_0xd433('0x2a');var _0x4bebcf=_0x724d36['count'];var _0x4d42b4=_0x44d51a?0x0:_0x389167['offset'];var _0x2bca1f=_0x44d51a?_0x724d36[_0xd433('0x2b')]:_0x389167[_0xd433('0x29')]+_0x389167[_0xd433('0x2c')];var _0x5ae7c2;if(_0x2bca1f>=_0x4bebcf){_0x2bca1f=_0x4bebcf;_0x5ae7c2=0xc8;}else{_0x5ae7c2=0xce;}_0x22cc1c[_0xd433('0x26')](_0x5ae7c2);return _0x22cc1c[_0xd433('0x2d')]('Content-Range',_0x4d42b4+'-'+_0x2bca1f+'/'+_0x4bebcf)[_0xd433('0x28')](_0x724d36);}return null;};}function patchUpdates(_0x383eb1){return function(_0x300bb5){try{jsonpatch[_0xd433('0x2e')](_0x300bb5,_0x383eb1,!![]);}catch(_0xb1d4ca){return BPromise[_0xd433('0x2f')](_0xb1d4ca);}return _0x300bb5[_0xd433('0x30')]();};}function saveUpdates(_0x197b2b,_0xb3e4aa){return function(_0x2979fb){if(_0x2979fb){return _0x2979fb[_0xd433('0x31')](_0x197b2b)[_0xd433('0x1c')](function(_0x132b05){return _0x132b05;});}return null;};}function removeEntity(_0x28b5f7,_0x480a6d){return function(_0x360ae2){if(_0x360ae2){return _0x360ae2[_0xd433('0x32')]()[_0xd433('0x1c')](function(){_0x28b5f7[_0xd433('0x26')](0xcc)[_0xd433('0x27')]();});}};}function handleEntityNotFound(_0x4b9515,_0x1a8f50){return function(_0x1ef634){if(!_0x1ef634){_0x4b9515['sendStatus'](0x194);}return _0x1ef634;};}function handleError(_0x35f27c,_0x44bba1){_0x44bba1=_0x44bba1||0x1f4;return function(_0x3874a2){logger['error'](_0x3874a2[_0xd433('0x33')]);if(_0x3874a2[_0xd433('0x34')]){delete _0x3874a2[_0xd433('0x34')];}_0x35f27c['status'](_0x44bba1)['send'](_0x3874a2);};}exports[_0xd433('0x35')]=function(_0x1d5e07,_0x1ca309){var _0x5d9e0d={},_0x53cbf2={},_0x2098f9={'count':0x0,'rows':[]};var _0x45a51f=_['map'](db[_0xd433('0x36')][_0xd433('0x37')],function(_0x9cad93){return{'name':_0x9cad93['fieldName'],'type':_0x9cad93[_0xd433('0x38')]['key']};});_0x53cbf2[_0xd433('0x39')]=_[_0xd433('0x3a')](_0x45a51f,'name');_0x53cbf2[_0xd433('0x3b')]=_[_0xd433('0x3c')](_0x1d5e07['query']);_0x53cbf2[_0xd433('0x3d')]=_['intersection'](_0x53cbf2['model'],_0x53cbf2['query']);_0x5d9e0d[_0xd433('0x3e')]=_[_0xd433('0x3f')](_0x53cbf2[_0xd433('0x39')],qs[_0xd433('0x40')](_0x1d5e07[_0xd433('0x3b')][_0xd433('0x40')]));_0x5d9e0d[_0xd433('0x3e')]=_0x5d9e0d[_0xd433('0x3e')][_0xd433('0x41')]?_0x5d9e0d['attributes']:_0x53cbf2[_0xd433('0x39')];if(!_0x1d5e07['query']['hasOwnProperty'](_0xd433('0x42'))){_0x5d9e0d[_0xd433('0x2c')]=qs[_0xd433('0x2c')](_0x1d5e07['query'][_0xd433('0x2c')]);_0x5d9e0d['offset']=qs[_0xd433('0x29')](_0x1d5e07[_0xd433('0x3b')][_0xd433('0x29')]);}_0x5d9e0d[_0xd433('0x43')]=qs[_0xd433('0x44')](_0x1d5e07[_0xd433('0x3b')][_0xd433('0x44')]);_0x5d9e0d[_0xd433('0x45')]=qs[_0xd433('0x3d')](_[_0xd433('0x46')](_0x1d5e07['query'],_0x53cbf2['filters']),_0x45a51f);if(_0x1d5e07[_0xd433('0x3b')][_0xd433('0x47')]){_0x5d9e0d['where']=_[_0xd433('0x48')](_0x5d9e0d[_0xd433('0x45')],{'$or':_[_0xd433('0x3a')](_0x45a51f,function(_0x4766df){if(_0x4766df['type']!==_0xd433('0x49')){var _0x1419a3={};_0x1419a3[_0x4766df[_0xd433('0x34')]]={'$like':'%'+_0x1d5e07[_0xd433('0x3b')][_0xd433('0x47')]+'%'};return _0x1419a3;}})});}_0x5d9e0d=_[_0xd433('0x48')]({},_0x5d9e0d,_0x1d5e07[_0xd433('0x4a')]);var _0x2b9544={'where':_0x5d9e0d[_0xd433('0x45')]};return db[_0xd433('0x36')][_0xd433('0x2b')](_0x2b9544)['then'](function(_0xdd3358){_0x2098f9[_0xd433('0x2b')]=_0xdd3358;if(_0x1d5e07['query'][_0xd433('0x4b')]){_0x5d9e0d['include']=[{'all':!![]}];}return db[_0xd433('0x36')][_0xd433('0x4c')](_0x5d9e0d);})['then'](function(_0x7d28e3){_0x2098f9[_0xd433('0x4d')]=_0x7d28e3;return _0x2098f9;})[_0xd433('0x1c')](respondWithFilteredResult(_0x1ca309,_0x5d9e0d))[_0xd433('0x25')](handleError(_0x1ca309,null));};exports[_0xd433('0x4e')]=function(_0x3c27ad,_0x192d0d){var _0x10934c={'raw':!![],'where':{'id':_0x3c27ad['params']['id']}},_0x2b5d19={};_0x2b5d19[_0xd433('0x39')]=_[_0xd433('0x3c')](db[_0xd433('0x36')][_0xd433('0x37')]);_0x2b5d19['query']=_[_0xd433('0x3c')](_0x3c27ad['query']);_0x2b5d19[_0xd433('0x3d')]=_[_0xd433('0x3f')](_0x2b5d19['model'],_0x2b5d19[_0xd433('0x3b')]);_0x10934c[_0xd433('0x3e')]=_[_0xd433('0x3f')](_0x2b5d19['model'],qs[_0xd433('0x40')](_0x3c27ad[_0xd433('0x3b')][_0xd433('0x40')]));_0x10934c[_0xd433('0x3e')]=_0x10934c[_0xd433('0x3e')][_0xd433('0x41')]?_0x10934c[_0xd433('0x3e')]:_0x2b5d19[_0xd433('0x39')];if(_0x3c27ad[_0xd433('0x3b')][_0xd433('0x4b')]){_0x10934c[_0xd433('0x4f')]=[{'all':!![]}];}_0x10934c=_[_0xd433('0x48')]({},_0x10934c,_0x3c27ad[_0xd433('0x4a')]);return db[_0xd433('0x36')][_0xd433('0x50')](_0x10934c)['then'](handleEntityNotFound(_0x192d0d,null))[_0xd433('0x1c')](respondWithResult(_0x192d0d,null))['catch'](handleError(_0x192d0d,null));};exports['create']=function(_0x318d22,_0xf6a2c9){return db['ChatMessage'][_0xd433('0x51')](_0x318d22[_0xd433('0x52')],{})[_0xd433('0x1c')](respondWithResult(_0xf6a2c9,0xc9))[_0xd433('0x25')](handleError(_0xf6a2c9,null));};exports[_0xd433('0x31')]=function(_0x5d7eed,_0x2c7bce){if(_0x5d7eed[_0xd433('0x52')]['id']){delete _0x5d7eed[_0xd433('0x52')]['id'];}return db[_0xd433('0x36')][_0xd433('0x50')]({'where':{'id':_0x5d7eed['params']['id']}})[_0xd433('0x1c')](handleEntityNotFound(_0x2c7bce,null))['then'](saveUpdates(_0x5d7eed[_0xd433('0x52')],null))['then'](respondWithResult(_0x2c7bce,null))[_0xd433('0x25')](handleError(_0x2c7bce,null));};exports[_0xd433('0x32')]=function(_0x4982df,_0x351196){return db[_0xd433('0x36')]['find']({'where':{'id':_0x4982df['params']['id']}})[_0xd433('0x1c')](handleEntityNotFound(_0x351196,null))[_0xd433('0x1c')](removeEntity(_0x351196,null))[_0xd433('0x25')](handleError(_0x351196,null));};exports[_0xd433('0x53')]=function(_0x44228d,_0x38fd52){return db[_0xd433('0x36')][_0xd433('0x53')]()[_0xd433('0x1c')](respondWithResult(_0x38fd52,null))[_0xd433('0x25')](handleError(_0x38fd52,null));};var interaction_log=require(_0xd433('0x54'))(_0xd433('0x55'));exports[_0xd433('0x56')]=function(_0x3c3f02,_0x28888c,_0x575d62){var _0x20897f={'agent':{},'channel':_0xd433('0x57')};if(_0x3c3f02[_0xd433('0x52')]['id']){delete _0x3c3f02[_0xd433('0x52')]['id'];}_0x3c3f02[_0xd433('0x52')][_0xd433('0x58')]=!![];_0x3c3f02[_0xd433('0x52')]['readAt']=moment()[_0xd433('0x59')](_0xd433('0x5a'));_0x3c3f02['body'][_0xd433('0x5b')]=_0x3c3f02['body'][_0xd433('0x5b')]||_0x3c3f02[_0xd433('0x5c')]['id'];_0x20897f[_0xd433('0x5d')]['id']=_0x3c3f02['body']['UserId'];return db[_0xd433('0x36')]['find']({'where':{'id':_0x3c3f02[_0xd433('0x5e')]['id'],'UserId':null}})[_0xd433('0x1c')](handleEntityNotFound(_0x28888c,null))[_0xd433('0x1c')](saveUpdates(_0x3c3f02[_0xd433('0x52')],null))[_0xd433('0x1c')](function(_0x585db5){if(_0x585db5){_0x20897f[_0xd433('0x24')]=_0x585db5[_0xd433('0x5f')]({'plain':!![]});return db[_0xd433('0x60')][_0xd433('0x50')]({'where':{'id':_0x585db5[_0xd433('0x61')]}});}return null;})[_0xd433('0x1c')](handleEntityNotFound(_0x28888c,null))[_0xd433('0x1c')](function(_0x37f38c){if(_0x37f38c){return _0x37f38c[_0xd433('0x31')]({'UserId':_0x3c3f02[_0xd433('0x52')][_0xd433('0x5b')],'read1stAt':_[_0xd433('0x62')](_0x37f38c['read1stAt'])?moment()[_0xd433('0x59')](_0xd433('0x5a')):undefined});}return null;})['then'](function(_0x498cec){if(_0x498cec){_0x20897f[_0xd433('0x63')]=_0x498cec['get']({'plain':!![]});interaction_log[_0xd433('0x1d')](_0xd433('0x64'),_0x3c3f02['user']['id'],_0x3c3f02[_0xd433('0x5c')][_0xd433('0x34')],_0x3c3f02[_0xd433('0x5c')][_0xd433('0x65')],_0x20897f[_0xd433('0x63')]['id'],_0x3c3f02[_0xd433('0x52')]?JSON[_0xd433('0x21')](_0x3c3f02[_0xd433('0x52')]):_0xd433('0x66'));return respondWithRpcPromise(_0xd433('0x67'),_0xd433('0x68'),_0x20897f);}return null;})['then'](function(_0x2c7bcb){var _0x9fc579=_0xd433('0x69')+_0x2c7bcb[_0xd433('0x24')]['ContactId'];return db[_0xd433('0x6a')][_0xd433('0x3b')](_0x9fc579,{'type':db[_0xd433('0x6b')][_0xd433('0x6c')][_0xd433('0x6d')],'raw':!![]})['then'](function(_0x38c1fc){return _0x38c1fc;});})[_0xd433('0x1c')](function(_0x14b991){if(_0x14b991){_0x20897f['message']['contact']=_0x14b991[0x0];if(!_0x3c3f02[_0xd433('0x52')][_0xd433('0x5b')])return;return db[_0xd433('0x6e')][_0xd433('0x50')]({'where':{'id':_0x3c3f02[_0xd433('0x52')][_0xd433('0x5b')],'role':_0xd433('0x5d')},'attributes':['id',_0xd433('0x34'),'fullname',_0xd433('0x6f'),_0xd433('0x70')],'raw':!![]});}return null;})[_0xd433('0x1c')](function(_0x56fa6f){if(!_0x56fa6f)return null;_0x20897f['message']['agent']=_0x56fa6f;return _0x20897f;})[_0xd433('0x1c')](function(_0x4b09ed){if(_0x4b09ed){if(_0x3c3f02[_0xd433('0x52')][_0xd433('0x71')]){_0x20897f[_0xd433('0x24')][_0xd433('0x72')]=util[_0xd433('0x59')](_0xd433('0x73'),_0x3c3f02[_0xd433('0x5c')][_0xd433('0x34')]);_0x20897f[_0xd433('0x24')]['channel']=_0x20897f['channel'];_0x20897f['message'][_0xd433('0x74')]=_0x20897f[_0xd433('0x75')];_0x20897f['message'][_0xd433('0x76')]='accept';return respondWithRpcPromise(_0xd433('0x77'),_0xd433('0x77'),{'event':'acceptmessage','message':_[_0xd433('0x48')](_0x20897f[_0xd433('0x24')],JSON['parse'](_0x20897f[_0xd433('0x63')][_0xd433('0x78')]))},client9002)[_0xd433('0x1c')](function(){return _0x20897f;});}return _0x20897f;}return null;})[_0xd433('0x1c')](respondWithResult(_0x28888c,null))[_0xd433('0x25')](handleError(_0x28888c,null));};var interaction_log=require(_0xd433('0x54'))(_0xd433('0x55'));exports[_0xd433('0x2f')]=function(_0x3655b5,_0x29c2a1,_0x4170f7){var _0x4bac72={'agent':{},'channel':_0xd433('0x57')};if(_0x3655b5[_0xd433('0x52')]['id']){delete _0x3655b5['body']['id'];}_0x3655b5['body'][_0xd433('0x5b')]=_0x3655b5[_0xd433('0x52')]['UserId']||_0x3655b5[_0xd433('0x5c')]['id'];_0x4bac72[_0xd433('0x5d')]['id']=_0x3655b5[_0xd433('0x52')][_0xd433('0x5b')];return db['ChatMessage']['find']({'where':{'id':_0x3655b5[_0xd433('0x5e')]['id'],'UserId':null}})[_0xd433('0x1c')](handleEntityNotFound(_0x29c2a1,null))[_0xd433('0x1c')](function(_0x42d058){if(_0x42d058){_0x4bac72[_0xd433('0x24')]=_0x42d058[_0xd433('0x5f')]({'plain':!![]});return db[_0xd433('0x60')][_0xd433('0x50')]({'where':{'id':_0x42d058['ChatInteractionId']}});}return null;})[_0xd433('0x1c')](handleEntityNotFound(_0x29c2a1,null))['then'](function(_0xf7df28){if(_0xf7df28){_0x4bac72['interaction']=_0xf7df28[_0xd433('0x5f')]({'plain':!![]});interaction_log[_0xd433('0x1d')](_0xd433('0x79'),_0x3655b5[_0xd433('0x5c')]['id'],_0x3655b5[_0xd433('0x5c')][_0xd433('0x34')],_0x3655b5[_0xd433('0x5c')][_0xd433('0x65')],_0x4bac72[_0xd433('0x63')]['id'],_0x3655b5[_0xd433('0x52')]?JSON[_0xd433('0x21')](_0x3655b5[_0xd433('0x52')]):_0xd433('0x66'));return respondWithRpcPromise(_0xd433('0x7a'),_0xd433('0x7b'),_0x4bac72);}return null;})[_0xd433('0x1c')](function(_0x437c92){var _0x36dabf=_0xd433('0x69')+_0x437c92[_0xd433('0x24')][_0xd433('0x7c')];return db[_0xd433('0x6a')][_0xd433('0x3b')](_0x36dabf,{'type':db[_0xd433('0x6b')][_0xd433('0x6c')]['SELECT'],'raw':!![]})[_0xd433('0x1c')](function(_0x5a7d33){return _0x5a7d33;});})[_0xd433('0x1c')](function(_0x345ea7){if(_0x345ea7){_0x4bac72[_0xd433('0x24')][_0xd433('0x7d')]=_0x345ea7[0x0];if(!_0x3655b5[_0xd433('0x52')][_0xd433('0x5b')])return;return db['User']['find']({'where':{'id':_0x3655b5['body'][_0xd433('0x5b')],'role':_0xd433('0x5d')},'attributes':['id','name','fullname',_0xd433('0x6f'),_0xd433('0x70')],'raw':!![]});}return null;})[_0xd433('0x1c')](function(_0x5512c0){if(!_0x5512c0)return null;_0x4bac72[_0xd433('0x24')][_0xd433('0x5d')]=_0x5512c0;return _0x4bac72;})['then'](function(_0x2b5752){if(_0x2b5752){_0x2b5752[_0xd433('0x24')][_0xd433('0x72')]=util[_0xd433('0x59')](_0xd433('0x73'),_0x3655b5['user']['name']);_0x2b5752[_0xd433('0x24')][_0xd433('0x75')]=_0x4bac72[_0xd433('0x75')];_0x2b5752[_0xd433('0x24')]['motionChannel']=_0x4bac72[_0xd433('0x75')];_0x2b5752[_0xd433('0x24')][_0xd433('0x76')]='reject';respondWithRpcPromise('EventManager',_0xd433('0x77'),{'event':_0xd433('0x7e'),'message':_[_0xd433('0x48')](_0x4bac72[_0xd433('0x24')],JSON['parse'](_0x4bac72[_0xd433('0x63')][_0xd433('0x78')]))},client9002);return _0x4bac72;}return null;})[_0xd433('0x1c')](respondWithResult(_0x29c2a1,null))[_0xd433('0x25')](handleError(_0x29c2a1,null));};
\ No newline at end of file
+var _0x46db=['stack','name','send','index','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','ChatMessage','includeAll','include','findAll','rows','params','keys','create','body','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','find','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','User','fullname','email','internal','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','reject','get','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','SELECT','interface','rejectmessage','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','sendStatus'];(function(_0x56f771,_0x4a8b95){var _0x481cac=function(_0x43deeb){while(--_0x43deeb){_0x56f771['push'](_0x56f771['shift']());}};_0x481cac(++_0x4a8b95);}(_0x46db,0x1da));var _0xb46d=function(_0x5b1933,_0xef5822){_0x5b1933=_0x5b1933-0x0;var _0x48fe80=_0x46db[_0x5b1933];return _0x48fe80;};'use strict';var emlformat=require(_0xb46d('0x0'));var rimraf=require(_0xb46d('0x1'));var zipdir=require(_0xb46d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb46d('0x3'));var BPromise=require(_0xb46d('0x4'));var Mustache=require(_0xb46d('0x5'));var util=require(_0xb46d('0x6'));var path=require(_0xb46d('0x7'));var sox=require(_0xb46d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb46d('0x9'));var _=require(_0xb46d('0xa'));var squel=require(_0xb46d('0xb'));var crypto=require(_0xb46d('0xc'));var jsforce=require(_0xb46d('0xd'));var deskjs=require(_0xb46d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb46d('0xf'));var Papa=require(_0xb46d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb46d('0x11'));var as=require(_0xb46d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb46d('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb46d('0x14'));var db=require('../../mysqldb')['db'];config[_0xb46d('0x15')]=_[_0xb46d('0x16')](config[_0xb46d('0x15')],{'host':_0xb46d('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb46d('0x15')]));require(_0xb46d('0x18'))[_0xb46d('0x19')](socket);var jayson=require(_0xb46d('0x1a'));var client=jayson['client'][_0xb46d('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x479e61,_0x23a2bf,_0x5721de,_0x2847bc){return new BPromise(function(_0x2841de,_0xe5254){var _0x52e076=_0x2847bc||client;return _0x52e076[_0xb46d('0x1c')](_0x479e61,_0x5721de)[_0xb46d('0x1d')](function(_0x3fe125){logger[_0xb46d('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x23a2bf,_0xb46d('0x1f'));logger[_0xb46d('0x20')](_0xb46d('0x21'),_0x23a2bf,'request\x20sent',JSON['stringify'](_0x3fe125));if(_0x3fe125[_0xb46d('0x22')]){if(_0x3fe125[_0xb46d('0x22')][_0xb46d('0x23')]===0x1f4){logger[_0xb46d('0x22')](_0xb46d('0x24'),_0x23a2bf,_0x3fe125[_0xb46d('0x22')]['message']);return _0xe5254(_0x3fe125[_0xb46d('0x22')][_0xb46d('0x25')]);}logger[_0xb46d('0x22')](_0xb46d('0x24'),_0x23a2bf,_0x3fe125[_0xb46d('0x22')][_0xb46d('0x25')]);return _0x2841de(_0x3fe125[_0xb46d('0x22')]['message']);}else{logger[_0xb46d('0x1e')](_0xb46d('0x24'),_0x23a2bf,'request\x20sent');_0x2841de(_0x3fe125[_0xb46d('0x26')][_0xb46d('0x25')]);}})[_0xb46d('0x27')](function(_0x433184){logger[_0xb46d('0x22')](_0xb46d('0x24'),_0x23a2bf,_0x433184);_0xe5254(_0x433184);});});}function respondWithStatusCode(_0x780d07,_0x1c106e){_0x1c106e=_0x1c106e||0xcc;return function(_0x3a437e){if(_0x3a437e){return _0x780d07['sendStatus'](_0x1c106e);}return _0x780d07[_0xb46d('0x28')](_0x1c106e)[_0xb46d('0x29')]();};}function respondWithResult(_0x7000c6,_0x57c6f7){_0x57c6f7=_0x57c6f7||0xc8;return function(_0x273037){if(_0x273037){return _0x7000c6[_0xb46d('0x28')](_0x57c6f7)[_0xb46d('0x2a')](_0x273037);}};}function respondWithFilteredResult(_0x514053,_0x3c683a){return function(_0x129004){if(_0x129004){var _0x3beb6c=typeof _0x3c683a[_0xb46d('0x2b')]===_0xb46d('0x2c')&&typeof _0x3c683a[_0xb46d('0x2d')]===_0xb46d('0x2c');var _0xedd0d5=_0x129004[_0xb46d('0x2e')];var _0x4a59c5=_0x3beb6c?0x0:_0x3c683a[_0xb46d('0x2b')];var _0x51ee9e=_0x3beb6c?_0x129004[_0xb46d('0x2e')]:_0x3c683a[_0xb46d('0x2b')]+_0x3c683a['limit'];var _0x3a13ae;if(_0x51ee9e>=_0xedd0d5){_0x51ee9e=_0xedd0d5;_0x3a13ae=0xc8;}else{_0x3a13ae=0xce;}_0x514053[_0xb46d('0x28')](_0x3a13ae);return _0x514053[_0xb46d('0x2f')](_0xb46d('0x30'),_0x4a59c5+'-'+_0x51ee9e+'/'+_0xedd0d5)[_0xb46d('0x2a')](_0x129004);}return null;};}function patchUpdates(_0x55b4db){return function(_0x303941){try{jsonpatch[_0xb46d('0x31')](_0x303941,_0x55b4db,!![]);}catch(_0x44bd15){return BPromise['reject'](_0x44bd15);}return _0x303941[_0xb46d('0x32')]();};}function saveUpdates(_0x12e0da,_0x597795){return function(_0x151d5a){if(_0x151d5a){return _0x151d5a[_0xb46d('0x33')](_0x12e0da)[_0xb46d('0x1d')](function(_0x1ba1ad){return _0x1ba1ad;});}return null;};}function removeEntity(_0x163474,_0x1d534f){return function(_0x4f03a5){if(_0x4f03a5){return _0x4f03a5[_0xb46d('0x34')]()[_0xb46d('0x1d')](function(){_0x163474[_0xb46d('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x282aa7,_0xf544b7){return function(_0x5504ce){if(!_0x5504ce){_0x282aa7[_0xb46d('0x35')](0x194);}return _0x5504ce;};}function handleError(_0x24ac70,_0x10d0a5){_0x10d0a5=_0x10d0a5||0x1f4;return function(_0x58e285){logger['error'](_0x58e285[_0xb46d('0x36')]);if(_0x58e285[_0xb46d('0x37')]){delete _0x58e285['name'];}_0x24ac70['status'](_0x10d0a5)[_0xb46d('0x38')](_0x58e285);};}exports[_0xb46d('0x39')]=function(_0x34a569,_0x378485){var _0x5ef88a={},_0x276f7c={},_0x3511d2={'count':0x0,'rows':[]};var _0xce5cf1=_['map'](db['ChatMessage'][_0xb46d('0x3a')],function(_0x8b6579){return{'name':_0x8b6579['fieldName'],'type':_0x8b6579['type'][_0xb46d('0x3b')]};});_0x276f7c[_0xb46d('0x3c')]=_[_0xb46d('0x3d')](_0xce5cf1,_0xb46d('0x37'));_0x276f7c[_0xb46d('0x3e')]=_['keys'](_0x34a569['query']);_0x276f7c[_0xb46d('0x3f')]=_[_0xb46d('0x40')](_0x276f7c['model'],_0x276f7c['query']);_0x5ef88a[_0xb46d('0x41')]=_[_0xb46d('0x40')](_0x276f7c[_0xb46d('0x3c')],qs[_0xb46d('0x42')](_0x34a569[_0xb46d('0x3e')][_0xb46d('0x42')]));_0x5ef88a[_0xb46d('0x41')]=_0x5ef88a[_0xb46d('0x41')][_0xb46d('0x43')]?_0x5ef88a[_0xb46d('0x41')]:_0x276f7c[_0xb46d('0x3c')];if(!_0x34a569[_0xb46d('0x3e')][_0xb46d('0x44')](_0xb46d('0x45'))){_0x5ef88a['limit']=qs[_0xb46d('0x2d')](_0x34a569[_0xb46d('0x3e')][_0xb46d('0x2d')]);_0x5ef88a['offset']=qs['offset'](_0x34a569[_0xb46d('0x3e')]['offset']);}_0x5ef88a[_0xb46d('0x46')]=qs[_0xb46d('0x47')](_0x34a569[_0xb46d('0x3e')][_0xb46d('0x47')]);_0x5ef88a[_0xb46d('0x48')]=qs[_0xb46d('0x3f')](_['pick'](_0x34a569[_0xb46d('0x3e')],_0x276f7c['filters']),_0xce5cf1);if(_0x34a569['query'][_0xb46d('0x49')]){_0x5ef88a['where']=_['merge'](_0x5ef88a[_0xb46d('0x48')],{'$or':_[_0xb46d('0x3d')](_0xce5cf1,function(_0x432d93){if(_0x432d93[_0xb46d('0x4a')]!==_0xb46d('0x4b')){var _0xb4ea86={};_0xb4ea86[_0x432d93[_0xb46d('0x37')]]={'$like':'%'+_0x34a569[_0xb46d('0x3e')][_0xb46d('0x49')]+'%'};return _0xb4ea86;}})});}_0x5ef88a=_[_0xb46d('0x4c')]({},_0x5ef88a,_0x34a569[_0xb46d('0x4d')]);var _0x5ce653={'where':_0x5ef88a[_0xb46d('0x48')]};return db[_0xb46d('0x4e')][_0xb46d('0x2e')](_0x5ce653)['then'](function(_0x404c6d){_0x3511d2[_0xb46d('0x2e')]=_0x404c6d;if(_0x34a569[_0xb46d('0x3e')][_0xb46d('0x4f')]){_0x5ef88a[_0xb46d('0x50')]=[{'all':!![]}];}return db[_0xb46d('0x4e')][_0xb46d('0x51')](_0x5ef88a);})[_0xb46d('0x1d')](function(_0x32f920){_0x3511d2[_0xb46d('0x52')]=_0x32f920;return _0x3511d2;})['then'](respondWithFilteredResult(_0x378485,_0x5ef88a))['catch'](handleError(_0x378485,null));};exports['show']=function(_0x2c1f8d,_0x418820){var _0x3136ad={'raw':!![],'where':{'id':_0x2c1f8d[_0xb46d('0x53')]['id']}},_0x53d808={};_0x53d808[_0xb46d('0x3c')]=_[_0xb46d('0x54')](db['ChatMessage'][_0xb46d('0x3a')]);_0x53d808['query']=_[_0xb46d('0x54')](_0x2c1f8d[_0xb46d('0x3e')]);_0x53d808[_0xb46d('0x3f')]=_['intersection'](_0x53d808[_0xb46d('0x3c')],_0x53d808['query']);_0x3136ad[_0xb46d('0x41')]=_[_0xb46d('0x40')](_0x53d808['model'],qs[_0xb46d('0x42')](_0x2c1f8d['query'][_0xb46d('0x42')]));_0x3136ad[_0xb46d('0x41')]=_0x3136ad['attributes'][_0xb46d('0x43')]?_0x3136ad[_0xb46d('0x41')]:_0x53d808[_0xb46d('0x3c')];if(_0x2c1f8d[_0xb46d('0x3e')][_0xb46d('0x4f')]){_0x3136ad[_0xb46d('0x50')]=[{'all':!![]}];}_0x3136ad=_[_0xb46d('0x4c')]({},_0x3136ad,_0x2c1f8d[_0xb46d('0x4d')]);return db[_0xb46d('0x4e')]['find'](_0x3136ad)[_0xb46d('0x1d')](handleEntityNotFound(_0x418820,null))[_0xb46d('0x1d')](respondWithResult(_0x418820,null))[_0xb46d('0x27')](handleError(_0x418820,null));};exports[_0xb46d('0x55')]=function(_0x538b02,_0x339cb6){return db[_0xb46d('0x4e')]['create'](_0x538b02['body'],{})[_0xb46d('0x1d')](respondWithResult(_0x339cb6,0xc9))[_0xb46d('0x27')](handleError(_0x339cb6,null));};exports['update']=function(_0x28098b,_0x2c266a){if(_0x28098b[_0xb46d('0x56')]['id']){delete _0x28098b[_0xb46d('0x56')]['id'];}return db[_0xb46d('0x4e')]['find']({'where':{'id':_0x28098b[_0xb46d('0x53')]['id']}})[_0xb46d('0x1d')](handleEntityNotFound(_0x2c266a,null))['then'](saveUpdates(_0x28098b[_0xb46d('0x56')],null))['then'](respondWithResult(_0x2c266a,null))['catch'](handleError(_0x2c266a,null));};exports[_0xb46d('0x34')]=function(_0x4beec3,_0x2151f3){return db[_0xb46d('0x4e')]['find']({'where':{'id':_0x4beec3[_0xb46d('0x53')]['id']}})[_0xb46d('0x1d')](handleEntityNotFound(_0x2151f3,null))[_0xb46d('0x1d')](removeEntity(_0x2151f3,null))['catch'](handleError(_0x2151f3,null));};exports['describe']=function(_0x1aa59c,_0x206aa2){return db[_0xb46d('0x4e')][_0xb46d('0x57')]()['then'](respondWithResult(_0x206aa2,null))[_0xb46d('0x27')](handleError(_0x206aa2,null));};var interaction_log=require(_0xb46d('0x13'))(_0xb46d('0x58'));exports[_0xb46d('0x59')]=function(_0x3b7b62,_0x18b006,_0x106448){var _0x4b82a8={'agent':{},'channel':_0xb46d('0x5a')};if(_0x3b7b62[_0xb46d('0x56')]['id']){delete _0x3b7b62[_0xb46d('0x56')]['id'];}_0x3b7b62['body'][_0xb46d('0x5b')]=!![];_0x3b7b62[_0xb46d('0x56')][_0xb46d('0x5c')]=moment()['format'](_0xb46d('0x5d'));_0x3b7b62[_0xb46d('0x56')][_0xb46d('0x5e')]=_0x3b7b62['body'][_0xb46d('0x5e')]||_0x3b7b62['user']['id'];_0x4b82a8[_0xb46d('0x5f')]['id']=_0x3b7b62[_0xb46d('0x56')][_0xb46d('0x5e')];return db[_0xb46d('0x4e')][_0xb46d('0x60')]({'where':{'id':_0x3b7b62[_0xb46d('0x53')]['id'],'UserId':null}})[_0xb46d('0x1d')](handleEntityNotFound(_0x18b006,null))[_0xb46d('0x1d')](saveUpdates(_0x3b7b62[_0xb46d('0x56')],null))[_0xb46d('0x1d')](function(_0x38fadc){if(_0x38fadc){_0x4b82a8[_0xb46d('0x25')]=_0x38fadc['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x38fadc[_0xb46d('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x18b006,null))[_0xb46d('0x1d')](function(_0x28a5be){if(_0x28a5be){return _0x28a5be['update']({'UserId':_0x3b7b62[_0xb46d('0x56')][_0xb46d('0x5e')],'read1stAt':_[_0xb46d('0x62')](_0x28a5be['read1stAt'])?moment()['format'](_0xb46d('0x5d')):undefined});}return null;})[_0xb46d('0x1d')](function(_0x48de5a){if(_0x48de5a){_0x4b82a8[_0xb46d('0x63')]=_0x48de5a['get']({'plain':!![]});interaction_log[_0xb46d('0x1e')](_0xb46d('0x64'),_0x3b7b62[_0xb46d('0x65')]['id'],_0x3b7b62[_0xb46d('0x65')]['name'],_0x3b7b62[_0xb46d('0x65')][_0xb46d('0x66')],_0x4b82a8[_0xb46d('0x63')]['id'],_0x3b7b62[_0xb46d('0x56')]?JSON[_0xb46d('0x67')](_0x3b7b62[_0xb46d('0x56')]):_0xb46d('0x68'));return respondWithRpcPromise(_0xb46d('0x69'),_0xb46d('0x6a'),_0x4b82a8);}return null;})['then'](function(_0x2059e1){var _0x2a082a=_0xb46d('0x6b')+_0x2059e1['message']['ContactId'];return db[_0xb46d('0x6c')][_0xb46d('0x3e')](_0x2a082a,{'type':db['Sequelize'][_0xb46d('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0x406473){return _0x406473;});})[_0xb46d('0x1d')](function(_0x4bb0a2){if(_0x4bb0a2){_0x4b82a8['message'][_0xb46d('0x6e')]=_0x4bb0a2[0x0];if(!_0x3b7b62[_0xb46d('0x56')][_0xb46d('0x5e')])return;return db[_0xb46d('0x6f')][_0xb46d('0x60')]({'where':{'id':_0x3b7b62[_0xb46d('0x56')][_0xb46d('0x5e')],'role':_0xb46d('0x5f')},'attributes':['id',_0xb46d('0x37'),_0xb46d('0x70'),_0xb46d('0x71'),_0xb46d('0x72')],'raw':!![]});}return null;})[_0xb46d('0x1d')](function(_0x988692){if(!_0x988692)return null;_0x4b82a8[_0xb46d('0x25')][_0xb46d('0x5f')]=_0x988692;return _0x4b82a8;})[_0xb46d('0x1d')](function(_0x529bae){if(_0x529bae){if(_0x3b7b62[_0xb46d('0x56')]['manual']){_0x4b82a8[_0xb46d('0x25')]['interface']=util['format'](_0xb46d('0x73'),_0x3b7b62[_0xb46d('0x65')][_0xb46d('0x37')]);_0x4b82a8[_0xb46d('0x25')][_0xb46d('0x74')]=_0x4b82a8[_0xb46d('0x74')];_0x4b82a8[_0xb46d('0x25')]['motionChannel']=_0x4b82a8[_0xb46d('0x74')];_0x4b82a8[_0xb46d('0x25')][_0xb46d('0x75')]=_0xb46d('0x59');return respondWithRpcPromise(_0xb46d('0x76'),_0xb46d('0x76'),{'event':_0xb46d('0x77'),'message':_['merge'](_0x4b82a8[_0xb46d('0x25')],JSON[_0xb46d('0x78')](_0x4b82a8[_0xb46d('0x63')][_0xb46d('0x79')]))},client9002)[_0xb46d('0x1d')](function(){return _0x4b82a8;});}return _0x4b82a8;}return null;})[_0xb46d('0x1d')](respondWithResult(_0x18b006,null))[_0xb46d('0x27')](handleError(_0x18b006,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xb46d('0x7a')]=function(_0x7d5a69,_0x592022,_0x8aa678){var _0x4d28d8={'agent':{},'channel':'chat'};if(_0x7d5a69[_0xb46d('0x56')]['id']){delete _0x7d5a69[_0xb46d('0x56')]['id'];}_0x7d5a69['body'][_0xb46d('0x5e')]=_0x7d5a69[_0xb46d('0x56')][_0xb46d('0x5e')]||_0x7d5a69[_0xb46d('0x65')]['id'];_0x4d28d8[_0xb46d('0x5f')]['id']=_0x7d5a69[_0xb46d('0x56')][_0xb46d('0x5e')];return db[_0xb46d('0x4e')][_0xb46d('0x60')]({'where':{'id':_0x7d5a69[_0xb46d('0x53')]['id'],'UserId':null}})[_0xb46d('0x1d')](handleEntityNotFound(_0x592022,null))[_0xb46d('0x1d')](function(_0x4a11de){if(_0x4a11de){_0x4d28d8[_0xb46d('0x25')]=_0x4a11de[_0xb46d('0x7b')]({'plain':!![]});return db[_0xb46d('0x7c')][_0xb46d('0x60')]({'where':{'id':_0x4a11de['ChatInteractionId']}});}return null;})[_0xb46d('0x1d')](handleEntityNotFound(_0x592022,null))[_0xb46d('0x1d')](function(_0x15f793){if(_0x15f793){_0x4d28d8['interaction']=_0x15f793['get']({'plain':!![]});interaction_log[_0xb46d('0x1e')](_0xb46d('0x7d'),_0x7d5a69[_0xb46d('0x65')]['id'],_0x7d5a69[_0xb46d('0x65')][_0xb46d('0x37')],_0x7d5a69[_0xb46d('0x65')][_0xb46d('0x66')],_0x4d28d8[_0xb46d('0x63')]['id'],_0x7d5a69['body']?JSON[_0xb46d('0x67')](_0x7d5a69['body']):_0xb46d('0x68'));return respondWithRpcPromise(_0xb46d('0x7e'),_0xb46d('0x7f'),_0x4d28d8);}return null;})[_0xb46d('0x1d')](function(_0x5b3898){var _0x41e077=_0xb46d('0x6b')+_0x5b3898[_0xb46d('0x25')][_0xb46d('0x80')];return db[_0xb46d('0x6c')][_0xb46d('0x3e')](_0x41e077,{'type':db['Sequelize'][_0xb46d('0x6d')][_0xb46d('0x81')],'raw':!![]})[_0xb46d('0x1d')](function(_0x839264){return _0x839264;});})[_0xb46d('0x1d')](function(_0x3038c7){if(_0x3038c7){_0x4d28d8[_0xb46d('0x25')][_0xb46d('0x6e')]=_0x3038c7[0x0];if(!_0x7d5a69[_0xb46d('0x56')][_0xb46d('0x5e')])return;return db[_0xb46d('0x6f')][_0xb46d('0x60')]({'where':{'id':_0x7d5a69[_0xb46d('0x56')][_0xb46d('0x5e')],'role':_0xb46d('0x5f')},'attributes':['id',_0xb46d('0x37'),_0xb46d('0x70'),_0xb46d('0x71'),_0xb46d('0x72')],'raw':!![]});}return null;})[_0xb46d('0x1d')](function(_0x534dd5){if(!_0x534dd5)return null;_0x4d28d8['message']['agent']=_0x534dd5;return _0x4d28d8;})[_0xb46d('0x1d')](function(_0x1be751){if(_0x1be751){_0x1be751['message'][_0xb46d('0x82')]=util['format'](_0xb46d('0x73'),_0x7d5a69[_0xb46d('0x65')]['name']);_0x1be751['message'][_0xb46d('0x74')]=_0x4d28d8[_0xb46d('0x74')];_0x1be751[_0xb46d('0x25')]['motionChannel']=_0x4d28d8[_0xb46d('0x74')];_0x1be751[_0xb46d('0x25')][_0xb46d('0x75')]=_0xb46d('0x7a');respondWithRpcPromise(_0xb46d('0x76'),'EventManager',{'event':_0xb46d('0x83'),'message':_[_0xb46d('0x4c')](_0x4d28d8[_0xb46d('0x25')],JSON['parse'](_0x4d28d8[_0xb46d('0x63')]['formData']))},client9002);return _0x4d28d8;}return null;})[_0xb46d('0x1d')](respondWithResult(_0x592022,null))[_0xb46d('0x27')](handleError(_0x592022,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 323dc34..068a1a3 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 _0x7c8a=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x3a9ee1,_0x1c9619){var _0x3d9dcc=function(_0x47fa08){while(--_0x47fa08){_0x3a9ee1['push'](_0x3a9ee1['shift']());}};_0x3d9dcc(++_0x1c9619);}(_0x7c8a,0x8e));var _0xa7c8=function(_0x32989d,_0x2d8a0c){_0x32989d=_0x32989d-0x0;var _0x1c18a5=_0x7c8a[_0x32989d];return _0x1c18a5;};'use strict';var EventEmitter=require(_0xa7c8('0x0'));var ChatMessage=require(_0xa7c8('0x1'))['db'][_0xa7c8('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa7c8('0x3')](0x0);var events={'afterCreate':_0xa7c8('0x4'),'afterUpdate':_0xa7c8('0x5'),'afterDestroy':_0xa7c8('0x6')};function emitEvent(_0x4e0ede){return function(_0x3317b1,_0x12c28e,_0x266eb1){ChatMessageEvents['emit'](_0x4e0ede+':'+_0x3317b1['id'],_0x3317b1);ChatMessageEvents[_0xa7c8('0x7')](_0x4e0ede,_0x3317b1);_0x266eb1(null);};}for(var e in events){if(events[_0xa7c8('0x8')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x4c9e=['emit','hook','exports','events','ChatMessage','save','remove'];(function(_0x1f8daa,_0x2e7165){var _0x11132f=function(_0x1d043d){while(--_0x1d043d){_0x1f8daa['push'](_0x1f8daa['shift']());}};_0x11132f(++_0x2e7165);}(_0x4c9e,0x17d));var _0xe4c9=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x4c9e[_0x42245d];return _0x4b211a;};'use strict';var EventEmitter=require(_0xe4c9('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xe4c9('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe4c9('0x2'),'afterUpdate':'update','afterDestroy':_0xe4c9('0x3')};function emitEvent(_0x16980b){return function(_0x3986e0,_0x4b9c13,_0x39ff6f){ChatMessageEvents[_0xe4c9('0x4')](_0x16980b+':'+_0x3986e0['id'],_0x3986e0);ChatMessageEvents['emit'](_0x16980b,_0x3986e0);_0x39ff6f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xe4c9('0x5')](e,emitEvent(event));}}module[_0xe4c9('0x6')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index eee9e35..c6c1175 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 _0xceae=['fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','bluebird','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages'];(function(_0x149300,_0x11fa0d){var _0x1e27ac=function(_0x388e6a){while(--_0x388e6a){_0x149300['push'](_0x149300['shift']());}};_0x1e27ac(++_0x11fa0d);}(_0xceae,0x122));var _0xecea=function(_0x5eb4bb,_0xbd4598){_0x5eb4bb=_0x5eb4bb-0x0;var _0x12d25b=_0xceae[_0x5eb4bb];return _0x12d25b;};'use strict';var _=require(_0xecea('0x0'));var util=require(_0xecea('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xecea('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xecea('0x3'));var config=require(_0xecea('0x4'));var attributes=require(_0xecea('0x5'));module[_0xecea('0x6')]=function(_0x1588bf,_0x1b1b68){return _0x1588bf[_0xecea('0x7')](_0xecea('0x8'),attributes,{'tableName':_0xecea('0x9'),'paranoid':![],'indexes':[{'name':_0xecea('0xa'),'fields':['body'],'type':_0xecea('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ecb8e,_0x379b2c,_0x2142af){var _0x38d7af=_0x1588bf[_0xecea('0xc')];var _0xd2fce0=_0x4ecb8e[_0xecea('0xd')]({'plain':!![]});if(_0xd2fce0[_0xecea('0xe')][_0xecea('0xf')]()==='in'||_0xd2fce0[_0xecea('0xe')][_0xecea('0xf')]()===_0xecea('0x10')&&!_0xd2fce0['secret']&&!_['isNil'](_0xd2fce0['UserId'])){_0x38d7af[_0xecea('0x11')]['findOne']({'where':{'id':_0xd2fce0[_0xecea('0x12')]}})[_0xecea('0x13')](function(_0x23d248){if(_0x23d248){_0x23d248[_0xecea('0x14')]({'lastMsgAt':_0xd2fce0[_0xecea('0x15')],'lastMsgDirection':_0xd2fce0[_0xecea('0xe')]['toLowerCase']()});}})[_0xecea('0x16')](function(_0x3245c2){console[_0xecea('0x17')](_0x3245c2);});}_0x2142af();}},'charset':'utf8mb4','collate':_0xecea('0x18')});};
\ No newline at end of file
+var _0xc955=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','util'];(function(_0x325d76,_0x478f38){var _0xfe2e13=function(_0x4706eb){while(--_0x4706eb){_0x325d76['push'](_0x325d76['shift']());}};_0xfe2e13(++_0x478f38);}(_0xc955,0x80));var _0x5c95=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xc955[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x5c95('0x0'));var util=require(_0x5c95('0x1'));var logger=require(_0x5c95('0x2'))('api');var moment=require(_0x5c95('0x3'));var BPromise=require(_0x5c95('0x4'));var rp=require(_0x5c95('0x5'));var fs=require('fs');var path=require(_0x5c95('0x6'));var rimraf=require(_0x5c95('0x7'));var config=require(_0x5c95('0x8'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x143c44,_0x5ed00f){return _0x143c44['define']('ChatMessage',attributes,{'tableName':_0x5c95('0x9'),'paranoid':![],'indexes':[{'name':_0x5c95('0xa'),'fields':[_0x5c95('0xb')],'type':_0x5c95('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x26ea2e,_0x17afe5,_0x3f71d9){var _0x5e2320=_0x143c44[_0x5c95('0xd')];var _0x54c377=_0x26ea2e[_0x5c95('0xe')]({'plain':!![]});if(_0x54c377[_0x5c95('0xf')][_0x5c95('0x10')]()==='in'||_0x54c377[_0x5c95('0xf')][_0x5c95('0x10')]()===_0x5c95('0x11')&&!_0x54c377['secret']&&!_['isNil'](_0x54c377[_0x5c95('0x12')])){_0x5e2320[_0x5c95('0x13')]['findOne']({'where':{'id':_0x54c377[_0x5c95('0x14')]}})[_0x5c95('0x15')](function(_0x114282){if(_0x114282){_0x114282[_0x5c95('0x16')]({'lastMsgAt':_0x54c377[_0x5c95('0x17')],'lastMsgDirection':_0x54c377[_0x5c95('0xf')][_0x5c95('0x10')]()});}})[_0x5c95('0x18')](function(_0x1b20e9){console['error'](_0x1b20e9);});}_0x3f71d9();}},'charset':'utf8mb4','collate':_0x5c95('0x19')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 1f3682a..37ebadc 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 _0xe1cc=['request\x20sent','stringify','error','code','message','result','CreateChatMessage','ChatMessage','options','raw','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x28c402,_0x4515bb){var _0x5e5a79=function(_0x4f15b3){while(--_0x4f15b3){_0x28c402['push'](_0x28c402['shift']());}};_0x5e5a79(++_0x4515bb);}(_0xe1cc,0xf2));var _0xce1c=function(_0x23524a,_0x118ff4){_0x23524a=_0x23524a-0x0;var _0x2a7744=_0xe1cc[_0x23524a];return _0x2a7744;};'use strict';var _=require(_0xce1c('0x0'));var util=require('util');var moment=require(_0xce1c('0x1'));var BPromise=require('bluebird');var rs=require(_0xce1c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce1c('0x3'))['db'];var utils=require(_0xce1c('0x4'));var logger=require(_0xce1c('0x5'))(_0xce1c('0x6'));var config=require(_0xce1c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xce1c('0x8')]['http']({'port':0x232a});config[_0xce1c('0x9')]=_[_0xce1c('0xa')](config['redis'],{'host':_0xce1c('0xb'),'port':0x18eb});var socket=require(_0xce1c('0xc'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1cbe6a,_0x144ed2,_0x39d045){return new BPromise(function(_0x3b1b28,_0x4beb9d){return client[_0xce1c('0xd')](_0x1cbe6a,_0x39d045)[_0xce1c('0xe')](function(_0x222ef7){logger[_0xce1c('0xf')](_0xce1c('0x10'),_0x144ed2,'request\x20sent');logger[_0xce1c('0x11')](_0xce1c('0x12'),_0x144ed2,_0xce1c('0x13'),JSON[_0xce1c('0x14')](_0x222ef7));if(_0x222ef7[_0xce1c('0x15')]){if(_0x222ef7[_0xce1c('0x15')][_0xce1c('0x16')]===0x1f4){logger[_0xce1c('0x15')](_0xce1c('0x10'),_0x144ed2,_0x222ef7[_0xce1c('0x15')]['message']);return _0x4beb9d(_0x222ef7['error'][_0xce1c('0x17')]);}logger[_0xce1c('0x15')]('ChatMessage,\x20%s,\x20%s',_0x144ed2,_0x222ef7[_0xce1c('0x15')]['message']);return _0x3b1b28(_0x222ef7[_0xce1c('0x15')][_0xce1c('0x17')]);}else{logger['info'](_0xce1c('0x10'),_0x144ed2,_0xce1c('0x13'));_0x3b1b28(_0x222ef7[_0xce1c('0x18')][_0xce1c('0x17')]);}})['catch'](function(_0x9d2955){logger[_0xce1c('0x15')](_0xce1c('0x10'),_0x144ed2,_0x9d2955);_0x4beb9d(_0x9d2955);});});}exports[_0xce1c('0x19')]=function(_0x3e1b0d){var _0x1b0054=this;return new Promise(function(_0x2d063f,_0x206074){return db[_0xce1c('0x1a')]['create'](_0x3e1b0d['body'],{'raw':_0x3e1b0d['options']?_0x3e1b0d[_0xce1c('0x1b')][_0xce1c('0x1c')]===undefined?!![]:![]:!![]})[_0xce1c('0xe')](function(_0x449019){logger[_0xce1c('0xf')](_0xce1c('0x19'),_0x3e1b0d);logger[_0xce1c('0x11')]('CreateChatMessage',_0x3e1b0d,JSON[_0xce1c('0x14')](_0x449019));_0x2d063f(_0x449019);})['catch'](function(_0x4e8e99){logger[_0xce1c('0x15')](_0xce1c('0x19'),_0x4e8e99[_0xce1c('0x17')],_0x3e1b0d);_0x206074(_0x1b0054[_0xce1c('0x15')](0x1f4,_0x4e8e99['message']));});});};
\ No newline at end of file
+var _0x3f26=['ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','body','options','raw','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x189e47,_0x4fa398){var _0x5c375b=function(_0x349e8c){while(--_0x349e8c){_0x189e47['push'](_0x189e47['shift']());}};_0x5c375b(++_0x4fa398);}(_0x3f26,0x8c));var _0x63f2=function(_0x19a681,_0x39d6a4){_0x19a681=_0x19a681-0x0;var _0x5189c9=_0x3f26[_0x19a681];return _0x5189c9;};'use strict';var _=require('lodash');var util=require(_0x63f2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x63f2('0x1'));var fs=require('fs');var Redis=require(_0x63f2('0x2'));var db=require(_0x63f2('0x3'))['db'];var utils=require(_0x63f2('0x4'));var logger=require(_0x63f2('0x5'))(_0x63f2('0x6'));var config=require('../../config/environment');var jayson=require(_0x63f2('0x7'));var client=jayson[_0x63f2('0x8')][_0x63f2('0x9')]({'port':0x232a});config['redis']=_[_0x63f2('0xa')](config[_0x63f2('0xb')],{'host':_0x63f2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x63f2('0xb')]));require(_0x63f2('0xd'))[_0x63f2('0xe')](socket);function respondWithRpcPromise(_0x1553ab,_0x5041dd,_0x1f4dcd){return new BPromise(function(_0x1333f4,_0x132682){return client['request'](_0x1553ab,_0x1f4dcd)[_0x63f2('0xf')](function(_0x13b0bf){logger[_0x63f2('0x10')](_0x63f2('0x11'),_0x5041dd,_0x63f2('0x12'));logger[_0x63f2('0x13')](_0x63f2('0x14'),_0x5041dd,_0x63f2('0x12'),JSON[_0x63f2('0x15')](_0x13b0bf));if(_0x13b0bf[_0x63f2('0x16')]){if(_0x13b0bf[_0x63f2('0x16')][_0x63f2('0x17')]===0x1f4){logger[_0x63f2('0x16')](_0x63f2('0x11'),_0x5041dd,_0x13b0bf[_0x63f2('0x16')][_0x63f2('0x18')]);return _0x132682(_0x13b0bf[_0x63f2('0x16')][_0x63f2('0x18')]);}logger[_0x63f2('0x16')](_0x63f2('0x11'),_0x5041dd,_0x13b0bf['error']['message']);return _0x1333f4(_0x13b0bf['error'][_0x63f2('0x18')]);}else{logger[_0x63f2('0x10')](_0x63f2('0x11'),_0x5041dd,_0x63f2('0x12'));_0x1333f4(_0x13b0bf[_0x63f2('0x19')][_0x63f2('0x18')]);}})[_0x63f2('0x1a')](function(_0xc675be){logger[_0x63f2('0x16')]('ChatMessage,\x20%s,\x20%s',_0x5041dd,_0xc675be);_0x132682(_0xc675be);});});}exports[_0x63f2('0x1b')]=function(_0x17f845){var _0x32e47d=this;return new Promise(function(_0x44fa30,_0x35b641){return db[_0x63f2('0x1c')]['create'](_0x17f845[_0x63f2('0x1d')],{'raw':_0x17f845['options']?_0x17f845[_0x63f2('0x1e')][_0x63f2('0x1f')]===undefined?!![]:![]:!![]})[_0x63f2('0xf')](function(_0x4a5318){logger[_0x63f2('0x10')](_0x63f2('0x1b'),_0x17f845);logger[_0x63f2('0x13')](_0x63f2('0x1b'),_0x17f845,JSON[_0x63f2('0x15')](_0x4a5318));_0x44fa30(_0x4a5318);})[_0x63f2('0x1a')](function(_0x38ce3f){logger[_0x63f2('0x16')]('CreateChatMessage',_0x38ce3f[_0x63f2('0x18')],_0x17f845);_0x35b641(_0x32e47d[_0x63f2('0x16')](0x1f4,_0x38ce3f[_0x63f2('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 16d633f..9965677 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 _0x7a2d=['length','chatMessage:','./chatMessage.events','save','remove','update','removeListener','register'];(function(_0xc79556,_0x27b148){var _0x19f18a=function(_0x434e45){while(--_0x434e45){_0xc79556['push'](_0xc79556['shift']());}};_0x19f18a(++_0x27b148);}(_0x7a2d,0x142));var _0xd7a2=function(_0x36e1d2,_0x5697a){_0x36e1d2=_0x36e1d2-0x0;var _0x3a7037=_0x7a2d[_0x36e1d2];return _0x3a7037;};'use strict';var ChatMessageEvents=require(_0xd7a2('0x0'));var events=[_0xd7a2('0x1'),_0xd7a2('0x2'),_0xd7a2('0x3')];function createListener(_0x81f2c5,_0x1edb4e){return function(_0x31dd61){_0x1edb4e['emit'](_0x81f2c5,_0x31dd61);};}function removeListener(_0x500472,_0x7370d9){return function(){ChatMessageEvents[_0xd7a2('0x4')](_0x500472,_0x7370d9);};}exports[_0xd7a2('0x5')]=function(_0x13b19d){for(var _0x4f0c6b=0x0,_0x210a06=events[_0xd7a2('0x6')];_0x4f0c6b<_0x210a06;_0x4f0c6b++){var _0x1e3fc8=events[_0x4f0c6b];var _0x69f732=createListener(_0xd7a2('0x7')+_0x1e3fc8,_0x13b19d);ChatMessageEvents['on'](_0x1e3fc8,_0x69f732);}};
\ No newline at end of file
+var _0xa8eb=['length','./chatMessage.events','remove','register'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0xa8eb,0x179));var _0xba8e=function(_0x46a82c,_0x1cd5ba){_0x46a82c=_0x46a82c-0x0;var _0x15e3d6=_0xa8eb[_0x46a82c];return _0x15e3d6;};'use strict';var ChatMessageEvents=require(_0xba8e('0x0'));var events=['save',_0xba8e('0x1'),'update'];function createListener(_0xd7f19f,_0x35f485){return function(_0x3b8fee){_0x35f485['emit'](_0xd7f19f,_0x3b8fee);};}function removeListener(_0x353df2,_0x368ce6){return function(){ChatMessageEvents['removeListener'](_0x353df2,_0x368ce6);};}exports[_0xba8e('0x2')]=function(_0x57e345){for(var _0x14c3ac=0x0,_0x52a8ef=events[_0xba8e('0x3')];_0x14c3ac<_0x52a8ef;_0x14c3ac++){var _0x69ccbe=events[_0x14c3ac];var _0x4b1bd6=createListener('chatMessage:'+_0x69ccbe,_0x57e345);ChatMessageEvents['on'](_0x69ccbe,_0x4b1bd6);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index ca063fe..5b18a99 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 _0x50d7=['chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','index','get','/describe','isAuthenticated','/:id','post','tracked'];(function(_0x2f16e5,_0x2e75e0){var _0x5d082a=function(_0x13873b){while(--_0x13873b){_0x2f16e5['push'](_0x2f16e5['shift']());}};_0x5d082a(++_0x2e75e0);}(_0x50d7,0xba));var _0x750d=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x50d7[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0x750d('0x0'));var util=require(_0x750d('0x1'));var path=require(_0x750d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x750d('0x3'));var auth=require(_0x750d('0x4'));var interaction=require(_0x750d('0x5'));var config=require('../../config/environment');var controller=require(_0x750d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x750d('0x7')]);router[_0x750d('0x8')](_0x750d('0x9'),auth[_0x750d('0xa')](),controller['describe']);router[_0x750d('0x8')](_0x750d('0xb'),auth[_0x750d('0xa')](),controller['show']);router[_0x750d('0xc')]('/',auth['isAuthenticated'](),interaction[_0x750d('0xd')](_0x750d('0xe'),_0x750d('0xf')),controller[_0x750d('0x10')]);router[_0x750d('0x11')](_0x750d('0xb'),controller[_0x750d('0x12')]);router[_0x750d('0x11')](_0x750d('0x13'),auth[_0x750d('0xa')](),controller[_0x750d('0x14')]);router[_0x750d('0x11')](_0x750d('0x15'),auth[_0x750d('0xa')](),controller[_0x750d('0x16')]);router[_0x750d('0x17')]('/:id',auth[_0x750d('0xa')](),controller[_0x750d('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x8874=['chat','chatmessage:create','create','put','/:id','update','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','post','tracked'];(function(_0x11f598,_0x5a2990){var _0x2a37dc=function(_0x510577){while(--_0x510577){_0x11f598['push'](_0x11f598['shift']());}};_0x2a37dc(++_0x5a2990);}(_0x8874,0x98));var _0x4887=function(_0x14fdb6,_0x2f65d7){_0x14fdb6=_0x14fdb6-0x0;var _0x4de02d=_0x8874[_0x14fdb6];return _0x4de02d;};'use strict';var multer=require(_0x4887('0x0'));var util=require('util');var path=require(_0x4887('0x1'));var timeout=require(_0x4887('0x2'));var express=require('express');var router=express[_0x4887('0x3')]();var fs_extra=require(_0x4887('0x4'));var auth=require(_0x4887('0x5'));var interaction=require(_0x4887('0x6'));var config=require(_0x4887('0x7'));var controller=require(_0x4887('0x8'));router[_0x4887('0x9')]('/',auth[_0x4887('0xa')](),controller[_0x4887('0xb')]);router['get'](_0x4887('0xc'),auth[_0x4887('0xa')](),controller[_0x4887('0xd')]);router[_0x4887('0x9')]('/:id',auth[_0x4887('0xa')](),controller['show']);router[_0x4887('0xe')]('/',auth[_0x4887('0xa')](),interaction[_0x4887('0xf')](_0x4887('0x10'),_0x4887('0x11')),controller[_0x4887('0x12')]);router[_0x4887('0x13')](_0x4887('0x14'),controller[_0x4887('0x15')]);router[_0x4887('0x13')]('/:id/accept',auth[_0x4887('0xa')](),controller[_0x4887('0x16')]);router[_0x4887('0x13')](_0x4887('0x17'),auth[_0x4887('0xa')](),controller[_0x4887('0x18')]);router[_0x4887('0x19')](_0x4887('0x14'),auth['isAuthenticated'](),controller[_0x4887('0x1a')]);module[_0x4887('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 8e2cfb0..5e0a3af 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x315b61,_0x4bb11e){_0x315b61=_0x315b61-0x0;var _0x3521e8=_0x0b0e[_0x315b61];return _0x3521e8;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x0b0e[_0x51c819];return _0x15c5d2;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index e7dab60..e2c3885 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(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x7a54,0x106));var _0x47a5=function(_0x2753f0,_0x29488e){_0x2753f0=_0x2753f0-0x0;var _0x4143ee=_0x7a54[_0x2753f0];return _0x4143ee;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x59e5b4,_0x3ef306){var _0x41b912=function(_0x4abd57){while(--_0x4abd57){_0x59e5b4['push'](_0x59e5b4['shift']());}};_0x41b912(++_0x3ef306);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 2b41983..6032e54 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 _0x01d9=['ChatOfflineMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3eb926,_0x27e966){var _0x29460d=function(_0x143ba7){while(--_0x143ba7){_0x3eb926['push'](_0x3eb926['shift']());}};_0x29460d(++_0x27e966);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x901d('0x0'));var ChatOfflineMessage=require(_0x901d('0x1'))['db'][_0x901d('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x901d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x901d('0x4'),'afterDestroy':_0x901d('0x5')};function emitEvent(_0x247cfc){return function(_0x8f7b4,_0x214f38,_0x456f31){ChatOfflineMessageEvents[_0x901d('0x6')](_0x247cfc+':'+_0x8f7b4['id'],_0x8f7b4);ChatOfflineMessageEvents['emit'](_0x247cfc,_0x8f7b4);_0x456f31(null);};}for(var e in events){if(events[_0x901d('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x901d('0x8')](e,emitEvent(event));}}module[_0x901d('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xf8af=['ChatOfflineMessage','setMaxListeners','save','update','hasOwnProperty','exports','events'];(function(_0x594a97,_0x1e5b33){var _0x115aad=function(_0x4ce5da){while(--_0x4ce5da){_0x594a97['push'](_0x594a97['shift']());}};_0x115aad(++_0x1e5b33);}(_0xf8af,0x8b));var _0xff8a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf8af[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0xff8a('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xff8a('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xff8a('0x2')](0x0);var events={'afterCreate':_0xff8a('0x3'),'afterUpdate':_0xff8a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7b1bb0){return function(_0x460bf6,_0x11cfa2,_0x3bd9c2){ChatOfflineMessageEvents['emit'](_0x7b1bb0+':'+_0x460bf6['id'],_0x460bf6);ChatOfflineMessageEvents['emit'](_0x7b1bb0,_0x460bf6);_0x3bd9c2(null);};}for(var e in events){if(events[_0xff8a('0x5')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xff8a('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 8cc4e99..e363b1d 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 _0x7a28=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x571339,_0x5bcafb){var _0x5af8a6=function(_0x389251){while(--_0x389251){_0x571339['push'](_0x571339['shift']());}};_0x5af8a6(++_0x5bcafb);}(_0x7a28,0x172));var _0x87a2=function(_0x1f4f68,_0x5c9022){_0x1f4f68=_0x1f4f68-0x0;var _0x3e2d3d=_0x7a28[_0x1f4f68];return _0x3e2d3d;};'use strict';var attributes=require(_0x87a2('0x0'));module[_0x87a2('0x1')]=function(_0x43eedd){return _0x43eedd[_0x87a2('0x2')](_0x87a2('0x3'),attributes,{'tableName':_0x87a2('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x87a2('0x5'),'collate':_0x87a2('0x6')});};
\ No newline at end of file
+var _0x6ac6=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0xf8e486,_0x5d2f29){var _0x5dcc9a=function(_0x363dfe){while(--_0x363dfe){_0xf8e486['push'](_0xf8e486['shift']());}};_0x5dcc9a(++_0x5d2f29);}(_0x6ac6,0xe0));var _0x66ac=function(_0x57a3e2,_0xe4b2c5){_0x57a3e2=_0x57a3e2-0x0;var _0x1e6edc=_0x6ac6[_0x57a3e2];return _0x1e6edc;};'use strict';var attributes=require(_0x66ac('0x0'));module[_0x66ac('0x1')]=function(_0x5bd387){return _0x5bd387[_0x66ac('0x2')](_0x66ac('0x3'),attributes,{'tableName':_0x66ac('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x66ac('0x5'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 525cd44..6da8795 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 _0xdae3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','info','result'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0xdae3,0x10e));var _0x3dae=function(_0x6d2cf2,_0x1386ca){_0x6d2cf2=_0x6d2cf2-0x0;var _0x2e646e=_0xdae3[_0x6d2cf2];return _0x2e646e;};'use strict';var _=require(_0x3dae('0x0'));var util=require(_0x3dae('0x1'));var moment=require(_0x3dae('0x2'));var BPromise=require(_0x3dae('0x3'));var rs=require(_0x3dae('0x4'));var fs=require('fs');var Redis=require(_0x3dae('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3dae('0x6'))(_0x3dae('0x7'));var config=require(_0x3dae('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3dae('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x353d24,_0x3f6ddd,_0x990c70){return new BPromise(function(_0x353eef,_0xbfc082){return client['request'](_0x353d24,_0x990c70)[_0x3dae('0xa')](function(_0x319278){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x3f6ddd,'request\x20sent');logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3f6ddd,_0x3dae('0xb'),JSON[_0x3dae('0xc')](_0x319278));if(_0x319278['error']){if(_0x319278[_0x3dae('0xd')]['code']===0x1f4){logger['error'](_0x3dae('0xe'),_0x3f6ddd,_0x319278[_0x3dae('0xd')][_0x3dae('0xf')]);return _0xbfc082(_0x319278['error']['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3f6ddd,_0x319278['error'][_0x3dae('0xf')]);return _0x353eef(_0x319278[_0x3dae('0xd')][_0x3dae('0xf')]);}else{logger[_0x3dae('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3f6ddd,_0x3dae('0xb'));_0x353eef(_0x319278[_0x3dae('0x11')][_0x3dae('0xf')]);}})['catch'](function(_0x46c437){logger[_0x3dae('0xd')](_0x3dae('0xe'),_0x3f6ddd,_0x46c437);_0xbfc082(_0x46c437);});});}
\ No newline at end of file
+var _0x221b=['request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x221b,0xbf));var _0xb221=function(_0x2889e7,_0x3ba050){_0x2889e7=_0x2889e7-0x0;var _0x5d7d93=_0x221b[_0x2889e7];return _0x5d7d93;};'use strict';var _=require(_0xb221('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb221('0x1'));var rs=require(_0xb221('0x2'));var fs=require('fs');var Redis=require(_0xb221('0x3'));var db=require(_0xb221('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb221('0x5'))(_0xb221('0x6'));var config=require(_0xb221('0x7'));var jayson=require(_0xb221('0x8'));var client=jayson[_0xb221('0x9')][_0xb221('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52119d,_0x5a1ba8,_0x1fbd29){return new BPromise(function(_0x41f0e8,_0x5d8f47){return client[_0xb221('0xb')](_0x52119d,_0x1fbd29)['then'](function(_0x1a712b){logger[_0xb221('0xc')](_0xb221('0xd'),_0x5a1ba8,'request\x20sent');logger[_0xb221('0xe')](_0xb221('0xf'),_0x5a1ba8,_0xb221('0x10'),JSON[_0xb221('0x11')](_0x1a712b));if(_0x1a712b[_0xb221('0x12')]){if(_0x1a712b[_0xb221('0x12')][_0xb221('0x13')]===0x1f4){logger[_0xb221('0x12')](_0xb221('0xd'),_0x5a1ba8,_0x1a712b[_0xb221('0x12')][_0xb221('0x14')]);return _0x5d8f47(_0x1a712b[_0xb221('0x12')]['message']);}logger[_0xb221('0x12')](_0xb221('0xd'),_0x5a1ba8,_0x1a712b[_0xb221('0x12')]['message']);return _0x41f0e8(_0x1a712b[_0xb221('0x12')][_0xb221('0x14')]);}else{logger[_0xb221('0xc')](_0xb221('0xd'),_0x5a1ba8,_0xb221('0x10'));_0x41f0e8(_0x1a712b[_0xb221('0x15')][_0xb221('0x14')]);}})[_0xb221('0x16')](function(_0x2c2912){logger[_0xb221('0x12')](_0xb221('0xd'),_0x5a1ba8,_0x2c2912);_0x5d8f47(_0x2c2912);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index e2a0d60..f15a91d 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 _0x9e3c=['put','update','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x153dba,_0x2fc9d9){var _0x4d3654=function(_0x4a0c50){while(--_0x4a0c50){_0x153dba['push'](_0x153dba['shift']());}};_0x4d3654(++_0x2fc9d9);}(_0x9e3c,0x17f));var _0xc9e3=function(_0x527a53,_0x3265d6){_0x527a53=_0x527a53-0x0;var _0x2332f5=_0x9e3c[_0x527a53];return _0x2332f5;};'use strict';var multer=require('multer');var util=require(_0xc9e3('0x0'));var path=require(_0xc9e3('0x1'));var timeout=require('connect-timeout');var express=require(_0xc9e3('0x2'));var router=express[_0xc9e3('0x3')]();var fs_extra=require(_0xc9e3('0x4'));var auth=require(_0xc9e3('0x5'));var interaction=require(_0xc9e3('0x6'));var config=require(_0xc9e3('0x7'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0xc9e3('0x8')](),controller[_0xc9e3('0x9')]);router[_0xc9e3('0xa')](_0xc9e3('0xb'),auth[_0xc9e3('0x8')](),controller[_0xc9e3('0xc')]);router['get'](_0xc9e3('0xd'),auth[_0xc9e3('0x8')](),controller[_0xc9e3('0xe')]);router[_0xc9e3('0xf')]('/',auth[_0xc9e3('0x8')](),controller['create']);router[_0xc9e3('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc9e3('0x11')]);router['delete'](_0xc9e3('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xc9e3('0x12')]=router;
\ No newline at end of file
+var _0xdace=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete'];(function(_0x3ba9c0,_0x2db2d8){var _0x543daa=function(_0x51e436){while(--_0x51e436){_0x3ba9c0['push'](_0x3ba9c0['shift']());}};_0x543daa(++_0x2db2d8);}(_0xdace,0xba));var _0xedac=function(_0x4a5494,_0x3ad336){_0x4a5494=_0x4a5494-0x0;var _0x57cbb5=_0xdace[_0x4a5494];return _0x57cbb5;};'use strict';var multer=require(_0xedac('0x0'));var util=require(_0xedac('0x1'));var path=require(_0xedac('0x2'));var timeout=require(_0xedac('0x3'));var express=require('express');var router=express[_0xedac('0x4')]();var fs_extra=require(_0xedac('0x5'));var auth=require(_0xedac('0x6'));var interaction=require(_0xedac('0x7'));var config=require('../../config/environment');var controller=require(_0xedac('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xedac('0x9')]);router[_0xedac('0xa')](_0xedac('0xb'),auth[_0xedac('0xc')](),controller[_0xedac('0xd')]);router[_0xedac('0xa')](_0xedac('0xe'),auth['isAuthenticated'](),controller[_0xedac('0xf')]);router[_0xedac('0x10')]('/',auth['isAuthenticated'](),controller[_0xedac('0x11')]);router[_0xedac('0x12')](_0xedac('0xe'),auth['isAuthenticated'](),controller[_0xedac('0x13')]);router[_0xedac('0x14')]('/:id',auth[_0xedac('0xc')](),controller[_0xedac('0x15')]);module[_0xedac('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 770302a..62b50ea 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 _0x1e12=['exports','STRING','mouseOver','timeout','INTEGER','sequelize'];(function(_0x2df84d,_0x56d874){var _0x2634ce=function(_0x8e8e31){while(--_0x8e8e31){_0x2df84d['push'](_0x2df84d['shift']());}};_0x2634ce(++_0x56d874);}(_0x1e12,0xef));var _0x21e1=function(_0x335f37,_0x23569c){_0x335f37=_0x335f37-0x0;var _0x5ebe83=_0x1e12[_0x335f37];return _0x5ebe83;};'use strict';var Sequelize=require(_0x21e1('0x0'));module[_0x21e1('0x1')]={'name':{'type':Sequelize[_0x21e1('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x21e1('0x3'),_0x21e1('0x4')),'defaultValue':_0x21e1('0x3')},'selector':{'type':Sequelize[_0x21e1('0x2')]},'timeout':{'type':Sequelize[_0x21e1('0x5')]}};
\ No newline at end of file
+var _0xa751=['INTEGER','sequelize','STRING','mouseOver','timeout'];(function(_0x1d844a,_0x7aaf1e){var _0x4b9c6f=function(_0x3d2b87){while(--_0x3d2b87){_0x1d844a['push'](_0x1d844a['shift']());}};_0x4b9c6f(++_0x7aaf1e);}(_0xa751,0x6f));var _0x1a75=function(_0x39dc2e,_0x3b9862){_0x39dc2e=_0x39dc2e-0x0;var _0x4eaf08=_0xa751[_0x39dc2e];return _0x4eaf08;};'use strict';var Sequelize=require(_0x1a75('0x0'));module['exports']={'name':{'type':Sequelize[_0x1a75('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1a75('0x2'),_0x1a75('0x3')),'defaultValue':_0x1a75('0x2')},'selector':{'type':Sequelize[_0x1a75('0x1')]},'timeout':{'type':Sequelize[_0x1a75('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 743fc62..6db98c4 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 _0x96f1=['Content-Range','apply','reject','then','end','error','stack','name','send','show','model','ChatProactiveAction','query','keys','filters','attributes','intersection','fields','length','includeAll','merge','options','find','catch','update','params','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count'];(function(_0x5d9f6d,_0x38ff06){var _0x3c9b25=function(_0x5f1913){while(--_0x5f1913){_0x5d9f6d['push'](_0x5d9f6d['shift']());}};_0x3c9b25(++_0x38ff06);}(_0x96f1,0x19c));var _0x196f=function(_0x1dacca,_0x5d87cf){_0x1dacca=_0x1dacca-0x0;var _0x155f58=_0x96f1[_0x1dacca];return _0x155f58;};'use strict';var emlformat=require(_0x196f('0x0'));var rimraf=require(_0x196f('0x1'));var zipdir=require(_0x196f('0x2'));var jsonpatch=require(_0x196f('0x3'));var rp=require(_0x196f('0x4'));var moment=require(_0x196f('0x5'));var BPromise=require(_0x196f('0x6'));var Mustache=require(_0x196f('0x7'));var util=require('util');var path=require('path');var sox=require(_0x196f('0x8'));var csv=require(_0x196f('0x9'));var ejs=require(_0x196f('0xa'));var fs=require('fs');var fs_extra=require(_0x196f('0xb'));var _=require(_0x196f('0xc'));var squel=require('squel');var crypto=require(_0x196f('0xd'));var jsforce=require(_0x196f('0xe'));var deskjs=require(_0x196f('0xf'));var toCsv=require(_0x196f('0x9'));var querystring=require('querystring');var Papa=require(_0x196f('0x10'));var Redis=require('ioredis');var authService=require(_0x196f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x196f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x196f('0x13'));var licenseUtil=require(_0x196f('0x14'));var db=require(_0x196f('0x15'))['db'];function respondWithStatusCode(_0x36e631,_0x28a202){_0x28a202=_0x28a202||0xcc;return function(_0x219c21){if(_0x219c21){return _0x36e631['sendStatus'](_0x28a202);}return _0x36e631[_0x196f('0x16')](_0x28a202)['end']();};}function respondWithResult(_0x40828b,_0x568ef0){_0x568ef0=_0x568ef0||0xc8;return function(_0x16bd9d){if(_0x16bd9d){return _0x40828b['status'](_0x568ef0)[_0x196f('0x17')](_0x16bd9d);}};}function respondWithFilteredResult(_0x106562,_0x192367){return function(_0x330646){if(_0x330646){var _0xeeae5d=typeof _0x192367[_0x196f('0x18')]==='undefined'&&typeof _0x192367[_0x196f('0x19')]===_0x196f('0x1a');var _0x1e73f1=_0x330646[_0x196f('0x1b')];var _0x55b82f=_0xeeae5d?0x0:_0x192367[_0x196f('0x18')];var _0x2b2f56=_0xeeae5d?_0x330646[_0x196f('0x1b')]:_0x192367['offset']+_0x192367[_0x196f('0x19')];var _0x84571f;if(_0x2b2f56>=_0x1e73f1){_0x2b2f56=_0x1e73f1;_0x84571f=0xc8;}else{_0x84571f=0xce;}_0x106562['status'](_0x84571f);return _0x106562['set'](_0x196f('0x1c'),_0x55b82f+'-'+_0x2b2f56+'/'+_0x1e73f1)[_0x196f('0x17')](_0x330646);}return null;};}function patchUpdates(_0x464321){return function(_0x16bec1){try{jsonpatch[_0x196f('0x1d')](_0x16bec1,_0x464321,!![]);}catch(_0x17fbd2){return BPromise[_0x196f('0x1e')](_0x17fbd2);}return _0x16bec1['save']();};}function saveUpdates(_0x3e17f,_0x3d6e33){return function(_0x31bf42){if(_0x31bf42){return _0x31bf42['update'](_0x3e17f)['then'](function(_0x2f5d60){return _0x2f5d60;});}return null;};}function removeEntity(_0x28a6d3,_0x1c5786){return function(_0x18b220){if(_0x18b220){return _0x18b220['destroy']()[_0x196f('0x1f')](function(){_0x28a6d3[_0x196f('0x16')](0xcc)[_0x196f('0x20')]();});}};}function handleEntityNotFound(_0x330e36,_0x427ac6){return function(_0x406ab5){if(!_0x406ab5){_0x330e36['sendStatus'](0x194);}return _0x406ab5;};}function handleError(_0x4f6155,_0x37105f){_0x37105f=_0x37105f||0x1f4;return function(_0x3c4834){logger[_0x196f('0x21')](_0x3c4834[_0x196f('0x22')]);if(_0x3c4834[_0x196f('0x23')]){delete _0x3c4834[_0x196f('0x23')];}_0x4f6155[_0x196f('0x16')](_0x37105f)[_0x196f('0x24')](_0x3c4834);};}exports[_0x196f('0x25')]=function(_0x22e769,_0x5a285b){var _0x2ef0ea={'raw':!![],'where':{'id':_0x22e769['params']['id']}},_0x30b0c7={};_0x30b0c7[_0x196f('0x26')]=_['keys'](db[_0x196f('0x27')]['rawAttributes']);_0x30b0c7[_0x196f('0x28')]=_[_0x196f('0x29')](_0x22e769[_0x196f('0x28')]);_0x30b0c7[_0x196f('0x2a')]=_['intersection'](_0x30b0c7[_0x196f('0x26')],_0x30b0c7[_0x196f('0x28')]);_0x2ef0ea[_0x196f('0x2b')]=_[_0x196f('0x2c')](_0x30b0c7[_0x196f('0x26')],qs[_0x196f('0x2d')](_0x22e769['query'][_0x196f('0x2d')]));_0x2ef0ea['attributes']=_0x2ef0ea['attributes'][_0x196f('0x2e')]?_0x2ef0ea[_0x196f('0x2b')]:_0x30b0c7[_0x196f('0x26')];if(_0x22e769[_0x196f('0x28')][_0x196f('0x2f')]){_0x2ef0ea['include']=[{'all':!![]}];}_0x2ef0ea=_[_0x196f('0x30')]({},_0x2ef0ea,_0x22e769[_0x196f('0x31')]);return db[_0x196f('0x27')][_0x196f('0x32')](_0x2ef0ea)[_0x196f('0x1f')](handleEntityNotFound(_0x5a285b,null))[_0x196f('0x1f')](respondWithResult(_0x5a285b,null))[_0x196f('0x33')](handleError(_0x5a285b,null));};exports['create']=function(_0x2d9cc4,_0x56c95c){return db[_0x196f('0x27')]['create'](_0x2d9cc4['body'],{})[_0x196f('0x1f')](respondWithResult(_0x56c95c,0xc9))[_0x196f('0x33')](handleError(_0x56c95c,null));};exports[_0x196f('0x34')]=function(_0x2e9533,_0x1805d1){if(_0x2e9533['body']['id']){delete _0x2e9533['body']['id'];}return db[_0x196f('0x27')][_0x196f('0x32')]({'where':{'id':_0x2e9533[_0x196f('0x35')]['id']}})[_0x196f('0x1f')](handleEntityNotFound(_0x1805d1,null))['then'](saveUpdates(_0x2e9533[_0x196f('0x36')],null))[_0x196f('0x1f')](respondWithResult(_0x1805d1,null))[_0x196f('0x33')](handleError(_0x1805d1,null));};exports['destroy']=function(_0x4fe155,_0x46e662){return db[_0x196f('0x27')]['find']({'where':{'id':_0x4fe155[_0x196f('0x35')]['id']}})[_0x196f('0x1f')](handleEntityNotFound(_0x46e662,null))[_0x196f('0x1f')](removeEntity(_0x46e662,null))[_0x196f('0x33')](handleError(_0x46e662,null));};
\ No newline at end of file
+var _0x47d6=['../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','include','merge','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2e233e,_0x2a9bef){var _0x5b506b=function(_0x21fd45){while(--_0x21fd45){_0x2e233e['push'](_0x2e233e['shift']());}};_0x5b506b(++_0x2a9bef);}(_0x47d6,0x1de));var _0x647d=function(_0x4800a2,_0x14acb9){_0x4800a2=_0x4800a2-0x0;var _0x3b6436=_0x47d6[_0x4800a2];return _0x3b6436;};'use strict';var emlformat=require(_0x647d('0x0'));var rimraf=require(_0x647d('0x1'));var zipdir=require(_0x647d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x647d('0x3'));var BPromise=require(_0x647d('0x4'));var Mustache=require(_0x647d('0x5'));var util=require('util');var path=require(_0x647d('0x6'));var sox=require(_0x647d('0x7'));var csv=require(_0x647d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x647d('0x9'));var _=require(_0x647d('0xa'));var squel=require(_0x647d('0xb'));var crypto=require(_0x647d('0xc'));var jsforce=require(_0x647d('0xd'));var deskjs=require(_0x647d('0xe'));var toCsv=require(_0x647d('0x8'));var querystring=require(_0x647d('0xf'));var Papa=require(_0x647d('0x10'));var Redis=require(_0x647d('0x11'));var authService=require(_0x647d('0x12'));var qs=require(_0x647d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x647d('0x14'));var logger=require(_0x647d('0x15'))(_0x647d('0x16'));var utils=require(_0x647d('0x17'));var config=require(_0x647d('0x18'));var licenseUtil=require(_0x647d('0x19'));var db=require(_0x647d('0x1a'))['db'];function respondWithStatusCode(_0x26cb0b,_0x52570d){_0x52570d=_0x52570d||0xcc;return function(_0x412e63){if(_0x412e63){return _0x26cb0b[_0x647d('0x1b')](_0x52570d);}return _0x26cb0b[_0x647d('0x1c')](_0x52570d)[_0x647d('0x1d')]();};}function respondWithResult(_0x4b224d,_0x18ef9e){_0x18ef9e=_0x18ef9e||0xc8;return function(_0x368b52){if(_0x368b52){return _0x4b224d[_0x647d('0x1c')](_0x18ef9e)['json'](_0x368b52);}};}function respondWithFilteredResult(_0x25fa4a,_0x4c175c){return function(_0x264e53){if(_0x264e53){var _0x5740ff=typeof _0x4c175c[_0x647d('0x1e')]===_0x647d('0x1f')&&typeof _0x4c175c['limit']===_0x647d('0x1f');var _0x539fe4=_0x264e53[_0x647d('0x20')];var _0x30a107=_0x5740ff?0x0:_0x4c175c[_0x647d('0x1e')];var _0x407788=_0x5740ff?_0x264e53[_0x647d('0x20')]:_0x4c175c[_0x647d('0x1e')]+_0x4c175c[_0x647d('0x21')];var _0x29168d;if(_0x407788>=_0x539fe4){_0x407788=_0x539fe4;_0x29168d=0xc8;}else{_0x29168d=0xce;}_0x25fa4a[_0x647d('0x1c')](_0x29168d);return _0x25fa4a[_0x647d('0x22')](_0x647d('0x23'),_0x30a107+'-'+_0x407788+'/'+_0x539fe4)[_0x647d('0x24')](_0x264e53);}return null;};}function patchUpdates(_0x33145c){return function(_0x13dcb6){try{jsonpatch[_0x647d('0x25')](_0x13dcb6,_0x33145c,!![]);}catch(_0x40484c){return BPromise[_0x647d('0x26')](_0x40484c);}return _0x13dcb6[_0x647d('0x27')]();};}function saveUpdates(_0x266982,_0x5e354e){return function(_0x417a03){if(_0x417a03){return _0x417a03[_0x647d('0x28')](_0x266982)['then'](function(_0x25bd0e){return _0x25bd0e;});}return null;};}function removeEntity(_0x3d8e69,_0x1f4c09){return function(_0x1e508a){if(_0x1e508a){return _0x1e508a['destroy']()[_0x647d('0x29')](function(){_0x3d8e69[_0x647d('0x1c')](0xcc)[_0x647d('0x1d')]();});}};}function handleEntityNotFound(_0x2a974c,_0x141b25){return function(_0x5db555){if(!_0x5db555){_0x2a974c[_0x647d('0x1b')](0x194);}return _0x5db555;};}function handleError(_0x248ab7,_0x1c6888){_0x1c6888=_0x1c6888||0x1f4;return function(_0x4499b2){logger[_0x647d('0x2a')](_0x4499b2[_0x647d('0x2b')]);if(_0x4499b2[_0x647d('0x2c')]){delete _0x4499b2[_0x647d('0x2c')];}_0x248ab7['status'](_0x1c6888)['send'](_0x4499b2);};}exports[_0x647d('0x2d')]=function(_0x20d08d,_0x1a0360){var _0x427915={'raw':!![],'where':{'id':_0x20d08d[_0x647d('0x2e')]['id']}},_0xefdb81={};_0xefdb81[_0x647d('0x2f')]=_[_0x647d('0x30')](db[_0x647d('0x31')][_0x647d('0x32')]);_0xefdb81[_0x647d('0x33')]=_[_0x647d('0x30')](_0x20d08d[_0x647d('0x33')]);_0xefdb81[_0x647d('0x34')]=_[_0x647d('0x35')](_0xefdb81[_0x647d('0x2f')],_0xefdb81['query']);_0x427915[_0x647d('0x36')]=_[_0x647d('0x35')](_0xefdb81[_0x647d('0x2f')],qs[_0x647d('0x37')](_0x20d08d[_0x647d('0x33')][_0x647d('0x37')]));_0x427915[_0x647d('0x36')]=_0x427915[_0x647d('0x36')]['length']?_0x427915[_0x647d('0x36')]:_0xefdb81[_0x647d('0x2f')];if(_0x20d08d[_0x647d('0x33')]['includeAll']){_0x427915[_0x647d('0x38')]=[{'all':!![]}];}_0x427915=_[_0x647d('0x39')]({},_0x427915,_0x20d08d['options']);return db[_0x647d('0x31')][_0x647d('0x3a')](_0x427915)[_0x647d('0x29')](handleEntityNotFound(_0x1a0360,null))[_0x647d('0x29')](respondWithResult(_0x1a0360,null))[_0x647d('0x3b')](handleError(_0x1a0360,null));};exports[_0x647d('0x3c')]=function(_0x250c33,_0x156844){return db[_0x647d('0x31')][_0x647d('0x3c')](_0x250c33[_0x647d('0x3d')],{})[_0x647d('0x29')](respondWithResult(_0x156844,0xc9))[_0x647d('0x3b')](handleError(_0x156844,null));};exports['update']=function(_0x3c4cbc,_0x5da608){if(_0x3c4cbc[_0x647d('0x3d')]['id']){delete _0x3c4cbc[_0x647d('0x3d')]['id'];}return db[_0x647d('0x31')]['find']({'where':{'id':_0x3c4cbc[_0x647d('0x2e')]['id']}})[_0x647d('0x29')](handleEntityNotFound(_0x5da608,null))[_0x647d('0x29')](saveUpdates(_0x3c4cbc['body'],null))[_0x647d('0x29')](respondWithResult(_0x5da608,null))['catch'](handleError(_0x5da608,null));};exports[_0x647d('0x3e')]=function(_0x5a3fe8,_0x2d261b){return db[_0x647d('0x31')][_0x647d('0x3a')]({'where':{'id':_0x5a3fe8[_0x647d('0x2e')]['id']}})[_0x647d('0x29')](handleEntityNotFound(_0x2d261b,null))[_0x647d('0x29')](removeEntity(_0x2d261b,null))[_0x647d('0x3b')](handleError(_0x2d261b,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index b5cbbb9..063f08c 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 _0x46a2=['chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction'];(function(_0x140438,_0x17c9e2){var _0x3ff495=function(_0x3d2b18){while(--_0x3d2b18){_0x140438['push'](_0x140438['shift']());}};_0x3ff495(++_0x17c9e2);}(_0x46a2,0x12c));var _0x246a=function(_0x5a7f64,_0x347d57){_0x5a7f64=_0x5a7f64-0x0;var _0x3d30f1=_0x46a2[_0x5a7f64];return _0x3d30f1;};'use strict';var _=require(_0x246a('0x0'));var util=require(_0x246a('0x1'));var logger=require(_0x246a('0x2'))(_0x246a('0x3'));var moment=require(_0x246a('0x4'));var BPromise=require(_0x246a('0x5'));var rp=require(_0x246a('0x6'));var fs=require('fs');var path=require(_0x246a('0x7'));var rimraf=require(_0x246a('0x8'));var config=require('../../config/environment');var attributes=require(_0x246a('0x9'));module['exports']=function(_0x2eecff,_0x5cdef3){return _0x2eecff[_0x246a('0xa')](_0x246a('0xb'),attributes,{'tableName':_0x246a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x70e7=['bluebird','../../config/environment','exports','ChatProactiveAction','lodash','util','../../config/logger','moment'];(function(_0x99ace4,_0x2cad84){var _0x1e5c4f=function(_0x41f255){while(--_0x41f255){_0x99ace4['push'](_0x99ace4['shift']());}};_0x1e5c4f(++_0x2cad84);}(_0x70e7,0x144));var _0x770e=function(_0x48b9c4,_0x461fee){_0x48b9c4=_0x48b9c4-0x0;var _0xa41721=_0x70e7[_0x48b9c4];return _0xa41721;};'use strict';var _=require(_0x770e('0x0'));var util=require(_0x770e('0x1'));var logger=require(_0x770e('0x2'))('api');var moment=require(_0x770e('0x3'));var BPromise=require(_0x770e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x770e('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0x770e('0x6')]=function(_0x423c74,_0x509fcf){return _0x423c74['define'](_0x770e('0x7'),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 ceb416e..1898429 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 _0x1e63=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring'];(function(_0x58c184,_0x128f43){var _0x25a09f=function(_0x5ef878){while(--_0x5ef878){_0x58c184['push'](_0x58c184['shift']());}};_0x25a09f(++_0x128f43);}(_0x1e63,0x11d));var _0x31e6=function(_0x48f0cb,_0x4e1f50){_0x48f0cb=_0x48f0cb-0x0;var _0x232533=_0x1e63[_0x48f0cb];return _0x232533;};'use strict';var _=require(_0x31e6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x31e6('0x1'));var rs=require(_0x31e6('0x2'));var fs=require('fs');var Redis=require(_0x31e6('0x3'));var db=require(_0x31e6('0x4'))['db'];var utils=require(_0x31e6('0x5'));var logger=require(_0x31e6('0x6'))('rpc');var config=require(_0x31e6('0x7'));var jayson=require(_0x31e6('0x8'));var client=jayson[_0x31e6('0x9')][_0x31e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x510124,_0x577ad5,_0x43b1d1){return new BPromise(function(_0x2dd77c,_0x333ae6){return client[_0x31e6('0xb')](_0x510124,_0x43b1d1)[_0x31e6('0xc')](function(_0x4e280d){logger[_0x31e6('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x577ad5,'request\x20sent');logger[_0x31e6('0xe')](_0x31e6('0xf'),_0x577ad5,_0x31e6('0x10'),JSON[_0x31e6('0x11')](_0x4e280d));if(_0x4e280d['error']){if(_0x4e280d[_0x31e6('0x12')][_0x31e6('0x13')]===0x1f4){logger[_0x31e6('0x12')](_0x31e6('0x14'),_0x577ad5,_0x4e280d[_0x31e6('0x12')][_0x31e6('0x15')]);return _0x333ae6(_0x4e280d[_0x31e6('0x12')][_0x31e6('0x15')]);}logger[_0x31e6('0x12')](_0x31e6('0x14'),_0x577ad5,_0x4e280d[_0x31e6('0x12')][_0x31e6('0x15')]);return _0x2dd77c(_0x4e280d[_0x31e6('0x12')][_0x31e6('0x15')]);}else{logger[_0x31e6('0xd')](_0x31e6('0x14'),_0x577ad5,_0x31e6('0x10'));_0x2dd77c(_0x4e280d[_0x31e6('0x16')]['message']);}})[_0x31e6('0x17')](function(_0x11268e){logger[_0x31e6('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x577ad5,_0x11268e);_0x333ae6(_0x11268e);});});}
\ No newline at end of file
+var _0x271a=['then','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x4659fe,_0x1acd23){var _0x283836=function(_0xcad166){while(--_0xcad166){_0x4659fe['push'](_0x4659fe['shift']());}};_0x283836(++_0x1acd23);}(_0x271a,0xc4));var _0xa271=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x271a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa271('0x0'));var util=require('util');var moment=require(_0xa271('0x1'));var BPromise=require(_0xa271('0x2'));var rs=require(_0xa271('0x3'));var fs=require('fs');var Redis=require(_0xa271('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa271('0x5'));var logger=require(_0xa271('0x6'))(_0xa271('0x7'));var config=require('../../config/environment');var jayson=require(_0xa271('0x8'));var client=jayson[_0xa271('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40974a,_0x1a9801,_0x3789e6){return new BPromise(function(_0xf74fa,_0x2ee6b6){return client[_0xa271('0xa')](_0x40974a,_0x3789e6)[_0xa271('0xb')](function(_0x1846ef){logger['info'](_0xa271('0xc'),_0x1a9801,'request\x20sent');logger[_0xa271('0xd')](_0xa271('0xe'),_0x1a9801,_0xa271('0xf'),JSON[_0xa271('0x10')](_0x1846ef));if(_0x1846ef['error']){if(_0x1846ef[_0xa271('0x11')][_0xa271('0x12')]===0x1f4){logger[_0xa271('0x11')](_0xa271('0xc'),_0x1a9801,_0x1846ef['error'][_0xa271('0x13')]);return _0x2ee6b6(_0x1846ef['error'][_0xa271('0x13')]);}logger[_0xa271('0x11')](_0xa271('0xc'),_0x1a9801,_0x1846ef['error'][_0xa271('0x13')]);return _0xf74fa(_0x1846ef[_0xa271('0x11')]['message']);}else{logger[_0xa271('0x14')](_0xa271('0xc'),_0x1a9801,_0xa271('0xf'));_0xf74fa(_0x1846ef[_0xa271('0x15')][_0xa271('0x13')]);}})[_0xa271('0x16')](function(_0x3db0c6){logger[_0xa271('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x1a9801,_0x3db0c6);_0x2ee6b6(_0x3db0c6);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 2e80e92..5c61c34 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 _0x5d17=['create','put','/:id','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated','show','post'];(function(_0x29b7d0,_0x180edf){var _0xbeb0b=function(_0x375188){while(--_0x375188){_0x29b7d0['push'](_0x29b7d0['shift']());}};_0xbeb0b(++_0x180edf);}(_0x5d17,0x114));var _0x75d1=function(_0x8686c9,_0x305a8f){_0x8686c9=_0x8686c9-0x0;var _0x1dc90c=_0x5d17[_0x8686c9];return _0x1dc90c;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var fs_extra=require(_0x75d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var controller=require(_0x75d1('0x7'));router[_0x75d1('0x8')]('/:id',auth[_0x75d1('0x9')](),controller[_0x75d1('0xa')]);router[_0x75d1('0xb')]('/',auth[_0x75d1('0x9')](),controller[_0x75d1('0xc')]);router[_0x75d1('0xd')](_0x75d1('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x75d1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x75d1('0x10')]);module[_0x75d1('0x11')]=router;
\ No newline at end of file
+var _0x53ec=['create','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','post'];(function(_0x1525d1,_0x310935){var _0xdbee2c=function(_0xb55347){while(--_0xb55347){_0x1525d1['push'](_0x1525d1['shift']());}};_0xdbee2c(++_0x310935);}(_0x53ec,0x192));var _0xc53e=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0x53ec[_0x4d337e];return _0x247963;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get'](_0xc53e('0x9'),auth['isAuthenticated'](),controller[_0xc53e('0xa')]);router[_0xc53e('0xb')]('/',auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xd')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index b99d918..5550ec8 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 _0xe5ac=['sequelize','exports','name','STRING','ENUM','beepall'];(function(_0x57c750,_0x3ca2c1){var _0x56dcba=function(_0x104134){while(--_0x104134){_0x57c750['push'](_0x57c750['shift']());}};_0x56dcba(++_0x3ca2c1);}(_0xe5ac,0x9c));var _0xce5a=function(_0x4b5740,_0x1689d2){_0x4b5740=_0x4b5740-0x0;var _0x49aa07=_0xe5ac[_0x4b5740];return _0x49aa07;};'use strict';var Sequelize=require(_0xce5a('0x0'));module[_0xce5a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xce5a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xce5a('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xce5a('0x4')]('rrmemory',_0xce5a('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0x7ed0=['STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x1c4397,_0x36a3e5){var _0x588673=function(_0x29e853){while(--_0x29e853){_0x1c4397['push'](_0x1c4397['shift']());}};_0x588673(++_0x36a3e5);}(_0x7ed0,0xce));var _0x07ed=function(_0xc4912a,_0x333022){_0xc4912a=_0xc4912a-0x0;var _0x288c7a=_0x7ed0[_0xc4912a];return _0x288c7a;};'use strict';var Sequelize=require(_0x07ed('0x0'));module[_0x07ed('0x1')]={'name':{'type':Sequelize[_0x07ed('0x2')],'unique':_0x07ed('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x07ed('0x2')]},'timeout':{'type':Sequelize[_0x07ed('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x07ed('0x5'),_0x07ed('0x6'),_0x07ed('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 678f582..11d8f43 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 _0x3d48=['message','ChatQueue,\x20%s,\x20%s','info','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','update','destroy','get','ChatQueues','stack','name','index','map','ChatQueue','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','include','findAll','rows','params','rawAttributes','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','describe','getMembers','UserChatQueue','ChatQueueId','UserId','agent','updatedAt','format','%s/%s','SIP','chatPause','createdAt','getTeams','findOne','Team','ids','User','online','voicePause','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','removeAgents','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5d5378,_0x3d083e){var _0x46fa19=function(_0x726a3d){while(--_0x726a3d){_0x5d5378['push'](_0x5d5378['shift']());}};_0x46fa19(++_0x3d083e);}(_0x3d48,0x1a0));var _0x83d4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x3d48[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x83d4('0x0'));var zipdir=require(_0x83d4('0x1'));var jsonpatch=require(_0x83d4('0x2'));var rp=require('request-promise');var moment=require(_0x83d4('0x3'));var BPromise=require(_0x83d4('0x4'));var Mustache=require(_0x83d4('0x5'));var util=require(_0x83d4('0x6'));var path=require(_0x83d4('0x7'));var sox=require(_0x83d4('0x8'));var csv=require(_0x83d4('0x9'));var ejs=require(_0x83d4('0xa'));var fs=require('fs');var fs_extra=require(_0x83d4('0xb'));var _=require(_0x83d4('0xc'));var squel=require(_0x83d4('0xd'));var crypto=require('crypto');var jsforce=require(_0x83d4('0xe'));var deskjs=require(_0x83d4('0xf'));var toCsv=require(_0x83d4('0x9'));var querystring=require(_0x83d4('0x10'));var Papa=require(_0x83d4('0x11'));var Redis=require(_0x83d4('0x12'));var authService=require(_0x83d4('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x83d4('0x14'));var hardwareService=require(_0x83d4('0x15'));var logger=require(_0x83d4('0x16'))(_0x83d4('0x17'));var utils=require(_0x83d4('0x18'));var config=require(_0x83d4('0x19'));var licenseUtil=require(_0x83d4('0x1a'));var db=require(_0x83d4('0x1b'))['db'];config[_0x83d4('0x1c')]=_[_0x83d4('0x1d')](config['redis'],{'host':_0x83d4('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x83d4('0x1f'))[_0x83d4('0x20')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x575ce7,_0x48471a,_0x5b1955,_0x9adfbc){return new BPromise(function(_0x190de6,_0x10ba2e){var _0x345cc8=_0x9adfbc||client;return _0x345cc8[_0x83d4('0x21')](_0x575ce7,_0x5b1955)[_0x83d4('0x22')](function(_0x5afeec){logger['info']('ChatQueue,\x20%s,\x20%s',_0x48471a,_0x83d4('0x23'));logger[_0x83d4('0x24')](_0x83d4('0x25'),_0x48471a,'request\x20sent',JSON[_0x83d4('0x26')](_0x5afeec));if(_0x5afeec[_0x83d4('0x27')]){if(_0x5afeec['error']['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x48471a,_0x5afeec['error'][_0x83d4('0x28')]);return _0x10ba2e(_0x5afeec[_0x83d4('0x27')][_0x83d4('0x28')]);}logger['error'](_0x83d4('0x29'),_0x48471a,_0x5afeec[_0x83d4('0x27')][_0x83d4('0x28')]);return _0x190de6(_0x5afeec[_0x83d4('0x27')][_0x83d4('0x28')]);}else{logger[_0x83d4('0x2a')](_0x83d4('0x29'),_0x48471a,_0x83d4('0x23'));_0x190de6(_0x5afeec['result'][_0x83d4('0x28')]);}})[_0x83d4('0x2b')](function(_0x1a6a39){logger[_0x83d4('0x27')](_0x83d4('0x29'),_0x48471a,_0x1a6a39);_0x10ba2e(_0x1a6a39);});});}function respondWithStatusCode(_0x4ddc4c,_0x9a0e77){_0x9a0e77=_0x9a0e77||0xcc;return function(_0x58d045){if(_0x58d045){return _0x4ddc4c[_0x83d4('0x2c')](_0x9a0e77);}return _0x4ddc4c[_0x83d4('0x2d')](_0x9a0e77)[_0x83d4('0x2e')]();};}function respondWithResult(_0x2ea4b3,_0x45f14e){_0x45f14e=_0x45f14e||0xc8;return function(_0x14e0c9){if(_0x14e0c9){return _0x2ea4b3[_0x83d4('0x2d')](_0x45f14e)['json'](_0x14e0c9);}};}function respondWithFilteredResult(_0x72451c,_0x140d31){return function(_0x126be9){if(_0x126be9){var _0x78e0c4=typeof _0x140d31[_0x83d4('0x2f')]===_0x83d4('0x30')&&typeof _0x140d31[_0x83d4('0x31')]===_0x83d4('0x30');var _0x3e447b=_0x126be9[_0x83d4('0x32')];var _0x3b9c72=_0x78e0c4?0x0:_0x140d31['offset'];var _0x32869a=_0x78e0c4?_0x126be9[_0x83d4('0x32')]:_0x140d31[_0x83d4('0x2f')]+_0x140d31['limit'];var _0x107241;if(_0x32869a>=_0x3e447b){_0x32869a=_0x3e447b;_0x107241=0xc8;}else{_0x107241=0xce;}_0x72451c[_0x83d4('0x2d')](_0x107241);return _0x72451c['set'](_0x83d4('0x33'),_0x3b9c72+'-'+_0x32869a+'/'+_0x3e447b)['json'](_0x126be9);}return null;};}function patchUpdates(_0x31f4b5){return function(_0x2d446a){try{jsonpatch['apply'](_0x2d446a,_0x31f4b5,!![]);}catch(_0x2e1f73){return BPromise[_0x83d4('0x34')](_0x2e1f73);}return _0x2d446a['save']();};}function saveUpdates(_0xebb1bd,_0x252919){return function(_0x72580a){if(_0x72580a){return _0x72580a[_0x83d4('0x35')](_0xebb1bd)[_0x83d4('0x22')](function(_0x10ca5b){return _0x10ca5b;});}return null;};}function removeEntity(_0x530687,_0x4898dc){return function(_0x2f3140){if(_0x2f3140){return _0x2f3140[_0x83d4('0x36')]()[_0x83d4('0x22')](function(){var _0x40b6b5=_0x2f3140[_0x83d4('0x37')]({'plain':!![]});var _0x3d4685=_0x83d4('0x38');return db['UserProfileResource'][_0x83d4('0x36')]({'where':{'type':_0x3d4685,'resourceId':_0x40b6b5['id']}})[_0x83d4('0x22')](function(){return _0x2f3140;});})[_0x83d4('0x22')](function(){_0x530687[_0x83d4('0x2d')](0xcc)[_0x83d4('0x2e')]();});}};}function handleEntityNotFound(_0x129375,_0x27d5fb){return function(_0x25dd7b){if(!_0x25dd7b){_0x129375[_0x83d4('0x2c')](0x194);}return _0x25dd7b;};}function handleError(_0x185647,_0x1854b5){_0x1854b5=_0x1854b5||0x1f4;return function(_0x358733){logger[_0x83d4('0x27')](_0x358733[_0x83d4('0x39')]);if(_0x358733[_0x83d4('0x3a')]){delete _0x358733['name'];}_0x185647['status'](_0x1854b5)['send'](_0x358733);};}exports[_0x83d4('0x3b')]=function(_0x50adb5,_0xe8899e){var _0xa4c237={},_0x18851b={},_0x1a6f67={'count':0x0,'rows':[]};var _0x4bd9ea=_[_0x83d4('0x3c')](db[_0x83d4('0x3d')]['rawAttributes'],function(_0x3a6e06){return{'name':_0x3a6e06['fieldName'],'type':_0x3a6e06['type'][_0x83d4('0x3e')]};});_0x18851b[_0x83d4('0x3f')]=_['map'](_0x4bd9ea,_0x83d4('0x3a'));_0x18851b[_0x83d4('0x40')]=_[_0x83d4('0x41')](_0x50adb5[_0x83d4('0x40')]);_0x18851b[_0x83d4('0x42')]=_[_0x83d4('0x43')](_0x18851b[_0x83d4('0x3f')],_0x18851b['query']);_0xa4c237[_0x83d4('0x44')]=_[_0x83d4('0x43')](_0x18851b['model'],qs[_0x83d4('0x45')](_0x50adb5['query']['fields']));_0xa4c237[_0x83d4('0x44')]=_0xa4c237[_0x83d4('0x44')][_0x83d4('0x46')]?_0xa4c237[_0x83d4('0x44')]:_0x18851b[_0x83d4('0x3f')];if(!_0x50adb5['query'][_0x83d4('0x47')](_0x83d4('0x48'))){_0xa4c237[_0x83d4('0x31')]=qs[_0x83d4('0x31')](_0x50adb5[_0x83d4('0x40')][_0x83d4('0x31')]);_0xa4c237['offset']=qs[_0x83d4('0x2f')](_0x50adb5[_0x83d4('0x40')][_0x83d4('0x2f')]);}_0xa4c237[_0x83d4('0x49')]=qs['sort'](_0x50adb5[_0x83d4('0x40')][_0x83d4('0x4a')]);_0xa4c237[_0x83d4('0x4b')]=qs[_0x83d4('0x42')](_[_0x83d4('0x4c')](_0x50adb5[_0x83d4('0x40')],_0x18851b['filters']),_0x4bd9ea);if(_0x50adb5[_0x83d4('0x40')]['filter']){_0xa4c237[_0x83d4('0x4b')]=_['merge'](_0xa4c237['where'],{'$or':_[_0x83d4('0x3c')](_0x4bd9ea,function(_0x2247bc){if(_0x2247bc[_0x83d4('0x4d')]!==_0x83d4('0x4e')){var _0x175ac1={};_0x175ac1[_0x2247bc[_0x83d4('0x3a')]]={'$like':'%'+_0x50adb5[_0x83d4('0x40')][_0x83d4('0x4f')]+'%'};return _0x175ac1;}})});}_0xa4c237=_[_0x83d4('0x50')]({},_0xa4c237,_0x50adb5['options']);var _0x34f450={'where':_0xa4c237[_0x83d4('0x4b')]};return db[_0x83d4('0x3d')][_0x83d4('0x32')](_0x34f450)['then'](function(_0x1cc9d2){_0x1a6f67[_0x83d4('0x32')]=_0x1cc9d2;if(_0x50adb5[_0x83d4('0x40')]['includeAll']){_0xa4c237[_0x83d4('0x51')]=[{'all':!![]}];}return db[_0x83d4('0x3d')][_0x83d4('0x52')](_0xa4c237);})[_0x83d4('0x22')](function(_0x1ec382){_0x1a6f67[_0x83d4('0x53')]=_0x1ec382;return _0x1a6f67;})[_0x83d4('0x22')](respondWithFilteredResult(_0xe8899e,_0xa4c237))[_0x83d4('0x2b')](handleError(_0xe8899e,null));};exports['show']=function(_0x2b6551,_0x500353){var _0x262984={'raw':!![],'where':{'id':_0x2b6551[_0x83d4('0x54')]['id']}},_0x49eaea={};_0x49eaea[_0x83d4('0x3f')]=_[_0x83d4('0x41')](db[_0x83d4('0x3d')][_0x83d4('0x55')]);_0x49eaea['query']=_[_0x83d4('0x41')](_0x2b6551[_0x83d4('0x40')]);_0x49eaea[_0x83d4('0x42')]=_[_0x83d4('0x43')](_0x49eaea[_0x83d4('0x3f')],_0x49eaea[_0x83d4('0x40')]);_0x262984['attributes']=_['intersection'](_0x49eaea[_0x83d4('0x3f')],qs['fields'](_0x2b6551[_0x83d4('0x40')][_0x83d4('0x45')]));_0x262984[_0x83d4('0x44')]=_0x262984[_0x83d4('0x44')]['length']?_0x262984[_0x83d4('0x44')]:_0x49eaea[_0x83d4('0x3f')];if(_0x2b6551['query'][_0x83d4('0x56')]){_0x262984[_0x83d4('0x51')]=[{'all':!![]}];}_0x262984=_[_0x83d4('0x50')]({},_0x262984,_0x2b6551[_0x83d4('0x57')]);return db[_0x83d4('0x3d')]['find'](_0x262984)[_0x83d4('0x22')](handleEntityNotFound(_0x500353,null))[_0x83d4('0x22')](respondWithResult(_0x500353,null))[_0x83d4('0x2b')](handleError(_0x500353,null));};exports['create']=function(_0x2fd9a6,_0xfc12c){return db[_0x83d4('0x3d')][_0x83d4('0x58')](_0x2fd9a6[_0x83d4('0x59')],{})[_0x83d4('0x22')](function(_0x402e2e){var _0x123fa2=_0x2fd9a6[_0x83d4('0x5a')][_0x83d4('0x37')]({'plain':!![]});if(!_0x123fa2)throw new Error(_0x83d4('0x5b'));if(_0x123fa2[_0x83d4('0x5c')]===_0x83d4('0x5a')){var _0x2871da=_0x402e2e[_0x83d4('0x37')]({'plain':!![]});var _0x253e28=_0x83d4('0x38');return db[_0x83d4('0x5d')][_0x83d4('0x5e')]({'where':{'name':_0x253e28,'userProfileId':_0x123fa2[_0x83d4('0x5f')]},'raw':!![]})[_0x83d4('0x22')](function(_0x5d991a){if(_0x5d991a&&_0x5d991a['autoAssociation']===0x0){return db[_0x83d4('0x60')][_0x83d4('0x58')]({'name':_0x2871da[_0x83d4('0x3a')],'resourceId':_0x2871da['id'],'type':_0x5d991a['name'],'sectionId':_0x5d991a['id']},{})[_0x83d4('0x22')](function(){return _0x402e2e;});}else{return _0x402e2e;}})[_0x83d4('0x2b')](function(_0x209129){logger[_0x83d4('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x209129);throw _0x209129;});}return _0x402e2e;})[_0x83d4('0x22')](respondWithResult(_0xfc12c,0xc9))[_0x83d4('0x2b')](handleError(_0xfc12c,null));};exports[_0x83d4('0x35')]=function(_0x2fa6d6,_0x2beea7){if(_0x2fa6d6[_0x83d4('0x59')]['id']){delete _0x2fa6d6['body']['id'];}return db['ChatQueue']['find']({'where':{'id':_0x2fa6d6[_0x83d4('0x54')]['id']}})[_0x83d4('0x22')](handleEntityNotFound(_0x2beea7,null))[_0x83d4('0x22')](saveUpdates(_0x2fa6d6[_0x83d4('0x59')],null))[_0x83d4('0x22')](respondWithResult(_0x2beea7,null))[_0x83d4('0x2b')](handleError(_0x2beea7,null));};exports[_0x83d4('0x36')]=function(_0x336546,_0x35c5e4){return db['ChatQueue'][_0x83d4('0x5e')]({'where':{'id':_0x336546[_0x83d4('0x54')]['id']}})[_0x83d4('0x22')](handleEntityNotFound(_0x35c5e4,null))[_0x83d4('0x22')](removeEntity(_0x35c5e4,null))[_0x83d4('0x2b')](handleError(_0x35c5e4,null));};exports[_0x83d4('0x61')]=function(_0xab3029,_0x2e9e89){return db[_0x83d4('0x3d')]['describe']()[_0x83d4('0x22')](respondWithResult(_0x2e9e89,null))[_0x83d4('0x2b')](handleError(_0x2e9e89,null));};exports[_0x83d4('0x62')]=function(_0x474fe,_0x3cd833,_0x220978){var _0x3b60c8={'raw':!![],'where':{}},_0x12e584={},_0x1ab963;return db['ChatQueue']['findOne']({'where':{'id':_0x474fe['params']['id']}})[_0x83d4('0x22')](handleEntityNotFound(_0x3cd833,null))[_0x83d4('0x22')](function(_0x3354a4){if(_0x3354a4){_0x1ab963=_0x3354a4[_0x83d4('0x37')]({'plain':!![]});_0x12e584[_0x83d4('0x3f')]=_[_0x83d4('0x41')](db[_0x83d4('0x63')][_0x83d4('0x55')]);_0x12e584['query']=_[_0x83d4('0x41')](_0x474fe[_0x83d4('0x40')]);_0x12e584[_0x83d4('0x42')]=_[_0x83d4('0x43')](_0x12e584[_0x83d4('0x3f')],_0x12e584[_0x83d4('0x40')]);_0x3b60c8['attributes']=_[_0x83d4('0x43')](_0x12e584[_0x83d4('0x3f')],qs[_0x83d4('0x45')](_0x474fe[_0x83d4('0x40')][_0x83d4('0x45')]));_0x3b60c8[_0x83d4('0x44')]=_0x3b60c8[_0x83d4('0x44')][_0x83d4('0x46')]?_0x3b60c8[_0x83d4('0x44')]:_0x12e584['model'];if(!_0x474fe[_0x83d4('0x40')]['hasOwnProperty'](_0x83d4('0x48'))){_0x3b60c8[_0x83d4('0x31')]=qs[_0x83d4('0x31')](_0x474fe[_0x83d4('0x40')]['limit']);_0x3b60c8[_0x83d4('0x2f')]=qs[_0x83d4('0x2f')](_0x474fe['query'][_0x83d4('0x2f')]);}_0x3b60c8[_0x83d4('0x49')]=qs[_0x83d4('0x4a')](_0x474fe[_0x83d4('0x40')][_0x83d4('0x4a')]);_0x3b60c8[_0x83d4('0x4b')]=qs[_0x83d4('0x42')](_[_0x83d4('0x4c')](_0x474fe[_0x83d4('0x40')],_0x12e584[_0x83d4('0x42')]));_0x3b60c8['where'][_0x83d4('0x64')]=_0x3354a4['id'];if(_0x474fe['query'][_0x83d4('0x4f')]){_0x3b60c8['where']=_['merge'](_0x3b60c8[_0x83d4('0x4b')],{'$or':_[_0x83d4('0x3c')](_0x3b60c8[_0x83d4('0x44')],function(_0x294acb){var _0x29e2ed={};_0x29e2ed[_0x294acb]={'$like':'%'+_0x474fe[_0x83d4('0x40')]['filter']+'%'};return _0x29e2ed;})});}_0x3b60c8=_[_0x83d4('0x50')]({},_0x3b60c8,_0x474fe['options']);return db['UserChatQueue'][_0x83d4('0x52')](_0x3b60c8);}})[_0x83d4('0x22')](function(_0x20c163){if(_0x20c163){return db['User']['findAndCountAll']({'where':{'id':_[_0x83d4('0x3c')](_0x20c163,_0x83d4('0x65')),'role':_0x83d4('0x66')},'attributes':['id',_0x83d4('0x3a'),'chatPause',_0x83d4('0x67'),'createdAt']});}})['then'](function(_0x4985b4){if(_0x4985b4){return{'count':_0x4985b4['count'],'rows':_['map'](_0x4985b4[_0x83d4('0x53')],function(_0x5700cc){return{'membername':_0x5700cc['name'],'UserId':_0x5700cc['id'],'queue_name':_0x1ab963[_0x83d4('0x3a')],'ChatQueueId':_0x1ab963['id'],'interface':util[_0x83d4('0x68')](_0x83d4('0x69'),_0x83d4('0x6a'),_0x5700cc[_0x83d4('0x3a')]),'penalty':0x0,'paused':_0x5700cc[_0x83d4('0x6b')],'createdAt':_0x5700cc[_0x83d4('0x6c')],'updatedAt':_0x5700cc[_0x83d4('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3cd833,_0x3b60c8))[_0x83d4('0x2b')](handleError(_0x3cd833,null));};exports[_0x83d4('0x6d')]=function(_0x1b54f4,_0xa828c7,_0xd32c7e){var _0x1e12c8={};var _0x5adb65={};var _0x165998;var _0x50f685;return db[_0x83d4('0x3d')][_0x83d4('0x6e')]({'where':{'id':_0x1b54f4[_0x83d4('0x54')]['id']}})['then'](handleEntityNotFound(_0xa828c7,null))[_0x83d4('0x22')](function(_0x2f56b2){if(_0x2f56b2){_0x165998=_0x2f56b2;_0x5adb65[_0x83d4('0x3f')]=_[_0x83d4('0x41')](db[_0x83d4('0x6f')][_0x83d4('0x55')]);_0x5adb65['query']=_[_0x83d4('0x41')](_0x1b54f4[_0x83d4('0x40')]);_0x5adb65['filters']=_[_0x83d4('0x43')](_0x5adb65[_0x83d4('0x3f')],_0x5adb65[_0x83d4('0x40')]);_0x1e12c8[_0x83d4('0x44')]=_[_0x83d4('0x43')](_0x5adb65[_0x83d4('0x3f')],qs[_0x83d4('0x45')](_0x1b54f4[_0x83d4('0x40')][_0x83d4('0x45')]));_0x1e12c8[_0x83d4('0x44')]=_0x1e12c8['attributes'][_0x83d4('0x46')]?_0x1e12c8[_0x83d4('0x44')]:_0x5adb65[_0x83d4('0x3f')];_0x1e12c8[_0x83d4('0x49')]=qs[_0x83d4('0x4a')](_0x1b54f4[_0x83d4('0x40')]['sort']);_0x1e12c8[_0x83d4('0x4b')]=qs['filters'](_['pick'](_0x1b54f4[_0x83d4('0x40')],_0x5adb65[_0x83d4('0x42')]));if(_0x1b54f4[_0x83d4('0x40')][_0x83d4('0x4f')]){_0x1e12c8['where']=_[_0x83d4('0x50')](_0x1e12c8['where'],{'$or':_[_0x83d4('0x3c')](_0x1e12c8[_0x83d4('0x44')],function(_0x43625d){var _0xb7d84={};_0xb7d84[_0x43625d]={'$like':'%'+_0x1b54f4[_0x83d4('0x40')][_0x83d4('0x4f')]+'%'};return _0xb7d84;})});}_0x1e12c8=_[_0x83d4('0x50')]({},_0x1e12c8,_0x1b54f4[_0x83d4('0x57')]);return _0x165998[_0x83d4('0x6d')](_0x1e12c8);}})[_0x83d4('0x22')](function(_0x588a66){if(_0x588a66){_0x50f685=_0x588a66['length'];if(!_0x1b54f4[_0x83d4('0x40')][_0x83d4('0x47')](_0x83d4('0x48'))){_0x1e12c8[_0x83d4('0x31')]=qs['limit'](_0x1b54f4[_0x83d4('0x40')]['limit']);_0x1e12c8[_0x83d4('0x2f')]=qs[_0x83d4('0x2f')](_0x1b54f4['query'][_0x83d4('0x2f')]);}return _0x165998['getTeams'](_0x1e12c8);}})[_0x83d4('0x22')](function(_0x41eca4){if(_0x41eca4){return _0x41eca4?{'count':_0x50f685,'rows':_0x41eca4}:null;}})[_0x83d4('0x22')](respondWithResult(_0xa828c7,null))[_0x83d4('0x2b')](handleError(_0xa828c7,null));};exports['addTeams']=function(_0x33000e,_0x32068a,_0x20a529){var _0x2355ab=_0x33000e[_0x83d4('0x59')][_0x83d4('0x70')];return db['Team'][_0x83d4('0x52')]({'where':{'id':_0x2355ab},'attributes':['id'],'include':[{'model':db[_0x83d4('0x71')],'as':'Agents','attributes':['id','name',_0x83d4('0x72'),_0x83d4('0x73'),'interface'],'raw':!![]}]})[_0x83d4('0x22')](function(_0x598b70){if(_0x598b70){var _0x4aa8ed=_['flatMap'](_0x598b70,function(_0x736606){var _0x309a9b=_0x736606[_0x83d4('0x37')]({'plain':!![]});return _0x309a9b[_0x83d4('0x74')];});return db[_0x83d4('0x3d')]['find']({'where':{'id':_0x33000e[_0x83d4('0x54')]['id']}})['then'](function(_0x15b88c){return db[_0x83d4('0x75')][_0x83d4('0x76')](function(_0x3e65ea){return _0x15b88c[_0x83d4('0x77')](_0x2355ab,{'transaction':_0x3e65ea})[_0x83d4('0x22')](function(){return BPromise[_0x83d4('0x78')](_0x4aa8ed,function(_0x5937f5){return db[_0x83d4('0x63')][_0x83d4('0x79')]({'where':{'UserId':_0x5937f5['id'],'ChatQueueId':_0x33000e[_0x83d4('0x54')]['id']},'transaction':_0x3e65ea});});})[_0x83d4('0x22')](function(){_0x4aa8ed[_0x83d4('0x7a')](function(_0x11eeb3){socket[_0x83d4('0x7b')]('userChatQueue:save',{'UserId':_0x11eeb3['id'],'ChatQueueId':_0x15b88c['id']});});});});});}})[_0x83d4('0x22')](respondWithStatusCode(_0x32068a,null))[_0x83d4('0x2b')](handleError(_0x32068a,null));};exports[_0x83d4('0x7c')]=function(_0x11a99c,_0x15ba00,_0xc09882){return db[_0x83d4('0x6f')][_0x83d4('0x52')]({'where':{'id':_0x11a99c['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x83d4('0x71')],'as':_0x83d4('0x74'),'attributes':['id'],'raw':!![]}]})[_0x83d4('0x22')](handleEntityNotFound(_0x15ba00,null))[_0x83d4('0x22')](function(_0x589e71){var _0x160dbe=_['map'](_0x589e71,'id');var _0x1cff7f=[];var _0x4a69ba=[];var _0xb78332=squel[_0x83d4('0x7d')]();_0xb78332[_0x83d4('0x7e')](_0x83d4('0x7f'))[_0x83d4('0x80')](_0x83d4('0x81'),'tq')[_0x83d4('0x82')](_0x83d4('0x83'),'ut',_0x83d4('0x84'))[_0x83d4('0x4b')](_0x83d4('0x85'),_0x11a99c[_0x83d4('0x54')]['id']);for(var _0x15726f=0x0;_0x15726f<_0x589e71[_0x83d4('0x46')];_0x15726f+=0x1){let _0x15f0d5=_0x589e71[_0x15726f];for(var _0x5c78de=0x0;_0x5c78de<_0x15f0d5['Agents'][_0x83d4('0x46')];_0x5c78de+=0x1){let _0x59d1f2=_0x15f0d5[_0x83d4('0x74')][_0x5c78de];var _0x4b8211=_0xb78332[_0x83d4('0x86')]();_0x4b8211[_0x83d4('0x4b')](_0x83d4('0x87'),_0x59d1f2['id']);_0x4a69ba[_0x83d4('0x88')](db[_0x83d4('0x75')][_0x83d4('0x40')](_0x4b8211[_0x83d4('0x89')](),{'type':db[_0x83d4('0x75')]['QueryTypes'][_0x83d4('0x8a')]})[_0x83d4('0x22')](function(_0x449cb4){if(_0x449cb4[_0x83d4('0x46')]===0x1){return _0x59d1f2['id'];}else{var _0x1a1145=_[_0x83d4('0x8b')](_[_0x83d4('0x3c')](_0x449cb4,_0x83d4('0x8c')),function(_0x38ae42){return _[_0x83d4('0x8d')](_0x160dbe,_0x38ae42);});if(_0x1a1145){return _0x59d1f2['id'];}}}));}}return BPromise[_0x83d4('0x8e')](_0x4a69ba)[_0x83d4('0x22')](function(_0x52ff9e){_0x1cff7f=_(_0x1cff7f)[_0x83d4('0x8f')](_0x52ff9e)[_0x83d4('0x90')]()['value']();return db[_0x83d4('0x3d')]['find']({'where':{'id':_0x11a99c['params']['id']}})[_0x83d4('0x22')](function(_0x182ba6){return db[_0x83d4('0x75')][_0x83d4('0x76')](function(_0x2d9a12){return _0x182ba6[_0x83d4('0x7c')](_0x11a99c[_0x83d4('0x40')]['ids'],{'transaction':_0x2d9a12})[_0x83d4('0x22')](function(){if(!_['isEmpty'](_0x1cff7f)){return _0x182ba6[_0x83d4('0x91')](_0x1cff7f,{'transaction':_0x2d9a12});}})['then'](function(){_0x1cff7f[_0x83d4('0x7a')](function(_0x5d1ca7){socket[_0x83d4('0x7b')](_0x83d4('0x92'),{'UserId':_0x5d1ca7,'ChatQueueId':_0x182ba6['id']});});});});});});})[_0x83d4('0x22')](respondWithStatusCode(_0x15ba00,null))[_0x83d4('0x2b')](handleError(_0x15ba00,null));};exports[_0x83d4('0x93')]=function(_0x31ae43,_0xeb6b2,_0x10d439){return db[_0x83d4('0x3d')][_0x83d4('0x5e')]({'where':{'id':_0x31ae43[_0x83d4('0x54')]['id']}})[_0x83d4('0x22')](handleEntityNotFound(_0xeb6b2,null))['then'](function(_0x550a34){if(_0x550a34){return _0x550a34[_0x83d4('0x93')](_0x31ae43[_0x83d4('0x59')][_0x83d4('0x70')],_[_0x83d4('0x94')](_0x31ae43[_0x83d4('0x59')],[_0x83d4('0x70'),'id'])||{})['spread'](function(_0x305d7c){for(var _0x22c625=0x0;_0x22c625<_0x31ae43[_0x83d4('0x59')][_0x83d4('0x70')]['length'];_0x22c625+=0x1){socket[_0x83d4('0x7b')](_0x83d4('0x95'),{'UserId':Number(_0x31ae43[_0x83d4('0x59')][_0x83d4('0x70')][_0x22c625]),'ChatQueueId':Number(_0x31ae43[_0x83d4('0x54')]['id'])});}return _0x305d7c;});}})[_0x83d4('0x22')](respondWithResult(_0xeb6b2,null))[_0x83d4('0x2b')](handleError(_0xeb6b2,null));};exports[_0x83d4('0x91')]=function(_0x3f8637,_0x2cb5f7,_0x420f4b){return db[_0x83d4('0x3d')][_0x83d4('0x5e')]({'where':{'id':_0x3f8637[_0x83d4('0x54')]['id']}})[_0x83d4('0x22')](handleEntityNotFound(_0x2cb5f7,null))[_0x83d4('0x22')](function(_0x58bf84){if(_0x58bf84){return _0x58bf84[_0x83d4('0x91')](_0x3f8637[_0x83d4('0x40')][_0x83d4('0x70')])[_0x83d4('0x22')](function(){if(_[_0x83d4('0x96')](_0x3f8637[_0x83d4('0x40')][_0x83d4('0x70')])){for(var _0x5a6a06=0x0;_0x5a6a06<_0x3f8637['query']['ids'][_0x83d4('0x46')];_0x5a6a06+=0x1){socket[_0x83d4('0x7b')](_0x83d4('0x92'),{'UserId':Number(_0x3f8637[_0x83d4('0x40')][_0x83d4('0x70')][_0x5a6a06]),'ChatQueueId':Number(_0x3f8637[_0x83d4('0x54')]['id'])});}}else{socket['emit'](_0x83d4('0x92'),{'UserId':Number(_0x3f8637[_0x83d4('0x40')][_0x83d4('0x70')]),'ChatQueueId':Number(_0x3f8637[_0x83d4('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x2cb5f7,null))['catch'](handleError(_0x2cb5f7,null));};exports['getAgents']=function(_0x29e982,_0x31fc87,_0x576937){var _0x2dcbd3={};var _0x597e93={};var _0x3c1fef;var _0x9e9e70;return db[_0x83d4('0x3d')][_0x83d4('0x6e')]({'where':{'id':_0x29e982[_0x83d4('0x54')]['id']}})[_0x83d4('0x22')](handleEntityNotFound(_0x31fc87,null))[_0x83d4('0x22')](function(_0x5cf27a){if(_0x5cf27a){_0x3c1fef=_0x5cf27a;_0x597e93[_0x83d4('0x3f')]=_[_0x83d4('0x41')](db['User']['rawAttributes']);_0x597e93[_0x83d4('0x40')]=_[_0x83d4('0x41')](_0x29e982[_0x83d4('0x40')]);_0x597e93[_0x83d4('0x42')]=_[_0x83d4('0x43')](_0x597e93['model'],_0x597e93['query']);_0x2dcbd3[_0x83d4('0x44')]=_[_0x83d4('0x43')](_0x597e93[_0x83d4('0x3f')],qs[_0x83d4('0x45')](_0x29e982['query'][_0x83d4('0x45')]));_0x2dcbd3[_0x83d4('0x44')]=_0x2dcbd3['attributes']['length']?_0x2dcbd3[_0x83d4('0x44')]:_0x597e93[_0x83d4('0x3f')];_0x2dcbd3[_0x83d4('0x49')]=qs[_0x83d4('0x4a')](_0x29e982[_0x83d4('0x40')][_0x83d4('0x4a')]);_0x2dcbd3[_0x83d4('0x4b')]=qs[_0x83d4('0x42')](_[_0x83d4('0x4c')](_0x29e982[_0x83d4('0x40')],_0x597e93[_0x83d4('0x42')]));if(_0x29e982[_0x83d4('0x40')][_0x83d4('0x4f')]){_0x2dcbd3[_0x83d4('0x4b')]=_[_0x83d4('0x50')](_0x2dcbd3[_0x83d4('0x4b')],{'$or':_[_0x83d4('0x3c')](_0x2dcbd3[_0x83d4('0x44')],function(_0x20b07f){var _0x361e49={};_0x361e49[_0x20b07f]={'$like':'%'+_0x29e982[_0x83d4('0x40')][_0x83d4('0x4f')]+'%'};return _0x361e49;})});}_0x2dcbd3=_['merge']({},_0x2dcbd3,_0x29e982[_0x83d4('0x57')]);return _0x3c1fef[_0x83d4('0x97')](_0x2dcbd3);}})[_0x83d4('0x22')](function(_0x521eee){if(_0x521eee){_0x9e9e70=_0x521eee['length'];if(!_0x29e982[_0x83d4('0x40')][_0x83d4('0x47')](_0x83d4('0x48'))){_0x2dcbd3[_0x83d4('0x31')]=qs[_0x83d4('0x31')](_0x29e982[_0x83d4('0x40')][_0x83d4('0x31')]);_0x2dcbd3[_0x83d4('0x2f')]=qs[_0x83d4('0x2f')](_0x29e982[_0x83d4('0x40')][_0x83d4('0x2f')]);}return _0x3c1fef[_0x83d4('0x97')](_0x2dcbd3);}})[_0x83d4('0x22')](function(_0x3156c0){if(_0x3156c0){return _0x3156c0?{'count':_0x9e9e70,'rows':_0x3156c0}:null;}})[_0x83d4('0x22')](respondWithResult(_0x31fc87,null))[_0x83d4('0x2b')](handleError(_0x31fc87,null));};
\ No newline at end of file
+var _0xfb05=['debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','map','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','filter','where','merge','VIRTUAL','ChatQueue','includeAll','include','findAll','rows','show','params','length','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','rawAttributes','order','sort','pick','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','interface','sequelize','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','union','compact','value','transaction','isEmpty','removeAgents','addAgents','spread','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x1bcc5e,_0x441b7a){var _0x312f3d=function(_0x3639a0){while(--_0x3639a0){_0x1bcc5e['push'](_0x1bcc5e['shift']());}};_0x312f3d(++_0x441b7a);}(_0xfb05,0x1b3));var _0x5fb0=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xfb05[_0x5f309e];return _0x487b5e;};'use strict';var emlformat=require(_0x5fb0('0x0'));var rimraf=require(_0x5fb0('0x1'));var zipdir=require(_0x5fb0('0x2'));var jsonpatch=require(_0x5fb0('0x3'));var rp=require(_0x5fb0('0x4'));var moment=require(_0x5fb0('0x5'));var BPromise=require(_0x5fb0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5fb0('0x7'));var csv=require('to-csv');var ejs=require(_0x5fb0('0x8'));var fs=require('fs');var fs_extra=require(_0x5fb0('0x9'));var _=require(_0x5fb0('0xa'));var squel=require(_0x5fb0('0xb'));var crypto=require('crypto');var jsforce=require(_0x5fb0('0xc'));var deskjs=require(_0x5fb0('0xd'));var toCsv=require(_0x5fb0('0xe'));var querystring=require(_0x5fb0('0xf'));var Papa=require(_0x5fb0('0x10'));var Redis=require(_0x5fb0('0x11'));var authService=require(_0x5fb0('0x12'));var qs=require(_0x5fb0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5fb0('0x14'));var logger=require(_0x5fb0('0x15'))(_0x5fb0('0x16'));var utils=require('../../config/utils');var config=require(_0x5fb0('0x17'));var licenseUtil=require(_0x5fb0('0x18'));var db=require(_0x5fb0('0x19'))['db'];config['redis']=_[_0x5fb0('0x1a')](config[_0x5fb0('0x1b')],{'host':_0x5fb0('0x1c'),'port':0x18eb});var socket=require(_0x5fb0('0x1d'))(new Redis(config[_0x5fb0('0x1b')]));require(_0x5fb0('0x1e'))[_0x5fb0('0x1f')](socket);var jayson=require(_0x5fb0('0x20'));var client=jayson['client'][_0x5fb0('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x58cc92,_0x587cb4,_0x14cac5,_0x742c0c){return new BPromise(function(_0xd268cc,_0x378b4d){var _0x1223b6=_0x742c0c||client;return _0x1223b6[_0x5fb0('0x22')](_0x58cc92,_0x14cac5)[_0x5fb0('0x23')](function(_0x2d5d17){logger[_0x5fb0('0x24')](_0x5fb0('0x25'),_0x587cb4,_0x5fb0('0x26'));logger[_0x5fb0('0x27')](_0x5fb0('0x28'),_0x587cb4,_0x5fb0('0x26'),JSON[_0x5fb0('0x29')](_0x2d5d17));if(_0x2d5d17[_0x5fb0('0x2a')]){if(_0x2d5d17['error'][_0x5fb0('0x2b')]===0x1f4){logger['error'](_0x5fb0('0x25'),_0x587cb4,_0x2d5d17['error']['message']);return _0x378b4d(_0x2d5d17[_0x5fb0('0x2a')][_0x5fb0('0x2c')]);}logger[_0x5fb0('0x2a')](_0x5fb0('0x25'),_0x587cb4,_0x2d5d17[_0x5fb0('0x2a')][_0x5fb0('0x2c')]);return _0xd268cc(_0x2d5d17[_0x5fb0('0x2a')][_0x5fb0('0x2c')]);}else{logger[_0x5fb0('0x24')]('ChatQueue,\x20%s,\x20%s',_0x587cb4,_0x5fb0('0x26'));_0xd268cc(_0x2d5d17[_0x5fb0('0x2d')][_0x5fb0('0x2c')]);}})[_0x5fb0('0x2e')](function(_0xeb5902){logger[_0x5fb0('0x2a')](_0x5fb0('0x25'),_0x587cb4,_0xeb5902);_0x378b4d(_0xeb5902);});});}function respondWithStatusCode(_0x428a13,_0x357baa){_0x357baa=_0x357baa||0xcc;return function(_0x49c985){if(_0x49c985){return _0x428a13['sendStatus'](_0x357baa);}return _0x428a13['status'](_0x357baa)[_0x5fb0('0x2f')]();};}function respondWithResult(_0x5dae25,_0x1a5bd2){_0x1a5bd2=_0x1a5bd2||0xc8;return function(_0x228ae4){if(_0x228ae4){return _0x5dae25[_0x5fb0('0x30')](_0x1a5bd2)[_0x5fb0('0x31')](_0x228ae4);}};}function respondWithFilteredResult(_0x3797d3,_0x8c8e18){return function(_0x62d73e){if(_0x62d73e){var _0x2cb2da=typeof _0x8c8e18[_0x5fb0('0x32')]===_0x5fb0('0x33')&&typeof _0x8c8e18[_0x5fb0('0x34')]==='undefined';var _0x4aef8c=_0x62d73e[_0x5fb0('0x35')];var _0x4457ed=_0x2cb2da?0x0:_0x8c8e18['offset'];var _0x363578=_0x2cb2da?_0x62d73e[_0x5fb0('0x35')]:_0x8c8e18[_0x5fb0('0x32')]+_0x8c8e18['limit'];var _0x3f9128;if(_0x363578>=_0x4aef8c){_0x363578=_0x4aef8c;_0x3f9128=0xc8;}else{_0x3f9128=0xce;}_0x3797d3['status'](_0x3f9128);return _0x3797d3[_0x5fb0('0x36')](_0x5fb0('0x37'),_0x4457ed+'-'+_0x363578+'/'+_0x4aef8c)['json'](_0x62d73e);}return null;};}function patchUpdates(_0x328751){return function(_0x45ae4b){try{jsonpatch[_0x5fb0('0x38')](_0x45ae4b,_0x328751,!![]);}catch(_0x462d5c){return BPromise['reject'](_0x462d5c);}return _0x45ae4b[_0x5fb0('0x39')]();};}function saveUpdates(_0x96812e,_0x52e0f6){return function(_0x2dde6d){if(_0x2dde6d){return _0x2dde6d[_0x5fb0('0x3a')](_0x96812e)[_0x5fb0('0x23')](function(_0x1743be){return _0x1743be;});}return null;};}function removeEntity(_0x4a4259,_0x30951c){return function(_0x54bdc0){if(_0x54bdc0){return _0x54bdc0[_0x5fb0('0x3b')]()[_0x5fb0('0x23')](function(){var _0x5b905e=_0x54bdc0[_0x5fb0('0x3c')]({'plain':!![]});var _0x590cb7=_0x5fb0('0x3d');return db[_0x5fb0('0x3e')]['destroy']({'where':{'type':_0x590cb7,'resourceId':_0x5b905e['id']}})['then'](function(){return _0x54bdc0;});})[_0x5fb0('0x23')](function(){_0x4a4259[_0x5fb0('0x30')](0xcc)[_0x5fb0('0x2f')]();});}};}function handleEntityNotFound(_0x4e5de7,_0x488fc0){return function(_0x17ddb1){if(!_0x17ddb1){_0x4e5de7[_0x5fb0('0x3f')](0x194);}return _0x17ddb1;};}function handleError(_0x4cf690,_0x15e0c9){_0x15e0c9=_0x15e0c9||0x1f4;return function(_0x476a0c){logger['error'](_0x476a0c[_0x5fb0('0x40')]);if(_0x476a0c[_0x5fb0('0x41')]){delete _0x476a0c[_0x5fb0('0x41')];}_0x4cf690['status'](_0x15e0c9)[_0x5fb0('0x42')](_0x476a0c);};}exports['index']=function(_0x172e10,_0x3d560e){var _0x50ba42={},_0x5af90c={},_0x4e4179={'count':0x0,'rows':[]};var _0x39bd40=_[_0x5fb0('0x43')](db['ChatQueue']['rawAttributes'],function(_0x3c3acd){return{'name':_0x3c3acd[_0x5fb0('0x44')],'type':_0x3c3acd[_0x5fb0('0x45')][_0x5fb0('0x46')]};});_0x5af90c['model']=_['map'](_0x39bd40,'name');_0x5af90c['query']=_[_0x5fb0('0x47')](_0x172e10[_0x5fb0('0x48')]);_0x5af90c[_0x5fb0('0x49')]=_[_0x5fb0('0x4a')](_0x5af90c['model'],_0x5af90c['query']);_0x50ba42[_0x5fb0('0x4b')]=_['intersection'](_0x5af90c[_0x5fb0('0x4c')],qs['fields'](_0x172e10['query'][_0x5fb0('0x4d')]));_0x50ba42[_0x5fb0('0x4b')]=_0x50ba42[_0x5fb0('0x4b')]['length']?_0x50ba42[_0x5fb0('0x4b')]:_0x5af90c[_0x5fb0('0x4c')];if(!_0x172e10[_0x5fb0('0x48')][_0x5fb0('0x4e')](_0x5fb0('0x4f'))){_0x50ba42[_0x5fb0('0x34')]=qs['limit'](_0x172e10[_0x5fb0('0x48')][_0x5fb0('0x34')]);_0x50ba42['offset']=qs['offset'](_0x172e10[_0x5fb0('0x48')]['offset']);}_0x50ba42['order']=qs['sort'](_0x172e10[_0x5fb0('0x48')]['sort']);_0x50ba42['where']=qs[_0x5fb0('0x49')](_['pick'](_0x172e10[_0x5fb0('0x48')],_0x5af90c[_0x5fb0('0x49')]),_0x39bd40);if(_0x172e10[_0x5fb0('0x48')][_0x5fb0('0x50')]){_0x50ba42[_0x5fb0('0x51')]=_[_0x5fb0('0x52')](_0x50ba42[_0x5fb0('0x51')],{'$or':_[_0x5fb0('0x43')](_0x39bd40,function(_0x176b92){if(_0x176b92[_0x5fb0('0x45')]!==_0x5fb0('0x53')){var _0x2f2cf0={};_0x2f2cf0[_0x176b92[_0x5fb0('0x41')]]={'$like':'%'+_0x172e10['query'][_0x5fb0('0x50')]+'%'};return _0x2f2cf0;}})});}_0x50ba42=_['merge']({},_0x50ba42,_0x172e10['options']);var _0x19e724={'where':_0x50ba42[_0x5fb0('0x51')]};return db[_0x5fb0('0x54')][_0x5fb0('0x35')](_0x19e724)[_0x5fb0('0x23')](function(_0xbd9fa1){_0x4e4179['count']=_0xbd9fa1;if(_0x172e10[_0x5fb0('0x48')][_0x5fb0('0x55')]){_0x50ba42[_0x5fb0('0x56')]=[{'all':!![]}];}return db[_0x5fb0('0x54')][_0x5fb0('0x57')](_0x50ba42);})[_0x5fb0('0x23')](function(_0x4ce09a){_0x4e4179[_0x5fb0('0x58')]=_0x4ce09a;return _0x4e4179;})[_0x5fb0('0x23')](respondWithFilteredResult(_0x3d560e,_0x50ba42))[_0x5fb0('0x2e')](handleError(_0x3d560e,null));};exports[_0x5fb0('0x59')]=function(_0x2b66e3,_0x3e166f){var _0x2a9c56={'raw':!![],'where':{'id':_0x2b66e3[_0x5fb0('0x5a')]['id']}},_0x39d2ea={};_0x39d2ea[_0x5fb0('0x4c')]=_[_0x5fb0('0x47')](db[_0x5fb0('0x54')]['rawAttributes']);_0x39d2ea[_0x5fb0('0x48')]=_[_0x5fb0('0x47')](_0x2b66e3[_0x5fb0('0x48')]);_0x39d2ea['filters']=_[_0x5fb0('0x4a')](_0x39d2ea[_0x5fb0('0x4c')],_0x39d2ea[_0x5fb0('0x48')]);_0x2a9c56[_0x5fb0('0x4b')]=_['intersection'](_0x39d2ea['model'],qs[_0x5fb0('0x4d')](_0x2b66e3['query'][_0x5fb0('0x4d')]));_0x2a9c56[_0x5fb0('0x4b')]=_0x2a9c56[_0x5fb0('0x4b')][_0x5fb0('0x5b')]?_0x2a9c56['attributes']:_0x39d2ea[_0x5fb0('0x4c')];if(_0x2b66e3['query'][_0x5fb0('0x55')]){_0x2a9c56['include']=[{'all':!![]}];}_0x2a9c56=_[_0x5fb0('0x52')]({},_0x2a9c56,_0x2b66e3[_0x5fb0('0x5c')]);return db[_0x5fb0('0x54')][_0x5fb0('0x5d')](_0x2a9c56)['then'](handleEntityNotFound(_0x3e166f,null))[_0x5fb0('0x23')](respondWithResult(_0x3e166f,null))[_0x5fb0('0x2e')](handleError(_0x3e166f,null));};exports[_0x5fb0('0x5e')]=function(_0x4cf321,_0x5dfa2b){return db[_0x5fb0('0x54')][_0x5fb0('0x5e')](_0x4cf321[_0x5fb0('0x5f')],{})['then'](function(_0x65a6bb){var _0x2d3b73=_0x4cf321[_0x5fb0('0x60')][_0x5fb0('0x3c')]({'plain':!![]});if(!_0x2d3b73)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d3b73['role']===_0x5fb0('0x60')){var _0xcfe4c9=_0x65a6bb[_0x5fb0('0x3c')]({'plain':!![]});var _0x493f18=_0x5fb0('0x3d');return db[_0x5fb0('0x61')][_0x5fb0('0x5d')]({'where':{'name':_0x493f18,'userProfileId':_0x2d3b73[_0x5fb0('0x62')]},'raw':!![]})[_0x5fb0('0x23')](function(_0x50cf96){if(_0x50cf96&&_0x50cf96[_0x5fb0('0x63')]===0x0){return db[_0x5fb0('0x3e')]['create']({'name':_0xcfe4c9[_0x5fb0('0x41')],'resourceId':_0xcfe4c9['id'],'type':_0x50cf96[_0x5fb0('0x41')],'sectionId':_0x50cf96['id']},{})[_0x5fb0('0x23')](function(){return _0x65a6bb;});}else{return _0x65a6bb;}})[_0x5fb0('0x2e')](function(_0x2751ac){logger['error'](_0x5fb0('0x64'),_0x2751ac);throw _0x2751ac;});}return _0x65a6bb;})[_0x5fb0('0x23')](respondWithResult(_0x5dfa2b,0xc9))[_0x5fb0('0x2e')](handleError(_0x5dfa2b,null));};exports['update']=function(_0x3f725e,_0x11ab29){if(_0x3f725e[_0x5fb0('0x5f')]['id']){delete _0x3f725e[_0x5fb0('0x5f')]['id'];}return db[_0x5fb0('0x54')][_0x5fb0('0x5d')]({'where':{'id':_0x3f725e['params']['id']}})[_0x5fb0('0x23')](handleEntityNotFound(_0x11ab29,null))[_0x5fb0('0x23')](saveUpdates(_0x3f725e['body'],null))[_0x5fb0('0x23')](respondWithResult(_0x11ab29,null))[_0x5fb0('0x2e')](handleError(_0x11ab29,null));};exports['destroy']=function(_0x2b424a,_0x39562a){return db['ChatQueue'][_0x5fb0('0x5d')]({'where':{'id':_0x2b424a[_0x5fb0('0x5a')]['id']}})[_0x5fb0('0x23')](handleEntityNotFound(_0x39562a,null))[_0x5fb0('0x23')](removeEntity(_0x39562a,null))['catch'](handleError(_0x39562a,null));};exports[_0x5fb0('0x65')]=function(_0x4c8ea2,_0x1b3d45){return db[_0x5fb0('0x54')][_0x5fb0('0x65')]()['then'](respondWithResult(_0x1b3d45,null))[_0x5fb0('0x2e')](handleError(_0x1b3d45,null));};exports[_0x5fb0('0x66')]=function(_0x13c236,_0x21daa9,_0x129a49){var _0x5b5ae2={'raw':!![],'where':{}},_0x2bf2a8={},_0x2efdc9;return db[_0x5fb0('0x54')][_0x5fb0('0x67')]({'where':{'id':_0x13c236[_0x5fb0('0x5a')]['id']}})['then'](handleEntityNotFound(_0x21daa9,null))['then'](function(_0x58a303){if(_0x58a303){_0x2efdc9=_0x58a303[_0x5fb0('0x3c')]({'plain':!![]});_0x2bf2a8[_0x5fb0('0x4c')]=_[_0x5fb0('0x47')](db['UserChatQueue'][_0x5fb0('0x68')]);_0x2bf2a8[_0x5fb0('0x48')]=_['keys'](_0x13c236[_0x5fb0('0x48')]);_0x2bf2a8['filters']=_[_0x5fb0('0x4a')](_0x2bf2a8['model'],_0x2bf2a8[_0x5fb0('0x48')]);_0x5b5ae2[_0x5fb0('0x4b')]=_[_0x5fb0('0x4a')](_0x2bf2a8[_0x5fb0('0x4c')],qs[_0x5fb0('0x4d')](_0x13c236[_0x5fb0('0x48')][_0x5fb0('0x4d')]));_0x5b5ae2['attributes']=_0x5b5ae2[_0x5fb0('0x4b')]['length']?_0x5b5ae2[_0x5fb0('0x4b')]:_0x2bf2a8[_0x5fb0('0x4c')];if(!_0x13c236['query'][_0x5fb0('0x4e')]('nolimit')){_0x5b5ae2[_0x5fb0('0x34')]=qs[_0x5fb0('0x34')](_0x13c236[_0x5fb0('0x48')]['limit']);_0x5b5ae2['offset']=qs['offset'](_0x13c236[_0x5fb0('0x48')][_0x5fb0('0x32')]);}_0x5b5ae2[_0x5fb0('0x69')]=qs[_0x5fb0('0x6a')](_0x13c236['query'][_0x5fb0('0x6a')]);_0x5b5ae2[_0x5fb0('0x51')]=qs['filters'](_[_0x5fb0('0x6b')](_0x13c236[_0x5fb0('0x48')],_0x2bf2a8[_0x5fb0('0x49')]));_0x5b5ae2[_0x5fb0('0x51')]['ChatQueueId']=_0x58a303['id'];if(_0x13c236['query']['filter']){_0x5b5ae2[_0x5fb0('0x51')]=_[_0x5fb0('0x52')](_0x5b5ae2[_0x5fb0('0x51')],{'$or':_[_0x5fb0('0x43')](_0x5b5ae2['attributes'],function(_0x4683e6){var _0x1819ef={};_0x1819ef[_0x4683e6]={'$like':'%'+_0x13c236['query'][_0x5fb0('0x50')]+'%'};return _0x1819ef;})});}_0x5b5ae2=_[_0x5fb0('0x52')]({},_0x5b5ae2,_0x13c236[_0x5fb0('0x5c')]);return db[_0x5fb0('0x6c')][_0x5fb0('0x57')](_0x5b5ae2);}})['then'](function(_0x2855ec){if(_0x2855ec){return db[_0x5fb0('0x6d')][_0x5fb0('0x6e')]({'where':{'id':_[_0x5fb0('0x43')](_0x2855ec,_0x5fb0('0x6f')),'role':_0x5fb0('0x70')},'attributes':['id','name',_0x5fb0('0x71'),_0x5fb0('0x72'),_0x5fb0('0x73')]});}})[_0x5fb0('0x23')](function(_0x368b06){if(_0x368b06){return{'count':_0x368b06['count'],'rows':_['map'](_0x368b06[_0x5fb0('0x58')],function(_0x568922){return{'membername':_0x568922['name'],'UserId':_0x568922['id'],'queue_name':_0x2efdc9[_0x5fb0('0x41')],'ChatQueueId':_0x2efdc9['id'],'interface':util[_0x5fb0('0x74')](_0x5fb0('0x75'),_0x5fb0('0x76'),_0x568922[_0x5fb0('0x41')]),'penalty':0x0,'paused':_0x568922[_0x5fb0('0x71')],'createdAt':_0x568922[_0x5fb0('0x73')],'updatedAt':_0x568922[_0x5fb0('0x72')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5fb0('0x23')](respondWithFilteredResult(_0x21daa9,_0x5b5ae2))[_0x5fb0('0x2e')](handleError(_0x21daa9,null));};exports[_0x5fb0('0x77')]=function(_0x442a1c,_0x2387a8,_0xfe8ed1){var _0x316490={};var _0x33c859={};var _0x302744;var _0x5e94fd;return db[_0x5fb0('0x54')][_0x5fb0('0x67')]({'where':{'id':_0x442a1c[_0x5fb0('0x5a')]['id']}})[_0x5fb0('0x23')](handleEntityNotFound(_0x2387a8,null))[_0x5fb0('0x23')](function(_0x54df3b){if(_0x54df3b){_0x302744=_0x54df3b;_0x33c859[_0x5fb0('0x4c')]=_[_0x5fb0('0x47')](db['Team']['rawAttributes']);_0x33c859[_0x5fb0('0x48')]=_[_0x5fb0('0x47')](_0x442a1c[_0x5fb0('0x48')]);_0x33c859['filters']=_[_0x5fb0('0x4a')](_0x33c859[_0x5fb0('0x4c')],_0x33c859[_0x5fb0('0x48')]);_0x316490[_0x5fb0('0x4b')]=_[_0x5fb0('0x4a')](_0x33c859[_0x5fb0('0x4c')],qs[_0x5fb0('0x4d')](_0x442a1c[_0x5fb0('0x48')][_0x5fb0('0x4d')]));_0x316490[_0x5fb0('0x4b')]=_0x316490[_0x5fb0('0x4b')][_0x5fb0('0x5b')]?_0x316490[_0x5fb0('0x4b')]:_0x33c859[_0x5fb0('0x4c')];_0x316490['order']=qs[_0x5fb0('0x6a')](_0x442a1c[_0x5fb0('0x48')][_0x5fb0('0x6a')]);_0x316490[_0x5fb0('0x51')]=qs['filters'](_[_0x5fb0('0x6b')](_0x442a1c[_0x5fb0('0x48')],_0x33c859[_0x5fb0('0x49')]));if(_0x442a1c[_0x5fb0('0x48')]['filter']){_0x316490[_0x5fb0('0x51')]=_[_0x5fb0('0x52')](_0x316490[_0x5fb0('0x51')],{'$or':_[_0x5fb0('0x43')](_0x316490['attributes'],function(_0x5b64f8){var _0x3b75ac={};_0x3b75ac[_0x5b64f8]={'$like':'%'+_0x442a1c[_0x5fb0('0x48')][_0x5fb0('0x50')]+'%'};return _0x3b75ac;})});}_0x316490=_['merge']({},_0x316490,_0x442a1c[_0x5fb0('0x5c')]);return _0x302744[_0x5fb0('0x77')](_0x316490);}})[_0x5fb0('0x23')](function(_0x3864b9){if(_0x3864b9){_0x5e94fd=_0x3864b9[_0x5fb0('0x5b')];if(!_0x442a1c['query'][_0x5fb0('0x4e')]('nolimit')){_0x316490['limit']=qs['limit'](_0x442a1c[_0x5fb0('0x48')][_0x5fb0('0x34')]);_0x316490[_0x5fb0('0x32')]=qs[_0x5fb0('0x32')](_0x442a1c['query'][_0x5fb0('0x32')]);}return _0x302744['getTeams'](_0x316490);}})['then'](function(_0x188060){if(_0x188060){return _0x188060?{'count':_0x5e94fd,'rows':_0x188060}:null;}})[_0x5fb0('0x23')](respondWithResult(_0x2387a8,null))['catch'](handleError(_0x2387a8,null));};exports[_0x5fb0('0x78')]=function(_0x5ef128,_0x5b1e79,_0x5ba705){var _0x9a0a44=_0x5ef128[_0x5fb0('0x5f')][_0x5fb0('0x79')];return db[_0x5fb0('0x7a')][_0x5fb0('0x57')]({'where':{'id':_0x9a0a44},'attributes':['id'],'include':[{'model':db[_0x5fb0('0x6d')],'as':_0x5fb0('0x7b'),'attributes':['id','name','online',_0x5fb0('0x7c'),_0x5fb0('0x7d')],'raw':!![]}]})['then'](function(_0x124206){if(_0x124206){var _0x4d6bd9=_['flatMap'](_0x124206,function(_0x116ab9){var _0x12dd90=_0x116ab9[_0x5fb0('0x3c')]({'plain':!![]});return _0x12dd90[_0x5fb0('0x7b')];});return db[_0x5fb0('0x54')][_0x5fb0('0x5d')]({'where':{'id':_0x5ef128[_0x5fb0('0x5a')]['id']}})[_0x5fb0('0x23')](function(_0x53e8d8){return db[_0x5fb0('0x7e')]['transaction'](function(_0x1ed0e8){return _0x53e8d8['addTeams'](_0x9a0a44,{'transaction':_0x1ed0e8})[_0x5fb0('0x23')](function(){return BPromise['each'](_0x4d6bd9,function(_0x304b12){return db[_0x5fb0('0x6c')][_0x5fb0('0x7f')]({'where':{'UserId':_0x304b12['id'],'ChatQueueId':_0x5ef128[_0x5fb0('0x5a')]['id']},'transaction':_0x1ed0e8});});})['then'](function(){_0x4d6bd9[_0x5fb0('0x80')](function(_0x3e736e){socket[_0x5fb0('0x81')](_0x5fb0('0x82'),{'UserId':_0x3e736e['id'],'ChatQueueId':_0x53e8d8['id']});});});});});}})[_0x5fb0('0x23')](respondWithStatusCode(_0x5b1e79,null))[_0x5fb0('0x2e')](handleError(_0x5b1e79,null));};exports[_0x5fb0('0x83')]=function(_0x18d03d,_0x383c70,_0x53658e){return db['Team'][_0x5fb0('0x57')]({'where':{'id':_0x18d03d[_0x5fb0('0x48')][_0x5fb0('0x79')]},'attributes':['id'],'include':[{'model':db[_0x5fb0('0x6d')],'as':_0x5fb0('0x7b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x383c70,null))[_0x5fb0('0x23')](function(_0x154405){var _0x39474a=_[_0x5fb0('0x43')](_0x154405,'id');var _0x3c7d83=[];var _0x1b2c3b=[];var _0x541c87=squel['select']();_0x541c87[_0x5fb0('0x84')](_0x5fb0('0x85'))[_0x5fb0('0x86')](_0x5fb0('0x87'),'tq')[_0x5fb0('0x88')](_0x5fb0('0x89'),'ut',_0x5fb0('0x8a'))['where'](_0x5fb0('0x8b'),_0x18d03d[_0x5fb0('0x5a')]['id']);for(var _0x109c4c=0x0;_0x109c4c<_0x154405[_0x5fb0('0x5b')];_0x109c4c+=0x1){let _0x17eb76=_0x154405[_0x109c4c];for(var _0x23430d=0x0;_0x23430d<_0x17eb76[_0x5fb0('0x7b')]['length'];_0x23430d+=0x1){let _0x59da6c=_0x17eb76[_0x5fb0('0x7b')][_0x23430d];var _0xc2dd00=_0x541c87[_0x5fb0('0x8c')]();_0xc2dd00[_0x5fb0('0x51')]('ut.UserId\x20=\x20?',_0x59da6c['id']);_0x1b2c3b[_0x5fb0('0x8d')](db[_0x5fb0('0x7e')]['query'](_0xc2dd00[_0x5fb0('0x8e')](),{'type':db[_0x5fb0('0x7e')][_0x5fb0('0x8f')][_0x5fb0('0x90')]})['then'](function(_0x506314){if(_0x506314[_0x5fb0('0x5b')]===0x1){return _0x59da6c['id'];}else{var _0x42f07e=_[_0x5fb0('0x91')](_[_0x5fb0('0x43')](_0x506314,_0x5fb0('0x92')),function(_0x177b28){return _['includes'](_0x39474a,_0x177b28);});if(_0x42f07e){return _0x59da6c['id'];}}}));}}return BPromise['all'](_0x1b2c3b)[_0x5fb0('0x23')](function(_0x47152c){_0x3c7d83=_(_0x3c7d83)[_0x5fb0('0x93')](_0x47152c)[_0x5fb0('0x94')]()[_0x5fb0('0x95')]();return db['ChatQueue'][_0x5fb0('0x5d')]({'where':{'id':_0x18d03d['params']['id']}})[_0x5fb0('0x23')](function(_0x1efe8f){return db[_0x5fb0('0x7e')][_0x5fb0('0x96')](function(_0x2449a7){return _0x1efe8f['removeTeams'](_0x18d03d[_0x5fb0('0x48')][_0x5fb0('0x79')],{'transaction':_0x2449a7})['then'](function(){if(!_[_0x5fb0('0x97')](_0x3c7d83)){return _0x1efe8f[_0x5fb0('0x98')](_0x3c7d83,{'transaction':_0x2449a7});}})[_0x5fb0('0x23')](function(){_0x3c7d83[_0x5fb0('0x80')](function(_0x2d919a){socket[_0x5fb0('0x81')]('userChatQueue:remove',{'UserId':_0x2d919a,'ChatQueueId':_0x1efe8f['id']});});});});});});})['then'](respondWithStatusCode(_0x383c70,null))[_0x5fb0('0x2e')](handleError(_0x383c70,null));};exports[_0x5fb0('0x99')]=function(_0x406c7b,_0x14c57c,_0x37d66d){return db[_0x5fb0('0x54')][_0x5fb0('0x5d')]({'where':{'id':_0x406c7b[_0x5fb0('0x5a')]['id']}})[_0x5fb0('0x23')](handleEntityNotFound(_0x14c57c,null))[_0x5fb0('0x23')](function(_0x587ab2){if(_0x587ab2){return _0x587ab2[_0x5fb0('0x99')](_0x406c7b[_0x5fb0('0x5f')]['ids'],_['omit'](_0x406c7b[_0x5fb0('0x5f')],['ids','id'])||{})[_0x5fb0('0x9a')](function(_0x573e17){for(var _0x3edc18=0x0;_0x3edc18<_0x406c7b[_0x5fb0('0x5f')][_0x5fb0('0x79')][_0x5fb0('0x5b')];_0x3edc18+=0x1){socket[_0x5fb0('0x81')](_0x5fb0('0x82'),{'UserId':Number(_0x406c7b[_0x5fb0('0x5f')][_0x5fb0('0x79')][_0x3edc18]),'ChatQueueId':Number(_0x406c7b['params']['id'])});}return _0x573e17;});}})[_0x5fb0('0x23')](respondWithResult(_0x14c57c,null))[_0x5fb0('0x2e')](handleError(_0x14c57c,null));};exports[_0x5fb0('0x98')]=function(_0x78102b,_0x40d77e,_0x4437dc){return db[_0x5fb0('0x54')][_0x5fb0('0x5d')]({'where':{'id':_0x78102b['params']['id']}})[_0x5fb0('0x23')](handleEntityNotFound(_0x40d77e,null))[_0x5fb0('0x23')](function(_0x4b5a34){if(_0x4b5a34){return _0x4b5a34[_0x5fb0('0x98')](_0x78102b['query'][_0x5fb0('0x79')])[_0x5fb0('0x23')](function(){if(_[_0x5fb0('0x9b')](_0x78102b[_0x5fb0('0x48')][_0x5fb0('0x79')])){for(var _0x16abf4=0x0;_0x16abf4<_0x78102b[_0x5fb0('0x48')][_0x5fb0('0x79')][_0x5fb0('0x5b')];_0x16abf4+=0x1){socket['emit'](_0x5fb0('0x9c'),{'UserId':Number(_0x78102b[_0x5fb0('0x48')][_0x5fb0('0x79')][_0x16abf4]),'ChatQueueId':Number(_0x78102b['params']['id'])});}}else{socket['emit'](_0x5fb0('0x9c'),{'UserId':Number(_0x78102b['query'][_0x5fb0('0x79')]),'ChatQueueId':Number(_0x78102b[_0x5fb0('0x5a')]['id'])});}});}})[_0x5fb0('0x23')](respondWithStatusCode(_0x40d77e,null))[_0x5fb0('0x2e')](handleError(_0x40d77e,null));};exports[_0x5fb0('0x9d')]=function(_0x169d4c,_0x1dc4d8,_0x5a82a4){var _0x497538={};var _0x5a90fd={};var _0x1de1d9;var _0x2f26b3;return db['ChatQueue'][_0x5fb0('0x67')]({'where':{'id':_0x169d4c['params']['id']}})[_0x5fb0('0x23')](handleEntityNotFound(_0x1dc4d8,null))[_0x5fb0('0x23')](function(_0x5aa335){if(_0x5aa335){_0x1de1d9=_0x5aa335;_0x5a90fd[_0x5fb0('0x4c')]=_[_0x5fb0('0x47')](db['User'][_0x5fb0('0x68')]);_0x5a90fd[_0x5fb0('0x48')]=_[_0x5fb0('0x47')](_0x169d4c[_0x5fb0('0x48')]);_0x5a90fd[_0x5fb0('0x49')]=_['intersection'](_0x5a90fd[_0x5fb0('0x4c')],_0x5a90fd['query']);_0x497538[_0x5fb0('0x4b')]=_['intersection'](_0x5a90fd['model'],qs[_0x5fb0('0x4d')](_0x169d4c['query']['fields']));_0x497538[_0x5fb0('0x4b')]=_0x497538[_0x5fb0('0x4b')][_0x5fb0('0x5b')]?_0x497538[_0x5fb0('0x4b')]:_0x5a90fd[_0x5fb0('0x4c')];_0x497538[_0x5fb0('0x69')]=qs[_0x5fb0('0x6a')](_0x169d4c[_0x5fb0('0x48')]['sort']);_0x497538[_0x5fb0('0x51')]=qs['filters'](_[_0x5fb0('0x6b')](_0x169d4c[_0x5fb0('0x48')],_0x5a90fd[_0x5fb0('0x49')]));if(_0x169d4c[_0x5fb0('0x48')][_0x5fb0('0x50')]){_0x497538[_0x5fb0('0x51')]=_[_0x5fb0('0x52')](_0x497538[_0x5fb0('0x51')],{'$or':_[_0x5fb0('0x43')](_0x497538[_0x5fb0('0x4b')],function(_0x4606fc){var _0x29f5e3={};_0x29f5e3[_0x4606fc]={'$like':'%'+_0x169d4c[_0x5fb0('0x48')][_0x5fb0('0x50')]+'%'};return _0x29f5e3;})});}_0x497538=_[_0x5fb0('0x52')]({},_0x497538,_0x169d4c[_0x5fb0('0x5c')]);return _0x1de1d9[_0x5fb0('0x9d')](_0x497538);}})[_0x5fb0('0x23')](function(_0x2beab2){if(_0x2beab2){_0x2f26b3=_0x2beab2[_0x5fb0('0x5b')];if(!_0x169d4c[_0x5fb0('0x48')][_0x5fb0('0x4e')](_0x5fb0('0x4f'))){_0x497538[_0x5fb0('0x34')]=qs['limit'](_0x169d4c[_0x5fb0('0x48')][_0x5fb0('0x34')]);_0x497538['offset']=qs[_0x5fb0('0x32')](_0x169d4c[_0x5fb0('0x48')][_0x5fb0('0x32')]);}return _0x1de1d9[_0x5fb0('0x9d')](_0x497538);}})[_0x5fb0('0x23')](function(_0x49c7b2){if(_0x49c7b2){return _0x49c7b2?{'count':_0x2f26b3,'rows':_0x49c7b2}:null;}})[_0x5fb0('0x23')](respondWithResult(_0x1dc4d8,null))[_0x5fb0('0x2e')](handleError(_0x1dc4d8,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 81ce422..5927aa9 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 _0x474f=['exports','events','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x474f,0xac));var _0xf474=function(_0x5725a0,_0x180d50){_0x5725a0=_0x5725a0-0x0;var _0x2eade4=_0x474f[_0x5725a0];return _0x2eade4;};'use strict';var EventEmitter=require(_0xf474('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xf474('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf474('0x2')](0x0);var events={'afterCreate':_0xf474('0x3'),'afterUpdate':_0xf474('0x4'),'afterDestroy':'remove'};function emitEvent(_0x509648){return function(_0x80bdac,_0x27fd05,_0x21e07f){ChatQueueEvents[_0xf474('0x5')](_0x509648+':'+_0x80bdac['id'],_0x80bdac);ChatQueueEvents[_0xf474('0x5')](_0x509648,_0x80bdac);_0x21e07f(null);};}for(var e in events){if(events[_0xf474('0x6')](e)){var event=events[e];ChatQueue[_0xf474('0x7')](e,emitEvent(event));}}module[_0xf474('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x293a=['events','ChatQueue','setMaxListeners','save','update','emit','hook','exports'];(function(_0x2cd0d8,_0x4fc59f){var _0x3c2198=function(_0x381b47){while(--_0x381b47){_0x2cd0d8['push'](_0x2cd0d8['shift']());}};_0x3c2198(++_0x4fc59f);}(_0x293a,0xc0));var _0xa293=function(_0x28762c,_0x2625e7){_0x28762c=_0x28762c-0x0;var _0x441a0b=_0x293a[_0x28762c];return _0x441a0b;};'use strict';var EventEmitter=require(_0xa293('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xa293('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa293('0x2')](0x0);var events={'afterCreate':_0xa293('0x3'),'afterUpdate':_0xa293('0x4'),'afterDestroy':'remove'};function emitEvent(_0x336c64){return function(_0x2a1474,_0x4271cd,_0x15eda9){ChatQueueEvents[_0xa293('0x5')](_0x336c64+':'+_0x2a1474['id'],_0x2a1474);ChatQueueEvents[_0xa293('0x5')](_0x336c64,_0x2a1474);_0x15eda9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xa293('0x6')](e,emitEvent(event));}}module[_0xa293('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 e978a0a..84e250b 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 _0x15f5=['chat_queues','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue'];(function(_0x4d1875,_0x5041fb){var _0x4f8f5c=function(_0x2ec54c){while(--_0x2ec54c){_0x4d1875['push'](_0x4d1875['shift']());}};_0x4f8f5c(++_0x5041fb);}(_0x15f5,0xbc));var _0x515f=function(_0x5b78e3,_0x3c5de6){_0x5b78e3=_0x5b78e3-0x0;var _0x55ff10=_0x15f5[_0x5b78e3];return _0x55ff10;};'use strict';var _=require(_0x515f('0x0'));var util=require(_0x515f('0x1'));var logger=require('../../config/logger')(_0x515f('0x2'));var moment=require('moment');var BPromise=require(_0x515f('0x3'));var rp=require(_0x515f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x515f('0x5'));var config=require(_0x515f('0x6'));var attributes=require(_0x515f('0x7'));module[_0x515f('0x8')]=function(_0x240f83,_0x27f22d){return _0x240f83['define'](_0x515f('0x9'),attributes,{'tableName':_0x515f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4c53=['rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c53,0x1c9));var _0x34c5=function(_0x3f7de7,_0x3d6dda){_0x3f7de7=_0x3f7de7-0x0;var _0x5c5652=_0x4c53[_0x3f7de7];return _0x5c5652;};'use strict';var _=require(_0x34c5('0x0'));var util=require(_0x34c5('0x1'));var logger=require(_0x34c5('0x2'))(_0x34c5('0x3'));var moment=require(_0x34c5('0x4'));var BPromise=require(_0x34c5('0x5'));var rp=require(_0x34c5('0x6'));var fs=require('fs');var path=require(_0x34c5('0x7'));var rimraf=require(_0x34c5('0x8'));var config=require(_0x34c5('0x9'));var attributes=require(_0x34c5('0xa'));module[_0x34c5('0xb')]=function(_0x233eb3,_0x35599c){return _0x233eb3[_0x34c5('0xc')](_0x34c5('0xd'),attributes,{'tableName':_0x34c5('0xe'),'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 dbc3675..644e14c 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 _0xc8ac=['./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults'];(function(_0xb2c134,_0x3eca93){var _0x120bac=function(_0x261e15){while(--_0x261e15){_0xb2c134['push'](_0xb2c134['shift']());}};_0x120bac(++_0x3eca93);}(_0xc8ac,0xe9));var _0xcc8a=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0xc8ac[_0x184759];return _0xf26d5f;};'use strict';var _=require(_0xcc8a('0x0'));var util=require(_0xcc8a('0x1'));var moment=require(_0xcc8a('0x2'));var BPromise=require(_0xcc8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc8a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc8a('0x5'));var logger=require(_0xcc8a('0x6'))(_0xcc8a('0x7'));var config=require(_0xcc8a('0x8'));var jayson=require(_0xcc8a('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xcc8a('0xa')]=_[_0xcc8a('0xb')](config[_0xcc8a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc8a('0xa')]));require(_0xcc8a('0xc'))['register'](socket);function respondWithRpcPromise(_0x3fa245,_0x34f02f,_0x510c1d){return new BPromise(function(_0x2c5025,_0x4e175e){return client['request'](_0x3fa245,_0x510c1d)[_0xcc8a('0xd')](function(_0x186896){logger[_0xcc8a('0xe')](_0xcc8a('0xf'),_0x34f02f,_0xcc8a('0x10'));logger[_0xcc8a('0x11')](_0xcc8a('0x12'),_0x34f02f,_0xcc8a('0x10'),JSON[_0xcc8a('0x13')](_0x186896));if(_0x186896[_0xcc8a('0x14')]){if(_0x186896[_0xcc8a('0x14')]['code']===0x1f4){logger[_0xcc8a('0x14')](_0xcc8a('0xf'),_0x34f02f,_0x186896[_0xcc8a('0x14')][_0xcc8a('0x15')]);return _0x4e175e(_0x186896[_0xcc8a('0x14')][_0xcc8a('0x15')]);}logger['error'](_0xcc8a('0xf'),_0x34f02f,_0x186896[_0xcc8a('0x14')][_0xcc8a('0x15')]);return _0x2c5025(_0x186896[_0xcc8a('0x14')][_0xcc8a('0x15')]);}else{logger[_0xcc8a('0xe')](_0xcc8a('0xf'),_0x34f02f,'request\x20sent');_0x2c5025(_0x186896['result'][_0xcc8a('0x15')]);}})[_0xcc8a('0x16')](function(_0x20c29f){logger[_0xcc8a('0x14')]('ChatQueue,\x20%s,\x20%s',_0x34f02f,_0x20c29f);_0x4e175e(_0x20c29f);});});}exports[_0xcc8a('0x17')]=function(_0x4dad7b){var _0x471f1d=this;return new Promise(function(_0x3a2e3d,_0xa76ad9){return db['ChatQueue'][_0xcc8a('0x18')]({'raw':_0x4dad7b[_0xcc8a('0x19')]?_0x4dad7b['options'][_0xcc8a('0x1a')]===undefined?!![]:![]:!![],'where':_0x4dad7b[_0xcc8a('0x19')]?_0x4dad7b[_0xcc8a('0x19')][_0xcc8a('0x1b')]||null:null,'attributes':_0x4dad7b[_0xcc8a('0x19')]?_0x4dad7b['options'][_0xcc8a('0x1c')]||null:null,'limit':_0x4dad7b[_0xcc8a('0x19')]?_0x4dad7b['options'][_0xcc8a('0x1d')]||null:null,'include':_0x4dad7b[_0xcc8a('0x19')]?_0x4dad7b['options'][_0xcc8a('0x1e')]?_[_0xcc8a('0x1f')](_0x4dad7b[_0xcc8a('0x19')][_0xcc8a('0x1e')],function(_0x221841){return{'model':db[_0x221841[_0xcc8a('0x20')]],'as':_0x221841['as'],'attributes':_0x221841[_0xcc8a('0x1c')],'include':_0x221841[_0xcc8a('0x1e')]?_[_0xcc8a('0x1f')](_0x221841[_0xcc8a('0x1e')],function(_0x338351){return{'model':db[_0x338351[_0xcc8a('0x20')]],'as':_0x338351['as'],'attributes':_0x338351['attributes'],'include':_0x338351[_0xcc8a('0x1e')]?_[_0xcc8a('0x1f')](_0x338351['include'],function(_0x41271f){return{'model':db[_0x41271f[_0xcc8a('0x20')]],'as':_0x41271f['as'],'attributes':_0x41271f[_0xcc8a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcc8a('0xd')](function(_0x581ae8){logger[_0xcc8a('0xe')](_0xcc8a('0x17'),_0x4dad7b);logger[_0xcc8a('0x11')](_0xcc8a('0x17'),_0x4dad7b,JSON[_0xcc8a('0x13')](_0x581ae8));_0x3a2e3d(_0x581ae8);})[_0xcc8a('0x16')](function(_0x2a877f){logger[_0xcc8a('0x14')]('GetChatQueue',_0x2a877f['message'],_0x4dad7b);_0xa76ad9(_0x471f1d[_0xcc8a('0x14')](0x1f4,_0x2a877f['message']));});});};exports[_0xcc8a('0x21')]=function(_0x3629c1){var _0x59ff46=this;return new Promise(function(_0x14dbee,_0x5c19b0){return db['ChatQueue'][_0xcc8a('0x22')]({'raw':_0x3629c1[_0xcc8a('0x19')]?_0x3629c1[_0xcc8a('0x19')][_0xcc8a('0x1a')]===undefined?!![]:![]:!![],'where':_0x3629c1['options']?_0x3629c1['options'][_0xcc8a('0x1b')]||null:null,'attributes':_0x3629c1[_0xcc8a('0x19')]?_0x3629c1[_0xcc8a('0x19')][_0xcc8a('0x1c')]||null:null,'include':_0x3629c1[_0xcc8a('0x19')]?_0x3629c1[_0xcc8a('0x19')][_0xcc8a('0x1e')]?_[_0xcc8a('0x1f')](_0x3629c1[_0xcc8a('0x19')][_0xcc8a('0x1e')],function(_0x36125f){return{'model':db[_0x36125f[_0xcc8a('0x20')]],'as':_0x36125f['as'],'attributes':_0x36125f['attributes'],'include':_0x36125f[_0xcc8a('0x1e')]?_[_0xcc8a('0x1f')](_0x36125f[_0xcc8a('0x1e')],function(_0x5df806){return{'model':db[_0x5df806[_0xcc8a('0x20')]],'as':_0x5df806['as'],'attributes':_0x5df806['attributes'],'include':_0x5df806['include']?_[_0xcc8a('0x1f')](_0x5df806['include'],function(_0x46a22d){return{'model':db[_0x46a22d[_0xcc8a('0x20')]],'as':_0x46a22d['as'],'attributes':_0x46a22d[_0xcc8a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcc8a('0xd')](function(_0x20390c){logger['info'](_0xcc8a('0x21'),_0x3629c1);logger[_0xcc8a('0x11')](_0xcc8a('0x21'),_0x3629c1,JSON[_0xcc8a('0x13')](_0x20390c));_0x14dbee(_0x20390c);})['catch'](function(_0x5e1174){logger[_0xcc8a('0x14')]('ShowChatQueue',_0x5e1174['message'],_0x3629c1);_0x5c19b0(_0x59ff46['error'](0x1f4,_0x5e1174['message']));});});};
\ No newline at end of file
+var _0x48bc=['raw','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ChatQueue','findAll','options'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0x48bc,0x1b6));var _0xc48b=function(_0x38ddec,_0x2ed54a){_0x38ddec=_0x38ddec-0x0;var _0x4bbfe=_0x48bc[_0x38ddec];return _0x4bbfe;};'use strict';var _=require(_0xc48b('0x0'));var util=require(_0xc48b('0x1'));var moment=require(_0xc48b('0x2'));var BPromise=require('bluebird');var rs=require(_0xc48b('0x3'));var fs=require('fs');var Redis=require(_0xc48b('0x4'));var db=require(_0xc48b('0x5'))['db'];var utils=require(_0xc48b('0x6'));var logger=require(_0xc48b('0x7'))(_0xc48b('0x8'));var config=require(_0xc48b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc48b('0xa')]['http']({'port':0x232a});config[_0xc48b('0xb')]=_[_0xc48b('0xc')](config['redis'],{'host':_0xc48b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc48b('0xb')]));require(_0xc48b('0xe'))['register'](socket);function respondWithRpcPromise(_0x2c0429,_0x3fcb54,_0xdea695){return new BPromise(function(_0x441e2c,_0x111e61){return client[_0xc48b('0xf')](_0x2c0429,_0xdea695)[_0xc48b('0x10')](function(_0x2fd6c7){logger[_0xc48b('0x11')](_0xc48b('0x12'),_0x3fcb54,_0xc48b('0x13'));logger[_0xc48b('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3fcb54,_0xc48b('0x13'),JSON[_0xc48b('0x15')](_0x2fd6c7));if(_0x2fd6c7[_0xc48b('0x16')]){if(_0x2fd6c7['error'][_0xc48b('0x17')]===0x1f4){logger[_0xc48b('0x16')](_0xc48b('0x12'),_0x3fcb54,_0x2fd6c7[_0xc48b('0x16')][_0xc48b('0x18')]);return _0x111e61(_0x2fd6c7[_0xc48b('0x16')][_0xc48b('0x18')]);}logger[_0xc48b('0x16')]('ChatQueue,\x20%s,\x20%s',_0x3fcb54,_0x2fd6c7[_0xc48b('0x16')]['message']);return _0x441e2c(_0x2fd6c7['error'][_0xc48b('0x18')]);}else{logger['info'](_0xc48b('0x12'),_0x3fcb54,'request\x20sent');_0x441e2c(_0x2fd6c7[_0xc48b('0x19')]['message']);}})[_0xc48b('0x1a')](function(_0x3bfd75){logger[_0xc48b('0x16')]('ChatQueue,\x20%s,\x20%s',_0x3fcb54,_0x3bfd75);_0x111e61(_0x3bfd75);});});}exports['GetChatQueue']=function(_0x12b34f){var _0x4a2997=this;return new Promise(function(_0x1c139c,_0x104a2f){return db[_0xc48b('0x1b')][_0xc48b('0x1c')]({'raw':_0x12b34f[_0xc48b('0x1d')]?_0x12b34f[_0xc48b('0x1d')][_0xc48b('0x1e')]===undefined?!![]:![]:!![],'where':_0x12b34f[_0xc48b('0x1d')]?_0x12b34f[_0xc48b('0x1d')]['where']||null:null,'attributes':_0x12b34f[_0xc48b('0x1d')]?_0x12b34f[_0xc48b('0x1d')][_0xc48b('0x1f')]||null:null,'limit':_0x12b34f[_0xc48b('0x1d')]?_0x12b34f[_0xc48b('0x1d')][_0xc48b('0x20')]||null:null,'include':_0x12b34f[_0xc48b('0x1d')]?_0x12b34f[_0xc48b('0x1d')][_0xc48b('0x21')]?_[_0xc48b('0x22')](_0x12b34f[_0xc48b('0x1d')][_0xc48b('0x21')],function(_0x4a6a22){return{'model':db[_0x4a6a22[_0xc48b('0x23')]],'as':_0x4a6a22['as'],'attributes':_0x4a6a22[_0xc48b('0x1f')],'include':_0x4a6a22[_0xc48b('0x21')]?_[_0xc48b('0x22')](_0x4a6a22[_0xc48b('0x21')],function(_0x2b53a3){return{'model':db[_0x2b53a3[_0xc48b('0x23')]],'as':_0x2b53a3['as'],'attributes':_0x2b53a3['attributes'],'include':_0x2b53a3[_0xc48b('0x21')]?_['map'](_0x2b53a3['include'],function(_0x49916e){return{'model':db[_0x49916e[_0xc48b('0x23')]],'as':_0x49916e['as'],'attributes':_0x49916e[_0xc48b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc48b('0x10')](function(_0x3a65eb){logger[_0xc48b('0x11')]('GetChatQueue',_0x12b34f);logger['debug'](_0xc48b('0x24'),_0x12b34f,JSON[_0xc48b('0x15')](_0x3a65eb));_0x1c139c(_0x3a65eb);})['catch'](function(_0x31eaa0){logger[_0xc48b('0x16')](_0xc48b('0x24'),_0x31eaa0[_0xc48b('0x18')],_0x12b34f);_0x104a2f(_0x4a2997[_0xc48b('0x16')](0x1f4,_0x31eaa0[_0xc48b('0x18')]));});});};exports[_0xc48b('0x25')]=function(_0x72fe6e){var _0x2e82e5=this;return new Promise(function(_0x53735e,_0xc46482){return db[_0xc48b('0x1b')][_0xc48b('0x26')]({'raw':_0x72fe6e[_0xc48b('0x1d')]?_0x72fe6e[_0xc48b('0x1d')][_0xc48b('0x1e')]===undefined?!![]:![]:!![],'where':_0x72fe6e[_0xc48b('0x1d')]?_0x72fe6e[_0xc48b('0x1d')]['where']||null:null,'attributes':_0x72fe6e[_0xc48b('0x1d')]?_0x72fe6e[_0xc48b('0x1d')][_0xc48b('0x1f')]||null:null,'include':_0x72fe6e['options']?_0x72fe6e['options'][_0xc48b('0x21')]?_[_0xc48b('0x22')](_0x72fe6e[_0xc48b('0x1d')][_0xc48b('0x21')],function(_0x4ec91a){return{'model':db[_0x4ec91a[_0xc48b('0x23')]],'as':_0x4ec91a['as'],'attributes':_0x4ec91a[_0xc48b('0x1f')],'include':_0x4ec91a[_0xc48b('0x21')]?_[_0xc48b('0x22')](_0x4ec91a[_0xc48b('0x21')],function(_0x591b4f){return{'model':db[_0x591b4f[_0xc48b('0x23')]],'as':_0x591b4f['as'],'attributes':_0x591b4f['attributes'],'include':_0x591b4f[_0xc48b('0x21')]?_[_0xc48b('0x22')](_0x591b4f[_0xc48b('0x21')],function(_0x513b99){return{'model':db[_0x513b99[_0xc48b('0x23')]],'as':_0x513b99['as'],'attributes':_0x513b99[_0xc48b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc48b('0x10')](function(_0x35d211){logger[_0xc48b('0x11')](_0xc48b('0x25'),_0x72fe6e);logger[_0xc48b('0x14')](_0xc48b('0x25'),_0x72fe6e,JSON['stringify'](_0x35d211));_0x53735e(_0x35d211);})[_0xc48b('0x1a')](function(_0x378b6f){logger[_0xc48b('0x16')](_0xc48b('0x25'),_0x378b6f[_0xc48b('0x18')],_0x72fe6e);_0xc46482(_0x2e82e5[_0xc48b('0x16')](0x1f4,_0x378b6f['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index c78c1e2..01ca4a4 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 _0x1cc7=['remove','emit','length','chatQueue:','./chatQueue.events','save'];(function(_0x44f773,_0xcb2147){var _0x517341=function(_0x3dbb3f){while(--_0x3dbb3f){_0x44f773['push'](_0x44f773['shift']());}};_0x517341(++_0xcb2147);}(_0x1cc7,0x15a));var _0x71cc=function(_0x25b189,_0x566220){_0x25b189=_0x25b189-0x0;var _0x4f0763=_0x1cc7[_0x25b189];return _0x4f0763;};'use strict';var ChatQueueEvents=require(_0x71cc('0x0'));var events=[_0x71cc('0x1'),_0x71cc('0x2'),'update'];function createListener(_0x4db9cd,_0x547fe6){return function(_0xe5d54e){_0x547fe6[_0x71cc('0x3')](_0x4db9cd,_0xe5d54e);};}function removeListener(_0x402191,_0x5431e1){return function(){ChatQueueEvents['removeListener'](_0x402191,_0x5431e1);};}exports['register']=function(_0x27a175){for(var _0x4ecf81=0x0,_0xc0444e=events[_0x71cc('0x4')];_0x4ecf81<_0xc0444e;_0x4ecf81++){var _0x4039ce=events[_0x4ecf81];var _0x2e70f0=createListener(_0x71cc('0x5')+_0x4039ce,_0x27a175);ChatQueueEvents['on'](_0x4039ce,_0x2e70f0);}};
\ No newline at end of file
+var _0x0ba7=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','remove','update'];(function(_0x287677,_0x1ec76e){var _0xb540eb=function(_0x243ea9){while(--_0x243ea9){_0x287677['push'](_0x287677['shift']());}};_0xb540eb(++_0x1ec76e);}(_0x0ba7,0x16d));var _0x70ba=function(_0x172dc2,_0x3eaa59){_0x172dc2=_0x172dc2-0x0;var _0x1dc2bc=_0x0ba7[_0x172dc2];return _0x1dc2bc;};'use strict';var ChatQueueEvents=require(_0x70ba('0x0'));var events=['save',_0x70ba('0x1'),_0x70ba('0x2')];function createListener(_0xadfc69,_0x42d93c){return function(_0x5e5368){_0x42d93c[_0x70ba('0x3')](_0xadfc69,_0x5e5368);};}function removeListener(_0x3e20ab,_0x3cb2e3){return function(){ChatQueueEvents[_0x70ba('0x4')](_0x3e20ab,_0x3cb2e3);};}exports[_0x70ba('0x5')]=function(_0x3f9877){for(var _0x17a00c=0x0,_0x2d5a16=events[_0x70ba('0x6')];_0x17a00c<_0x2d5a16;_0x17a00c++){var _0x1185cb=events[_0x17a00c];var _0x1a968b=createListener(_0x70ba('0x7')+_0x1185cb,_0x3f9877);ChatQueueEvents['on'](_0x1185cb,_0x1a968b);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 8741f69..814c9ac 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x321d22,_0x350ec3){var _0x3d360c=function(_0x1b0b1b){while(--_0x1b0b1b){_0x321d22['push'](_0x321d22['shift']());}};_0x3d360c(++_0x350ec3);}(_0xe14b,0x93));var _0xbe14=function(_0x2a5ac2,_0x36db10){_0x2a5ac2=_0x2a5ac2-0x0;var _0x25c649=_0xe14b[_0x2a5ac2];return _0x25c649;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x326cb7,_0x3d8ee7){var _0x27788f=function(_0x53d408){while(--_0x53d408){_0x326cb7['push'](_0x326cb7['shift']());}};_0x27788f(++_0x3d8ee7);}(_0x008c,0x188));var _0xc008=function(_0x21c8a9,_0x5687f4){_0x21c8a9=_0x21c8a9-0x0;var _0x1f8a72=_0x008c[_0x21c8a9];return _0x1f8a72;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 84f44e5..73896bf 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 _0xfcd2=['DATE','exports','STRING'];(function(_0x4cf23f,_0x99878d){var _0x1ee7cd=function(_0x44c804){while(--_0x44c804){_0x4cf23f['push'](_0x4cf23f['shift']());}};_0x1ee7cd(++_0x99878d);}(_0xfcd2,0x1d8));var _0x2fcd=function(_0x33db4b,_0x1d8a35){_0x33db4b=_0x33db4b-0x0;var _0x1ad559=_0xfcd2[_0x33db4b];return _0x1ad559;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x2fcd('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2fcd('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2fcd('0x2')]},'exitAt':{'type':Sequelize[_0x2fcd('0x2')]},'reason':{'type':Sequelize[_0x2fcd('0x1')]}};
\ No newline at end of file
+var _0xcb36=['DATE','moment','sequelize','STRING'];(function(_0x2042b6,_0x511b0e){var _0x5519b7=function(_0x3792ea){while(--_0x3792ea){_0x2042b6['push'](_0x2042b6['shift']());}};_0x5519b7(++_0x511b0e);}(_0xcb36,0xe9));var _0x6cb3=function(_0x1ce89b,_0x41133a){_0x1ce89b=_0x1ce89b-0x0;var _0x355bc9=_0xcb36[_0x1ce89b];return _0x355bc9;};'use strict';var moment=require(_0x6cb3('0x0'));var Sequelize=require(_0x6cb3('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x6cb3('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6cb3('0x3')]},'acceptAt':{'type':Sequelize[_0x6cb3('0x3')]},'exitAt':{'type':Sequelize[_0x6cb3('0x3')]},'reason':{'type':Sequelize[_0x6cb3('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 4ce16d5..d327b59 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 _0xbd0e=['VIRTUAL','options','ChatQueueReport','findAll','rows','catch','show','keys','rawAttributes','fields','include','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','end','stack','name','send','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0xbd0e,0x187));var _0xebd0=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0xbd0e[_0x149ca0];return _0x56b6b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebd0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebd0('0x1'));var rp=require(_0xebd0('0x2'));var moment=require(_0xebd0('0x3'));var BPromise=require(_0xebd0('0x4'));var Mustache=require(_0xebd0('0x5'));var util=require(_0xebd0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xebd0('0x7'));var ejs=require(_0xebd0('0x8'));var fs=require('fs');var fs_extra=require(_0xebd0('0x9'));var _=require(_0xebd0('0xa'));var squel=require(_0xebd0('0xb'));var crypto=require(_0xebd0('0xc'));var jsforce=require(_0xebd0('0xd'));var deskjs=require(_0xebd0('0xe'));var toCsv=require(_0xebd0('0x7'));var querystring=require('querystring');var Papa=require(_0xebd0('0xf'));var Redis=require(_0xebd0('0x10'));var authService=require(_0xebd0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xebd0('0x12'));var hardwareService=require(_0xebd0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xebd0('0x14'));var config=require(_0xebd0('0x15'));var licenseUtil=require(_0xebd0('0x16'));var db=require(_0xebd0('0x17'))['db'];function respondWithStatusCode(_0xfbd0b7,_0x562df3){_0x562df3=_0x562df3||0xcc;return function(_0x464387){if(_0x464387){return _0xfbd0b7[_0xebd0('0x18')](_0x562df3);}return _0xfbd0b7[_0xebd0('0x19')](_0x562df3)['end']();};}function respondWithResult(_0x298300,_0x22c014){_0x22c014=_0x22c014||0xc8;return function(_0x3ad9ac){if(_0x3ad9ac){return _0x298300[_0xebd0('0x19')](_0x22c014)[_0xebd0('0x1a')](_0x3ad9ac);}};}function respondWithFilteredResult(_0x406cff,_0x2bf066){return function(_0x44822c){if(_0x44822c){var _0x25097c=typeof _0x2bf066[_0xebd0('0x1b')]===_0xebd0('0x1c')&&typeof _0x2bf066[_0xebd0('0x1d')]===_0xebd0('0x1c');var _0x20244d=_0x44822c[_0xebd0('0x1e')];var _0x4791b2=_0x25097c?0x0:_0x2bf066[_0xebd0('0x1b')];var _0x40b14d=_0x25097c?_0x44822c[_0xebd0('0x1e')]:_0x2bf066[_0xebd0('0x1b')]+_0x2bf066['limit'];var _0x37eff9;if(_0x40b14d>=_0x20244d){_0x40b14d=_0x20244d;_0x37eff9=0xc8;}else{_0x37eff9=0xce;}_0x406cff[_0xebd0('0x19')](_0x37eff9);return _0x406cff['set'](_0xebd0('0x1f'),_0x4791b2+'-'+_0x40b14d+'/'+_0x20244d)['json'](_0x44822c);}return null;};}function patchUpdates(_0x4720d5){return function(_0x197b2f){try{jsonpatch[_0xebd0('0x20')](_0x197b2f,_0x4720d5,!![]);}catch(_0x1827ae){return BPromise['reject'](_0x1827ae);}return _0x197b2f[_0xebd0('0x21')]();};}function saveUpdates(_0x4ad73a,_0x2970e7){return function(_0x2d2639){if(_0x2d2639){return _0x2d2639[_0xebd0('0x22')](_0x4ad73a)['then'](function(_0x234548){return _0x234548;});}return null;};}function removeEntity(_0x47fe4,_0x254979){return function(_0x507343){if(_0x507343){return _0x507343[_0xebd0('0x23')]()[_0xebd0('0x24')](function(){_0x47fe4[_0xebd0('0x19')](0xcc)[_0xebd0('0x25')]();});}};}function handleEntityNotFound(_0x4a0deb,_0x4ee6dd){return function(_0x144f13){if(!_0x144f13){_0x4a0deb[_0xebd0('0x18')](0x194);}return _0x144f13;};}function handleError(_0x4210fb,_0x73fd66){_0x73fd66=_0x73fd66||0x1f4;return function(_0x30d96b){logger['error'](_0x30d96b[_0xebd0('0x26')]);if(_0x30d96b[_0xebd0('0x27')]){delete _0x30d96b[_0xebd0('0x27')];}_0x4210fb[_0xebd0('0x19')](_0x73fd66)[_0xebd0('0x28')](_0x30d96b);};}exports['index']=function(_0x53169b,_0x4edc71){var _0x540a70={},_0x206716={},_0x3b9033={'count':0x0,'rows':[]};var _0x16c821=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0x140967){return{'name':_0x140967[_0xebd0('0x29')],'type':_0x140967[_0xebd0('0x2a')][_0xebd0('0x2b')]};});_0x206716[_0xebd0('0x2c')]=_[_0xebd0('0x2d')](_0x16c821,_0xebd0('0x27'));_0x206716[_0xebd0('0x2e')]=_['keys'](_0x53169b[_0xebd0('0x2e')]);_0x206716[_0xebd0('0x2f')]=_[_0xebd0('0x30')](_0x206716[_0xebd0('0x2c')],_0x206716[_0xebd0('0x2e')]);_0x540a70[_0xebd0('0x31')]=_['intersection'](_0x206716[_0xebd0('0x2c')],qs['fields'](_0x53169b['query']['fields']));_0x540a70[_0xebd0('0x31')]=_0x540a70[_0xebd0('0x31')][_0xebd0('0x32')]?_0x540a70[_0xebd0('0x31')]:_0x206716[_0xebd0('0x2c')];if(!_0x53169b['query'][_0xebd0('0x33')](_0xebd0('0x34'))){_0x540a70[_0xebd0('0x1d')]=qs[_0xebd0('0x1d')](_0x53169b[_0xebd0('0x2e')][_0xebd0('0x1d')]);_0x540a70[_0xebd0('0x1b')]=qs[_0xebd0('0x1b')](_0x53169b[_0xebd0('0x2e')]['offset']);}_0x540a70[_0xebd0('0x35')]=qs['sort'](_0x53169b[_0xebd0('0x2e')][_0xebd0('0x36')]);_0x540a70[_0xebd0('0x37')]=qs['filters'](_[_0xebd0('0x38')](_0x53169b['query'],_0x206716[_0xebd0('0x2f')]),_0x16c821);if(_0x53169b[_0xebd0('0x2e')][_0xebd0('0x39')]){_0x540a70['where']=_[_0xebd0('0x3a')](_0x540a70[_0xebd0('0x37')],{'$or':_['map'](_0x16c821,function(_0x58db9e){if(_0x58db9e[_0xebd0('0x2a')]!==_0xebd0('0x3b')){var _0x292c1e={};_0x292c1e[_0x58db9e['name']]={'$like':'%'+_0x53169b[_0xebd0('0x2e')][_0xebd0('0x39')]+'%'};return _0x292c1e;}})});}_0x540a70=_[_0xebd0('0x3a')]({},_0x540a70,_0x53169b[_0xebd0('0x3c')]);var _0x46c7b7={'where':_0x540a70[_0xebd0('0x37')]};return db[_0xebd0('0x3d')][_0xebd0('0x1e')](_0x46c7b7)['then'](function(_0x5d030d){_0x3b9033[_0xebd0('0x1e')]=_0x5d030d;if(_0x53169b['query']['includeAll']){_0x540a70['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xebd0('0x3e')](_0x540a70);})[_0xebd0('0x24')](function(_0x14d0bc){_0x3b9033[_0xebd0('0x3f')]=_0x14d0bc;return _0x3b9033;})[_0xebd0('0x24')](respondWithFilteredResult(_0x4edc71,_0x540a70))[_0xebd0('0x40')](handleError(_0x4edc71,null));};exports[_0xebd0('0x41')]=function(_0x50840c,_0x1dad44){var _0xd994f={'raw':!![],'where':{'id':_0x50840c['params']['id']}},_0x2c3bc3={};_0x2c3bc3['model']=_[_0xebd0('0x42')](db['ChatQueueReport'][_0xebd0('0x43')]);_0x2c3bc3[_0xebd0('0x2e')]=_[_0xebd0('0x42')](_0x50840c[_0xebd0('0x2e')]);_0x2c3bc3[_0xebd0('0x2f')]=_[_0xebd0('0x30')](_0x2c3bc3[_0xebd0('0x2c')],_0x2c3bc3['query']);_0xd994f[_0xebd0('0x31')]=_[_0xebd0('0x30')](_0x2c3bc3[_0xebd0('0x2c')],qs[_0xebd0('0x44')](_0x50840c[_0xebd0('0x2e')][_0xebd0('0x44')]));_0xd994f['attributes']=_0xd994f[_0xebd0('0x31')]['length']?_0xd994f['attributes']:_0x2c3bc3[_0xebd0('0x2c')];if(_0x50840c['query']['includeAll']){_0xd994f[_0xebd0('0x45')]=[{'all':!![]}];}_0xd994f=_[_0xebd0('0x3a')]({},_0xd994f,_0x50840c[_0xebd0('0x3c')]);return db[_0xebd0('0x3d')][_0xebd0('0x46')](_0xd994f)['then'](handleEntityNotFound(_0x1dad44,null))[_0xebd0('0x24')](respondWithResult(_0x1dad44,null))['catch'](handleError(_0x1dad44,null));};exports['create']=function(_0x2e44f1,_0x45ad49){return db['ChatQueueReport'][_0xebd0('0x47')](_0x2e44f1[_0xebd0('0x48')],{})[_0xebd0('0x24')](respondWithResult(_0x45ad49,0xc9))[_0xebd0('0x40')](handleError(_0x45ad49,null));};exports[_0xebd0('0x22')]=function(_0x18675a,_0x778fa1){if(_0x18675a[_0xebd0('0x48')]['id']){delete _0x18675a[_0xebd0('0x48')]['id'];}return db['ChatQueueReport'][_0xebd0('0x46')]({'where':{'id':_0x18675a[_0xebd0('0x49')]['id']}})[_0xebd0('0x24')](handleEntityNotFound(_0x778fa1,null))[_0xebd0('0x24')](saveUpdates(_0x18675a[_0xebd0('0x48')],null))[_0xebd0('0x24')](respondWithResult(_0x778fa1,null))['catch'](handleError(_0x778fa1,null));};exports[_0xebd0('0x23')]=function(_0x14ed2e,_0x526a93){return db[_0xebd0('0x3d')][_0xebd0('0x46')]({'where':{'id':_0x14ed2e['params']['id']}})[_0xebd0('0x24')](handleEntityNotFound(_0x526a93,null))[_0xebd0('0x24')](removeEntity(_0x526a93,null))[_0xebd0('0x40')](handleError(_0x526a93,null));};exports[_0xebd0('0x4a')]=function(_0x28a11b,_0x4ce8a5){return db['ChatQueueReport'][_0xebd0('0x4a')]()[_0xebd0('0x24')](respondWithResult(_0x4ce8a5,null))[_0xebd0('0x40')](handleError(_0x4ce8a5,null));};
\ No newline at end of file
+var _0x126e=['../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','ChatQueueReport','rawAttributes','type','model','map','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','show','params','intersection','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x5c8490,_0x21e3b4){var _0x2c4f89=function(_0x5e67fc){while(--_0x5e67fc){_0x5c8490['push'](_0x5c8490['shift']());}};_0x2c4f89(++_0x21e3b4);}(_0x126e,0x108));var _0xe126=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x126e[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe126('0x0'));var zipdir=require(_0xe126('0x1'));var jsonpatch=require(_0xe126('0x2'));var rp=require(_0xe126('0x3'));var moment=require(_0xe126('0x4'));var BPromise=require(_0xe126('0x5'));var Mustache=require('mustache');var util=require(_0xe126('0x6'));var path=require(_0xe126('0x7'));var sox=require(_0xe126('0x8'));var csv=require(_0xe126('0x9'));var ejs=require(_0xe126('0xa'));var fs=require('fs');var fs_extra=require(_0xe126('0xb'));var _=require(_0xe126('0xc'));var squel=require('squel');var crypto=require(_0xe126('0xd'));var jsforce=require(_0xe126('0xe'));var deskjs=require(_0xe126('0xf'));var toCsv=require(_0xe126('0x9'));var querystring=require(_0xe126('0x10'));var Papa=require('papaparse');var Redis=require(_0xe126('0x11'));var authService=require(_0xe126('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe126('0x13'));var hardwareService=require(_0xe126('0x14'));var logger=require('../../config/logger')(_0xe126('0x15'));var utils=require('../../config/utils');var config=require(_0xe126('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe126('0x17'))['db'];function respondWithStatusCode(_0x34ae06,_0x23ff02){_0x23ff02=_0x23ff02||0xcc;return function(_0x38b8c3){if(_0x38b8c3){return _0x34ae06[_0xe126('0x18')](_0x23ff02);}return _0x34ae06[_0xe126('0x19')](_0x23ff02)[_0xe126('0x1a')]();};}function respondWithResult(_0x55f10a,_0xd55baf){_0xd55baf=_0xd55baf||0xc8;return function(_0x1c02c9){if(_0x1c02c9){return _0x55f10a['status'](_0xd55baf)[_0xe126('0x1b')](_0x1c02c9);}};}function respondWithFilteredResult(_0x28d7dd,_0x10bc24){return function(_0x38b0c0){if(_0x38b0c0){var _0x5e52d1=typeof _0x10bc24[_0xe126('0x1c')]===_0xe126('0x1d')&&typeof _0x10bc24[_0xe126('0x1e')]==='undefined';var _0x2b0baa=_0x38b0c0['count'];var _0x46c98a=_0x5e52d1?0x0:_0x10bc24[_0xe126('0x1c')];var _0x19b0a3=_0x5e52d1?_0x38b0c0[_0xe126('0x1f')]:_0x10bc24[_0xe126('0x1c')]+_0x10bc24[_0xe126('0x1e')];var _0x20874b;if(_0x19b0a3>=_0x2b0baa){_0x19b0a3=_0x2b0baa;_0x20874b=0xc8;}else{_0x20874b=0xce;}_0x28d7dd[_0xe126('0x19')](_0x20874b);return _0x28d7dd['set'](_0xe126('0x20'),_0x46c98a+'-'+_0x19b0a3+'/'+_0x2b0baa)[_0xe126('0x1b')](_0x38b0c0);}return null;};}function patchUpdates(_0x35ab64){return function(_0x2e5617){try{jsonpatch[_0xe126('0x21')](_0x2e5617,_0x35ab64,!![]);}catch(_0x24076e){return BPromise[_0xe126('0x22')](_0x24076e);}return _0x2e5617[_0xe126('0x23')]();};}function saveUpdates(_0x5257bc,_0x4a1a97){return function(_0xdb6544){if(_0xdb6544){return _0xdb6544[_0xe126('0x24')](_0x5257bc)[_0xe126('0x25')](function(_0x5f1ce1){return _0x5f1ce1;});}return null;};}function removeEntity(_0x5381e1,_0x47f179){return function(_0x4807d3){if(_0x4807d3){return _0x4807d3[_0xe126('0x26')]()['then'](function(){_0x5381e1[_0xe126('0x19')](0xcc)[_0xe126('0x1a')]();});}};}function handleEntityNotFound(_0x4157ed,_0x1674c9){return function(_0x532409){if(!_0x532409){_0x4157ed['sendStatus'](0x194);}return _0x532409;};}function handleError(_0x26482f,_0x4facea){_0x4facea=_0x4facea||0x1f4;return function(_0x3f5de5){logger[_0xe126('0x27')](_0x3f5de5[_0xe126('0x28')]);if(_0x3f5de5['name']){delete _0x3f5de5[_0xe126('0x29')];}_0x26482f[_0xe126('0x19')](_0x4facea)['send'](_0x3f5de5);};}exports[_0xe126('0x2a')]=function(_0x259059,_0x5a8b2a){var _0x9d9e28={},_0x1fb354={},_0x29dec4={'count':0x0,'rows':[]};var _0x181ccc=_['map'](db[_0xe126('0x2b')][_0xe126('0x2c')],function(_0x5e7bab){return{'name':_0x5e7bab['fieldName'],'type':_0x5e7bab[_0xe126('0x2d')]['key']};});_0x1fb354[_0xe126('0x2e')]=_[_0xe126('0x2f')](_0x181ccc,_0xe126('0x29'));_0x1fb354['query']=_[_0xe126('0x30')](_0x259059[_0xe126('0x31')]);_0x1fb354[_0xe126('0x32')]=_['intersection'](_0x1fb354[_0xe126('0x2e')],_0x1fb354[_0xe126('0x31')]);_0x9d9e28['attributes']=_['intersection'](_0x1fb354[_0xe126('0x2e')],qs[_0xe126('0x33')](_0x259059[_0xe126('0x31')][_0xe126('0x33')]));_0x9d9e28[_0xe126('0x34')]=_0x9d9e28[_0xe126('0x34')][_0xe126('0x35')]?_0x9d9e28[_0xe126('0x34')]:_0x1fb354['model'];if(!_0x259059[_0xe126('0x31')][_0xe126('0x36')](_0xe126('0x37'))){_0x9d9e28[_0xe126('0x1e')]=qs[_0xe126('0x1e')](_0x259059[_0xe126('0x31')]['limit']);_0x9d9e28[_0xe126('0x1c')]=qs[_0xe126('0x1c')](_0x259059[_0xe126('0x31')][_0xe126('0x1c')]);}_0x9d9e28[_0xe126('0x38')]=qs['sort'](_0x259059[_0xe126('0x31')][_0xe126('0x39')]);_0x9d9e28[_0xe126('0x3a')]=qs[_0xe126('0x32')](_['pick'](_0x259059[_0xe126('0x31')],_0x1fb354[_0xe126('0x32')]),_0x181ccc);if(_0x259059[_0xe126('0x31')][_0xe126('0x3b')]){_0x9d9e28[_0xe126('0x3a')]=_[_0xe126('0x3c')](_0x9d9e28['where'],{'$or':_[_0xe126('0x2f')](_0x181ccc,function(_0x1a8edf){if(_0x1a8edf[_0xe126('0x2d')]!=='VIRTUAL'){var _0x5073bc={};_0x5073bc[_0x1a8edf[_0xe126('0x29')]]={'$like':'%'+_0x259059[_0xe126('0x31')][_0xe126('0x3b')]+'%'};return _0x5073bc;}})});}_0x9d9e28=_[_0xe126('0x3c')]({},_0x9d9e28,_0x259059[_0xe126('0x3d')]);var _0x1c128d={'where':_0x9d9e28['where']};return db[_0xe126('0x2b')][_0xe126('0x1f')](_0x1c128d)['then'](function(_0x4eb3d7){_0x29dec4[_0xe126('0x1f')]=_0x4eb3d7;if(_0x259059[_0xe126('0x31')]['includeAll']){_0x9d9e28[_0xe126('0x3e')]=[{'all':!![]}];}return db[_0xe126('0x2b')]['findAll'](_0x9d9e28);})[_0xe126('0x25')](function(_0x366754){_0x29dec4['rows']=_0x366754;return _0x29dec4;})[_0xe126('0x25')](respondWithFilteredResult(_0x5a8b2a,_0x9d9e28))['catch'](handleError(_0x5a8b2a,null));};exports[_0xe126('0x3f')]=function(_0x23d1d8,_0x5d5111){var _0x3613de={'raw':!![],'where':{'id':_0x23d1d8[_0xe126('0x40')]['id']}},_0x149b84={};_0x149b84['model']=_[_0xe126('0x30')](db['ChatQueueReport'][_0xe126('0x2c')]);_0x149b84[_0xe126('0x31')]=_[_0xe126('0x30')](_0x23d1d8[_0xe126('0x31')]);_0x149b84[_0xe126('0x32')]=_[_0xe126('0x41')](_0x149b84[_0xe126('0x2e')],_0x149b84[_0xe126('0x31')]);_0x3613de[_0xe126('0x34')]=_[_0xe126('0x41')](_0x149b84[_0xe126('0x2e')],qs['fields'](_0x23d1d8['query'][_0xe126('0x33')]));_0x3613de[_0xe126('0x34')]=_0x3613de['attributes'][_0xe126('0x35')]?_0x3613de[_0xe126('0x34')]:_0x149b84[_0xe126('0x2e')];if(_0x23d1d8[_0xe126('0x31')]['includeAll']){_0x3613de[_0xe126('0x3e')]=[{'all':!![]}];}_0x3613de=_[_0xe126('0x3c')]({},_0x3613de,_0x23d1d8[_0xe126('0x3d')]);return db[_0xe126('0x2b')][_0xe126('0x42')](_0x3613de)[_0xe126('0x25')](handleEntityNotFound(_0x5d5111,null))[_0xe126('0x25')](respondWithResult(_0x5d5111,null))[_0xe126('0x43')](handleError(_0x5d5111,null));};exports[_0xe126('0x44')]=function(_0xccc25d,_0x23007d){return db[_0xe126('0x2b')][_0xe126('0x44')](_0xccc25d['body'],{})['then'](respondWithResult(_0x23007d,0xc9))['catch'](handleError(_0x23007d,null));};exports['update']=function(_0xe642ae,_0x8d5abd){if(_0xe642ae[_0xe126('0x45')]['id']){delete _0xe642ae[_0xe126('0x45')]['id'];}return db[_0xe126('0x2b')][_0xe126('0x42')]({'where':{'id':_0xe642ae[_0xe126('0x40')]['id']}})['then'](handleEntityNotFound(_0x8d5abd,null))['then'](saveUpdates(_0xe642ae[_0xe126('0x45')],null))[_0xe126('0x25')](respondWithResult(_0x8d5abd,null))['catch'](handleError(_0x8d5abd,null));};exports[_0xe126('0x26')]=function(_0x209002,_0x518e43){return db[_0xe126('0x2b')][_0xe126('0x42')]({'where':{'id':_0x209002['params']['id']}})['then'](handleEntityNotFound(_0x518e43,null))[_0xe126('0x25')](removeEntity(_0x518e43,null))[_0xe126('0x43')](handleError(_0x518e43,null));};exports[_0xe126('0x46')]=function(_0x48fbed,_0x31e193){return db['ChatQueueReport'][_0xe126('0x46')]()[_0xe126('0x25')](respondWithResult(_0x31e193,null))['catch'](handleError(_0x31e193,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 74bb23f..245cbb3 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x3878bd,_0x51e3e5){var _0x359e60=function(_0xe70276){while(--_0xe70276){_0x3878bd['push'](_0x3878bd['shift']());}};_0x359e60(++_0x51e3e5);}(_0xe706,0xa3));var _0x6e70=function(_0x788c48,_0x5c0e5e){_0x788c48=_0x788c48-0x0;var _0x299c14=_0xe706[_0x788c48];return _0x299c14;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x5a3f9d,_0x4e2056){var _0x4b0cd=function(_0x1d7a31){while(--_0x1d7a31){_0x5a3f9d['push'](_0x5a3f9d['shift']());}};_0x4b0cd(++_0x4e2056);}(_0x757a,0xde));var _0xa757=function(_0x1e7dd1,_0x533388){_0x1e7dd1=_0x1e7dd1-0x0;var _0x988568=_0x757a[_0x1e7dd1];return _0x988568;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 7674475..b956e5d 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 _0x6cb4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','debug','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','UpdateChatQueueReport','update','attributes','limit','lodash'];(function(_0x37e4ad,_0x170ca0){var _0x128d7c=function(_0x137db8){while(--_0x137db8){_0x37e4ad['push'](_0x37e4ad['shift']());}};_0x128d7c(++_0x170ca0);}(_0x6cb4,0xff));var _0x46cb=function(_0x5cf074,_0x34f595){_0x5cf074=_0x5cf074-0x0;var _0x593789=_0x6cb4[_0x5cf074];return _0x593789;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rs=require(_0x46cb('0x4'));var fs=require('fs');var Redis=require(_0x46cb('0x5'));var db=require(_0x46cb('0x6'))['db'];var utils=require(_0x46cb('0x7'));var logger=require(_0x46cb('0x8'))('rpc');var config=require(_0x46cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46cb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11262d,_0x148d0f,_0x31b35b){return new BPromise(function(_0x2d6c29,_0x24b4f5){return client[_0x46cb('0xb')](_0x11262d,_0x31b35b)['then'](function(_0x3d7663){logger[_0x46cb('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'));logger[_0x46cb('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'),JSON[_0x46cb('0xf')](_0x3d7663));if(_0x3d7663['error']){if(_0x3d7663['error']['code']===0x1f4){logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x24b4f5(_0x3d7663['error'][_0x46cb('0x12')]);}logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x2d6c29(_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);}else{logger[_0x46cb('0xc')](_0x46cb('0x11'),_0x148d0f,_0x46cb('0xd'));_0x2d6c29(_0x3d7663[_0x46cb('0x13')]['message']);}})[_0x46cb('0x14')](function(_0x5796d2){logger[_0x46cb('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x148d0f,_0x5796d2);_0x24b4f5(_0x5796d2);});});}exports['CreateChatQueueReport']=function(_0x4e3454){var _0x1b6646=this;return new Promise(function(_0x1f2891,_0x4df1f0){return db[_0x46cb('0x15')][_0x46cb('0x16')](_0x4e3454[_0x46cb('0x17')],{'raw':_0x4e3454[_0x46cb('0x18')]?_0x4e3454[_0x46cb('0x18')][_0x46cb('0x19')]===undefined?!![]:![]:!![]})[_0x46cb('0x1a')](function(_0x149483){logger[_0x46cb('0xc')](_0x46cb('0x1b'),_0x4e3454);logger[_0x46cb('0xe')](_0x46cb('0x1b'),_0x4e3454,JSON[_0x46cb('0xf')](_0x149483));_0x1f2891(_0x149483);})[_0x46cb('0x14')](function(_0x1fb467){logger[_0x46cb('0x10')](_0x46cb('0x1b'),_0x1fb467[_0x46cb('0x12')],_0x4e3454);_0x4df1f0(_0x1b6646[_0x46cb('0x10')](0x1f4,_0x1fb467[_0x46cb('0x12')]));});});};exports[_0x46cb('0x1c')]=function(_0x40e0e5){var _0x5a1338=this;return new Promise(function(_0x4d663e,_0x6588f3){return db[_0x46cb('0x15')][_0x46cb('0x1d')](_0x40e0e5[_0x46cb('0x17')],{'raw':_0x40e0e5[_0x46cb('0x18')]?_0x40e0e5['options'][_0x46cb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40e0e5['options']?_0x40e0e5['options']['where']||null:null,'attributes':_0x40e0e5[_0x46cb('0x18')]?_0x40e0e5[_0x46cb('0x18')][_0x46cb('0x1e')]||null:null,'limit':_0x40e0e5[_0x46cb('0x18')]?_0x40e0e5[_0x46cb('0x18')][_0x46cb('0x1f')]||null:null})[_0x46cb('0x1a')](function(_0x8c65b2){logger[_0x46cb('0xc')](_0x46cb('0x1c'),_0x40e0e5);logger[_0x46cb('0xe')]('UpdateChatQueueReport',_0x40e0e5,JSON[_0x46cb('0xf')](_0x8c65b2));_0x4d663e(_0x8c65b2);})[_0x46cb('0x14')](function(_0x4c73bd){logger['error'](_0x46cb('0x1c'),_0x4c73bd['message'],_0x40e0e5);_0x6588f3(_0x5a1338[_0x46cb('0x10')](0x1f4,_0x4c73bd[_0x46cb('0x12')]));});});};
\ No newline at end of file
+var _0x4b03=['error','message','result','catch','CreateChatQueueReport','create','body','options','raw','stringify','UpdateChatQueueReport','ChatQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0xc0797d,_0x8f7795){var _0x14038d=function(_0x3af163){while(--_0x3af163){_0xc0797d['push'](_0xc0797d['shift']());}};_0x14038d(++_0x8f7795);}(_0x4b03,0x11f));var _0x34b0=function(_0x3e8384,_0x1a7869){_0x3e8384=_0x3e8384-0x0;var _0xddc3eb=_0x4b03[_0x3e8384];return _0xddc3eb;};'use strict';var _=require(_0x34b0('0x0'));var util=require(_0x34b0('0x1'));var moment=require(_0x34b0('0x2'));var BPromise=require(_0x34b0('0x3'));var rs=require(_0x34b0('0x4'));var fs=require('fs');var Redis=require(_0x34b0('0x5'));var db=require(_0x34b0('0x6'))['db'];var utils=require(_0x34b0('0x7'));var logger=require(_0x34b0('0x8'))(_0x34b0('0x9'));var config=require(_0x34b0('0xa'));var jayson=require(_0x34b0('0xb'));var client=jayson[_0x34b0('0xc')][_0x34b0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1c5775,_0x287f05,_0x5082d5){return new BPromise(function(_0x52ed51,_0x312672){return client['request'](_0x1c5775,_0x5082d5)[_0x34b0('0xe')](function(_0xcf4585){logger[_0x34b0('0xf')](_0x34b0('0x10'),_0x287f05,'request\x20sent');logger[_0x34b0('0x11')](_0x34b0('0x12'),_0x287f05,'request\x20sent',JSON['stringify'](_0xcf4585));if(_0xcf4585[_0x34b0('0x13')]){if(_0xcf4585[_0x34b0('0x13')]['code']===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x287f05,_0xcf4585['error'][_0x34b0('0x14')]);return _0x312672(_0xcf4585['error'][_0x34b0('0x14')]);}logger['error'](_0x34b0('0x10'),_0x287f05,_0xcf4585['error'][_0x34b0('0x14')]);return _0x52ed51(_0xcf4585['error'][_0x34b0('0x14')]);}else{logger[_0x34b0('0xf')](_0x34b0('0x10'),_0x287f05,'request\x20sent');_0x52ed51(_0xcf4585[_0x34b0('0x15')][_0x34b0('0x14')]);}})[_0x34b0('0x16')](function(_0x3b645d){logger[_0x34b0('0x13')](_0x34b0('0x10'),_0x287f05,_0x3b645d);_0x312672(_0x3b645d);});});}exports[_0x34b0('0x17')]=function(_0x4adf65){var _0x5b2372=this;return new Promise(function(_0x1278d5,_0x46d534){return db['ChatQueueReport'][_0x34b0('0x18')](_0x4adf65[_0x34b0('0x19')],{'raw':_0x4adf65[_0x34b0('0x1a')]?_0x4adf65[_0x34b0('0x1a')][_0x34b0('0x1b')]===undefined?!![]:![]:!![]})[_0x34b0('0xe')](function(_0x185b79){logger[_0x34b0('0xf')](_0x34b0('0x17'),_0x4adf65);logger['debug'](_0x34b0('0x17'),_0x4adf65,JSON[_0x34b0('0x1c')](_0x185b79));_0x1278d5(_0x185b79);})[_0x34b0('0x16')](function(_0x17c0e3){logger[_0x34b0('0x13')](_0x34b0('0x17'),_0x17c0e3[_0x34b0('0x14')],_0x4adf65);_0x46d534(_0x5b2372[_0x34b0('0x13')](0x1f4,_0x17c0e3[_0x34b0('0x14')]));});});};exports[_0x34b0('0x1d')]=function(_0x4c1f35){var _0x2c6a45=this;return new Promise(function(_0x535d53,_0x18f90b){return db[_0x34b0('0x1e')][_0x34b0('0x1f')](_0x4c1f35[_0x34b0('0x19')],{'raw':_0x4c1f35[_0x34b0('0x1a')]?_0x4c1f35['options'][_0x34b0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c1f35[_0x34b0('0x1a')]?_0x4c1f35[_0x34b0('0x1a')][_0x34b0('0x20')]||null:null,'attributes':_0x4c1f35[_0x34b0('0x1a')]?_0x4c1f35[_0x34b0('0x1a')]['attributes']||null:null,'limit':_0x4c1f35[_0x34b0('0x1a')]?_0x4c1f35[_0x34b0('0x1a')][_0x34b0('0x21')]||null:null})[_0x34b0('0xe')](function(_0x4f9ab2){logger[_0x34b0('0xf')]('UpdateChatQueueReport',_0x4c1f35);logger['debug'](_0x34b0('0x1d'),_0x4c1f35,JSON[_0x34b0('0x1c')](_0x4f9ab2));_0x535d53(_0x4f9ab2);})['catch'](function(_0x134924){logger['error']('UpdateChatQueueReport',_0x134924[_0x34b0('0x14')],_0x4c1f35);_0x18f90b(_0x2c6a45[_0x34b0('0x13')](0x1f4,_0x134924[_0x34b0('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 8b373e5..2ecaa74 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 _0xe501=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','exports','util','path','connect-timeout','express'];(function(_0x214057,_0x598967){var _0x565bc9=function(_0x95b3f3){while(--_0x95b3f3){_0x214057['push'](_0x214057['shift']());}};_0x565bc9(++_0x598967);}(_0xe501,0x1f0));var _0x1e50=function(_0x458829,_0x5dae88){_0x458829=_0x458829-0x0;var _0xc0a3c=_0xe501[_0x458829];return _0xc0a3c;};'use strict';var multer=require('multer');var util=require(_0x1e50('0x0'));var path=require(_0x1e50('0x1'));var timeout=require(_0x1e50('0x2'));var express=require(_0x1e50('0x3'));var router=express[_0x1e50('0x4')]();var fs_extra=require(_0x1e50('0x5'));var auth=require(_0x1e50('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1e50('0x7'));var controller=require(_0x1e50('0x8'));router[_0x1e50('0x9')]('/',auth[_0x1e50('0xa')](),controller[_0x1e50('0xb')]);router[_0x1e50('0x9')](_0x1e50('0xc'),auth[_0x1e50('0xa')](),controller[_0x1e50('0xd')]);router['get'](_0x1e50('0xe'),auth[_0x1e50('0xa')](),controller[_0x1e50('0xf')]);router['post']('/',auth[_0x1e50('0xa')](),controller[_0x1e50('0x10')]);router[_0x1e50('0x11')](_0x1e50('0xe'),auth['isAuthenticated'](),controller[_0x1e50('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1e50('0x13')]=router;
\ No newline at end of file
+var _0xeb33=['put','/:id','update','delete','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','show','post','create'];(function(_0x242ea3,_0xe7e9bb){var _0x44bdf9=function(_0x375d0b){while(--_0x375d0b){_0x242ea3['push'](_0x242ea3['shift']());}};_0x44bdf9(++_0xe7e9bb);}(_0xeb33,0x1a2));var _0x3eb3=function(_0x4d4ca7,_0x56a047){_0x4d4ca7=_0x4d4ca7-0x0;var _0x59aedb=_0xeb33[_0x4d4ca7];return _0x59aedb;};'use strict';var multer=require(_0x3eb3('0x0'));var util=require(_0x3eb3('0x1'));var path=require('path');var timeout=require(_0x3eb3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3eb3('0x3'));var auth=require(_0x3eb3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3eb3('0x5'));var controller=require(_0x3eb3('0x6'));router[_0x3eb3('0x7')]('/',auth[_0x3eb3('0x8')](),controller['index']);router[_0x3eb3('0x7')](_0x3eb3('0x9'),auth[_0x3eb3('0x8')](),controller[_0x3eb3('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3eb3('0xb')]);router[_0x3eb3('0xc')]('/',auth[_0x3eb3('0x8')](),controller[_0x3eb3('0xd')]);router[_0x3eb3('0xe')](_0x3eb3('0xf'),auth['isAuthenticated'](),controller[_0x3eb3('0x10')]);router[_0x3eb3('0x11')]('/:id',auth[_0x3eb3('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 4c764c2..8c3f4e6 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x22d352,_0x4a576f){var _0x11228c=function(_0x4d8414){while(--_0x4d8414){_0x22d352['push'](_0x22d352['shift']());}};_0x11228c(++_0x4a576f);}(_0xaa88,0x137));var _0x8aa8=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0xaa88[_0x2074db];return _0x27324c;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x11dde4,_0x1d4852){var _0x6eea94=function(_0x182859){while(--_0x182859){_0x11dde4['push'](_0x11dde4['shift']());}};_0x6eea94(++_0x1d4852);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index c93cd72..6ed897d 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 _0x90c9=['body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','Content-Range','save','then','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x90c9,0x12b));var _0x990c=function(_0x4befae,_0x55b079){_0x4befae=_0x4befae-0x0;var _0x76c573=_0x90c9[_0x4befae];return _0x76c573;};'use strict';var emlformat=require(_0x990c('0x0'));var rimraf=require(_0x990c('0x1'));var zipdir=require(_0x990c('0x2'));var jsonpatch=require(_0x990c('0x3'));var rp=require(_0x990c('0x4'));var moment=require(_0x990c('0x5'));var BPromise=require(_0x990c('0x6'));var Mustache=require('mustache');var util=require(_0x990c('0x7'));var path=require('path');var sox=require(_0x990c('0x8'));var csv=require(_0x990c('0x9'));var ejs=require(_0x990c('0xa'));var fs=require('fs');var fs_extra=require(_0x990c('0xb'));var _=require(_0x990c('0xc'));var squel=require(_0x990c('0xd'));var crypto=require(_0x990c('0xe'));var jsforce=require(_0x990c('0xf'));var deskjs=require(_0x990c('0x10'));var toCsv=require(_0x990c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x990c('0x11'));var authService=require(_0x990c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x990c('0x13'));var hardwareService=require(_0x990c('0x14'));var logger=require('../../config/logger')(_0x990c('0x15'));var utils=require('../../config/utils');var config=require(_0x990c('0x16'));var licenseUtil=require(_0x990c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x218659,_0xe9fa7b){_0xe9fa7b=_0xe9fa7b||0xcc;return function(_0x3f89c6){if(_0x3f89c6){return _0x218659['sendStatus'](_0xe9fa7b);}return _0x218659['status'](_0xe9fa7b)['end']();};}function respondWithResult(_0x29d69a,_0x2a8822){_0x2a8822=_0x2a8822||0xc8;return function(_0xa1b7b0){if(_0xa1b7b0){return _0x29d69a[_0x990c('0x18')](_0x2a8822)[_0x990c('0x19')](_0xa1b7b0);}};}function respondWithFilteredResult(_0x461213,_0x4744ec){return function(_0x4cce3a){if(_0x4cce3a){var _0x8bb2f2=typeof _0x4744ec[_0x990c('0x1a')]==='undefined'&&typeof _0x4744ec[_0x990c('0x1b')]===_0x990c('0x1c');var _0x12c407=_0x4cce3a[_0x990c('0x1d')];var _0x5679a7=_0x8bb2f2?0x0:_0x4744ec[_0x990c('0x1a')];var _0x4326e2=_0x8bb2f2?_0x4cce3a['count']:_0x4744ec['offset']+_0x4744ec['limit'];var _0x32b8e9;if(_0x4326e2>=_0x12c407){_0x4326e2=_0x12c407;_0x32b8e9=0xc8;}else{_0x32b8e9=0xce;}_0x461213['status'](_0x32b8e9);return _0x461213[_0x990c('0x1e')](_0x990c('0x1f'),_0x5679a7+'-'+_0x4326e2+'/'+_0x12c407)['json'](_0x4cce3a);}return null;};}function patchUpdates(_0x54633a){return function(_0x3d3690){try{jsonpatch['apply'](_0x3d3690,_0x54633a,!![]);}catch(_0x6a3551){return BPromise['reject'](_0x6a3551);}return _0x3d3690[_0x990c('0x20')]();};}function saveUpdates(_0x996ced,_0x5099d3){return function(_0x96202b){if(_0x96202b){return _0x96202b['update'](_0x996ced)[_0x990c('0x21')](function(_0x33fdc0){return _0x33fdc0;});}return null;};}function removeEntity(_0x18d9be,_0x1b1e0a){return function(_0x3f3093){if(_0x3f3093){return _0x3f3093['destroy']()[_0x990c('0x21')](function(){_0x18d9be[_0x990c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34537b,_0x48134e){return function(_0x36f602){if(!_0x36f602){_0x34537b['sendStatus'](0x194);}return _0x36f602;};}function handleError(_0x1faec8,_0x1c842b){_0x1c842b=_0x1c842b||0x1f4;return function(_0x3704c4){logger[_0x990c('0x22')](_0x3704c4[_0x990c('0x23')]);if(_0x3704c4[_0x990c('0x24')]){delete _0x3704c4[_0x990c('0x24')];}_0x1faec8[_0x990c('0x18')](_0x1c842b)[_0x990c('0x25')](_0x3704c4);};}exports[_0x990c('0x26')]=function(_0x28909c,_0x5b952f){var _0x50c555={},_0x356a4a={},_0x53d9ae={'count':0x0,'rows':[]};var _0x43ca4e=_[_0x990c('0x27')](db[_0x990c('0x28')]['rawAttributes'],function(_0x56979b){return{'name':_0x56979b[_0x990c('0x29')],'type':_0x56979b[_0x990c('0x2a')][_0x990c('0x2b')]};});_0x356a4a[_0x990c('0x2c')]=_[_0x990c('0x27')](_0x43ca4e,_0x990c('0x24'));_0x356a4a[_0x990c('0x2d')]=_['keys'](_0x28909c[_0x990c('0x2d')]);_0x356a4a[_0x990c('0x2e')]=_['intersection'](_0x356a4a[_0x990c('0x2c')],_0x356a4a[_0x990c('0x2d')]);_0x50c555[_0x990c('0x2f')]=_[_0x990c('0x30')](_0x356a4a[_0x990c('0x2c')],qs[_0x990c('0x31')](_0x28909c[_0x990c('0x2d')]['fields']));_0x50c555[_0x990c('0x2f')]=_0x50c555[_0x990c('0x2f')][_0x990c('0x32')]?_0x50c555[_0x990c('0x2f')]:_0x356a4a[_0x990c('0x2c')];if(!_0x28909c[_0x990c('0x2d')][_0x990c('0x33')](_0x990c('0x34'))){_0x50c555[_0x990c('0x1b')]=qs['limit'](_0x28909c[_0x990c('0x2d')][_0x990c('0x1b')]);_0x50c555[_0x990c('0x1a')]=qs[_0x990c('0x1a')](_0x28909c['query']['offset']);}_0x50c555[_0x990c('0x35')]=qs[_0x990c('0x36')](_0x28909c['query']['sort']);_0x50c555[_0x990c('0x37')]=qs['filters'](_[_0x990c('0x38')](_0x28909c['query'],_0x356a4a[_0x990c('0x2e')]),_0x43ca4e);if(_0x28909c[_0x990c('0x2d')][_0x990c('0x39')]){_0x50c555[_0x990c('0x37')]=_[_0x990c('0x3a')](_0x50c555[_0x990c('0x37')],{'$or':_[_0x990c('0x27')](_0x43ca4e,function(_0x4979cf){if(_0x4979cf[_0x990c('0x2a')]!==_0x990c('0x3b')){var _0x148f62={};_0x148f62[_0x4979cf['name']]={'$like':'%'+_0x28909c['query'][_0x990c('0x39')]+'%'};return _0x148f62;}})});}_0x50c555=_['merge']({},_0x50c555,_0x28909c[_0x990c('0x3c')]);var _0x298406={'where':_0x50c555['where']};return db[_0x990c('0x28')]['count'](_0x298406)[_0x990c('0x21')](function(_0x37c0db){_0x53d9ae[_0x990c('0x1d')]=_0x37c0db;if(_0x28909c[_0x990c('0x2d')]['includeAll']){_0x50c555['include']=[{'all':!![]}];}return db[_0x990c('0x28')][_0x990c('0x3d')](_0x50c555);})['then'](function(_0x5a1fbf){_0x53d9ae[_0x990c('0x3e')]=_0x5a1fbf;return _0x53d9ae;})[_0x990c('0x21')](respondWithFilteredResult(_0x5b952f,_0x50c555))[_0x990c('0x3f')](handleError(_0x5b952f,null));};exports[_0x990c('0x40')]=function(_0x351668,_0x13b62c){var _0x3182b9={'raw':!![],'where':{'id':_0x351668[_0x990c('0x41')]['id']}},_0x56adf4={};_0x56adf4[_0x990c('0x2c')]=_[_0x990c('0x42')](db[_0x990c('0x28')][_0x990c('0x43')]);_0x56adf4['query']=_[_0x990c('0x42')](_0x351668[_0x990c('0x2d')]);_0x56adf4[_0x990c('0x2e')]=_[_0x990c('0x30')](_0x56adf4[_0x990c('0x2c')],_0x56adf4[_0x990c('0x2d')]);_0x3182b9[_0x990c('0x2f')]=_[_0x990c('0x30')](_0x56adf4[_0x990c('0x2c')],qs[_0x990c('0x31')](_0x351668[_0x990c('0x2d')][_0x990c('0x31')]));_0x3182b9['attributes']=_0x3182b9['attributes'][_0x990c('0x32')]?_0x3182b9[_0x990c('0x2f')]:_0x56adf4[_0x990c('0x2c')];if(_0x351668[_0x990c('0x2d')][_0x990c('0x44')]){_0x3182b9['include']=[{'all':!![]}];}_0x3182b9=_['merge']({},_0x3182b9,_0x351668[_0x990c('0x3c')]);return db[_0x990c('0x28')][_0x990c('0x45')](_0x3182b9)['then'](handleEntityNotFound(_0x13b62c,null))[_0x990c('0x21')](respondWithResult(_0x13b62c,null))[_0x990c('0x3f')](handleError(_0x13b62c,null));};exports[_0x990c('0x46')]=function(_0x1fce14,_0x361055){return db[_0x990c('0x28')][_0x990c('0x46')](_0x1fce14[_0x990c('0x47')],{})[_0x990c('0x21')](respondWithResult(_0x361055,0xc9))[_0x990c('0x3f')](handleError(_0x361055,null));};exports['update']=function(_0x24963c,_0x826832){if(_0x24963c[_0x990c('0x47')]['id']){delete _0x24963c['body']['id'];}return db[_0x990c('0x28')]['find']({'where':{'id':_0x24963c[_0x990c('0x41')]['id']}})['then'](handleEntityNotFound(_0x826832,null))[_0x990c('0x21')](saveUpdates(_0x24963c[_0x990c('0x47')],null))[_0x990c('0x21')](respondWithResult(_0x826832,null))[_0x990c('0x3f')](handleError(_0x826832,null));};exports[_0x990c('0x48')]=function(_0x3c125f,_0x53ba89){return db['ChatTransferReport'][_0x990c('0x45')]({'where':{'id':_0x3c125f[_0x990c('0x41')]['id']}})[_0x990c('0x21')](handleEntityNotFound(_0x53ba89,null))[_0x990c('0x21')](removeEntity(_0x53ba89,null))[_0x990c('0x3f')](handleError(_0x53ba89,null));};exports['describe']=function(_0x54f610,_0xfbd3ea){return db[_0x990c('0x28')][_0x990c('0x49')]()[_0x990c('0x21')](respondWithResult(_0xfbd3ea,null))[_0x990c('0x3f')](handleError(_0xfbd3ea,null));};
\ No newline at end of file
+var _0x27bf=['length','hasOwnProperty','nolimit','order','where','pick','merge','filter','options','includeAll','include','rows','catch','keys','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','then','end','sendStatus','error','name','send','map','ChatTransferReport','rawAttributes','type','query','filters','intersection','model','attributes','fields'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x27bf,0x113));var _0xf27b=function(_0x444098,_0x204481){_0x444098=_0x444098-0x0;var _0x12c28c=_0x27bf[_0x444098];return _0x12c28c;};'use strict';var emlformat=require(_0xf27b('0x0'));var rimraf=require(_0xf27b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf27b('0x2'));var rp=require(_0xf27b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf27b('0x4'));var util=require(_0xf27b('0x5'));var path=require('path');var sox=require(_0xf27b('0x6'));var csv=require(_0xf27b('0x7'));var ejs=require(_0xf27b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf27b('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf27b('0xa'));var Redis=require(_0xf27b('0xb'));var authService=require(_0xf27b('0xc'));var qs=require(_0xf27b('0xd'));var as=require(_0xf27b('0xe'));var hardwareService=require(_0xf27b('0xf'));var logger=require('../../config/logger')(_0xf27b('0x10'));var utils=require('../../config/utils');var config=require(_0xf27b('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xf27b('0x12'))['db'];function respondWithStatusCode(_0x2ec729,_0x516ac9){_0x516ac9=_0x516ac9||0xcc;return function(_0x1096eb){if(_0x1096eb){return _0x2ec729['sendStatus'](_0x516ac9);}return _0x2ec729[_0xf27b('0x13')](_0x516ac9)['end']();};}function respondWithResult(_0x527b5f,_0x488606){_0x488606=_0x488606||0xc8;return function(_0x15ad3f){if(_0x15ad3f){return _0x527b5f[_0xf27b('0x13')](_0x488606)['json'](_0x15ad3f);}};}function respondWithFilteredResult(_0x396d4c,_0x52f8a1){return function(_0x4778a2){if(_0x4778a2){var _0x3858dc=typeof _0x52f8a1[_0xf27b('0x14')]===_0xf27b('0x15')&&typeof _0x52f8a1['limit']===_0xf27b('0x15');var _0x218a8a=_0x4778a2[_0xf27b('0x16')];var _0x2d34ac=_0x3858dc?0x0:_0x52f8a1[_0xf27b('0x14')];var _0x49c0a6=_0x3858dc?_0x4778a2[_0xf27b('0x16')]:_0x52f8a1[_0xf27b('0x14')]+_0x52f8a1[_0xf27b('0x17')];var _0x2f3208;if(_0x49c0a6>=_0x218a8a){_0x49c0a6=_0x218a8a;_0x2f3208=0xc8;}else{_0x2f3208=0xce;}_0x396d4c['status'](_0x2f3208);return _0x396d4c['set'](_0xf27b('0x18'),_0x2d34ac+'-'+_0x49c0a6+'/'+_0x218a8a)['json'](_0x4778a2);}return null;};}function patchUpdates(_0x41a7a8){return function(_0x49318c){try{jsonpatch[_0xf27b('0x19')](_0x49318c,_0x41a7a8,!![]);}catch(_0x292f83){return BPromise['reject'](_0x292f83);}return _0x49318c[_0xf27b('0x1a')]();};}function saveUpdates(_0x5a209a,_0x17db84){return function(_0x24d774){if(_0x24d774){return _0x24d774[_0xf27b('0x1b')](_0x5a209a)['then'](function(_0x1c8083){return _0x1c8083;});}return null;};}function removeEntity(_0x43ce08,_0x5cd8e2){return function(_0x4b4ac7){if(_0x4b4ac7){return _0x4b4ac7[_0xf27b('0x1c')]()[_0xf27b('0x1d')](function(){_0x43ce08[_0xf27b('0x13')](0xcc)[_0xf27b('0x1e')]();});}};}function handleEntityNotFound(_0x84b100,_0x39638c){return function(_0x41b769){if(!_0x41b769){_0x84b100[_0xf27b('0x1f')](0x194);}return _0x41b769;};}function handleError(_0x3b69f9,_0x4f18bf){_0x4f18bf=_0x4f18bf||0x1f4;return function(_0xb03cc6){logger[_0xf27b('0x20')](_0xb03cc6['stack']);if(_0xb03cc6[_0xf27b('0x21')]){delete _0xb03cc6[_0xf27b('0x21')];}_0x3b69f9[_0xf27b('0x13')](_0x4f18bf)[_0xf27b('0x22')](_0xb03cc6);};}exports['index']=function(_0x4e9e39,_0x1cb43a){var _0x182ac7={},_0x24993b={},_0x51ccb3={'count':0x0,'rows':[]};var _0x4b8462=_[_0xf27b('0x23')](db[_0xf27b('0x24')][_0xf27b('0x25')],function(_0x51b1f7){return{'name':_0x51b1f7['fieldName'],'type':_0x51b1f7[_0xf27b('0x26')]['key']};});_0x24993b['model']=_['map'](_0x4b8462,'name');_0x24993b[_0xf27b('0x27')]=_['keys'](_0x4e9e39[_0xf27b('0x27')]);_0x24993b[_0xf27b('0x28')]=_[_0xf27b('0x29')](_0x24993b[_0xf27b('0x2a')],_0x24993b[_0xf27b('0x27')]);_0x182ac7[_0xf27b('0x2b')]=_[_0xf27b('0x29')](_0x24993b[_0xf27b('0x2a')],qs[_0xf27b('0x2c')](_0x4e9e39[_0xf27b('0x27')][_0xf27b('0x2c')]));_0x182ac7[_0xf27b('0x2b')]=_0x182ac7['attributes'][_0xf27b('0x2d')]?_0x182ac7[_0xf27b('0x2b')]:_0x24993b[_0xf27b('0x2a')];if(!_0x4e9e39[_0xf27b('0x27')][_0xf27b('0x2e')](_0xf27b('0x2f'))){_0x182ac7[_0xf27b('0x17')]=qs['limit'](_0x4e9e39[_0xf27b('0x27')]['limit']);_0x182ac7['offset']=qs['offset'](_0x4e9e39[_0xf27b('0x27')]['offset']);}_0x182ac7[_0xf27b('0x30')]=qs['sort'](_0x4e9e39[_0xf27b('0x27')]['sort']);_0x182ac7[_0xf27b('0x31')]=qs['filters'](_[_0xf27b('0x32')](_0x4e9e39[_0xf27b('0x27')],_0x24993b[_0xf27b('0x28')]),_0x4b8462);if(_0x4e9e39['query']['filter']){_0x182ac7[_0xf27b('0x31')]=_[_0xf27b('0x33')](_0x182ac7['where'],{'$or':_[_0xf27b('0x23')](_0x4b8462,function(_0x45f8ef){if(_0x45f8ef[_0xf27b('0x26')]!=='VIRTUAL'){var _0x24e22f={};_0x24e22f[_0x45f8ef[_0xf27b('0x21')]]={'$like':'%'+_0x4e9e39[_0xf27b('0x27')][_0xf27b('0x34')]+'%'};return _0x24e22f;}})});}_0x182ac7=_[_0xf27b('0x33')]({},_0x182ac7,_0x4e9e39[_0xf27b('0x35')]);var _0x33f629={'where':_0x182ac7[_0xf27b('0x31')]};return db[_0xf27b('0x24')]['count'](_0x33f629)[_0xf27b('0x1d')](function(_0x378b22){_0x51ccb3[_0xf27b('0x16')]=_0x378b22;if(_0x4e9e39[_0xf27b('0x27')][_0xf27b('0x36')]){_0x182ac7[_0xf27b('0x37')]=[{'all':!![]}];}return db[_0xf27b('0x24')]['findAll'](_0x182ac7);})[_0xf27b('0x1d')](function(_0x2dd3b9){_0x51ccb3[_0xf27b('0x38')]=_0x2dd3b9;return _0x51ccb3;})[_0xf27b('0x1d')](respondWithFilteredResult(_0x1cb43a,_0x182ac7))[_0xf27b('0x39')](handleError(_0x1cb43a,null));};exports['show']=function(_0x513732,_0x3023c6){var _0x5ac0bd={'raw':!![],'where':{'id':_0x513732['params']['id']}},_0x4621f1={};_0x4621f1['model']=_[_0xf27b('0x3a')](db['ChatTransferReport'][_0xf27b('0x25')]);_0x4621f1[_0xf27b('0x27')]=_['keys'](_0x513732['query']);_0x4621f1[_0xf27b('0x28')]=_['intersection'](_0x4621f1[_0xf27b('0x2a')],_0x4621f1[_0xf27b('0x27')]);_0x5ac0bd[_0xf27b('0x2b')]=_[_0xf27b('0x29')](_0x4621f1[_0xf27b('0x2a')],qs[_0xf27b('0x2c')](_0x513732[_0xf27b('0x27')]['fields']));_0x5ac0bd[_0xf27b('0x2b')]=_0x5ac0bd[_0xf27b('0x2b')][_0xf27b('0x2d')]?_0x5ac0bd['attributes']:_0x4621f1[_0xf27b('0x2a')];if(_0x513732[_0xf27b('0x27')]['includeAll']){_0x5ac0bd[_0xf27b('0x37')]=[{'all':!![]}];}_0x5ac0bd=_['merge']({},_0x5ac0bd,_0x513732[_0xf27b('0x35')]);return db['ChatTransferReport'][_0xf27b('0x3b')](_0x5ac0bd)[_0xf27b('0x1d')](handleEntityNotFound(_0x3023c6,null))[_0xf27b('0x1d')](respondWithResult(_0x3023c6,null))[_0xf27b('0x39')](handleError(_0x3023c6,null));};exports[_0xf27b('0x3c')]=function(_0x53a896,_0x40d767){return db[_0xf27b('0x24')][_0xf27b('0x3c')](_0x53a896[_0xf27b('0x3d')],{})[_0xf27b('0x1d')](respondWithResult(_0x40d767,0xc9))['catch'](handleError(_0x40d767,null));};exports[_0xf27b('0x1b')]=function(_0x5a148d,_0x3a3975){if(_0x5a148d['body']['id']){delete _0x5a148d[_0xf27b('0x3d')]['id'];}return db[_0xf27b('0x24')][_0xf27b('0x3b')]({'where':{'id':_0x5a148d['params']['id']}})['then'](handleEntityNotFound(_0x3a3975,null))['then'](saveUpdates(_0x5a148d[_0xf27b('0x3d')],null))[_0xf27b('0x1d')](respondWithResult(_0x3a3975,null))[_0xf27b('0x39')](handleError(_0x3a3975,null));};exports[_0xf27b('0x1c')]=function(_0xcd4b28,_0x3f1921){return db[_0xf27b('0x24')][_0xf27b('0x3b')]({'where':{'id':_0xcd4b28[_0xf27b('0x3e')]['id']}})[_0xf27b('0x1d')](handleEntityNotFound(_0x3f1921,null))[_0xf27b('0x1d')](removeEntity(_0x3f1921,null))[_0xf27b('0x39')](handleError(_0x3f1921,null));};exports[_0xf27b('0x3f')]=function(_0x13d2dd,_0x6942ef){return db['ChatTransferReport']['describe']()[_0xf27b('0x1d')](respondWithResult(_0x6942ef,null))[_0xf27b('0x39')](handleError(_0x6942ef,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 6a165a1..91d883a 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 _0xc4a2=['define','report_chat_transfer','lodash','util','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x404991,_0x5a9865){var _0x429b45=function(_0x3ad6e5){while(--_0x3ad6e5){_0x404991['push'](_0x404991['shift']());}};_0x429b45(++_0x5a9865);}(_0xc4a2,0xfc));var _0x2c4a=function(_0x38a7ee,_0x69abc5){_0x38a7ee=_0x38a7ee-0x0;var _0xcc983=_0xc4a2[_0x38a7ee];return _0xcc983;};'use strict';var _=require(_0x2c4a('0x0'));var util=require(_0x2c4a('0x1'));var logger=require('../../config/logger')(_0x2c4a('0x2'));var moment=require(_0x2c4a('0x3'));var BPromise=require(_0x2c4a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c4a('0x5'));var rimraf=require('rimraf');var config=require(_0x2c4a('0x6'));var attributes=require('./chatTransferReport.attributes');module[_0x2c4a('0x7')]=function(_0x553a4b,_0x115e11){return _0x553a4b[_0x2c4a('0x8')]('ChatTransferReport',attributes,{'tableName':_0x2c4a('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c97=['request-promise','path','../../config/environment','exports','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x4f5fbc,_0x74cb4e){var _0x486e0e=function(_0x306829){while(--_0x306829){_0x4f5fbc['push'](_0x4f5fbc['shift']());}};_0x486e0e(++_0x74cb4e);}(_0x7c97,0x1b3));var _0x77c9=function(_0x184268,_0x469663){_0x184268=_0x184268-0x0;var _0x3ef971=_0x7c97[_0x184268];return _0x3ef971;};'use strict';var _=require(_0x77c9('0x0'));var util=require(_0x77c9('0x1'));var logger=require('../../config/logger')(_0x77c9('0x2'));var moment=require(_0x77c9('0x3'));var BPromise=require(_0x77c9('0x4'));var rp=require(_0x77c9('0x5'));var fs=require('fs');var path=require(_0x77c9('0x6'));var rimraf=require('rimraf');var config=require(_0x77c9('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0x77c9('0x8')]=function(_0x2e4e94,_0x4d7039){return _0x2e4e94['define']('ChatTransferReport',attributes,{'tableName':_0x77c9('0x9'),'paranoid':![],'indexes':[{'name':_0x77c9('0xa'),'fields':[_0x77c9('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 29119ce..55dc76c 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 _0x66a1=['then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request'];(function(_0x13551e,_0x3a8c79){var _0x55d46f=function(_0x312f35){while(--_0x312f35){_0x13551e['push'](_0x13551e['shift']());}};_0x55d46f(++_0x3a8c79);}(_0x66a1,0xe7));var _0x166a=function(_0x2d0ce6,_0x43a84f){_0x2d0ce6=_0x2d0ce6-0x0;var _0x2b0323=_0x66a1[_0x2d0ce6];return _0x2b0323;};'use strict';var _=require('lodash');var util=require(_0x166a('0x0'));var moment=require(_0x166a('0x1'));var BPromise=require(_0x166a('0x2'));var rs=require(_0x166a('0x3'));var fs=require('fs');var Redis=require(_0x166a('0x4'));var db=require(_0x166a('0x5'))['db'];var utils=require(_0x166a('0x6'));var logger=require('../../config/logger')(_0x166a('0x7'));var config=require('../../config/environment');var jayson=require(_0x166a('0x8'));var client=jayson['client'][_0x166a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35ea3a,_0x242f55,_0x21f6c9){return new BPromise(function(_0x35d1a1,_0x51fcf0){return client[_0x166a('0xa')](_0x35ea3a,_0x21f6c9)[_0x166a('0xb')](function(_0xe0b6ba){logger[_0x166a('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x242f55,_0x166a('0xd'));logger[_0x166a('0xe')](_0x166a('0xf'),_0x242f55,_0x166a('0xd'),JSON[_0x166a('0x10')](_0xe0b6ba));if(_0xe0b6ba[_0x166a('0x11')]){if(_0xe0b6ba['error'][_0x166a('0x12')]===0x1f4){logger['error'](_0x166a('0x13'),_0x242f55,_0xe0b6ba[_0x166a('0x11')]['message']);return _0x51fcf0(_0xe0b6ba['error'][_0x166a('0x14')]);}logger[_0x166a('0x11')](_0x166a('0x13'),_0x242f55,_0xe0b6ba[_0x166a('0x11')][_0x166a('0x14')]);return _0x35d1a1(_0xe0b6ba[_0x166a('0x11')][_0x166a('0x14')]);}else{logger[_0x166a('0xc')](_0x166a('0x13'),_0x242f55,_0x166a('0xd'));_0x35d1a1(_0xe0b6ba['result']['message']);}})[_0x166a('0x15')](function(_0x5a9abc){logger[_0x166a('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x242f55,_0x5a9abc);_0x51fcf0(_0x5a9abc);});});}
\ No newline at end of file
+var _0x2277=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','error','code','ChatTransferReport,\x20%s,\x20%s','message','result'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2277,0x118));var _0x7227=function(_0x6a2c85,_0x52536c){_0x6a2c85=_0x6a2c85-0x0;var _0x3c6723=_0x2277[_0x6a2c85];return _0x3c6723;};'use strict';var _=require(_0x7227('0x0'));var util=require(_0x7227('0x1'));var moment=require(_0x7227('0x2'));var BPromise=require(_0x7227('0x3'));var rs=require(_0x7227('0x4'));var fs=require('fs');var Redis=require(_0x7227('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7227('0x6'));var logger=require(_0x7227('0x7'))('rpc');var config=require(_0x7227('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7227('0x9')][_0x7227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c7511,_0x17b986,_0x50ec33){return new BPromise(function(_0x424c1b,_0x489415){return client[_0x7227('0xb')](_0x3c7511,_0x50ec33)[_0x7227('0xc')](function(_0x48df56){logger[_0x7227('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x17b986,_0x7227('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x17b986,'request\x20sent',JSON['stringify'](_0x48df56));if(_0x48df56[_0x7227('0xf')]){if(_0x48df56['error'][_0x7227('0x10')]===0x1f4){logger[_0x7227('0xf')](_0x7227('0x11'),_0x17b986,_0x48df56[_0x7227('0xf')][_0x7227('0x12')]);return _0x489415(_0x48df56[_0x7227('0xf')][_0x7227('0x12')]);}logger[_0x7227('0xf')](_0x7227('0x11'),_0x17b986,_0x48df56[_0x7227('0xf')][_0x7227('0x12')]);return _0x424c1b(_0x48df56[_0x7227('0xf')][_0x7227('0x12')]);}else{logger[_0x7227('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x17b986,_0x7227('0xe'));_0x424c1b(_0x48df56[_0x7227('0x13')]['message']);}})['catch'](function(_0xb603be){logger[_0x7227('0xf')](_0x7227('0x11'),_0x17b986,_0xb603be);_0x489415(_0xb603be);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index b73282e..ce0ade7 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 _0x542c=['delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put'];(function(_0x3ebeb8,_0x1890da){var _0x1cfc32=function(_0x340e58){while(--_0x340e58){_0x3ebeb8['push'](_0x3ebeb8['shift']());}};_0x1cfc32(++_0x1890da);}(_0x542c,0x8f));var _0xc542=function(_0x9ce333,_0x162dac){_0x9ce333=_0x9ce333-0x0;var _0xde9dcc=_0x542c[_0x9ce333];return _0xde9dcc;};'use strict';var multer=require(_0xc542('0x0'));var util=require('util');var path=require(_0xc542('0x1'));var timeout=require(_0xc542('0x2'));var express=require('express');var router=express[_0xc542('0x3')]();var fs_extra=require(_0xc542('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc542('0x5'));var config=require(_0xc542('0x6'));var controller=require(_0xc542('0x7'));router[_0xc542('0x8')]('/',auth[_0xc542('0x9')](),controller[_0xc542('0xa')]);router[_0xc542('0x8')](_0xc542('0xb'),auth[_0xc542('0x9')](),controller[_0xc542('0xc')]);router[_0xc542('0x8')](_0xc542('0xd'),auth[_0xc542('0x9')](),controller[_0xc542('0xe')]);router[_0xc542('0xf')]('/',auth[_0xc542('0x9')](),controller['create']);router[_0xc542('0x10')]('/:id',auth[_0xc542('0x9')](),controller['update']);router[_0xc542('0x11')](_0xc542('0xd'),auth[_0xc542('0x9')](),controller[_0xc542('0x12')]);module[_0xc542('0x13')]=router;
\ No newline at end of file
+var _0x02aa=['multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','/describe','describe','/:id','post','isAuthenticated','create','update','delete','destroy','exports'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0x02aa,0x7e));var _0xa02a=function(_0x4a6a4c,_0x5149d1){_0x4a6a4c=_0x4a6a4c-0x0;var _0xdb0e5b=_0x02aa[_0x4a6a4c];return _0xdb0e5b;};'use strict';var multer=require(_0xa02a('0x0'));var util=require(_0xa02a('0x1'));var path=require(_0xa02a('0x2'));var timeout=require('connect-timeout');var express=require(_0xa02a('0x3'));var router=express[_0xa02a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa02a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa02a('0x6'));var controller=require('./chatTransferReport.controller');router[_0xa02a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa02a('0x8'),auth['isAuthenticated'](),controller[_0xa02a('0x9')]);router[_0xa02a('0x7')](_0xa02a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa02a('0xb')]('/',auth[_0xa02a('0xc')](),controller[_0xa02a('0xd')]);router['put'](_0xa02a('0xa'),auth[_0xa02a('0xc')](),controller[_0xa02a('0xe')]);router[_0xa02a('0xf')](_0xa02a('0xa'),auth[_0xa02a('0xc')](),controller[_0xa02a('0x10')]);module[_0xa02a('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 986c55e..40d0316 100644
--- a/server/api/chatWebsite/chatWebsite.attributes.js
+++ b/server/api/chatWebsite/chatWebsite.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55e0=['CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','name','text','input','getDataValue','onlineForm','parse','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x241d8b,_0xbc727d){var _0xa8e555=function(_0x46d325){while(--_0x46d325){_0x241d8b['push'](_0x241d8b['shift']());}};_0xa8e555(++_0xbc727d);}(_0x55e0,0xdc));var _0x055e=function(_0x3d63f6,_0x8cd7e4){_0x3d63f6=_0x3d63f6-0x0;var _0x2ac67b=_0x55e0[_0x3d63f6];return _0x2ac67b;};'use strict';var Sequelize=require(_0x055e('0x0'));var rs=require(_0x055e('0x1'));module[_0x055e('0x2')]={'name':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x055e('0x3')]},'mapKey':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'mapKeyOffline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x4')},'key':{'type':Sequelize[_0x055e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x055e('0x3')]},'animation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x055e('0x9')]('rounded','squared'),'defaultValue':_0x055e('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0xb')},'start_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xc')},'offline_chat_button':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'header_offline':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x055e('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x13')},'noteTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x14')},'placeholderMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x16')},'closingMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'skipMessageButton':{'type':Sequelize[_0x055e('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x17')},'ratingType':{'type':Sequelize[_0x055e('0x9')](_0x055e('0x18'),_0x055e('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON[_0x055e('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x055e('0x1b'),'type':_0x055e('0x1c'),'required':!![]},'props':{'title':_0x055e('0x1b'),'helpText':''}},{'type':_0x055e('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x1f'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')](_0x055e('0x1f'))):{};},'set':function(_0x4c653c){return this['setDataValue'](_0x055e('0x1f'),JSON[_0x055e('0x1a')](_0x4c653c));}},'offlineForm':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x055e('0x1d'),'props':{'title':_0x055e('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x055e('0x4'),'type':_0x055e('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x055e('0x21')},'props':{'title':'Comments','helpText':_0x055e('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x055e('0x1e')](_0x055e('0x23'))?JSON[_0x055e('0x20')](this[_0x055e('0x1e')]('offlineForm')):{};},'set':function(_0x99a372){return this[_0x055e('0x24')](_0x055e('0x23'),JSON[_0x055e('0x1a')](_0x99a372));}},'token':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return rs[_0x055e('0x25')]();}},'autoclose':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x055e('0x3')]},'forwardOffline':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x26')},'waitingMessage':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x29')},'sendUnmanaged':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x055e('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x055e('0x3')]},'notificationTemplate':{'type':Sequelize[_0x055e('0x10')],'defaultValue':function(){return _0x055e('0x2a');}},'notificationSound':{'type':Sequelize[_0x055e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2c')},'verticalAlignment':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x055e('0x3')],'defaultValue':_0x055e('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x2e')},'defaultTitle':{'type':Sequelize[_0x055e('0x3')]},'customerAvatar':{'type':Sequelize[_0x055e('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x055e('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x055e('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x055e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x055e('0x30')},'systemAvatar':{'type':Sequelize[_0x055e('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x055e('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1012a4){if(!_0x1012a4)this[_0x055e('0x24')](_0x055e('0x32'),null);this['setDataValue'](_0x055e('0x33'),_0x1012a4);}},'vidaooEscalation':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x055e('0x3')],'allowNull':![],'defaultValue':_0x055e('0x34')},'vidaooNote':{'type':Sequelize[_0x055e('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x055e('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x055e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x055e('0x10')]}};
\ No newline at end of file
+var _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(_0x5a7908,_0x439d2c){var _0x4c7ea4=function(_0x2ce091){while(--_0x2ce091){_0x5a7908['push'](_0x5a7908['shift']());}};_0x4c7ea4(++_0x439d2c);}(_0x153f,0x15b));var _0xf153=function(_0x3af013,_0x1ac017){_0x3af013=_0x3af013-0x0;var _0x5d23f5=_0x153f[_0x3af013];return _0x5d23f5;};'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 6e7a58f..969ca17 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 _0x79c5=['server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','ChatApplication','Applications','account','applications','list','priority','asc','Contacts','ListId','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','referer','version','%s\x20%s','browser','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','messageId','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','CloudProvider','Smtp','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','offlineMessageSubject','subjectOffline','toPairsIn','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','ids','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','timezone','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','all','some','server/files/chat/iframe.ejs','utf8','URL','address','origin','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','hideWhenOffline','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','omit','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','get','ChatWebsites','UserProfileResource','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','removeDispositions','CannedAnswer','findOne','removeAnswers','addLogo','file','filename','agentAvatar','addCustomerAvatar','addSystemAvatar','join','root','sitepic','../../config/license/util','getLicense','isNil','existsSync'];(function(_0x4c5205,_0x14084a){var _0x114f3d=function(_0x2408f3){while(--_0x2408f3){_0x4c5205['push'](_0x4c5205['shift']());}};_0x114f3d(++_0x14084a);}(_0x79c5,0xb8));var _0x579c=function(_0x2f77d6,_0x815a1d){_0x2f77d6=_0x2f77d6-0x0;var _0x5bf9eb=_0x79c5[_0x2f77d6];return _0x5bf9eb;};'use strict';var BPromise=require(_0x579c('0x0'));var Mustache=require('mustache');var util=require(_0x579c('0x1'));var path=require(_0x579c('0x2'));var ejs=require(_0x579c('0x3'));var fs=require('fs');var fs_extra=require(_0x579c('0x4'));var _=require(_0x579c('0x5'));var querystring=require(_0x579c('0x6'));var Redis=require('ioredis');var qs=require(_0x579c('0x7'));var logger=require('../../config/logger')(_0x579c('0x8'));var config=require(_0x579c('0x9'));var url=require(_0x579c('0xa'));var db=require(_0x579c('0xb'))['db'];config[_0x579c('0xc')]=_[_0x579c('0xd')](config['redis'],{'host':_0x579c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x579c('0xc')]));require(_0x579c('0xf'))[_0x579c('0x10')](socket);var htmlToText=require(_0x579c('0x11'));var jayson=require(_0x579c('0x12'));var client=jayson[_0x579c('0x13')][_0x579c('0x14')]({'port':0x232c});var client9002=jayson[_0x579c('0x13')][_0x579c('0x14')]({'port':0x232a});var client9003=jayson[_0x579c('0x13')][_0x579c('0x14')]({'port':0x232b});var client9001=jayson[_0x579c('0x13')][_0x579c('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x57e32c,_0x3ed642,_0x71298,_0xea3ff4){return new BPromise(function(_0x293380,_0x5a47ea){var _0xcf9c1b=_0xea3ff4||client;return _0xcf9c1b['request'](_0x57e32c,_0x71298)[_0x579c('0x15')](function(_0x257ea5){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x3ed642,_0x579c('0x16'));logger['debug'](_0x579c('0x17'),_0x3ed642,'request\x20sent',JSON[_0x579c('0x18')](_0x257ea5));if(_0x257ea5['error']){if(_0x257ea5[_0x579c('0x19')][_0x579c('0x1a')]===0x1f4){logger[_0x579c('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x3ed642,_0x257ea5[_0x579c('0x19')][_0x579c('0x1b')]);return _0x5a47ea(_0x257ea5[_0x579c('0x19')][_0x579c('0x1b')]);}logger['error'](_0x579c('0x1c'),_0x3ed642,_0x257ea5[_0x579c('0x19')][_0x579c('0x1b')]);return _0x293380(_0x257ea5[_0x579c('0x19')][_0x579c('0x1b')]);}else{logger[_0x579c('0x1d')](_0x579c('0x1c'),_0x3ed642,_0x579c('0x16'));_0x293380(_0x257ea5[_0x579c('0x1e')][_0x579c('0x1b')]);}})[_0x579c('0x1f')](function(_0x50a4e6){logger[_0x579c('0x19')](_0x579c('0x1c'),_0x3ed642,_0x50a4e6);_0x5a47ea(_0x50a4e6);});});}function respondWithStatusCode(_0x5a68d9,_0x5a2b0a){_0x5a2b0a=_0x5a2b0a||0xcc;return function(_0x422bc0){if(_0x422bc0){return _0x5a68d9[_0x579c('0x20')](_0x5a2b0a);}return _0x5a68d9[_0x579c('0x21')](_0x5a2b0a)['end']();};}function respondWithResult(_0x4662a9,_0x425a6e){_0x425a6e=_0x425a6e||0xc8;return function(_0x32e2a9){if(_0x32e2a9){return _0x4662a9[_0x579c('0x21')](_0x425a6e)[_0x579c('0x22')](_0x32e2a9);}};}function respondWithFilteredResult(_0x5e7c02,_0x45dde4){return function(_0x2c7991){if(_0x2c7991){var _0x2bdca1=typeof _0x45dde4[_0x579c('0x23')]===_0x579c('0x24')&&typeof _0x45dde4[_0x579c('0x25')]===_0x579c('0x24');var _0x1419c2=_0x2c7991[_0x579c('0x26')];var _0x24441f=_0x2bdca1?0x0:_0x45dde4[_0x579c('0x23')];var _0x459147=_0x2bdca1?_0x2c7991[_0x579c('0x26')]:_0x45dde4[_0x579c('0x23')]+_0x45dde4['limit'];var _0x227518;if(_0x459147>=_0x1419c2){_0x459147=_0x1419c2;_0x227518=0xc8;}else{_0x227518=0xce;}_0x5e7c02[_0x579c('0x21')](_0x227518);return _0x5e7c02[_0x579c('0x27')](_0x579c('0x28'),_0x24441f+'-'+_0x459147+'/'+_0x1419c2)[_0x579c('0x22')](_0x2c7991);}return null;};}function saveUpdates(_0x2d52fd){return function(_0x1dc749){if(_0x1dc749){return _0x1dc749[_0x579c('0x29')](_0x2d52fd)[_0x579c('0x15')](function(_0x1636f5){return _0x1636f5;});}return null;};}function removeEntity(_0x5e7398){return function(_0x38bad8){if(_0x38bad8){return _0x38bad8['destroy']()['then'](function(){var _0x3808d2=_0x38bad8[_0x579c('0x2a')]({'plain':!![]});var _0xd2082a=_0x579c('0x2b');return db[_0x579c('0x2c')][_0x579c('0x2d')]({'where':{'type':_0xd2082a,'resourceId':_0x3808d2['id']}})[_0x579c('0x15')](function(){return _0x38bad8;});})[_0x579c('0x15')](function(){_0x5e7398[_0x579c('0x21')](0xcc)[_0x579c('0x2e')]();});}};}function handleEntityNotFound(_0x37f906){return function(_0x4da111){if(!_0x4da111){_0x37f906[_0x579c('0x20')](0x194);}return _0x4da111;};}function handleError(_0x22ebb8,_0x3e2d2a){_0x3e2d2a=_0x3e2d2a||0x1f4;return function(_0x37d435){logger['error'](_0x37d435[_0x579c('0x2f')]);if(_0x37d435[_0x579c('0x30')]){delete _0x37d435['name'];}_0x22ebb8[_0x579c('0x21')](_0x3e2d2a)[_0x579c('0x31')](_0x37d435);};}exports[_0x579c('0x32')]=function(_0x694e00,_0x4526e3){var _0x11fd07={'include':[{'model':db[_0x579c('0x33')],'as':_0x579c('0x34')}]},_0x5de068={},_0x3658c4={'count':0x0,'rows':[]};var _0xf2b444=_[_0x579c('0x35')](db[_0x579c('0x36')][_0x579c('0x37')],function(_0x5407e1){return{'name':_0x5407e1['fieldName'],'type':_0x5407e1[_0x579c('0x38')][_0x579c('0x39')]};});_0x5de068['model']=_[_0x579c('0x35')](_0xf2b444,'name');_0x5de068['query']=_[_0x579c('0x3a')](_0x694e00['query']);_0x5de068[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0x5de068[_0x579c('0x3d')],_0x5de068[_0x579c('0x3e')]);_0x11fd07[_0x579c('0x3f')]=_[_0x579c('0x3c')](_0x5de068[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x694e00[_0x579c('0x3e')][_0x579c('0x40')]));_0x11fd07[_0x579c('0x3f')]=_0x11fd07['attributes'][_0x579c('0x41')]?_0x11fd07[_0x579c('0x3f')]:_0x5de068['model'];if(!_0x694e00[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0x11fd07[_0x579c('0x25')]=qs[_0x579c('0x25')](_0x694e00[_0x579c('0x3e')][_0x579c('0x25')]);_0x11fd07[_0x579c('0x23')]=qs[_0x579c('0x23')](_0x694e00['query'][_0x579c('0x23')]);}_0x11fd07[_0x579c('0x44')]=qs[_0x579c('0x45')](_0x694e00[_0x579c('0x3e')][_0x579c('0x45')]);_0x11fd07[_0x579c('0x46')]=qs['filters'](_[_0x579c('0x47')](_0x694e00[_0x579c('0x3e')],_0x5de068['filters']),_0xf2b444);if(_0x694e00[_0x579c('0x3e')][_0x579c('0x48')]){_0x11fd07[_0x579c('0x46')]=_[_0x579c('0x49')](_0x11fd07[_0x579c('0x46')],{'$or':_[_0x579c('0x35')](_0xf2b444,function(_0x3e0856){if(_0x3e0856[_0x579c('0x38')]!==_0x579c('0x4a')){var _0x3583bb={};_0x3583bb[_0x3e0856['name']]={'$like':'%'+_0x694e00[_0x579c('0x3e')]['filter']+'%'};return _0x3583bb;}})});}_0x11fd07=_[_0x579c('0x49')]({},_0x11fd07,_0x694e00['options']);var _0x112d42={'where':_0x11fd07[_0x579c('0x46')]};return db[_0x579c('0x36')][_0x579c('0x26')](_0x112d42)[_0x579c('0x15')](function(_0xe8baf3){_0x3658c4[_0x579c('0x26')]=_0xe8baf3;if(_0x694e00[_0x579c('0x3e')][_0x579c('0x4b')]){_0x11fd07[_0x579c('0x4c')]=[{'all':!![]}];}return db['ChatWebsite'][_0x579c('0x4d')](_0x11fd07);})['then'](function(_0x3a7e19){_0x3658c4[_0x579c('0x4e')]=_0x3a7e19;return _0x3658c4;})[_0x579c('0x15')](respondWithFilteredResult(_0x4526e3,_0x11fd07))['catch'](handleError(_0x4526e3,null));};exports[_0x579c('0x4f')]=function(_0x4b424f,_0x4a8ed1){var _0x28497b={'raw':![],'where':{'id':_0x4b424f[_0x579c('0x50')]['id']},'include':[{'model':db[_0x579c('0x33')],'as':_0x579c('0x34')}]},_0x4064df={};_0x4064df['model']=_[_0x579c('0x3a')](db[_0x579c('0x36')][_0x579c('0x37')]);_0x4064df[_0x579c('0x3e')]=_[_0x579c('0x3a')](_0x4b424f[_0x579c('0x3e')]);_0x4064df[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0x4064df[_0x579c('0x3d')],_0x4064df['query']);_0x28497b[_0x579c('0x3f')]=_['intersection'](_0x4064df[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x4b424f[_0x579c('0x3e')][_0x579c('0x40')]));_0x28497b['attributes']=_0x28497b[_0x579c('0x3f')][_0x579c('0x41')]?_0x28497b[_0x579c('0x3f')]:_0x4064df[_0x579c('0x3d')];if(_0x4b424f['query'][_0x579c('0x4b')]){_0x28497b['include']=[{'all':!![]}];}_0x28497b=_[_0x579c('0x49')]({},_0x28497b,_0x4b424f[_0x579c('0x51')]);return db[_0x579c('0x36')][_0x579c('0x52')](_0x28497b)[_0x579c('0x15')](handleEntityNotFound(_0x4a8ed1,null))[_0x579c('0x15')](respondWithResult(_0x4a8ed1,null))['catch'](handleError(_0x4a8ed1,null));};exports[_0x579c('0x53')]=function(_0x2ea34a,_0x3e8200){return db['ChatWebsite'][_0x579c('0x53')](_0x2ea34a[_0x579c('0x54')],{})[_0x579c('0x15')](function(_0x333d45){var _0x301880=_0x2ea34a[_0x579c('0x55')][_0x579c('0x2a')]({'plain':!![]});if(!_0x301880)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x301880[_0x579c('0x56')]===_0x579c('0x55')){var _0x5eeef7=_0x333d45[_0x579c('0x2a')]({'plain':!![]});var _0x39ff7d=_0x579c('0x2b');return db[_0x579c('0x57')][_0x579c('0x52')]({'where':{'name':_0x39ff7d,'userProfileId':_0x301880[_0x579c('0x58')]},'raw':!![]})['then'](function(_0x288e4f){if(_0x288e4f&&_0x288e4f[_0x579c('0x59')]===0x0){return db[_0x579c('0x2c')][_0x579c('0x53')]({'name':_0x5eeef7[_0x579c('0x30')],'resourceId':_0x5eeef7['id'],'type':_0x288e4f[_0x579c('0x30')],'sectionId':_0x288e4f['id']},{})['then'](function(){return _0x333d45;});}else{return _0x333d45;}})[_0x579c('0x1f')](function(_0x332724){logger[_0x579c('0x19')](_0x579c('0x5a'),_0x332724);throw _0x332724;});}return _0x333d45;})['then'](respondWithResult(_0x3e8200,0xc9))[_0x579c('0x1f')](handleError(_0x3e8200,null));};exports['update']=function(_0x1afed4,_0x103964){if(_0x1afed4['body']['id']){delete _0x1afed4[_0x579c('0x54')]['id'];}return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x1afed4['params']['id']},'include':[{'model':db['Pause'],'as':_0x579c('0x34')}]})[_0x579c('0x15')](handleEntityNotFound(_0x103964,null))['then'](saveUpdates(_0x1afed4[_0x579c('0x54')],null))[_0x579c('0x15')](respondWithResult(_0x103964,null))['catch'](handleError(_0x103964,null));};exports[_0x579c('0x2d')]=function(_0x3da66e,_0x2359ad){return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x3da66e['params']['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x2359ad,null))[_0x579c('0x15')](removeEntity(_0x2359ad,null))[_0x579c('0x1f')](handleError(_0x2359ad,null));};exports[_0x579c('0x5b')]=function(_0x55ee02,_0x3b010d){return db[_0x579c('0x36')][_0x579c('0x5b')]()[_0x579c('0x15')](respondWithResult(_0x3b010d,null))[_0x579c('0x1f')](handleError(_0x3b010d,null));};exports[_0x579c('0x5c')]=function(_0x417f90,_0x50878f){if(_0x417f90['body']['id']){delete _0x417f90[_0x579c('0x54')]['id'];}return db['ChatWebsite'][_0x579c('0x52')]({'where':{'id':_0x417f90[_0x579c('0x50')]['id']}})['then'](handleEntityNotFound(_0x50878f,null))[_0x579c('0x15')](function(_0x3b37cd){if(_0x3b37cd){_0x417f90[_0x579c('0x54')][_0x579c('0x5d')]=_0x3b37cd['id'];return db[_0x579c('0x5e')]['create'](_0x417f90['body']);}})[_0x579c('0x15')](respondWithResult(_0x50878f,null))[_0x579c('0x1f')](handleError(_0x50878f,null));};exports[_0x579c('0x5f')]=function(_0x15c8db,_0x533ca5){var _0x446f4d={'raw':![],'where':{}};var _0xef0072={};var _0xa96ec4={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x15c8db[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x533ca5,null))[_0x579c('0x15')](function(_0x33edfc){if(_0x33edfc){_0xef0072['model']=_[_0x579c('0x3a')](db[_0x579c('0x5e')][_0x579c('0x37')]);_0xef0072['query']=_[_0x579c('0x3a')](_0x15c8db[_0x579c('0x3e')]);_0xef0072[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0xef0072['model'],_0xef0072[_0x579c('0x3e')]);_0x446f4d[_0x579c('0x3f')]=_[_0x579c('0x3c')](_0xef0072['model'],qs['fields'](_0x15c8db[_0x579c('0x3e')][_0x579c('0x40')]));_0x446f4d[_0x579c('0x3f')]=_0x446f4d[_0x579c('0x3f')][_0x579c('0x41')]?_0x446f4d[_0x579c('0x3f')]:_0xef0072[_0x579c('0x3d')];if(!_0x15c8db[_0x579c('0x3e')][_0x579c('0x42')]('nolimit')){_0x446f4d[_0x579c('0x25')]=qs[_0x579c('0x25')](_0x15c8db[_0x579c('0x3e')][_0x579c('0x25')]);_0x446f4d[_0x579c('0x23')]=qs[_0x579c('0x23')](_0x15c8db[_0x579c('0x3e')][_0x579c('0x23')]);}_0x446f4d[_0x579c('0x44')]=qs['sort'](_0x15c8db[_0x579c('0x3e')]['sort']);_0x446f4d[_0x579c('0x46')]=qs[_0x579c('0x3b')](_[_0x579c('0x47')](_0x15c8db['query'],_0xef0072[_0x579c('0x3b')]));_0x446f4d[_0x579c('0x46')][_0x579c('0x5d')]=_0x33edfc['id'];if(_0x15c8db[_0x579c('0x3e')]['filter']){_0x446f4d[_0x579c('0x46')]=_[_0x579c('0x49')](_0x446f4d[_0x579c('0x46')],{'$or':_['map'](_0x446f4d[_0x579c('0x3f')],function(_0x3fb859){var _0x1a63b5={};_0x1a63b5[_0x3fb859]={'$like':'%'+_0x15c8db[_0x579c('0x3e')][_0x579c('0x48')]+'%'};return _0x1a63b5;})});}_0x446f4d=_['merge']({},_0x446f4d,_0x15c8db[_0x579c('0x51')]);return db['Disposition'][_0x579c('0x26')]({'where':_0x446f4d['where']})[_0x579c('0x15')](function(_0x10cd13){_0xa96ec4[_0x579c('0x26')]=_0x10cd13;if(_0x15c8db[_0x579c('0x3e')][_0x579c('0x4b')]){_0x446f4d['include']=[{'all':!![]}];}return db[_0x579c('0x5e')][_0x579c('0x4d')](_0x446f4d);})[_0x579c('0x15')](function(_0xc8becf){_0xa96ec4[_0x579c('0x4e')]=_0xc8becf;return _0xa96ec4;});}})['then'](respondWithFilteredResult(_0x533ca5,_0x446f4d))['catch'](handleError(_0x533ca5,null));};exports[_0x579c('0x60')]=function(_0x17aa5d,_0x10aa11){return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x17aa5d['params']['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x10aa11,null))['then'](function(_0x50dad3){if(_0x50dad3){return _0x50dad3[_0x579c('0x60')](_0x17aa5d[_0x579c('0x3e')]['ids']);}})['then'](respondWithStatusCode(_0x10aa11,null))[_0x579c('0x1f')](handleError(_0x10aa11,null));};exports['addAnswer']=function(_0x3d733f,_0x4d745c){if(_0x3d733f['body']['id']){delete _0x3d733f[_0x579c('0x54')]['id'];}return db['ChatWebsite'][_0x579c('0x52')]({'where':{'id':_0x3d733f[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x4d745c,null))[_0x579c('0x15')](function(_0x3377b8){if(_0x3377b8){_0x3d733f[_0x579c('0x54')][_0x579c('0x5d')]=_0x3377b8['id'];return db[_0x579c('0x61')][_0x579c('0x53')](_0x3d733f[_0x579c('0x54')]);}})[_0x579c('0x15')](respondWithResult(_0x4d745c,null))[_0x579c('0x1f')](handleError(_0x4d745c,null));};exports['getAnswers']=function(_0x2d2b26,_0x3d55e4){var _0x5ba109={'raw':![],'where':{}};var _0x354c7d={};var _0x36e10d={'count':0x0,'rows':[]};return db[_0x579c('0x36')][_0x579c('0x62')]({'where':{'id':_0x2d2b26[_0x579c('0x50')]['id']}})['then'](handleEntityNotFound(_0x3d55e4,null))[_0x579c('0x15')](function(_0xcf5a3d){if(_0xcf5a3d){_0x354c7d[_0x579c('0x3d')]=_[_0x579c('0x3a')](db[_0x579c('0x61')][_0x579c('0x37')]);_0x354c7d['query']=_['keys'](_0x2d2b26[_0x579c('0x3e')]);_0x354c7d[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0x354c7d[_0x579c('0x3d')],_0x354c7d[_0x579c('0x3e')]);_0x5ba109[_0x579c('0x3f')]=_[_0x579c('0x3c')](_0x354c7d[_0x579c('0x3d')],qs['fields'](_0x2d2b26[_0x579c('0x3e')][_0x579c('0x40')]));_0x5ba109['attributes']=_0x5ba109[_0x579c('0x3f')][_0x579c('0x41')]?_0x5ba109[_0x579c('0x3f')]:_0x354c7d[_0x579c('0x3d')];if(!_0x2d2b26[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0x5ba109[_0x579c('0x25')]=qs[_0x579c('0x25')](_0x2d2b26[_0x579c('0x3e')][_0x579c('0x25')]);_0x5ba109[_0x579c('0x23')]=qs[_0x579c('0x23')](_0x2d2b26[_0x579c('0x3e')][_0x579c('0x23')]);}_0x5ba109[_0x579c('0x44')]=qs[_0x579c('0x45')](_0x2d2b26[_0x579c('0x3e')][_0x579c('0x45')]);_0x5ba109['where']=qs[_0x579c('0x3b')](_[_0x579c('0x47')](_0x2d2b26[_0x579c('0x3e')],_0x354c7d[_0x579c('0x3b')]));_0x5ba109[_0x579c('0x46')][_0x579c('0x5d')]=_0xcf5a3d['id'];if(_0x2d2b26['query']['filter']){_0x5ba109[_0x579c('0x46')]=_['merge'](_0x5ba109[_0x579c('0x46')],{'$or':_[_0x579c('0x35')](_0x5ba109['attributes'],function(_0x19cbea){var _0x41aa5b={};_0x41aa5b[_0x19cbea]={'$like':'%'+_0x2d2b26[_0x579c('0x3e')][_0x579c('0x48')]+'%'};return _0x41aa5b;})});}_0x5ba109=_[_0x579c('0x49')]({},_0x5ba109,_0x2d2b26[_0x579c('0x51')]);return db[_0x579c('0x61')][_0x579c('0x26')]({'where':_0x5ba109[_0x579c('0x46')]})[_0x579c('0x15')](function(_0x39efcc){_0x36e10d[_0x579c('0x26')]=_0x39efcc;if(_0x2d2b26[_0x579c('0x3e')][_0x579c('0x4b')]){_0x5ba109['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x579c('0x4d')](_0x5ba109);})['then'](function(_0x1e4ad0){_0x36e10d[_0x579c('0x4e')]=_0x1e4ad0;return _0x36e10d;});}})[_0x579c('0x15')](respondWithFilteredResult(_0x3d55e4,_0x5ba109))[_0x579c('0x1f')](handleError(_0x3d55e4,null));};exports['removeAnswers']=function(_0x403298,_0x36060e){return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x403298[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x36060e,null))[_0x579c('0x15')](function(_0x3d291a){if(_0x3d291a){return _0x3d291a[_0x579c('0x63')](_0x403298['query']['ids']);}})[_0x579c('0x15')](respondWithStatusCode(_0x36060e,null))[_0x579c('0x1f')](handleError(_0x36060e,null));};exports[_0x579c('0x64')]=function(_0x30a43b,_0x54555f){_0x30a43b[_0x579c('0x54')]['sitepic']=_0x30a43b[_0x579c('0x65')][_0x579c('0x66')];return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x30a43b[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x54555f,null))[_0x579c('0x15')](saveUpdates(_0x30a43b['body'],null))[_0x579c('0x15')](respondWithResult(_0x54555f,null))[_0x579c('0x1f')](handleError(_0x54555f,null));};exports['addAvatar']=function(_0x7cb127,_0xfccc4a){_0x7cb127[_0x579c('0x54')][_0x579c('0x67')]=_0x7cb127[_0x579c('0x65')][_0x579c('0x66')];return db['ChatWebsite'][_0x579c('0x52')]({'where':{'id':_0x7cb127[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0xfccc4a,null))[_0x579c('0x15')](saveUpdates(_0x7cb127[_0x579c('0x54')],null))[_0x579c('0x15')](respondWithResult(_0xfccc4a,null))[_0x579c('0x1f')](handleError(_0xfccc4a,null));};exports[_0x579c('0x68')]=function(_0x147a06,_0x5c2ba5){_0x147a06['body']['customerAvatar']=_0x147a06[_0x579c('0x65')]['filename'];return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x147a06['params']['id']}})['then'](handleEntityNotFound(_0x5c2ba5,null))[_0x579c('0x15')](saveUpdates(_0x147a06[_0x579c('0x54')],null))[_0x579c('0x15')](respondWithResult(_0x5c2ba5,null))[_0x579c('0x1f')](handleError(_0x5c2ba5,null));};exports[_0x579c('0x69')]=function(_0xa37af0,_0x8c97cb){_0xa37af0[_0x579c('0x54')]['systemAvatar']=_0xa37af0[_0x579c('0x65')][_0x579c('0x66')];return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0xa37af0[_0x579c('0x50')]['id']}})['then'](handleEntityNotFound(_0x8c97cb,null))[_0x579c('0x15')](saveUpdates(_0xa37af0['body'],null))[_0x579c('0x15')](respondWithResult(_0x8c97cb,null))['catch'](handleError(_0x8c97cb,null));};exports['getLogo']=function(_0x3c81a2,_0xd789d9){var _0x1da1cc=path[_0x579c('0x6a')](config[_0x579c('0x6b')],'server/files/images/logos/default_logo.svg');var _0x4719b2={'where':{'id':_0x3c81a2[_0x579c('0x50')]['id']},'attributes':['id',_0x579c('0x6c')],'raw':!![]};var _0x48da20=![];return require(_0x579c('0x6d'))[_0x579c('0x6e')]()[_0x579c('0x15')](function(_0x353ba8){if(_0x353ba8){_0x48da20=_0x353ba8['custom'];}})[_0x579c('0x15')](function(){return db[_0x579c('0x36')][_0x579c('0x52')](_0x4719b2);})['then'](handleEntityNotFound(_0xd789d9,null))[_0x579c('0x15')](function(_0x4a5097){if(_0x4a5097){if(!_[_0x579c('0x6f')](_0x4a5097[_0x579c('0x6c')])){if(fs[_0x579c('0x70')](path[_0x579c('0x6a')](config[_0x579c('0x6b')],_0x579c('0x71'),_0x4a5097[_0x579c('0x6c')]))&&_0x48da20){_0x1da1cc=path['join'](config[_0x579c('0x6b')],_0x579c('0x71'),_0x4a5097[_0x579c('0x6c')]);}}return _0xd789d9[_0x579c('0x72')](_0x1da1cc);}})['catch'](handleError(_0xd789d9,null));};exports[_0x579c('0x73')]=function(_0x40da02,_0x5be62f){var _0xe967ea=path[_0x579c('0x6a')](config['root'],_0x579c('0x74'));var _0x20ab1e={'where':{'id':_0x40da02[_0x579c('0x50')]['id']},'attributes':['id',_0x579c('0x67')],'raw':!![]};return db[_0x579c('0x36')][_0x579c('0x52')](_0x20ab1e)[_0x579c('0x15')](handleEntityNotFound(_0x5be62f,null))[_0x579c('0x15')](function(_0x1fc9c0){if(_0x1fc9c0){if(!_['isNil'](_0x1fc9c0[_0x579c('0x67')])){if(fs[_0x579c('0x70')](path[_0x579c('0x6a')](config[_0x579c('0x6b')],_0x579c('0x75'),_0x1fc9c0[_0x579c('0x67')]))){_0xe967ea=path[_0x579c('0x6a')](config[_0x579c('0x6b')],_0x579c('0x75'),_0x1fc9c0[_0x579c('0x67')]);}}return _0x5be62f[_0x579c('0x72')](_0xe967ea);}})[_0x579c('0x1f')](handleError(_0x5be62f,null));};exports[_0x579c('0x76')]=function(_0x470673,_0x303eda){var _0x57bb06=path[_0x579c('0x6a')](config['root'],_0x579c('0x77'));var _0x3574dd={'where':{'id':_0x470673[_0x579c('0x50')]['id']},'attributes':['id',_0x579c('0x78'),'showCustomerAvatar'],'raw':!![]};return db[_0x579c('0x36')]['find'](_0x3574dd)['then'](handleEntityNotFound(_0x303eda,null))[_0x579c('0x15')](function(_0x229a0a){if(_0x229a0a){if(!_[_0x579c('0x6f')](_0x229a0a[_0x579c('0x78')])){if(fs[_0x579c('0x70')](path[_0x579c('0x6a')](config['root'],_0x579c('0x75'),_0x229a0a['customerAvatar']))&&_0x229a0a[_0x579c('0x79')]){_0x57bb06=path['join'](config[_0x579c('0x6b')],'server/files/images/avatars/',_0x229a0a[_0x579c('0x78')]);}}return _0x303eda[_0x579c('0x72')](_0x57bb06);}})[_0x579c('0x1f')](handleError(_0x303eda,null));};exports[_0x579c('0x7a')]=function(_0x26e40c,_0x1b0fbb){var _0x226159=path[_0x579c('0x6a')](config[_0x579c('0x6b')],_0x579c('0x7b'));var _0x38c878={'where':{'id':_0x26e40c[_0x579c('0x50')]['id']},'attributes':['id',_0x579c('0x7c')],'raw':!![]};return db[_0x579c('0x36')][_0x579c('0x52')](_0x38c878)[_0x579c('0x15')](handleEntityNotFound(_0x1b0fbb,null))[_0x579c('0x15')](function(_0x1c8d57){if(_0x1c8d57){if(!_[_0x579c('0x6f')](_0x1c8d57['systemAvatar'])){if(fs[_0x579c('0x70')](path[_0x579c('0x6a')](config[_0x579c('0x6b')],_0x579c('0x75'),_0x1c8d57['systemAvatar']))){_0x226159=path[_0x579c('0x6a')](config['root'],_0x579c('0x75'),_0x1c8d57[_0x579c('0x7c')]);}}return _0x1b0fbb[_0x579c('0x72')](_0x226159);}})[_0x579c('0x1f')](handleError(_0x1b0fbb,null));};exports['notify']=function(_0x36136a,_0x5817f2){var _0x2fbc0c=require(_0x579c('0x7d'));var _0x342eda=new _0x2fbc0c();var _0x87264c=_0x342eda[_0x579c('0x7e')](_0x36136a[_0x579c('0x7f')][_0x579c('0x80')])['getResult']();var _0x1f34fe={'body':_0x36136a[_0x579c('0x54')],'channel':_0x579c('0x81')};var _0x3f016d=[];var _0x4da428=[];var _0x5cc70c={};var _0x2888c1=![];return db[_0x579c('0x82')][_0x579c('0x5b')]()[_0x579c('0x15')](function(_0x38e9a2){if(!_0x38e9a2){throw new db[(_0x579c('0x83'))]['ValidationError']('no\x20available\x20attributes');}_0x3f016d=_[_0x579c('0x84')](_[_0x579c('0x3a')](_0x38e9a2),[_0x579c('0x85'),'updatedAt']);_0x4da428=_['difference'](_['keys'](_0x38e9a2),[_0x579c('0x85'),_0x579c('0x86'),_0x579c('0x87'),'ListId']);if(_0x36136a['body']['id']){delete _0x36136a['body']['id'];}if(_[_0x579c('0x6f')](_0x36136a[_0x579c('0x54')][_0x579c('0x88')])){throw new db[(_0x579c('0x83'))][(_0x579c('0x89'))](_0x579c('0x8a'));}if(_[_0x579c('0x6f')](_0x36136a['body'][_0x579c('0x54')])||_0x36136a['body'][_0x579c('0x54')]===''){throw new db[(_0x579c('0x83'))][(_0x579c('0x89'))](_0x579c('0x8b'));}if(_['isNil'](_0x36136a[_0x579c('0x54')]['mapKey'])){throw new db['Sequelize'][(_0x579c('0x89'))](_0x579c('0x8c')+_0x4da428);}if(!_[_0x579c('0x8d')](_0x4da428,_0x36136a['body'][_0x579c('0x8e')])){throw new db[(_0x579c('0x83'))][(_0x579c('0x89'))](_0x579c('0x8f')+_0x4da428);}_0x5cc70c[_0x36136a['body'][_0x579c('0x8e')]]=_0x36136a[_0x579c('0x54')][_0x579c('0x88')];})['then'](function(){return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x36136a[_0x579c('0x50')]['id']},'include':[{'model':db[_0x579c('0x90')],'as':_0x579c('0x91'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5cc70c,'limit':0x1,'order':[[_0x579c('0x86'),'DESC']]}]},{'model':db[_0x579c('0x92')],'as':_0x579c('0x93')}]});})['then'](handleEntityNotFound(_0x5817f2,null))['then'](function(_0x13aa92){if(_0x13aa92&&_0x13aa92[_0x579c('0x91')]){_0x1f34fe[_0x579c('0x94')]=_0x13aa92;_0x1f34fe[_0x579c('0x95')]=_0x13aa92['Applications'];_0x1f34fe[_0x579c('0x96')]=_0x13aa92[_0x579c('0x91')];_0x1f34fe[_0x579c('0x95')]=_['orderBy'](_0x1f34fe[_0x579c('0x95')],[_0x579c('0x97')],[_0x579c('0x98')]);if(_0x1f34fe[_0x579c('0x94')][_0x579c('0x93')]){delete _0x1f34fe['account'][_0x579c('0x93')];}if(_0x1f34fe['account'][_0x579c('0x91')]&&_0x1f34fe['account'][_0x579c('0x91')]['Contacts'][_0x579c('0x41')]){return _0x1f34fe[_0x579c('0x94')][_0x579c('0x91')][_0x579c('0x99')][0x0];}var _0x23aa12=_[_0x579c('0xd')](_0x36136a[_0x579c('0x54')],{'firstName':_0x36136a[_0x579c('0x54')][_0x579c('0x88')],'ListId':_0x13aa92[_0x579c('0x9a')]});_0x23aa12[_0x36136a[_0x579c('0x54')][_0x579c('0x8e')]]=_0x36136a[_0x579c('0x54')][_0x579c('0x88')];return db['CmContact'][_0x579c('0x53')](_0x23aa12,{'fields':_0x3f016d,'raw':!![]});}})['then'](handleEntityNotFound(_0x5817f2,null))[_0x579c('0x15')](function(_0xe18e9e){_0x1f34fe['contact']=_0xe18e9e;var _0x126557=_0x36136a[_0x579c('0x54')][_0x579c('0x9b')];if(_0x36136a['headers'][_0x579c('0x9c')]){_0x126557=_0x36136a[_0x579c('0x7f')][_0x579c('0x9c')];}else if(_0x36136a[_0x579c('0x7f')]['x-forwarded-for']){_0x126557=_[_0x579c('0x9d')](_0x36136a['headers'][_0x579c('0x9e')][_0x579c('0x9f')](','));}if(_0xe18e9e){var _0x45dbfa={'ContactId':_0xe18e9e['id'],'ChatWebsiteId':_0x36136a[_0x579c('0x50')]['id'],'from':(_0xe18e9e[_0x579c('0xa0')]||'')+'\x20'+(_0xe18e9e['lastName']||''),'customerIp':_0x126557,'customerPort':_0x36136a[_0x579c('0x7f')][_0x579c('0xa1')]?_0x36136a[_0x579c('0x7f')][_0x579c('0xa1')]:null,'referer':_0x36136a[_0x579c('0x54')][_0x579c('0xa2')],'browserName':_0x87264c['browser']['name']&&_0x87264c['browser'][_0x579c('0xa3')]?util['format'](_0x579c('0xa4'),_0x87264c[_0x579c('0xa5')]['name'],_0x87264c[_0x579c('0xa5')][_0x579c('0xa3')]):_0x579c('0xa6'),'browserVersion':_0x87264c[_0x579c('0xa5')][_0x579c('0xa3')]||'unknown','osName':util[_0x579c('0xa7')](_0x579c('0xa4'),_0x87264c['os'][_0x579c('0x30')],_0x87264c['os']['version']),'osVersion':_0x87264c['os'][_0x579c('0xa3')],'deviceModel':_0x87264c['device'][_0x579c('0x3d')]&&_0x87264c[_0x579c('0xa8')][_0x579c('0xa9')]?util[_0x579c('0xa7')](_0x579c('0xaa'),_0x87264c['device'][_0x579c('0x3d')],_0x87264c[_0x579c('0xa8')][_0x579c('0xa9')],_0x87264c[_0x579c('0xa8')][_0x579c('0x38')]):null,'deviceVendor':_0x87264c['device'][_0x579c('0xa9')],'deviceType':_0x87264c[_0x579c('0xa8')][_0x579c('0x38')],'formData':JSON[_0x579c('0x18')](_0x36136a['body'])};var _0x7c0c7a={'ChatWebsiteId':_0x36136a[_0x579c('0x50')]['id'],'closed':![]};if(_0x36136a['body'][_0x579c('0xab')]){_0x7c0c7a[_0x579c('0xab')]=_0x36136a['body'][_0x579c('0xab')];return db['ChatInteraction'][_0x579c('0x52')]({'where':_0x7c0c7a})[_0x579c('0x15')](function(_0xe3b3c4){if(_0xe3b3c4){return[_0xe3b3c4,![]];}_0x45dbfa['threadId']=_0x36136a['body'][_0x579c('0xab')];_0x45dbfa[_0x579c('0xac')]=_0x36136a['body']['externalUrl'];return db[_0x579c('0xad')][_0x579c('0x53')](_0x45dbfa)['then'](function(_0x97d789){return[_0x97d789,!![]];});});}_0x7c0c7a[_0x579c('0xae')]=_0xe18e9e['id'];if(_0x36136a[_0x579c('0x54')][_0x579c('0xaf')]&&_0x36136a[_0x579c('0x54')]['interaction']['id']){_0x7c0c7a['id']=_0x36136a['body'][_0x579c('0xaf')]['id'];return db[_0x579c('0xad')][_0x579c('0x52')]({'where':_0x7c0c7a})[_0x579c('0x15')](function(_0x3ee520){if(_0x3ee520){return[_0x3ee520,![]];}return db[_0x579c('0xad')][_0x579c('0x53')](_0x45dbfa)[_0x579c('0x15')](function(_0x407d6b){return[_0x407d6b,!![]];});});}return db[_0x579c('0xad')][_0x579c('0x53')](_0x45dbfa)[_0x579c('0x15')](function(_0x2d76ce){return[_0x2d76ce,!![]];});}})[_0x579c('0xb0')](function(_0xd80713,_0x1f2111){if(_0xd80713){_0x2888c1=_0x1f2111;if(!_0x1f2111){var _0x522be3={'from':(_0x1f34fe[_0x579c('0xb1')][_0x579c('0xa0')]||'')+'\x20'+(_0x1f34fe[_0x579c('0xb1')]['lastName']||'')};if(_0x36136a[_0x579c('0x54')][_0x579c('0xab')]&&_0x36136a[_0x579c('0x54')][_0x579c('0xb2')]&&_0x36136a['body']['threadId']!=_0x36136a[_0x579c('0x54')][_0x579c('0xb2')]){_0x522be3[_0x579c('0xab')]=_0x36136a[_0x579c('0x54')][_0x579c('0xb2')];}return _0xd80713[_0x579c('0x29')](_0x522be3);}else{return _0xd80713;}}})[_0x579c('0x15')](function(_0x3b1909){_0x1f34fe[_0x579c('0xaf')]=_0x3b1909['get']({'plain':!![]});_0x1f34fe[_0x579c('0xaf')]['created']=_0x2888c1;if(_0x1f34fe[_0x579c('0xaf')]['created']){if(_0x1f34fe['account'][_0x579c('0xb3')]){_0x1f34fe['applications'][_0x579c('0xb4')]({'id':0x0,'priority':_0x1f34fe[_0x579c('0x95')][_0x579c('0x41')]+0x1,'app':_0x579c('0xb5'),'appdata':_0x579c('0xb6'),'interval':_0x579c('0xb7')});}}return db['ChatMessage'][_0x579c('0x53')]({'body':_0x36136a[_0x579c('0x54')]['body'],'ChatWebsiteId':_0x36136a[_0x579c('0x50')]['id'],'ChatInteractionId':_0x3b1909['id'],'direction':'in','ContactId':_0x1f34fe['contact']['id'],'AttachmentId':_0x36136a[_0x579c('0x54')][_0x579c('0xb8')]});})[_0x579c('0x15')](function(_0x26d4c0){_0x1f34fe['message']=_0x26d4c0;if(_0x1f34fe['interaction'][_0x579c('0xb9')]){return db['User'][_0x579c('0x52')]({'attributes':['id',_0x579c('0x30')],'where':{'id':_0x1f34fe[_0x579c('0xaf')]['UserId']}})[_0x579c('0x15')](function(_0x4408be){if(_0x4408be){_0x1f34fe[_0x579c('0x95')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4408be[_0x579c('0x30')]+','+(_0x1f34fe[_0x579c('0x94')][_0x579c('0xba')]||0xa),'interval':_0x579c('0xb7')});_0x1f34fe[_0x579c('0xbb')]=!![];}return respondWithRpcPromise('Start',_0x579c('0xbc'),_0x1f34fe);});}return respondWithRpcPromise(_0x579c('0xbd'),_0x579c('0xbc'),_0x1f34fe);})[_0x579c('0x15')](function(_0x24a080){respondWithRpcPromise(_0x579c('0xbe'),_0x579c('0xbe'),{'event':'notify','message':_0x24a080},client9002);return _0x24a080;})[_0x579c('0x15')](respondWithResult(_0x5817f2,null))[_0x579c('0x1f')](handleError(_0x5817f2,null));};exports[_0x579c('0xbf')]=function(_0x22f930,_0xb6e3d9){var _0xc5d770,_0xf64aac,_0x4e44d9;var _0x26ce63=[];var _0x52288a={};var _0x5abf65=_0x22f930[_0x579c('0xc0')]||[];var _0x29bb9d=[];var _0x125fb7;return db[_0x579c('0x82')][_0x579c('0x5b')]()[_0x579c('0x15')](function(_0x246c91){if(!_0x246c91){throw new db[(_0x579c('0x83'))]['ValidationError']('no\x20available\x20attributes');}_0x26ce63=_[_0x579c('0x84')](_['keys'](_0x246c91),[_0x579c('0x85'),_0x579c('0x86'),_0x579c('0x87'),_0x579c('0x9a')]);if(_0x22f930[_0x579c('0x54')]['id']){delete _0x22f930[_0x579c('0x54')]['id'];}if(_[_0x579c('0x6f')](_0x22f930[_0x579c('0x54')][_0x579c('0x88')])){throw _0xb6e3d9[_0x579c('0x21')](0x1f4)['send'](new db[(_0x579c('0x83'))][(_0x579c('0x89'))](_0x579c('0x8a')));}if(_[_0x579c('0x6f')](_0x22f930[_0x579c('0x54')]['body'])||_0x22f930[_0x579c('0x54')][_0x579c('0x54')]===''){throw _0xb6e3d9[_0x579c('0x21')](0x1f4)[_0x579c('0x31')](new db[(_0x579c('0x83'))]['ValidationError'](_0x579c('0x8b')));}if(_['isNil'](_0x22f930[_0x579c('0x54')][_0x579c('0xc1')])){throw _0xb6e3d9[_0x579c('0x21')](0x1f4)['send'](new db['Sequelize'][(_0x579c('0x89'))](_0x579c('0xc2')+_0x26ce63));}if(!_['includes'](_0x26ce63,_0x22f930[_0x579c('0x54')][_0x579c('0xc1')])){throw _0xb6e3d9[_0x579c('0x21')](0x1f4)['send'](new db['Sequelize'][(_0x579c('0x89'))](_0x579c('0xc3')+_0x26ce63));}_0x52288a[_0x22f930[_0x579c('0x54')]['mapKeyOffline']]=_0x22f930[_0x579c('0x54')]['from'];})['then'](function(){return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x22f930[_0x579c('0x50')]['id']},'include':[{'model':db[_0x579c('0x90')],'as':_0x579c('0x91')},{'model':db['MailAccount'],'as':_0x579c('0xc4')}]});})['then'](handleEntityNotFound(_0xb6e3d9,null))['then'](function(_0x3ed301){if(_0x3ed301&&_0x3ed301[_0x579c('0x91')]){_0xf64aac=_0x3ed301;var _0x6e3600=_[_0x579c('0xd')](_0x22f930[_0x579c('0x54')],{'firstName':_0x22f930[_0x579c('0x54')][_0x579c('0x88')],'phone':_0x22f930[_0x579c('0x54')]['from'],'ListId':_0x3ed301[_0x579c('0x9a')]});_0x6e3600[_0x22f930[_0x579c('0x54')][_0x579c('0xc1')]]=_0x22f930[_0x579c('0x54')][_0x579c('0x88')];return db[_0x579c('0x82')][_0x579c('0xc5')]({'where':_0x52288a,'defaults':_0x6e3600});}})[_0x579c('0xb0')](function(_0x4f1e27){if(_0x4f1e27){_0x4e44d9=_0x4f1e27;var _0x8adb3d=fs[_0x579c('0xc6')](path[_0x579c('0x6a')](config[_0x579c('0x6b')],_0x579c('0xc7')),'utf8');var _0x10c3d2=ejs[_0x579c('0xc8')](_0x8adb3d,{'body':_[_0x579c('0xc9')](_0x22f930[_0x579c('0x54')][_0x579c('0x54')]),'bodyTitle':_0xf64aac[_0x579c('0xca')]});return db['ChatOfflineMessage'][_0x579c('0x53')]({'body':_0x10c3d2,'plainBody':htmlToText[_0x579c('0xcb')](_0x10c3d2),'ContactId':_0x4f1e27['id'],'ChatWebsiteId':_0xf64aac['id']});}})[_0x579c('0x15')](function(_0x7982a){_0x125fb7=_0x7982a;if(_0x5abf65[_0x579c('0x41')]){var _0x34fe88=_0x5abf65['map'](function(_0x1c4f25){return{'name':_0x1c4f25[_0x579c('0xcc')],'basename':_0x1c4f25[_0x579c('0x66')],'type':_0x1c4f25[_0x579c('0xcd')],'ChatOfflineMessageId':_0x7982a['id']};});_0x29bb9d=_0x34fe88['map'](_0x390002=>{var _0x45ce1b={'filename':_0x390002[_0x579c('0x30')],'path':path['join'](config['root'],_0x579c('0xce'),_0x579c('0xc0'),_0x579c('0xcf'),_0x579c('0xd0'),_0x390002['basename'])};return _0x45ce1b;});if(!_0xf64aac[_0x579c('0xd1')]){return db[_0x579c('0xd2')][_0x579c('0xd3')](function(_0x363be0){return db[_0x579c('0xd4')]['bulkCreate'](_0x34fe88,{'transaction':_0x363be0});});}}})[_0x579c('0x15')](function(){if(_0x125fb7){_0xc5d770=_0x125fb7;return db[_0x579c('0xc4')][_0x579c('0x62')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x579c('0xd5'),'raw':!![]}]}]});}})['then'](function(_0x478f50){if(_0x478f50&&_0x478f50[_0x579c('0xd6')]&&_0xf64aac[_0x579c('0xd7')]&&_0xf64aac[_0x579c('0xd8')]){var _0x568446=_0x478f50[_0x579c('0xd9')]();return respondWithRpcPromise(_0x579c('0xda'),_0x579c('0xdb'),{'account':_0x568446,'message':{'from':util[_0x579c('0xa7')]('\x22%s\x22\x20<%s>',_0x478f50[_0x579c('0x30')],_0x478f50[_0x579c('0xdc')]||_0x478f50[_0x579c('0xd6')][_0x579c('0x55')]),'to':_0xf64aac['forwardOfflineAddress'],'subject':_0xf64aac[_0x579c('0xdd')],'html':_0xc5d770[_0x579c('0x54')],'attachments':_0x29bb9d}},client9003)['then'](function(){return _0xc5d770;})['catch'](function(_0x440e27){logger[_0x579c('0x19')](_0x440e27);});}})[_0x579c('0x15')](function(){if(_0xf64aac&&_0xf64aac[_0x579c('0xd1')]&&_0xf64aac['MailAccountId']){var _0x551f6a=[];if(_0x5abf65[_0x579c('0x41')]){_0x551f6a=_0x5abf65['map'](function(_0x5d7d8f){return{'name':_0x5d7d8f[_0x579c('0xcc')],'basename':_0x5d7d8f[_0x579c('0x66')],'type':_0x5d7d8f[_0x579c('0xcd')],'ChatOfflineMessageId':_0x125fb7['id']};});}var _0x543c9a;if(!_[_0x579c('0x6f')](_0xf64aac[_0x579c('0xde')])){var _0x4b8c5a=_[_0x579c('0x35')](_0x22f930[_0x579c('0x54')],function(_0x2b0927){return _0x2b0927;});var _0x3ad619=_[_0x579c('0xdf')](_0x4b8c5a)[0x0];var _0x407317=_['mapValues'](_0x3ad619,function(_0x3fc490){return _0x3fc490;});_0x543c9a=_0x407317[0x1][_0xf64aac['subjectOffline']];}var _0x17d1c9={'from':_0x4e44d9['email'],'firstName':_0x4e44d9['firstName'],'lastName':_0x4e44d9['lastName'],'mapKey':_0x579c('0xdc'),'message':{'from':_0x4e44d9[_0x579c('0xdc')],'to':_0xf64aac[_0x579c('0xc4')][_0x579c('0xdc')],'cc':'','subject':_['isNil'](_0x543c9a)?_0xf64aac[_0x579c('0xdd')]:_0x543c9a,'messageId':'','sentAt':new Date(),'attach':_0x551f6a[_0x579c('0x41')],'attachments':_0x551f6a,'originChannel':_0x579c('0xe0'),'ChatWebsiteId':_0xf64aac['id'],'ChatOfflineMessageId':_0xc5d770['id'],'originTo':_0xf64aac['MailAccount'][_0x579c('0xdc')]},'body':_0xc5d770[_0x579c('0x54')]};var _0x68d5e1={'account':{'id':_0xf64aac[_0x579c('0xe1')]},'body':_0x17d1c9,'log':_0x579c('0xe2')};return respondWithRpcPromise(_0x579c('0xe2'),_0x579c('0xe3'),_0x68d5e1,client9001)['then'](function(){return _0xc5d770;})[_0x579c('0x1f')](function(_0x4b5e75){logger[_0x579c('0x19')](_0x4b5e75);});}return;})[_0x579c('0x15')](function(){if(_0xc5d770){return _0xc5d770;}})['then'](respondWithResult(_0xb6e3d9,null))['catch'](function(_0x340282){logger['error'](_0x579c('0x1f'),_0x340282);for(var _0xaefa4e of _0x5abf65){var _0x52bc5f=path['join'](config[_0x579c('0x6b')],'server',_0x579c('0xc0'),_0x579c('0xcf'),'offline-chat',_0xaefa4e[_0x579c('0x66')]);fs_extra[_0x579c('0xe4')](_0x52bc5f)[_0x579c('0x1f')](function(_0xfa690f){logger[_0x579c('0x19')](_0x579c('0xe5'),_0x52bc5f,_0xfa690f);});}});};exports['addInteraction']=function(_0x3bd55d,_0x488f20){return db[_0x579c('0xad')][_0x579c('0x52')]({'where':{'id':_0x3bd55d[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x488f20,null))[_0x579c('0x15')](function(_0x46c62f){if(_0x46c62f){return _0x46c62f['addInteraction'](_0x3bd55d[_0x579c('0x54')][_0x579c('0xe6')],_['omit'](_0x3bd55d[_0x579c('0x54')],['ids','id'])||{});}})[_0x579c('0x15')](respondWithResult(_0x488f20,null))[_0x579c('0x1f')](handleError(_0x488f20,null));};exports[_0x579c('0xe7')]=function(_0x6e198c,_0x4635b6){var _0x1cfd5a={'raw':![],'where':{}};var _0xb58089={};var _0x22795b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x579c('0x62')]({'where':{'id':_0x6e198c[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x4635b6,null))[_0x579c('0x15')](function(_0x4b972f){if(_0x4b972f){_0xb58089[_0x579c('0x3d')]=_[_0x579c('0x3a')](db['ChatInteraction'][_0x579c('0x37')]);_0xb58089['query']=_[_0x579c('0x3a')](_0x6e198c[_0x579c('0x3e')]);_0xb58089[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0xb58089[_0x579c('0x3d')],_0xb58089['query']);_0x1cfd5a[_0x579c('0x3f')]=_[_0x579c('0x3c')](_0xb58089[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x6e198c[_0x579c('0x3e')][_0x579c('0x40')]));_0x1cfd5a['attributes']=_0x1cfd5a['attributes'][_0x579c('0x41')]?_0x1cfd5a['attributes']:_0xb58089[_0x579c('0x3d')];if(!_0x6e198c[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0x1cfd5a[_0x579c('0x25')]=qs['limit'](_0x6e198c['query'][_0x579c('0x25')]);_0x1cfd5a['offset']=qs[_0x579c('0x23')](_0x6e198c[_0x579c('0x3e')][_0x579c('0x23')]);}_0x1cfd5a[_0x579c('0x44')]=qs[_0x579c('0x45')](_0x6e198c[_0x579c('0x3e')][_0x579c('0x45')]);_0x1cfd5a[_0x579c('0x46')]=qs[_0x579c('0x3b')](_['pick'](_0x6e198c[_0x579c('0x3e')],_0xb58089[_0x579c('0x3b')]));_0x1cfd5a[_0x579c('0x46')][_0x579c('0x5d')]=_0x4b972f['id'];if(_0x6e198c['query']['filter']){_0x1cfd5a[_0x579c('0x46')]=_['merge'](_0x1cfd5a[_0x579c('0x46')],{'$or':_[_0x579c('0x35')](_0x1cfd5a['attributes'],function(_0x4ca45e){var _0xc9f655={};_0xc9f655[_0x4ca45e]={'$like':'%'+_0x6e198c[_0x579c('0x3e')][_0x579c('0x48')]+'%'};return _0xc9f655;})});}_0x1cfd5a=_[_0x579c('0x49')]({},_0x1cfd5a,_0x6e198c[_0x579c('0x51')]);return db[_0x579c('0xad')][_0x579c('0x26')]({'where':_0x1cfd5a['where']})[_0x579c('0x15')](function(_0x3ba470){_0x22795b[_0x579c('0x26')]=_0x3ba470;if(_0x6e198c[_0x579c('0x3e')][_0x579c('0x4b')]){_0x1cfd5a[_0x579c('0x4c')]=[{'model':db[_0x579c('0x82')],'as':_0x579c('0xe8'),'required':![]},{'model':db[_0x579c('0xe9')],'as':_0x579c('0xea'),'attributes':[_0x579c('0x30'),_0x579c('0xeb'),_0x579c('0xec')],'required':![]},{'model':db[_0x579c('0xed')],'as':'Tags','attributes':['id',_0x579c('0x30'),_0x579c('0xee')],'where':_0x6e198c['query'][_0x579c('0xef')]?{'id':_0x6e198c[_0x579c('0x3e')][_0x579c('0xef')]}:undefined,'required':_0x6e198c[_0x579c('0x3e')][_0x579c('0xef')]?!![]:![]}];}return db[_0x579c('0xad')][_0x579c('0x4d')](_0x1cfd5a);})['then'](function(_0x45f94a){_0x22795b[_0x579c('0x4e')]=_0x45f94a;return _0x22795b;});}})[_0x579c('0x15')](respondWithFilteredResult(_0x4635b6,_0x1cfd5a))[_0x579c('0x1f')](handleError(_0x4635b6,null));};function iftimePromise(_0x282da9,_0x29efea){return respondWithRpcPromise(_0x579c('0xf0'),_0x579c('0xf1'),{'command':_0x29efea['timezone']?util[_0x579c('0xa7')](_0x579c('0xf2'),_0x282da9[_0x579c('0xf3')],_0x29efea['timezone']):util['format'](_0x579c('0xf4'),_0x282da9[_0x579c('0xf3')])},client9002)[_0x579c('0x15')](function(_0x3146fd){var _0x415778=_0x3146fd&&_0x3146fd[_0x579c('0xf5')](_0x579c('0xf6'))>=0x0?!![]:![];logger[_0x579c('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x29efea['id'],_0x282da9['id'],_0x282da9[_0x579c('0xf3')],_0x415778?_0x579c('0xf7'):_0x579c('0xf8'),_0x29efea[_0x579c('0xf9')]?_0x29efea[_0x579c('0xf9')]:_0x579c('0xfa'));return _0x415778;})[_0x579c('0x1f')](function(_0x34f5fe){logger[_0x579c('0x19')](_0x579c('0xfb'),_0x29efea['id'],_0x282da9['id'],_0x282da9[_0x579c('0xf3')],util[_0x579c('0xfc')](_0x34f5fe,{'showHidden':![],'depth':null}),_0x29efea[_0x579c('0xf9')]?_0x29efea[_0x579c('0xf9')]:_0x579c('0xfa'));return![];});}exports[_0x579c('0xf1')]=function(_0x289669,_0x2332a4){var _0x568406=0x0;var _0x5e3e3b=0x0;var _0x29a239=![];var _0x124c2b;var _0x145580;return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x289669[_0x579c('0x50')]['id']},'include':[{'model':db[_0x579c('0xfd')],'as':'Interval','include':[{'model':db[_0x579c('0xfd')],'as':_0x579c('0xfe'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x579c('0x15')](handleEntityNotFound(_0x2332a4,null))[_0x579c('0x15')](function(_0x47e63e){if(_0x47e63e){_0x124c2b=_0x47e63e;return _0x47e63e[_0x579c('0xff')]({'raw':!![]});}})[_0x579c('0x15')](function(_0x2d19dc){if(_0x124c2b){if(_0x2d19dc){_0x145580=_0x2d19dc;}}return require(_0x579c('0x6d'))['getLicense']();})[_0x579c('0x15')](function(_0x3ca798){if(_0x3ca798){_0x5e3e3b=_0x3ca798[_0x579c('0x100')];_0x29a239=_0x3ca798[_0x579c('0x101')];}})[_0x579c('0x15')](function(){return db[_0x579c('0xad')][_0x579c('0x26')]({'where':{'closed':![]}});})['then'](function(_0x692fb){_0x568406=_0x692fb;if(_0x5e3e3b&&_0x692fb>_0x5e3e3b){return db[_0x579c('0x102')][_0x579c('0x62')]({'where':{'id':0x1}})[_0x579c('0x15')](function(_0xdcb9a5){if(_0xdcb9a5){_0xdcb9a5['increment']('chatLicenseExceeded');}});}})[_0x579c('0x15')](function(){if(_0x124c2b[_0x579c('0xfd')]&&_0x124c2b['Interval'][_0x579c('0xfe')]){var _0x18b041=[];for(var _0x5bbcc5=0x0;_0x5bbcc5<_0x124c2b['Interval'][_0x579c('0xfe')][_0x579c('0x41')];_0x5bbcc5++){var _0x2e6638=_0x124c2b[_0x579c('0xfd')][_0x579c('0xfe')][_0x5bbcc5][_0x579c('0x2a')]({'plain':!![]});_0x18b041[_0x579c('0xb4')](iftimePromise(_0x2e6638,_0x124c2b));}return BPromise[_0x579c('0x103')](_0x18b041)[_0x579c('0x15')](function(_0x286ae6){return _[_0x579c('0x104')](_0x286ae6);});}else{return!![];}})[_0x579c('0x15')](function(_0x251b3b){var _0x873e25=fs[_0x579c('0xc6')](path['join'](config[_0x579c('0x6b')],_0x579c('0x105')),_0x579c('0x106'));var _0x30b1a0=new url[(_0x579c('0x107'))](_0x124c2b[_0x579c('0x108')])[_0x579c('0x109')];var _0x484608='3.1.0';var _0x534574=![];var _0x3a988e={'chatVersion':_0x484608,'chatWebsiteAddressOrigin':_0x30b1a0,'remote':_0x124c2b['remote'],'query':querystring['stringify'](_[_0x579c('0x49')](_0x124c2b['get']({'plain':!![]}),{'customerIp':_0x289669[_0x579c('0x7f')]['x-forwarded-for']||_0x289669['headers'][_0x579c('0x10a')]||_0x289669[_0x579c('0x10b')][_0x579c('0x10c')]||_0x289669['ip'],'referer':_0x289669['headers'][_0x579c('0xa2')],'openedInteractions':_0x568406,'maxInteractions':_0x5e3e3b,'virtual':_0x29a239[_0x579c('0x100')],'online':_0x251b3b,'custom':_0x29a239}))[_0x579c('0x10d')](/'/g,'\x5c\x27')};_0x2332a4[_0x579c('0x31')](ejs['render'](Mustache[_0x579c('0xc8')](_0x873e25,_0x3a988e),{'proactiveActions':_0x145580,'alignment':_0x124c2b[_0x579c('0x10e')],'verticalAlignment':_0x124c2b[_0x579c('0x10f')],'div_color':_0x124c2b[_0x579c('0xee')],'labelText':_0x124c2b['labelText'],'text_color':_0x124c2b[_0x579c('0x110')],'text_button_color':_0x124c2b['textButtonColor'],'button_color':_0x124c2b['color_button'],'background_color':_0x124c2b['backgroundColor'],'hideWhenOffline':_0x124c2b[_0x579c('0x111')],'intervalId':_0x124c2b['IntervalId'],'isDevelopment':_0x534574,'chatVersion':_0x484608}));})[_0x579c('0x1f')](handleError(_0x2332a4,null));};exports['addApplications']=function(_0xaba7ad,_0x33990f){var _0x5e7106=_0xaba7ad[_0x579c('0x50')]['id'];var _0xb80433=_0xaba7ad[_0x579c('0x54')];var _0x4fa8d4=0xc8;var _0x534616=null;return db[_0x579c('0xd2')]['transaction']({'isolationLevel':db[_0x579c('0xd2')][_0x579c('0x112')][_0x579c('0x113')][_0x579c('0x114')]},function(_0x1fd3e3){return db['ChatWebsite']['findOne']({'where':{'id':_0x5e7106},'transaction':_0x1fd3e3})[_0x579c('0x15')](function(_0x1f1c56){if(_0x1f1c56){return db[_0x579c('0x92')][_0x579c('0x2d')]({'where':{'ChatWebsiteId':_0x5e7106},'transaction':_0x1fd3e3})[_0x579c('0x15')](function(){var _0x4e77fc=_[_0x579c('0x35')](_0xb80433,function(_0x5b1fbe){_0x5b1fbe[_0x579c('0x5d')]=_0x5e7106;return _0x5b1fbe;});return db[_0x579c('0x92')][_0x579c('0x115')](_0x4e77fc,{'transaction':_0x1fd3e3});});}else{_0x4fa8d4=0x194;_0x534616=[];}});})['then'](function(){if(_0x4fa8d4!==0x194){return db[_0x579c('0x92')][_0x579c('0x116')]({'where':{'ChatWebsiteId':_0x5e7106},'order':_0x579c('0x97')})[_0x579c('0x15')](function(_0x3f7306){_0x534616=_0x3f7306;});}})['catch'](function(_0x3b48dc){_0x4fa8d4=0x1f4;logger[_0x579c('0x19')](_0x3b48dc[_0x579c('0x2f')]);if(_0x3b48dc[_0x579c('0x30')]){delete _0x3b48dc['name'];}_0x534616=_0x3b48dc;})[_0x579c('0x117')](function(){if(_0x534616===null){_0x33990f['sendStatus'](_0x4fa8d4);}else{if(_0x4fa8d4===0x1f4){_0x33990f[_0x579c('0x21')](_0x4fa8d4)['send'](_0x534616);}else{_0x33990f[_0x579c('0x21')](_0x4fa8d4)[_0x579c('0x22')](_0x534616);}}});};exports[_0x579c('0x118')]=function(_0x2cec7e,_0x28e833){var _0x33cb2b={};var _0x477bc4={};var _0xe06bb6;var _0x4170aa;return db[_0x579c('0x36')]['findOne']({'where':{'id':_0x2cec7e[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x28e833,null))['then'](function(_0x7305bf){if(_0x7305bf){_0xe06bb6=_0x7305bf;_0x477bc4['model']=_[_0x579c('0x3a')](db[_0x579c('0x92')][_0x579c('0x37')]);_0x477bc4[_0x579c('0x3e')]=_[_0x579c('0x3a')](_0x2cec7e[_0x579c('0x3e')]);_0x477bc4[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0x477bc4[_0x579c('0x3d')],_0x477bc4[_0x579c('0x3e')]);_0x33cb2b['attributes']=_[_0x579c('0x3c')](_0x477bc4[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x2cec7e[_0x579c('0x3e')][_0x579c('0x40')]));_0x33cb2b[_0x579c('0x3f')]=_0x33cb2b[_0x579c('0x3f')][_0x579c('0x41')]?_0x33cb2b[_0x579c('0x3f')]:_0x477bc4['model'];_0x33cb2b['order']=qs[_0x579c('0x45')](_0x2cec7e[_0x579c('0x3e')][_0x579c('0x45')]);_0x33cb2b[_0x579c('0x46')]=qs[_0x579c('0x3b')](_['pick'](_0x2cec7e[_0x579c('0x3e')],_0x477bc4[_0x579c('0x3b')]));if(_0x2cec7e[_0x579c('0x3e')][_0x579c('0x48')]){_0x33cb2b[_0x579c('0x46')]=_['merge'](_0x33cb2b[_0x579c('0x46')],{'$or':_[_0x579c('0x35')](_0x33cb2b[_0x579c('0x3f')],function(_0x345dcc){var _0x39451a={};_0x39451a[_0x345dcc]={'$like':'%'+_0x2cec7e[_0x579c('0x3e')]['filter']+'%'};return _0x39451a;})});}_0x33cb2b=_['merge']({},_0x33cb2b,_0x2cec7e[_0x579c('0x51')]);return _0xe06bb6[_0x579c('0x118')](_0x33cb2b);}})[_0x579c('0x15')](function(_0x34d256){if(_0x34d256){_0x4170aa=_0x34d256[_0x579c('0x41')];if(!_0x2cec7e[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0x33cb2b[_0x579c('0x25')]=qs['limit'](_0x2cec7e['query']['limit']);_0x33cb2b[_0x579c('0x23')]=qs[_0x579c('0x23')](_0x2cec7e[_0x579c('0x3e')]['offset']);}return _0xe06bb6['getApplications'](_0x33cb2b);}})[_0x579c('0x15')](function(_0x51e0b3){if(_0x51e0b3){return _0x51e0b3?{'count':_0x4170aa,'rows':_0x51e0b3}:null;}})[_0x579c('0x15')](respondWithResult(_0x28e833,null))[_0x579c('0x1f')](handleError(_0x28e833,null));};exports['addProactiveActions']=function(_0x263db5,_0xf4e279){return db[_0x579c('0x119')]['find']({'where':{'id':_0x263db5[_0x579c('0x50')]['id']}})['then'](handleEntityNotFound(_0xf4e279,null))[_0x579c('0x15')](function(_0x17edd0){if(_0x17edd0){return _0x17edd0[_0x579c('0x11a')](_0x263db5[_0x579c('0x54')][_0x579c('0xe6')],_[_0x579c('0x11b')](_0x263db5['body'],['ids','id'])||{});}})[_0x579c('0x15')](respondWithResult(_0xf4e279,null))['catch'](handleError(_0xf4e279,null));};exports['getProactiveActions']=function(_0x18cedb,_0x5ef787){var _0x2bcb1e={};var _0x1745fa={};var _0x254358;var _0x376a24;return db['ChatWebsite']['findOne']({'where':{'id':_0x18cedb['params']['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x5ef787,null))[_0x579c('0x15')](function(_0x1f1593){if(_0x1f1593){_0x254358=_0x1f1593;_0x1745fa[_0x579c('0x3d')]=_['keys'](db['ChatProactiveAction'][_0x579c('0x37')]);_0x1745fa[_0x579c('0x3e')]=_[_0x579c('0x3a')](_0x18cedb[_0x579c('0x3e')]);_0x1745fa['filters']=_[_0x579c('0x3c')](_0x1745fa[_0x579c('0x3d')],_0x1745fa[_0x579c('0x3e')]);_0x2bcb1e['attributes']=_[_0x579c('0x3c')](_0x1745fa[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x18cedb[_0x579c('0x3e')][_0x579c('0x40')]));_0x2bcb1e[_0x579c('0x3f')]=_0x2bcb1e['attributes']['length']?_0x2bcb1e['attributes']:_0x1745fa[_0x579c('0x3d')];_0x2bcb1e[_0x579c('0x44')]=qs['sort'](_0x18cedb[_0x579c('0x3e')]['sort']);_0x2bcb1e['where']=qs[_0x579c('0x3b')](_[_0x579c('0x47')](_0x18cedb[_0x579c('0x3e')],_0x1745fa[_0x579c('0x3b')]));if(_0x18cedb[_0x579c('0x3e')]['filter']){_0x2bcb1e['where']=_['merge'](_0x2bcb1e[_0x579c('0x46')],{'$or':_[_0x579c('0x35')](_0x2bcb1e[_0x579c('0x3f')],function(_0x214f2e){var _0x583cf2={};_0x583cf2[_0x214f2e]={'$like':'%'+_0x18cedb[_0x579c('0x3e')][_0x579c('0x48')]+'%'};return _0x583cf2;})});}_0x2bcb1e=_[_0x579c('0x49')]({},_0x2bcb1e,_0x18cedb[_0x579c('0x51')]);return _0x254358['getProactiveActions'](_0x2bcb1e);}})[_0x579c('0x15')](function(_0x20363d){if(_0x20363d){_0x376a24=_0x20363d[_0x579c('0x41')];if(!_0x18cedb[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0x2bcb1e[_0x579c('0x25')]=qs[_0x579c('0x25')](_0x18cedb[_0x579c('0x3e')][_0x579c('0x25')]);_0x2bcb1e[_0x579c('0x23')]=qs[_0x579c('0x23')](_0x18cedb[_0x579c('0x3e')][_0x579c('0x23')]);}return _0x254358[_0x579c('0xff')](_0x2bcb1e);}})[_0x579c('0x15')](function(_0x4d50d8){if(_0x4d50d8){return _0x4d50d8?{'count':_0x376a24,'rows':_0x4d50d8}:null;}})[_0x579c('0x15')](respondWithResult(_0x5ef787,null))[_0x579c('0x1f')](handleError(_0x5ef787,null));};exports[_0x579c('0x11c')]=function(_0x44070e,_0x3b7ffa){var _0x4a7281=_0x44070e[_0x579c('0x3e')]['online']==='false'?_0x579c('0x11d'):_0x579c('0x11e');return db[_0x579c('0x36')][_0x579c('0x52')]({'attributes':['id',_0x4a7281],'where':{'id':_0x44070e['params']['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x3b7ffa,null))['then'](function(_0x460583){if(_0x460583){var _0x3d7a7e=_0x460583[_0x4a7281];var _0x16f299=_0x3d7a7e&&_0x3d7a7e[_0x579c('0x11f')]?_0x3d7a7e[_0x579c('0x11f')]:[];_0x3b7ffa[_0x579c('0x31')]({'fromKey':_['isNil'](_0x3d7a7e[_0x579c('0x120')])?undefined:_0x3d7a7e[_0x579c('0x120')],'count':_0x16f299[_0x579c('0x41')],'rows':_0x16f299});}})['catch'](handleError(_0x3b7ffa,null));};exports[_0x579c('0x121')]=function(_0x51af47,_0x4af1e1){var _0xe0f93c={'raw':![],'where':{}};var _0x393741={};var _0xf9f2a6={'count':0x0,'rows':[]};return db[_0x579c('0x36')][_0x579c('0x62')]({'where':{'id':_0x51af47[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x4af1e1,null))[_0x579c('0x15')](function(_0x50ee6b){if(_0x50ee6b){_0x393741[_0x579c('0x3d')]=_[_0x579c('0x3a')](db[_0x579c('0x122')][_0x579c('0x37')]);_0x393741[_0x579c('0x3e')]=_['keys'](_0x51af47[_0x579c('0x3e')]);_0x393741[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0x393741[_0x579c('0x3d')],_0x393741[_0x579c('0x3e')]);_0xe0f93c[_0x579c('0x3f')]=_[_0x579c('0x3c')](_0x393741[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x51af47[_0x579c('0x3e')][_0x579c('0x40')]));_0xe0f93c[_0x579c('0x3f')]=_0xe0f93c[_0x579c('0x3f')][_0x579c('0x41')]?_0xe0f93c['attributes']:_0x393741[_0x579c('0x3d')];if(!_0x51af47[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0xe0f93c[_0x579c('0x25')]=qs[_0x579c('0x25')](_0x51af47[_0x579c('0x3e')]['limit']);_0xe0f93c[_0x579c('0x23')]=qs[_0x579c('0x23')](_0x51af47[_0x579c('0x3e')][_0x579c('0x23')]);}_0xe0f93c[_0x579c('0x44')]=qs[_0x579c('0x45')](_0x51af47[_0x579c('0x3e')][_0x579c('0x45')]);_0xe0f93c['where']=qs[_0x579c('0x3b')](_['pick'](_0x51af47[_0x579c('0x3e')],_0x393741[_0x579c('0x3b')]));_0xe0f93c[_0x579c('0x46')][_0x579c('0x5d')]=_0x50ee6b['id'];if(_0x51af47[_0x579c('0x3e')][_0x579c('0x48')]){_0xe0f93c['where']=_['merge'](_0xe0f93c[_0x579c('0x46')],{'$or':_[_0x579c('0x35')](_0xe0f93c[_0x579c('0x3f')],function(_0x30f78d){var _0x509984={};_0x509984[_0x30f78d]={'$like':'%'+_0x51af47[_0x579c('0x3e')][_0x579c('0x48')]+'%'};return _0x509984;})});}_0xe0f93c=_[_0x579c('0x49')]({},_0xe0f93c,_0x51af47[_0x579c('0x51')]);return db[_0x579c('0x122')]['count']({'where':_0xe0f93c[_0x579c('0x46')]})[_0x579c('0x15')](function(_0x473c4f){_0xf9f2a6[_0x579c('0x26')]=_0x473c4f;if(_0x51af47[_0x579c('0x3e')][_0x579c('0x4b')]){_0xe0f93c[_0x579c('0x4c')]=[{'all':!![]}];}else{_0xe0f93c[_0x579c('0x4c')]=[{'model':db['CmContact'],'as':_0x579c('0xe8'),'required':![]},{'model':db[_0x579c('0xd4')],'as':'Attachments','required':![]}];}return db[_0x579c('0x122')][_0x579c('0x4d')](_0xe0f93c);})[_0x579c('0x15')](function(_0xd7d6c1){_0xf9f2a6[_0x579c('0x4e')]=_0xd7d6c1;return _0xf9f2a6;});}})[_0x579c('0x15')](respondWithFilteredResult(_0x4af1e1,_0xe0f93c))[_0x579c('0x1f')](handleError(_0x4af1e1,null));};exports[_0x579c('0x123')]=function(_0x2968df,_0x119794){return db[_0x579c('0x36')][_0x579c('0x52')]({'where':{'id':_0x2968df[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x119794,null))['then'](function(_0x2f520d){if(_0x2f520d){return _0x2f520d[_0x579c('0x123')](_0x2968df['body'][_0x579c('0xe6')],_[_0x579c('0x11b')](_0x2968df[_0x579c('0x54')],[_0x579c('0xe6'),'id'])||{})['spread'](function(_0x354b84){for(var _0x6d64e=0x0;_0x6d64e<_0x2968df['body']['ids']['length'];_0x6d64e+=0x1){socket[_0x579c('0x124')]('userChatWebsite:save',{'UserId':Number(_0x2968df['body'][_0x579c('0xe6')][_0x6d64e]),'ChatWebsiteId':Number(_0x2968df['params']['id'])});}return _0x354b84;});}})[_0x579c('0x15')](respondWithResult(_0x119794,null))['catch'](handleError(_0x119794,null));};exports[_0x579c('0x125')]=function(_0x18d144,_0x45e569){return db['ChatWebsite']['find']({'where':{'id':_0x18d144[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x45e569,null))[_0x579c('0x15')](function(_0xfc0fac){if(_0xfc0fac){return _0xfc0fac[_0x579c('0x125')](_0x18d144[_0x579c('0x3e')][_0x579c('0xe6')])['then'](function(){if(_[_0x579c('0x126')](_0x18d144[_0x579c('0x3e')][_0x579c('0xe6')])){for(var _0xdcd95c=0x0;_0xdcd95c<_0x18d144[_0x579c('0x3e')][_0x579c('0xe6')]['length'];_0xdcd95c+=0x1){socket[_0x579c('0x124')](_0x579c('0x127'),{'UserId':Number(_0x18d144[_0x579c('0x3e')][_0x579c('0xe6')][_0xdcd95c]),'ChatWebsiteId':Number(_0x18d144['params']['id'])});}}else{socket[_0x579c('0x124')](_0x579c('0x127'),{'UserId':Number(_0x18d144[_0x579c('0x3e')][_0x579c('0xe6')]),'ChatWebsiteId':Number(_0x18d144['params']['id'])});}});}})[_0x579c('0x15')](respondWithStatusCode(_0x45e569,null))[_0x579c('0x1f')](handleError(_0x45e569,null));};exports[_0x579c('0x128')]=function(_0x38d137,_0x1280dc){var _0x4ae796={};var _0x176441={};var _0x3bd037;var _0x52a1d4;return db['ChatWebsite']['findOne']({'where':{'id':_0x38d137[_0x579c('0x50')]['id']}})[_0x579c('0x15')](handleEntityNotFound(_0x1280dc,null))[_0x579c('0x15')](function(_0x22a3cb){if(_0x22a3cb){_0x3bd037=_0x22a3cb;_0x176441['model']=_[_0x579c('0x3a')](db['User'][_0x579c('0x37')]);_0x176441['query']=_[_0x579c('0x3a')](_0x38d137[_0x579c('0x3e')]);_0x176441[_0x579c('0x3b')]=_[_0x579c('0x3c')](_0x176441[_0x579c('0x3d')],_0x176441[_0x579c('0x3e')]);_0x4ae796[_0x579c('0x3f')]=_[_0x579c('0x3c')](_0x176441[_0x579c('0x3d')],qs[_0x579c('0x40')](_0x38d137['query'][_0x579c('0x40')]));_0x4ae796[_0x579c('0x3f')]=_0x4ae796[_0x579c('0x3f')]['length']?_0x4ae796['attributes']:_0x176441[_0x579c('0x3d')];_0x4ae796['order']=qs['sort'](_0x38d137[_0x579c('0x3e')][_0x579c('0x45')]);_0x4ae796['where']=qs[_0x579c('0x3b')](_[_0x579c('0x47')](_0x38d137[_0x579c('0x3e')],_0x176441['filters']));if(_0x38d137['query']['filter']){_0x4ae796[_0x579c('0x46')]=_['merge'](_0x4ae796[_0x579c('0x46')],{'$or':_['map'](_0x4ae796['attributes'],function(_0x2e6b62){var _0x365695={};_0x365695[_0x2e6b62]={'$like':'%'+_0x38d137[_0x579c('0x3e')][_0x579c('0x48')]+'%'};return _0x365695;})});}_0x4ae796=_[_0x579c('0x49')]({},_0x4ae796,_0x38d137[_0x579c('0x51')]);return _0x3bd037['getAgents'](_0x4ae796);}})[_0x579c('0x15')](function(_0x4eadc7){if(_0x4eadc7){_0x52a1d4=_0x4eadc7[_0x579c('0x41')];if(!_0x38d137[_0x579c('0x3e')][_0x579c('0x42')](_0x579c('0x43'))){_0x4ae796[_0x579c('0x25')]=qs[_0x579c('0x25')](_0x38d137[_0x579c('0x3e')]['limit']);_0x4ae796['offset']=qs['offset'](_0x38d137[_0x579c('0x3e')][_0x579c('0x23')]);}return _0x3bd037[_0x579c('0x128')](_0x4ae796);}})[_0x579c('0x15')](function(_0x561fa7){if(_0x561fa7){return _0x561fa7?{'count':_0x52a1d4,'rows':_0x561fa7}:null;}})[_0x579c('0x15')](respondWithResult(_0x1280dc,null))[_0x579c('0x1f')](handleError(_0x1280dc,null));};
\ No newline at end of file
+var _0xa5af=['getSystemAvatar','server/files/images/avatars/system_avatar.png','getResult','chat','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','Applications','List','account','list','orderBy','applications','priority','asc','contact','customerIp','headers','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','device','%s\x20%s\x20%s','stringify','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','lastName','messageId','update','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','basename','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','notifyMail','attachments','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','timezone','interval','indexOf','true','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','getSnippet','Interval','getProactiveActions','License','chatLicenseExceeded','Intervals','server/files/chat/iframe.ejs','URL','address','3.1.0','remote','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','status','json','offset','undefined','limit','count','set','Content-Range','get','ChatWebsites','destroy','end','sendStatus','stack','name','send','index','Pause','map','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','ChatWebsite','includeAll','include','findAll','show','params','mandatoryDispositionPause','rawAttributes','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','Disposition','findOne','hasOwnProperty','ChatWebsiteId','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','nolimit','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar'];(function(_0x9e3f17,_0x1a75f4){var _0x2c2f45=function(_0x1ff728){while(--_0x1ff728){_0x9e3f17['push'](_0x9e3f17['shift']());}};_0x2c2f45(++_0x1a75f4);}(_0xa5af,0x1d9));var _0xfa5a=function(_0x517078,_0x578fbf){_0x517078=_0x517078-0x0;var _0x1c8aeb=_0xa5af[_0x517078];return _0x1c8aeb;};'use strict';var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xfa5a('0x0'));var ejs=require(_0xfa5a('0x1'));var fs=require('fs');var fs_extra=require(_0xfa5a('0x2'));var _=require(_0xfa5a('0x3'));var querystring=require('querystring');var Redis=require(_0xfa5a('0x4'));var qs=require(_0xfa5a('0x5'));var logger=require(_0xfa5a('0x6'))(_0xfa5a('0x7'));var config=require(_0xfa5a('0x8'));var url=require(_0xfa5a('0x9'));var db=require('../../mysqldb')['db'];config[_0xfa5a('0xa')]=_[_0xfa5a('0xb')](config[_0xfa5a('0xa')],{'host':_0xfa5a('0xc'),'port':0x18eb});var socket=require(_0xfa5a('0xd'))(new Redis(config[_0xfa5a('0xa')]));require(_0xfa5a('0xe'))[_0xfa5a('0xf')](socket);var htmlToText=require(_0xfa5a('0x10'));var jayson=require(_0xfa5a('0x11'));var client=jayson[_0xfa5a('0x12')]['http']({'port':0x232c});var client9002=jayson[_0xfa5a('0x12')]['http']({'port':0x232a});var client9003=jayson[_0xfa5a('0x12')][_0xfa5a('0x13')]({'port':0x232b});var client9001=jayson[_0xfa5a('0x12')][_0xfa5a('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x3cf365,_0x117499,_0x4bcf6e,_0x580c37){return new BPromise(function(_0x599bb3,_0x399c79){var _0xa62c02=_0x580c37||client;return _0xa62c02[_0xfa5a('0x14')](_0x3cf365,_0x4bcf6e)[_0xfa5a('0x15')](function(_0x30ad5e){logger[_0xfa5a('0x16')](_0xfa5a('0x17'),_0x117499,_0xfa5a('0x18'));logger['debug'](_0xfa5a('0x19'),_0x117499,_0xfa5a('0x18'),JSON['stringify'](_0x30ad5e));if(_0x30ad5e[_0xfa5a('0x1a')]){if(_0x30ad5e[_0xfa5a('0x1a')]['code']===0x1f4){logger[_0xfa5a('0x1a')](_0xfa5a('0x17'),_0x117499,_0x30ad5e[_0xfa5a('0x1a')][_0xfa5a('0x1b')]);return _0x399c79(_0x30ad5e[_0xfa5a('0x1a')][_0xfa5a('0x1b')]);}logger[_0xfa5a('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x117499,_0x30ad5e[_0xfa5a('0x1a')][_0xfa5a('0x1b')]);return _0x599bb3(_0x30ad5e[_0xfa5a('0x1a')][_0xfa5a('0x1b')]);}else{logger[_0xfa5a('0x16')](_0xfa5a('0x17'),_0x117499,_0xfa5a('0x18'));_0x599bb3(_0x30ad5e[_0xfa5a('0x1c')]['message']);}})['catch'](function(_0xf6e7f5){logger['error'](_0xfa5a('0x17'),_0x117499,_0xf6e7f5);_0x399c79(_0xf6e7f5);});});}function respondWithStatusCode(_0x20f38d,_0x1bbd8f){_0x1bbd8f=_0x1bbd8f||0xcc;return function(_0x595b0e){if(_0x595b0e){return _0x20f38d['sendStatus'](_0x1bbd8f);}return _0x20f38d[_0xfa5a('0x1d')](_0x1bbd8f)['end']();};}function respondWithResult(_0x53e2c1,_0x3b09ae){_0x3b09ae=_0x3b09ae||0xc8;return function(_0x5d2948){if(_0x5d2948){return _0x53e2c1['status'](_0x3b09ae)[_0xfa5a('0x1e')](_0x5d2948);}};}function respondWithFilteredResult(_0xc0f695,_0x347e28){return function(_0x30af70){if(_0x30af70){var _0x3f9d58=typeof _0x347e28[_0xfa5a('0x1f')]===_0xfa5a('0x20')&&typeof _0x347e28[_0xfa5a('0x21')]==='undefined';var _0x4746ee=_0x30af70[_0xfa5a('0x22')];var _0x18f6af=_0x3f9d58?0x0:_0x347e28['offset'];var _0x399acc=_0x3f9d58?_0x30af70[_0xfa5a('0x22')]:_0x347e28[_0xfa5a('0x1f')]+_0x347e28[_0xfa5a('0x21')];var _0x46fd07;if(_0x399acc>=_0x4746ee){_0x399acc=_0x4746ee;_0x46fd07=0xc8;}else{_0x46fd07=0xce;}_0xc0f695[_0xfa5a('0x1d')](_0x46fd07);return _0xc0f695[_0xfa5a('0x23')](_0xfa5a('0x24'),_0x18f6af+'-'+_0x399acc+'/'+_0x4746ee)[_0xfa5a('0x1e')](_0x30af70);}return null;};}function saveUpdates(_0x3f5f3e){return function(_0x1b653d){if(_0x1b653d){return _0x1b653d['update'](_0x3f5f3e)[_0xfa5a('0x15')](function(_0x2628c7){return _0x2628c7;});}return null;};}function removeEntity(_0x1b2cb9){return function(_0x258e00){if(_0x258e00){return _0x258e00['destroy']()[_0xfa5a('0x15')](function(){var _0x5d7cfd=_0x258e00[_0xfa5a('0x25')]({'plain':!![]});var _0x4cab7b=_0xfa5a('0x26');return db['UserProfileResource'][_0xfa5a('0x27')]({'where':{'type':_0x4cab7b,'resourceId':_0x5d7cfd['id']}})[_0xfa5a('0x15')](function(){return _0x258e00;});})['then'](function(){_0x1b2cb9['status'](0xcc)[_0xfa5a('0x28')]();});}};}function handleEntityNotFound(_0x51c8f2){return function(_0x525975){if(!_0x525975){_0x51c8f2[_0xfa5a('0x29')](0x194);}return _0x525975;};}function handleError(_0x4a38ef,_0x42abc4){_0x42abc4=_0x42abc4||0x1f4;return function(_0x5361c9){logger[_0xfa5a('0x1a')](_0x5361c9[_0xfa5a('0x2a')]);if(_0x5361c9[_0xfa5a('0x2b')]){delete _0x5361c9[_0xfa5a('0x2b')];}_0x4a38ef[_0xfa5a('0x1d')](_0x42abc4)[_0xfa5a('0x2c')](_0x5361c9);};}exports[_0xfa5a('0x2d')]=function(_0x3e4e14,_0x1ba7b5){var _0x15d3a8={'include':[{'model':db[_0xfa5a('0x2e')],'as':'mandatoryDispositionPause'}]},_0xf69ebe={},_0x24f705={'count':0x0,'rows':[]};var _0x141d50=_[_0xfa5a('0x2f')](db['ChatWebsite']['rawAttributes'],function(_0x5266f7){return{'name':_0x5266f7[_0xfa5a('0x30')],'type':_0x5266f7[_0xfa5a('0x31')][_0xfa5a('0x32')]};});_0xf69ebe[_0xfa5a('0x33')]=_[_0xfa5a('0x2f')](_0x141d50,_0xfa5a('0x2b'));_0xf69ebe['query']=_[_0xfa5a('0x34')](_0x3e4e14[_0xfa5a('0x35')]);_0xf69ebe[_0xfa5a('0x36')]=_[_0xfa5a('0x37')](_0xf69ebe['model'],_0xf69ebe['query']);_0x15d3a8['attributes']=_['intersection'](_0xf69ebe[_0xfa5a('0x33')],qs[_0xfa5a('0x38')](_0x3e4e14[_0xfa5a('0x35')][_0xfa5a('0x38')]));_0x15d3a8[_0xfa5a('0x39')]=_0x15d3a8[_0xfa5a('0x39')][_0xfa5a('0x3a')]?_0x15d3a8[_0xfa5a('0x39')]:_0xf69ebe[_0xfa5a('0x33')];if(!_0x3e4e14[_0xfa5a('0x35')]['hasOwnProperty']('nolimit')){_0x15d3a8[_0xfa5a('0x21')]=qs['limit'](_0x3e4e14[_0xfa5a('0x35')][_0xfa5a('0x21')]);_0x15d3a8[_0xfa5a('0x1f')]=qs[_0xfa5a('0x1f')](_0x3e4e14[_0xfa5a('0x35')]['offset']);}_0x15d3a8[_0xfa5a('0x3b')]=qs[_0xfa5a('0x3c')](_0x3e4e14[_0xfa5a('0x35')][_0xfa5a('0x3c')]);_0x15d3a8[_0xfa5a('0x3d')]=qs['filters'](_[_0xfa5a('0x3e')](_0x3e4e14['query'],_0xf69ebe['filters']),_0x141d50);if(_0x3e4e14[_0xfa5a('0x35')][_0xfa5a('0x3f')]){_0x15d3a8[_0xfa5a('0x3d')]=_[_0xfa5a('0x40')](_0x15d3a8[_0xfa5a('0x3d')],{'$or':_[_0xfa5a('0x2f')](_0x141d50,function(_0x2732df){if(_0x2732df[_0xfa5a('0x31')]!==_0xfa5a('0x41')){var _0x4e7184={};_0x4e7184[_0x2732df[_0xfa5a('0x2b')]]={'$like':'%'+_0x3e4e14[_0xfa5a('0x35')][_0xfa5a('0x3f')]+'%'};return _0x4e7184;}})});}_0x15d3a8=_[_0xfa5a('0x40')]({},_0x15d3a8,_0x3e4e14['options']);var _0x4636a1={'where':_0x15d3a8['where']};return db[_0xfa5a('0x42')]['count'](_0x4636a1)[_0xfa5a('0x15')](function(_0x59d683){_0x24f705['count']=_0x59d683;if(_0x3e4e14[_0xfa5a('0x35')][_0xfa5a('0x43')]){_0x15d3a8[_0xfa5a('0x44')]=[{'all':!![]}];}return db[_0xfa5a('0x42')][_0xfa5a('0x45')](_0x15d3a8);})[_0xfa5a('0x15')](function(_0x3042a0){_0x24f705['rows']=_0x3042a0;return _0x24f705;})[_0xfa5a('0x15')](respondWithFilteredResult(_0x1ba7b5,_0x15d3a8))['catch'](handleError(_0x1ba7b5,null));};exports[_0xfa5a('0x46')]=function(_0x503354,_0x3d013d){var _0x361206={'raw':![],'where':{'id':_0x503354[_0xfa5a('0x47')]['id']},'include':[{'model':db['Pause'],'as':_0xfa5a('0x48')}]},_0x1fd400={};_0x1fd400[_0xfa5a('0x33')]=_[_0xfa5a('0x34')](db[_0xfa5a('0x42')][_0xfa5a('0x49')]);_0x1fd400[_0xfa5a('0x35')]=_['keys'](_0x503354[_0xfa5a('0x35')]);_0x1fd400[_0xfa5a('0x36')]=_[_0xfa5a('0x37')](_0x1fd400['model'],_0x1fd400[_0xfa5a('0x35')]);_0x361206[_0xfa5a('0x39')]=_[_0xfa5a('0x37')](_0x1fd400[_0xfa5a('0x33')],qs['fields'](_0x503354[_0xfa5a('0x35')][_0xfa5a('0x38')]));_0x361206['attributes']=_0x361206[_0xfa5a('0x39')]['length']?_0x361206[_0xfa5a('0x39')]:_0x1fd400['model'];if(_0x503354[_0xfa5a('0x35')][_0xfa5a('0x43')]){_0x361206['include']=[{'all':!![]}];}_0x361206=_[_0xfa5a('0x40')]({},_0x361206,_0x503354[_0xfa5a('0x4a')]);return db[_0xfa5a('0x42')][_0xfa5a('0x4b')](_0x361206)[_0xfa5a('0x15')](handleEntityNotFound(_0x3d013d,null))[_0xfa5a('0x15')](respondWithResult(_0x3d013d,null))[_0xfa5a('0x4c')](handleError(_0x3d013d,null));};exports[_0xfa5a('0x4d')]=function(_0x4110e4,_0x50fed5){return db[_0xfa5a('0x42')]['create'](_0x4110e4[_0xfa5a('0x4e')],{})[_0xfa5a('0x15')](function(_0x47c878){var _0x3b6407=_0x4110e4[_0xfa5a('0x4f')]['get']({'plain':!![]});if(!_0x3b6407)throw new Error(_0xfa5a('0x50'));if(_0x3b6407['role']===_0xfa5a('0x4f')){var _0x5253f8=_0x47c878[_0xfa5a('0x25')]({'plain':!![]});var _0xa27dc4=_0xfa5a('0x26');return db[_0xfa5a('0x51')][_0xfa5a('0x4b')]({'where':{'name':_0xa27dc4,'userProfileId':_0x3b6407['userProfileId']},'raw':!![]})[_0xfa5a('0x15')](function(_0x38599e){if(_0x38599e&&_0x38599e[_0xfa5a('0x52')]===0x0){return db[_0xfa5a('0x53')][_0xfa5a('0x4d')]({'name':_0x5253f8[_0xfa5a('0x2b')],'resourceId':_0x5253f8['id'],'type':_0x38599e[_0xfa5a('0x2b')],'sectionId':_0x38599e['id']},{})['then'](function(){return _0x47c878;});}else{return _0x47c878;}})['catch'](function(_0x5878c3){logger[_0xfa5a('0x1a')](_0xfa5a('0x54'),_0x5878c3);throw _0x5878c3;});}return _0x47c878;})[_0xfa5a('0x15')](respondWithResult(_0x50fed5,0xc9))[_0xfa5a('0x4c')](handleError(_0x50fed5,null));};exports['update']=function(_0x50dd12,_0x5cc577){if(_0x50dd12[_0xfa5a('0x4e')]['id']){delete _0x50dd12['body']['id'];}return db['ChatWebsite'][_0xfa5a('0x4b')]({'where':{'id':_0x50dd12[_0xfa5a('0x47')]['id']},'include':[{'model':db[_0xfa5a('0x2e')],'as':_0xfa5a('0x48')}]})['then'](handleEntityNotFound(_0x5cc577,null))[_0xfa5a('0x15')](saveUpdates(_0x50dd12[_0xfa5a('0x4e')],null))[_0xfa5a('0x15')](respondWithResult(_0x5cc577,null))[_0xfa5a('0x4c')](handleError(_0x5cc577,null));};exports[_0xfa5a('0x27')]=function(_0x9f6b39,_0x3843be){return db[_0xfa5a('0x42')][_0xfa5a('0x4b')]({'where':{'id':_0x9f6b39[_0xfa5a('0x47')]['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0x3843be,null))[_0xfa5a('0x15')](removeEntity(_0x3843be,null))[_0xfa5a('0x4c')](handleError(_0x3843be,null));};exports['describe']=function(_0x28c7b9,_0x44c617){return db[_0xfa5a('0x42')]['describe']()[_0xfa5a('0x15')](respondWithResult(_0x44c617,null))[_0xfa5a('0x4c')](handleError(_0x44c617,null));};exports[_0xfa5a('0x55')]=function(_0xb5402d,_0x20fd17){if(_0xb5402d['body']['id']){delete _0xb5402d['body']['id'];}return db[_0xfa5a('0x42')][_0xfa5a('0x4b')]({'where':{'id':_0xb5402d[_0xfa5a('0x47')]['id']}})['then'](handleEntityNotFound(_0x20fd17,null))['then'](function(_0x405e9e){if(_0x405e9e){_0xb5402d[_0xfa5a('0x4e')]['ChatWebsiteId']=_0x405e9e['id'];return db[_0xfa5a('0x56')][_0xfa5a('0x4d')](_0xb5402d[_0xfa5a('0x4e')]);}})[_0xfa5a('0x15')](respondWithResult(_0x20fd17,null))[_0xfa5a('0x4c')](handleError(_0x20fd17,null));};exports['getDispositions']=function(_0x33985f,_0x2b7230){var _0x1e9490={'raw':![],'where':{}};var _0x3b8afb={};var _0x90a37f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfa5a('0x57')]({'where':{'id':_0x33985f['params']['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0x2b7230,null))[_0xfa5a('0x15')](function(_0x51d794){if(_0x51d794){_0x3b8afb[_0xfa5a('0x33')]=_[_0xfa5a('0x34')](db[_0xfa5a('0x56')][_0xfa5a('0x49')]);_0x3b8afb[_0xfa5a('0x35')]=_['keys'](_0x33985f[_0xfa5a('0x35')]);_0x3b8afb['filters']=_[_0xfa5a('0x37')](_0x3b8afb[_0xfa5a('0x33')],_0x3b8afb[_0xfa5a('0x35')]);_0x1e9490[_0xfa5a('0x39')]=_[_0xfa5a('0x37')](_0x3b8afb[_0xfa5a('0x33')],qs['fields'](_0x33985f[_0xfa5a('0x35')][_0xfa5a('0x38')]));_0x1e9490[_0xfa5a('0x39')]=_0x1e9490[_0xfa5a('0x39')]['length']?_0x1e9490['attributes']:_0x3b8afb[_0xfa5a('0x33')];if(!_0x33985f[_0xfa5a('0x35')][_0xfa5a('0x58')]('nolimit')){_0x1e9490['limit']=qs[_0xfa5a('0x21')](_0x33985f['query'][_0xfa5a('0x21')]);_0x1e9490[_0xfa5a('0x1f')]=qs[_0xfa5a('0x1f')](_0x33985f[_0xfa5a('0x35')][_0xfa5a('0x1f')]);}_0x1e9490[_0xfa5a('0x3b')]=qs[_0xfa5a('0x3c')](_0x33985f[_0xfa5a('0x35')][_0xfa5a('0x3c')]);_0x1e9490[_0xfa5a('0x3d')]=qs[_0xfa5a('0x36')](_[_0xfa5a('0x3e')](_0x33985f[_0xfa5a('0x35')],_0x3b8afb[_0xfa5a('0x36')]));_0x1e9490['where'][_0xfa5a('0x59')]=_0x51d794['id'];if(_0x33985f[_0xfa5a('0x35')][_0xfa5a('0x3f')]){_0x1e9490[_0xfa5a('0x3d')]=_[_0xfa5a('0x40')](_0x1e9490['where'],{'$or':_[_0xfa5a('0x2f')](_0x1e9490[_0xfa5a('0x39')],function(_0x562731){var _0x1fa581={};_0x1fa581[_0x562731]={'$like':'%'+_0x33985f[_0xfa5a('0x35')][_0xfa5a('0x3f')]+'%'};return _0x1fa581;})});}_0x1e9490=_[_0xfa5a('0x40')]({},_0x1e9490,_0x33985f[_0xfa5a('0x4a')]);return db[_0xfa5a('0x56')][_0xfa5a('0x22')]({'where':_0x1e9490['where']})[_0xfa5a('0x15')](function(_0x283073){_0x90a37f[_0xfa5a('0x22')]=_0x283073;if(_0x33985f[_0xfa5a('0x35')]['includeAll']){_0x1e9490[_0xfa5a('0x44')]=[{'all':!![]}];}return db['Disposition'][_0xfa5a('0x45')](_0x1e9490);})[_0xfa5a('0x15')](function(_0x2c2088){_0x90a37f[_0xfa5a('0x5a')]=_0x2c2088;return _0x90a37f;});}})['then'](respondWithFilteredResult(_0x2b7230,_0x1e9490))[_0xfa5a('0x4c')](handleError(_0x2b7230,null));};exports[_0xfa5a('0x5b')]=function(_0x2b5b13,_0x31afeb){return db[_0xfa5a('0x42')][_0xfa5a('0x4b')]({'where':{'id':_0x2b5b13[_0xfa5a('0x47')]['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0x31afeb,null))[_0xfa5a('0x15')](function(_0x210bc0){if(_0x210bc0){return _0x210bc0[_0xfa5a('0x5b')](_0x2b5b13['query'][_0xfa5a('0x5c')]);}})[_0xfa5a('0x15')](respondWithStatusCode(_0x31afeb,null))[_0xfa5a('0x4c')](handleError(_0x31afeb,null));};exports[_0xfa5a('0x5d')]=function(_0x1298ea,_0x3a0f1d){if(_0x1298ea[_0xfa5a('0x4e')]['id']){delete _0x1298ea[_0xfa5a('0x4e')]['id'];}return db[_0xfa5a('0x42')][_0xfa5a('0x4b')]({'where':{'id':_0x1298ea['params']['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0x3a0f1d,null))['then'](function(_0x354dd7){if(_0x354dd7){_0x1298ea[_0xfa5a('0x4e')][_0xfa5a('0x59')]=_0x354dd7['id'];return db['CannedAnswer'][_0xfa5a('0x4d')](_0x1298ea[_0xfa5a('0x4e')]);}})[_0xfa5a('0x15')](respondWithResult(_0x3a0f1d,null))['catch'](handleError(_0x3a0f1d,null));};exports[_0xfa5a('0x5e')]=function(_0x47f3e2,_0x2ab327){var _0x22b359={'raw':![],'where':{}};var _0x4cf1cc={};var _0x46dc63={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfa5a('0x57')]({'where':{'id':_0x47f3e2[_0xfa5a('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ab327,null))['then'](function(_0x1bc626){if(_0x1bc626){_0x4cf1cc[_0xfa5a('0x33')]=_[_0xfa5a('0x34')](db[_0xfa5a('0x5f')][_0xfa5a('0x49')]);_0x4cf1cc['query']=_[_0xfa5a('0x34')](_0x47f3e2[_0xfa5a('0x35')]);_0x4cf1cc['filters']=_['intersection'](_0x4cf1cc['model'],_0x4cf1cc[_0xfa5a('0x35')]);_0x22b359['attributes']=_['intersection'](_0x4cf1cc[_0xfa5a('0x33')],qs[_0xfa5a('0x38')](_0x47f3e2['query'][_0xfa5a('0x38')]));_0x22b359[_0xfa5a('0x39')]=_0x22b359['attributes'][_0xfa5a('0x3a')]?_0x22b359[_0xfa5a('0x39')]:_0x4cf1cc[_0xfa5a('0x33')];if(!_0x47f3e2['query'][_0xfa5a('0x58')](_0xfa5a('0x60'))){_0x22b359['limit']=qs[_0xfa5a('0x21')](_0x47f3e2[_0xfa5a('0x35')][_0xfa5a('0x21')]);_0x22b359[_0xfa5a('0x1f')]=qs['offset'](_0x47f3e2[_0xfa5a('0x35')]['offset']);}_0x22b359['order']=qs['sort'](_0x47f3e2['query'][_0xfa5a('0x3c')]);_0x22b359[_0xfa5a('0x3d')]=qs[_0xfa5a('0x36')](_[_0xfa5a('0x3e')](_0x47f3e2['query'],_0x4cf1cc[_0xfa5a('0x36')]));_0x22b359[_0xfa5a('0x3d')][_0xfa5a('0x59')]=_0x1bc626['id'];if(_0x47f3e2[_0xfa5a('0x35')][_0xfa5a('0x3f')]){_0x22b359[_0xfa5a('0x3d')]=_[_0xfa5a('0x40')](_0x22b359[_0xfa5a('0x3d')],{'$or':_[_0xfa5a('0x2f')](_0x22b359['attributes'],function(_0x2f09b6){var _0x21eda={};_0x21eda[_0x2f09b6]={'$like':'%'+_0x47f3e2[_0xfa5a('0x35')][_0xfa5a('0x3f')]+'%'};return _0x21eda;})});}_0x22b359=_[_0xfa5a('0x40')]({},_0x22b359,_0x47f3e2['options']);return db[_0xfa5a('0x5f')][_0xfa5a('0x22')]({'where':_0x22b359[_0xfa5a('0x3d')]})[_0xfa5a('0x15')](function(_0x3062c5){_0x46dc63[_0xfa5a('0x22')]=_0x3062c5;if(_0x47f3e2['query'][_0xfa5a('0x43')]){_0x22b359[_0xfa5a('0x44')]=[{'all':!![]}];}return db[_0xfa5a('0x5f')][_0xfa5a('0x45')](_0x22b359);})[_0xfa5a('0x15')](function(_0x4b4d7c){_0x46dc63[_0xfa5a('0x5a')]=_0x4b4d7c;return _0x46dc63;});}})['then'](respondWithFilteredResult(_0x2ab327,_0x22b359))[_0xfa5a('0x4c')](handleError(_0x2ab327,null));};exports['removeAnswers']=function(_0x34f75f,_0x380944){return db[_0xfa5a('0x42')][_0xfa5a('0x4b')]({'where':{'id':_0x34f75f[_0xfa5a('0x47')]['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0x380944,null))[_0xfa5a('0x15')](function(_0x51948f){if(_0x51948f){return _0x51948f[_0xfa5a('0x61')](_0x34f75f[_0xfa5a('0x35')]['ids']);}})[_0xfa5a('0x15')](respondWithStatusCode(_0x380944,null))[_0xfa5a('0x4c')](handleError(_0x380944,null));};exports[_0xfa5a('0x62')]=function(_0x3fab50,_0x12792c){_0x3fab50[_0xfa5a('0x4e')][_0xfa5a('0x63')]=_0x3fab50[_0xfa5a('0x64')][_0xfa5a('0x65')];return db[_0xfa5a('0x42')][_0xfa5a('0x4b')]({'where':{'id':_0x3fab50[_0xfa5a('0x47')]['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0x12792c,null))['then'](saveUpdates(_0x3fab50[_0xfa5a('0x4e')],null))[_0xfa5a('0x15')](respondWithResult(_0x12792c,null))[_0xfa5a('0x4c')](handleError(_0x12792c,null));};exports[_0xfa5a('0x66')]=function(_0x4640e8,_0x417d3e){_0x4640e8[_0xfa5a('0x4e')][_0xfa5a('0x67')]=_0x4640e8['file']['filename'];return db['ChatWebsite'][_0xfa5a('0x4b')]({'where':{'id':_0x4640e8['params']['id']}})['then'](handleEntityNotFound(_0x417d3e,null))[_0xfa5a('0x15')](saveUpdates(_0x4640e8['body'],null))['then'](respondWithResult(_0x417d3e,null))['catch'](handleError(_0x417d3e,null));};exports['addCustomerAvatar']=function(_0x18e6ac,_0x5ac669){_0x18e6ac['body']['customerAvatar']=_0x18e6ac['file']['filename'];return db[_0xfa5a('0x42')][_0xfa5a('0x4b')]({'where':{'id':_0x18e6ac[_0xfa5a('0x47')]['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0x5ac669,null))[_0xfa5a('0x15')](saveUpdates(_0x18e6ac[_0xfa5a('0x4e')],null))['then'](respondWithResult(_0x5ac669,null))[_0xfa5a('0x4c')](handleError(_0x5ac669,null));};exports['addSystemAvatar']=function(_0x5e819c,_0x367ff1){_0x5e819c[_0xfa5a('0x4e')][_0xfa5a('0x68')]=_0x5e819c[_0xfa5a('0x64')][_0xfa5a('0x65')];return db[_0xfa5a('0x42')][_0xfa5a('0x4b')]({'where':{'id':_0x5e819c[_0xfa5a('0x47')]['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0x367ff1,null))[_0xfa5a('0x15')](saveUpdates(_0x5e819c['body'],null))['then'](respondWithResult(_0x367ff1,null))['catch'](handleError(_0x367ff1,null));};exports[_0xfa5a('0x69')]=function(_0x2ba59b,_0x518ac5){var _0x14141c=path[_0xfa5a('0x6a')](config[_0xfa5a('0x6b')],_0xfa5a('0x6c'));var _0x4e08a6={'where':{'id':_0x2ba59b[_0xfa5a('0x47')]['id']},'attributes':['id',_0xfa5a('0x63')],'raw':!![]};var _0x3e501a=![];return require(_0xfa5a('0x6d'))[_0xfa5a('0x6e')]()[_0xfa5a('0x15')](function(_0x1799bd){if(_0x1799bd){_0x3e501a=_0x1799bd[_0xfa5a('0x6f')];}})[_0xfa5a('0x15')](function(){return db[_0xfa5a('0x42')][_0xfa5a('0x4b')](_0x4e08a6);})[_0xfa5a('0x15')](handleEntityNotFound(_0x518ac5,null))[_0xfa5a('0x15')](function(_0x2b5545){if(_0x2b5545){if(!_[_0xfa5a('0x70')](_0x2b5545[_0xfa5a('0x63')])){if(fs['existsSync'](path[_0xfa5a('0x6a')](config[_0xfa5a('0x6b')],_0xfa5a('0x71'),_0x2b5545[_0xfa5a('0x63')]))&&_0x3e501a){_0x14141c=path[_0xfa5a('0x6a')](config[_0xfa5a('0x6b')],_0xfa5a('0x71'),_0x2b5545[_0xfa5a('0x63')]);}}return _0x518ac5[_0xfa5a('0x72')](_0x14141c);}})[_0xfa5a('0x4c')](handleError(_0x518ac5,null));};exports[_0xfa5a('0x73')]=function(_0x19e33e,_0x252646){var _0x4b0c7d=path[_0xfa5a('0x6a')](config[_0xfa5a('0x6b')],_0xfa5a('0x74'));var _0x1f6b33={'where':{'id':_0x19e33e[_0xfa5a('0x47')]['id']},'attributes':['id',_0xfa5a('0x67')],'raw':!![]};return db[_0xfa5a('0x42')]['find'](_0x1f6b33)[_0xfa5a('0x15')](handleEntityNotFound(_0x252646,null))[_0xfa5a('0x15')](function(_0x28d4d2){if(_0x28d4d2){if(!_[_0xfa5a('0x70')](_0x28d4d2[_0xfa5a('0x67')])){if(fs[_0xfa5a('0x75')](path[_0xfa5a('0x6a')](config[_0xfa5a('0x6b')],_0xfa5a('0x76'),_0x28d4d2[_0xfa5a('0x67')]))){_0x4b0c7d=path[_0xfa5a('0x6a')](config[_0xfa5a('0x6b')],'server/files/images/avatars/',_0x28d4d2[_0xfa5a('0x67')]);}}return _0x252646[_0xfa5a('0x72')](_0x4b0c7d);}})[_0xfa5a('0x4c')](handleError(_0x252646,null));};exports[_0xfa5a('0x77')]=function(_0x5ee07b,_0x31cb9d){var _0x4fdf58=path[_0xfa5a('0x6a')](config[_0xfa5a('0x6b')],_0xfa5a('0x78'));var _0x9059f5={'where':{'id':_0x5ee07b[_0xfa5a('0x47')]['id']},'attributes':['id',_0xfa5a('0x79'),_0xfa5a('0x7a')],'raw':!![]};return db[_0xfa5a('0x42')][_0xfa5a('0x4b')](_0x9059f5)[_0xfa5a('0x15')](handleEntityNotFound(_0x31cb9d,null))[_0xfa5a('0x15')](function(_0x2b0a8a){if(_0x2b0a8a){if(!_[_0xfa5a('0x70')](_0x2b0a8a[_0xfa5a('0x79')])){if(fs['existsSync'](path[_0xfa5a('0x6a')](config['root'],_0xfa5a('0x76'),_0x2b0a8a[_0xfa5a('0x79')]))&&_0x2b0a8a['showCustomerAvatar']){_0x4fdf58=path[_0xfa5a('0x6a')](config[_0xfa5a('0x6b')],_0xfa5a('0x76'),_0x2b0a8a[_0xfa5a('0x79')]);}}return _0x31cb9d[_0xfa5a('0x72')](_0x4fdf58);}})['catch'](handleError(_0x31cb9d,null));};exports[_0xfa5a('0x7b')]=function(_0x45e783,_0x38838f){var _0x19df36=path[_0xfa5a('0x6a')](config['root'],_0xfa5a('0x7c'));var _0xdfc42={'where':{'id':_0x45e783[_0xfa5a('0x47')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xfa5a('0x42')]['find'](_0xdfc42)[_0xfa5a('0x15')](handleEntityNotFound(_0x38838f,null))[_0xfa5a('0x15')](function(_0x32ae79){if(_0x32ae79){if(!_[_0xfa5a('0x70')](_0x32ae79[_0xfa5a('0x68')])){if(fs[_0xfa5a('0x75')](path[_0xfa5a('0x6a')](config['root'],_0xfa5a('0x76'),_0x32ae79[_0xfa5a('0x68')]))){_0x19df36=path[_0xfa5a('0x6a')](config[_0xfa5a('0x6b')],'server/files/images/avatars/',_0x32ae79[_0xfa5a('0x68')]);}}return _0x38838f[_0xfa5a('0x72')](_0x19df36);}})['catch'](handleError(_0x38838f,null));};exports['notify']=function(_0x5ce947,_0x1730ba){var _0xeb6d85=require('user-agent-parser');var _0x3a50c3=new _0xeb6d85();var _0x1e8220=_0x3a50c3['setUA'](_0x5ce947['headers']['user-agent'])[_0xfa5a('0x7d')]();var _0x3f03fd={'body':_0x5ce947['body'],'channel':_0xfa5a('0x7e')};var _0x4a85e6=[];var _0x5e5c27=[];var _0x8ae49d={};var _0x631b84=![];return db[_0xfa5a('0x7f')][_0xfa5a('0x80')]()['then'](function(_0x1acc83){if(!_0x1acc83){throw new db[(_0xfa5a('0x81'))][(_0xfa5a('0x82'))](_0xfa5a('0x83'));}_0x4a85e6=_[_0xfa5a('0x84')](_[_0xfa5a('0x34')](_0x1acc83),['createdAt',_0xfa5a('0x85')]);_0x5e5c27=_[_0xfa5a('0x84')](_[_0xfa5a('0x34')](_0x1acc83),[_0xfa5a('0x86'),'updatedAt','CompanyId',_0xfa5a('0x87')]);if(_0x5ce947[_0xfa5a('0x4e')]['id']){delete _0x5ce947[_0xfa5a('0x4e')]['id'];}if(_[_0xfa5a('0x70')](_0x5ce947['body'][_0xfa5a('0x88')])){throw new db[(_0xfa5a('0x81'))][(_0xfa5a('0x82'))](_0xfa5a('0x89'));}if(_[_0xfa5a('0x70')](_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0x4e')])||_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0x4e')]===''){throw new db['Sequelize'][(_0xfa5a('0x82'))](_0xfa5a('0x8a'));}if(_[_0xfa5a('0x70')](_0x5ce947['body'][_0xfa5a('0x8b')])){throw new db[(_0xfa5a('0x81'))][(_0xfa5a('0x82'))](_0xfa5a('0x8c')+_0x5e5c27);}if(!_['includes'](_0x5e5c27,_0x5ce947[_0xfa5a('0x4e')]['mapKey'])){throw new db[(_0xfa5a('0x81'))][(_0xfa5a('0x82'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5e5c27);}_0x8ae49d[_0x5ce947['body'][_0xfa5a('0x8b')]]=_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0x88')];})[_0xfa5a('0x15')](function(){return db['ChatWebsite'][_0xfa5a('0x4b')]({'where':{'id':_0x5ce947['params']['id']},'include':[{'model':db[_0xfa5a('0x8d')],'as':'List','include':[{'model':db[_0xfa5a('0x7f')],'as':_0xfa5a('0x8e'),'where':_0x8ae49d,'limit':0x1,'order':[[_0xfa5a('0x85'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0xfa5a('0x8f')}]});})[_0xfa5a('0x15')](handleEntityNotFound(_0x1730ba,null))[_0xfa5a('0x15')](function(_0x189172){if(_0x189172&&_0x189172[_0xfa5a('0x90')]){_0x3f03fd[_0xfa5a('0x91')]=_0x189172;_0x3f03fd['applications']=_0x189172[_0xfa5a('0x8f')];_0x3f03fd[_0xfa5a('0x92')]=_0x189172['List'];_0x3f03fd['applications']=_[_0xfa5a('0x93')](_0x3f03fd[_0xfa5a('0x94')],[_0xfa5a('0x95')],[_0xfa5a('0x96')]);if(_0x3f03fd[_0xfa5a('0x91')][_0xfa5a('0x8f')]){delete _0x3f03fd[_0xfa5a('0x91')]['Applications'];}if(_0x3f03fd[_0xfa5a('0x91')][_0xfa5a('0x90')]&&_0x3f03fd['account'][_0xfa5a('0x90')][_0xfa5a('0x8e')][_0xfa5a('0x3a')]){return _0x3f03fd['account'][_0xfa5a('0x90')][_0xfa5a('0x8e')][0x0];}var _0x1a23df=_[_0xfa5a('0xb')](_0x5ce947[_0xfa5a('0x4e')],{'firstName':_0x5ce947['body'][_0xfa5a('0x88')],'ListId':_0x189172['ListId']});_0x1a23df[_0x5ce947['body']['mapKey']]=_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0x88')];return db['CmContact']['create'](_0x1a23df,{'fields':_0x4a85e6,'raw':!![]});}})[_0xfa5a('0x15')](handleEntityNotFound(_0x1730ba,null))[_0xfa5a('0x15')](function(_0x250513){_0x3f03fd[_0xfa5a('0x97')]=_0x250513;var _0x318d1a=_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0x98')];if(_0x5ce947[_0xfa5a('0x99')]['cf-connecting-ip']){_0x318d1a=_0x5ce947['headers']['cf-connecting-ip'];}else if(_0x5ce947[_0xfa5a('0x99')][_0xfa5a('0x9a')]){_0x318d1a=_['first'](_0x5ce947[_0xfa5a('0x99')][_0xfa5a('0x9a')][_0xfa5a('0x9b')](','));}if(_0x250513){var _0x50c2de={'ContactId':_0x250513['id'],'ChatWebsiteId':_0x5ce947[_0xfa5a('0x47')]['id'],'from':(_0x250513[_0xfa5a('0x9c')]||'')+'\x20'+(_0x250513['lastName']||''),'customerIp':_0x318d1a,'customerPort':_0x5ce947[_0xfa5a('0x99')]['x-real-port']?_0x5ce947['headers'][_0xfa5a('0x9d')]:null,'referer':_0x5ce947['body'][_0xfa5a('0x9e')],'browserName':_0x1e8220[_0xfa5a('0x9f')][_0xfa5a('0x2b')]&&_0x1e8220['browser'][_0xfa5a('0xa0')]?util[_0xfa5a('0xa1')](_0xfa5a('0xa2'),_0x1e8220[_0xfa5a('0x9f')]['name'],_0x1e8220[_0xfa5a('0x9f')]['version']):'unknown','browserVersion':_0x1e8220[_0xfa5a('0x9f')][_0xfa5a('0xa0')]||'unknown','osName':util[_0xfa5a('0xa1')](_0xfa5a('0xa2'),_0x1e8220['os'][_0xfa5a('0x2b')],_0x1e8220['os'][_0xfa5a('0xa0')]),'osVersion':_0x1e8220['os']['version'],'deviceModel':_0x1e8220[_0xfa5a('0xa3')][_0xfa5a('0x33')]&&_0x1e8220['device']['vendor']?util[_0xfa5a('0xa1')](_0xfa5a('0xa4'),_0x1e8220[_0xfa5a('0xa3')][_0xfa5a('0x33')],_0x1e8220[_0xfa5a('0xa3')]['vendor'],_0x1e8220[_0xfa5a('0xa3')][_0xfa5a('0x31')]):null,'deviceVendor':_0x1e8220[_0xfa5a('0xa3')]['vendor'],'deviceType':_0x1e8220[_0xfa5a('0xa3')][_0xfa5a('0x31')],'formData':JSON[_0xfa5a('0xa5')](_0x5ce947[_0xfa5a('0x4e')])};var _0x32d4a7={'ChatWebsiteId':_0x5ce947['params']['id'],'closed':![]};if(_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0xa6')]){_0x32d4a7['threadId']=_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0xa6')];return db['ChatInteraction'][_0xfa5a('0x4b')]({'where':_0x32d4a7})['then'](function(_0x16e4dc){if(_0x16e4dc){return[_0x16e4dc,![]];}_0x50c2de[_0xfa5a('0xa6')]=_0x5ce947[_0xfa5a('0x4e')]['threadId'];_0x50c2de[_0xfa5a('0xa7')]=_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0xa7')];return db[_0xfa5a('0xa8')][_0xfa5a('0x4d')](_0x50c2de)[_0xfa5a('0x15')](function(_0x30b801){return[_0x30b801,!![]];});});}_0x32d4a7[_0xfa5a('0xa9')]=_0x250513['id'];if(_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0xaa')]&&_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0xaa')]['id']){_0x32d4a7['id']=_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0xaa')]['id'];return db['ChatInteraction'][_0xfa5a('0x4b')]({'where':_0x32d4a7})[_0xfa5a('0x15')](function(_0x5f1e4a){if(_0x5f1e4a){return[_0x5f1e4a,![]];}return db[_0xfa5a('0xa8')][_0xfa5a('0x4d')](_0x50c2de)[_0xfa5a('0x15')](function(_0x591cb7){return[_0x591cb7,!![]];});});}return db[_0xfa5a('0xa8')]['create'](_0x50c2de)[_0xfa5a('0x15')](function(_0x16974e){return[_0x16974e,!![]];});}})[_0xfa5a('0xab')](function(_0x242ece,_0x5a2e85){if(_0x242ece){_0x631b84=_0x5a2e85;if(!_0x5a2e85){var _0x2ccbcc={'from':(_0x3f03fd['contact'][_0xfa5a('0x9c')]||'')+'\x20'+(_0x3f03fd[_0xfa5a('0x97')][_0xfa5a('0xac')]||'')};if(_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0xa6')]&&_0x5ce947[_0xfa5a('0x4e')]['messageId']&&_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0xa6')]!=_0x5ce947['body'][_0xfa5a('0xad')]){_0x2ccbcc[_0xfa5a('0xa6')]=_0x5ce947['body'][_0xfa5a('0xad')];}return _0x242ece[_0xfa5a('0xae')](_0x2ccbcc);}else{return _0x242ece;}}})[_0xfa5a('0x15')](function(_0x16c329){_0x3f03fd[_0xfa5a('0xaa')]=_0x16c329[_0xfa5a('0x25')]({'plain':!![]});_0x3f03fd['interaction'][_0xfa5a('0xaf')]=_0x631b84;if(_0x3f03fd[_0xfa5a('0xaa')]['created']){if(_0x3f03fd[_0xfa5a('0x91')][_0xfa5a('0xb0')]){_0x3f03fd['applications'][_0xfa5a('0xb1')]({'id':0x0,'priority':_0x3f03fd['applications'][_0xfa5a('0x3a')]+0x1,'app':'close','appdata':_0xfa5a('0xb2'),'interval':_0xfa5a('0xb3')});}}return db['ChatMessage']['create']({'body':_0x5ce947[_0xfa5a('0x4e')][_0xfa5a('0x4e')],'ChatWebsiteId':_0x5ce947[_0xfa5a('0x47')]['id'],'ChatInteractionId':_0x16c329['id'],'direction':'in','ContactId':_0x3f03fd[_0xfa5a('0x97')]['id'],'AttachmentId':_0x5ce947['body'][_0xfa5a('0xb4')]});})['then'](function(_0x207992){_0x3f03fd[_0xfa5a('0x1b')]=_0x207992;if(_0x3f03fd[_0xfa5a('0xaa')][_0xfa5a('0xb5')]){return db[_0xfa5a('0xb6')]['find']({'attributes':['id',_0xfa5a('0x2b')],'where':{'id':_0x3f03fd[_0xfa5a('0xaa')][_0xfa5a('0xb5')]}})['then'](function(_0x5187e7){if(_0x5187e7){_0x3f03fd[_0xfa5a('0x94')][_0xfa5a('0xb7')]({'id':0x0,'priority':0x0,'app':_0xfa5a('0xb8'),'appdata':_0x5187e7['name']+','+(_0x3f03fd[_0xfa5a('0x91')][_0xfa5a('0xb9')]||0xa),'interval':_0xfa5a('0xb3')});_0x3f03fd[_0xfa5a('0xba')]=!![];}return respondWithRpcPromise(_0xfa5a('0xbb'),_0xfa5a('0xbc'),_0x3f03fd);});}return respondWithRpcPromise('Start',_0xfa5a('0xbc'),_0x3f03fd);})[_0xfa5a('0x15')](function(_0x2a5a83){respondWithRpcPromise(_0xfa5a('0xbd'),_0xfa5a('0xbd'),{'event':_0xfa5a('0xbe'),'message':_0x2a5a83},client9002);return _0x2a5a83;})['then'](respondWithResult(_0x1730ba,null))[_0xfa5a('0x4c')](handleError(_0x1730ba,null));};exports[_0xfa5a('0xbf')]=function(_0x4ae5af,_0x1608f0){var _0x56647c,_0x97e505,_0x440b3b;var _0x37dd6b=[];var _0x52d09d={};var _0x3dd58a=_0x4ae5af[_0xfa5a('0xc0')]||[];var _0x1aeb72=[];var _0x312ae7;return db[_0xfa5a('0x7f')][_0xfa5a('0x80')]()[_0xfa5a('0x15')](function(_0x1a1a68){if(!_0x1a1a68){throw new db[(_0xfa5a('0x81'))][(_0xfa5a('0x82'))](_0xfa5a('0x83'));}_0x37dd6b=_[_0xfa5a('0x84')](_[_0xfa5a('0x34')](_0x1a1a68),['createdAt',_0xfa5a('0x85'),_0xfa5a('0xc1'),_0xfa5a('0x87')]);if(_0x4ae5af[_0xfa5a('0x4e')]['id']){delete _0x4ae5af[_0xfa5a('0x4e')]['id'];}if(_['isNil'](_0x4ae5af[_0xfa5a('0x4e')][_0xfa5a('0x88')])){throw _0x1608f0[_0xfa5a('0x1d')](0x1f4)[_0xfa5a('0x2c')](new db[(_0xfa5a('0x81'))]['ValidationError'](_0xfa5a('0x89')));}if(_[_0xfa5a('0x70')](_0x4ae5af[_0xfa5a('0x4e')][_0xfa5a('0x4e')])||_0x4ae5af[_0xfa5a('0x4e')][_0xfa5a('0x4e')]===''){throw _0x1608f0[_0xfa5a('0x1d')](0x1f4)['send'](new db[(_0xfa5a('0x81'))][(_0xfa5a('0x82'))](_0xfa5a('0x8a')));}if(_['isNil'](_0x4ae5af[_0xfa5a('0x4e')][_0xfa5a('0xc2')])){throw _0x1608f0['status'](0x1f4)['send'](new db['Sequelize'][(_0xfa5a('0x82'))](_0xfa5a('0xc3')+_0x37dd6b));}if(!_[_0xfa5a('0xc4')](_0x37dd6b,_0x4ae5af[_0xfa5a('0x4e')][_0xfa5a('0xc2')])){throw _0x1608f0[_0xfa5a('0x1d')](0x1f4)['send'](new db['Sequelize'][(_0xfa5a('0x82'))](_0xfa5a('0xc5')+_0x37dd6b));}_0x52d09d[_0x4ae5af['body']['mapKeyOffline']]=_0x4ae5af[_0xfa5a('0x4e')][_0xfa5a('0x88')];})[_0xfa5a('0x15')](function(){return db['ChatWebsite'][_0xfa5a('0x4b')]({'where':{'id':_0x4ae5af[_0xfa5a('0x47')]['id']},'include':[{'model':db[_0xfa5a('0x8d')],'as':_0xfa5a('0x90')},{'model':db[_0xfa5a('0xc6')],'as':_0xfa5a('0xc6')}]});})[_0xfa5a('0x15')](handleEntityNotFound(_0x1608f0,null))[_0xfa5a('0x15')](function(_0x455a0e){if(_0x455a0e&&_0x455a0e[_0xfa5a('0x90')]){_0x97e505=_0x455a0e;var _0x240ccb=_['defaults'](_0x4ae5af[_0xfa5a('0x4e')],{'firstName':_0x4ae5af[_0xfa5a('0x4e')][_0xfa5a('0x88')],'phone':_0x4ae5af[_0xfa5a('0x4e')][_0xfa5a('0x88')],'ListId':_0x455a0e[_0xfa5a('0x87')]});_0x240ccb[_0x4ae5af['body'][_0xfa5a('0xc2')]]=_0x4ae5af['body'][_0xfa5a('0x88')];return db[_0xfa5a('0x7f')][_0xfa5a('0xc7')]({'where':_0x52d09d,'defaults':_0x240ccb});}})[_0xfa5a('0xab')](function(_0x502289){if(_0x502289){_0x440b3b=_0x502289;var _0x194dbb=fs[_0xfa5a('0xc8')](path[_0xfa5a('0x6a')](config[_0xfa5a('0x6b')],'server/files/templates/chatOfflineMessage.ejs'),_0xfa5a('0xc9'));var _0x4e0165=ejs[_0xfa5a('0xca')](_0x194dbb,{'body':_[_0xfa5a('0xcb')](_0x4ae5af['body'][_0xfa5a('0x4e')]),'bodyTitle':_0x97e505[_0xfa5a('0xcc')]});return db[_0xfa5a('0xcd')][_0xfa5a('0x4d')]({'body':_0x4e0165,'plainBody':htmlToText[_0xfa5a('0xce')](_0x4e0165),'ContactId':_0x502289['id'],'ChatWebsiteId':_0x97e505['id']});}})[_0xfa5a('0x15')](function(_0x4187b4){_0x312ae7=_0x4187b4;if(_0x3dd58a[_0xfa5a('0x3a')]){var _0x2b6ee1=_0x3dd58a[_0xfa5a('0x2f')](function(_0x29a14c){return{'name':_0x29a14c[_0xfa5a('0xcf')],'basename':_0x29a14c['filename'],'type':_0x29a14c[_0xfa5a('0xd0')],'ChatOfflineMessageId':_0x4187b4['id']};});_0x1aeb72=_0x2b6ee1[_0xfa5a('0x2f')](_0x1475d3=>{var _0x166846={'filename':_0x1475d3['name'],'path':path['join'](config[_0xfa5a('0x6b')],_0xfa5a('0xd1'),_0xfa5a('0xc0'),'attachments','offline-chat',_0x1475d3[_0xfa5a('0xd2')])};return _0x166846;});if(!_0x97e505['openNewInteraction']){return db['sequelize'][_0xfa5a('0xd3')](function(_0x126ab1){return db[_0xfa5a('0xd4')][_0xfa5a('0xd5')](_0x2b6ee1,{'transaction':_0x126ab1});});}}})[_0xfa5a('0x15')](function(){if(_0x312ae7){_0x56647c=_0x312ae7;return db[_0xfa5a('0xc6')][_0xfa5a('0x57')]({'where':{'service':!![]},'include':[{'model':db[_0xfa5a('0xd6')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xfa5a('0xd7')],'as':_0xfa5a('0xd7'),'raw':!![]}]}]});}})['then'](function(_0x253a1a){if(_0x253a1a&&_0x253a1a[_0xfa5a('0xd8')]&&_0x97e505['forwardOffline']&&_0x97e505[_0xfa5a('0xd9')]){var _0x572d42=_0x253a1a[_0xfa5a('0xda')]();return respondWithRpcPromise(_0xfa5a('0xdb'),_0xfa5a('0xdc'),{'account':_0x572d42,'message':{'from':util[_0xfa5a('0xa1')]('\x22%s\x22\x20<%s>',_0x253a1a[_0xfa5a('0x2b')],_0x253a1a[_0xfa5a('0xdd')]||_0x253a1a[_0xfa5a('0xd8')]['user']),'to':_0x97e505[_0xfa5a('0xd9')],'subject':_0x97e505[_0xfa5a('0xde')],'html':_0x56647c[_0xfa5a('0x4e')],'attachments':_0x1aeb72}},client9003)[_0xfa5a('0x15')](function(){return _0x56647c;})[_0xfa5a('0x4c')](function(_0x293872){logger[_0xfa5a('0x1a')](_0x293872);});}})['then'](function(){if(_0x97e505&&_0x97e505['openNewInteraction']&&_0x97e505[_0xfa5a('0xdf')]){var _0x108553=[];if(_0x3dd58a[_0xfa5a('0x3a')]){_0x108553=_0x3dd58a[_0xfa5a('0x2f')](function(_0x2a9ea0){return{'name':_0x2a9ea0['originalname'],'basename':_0x2a9ea0['filename'],'type':_0x2a9ea0[_0xfa5a('0xd0')],'ChatOfflineMessageId':_0x312ae7['id']};});}var _0x2fe27d;if(!_[_0xfa5a('0x70')](_0x97e505[_0xfa5a('0xe0')])){var _0x57fca1=_[_0xfa5a('0x2f')](_0x4ae5af[_0xfa5a('0x4e')],function(_0x3e5617){return _0x3e5617;});var _0x25c0e9=_[_0xfa5a('0xe1')](_0x57fca1)[0x0];var _0xe09ebf=_[_0xfa5a('0xe2')](_0x25c0e9,function(_0x28341f){return _0x28341f;});_0x2fe27d=_0xe09ebf[0x1][_0x97e505[_0xfa5a('0xe0')]];}var _0x36bb61={'from':_0x440b3b[_0xfa5a('0xdd')],'firstName':_0x440b3b[_0xfa5a('0x9c')],'lastName':_0x440b3b[_0xfa5a('0xac')],'mapKey':_0xfa5a('0xdd'),'message':{'from':_0x440b3b['email'],'to':_0x97e505[_0xfa5a('0xc6')]['email'],'cc':'','subject':_[_0xfa5a('0x70')](_0x2fe27d)?_0x97e505[_0xfa5a('0xde')]:_0x2fe27d,'messageId':'','sentAt':new Date(),'attach':_0x108553[_0xfa5a('0x3a')],'attachments':_0x108553,'originChannel':_0xfa5a('0xe3'),'ChatWebsiteId':_0x97e505['id'],'ChatOfflineMessageId':_0x56647c['id'],'originTo':_0x97e505[_0xfa5a('0xc6')]['email']},'body':_0x56647c[_0xfa5a('0x4e')]};var _0x282a3d={'account':{'id':_0x97e505[_0xfa5a('0xdf')]},'body':_0x36bb61,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xfa5a('0xe4'),_0x282a3d,client9001)['then'](function(){return _0x56647c;})[_0xfa5a('0x4c')](function(_0x4488b4){logger[_0xfa5a('0x1a')](_0x4488b4);});}return;})[_0xfa5a('0x15')](function(){if(_0x56647c){return _0x56647c;}})[_0xfa5a('0x15')](respondWithResult(_0x1608f0,null))[_0xfa5a('0x4c')](function(_0x51a771){logger['error']('catch',_0x51a771);for(var _0x48387b of _0x3dd58a){var _0x4d2b74=path[_0xfa5a('0x6a')](config['root'],'server','files',_0xfa5a('0xe5'),_0xfa5a('0xe6'),_0x48387b[_0xfa5a('0x65')]);fs_extra[_0xfa5a('0xe7')](_0x4d2b74)[_0xfa5a('0x4c')](function(_0x7a75f){logger[_0xfa5a('0x1a')](_0xfa5a('0xe8'),_0x4d2b74,_0x7a75f);});}});};exports[_0xfa5a('0xe9')]=function(_0x203095,_0x4113fd){return db[_0xfa5a('0xa8')][_0xfa5a('0x4b')]({'where':{'id':_0x203095['params']['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0x4113fd,null))[_0xfa5a('0x15')](function(_0x146e7f){if(_0x146e7f){return _0x146e7f['addInteraction'](_0x203095[_0xfa5a('0x4e')]['ids'],_[_0xfa5a('0xea')](_0x203095[_0xfa5a('0x4e')],[_0xfa5a('0x5c'),'id'])||{});}})[_0xfa5a('0x15')](respondWithResult(_0x4113fd,null))[_0xfa5a('0x4c')](handleError(_0x4113fd,null));};exports[_0xfa5a('0xeb')]=function(_0x15f3fb,_0xad4c86){var _0x3e7c7f={'raw':![],'where':{}};var _0x22674f={};var _0x3bc529={'count':0x0,'rows':[]};return db[_0xfa5a('0x42')]['findOne']({'where':{'id':_0x15f3fb['params']['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0xad4c86,null))[_0xfa5a('0x15')](function(_0x1fd58d){if(_0x1fd58d){_0x22674f[_0xfa5a('0x33')]=_['keys'](db[_0xfa5a('0xa8')][_0xfa5a('0x49')]);_0x22674f['query']=_[_0xfa5a('0x34')](_0x15f3fb[_0xfa5a('0x35')]);_0x22674f[_0xfa5a('0x36')]=_['intersection'](_0x22674f[_0xfa5a('0x33')],_0x22674f[_0xfa5a('0x35')]);_0x3e7c7f[_0xfa5a('0x39')]=_[_0xfa5a('0x37')](_0x22674f['model'],qs[_0xfa5a('0x38')](_0x15f3fb['query']['fields']));_0x3e7c7f['attributes']=_0x3e7c7f[_0xfa5a('0x39')]['length']?_0x3e7c7f[_0xfa5a('0x39')]:_0x22674f[_0xfa5a('0x33')];if(!_0x15f3fb[_0xfa5a('0x35')]['hasOwnProperty'](_0xfa5a('0x60'))){_0x3e7c7f[_0xfa5a('0x21')]=qs[_0xfa5a('0x21')](_0x15f3fb['query'][_0xfa5a('0x21')]);_0x3e7c7f[_0xfa5a('0x1f')]=qs[_0xfa5a('0x1f')](_0x15f3fb['query'][_0xfa5a('0x1f')]);}_0x3e7c7f[_0xfa5a('0x3b')]=qs[_0xfa5a('0x3c')](_0x15f3fb[_0xfa5a('0x35')][_0xfa5a('0x3c')]);_0x3e7c7f[_0xfa5a('0x3d')]=qs[_0xfa5a('0x36')](_['pick'](_0x15f3fb[_0xfa5a('0x35')],_0x22674f[_0xfa5a('0x36')]));_0x3e7c7f[_0xfa5a('0x3d')]['ChatWebsiteId']=_0x1fd58d['id'];if(_0x15f3fb[_0xfa5a('0x35')][_0xfa5a('0x3f')]){_0x3e7c7f[_0xfa5a('0x3d')]=_[_0xfa5a('0x40')](_0x3e7c7f[_0xfa5a('0x3d')],{'$or':_[_0xfa5a('0x2f')](_0x3e7c7f[_0xfa5a('0x39')],function(_0x104be5){var _0x3ea21c={};_0x3ea21c[_0x104be5]={'$like':'%'+_0x15f3fb[_0xfa5a('0x35')][_0xfa5a('0x3f')]+'%'};return _0x3ea21c;})});}_0x3e7c7f=_['merge']({},_0x3e7c7f,_0x15f3fb[_0xfa5a('0x4a')]);return db[_0xfa5a('0xa8')][_0xfa5a('0x22')]({'where':_0x3e7c7f['where']})['then'](function(_0x1f778b){_0x3bc529[_0xfa5a('0x22')]=_0x1f778b;if(_0x15f3fb[_0xfa5a('0x35')]['includeAll']){_0x3e7c7f[_0xfa5a('0x44')]=[{'model':db[_0xfa5a('0x7f')],'as':_0xfa5a('0xec'),'required':![]},{'model':db[_0xfa5a('0xb6')],'as':_0xfa5a('0xed'),'attributes':[_0xfa5a('0x2b'),_0xfa5a('0xee'),_0xfa5a('0xef')],'required':![]},{'model':db[_0xfa5a('0xf0')],'as':_0xfa5a('0xf1'),'attributes':['id',_0xfa5a('0x2b'),'color'],'where':_0x15f3fb[_0xfa5a('0x35')]['tag']?{'id':_0x15f3fb[_0xfa5a('0x35')][_0xfa5a('0xf2')]}:undefined,'required':_0x15f3fb[_0xfa5a('0x35')]['tag']?!![]:![]}];}return db[_0xfa5a('0xa8')][_0xfa5a('0x45')](_0x3e7c7f);})[_0xfa5a('0x15')](function(_0x374956){_0x3bc529[_0xfa5a('0x5a')]=_0x374956;return _0x3bc529;});}})['then'](respondWithFilteredResult(_0xad4c86,_0x3e7c7f))[_0xfa5a('0x4c')](handleError(_0xad4c86,null));};function iftimePromise(_0x48f3c5,_0x519c4b){return respondWithRpcPromise(_0xfa5a('0xf3'),'getSnippet',{'command':_0x519c4b[_0xfa5a('0xf4')]?util[_0xfa5a('0xa1')]('iftime\x20%s,%s',_0x48f3c5[_0xfa5a('0xf5')],_0x519c4b[_0xfa5a('0xf4')]):util['format']('iftime\x20%s',_0x48f3c5[_0xfa5a('0xf5')])},client9002)[_0xfa5a('0x15')](function(_0x4608ee){var _0x235bc3=_0x4608ee&&_0x4608ee[_0xfa5a('0xf6')](_0xfa5a('0xf7'))>=0x0?!![]:![];logger[_0xfa5a('0x16')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x519c4b['id'],_0x48f3c5['id'],_0x48f3c5[_0xfa5a('0xf5')],_0x235bc3?'ONLINE':_0xfa5a('0xf8'),_0x519c4b[_0xfa5a('0xf4')]?_0x519c4b[_0xfa5a('0xf4')]:_0xfa5a('0xf9'));return _0x235bc3;})[_0xfa5a('0x4c')](function(_0x274237){logger[_0xfa5a('0x1a')](_0xfa5a('0xfa'),_0x519c4b['id'],_0x48f3c5['id'],_0x48f3c5[_0xfa5a('0xf5')],util[_0xfa5a('0xfb')](_0x274237,{'showHidden':![],'depth':null}),_0x519c4b['timezone']?_0x519c4b[_0xfa5a('0xf4')]:_0xfa5a('0xf9'));return![];});}exports[_0xfa5a('0xfc')]=function(_0x59cc37,_0x25e8b9){var _0x1783aa=0x0;var _0x561e84=0x0;var _0x3499e6=![];var _0x3cd887;var _0x21ef85;return db['ChatWebsite']['find']({'where':{'id':_0x59cc37[_0xfa5a('0x47')]['id']},'include':[{'model':db[_0xfa5a('0xfd')],'as':_0xfa5a('0xfd'),'include':[{'model':db[_0xfa5a('0xfd')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0xfa5a('0x15')](handleEntityNotFound(_0x25e8b9,null))[_0xfa5a('0x15')](function(_0xb7d75){if(_0xb7d75){_0x3cd887=_0xb7d75;return _0xb7d75[_0xfa5a('0xfe')]({'raw':!![]});}})['then'](function(_0x10c0b8){if(_0x3cd887){if(_0x10c0b8){_0x21ef85=_0x10c0b8;}}return require(_0xfa5a('0x6d'))['getLicense']();})[_0xfa5a('0x15')](function(_0x2ae3fe){if(_0x2ae3fe){_0x561e84=_0x2ae3fe['virtual'];_0x3499e6=_0x2ae3fe[_0xfa5a('0x6f')];}})[_0xfa5a('0x15')](function(){return db['ChatInteraction'][_0xfa5a('0x22')]({'where':{'closed':![]}});})['then'](function(_0x527068){_0x1783aa=_0x527068;if(_0x561e84&&_0x527068>_0x561e84){return db[_0xfa5a('0xff')][_0xfa5a('0x57')]({'where':{'id':0x1}})[_0xfa5a('0x15')](function(_0x49fa3e){if(_0x49fa3e){_0x49fa3e['increment'](_0xfa5a('0x100'));}});}})[_0xfa5a('0x15')](function(){if(_0x3cd887[_0xfa5a('0xfd')]&&_0x3cd887[_0xfa5a('0xfd')][_0xfa5a('0x101')]){var _0x4e3339=[];for(var _0x16dffa=0x0;_0x16dffa<_0x3cd887[_0xfa5a('0xfd')]['Intervals']['length'];_0x16dffa++){var _0x2da701=_0x3cd887[_0xfa5a('0xfd')][_0xfa5a('0x101')][_0x16dffa][_0xfa5a('0x25')]({'plain':!![]});_0x4e3339[_0xfa5a('0xb1')](iftimePromise(_0x2da701,_0x3cd887));}return BPromise['all'](_0x4e3339)['then'](function(_0x2d4cab){return _['some'](_0x2d4cab);});}else{return!![];}})[_0xfa5a('0x15')](function(_0x321123){var _0x30671e=fs[_0xfa5a('0xc8')](path['join'](config[_0xfa5a('0x6b')],_0xfa5a('0x102')),_0xfa5a('0xc9'));var _0x28da0d=new url[(_0xfa5a('0x103'))](_0x3cd887[_0xfa5a('0x104')])['origin'];var _0x4e5989=_0xfa5a('0x105');var _0x566ebf=![];var _0x431c8d={'chatVersion':_0x4e5989,'chatWebsiteAddressOrigin':_0x28da0d,'remote':_0x3cd887[_0xfa5a('0x106')],'query':querystring['stringify'](_[_0xfa5a('0x40')](_0x3cd887[_0xfa5a('0x25')]({'plain':!![]}),{'customerIp':_0x59cc37[_0xfa5a('0x99')][_0xfa5a('0x9a')]||_0x59cc37[_0xfa5a('0x99')][_0xfa5a('0x107')]||_0x59cc37['connection'][_0xfa5a('0x108')]||_0x59cc37['ip'],'referer':_0x59cc37[_0xfa5a('0x99')]['referer'],'openedInteractions':_0x1783aa,'maxInteractions':_0x561e84,'virtual':_0x3499e6['virtual'],'online':_0x321123,'custom':_0x3499e6}))[_0xfa5a('0x109')](/'/g,'\x5c\x27')};_0x25e8b9[_0xfa5a('0x2c')](ejs[_0xfa5a('0xca')](Mustache[_0xfa5a('0xca')](_0x30671e,_0x431c8d),{'proactiveActions':_0x21ef85,'alignment':_0x3cd887[_0xfa5a('0x10a')],'verticalAlignment':_0x3cd887[_0xfa5a('0x10b')],'div_color':_0x3cd887['color'],'labelText':_0x3cd887[_0xfa5a('0x10c')],'text_color':_0x3cd887[_0xfa5a('0x10d')],'text_button_color':_0x3cd887[_0xfa5a('0x10e')],'button_color':_0x3cd887['color_button'],'background_color':_0x3cd887[_0xfa5a('0x10f')],'hideWhenOffline':_0x3cd887[_0xfa5a('0x110')],'intervalId':_0x3cd887[_0xfa5a('0x111')],'isDevelopment':_0x566ebf,'chatVersion':_0x4e5989}));})['catch'](handleError(_0x25e8b9,null));};exports[_0xfa5a('0x112')]=function(_0x28a626,_0x13cd80){var _0x15433f=_0x28a626[_0xfa5a('0x47')]['id'];var _0x3fe030=_0x28a626[_0xfa5a('0x4e')];var _0x42d283=0xc8;var _0x153c13=null;return db[_0xfa5a('0x113')][_0xfa5a('0xd3')]({'isolationLevel':db['sequelize'][_0xfa5a('0x114')][_0xfa5a('0x115')][_0xfa5a('0x116')]},function(_0x2443d1){return db[_0xfa5a('0x42')][_0xfa5a('0x57')]({'where':{'id':_0x15433f},'transaction':_0x2443d1})[_0xfa5a('0x15')](function(_0x88f953){if(_0x88f953){return db[_0xfa5a('0x117')][_0xfa5a('0x27')]({'where':{'ChatWebsiteId':_0x15433f},'transaction':_0x2443d1})[_0xfa5a('0x15')](function(){var _0x323292=_[_0xfa5a('0x2f')](_0x3fe030,function(_0x1f97c4){_0x1f97c4[_0xfa5a('0x59')]=_0x15433f;return _0x1f97c4;});return db[_0xfa5a('0x117')][_0xfa5a('0xd5')](_0x323292,{'transaction':_0x2443d1});});}else{_0x42d283=0x194;_0x153c13=[];}});})[_0xfa5a('0x15')](function(){if(_0x42d283!==0x194){return db['ChatApplication'][_0xfa5a('0x118')]({'where':{'ChatWebsiteId':_0x15433f},'order':_0xfa5a('0x95')})[_0xfa5a('0x15')](function(_0x218427){_0x153c13=_0x218427;});}})[_0xfa5a('0x4c')](function(_0x48cacf){_0x42d283=0x1f4;logger['error'](_0x48cacf[_0xfa5a('0x2a')]);if(_0x48cacf['name']){delete _0x48cacf[_0xfa5a('0x2b')];}_0x153c13=_0x48cacf;})[_0xfa5a('0x119')](function(){if(_0x153c13===null){_0x13cd80[_0xfa5a('0x29')](_0x42d283);}else{if(_0x42d283===0x1f4){_0x13cd80['status'](_0x42d283)[_0xfa5a('0x2c')](_0x153c13);}else{_0x13cd80[_0xfa5a('0x1d')](_0x42d283)[_0xfa5a('0x1e')](_0x153c13);}}});};exports[_0xfa5a('0x11a')]=function(_0xbf558f,_0x57cb3b){var _0x488f19={};var _0x2da14c={};var _0x532975;var _0x332a61;return db[_0xfa5a('0x42')][_0xfa5a('0x57')]({'where':{'id':_0xbf558f[_0xfa5a('0x47')]['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0x57cb3b,null))['then'](function(_0x5392aa){if(_0x5392aa){_0x532975=_0x5392aa;_0x2da14c[_0xfa5a('0x33')]=_['keys'](db[_0xfa5a('0x117')]['rawAttributes']);_0x2da14c[_0xfa5a('0x35')]=_[_0xfa5a('0x34')](_0xbf558f['query']);_0x2da14c[_0xfa5a('0x36')]=_[_0xfa5a('0x37')](_0x2da14c[_0xfa5a('0x33')],_0x2da14c[_0xfa5a('0x35')]);_0x488f19['attributes']=_[_0xfa5a('0x37')](_0x2da14c['model'],qs['fields'](_0xbf558f[_0xfa5a('0x35')][_0xfa5a('0x38')]));_0x488f19['attributes']=_0x488f19[_0xfa5a('0x39')][_0xfa5a('0x3a')]?_0x488f19[_0xfa5a('0x39')]:_0x2da14c['model'];_0x488f19['order']=qs['sort'](_0xbf558f[_0xfa5a('0x35')]['sort']);_0x488f19['where']=qs['filters'](_['pick'](_0xbf558f[_0xfa5a('0x35')],_0x2da14c[_0xfa5a('0x36')]));if(_0xbf558f[_0xfa5a('0x35')][_0xfa5a('0x3f')]){_0x488f19['where']=_[_0xfa5a('0x40')](_0x488f19['where'],{'$or':_[_0xfa5a('0x2f')](_0x488f19[_0xfa5a('0x39')],function(_0xeeeab4){var _0x27c46f={};_0x27c46f[_0xeeeab4]={'$like':'%'+_0xbf558f['query'][_0xfa5a('0x3f')]+'%'};return _0x27c46f;})});}_0x488f19=_[_0xfa5a('0x40')]({},_0x488f19,_0xbf558f['options']);return _0x532975[_0xfa5a('0x11a')](_0x488f19);}})[_0xfa5a('0x15')](function(_0x2abf76){if(_0x2abf76){_0x332a61=_0x2abf76[_0xfa5a('0x3a')];if(!_0xbf558f[_0xfa5a('0x35')][_0xfa5a('0x58')](_0xfa5a('0x60'))){_0x488f19[_0xfa5a('0x21')]=qs[_0xfa5a('0x21')](_0xbf558f[_0xfa5a('0x35')][_0xfa5a('0x21')]);_0x488f19[_0xfa5a('0x1f')]=qs[_0xfa5a('0x1f')](_0xbf558f[_0xfa5a('0x35')][_0xfa5a('0x1f')]);}return _0x532975[_0xfa5a('0x11a')](_0x488f19);}})[_0xfa5a('0x15')](function(_0x20fe3e){if(_0x20fe3e){return _0x20fe3e?{'count':_0x332a61,'rows':_0x20fe3e}:null;}})[_0xfa5a('0x15')](respondWithResult(_0x57cb3b,null))[_0xfa5a('0x4c')](handleError(_0x57cb3b,null));};exports[_0xfa5a('0x11b')]=function(_0x313eb1,_0x4d9bd9){return db[_0xfa5a('0x11c')]['find']({'where':{'id':_0x313eb1[_0xfa5a('0x47')]['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0x4d9bd9,null))[_0xfa5a('0x15')](function(_0x5583c4){if(_0x5583c4){return _0x5583c4[_0xfa5a('0x11b')](_0x313eb1[_0xfa5a('0x4e')][_0xfa5a('0x5c')],_[_0xfa5a('0xea')](_0x313eb1[_0xfa5a('0x4e')],['ids','id'])||{});}})[_0xfa5a('0x15')](respondWithResult(_0x4d9bd9,null))[_0xfa5a('0x4c')](handleError(_0x4d9bd9,null));};exports['getProactiveActions']=function(_0x586aa2,_0x44f456){var _0x38147a={};var _0x17c6b1={};var _0x5dcb0a;var _0x31302d;return db[_0xfa5a('0x42')][_0xfa5a('0x57')]({'where':{'id':_0x586aa2[_0xfa5a('0x47')]['id']}})['then'](handleEntityNotFound(_0x44f456,null))[_0xfa5a('0x15')](function(_0x2b85fd){if(_0x2b85fd){_0x5dcb0a=_0x2b85fd;_0x17c6b1[_0xfa5a('0x33')]=_[_0xfa5a('0x34')](db['ChatProactiveAction'][_0xfa5a('0x49')]);_0x17c6b1[_0xfa5a('0x35')]=_[_0xfa5a('0x34')](_0x586aa2[_0xfa5a('0x35')]);_0x17c6b1[_0xfa5a('0x36')]=_[_0xfa5a('0x37')](_0x17c6b1[_0xfa5a('0x33')],_0x17c6b1[_0xfa5a('0x35')]);_0x38147a['attributes']=_[_0xfa5a('0x37')](_0x17c6b1['model'],qs['fields'](_0x586aa2['query']['fields']));_0x38147a[_0xfa5a('0x39')]=_0x38147a[_0xfa5a('0x39')][_0xfa5a('0x3a')]?_0x38147a[_0xfa5a('0x39')]:_0x17c6b1[_0xfa5a('0x33')];_0x38147a[_0xfa5a('0x3b')]=qs[_0xfa5a('0x3c')](_0x586aa2[_0xfa5a('0x35')][_0xfa5a('0x3c')]);_0x38147a[_0xfa5a('0x3d')]=qs[_0xfa5a('0x36')](_[_0xfa5a('0x3e')](_0x586aa2['query'],_0x17c6b1[_0xfa5a('0x36')]));if(_0x586aa2[_0xfa5a('0x35')][_0xfa5a('0x3f')]){_0x38147a[_0xfa5a('0x3d')]=_[_0xfa5a('0x40')](_0x38147a[_0xfa5a('0x3d')],{'$or':_['map'](_0x38147a[_0xfa5a('0x39')],function(_0x593f82){var _0x4d5f03={};_0x4d5f03[_0x593f82]={'$like':'%'+_0x586aa2[_0xfa5a('0x35')][_0xfa5a('0x3f')]+'%'};return _0x4d5f03;})});}_0x38147a=_[_0xfa5a('0x40')]({},_0x38147a,_0x586aa2[_0xfa5a('0x4a')]);return _0x5dcb0a['getProactiveActions'](_0x38147a);}})[_0xfa5a('0x15')](function(_0x121b1f){if(_0x121b1f){_0x31302d=_0x121b1f['length'];if(!_0x586aa2[_0xfa5a('0x35')][_0xfa5a('0x58')](_0xfa5a('0x60'))){_0x38147a['limit']=qs[_0xfa5a('0x21')](_0x586aa2[_0xfa5a('0x35')][_0xfa5a('0x21')]);_0x38147a[_0xfa5a('0x1f')]=qs[_0xfa5a('0x1f')](_0x586aa2[_0xfa5a('0x35')][_0xfa5a('0x1f')]);}return _0x5dcb0a[_0xfa5a('0xfe')](_0x38147a);}})[_0xfa5a('0x15')](function(_0x56bd91){if(_0x56bd91){return _0x56bd91?{'count':_0x31302d,'rows':_0x56bd91}:null;}})[_0xfa5a('0x15')](respondWithResult(_0x44f456,null))[_0xfa5a('0x4c')](handleError(_0x44f456,null));};exports[_0xfa5a('0x11d')]=function(_0x577e24,_0x2a0589){var _0x16345f=_0x577e24[_0xfa5a('0x35')][_0xfa5a('0x11e')]==='false'?'offlineForm':_0xfa5a('0x11f');return db['ChatWebsite'][_0xfa5a('0x4b')]({'attributes':['id',_0x16345f],'where':{'id':_0x577e24[_0xfa5a('0x47')]['id']}})['then'](handleEntityNotFound(_0x2a0589,null))[_0xfa5a('0x15')](function(_0x5447c9){if(_0x5447c9){var _0x4cb61b=_0x5447c9[_0x16345f];var _0x340dd1=_0x4cb61b&&_0x4cb61b['items']?_0x4cb61b[_0xfa5a('0x120')]:[];_0x2a0589['send']({'fromKey':_[_0xfa5a('0x70')](_0x4cb61b[_0xfa5a('0x121')])?undefined:_0x4cb61b[_0xfa5a('0x121')],'count':_0x340dd1['length'],'rows':_0x340dd1});}})['catch'](handleError(_0x2a0589,null));};exports['getOfflineMessages']=function(_0x5cbdc6,_0xdfa641){var _0x296e9b={'raw':![],'where':{}};var _0x5d8173={};var _0x1648ff={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfa5a('0x57')]({'where':{'id':_0x5cbdc6[_0xfa5a('0x47')]['id']}})['then'](handleEntityNotFound(_0xdfa641,null))[_0xfa5a('0x15')](function(_0x30ebfc){if(_0x30ebfc){_0x5d8173['model']=_[_0xfa5a('0x34')](db[_0xfa5a('0xcd')][_0xfa5a('0x49')]);_0x5d8173['query']=_[_0xfa5a('0x34')](_0x5cbdc6[_0xfa5a('0x35')]);_0x5d8173[_0xfa5a('0x36')]=_[_0xfa5a('0x37')](_0x5d8173['model'],_0x5d8173[_0xfa5a('0x35')]);_0x296e9b[_0xfa5a('0x39')]=_[_0xfa5a('0x37')](_0x5d8173[_0xfa5a('0x33')],qs['fields'](_0x5cbdc6['query']['fields']));_0x296e9b[_0xfa5a('0x39')]=_0x296e9b[_0xfa5a('0x39')][_0xfa5a('0x3a')]?_0x296e9b['attributes']:_0x5d8173[_0xfa5a('0x33')];if(!_0x5cbdc6[_0xfa5a('0x35')][_0xfa5a('0x58')](_0xfa5a('0x60'))){_0x296e9b[_0xfa5a('0x21')]=qs[_0xfa5a('0x21')](_0x5cbdc6['query']['limit']);_0x296e9b[_0xfa5a('0x1f')]=qs[_0xfa5a('0x1f')](_0x5cbdc6[_0xfa5a('0x35')][_0xfa5a('0x1f')]);}_0x296e9b[_0xfa5a('0x3b')]=qs[_0xfa5a('0x3c')](_0x5cbdc6['query'][_0xfa5a('0x3c')]);_0x296e9b[_0xfa5a('0x3d')]=qs['filters'](_[_0xfa5a('0x3e')](_0x5cbdc6[_0xfa5a('0x35')],_0x5d8173[_0xfa5a('0x36')]));_0x296e9b[_0xfa5a('0x3d')]['ChatWebsiteId']=_0x30ebfc['id'];if(_0x5cbdc6[_0xfa5a('0x35')][_0xfa5a('0x3f')]){_0x296e9b[_0xfa5a('0x3d')]=_[_0xfa5a('0x40')](_0x296e9b[_0xfa5a('0x3d')],{'$or':_['map'](_0x296e9b[_0xfa5a('0x39')],function(_0x4627ea){var _0x48f627={};_0x48f627[_0x4627ea]={'$like':'%'+_0x5cbdc6[_0xfa5a('0x35')]['filter']+'%'};return _0x48f627;})});}_0x296e9b=_[_0xfa5a('0x40')]({},_0x296e9b,_0x5cbdc6[_0xfa5a('0x4a')]);return db['ChatOfflineMessage']['count']({'where':_0x296e9b['where']})[_0xfa5a('0x15')](function(_0x67cebe){_0x1648ff[_0xfa5a('0x22')]=_0x67cebe;if(_0x5cbdc6[_0xfa5a('0x35')][_0xfa5a('0x43')]){_0x296e9b['include']=[{'all':!![]}];}else{_0x296e9b[_0xfa5a('0x44')]=[{'model':db[_0xfa5a('0x7f')],'as':_0xfa5a('0xec'),'required':![]},{'model':db[_0xfa5a('0xd4')],'as':_0xfa5a('0x122'),'required':![]}];}return db[_0xfa5a('0xcd')][_0xfa5a('0x45')](_0x296e9b);})[_0xfa5a('0x15')](function(_0x285cb2){_0x1648ff[_0xfa5a('0x5a')]=_0x285cb2;return _0x1648ff;});}})[_0xfa5a('0x15')](respondWithFilteredResult(_0xdfa641,_0x296e9b))[_0xfa5a('0x4c')](handleError(_0xdfa641,null));};exports[_0xfa5a('0x123')]=function(_0xdcbc76,_0xa425b4){return db[_0xfa5a('0x42')]['find']({'where':{'id':_0xdcbc76[_0xfa5a('0x47')]['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0xa425b4,null))[_0xfa5a('0x15')](function(_0x73cacc){if(_0x73cacc){return _0x73cacc['addAgents'](_0xdcbc76[_0xfa5a('0x4e')][_0xfa5a('0x5c')],_['omit'](_0xdcbc76[_0xfa5a('0x4e')],[_0xfa5a('0x5c'),'id'])||{})['spread'](function(_0x14eb57){for(var _0x4185d5=0x0;_0x4185d5<_0xdcbc76[_0xfa5a('0x4e')][_0xfa5a('0x5c')][_0xfa5a('0x3a')];_0x4185d5+=0x1){socket[_0xfa5a('0x124')](_0xfa5a('0x125'),{'UserId':Number(_0xdcbc76['body'][_0xfa5a('0x5c')][_0x4185d5]),'ChatWebsiteId':Number(_0xdcbc76['params']['id'])});}return _0x14eb57;});}})[_0xfa5a('0x15')](respondWithResult(_0xa425b4,null))[_0xfa5a('0x4c')](handleError(_0xa425b4,null));};exports[_0xfa5a('0x126')]=function(_0x31b84a,_0x5f4e7e){return db['ChatWebsite'][_0xfa5a('0x4b')]({'where':{'id':_0x31b84a[_0xfa5a('0x47')]['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0x5f4e7e,null))['then'](function(_0x599aa8){if(_0x599aa8){return _0x599aa8[_0xfa5a('0x126')](_0x31b84a['query'][_0xfa5a('0x5c')])[_0xfa5a('0x15')](function(){if(_[_0xfa5a('0x127')](_0x31b84a[_0xfa5a('0x35')][_0xfa5a('0x5c')])){for(var _0x1ec458=0x0;_0x1ec458<_0x31b84a[_0xfa5a('0x35')]['ids'][_0xfa5a('0x3a')];_0x1ec458+=0x1){socket['emit'](_0xfa5a('0x128'),{'UserId':Number(_0x31b84a[_0xfa5a('0x35')][_0xfa5a('0x5c')][_0x1ec458]),'ChatWebsiteId':Number(_0x31b84a[_0xfa5a('0x47')]['id'])});}}else{socket['emit'](_0xfa5a('0x128'),{'UserId':Number(_0x31b84a[_0xfa5a('0x35')][_0xfa5a('0x5c')]),'ChatWebsiteId':Number(_0x31b84a['params']['id'])});}});}})[_0xfa5a('0x15')](respondWithStatusCode(_0x5f4e7e,null))[_0xfa5a('0x4c')](handleError(_0x5f4e7e,null));};exports[_0xfa5a('0x129')]=function(_0x3b16d7,_0x1f36ea){var _0x10ff39={};var _0x14f127={};var _0x2b18b0;var _0x5e4786;return db[_0xfa5a('0x42')][_0xfa5a('0x57')]({'where':{'id':_0x3b16d7[_0xfa5a('0x47')]['id']}})[_0xfa5a('0x15')](handleEntityNotFound(_0x1f36ea,null))['then'](function(_0x1a3c83){if(_0x1a3c83){_0x2b18b0=_0x1a3c83;_0x14f127[_0xfa5a('0x33')]=_[_0xfa5a('0x34')](db['User'][_0xfa5a('0x49')]);_0x14f127['query']=_[_0xfa5a('0x34')](_0x3b16d7[_0xfa5a('0x35')]);_0x14f127[_0xfa5a('0x36')]=_[_0xfa5a('0x37')](_0x14f127['model'],_0x14f127[_0xfa5a('0x35')]);_0x10ff39[_0xfa5a('0x39')]=_[_0xfa5a('0x37')](_0x14f127[_0xfa5a('0x33')],qs[_0xfa5a('0x38')](_0x3b16d7[_0xfa5a('0x35')][_0xfa5a('0x38')]));_0x10ff39[_0xfa5a('0x39')]=_0x10ff39[_0xfa5a('0x39')][_0xfa5a('0x3a')]?_0x10ff39[_0xfa5a('0x39')]:_0x14f127[_0xfa5a('0x33')];_0x10ff39[_0xfa5a('0x3b')]=qs['sort'](_0x3b16d7['query'][_0xfa5a('0x3c')]);_0x10ff39[_0xfa5a('0x3d')]=qs[_0xfa5a('0x36')](_[_0xfa5a('0x3e')](_0x3b16d7[_0xfa5a('0x35')],_0x14f127[_0xfa5a('0x36')]));if(_0x3b16d7['query'][_0xfa5a('0x3f')]){_0x10ff39[_0xfa5a('0x3d')]=_[_0xfa5a('0x40')](_0x10ff39[_0xfa5a('0x3d')],{'$or':_[_0xfa5a('0x2f')](_0x10ff39['attributes'],function(_0xd18778){var _0x40250b={};_0x40250b[_0xd18778]={'$like':'%'+_0x3b16d7['query'][_0xfa5a('0x3f')]+'%'};return _0x40250b;})});}_0x10ff39=_[_0xfa5a('0x40')]({},_0x10ff39,_0x3b16d7[_0xfa5a('0x4a')]);return _0x2b18b0[_0xfa5a('0x129')](_0x10ff39);}})[_0xfa5a('0x15')](function(_0x419dde){if(_0x419dde){_0x5e4786=_0x419dde['length'];if(!_0x3b16d7[_0xfa5a('0x35')][_0xfa5a('0x58')]('nolimit')){_0x10ff39[_0xfa5a('0x21')]=qs[_0xfa5a('0x21')](_0x3b16d7[_0xfa5a('0x35')][_0xfa5a('0x21')]);_0x10ff39['offset']=qs[_0xfa5a('0x1f')](_0x3b16d7[_0xfa5a('0x35')][_0xfa5a('0x1f')]);}return _0x2b18b0[_0xfa5a('0x129')](_0x10ff39);}})[_0xfa5a('0x15')](function(_0x39d52a){if(_0x39d52a){return _0x39d52a?{'count':_0x5e4786,'rows':_0x39d52a}:null;}})[_0xfa5a('0x15')](respondWithResult(_0x1f36ea,null))['catch'](handleError(_0x1f36ea,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index a5190d6..dcb28a1 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 _0x6b4e=['emit','hasOwnProperty','hook','exports','../../mysqldb','remove'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x4cba09,_0x169035){_0x4cba09=_0x4cba09-0x0;var _0x1d626e=_0x6b4e[_0x4cba09];return _0x1d626e;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xe6b4('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe6b4('0x1')};function emitEvent(_0x3be9b1){return function(_0x1aedc5,_0x344db1,_0x436fc0){ChatWebsiteEvents[_0xe6b4('0x2')](_0x3be9b1+':'+_0x1aedc5['id'],_0x1aedc5);ChatWebsiteEvents['emit'](_0x3be9b1,_0x1aedc5);_0x436fc0(null);};}for(var e in events){if(events[_0xe6b4('0x3')](e)){var event=events[e];ChatWebsite[_0xe6b4('0x4')](e,emitEvent(event));}}module[_0xe6b4('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x615a=['exports','events','ChatWebsite','save','update','remove','emit','hook'];(function(_0x6bb4fa,_0x4603e3){var _0x4cd4d0=function(_0x194f14){while(--_0x194f14){_0x6bb4fa['push'](_0x6bb4fa['shift']());}};_0x4cd4d0(++_0x4603e3);}(_0x615a,0x119));var _0xa615=function(_0x173b35,_0x5830a){_0x173b35=_0x173b35-0x0;var _0x5d68fb=_0x615a[_0x173b35];return _0x5d68fb;};'use strict';var EventEmitter=require(_0xa615('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xa615('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa615('0x2'),'afterUpdate':_0xa615('0x3'),'afterDestroy':_0xa615('0x4')};function emitEvent(_0x11fd6e){return function(_0x52ae35,_0x1d9a38,_0x1463be){ChatWebsiteEvents['emit'](_0x11fd6e+':'+_0x52ae35['id'],_0x52ae35);ChatWebsiteEvents[_0xa615('0x5')](_0x11fd6e,_0x52ae35);_0x1463be(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xa615('0x6')](e,emitEvent(event));}}module[_0xa615('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 458002c..51548d5 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 _0xea56=['moment','request-promise','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api'];(function(_0x597db9,_0x5a8c52){var _0xc6120b=function(_0x33c6bc){while(--_0x33c6bc){_0x597db9['push'](_0x597db9['shift']());}};_0xc6120b(++_0x5a8c52);}(_0xea56,0x74));var _0x6ea5=function(_0x281353,_0x5d53a9){_0x281353=_0x281353-0x0;var _0x4f4e7b=_0xea56[_0x281353];return _0x4f4e7b;};'use strict';var _=require(_0x6ea5('0x0'));var util=require(_0x6ea5('0x1'));var logger=require(_0x6ea5('0x2'))(_0x6ea5('0x3'));var moment=require(_0x6ea5('0x4'));var BPromise=require('bluebird');var rp=require(_0x6ea5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ea5('0x6'));var config=require('../../config/environment');var attributes=require(_0x6ea5('0x7'));module[_0x6ea5('0x8')]=function(_0x4e2953,_0x218b92){return _0x4e2953[_0x6ea5('0x9')](_0x6ea5('0xa'),attributes,{'tableName':_0x6ea5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x56e9=['path','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','moment','request-promise'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0x56e9,0xf9));var _0x956e=function(_0x3f96f0,_0xa755cc){_0x3f96f0=_0x3f96f0-0x0;var _0x338019=_0x56e9[_0x3f96f0];return _0x338019;};'use strict';var _=require(_0x956e('0x0'));var util=require('util');var logger=require(_0x956e('0x1'))('api');var moment=require(_0x956e('0x2'));var BPromise=require('bluebird');var rp=require(_0x956e('0x3'));var fs=require('fs');var path=require(_0x956e('0x4'));var rimraf=require(_0x956e('0x5'));var config=require(_0x956e('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x956e('0x7')]=function(_0x25562d,_0x1c940a){return _0x25562d[_0x956e('0x8')](_0x956e('0x9'),attributes,{'tableName':_0x956e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 14abb62..5dae62c 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 _0x16fb=['jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x211791,_0xb1b929){var _0x198234=function(_0x43ee1f){while(--_0x43ee1f){_0x211791['push'](_0x211791['shift']());}};_0x198234(++_0xb1b929);}(_0x16fb,0x189));var _0xb16f=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x16fb[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0xb16f('0x0'));var util=require(_0xb16f('0x1'));var moment=require('moment');var BPromise=require(_0xb16f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb16f('0x3'));var db=require(_0xb16f('0x4'))['db'];var utils=require(_0xb16f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb16f('0x6'));var jayson=require(_0xb16f('0x7'));var client=jayson[_0xb16f('0x8')][_0xb16f('0x9')]({'port':0x232a});config[_0xb16f('0xa')]=_[_0xb16f('0xb')](config[_0xb16f('0xa')],{'host':_0xb16f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb16f('0xa')]));require(_0xb16f('0xd'))['register'](socket);function respondWithRpcPromise(_0xeab76,_0x1d65d4,_0x2601fc){return new BPromise(function(_0x2ed95e,_0x31427c){return client[_0xb16f('0xe')](_0xeab76,_0x2601fc)['then'](function(_0x89c532){logger['info'](_0xb16f('0xf'),_0x1d65d4,_0xb16f('0x10'));logger[_0xb16f('0x11')](_0xb16f('0x12'),_0x1d65d4,'request\x20sent',JSON[_0xb16f('0x13')](_0x89c532));if(_0x89c532[_0xb16f('0x14')]){if(_0x89c532[_0xb16f('0x14')]['code']===0x1f4){logger['error'](_0xb16f('0xf'),_0x1d65d4,_0x89c532[_0xb16f('0x14')][_0xb16f('0x15')]);return _0x31427c(_0x89c532[_0xb16f('0x14')][_0xb16f('0x15')]);}logger['error'](_0xb16f('0xf'),_0x1d65d4,_0x89c532['error'][_0xb16f('0x15')]);return _0x2ed95e(_0x89c532[_0xb16f('0x14')][_0xb16f('0x15')]);}else{logger[_0xb16f('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x1d65d4,'request\x20sent');_0x2ed95e(_0x89c532[_0xb16f('0x17')][_0xb16f('0x15')]);}})[_0xb16f('0x18')](function(_0x40099b){logger[_0xb16f('0x14')](_0xb16f('0xf'),_0x1d65d4,_0x40099b);_0x31427c(_0x40099b);});});}
\ No newline at end of file
+var _0xa341=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4981b8,_0x2eac0f){var _0x4e149e=function(_0x11f256){while(--_0x11f256){_0x4981b8['push'](_0x4981b8['shift']());}};_0x4e149e(++_0x2eac0f);}(_0xa341,0x1bc));var _0x1a34=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa341[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x1a34('0x0'));var util=require(_0x1a34('0x1'));var moment=require('moment');var BPromise=require(_0x1a34('0x2'));var rs=require(_0x1a34('0x3'));var fs=require('fs');var Redis=require(_0x1a34('0x4'));var db=require(_0x1a34('0x5'))['db'];var utils=require(_0x1a34('0x6'));var logger=require('../../config/logger')(_0x1a34('0x7'));var config=require(_0x1a34('0x8'));var jayson=require(_0x1a34('0x9'));var client=jayson[_0x1a34('0xa')][_0x1a34('0xb')]({'port':0x232a});config[_0x1a34('0xc')]=_[_0x1a34('0xd')](config[_0x1a34('0xc')],{'host':_0x1a34('0xe'),'port':0x18eb});var socket=require(_0x1a34('0xf'))(new Redis(config[_0x1a34('0xc')]));require(_0x1a34('0x10'))[_0x1a34('0x11')](socket);function respondWithRpcPromise(_0x5b15e1,_0x4ccf51,_0x14b221){return new BPromise(function(_0x25bd19,_0x56642c){return client[_0x1a34('0x12')](_0x5b15e1,_0x14b221)[_0x1a34('0x13')](function(_0x47394c){logger[_0x1a34('0x14')](_0x1a34('0x15'),_0x4ccf51,_0x1a34('0x16'));logger[_0x1a34('0x17')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x4ccf51,_0x1a34('0x16'),JSON[_0x1a34('0x18')](_0x47394c));if(_0x47394c[_0x1a34('0x19')]){if(_0x47394c[_0x1a34('0x19')][_0x1a34('0x1a')]===0x1f4){logger['error'](_0x1a34('0x15'),_0x4ccf51,_0x47394c[_0x1a34('0x19')][_0x1a34('0x1b')]);return _0x56642c(_0x47394c['error'][_0x1a34('0x1b')]);}logger[_0x1a34('0x19')](_0x1a34('0x15'),_0x4ccf51,_0x47394c[_0x1a34('0x19')][_0x1a34('0x1b')]);return _0x25bd19(_0x47394c[_0x1a34('0x19')][_0x1a34('0x1b')]);}else{logger[_0x1a34('0x14')](_0x1a34('0x15'),_0x4ccf51,_0x1a34('0x16'));_0x25bd19(_0x47394c[_0x1a34('0x1c')][_0x1a34('0x1b')]);}})[_0x1a34('0x1d')](function(_0x6890c2){logger[_0x1a34('0x19')](_0x1a34('0x15'),_0x4ccf51,_0x6890c2);_0x56642c(_0x6890c2);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 31402cc..62bbdef 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 _0x3e7f=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x3e7f,0x66));var _0xf3e7=function(_0x2c9db3,_0x47f183){_0x2c9db3=_0x2c9db3-0x0;var _0x2d7879=_0x3e7f[_0x2c9db3];return _0x2d7879;};'use strict';var ChatWebsiteEvents=require(_0xf3e7('0x0'));var events=[_0xf3e7('0x1'),_0xf3e7('0x2'),'update'];function createListener(_0x3db708,_0x4382e2){return function(_0xdde034){_0x4382e2[_0xf3e7('0x3')](_0x3db708,_0xdde034);};}function removeListener(_0x27e628,_0x208207){return function(){ChatWebsiteEvents[_0xf3e7('0x4')](_0x27e628,_0x208207);};}exports[_0xf3e7('0x5')]=function(_0x429845){for(var _0x23c1be=0x0,_0x1c98ce=events[_0xf3e7('0x6')];_0x23c1be<_0x1c98ce;_0x23c1be++){var _0x33e6d4=events[_0x23c1be];var _0x5133ed=createListener(_0xf3e7('0x7')+_0x33e6d4,_0x429845);ChatWebsiteEvents['on'](_0x33e6d4,_0x5133ed);}};
\ No newline at end of file
+var _0xac3c=['register','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener'];(function(_0x30573a,_0x1b94e3){var _0x309cc8=function(_0x63bc1c){while(--_0x63bc1c){_0x30573a['push'](_0x30573a['shift']());}};_0x309cc8(++_0x1b94e3);}(_0xac3c,0x17a));var _0xcac3=function(_0x1c6025,_0x151efe){_0x1c6025=_0x1c6025-0x0;var _0x11db0a=_0xac3c[_0x1c6025];return _0x11db0a;};'use strict';var ChatWebsiteEvents=require(_0xcac3('0x0'));var events=[_0xcac3('0x1'),_0xcac3('0x2'),_0xcac3('0x3')];function createListener(_0x108439,_0x245ae4){return function(_0xa3ee56){_0x245ae4[_0xcac3('0x4')](_0x108439,_0xa3ee56);};}function removeListener(_0x1894fa,_0x1e6529){return function(){ChatWebsiteEvents[_0xcac3('0x5')](_0x1894fa,_0x1e6529);};}exports[_0xcac3('0x6')]=function(_0x45657a){for(var _0xab02fa=0x0,_0x10757f=events['length'];_0xab02fa<_0x10757f;_0xab02fa++){var _0x3b02b4=events[_0xab02fa];var _0x40004b=createListener(_0xcac3('0x7')+_0x3b02b4,_0x45657a);ChatWebsiteEvents['on'](_0x3b02b4,_0x40004b);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 75626cd..ee92b3d 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 _0x60ba=['addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','single','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x60ba,0x75));var _0xa60b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x60ba[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xa60b('0x0'));var util=require('util');var path=require(_0xa60b('0x1'));var timeout=require(_0xa60b('0x2'));var express=require(_0xa60b('0x3'));var router=express['Router']();var fs_extra=require(_0xa60b('0x4'));var auth=require(_0xa60b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa60b('0x6'));var controller=require('./chatWebsite.controller');router[_0xa60b('0x7')]('/',auth[_0xa60b('0x8')](),controller[_0xa60b('0x9')]);router['get'](_0xa60b('0xa'),auth[_0xa60b('0x8')](),controller[_0xa60b('0xb')]);router[_0xa60b('0x7')](_0xa60b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xa60b('0x7')](_0xa60b('0xd'),auth[_0xa60b('0x8')](),controller[_0xa60b('0xe')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xa60b('0x7')](_0xa60b('0xf'),controller[_0xa60b('0x10')]);router['get'](_0xa60b('0x11'),controller[_0xa60b('0x12')]);router[_0xa60b('0x7')](_0xa60b('0x13'),controller[_0xa60b('0x14')]);router[_0xa60b('0x7')](_0xa60b('0x15'),controller[_0xa60b('0x16')]);router[_0xa60b('0x7')](_0xa60b('0x17'),auth['isAuthenticated'](),controller[_0xa60b('0x18')]);router[_0xa60b('0x7')](_0xa60b('0x19'),controller[_0xa60b('0x1a')]);router['get'](_0xa60b('0x1b'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x1c')]);router[_0xa60b('0x7')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['getProactiveActions']);router[_0xa60b('0x7')]('/:id/fields',controller[_0xa60b('0x1d')]);router[_0xa60b('0x7')](_0xa60b('0x1e'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x1f')]);router[_0xa60b('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0xa60b('0x20')]);router[_0xa60b('0x21')]('/',auth['isAuthenticated'](),controller[_0xa60b('0x22')]);router[_0xa60b('0x21')](_0xa60b('0xd'),auth['isAuthenticated'](),controller[_0xa60b('0x23')]);router[_0xa60b('0x21')](_0xa60b('0x24'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x25')]);var upload=multer({'storage':multer[_0xa60b('0x26')]({'destination':function(_0x689af6,_0x11b48d,_0xc01aee){_0xc01aee(null,path[_0xa60b('0x27')](config[_0xa60b('0x28')],_0xa60b('0x29')));},'filename':function(_0x13c32f,_0x72ea3c,_0x91b38e){_0x91b38e(null,util[_0xa60b('0x2a')](_0xa60b('0x2b'),Date[_0xa60b('0x2c')](),_0x72ea3c[_0xa60b('0x2d')]));}})});router[_0xa60b('0x21')](_0xa60b('0xf'),upload['single'](_0xa60b('0x2e')),controller[_0xa60b('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x506f42,_0x398809,_0x29b1ab){_0x29b1ab(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x149b6b,_0x542cb0,_0xb99965){_0xb99965(null,util[_0xa60b('0x2a')](_0xa60b('0x2b'),Date[_0xa60b('0x2c')](),_0x542cb0[_0xa60b('0x2d')]));}})});router[_0xa60b('0x21')](_0xa60b('0x11'),upload[_0xa60b('0x30')]('file'),controller[_0xa60b('0x31')]);var upload=multer({'storage':multer[_0xa60b('0x26')]({'destination':function(_0x547883,_0x104050,_0x40b6de){_0x40b6de(null,path[_0xa60b('0x27')](config[_0xa60b('0x28')],_0xa60b('0x32')));},'filename':function(_0x1cf202,_0x584656,_0x5935c2){_0x5935c2(null,util[_0xa60b('0x2a')]('%s-%s',Date['now'](),_0x584656[_0xa60b('0x2d')]));}})});router['post']('/:id/customer_avatar',upload[_0xa60b('0x30')]('file'),controller[_0xa60b('0x33')]);var upload=multer({'storage':multer[_0xa60b('0x26')]({'destination':function(_0x52a201,_0x4f4af1,_0x5be19c){_0x5be19c(null,path[_0xa60b('0x27')](config[_0xa60b('0x28')],'server/files/images/avatars/'));},'filename':function(_0x1e7419,_0x381ed7,_0x567624){_0x567624(null,util['format'](_0xa60b('0x2b'),Date[_0xa60b('0x2c')](),_0x381ed7['originalname']));}})});router[_0xa60b('0x21')](_0xa60b('0x15'),upload[_0xa60b('0x30')]('file'),controller[_0xa60b('0x34')]);router[_0xa60b('0x21')](_0xa60b('0x35'),controller[_0xa60b('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0xa60b('0x26')]({'destination':function(_0x89709c,_0x45ea85,_0x1e1b84){const _0x1d161b=path['join'](config['root'],_0xa60b('0x37'),_0xa60b('0x38'),_0xa60b('0x39'));fs_extra[_0xa60b('0x3a')](_0x1d161b,function(){_0x1e1b84(null,_0x1d161b);});},'filename':function(_0x146f5f,_0x105650,_0x3265c4){const _0x2cbd85=_0x105650[_0xa60b('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3d2e8e=path[_0xa60b('0x3b')](_0x2cbd85);const _0x5219f6=Date[_0xa60b('0x2c')]()+'-'+_0x2cbd85[_0xa60b('0x3c')](_0x3d2e8e,'')+_0x3d2e8e;_0x3265c4(null,_0x5219f6);}})});router['post'](_0xa60b('0x3d'),offlineUploadMulter[_0xa60b('0x3e')](),controller[_0xa60b('0x3f')]);router[_0xa60b('0x21')](_0xa60b('0x17'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x40')]);router[_0xa60b('0x21')](_0xa60b('0x1b'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x41')]);router[_0xa60b('0x21')](_0xa60b('0x42'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x43')]);router[_0xa60b('0x21')](_0xa60b('0x44'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x45')]);router[_0xa60b('0x46')](_0xa60b('0xc'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x47')]);router[_0xa60b('0x48')]('/:id',auth[_0xa60b('0x8')](),controller[_0xa60b('0x49')]);router[_0xa60b('0x48')](_0xa60b('0xd'),auth[_0xa60b('0x8')](),controller['removeDispositions']);router[_0xa60b('0x48')]('/:id/canned_answers',auth[_0xa60b('0x8')](),controller[_0xa60b('0x4a')]);router[_0xa60b('0x48')](_0xa60b('0x44'),auth[_0xa60b('0x8')](),controller[_0xa60b('0x4b')]);module['exports']=router;
\ No newline at end of file
+var _0x048f=['multer','util','Router','fs-extra','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','create','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','join','server/files/images/avatars/','single','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAgents','exports'];(function(_0x3d00db,_0x3692b3){var _0x41f115=function(_0x3c94fd){while(--_0x3c94fd){_0x3d00db['push'](_0x3d00db['shift']());}};_0x41f115(++_0x3692b3);}(_0x048f,0x1e3));var _0xf048=function(_0x48d8b5,_0x35319d){_0x48d8b5=_0x48d8b5-0x0;var _0x4f2f87=_0x048f[_0x48d8b5];return _0x4f2f87;};'use strict';var multer=require(_0xf048('0x0'));var util=require(_0xf048('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf048('0x2')]();var fs_extra=require(_0xf048('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf048('0x4'));var controller=require(_0xf048('0x5'));router[_0xf048('0x6')]('/',auth[_0xf048('0x7')](),controller[_0xf048('0x8')]);router[_0xf048('0x6')](_0xf048('0x9'),auth[_0xf048('0x7')](),controller[_0xf048('0xa')]);router[_0xf048('0x6')]('/:id',auth[_0xf048('0x7')](),controller['show']);router[_0xf048('0x6')](_0xf048('0xb'),auth['isAuthenticated'](),controller[_0xf048('0xc')]);router[_0xf048('0x6')](_0xf048('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xf048('0x6')](_0xf048('0xe'),controller[_0xf048('0xf')]);router[_0xf048('0x6')](_0xf048('0x10'),controller['getAvatar']);router[_0xf048('0x6')]('/:id/customer_avatar',controller[_0xf048('0x11')]);router[_0xf048('0x6')](_0xf048('0x12'),controller[_0xf048('0x13')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0xf048('0x14')]);router[_0xf048('0x6')](_0xf048('0x15'),controller['getSnippet']);router[_0xf048('0x6')](_0xf048('0x16'),auth[_0xf048('0x7')](),controller[_0xf048('0x17')]);router[_0xf048('0x6')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xf048('0x18')]);router[_0xf048('0x6')](_0xf048('0x19'),controller[_0xf048('0x1a')]);router['get']('/:id/offline_messages',auth[_0xf048('0x7')](),controller[_0xf048('0x1b')]);router['get'](_0xf048('0x1c'),auth['isAuthenticated'](),controller['getAgents']);router[_0xf048('0x1d')]('/',auth[_0xf048('0x7')](),controller[_0xf048('0x1e')]);router['post'](_0xf048('0xb'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0xf048('0xd'),auth[_0xf048('0x7')](),controller[_0xf048('0x1f')]);var upload=multer({'storage':multer[_0xf048('0x20')]({'destination':function(_0x46863a,_0xb5bc99,_0x13ee2c){_0x13ee2c(null,path['join'](config[_0xf048('0x21')],_0xf048('0x22')));},'filename':function(_0x53bd00,_0x421e6c,_0x44e19d){_0x44e19d(null,util[_0xf048('0x23')](_0xf048('0x24'),Date[_0xf048('0x25')](),_0x421e6c[_0xf048('0x26')]));}})});router['post'](_0xf048('0xe'),upload['single'](_0xf048('0x27')),controller[_0xf048('0x28')]);var upload=multer({'storage':multer[_0xf048('0x20')]({'destination':function(_0x105229,_0x2fec04,_0x3d9668){_0x3d9668(null,path[_0xf048('0x29')](config[_0xf048('0x21')],_0xf048('0x2a')));},'filename':function(_0x8cf121,_0x4f5a2b,_0x50d159){_0x50d159(null,util[_0xf048('0x23')](_0xf048('0x24'),Date[_0xf048('0x25')](),_0x4f5a2b[_0xf048('0x26')]));}})});router[_0xf048('0x1d')]('/:id/avatar',upload[_0xf048('0x2b')](_0xf048('0x27')),controller[_0xf048('0x2c')]);var upload=multer({'storage':multer[_0xf048('0x20')]({'destination':function(_0x2a7898,_0x2ded85,_0x16483d){_0x16483d(null,path['join'](config[_0xf048('0x21')],_0xf048('0x2a')));},'filename':function(_0x32f3a1,_0x39adf7,_0x363597){_0x363597(null,util[_0xf048('0x23')]('%s-%s',Date['now'](),_0x39adf7[_0xf048('0x26')]));}})});router[_0xf048('0x1d')](_0xf048('0x2d'),upload[_0xf048('0x2b')](_0xf048('0x27')),controller[_0xf048('0x2e')]);var upload=multer({'storage':multer[_0xf048('0x20')]({'destination':function(_0x4a3b4c,_0x523ba4,_0x386756){_0x386756(null,path[_0xf048('0x29')](config['root'],_0xf048('0x2a')));},'filename':function(_0x134132,_0x4ff390,_0x5b6160){_0x5b6160(null,util['format'](_0xf048('0x24'),Date[_0xf048('0x25')](),_0x4ff390[_0xf048('0x26')]));}})});router[_0xf048('0x1d')](_0xf048('0x12'),upload['single'](_0xf048('0x27')),controller['addSystemAvatar']);router[_0xf048('0x1d')](_0xf048('0x2f'),controller[_0xf048('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0xf048('0x20')]({'destination':function(_0x3888ba,_0x51faf9,_0x2e3547){const _0x1c594d=path[_0xf048('0x29')](config[_0xf048('0x21')],'server/files',_0xf048('0x31'),_0xf048('0x32'));fs_extra[_0xf048('0x33')](_0x1c594d,function(){_0x2e3547(null,_0x1c594d);});},'filename':function(_0x13e097,_0x5ac408,_0xfbb47b){const _0x5c3ea4=_0x5ac408[_0xf048('0x26')][_0xf048('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x23eee8=path['extname'](_0x5c3ea4);const _0x129173=Date[_0xf048('0x25')]()+'-'+_0x5c3ea4[_0xf048('0x34')](_0x23eee8,'')+_0x23eee8;_0xfbb47b(null,_0x129173);}})});router[_0xf048('0x1d')](_0xf048('0x35'),offlineUploadMulter[_0xf048('0x36')](),controller[_0xf048('0x37')]);router['post']('/:id/interactions',auth[_0xf048('0x7')](),controller[_0xf048('0x38')]);router[_0xf048('0x1d')]('/:id/applications',auth[_0xf048('0x7')](),controller[_0xf048('0x39')]);router[_0xf048('0x1d')](_0xf048('0x3a'),auth[_0xf048('0x7')](),controller[_0xf048('0x3b')]);router[_0xf048('0x1d')](_0xf048('0x1c'),auth['isAuthenticated'](),controller[_0xf048('0x3c')]);router[_0xf048('0x3d')](_0xf048('0x3e'),auth[_0xf048('0x7')](),controller[_0xf048('0x3f')]);router['delete'](_0xf048('0x3e'),auth[_0xf048('0x7')](),controller[_0xf048('0x40')]);router[_0xf048('0x41')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf048('0x42')]);router[_0xf048('0x41')]('/:id/canned_answers',auth[_0xf048('0x7')](),controller['removeAnswers']);router[_0xf048('0x41')](_0xf048('0x1c'),auth[_0xf048('0x7')](),controller[_0xf048('0x43')]);module[_0xf048('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index d0d23b5..8285b03 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 _0x7db1=['Router','production','app','get','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment'];(function(_0x2ea174,_0xb3181){var _0x5987c7=function(_0x3f7c44){while(--_0x3f7c44){_0x2ea174['push'](_0x2ea174['shift']());}};_0x5987c7(++_0xb3181);}(_0x7db1,0x1ca));var _0x17db=function(_0x3a1972,_0x194511){_0x3a1972=_0x3a1972-0x0;var _0xc7e0b5=_0x7db1[_0x3a1972];return _0xc7e0b5;};var beaverLogger=require(_0x17db('0x0'));var express=require(_0x17db('0x1'));var auth=require(_0x17db('0x2'));var config=require(_0x17db('0x3'));var router=express[_0x17db('0x4')]();var isProduction=config['env']===_0x17db('0x5')||![];function clientSideLogs(_0x35e5ae,_0x47aa41,_0x3d8d6b){var _0x43e41d=_0x35e5ae[_0x17db('0x6')][_0x17db('0x7')](_0x17db('0x8'));if(!_0x43e41d){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x17db('0x9')]({'uri':_0x17db('0xa'),'logger':_0x43e41d,'enableCors':!isProduction})(_0x35e5ae,_0x47aa41,_0x3d8d6b);}router[_0x17db('0xb')](auth[_0x17db('0xc')](),clientSideLogs);module[_0x17db('0xd')]=router;
\ No newline at end of file
+var _0x7929=['../config/environment','Router','env','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','express','../components/auth/service'];(function(_0x56a67a,_0x9c0845){var _0x325989=function(_0x3511ed){while(--_0x3511ed){_0x56a67a['push'](_0x56a67a['shift']());}};_0x325989(++_0x9c0845);}(_0x7929,0x106));var _0x9792=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0x7929[_0x36bf88];return _0x332914;};var beaverLogger=require('beaver-logger/server');var express=require(_0x9792('0x0'));var auth=require(_0x9792('0x1'));var config=require(_0x9792('0x2'));var router=express[_0x9792('0x3')]();var isProduction=config[_0x9792('0x4')]==='production'||![];function clientSideLogs(_0x460d65,_0x944700,_0x3ed9bf){var _0x23e2f1=_0x460d65['app'][_0x9792('0x5')](_0x9792('0x6'));if(!_0x23e2f1){throw new Error(_0x9792('0x7'));}return beaverLogger[_0x9792('0x8')]({'uri':_0x9792('0x9'),'logger':_0x23e2f1,'enableCors':!isProduction})(_0x460d65,_0x944700,_0x3ed9bf);}router['use'](auth[_0x9792('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index b583944..3c433ba 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 _0x5c66=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x5f4585,_0x287c9f){var _0x32b347=function(_0x301639){while(--_0x301639){_0x5f4585['push'](_0x5f4585['shift']());}};_0x32b347(++_0x287c9f);}(_0x5c66,0xd7));var _0x65c6=function(_0xf46740,_0x2d49e0){_0xf46740=_0xf46740-0x0;var _0x46361a=_0x5c66[_0xf46740];return _0x46361a;};'use strict';var Sequelize=require(_0x65c6('0x0'));module[_0x65c6('0x1')]={'name':{'type':Sequelize[_0x65c6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x65c6('0x3')](_0x65c6('0x4'),_0x65c6('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x65c6('0x6'),_0x65c6('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0x65c6('0x8')},'data2':{'type':Sequelize[_0x65c6('0x2')],'comment':_0x65c6('0x9')},'data3':{'type':Sequelize[_0x65c6('0x2')],'comment':_0x65c6('0xa')},'data4':{'type':Sequelize[_0x65c6('0x2')],'comment':_0x65c6('0xb')},'data5':{'type':Sequelize[_0x65c6('0xc')],'comment':_0x65c6('0xd')},'data6':{'type':Sequelize['TEXT'],'comment':_0x65c6('0xe')},'data7':{'type':Sequelize[_0x65c6('0xc')],'comment':_0x65c6('0xf')}};
\ No newline at end of file
+var _0x9a9c=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','STRING','ENUM','AmazonAWS'];(function(_0xd1b4df,_0x118a9a){var _0x24b551=function(_0x438cfc){while(--_0x438cfc){_0xd1b4df['push'](_0xd1b4df['shift']());}};_0x24b551(++_0x118a9a);}(_0x9a9c,0xbc));var _0xc9a9=function(_0x41a332,_0x67b939){_0x41a332=_0x41a332-0x0;var _0x15ae65=_0x9a9c[_0x41a332];return _0x15ae65;};'use strict';var Sequelize=require(_0xc9a9('0x0'));module['exports']={'name':{'type':Sequelize[_0xc9a9('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc9a9('0x2')](_0xc9a9('0x3'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc9a9('0x2')](_0xc9a9('0x4'),_0xc9a9('0x5'))},'data1':{'type':Sequelize[_0xc9a9('0x1')],'comment':_0xc9a9('0x6')},'data2':{'type':Sequelize[_0xc9a9('0x1')],'comment':_0xc9a9('0x7')},'data3':{'type':Sequelize[_0xc9a9('0x1')],'comment':_0xc9a9('0x8')},'data4':{'type':Sequelize[_0xc9a9('0x1')],'comment':_0xc9a9('0x9')},'data5':{'type':Sequelize[_0xc9a9('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xc9a9('0xa')],'comment':_0xc9a9('0xb')},'data7':{'type':Sequelize[_0xc9a9('0xa')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 2d7c4cc..c3229fd 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 _0x581c=['base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','end','error','stack','name','send','padEnd','slice','index','CloudProvider','fieldName','type','key','filters','intersection','model','query','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','service','decryptString','data3','catch','show','params','keys','length','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','rawAttributes','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','state'];(function(_0x31a201,_0x1fc5c7){var _0x5c8148=function(_0x49c045){while(--_0x49c045){_0x31a201['push'](_0x31a201['shift']());}};_0x5c8148(++_0x1fc5c7);}(_0x581c,0x78));var _0xc581=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x581c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc581('0x0'));var Redis=require('ioredis');var qs=require(_0xc581('0x1'));var encryptor=require(_0xc581('0x2'));var config=require('../../config/environment');var logger=require(_0xc581('0x3'))(_0xc581('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0xc581('0x5'));config[_0xc581('0x6')]=_[_0xc581('0x7')](config['redis'],{'host':_0xc581('0x8'),'port':0x18eb});var socket=require(_0xc581('0x9'))(new Redis(config['redis']));var redis=new Redis(config[_0xc581('0x6')]);function respondWithStatusCode(_0x523113,_0x4daa8e){_0x4daa8e=_0x4daa8e||0xcc;return function(_0x503b7a){if(_0x503b7a){return _0x523113[_0xc581('0xa')](_0x4daa8e);}return _0x523113[_0xc581('0xb')](_0x4daa8e)['end']();};}function respondWithResult(_0x570a86,_0x47557e){_0x47557e=_0x47557e||0xc8;return function(_0x5018e){if(_0x5018e){return _0x570a86[_0xc581('0xb')](_0x47557e)['json'](_0x5018e);}};}function respondWithFilteredResult(_0x325e5c,_0x5b4a7a){return function(_0x1b7af9){if(_0x1b7af9){var _0x5cec5a=typeof _0x5b4a7a[_0xc581('0xc')]===_0xc581('0xd')&&typeof _0x5b4a7a[_0xc581('0xe')]==='undefined';var _0xd7f203=_0x1b7af9['count'];var _0x5dae41=_0x5cec5a?0x0:_0x5b4a7a[_0xc581('0xc')];var _0x553a80=_0x5cec5a?_0x1b7af9[_0xc581('0xf')]:_0x5b4a7a[_0xc581('0xc')]+_0x5b4a7a[_0xc581('0xe')];var _0x2301a0;if(_0x553a80>=_0xd7f203){_0x553a80=_0xd7f203;_0x2301a0=0xc8;}else{_0x2301a0=0xce;}_0x325e5c[_0xc581('0xb')](_0x2301a0);return _0x325e5c[_0xc581('0x10')](_0xc581('0x11'),_0x5dae41+'-'+_0x553a80+'/'+_0xd7f203)[_0xc581('0x12')](_0x1b7af9);}return null;};}function saveUpdates(_0x3e2400){return function(_0x3d9f26){if(_0x3d9f26){return _0x3d9f26[_0xc581('0x13')](_0x3e2400)[_0xc581('0x14')](function(_0x514dc4){return _0x514dc4;});}return null;};}function removeEntity(_0x131a98){return function(_0x3de59f){if(_0x3de59f){return _0x3de59f[_0xc581('0x15')]()[_0xc581('0x14')](function(){_0x131a98[_0xc581('0xb')](0xcc)[_0xc581('0x16')]();});}};}function handleEntityNotFound(_0x53bb19){return function(_0x1936b5){if(!_0x1936b5){_0x53bb19[_0xc581('0xa')](0x194);}return _0x1936b5;};}function handleError(_0x47a548,_0x1b1f79){_0x1b1f79=_0x1b1f79||0x1f4;return function(_0x46ccc4){logger[_0xc581('0x17')](_0x46ccc4[_0xc581('0x18')]);if(_0x46ccc4[_0xc581('0x19')]){delete _0x46ccc4['name'];}_0x47a548['status'](_0x1b1f79)[_0xc581('0x1a')](_0x46ccc4);};}function maskClientSecret(_0xf9ada2){return _[_0xc581('0x1b')](_0xf9ada2[_0xc581('0x1c')](0x0,0x3),0x14,'*');}exports[_0xc581('0x1d')]=function(_0x41e726,_0x54139c){var _0x1b3348={},_0x1f0cf6={},_0x21be13={'count':0x0,'rows':[]};var _0x13e487=_['map'](db[_0xc581('0x1e')]['rawAttributes'],function(_0x1df3d1){return{'name':_0x1df3d1[_0xc581('0x1f')],'type':_0x1df3d1[_0xc581('0x20')][_0xc581('0x21')]};});_0x1f0cf6['model']=_['map'](_0x13e487,_0xc581('0x19'));_0x1f0cf6['query']=_['keys'](_0x41e726['query']);_0x1f0cf6[_0xc581('0x22')]=_[_0xc581('0x23')](_0x1f0cf6[_0xc581('0x24')],_0x1f0cf6[_0xc581('0x25')]);_0x1b3348[_0xc581('0x26')]=_['intersection'](_0x1f0cf6[_0xc581('0x24')],qs[_0xc581('0x27')](_0x41e726[_0xc581('0x25')]['fields']));_0x1b3348[_0xc581('0x26')]=_0x1b3348[_0xc581('0x26')]['length']?_0x1b3348[_0xc581('0x26')]:_0x1f0cf6[_0xc581('0x24')];if(!_0x41e726[_0xc581('0x25')]['hasOwnProperty'](_0xc581('0x28'))){_0x1b3348[_0xc581('0xe')]=qs[_0xc581('0xe')](_0x41e726[_0xc581('0x25')][_0xc581('0xe')]);_0x1b3348['offset']=qs['offset'](_0x41e726[_0xc581('0x25')][_0xc581('0xc')]);}_0x1b3348[_0xc581('0x29')]=qs['sort'](_0x41e726[_0xc581('0x25')][_0xc581('0x2a')]);_0x1b3348[_0xc581('0x2b')]=qs[_0xc581('0x22')](_[_0xc581('0x2c')](_0x41e726[_0xc581('0x25')],_0x1f0cf6[_0xc581('0x22')]),_0x13e487);if(_0x41e726['query'][_0xc581('0x2d')]){_0x1b3348['where']=_[_0xc581('0x2e')](_0x1b3348['where'],{'$or':_[_0xc581('0x2f')](_0x13e487,function(_0x994fb8){if(_0x994fb8[_0xc581('0x20')]!==_0xc581('0x30')){var _0xf33e45={};_0xf33e45[_0x994fb8[_0xc581('0x19')]]={'$like':'%'+_0x41e726[_0xc581('0x25')][_0xc581('0x2d')]+'%'};return _0xf33e45;}})});}_0x1b3348=_[_0xc581('0x2e')]({},_0x1b3348,_0x41e726[_0xc581('0x31')]);var _0x3874c7={'where':_0x1b3348['where']};return db[_0xc581('0x1e')]['count'](_0x3874c7)[_0xc581('0x14')](function(_0x3863c7){_0x21be13[_0xc581('0xf')]=_0x3863c7;if(_0x41e726[_0xc581('0x25')][_0xc581('0x32')]){_0x1b3348[_0xc581('0x33')]=[{'all':!![]}];}return db[_0xc581('0x1e')][_0xc581('0x34')](_0x1b3348);})[_0xc581('0x14')](function(_0x2f7310){_0x21be13[_0xc581('0x35')]=_[_0xc581('0x2f')](_0x2f7310,function(_0x57d21b){if(_0x57d21b[_0xc581('0x36')]==='MicrosoftAzure'){var _0x593bcf=encryptor[_0xc581('0x37')](_0x57d21b['data3']);_0x57d21b[_0xc581('0x38')]=maskClientSecret(_0x593bcf);}return _0x57d21b;});return _0x21be13;})[_0xc581('0x14')](respondWithFilteredResult(_0x54139c,_0x1b3348))[_0xc581('0x39')](handleError(_0x54139c,null));};exports[_0xc581('0x3a')]=function(_0x564501,_0x1dd92d){var _0x491a63={'raw':!![],'where':{'id':_0x564501[_0xc581('0x3b')]['id']}},_0x1d2e44={};_0x1d2e44[_0xc581('0x24')]=_[_0xc581('0x3c')](db[_0xc581('0x1e')]['rawAttributes']);_0x1d2e44[_0xc581('0x25')]=_[_0xc581('0x3c')](_0x564501[_0xc581('0x25')]);_0x1d2e44[_0xc581('0x22')]=_[_0xc581('0x23')](_0x1d2e44['model'],_0x1d2e44[_0xc581('0x25')]);_0x491a63['attributes']=_[_0xc581('0x23')](_0x1d2e44[_0xc581('0x24')],qs[_0xc581('0x27')](_0x564501['query']['fields']));_0x491a63[_0xc581('0x26')]=_0x491a63[_0xc581('0x26')][_0xc581('0x3d')]?_0x491a63['attributes']:_0x1d2e44[_0xc581('0x24')];if(_0x564501[_0xc581('0x25')][_0xc581('0x32')]){_0x491a63[_0xc581('0x33')]=[{'all':!![]}];}_0x491a63=_['merge']({},_0x491a63,_0x564501[_0xc581('0x31')]);return db[_0xc581('0x1e')][_0xc581('0x3e')](_0x491a63)[_0xc581('0x14')](handleEntityNotFound(_0x1dd92d,null))[_0xc581('0x14')](function(_0x42a483){if(_0x42a483['service']===_0xc581('0x3f')){var _0xa1857f=encryptor['decryptString'](_0x42a483[_0xc581('0x38')]);_0x42a483[_0xc581('0x38')]=maskClientSecret(_0xa1857f);}return _0x42a483;})[_0xc581('0x14')](respondWithResult(_0x1dd92d,null))[_0xc581('0x39')](handleError(_0x1dd92d,null));};exports[_0xc581('0x40')]=function(_0x5b34cc,_0x37d70a){if(!_0x5b34cc[_0xc581('0x41')][_0xc581('0x19')])throw new Error(_0xc581('0x42'));if(!_0x5b34cc[_0xc581('0x41')][_0xc581('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x4e5f88=db[_0xc581('0x1e')][_0xc581('0x43')][_0xc581('0x36')][_0xc581('0x44')];if(!_0x4e5f88['includes'](_0x5b34cc['body'][_0xc581('0x36')]))throw new Error(_0xc581('0x45')+_0x4e5f88[_0xc581('0x46')](',\x20'));if(_0x5b34cc[_0xc581('0x41')]['service']===_0xc581('0x3f')&&_0x5b34cc[_0xc581('0x41')][_0xc581('0x38')]){_0x5b34cc[_0xc581('0x41')]['data3']=encryptor[_0xc581('0x47')](_0x5b34cc[_0xc581('0x41')][_0xc581('0x38')]);}return db[_0xc581('0x1e')][_0xc581('0x40')](_0x5b34cc[_0xc581('0x41')],{})[_0xc581('0x14')](respondWithResult(_0x37d70a,0xc9))[_0xc581('0x39')](handleError(_0x37d70a,null));};exports[_0xc581('0x13')]=function(_0x40c2e4,_0x4862c0){if(_0x40c2e4[_0xc581('0x41')]['id']){delete _0x40c2e4[_0xc581('0x41')]['id'];}return db[_0xc581('0x1e')]['find']({'where':{'id':_0x40c2e4[_0xc581('0x3b')]['id']}})[_0xc581('0x14')](handleEntityNotFound(_0x4862c0,null))[_0xc581('0x14')](function(_0x490a9f){if(_0x490a9f[_0xc581('0x36')]===_0xc581('0x3f')&&_0x40c2e4[_0xc581('0x41')][_0xc581('0x38')]){_0x40c2e4[_0xc581('0x41')][_0xc581('0x38')]=encryptor[_0xc581('0x47')](_0x40c2e4['body'][_0xc581('0x38')]);}return _0x490a9f;})['then'](saveUpdates(_0x40c2e4[_0xc581('0x41')],null))[_0xc581('0x14')](respondWithResult(_0x4862c0,null))[_0xc581('0x39')](handleError(_0x4862c0,null));};exports['destroy']=function(_0x85f63b,_0x17b3f7){return db['CloudProvider'][_0xc581('0x3e')]({'where':{'id':_0x85f63b[_0xc581('0x3b')]['id']}})[_0xc581('0x14')](handleEntityNotFound(_0x17b3f7,null))[_0xc581('0x14')](removeEntity(_0x17b3f7,null))[_0xc581('0x39')](handleError(_0x17b3f7,null));};exports[_0xc581('0x48')]=function(_0x4ce9d1,_0x29e6fe){return db[_0xc581('0x1e')]['findOne']({'where':{'id':_0x4ce9d1[_0xc581('0x3b')]['id']},'raw':!![]})['then'](function(_0x41752d){if(!_0x41752d)return _0x29e6fe[_0xc581('0xa')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x41752d,_0x4ce9d1[_0xc581('0x49')]['id'])};})[_0xc581('0x14')](respondWithResult(_0x29e6fe,null))['catch'](handleError(_0x29e6fe,null));};exports[_0xc581('0x4a')]=function(_0x5ac4bf,_0x51a873){var _0x43a3ae=_0x5ac4bf[_0xc581('0x41')];var _0x1cc3cf;var _0x47a928;if(_0x43a3ae[_0xc581('0x17')])throw _0x43a3ae;redis[_0xc581('0x4b')](_0x43a3ae['state'])[_0xc581('0x14')](function(_0x17e3ea){if(!_0x17e3ea)throw new Error(_0xc581('0x4c'));_0x1cc3cf=JSON[_0xc581('0x4d')](_0x17e3ea);var _0x562009=Buffer[_0xc581('0x4e')](_0x43a3ae[_0xc581('0x4f')],_0xc581('0x50'))[_0xc581('0x51')](_0xc581('0x52'));_0x47a928=JSON['parse'](_0x562009);if(!oauth[_0xc581('0x53')](_0x43a3ae['id_token'],_0x1cc3cf[_0xc581('0x54')]))throw new Error(_0xc581('0x55'));redis[_0xc581('0x56')](_0x43a3ae[_0xc581('0x4f')]);return oauth[_0xc581('0x57')](_0x43a3ae[_0xc581('0x58')],_0x1cc3cf);})[_0xc581('0x14')](function(_0x560c20){_0x1cc3cf[_0xc581('0x59')]=_0x560c20['access_token'];_0x1cc3cf[_0xc581('0x5a')]=_0x560c20[_0xc581('0x5b')];return db[_0xc581('0x1e')][_0xc581('0x13')]({'data5':_0x1cc3cf[_0xc581('0x59')],'data6':_0x1cc3cf[_0xc581('0x5a')]},{'where':{'id':_0x1cc3cf['id']}});})[_0xc581('0x14')](function(){oauth[_0xc581('0x5c')](_0x1cc3cf);socket[_0xc581('0x5d')](_0xc581('0x5e'),{'id':_0x47a928['id']});return;})[_0xc581('0x14')](respondWithStatusCode(_0x51a873,null))[_0xc581('0x39')](function(_0xa8578){if(_0x47a928){socket['emit'](_0xc581('0x5f'),{'id':_0x47a928['id']});}if(!_0x1cc3cf){logger[_0xc581('0x17')](_0xc581('0x60'),_0xa8578);return _0x51a873[_0xc581('0xb')](0x1f4)[_0xc581('0x1a')](_0xa8578[_0xc581('0x61')]);}logger[_0xc581('0x17')](_0xc581('0x62'),_0x1cc3cf['id'],JSON[_0xc581('0x63')](_0xa8578));});};
\ No newline at end of file
+var _0x7a7a=['redis','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','padEnd','slice','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','CloudProvider','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','service','create','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','get','state','Invalid\x20state\x20parameter','parse','from','toString','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','localhost','socket.io-emitter'];(function(_0x1b36f6,_0x4c9232){var _0x5a2d88=function(_0x2119ae){while(--_0x2119ae){_0x1b36f6['push'](_0x1b36f6['shift']());}};_0x5a2d88(++_0x4c9232);}(_0x7a7a,0xb2));var _0xa7a7=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x7a7a[_0x599e60];return _0x468e19;};'use strict';var _=require(_0xa7a7('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xa7a7('0x1'));var config=require(_0xa7a7('0x2'));var logger=require(_0xa7a7('0x3'))(_0xa7a7('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0xa7a7('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0xa7a7('0x6'),'port':0x18eb});var socket=require(_0xa7a7('0x7'))(new Redis(config[_0xa7a7('0x8')]));var redis=new Redis(config[_0xa7a7('0x8')]);function respondWithStatusCode(_0x5d01bb,_0x34d84a){_0x34d84a=_0x34d84a||0xcc;return function(_0x2665c5){if(_0x2665c5){return _0x5d01bb[_0xa7a7('0x9')](_0x34d84a);}return _0x5d01bb[_0xa7a7('0xa')](_0x34d84a)[_0xa7a7('0xb')]();};}function respondWithResult(_0xc76317,_0x3312aa){_0x3312aa=_0x3312aa||0xc8;return function(_0x517627){if(_0x517627){return _0xc76317['status'](_0x3312aa)[_0xa7a7('0xc')](_0x517627);}};}function respondWithFilteredResult(_0xc84dc5,_0x271a46){return function(_0x16f4d4){if(_0x16f4d4){var _0x26d045=typeof _0x271a46['offset']===_0xa7a7('0xd')&&typeof _0x271a46[_0xa7a7('0xe')]===_0xa7a7('0xd');var _0x48b954=_0x16f4d4[_0xa7a7('0xf')];var _0x309107=_0x26d045?0x0:_0x271a46['offset'];var _0x1fa626=_0x26d045?_0x16f4d4[_0xa7a7('0xf')]:_0x271a46[_0xa7a7('0x10')]+_0x271a46[_0xa7a7('0xe')];var _0x2989c4;if(_0x1fa626>=_0x48b954){_0x1fa626=_0x48b954;_0x2989c4=0xc8;}else{_0x2989c4=0xce;}_0xc84dc5[_0xa7a7('0xa')](_0x2989c4);return _0xc84dc5[_0xa7a7('0x11')](_0xa7a7('0x12'),_0x309107+'-'+_0x1fa626+'/'+_0x48b954)[_0xa7a7('0xc')](_0x16f4d4);}return null;};}function saveUpdates(_0x50784c){return function(_0xcdf078){if(_0xcdf078){return _0xcdf078[_0xa7a7('0x13')](_0x50784c)[_0xa7a7('0x14')](function(_0x3d59a1){return _0x3d59a1;});}return null;};}function removeEntity(_0x1330de){return function(_0x522d65){if(_0x522d65){return _0x522d65[_0xa7a7('0x15')]()[_0xa7a7('0x14')](function(){_0x1330de[_0xa7a7('0xa')](0xcc)[_0xa7a7('0xb')]();});}};}function handleEntityNotFound(_0x15704f){return function(_0x2a75a9){if(!_0x2a75a9){_0x15704f[_0xa7a7('0x9')](0x194);}return _0x2a75a9;};}function handleError(_0xaeef60,_0x48ca82){_0x48ca82=_0x48ca82||0x1f4;return function(_0x4f1339){logger[_0xa7a7('0x16')](_0x4f1339[_0xa7a7('0x17')]);if(_0x4f1339[_0xa7a7('0x18')]){delete _0x4f1339[_0xa7a7('0x18')];}_0xaeef60[_0xa7a7('0xa')](_0x48ca82)[_0xa7a7('0x19')](_0x4f1339);};}function maskClientSecret(_0x1c825a){return _[_0xa7a7('0x1a')](_0x1c825a[_0xa7a7('0x1b')](0x0,0x3),0x14,'*');}exports[_0xa7a7('0x1c')]=function(_0x1eb477,_0x1291fd){var _0x47e700={},_0x21e633={},_0x13a946={'count':0x0,'rows':[]};var _0x15e566=_[_0xa7a7('0x1d')](db['CloudProvider'][_0xa7a7('0x1e')],function(_0x15f3ce){return{'name':_0x15f3ce[_0xa7a7('0x1f')],'type':_0x15f3ce[_0xa7a7('0x20')]['key']};});_0x21e633[_0xa7a7('0x21')]=_['map'](_0x15e566,_0xa7a7('0x18'));_0x21e633[_0xa7a7('0x22')]=_[_0xa7a7('0x23')](_0x1eb477['query']);_0x21e633['filters']=_[_0xa7a7('0x24')](_0x21e633[_0xa7a7('0x21')],_0x21e633[_0xa7a7('0x22')]);_0x47e700['attributes']=_[_0xa7a7('0x24')](_0x21e633[_0xa7a7('0x21')],qs[_0xa7a7('0x25')](_0x1eb477[_0xa7a7('0x22')]['fields']));_0x47e700[_0xa7a7('0x26')]=_0x47e700[_0xa7a7('0x26')][_0xa7a7('0x27')]?_0x47e700[_0xa7a7('0x26')]:_0x21e633['model'];if(!_0x1eb477['query'][_0xa7a7('0x28')](_0xa7a7('0x29'))){_0x47e700[_0xa7a7('0xe')]=qs[_0xa7a7('0xe')](_0x1eb477[_0xa7a7('0x22')][_0xa7a7('0xe')]);_0x47e700[_0xa7a7('0x10')]=qs[_0xa7a7('0x10')](_0x1eb477[_0xa7a7('0x22')]['offset']);}_0x47e700['order']=qs[_0xa7a7('0x2a')](_0x1eb477['query']['sort']);_0x47e700[_0xa7a7('0x2b')]=qs[_0xa7a7('0x2c')](_[_0xa7a7('0x2d')](_0x1eb477[_0xa7a7('0x22')],_0x21e633[_0xa7a7('0x2c')]),_0x15e566);if(_0x1eb477[_0xa7a7('0x22')][_0xa7a7('0x2e')]){_0x47e700[_0xa7a7('0x2b')]=_[_0xa7a7('0x2f')](_0x47e700[_0xa7a7('0x2b')],{'$or':_[_0xa7a7('0x1d')](_0x15e566,function(_0x29b004){if(_0x29b004['type']!==_0xa7a7('0x30')){var _0x5bc08f={};_0x5bc08f[_0x29b004[_0xa7a7('0x18')]]={'$like':'%'+_0x1eb477[_0xa7a7('0x22')][_0xa7a7('0x2e')]+'%'};return _0x5bc08f;}})});}_0x47e700=_[_0xa7a7('0x2f')]({},_0x47e700,_0x1eb477['options']);var _0x3573e3={'where':_0x47e700[_0xa7a7('0x2b')]};return db['CloudProvider'][_0xa7a7('0xf')](_0x3573e3)[_0xa7a7('0x14')](function(_0x1c11c6){_0x13a946[_0xa7a7('0xf')]=_0x1c11c6;if(_0x1eb477[_0xa7a7('0x22')][_0xa7a7('0x31')]){_0x47e700[_0xa7a7('0x32')]=[{'all':!![]}];}return db[_0xa7a7('0x33')]['findAll'](_0x47e700);})[_0xa7a7('0x14')](function(_0x18c7f4){_0x13a946['rows']=_['map'](_0x18c7f4,function(_0x4069f3){if(_0x4069f3['service']===_0xa7a7('0x34')){var _0x447feb=encryptor[_0xa7a7('0x35')](_0x4069f3[_0xa7a7('0x36')]);_0x4069f3['data3']=maskClientSecret(_0x447feb);}return _0x4069f3;});return _0x13a946;})[_0xa7a7('0x14')](respondWithFilteredResult(_0x1291fd,_0x47e700))[_0xa7a7('0x37')](handleError(_0x1291fd,null));};exports[_0xa7a7('0x38')]=function(_0xb4bf50,_0x4f57a2){var _0x309231={'raw':!![],'where':{'id':_0xb4bf50[_0xa7a7('0x39')]['id']}},_0x403eed={};_0x403eed[_0xa7a7('0x21')]=_[_0xa7a7('0x23')](db[_0xa7a7('0x33')]['rawAttributes']);_0x403eed['query']=_[_0xa7a7('0x23')](_0xb4bf50[_0xa7a7('0x22')]);_0x403eed['filters']=_[_0xa7a7('0x24')](_0x403eed[_0xa7a7('0x21')],_0x403eed[_0xa7a7('0x22')]);_0x309231['attributes']=_['intersection'](_0x403eed[_0xa7a7('0x21')],qs[_0xa7a7('0x25')](_0xb4bf50[_0xa7a7('0x22')][_0xa7a7('0x25')]));_0x309231[_0xa7a7('0x26')]=_0x309231['attributes']['length']?_0x309231['attributes']:_0x403eed[_0xa7a7('0x21')];if(_0xb4bf50[_0xa7a7('0x22')][_0xa7a7('0x31')]){_0x309231[_0xa7a7('0x32')]=[{'all':!![]}];}_0x309231=_[_0xa7a7('0x2f')]({},_0x309231,_0xb4bf50[_0xa7a7('0x3a')]);return db[_0xa7a7('0x33')][_0xa7a7('0x3b')](_0x309231)[_0xa7a7('0x14')](handleEntityNotFound(_0x4f57a2,null))[_0xa7a7('0x14')](function(_0x4135fe){if(_0x4135fe[_0xa7a7('0x3c')]==='MicrosoftAzure'){var _0x408d9c=encryptor[_0xa7a7('0x35')](_0x4135fe['data3']);_0x4135fe[_0xa7a7('0x36')]=maskClientSecret(_0x408d9c);}return _0x4135fe;})[_0xa7a7('0x14')](respondWithResult(_0x4f57a2,null))[_0xa7a7('0x37')](handleError(_0x4f57a2,null));};exports[_0xa7a7('0x3d')]=function(_0x3edd66,_0x3aa7a0){if(!_0x3edd66[_0xa7a7('0x3e')][_0xa7a7('0x18')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x3edd66[_0xa7a7('0x3e')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x336aec=db[_0xa7a7('0x33')][_0xa7a7('0x1e')][_0xa7a7('0x3c')][_0xa7a7('0x3f')];if(!_0x336aec[_0xa7a7('0x40')](_0x3edd66['body'][_0xa7a7('0x3c')]))throw new Error(_0xa7a7('0x41')+_0x336aec[_0xa7a7('0x42')](',\x20'));if(_0x3edd66[_0xa7a7('0x3e')]['service']===_0xa7a7('0x34')&&_0x3edd66['body'][_0xa7a7('0x36')]){_0x3edd66[_0xa7a7('0x3e')][_0xa7a7('0x36')]=encryptor[_0xa7a7('0x43')](_0x3edd66[_0xa7a7('0x3e')][_0xa7a7('0x36')]);}return db[_0xa7a7('0x33')]['create'](_0x3edd66[_0xa7a7('0x3e')],{})[_0xa7a7('0x14')](respondWithResult(_0x3aa7a0,0xc9))[_0xa7a7('0x37')](handleError(_0x3aa7a0,null));};exports[_0xa7a7('0x13')]=function(_0x3da1c4,_0x1777bd){if(_0x3da1c4[_0xa7a7('0x3e')]['id']){delete _0x3da1c4[_0xa7a7('0x3e')]['id'];}return db[_0xa7a7('0x33')]['find']({'where':{'id':_0x3da1c4[_0xa7a7('0x39')]['id']}})[_0xa7a7('0x14')](handleEntityNotFound(_0x1777bd,null))['then'](function(_0x5035a9){if(_0x5035a9[_0xa7a7('0x3c')]===_0xa7a7('0x34')&&_0x3da1c4[_0xa7a7('0x3e')][_0xa7a7('0x36')]){_0x3da1c4[_0xa7a7('0x3e')]['data3']=encryptor[_0xa7a7('0x43')](_0x3da1c4[_0xa7a7('0x3e')][_0xa7a7('0x36')]);}return _0x5035a9;})[_0xa7a7('0x14')](saveUpdates(_0x3da1c4[_0xa7a7('0x3e')],null))[_0xa7a7('0x14')](respondWithResult(_0x1777bd,null))[_0xa7a7('0x37')](handleError(_0x1777bd,null));};exports[_0xa7a7('0x15')]=function(_0x5b14fa,_0x5f0ec5){return db[_0xa7a7('0x33')][_0xa7a7('0x3b')]({'where':{'id':_0x5b14fa[_0xa7a7('0x39')]['id']}})[_0xa7a7('0x14')](handleEntityNotFound(_0x5f0ec5,null))['then'](removeEntity(_0x5f0ec5,null))[_0xa7a7('0x37')](handleError(_0x5f0ec5,null));};exports[_0xa7a7('0x44')]=function(_0x345c1c,_0x7c1ee8){return db[_0xa7a7('0x33')][_0xa7a7('0x45')]({'where':{'id':_0x345c1c['params']['id']},'raw':!![]})[_0xa7a7('0x14')](function(_0x547c9b){if(!_0x547c9b)return _0x7c1ee8[_0xa7a7('0x9')](0x194);return{'url':oauth[_0xa7a7('0x46')](_0x547c9b,_0x345c1c['user']['id'])};})['then'](respondWithResult(_0x7c1ee8,null))[_0xa7a7('0x37')](handleError(_0x7c1ee8,null));};exports['oauth2MicrosoftCallback']=function(_0x3d89e4,_0x24098a){var _0x250f31=_0x3d89e4[_0xa7a7('0x3e')];var _0x5ac41e;var _0x12baa0;if(_0x250f31['error'])throw _0x250f31;redis[_0xa7a7('0x47')](_0x250f31[_0xa7a7('0x48')])[_0xa7a7('0x14')](function(_0x111003){if(!_0x111003)throw new Error(_0xa7a7('0x49'));_0x5ac41e=JSON[_0xa7a7('0x4a')](_0x111003);var _0xe3cf39=Buffer[_0xa7a7('0x4b')](_0x250f31[_0xa7a7('0x48')],'base64')[_0xa7a7('0x4c')]('ascii');_0x12baa0=JSON['parse'](_0xe3cf39);if(!oauth[_0xa7a7('0x4d')](_0x250f31['id_token'],_0x5ac41e[_0xa7a7('0x4e')]))throw new Error(_0xa7a7('0x4f'));redis[_0xa7a7('0x50')](_0x250f31[_0xa7a7('0x48')]);return oauth[_0xa7a7('0x51')](_0x250f31[_0xa7a7('0x52')],_0x5ac41e);})[_0xa7a7('0x14')](function(_0x5c60d4){_0x5ac41e[_0xa7a7('0x53')]=_0x5c60d4[_0xa7a7('0x54')];_0x5ac41e[_0xa7a7('0x55')]=_0x5c60d4[_0xa7a7('0x56')];return db['CloudProvider'][_0xa7a7('0x13')]({'data5':_0x5ac41e[_0xa7a7('0x53')],'data6':_0x5ac41e[_0xa7a7('0x55')]},{'where':{'id':_0x5ac41e['id']}});})[_0xa7a7('0x14')](function(){oauth[_0xa7a7('0x57')](_0x5ac41e);socket['emit'](_0xa7a7('0x58'),{'id':_0x12baa0['id']});return;})[_0xa7a7('0x14')](respondWithStatusCode(_0x24098a,null))[_0xa7a7('0x37')](function(_0x311a48){if(_0x12baa0){socket[_0xa7a7('0x59')]('microsoftAuthorization:error',{'id':_0x12baa0['id']});}if(!_0x5ac41e){logger[_0xa7a7('0x16')](_0xa7a7('0x5a'),_0x311a48);return _0x24098a[_0xa7a7('0xa')](0x1f4)['send'](_0x311a48['message']);}logger[_0xa7a7('0x16')](_0xa7a7('0x5b'),_0x5ac41e['id'],JSON[_0xa7a7('0x5c')](_0x311a48));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 1ba3bd8..8eb5c09 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 _0x2893=['rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','util','../../config/logger','path'];(function(_0x4d5cc7,_0x10f85d){var _0x289350=function(_0x5af4c3){while(--_0x5af4c3){_0x4d5cc7['push'](_0x4d5cc7['shift']());}};_0x289350(++_0x10f85d);}(_0x2893,0x12f));var _0x3289=function(_0x48bee1,_0x29f43d){_0x48bee1=_0x48bee1-0x0;var _0x582372=_0x2893[_0x48bee1];return _0x582372;};'use strict';var _=require('lodash');var util=require(_0x3289('0x0'));var logger=require(_0x3289('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3289('0x2'));var rimraf=require(_0x3289('0x3'));var config=require(_0x3289('0x4'));var attributes=require(_0x3289('0x5'));module[_0x3289('0x6')]=function(_0x2e2d7e,_0x54f77f){return _0x2e2d7e[_0x3289('0x7')](_0x3289('0x8'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3c8d=['define','CloudProvider','cloud_providers','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x3c8d,0xdb));var _0xd3c8=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x3c8d[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0xd3c8('0x0'));var util=require('util');var logger=require(_0xd3c8('0x1'))(_0xd3c8('0x2'));var moment=require('moment');var BPromise=require(_0xd3c8('0x3'));var rp=require(_0xd3c8('0x4'));var fs=require('fs');var path=require(_0xd3c8('0x5'));var rimraf=require(_0xd3c8('0x6'));var config=require('../../config/environment');var attributes=require(_0xd3c8('0x7'));module[_0xd3c8('0x8')]=function(_0x27c153,_0x4e7b92){return _0x27c153[_0xd3c8('0x9')](_0xd3c8('0xa'),attributes,{'tableName':_0xd3c8('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 f44bb5b..6ef07e2 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 _0x3177=['update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','/.default','Outlook365','replace','{TENANT_ID}','data2','code','stringify','base64','toString','hex','client_id','response_type','join','redirect_uri','form_post','scope','nonce','prompt','login','map','value','oauth2Claims','payload','iss','issuer','aud','audience','unix','exp','resolve','data3','findOne','then','refresh_token','data6','data4','data1','decryptString','POST','data5','CloudProvider'];(function(_0x5adfa9,_0x4b835d){var _0x458f41=function(_0x504e46){while(--_0x504e46){_0x5adfa9['push'](_0x5adfa9['shift']());}};_0x458f41(++_0x4b835d);}(_0x3177,0x185));var _0x7317=function(_0xfc5df5,_0x5935dc){_0xfc5df5=_0xfc5df5-0x0;var _0x3a9b2c=_0x3177[_0xfc5df5];return _0x3a9b2c;};'use strict';var _=require(_0x7317('0x0'));var crypto=require(_0x7317('0x1'));var jwt=require(_0x7317('0x2'));var moment=require(_0x7317('0x3'));var Redis=require(_0x7317('0x4'));var rp=require(_0x7317('0x5'));var util=require(_0x7317('0x6'));var encryptor=require(_0x7317('0x7'));var config=require(_0x7317('0x8'));var logger=require('../../config/logger')(_0x7317('0x9'));var schedule=require(_0x7317('0xa'));var db=require(_0x7317('0xb'))['db'];config[_0x7317('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x7317('0xc')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x7317('0xd'),_0x7317('0xe'),_0x7317('0xf'),_0x7317('0x10'),_0x7317('0x11'),_0x7317('0x12'),_0x7317('0x13')],'Dynamics365':[_0x7317('0xd'),_0x7317('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x7317('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x7317('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1f8b72){var _0x2c63d8=_['map'](AZURE_AUTH_SCOPES[_0x1f8b72[_0x7317('0x16')]]);if(_0x1f8b72[_0x7317('0x16')]===_0x7317('0x17'))_0x2c63d8[_0x7317('0x18')](_0x1f8b72[_0x7317('0x19')]+_0x7317('0x1a'));return _0x2c63d8['join']('\x20');}function getAccessTokenScope(_0x3272f5){if(_0x3272f5[_0x7317('0x16')]===_0x7317('0x1b'))return _0x7317('0x11');if(_0x3272f5[_0x7317('0x16')]===_0x7317('0x17'))return _0x3272f5[_0x7317('0x19')]+_0x7317('0x1a');}function generateMicrosoftAuthorizationUrl(_0x32f011,_0x48aeb5){var _0x3306c1=MICROSOFT_AUTH_URL[_0x7317('0x1c')](_0x7317('0x1d'),_0x32f011[_0x7317('0x1e')]);var _0xb93fa5=[_0x7317('0x1f'),'id_token'];var _0x4960d1=Buffer['from'](JSON[_0x7317('0x20')]({'id':_0x48aeb5}))['toString'](_0x7317('0x21'));var _0x94a0c0=crypto['randomBytes'](0x10)[_0x7317('0x22')](_0x7317('0x23'));var _0x169910=getAuthorizationScopes(_0x32f011);var _0xa41d59=[{'key':_0x7317('0x24'),'value':_0x32f011['data1']},{'key':_0x7317('0x25'),'value':encodeURIComponent(_0xb93fa5[_0x7317('0x26')]('\x20'))},{'key':_0x7317('0x27'),'value':_0x32f011['data4']},{'key':'response_mode','value':_0x7317('0x28')},{'key':_0x7317('0x29'),'value':encodeURIComponent(_0x169910)},{'key':'state','value':_0x4960d1},{'key':_0x7317('0x2a'),'value':_0x94a0c0},{'key':_0x7317('0x2b'),'value':_0x7317('0x2c')}];var _0x41ee35=_0x3306c1+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x7317('0x2d')](_0xa41d59,function(_0x2b4f18){return _0x2b4f18['key']+'='+_0x2b4f18[_0x7317('0x2e')];})['join']('&');_0x32f011[_0x7317('0x2f')]={'issuer':_0x3306c1['replace']('oauth2/',''),'audience':_0x32f011['data1'],'state':_0x4960d1,'nonce':_0x94a0c0};redis['set'](_0x4960d1,JSON[_0x7317('0x20')](_0x32f011));return _0x41ee35;}function isValidIdToken(_0x17bb24,_0x503de4){try{var _0x1641b4=jwt['decode'](_0x17bb24,{'complete':!![]});var _0x325e71=_0x1641b4[_0x7317('0x30')];if(_0x325e71[_0x7317('0x31')]!==_0x503de4[_0x7317('0x32')])return![];if(_0x325e71[_0x7317('0x33')]!==_0x503de4[_0x7317('0x34')])return![];if(_0x325e71[_0x7317('0x2a')]!==_0x503de4[_0x7317('0x2a')])return![];if(moment()['isAfter'](moment[_0x7317('0x35')](_0x325e71[_0x7317('0x36')])))return![];return!![];}catch(_0x28e3b3){throw _0x28e3b3;}}function refreshOauth2MicrosoftAccessToken(_0x5870b4){return Promise[_0x7317('0x37')]()['then'](function(){if(_0x5870b4[_0x7317('0x38')])return _0x5870b4;return db['CloudProvider'][_0x7317('0x39')]({'where':{'id':_0x5870b4['id']},'raw':!![]});})[_0x7317('0x3a')](function(_0x55bf07){var _0x4019e8={'grant_type':_0x7317('0x3b'),'refresh_token':_0x55bf07[_0x7317('0x3c')],'scope':getAccessTokenScope(_0x55bf07),'redirect_uri':_0x55bf07[_0x7317('0x3d')],'client_id':_0x55bf07[_0x7317('0x3e')],'client_secret':encryptor[_0x7317('0x3f')](_0x55bf07[_0x7317('0x38')])};var _0x558091={'method':_0x7317('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0x7317('0x1d'),_0x55bf07[_0x7317('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4019e8,'json':!![]};return rp(_0x558091);})[_0x7317('0x3a')](function(_0xe8fd0f){_0x5870b4[_0x7317('0x41')]=_0xe8fd0f['access_token'];_0x5870b4['data6']=_0xe8fd0f['refresh_token'];return db[_0x7317('0x42')][_0x7317('0x43')]({'data5':_0x5870b4[_0x7317('0x41')],'data6':_0x5870b4[_0x7317('0x3c')]},{'where':{'id':_0x5870b4['id']}});})['then'](function(){return _0x5870b4;})[_0x7317('0x44')](function(_0x2a5163){logger[_0x7317('0x45')](_0x7317('0x46'),_0x5870b4['id'],_0x2a5163);});}function getOauth2MicrosoftAccessToken(_0x2345dd,_0x28556d){var _0x54fa94={'grant_type':_0x7317('0x47'),'code':_0x2345dd,'scope':getAccessTokenScope(_0x28556d),'redirect_uri':_0x28556d[_0x7317('0x3d')],'client_id':_0x28556d[_0x7317('0x3e')],'client_secret':encryptor[_0x7317('0x3f')](_0x28556d['data3'])};var _0x4067d3={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x7317('0x1d'),_0x28556d[_0x7317('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x54fa94,'json':!![]};return rp(_0x4067d3);}function startRefreshInterval(_0x27c2cc){var _0x13a996=schedule['intervals'];if(_0x13a996[_0x27c2cc['id']])clearInterval(_0x13a996[_0x27c2cc['id']]);_0x13a996[_0x27c2cc['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x27c2cc['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x7317('0x48')]=_0x13a996;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x7317('0x3a')](function(_0x33eacf){var _0x1f2da5=_0x33eacf[_0x7317('0x2d')](function(_0x568067){return refreshOauth2MicrosoftAccessToken(_0x568067)[_0x7317('0x3a')](function(_0xf063b5){startRefreshInterval(_0xf063b5);});});return Promise['all'](_0x1f2da5);})[_0x7317('0x44')](function(_0x3c2474){var _0x824c56=_0x3c2474?util[_0x7317('0x49')](_0x3c2474,{'showHidden':![],'depth':null}):'';logger['error'](_0x7317('0x4a'),_0x824c56);});}module[_0x7317('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xa6a3=['all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','offline_access','/authorize','/token','type','Dynamics365','push','data7','join','Outlook365','/.default','replace','data2','code','id_token','from','stringify','toString','base64','client_id','data1','response_type','data4','response_mode','form_post','scope','state','nonce','key','value','set','decode','payload','iss','audience','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','access_token','CloudProvider','data5','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','map'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa6a3,0x1de));var _0x3a6a=function(_0x1bdc52,_0x4876a9){_0x1bdc52=_0x1bdc52-0x0;var _0xdf3fa3=_0xa6a3[_0x1bdc52];return _0xdf3fa3;};'use strict';var _=require(_0x3a6a('0x0'));var crypto=require('crypto');var jwt=require(_0x3a6a('0x1'));var moment=require(_0x3a6a('0x2'));var Redis=require(_0x3a6a('0x3'));var rp=require(_0x3a6a('0x4'));var util=require(_0x3a6a('0x5'));var encryptor=require(_0x3a6a('0x6'));var config=require(_0x3a6a('0x7'));var logger=require(_0x3a6a('0x8'))('api');var schedule=require(_0x3a6a('0x9'));var db=require(_0x3a6a('0xa'))['db'];config['redis']=_[_0x3a6a('0xb')](config[_0x3a6a('0xc')],{'host':_0x3a6a('0xd'),'port':0x18eb});var redis=new Redis(config[_0x3a6a('0xc')]);var MICROSOFT_AUTH_URL=_0x3a6a('0xe');var AZURE_AUTH_SCOPES={'Outlook365':['openid','profile',_0x3a6a('0xf'),'offline_access',_0x3a6a('0x10'),_0x3a6a('0x11'),_0x3a6a('0x12')],'Dynamics365':[_0x3a6a('0x13'),_0x3a6a('0x14')]};var MICROSOFT_AUTH_ENDPOINT=_0x3a6a('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0x3a6a('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x48a8c9){var _0x567500=_['map'](AZURE_AUTH_SCOPES[_0x48a8c9[_0x3a6a('0x17')]]);if(_0x48a8c9[_0x3a6a('0x17')]===_0x3a6a('0x18'))_0x567500[_0x3a6a('0x19')](_0x48a8c9[_0x3a6a('0x1a')]+'/.default');return _0x567500[_0x3a6a('0x1b')]('\x20');}function getAccessTokenScope(_0x42300a){if(_0x42300a['type']===_0x3a6a('0x1c'))return _0x3a6a('0x10');if(_0x42300a[_0x3a6a('0x17')]===_0x3a6a('0x18'))return _0x42300a['data7']+_0x3a6a('0x1d');}function generateMicrosoftAuthorizationUrl(_0x325a0f,_0x4469d8){var _0x5839dc=MICROSOFT_AUTH_URL[_0x3a6a('0x1e')]('{TENANT_ID}',_0x325a0f[_0x3a6a('0x1f')]);var _0x25c292=[_0x3a6a('0x20'),_0x3a6a('0x21')];var _0x406990=Buffer[_0x3a6a('0x22')](JSON[_0x3a6a('0x23')]({'id':_0x4469d8}))[_0x3a6a('0x24')](_0x3a6a('0x25'));var _0x16d68b=crypto['randomBytes'](0x10)[_0x3a6a('0x24')]('hex');var _0x55be52=getAuthorizationScopes(_0x325a0f);var _0x1294bd=[{'key':_0x3a6a('0x26'),'value':_0x325a0f[_0x3a6a('0x27')]},{'key':_0x3a6a('0x28'),'value':encodeURIComponent(_0x25c292[_0x3a6a('0x1b')]('\x20'))},{'key':'redirect_uri','value':_0x325a0f[_0x3a6a('0x29')]},{'key':_0x3a6a('0x2a'),'value':_0x3a6a('0x2b')},{'key':_0x3a6a('0x2c'),'value':encodeURIComponent(_0x55be52)},{'key':_0x3a6a('0x2d'),'value':_0x406990},{'key':_0x3a6a('0x2e'),'value':_0x16d68b},{'key':'prompt','value':'login'}];var _0x4f6589=_0x5839dc+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x1294bd,function(_0x146b94){return _0x146b94[_0x3a6a('0x2f')]+'='+_0x146b94[_0x3a6a('0x30')];})[_0x3a6a('0x1b')]('&');_0x325a0f['oauth2Claims']={'issuer':_0x5839dc[_0x3a6a('0x1e')]('oauth2/',''),'audience':_0x325a0f['data1'],'state':_0x406990,'nonce':_0x16d68b};redis[_0x3a6a('0x31')](_0x406990,JSON[_0x3a6a('0x23')](_0x325a0f));return _0x4f6589;}function isValidIdToken(_0x1e54ef,_0x379808){try{var _0x1731b1=jwt[_0x3a6a('0x32')](_0x1e54ef,{'complete':!![]});var _0x51e3dc=_0x1731b1[_0x3a6a('0x33')];if(_0x51e3dc[_0x3a6a('0x34')]!==_0x379808['issuer'])return![];if(_0x51e3dc['aud']!==_0x379808[_0x3a6a('0x35')])return![];if(_0x51e3dc[_0x3a6a('0x2e')]!==_0x379808[_0x3a6a('0x2e')])return![];if(moment()[_0x3a6a('0x36')](moment[_0x3a6a('0x37')](_0x51e3dc[_0x3a6a('0x38')])))return![];return!![];}catch(_0x3cfbc9){throw _0x3cfbc9;}}function refreshOauth2MicrosoftAccessToken(_0x247196){return Promise[_0x3a6a('0x39')]()[_0x3a6a('0x3a')](function(){if(_0x247196[_0x3a6a('0x3b')])return _0x247196;return db['CloudProvider'][_0x3a6a('0x3c')]({'where':{'id':_0x247196['id']},'raw':!![]});})[_0x3a6a('0x3a')](function(_0x32a370){var _0x11efdc={'grant_type':_0x3a6a('0x3d'),'refresh_token':_0x32a370[_0x3a6a('0x3e')],'scope':getAccessTokenScope(_0x32a370),'redirect_uri':_0x32a370[_0x3a6a('0x29')],'client_id':_0x32a370[_0x3a6a('0x27')],'client_secret':encryptor[_0x3a6a('0x3f')](_0x32a370['data3'])};var _0x2187b7={'method':_0x3a6a('0x40'),'uri':MICROSOFT_AUTH_URL[_0x3a6a('0x1e')](_0x3a6a('0x41'),_0x32a370[_0x3a6a('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x11efdc,'json':!![]};return rp(_0x2187b7);})[_0x3a6a('0x3a')](function(_0x499ab5){_0x247196['data5']=_0x499ab5[_0x3a6a('0x42')];_0x247196[_0x3a6a('0x3e')]=_0x499ab5[_0x3a6a('0x3d')];return db[_0x3a6a('0x43')]['update']({'data5':_0x247196[_0x3a6a('0x44')],'data6':_0x247196[_0x3a6a('0x3e')]},{'where':{'id':_0x247196['id']}});})[_0x3a6a('0x3a')](function(){return _0x247196;})['catch'](function(_0x15fe2c){logger[_0x3a6a('0x45')](_0x3a6a('0x46'),_0x247196['id'],_0x15fe2c);});}function getOauth2MicrosoftAccessToken(_0x1d50e8,_0x364151){var _0x102f2f={'grant_type':'authorization_code','code':_0x1d50e8,'scope':getAccessTokenScope(_0x364151),'redirect_uri':_0x364151[_0x3a6a('0x29')],'client_id':_0x364151[_0x3a6a('0x27')],'client_secret':encryptor[_0x3a6a('0x3f')](_0x364151[_0x3a6a('0x3b')])};var _0x169b51={'method':'POST','uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x364151[_0x3a6a('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x102f2f,'json':!![]};return rp(_0x169b51);}function startRefreshInterval(_0xb0716d){var _0x49868c=schedule[_0x3a6a('0x47')];if(_0x49868c[_0xb0716d['id']])clearInterval(_0x49868c[_0xb0716d['id']]);_0x49868c[_0xb0716d['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x3a6a('0x48')](this,{'id':_0xb0716d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3a6a('0x47')]=_0x49868c;}function startAllRefreshIntervals(){return db[_0x3a6a('0x43')][_0x3a6a('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x22261e){var _0x44cf58=_0x22261e[_0x3a6a('0x4a')](function(_0x3673b2){return refreshOauth2MicrosoftAccessToken(_0x3673b2)[_0x3a6a('0x3a')](function(_0x2c0706){startRefreshInterval(_0x2c0706);});});return Promise[_0x3a6a('0x4b')](_0x44cf58);})[_0x3a6a('0x4c')](function(_0xe20041){var _0x31b15e=_0xe20041?util[_0x3a6a('0x4d')](_0xe20041,{'showHidden':![],'depth':null}):'';logger[_0x3a6a('0x45')](_0x3a6a('0x4e'),_0x31b15e);});}module['exports']={'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 3812e44..777aa18 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 _0x8ff9=['../../config/environment','client','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x8ff9,0x1a6));var _0x98ff=function(_0xc1da56,_0x5e7d96){_0xc1da56=_0xc1da56-0x0;var _0x5b1e17=_0x8ff9[_0xc1da56];return _0x5b1e17;};'use strict';var _=require(_0x98ff('0x0'));var util=require(_0x98ff('0x1'));var moment=require(_0x98ff('0x2'));var BPromise=require(_0x98ff('0x3'));var rs=require(_0x98ff('0x4'));var fs=require('fs');var Redis=require(_0x98ff('0x5'));var db=require(_0x98ff('0x6'))['db'];var utils=require(_0x98ff('0x7'));var logger=require(_0x98ff('0x8'))(_0x98ff('0x9'));var config=require(_0x98ff('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x98ff('0xb')][_0x98ff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13537e,_0x21d840,_0x12d3fe){return new BPromise(function(_0xbe13f3,_0x51fbd8){return client[_0x98ff('0xd')](_0x13537e,_0x12d3fe)['then'](function(_0x4bbf37){logger[_0x98ff('0xe')](_0x98ff('0xf'),_0x21d840,_0x98ff('0x10'));logger[_0x98ff('0x11')](_0x98ff('0x12'),_0x21d840,'request\x20sent',JSON[_0x98ff('0x13')](_0x4bbf37));if(_0x4bbf37['error']){if(_0x4bbf37[_0x98ff('0x14')]['code']===0x1f4){logger['error'](_0x98ff('0xf'),_0x21d840,_0x4bbf37[_0x98ff('0x14')][_0x98ff('0x15')]);return _0x51fbd8(_0x4bbf37['error'][_0x98ff('0x15')]);}logger['error'](_0x98ff('0xf'),_0x21d840,_0x4bbf37[_0x98ff('0x14')][_0x98ff('0x15')]);return _0xbe13f3(_0x4bbf37[_0x98ff('0x14')][_0x98ff('0x15')]);}else{logger[_0x98ff('0xe')]('CloudProvider,\x20%s,\x20%s',_0x21d840,_0x98ff('0x10'));_0xbe13f3(_0x4bbf37[_0x98ff('0x16')][_0x98ff('0x15')]);}})[_0x98ff('0x17')](function(_0x3751b9){logger[_0x98ff('0x14')](_0x98ff('0xf'),_0x21d840,_0x3751b9);_0x51fbd8(_0x3751b9);});});}
\ No newline at end of file
+var _0x85de=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x397ed9,_0x3a831a){var _0x1a5a4d=function(_0x974ae9){while(--_0x974ae9){_0x397ed9['push'](_0x397ed9['shift']());}};_0x1a5a4d(++_0x3a831a);}(_0x85de,0x65));var _0xe85d=function(_0x5efdbf,_0x4edf76){_0x5efdbf=_0x5efdbf-0x0;var _0x397580=_0x85de[_0x5efdbf];return _0x397580;};'use strict';var _=require(_0xe85d('0x0'));var util=require(_0xe85d('0x1'));var moment=require(_0xe85d('0x2'));var BPromise=require(_0xe85d('0x3'));var rs=require(_0xe85d('0x4'));var fs=require('fs');var Redis=require(_0xe85d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe85d('0x6'));var logger=require(_0xe85d('0x7'))(_0xe85d('0x8'));var config=require(_0xe85d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe85d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27401c,_0x387bfc,_0x42c1ca){return new BPromise(function(_0x4c1cbb,_0x2c1197){return client[_0xe85d('0xb')](_0x27401c,_0x42c1ca)[_0xe85d('0xc')](function(_0x89b2b2){logger[_0xe85d('0xd')](_0xe85d('0xe'),_0x387bfc,_0xe85d('0xf'));logger[_0xe85d('0x10')](_0xe85d('0x11'),_0x387bfc,_0xe85d('0xf'),JSON[_0xe85d('0x12')](_0x89b2b2));if(_0x89b2b2[_0xe85d('0x13')]){if(_0x89b2b2[_0xe85d('0x13')][_0xe85d('0x14')]===0x1f4){logger[_0xe85d('0x13')](_0xe85d('0xe'),_0x387bfc,_0x89b2b2[_0xe85d('0x13')]['message']);return _0x2c1197(_0x89b2b2['error'][_0xe85d('0x15')]);}logger[_0xe85d('0x13')](_0xe85d('0xe'),_0x387bfc,_0x89b2b2[_0xe85d('0x13')][_0xe85d('0x15')]);return _0x4c1cbb(_0x89b2b2[_0xe85d('0x13')][_0xe85d('0x15')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x387bfc,'request\x20sent');_0x4c1cbb(_0x89b2b2['result'][_0xe85d('0x15')]);}})[_0xe85d('0x16')](function(_0x5c431c){logger[_0xe85d('0x13')](_0xe85d('0xe'),_0x387bfc,_0x5c431c);_0x2c1197(_0x5c431c);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index f7928ca..24e1c6a 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x1261,0x144));var _0x1126=function(_0x1193ea,_0xc04ef0){_0x1193ea=_0x1193ea-0x0;var _0x5e4000=_0x1261[_0x1193ea];return _0x5e4000;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x491437,_0xe137b8){var _0x197aad=function(_0x2dfd60){while(--_0x2dfd60){_0x491437['push'](_0x491437['shift']());}};_0x197aad(++_0xe137b8);}(_0x2ef3,0xba));var _0x32ef=function(_0x421c50,_0xe31ea3){_0x421c50=_0x421c50-0x0;var _0x9a7189=_0x2ef3[_0x421c50];return _0x9a7189;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 9b948b5..788cded 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 _0x4606=['exports','STRING','name'];(function(_0x2f08db,_0x468da8){var _0xd8d3e6=function(_0x1d72e2){while(--_0x1d72e2){_0x2f08db['push'](_0x2f08db['shift']());}};_0xd8d3e6(++_0x468da8);}(_0x4606,0x1b0));var _0x6460=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4606[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x6460('0x0')]={'name':{'type':Sequelize[_0x6460('0x1')],'unique':_0x6460('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x6460('0x1')]},'companyId':{'type':Sequelize[_0x6460('0x1')]},'website':{'type':Sequelize[_0x6460('0x1')]},'phone':{'type':Sequelize[_0x6460('0x1')]},'fax':{'type':Sequelize[_0x6460('0x1')]},'type':{'type':Sequelize[_0x6460('0x1')]},'street':{'type':Sequelize[_0x6460('0x1')]},'postalCode':{'type':Sequelize[_0x6460('0x1')]},'city':{'type':Sequelize[_0x6460('0x1')]},'country':{'type':Sequelize[_0x6460('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x6460('0x1')]},'sStreet':{'type':Sequelize[_0x6460('0x1')]},'sPostalCode':{'type':Sequelize[_0x6460('0x1')]},'sCity':{'type':Sequelize[_0x6460('0x1')]},'sCountry':{'type':Sequelize[_0x6460('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe497=['exports','STRING','name','sequelize'];(function(_0x3ef3c2,_0x4dedd7){var _0x3b984f=function(_0x497476){while(--_0x497476){_0x3ef3c2['push'](_0x3ef3c2['shift']());}};_0x3b984f(++_0x4dedd7);}(_0xe497,0xb3));var _0x7e49=function(_0x2f4fde,_0x1b4b1e){_0x2f4fde=_0x2f4fde-0x0;var _0x2a2d95=_0xe497[_0x2f4fde];return _0x2a2d95;};'use strict';var Sequelize=require(_0x7e49('0x0'));module[_0x7e49('0x1')]={'name':{'type':Sequelize[_0x7e49('0x2')],'unique':_0x7e49('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7e49('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x7e49('0x2')]},'phone':{'type':Sequelize[_0x7e49('0x2')]},'fax':{'type':Sequelize[_0x7e49('0x2')]},'type':{'type':Sequelize[_0x7e49('0x2')]},'street':{'type':Sequelize[_0x7e49('0x2')]},'postalCode':{'type':Sequelize[_0x7e49('0x2')]},'city':{'type':Sequelize[_0x7e49('0x2')]},'country':{'type':Sequelize[_0x7e49('0x2')]},'email':{'type':Sequelize[_0x7e49('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7e49('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x7e49('0x2')]},'sCity':{'type':Sequelize[_0x7e49('0x2')]},'sCountry':{'type':Sequelize[_0x7e49('0x2')]},'description':{'type':Sequelize[_0x7e49('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index c1530e1..98b9ed1 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 _0x2c86=['zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','Companies','UserProfileResource','then','end','sendStatus','error','stack','name','send','index','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','merge','map','filter','options','CmCompany','includeAll','findAll','rows','catch','show','params','rawAttributes','fields','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','omit','ids','getContacts','findOne','pick','eml-format','rimraf'];(function(_0x499792,_0x20bf22){var _0x1ba806=function(_0x2bc368){while(--_0x2bc368){_0x499792['push'](_0x499792['shift']());}};_0x1ba806(++_0x20bf22);}(_0x2c86,0x1c0));var _0x62c8=function(_0xa002c8,_0x485247){_0xa002c8=_0xa002c8-0x0;var _0x4da7a6=_0x2c86[_0xa002c8];return _0x4da7a6;};'use strict';var emlformat=require(_0x62c8('0x0'));var rimraf=require(_0x62c8('0x1'));var zipdir=require(_0x62c8('0x2'));var jsonpatch=require(_0x62c8('0x3'));var rp=require(_0x62c8('0x4'));var moment=require(_0x62c8('0x5'));var BPromise=require(_0x62c8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x62c8('0x7'));var sox=require(_0x62c8('0x8'));var csv=require(_0x62c8('0x9'));var ejs=require(_0x62c8('0xa'));var fs=require('fs');var fs_extra=require(_0x62c8('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x62c8('0xc'));var deskjs=require(_0x62c8('0xd'));var toCsv=require(_0x62c8('0x9'));var querystring=require(_0x62c8('0xe'));var Papa=require(_0x62c8('0xf'));var Redis=require(_0x62c8('0x10'));var authService=require(_0x62c8('0x11'));var qs=require(_0x62c8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62c8('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x62c8('0x14'));var config=require(_0x62c8('0x15'));var licenseUtil=require(_0x62c8('0x16'));var db=require(_0x62c8('0x17'))['db'];function respondWithStatusCode(_0x5ca63b,_0x702ad4){_0x702ad4=_0x702ad4||0xcc;return function(_0x462fd9){if(_0x462fd9){return _0x5ca63b['sendStatus'](_0x702ad4);}return _0x5ca63b[_0x62c8('0x18')](_0x702ad4)['end']();};}function respondWithResult(_0x142ff6,_0x389a5f){_0x389a5f=_0x389a5f||0xc8;return function(_0x30038e){if(_0x30038e){return _0x142ff6['status'](_0x389a5f)['json'](_0x30038e);}};}function respondWithFilteredResult(_0x14abaa,_0xfe9a1f){return function(_0x40b733){if(_0x40b733){var _0x31800d=typeof _0xfe9a1f[_0x62c8('0x19')]===_0x62c8('0x1a')&&typeof _0xfe9a1f[_0x62c8('0x1b')]==='undefined';var _0xea343e=_0x40b733['count'];var _0x5067c0=_0x31800d?0x0:_0xfe9a1f[_0x62c8('0x19')];var _0x3de0a1=_0x31800d?_0x40b733[_0x62c8('0x1c')]:_0xfe9a1f[_0x62c8('0x19')]+_0xfe9a1f[_0x62c8('0x1b')];var _0x2a7f91;if(_0x3de0a1>=_0xea343e){_0x3de0a1=_0xea343e;_0x2a7f91=0xc8;}else{_0x2a7f91=0xce;}_0x14abaa[_0x62c8('0x18')](_0x2a7f91);return _0x14abaa[_0x62c8('0x1d')](_0x62c8('0x1e'),_0x5067c0+'-'+_0x3de0a1+'/'+_0xea343e)[_0x62c8('0x1f')](_0x40b733);}return null;};}function patchUpdates(_0x1be691){return function(_0x1b3318){try{jsonpatch[_0x62c8('0x20')](_0x1b3318,_0x1be691,!![]);}catch(_0x2be4c9){return BPromise[_0x62c8('0x21')](_0x2be4c9);}return _0x1b3318[_0x62c8('0x22')]();};}function saveUpdates(_0x251053,_0x5a99ce){return function(_0x1fe31d){if(_0x1fe31d){return _0x1fe31d[_0x62c8('0x23')](_0x251053)['then'](function(_0x330841){return _0x330841;});}return null;};}function removeEntity(_0x56e759,_0x3d0bff){return function(_0x2b74ad){if(_0x2b74ad){return _0x2b74ad[_0x62c8('0x24')]()['then'](function(){var _0x207e8f=_0x2b74ad[_0x62c8('0x25')]({'plain':!![]});var _0x1be463=_0x62c8('0x26');return db[_0x62c8('0x27')][_0x62c8('0x24')]({'where':{'type':_0x1be463,'resourceId':_0x207e8f['id']}})[_0x62c8('0x28')](function(){return _0x2b74ad;});})[_0x62c8('0x28')](function(){_0x56e759['status'](0xcc)[_0x62c8('0x29')]();});}};}function handleEntityNotFound(_0x63f403,_0x159401){return function(_0x5b3738){if(!_0x5b3738){_0x63f403[_0x62c8('0x2a')](0x194);}return _0x5b3738;};}function handleError(_0x5a0530,_0x1f7e2e){_0x1f7e2e=_0x1f7e2e||0x1f4;return function(_0x384cc9){logger[_0x62c8('0x2b')](_0x384cc9[_0x62c8('0x2c')]);if(_0x384cc9[_0x62c8('0x2d')]){delete _0x384cc9[_0x62c8('0x2d')];}_0x5a0530[_0x62c8('0x18')](_0x1f7e2e)[_0x62c8('0x2e')](_0x384cc9);};}exports[_0x62c8('0x2f')]=function(_0x9d80c1,_0x424b00){var _0x1d236b={},_0x58b068={},_0x50734e={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x62c8('0x28')](function(_0x34538a){_0x58b068[_0x62c8('0x30')]=_[_0x62c8('0x31')](_0x34538a);_0x58b068[_0x62c8('0x32')]=_['keys'](_0x9d80c1[_0x62c8('0x32')]);_0x58b068[_0x62c8('0x33')]=_[_0x62c8('0x34')](_0x58b068[_0x62c8('0x30')],_0x58b068[_0x62c8('0x32')]);_0x1d236b['attributes']=_[_0x62c8('0x34')](_0x58b068['model'],qs['fields'](_0x9d80c1[_0x62c8('0x32')]['fields']));_0x1d236b[_0x62c8('0x35')]=_0x1d236b[_0x62c8('0x35')]['length']?_0x1d236b[_0x62c8('0x35')]:_0x58b068[_0x62c8('0x30')];if(!_0x9d80c1['query'][_0x62c8('0x36')](_0x62c8('0x37'))){_0x1d236b[_0x62c8('0x1b')]=qs[_0x62c8('0x1b')](_0x9d80c1['query'][_0x62c8('0x1b')]);_0x1d236b[_0x62c8('0x19')]=qs[_0x62c8('0x19')](_0x9d80c1[_0x62c8('0x32')]['offset']);}_0x1d236b[_0x62c8('0x38')]=qs[_0x62c8('0x39')](_0x9d80c1[_0x62c8('0x32')][_0x62c8('0x39')]);_0x1d236b[_0x62c8('0x3a')]=qs['filters'](_['pick'](_0x9d80c1['query'],_0x58b068['filters']),_0x34538a);if(_0x9d80c1[_0x62c8('0x32')]['filter']){_0x1d236b['where']=_[_0x62c8('0x3b')](_0x1d236b[_0x62c8('0x3a')],{'$or':_[_0x62c8('0x3c')](_0x1d236b[_0x62c8('0x35')],function(_0x2af9f9){var _0x5ba444={};_0x5ba444[_0x2af9f9]={'$like':'%'+_0x9d80c1[_0x62c8('0x32')][_0x62c8('0x3d')]+'%'};return _0x5ba444;})});}_0x1d236b=_[_0x62c8('0x3b')]({},_0x1d236b,_0x9d80c1[_0x62c8('0x3e')]);var _0x45b629={'where':_0x1d236b[_0x62c8('0x3a')]};return db[_0x62c8('0x3f')][_0x62c8('0x1c')](_0x45b629)['then'](function(_0x1d6c9d){_0x50734e[_0x62c8('0x1c')]=_0x1d6c9d;if(_0x9d80c1[_0x62c8('0x32')][_0x62c8('0x40')]){_0x1d236b['include']=[{'all':!![]}];}return db[_0x62c8('0x3f')][_0x62c8('0x41')](_0x1d236b);})[_0x62c8('0x28')](function(_0x280128){_0x50734e[_0x62c8('0x42')]=_0x280128;return _0x50734e;})[_0x62c8('0x28')](respondWithFilteredResult(_0x424b00,_0x1d236b))[_0x62c8('0x43')](handleError(_0x424b00,null));})[_0x62c8('0x43')](handleError(_0x424b00,null));};exports[_0x62c8('0x44')]=function(_0x5b7905,_0x1b34d8){var _0x46c9a2={'raw':![],'where':{'id':_0x5b7905[_0x62c8('0x45')]['id']}},_0x559fe0={};_0x559fe0[_0x62c8('0x30')]=_[_0x62c8('0x31')](db[_0x62c8('0x3f')][_0x62c8('0x46')]);_0x559fe0[_0x62c8('0x32')]=_[_0x62c8('0x31')](_0x5b7905[_0x62c8('0x32')]);_0x559fe0[_0x62c8('0x33')]=_[_0x62c8('0x34')](_0x559fe0['model'],_0x559fe0['query']);_0x46c9a2[_0x62c8('0x35')]=_['intersection'](_0x559fe0[_0x62c8('0x30')],qs[_0x62c8('0x47')](_0x5b7905[_0x62c8('0x32')][_0x62c8('0x47')]));_0x46c9a2['attributes']=_0x46c9a2[_0x62c8('0x35')][_0x62c8('0x48')]?_0x46c9a2['attributes']:_0x559fe0['model'];if(_0x5b7905['query']['includeAll']){_0x46c9a2[_0x62c8('0x49')]=[{'all':!![]}];}_0x46c9a2=_['merge']({},_0x46c9a2,_0x5b7905[_0x62c8('0x3e')]);return db[_0x62c8('0x3f')][_0x62c8('0x4a')](_0x46c9a2)['then'](handleEntityNotFound(_0x1b34d8,null))[_0x62c8('0x28')](respondWithResult(_0x1b34d8,null))[_0x62c8('0x43')](handleError(_0x1b34d8,null));};exports[_0x62c8('0x4b')]=function(_0x459114,_0x244f5b){return db['CmCompany'][_0x62c8('0x4b')](_0x459114[_0x62c8('0x4c')],{})[_0x62c8('0x28')](function(_0x238003){var _0x2e20f1=_0x459114[_0x62c8('0x4d')][_0x62c8('0x25')]({'plain':!![]});if(!_0x2e20f1)throw new Error(_0x62c8('0x4e'));if(_0x2e20f1['role']===_0x62c8('0x4d')){var _0x4fe10a=_0x238003[_0x62c8('0x25')]({'plain':!![]});var _0x55bd2f='Companies';return db[_0x62c8('0x4f')][_0x62c8('0x4a')]({'where':{'name':_0x55bd2f,'userProfileId':_0x2e20f1[_0x62c8('0x50')]},'raw':!![]})[_0x62c8('0x28')](function(_0x22690b){if(_0x22690b&&_0x22690b['autoAssociation']===0x0){return db[_0x62c8('0x27')]['create']({'name':_0x4fe10a[_0x62c8('0x2d')],'resourceId':_0x4fe10a['id'],'type':_0x22690b[_0x62c8('0x2d')],'sectionId':_0x22690b['id']},{})['then'](function(){return _0x238003;});}else{return _0x238003;}})[_0x62c8('0x43')](function(_0x49429c){logger[_0x62c8('0x2b')](_0x62c8('0x51'),_0x49429c);throw _0x49429c;});}return _0x238003;})['then'](respondWithResult(_0x244f5b,0xc9))[_0x62c8('0x43')](handleError(_0x244f5b,null));};exports['update']=function(_0x5d2ed5,_0x274390){if(_0x5d2ed5[_0x62c8('0x4c')]['id']){delete _0x5d2ed5[_0x62c8('0x4c')]['id'];}return db[_0x62c8('0x3f')][_0x62c8('0x4a')]({'where':{'id':_0x5d2ed5[_0x62c8('0x45')]['id']}})[_0x62c8('0x28')](handleEntityNotFound(_0x274390,null))[_0x62c8('0x28')](saveUpdates(_0x5d2ed5[_0x62c8('0x4c')],null))[_0x62c8('0x28')](respondWithResult(_0x274390,null))[_0x62c8('0x43')](handleError(_0x274390,null));};exports[_0x62c8('0x24')]=function(_0x30f447,_0x677100){return db[_0x62c8('0x3f')]['find']({'where':{'id':_0x30f447[_0x62c8('0x45')]['id']}})['then'](handleEntityNotFound(_0x677100,null))[_0x62c8('0x28')](removeEntity(_0x677100,null))[_0x62c8('0x43')](handleError(_0x677100,null));};exports[_0x62c8('0x52')]=function(_0x11fbec,_0x1ee9c7){return db['CmCompany'][_0x62c8('0x52')]()[_0x62c8('0x28')](respondWithResult(_0x1ee9c7,null))[_0x62c8('0x43')](handleError(_0x1ee9c7,null));};exports[_0x62c8('0x53')]=function(_0x23ddb9,_0x682ddb,_0x180935){return db[_0x62c8('0x54')][_0x62c8('0x4a')]({'where':{'id':_0x23ddb9[_0x62c8('0x45')]['id']}})[_0x62c8('0x28')](handleEntityNotFound(_0x682ddb,null))['then'](function(_0x36e205){if(_0x36e205){return _0x36e205[_0x62c8('0x53')](_0x23ddb9[_0x62c8('0x4c')]['ids'],_[_0x62c8('0x55')](_0x23ddb9[_0x62c8('0x4c')],[_0x62c8('0x56'),'id'])||{});}})[_0x62c8('0x28')](respondWithResult(_0x682ddb,null))['catch'](handleError(_0x682ddb,null));};exports[_0x62c8('0x57')]=function(_0xa422be,_0x11a719,_0x55e2cc){var _0x29bd37={};var _0x469ebb={};var _0x36d92e;var _0x1ed089;return db[_0x62c8('0x3f')][_0x62c8('0x58')]({'where':{'id':_0xa422be['params']['id']}})[_0x62c8('0x28')](handleEntityNotFound(_0x11a719,null))[_0x62c8('0x28')](function(_0x176bd6){if(_0x176bd6){_0x36d92e=_0x176bd6;_0x469ebb[_0x62c8('0x30')]=_[_0x62c8('0x31')](db['CmContact']['rawAttributes']);_0x469ebb[_0x62c8('0x32')]=_[_0x62c8('0x31')](_0xa422be[_0x62c8('0x32')]);_0x469ebb[_0x62c8('0x33')]=_[_0x62c8('0x34')](_0x469ebb[_0x62c8('0x30')],_0x469ebb['query']);_0x29bd37['attributes']=_[_0x62c8('0x34')](_0x469ebb[_0x62c8('0x30')],qs['fields'](_0xa422be[_0x62c8('0x32')][_0x62c8('0x47')]));_0x29bd37[_0x62c8('0x35')]=_0x29bd37[_0x62c8('0x35')][_0x62c8('0x48')]?_0x29bd37[_0x62c8('0x35')]:_0x469ebb[_0x62c8('0x30')];_0x29bd37[_0x62c8('0x38')]=qs[_0x62c8('0x39')](_0xa422be[_0x62c8('0x32')][_0x62c8('0x39')]);_0x29bd37[_0x62c8('0x3a')]=qs[_0x62c8('0x33')](_[_0x62c8('0x59')](_0xa422be[_0x62c8('0x32')],_0x469ebb['filters']));if(_0xa422be[_0x62c8('0x32')][_0x62c8('0x3d')]){_0x29bd37['where']=_[_0x62c8('0x3b')](_0x29bd37['where'],{'$or':_[_0x62c8('0x3c')](_0x29bd37[_0x62c8('0x35')],function(_0x2964f7){var _0x3bcb3e={};_0x3bcb3e[_0x2964f7]={'$like':'%'+_0xa422be['query'][_0x62c8('0x3d')]+'%'};return _0x3bcb3e;})});}_0x29bd37=_[_0x62c8('0x3b')]({},_0x29bd37,_0xa422be[_0x62c8('0x3e')]);return _0x36d92e['getContacts'](_0x29bd37);}})[_0x62c8('0x28')](function(_0x51f3a7){if(_0x51f3a7){_0x1ed089=_0x51f3a7[_0x62c8('0x48')];if(!_0xa422be[_0x62c8('0x32')][_0x62c8('0x36')](_0x62c8('0x37'))){_0x29bd37[_0x62c8('0x1b')]=qs[_0x62c8('0x1b')](_0xa422be['query'][_0x62c8('0x1b')]);_0x29bd37['offset']=qs['offset'](_0xa422be[_0x62c8('0x32')][_0x62c8('0x19')]);}return _0x36d92e[_0x62c8('0x57')](_0x29bd37);}})[_0x62c8('0x28')](function(_0x1aaf92){if(_0x1aaf92){return _0x1aaf92?{'count':_0x1ed089,'rows':_0x1aaf92}:null;}})[_0x62c8('0x28')](respondWithResult(_0x11a719,null))['catch'](handleError(_0x11a719,null));};
\ No newline at end of file
+var _0xe86e=['rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','UserProfileResource','end','error','name','index','CmCompany','describe','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Companies','UserProfileSection','userProfileId','autoAssociation','CmContact','params','addContacts','ids','omit','getContacts','findOne','eml-format'];(function(_0x56f7e2,_0x145392){var _0x36240b=function(_0x216ff7){while(--_0x216ff7){_0x56f7e2['push'](_0x56f7e2['shift']());}};_0x36240b(++_0x145392);}(_0xe86e,0x1b7));var _0xee86=function(_0x2313f3,_0x2549de){_0x2313f3=_0x2313f3-0x0;var _0x4bb913=_0xe86e[_0x2313f3];return _0x4bb913;};'use strict';var emlformat=require(_0xee86('0x0'));var rimraf=require(_0xee86('0x1'));var zipdir=require(_0xee86('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee86('0x3'));var moment=require(_0xee86('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xee86('0x5'));var util=require(_0xee86('0x6'));var path=require(_0xee86('0x7'));var sox=require(_0xee86('0x8'));var csv=require(_0xee86('0x9'));var ejs=require(_0xee86('0xa'));var fs=require('fs');var fs_extra=require(_0xee86('0xb'));var _=require(_0xee86('0xc'));var squel=require(_0xee86('0xd'));var crypto=require(_0xee86('0xe'));var jsforce=require(_0xee86('0xf'));var deskjs=require(_0xee86('0x10'));var toCsv=require(_0xee86('0x9'));var querystring=require(_0xee86('0x11'));var Papa=require('papaparse');var Redis=require(_0xee86('0x12'));var authService=require(_0xee86('0x13'));var qs=require(_0xee86('0x14'));var as=require(_0xee86('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee86('0x16'))('api');var utils=require(_0xee86('0x17'));var config=require(_0xee86('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xee86('0x19'))['db'];function respondWithStatusCode(_0x115874,_0x19f44f){_0x19f44f=_0x19f44f||0xcc;return function(_0x108947){if(_0x108947){return _0x115874[_0xee86('0x1a')](_0x19f44f);}return _0x115874[_0xee86('0x1b')](_0x19f44f)['end']();};}function respondWithResult(_0x4083d9,_0x58c4f9){_0x58c4f9=_0x58c4f9||0xc8;return function(_0x4c9a85){if(_0x4c9a85){return _0x4083d9[_0xee86('0x1b')](_0x58c4f9)[_0xee86('0x1c')](_0x4c9a85);}};}function respondWithFilteredResult(_0x14ca53,_0x34ff77){return function(_0x1b850d){if(_0x1b850d){var _0x376aaf=typeof _0x34ff77['offset']===_0xee86('0x1d')&&typeof _0x34ff77[_0xee86('0x1e')]===_0xee86('0x1d');var _0x11bf58=_0x1b850d[_0xee86('0x1f')];var _0x2107d9=_0x376aaf?0x0:_0x34ff77[_0xee86('0x20')];var _0x38bb7b=_0x376aaf?_0x1b850d[_0xee86('0x1f')]:_0x34ff77[_0xee86('0x20')]+_0x34ff77['limit'];var _0x8116d5;if(_0x38bb7b>=_0x11bf58){_0x38bb7b=_0x11bf58;_0x8116d5=0xc8;}else{_0x8116d5=0xce;}_0x14ca53[_0xee86('0x1b')](_0x8116d5);return _0x14ca53[_0xee86('0x21')]('Content-Range',_0x2107d9+'-'+_0x38bb7b+'/'+_0x11bf58)['json'](_0x1b850d);}return null;};}function patchUpdates(_0x5bac44){return function(_0x3b453){try{jsonpatch['apply'](_0x3b453,_0x5bac44,!![]);}catch(_0x326c81){return BPromise[_0xee86('0x22')](_0x326c81);}return _0x3b453[_0xee86('0x23')]();};}function saveUpdates(_0x2ea436,_0x2f5192){return function(_0xdd352e){if(_0xdd352e){return _0xdd352e[_0xee86('0x24')](_0x2ea436)[_0xee86('0x25')](function(_0x187843){return _0x187843;});}return null;};}function removeEntity(_0x4fe7fc,_0x3ed109){return function(_0x530fdc){if(_0x530fdc){return _0x530fdc[_0xee86('0x26')]()[_0xee86('0x25')](function(){var _0x5714ad=_0x530fdc['get']({'plain':!![]});var _0x63a013='Companies';return db[_0xee86('0x27')][_0xee86('0x26')]({'where':{'type':_0x63a013,'resourceId':_0x5714ad['id']}})[_0xee86('0x25')](function(){return _0x530fdc;});})['then'](function(){_0x4fe7fc[_0xee86('0x1b')](0xcc)[_0xee86('0x28')]();});}};}function handleEntityNotFound(_0x41a872,_0x381630){return function(_0x3178da){if(!_0x3178da){_0x41a872[_0xee86('0x1a')](0x194);}return _0x3178da;};}function handleError(_0x3fa8ca,_0x5a0b17){_0x5a0b17=_0x5a0b17||0x1f4;return function(_0xb68b01){logger[_0xee86('0x29')](_0xb68b01['stack']);if(_0xb68b01[_0xee86('0x2a')]){delete _0xb68b01['name'];}_0x3fa8ca[_0xee86('0x1b')](_0x5a0b17)['send'](_0xb68b01);};}exports[_0xee86('0x2b')]=function(_0xce3bb1,_0x48b7fc){var _0x27fbea={},_0x1f941e={},_0xf815c9={'count':0x0,'rows':[]};return db[_0xee86('0x2c')][_0xee86('0x2d')]()[_0xee86('0x25')](function(_0x3265ce){_0x1f941e['model']=_[_0xee86('0x2e')](_0x3265ce);_0x1f941e['query']=_[_0xee86('0x2e')](_0xce3bb1[_0xee86('0x2f')]);_0x1f941e['filters']=_[_0xee86('0x30')](_0x1f941e[_0xee86('0x31')],_0x1f941e[_0xee86('0x2f')]);_0x27fbea[_0xee86('0x32')]=_[_0xee86('0x30')](_0x1f941e[_0xee86('0x31')],qs['fields'](_0xce3bb1[_0xee86('0x2f')][_0xee86('0x33')]));_0x27fbea[_0xee86('0x32')]=_0x27fbea[_0xee86('0x32')][_0xee86('0x34')]?_0x27fbea[_0xee86('0x32')]:_0x1f941e['model'];if(!_0xce3bb1['query'][_0xee86('0x35')](_0xee86('0x36'))){_0x27fbea[_0xee86('0x1e')]=qs[_0xee86('0x1e')](_0xce3bb1[_0xee86('0x2f')]['limit']);_0x27fbea[_0xee86('0x20')]=qs['offset'](_0xce3bb1[_0xee86('0x2f')][_0xee86('0x20')]);}_0x27fbea[_0xee86('0x37')]=qs[_0xee86('0x38')](_0xce3bb1[_0xee86('0x2f')]['sort']);_0x27fbea[_0xee86('0x39')]=qs[_0xee86('0x3a')](_[_0xee86('0x3b')](_0xce3bb1[_0xee86('0x2f')],_0x1f941e[_0xee86('0x3a')]),_0x3265ce);if(_0xce3bb1[_0xee86('0x2f')][_0xee86('0x3c')]){_0x27fbea[_0xee86('0x39')]=_[_0xee86('0x3d')](_0x27fbea[_0xee86('0x39')],{'$or':_[_0xee86('0x3e')](_0x27fbea[_0xee86('0x32')],function(_0x1c2661){var _0x4fb73a={};_0x4fb73a[_0x1c2661]={'$like':'%'+_0xce3bb1[_0xee86('0x2f')][_0xee86('0x3c')]+'%'};return _0x4fb73a;})});}_0x27fbea=_[_0xee86('0x3d')]({},_0x27fbea,_0xce3bb1[_0xee86('0x3f')]);var _0x2dd133={'where':_0x27fbea[_0xee86('0x39')]};return db[_0xee86('0x2c')][_0xee86('0x1f')](_0x2dd133)[_0xee86('0x25')](function(_0x17bfdf){_0xf815c9[_0xee86('0x1f')]=_0x17bfdf;if(_0xce3bb1[_0xee86('0x2f')][_0xee86('0x40')]){_0x27fbea[_0xee86('0x41')]=[{'all':!![]}];}return db[_0xee86('0x2c')][_0xee86('0x42')](_0x27fbea);})['then'](function(_0x11360a){_0xf815c9[_0xee86('0x43')]=_0x11360a;return _0xf815c9;})[_0xee86('0x25')](respondWithFilteredResult(_0x48b7fc,_0x27fbea))[_0xee86('0x44')](handleError(_0x48b7fc,null));})[_0xee86('0x44')](handleError(_0x48b7fc,null));};exports[_0xee86('0x45')]=function(_0x50f5c3,_0x4bc930){var _0x18b371={'raw':![],'where':{'id':_0x50f5c3['params']['id']}},_0x2a363a={};_0x2a363a[_0xee86('0x31')]=_[_0xee86('0x2e')](db['CmCompany'][_0xee86('0x46')]);_0x2a363a[_0xee86('0x2f')]=_['keys'](_0x50f5c3['query']);_0x2a363a[_0xee86('0x3a')]=_['intersection'](_0x2a363a['model'],_0x2a363a[_0xee86('0x2f')]);_0x18b371['attributes']=_[_0xee86('0x30')](_0x2a363a[_0xee86('0x31')],qs['fields'](_0x50f5c3[_0xee86('0x2f')][_0xee86('0x33')]));_0x18b371[_0xee86('0x32')]=_0x18b371[_0xee86('0x32')][_0xee86('0x34')]?_0x18b371[_0xee86('0x32')]:_0x2a363a[_0xee86('0x31')];if(_0x50f5c3['query']['includeAll']){_0x18b371[_0xee86('0x41')]=[{'all':!![]}];}_0x18b371=_[_0xee86('0x3d')]({},_0x18b371,_0x50f5c3[_0xee86('0x3f')]);return db[_0xee86('0x2c')][_0xee86('0x47')](_0x18b371)[_0xee86('0x25')](handleEntityNotFound(_0x4bc930,null))['then'](respondWithResult(_0x4bc930,null))[_0xee86('0x44')](handleError(_0x4bc930,null));};exports[_0xee86('0x48')]=function(_0x48fe16,_0x310d12){return db[_0xee86('0x2c')][_0xee86('0x48')](_0x48fe16[_0xee86('0x49')],{})['then'](function(_0x5a4a57){var _0x44eec8=_0x48fe16[_0xee86('0x4a')]['get']({'plain':!![]});if(!_0x44eec8)throw new Error(_0xee86('0x4b'));if(_0x44eec8['role']===_0xee86('0x4a')){var _0x52d1ad=_0x5a4a57[_0xee86('0x4c')]({'plain':!![]});var _0x56d936=_0xee86('0x4d');return db[_0xee86('0x4e')]['find']({'where':{'name':_0x56d936,'userProfileId':_0x44eec8[_0xee86('0x4f')]},'raw':!![]})[_0xee86('0x25')](function(_0x747d35){if(_0x747d35&&_0x747d35[_0xee86('0x50')]===0x0){return db[_0xee86('0x27')]['create']({'name':_0x52d1ad[_0xee86('0x2a')],'resourceId':_0x52d1ad['id'],'type':_0x747d35['name'],'sectionId':_0x747d35['id']},{})[_0xee86('0x25')](function(){return _0x5a4a57;});}else{return _0x5a4a57;}})['catch'](function(_0x38b23f){logger[_0xee86('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38b23f);throw _0x38b23f;});}return _0x5a4a57;})[_0xee86('0x25')](respondWithResult(_0x310d12,0xc9))[_0xee86('0x44')](handleError(_0x310d12,null));};exports[_0xee86('0x24')]=function(_0x12aba0,_0x1a1290){if(_0x12aba0['body']['id']){delete _0x12aba0['body']['id'];}return db['CmCompany'][_0xee86('0x47')]({'where':{'id':_0x12aba0['params']['id']}})[_0xee86('0x25')](handleEntityNotFound(_0x1a1290,null))[_0xee86('0x25')](saveUpdates(_0x12aba0[_0xee86('0x49')],null))[_0xee86('0x25')](respondWithResult(_0x1a1290,null))[_0xee86('0x44')](handleError(_0x1a1290,null));};exports[_0xee86('0x26')]=function(_0x49a2cc,_0x3b20a4){return db[_0xee86('0x2c')][_0xee86('0x47')]({'where':{'id':_0x49a2cc['params']['id']}})['then'](handleEntityNotFound(_0x3b20a4,null))[_0xee86('0x25')](removeEntity(_0x3b20a4,null))[_0xee86('0x44')](handleError(_0x3b20a4,null));};exports[_0xee86('0x2d')]=function(_0x164222,_0x4a2809){return db[_0xee86('0x2c')][_0xee86('0x2d')]()['then'](respondWithResult(_0x4a2809,null))[_0xee86('0x44')](handleError(_0x4a2809,null));};exports['addContacts']=function(_0x5224ad,_0x357b3a,_0x1e7a94){return db[_0xee86('0x51')][_0xee86('0x47')]({'where':{'id':_0x5224ad[_0xee86('0x52')]['id']}})[_0xee86('0x25')](handleEntityNotFound(_0x357b3a,null))[_0xee86('0x25')](function(_0x10dd90){if(_0x10dd90){return _0x10dd90[_0xee86('0x53')](_0x5224ad[_0xee86('0x49')][_0xee86('0x54')],_[_0xee86('0x55')](_0x5224ad[_0xee86('0x49')],['ids','id'])||{});}})[_0xee86('0x25')](respondWithResult(_0x357b3a,null))[_0xee86('0x44')](handleError(_0x357b3a,null));};exports[_0xee86('0x56')]=function(_0x8cc3d6,_0x10d09f,_0x324f11){var _0x42372d={};var _0x3d19d4={};var _0x38d0d7;var _0x2c965f;return db[_0xee86('0x2c')][_0xee86('0x57')]({'where':{'id':_0x8cc3d6[_0xee86('0x52')]['id']}})[_0xee86('0x25')](handleEntityNotFound(_0x10d09f,null))[_0xee86('0x25')](function(_0x2518b4){if(_0x2518b4){_0x38d0d7=_0x2518b4;_0x3d19d4[_0xee86('0x31')]=_['keys'](db[_0xee86('0x51')]['rawAttributes']);_0x3d19d4[_0xee86('0x2f')]=_['keys'](_0x8cc3d6['query']);_0x3d19d4['filters']=_['intersection'](_0x3d19d4[_0xee86('0x31')],_0x3d19d4[_0xee86('0x2f')]);_0x42372d['attributes']=_[_0xee86('0x30')](_0x3d19d4[_0xee86('0x31')],qs[_0xee86('0x33')](_0x8cc3d6[_0xee86('0x2f')][_0xee86('0x33')]));_0x42372d[_0xee86('0x32')]=_0x42372d['attributes'][_0xee86('0x34')]?_0x42372d['attributes']:_0x3d19d4['model'];_0x42372d[_0xee86('0x37')]=qs[_0xee86('0x38')](_0x8cc3d6[_0xee86('0x2f')][_0xee86('0x38')]);_0x42372d[_0xee86('0x39')]=qs[_0xee86('0x3a')](_['pick'](_0x8cc3d6[_0xee86('0x2f')],_0x3d19d4[_0xee86('0x3a')]));if(_0x8cc3d6[_0xee86('0x2f')][_0xee86('0x3c')]){_0x42372d['where']=_[_0xee86('0x3d')](_0x42372d['where'],{'$or':_[_0xee86('0x3e')](_0x42372d[_0xee86('0x32')],function(_0x4d5253){var _0x2ccf90={};_0x2ccf90[_0x4d5253]={'$like':'%'+_0x8cc3d6['query'][_0xee86('0x3c')]+'%'};return _0x2ccf90;})});}_0x42372d=_[_0xee86('0x3d')]({},_0x42372d,_0x8cc3d6[_0xee86('0x3f')]);return _0x38d0d7[_0xee86('0x56')](_0x42372d);}})[_0xee86('0x25')](function(_0x53cfb5){if(_0x53cfb5){_0x2c965f=_0x53cfb5[_0xee86('0x34')];if(!_0x8cc3d6[_0xee86('0x2f')][_0xee86('0x35')](_0xee86('0x36'))){_0x42372d['limit']=qs['limit'](_0x8cc3d6[_0xee86('0x2f')][_0xee86('0x1e')]);_0x42372d[_0xee86('0x20')]=qs[_0xee86('0x20')](_0x8cc3d6[_0xee86('0x2f')][_0xee86('0x20')]);}return _0x38d0d7['getContacts'](_0x42372d);}})['then'](function(_0x555ace){if(_0x555ace){return _0x555ace?{'count':_0x2c965f,'rows':_0x555ace}:null;}})[_0xee86('0x25')](respondWithResult(_0x10d09f,null))[_0xee86('0x44')](handleError(_0x10d09f,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 7b16c4e..5c21d03 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 _0xd55f=['cm_companies','lodash','../../config/logger','request-promise','path','../../config/environment','exports','define','CmCompany'];(function(_0x134c95,_0x49ed19){var _0x5ac841=function(_0x442161){while(--_0x442161){_0x134c95['push'](_0x134c95['shift']());}};_0x5ac841(++_0x49ed19);}(_0xd55f,0xac));var _0xfd55=function(_0x8ae658,_0x2e66d6){_0x8ae658=_0x8ae658-0x0;var _0x55a7d9=_0xd55f[_0x8ae658];return _0x55a7d9;};'use strict';var _=require(_0xfd55('0x0'));var util=require('util');var logger=require(_0xfd55('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfd55('0x2'));var fs=require('fs');var path=require(_0xfd55('0x3'));var rimraf=require('rimraf');var config=require(_0xfd55('0x4'));var attributes=require('./cmCompany.attributes');module[_0xfd55('0x5')]=function(_0x5832a9,_0xf4f36f){return _0x5832a9[_0xfd55('0x6')](_0xfd55('0x7'),attributes,{'tableName':_0xfd55('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0715=['rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x41957,_0x377c7e){var _0x601b77=function(_0x471ace){while(--_0x471ace){_0x41957['push'](_0x41957['shift']());}};_0x601b77(++_0x377c7e);}(_0x0715,0x1b6));var _0x5071=function(_0x28df1c,_0x1ea072){_0x28df1c=_0x28df1c-0x0;var _0x395808=_0x0715[_0x28df1c];return _0x395808;};'use strict';var _=require(_0x5071('0x0'));var util=require(_0x5071('0x1'));var logger=require(_0x5071('0x2'))(_0x5071('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5071('0x4'));var fs=require('fs');var path=require(_0x5071('0x5'));var rimraf=require(_0x5071('0x6'));var config=require(_0x5071('0x7'));var attributes=require(_0x5071('0x8'));module[_0x5071('0x9')]=function(_0x2b0b52,_0x1ce660){return _0x2b0b52[_0x5071('0xa')](_0x5071('0xb'),attributes,{'tableName':'cm_companies','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 b85d7a1..84704a6 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 _0xd83b=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x17c487,_0x2b72f1){var _0x3feeb8=function(_0x49aaa1){while(--_0x49aaa1){_0x17c487['push'](_0x17c487['shift']());}};_0x3feeb8(++_0x2b72f1);}(_0xd83b,0x10f));var _0xbd83=function(_0x4bb496,_0x305ebc){_0x4bb496=_0x4bb496-0x0;var _0x3b8d1d=_0xd83b[_0x4bb496];return _0x3b8d1d;};'use strict';var _=require(_0xbd83('0x0'));var util=require(_0xbd83('0x1'));var moment=require(_0xbd83('0x2'));var BPromise=require(_0xbd83('0x3'));var rs=require(_0xbd83('0x4'));var fs=require('fs');var Redis=require(_0xbd83('0x5'));var db=require(_0xbd83('0x6'))['db'];var utils=require(_0xbd83('0x7'));var logger=require(_0xbd83('0x8'))(_0xbd83('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbd83('0xa')][_0xbd83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19a7f3,_0x248539,_0xd9b549){return new BPromise(function(_0x474124,_0x4d7e98){return client[_0xbd83('0xc')](_0x19a7f3,_0xd9b549)[_0xbd83('0xd')](function(_0x68155){logger[_0xbd83('0xe')](_0xbd83('0xf'),_0x248539,'request\x20sent');logger['debug'](_0xbd83('0x10'),_0x248539,_0xbd83('0x11'),JSON[_0xbd83('0x12')](_0x68155));if(_0x68155[_0xbd83('0x13')]){if(_0x68155[_0xbd83('0x13')][_0xbd83('0x14')]===0x1f4){logger[_0xbd83('0x13')](_0xbd83('0xf'),_0x248539,_0x68155[_0xbd83('0x13')]['message']);return _0x4d7e98(_0x68155[_0xbd83('0x13')][_0xbd83('0x15')]);}logger[_0xbd83('0x13')]('CmCompany,\x20%s,\x20%s',_0x248539,_0x68155['error']['message']);return _0x474124(_0x68155[_0xbd83('0x13')][_0xbd83('0x15')]);}else{logger[_0xbd83('0xe')]('CmCompany,\x20%s,\x20%s',_0x248539,'request\x20sent');_0x474124(_0x68155[_0xbd83('0x16')][_0xbd83('0x15')]);}})[_0xbd83('0x17')](function(_0x1406ea){logger[_0xbd83('0x13')]('CmCompany,\x20%s,\x20%s',_0x248539,_0x1406ea);_0x4d7e98(_0x1406ea);});});}
\ No newline at end of file
+var _0xd5dc=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5eb4b1,_0x45843c){var _0x50dfbc=function(_0x24b001){while(--_0x24b001){_0x5eb4b1['push'](_0x5eb4b1['shift']());}};_0x50dfbc(++_0x45843c);}(_0xd5dc,0xfb));var _0xcd5d=function(_0x195c0b,_0x28fdc0){_0x195c0b=_0x195c0b-0x0;var _0x2b0ec2=_0xd5dc[_0x195c0b];return _0x2b0ec2;};'use strict';var _=require('lodash');var util=require(_0xcd5d('0x0'));var moment=require('moment');var BPromise=require(_0xcd5d('0x1'));var rs=require(_0xcd5d('0x2'));var fs=require('fs');var Redis=require(_0xcd5d('0x3'));var db=require(_0xcd5d('0x4'))['db'];var utils=require(_0xcd5d('0x5'));var logger=require(_0xcd5d('0x6'))('rpc');var config=require(_0xcd5d('0x7'));var jayson=require(_0xcd5d('0x8'));var client=jayson[_0xcd5d('0x9')][_0xcd5d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe6cc19,_0x1104a4,_0x3310ee){return new BPromise(function(_0x4a375a,_0x33cedc){return client[_0xcd5d('0xb')](_0xe6cc19,_0x3310ee)[_0xcd5d('0xc')](function(_0x3b1fd0){logger[_0xcd5d('0xd')](_0xcd5d('0xe'),_0x1104a4,_0xcd5d('0xf'));logger[_0xcd5d('0x10')](_0xcd5d('0x11'),_0x1104a4,'request\x20sent',JSON[_0xcd5d('0x12')](_0x3b1fd0));if(_0x3b1fd0[_0xcd5d('0x13')]){if(_0x3b1fd0[_0xcd5d('0x13')][_0xcd5d('0x14')]===0x1f4){logger[_0xcd5d('0x13')](_0xcd5d('0xe'),_0x1104a4,_0x3b1fd0[_0xcd5d('0x13')]['message']);return _0x33cedc(_0x3b1fd0['error']['message']);}logger[_0xcd5d('0x13')](_0xcd5d('0xe'),_0x1104a4,_0x3b1fd0[_0xcd5d('0x13')][_0xcd5d('0x15')]);return _0x4a375a(_0x3b1fd0[_0xcd5d('0x13')][_0xcd5d('0x15')]);}else{logger['info'](_0xcd5d('0xe'),_0x1104a4,'request\x20sent');_0x4a375a(_0x3b1fd0['result'][_0xcd5d('0x15')]);}})['catch'](function(_0x4ec2a0){logger[_0xcd5d('0x13')]('CmCompany,\x20%s,\x20%s',_0x1104a4,_0x4ec2a0);_0x33cedc(_0x4ec2a0);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 6840f69..892ec5f 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 _0x1d67=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','delete','exports','path','connect-timeout','express'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x1d67,0x129));var _0x71d6=function(_0x74fe94,_0x416c62){_0x74fe94=_0x74fe94-0x0;var _0x33ffda=_0x1d67[_0x74fe94];return _0x33ffda;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x71d6('0x0'));var timeout=require(_0x71d6('0x1'));var express=require(_0x71d6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x71d6('0x3'));var interaction=require(_0x71d6('0x4'));var config=require(_0x71d6('0x5'));var controller=require(_0x71d6('0x6'));router[_0x71d6('0x7')]('/',auth['isAuthenticated'](),controller[_0x71d6('0x8')]);router[_0x71d6('0x7')](_0x71d6('0x9'),auth[_0x71d6('0xa')](),controller[_0x71d6('0xb')]);router[_0x71d6('0x7')](_0x71d6('0xc'),auth[_0x71d6('0xa')](),controller[_0x71d6('0xd')]);router[_0x71d6('0x7')](_0x71d6('0xe'),auth[_0x71d6('0xa')](),controller[_0x71d6('0xf')]);router[_0x71d6('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x71d6('0x10')]('/:id/contacts',auth[_0x71d6('0xa')](),controller[_0x71d6('0x11')]);router['put'](_0x71d6('0xc'),auth[_0x71d6('0xa')](),controller['update']);router[_0x71d6('0x12')](_0x71d6('0xc'),auth[_0x71d6('0xa')](),controller['destroy']);module[_0x71d6('0x13')]=router;
\ No newline at end of file
+var _0x3f29=['get','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated'];(function(_0x521750,_0x29c01f){var _0x36f17c=function(_0x219574){while(--_0x219574){_0x521750['push'](_0x521750['shift']());}};_0x36f17c(++_0x29c01f);}(_0x3f29,0x19b));var _0x93f2=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x3f29[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x93f2('0x0'));var util=require(_0x93f2('0x1'));var path=require(_0x93f2('0x2'));var timeout=require(_0x93f2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x93f2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x93f2('0x5'));var config=require(_0x93f2('0x6'));var controller=require(_0x93f2('0x7'));router['get']('/',auth[_0x93f2('0x8')](),controller['index']);router[_0x93f2('0x9')](_0x93f2('0xa'),auth[_0x93f2('0x8')](),controller[_0x93f2('0xb')]);router[_0x93f2('0x9')](_0x93f2('0xc'),auth[_0x93f2('0x8')](),controller[_0x93f2('0xd')]);router[_0x93f2('0x9')](_0x93f2('0xe'),auth[_0x93f2('0x8')](),controller[_0x93f2('0xf')]);router[_0x93f2('0x10')]('/',auth[_0x93f2('0x8')](),controller[_0x93f2('0x11')]);router[_0x93f2('0x10')]('/:id/contacts',auth[_0x93f2('0x8')](),controller[_0x93f2('0x12')]);router['put'](_0x93f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x93f2('0x13')](_0x93f2('0xc'),auth[_0x93f2('0x8')](),controller[_0x93f2('0x14')]);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 df0c486..282be30 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 _0xd32b=['NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x2673c1,_0x489c00){var _0x46bde=function(_0x3c7b08){while(--_0x3c7b08){_0x2673c1['push'](_0x2673c1['shift']());}};_0x46bde(++_0x489c00);}(_0xd32b,0x109));var _0xbd32=function(_0x1b4eaa,_0x5d7c98){_0x1b4eaa=_0x1b4eaa-0x0;var _0xe684b9=_0xd32b[_0x1b4eaa];return _0xe684b9;};'use strict';var _=require(_0xbd32('0x0'));var Sequelize=require('sequelize');module[_0xbd32('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xbd32('0x2')]},'street':{'type':Sequelize[_0xbd32('0x2')]},'postalCode':{'type':Sequelize[_0xbd32('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xbd32('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbd32('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbd32('0x2')]},'email':{'type':Sequelize[_0xbd32('0x2')]},'url':{'type':Sequelize[_0xbd32('0x2')]},'facebook':{'type':Sequelize[_0xbd32('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xbd32('0x2')]},'teams':{'type':Sequelize[_0xbd32('0x2')]},'viber':{'type':Sequelize[_0xbd32('0x2')]},'line':{'type':Sequelize[_0xbd32('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xbd32('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xbd32('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xbd32('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xbd32('0x6')],'defaultValue':Sequelize[_0xbd32('0x7')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xbd32('0x4')]}};
\ No newline at end of file
+var _0x95cc=['lodash','sequelize','exports','STRING','INTEGER','UNSIGNED','NOW'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0x95cc,0x12d));var _0xc95c=function(_0x52d637,_0x4f76ce){_0x52d637=_0x52d637-0x0;var _0x2de925=_0x95cc[_0x52d637];return _0x2de925;};'use strict';var _=require(_0xc95c('0x0'));var Sequelize=require(_0xc95c('0x1'));module[_0xc95c('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xc95c('0x3')]},'street':{'type':Sequelize[_0xc95c('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc95c('0x3')]},'country':{'type':Sequelize[_0xc95c('0x3')]},'dateOfBirth':{'type':Sequelize[_0xc95c('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xc95c('0x3')]},'mobile':{'type':Sequelize[_0xc95c('0x3')]},'fax':{'type':Sequelize[_0xc95c('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xc95c('0x3')]},'fb_data':{'type':Sequelize[_0xc95c('0x3')]},'twitter':{'type':Sequelize[_0xc95c('0x3')]},'skype':{'type':Sequelize[_0xc95c('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xc95c('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xc95c('0x3')]},'UserId':{'type':Sequelize[_0xc95c('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xc95c('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xc95c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xc95c('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xc95c('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 08ae1cc..cdfc773 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(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Title','Data','generateXOAuth2Token','auth=Bearer\x20','toString','lodash','moment','randomstring','util','../../../config/logger','email','../../../config/environment'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xbf6f,0x157));var _0xfbf6=function(_0x5c52e6,_0x2a98fa){_0x5c52e6=_0x5c52e6-0x0;var _0x48c5ef=_0xbf6f[_0x5c52e6];return _0x48c5ef;};'use strict';var _=require(_0xfbf6('0x0'));var moment=require(_0xfbf6('0x1'));var random=require(_0xfbf6('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xfbf6('0x3'));var tnef=require('node-tnef');var logger=require(_0xfbf6('0x4'))(_0xfbf6('0x5'));var config=require(_0xfbf6('0x6'));function getAddress(_0x3f6fc3){var _0x41053d=_[_0xfbf6('0x7')](_0x3f6fc3[_0xfbf6('0x8')]);return _0x41053d&&_0x41053d[_0xfbf6('0x9')]?_0x41053d[_0xfbf6('0x9')]:_0xfbf6('0xa')+random[_0xfbf6('0xb')](0x6)+_0xfbf6('0xc');}function getFirstName(_0x1c97d1){var _0x4cfae1=_[_0xfbf6('0x7')](_0x1c97d1[_0xfbf6('0x8')]);if(_0x4cfae1&&_0x4cfae1['name']){if(_0x4cfae1[_0xfbf6('0xd')]==_0x4cfae1[_0xfbf6('0x9')]){return _0x4cfae1['name'][_0xfbf6('0xe')](0x0,_0x4cfae1['name']['indexOf']('@'));}var _0x4db9b3=_0x4cfae1[_0xfbf6('0xd')][_0xfbf6('0xf')](/\s+/);return _0x4db9b3[_0xfbf6('0x10')]>0x1?_0x4db9b3[_0xfbf6('0x11')](0x0,-0x1)[_0xfbf6('0x12')]('\x20'):_0x4cfae1[_0xfbf6('0xd')];}return _0xfbf6('0x13');}function getLastName(_0x16d13e){var _0x454553=_[_0xfbf6('0x7')](_0x16d13e[_0xfbf6('0x8')]);if(_0x454553&&_0x454553[_0xfbf6('0xd')]){var _0x1ebfeb=_0x454553['name']['split'](/\s+/);return _0x1ebfeb['length']>0x1?_0x1ebfeb[_0xfbf6('0x14')]():'';}return'';}function getMails(_0x128ce0,_0x94393a){var _0x2bbdf4='';for(var _0x45aed8=0x0;_0x45aed8<_0x94393a[_0xfbf6('0x8')][_0xfbf6('0x10')];_0x45aed8+=0x1){if(_0x94393a[_0xfbf6('0x8')][_0x45aed8]['address']!==_0x128ce0){if(!_['isEmpty'](_0x2bbdf4)){_0x2bbdf4+=',';}_0x2bbdf4+=_0x94393a[_0xfbf6('0x8')][_0x45aed8][_0xfbf6('0xd')]||_0x94393a[_0xfbf6('0x8')][_0x45aed8][_0xfbf6('0x9')]||'';_0x2bbdf4+='\x20<';_0x2bbdf4+=_0x94393a[_0xfbf6('0x8')][_0x45aed8][_0xfbf6('0x9')]?_0x94393a['value'][_0x45aed8][_0xfbf6('0x9')]:_0xfbf6('0xa')+random[_0xfbf6('0xb')](0x6)+_0xfbf6('0xc');_0x2bbdf4+='>';}}return _0x2bbdf4;}function parseEmail(_0x4ebd4c,_0x52414e,_0x4a4374){if(_0x52414e[_0xfbf6('0x15')]){var _0x581789=/