From: support
Date: Tue, 5 Apr 2022 12:35:46 +0000 (+0000)
Subject: Built motion from commit b1bdb64d.|2.6.7
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22https:/fonts.googleapis.com/icon?a=commitdiff_plain;h=3df28cc7f420bb5b873dae4e7cd23520063f33a6;p=motion2.git
Built motion from commit b1bdb64d.|2.6.7
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 85e100c..32495ec 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-04-05T12:11:46.613Z",
+ "time": "2022-04-05T12:27:55.732Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index f430c60..f403d28 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-04-05T12:11:46.613Z",
+ "time": "2022-04-05T12:27:55.732Z",
"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 8e35492..9dd332a 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 _0xd60d=['urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','action','STRING','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x39696e,_0x1eda1e){var _0x4211ce=function(_0x558455){while(--_0x558455){_0x39696e['push'](_0x39696e['shift']());}};_0x4211ce(++_0x1eda1e);}(_0xd60d,0xff));var _0xdd60=function(_0x4ae56a,_0x20d5d8){_0x4ae56a=_0x4ae56a-0x0;var _0x297744=_0xd60d[_0x4ae56a];return _0x297744;};'use strict';var Sequelize=require(_0xdd60('0x0'));module[_0xdd60('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xb194be){return this['getDataValue'](_0xdd60('0x2'));}},'action':{'type':Sequelize[_0xdd60('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xdd60('0x4'),_0xdd60('0x5'),_0xdd60('0x6'),'jscripty',_0xdd60('0x7'),_0xdd60('0x8'),_0xdd60('0x9'),_0xdd60('0xa')]],'msg':_0xdd60('0xb')}},'comment':_0xdd60('0xb')},'data1':{'type':Sequelize[_0xdd60('0x3')](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[_0xdd60('0x3')](0x1000),'comment':_0xdd60('0xc')},'data3':{'type':Sequelize[_0xdd60('0x3')](0x1000),'comment':_0xdd60('0xd')},'data4':{'type':Sequelize[_0xdd60('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xdd60('0x3')](0x1000),'comments':_0xdd60('0xe')},'data6':{'type':Sequelize[_0xdd60('0x3')],'comments':_0xdd60('0xf')},'data7':{'type':Sequelize[_0xdd60('0x10')],'comments':_0xdd60('0x11')}};
\ No newline at end of file
+var _0x1eb1=['contactManager','integration','urlForward','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','action'];(function(_0x4e0894,_0x15c499){var _0x301041=function(_0x3cfaec){while(--_0x3cfaec){_0x4e0894['push'](_0x4e0894['shift']());}};_0x301041(++_0x15c499);}(_0x1eb1,0xa2));var _0x11eb=function(_0x290fa4,_0x18dbf1){_0x290fa4=_0x290fa4-0x0;var _0x8f4532=_0x1eb1[_0x290fa4];return _0x8f4532;};'use strict';var Sequelize=require(_0x11eb('0x0'));module[_0x11eb('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4eba6a){return this['getDataValue'](_0x11eb('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x11eb('0x3'),_0x11eb('0x4'),'motionbar','jscripty',_0x11eb('0x5'),'browser','bot',_0x11eb('0x6')]],'msg':_0x11eb('0x7')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x11eb('0x8')](0x1000),'comment':_0x11eb('0x9')},'data2':{'type':Sequelize[_0x11eb('0x8')](0x1000),'comment':_0x11eb('0xa')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x11eb('0xb')},'data4':{'type':Sequelize[_0x11eb('0x8')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x11eb('0x8')](0x1000),'comments':_0x11eb('0xc')},'data6':{'type':Sequelize[_0x11eb('0x8')],'comments':_0x11eb('0xd')},'data7':{'type':Sequelize[_0x11eb('0xe')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 942e3bf..ea4a939 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 _0x0240=['then','error','stack','name','params','Action','catch','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','reject','update'];(function(_0x1b7d3e,_0xa4cadf){var _0xe9147f=function(_0x4a5dad){while(--_0x4a5dad){_0x1b7d3e['push'](_0x1b7d3e['shift']());}};_0xe9147f(++_0xa4cadf);}(_0x0240,0x15d));var _0x0024=function(_0x44fc70,_0x1c92d4){_0x44fc70=_0x44fc70-0x0;var _0x4db768=_0x0240[_0x44fc70];return _0x4db768;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0024('0x0'));var zipdir=require(_0x0024('0x1'));var jsonpatch=require(_0x0024('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0024('0x3'));var Mustache=require(_0x0024('0x4'));var util=require('util');var path=require(_0x0024('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0024('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0024('0x7'));var squel=require(_0x0024('0x8'));var crypto=require(_0x0024('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0024('0xa'));var toCsv=require(_0x0024('0xb'));var querystring=require(_0x0024('0xc'));var Papa=require(_0x0024('0xd'));var Redis=require('ioredis');var authService=require(_0x0024('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0024('0xf'));var logger=require(_0x0024('0x10'))(_0x0024('0x11'));var utils=require(_0x0024('0x12'));var config=require(_0x0024('0x13'));var licenseUtil=require(_0x0024('0x14'));var db=require(_0x0024('0x15'))['db'];function respondWithStatusCode(_0x316b2e,_0x3dd798){_0x3dd798=_0x3dd798||0xcc;return function(_0x25703b){if(_0x25703b){return _0x316b2e[_0x0024('0x16')](_0x3dd798);}return _0x316b2e[_0x0024('0x17')](_0x3dd798)[_0x0024('0x18')]();};}function respondWithResult(_0x506416,_0x56896b){_0x56896b=_0x56896b||0xc8;return function(_0x1c80c2){if(_0x1c80c2){return _0x506416[_0x0024('0x17')](_0x56896b)['json'](_0x1c80c2);}};}function respondWithFilteredResult(_0x2d2d83,_0x1ef791){return function(_0x42a701){if(_0x42a701){var _0x1f78f9=typeof _0x1ef791[_0x0024('0x19')]===_0x0024('0x1a')&&typeof _0x1ef791['limit']===_0x0024('0x1a');var _0x27b91f=_0x42a701['count'];var _0x29f96f=_0x1f78f9?0x0:_0x1ef791[_0x0024('0x19')];var _0x306ea0=_0x1f78f9?_0x42a701[_0x0024('0x1b')]:_0x1ef791[_0x0024('0x19')]+_0x1ef791['limit'];var _0x416787;if(_0x306ea0>=_0x27b91f){_0x306ea0=_0x27b91f;_0x416787=0xc8;}else{_0x416787=0xce;}_0x2d2d83[_0x0024('0x17')](_0x416787);return _0x2d2d83[_0x0024('0x1c')]('Content-Range',_0x29f96f+'-'+_0x306ea0+'/'+_0x27b91f)['json'](_0x42a701);}return null;};}function patchUpdates(_0x37774a){return function(_0x58c2bd){try{jsonpatch['apply'](_0x58c2bd,_0x37774a,!![]);}catch(_0x5cbecc){return BPromise[_0x0024('0x1d')](_0x5cbecc);}return _0x58c2bd['save']();};}function saveUpdates(_0x5caf28,_0xef560b){return function(_0x258a04){if(_0x258a04){return _0x258a04[_0x0024('0x1e')](_0x5caf28)[_0x0024('0x1f')](function(_0x17bb2e){return _0x17bb2e;});}return null;};}function removeEntity(_0x3ab728,_0xd64d90){return function(_0x4dee1d){if(_0x4dee1d){return _0x4dee1d['destroy']()['then'](function(){_0x3ab728[_0x0024('0x17')](0xcc)[_0x0024('0x18')]();});}};}function handleEntityNotFound(_0x56ce93,_0x5c627f){return function(_0x36a3a1){if(!_0x36a3a1){_0x56ce93[_0x0024('0x16')](0x194);}return _0x36a3a1;};}function handleError(_0x267ffa,_0x124e56){_0x124e56=_0x124e56||0x1f4;return function(_0x578845){logger[_0x0024('0x20')](_0x578845[_0x0024('0x21')]);if(_0x578845['name']){delete _0x578845[_0x0024('0x22')];}_0x267ffa['status'](_0x124e56)['send'](_0x578845);};}exports[_0x0024('0x1e')]=function(_0xceeb93,_0x853abf){if(_0xceeb93['body']['id']){delete _0xceeb93['body']['id'];}return db['Action']['find']({'where':{'id':_0xceeb93[_0x0024('0x23')]['id']}})[_0x0024('0x1f')](handleEntityNotFound(_0x853abf,null))['then'](saveUpdates(_0xceeb93['body'],null))[_0x0024('0x1f')](respondWithResult(_0x853abf,null))['catch'](handleError(_0x853abf,null));};exports['destroy']=function(_0x1daae6,_0x447b53){return db[_0x0024('0x24')]['find']({'where':{'id':_0x1daae6[_0x0024('0x23')]['id']}})[_0x0024('0x1f')](handleEntityNotFound(_0x447b53,null))['then'](removeEntity(_0x447b53,null))[_0x0024('0x25')](handleError(_0x447b53,null));};
\ No newline at end of file
+var _0x453c=['../../mysqldb','sendStatus','status','json','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','body','Action','find','params','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x389949,_0x7d88aa){var _0x476e19=function(_0x2a733f){while(--_0x2a733f){_0x389949['push'](_0x389949['shift']());}};_0x476e19(++_0x7d88aa);}(_0x453c,0x1b9));var _0xc453=function(_0x1064bc,_0x206f12){_0x1064bc=_0x1064bc-0x0;var _0x5edc45=_0x453c[_0x1064bc];return _0x5edc45;};'use strict';var emlformat=require(_0xc453('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc453('0x1'));var jsonpatch=require(_0xc453('0x2'));var rp=require('request-promise');var moment=require(_0xc453('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc453('0x4'));var util=require('util');var path=require(_0xc453('0x5'));var sox=require('sox');var csv=require(_0xc453('0x6'));var ejs=require(_0xc453('0x7'));var fs=require('fs');var fs_extra=require(_0xc453('0x8'));var _=require('lodash');var squel=require(_0xc453('0x9'));var crypto=require(_0xc453('0xa'));var jsforce=require(_0xc453('0xb'));var deskjs=require(_0xc453('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc453('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc453('0xe'));var as=require(_0xc453('0xf'));var hardwareService=require(_0xc453('0x10'));var logger=require(_0xc453('0x11'))(_0xc453('0x12'));var utils=require(_0xc453('0x13'));var config=require(_0xc453('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc453('0x15'))['db'];function respondWithStatusCode(_0x34e888,_0x59ca68){_0x59ca68=_0x59ca68||0xcc;return function(_0x189482){if(_0x189482){return _0x34e888[_0xc453('0x16')](_0x59ca68);}return _0x34e888[_0xc453('0x17')](_0x59ca68)['end']();};}function respondWithResult(_0x211eb8,_0x322681){_0x322681=_0x322681||0xc8;return function(_0x5c6605){if(_0x5c6605){return _0x211eb8[_0xc453('0x17')](_0x322681)[_0xc453('0x18')](_0x5c6605);}};}function respondWithFilteredResult(_0x286666,_0xedecb4){return function(_0x2c7b47){if(_0x2c7b47){var _0x54bfb0=typeof _0xedecb4['offset']===_0xc453('0x19')&&typeof _0xedecb4['limit']===_0xc453('0x19');var _0x52dc32=_0x2c7b47[_0xc453('0x1a')];var _0x217b05=_0x54bfb0?0x0:_0xedecb4['offset'];var _0x40245b=_0x54bfb0?_0x2c7b47['count']:_0xedecb4['offset']+_0xedecb4['limit'];var _0xa8372f;if(_0x40245b>=_0x52dc32){_0x40245b=_0x52dc32;_0xa8372f=0xc8;}else{_0xa8372f=0xce;}_0x286666[_0xc453('0x17')](_0xa8372f);return _0x286666[_0xc453('0x1b')](_0xc453('0x1c'),_0x217b05+'-'+_0x40245b+'/'+_0x52dc32)[_0xc453('0x18')](_0x2c7b47);}return null;};}function patchUpdates(_0x1c986c){return function(_0x22ade8){try{jsonpatch['apply'](_0x22ade8,_0x1c986c,!![]);}catch(_0xad7dad){return BPromise[_0xc453('0x1d')](_0xad7dad);}return _0x22ade8[_0xc453('0x1e')]();};}function saveUpdates(_0x14a59f,_0x429ef6){return function(_0x334554){if(_0x334554){return _0x334554[_0xc453('0x1f')](_0x14a59f)[_0xc453('0x20')](function(_0x4fcd88){return _0x4fcd88;});}return null;};}function removeEntity(_0x1bdb76,_0x2988e5){return function(_0x29ee72){if(_0x29ee72){return _0x29ee72[_0xc453('0x21')]()[_0xc453('0x20')](function(){_0x1bdb76[_0xc453('0x17')](0xcc)[_0xc453('0x22')]();});}};}function handleEntityNotFound(_0x3b3886,_0x2db12d){return function(_0x22f6d3){if(!_0x22f6d3){_0x3b3886[_0xc453('0x16')](0x194);}return _0x22f6d3;};}function handleError(_0x57f527,_0xfbf6c5){_0xfbf6c5=_0xfbf6c5||0x1f4;return function(_0x1a823d){logger[_0xc453('0x23')](_0x1a823d['stack']);if(_0x1a823d[_0xc453('0x24')]){delete _0x1a823d['name'];}_0x57f527[_0xc453('0x17')](_0xfbf6c5)[_0xc453('0x25')](_0x1a823d);};}exports[_0xc453('0x1f')]=function(_0x1e132c,_0x522aa0){if(_0x1e132c[_0xc453('0x26')]['id']){delete _0x1e132c['body']['id'];}return db[_0xc453('0x27')][_0xc453('0x28')]({'where':{'id':_0x1e132c['params']['id']}})[_0xc453('0x20')](handleEntityNotFound(_0x522aa0,null))['then'](saveUpdates(_0x1e132c['body'],null))[_0xc453('0x20')](respondWithResult(_0x522aa0,null))['catch'](handleError(_0x522aa0,null));};exports[_0xc453('0x21')]=function(_0x351763,_0x246c20){return db['Action'][_0xc453('0x28')]({'where':{'id':_0x351763[_0xc453('0x29')]['id']}})[_0xc453('0x20')](handleEntityNotFound(_0x246c20,null))[_0xc453('0x20')](removeEntity(_0x246c20,null))['catch'](handleError(_0x246c20,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 09e4a45..93bda66 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 _0x2315=['exports','define','tools_actions','lodash','../../config/logger','moment','request-promise','path','rimraf','./action.attributes'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x2315,0xfd));var _0x5231=function(_0x23808c,_0x3b032b){_0x23808c=_0x23808c-0x0;var _0x39d835=_0x2315[_0x23808c];return _0x39d835;};'use strict';var _=require(_0x5231('0x0'));var util=require('util');var logger=require(_0x5231('0x1'))('api');var moment=require(_0x5231('0x2'));var BPromise=require('bluebird');var rp=require(_0x5231('0x3'));var fs=require('fs');var path=require(_0x5231('0x4'));var rimraf=require(_0x5231('0x5'));var config=require('../../config/environment');var attributes=require(_0x5231('0x6'));module[_0x5231('0x7')]=function(_0x5b3e33,_0x50141c){return _0x5b3e33[_0x5231('0x8')]('Action',attributes,{'tableName':_0x5231('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x98f1=['Action','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define'];(function(_0x1a79c6,_0x5bad0b){var _0x301647=function(_0x9d3817){while(--_0x9d3817){_0x1a79c6['push'](_0x1a79c6['shift']());}};_0x301647(++_0x5bad0b);}(_0x98f1,0x1cf));var _0x198f=function(_0x4d51cb,_0x12df1b){_0x4d51cb=_0x4d51cb-0x0;var _0x7a9f54=_0x98f1[_0x4d51cb];return _0x7a9f54;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x198f('0x0'))(_0x198f('0x1'));var moment=require(_0x198f('0x2'));var BPromise=require(_0x198f('0x3'));var rp=require(_0x198f('0x4'));var fs=require('fs');var path=require(_0x198f('0x5'));var rimraf=require('rimraf');var config=require(_0x198f('0x6'));var attributes=require(_0x198f('0x7'));module[_0x198f('0x8')]=function(_0x589abf,_0x3b9901){return _0x589abf[_0x198f('0x9')](_0x198f('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 1db898c..9629566 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4f03ad,_0x1921e3){_0x4f03ad=_0x4f03ad-0x0;var _0x26d793=_0x1cb9[_0x4f03ad];return _0x26d793;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
+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(_0x1f76a4,_0x433129){var _0x1f515a=function(_0x3384c3){while(--_0x3384c3){_0x1f76a4['push'](_0x1f76a4['shift']());}};_0x1f515a(++_0x433129);}(_0x5fab,0x177));var _0xb5fa=function(_0x5ff517,_0x3e4ee0){_0x5ff517=_0x5ff517-0x0;var _0x19a245=_0x5fab[_0x5ff517];return _0x19a245;};'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
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 2f42aaf..03d9f7b 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 _0x5e7a=['update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5e7a,0x1e2));var _0xa5e7=function(_0x3e6f1e,_0x305234){_0x3e6f1e=_0x3e6f1e-0x0;var _0x941ad1=_0x5e7a[_0x3e6f1e];return _0x941ad1;};'use strict';var multer=require(_0xa5e7('0x0'));var util=require(_0xa5e7('0x1'));var path=require(_0xa5e7('0x2'));var timeout=require(_0xa5e7('0x3'));var express=require('express');var router=express[_0xa5e7('0x4')]();var fs_extra=require(_0xa5e7('0x5'));var auth=require(_0xa5e7('0x6'));var interaction=require(_0xa5e7('0x7'));var config=require(_0xa5e7('0x8'));var controller=require(_0xa5e7('0x9'));router[_0xa5e7('0xa')](_0xa5e7('0xb'),auth[_0xa5e7('0xc')](),controller[_0xa5e7('0xd')]);router[_0xa5e7('0xe')](_0xa5e7('0xb'),auth[_0xa5e7('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3ea3=['../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x46f9ac,_0x5c6930){var _0x1b5742=function(_0x2abf6d){while(--_0x2abf6d){_0x46f9ac['push'](_0x46f9ac['shift']());}};_0x1b5742(++_0x5c6930);}(_0x3ea3,0xf7));var _0x33ea=function(_0x1383ec,_0x188bf4){_0x1383ec=_0x1383ec-0x0;var _0x163548=_0x3ea3[_0x1383ec];return _0x163548;};'use strict';var multer=require(_0x33ea('0x0'));var util=require(_0x33ea('0x1'));var path=require('path');var timeout=require(_0x33ea('0x2'));var express=require(_0x33ea('0x3'));var router=express['Router']();var fs_extra=require(_0x33ea('0x4'));var auth=require(_0x33ea('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x33ea('0x6'));var controller=require(_0x33ea('0x7'));router[_0x33ea('0x8')](_0x33ea('0x9'),auth[_0x33ea('0xa')](),controller['update']);router[_0x33ea('0xb')](_0x33ea('0x9'),auth[_0x33ea('0xa')](),controller[_0x33ea('0xc')]);module[_0x33ea('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 819f8f5..9c50164 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7c09=['exports','STRING','TEXT'];(function(_0x1d3a20,_0x23998e){var _0x535677=function(_0x46c21e){while(--_0x46c21e){_0x1d3a20['push'](_0x1d3a20['shift']());}};_0x535677(++_0x23998e);}(_0x7c09,0x102));var _0x97c0=function(_0x3d0096,_0x5f3cd3){_0x3d0096=_0x3d0096-0x0;var _0xa620c7=_0x7c09[_0x3d0096];return _0xa620c7;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}};
\ No newline at end of file
+var _0x8958=['TEXT','exports'];(function(_0xfb9aaa,_0x37935d){var _0x103bf7=function(_0x1e9f2a){while(--_0x1e9f2a){_0xfb9aaa['push'](_0xfb9aaa['shift']());}};_0x103bf7(++_0x37935d);}(_0x8958,0x93));var _0x8895=function(_0x3f1f59,_0x5ebceb){_0x3f1f59=_0x3f1f59-0x0;var _0xd0a450=_0x8958[_0x3f1f59];return _0xd0a450;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index dc149b8..ed64be0 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 _0x70b7=['child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','runReport','operator','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','get','CustomReports','UserProfileResource','end','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','field','function','replace','format','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','MAX(%s)','ROUND(%s)','getFields','ValidationErrorItem','from','MetricId','metric','groupBy','%s.%s\x20=\x20%s.%s','output','web','%s-%s.%s','randomstring','custom','cdr','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:'];(function(_0x429e26,_0x573537){var _0x48268e=function(_0x26553e){while(--_0x26553e){_0x429e26['push'](_0x429e26['shift']());}};_0x48268e(++_0x573537);}(_0x70b7,0x1e9));var _0x770b=function(_0x5e4b85,_0x6cf965){_0x5e4b85=_0x5e4b85-0x0;var _0x5cd3cb=_0x70b7[_0x5e4b85];return _0x5cd3cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x770b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x770b('0x1'));var rp=require(_0x770b('0x2'));var moment=require(_0x770b('0x3'));var BPromise=require(_0x770b('0x4'));var Mustache=require(_0x770b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x770b('0x6'));var csv=require(_0x770b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x770b('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x770b('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x770b('0xa'));var toCsv=require(_0x770b('0x7'));var querystring=require(_0x770b('0xb'));var Papa=require(_0x770b('0xc'));var Redis=require(_0x770b('0xd'));var authService=require(_0x770b('0xe'));var qs=require(_0x770b('0xf'));var as=require(_0x770b('0x10'));var hardwareService=require(_0x770b('0x11'));var logger=require(_0x770b('0x12'))(_0x770b('0x13'));var utils=require(_0x770b('0x14'));var config=require(_0x770b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x770b('0x16'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x42c21a,_0x5186f7){_0x5186f7=_0x5186f7||0xcc;return function(_0x45d31d){if(_0x45d31d){return _0x42c21a[_0x770b('0x17')](_0x5186f7);}return _0x42c21a[_0x770b('0x18')](_0x5186f7)['end']();};}function respondWithResult(_0x15baf3,_0x45fcc0){_0x45fcc0=_0x45fcc0||0xc8;return function(_0x558f15){if(_0x558f15){return _0x15baf3[_0x770b('0x18')](_0x45fcc0)['json'](_0x558f15);}};}function respondWithFilteredResult(_0x2eb231,_0x298a70){return function(_0x5929a0){if(_0x5929a0){var _0x6648c3=typeof _0x298a70[_0x770b('0x19')]===_0x770b('0x1a')&&typeof _0x298a70[_0x770b('0x1b')]===_0x770b('0x1a');var _0xd29578=_0x5929a0[_0x770b('0x1c')];var _0xfd54ff=_0x6648c3?0x0:_0x298a70[_0x770b('0x19')];var _0x4a7727=_0x6648c3?_0x5929a0['count']:_0x298a70['offset']+_0x298a70[_0x770b('0x1b')];var _0x135297;if(_0x4a7727>=_0xd29578){_0x4a7727=_0xd29578;_0x135297=0xc8;}else{_0x135297=0xce;}_0x2eb231['status'](_0x135297);return _0x2eb231[_0x770b('0x1d')]('Content-Range',_0xfd54ff+'-'+_0x4a7727+'/'+_0xd29578)[_0x770b('0x1e')](_0x5929a0);}return null;};}function patchUpdates(_0xcda6fe){return function(_0x4bd65c){try{jsonpatch[_0x770b('0x1f')](_0x4bd65c,_0xcda6fe,!![]);}catch(_0x5bf654){return BPromise[_0x770b('0x20')](_0x5bf654);}return _0x4bd65c[_0x770b('0x21')]();};}function saveUpdates(_0x3fa38c,_0x3c9900){return function(_0x5512ef){if(_0x5512ef){return _0x5512ef[_0x770b('0x22')](_0x3fa38c)[_0x770b('0x23')](function(_0x575eb2){return _0x575eb2;});}return null;};}function removeEntity(_0x5f3197,_0x4eafb0){return function(_0x3b72f6){if(_0x3b72f6){return _0x3b72f6['destroy']()['then'](function(){var _0x891193=_0x3b72f6[_0x770b('0x24')]({'plain':!![]});var _0x23be5a=_0x770b('0x25');return db[_0x770b('0x26')]['destroy']({'where':{'type':_0x23be5a,'resourceId':_0x891193['id']}})['then'](function(){return _0x3b72f6;});})['then'](function(){_0x5f3197[_0x770b('0x18')](0xcc)[_0x770b('0x27')]();});}};}function handleEntityNotFound(_0x3e36b8,_0x33ff06){return function(_0x18c393){if(!_0x18c393){_0x3e36b8[_0x770b('0x17')](0x194);}return _0x18c393;};}function handleError(_0x3cc9b9,_0x50ee4c){_0x50ee4c=_0x50ee4c||0x1f4;return function(_0x458ef5){logger[_0x770b('0x28')](_0x458ef5[_0x770b('0x29')]);if(_0x458ef5[_0x770b('0x2a')]){delete _0x458ef5['name'];}_0x3cc9b9['status'](_0x50ee4c)[_0x770b('0x2b')](_0x458ef5);};}exports[_0x770b('0x2c')]=function(_0x13da2e,_0x168089){var _0x38af54={},_0x4d5257={},_0x2af88c={'count':0x0,'rows':[]};var _0x523edb=_[_0x770b('0x2d')](db[_0x770b('0x2e')][_0x770b('0x2f')],function(_0x351540){return{'name':_0x351540[_0x770b('0x30')],'type':_0x351540['type'][_0x770b('0x31')]};});_0x4d5257[_0x770b('0x32')]=_[_0x770b('0x2d')](_0x523edb,_0x770b('0x2a'));_0x4d5257[_0x770b('0x33')]=_[_0x770b('0x34')](_0x13da2e[_0x770b('0x33')]);_0x4d5257[_0x770b('0x35')]=_[_0x770b('0x36')](_0x4d5257[_0x770b('0x32')],_0x4d5257[_0x770b('0x33')]);_0x38af54[_0x770b('0x37')]=_[_0x770b('0x36')](_0x4d5257[_0x770b('0x32')],qs['fields'](_0x13da2e['query'][_0x770b('0x38')]));_0x38af54[_0x770b('0x37')]=_0x38af54['attributes'][_0x770b('0x39')]?_0x38af54[_0x770b('0x37')]:_0x4d5257[_0x770b('0x32')];if(!_0x13da2e[_0x770b('0x33')]['hasOwnProperty'](_0x770b('0x3a'))){_0x38af54[_0x770b('0x1b')]=qs[_0x770b('0x1b')](_0x13da2e[_0x770b('0x33')]['limit']);_0x38af54[_0x770b('0x19')]=qs['offset'](_0x13da2e[_0x770b('0x33')][_0x770b('0x19')]);}_0x38af54[_0x770b('0x3b')]=qs['sort'](_0x13da2e[_0x770b('0x33')][_0x770b('0x3c')]);_0x38af54[_0x770b('0x3d')]=qs[_0x770b('0x35')](_[_0x770b('0x3e')](_0x13da2e['query'],_0x4d5257[_0x770b('0x35')]),_0x523edb);if(_0x13da2e[_0x770b('0x33')][_0x770b('0x3f')]){_0x38af54[_0x770b('0x3d')]=_[_0x770b('0x40')](_0x38af54[_0x770b('0x3d')],{'$or':_[_0x770b('0x2d')](_0x523edb,function(_0x3bf38e){if(_0x3bf38e[_0x770b('0x41')]!==_0x770b('0x42')){var _0x322269={};_0x322269[_0x3bf38e[_0x770b('0x2a')]]={'$like':'%'+_0x13da2e[_0x770b('0x33')]['filter']+'%'};return _0x322269;}})});}_0x38af54=_[_0x770b('0x40')]({},_0x38af54,_0x13da2e[_0x770b('0x43')]);var _0xb94b1a={'where':_0x38af54[_0x770b('0x3d')]};return db[_0x770b('0x2e')][_0x770b('0x1c')](_0xb94b1a)['then'](function(_0x415168){_0x2af88c[_0x770b('0x1c')]=_0x415168;if(_0x13da2e[_0x770b('0x33')][_0x770b('0x44')]){_0x38af54[_0x770b('0x45')]=[{'all':!![]}];}return db[_0x770b('0x2e')][_0x770b('0x46')](_0x38af54);})[_0x770b('0x23')](function(_0x16f853){_0x2af88c['rows']=_0x16f853;return _0x2af88c;})[_0x770b('0x23')](respondWithFilteredResult(_0x168089,_0x38af54))['catch'](handleError(_0x168089,null));};exports[_0x770b('0x47')]=function(_0x4b024d,_0x14f2af){var _0x293d5e={'raw':![],'where':{'id':_0x4b024d[_0x770b('0x48')]['id']}},_0x46952a={};_0x46952a[_0x770b('0x32')]=_['keys'](db['AnalyticCustomReport'][_0x770b('0x2f')]);_0x46952a[_0x770b('0x33')]=_[_0x770b('0x34')](_0x4b024d[_0x770b('0x33')]);_0x46952a[_0x770b('0x35')]=_[_0x770b('0x36')](_0x46952a[_0x770b('0x32')],_0x46952a[_0x770b('0x33')]);_0x293d5e[_0x770b('0x37')]=_['intersection'](_0x46952a[_0x770b('0x32')],qs[_0x770b('0x38')](_0x4b024d['query'][_0x770b('0x38')]));_0x293d5e[_0x770b('0x37')]=_0x293d5e[_0x770b('0x37')][_0x770b('0x39')]?_0x293d5e['attributes']:_0x46952a[_0x770b('0x32')];if(_0x4b024d[_0x770b('0x33')][_0x770b('0x44')]){_0x293d5e[_0x770b('0x45')]=[{'all':!![]}];}_0x293d5e=_['merge']({},_0x293d5e,_0x4b024d[_0x770b('0x43')]);return db[_0x770b('0x2e')][_0x770b('0x49')](_0x293d5e)['then'](handleEntityNotFound(_0x14f2af,null))['then'](respondWithResult(_0x14f2af,null))[_0x770b('0x4a')](handleError(_0x14f2af,null));};exports['create']=function(_0x1b9804,_0x50f300){return db[_0x770b('0x2e')][_0x770b('0x4b')](_0x1b9804['body'],{})[_0x770b('0x23')](function(_0x2fafee){var _0x1c7483=_0x1b9804['user']['get']({'plain':!![]});if(!_0x1c7483)throw new Error(_0x770b('0x4c'));if(_0x1c7483[_0x770b('0x4d')]===_0x770b('0x4e')){var _0x215121=_0x2fafee[_0x770b('0x24')]({'plain':!![]});var _0x1efe13=_0x770b('0x4f');return db[_0x770b('0x50')]['find']({'where':{'name':_0x1efe13,'userProfileId':_0x1c7483[_0x770b('0x51')]},'raw':!![]})['then'](function(_0x25aa85){if(_0x25aa85&&_0x25aa85['autoAssociation']===0x0){return db['UserProfileResource'][_0x770b('0x4b')]({'name':_0x215121[_0x770b('0x2a')],'resourceId':_0x215121['id'],'type':_0x770b('0x25'),'sectionId':_0x25aa85['id']},{})[_0x770b('0x23')](function(){return _0x2fafee;});}else{return _0x2fafee;}})['catch'](function(_0x468dd0){logger[_0x770b('0x28')](_0x770b('0x52'),_0x468dd0);throw _0x468dd0;});}return _0x2fafee;})['then'](respondWithResult(_0x50f300,0xc9))[_0x770b('0x4a')](handleError(_0x50f300,null));};exports[_0x770b('0x22')]=function(_0x528a7a,_0x4bc451){if(_0x528a7a[_0x770b('0x53')]['id']){delete _0x528a7a['body']['id'];}return db[_0x770b('0x2e')][_0x770b('0x49')]({'where':{'id':_0x528a7a[_0x770b('0x48')]['id']}})[_0x770b('0x23')](handleEntityNotFound(_0x4bc451,null))[_0x770b('0x23')](saveUpdates(_0x528a7a[_0x770b('0x53')],null))['then'](respondWithResult(_0x4bc451,null))['catch'](handleError(_0x4bc451,null));};exports[_0x770b('0x54')]=function(_0x1b2b01,_0x5c0fbb){return db['AnalyticCustomReport']['find']({'where':{'id':_0x1b2b01[_0x770b('0x48')]['id']}})['then'](handleEntityNotFound(_0x5c0fbb,null))[_0x770b('0x23')](removeEntity(_0x5c0fbb,null))[_0x770b('0x4a')](handleError(_0x5c0fbb,null));};exports['preview']=function(_0x4b2382,_0x5191c3){var _0x348c37=0xa;var _0x5701a2=[_0x770b('0x55'),_0x770b('0x56'),_0x770b('0x57'),_0x770b('0x58')];var _0xd75208={'SUM':_0x770b('0x59'),'COUNT':_0x770b('0x5a'),'COUNT DISTINCT':_0x770b('0x5b'),'MAX':'MAX(%s)','MIN':_0x770b('0x5c'),'AVG':_0x770b('0x5d'),'GROUP_CONCAT':_0x770b('0x5e'),'GROUP_CONCAT ASC':_0x770b('0x5f'),'GROUP_CONCAT DESC':_0x770b('0x60')};var _0x232713={'SEC_TO_TIME':_0x770b('0x61'),'DATE':_0x770b('0x62'),'HOUR':_0x770b('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x770b('0x64')};var _0x5eb021=function(_0x4e664c){return!_['includes']([_0x770b('0x65'),'IS\x20NOT\x20NULL',_0x770b('0x66'),_0x770b('0x67')],_0x4e664c);};var _0x578364=function(_0x50736f){if(!_0x50736f||!_0x50736f['rules'][_0x770b('0x39')]){return'';}for(var _0x2c338f='(',_0x5f14e5=0x0;_0x5f14e5<_0x50736f[_0x770b('0x68')][_0x770b('0x39')];_0x5f14e5+=0x1){_0x5f14e5>0x0&&(_0x2c338f+='\x20'+_0x50736f['operator']+'\x20');_0x2c338f+=_0x50736f['rules'][_0x5f14e5][_0x770b('0x69')]?_0x578364(_0x50736f[_0x770b('0x68')][_0x5f14e5][_0x770b('0x69')]):_0x50736f[_0x770b('0x68')][_0x5f14e5]['field']+'\x20'+_0x50736f[_0x770b('0x68')][_0x5f14e5][_0x770b('0x6a')]+(_0x5eb021(_0x50736f[_0x770b('0x68')][_0x5f14e5][_0x770b('0x6a')])?'\x20'+_0x50736f[_0x770b('0x68')][_0x5f14e5]['value']:'');}return _0x2c338f+')';};var _0x574b3b={'where':{'id':_0x4b2382[_0x770b('0x48')]['id']}},_0xb94d62,_0x23f1f0,_0x5881b2,_0x596e0f,_0x2395de;_0x574b3b=_[_0x770b('0x40')]({},_0x574b3b,_0x4b2382[_0x770b('0x43')]);return db[_0x770b('0x2e')][_0x770b('0x49')](_0x574b3b)[_0x770b('0x23')](function(_0x5b651a){if(_0x5b651a){_0xb94d62=_0x5b651a;return _0x5b651a['getFields']();}return null;})[_0x770b('0x23')](function(_0x3f0825){if(_0x3f0825){if(!_0x3f0825[_0x770b('0x39')]){throw new db[(_0x770b('0x6b'))]['ValidationErrorItem'](_0x770b('0x6c'),0x193);}_0x23f1f0=_0x3f0825;return db[_0x770b('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x770b('0x23')](function(_0x12fb34){if(_0x12fb34){_0x5881b2=_[_0x770b('0x6e')](_0x12fb34,'id');var _0x570132;var _0x3a0f12=squel[_0x770b('0x6f')]();_0x3a0f12['from'](_0xb94d62[_0x770b('0x70')]);for(var _0x1563f3=0x0;_0x1563f3<_0x23f1f0[_0x770b('0x39')];_0x1563f3+=0x1){_0x570132=_0x23f1f0[_0x1563f3]['MetricId']?_0x5881b2[_0x23f1f0[_0x1563f3]['MetricId']]['metric']:_0x23f1f0[_0x1563f3][_0x770b('0x71')];_0x570132=_0x23f1f0[_0x1563f3][_0x770b('0x72')]?_[_0x770b('0x73')](_0xd75208[_0x23f1f0[_0x1563f3][_0x770b('0x72')]],'%s',_0x570132):_0x570132;_0x570132=_0x23f1f0[_0x1563f3]['format']?_[_0x770b('0x73')](_0x232713[_0x23f1f0[_0x1563f3][_0x770b('0x74')]],'%s',_0x570132):_0x570132;if(_0x23f1f0[_0x1563f3]['groupBy']){_0x3a0f12[_0x770b('0x69')](_0x570132);}_0x23f1f0[_0x1563f3][_0x770b('0x75')]&&_0x3a0f12[_0x770b('0x3b')](_0x570132,_0x23f1f0[_0x1563f3][_0x770b('0x75')]===_0x770b('0x76')?![]:!![]);_0x3a0f12[_0x770b('0x71')](_0x570132,_0x23f1f0[_0x1563f3][_0x770b('0x77')]||_0x570132);}if(_0xb94d62[_0x770b('0x78')]){_0xb94d62['joins']=JSON[_0x770b('0x79')](_0xb94d62[_0x770b('0x78')]);for(var _0x38b0d1=0x0;_0x38b0d1<_0xb94d62[_0x770b('0x78')][_0x770b('0x39')];_0x38b0d1+=0x1){if(_0xb94d62[_0x770b('0x78')][_0x38b0d1]['type']&&_[_0x770b('0x7a')](_0x5701a2,_0xb94d62[_0x770b('0x78')][_0x38b0d1]['type'])&&_0xb94d62[_0x770b('0x78')][_0x38b0d1][_0x770b('0x7b')]&&_0xb94d62[_0x770b('0x78')][_0x38b0d1][_0x770b('0x7c')]&&_0xb94d62['joins'][_0x38b0d1]['foreignKey']){_0x3a0f12[_0xb94d62['joins'][_0x38b0d1][_0x770b('0x41')]](_0xb94d62[_0x770b('0x78')][_0x38b0d1][_0x770b('0x7c')],null,util[_0x770b('0x74')]('%s.%s\x20=\x20%s.%s',_0xb94d62['table'],_0xb94d62['joins'][_0x38b0d1][_0x770b('0x7b')],_0xb94d62[_0x770b('0x78')][_0x38b0d1]['foreignTable'],_0xb94d62[_0x770b('0x78')][_0x38b0d1][_0x770b('0x7d')]));}}}if(_0xb94d62[_0x770b('0x7e')]){_0xb94d62[_0x770b('0x7e')]=JSON[_0x770b('0x79')](_0xb94d62[_0x770b('0x7e')]);_0x3a0f12[_0x770b('0x3d')](_0x578364(_0xb94d62[_0x770b('0x7e')]['group']));}_0x2395de=_0x3a0f12[_0x770b('0x7f')]();_0x3a0f12[_0x770b('0x1b')](_0x348c37);_0x3a0f12[_0x770b('0x19')](0x0);logger[_0x770b('0x80')]('Limited\x20Query:',_0x3a0f12[_0x770b('0x81')]());return dbH['sequelize'][_0x770b('0x33')](_0x3a0f12[_0x770b('0x81')](),{'type':dbH[_0x770b('0x82')][_0x770b('0x83')][_0x770b('0x84')]});}})[_0x770b('0x23')](respondWithResult(_0x5191c3,null))[_0x770b('0x4a')](handleError(_0x5191c3,null));};function runReport(_0x35b04c,_0x55cdb5,_0x474c17){var _0x22041c=_0x55cdb5[_0x770b('0x2a')];var _0xe484f8=0xa;var _0xed7c9=[_0x770b('0x55'),_0x770b('0x56'),_0x770b('0x57'),'cross_join'];var _0x22fcc5={'SUM':_0x770b('0x59'),'COUNT':_0x770b('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x770b('0x85'),'MIN':'MIN(%s)','AVG':_0x770b('0x5d'),'GROUP_CONCAT':_0x770b('0x5e'),'GROUP_CONCAT ASC':_0x770b('0x5f'),'GROUP_CONCAT DESC':_0x770b('0x60')};var _0x20d444={'SEC_TO_TIME':_0x770b('0x61'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x770b('0x86'),'UNIX_TIMESTAMP':_0x770b('0x64')};var _0x68efc=function(_0xd57067){return!_[_0x770b('0x7a')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x770b('0x66'),_0x770b('0x67')],_0xd57067);};var _0x2922e9=function(_0x2b2269){if(!_0x2b2269||!_0x2b2269['rules'][_0x770b('0x39')]){return'';}for(var _0x1b7c2c='(',_0x20ad84=0x0;_0x20ad84<_0x2b2269[_0x770b('0x68')]['length'];_0x20ad84+=0x1){_0x20ad84>0x0&&(_0x1b7c2c+='\x20'+_0x2b2269['operator']+'\x20');_0x1b7c2c+=_0x2b2269[_0x770b('0x68')][_0x20ad84]['group']?_0x2922e9(_0x2b2269['rules'][_0x20ad84][_0x770b('0x69')]):_0x2b2269[_0x770b('0x68')][_0x20ad84][_0x770b('0x71')]+'\x20'+_0x2b2269[_0x770b('0x68')][_0x20ad84][_0x770b('0x6a')]+(_0x68efc(_0x2b2269['rules'][_0x20ad84][_0x770b('0x6a')])?'\x20'+_0x2b2269[_0x770b('0x68')][_0x20ad84]['value']:'');}return _0x1b7c2c+')';};var _0x385b0b={'where':{'id':_0x35b04c['id']}},_0x2fb89c,_0x2a7430,_0x566929,_0x2589f1,_0x2b6a51;_0x385b0b=_['merge']({},_0x385b0b,_0x474c17);return db['AnalyticCustomReport'][_0x770b('0x49')](_0x385b0b)[_0x770b('0x23')](function(_0x4d16e2){if(_0x4d16e2){_0x2fb89c=_0x4d16e2;return _0x4d16e2[_0x770b('0x87')]();}return null;})[_0x770b('0x23')](function(_0x3372e6){if(_0x3372e6){if(!_0x3372e6[_0x770b('0x39')]){throw new db['Sequelize'][(_0x770b('0x88'))](_0x770b('0x6c'),0x193);}_0x2a7430=_0x3372e6;return db[_0x770b('0x6d')][_0x770b('0x46')]({'raw':!![]});}return null;})[_0x770b('0x23')](function(_0x186253){if(_0x186253){_0x566929=_[_0x770b('0x6e')](_0x186253,'id');var _0x41d34f;var _0x6af2cc=squel[_0x770b('0x6f')]();_0x6af2cc[_0x770b('0x89')](_0x2fb89c['table']);for(var _0xcc03d=0x0;_0xcc03d<_0x2a7430[_0x770b('0x39')];_0xcc03d+=0x1){_0x41d34f=_0x2a7430[_0xcc03d][_0x770b('0x8a')]?_0x566929[_0x2a7430[_0xcc03d][_0x770b('0x8a')]][_0x770b('0x8b')]:_0x2a7430[_0xcc03d][_0x770b('0x71')];_0x41d34f=_0x2a7430[_0xcc03d][_0x770b('0x72')]?_[_0x770b('0x73')](_0x22fcc5[_0x2a7430[_0xcc03d][_0x770b('0x72')]],'%s',_0x41d34f):_0x41d34f;_0x41d34f=_0x2a7430[_0xcc03d][_0x770b('0x74')]?_['replace'](_0x20d444[_0x2a7430[_0xcc03d]['format']],'%s',_0x41d34f):_0x41d34f;if(_0x2a7430[_0xcc03d][_0x770b('0x8c')]){_0x6af2cc[_0x770b('0x69')](_0x41d34f);}_0x2a7430[_0xcc03d][_0x770b('0x75')]&&_0x6af2cc['order'](_0x41d34f,_0x2a7430[_0xcc03d][_0x770b('0x75')]==='DESC'?![]:!![]);_0x6af2cc['field'](_0x41d34f,_0x2a7430[_0xcc03d][_0x770b('0x77')]||_0x41d34f);}if(_0x2fb89c[_0x770b('0x78')]){_0x2fb89c[_0x770b('0x78')]=JSON[_0x770b('0x79')](_0x2fb89c[_0x770b('0x78')]);for(var _0x2bb459=0x0;_0x2bb459<_0x2fb89c[_0x770b('0x78')]['length'];_0x2bb459+=0x1){if(_0x2fb89c[_0x770b('0x78')][_0x2bb459][_0x770b('0x41')]&&_[_0x770b('0x7a')](_0xed7c9,_0x2fb89c['joins'][_0x2bb459][_0x770b('0x41')])&&_0x2fb89c[_0x770b('0x78')][_0x2bb459][_0x770b('0x7b')]&&_0x2fb89c[_0x770b('0x78')][_0x2bb459][_0x770b('0x7c')]&&_0x2fb89c[_0x770b('0x78')][_0x2bb459][_0x770b('0x7d')]){_0x6af2cc[_0x2fb89c[_0x770b('0x78')][_0x2bb459]['type']](_0x2fb89c[_0x770b('0x78')][_0x2bb459][_0x770b('0x7c')],null,util[_0x770b('0x74')](_0x770b('0x8d'),_0x2fb89c[_0x770b('0x70')],_0x2fb89c['joins'][_0x2bb459]['parentKey'],_0x2fb89c['joins'][_0x2bb459]['foreignTable'],_0x2fb89c[_0x770b('0x78')][_0x2bb459][_0x770b('0x7d')]));}}}if(_0x2fb89c[_0x770b('0x7e')]){_0x2fb89c[_0x770b('0x7e')]=JSON['parse'](_0x2fb89c['conditions']);_0x6af2cc[_0x770b('0x3d')](_0x2922e9(_0x2fb89c['conditions']['group']));}_0x2b6a51=_0x6af2cc[_0x770b('0x7f')]();_0x6af2cc[_0x770b('0x1b')](_0xe484f8);_0x6af2cc[_0x770b('0x19')](0x0);return;}})[_0x770b('0x23')](function(){if(_0x55cdb5[_0x770b('0x8e')]===_0x770b('0x8f')){return null;}var _0xae9a62=_[_0x770b('0x40')](_0x55cdb5,{'name':_0x55cdb5['fullPath']||_0x55cdb5[_0x770b('0x2a')]||_0x2fb89c[_0x770b('0x2a')],'basename':_0x22041c,'savename':util[_0x770b('0x74')](_0x770b('0x90'),_0x55cdb5[_0x770b('0x2a')]||_0x2fb89c[_0x770b('0x2a')],require(_0x770b('0x91'))['generate'](0x4),_0x55cdb5['output']||'csv'),'reportId':_0x2fb89c['id'],'reportType':_0x770b('0x92')});return db['AnalyticExtractedReport'][_0x770b('0x4b')](_0xae9a62,{'raw':!![]});})[_0x770b('0x23')](function(_0x5e8084){if(_0x2fb89c[_0x770b('0x70')]===_0x770b('0x93')){_0x2b6a51['where'](_0x2fb89c[_0x770b('0x70')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x55cdb5['startDate'],_0x55cdb5['endDate']);}else{_0x2b6a51['where'](_0x2fb89c[_0x770b('0x70')]+_0x770b('0x94'),_0x55cdb5['startDate'],_0x55cdb5[_0x770b('0x95')]);}if(_0x5e8084){logger['info'](_0x770b('0x96'),_0x2b6a51[_0x770b('0x81')]());require(_0x770b('0x97'))[_0x770b('0x98')](path[_0x770b('0x55')](__dirname,'../../components/export/',_0x5e8084[_0x770b('0x8e')]),[_0x5e8084['id'],_0x2b6a51[_0x770b('0x81')](),path['join'](__dirname,_0x770b('0x99'),_0x5e8084[_0x770b('0x9a')]),_0x22041c]);return _0x5e8084;}else{var _0x52f082=squel[_0x770b('0x6f')]();_0x52f082[_0x770b('0x89')]('('+_0x2b6a51[_0x770b('0x81')]()+')',_0x770b('0x9b'));_0x52f082[_0x770b('0x71')](_0x770b('0x9c'),_0x770b('0x1c'));_0x2b6a51[_0x770b('0x1b')](_0x55cdb5[_0x770b('0x1b')]||_0xe484f8);_0x2b6a51['offset'](_0x55cdb5[_0x770b('0x19')]||0x0);return dbH['sequelize'][_0x770b('0x33')](_0x52f082['toString'](),{'type':dbH[_0x770b('0x82')][_0x770b('0x83')][_0x770b('0x84')]})[_0x770b('0x23')](function(_0xc1aa13){if(!_0xc1aa13[_0x770b('0x39')]){_0x2589f1=0x0;}else{_0x2589f1=_0xc1aa13[0x0][_0x770b('0x1c')]||0x0;}return dbH[_0x770b('0x82')][_0x770b('0x33')](_0x2b6a51[_0x770b('0x81')](),{'type':dbH['sequelize'][_0x770b('0x83')][_0x770b('0x84')]});})[_0x770b('0x23')](function(_0x94aeb2){return{'rows':_0x94aeb2||[],'count':_0x2589f1};});}});}exports[_0x770b('0x9d')]=function(_0x1f00f6,_0x253d29){return runReport(_0x1f00f6[_0x770b('0x48')],_0x1f00f6[_0x770b('0x33')],_0x1f00f6['options'])[_0x770b('0x23')](respondWithResult(_0x253d29,null))[_0x770b('0x4a')](handleError(_0x253d29,null));};exports[_0x770b('0x9e')]=runReport;exports['query']=function(_0x613684,_0x20d24e){var _0x4cf296=0xa;var _0x3885a9=[_0x770b('0x55'),_0x770b('0x56'),_0x770b('0x57'),_0x770b('0x58')];var _0x4e866b={'SUM':'SUM(%s)','COUNT':_0x770b('0x5a'),'COUNT DISTINCT':_0x770b('0x5b'),'MAX':_0x770b('0x85'),'MIN':'MIN(%s)','AVG':_0x770b('0x5d'),'GROUP_CONCAT':_0x770b('0x5e'),'GROUP_CONCAT ASC':_0x770b('0x5f'),'GROUP_CONCAT DESC':_0x770b('0x60')};var _0x37f7e6={'SEC_TO_TIME':_0x770b('0x61'),'DATE':_0x770b('0x62'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x770b('0x64')};var _0x6176bb=function(_0xa2ac9){return!_['includes']([_0x770b('0x65'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x770b('0x67')],_0xa2ac9);};var _0x3c9858=function(_0xefb9cc){if(!_0xefb9cc||!_0xefb9cc[_0x770b('0x68')][_0x770b('0x39')]){return'';}for(var _0x2924d4='(',_0x49dc60=0x0;_0x49dc60<_0xefb9cc[_0x770b('0x68')][_0x770b('0x39')];_0x49dc60+=0x1){_0x49dc60>0x0&&(_0x2924d4+='\x20'+_0xefb9cc[_0x770b('0x9f')]+'\x20');_0x2924d4+=_0xefb9cc[_0x770b('0x68')][_0x49dc60][_0x770b('0x69')]?_0x3c9858(_0xefb9cc[_0x770b('0x68')][_0x49dc60][_0x770b('0x69')]):_0xefb9cc[_0x770b('0x68')][_0x49dc60]['field']+'\x20'+_0xefb9cc['rules'][_0x49dc60][_0x770b('0x6a')]+(_0x6176bb(_0xefb9cc[_0x770b('0x68')][_0x49dc60]['condition'])?'\x20'+_0xefb9cc[_0x770b('0x68')][_0x49dc60]['value']:'');}return _0x2924d4+')';};var _0xdcca37={'where':{'id':_0x613684[_0x770b('0x48')]['id']}},_0x2fc808,_0x4f493f,_0x94cda9,_0x24583f,_0x2d55e9;_0xdcca37=_['merge']({},_0xdcca37,_0x613684['options']);return db[_0x770b('0x2e')][_0x770b('0x49')](_0xdcca37)[_0x770b('0x23')](function(_0x14465b){if(_0x14465b){_0x2fc808=_0x14465b;return _0x14465b[_0x770b('0x87')]();}return null;})[_0x770b('0x23')](function(_0x212b7e){if(_0x212b7e){if(!_0x212b7e[_0x770b('0x39')]){throw new db[(_0x770b('0x6b'))][(_0x770b('0x88'))](_0x770b('0x6c'),0x193);}_0x4f493f=_0x212b7e;return db[_0x770b('0x6d')][_0x770b('0x46')]({'raw':!![]});}return null;})[_0x770b('0x23')](function(_0x26c4dc){if(_0x26c4dc){_0x94cda9=_[_0x770b('0x6e')](_0x26c4dc,'id');var _0x4450e2;var _0x53f3b1=squel[_0x770b('0x6f')]();_0x53f3b1[_0x770b('0x89')](_0x2fc808[_0x770b('0x70')]);for(var _0x20c286=0x0;_0x20c286<_0x4f493f[_0x770b('0x39')];_0x20c286+=0x1){_0x4450e2=_0x4f493f[_0x20c286][_0x770b('0x8a')]?_0x94cda9[_0x4f493f[_0x20c286]['MetricId']][_0x770b('0x8b')]:_0x4f493f[_0x20c286][_0x770b('0x71')];_0x4450e2=_0x4f493f[_0x20c286][_0x770b('0x72')]?_['replace'](_0x4e866b[_0x4f493f[_0x20c286][_0x770b('0x72')]],'%s',_0x4450e2):_0x4450e2;_0x4450e2=_0x4f493f[_0x20c286][_0x770b('0x74')]?_[_0x770b('0x73')](_0x37f7e6[_0x4f493f[_0x20c286][_0x770b('0x74')]],'%s',_0x4450e2):_0x4450e2;if(_0x4f493f[_0x20c286][_0x770b('0x8c')]){_0x53f3b1['group'](_0x4450e2);}_0x4f493f[_0x20c286][_0x770b('0x75')]&&_0x53f3b1[_0x770b('0x3b')](_0x4450e2,_0x4f493f[_0x20c286]['orderBy']===_0x770b('0x76')?![]:!![]);_0x53f3b1[_0x770b('0x71')](_0x4450e2,_0x4f493f[_0x20c286][_0x770b('0x77')]||_0x4450e2);}if(_0x2fc808[_0x770b('0x78')]){_0x2fc808[_0x770b('0x78')]=JSON['parse'](_0x2fc808[_0x770b('0x78')]);for(var _0x316c1a=0x0;_0x316c1a<_0x2fc808['joins'][_0x770b('0x39')];_0x316c1a+=0x1){if(_0x2fc808[_0x770b('0x78')][_0x316c1a][_0x770b('0x41')]&&_[_0x770b('0x7a')](_0x3885a9,_0x2fc808[_0x770b('0x78')][_0x316c1a][_0x770b('0x41')])&&_0x2fc808[_0x770b('0x78')][_0x316c1a][_0x770b('0x7b')]&&_0x2fc808[_0x770b('0x78')][_0x316c1a][_0x770b('0x7c')]&&_0x2fc808[_0x770b('0x78')][_0x316c1a]['foreignKey']){_0x53f3b1[_0x2fc808['joins'][_0x316c1a][_0x770b('0x41')]](_0x2fc808[_0x770b('0x78')][_0x316c1a][_0x770b('0x7c')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2fc808[_0x770b('0x70')],_0x2fc808[_0x770b('0x78')][_0x316c1a]['parentKey'],_0x2fc808[_0x770b('0x78')][_0x316c1a][_0x770b('0x7c')],_0x2fc808['joins'][_0x316c1a][_0x770b('0x7d')]));}}}if(_0x2fc808[_0x770b('0x7e')]){_0x2fc808[_0x770b('0x7e')]=JSON[_0x770b('0x79')](_0x2fc808['conditions']);_0x53f3b1[_0x770b('0x3d')](_0x3c9858(_0x2fc808[_0x770b('0x7e')][_0x770b('0x69')]));}_0x2d55e9=_0x53f3b1[_0x770b('0x7f')]();_0x53f3b1[_0x770b('0x1b')](_0x4cf296);_0x53f3b1[_0x770b('0x19')](0x0);logger[_0x770b('0x80')]('Limited\x20Query:',_0x53f3b1[_0x770b('0x81')]());return dbH['sequelize'][_0x770b('0x33')](_0x53f3b1['toString'](),{'type':dbH[_0x770b('0x82')][_0x770b('0x83')][_0x770b('0x84')]});}})['then'](function(){return{'sql':_0x2d55e9[_0x770b('0x81')]()};})[_0x770b('0x23')](respondWithResult(_0x20d24e,null))[_0x770b('0x4a')](handleError(_0x20d24e,null));};
\ No newline at end of file
+var _0x26e4=['operator','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','order','orderBy','DESC','alias','parse','joins','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','getFields','Please\x20insert\x20at\x20least\x20one\x20field','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','destroy','CustomReports','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','then','catch','show','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','DATE(%s)','HOUR(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules'];(function(_0x4d27c0,_0x555ad3){var _0x4c948e=function(_0xdaaa3e){while(--_0xdaaa3e){_0x4d27c0['push'](_0x4d27c0['shift']());}};_0x4c948e(++_0x555ad3);}(_0x26e4,0xec));var _0x426e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x26e4[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x426e('0x0'));var zipdir=require(_0x426e('0x1'));var jsonpatch=require(_0x426e('0x2'));var rp=require(_0x426e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x426e('0x4'));var util=require(_0x426e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x426e('0x6'));var ejs=require(_0x426e('0x7'));var fs=require('fs');var fs_extra=require(_0x426e('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x426e('0x9'));var deskjs=require(_0x426e('0xa'));var toCsv=require(_0x426e('0x6'));var querystring=require(_0x426e('0xb'));var Papa=require('papaparse');var Redis=require(_0x426e('0xc'));var authService=require(_0x426e('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x426e('0xe'));var hardwareService=require(_0x426e('0xf'));var logger=require(_0x426e('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x426e('0x11'));var db=require(_0x426e('0x12'))['db'];var dbH=require(_0x426e('0x12'))[_0x426e('0x13')];function respondWithStatusCode(_0x870370,_0x3ee646){_0x3ee646=_0x3ee646||0xcc;return function(_0x42b9a2){if(_0x42b9a2){return _0x870370[_0x426e('0x14')](_0x3ee646);}return _0x870370[_0x426e('0x15')](_0x3ee646)[_0x426e('0x16')]();};}function respondWithResult(_0x5d1113,_0x128ea1){_0x128ea1=_0x128ea1||0xc8;return function(_0x21d12d){if(_0x21d12d){return _0x5d1113[_0x426e('0x15')](_0x128ea1)['json'](_0x21d12d);}};}function respondWithFilteredResult(_0x263a6e,_0x5e5a15){return function(_0x2981d6){if(_0x2981d6){var _0x4ea621=typeof _0x5e5a15[_0x426e('0x17')]===_0x426e('0x18')&&typeof _0x5e5a15[_0x426e('0x19')]===_0x426e('0x18');var _0x59e6d6=_0x2981d6['count'];var _0x3cd9b5=_0x4ea621?0x0:_0x5e5a15['offset'];var _0x2c2a05=_0x4ea621?_0x2981d6[_0x426e('0x1a')]:_0x5e5a15[_0x426e('0x17')]+_0x5e5a15['limit'];var _0x2df9da;if(_0x2c2a05>=_0x59e6d6){_0x2c2a05=_0x59e6d6;_0x2df9da=0xc8;}else{_0x2df9da=0xce;}_0x263a6e[_0x426e('0x15')](_0x2df9da);return _0x263a6e[_0x426e('0x1b')](_0x426e('0x1c'),_0x3cd9b5+'-'+_0x2c2a05+'/'+_0x59e6d6)[_0x426e('0x1d')](_0x2981d6);}return null;};}function patchUpdates(_0x3ad2e1){return function(_0x53020f){try{jsonpatch[_0x426e('0x1e')](_0x53020f,_0x3ad2e1,!![]);}catch(_0x602e50){return BPromise['reject'](_0x602e50);}return _0x53020f[_0x426e('0x1f')]();};}function saveUpdates(_0x5df0f1,_0x42ad88){return function(_0x2cae41){if(_0x2cae41){return _0x2cae41['update'](_0x5df0f1)['then'](function(_0x5e6108){return _0x5e6108;});}return null;};}function removeEntity(_0x2cdc76,_0x3beac3){return function(_0x478d2e){if(_0x478d2e){return _0x478d2e[_0x426e('0x20')]()['then'](function(){var _0x51c730=_0x478d2e['get']({'plain':!![]});var _0x28cac6=_0x426e('0x21');return db['UserProfileResource'][_0x426e('0x20')]({'where':{'type':_0x28cac6,'resourceId':_0x51c730['id']}})['then'](function(){return _0x478d2e;});})['then'](function(){_0x2cdc76[_0x426e('0x15')](0xcc)[_0x426e('0x16')]();});}};}function handleEntityNotFound(_0x58223b,_0x3de0a6){return function(_0x5d6252){if(!_0x5d6252){_0x58223b[_0x426e('0x14')](0x194);}return _0x5d6252;};}function handleError(_0x91fde4,_0x50c510){_0x50c510=_0x50c510||0x1f4;return function(_0x582d91){logger['error'](_0x582d91[_0x426e('0x22')]);if(_0x582d91['name']){delete _0x582d91[_0x426e('0x23')];}_0x91fde4[_0x426e('0x15')](_0x50c510)[_0x426e('0x24')](_0x582d91);};}exports[_0x426e('0x25')]=function(_0x56b09a,_0x2a337b){var _0x2e9330={},_0x447160={},_0xa14e20={'count':0x0,'rows':[]};var _0x38170c=_[_0x426e('0x26')](db[_0x426e('0x27')]['rawAttributes'],function(_0x3c5592){return{'name':_0x3c5592[_0x426e('0x28')],'type':_0x3c5592[_0x426e('0x29')]['key']};});_0x447160[_0x426e('0x2a')]=_[_0x426e('0x26')](_0x38170c,_0x426e('0x23'));_0x447160[_0x426e('0x2b')]=_[_0x426e('0x2c')](_0x56b09a[_0x426e('0x2b')]);_0x447160[_0x426e('0x2d')]=_[_0x426e('0x2e')](_0x447160['model'],_0x447160[_0x426e('0x2b')]);_0x2e9330['attributes']=_[_0x426e('0x2e')](_0x447160[_0x426e('0x2a')],qs[_0x426e('0x2f')](_0x56b09a[_0x426e('0x2b')][_0x426e('0x2f')]));_0x2e9330[_0x426e('0x30')]=_0x2e9330[_0x426e('0x30')][_0x426e('0x31')]?_0x2e9330['attributes']:_0x447160[_0x426e('0x2a')];if(!_0x56b09a[_0x426e('0x2b')][_0x426e('0x32')]('nolimit')){_0x2e9330['limit']=qs['limit'](_0x56b09a['query']['limit']);_0x2e9330[_0x426e('0x17')]=qs[_0x426e('0x17')](_0x56b09a[_0x426e('0x2b')]['offset']);}_0x2e9330['order']=qs['sort'](_0x56b09a[_0x426e('0x2b')]['sort']);_0x2e9330[_0x426e('0x33')]=qs[_0x426e('0x2d')](_[_0x426e('0x34')](_0x56b09a['query'],_0x447160[_0x426e('0x2d')]),_0x38170c);if(_0x56b09a[_0x426e('0x2b')][_0x426e('0x35')]){_0x2e9330[_0x426e('0x33')]=_['merge'](_0x2e9330[_0x426e('0x33')],{'$or':_['map'](_0x38170c,function(_0x2fd673){if(_0x2fd673[_0x426e('0x29')]!==_0x426e('0x36')){var _0x337d0b={};_0x337d0b[_0x2fd673['name']]={'$like':'%'+_0x56b09a[_0x426e('0x2b')][_0x426e('0x35')]+'%'};return _0x337d0b;}})});}_0x2e9330=_[_0x426e('0x37')]({},_0x2e9330,_0x56b09a[_0x426e('0x38')]);var _0x19cdef={'where':_0x2e9330[_0x426e('0x33')]};return db[_0x426e('0x27')][_0x426e('0x1a')](_0x19cdef)['then'](function(_0x5cfd96){_0xa14e20['count']=_0x5cfd96;if(_0x56b09a[_0x426e('0x2b')][_0x426e('0x39')]){_0x2e9330[_0x426e('0x3a')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x426e('0x3b')](_0x2e9330);})['then'](function(_0x28d05e){_0xa14e20[_0x426e('0x3c')]=_0x28d05e;return _0xa14e20;})[_0x426e('0x3d')](respondWithFilteredResult(_0x2a337b,_0x2e9330))[_0x426e('0x3e')](handleError(_0x2a337b,null));};exports[_0x426e('0x3f')]=function(_0x2f05ad,_0x160c5f){var _0xa4dd05={'raw':![],'where':{'id':_0x2f05ad['params']['id']}},_0x1ebe7={};_0x1ebe7[_0x426e('0x2a')]=_['keys'](db[_0x426e('0x27')][_0x426e('0x40')]);_0x1ebe7['query']=_[_0x426e('0x2c')](_0x2f05ad[_0x426e('0x2b')]);_0x1ebe7[_0x426e('0x2d')]=_[_0x426e('0x2e')](_0x1ebe7[_0x426e('0x2a')],_0x1ebe7['query']);_0xa4dd05['attributes']=_['intersection'](_0x1ebe7[_0x426e('0x2a')],qs[_0x426e('0x2f')](_0x2f05ad[_0x426e('0x2b')][_0x426e('0x2f')]));_0xa4dd05[_0x426e('0x30')]=_0xa4dd05[_0x426e('0x30')][_0x426e('0x31')]?_0xa4dd05[_0x426e('0x30')]:_0x1ebe7[_0x426e('0x2a')];if(_0x2f05ad[_0x426e('0x2b')][_0x426e('0x39')]){_0xa4dd05[_0x426e('0x3a')]=[{'all':!![]}];}_0xa4dd05=_[_0x426e('0x37')]({},_0xa4dd05,_0x2f05ad['options']);return db[_0x426e('0x27')][_0x426e('0x41')](_0xa4dd05)[_0x426e('0x3d')](handleEntityNotFound(_0x160c5f,null))[_0x426e('0x3d')](respondWithResult(_0x160c5f,null))[_0x426e('0x3e')](handleError(_0x160c5f,null));};exports[_0x426e('0x42')]=function(_0x411ba6,_0x22c152){return db[_0x426e('0x27')]['create'](_0x411ba6[_0x426e('0x43')],{})[_0x426e('0x3d')](function(_0x2c479c){var _0x4747ee=_0x411ba6[_0x426e('0x44')][_0x426e('0x45')]({'plain':!![]});if(!_0x4747ee)throw new Error(_0x426e('0x46'));if(_0x4747ee[_0x426e('0x47')]===_0x426e('0x44')){var _0x316f8c=_0x2c479c[_0x426e('0x45')]({'plain':!![]});var _0x2ff1e3='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x2ff1e3,'userProfileId':_0x4747ee[_0x426e('0x48')]},'raw':!![]})['then'](function(_0x3373ca){if(_0x3373ca&&_0x3373ca[_0x426e('0x49')]===0x0){return db[_0x426e('0x4a')][_0x426e('0x42')]({'name':_0x316f8c['name'],'resourceId':_0x316f8c['id'],'type':_0x426e('0x21'),'sectionId':_0x3373ca['id']},{})['then'](function(){return _0x2c479c;});}else{return _0x2c479c;}})['catch'](function(_0x36db5e){logger[_0x426e('0x4b')](_0x426e('0x4c'),_0x36db5e);throw _0x36db5e;});}return _0x2c479c;})['then'](respondWithResult(_0x22c152,0xc9))[_0x426e('0x3e')](handleError(_0x22c152,null));};exports[_0x426e('0x4d')]=function(_0x48a53b,_0x453180){if(_0x48a53b[_0x426e('0x43')]['id']){delete _0x48a53b['body']['id'];}return db[_0x426e('0x27')][_0x426e('0x41')]({'where':{'id':_0x48a53b['params']['id']}})[_0x426e('0x3d')](handleEntityNotFound(_0x453180,null))[_0x426e('0x3d')](saveUpdates(_0x48a53b[_0x426e('0x43')],null))[_0x426e('0x3d')](respondWithResult(_0x453180,null))[_0x426e('0x3e')](handleError(_0x453180,null));};exports[_0x426e('0x20')]=function(_0x5dc98d,_0x34b866){return db[_0x426e('0x27')]['find']({'where':{'id':_0x5dc98d[_0x426e('0x4e')]['id']}})[_0x426e('0x3d')](handleEntityNotFound(_0x34b866,null))[_0x426e('0x3d')](removeEntity(_0x34b866,null))[_0x426e('0x3e')](handleError(_0x34b866,null));};exports[_0x426e('0x4f')]=function(_0x2ea407,_0x5b5084){var _0x30befc=0xa;var _0x290474=[_0x426e('0x50'),_0x426e('0x51'),_0x426e('0x52'),_0x426e('0x53')];var _0x3067cb={'SUM':'SUM(%s)','COUNT':_0x426e('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x426e('0x55'),'MIN':_0x426e('0x56'),'AVG':_0x426e('0x57'),'GROUP_CONCAT':_0x426e('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x33d0ef={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x426e('0x59'),'HOUR':_0x426e('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x19d524=function(_0xdd7d62){return!_['includes']([_0x426e('0x5b'),_0x426e('0x5c'),_0x426e('0x5d'),_0x426e('0x5e')],_0xdd7d62);};var _0x5c732c=function(_0x4b0257){if(!_0x4b0257||!_0x4b0257[_0x426e('0x5f')][_0x426e('0x31')]){return'';}for(var _0x56791f='(',_0x25d65c=0x0;_0x25d65c<_0x4b0257[_0x426e('0x5f')]['length'];_0x25d65c+=0x1){_0x25d65c>0x0&&(_0x56791f+='\x20'+_0x4b0257[_0x426e('0x60')]+'\x20');_0x56791f+=_0x4b0257['rules'][_0x25d65c]['group']?_0x5c732c(_0x4b0257[_0x426e('0x5f')][_0x25d65c][_0x426e('0x61')]):_0x4b0257['rules'][_0x25d65c][_0x426e('0x62')]+'\x20'+_0x4b0257['rules'][_0x25d65c][_0x426e('0x63')]+(_0x19d524(_0x4b0257[_0x426e('0x5f')][_0x25d65c]['condition'])?'\x20'+_0x4b0257[_0x426e('0x5f')][_0x25d65c][_0x426e('0x64')]:'');}return _0x56791f+')';};var _0x28c29c={'where':{'id':_0x2ea407['params']['id']}},_0x2900cc,_0x27dd8b,_0x52f8a2,_0x361c90,_0x5b8388;_0x28c29c=_[_0x426e('0x37')]({},_0x28c29c,_0x2ea407['options']);return db['AnalyticCustomReport'][_0x426e('0x41')](_0x28c29c)[_0x426e('0x3d')](function(_0x90f53a){if(_0x90f53a){_0x2900cc=_0x90f53a;return _0x90f53a['getFields']();}return null;})[_0x426e('0x3d')](function(_0x460c18){if(_0x460c18){if(!_0x460c18['length']){throw new db[(_0x426e('0x65'))][(_0x426e('0x66'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x27dd8b=_0x460c18;return db[_0x426e('0x67')][_0x426e('0x3b')]({'raw':!![]});}return null;})[_0x426e('0x3d')](function(_0x1d0586){if(_0x1d0586){_0x52f8a2=_[_0x426e('0x68')](_0x1d0586,'id');var _0x4fdcb6;var _0x346585=squel[_0x426e('0x69')]();_0x346585[_0x426e('0x6a')](_0x2900cc[_0x426e('0x6b')]);for(var _0x4ed96c=0x0;_0x4ed96c<_0x27dd8b['length'];_0x4ed96c+=0x1){_0x4fdcb6=_0x27dd8b[_0x4ed96c]['MetricId']?_0x52f8a2[_0x27dd8b[_0x4ed96c][_0x426e('0x6c')]][_0x426e('0x6d')]:_0x27dd8b[_0x4ed96c][_0x426e('0x62')];_0x4fdcb6=_0x27dd8b[_0x4ed96c][_0x426e('0x6e')]?_[_0x426e('0x6f')](_0x3067cb[_0x27dd8b[_0x4ed96c][_0x426e('0x6e')]],'%s',_0x4fdcb6):_0x4fdcb6;_0x4fdcb6=_0x27dd8b[_0x4ed96c]['format']?_[_0x426e('0x6f')](_0x33d0ef[_0x27dd8b[_0x4ed96c][_0x426e('0x70')]],'%s',_0x4fdcb6):_0x4fdcb6;if(_0x27dd8b[_0x4ed96c][_0x426e('0x71')]){_0x346585[_0x426e('0x61')](_0x4fdcb6);}_0x27dd8b[_0x4ed96c]['orderBy']&&_0x346585[_0x426e('0x72')](_0x4fdcb6,_0x27dd8b[_0x4ed96c][_0x426e('0x73')]===_0x426e('0x74')?![]:!![]);_0x346585['field'](_0x4fdcb6,_0x27dd8b[_0x4ed96c][_0x426e('0x75')]||_0x4fdcb6);}if(_0x2900cc['joins']){_0x2900cc['joins']=JSON[_0x426e('0x76')](_0x2900cc[_0x426e('0x77')]);for(var _0x357a79=0x0;_0x357a79<_0x2900cc[_0x426e('0x77')][_0x426e('0x31')];_0x357a79+=0x1){if(_0x2900cc[_0x426e('0x77')][_0x357a79][_0x426e('0x29')]&&_[_0x426e('0x78')](_0x290474,_0x2900cc[_0x426e('0x77')][_0x357a79][_0x426e('0x29')])&&_0x2900cc[_0x426e('0x77')][_0x357a79][_0x426e('0x79')]&&_0x2900cc['joins'][_0x357a79][_0x426e('0x7a')]&&_0x2900cc['joins'][_0x357a79][_0x426e('0x7b')]){_0x346585[_0x2900cc[_0x426e('0x77')][_0x357a79][_0x426e('0x29')]](_0x2900cc[_0x426e('0x77')][_0x357a79][_0x426e('0x7a')],null,util[_0x426e('0x70')](_0x426e('0x7c'),_0x2900cc['table'],_0x2900cc[_0x426e('0x77')][_0x357a79]['parentKey'],_0x2900cc[_0x426e('0x77')][_0x357a79]['foreignTable'],_0x2900cc[_0x426e('0x77')][_0x357a79][_0x426e('0x7b')]));}}}if(_0x2900cc['conditions']){_0x2900cc[_0x426e('0x7d')]=JSON[_0x426e('0x76')](_0x2900cc['conditions']);_0x346585[_0x426e('0x33')](_0x5c732c(_0x2900cc[_0x426e('0x7d')][_0x426e('0x61')]));}_0x5b8388=_0x346585[_0x426e('0x7e')]();_0x346585[_0x426e('0x19')](_0x30befc);_0x346585[_0x426e('0x17')](0x0);logger[_0x426e('0x7f')](_0x426e('0x80'),_0x346585[_0x426e('0x81')]());return dbH[_0x426e('0x82')][_0x426e('0x2b')](_0x346585[_0x426e('0x81')](),{'type':dbH[_0x426e('0x82')][_0x426e('0x83')][_0x426e('0x84')]});}})[_0x426e('0x3d')](respondWithResult(_0x5b5084,null))['catch'](handleError(_0x5b5084,null));};function runReport(_0x133dfc,_0x1be878,_0x3e3ff5){var _0x3fd390=_0x1be878['name'];var _0x1005e5=0xa;var _0x3af486=['join',_0x426e('0x51'),_0x426e('0x52'),_0x426e('0x53')];var _0x46ef68={'SUM':_0x426e('0x85'),'COUNT':_0x426e('0x54'),'COUNT DISTINCT':_0x426e('0x86'),'MAX':_0x426e('0x55'),'MIN':_0x426e('0x56'),'AVG':_0x426e('0x57'),'GROUP_CONCAT':_0x426e('0x58'),'GROUP_CONCAT ASC':_0x426e('0x87'),'GROUP_CONCAT DESC':_0x426e('0x88')};var _0x3efffb={'SEC_TO_TIME':_0x426e('0x89'),'DATE':_0x426e('0x59'),'HOUR':_0x426e('0x5a'),'ROUND':_0x426e('0x8a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4c23a4=function(_0x406462){return!_['includes'](['IS\x20NULL',_0x426e('0x5c'),_0x426e('0x5d'),'IS\x20NOT\x20EMPTY'],_0x406462);};var _0xc6885=function(_0x22ae68){if(!_0x22ae68||!_0x22ae68['rules'][_0x426e('0x31')]){return'';}for(var _0x316766='(',_0x29f1a9=0x0;_0x29f1a9<_0x22ae68[_0x426e('0x5f')]['length'];_0x29f1a9+=0x1){_0x29f1a9>0x0&&(_0x316766+='\x20'+_0x22ae68['operator']+'\x20');_0x316766+=_0x22ae68['rules'][_0x29f1a9][_0x426e('0x61')]?_0xc6885(_0x22ae68[_0x426e('0x5f')][_0x29f1a9][_0x426e('0x61')]):_0x22ae68[_0x426e('0x5f')][_0x29f1a9][_0x426e('0x62')]+'\x20'+_0x22ae68[_0x426e('0x5f')][_0x29f1a9][_0x426e('0x63')]+(_0x4c23a4(_0x22ae68[_0x426e('0x5f')][_0x29f1a9][_0x426e('0x63')])?'\x20'+_0x22ae68['rules'][_0x29f1a9][_0x426e('0x64')]:'');}return _0x316766+')';};var _0x2862d6={'where':{'id':_0x133dfc['id']}},_0x27c0ca,_0x3e04dd,_0x53bb59,_0x1becec,_0x403bb5;_0x2862d6=_[_0x426e('0x37')]({},_0x2862d6,_0x3e3ff5);return db[_0x426e('0x27')]['find'](_0x2862d6)[_0x426e('0x3d')](function(_0x4cc5d9){if(_0x4cc5d9){_0x27c0ca=_0x4cc5d9;return _0x4cc5d9[_0x426e('0x8b')]();}return null;})['then'](function(_0x1a50b2){if(_0x1a50b2){if(!_0x1a50b2[_0x426e('0x31')]){throw new db[(_0x426e('0x65'))]['ValidationErrorItem'](_0x426e('0x8c'),0x193);}_0x3e04dd=_0x1a50b2;return db[_0x426e('0x67')][_0x426e('0x3b')]({'raw':!![]});}return null;})['then'](function(_0x9e0bc5){if(_0x9e0bc5){_0x53bb59=_[_0x426e('0x68')](_0x9e0bc5,'id');var _0x3bac0d;var _0xec0149=squel[_0x426e('0x69')]();_0xec0149['from'](_0x27c0ca['table']);for(var _0x503567=0x0;_0x503567<_0x3e04dd[_0x426e('0x31')];_0x503567+=0x1){_0x3bac0d=_0x3e04dd[_0x503567]['MetricId']?_0x53bb59[_0x3e04dd[_0x503567]['MetricId']][_0x426e('0x6d')]:_0x3e04dd[_0x503567][_0x426e('0x62')];_0x3bac0d=_0x3e04dd[_0x503567][_0x426e('0x6e')]?_['replace'](_0x46ef68[_0x3e04dd[_0x503567]['function']],'%s',_0x3bac0d):_0x3bac0d;_0x3bac0d=_0x3e04dd[_0x503567]['format']?_[_0x426e('0x6f')](_0x3efffb[_0x3e04dd[_0x503567][_0x426e('0x70')]],'%s',_0x3bac0d):_0x3bac0d;if(_0x3e04dd[_0x503567][_0x426e('0x71')]){_0xec0149[_0x426e('0x61')](_0x3bac0d);}_0x3e04dd[_0x503567]['orderBy']&&_0xec0149['order'](_0x3bac0d,_0x3e04dd[_0x503567][_0x426e('0x73')]===_0x426e('0x74')?![]:!![]);_0xec0149['field'](_0x3bac0d,_0x3e04dd[_0x503567][_0x426e('0x75')]||_0x3bac0d);}if(_0x27c0ca[_0x426e('0x77')]){_0x27c0ca[_0x426e('0x77')]=JSON[_0x426e('0x76')](_0x27c0ca[_0x426e('0x77')]);for(var _0x2bed88=0x0;_0x2bed88<_0x27c0ca[_0x426e('0x77')][_0x426e('0x31')];_0x2bed88+=0x1){if(_0x27c0ca[_0x426e('0x77')][_0x2bed88][_0x426e('0x29')]&&_[_0x426e('0x78')](_0x3af486,_0x27c0ca[_0x426e('0x77')][_0x2bed88][_0x426e('0x29')])&&_0x27c0ca[_0x426e('0x77')][_0x2bed88][_0x426e('0x79')]&&_0x27c0ca[_0x426e('0x77')][_0x2bed88][_0x426e('0x7a')]&&_0x27c0ca[_0x426e('0x77')][_0x2bed88][_0x426e('0x7b')]){_0xec0149[_0x27c0ca['joins'][_0x2bed88][_0x426e('0x29')]](_0x27c0ca[_0x426e('0x77')][_0x2bed88]['foreignTable'],null,util[_0x426e('0x70')](_0x426e('0x7c'),_0x27c0ca[_0x426e('0x6b')],_0x27c0ca[_0x426e('0x77')][_0x2bed88][_0x426e('0x79')],_0x27c0ca['joins'][_0x2bed88][_0x426e('0x7a')],_0x27c0ca[_0x426e('0x77')][_0x2bed88][_0x426e('0x7b')]));}}}if(_0x27c0ca[_0x426e('0x7d')]){_0x27c0ca['conditions']=JSON[_0x426e('0x76')](_0x27c0ca[_0x426e('0x7d')]);_0xec0149[_0x426e('0x33')](_0xc6885(_0x27c0ca['conditions'][_0x426e('0x61')]));}_0x403bb5=_0xec0149[_0x426e('0x7e')]();_0xec0149[_0x426e('0x19')](_0x1005e5);_0xec0149[_0x426e('0x17')](0x0);return;}})[_0x426e('0x3d')](function(){if(_0x1be878['output']===_0x426e('0x8d')){return null;}var _0x575889=_[_0x426e('0x37')](_0x1be878,{'name':_0x1be878[_0x426e('0x8e')]||_0x1be878[_0x426e('0x23')]||_0x27c0ca[_0x426e('0x23')],'basename':_0x3fd390,'savename':util[_0x426e('0x70')](_0x426e('0x8f'),_0x1be878['name']||_0x27c0ca[_0x426e('0x23')],require(_0x426e('0x90'))[_0x426e('0x91')](0x4),_0x1be878[_0x426e('0x92')]||_0x426e('0x93')),'reportId':_0x27c0ca['id'],'reportType':_0x426e('0x94')});return db['AnalyticExtractedReport']['create'](_0x575889,{'raw':!![]});})[_0x426e('0x3d')](function(_0x5ab5e3){if(_0x27c0ca[_0x426e('0x6b')]===_0x426e('0x95')){_0x403bb5[_0x426e('0x33')](_0x27c0ca['table']+_0x426e('0x96'),_0x1be878[_0x426e('0x97')],_0x1be878[_0x426e('0x98')]);}else{_0x403bb5['where'](_0x27c0ca[_0x426e('0x6b')]+_0x426e('0x99'),_0x1be878[_0x426e('0x97')],_0x1be878[_0x426e('0x98')]);}if(_0x5ab5e3){logger[_0x426e('0x9a')](_0x426e('0x9b'),_0x403bb5[_0x426e('0x81')]());require(_0x426e('0x9c'))[_0x426e('0x9d')](path[_0x426e('0x50')](__dirname,_0x426e('0x9e'),_0x5ab5e3[_0x426e('0x92')]),[_0x5ab5e3['id'],_0x403bb5[_0x426e('0x81')](),path[_0x426e('0x50')](__dirname,_0x426e('0x9f'),_0x5ab5e3[_0x426e('0xa0')]),_0x3fd390]);return _0x5ab5e3;}else{var _0x18275f=squel['select']();_0x18275f[_0x426e('0x6a')]('('+_0x403bb5[_0x426e('0x81')]()+')',_0x426e('0xa1'));_0x18275f['field'](_0x426e('0xa2'),_0x426e('0x1a'));_0x403bb5[_0x426e('0x19')](_0x1be878[_0x426e('0x19')]||_0x1005e5);_0x403bb5['offset'](_0x1be878['offset']||0x0);return dbH['sequelize'][_0x426e('0x2b')](_0x18275f['toString'](),{'type':dbH[_0x426e('0x82')][_0x426e('0x83')][_0x426e('0x84')]})['then'](function(_0x1c33aa){if(!_0x1c33aa[_0x426e('0x31')]){_0x1becec=0x0;}else{_0x1becec=_0x1c33aa[0x0][_0x426e('0x1a')]||0x0;}return dbH[_0x426e('0x82')][_0x426e('0x2b')](_0x403bb5[_0x426e('0x81')](),{'type':dbH[_0x426e('0x82')]['QueryTypes'][_0x426e('0x84')]});})[_0x426e('0x3d')](function(_0x35a435){return{'rows':_0x35a435||[],'count':_0x1becec};});}});}exports[_0x426e('0xa3')]=function(_0x22c3bd,_0x4af756){return runReport(_0x22c3bd[_0x426e('0x4e')],_0x22c3bd[_0x426e('0x2b')],_0x22c3bd[_0x426e('0x38')])[_0x426e('0x3d')](respondWithResult(_0x4af756,null))['catch'](handleError(_0x4af756,null));};exports[_0x426e('0xa4')]=runReport;exports[_0x426e('0x2b')]=function(_0xe6c293,_0x367572){var _0x438514=0xa;var _0x2fe6ba=[_0x426e('0x50'),_0x426e('0x51'),'right_join',_0x426e('0x53')];var _0x5de816={'SUM':_0x426e('0x85'),'COUNT':_0x426e('0x54'),'COUNT DISTINCT':_0x426e('0x86'),'MAX':_0x426e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x426e('0x87'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x509e9b={'SEC_TO_TIME':_0x426e('0x89'),'DATE':_0x426e('0x59'),'HOUR':_0x426e('0x5a'),'ROUND':_0x426e('0x8a'),'UNIX_TIMESTAMP':_0x426e('0xa5')};var _0x5b3c15=function(_0x4f64ad){return!_[_0x426e('0x78')](['IS\x20NULL',_0x426e('0x5c'),_0x426e('0x5d'),'IS\x20NOT\x20EMPTY'],_0x4f64ad);};var _0x234695=function(_0x2eb42c){if(!_0x2eb42c||!_0x2eb42c['rules'][_0x426e('0x31')]){return'';}for(var _0x7ea6a6='(',_0x23c870=0x0;_0x23c870<_0x2eb42c[_0x426e('0x5f')][_0x426e('0x31')];_0x23c870+=0x1){_0x23c870>0x0&&(_0x7ea6a6+='\x20'+_0x2eb42c[_0x426e('0x60')]+'\x20');_0x7ea6a6+=_0x2eb42c[_0x426e('0x5f')][_0x23c870]['group']?_0x234695(_0x2eb42c[_0x426e('0x5f')][_0x23c870][_0x426e('0x61')]):_0x2eb42c[_0x426e('0x5f')][_0x23c870]['field']+'\x20'+_0x2eb42c[_0x426e('0x5f')][_0x23c870][_0x426e('0x63')]+(_0x5b3c15(_0x2eb42c[_0x426e('0x5f')][_0x23c870][_0x426e('0x63')])?'\x20'+_0x2eb42c[_0x426e('0x5f')][_0x23c870][_0x426e('0x64')]:'');}return _0x7ea6a6+')';};var _0x439b38={'where':{'id':_0xe6c293[_0x426e('0x4e')]['id']}},_0x574051,_0x215564,_0x3cd233,_0x2d959b,_0x3f6d8d;_0x439b38=_[_0x426e('0x37')]({},_0x439b38,_0xe6c293[_0x426e('0x38')]);return db[_0x426e('0x27')]['find'](_0x439b38)[_0x426e('0x3d')](function(_0x9e1ad8){if(_0x9e1ad8){_0x574051=_0x9e1ad8;return _0x9e1ad8[_0x426e('0x8b')]();}return null;})[_0x426e('0x3d')](function(_0x400602){if(_0x400602){if(!_0x400602[_0x426e('0x31')]){throw new db['Sequelize'][(_0x426e('0x66'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x215564=_0x400602;return db[_0x426e('0x67')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x58d797){if(_0x58d797){_0x3cd233=_[_0x426e('0x68')](_0x58d797,'id');var _0x352aba;var _0xb6064c=squel[_0x426e('0x69')]();_0xb6064c[_0x426e('0x6a')](_0x574051['table']);for(var _0x545f6a=0x0;_0x545f6a<_0x215564[_0x426e('0x31')];_0x545f6a+=0x1){_0x352aba=_0x215564[_0x545f6a][_0x426e('0x6c')]?_0x3cd233[_0x215564[_0x545f6a][_0x426e('0x6c')]][_0x426e('0x6d')]:_0x215564[_0x545f6a][_0x426e('0x62')];_0x352aba=_0x215564[_0x545f6a][_0x426e('0x6e')]?_[_0x426e('0x6f')](_0x5de816[_0x215564[_0x545f6a]['function']],'%s',_0x352aba):_0x352aba;_0x352aba=_0x215564[_0x545f6a][_0x426e('0x70')]?_[_0x426e('0x6f')](_0x509e9b[_0x215564[_0x545f6a][_0x426e('0x70')]],'%s',_0x352aba):_0x352aba;if(_0x215564[_0x545f6a]['groupBy']){_0xb6064c['group'](_0x352aba);}_0x215564[_0x545f6a]['orderBy']&&_0xb6064c[_0x426e('0x72')](_0x352aba,_0x215564[_0x545f6a][_0x426e('0x73')]==='DESC'?![]:!![]);_0xb6064c['field'](_0x352aba,_0x215564[_0x545f6a][_0x426e('0x75')]||_0x352aba);}if(_0x574051[_0x426e('0x77')]){_0x574051[_0x426e('0x77')]=JSON[_0x426e('0x76')](_0x574051[_0x426e('0x77')]);for(var _0x4d6f3f=0x0;_0x4d6f3f<_0x574051[_0x426e('0x77')][_0x426e('0x31')];_0x4d6f3f+=0x1){if(_0x574051['joins'][_0x4d6f3f]['type']&&_[_0x426e('0x78')](_0x2fe6ba,_0x574051[_0x426e('0x77')][_0x4d6f3f][_0x426e('0x29')])&&_0x574051[_0x426e('0x77')][_0x4d6f3f][_0x426e('0x79')]&&_0x574051['joins'][_0x4d6f3f]['foreignTable']&&_0x574051['joins'][_0x4d6f3f]['foreignKey']){_0xb6064c[_0x574051[_0x426e('0x77')][_0x4d6f3f][_0x426e('0x29')]](_0x574051[_0x426e('0x77')][_0x4d6f3f]['foreignTable'],null,util[_0x426e('0x70')](_0x426e('0x7c'),_0x574051[_0x426e('0x6b')],_0x574051['joins'][_0x4d6f3f][_0x426e('0x79')],_0x574051[_0x426e('0x77')][_0x4d6f3f][_0x426e('0x7a')],_0x574051[_0x426e('0x77')][_0x4d6f3f][_0x426e('0x7b')]));}}}if(_0x574051[_0x426e('0x7d')]){_0x574051[_0x426e('0x7d')]=JSON[_0x426e('0x76')](_0x574051[_0x426e('0x7d')]);_0xb6064c[_0x426e('0x33')](_0x234695(_0x574051['conditions'][_0x426e('0x61')]));}_0x3f6d8d=_0xb6064c[_0x426e('0x7e')]();_0xb6064c[_0x426e('0x19')](_0x438514);_0xb6064c[_0x426e('0x17')](0x0);logger[_0x426e('0x7f')](_0x426e('0x80'),_0xb6064c[_0x426e('0x81')]());return dbH[_0x426e('0x82')][_0x426e('0x2b')](_0xb6064c['toString'](),{'type':dbH[_0x426e('0x82')][_0x426e('0x83')][_0x426e('0x84')]});}})[_0x426e('0x3d')](function(){return{'sql':_0x3f6d8d[_0x426e('0x81')]()};})[_0x426e('0x3d')](respondWithResult(_0x367572,null))[_0x426e('0x3e')](handleError(_0x367572,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index aac3b96..bedf821 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 _0x56a0=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','api','moment','bluebird'];(function(_0x5ba5ca,_0x13b6e5){var _0x80d75e=function(_0x21f1d8){while(--_0x21f1d8){_0x5ba5ca['push'](_0x5ba5ca['shift']());}};_0x80d75e(++_0x13b6e5);}(_0x56a0,0x100));var _0x056a=function(_0x4dcecc,_0x3865b9){_0x4dcecc=_0x4dcecc-0x0;var _0x2aa658=_0x56a0[_0x4dcecc];return _0x2aa658;};'use strict';var _=require('lodash');var util=require(_0x056a('0x0'));var logger=require('../../config/logger')(_0x056a('0x1'));var moment=require(_0x056a('0x2'));var BPromise=require(_0x056a('0x3'));var rp=require(_0x056a('0x4'));var fs=require('fs');var path=require(_0x056a('0x5'));var rimraf=require(_0x056a('0x6'));var config=require(_0x056a('0x7'));var attributes=require(_0x056a('0x8'));module[_0x056a('0x9')]=function(_0x3bf532,_0x4cd2af){return _0x3bf532[_0x056a('0xa')](_0x056a('0xb'),attributes,{'tableName':_0x056a('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x799b=['../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x799b,0x164));var _0xb799=function(_0x4596de,_0x49e8e7){_0x4596de=_0x4596de-0x0;var _0x3f2a40=_0x799b[_0x4596de];return _0x3f2a40;};'use strict';var _=require(_0xb799('0x0'));var util=require(_0xb799('0x1'));var logger=require(_0xb799('0x2'))(_0xb799('0x3'));var moment=require(_0xb799('0x4'));var BPromise=require(_0xb799('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb799('0x6'));var rimraf=require(_0xb799('0x7'));var config=require(_0xb799('0x8'));var attributes=require(_0xb799('0x9'));module[_0xb799('0xa')]=function(_0x111dad,_0x1e98b1){return _0x111dad[_0xb799('0xb')]('AnalyticCustomReport',attributes,{'tableName':_0xb799('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 950a647..d7a40ad 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 _0x3382=['util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash'];(function(_0x427da7,_0x51f105){var _0x1bd435=function(_0x381249){while(--_0x381249){_0x427da7['push'](_0x427da7['shift']());}};_0x1bd435(++_0x51f105);}(_0x3382,0xfb));var _0x2338=function(_0x5e6666,_0x1a5bdf){_0x5e6666=_0x5e6666-0x0;var _0x1869b7=_0x3382[_0x5e6666];return _0x1869b7;};'use strict';var _=require(_0x2338('0x0'));var util=require(_0x2338('0x1'));var moment=require('moment');var BPromise=require(_0x2338('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2338('0x3'));var db=require(_0x2338('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2338('0x5'))(_0x2338('0x6'));var config=require(_0x2338('0x7'));var jayson=require(_0x2338('0x8'));var client=jayson[_0x2338('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4619f0,_0x3b9021,_0x565305){return new BPromise(function(_0x15c237,_0x53e7b9){return client[_0x2338('0xa')](_0x4619f0,_0x565305)[_0x2338('0xb')](function(_0x1b9b5b){logger[_0x2338('0xc')](_0x2338('0xd'),_0x3b9021,_0x2338('0xe'));logger[_0x2338('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x3b9021,_0x2338('0xe'),JSON[_0x2338('0x10')](_0x1b9b5b));if(_0x1b9b5b['error']){if(_0x1b9b5b[_0x2338('0x11')][_0x2338('0x12')]===0x1f4){logger[_0x2338('0x11')](_0x2338('0xd'),_0x3b9021,_0x1b9b5b[_0x2338('0x11')][_0x2338('0x13')]);return _0x53e7b9(_0x1b9b5b[_0x2338('0x11')][_0x2338('0x13')]);}logger[_0x2338('0x11')](_0x2338('0xd'),_0x3b9021,_0x1b9b5b[_0x2338('0x11')]['message']);return _0x15c237(_0x1b9b5b['error'][_0x2338('0x13')]);}else{logger[_0x2338('0xc')](_0x2338('0xd'),_0x3b9021,_0x2338('0xe'));_0x15c237(_0x1b9b5b['result'][_0x2338('0x13')]);}})[_0x2338('0x14')](function(_0x58674f){logger[_0x2338('0x11')](_0x2338('0xd'),_0x3b9021,_0x58674f);_0x53e7b9(_0x58674f);});});}
\ No newline at end of file
+var _0x6eb7=['AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','http','request','then'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x6eb7,0x16f));var _0x76eb=function(_0x365720,_0x315cb5){_0x365720=_0x365720-0x0;var _0x5d5890=_0x6eb7[_0x365720];return _0x5d5890;};'use strict';var _=require(_0x76eb('0x0'));var util=require(_0x76eb('0x1'));var moment=require(_0x76eb('0x2'));var BPromise=require(_0x76eb('0x3'));var rs=require(_0x76eb('0x4'));var fs=require('fs');var Redis=require(_0x76eb('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x76eb('0x6'));var config=require(_0x76eb('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x76eb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf34cef,_0x45eb05,_0x5949a5){return new BPromise(function(_0x3ff71b,_0x540246){return client[_0x76eb('0x9')](_0xf34cef,_0x5949a5)[_0x76eb('0xa')](function(_0x43f98f){logger['info'](_0x76eb('0xb'),_0x45eb05,_0x76eb('0xc'));logger[_0x76eb('0xd')](_0x76eb('0xe'),_0x45eb05,_0x76eb('0xc'),JSON[_0x76eb('0xf')](_0x43f98f));if(_0x43f98f[_0x76eb('0x10')]){if(_0x43f98f[_0x76eb('0x10')][_0x76eb('0x11')]===0x1f4){logger['error'](_0x76eb('0xb'),_0x45eb05,_0x43f98f[_0x76eb('0x10')][_0x76eb('0x12')]);return _0x540246(_0x43f98f[_0x76eb('0x10')][_0x76eb('0x12')]);}logger[_0x76eb('0x10')](_0x76eb('0xb'),_0x45eb05,_0x43f98f['error'][_0x76eb('0x12')]);return _0x3ff71b(_0x43f98f[_0x76eb('0x10')][_0x76eb('0x12')]);}else{logger[_0x76eb('0x13')](_0x76eb('0xb'),_0x45eb05,_0x76eb('0xc'));_0x3ff71b(_0x43f98f[_0x76eb('0x14')][_0x76eb('0x12')]);}})['catch'](function(_0x9bda96){logger['error'](_0x76eb('0xb'),_0x45eb05,_0x9bda96);_0x540246(_0x9bda96);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 537829b..28d8738 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 _0xe330=['show','/:id/preview','preview','/:id/run','run','query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id'];(function(_0x4edb7f,_0x3b68c0){var _0x52a707=function(_0x59bc62){while(--_0x59bc62){_0x4edb7f['push'](_0x4edb7f['shift']());}};_0x52a707(++_0x3b68c0);}(_0xe330,0x1ce));var _0x0e33=function(_0x5198c7,_0x410fa0){_0x5198c7=_0x5198c7-0x0;var _0x5b2166=_0xe330[_0x5198c7];return _0x5b2166;};'use strict';var multer=require(_0x0e33('0x0'));var util=require(_0x0e33('0x1'));var path=require(_0x0e33('0x2'));var timeout=require(_0x0e33('0x3'));var express=require(_0x0e33('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0e33('0x5'));var interaction=require(_0x0e33('0x6'));var config=require(_0x0e33('0x7'));var controller=require(_0x0e33('0x8'));router[_0x0e33('0x9')]('/',auth[_0x0e33('0xa')](),controller[_0x0e33('0xb')]);router['get'](_0x0e33('0xc'),auth[_0x0e33('0xa')](),controller[_0x0e33('0xd')]);router['get'](_0x0e33('0xe'),auth['isAuthenticated'](),controller[_0x0e33('0xf')]);router[_0x0e33('0x9')](_0x0e33('0x10'),auth[_0x0e33('0xa')](),controller[_0x0e33('0x11')]);router[_0x0e33('0x9')]('/:id/query',auth[_0x0e33('0xa')](),controller[_0x0e33('0x12')]);router[_0x0e33('0x13')]('/',auth[_0x0e33('0xa')](),controller[_0x0e33('0x14')]);router[_0x0e33('0x15')](_0x0e33('0xc'),auth[_0x0e33('0xa')](),controller[_0x0e33('0x16')]);router[_0x0e33('0x17')](_0x0e33('0xc'),auth[_0x0e33('0xa')](),controller[_0x0e33('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x0cf6=['post','create','put','/:id','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query'];(function(_0x4eddd7,_0x13fd4e){var _0x4a8af5=function(_0x579dfe){while(--_0x579dfe){_0x4eddd7['push'](_0x4eddd7['shift']());}};_0x4a8af5(++_0x13fd4e);}(_0x0cf6,0xd6));var _0x60cf=function(_0x590ef9,_0x2cbc10){_0x590ef9=_0x590ef9-0x0;var _0x5c7eb3=_0x0cf6[_0x590ef9];return _0x5c7eb3;};'use strict';var multer=require(_0x60cf('0x0'));var util=require(_0x60cf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x60cf('0x2'));var router=express[_0x60cf('0x3')]();var fs_extra=require(_0x60cf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x60cf('0x5'));var config=require('../../config/environment');var controller=require(_0x60cf('0x6'));router[_0x60cf('0x7')]('/',auth[_0x60cf('0x8')](),controller[_0x60cf('0x9')]);router[_0x60cf('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x60cf('0xa')]);router[_0x60cf('0x7')](_0x60cf('0xb'),auth[_0x60cf('0x8')](),controller[_0x60cf('0xc')]);router[_0x60cf('0x7')](_0x60cf('0xd'),auth[_0x60cf('0x8')](),controller[_0x60cf('0xe')]);router['get'](_0x60cf('0xf'),auth[_0x60cf('0x8')](),controller['query']);router[_0x60cf('0x10')]('/',auth[_0x60cf('0x8')](),controller[_0x60cf('0x11')]);router[_0x60cf('0x12')](_0x60cf('0x13'),auth[_0x60cf('0x8')](),controller[_0x60cf('0x14')]);router['delete'](_0x60cf('0x13'),auth['isAuthenticated'](),controller[_0x60cf('0x15')]);module[_0x60cf('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 204d04d..522d853 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 _0x038b=['exports','STRING','TEXT'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x038b,0x114));var _0xb038=function(_0x1a83fc,_0x4623be){_0x1a83fc=_0x1a83fc-0x0;var _0x47cf3e=_0x038b[_0x1a83fc];return _0x47cf3e;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb038('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb038('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb038('0x2')]}};
\ No newline at end of file
+var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x2e2eab,_0x2e609a){var _0x2357bc=function(_0x2235ad){while(--_0x2235ad){_0x2e2eab['push'](_0x2e2eab['shift']());}};_0x2357bc(++_0x2e609a);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0xfdbd[_0x2b0bc2];return _0x56e5b9;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 8a1865a..0231ed7 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 _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x3591c8,_0x460d82){var _0x1512bc=function(_0x1f5bd0){while(--_0x1f5bd0){_0x3591c8['push'](_0x3591c8['shift']());}};_0x1512bc(++_0x460d82);}(_0x53ec,0x192));var _0xc53e=function(_0xd204b0,_0x4c7d1d){_0xd204b0=_0xd204b0-0x0;var _0xfc8310=_0x53ec[_0xd204b0];return _0xfc8310;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
+var _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x1e1c0b,_0x591d01){var _0x33241b=function(_0x3a8aea){while(--_0x3a8aea){_0x1e1c0b['push'](_0x1e1c0b['shift']());}};_0x33241b(++_0x591d01);}(_0x5fab,0x177));var _0xb5fa=function(_0x3566d0,_0x34a49f){_0x3566d0=_0x3566d0-0x0;var _0x3fd4da=_0x5fab[_0x3566d0];return _0x3fd4da;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index c49fbdf..f7909d8 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 _0xaed6=['bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api'];(function(_0x340e24,_0xde71e){var _0x1808a=function(_0x2a602e){while(--_0x2a602e){_0x340e24['push'](_0x340e24['shift']());}};_0x1808a(++_0xde71e);}(_0xaed6,0x1d1));var _0x6aed=function(_0x4e138a,_0x28ce99){_0x4e138a=_0x4e138a-0x0;var _0x17f686=_0xaed6[_0x4e138a];return _0x17f686;};'use strict';var _=require('lodash');var util=require(_0x6aed('0x0'));var logger=require(_0x6aed('0x1'))(_0x6aed('0x2'));var moment=require('moment');var BPromise=require(_0x6aed('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6aed('0x4'));var rimraf=require(_0x6aed('0x5'));var config=require(_0x6aed('0x6'));var attributes=require(_0x6aed('0x7'));module[_0x6aed('0x8')]=function(_0x1b396c,_0x36f77e){return _0x1b396c[_0x6aed('0x9')](_0x6aed('0xa'),attributes,{'tableName':_0x6aed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3347=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports'];(function(_0x4491a7,_0x4215e1){var _0x23fc95=function(_0x1decf4){while(--_0x1decf4){_0x4491a7['push'](_0x4491a7['shift']());}};_0x23fc95(++_0x4215e1);}(_0x3347,0x168));var _0x7334=function(_0x283152,_0x162a4d){_0x283152=_0x283152-0x0;var _0x3319e8=_0x3347[_0x283152];return _0x3319e8;};'use strict';var _=require(_0x7334('0x0'));var util=require('util');var logger=require(_0x7334('0x1'))(_0x7334('0x2'));var moment=require(_0x7334('0x3'));var BPromise=require(_0x7334('0x4'));var rp=require(_0x7334('0x5'));var fs=require('fs');var path=require(_0x7334('0x6'));var rimraf=require(_0x7334('0x7'));var config=require('../../config/environment');var attributes=require(_0x7334('0x8'));module[_0x7334('0x9')]=function(_0x39c216,_0x31ba06){return _0x39c216['define'](_0x7334('0xa'),attributes,{'tableName':_0x7334('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index e77d9af..1954a26 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 _0x9447=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x135ad5,_0x3036b7){var _0x500007=function(_0x4d81a1){while(--_0x4d81a1){_0x135ad5['push'](_0x135ad5['shift']());}};_0x500007(++_0x3036b7);}(_0x9447,0x176));var _0x7944=function(_0xbf6d10,_0x33369b){_0xbf6d10=_0xbf6d10-0x0;var _0x8c8ad3=_0x9447[_0xbf6d10];return _0x8c8ad3;};'use strict';var _=require(_0x7944('0x0'));var util=require('util');var moment=require(_0x7944('0x1'));var BPromise=require(_0x7944('0x2'));var rs=require(_0x7944('0x3'));var fs=require('fs');var Redis=require(_0x7944('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7944('0x5'));var logger=require(_0x7944('0x6'))(_0x7944('0x7'));var config=require('../../config/environment');var jayson=require(_0x7944('0x8'));var client=jayson[_0x7944('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x571e91,_0x26e21b,_0x3d73b4){return new BPromise(function(_0x435f30,_0x5dbe6b){return client[_0x7944('0xa')](_0x571e91,_0x3d73b4)[_0x7944('0xb')](function(_0x545073){logger[_0x7944('0xc')](_0x7944('0xd'),_0x26e21b,_0x7944('0xe'));logger['debug'](_0x7944('0xf'),_0x26e21b,_0x7944('0xe'),JSON[_0x7944('0x10')](_0x545073));if(_0x545073[_0x7944('0x11')]){if(_0x545073['error']['code']===0x1f4){logger[_0x7944('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x26e21b,_0x545073[_0x7944('0x11')][_0x7944('0x12')]);return _0x5dbe6b(_0x545073[_0x7944('0x11')][_0x7944('0x12')]);}logger[_0x7944('0x11')](_0x7944('0xd'),_0x26e21b,_0x545073['error']['message']);return _0x435f30(_0x545073[_0x7944('0x11')][_0x7944('0x12')]);}else{logger[_0x7944('0xc')](_0x7944('0xd'),_0x26e21b,_0x7944('0xe'));_0x435f30(_0x545073[_0x7944('0x13')][_0x7944('0x12')]);}})[_0x7944('0x14')](function(_0x366471){logger[_0x7944('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x26e21b,_0x366471);_0x5dbe6b(_0x366471);});});}
\ No newline at end of file
+var _0x4455=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird'];(function(_0x545bc7,_0x2d1099){var _0x1204e6=function(_0x1aaca8){while(--_0x1aaca8){_0x545bc7['push'](_0x545bc7['shift']());}};_0x1204e6(++_0x2d1099);}(_0x4455,0xe3));var _0x5445=function(_0x498afe,_0x4b2585){_0x498afe=_0x498afe-0x0;var _0x428049=_0x4455[_0x498afe];return _0x428049;};'use strict';var _=require(_0x5445('0x0'));var util=require(_0x5445('0x1'));var moment=require(_0x5445('0x2'));var BPromise=require(_0x5445('0x3'));var rs=require(_0x5445('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5445('0x5'))['db'];var utils=require(_0x5445('0x6'));var logger=require(_0x5445('0x7'))(_0x5445('0x8'));var config=require(_0x5445('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5445('0xa')][_0x5445('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cadd5,_0x3d4818,_0x14ef37){return new BPromise(function(_0xcba4ef,_0x387d91){return client[_0x5445('0xc')](_0x5cadd5,_0x14ef37)['then'](function(_0x3fa909){logger[_0x5445('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3d4818,_0x5445('0xe'));logger[_0x5445('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3d4818,_0x5445('0xe'),JSON[_0x5445('0x10')](_0x3fa909));if(_0x3fa909[_0x5445('0x11')]){if(_0x3fa909[_0x5445('0x11')][_0x5445('0x12')]===0x1f4){logger[_0x5445('0x11')](_0x5445('0x13'),_0x3d4818,_0x3fa909[_0x5445('0x11')][_0x5445('0x14')]);return _0x387d91(_0x3fa909[_0x5445('0x11')][_0x5445('0x14')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x3d4818,_0x3fa909[_0x5445('0x11')][_0x5445('0x14')]);return _0xcba4ef(_0x3fa909[_0x5445('0x11')][_0x5445('0x14')]);}else{logger[_0x5445('0xd')](_0x5445('0x13'),_0x3d4818,'request\x20sent');_0xcba4ef(_0x3fa909['result'][_0x5445('0x14')]);}})['catch'](function(_0x5eb68a){logger[_0x5445('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3d4818,_0x5eb68a);_0x387d91(_0x5eb68a);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index e1df8e5..3383d98 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 _0x9271=['delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id/run','run','/:id/query','post','create','put','/:id','update'];(function(_0x1afd25,_0xee6014){var _0x80da5e=function(_0x51e830){while(--_0x51e830){_0x1afd25['push'](_0x1afd25['shift']());}};_0x80da5e(++_0xee6014);}(_0x9271,0x1e3));var _0x1927=function(_0x27e94f,_0x369fe1){_0x27e94f=_0x27e94f-0x0;var _0x1436f5=_0x9271[_0x27e94f];return _0x1436f5;};'use strict';var multer=require(_0x1927('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1927('0x1'));var express=require(_0x1927('0x2'));var router=express[_0x1927('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1927('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1927('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0x1927('0x6')]('/',auth[_0x1927('0x7')](),controller[_0x1927('0x8')]);router['get']('/:id',auth[_0x1927('0x7')](),controller['show']);router[_0x1927('0x6')]('/:id/preview',auth[_0x1927('0x7')](),controller['preview']);router[_0x1927('0x6')](_0x1927('0x9'),auth[_0x1927('0x7')](),controller[_0x1927('0xa')]);router['get'](_0x1927('0xb'),auth[_0x1927('0x7')](),controller['query']);router[_0x1927('0xc')]('/',auth['isAuthenticated'](),controller[_0x1927('0xd')]);router[_0x1927('0xe')](_0x1927('0xf'),auth['isAuthenticated'](),controller[_0x1927('0x10')]);router[_0x1927('0x11')](_0x1927('0xf'),auth[_0x1927('0x7')](),controller[_0x1927('0x12')]);module[_0x1927('0x13')]=router;
\ No newline at end of file
+var _0x3408=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports'];(function(_0x20d892,_0x167fcd){var _0x5b2867=function(_0x512ea6){while(--_0x512ea6){_0x20d892['push'](_0x20d892['shift']());}};_0x5b2867(++_0x167fcd);}(_0x3408,0x177));var _0x8340=function(_0x1ea5db,_0xa6fb22){_0x1ea5db=_0x1ea5db-0x0;var _0x25c0bf=_0x3408[_0x1ea5db];return _0x25c0bf;};'use strict';var multer=require(_0x8340('0x0'));var util=require(_0x8340('0x1'));var path=require(_0x8340('0x2'));var timeout=require(_0x8340('0x3'));var express=require(_0x8340('0x4'));var router=express[_0x8340('0x5')]();var fs_extra=require(_0x8340('0x6'));var auth=require(_0x8340('0x7'));var interaction=require(_0x8340('0x8'));var config=require(_0x8340('0x9'));var controller=require(_0x8340('0xa'));router[_0x8340('0xb')]('/',auth[_0x8340('0xc')](),controller[_0x8340('0xd')]);router[_0x8340('0xb')](_0x8340('0xe'),auth[_0x8340('0xc')](),controller['show']);router[_0x8340('0xb')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0x8340('0xb')](_0x8340('0xf'),auth[_0x8340('0xc')](),controller[_0x8340('0x10')]);router[_0x8340('0xb')](_0x8340('0x11'),auth['isAuthenticated'](),controller[_0x8340('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8340('0x13')]);router[_0x8340('0x14')]('/:id',auth[_0x8340('0xc')](),controller[_0x8340('0x15')]);router[_0x8340('0x16')](_0x8340('0xe'),auth[_0x8340('0xc')](),controller[_0x8340('0x17')]);module[_0x8340('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index db0fd6e..e9aad17 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 _0x2c44=['DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','csv','pdf','xlsx'];(function(_0x495c2b,_0x5044b0){var _0x370520=function(_0x57c87f){while(--_0x57c87f){_0x495c2b['push'](_0x495c2b['shift']());}};_0x370520(++_0x5044b0);}(_0x2c44,0xf0));var _0x42c4=function(_0x2ecaf6,_0x60d2f5){_0x2ecaf6=_0x2ecaf6-0x0;var _0x29004f=_0x2c44[_0x2ecaf6];return _0x29004f;};'use strict';var Sequelize=require(_0x42c4('0x0'));var moment=require(_0x42c4('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x42c4('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x42c4('0x3')](_0x42c4('0x4'),_0x42c4('0x5'),_0x42c4('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x42c4('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x42c4('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x42c4('0x2')],'defaultValue':_0x42c4('0x8')},'type':{'type':Sequelize[_0x42c4('0x3')](_0x42c4('0x9'),_0x42c4('0xa')),'allowNull':![],'defaultValue':_0x42c4('0x9')},'reportId':{'type':Sequelize[_0x42c4('0xb')](0xb)[_0x42c4('0xc')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x079c=['manual','scheduled','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading'];(function(_0x2017bf,_0x2ec352){var _0x138cda=function(_0x351c87){while(--_0x351c87){_0x2017bf['push'](_0x2017bf['shift']());}};_0x138cda(++_0x2ec352);}(_0x079c,0x1d7));var _0xc079=function(_0x797a70,_0x466e0b){_0x797a70=_0x797a70-0x0;var _0x53d9fd=_0x079c[_0x797a70];return _0x53d9fd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc079('0x0'));module[_0xc079('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xc079('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xc079('0x3')](_0xc079('0x4'),_0xc079('0x5'),_0xc079('0x6')),'allowNull':![],'defaultValue':_0xc079('0x4')},'savename':{'type':Sequelize[_0xc079('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc079('0x7')]},'endDate':{'type':Sequelize[_0xc079('0x7')]},'status':{'type':Sequelize[_0xc079('0x2')],'defaultValue':_0xc079('0x8')},'type':{'type':Sequelize[_0xc079('0x3')](_0xc079('0x9'),_0xc079('0xa')),'allowNull':![],'defaultValue':_0xc079('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xc079('0xb')]},'reportType':{'type':Sequelize[_0xc079('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 3355280..da6e081 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 _0x1419=['hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','download','basename','savename','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','output','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','apply','reject','save','update','destroy','then','get','ExtractedReports','sendStatus','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields'];(function(_0x358634,_0x3d8e70){var _0x3d0ef7=function(_0x4fd949){while(--_0x4fd949){_0x358634['push'](_0x358634['shift']());}};_0x3d0ef7(++_0x3d8e70);}(_0x1419,0xe3));var _0x9141=function(_0x23b3c8,_0x685dde){_0x23b3c8=_0x23b3c8-0x0;var _0x31c27c=_0x1419[_0x23b3c8];return _0x31c27c;};'use strict';var emlformat=require(_0x9141('0x0'));var rimraf=require(_0x9141('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9141('0x2'));var rp=require(_0x9141('0x3'));var moment=require(_0x9141('0x4'));var BPromise=require(_0x9141('0x5'));var Mustache=require('mustache');var util=require(_0x9141('0x6'));var path=require(_0x9141('0x7'));var sox=require('sox');var csv=require(_0x9141('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9141('0x9'));var _=require('lodash');var squel=require(_0x9141('0xa'));var crypto=require('crypto');var jsforce=require(_0x9141('0xb'));var deskjs=require(_0x9141('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9141('0xd'));var Redis=require(_0x9141('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9141('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9141('0x10'))('api');var utils=require(_0x9141('0x11'));var config=require(_0x9141('0x12'));var licenseUtil=require(_0x9141('0x13'));var db=require(_0x9141('0x14'))['db'];function respondWithStatusCode(_0x369ce0,_0x3b198c){_0x3b198c=_0x3b198c||0xcc;return function(_0xdba496){if(_0xdba496){return _0x369ce0['sendStatus'](_0x3b198c);}return _0x369ce0[_0x9141('0x15')](_0x3b198c)[_0x9141('0x16')]();};}function respondWithResult(_0x346866,_0x20ee91){_0x20ee91=_0x20ee91||0xc8;return function(_0x5b9e50){if(_0x5b9e50){return _0x346866[_0x9141('0x15')](_0x20ee91)[_0x9141('0x17')](_0x5b9e50);}};}function respondWithFilteredResult(_0x3ae46e,_0x218f41){return function(_0x287509){if(_0x287509){var _0x52118e=typeof _0x218f41[_0x9141('0x18')]==='undefined'&&typeof _0x218f41[_0x9141('0x19')]===_0x9141('0x1a');var _0x39fcc7=_0x287509[_0x9141('0x1b')];var _0x29e998=_0x52118e?0x0:_0x218f41['offset'];var _0x4b4d15=_0x52118e?_0x287509[_0x9141('0x1b')]:_0x218f41['offset']+_0x218f41['limit'];var _0x3de2cc;if(_0x4b4d15>=_0x39fcc7){_0x4b4d15=_0x39fcc7;_0x3de2cc=0xc8;}else{_0x3de2cc=0xce;}_0x3ae46e[_0x9141('0x15')](_0x3de2cc);return _0x3ae46e['set']('Content-Range',_0x29e998+'-'+_0x4b4d15+'/'+_0x39fcc7)['json'](_0x287509);}return null;};}function patchUpdates(_0x56f636){return function(_0x9d6cf){try{jsonpatch[_0x9141('0x1c')](_0x9d6cf,_0x56f636,!![]);}catch(_0x48a7d1){return BPromise[_0x9141('0x1d')](_0x48a7d1);}return _0x9d6cf[_0x9141('0x1e')]();};}function saveUpdates(_0x2e4e60,_0x11d9d3){return function(_0x7ffa84){if(_0x7ffa84){return _0x7ffa84[_0x9141('0x1f')](_0x2e4e60)['then'](function(_0x243842){return _0x243842;});}return null;};}function removeEntity(_0x331e0d,_0x1a42e1){return function(_0x36bc44){if(_0x36bc44){return _0x36bc44[_0x9141('0x20')]()[_0x9141('0x21')](function(){var _0x133cee=_0x36bc44[_0x9141('0x22')]({'plain':!![]});var _0xab4c7b=_0x9141('0x23');return db['UserProfileResource'][_0x9141('0x20')]({'where':{'type':_0xab4c7b,'resourceId':_0x133cee['id']}})['then'](function(){return _0x36bc44;});})[_0x9141('0x21')](function(){_0x331e0d['status'](0xcc)[_0x9141('0x16')]();});}};}function handleEntityNotFound(_0x8c1fec,_0x11a499){return function(_0xd78912){if(!_0xd78912){_0x8c1fec[_0x9141('0x24')](0x194);}return _0xd78912;};}function handleError(_0x4d7275,_0x18d065){_0x18d065=_0x18d065||0x1f4;return function(_0x80e391){logger[_0x9141('0x25')](_0x80e391[_0x9141('0x26')]);if(_0x80e391['name']){delete _0x80e391[_0x9141('0x27')];}_0x4d7275['status'](_0x18d065)['send'](_0x80e391);};}exports[_0x9141('0x28')]=function(_0x50b660,_0x5f4de9){var _0x253b4a={},_0x5cc97e={},_0x50f953={'count':0x0,'rows':[]};var _0x4d742c=_[_0x9141('0x29')](db[_0x9141('0x2a')][_0x9141('0x2b')],function(_0x3f6c83){return{'name':_0x3f6c83[_0x9141('0x2c')],'type':_0x3f6c83['type'][_0x9141('0x2d')]};});_0x5cc97e['model']=_[_0x9141('0x29')](_0x4d742c,'name');_0x5cc97e[_0x9141('0x2e')]=_['keys'](_0x50b660['query']);_0x5cc97e[_0x9141('0x2f')]=_[_0x9141('0x30')](_0x5cc97e[_0x9141('0x31')],_0x5cc97e[_0x9141('0x2e')]);_0x253b4a[_0x9141('0x32')]=_[_0x9141('0x30')](_0x5cc97e[_0x9141('0x31')],qs[_0x9141('0x33')](_0x50b660[_0x9141('0x2e')][_0x9141('0x33')]));_0x253b4a['attributes']=_0x253b4a[_0x9141('0x32')]['length']?_0x253b4a[_0x9141('0x32')]:_0x5cc97e[_0x9141('0x31')];if(!_0x50b660[_0x9141('0x2e')][_0x9141('0x34')](_0x9141('0x35'))){_0x253b4a[_0x9141('0x19')]=qs[_0x9141('0x19')](_0x50b660[_0x9141('0x2e')][_0x9141('0x19')]);_0x253b4a[_0x9141('0x18')]=qs[_0x9141('0x18')](_0x50b660[_0x9141('0x2e')][_0x9141('0x18')]);}_0x253b4a[_0x9141('0x36')]=qs[_0x9141('0x37')](_0x50b660[_0x9141('0x2e')][_0x9141('0x37')]);_0x253b4a[_0x9141('0x38')]=qs[_0x9141('0x2f')](_['pick'](_0x50b660[_0x9141('0x2e')],_0x5cc97e['filters']),_0x4d742c);if(_0x50b660[_0x9141('0x2e')][_0x9141('0x39')]){_0x253b4a['where']=_[_0x9141('0x3a')](_0x253b4a['where'],{'$or':_[_0x9141('0x29')](_0x4d742c,function(_0x438b6d){if(_0x438b6d[_0x9141('0x3b')]!==_0x9141('0x3c')){var _0x28154b={};_0x28154b[_0x438b6d[_0x9141('0x27')]]={'$like':'%'+_0x50b660['query']['filter']+'%'};return _0x28154b;}})});}_0x253b4a=_[_0x9141('0x3a')]({},_0x253b4a,_0x50b660[_0x9141('0x3d')]);var _0x192f1a={'where':_0x253b4a[_0x9141('0x38')]};return db[_0x9141('0x2a')][_0x9141('0x1b')](_0x192f1a)['then'](function(_0x3dcc75){_0x50f953[_0x9141('0x1b')]=_0x3dcc75;if(_0x50b660[_0x9141('0x2e')][_0x9141('0x3e')]){_0x253b4a[_0x9141('0x3f')]=[{'all':!![]}];}return db[_0x9141('0x2a')][_0x9141('0x40')](_0x253b4a);})[_0x9141('0x21')](function(_0xfa40f8){_0x50f953[_0x9141('0x41')]=_0xfa40f8;return _0x50f953;})[_0x9141('0x21')](respondWithFilteredResult(_0x5f4de9,_0x253b4a))[_0x9141('0x42')](handleError(_0x5f4de9,null));};exports[_0x9141('0x43')]=function(_0x4000d6,_0x1a108b){var _0x38306a={'raw':!![],'where':{'id':_0x4000d6[_0x9141('0x44')]['id']}},_0x1d16cb={};_0x1d16cb[_0x9141('0x31')]=_[_0x9141('0x45')](db[_0x9141('0x2a')][_0x9141('0x2b')]);_0x1d16cb[_0x9141('0x2e')]=_['keys'](_0x4000d6[_0x9141('0x2e')]);_0x1d16cb['filters']=_['intersection'](_0x1d16cb[_0x9141('0x31')],_0x1d16cb['query']);_0x38306a['attributes']=_[_0x9141('0x30')](_0x1d16cb[_0x9141('0x31')],qs[_0x9141('0x33')](_0x4000d6['query']['fields']));_0x38306a[_0x9141('0x32')]=_0x38306a['attributes'][_0x9141('0x46')]?_0x38306a['attributes']:_0x1d16cb[_0x9141('0x31')];if(_0x4000d6[_0x9141('0x2e')][_0x9141('0x3e')]){_0x38306a[_0x9141('0x3f')]=[{'all':!![]}];}_0x38306a=_[_0x9141('0x3a')]({},_0x38306a,_0x4000d6[_0x9141('0x3d')]);return db[_0x9141('0x2a')][_0x9141('0x47')](_0x38306a)[_0x9141('0x21')](handleEntityNotFound(_0x1a108b,null))['then'](respondWithResult(_0x1a108b,null))[_0x9141('0x42')](handleError(_0x1a108b,null));};exports['create']=function(_0x40a16a,_0x1ee9a5){return db[_0x9141('0x2a')][_0x9141('0x48')](_0x40a16a[_0x9141('0x49')],{})[_0x9141('0x21')](function(_0x9add77){var _0x1682a9=_0x40a16a[_0x9141('0x4a')][_0x9141('0x22')]({'plain':!![]});if(!_0x1682a9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1682a9[_0x9141('0x4b')]===_0x9141('0x4a')){var _0xf04bdc=_0x9add77[_0x9141('0x22')]({'plain':!![]});var _0x12efbc='ExtractedReports';return db[_0x9141('0x4c')][_0x9141('0x47')]({'where':{'name':_0x12efbc,'userProfileId':_0x1682a9[_0x9141('0x4d')]},'raw':!![]})['then'](function(_0x3645fa){if(_0x3645fa&&_0x3645fa[_0x9141('0x4e')]===0x0){return db['UserProfileResource'][_0x9141('0x48')]({'name':_0xf04bdc['name'],'resourceId':_0xf04bdc['id'],'type':_0x3645fa['name'],'sectionId':_0x3645fa['id']},{})[_0x9141('0x21')](function(){return _0x9add77;});}else{return _0x9add77;}})[_0x9141('0x42')](function(_0x36e8c7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36e8c7);throw _0x36e8c7;});}return _0x9add77;})[_0x9141('0x21')](respondWithResult(_0x1ee9a5,0xc9))[_0x9141('0x42')](handleError(_0x1ee9a5,null));};exports['update']=function(_0x113d47,_0x498f06){if(_0x113d47[_0x9141('0x49')]['id']){delete _0x113d47[_0x9141('0x49')]['id'];}return db['AnalyticExtractedReport'][_0x9141('0x47')]({'where':{'id':_0x113d47[_0x9141('0x44')]['id']}})['then'](handleEntityNotFound(_0x498f06,null))['then'](saveUpdates(_0x113d47[_0x9141('0x49')],null))[_0x9141('0x21')](respondWithResult(_0x498f06,null))[_0x9141('0x42')](handleError(_0x498f06,null));};exports[_0x9141('0x20')]=function(_0x14d9bd,_0x4a94d7){return db[_0x9141('0x2a')][_0x9141('0x47')]({'where':{'id':_0x14d9bd[_0x9141('0x44')]['id']}})[_0x9141('0x21')](handleEntityNotFound(_0x4a94d7,null))['then'](removeEntity(_0x4a94d7,null))[_0x9141('0x42')](handleError(_0x4a94d7,null));};exports[_0x9141('0x4f')]=function(_0x1b5c20,_0x1fa180,_0x25fde9){return db[_0x9141('0x2a')]['find']({'where':{'id':_0x1b5c20[_0x9141('0x44')]['id']},'attributes':[_0x9141('0x27'),_0x9141('0x50'),_0x9141('0x51'),'output'],'raw':!![]})[_0x9141('0x21')](handleEntityNotFound(_0x1fa180,null))['then'](function(_0xeffda6){if(_0xeffda6){if(!fs[_0x9141('0x52')](path[_0x9141('0x53')](config[_0x9141('0x54')],_0x9141('0x55'),_0xeffda6[_0x9141('0x51')]))){throw new db['Sequelize'][(_0x9141('0x56'))](_0x9141('0x57'));}if(_0x1b5c20['query'][_0x9141('0x58')]){return _0x1fa180[_0x9141('0x24')](0xc8);}return _0x1fa180['download'](path['join'](config['root'],'server/files/reports',_0xeffda6[_0x9141('0x51')]),util[_0x9141('0x59')](_0x9141('0x5a'),_0xeffda6[_0x9141('0x50')]||_0xeffda6[_0x9141('0x27')],_0xeffda6[_0x9141('0x5b')][_0x9141('0x5c')]()));}})[_0x9141('0x42')](handleError(_0x1fa180,null));};
\ No newline at end of file
+var _0x99e1=['%s.%s','basename','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','join','root','server/files/reports','exists','format'];(function(_0x3893f5,_0x207595){var _0x5cf9d0=function(_0x452928){while(--_0x452928){_0x3893f5['push'](_0x3893f5['shift']());}};_0x5cf9d0(++_0x207595);}(_0x99e1,0x12c));var _0x199e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x99e1[_0x2576d7];return _0x16a08c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x199e('0x0'));var zipdir=require(_0x199e('0x1'));var jsonpatch=require(_0x199e('0x2'));var rp=require(_0x199e('0x3'));var moment=require('moment');var BPromise=require(_0x199e('0x4'));var Mustache=require(_0x199e('0x5'));var util=require(_0x199e('0x6'));var path=require(_0x199e('0x7'));var sox=require(_0x199e('0x8'));var csv=require(_0x199e('0x9'));var ejs=require(_0x199e('0xa'));var fs=require('fs');var fs_extra=require(_0x199e('0xb'));var _=require('lodash');var squel=require(_0x199e('0xc'));var crypto=require(_0x199e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x199e('0xe'));var toCsv=require(_0x199e('0x9'));var querystring=require(_0x199e('0xf'));var Papa=require(_0x199e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x199e('0x11'));var as=require(_0x199e('0x12'));var hardwareService=require(_0x199e('0x13'));var logger=require(_0x199e('0x14'))(_0x199e('0x15'));var utils=require(_0x199e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x199e('0x17'));var db=require(_0x199e('0x18'))['db'];function respondWithStatusCode(_0xfcc8c6,_0x35a2d3){_0x35a2d3=_0x35a2d3||0xcc;return function(_0x5bd895){if(_0x5bd895){return _0xfcc8c6[_0x199e('0x19')](_0x35a2d3);}return _0xfcc8c6['status'](_0x35a2d3)['end']();};}function respondWithResult(_0x518f55,_0x1bacaa){_0x1bacaa=_0x1bacaa||0xc8;return function(_0x7eefc0){if(_0x7eefc0){return _0x518f55[_0x199e('0x1a')](_0x1bacaa)[_0x199e('0x1b')](_0x7eefc0);}};}function respondWithFilteredResult(_0x2e1ce2,_0x1cb8f3){return function(_0x32caf1){if(_0x32caf1){var _0x1b2ff1=typeof _0x1cb8f3[_0x199e('0x1c')]===_0x199e('0x1d')&&typeof _0x1cb8f3[_0x199e('0x1e')]==='undefined';var _0x498aff=_0x32caf1[_0x199e('0x1f')];var _0x5b9865=_0x1b2ff1?0x0:_0x1cb8f3[_0x199e('0x1c')];var _0x5c1528=_0x1b2ff1?_0x32caf1['count']:_0x1cb8f3[_0x199e('0x1c')]+_0x1cb8f3['limit'];var _0x5e0dfb;if(_0x5c1528>=_0x498aff){_0x5c1528=_0x498aff;_0x5e0dfb=0xc8;}else{_0x5e0dfb=0xce;}_0x2e1ce2[_0x199e('0x1a')](_0x5e0dfb);return _0x2e1ce2[_0x199e('0x20')](_0x199e('0x21'),_0x5b9865+'-'+_0x5c1528+'/'+_0x498aff)[_0x199e('0x1b')](_0x32caf1);}return null;};}function patchUpdates(_0x4648ea){return function(_0x5327b6){try{jsonpatch['apply'](_0x5327b6,_0x4648ea,!![]);}catch(_0x54739a){return BPromise[_0x199e('0x22')](_0x54739a);}return _0x5327b6[_0x199e('0x23')]();};}function saveUpdates(_0x39e33b,_0xd114d1){return function(_0x12d7d1){if(_0x12d7d1){return _0x12d7d1[_0x199e('0x24')](_0x39e33b)[_0x199e('0x25')](function(_0x53b356){return _0x53b356;});}return null;};}function removeEntity(_0x457767,_0x2e4142){return function(_0x303e84){if(_0x303e84){return _0x303e84[_0x199e('0x26')]()[_0x199e('0x25')](function(){var _0x27741c=_0x303e84[_0x199e('0x27')]({'plain':!![]});var _0x3e036b=_0x199e('0x28');return db[_0x199e('0x29')][_0x199e('0x26')]({'where':{'type':_0x3e036b,'resourceId':_0x27741c['id']}})[_0x199e('0x25')](function(){return _0x303e84;});})[_0x199e('0x25')](function(){_0x457767[_0x199e('0x1a')](0xcc)[_0x199e('0x2a')]();});}};}function handleEntityNotFound(_0x409e6d,_0x48b27c){return function(_0x20a293){if(!_0x20a293){_0x409e6d[_0x199e('0x19')](0x194);}return _0x20a293;};}function handleError(_0xd40447,_0x32ded9){_0x32ded9=_0x32ded9||0x1f4;return function(_0x4b9047){logger[_0x199e('0x2b')](_0x4b9047[_0x199e('0x2c')]);if(_0x4b9047[_0x199e('0x2d')]){delete _0x4b9047[_0x199e('0x2d')];}_0xd40447['status'](_0x32ded9)['send'](_0x4b9047);};}exports[_0x199e('0x2e')]=function(_0x234df0,_0x4461ae){var _0x3800a9={},_0x3dcc50={},_0x59fe6b={'count':0x0,'rows':[]};var _0x1c59cc=_['map'](db[_0x199e('0x2f')][_0x199e('0x30')],function(_0x5b8aa7){return{'name':_0x5b8aa7[_0x199e('0x31')],'type':_0x5b8aa7[_0x199e('0x32')][_0x199e('0x33')]};});_0x3dcc50[_0x199e('0x34')]=_[_0x199e('0x35')](_0x1c59cc,_0x199e('0x2d'));_0x3dcc50[_0x199e('0x36')]=_[_0x199e('0x37')](_0x234df0[_0x199e('0x36')]);_0x3dcc50[_0x199e('0x38')]=_['intersection'](_0x3dcc50[_0x199e('0x34')],_0x3dcc50[_0x199e('0x36')]);_0x3800a9[_0x199e('0x39')]=_[_0x199e('0x3a')](_0x3dcc50[_0x199e('0x34')],qs[_0x199e('0x3b')](_0x234df0[_0x199e('0x36')][_0x199e('0x3b')]));_0x3800a9['attributes']=_0x3800a9[_0x199e('0x39')][_0x199e('0x3c')]?_0x3800a9['attributes']:_0x3dcc50[_0x199e('0x34')];if(!_0x234df0[_0x199e('0x36')][_0x199e('0x3d')]('nolimit')){_0x3800a9[_0x199e('0x1e')]=qs['limit'](_0x234df0[_0x199e('0x36')][_0x199e('0x1e')]);_0x3800a9[_0x199e('0x1c')]=qs['offset'](_0x234df0['query'][_0x199e('0x1c')]);}_0x3800a9[_0x199e('0x3e')]=qs['sort'](_0x234df0[_0x199e('0x36')][_0x199e('0x3f')]);_0x3800a9[_0x199e('0x40')]=qs[_0x199e('0x38')](_[_0x199e('0x41')](_0x234df0[_0x199e('0x36')],_0x3dcc50['filters']),_0x1c59cc);if(_0x234df0['query'][_0x199e('0x42')]){_0x3800a9[_0x199e('0x40')]=_[_0x199e('0x43')](_0x3800a9['where'],{'$or':_[_0x199e('0x35')](_0x1c59cc,function(_0x19f644){if(_0x19f644[_0x199e('0x32')]!==_0x199e('0x44')){var _0x198b21={};_0x198b21[_0x19f644['name']]={'$like':'%'+_0x234df0[_0x199e('0x36')]['filter']+'%'};return _0x198b21;}})});}_0x3800a9=_['merge']({},_0x3800a9,_0x234df0[_0x199e('0x45')]);var _0x3ec04c={'where':_0x3800a9[_0x199e('0x40')]};return db[_0x199e('0x2f')][_0x199e('0x1f')](_0x3ec04c)['then'](function(_0x1671c8){_0x59fe6b[_0x199e('0x1f')]=_0x1671c8;if(_0x234df0['query'][_0x199e('0x46')]){_0x3800a9[_0x199e('0x47')]=[{'all':!![]}];}return db[_0x199e('0x2f')][_0x199e('0x48')](_0x3800a9);})[_0x199e('0x25')](function(_0x61276a){_0x59fe6b[_0x199e('0x49')]=_0x61276a;return _0x59fe6b;})[_0x199e('0x25')](respondWithFilteredResult(_0x4461ae,_0x3800a9))[_0x199e('0x4a')](handleError(_0x4461ae,null));};exports[_0x199e('0x4b')]=function(_0x4c52e5,_0x5c3e6b){var _0x4d0835={'raw':!![],'where':{'id':_0x4c52e5[_0x199e('0x4c')]['id']}},_0x114db7={};_0x114db7[_0x199e('0x34')]=_[_0x199e('0x37')](db[_0x199e('0x2f')][_0x199e('0x30')]);_0x114db7[_0x199e('0x36')]=_[_0x199e('0x37')](_0x4c52e5[_0x199e('0x36')]);_0x114db7[_0x199e('0x38')]=_[_0x199e('0x3a')](_0x114db7[_0x199e('0x34')],_0x114db7[_0x199e('0x36')]);_0x4d0835['attributes']=_['intersection'](_0x114db7['model'],qs[_0x199e('0x3b')](_0x4c52e5[_0x199e('0x36')][_0x199e('0x3b')]));_0x4d0835[_0x199e('0x39')]=_0x4d0835[_0x199e('0x39')][_0x199e('0x3c')]?_0x4d0835[_0x199e('0x39')]:_0x114db7['model'];if(_0x4c52e5[_0x199e('0x36')][_0x199e('0x46')]){_0x4d0835[_0x199e('0x47')]=[{'all':!![]}];}_0x4d0835=_['merge']({},_0x4d0835,_0x4c52e5[_0x199e('0x45')]);return db['AnalyticExtractedReport'][_0x199e('0x4d')](_0x4d0835)['then'](handleEntityNotFound(_0x5c3e6b,null))[_0x199e('0x25')](respondWithResult(_0x5c3e6b,null))[_0x199e('0x4a')](handleError(_0x5c3e6b,null));};exports['create']=function(_0x9f249a,_0x198600){return db[_0x199e('0x2f')]['create'](_0x9f249a[_0x199e('0x4e')],{})[_0x199e('0x25')](function(_0x405e37){var _0xc09f32=_0x9f249a[_0x199e('0x4f')][_0x199e('0x27')]({'plain':!![]});if(!_0xc09f32)throw new Error(_0x199e('0x50'));if(_0xc09f32[_0x199e('0x51')]===_0x199e('0x4f')){var _0x446c96=_0x405e37['get']({'plain':!![]});var _0x32cdca=_0x199e('0x28');return db[_0x199e('0x52')][_0x199e('0x4d')]({'where':{'name':_0x32cdca,'userProfileId':_0xc09f32[_0x199e('0x53')]},'raw':!![]})[_0x199e('0x25')](function(_0x2bf593){if(_0x2bf593&&_0x2bf593[_0x199e('0x54')]===0x0){return db[_0x199e('0x29')][_0x199e('0x55')]({'name':_0x446c96[_0x199e('0x2d')],'resourceId':_0x446c96['id'],'type':_0x2bf593[_0x199e('0x2d')],'sectionId':_0x2bf593['id']},{})['then'](function(){return _0x405e37;});}else{return _0x405e37;}})[_0x199e('0x4a')](function(_0x414868){logger[_0x199e('0x2b')](_0x199e('0x56'),_0x414868);throw _0x414868;});}return _0x405e37;})['then'](respondWithResult(_0x198600,0xc9))[_0x199e('0x4a')](handleError(_0x198600,null));};exports[_0x199e('0x24')]=function(_0x58fbc7,_0x242e6c){if(_0x58fbc7['body']['id']){delete _0x58fbc7[_0x199e('0x4e')]['id'];}return db[_0x199e('0x2f')][_0x199e('0x4d')]({'where':{'id':_0x58fbc7[_0x199e('0x4c')]['id']}})[_0x199e('0x25')](handleEntityNotFound(_0x242e6c,null))['then'](saveUpdates(_0x58fbc7[_0x199e('0x4e')],null))[_0x199e('0x25')](respondWithResult(_0x242e6c,null))[_0x199e('0x4a')](handleError(_0x242e6c,null));};exports[_0x199e('0x26')]=function(_0x530545,_0x574590){return db[_0x199e('0x2f')][_0x199e('0x4d')]({'where':{'id':_0x530545[_0x199e('0x4c')]['id']}})[_0x199e('0x25')](handleEntityNotFound(_0x574590,null))['then'](removeEntity(_0x574590,null))[_0x199e('0x4a')](handleError(_0x574590,null));};exports[_0x199e('0x57')]=function(_0x3e00d0,_0x4fbdc7,_0x29019d){return db['AnalyticExtractedReport'][_0x199e('0x4d')]({'where':{'id':_0x3e00d0[_0x199e('0x4c')]['id']},'attributes':[_0x199e('0x2d'),'basename',_0x199e('0x58'),_0x199e('0x59')],'raw':!![]})[_0x199e('0x25')](handleEntityNotFound(_0x4fbdc7,null))[_0x199e('0x25')](function(_0x168ca6){if(_0x168ca6){if(!fs[_0x199e('0x5a')](path[_0x199e('0x5b')](config[_0x199e('0x5c')],_0x199e('0x5d'),_0x168ca6['savename']))){throw new db['Sequelize']['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x3e00d0[_0x199e('0x36')][_0x199e('0x5e')]){return _0x4fbdc7[_0x199e('0x19')](0xc8);}return _0x4fbdc7[_0x199e('0x57')](path[_0x199e('0x5b')](config[_0x199e('0x5c')],_0x199e('0x5d'),_0x168ca6[_0x199e('0x58')]),util[_0x199e('0x5f')](_0x199e('0x60'),_0x168ca6[_0x199e('0x61')]||_0x168ca6[_0x199e('0x2d')],_0x168ca6[_0x199e('0x59')][_0x199e('0x62')]()));}})[_0x199e('0x4a')](handleError(_0x4fbdc7,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 44043c6..93d2244 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 _0xfdfa=['AnalyticExtractedReport','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','define'];(function(_0xcc97f3,_0x53ad64){var _0x25bd0c=function(_0x482225){while(--_0x482225){_0xcc97f3['push'](_0xcc97f3['shift']());}};_0x25bd0c(++_0x53ad64);}(_0xfdfa,0x88));var _0xafdf=function(_0x524f0e,_0x2e6801){_0x524f0e=_0x524f0e-0x0;var _0x630076=_0xfdfa[_0x524f0e];return _0x630076;};'use strict';var _=require(_0xafdf('0x0'));var util=require('util');var logger=require(_0xafdf('0x1'))(_0xafdf('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xafdf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xafdf('0x4'));var config=require(_0xafdf('0x5'));var attributes=require(_0xafdf('0x6'));module['exports']=function(_0x2bb4bd,_0xb8d8ad){return _0x2bb4bd[_0xafdf('0x7')](_0xafdf('0x8'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5852=['analytics_extracted_reports','lodash','util','api','bluebird','path','rimraf','./analyticExtractedReport.attributes','define'];(function(_0x488037,_0x338c3e){var _0x53aa99=function(_0x192a6c){while(--_0x192a6c){_0x488037['push'](_0x488037['shift']());}};_0x53aa99(++_0x338c3e);}(_0x5852,0x157));var _0x2585=function(_0x2ed08e,_0x31e039){_0x2ed08e=_0x2ed08e-0x0;var _0x5d98cb=_0x5852[_0x2ed08e];return _0x5d98cb;};'use strict';var _=require(_0x2585('0x0'));var util=require(_0x2585('0x1'));var logger=require('../../config/logger')(_0x2585('0x2'));var moment=require('moment');var BPromise=require(_0x2585('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2585('0x4'));var rimraf=require(_0x2585('0x5'));var config=require('../../config/environment');var attributes=require(_0x2585('0x6'));module['exports']=function(_0x2a9830,_0x16ed85){return _0x2a9830[_0x2585('0x7')]('AnalyticExtractedReport',attributes,{'tableName':_0x2585('0x8'),'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 824d1d3..8bff319 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 _0xea89=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','code','error','message','catch','lodash','util','moment'];(function(_0x20c1e3,_0x3cdcde){var _0x55bd75=function(_0x29d8dd){while(--_0x29d8dd){_0x20c1e3['push'](_0x20c1e3['shift']());}};_0x55bd75(++_0x3cdcde);}(_0xea89,0xfa));var _0x9ea8=function(_0x51d70b,_0x17c1b1){_0x51d70b=_0x51d70b-0x0;var _0x3f5334=_0xea89[_0x51d70b];return _0x3f5334;};'use strict';var _=require(_0x9ea8('0x0'));var util=require(_0x9ea8('0x1'));var moment=require(_0x9ea8('0x2'));var BPromise=require(_0x9ea8('0x3'));var rs=require(_0x9ea8('0x4'));var fs=require('fs');var Redis=require(_0x9ea8('0x5'));var db=require(_0x9ea8('0x6'))['db'];var utils=require(_0x9ea8('0x7'));var logger=require('../../config/logger')(_0x9ea8('0x8'));var config=require(_0x9ea8('0x9'));var jayson=require(_0x9ea8('0xa'));var client=jayson[_0x9ea8('0xb')][_0x9ea8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f7b38,_0x36c15e,_0x4875d2){return new BPromise(function(_0xcc54cb,_0x47e20f){return client[_0x9ea8('0xd')](_0x2f7b38,_0x4875d2)[_0x9ea8('0xe')](function(_0xd2435){logger[_0x9ea8('0xf')](_0x9ea8('0x10'),_0x36c15e,_0x9ea8('0x11'));logger[_0x9ea8('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x36c15e,_0x9ea8('0x11'),JSON['stringify'](_0xd2435));if(_0xd2435['error']){if(_0xd2435['error'][_0x9ea8('0x13')]===0x1f4){logger[_0x9ea8('0x14')](_0x9ea8('0x10'),_0x36c15e,_0xd2435[_0x9ea8('0x14')][_0x9ea8('0x15')]);return _0x47e20f(_0xd2435[_0x9ea8('0x14')]['message']);}logger[_0x9ea8('0x14')](_0x9ea8('0x10'),_0x36c15e,_0xd2435[_0x9ea8('0x14')]['message']);return _0xcc54cb(_0xd2435[_0x9ea8('0x14')][_0x9ea8('0x15')]);}else{logger[_0x9ea8('0xf')](_0x9ea8('0x10'),_0x36c15e,_0x9ea8('0x11'));_0xcc54cb(_0xd2435['result'][_0x9ea8('0x15')]);}})[_0x9ea8('0x16')](function(_0x46d12c){logger[_0x9ea8('0x14')](_0x9ea8('0x10'),_0x36c15e,_0x46d12c);_0x47e20f(_0x46d12c);});});}
\ No newline at end of file
+var _0x7035=['request','info','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0xfc505d,_0x625d3b){var _0x2000c8=function(_0x1b34d0){while(--_0x1b34d0){_0xfc505d['push'](_0xfc505d['shift']());}};_0x2000c8(++_0x625d3b);}(_0x7035,0x15e));var _0x5703=function(_0x15a3e6,_0xe05732){_0x15a3e6=_0x15a3e6-0x0;var _0x4ad02d=_0x7035[_0x15a3e6];return _0x4ad02d;};'use strict';var _=require(_0x5703('0x0'));var util=require('util');var moment=require(_0x5703('0x1'));var BPromise=require(_0x5703('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5703('0x3'));var db=require(_0x5703('0x4'))['db'];var utils=require(_0x5703('0x5'));var logger=require(_0x5703('0x6'))(_0x5703('0x7'));var config=require('../../config/environment');var jayson=require(_0x5703('0x8'));var client=jayson[_0x5703('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e2e90,_0x1b1ee9,_0x401d33){return new BPromise(function(_0x291988,_0x1afe73){return client[_0x5703('0xa')](_0x2e2e90,_0x401d33)['then'](function(_0x58a04c){logger[_0x5703('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1b1ee9,_0x5703('0xc'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1b1ee9,_0x5703('0xc'),JSON[_0x5703('0xd')](_0x58a04c));if(_0x58a04c[_0x5703('0xe')]){if(_0x58a04c['error'][_0x5703('0xf')]===0x1f4){logger['error'](_0x5703('0x10'),_0x1b1ee9,_0x58a04c[_0x5703('0xe')][_0x5703('0x11')]);return _0x1afe73(_0x58a04c[_0x5703('0xe')][_0x5703('0x11')]);}logger[_0x5703('0xe')](_0x5703('0x10'),_0x1b1ee9,_0x58a04c[_0x5703('0xe')][_0x5703('0x11')]);return _0x291988(_0x58a04c[_0x5703('0xe')][_0x5703('0x11')]);}else{logger['info'](_0x5703('0x10'),_0x1b1ee9,_0x5703('0xc'));_0x291988(_0x58a04c[_0x5703('0x12')][_0x5703('0x11')]);}})[_0x5703('0x13')](function(_0x4576d4){logger[_0x5703('0xe')](_0x5703('0x10'),_0x1b1ee9,_0x4576d4);_0x1afe73(_0x4576d4);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 41164b9..da1d8c7 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 _0x84a3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','post','put','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x32dcd8,_0x23fa22){var _0x3e9868=function(_0x4f9a58){while(--_0x4f9a58){_0x32dcd8['push'](_0x32dcd8['shift']());}};_0x3e9868(++_0x23fa22);}(_0x84a3,0x1b4));var _0x384a=function(_0xfd7b9e,_0x431fbf){_0xfd7b9e=_0xfd7b9e-0x0;var _0x2ff2c3=_0x84a3[_0xfd7b9e];return _0x2ff2c3;};'use strict';var multer=require(_0x384a('0x0'));var util=require('util');var path=require(_0x384a('0x1'));var timeout=require(_0x384a('0x2'));var express=require(_0x384a('0x3'));var router=express[_0x384a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x384a('0x5'));var interaction=require(_0x384a('0x6'));var config=require(_0x384a('0x7'));var controller=require(_0x384a('0x8'));router['get']('/',auth[_0x384a('0x9')](),controller[_0x384a('0xa')]);router[_0x384a('0xb')](_0x384a('0xc'),auth['isAuthenticated'](),controller[_0x384a('0xd')]);router[_0x384a('0xb')](_0x384a('0xe'),auth[_0x384a('0x9')](),controller[_0x384a('0xf')]);router[_0x384a('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x384a('0x11')]('/:id',auth[_0x384a('0x9')](),controller[_0x384a('0x12')]);router['delete'](_0x384a('0xc'),auth[_0x384a('0x9')](),controller[_0x384a('0x13')]);module[_0x384a('0x14')]=router;
\ No newline at end of file
+var _0xd9a2=['./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd9a2,0x142));var _0x2d9a=function(_0x40dd64,_0x55fda1){_0x40dd64=_0x40dd64-0x0;var _0x213898=_0xd9a2[_0x40dd64];return _0x213898;};'use strict';var multer=require(_0x2d9a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d9a('0x1'));var express=require(_0x2d9a('0x2'));var router=express[_0x2d9a('0x3')]();var fs_extra=require(_0x2d9a('0x4'));var auth=require(_0x2d9a('0x5'));var interaction=require(_0x2d9a('0x6'));var config=require(_0x2d9a('0x7'));var controller=require(_0x2d9a('0x8'));router[_0x2d9a('0x9')]('/',auth[_0x2d9a('0xa')](),controller[_0x2d9a('0xb')]);router['get']('/:id',auth[_0x2d9a('0xa')](),controller[_0x2d9a('0xc')]);router[_0x2d9a('0x9')](_0x2d9a('0xd'),auth['isAuthenticated'](),controller[_0x2d9a('0xe')]);router[_0x2d9a('0xf')]('/',auth[_0x2d9a('0xa')](),controller[_0x2d9a('0x10')]);router[_0x2d9a('0x11')](_0x2d9a('0x12'),auth[_0x2d9a('0xa')](),controller[_0x2d9a('0x13')]);router['delete'](_0x2d9a('0x12'),auth[_0x2d9a('0xa')](),controller[_0x2d9a('0x14')]);module[_0x2d9a('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 9f1b01b..357a49c 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 _0xeac7=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0xc350,_0x2fb0f8){var _0x126021=function(_0x3f0b9e){while(--_0x3f0b9e){_0xc350['push'](_0xc350['shift']());}};_0x126021(++_0x2fb0f8);}(_0xeac7,0x88));var _0x7eac=function(_0x188b01,_0x2eb36b){_0x188b01=_0x188b01-0x0;var _0x40e1e8=_0xeac7[_0x188b01];return _0x40e1e8;};'use strict';var Sequelize=require(_0x7eac('0x0'));module[_0x7eac('0x1')]={'field':{'type':Sequelize[_0x7eac('0x2')]},'alias':{'type':Sequelize[_0x7eac('0x3')]},'function':{'type':Sequelize[_0x7eac('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x7eac('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xcc4a=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x1fcb67,_0x70fb6c){var _0x17a001=function(_0x43ae93){while(--_0x43ae93){_0x1fcb67['push'](_0x1fcb67['shift']());}};_0x17a001(++_0x70fb6c);}(_0xcc4a,0x16d));var _0xacc4=function(_0x232088,_0x580098){_0x232088=_0x232088-0x0;var _0x313f41=_0xcc4a[_0x232088];return _0x313f41;};'use strict';var Sequelize=require(_0xacc4('0x0'));module['exports']={'field':{'type':Sequelize[_0xacc4('0x1')]},'alias':{'type':Sequelize[_0xacc4('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xacc4('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 367ba6b..0615a00 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 _0x58b6=['include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','index','AnalyticFieldReport','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','VIRTUAL','options'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x58b6,0x102));var _0x658b=function(_0x372914,_0x53a9ba){_0x372914=_0x372914-0x0;var _0x198ffb=_0x58b6[_0x372914];return _0x198ffb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x658b('0x0'));var jsonpatch=require(_0x658b('0x1'));var rp=require(_0x658b('0x2'));var moment=require(_0x658b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x658b('0x4'));var sox=require(_0x658b('0x5'));var csv=require(_0x658b('0x6'));var ejs=require(_0x658b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x658b('0x8'));var crypto=require(_0x658b('0x9'));var jsforce=require(_0x658b('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x658b('0xb'));var Papa=require(_0x658b('0xc'));var Redis=require('ioredis');var authService=require(_0x658b('0xd'));var qs=require(_0x658b('0xe'));var as=require(_0x658b('0xf'));var hardwareService=require(_0x658b('0x10'));var logger=require(_0x658b('0x11'))(_0x658b('0x12'));var utils=require('../../config/utils');var config=require(_0x658b('0x13'));var licenseUtil=require(_0x658b('0x14'));var db=require(_0x658b('0x15'))['db'];function respondWithStatusCode(_0x15fdca,_0x4ac2fb){_0x4ac2fb=_0x4ac2fb||0xcc;return function(_0x5b7842){if(_0x5b7842){return _0x15fdca[_0x658b('0x16')](_0x4ac2fb);}return _0x15fdca['status'](_0x4ac2fb)['end']();};}function respondWithResult(_0x13b32a,_0x5c470f){_0x5c470f=_0x5c470f||0xc8;return function(_0x42e773){if(_0x42e773){return _0x13b32a['status'](_0x5c470f)[_0x658b('0x17')](_0x42e773);}};}function respondWithFilteredResult(_0x1831a8,_0x38b49e){return function(_0x3b0c45){if(_0x3b0c45){var _0x5a117a=typeof _0x38b49e[_0x658b('0x18')]===_0x658b('0x19')&&typeof _0x38b49e['limit']===_0x658b('0x19');var _0x273671=_0x3b0c45[_0x658b('0x1a')];var _0x21540d=_0x5a117a?0x0:_0x38b49e[_0x658b('0x18')];var _0x549ae3=_0x5a117a?_0x3b0c45[_0x658b('0x1a')]:_0x38b49e['offset']+_0x38b49e['limit'];var _0x40466c;if(_0x549ae3>=_0x273671){_0x549ae3=_0x273671;_0x40466c=0xc8;}else{_0x40466c=0xce;}_0x1831a8['status'](_0x40466c);return _0x1831a8[_0x658b('0x1b')](_0x658b('0x1c'),_0x21540d+'-'+_0x549ae3+'/'+_0x273671)[_0x658b('0x17')](_0x3b0c45);}return null;};}function patchUpdates(_0x44bce2){return function(_0x40e797){try{jsonpatch[_0x658b('0x1d')](_0x40e797,_0x44bce2,!![]);}catch(_0x156dcf){return BPromise[_0x658b('0x1e')](_0x156dcf);}return _0x40e797[_0x658b('0x1f')]();};}function saveUpdates(_0x5bc89a,_0x14f4de){return function(_0x5d7b4b){if(_0x5d7b4b){return _0x5d7b4b[_0x658b('0x20')](_0x5bc89a)['then'](function(_0x32c28d){return _0x32c28d;});}return null;};}function removeEntity(_0xf20119,_0x2486a0){return function(_0x4e38c6){if(_0x4e38c6){return _0x4e38c6[_0x658b('0x21')]()[_0x658b('0x22')](function(){_0xf20119['status'](0xcc)[_0x658b('0x23')]();});}};}function handleEntityNotFound(_0x53f5a0,_0xfb3651){return function(_0x4a8186){if(!_0x4a8186){_0x53f5a0[_0x658b('0x16')](0x194);}return _0x4a8186;};}function handleError(_0x3e08f7,_0xfaeaaa){_0xfaeaaa=_0xfaeaaa||0x1f4;return function(_0x14dfa8){logger[_0x658b('0x24')](_0x14dfa8[_0x658b('0x25')]);if(_0x14dfa8[_0x658b('0x26')]){delete _0x14dfa8[_0x658b('0x26')];}_0x3e08f7['status'](_0xfaeaaa)['send'](_0x14dfa8);};}exports[_0x658b('0x27')]=function(_0x58663a,_0x558b84){var _0x21b2f8={},_0x56554e={},_0x14f940={'count':0x0,'rows':[]};var _0x2f24b1=_['map'](db[_0x658b('0x28')]['rawAttributes'],function(_0x26acfe){return{'name':_0x26acfe[_0x658b('0x29')],'type':_0x26acfe[_0x658b('0x2a')]['key']};});_0x56554e[_0x658b('0x2b')]=_[_0x658b('0x2c')](_0x2f24b1,_0x658b('0x26'));_0x56554e[_0x658b('0x2d')]=_[_0x658b('0x2e')](_0x58663a[_0x658b('0x2d')]);_0x56554e['filters']=_[_0x658b('0x2f')](_0x56554e[_0x658b('0x2b')],_0x56554e['query']);_0x21b2f8[_0x658b('0x30')]=_['intersection'](_0x56554e['model'],qs[_0x658b('0x31')](_0x58663a['query']['fields']));_0x21b2f8[_0x658b('0x30')]=_0x21b2f8['attributes'][_0x658b('0x32')]?_0x21b2f8['attributes']:_0x56554e[_0x658b('0x2b')];if(!_0x58663a[_0x658b('0x2d')][_0x658b('0x33')](_0x658b('0x34'))){_0x21b2f8[_0x658b('0x35')]=qs[_0x658b('0x35')](_0x58663a[_0x658b('0x2d')][_0x658b('0x35')]);_0x21b2f8['offset']=qs[_0x658b('0x18')](_0x58663a[_0x658b('0x2d')][_0x658b('0x18')]);}_0x21b2f8[_0x658b('0x36')]=qs[_0x658b('0x37')](_0x58663a[_0x658b('0x2d')][_0x658b('0x37')]);_0x21b2f8[_0x658b('0x38')]=qs['filters'](_[_0x658b('0x39')](_0x58663a[_0x658b('0x2d')],_0x56554e[_0x658b('0x3a')]),_0x2f24b1);if(_0x58663a[_0x658b('0x2d')][_0x658b('0x3b')]){_0x21b2f8['where']=_['merge'](_0x21b2f8[_0x658b('0x38')],{'$or':_['map'](_0x2f24b1,function(_0x7cd337){if(_0x7cd337[_0x658b('0x2a')]!==_0x658b('0x3c')){var _0x15bf32={};_0x15bf32[_0x7cd337['name']]={'$like':'%'+_0x58663a['query'][_0x658b('0x3b')]+'%'};return _0x15bf32;}})});}_0x21b2f8=_['merge']({},_0x21b2f8,_0x58663a[_0x658b('0x3d')]);var _0x42ea74={'where':_0x21b2f8['where']};return db[_0x658b('0x28')][_0x658b('0x1a')](_0x42ea74)[_0x658b('0x22')](function(_0x1fa318){_0x14f940['count']=_0x1fa318;if(_0x58663a[_0x658b('0x2d')]['includeAll']){_0x21b2f8[_0x658b('0x3e')]=[{'all':!![]}];}return db[_0x658b('0x28')][_0x658b('0x3f')](_0x21b2f8);})['then'](function(_0x28ceff){_0x14f940[_0x658b('0x40')]=_0x28ceff;return _0x14f940;})[_0x658b('0x22')](respondWithFilteredResult(_0x558b84,_0x21b2f8))[_0x658b('0x41')](handleError(_0x558b84,null));};exports[_0x658b('0x42')]=function(_0x615260,_0x189097){var _0x40a080={'raw':![],'where':{'id':_0x615260[_0x658b('0x43')]['id']}},_0x3eb524={};_0x3eb524[_0x658b('0x2b')]=_[_0x658b('0x2e')](db[_0x658b('0x28')][_0x658b('0x44')]);_0x3eb524['query']=_[_0x658b('0x2e')](_0x615260[_0x658b('0x2d')]);_0x3eb524[_0x658b('0x3a')]=_['intersection'](_0x3eb524[_0x658b('0x2b')],_0x3eb524[_0x658b('0x2d')]);_0x40a080['attributes']=_[_0x658b('0x2f')](_0x3eb524['model'],qs[_0x658b('0x31')](_0x615260[_0x658b('0x2d')]['fields']));_0x40a080[_0x658b('0x30')]=_0x40a080[_0x658b('0x30')][_0x658b('0x32')]?_0x40a080[_0x658b('0x30')]:_0x3eb524[_0x658b('0x2b')];if(_0x615260[_0x658b('0x2d')][_0x658b('0x45')]){_0x40a080[_0x658b('0x3e')]=[{'all':!![]}];}_0x40a080=_['merge']({},_0x40a080,_0x615260[_0x658b('0x3d')]);return db['AnalyticFieldReport'][_0x658b('0x46')](_0x40a080)['then'](handleEntityNotFound(_0x189097,null))[_0x658b('0x22')](respondWithResult(_0x189097,null))[_0x658b('0x41')](handleError(_0x189097,null));};exports[_0x658b('0x47')]=function(_0x3c592c,_0x406f41){return db['AnalyticFieldReport'][_0x658b('0x47')](_0x3c592c[_0x658b('0x48')],{})[_0x658b('0x22')](respondWithResult(_0x406f41,0xc9))[_0x658b('0x41')](handleError(_0x406f41,null));};exports[_0x658b('0x49')]=function(_0x3c12fa,_0x5ab707){return db[_0x658b('0x28')][_0x658b('0x49')](_0x3c12fa[_0x658b('0x48')],{'raw':![],'individualHooks':!![]})[_0x658b('0x22')](respondWithResult(_0x5ab707,0xc9))[_0x658b('0x41')](handleError(_0x5ab707,null));};exports[_0x658b('0x20')]=function(_0x23bf09,_0xed118c){if(_0x23bf09[_0x658b('0x48')]['id']){delete _0x23bf09['body']['id'];}return db[_0x658b('0x28')][_0x658b('0x46')]({'where':{'id':_0x23bf09[_0x658b('0x43')]['id']}})[_0x658b('0x22')](handleEntityNotFound(_0xed118c,null))[_0x658b('0x22')](saveUpdates(_0x23bf09[_0x658b('0x48')],null))['then'](respondWithResult(_0xed118c,null))['catch'](handleError(_0xed118c,null));};exports['destroy']=function(_0x186a24,_0x1720db){return db[_0x658b('0x28')]['find']({'where':{'id':_0x186a24['params']['id']}})['then'](handleEntityNotFound(_0x1720db,null))[_0x658b('0x22')](removeEntity(_0x1720db,null))[_0x658b('0x41')](handleError(_0x1720db,null));};exports['bulkDestroy']=function(_0x2dabba,_0x35b575){return db[_0x658b('0x28')]['destroy']({'where':{'id':_0x2dabba[_0x658b('0x2d')][_0x658b('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x35b575,0xcc))['catch'](handleError(_0x35b575,null));};exports[_0x658b('0x4b')]=function(_0x51431e,_0x1ebb54,_0x33e2a3){return db[_0x658b('0x4c')][_0x658b('0x4d')]({'where':{'id':_0x51431e[_0x658b('0x43')]['id']}})[_0x658b('0x22')](handleEntityNotFound(_0x1ebb54,null))[_0x658b('0x22')](function(_0x3fdc28){if(_0x3fdc28){return db[_0x658b('0x4e')][_0x658b('0x4f')](function(_0x4ad98a){return db['AnalyticFieldReport'][_0x658b('0x21')]({'where':{'CustomReportId':_0x51431e[_0x658b('0x43')]['id']},'transaction':_0x4ad98a})['then'](function(_0x415ebb){var _0x8dec55=_[_0x658b('0x2c')](_0x51431e[_0x658b('0x48')],function(_0x195809){delete _0x195809['id'];_0x195809['CustomReportId']=_0x51431e[_0x658b('0x43')]['id'];return _0x195809;});return db[_0x658b('0x28')]['bulkCreate'](_0x8dec55,{'transaction':_0x4ad98a});});})[_0x658b('0x22')](function(){return db[_0x658b('0x28')]['findAll']({'where':{'CustomReportId':_0x51431e['params']['id']}});});}})[_0x658b('0x22')](respondWithResult(_0x1ebb54,null))[_0x658b('0x41')](handleError(_0x1ebb54,null));};
\ No newline at end of file
+var _0xe7e3=['util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filter','merge','include','rows','catch','show','rawAttributes','includeAll','options','create','bulkCreate','body','find','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','findAll','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0xe7e3,0x1e0));var _0x3e7e=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0xe7e3[_0x425716];return _0x2d39af;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e7e('0x0'));var zipdir=require(_0x3e7e('0x1'));var jsonpatch=require(_0x3e7e('0x2'));var rp=require(_0x3e7e('0x3'));var moment=require('moment');var BPromise=require(_0x3e7e('0x4'));var Mustache=require(_0x3e7e('0x5'));var util=require(_0x3e7e('0x6'));var path=require('path');var sox=require(_0x3e7e('0x7'));var csv=require(_0x3e7e('0x8'));var ejs=require(_0x3e7e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e7e('0xa'));var squel=require(_0x3e7e('0xb'));var crypto=require(_0x3e7e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3e7e('0xd'));var toCsv=require(_0x3e7e('0x8'));var querystring=require('querystring');var Papa=require(_0x3e7e('0xe'));var Redis=require(_0x3e7e('0xf'));var authService=require(_0x3e7e('0x10'));var qs=require(_0x3e7e('0x11'));var as=require(_0x3e7e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e7e('0x13'))(_0x3e7e('0x14'));var utils=require(_0x3e7e('0x15'));var config=require(_0x3e7e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e7e('0x17'))['db'];function respondWithStatusCode(_0x3c181c,_0x55385f){_0x55385f=_0x55385f||0xcc;return function(_0x4a9281){if(_0x4a9281){return _0x3c181c[_0x3e7e('0x18')](_0x55385f);}return _0x3c181c[_0x3e7e('0x19')](_0x55385f)[_0x3e7e('0x1a')]();};}function respondWithResult(_0xd0ea33,_0x478996){_0x478996=_0x478996||0xc8;return function(_0x24d441){if(_0x24d441){return _0xd0ea33[_0x3e7e('0x19')](_0x478996)[_0x3e7e('0x1b')](_0x24d441);}};}function respondWithFilteredResult(_0x40f8f6,_0xa68846){return function(_0x3e4e53){if(_0x3e4e53){var _0x2a1bf7=typeof _0xa68846[_0x3e7e('0x1c')]===_0x3e7e('0x1d')&&typeof _0xa68846[_0x3e7e('0x1e')]===_0x3e7e('0x1d');var _0xeae54f=_0x3e4e53['count'];var _0x40c7f9=_0x2a1bf7?0x0:_0xa68846['offset'];var _0x57bb98=_0x2a1bf7?_0x3e4e53[_0x3e7e('0x1f')]:_0xa68846[_0x3e7e('0x1c')]+_0xa68846['limit'];var _0x4b3cb6;if(_0x57bb98>=_0xeae54f){_0x57bb98=_0xeae54f;_0x4b3cb6=0xc8;}else{_0x4b3cb6=0xce;}_0x40f8f6['status'](_0x4b3cb6);return _0x40f8f6[_0x3e7e('0x20')]('Content-Range',_0x40c7f9+'-'+_0x57bb98+'/'+_0xeae54f)['json'](_0x3e4e53);}return null;};}function patchUpdates(_0x38711e){return function(_0x34a53d){try{jsonpatch[_0x3e7e('0x21')](_0x34a53d,_0x38711e,!![]);}catch(_0x31e8b8){return BPromise[_0x3e7e('0x22')](_0x31e8b8);}return _0x34a53d[_0x3e7e('0x23')]();};}function saveUpdates(_0x36c823,_0x58b9eb){return function(_0x34ac97){if(_0x34ac97){return _0x34ac97[_0x3e7e('0x24')](_0x36c823)[_0x3e7e('0x25')](function(_0x5ec167){return _0x5ec167;});}return null;};}function removeEntity(_0x26dc78,_0x5ccddf){return function(_0x435a12){if(_0x435a12){return _0x435a12[_0x3e7e('0x26')]()['then'](function(){_0x26dc78[_0x3e7e('0x19')](0xcc)[_0x3e7e('0x1a')]();});}};}function handleEntityNotFound(_0x2154d2,_0x3dc98d){return function(_0x464c98){if(!_0x464c98){_0x2154d2[_0x3e7e('0x18')](0x194);}return _0x464c98;};}function handleError(_0x329563,_0x5bc56b){_0x5bc56b=_0x5bc56b||0x1f4;return function(_0x8080c4){logger[_0x3e7e('0x27')](_0x8080c4[_0x3e7e('0x28')]);if(_0x8080c4[_0x3e7e('0x29')]){delete _0x8080c4[_0x3e7e('0x29')];}_0x329563[_0x3e7e('0x19')](_0x5bc56b)[_0x3e7e('0x2a')](_0x8080c4);};}exports[_0x3e7e('0x2b')]=function(_0x11e703,_0x57c41){var _0x149f37={},_0x4062e0={},_0x48a4a0={'count':0x0,'rows':[]};var _0x45f98b=_[_0x3e7e('0x2c')](db[_0x3e7e('0x2d')]['rawAttributes'],function(_0x2e8cbf){return{'name':_0x2e8cbf[_0x3e7e('0x2e')],'type':_0x2e8cbf['type']['key']};});_0x4062e0['model']=_[_0x3e7e('0x2c')](_0x45f98b,_0x3e7e('0x29'));_0x4062e0[_0x3e7e('0x2f')]=_[_0x3e7e('0x30')](_0x11e703['query']);_0x4062e0[_0x3e7e('0x31')]=_[_0x3e7e('0x32')](_0x4062e0['model'],_0x4062e0[_0x3e7e('0x2f')]);_0x149f37[_0x3e7e('0x33')]=_[_0x3e7e('0x32')](_0x4062e0['model'],qs[_0x3e7e('0x34')](_0x11e703[_0x3e7e('0x2f')][_0x3e7e('0x34')]));_0x149f37[_0x3e7e('0x33')]=_0x149f37[_0x3e7e('0x33')][_0x3e7e('0x35')]?_0x149f37['attributes']:_0x4062e0[_0x3e7e('0x36')];if(!_0x11e703[_0x3e7e('0x2f')][_0x3e7e('0x37')](_0x3e7e('0x38'))){_0x149f37[_0x3e7e('0x1e')]=qs[_0x3e7e('0x1e')](_0x11e703['query']['limit']);_0x149f37[_0x3e7e('0x1c')]=qs['offset'](_0x11e703[_0x3e7e('0x2f')]['offset']);}_0x149f37[_0x3e7e('0x39')]=qs['sort'](_0x11e703[_0x3e7e('0x2f')][_0x3e7e('0x3a')]);_0x149f37[_0x3e7e('0x3b')]=qs['filters'](_['pick'](_0x11e703[_0x3e7e('0x2f')],_0x4062e0[_0x3e7e('0x31')]),_0x45f98b);if(_0x11e703[_0x3e7e('0x2f')][_0x3e7e('0x3c')]){_0x149f37[_0x3e7e('0x3b')]=_[_0x3e7e('0x3d')](_0x149f37[_0x3e7e('0x3b')],{'$or':_[_0x3e7e('0x2c')](_0x45f98b,function(_0x53840e){if(_0x53840e['type']!=='VIRTUAL'){var _0x41c4d4={};_0x41c4d4[_0x53840e[_0x3e7e('0x29')]]={'$like':'%'+_0x11e703[_0x3e7e('0x2f')][_0x3e7e('0x3c')]+'%'};return _0x41c4d4;}})});}_0x149f37=_[_0x3e7e('0x3d')]({},_0x149f37,_0x11e703['options']);var _0x127608={'where':_0x149f37[_0x3e7e('0x3b')]};return db[_0x3e7e('0x2d')][_0x3e7e('0x1f')](_0x127608)['then'](function(_0x47f37b){_0x48a4a0[_0x3e7e('0x1f')]=_0x47f37b;if(_0x11e703['query']['includeAll']){_0x149f37[_0x3e7e('0x3e')]=[{'all':!![]}];}return db[_0x3e7e('0x2d')]['findAll'](_0x149f37);})[_0x3e7e('0x25')](function(_0x11c0be){_0x48a4a0[_0x3e7e('0x3f')]=_0x11c0be;return _0x48a4a0;})['then'](respondWithFilteredResult(_0x57c41,_0x149f37))[_0x3e7e('0x40')](handleError(_0x57c41,null));};exports[_0x3e7e('0x41')]=function(_0x1217f,_0x570d56){var _0x317463={'raw':![],'where':{'id':_0x1217f['params']['id']}},_0x44903d={};_0x44903d[_0x3e7e('0x36')]=_[_0x3e7e('0x30')](db[_0x3e7e('0x2d')][_0x3e7e('0x42')]);_0x44903d['query']=_[_0x3e7e('0x30')](_0x1217f[_0x3e7e('0x2f')]);_0x44903d['filters']=_[_0x3e7e('0x32')](_0x44903d[_0x3e7e('0x36')],_0x44903d['query']);_0x317463[_0x3e7e('0x33')]=_['intersection'](_0x44903d[_0x3e7e('0x36')],qs[_0x3e7e('0x34')](_0x1217f[_0x3e7e('0x2f')]['fields']));_0x317463[_0x3e7e('0x33')]=_0x317463['attributes'][_0x3e7e('0x35')]?_0x317463[_0x3e7e('0x33')]:_0x44903d[_0x3e7e('0x36')];if(_0x1217f[_0x3e7e('0x2f')][_0x3e7e('0x43')]){_0x317463[_0x3e7e('0x3e')]=[{'all':!![]}];}_0x317463=_['merge']({},_0x317463,_0x1217f[_0x3e7e('0x44')]);return db[_0x3e7e('0x2d')]['find'](_0x317463)[_0x3e7e('0x25')](handleEntityNotFound(_0x570d56,null))[_0x3e7e('0x25')](respondWithResult(_0x570d56,null))[_0x3e7e('0x40')](handleError(_0x570d56,null));};exports[_0x3e7e('0x45')]=function(_0x1145e2,_0x3fce43){return db['AnalyticFieldReport'][_0x3e7e('0x45')](_0x1145e2['body'],{})[_0x3e7e('0x25')](respondWithResult(_0x3fce43,0xc9))[_0x3e7e('0x40')](handleError(_0x3fce43,null));};exports[_0x3e7e('0x46')]=function(_0x2adfc5,_0x53acfa){return db[_0x3e7e('0x2d')][_0x3e7e('0x46')](_0x2adfc5[_0x3e7e('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x53acfa,0xc9))[_0x3e7e('0x40')](handleError(_0x53acfa,null));};exports[_0x3e7e('0x24')]=function(_0x431e0,_0x4956b1){if(_0x431e0[_0x3e7e('0x47')]['id']){delete _0x431e0[_0x3e7e('0x47')]['id'];}return db[_0x3e7e('0x2d')][_0x3e7e('0x48')]({'where':{'id':_0x431e0[_0x3e7e('0x49')]['id']}})[_0x3e7e('0x25')](handleEntityNotFound(_0x4956b1,null))[_0x3e7e('0x25')](saveUpdates(_0x431e0[_0x3e7e('0x47')],null))[_0x3e7e('0x25')](respondWithResult(_0x4956b1,null))['catch'](handleError(_0x4956b1,null));};exports['destroy']=function(_0x4c7cd1,_0x52f22f){return db[_0x3e7e('0x2d')][_0x3e7e('0x48')]({'where':{'id':_0x4c7cd1['params']['id']}})['then'](handleEntityNotFound(_0x52f22f,null))[_0x3e7e('0x25')](removeEntity(_0x52f22f,null))['catch'](handleError(_0x52f22f,null));};exports[_0x3e7e('0x4a')]=function(_0x236c7e,_0x114b64){return db[_0x3e7e('0x2d')][_0x3e7e('0x26')]({'where':{'id':_0x236c7e['query'][_0x3e7e('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x3e7e('0x25')](respondWithResult(_0x114b64,0xcc))[_0x3e7e('0x40')](handleError(_0x114b64,null));};exports[_0x3e7e('0x4c')]=function(_0x43a553,_0x1b5dd5,_0xa3f8f8){return db[_0x3e7e('0x4d')][_0x3e7e('0x4e')]({'where':{'id':_0x43a553[_0x3e7e('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b5dd5,null))[_0x3e7e('0x25')](function(_0x28615d){if(_0x28615d){return db[_0x3e7e('0x4f')]['transaction'](function(_0x347399){return db[_0x3e7e('0x2d')][_0x3e7e('0x26')]({'where':{'CustomReportId':_0x43a553['params']['id']},'transaction':_0x347399})[_0x3e7e('0x25')](function(_0x1a55ff){var _0x2efadb=_[_0x3e7e('0x2c')](_0x43a553[_0x3e7e('0x47')],function(_0x298a50){delete _0x298a50['id'];_0x298a50['CustomReportId']=_0x43a553[_0x3e7e('0x49')]['id'];return _0x298a50;});return db[_0x3e7e('0x2d')]['bulkCreate'](_0x2efadb,{'transaction':_0x347399});});})[_0x3e7e('0x25')](function(){return db['AnalyticFieldReport'][_0x3e7e('0x50')]({'where':{'CustomReportId':_0x43a553[_0x3e7e('0x49')]['id']}});});}})[_0x3e7e('0x25')](respondWithResult(_0x1b5dd5,null))[_0x3e7e('0x40')](handleError(_0x1b5dd5,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index cc9916a..2bc7135 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 _0x406d=['moment','path','rimraf','./analyticFieldReport.attributes','exports','analytics_report_fields','util','../../config/logger','api'];(function(_0x247506,_0x5e364b){var _0x2f17d4=function(_0x48c6d2){while(--_0x48c6d2){_0x247506['push'](_0x247506['shift']());}};_0x2f17d4(++_0x5e364b);}(_0x406d,0x7b));var _0xd406=function(_0x3db58d,_0x3f0c01){_0x3db58d=_0x3db58d-0x0;var _0x17158d=_0x406d[_0x3db58d];return _0x17158d;};'use strict';var _=require('lodash');var util=require(_0xd406('0x0'));var logger=require(_0xd406('0x1'))(_0xd406('0x2'));var moment=require(_0xd406('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd406('0x4'));var rimraf=require(_0xd406('0x5'));var config=require('../../config/environment');var attributes=require(_0xd406('0x6'));module[_0xd406('0x7')]=function(_0x5e0f2d,_0x2e43f3){return _0x5e0f2d['define']('AnalyticFieldReport',attributes,{'tableName':_0xd406('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfa45=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x5c027f,_0xa40135){var _0x5392f3=function(_0x581c3b){while(--_0x581c3b){_0x5c027f['push'](_0x5c027f['shift']());}};_0x5392f3(++_0xa40135);}(_0xfa45,0x1be));var _0x5fa4=function(_0xc48309,_0x452c9f){_0xc48309=_0xc48309-0x0;var _0x45880f=_0xfa45[_0xc48309];return _0x45880f;};'use strict';var _=require(_0x5fa4('0x0'));var util=require('util');var logger=require(_0x5fa4('0x1'))(_0x5fa4('0x2'));var moment=require(_0x5fa4('0x3'));var BPromise=require('bluebird');var rp=require(_0x5fa4('0x4'));var fs=require('fs');var path=require(_0x5fa4('0x5'));var rimraf=require(_0x5fa4('0x6'));var config=require(_0x5fa4('0x7'));var attributes=require(_0x5fa4('0x8'));module[_0x5fa4('0x9')]=function(_0x524b77,_0x392112){return _0x524b77[_0x5fa4('0xa')](_0x5fa4('0xb'),attributes,{'tableName':_0x5fa4('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 f5aa9ba..bcbb9fc 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 _0x5a3e=['../../config/utils','../../config/logger','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','message','error','result','lodash','util','moment','ioredis','../../mysqldb'];(function(_0xf46a3a,_0x2186e1){var _0x47c2ee=function(_0x4df476){while(--_0x4df476){_0xf46a3a['push'](_0xf46a3a['shift']());}};_0x47c2ee(++_0x2186e1);}(_0x5a3e,0x177));var _0xe5a3=function(_0xf692d8,_0x1060a2){_0xf692d8=_0xf692d8-0x0;var _0x2765cd=_0x5a3e[_0xf692d8];return _0x2765cd;};'use strict';var _=require(_0xe5a3('0x0'));var util=require(_0xe5a3('0x1'));var moment=require(_0xe5a3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5a3('0x3'));var db=require(_0xe5a3('0x4'))['db'];var utils=require(_0xe5a3('0x5'));var logger=require(_0xe5a3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe5a3('0x7')][_0xe5a3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x155ee6,_0xc51179,_0x518f80){return new BPromise(function(_0x33e2ff,_0x25d834){return client[_0xe5a3('0x9')](_0x155ee6,_0x518f80)[_0xe5a3('0xa')](function(_0x7e5355){logger[_0xe5a3('0xb')](_0xe5a3('0xc'),_0xc51179,_0xe5a3('0xd'));logger[_0xe5a3('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0xc51179,_0xe5a3('0xd'),JSON[_0xe5a3('0xf')](_0x7e5355));if(_0x7e5355['error']){if(_0x7e5355['error']['code']===0x1f4){logger['error'](_0xe5a3('0xc'),_0xc51179,_0x7e5355['error'][_0xe5a3('0x10')]);return _0x25d834(_0x7e5355[_0xe5a3('0x11')]['message']);}logger[_0xe5a3('0x11')](_0xe5a3('0xc'),_0xc51179,_0x7e5355[_0xe5a3('0x11')][_0xe5a3('0x10')]);return _0x33e2ff(_0x7e5355[_0xe5a3('0x11')][_0xe5a3('0x10')]);}else{logger['info'](_0xe5a3('0xc'),_0xc51179,'request\x20sent');_0x33e2ff(_0x7e5355[_0xe5a3('0x12')][_0xe5a3('0x10')]);}})['catch'](function(_0x4c57c1){logger[_0xe5a3('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0xc51179,_0x4c57c1);_0x25d834(_0x4c57c1);});});}
\ No newline at end of file
+var _0x6794=['rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x6794,0x16f));var _0x4679=function(_0x23536e,_0x1f35a2){_0x23536e=_0x23536e-0x0;var _0x70f515=_0x6794[_0x23536e];return _0x70f515;};'use strict';var _=require(_0x4679('0x0'));var util=require(_0x4679('0x1'));var moment=require(_0x4679('0x2'));var BPromise=require(_0x4679('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4679('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4679('0x5'));var logger=require(_0x4679('0x6'))(_0x4679('0x7'));var config=require(_0x4679('0x8'));var jayson=require(_0x4679('0x9'));var client=jayson[_0x4679('0xa')][_0x4679('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x410600,_0x2960fc,_0x2686b6){return new BPromise(function(_0x2a12fd,_0x3b665f){return client['request'](_0x410600,_0x2686b6)[_0x4679('0xc')](function(_0x47dc9){logger[_0x4679('0xd')](_0x4679('0xe'),_0x2960fc,'request\x20sent');logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2960fc,'request\x20sent',JSON[_0x4679('0xf')](_0x47dc9));if(_0x47dc9['error']){if(_0x47dc9[_0x4679('0x10')][_0x4679('0x11')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x2960fc,_0x47dc9['error'][_0x4679('0x12')]);return _0x3b665f(_0x47dc9[_0x4679('0x10')][_0x4679('0x12')]);}logger[_0x4679('0x10')](_0x4679('0xe'),_0x2960fc,_0x47dc9[_0x4679('0x10')][_0x4679('0x12')]);return _0x2a12fd(_0x47dc9[_0x4679('0x10')][_0x4679('0x12')]);}else{logger[_0x4679('0xd')](_0x4679('0xe'),_0x2960fc,_0x4679('0x13'));_0x2a12fd(_0x47dc9[_0x4679('0x14')][_0x4679('0x12')]);}})[_0x4679('0x15')](function(_0x3e6f09){logger[_0x4679('0x10')](_0x4679('0xe'),_0x2960fc,_0x3e6f09);_0x3b665f(_0x3e6f09);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 4e853d0..209fc1f 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(_0x8cb724,_0x5e78d5){var _0x348d6f=function(_0x7b70ea){while(--_0x7b70ea){_0x8cb724['push'](_0x8cb724['shift']());}};_0x348d6f(++_0x5e78d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x4875e8,_0x30267d){var _0x54942e=function(_0x5a340f){while(--_0x5a340f){_0x4875e8['push'](_0x4875e8['shift']());}};_0x54942e(++_0x30267d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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 5e9d135..de376f1 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 _0x6594=['TEXT','STRING'];(function(_0x47bcf7,_0x43d5aa){var _0x2efd4e=function(_0x566095){while(--_0x566095){_0x47bcf7['push'](_0x47bcf7['shift']());}};_0x2efd4e(++_0x43d5aa);}(_0x6594,0xcb));var _0x4659=function(_0x5e8c0f,_0x1f20d9){_0x5e8c0f=_0x5e8c0f-0x0;var _0x568dbe=_0x6594[_0x5e8c0f];return _0x568dbe;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x4659('0x0')]},'metric':{'type':Sequelize[_0x4659('0x1')]},'description':{'type':Sequelize[_0x4659('0x0')]}};
\ No newline at end of file
+var _0x7df3=['sequelize','exports','name','TEXT'];(function(_0x35bf25,_0xff9266){var _0x472a0e=function(_0x286a3f){while(--_0x286a3f){_0x35bf25['push'](_0x35bf25['shift']());}};_0x472a0e(++_0xff9266);}(_0x7df3,0x1cc));var _0x37df=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7df3[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x37df('0x0'));module[_0x37df('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x37df('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x37df('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index b5dec17..a05d547 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 _0x9957=['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','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x2fd160,_0x53c0d6){var _0x5c2031=function(_0x8ecfa5){while(--_0x8ecfa5){_0x2fd160['push'](_0x2fd160['shift']());}};_0x5c2031(++_0x53c0d6);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));};
\ No newline at end of file
+var _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x83338,_0x1834bc){var _0x27aca9=function(_0x5588f7){while(--_0x5588f7){_0x83338['push'](_0x83338['shift']());}};_0x27aca9(++_0x1834bc);}(_0x24ca,0x1bc));var _0xa24c=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0x24ca[_0x25a42a];return _0x1129b1;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 4ac7e38..a94dcba 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 _0xf88f=['analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric'];(function(_0x108442,_0x4359df){var _0x450b63=function(_0x3216ad){while(--_0x3216ad){_0x108442['push'](_0x108442['shift']());}};_0x450b63(++_0x4359df);}(_0xf88f,0x1bb));var _0xff88=function(_0x154c66,_0x9ba0f2){_0x154c66=_0x154c66-0x0;var _0x1c68be=_0xf88f[_0x154c66];return _0x1c68be;};'use strict';var _=require(_0xff88('0x0'));var util=require(_0xff88('0x1'));var logger=require(_0xff88('0x2'))(_0xff88('0x3'));var moment=require(_0xff88('0x4'));var BPromise=require(_0xff88('0x5'));var rp=require(_0xff88('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff88('0x7'));var config=require(_0xff88('0x8'));var attributes=require(_0xff88('0x9'));module['exports']=function(_0x38e1df,_0x406a2e){return _0x38e1df[_0xff88('0xa')](_0xff88('0xb'),attributes,{'tableName':_0xff88('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1203=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x1203,0x8c));var _0x3120=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1203[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3120('0x0'));var util=require(_0x3120('0x1'));var logger=require(_0x3120('0x2'))(_0x3120('0x3'));var moment=require(_0x3120('0x4'));var BPromise=require(_0x3120('0x5'));var rp=require(_0x3120('0x6'));var fs=require('fs');var path=require(_0x3120('0x7'));var rimraf=require(_0x3120('0x8'));var config=require(_0x3120('0x9'));var attributes=require(_0x3120('0xa'));module[_0x3120('0xb')]=function(_0x24de12,_0x835eba){return _0x24de12[_0x3120('0xc')](_0x3120('0xd'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index bd38193..8f0dc65 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 _0x6e5c=['jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x147694,_0x3e5dc8){var _0x127d3a=function(_0x4bfe80){while(--_0x4bfe80){_0x147694['push'](_0x147694['shift']());}};_0x127d3a(++_0x3e5dc8);}(_0x6e5c,0x178));var _0xc6e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6e5c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc6e5('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6e5('0x1'));var db=require(_0xc6e5('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6e5('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc6e5('0x4'));var client=jayson[_0xc6e5('0x5')][_0xc6e5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x26692a,_0x54f17d,_0x345098){return new BPromise(function(_0x599fc5,_0x5c11c7){return client[_0xc6e5('0x7')](_0x26692a,_0x345098)[_0xc6e5('0x8')](function(_0x5ed201){logger['info'](_0xc6e5('0x9'),_0x54f17d,_0xc6e5('0xa'));logger[_0xc6e5('0xb')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x54f17d,'request\x20sent',JSON[_0xc6e5('0xc')](_0x5ed201));if(_0x5ed201[_0xc6e5('0xd')]){if(_0x5ed201[_0xc6e5('0xd')][_0xc6e5('0xe')]===0x1f4){logger[_0xc6e5('0xd')](_0xc6e5('0x9'),_0x54f17d,_0x5ed201[_0xc6e5('0xd')]['message']);return _0x5c11c7(_0x5ed201[_0xc6e5('0xd')]['message']);}logger[_0xc6e5('0xd')](_0xc6e5('0x9'),_0x54f17d,_0x5ed201[_0xc6e5('0xd')][_0xc6e5('0xf')]);return _0x599fc5(_0x5ed201[_0xc6e5('0xd')][_0xc6e5('0xf')]);}else{logger[_0xc6e5('0x10')](_0xc6e5('0x9'),_0x54f17d,_0xc6e5('0xa'));_0x599fc5(_0x5ed201[_0xc6e5('0x11')][_0xc6e5('0xf')]);}})[_0xc6e5('0x12')](function(_0x4ac952){logger[_0xc6e5('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x54f17d,_0x4ac952);_0x5c11c7(_0x4ac952);});});}
\ No newline at end of file
+var _0x1652=['AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0x1652,0x137));var _0x2165=function(_0x23600c,_0x31d165){_0x23600c=_0x23600c-0x0;var _0x57f2a2=_0x1652[_0x23600c];return _0x57f2a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2165('0x0'));var BPromise=require(_0x2165('0x1'));var rs=require(_0x2165('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2165('0x3'));var logger=require('../../config/logger')(_0x2165('0x4'));var config=require('../../config/environment');var jayson=require(_0x2165('0x5'));var client=jayson[_0x2165('0x6')][_0x2165('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3768fa,_0x3d5f0f,_0x190024){return new BPromise(function(_0x2a05bf,_0x226f6b){return client[_0x2165('0x8')](_0x3768fa,_0x190024)[_0x2165('0x9')](function(_0x504a5c){logger[_0x2165('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x3d5f0f,_0x2165('0xb'));logger['debug'](_0x2165('0xc'),_0x3d5f0f,_0x2165('0xb'),JSON['stringify'](_0x504a5c));if(_0x504a5c[_0x2165('0xd')]){if(_0x504a5c[_0x2165('0xd')][_0x2165('0xe')]===0x1f4){logger['error'](_0x2165('0xf'),_0x3d5f0f,_0x504a5c['error'][_0x2165('0x10')]);return _0x226f6b(_0x504a5c[_0x2165('0xd')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x3d5f0f,_0x504a5c[_0x2165('0xd')][_0x2165('0x10')]);return _0x2a05bf(_0x504a5c[_0x2165('0xd')][_0x2165('0x10')]);}else{logger[_0x2165('0xa')](_0x2165('0xf'),_0x3d5f0f,_0x2165('0xb'));_0x2a05bf(_0x504a5c[_0x2165('0x11')]['message']);}})[_0x2165('0x12')](function(_0x4a615a){logger[_0x2165('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x3d5f0f,_0x4a615a);_0x226f6b(_0x4a615a);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 95db50c..9ab6296 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 _0xeecc=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xeecc,0x12d));var _0xceec=function(_0x21ce09,_0x80e5e6){_0x21ce09=_0x21ce09-0x0;var _0x4dfa41=_0xeecc[_0x21ce09];return _0x4dfa41;};'use strict';var multer=require(_0xceec('0x0'));var util=require(_0xceec('0x1'));var path=require(_0xceec('0x2'));var timeout=require(_0xceec('0x3'));var express=require('express');var router=express[_0xceec('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xceec('0x5'));var controller=require(_0xceec('0x6'));router[_0xceec('0x7')]('/',auth[_0xceec('0x8')](),controller['index']);router[_0xceec('0x7')]('/:id',auth[_0xceec('0x8')](),controller[_0xceec('0x9')]);router[_0xceec('0xa')]('/',auth[_0xceec('0x8')](),controller[_0xceec('0xb')]);router[_0xceec('0xc')](_0xceec('0xd'),auth['isAuthenticated'](),controller[_0xceec('0xe')]);router[_0xceec('0xf')](_0xceec('0xd'),auth[_0xceec('0x8')](),controller[_0xceec('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x3561=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','put','/:id','update','exports','multer','path','connect-timeout','express'];(function(_0x262966,_0x17911e){var _0x40b6b9=function(_0x59aec7){while(--_0x59aec7){_0x262966['push'](_0x262966['shift']());}};_0x40b6b9(++_0x17911e);}(_0x3561,0x94));var _0x1356=function(_0x5247b8,_0x5ca75e){_0x5247b8=_0x5247b8-0x0;var _0x362acd=_0x3561[_0x5247b8];return _0x362acd;};'use strict';var multer=require(_0x1356('0x0'));var util=require('util');var path=require(_0x1356('0x1'));var timeout=require(_0x1356('0x2'));var express=require(_0x1356('0x3'));var router=express[_0x1356('0x4')]();var fs_extra=require(_0x1356('0x5'));var auth=require(_0x1356('0x6'));var interaction=require(_0x1356('0x7'));var config=require(_0x1356('0x8'));var controller=require(_0x1356('0x9'));router[_0x1356('0xa')]('/',auth[_0x1356('0xb')](),controller[_0x1356('0xc')]);router[_0x1356('0xa')]('/:id',auth[_0x1356('0xb')](),controller[_0x1356('0xd')]);router[_0x1356('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1356('0xf')](_0x1356('0x10'),auth['isAuthenticated'](),controller[_0x1356('0x11')]);router['delete'](_0x1356('0x10'),auth[_0x1356('0xb')](),controller['destroy']);module[_0x1356('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 0db49f7..f1e6c16 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 _0x2ebc=['exports','TEXT','sequelize'];(function(_0x15b9b9,_0x81f07f){var _0x1a8d00=function(_0x31c8db){while(--_0x31c8db){_0x15b9b9['push'](_0x15b9b9['shift']());}};_0x1a8d00(++_0x81f07f);}(_0x2ebc,0xa4));var _0xc2eb=function(_0x177d5b,_0xf666a5){_0x177d5b=_0x177d5b-0x0;var _0x4c64d5=_0x2ebc[_0x177d5b];return _0x4c64d5;};'use strict';var Sequelize=require(_0xc2eb('0x0'));module[_0xc2eb('0x1')]={'tree':{'type':Sequelize[_0xc2eb('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x96c8=['TEXT','exports'];(function(_0x4979ad,_0x36df48){var _0x3e8c8e=function(_0x4f90b2){while(--_0x4f90b2){_0x4979ad['push'](_0x4979ad['shift']());}};_0x3e8c8e(++_0x36df48);}(_0x96c8,0xa3));var _0x896c=function(_0x3503ee,_0x4498fb){_0x3503ee=_0x3503ee-0x0;var _0x4d62ae=_0x96c8[_0x3503ee];return _0x4d62ae;};'use strict';var Sequelize=require('sequelize');module[_0x896c('0x0')]={'tree':{'type':Sequelize[_0x896c('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index e9f60e0..31131f6 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 _0x7dab=['filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','AnalyticTreeReport','fieldName','type','model','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5a9111,_0x362938){var _0x4ff060=function(_0x42faba){while(--_0x42faba){_0x5a9111['push'](_0x5a9111['shift']());}};_0x4ff060(++_0x362938);}(_0x7dab,0x9f));var _0xb7da=function(_0x599cc1,_0x35652){_0x599cc1=_0x599cc1-0x0;var _0x128dc0=_0x7dab[_0x599cc1];return _0x128dc0;};'use strict';var emlformat=require(_0xb7da('0x0'));var rimraf=require(_0xb7da('0x1'));var zipdir=require(_0xb7da('0x2'));var jsonpatch=require(_0xb7da('0x3'));var rp=require(_0xb7da('0x4'));var moment=require(_0xb7da('0x5'));var BPromise=require(_0xb7da('0x6'));var Mustache=require(_0xb7da('0x7'));var util=require('util');var path=require(_0xb7da('0x8'));var sox=require(_0xb7da('0x9'));var csv=require(_0xb7da('0xa'));var ejs=require(_0xb7da('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb7da('0xc'));var squel=require(_0xb7da('0xd'));var crypto=require(_0xb7da('0xe'));var jsforce=require(_0xb7da('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb7da('0xa'));var querystring=require('querystring');var Papa=require(_0xb7da('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb7da('0x11'));var as=require(_0xb7da('0x12'));var hardwareService=require(_0xb7da('0x13'));var logger=require(_0xb7da('0x14'))('api');var utils=require(_0xb7da('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb7da('0x16'));var db=require(_0xb7da('0x17'))['db'];function respondWithStatusCode(_0x1b6fef,_0x4fca4b){_0x4fca4b=_0x4fca4b||0xcc;return function(_0x2fff87){if(_0x2fff87){return _0x1b6fef[_0xb7da('0x18')](_0x4fca4b);}return _0x1b6fef[_0xb7da('0x19')](_0x4fca4b)[_0xb7da('0x1a')]();};}function respondWithResult(_0x2bf327,_0x49d612){_0x49d612=_0x49d612||0xc8;return function(_0x575f92){if(_0x575f92){return _0x2bf327[_0xb7da('0x19')](_0x49d612)[_0xb7da('0x1b')](_0x575f92);}};}function respondWithFilteredResult(_0x2980d3,_0x28a506){return function(_0x3ae033){if(_0x3ae033){var _0x519e28=typeof _0x28a506[_0xb7da('0x1c')]===_0xb7da('0x1d')&&typeof _0x28a506[_0xb7da('0x1e')]===_0xb7da('0x1d');var _0x4ad279=_0x3ae033[_0xb7da('0x1f')];var _0x244811=_0x519e28?0x0:_0x28a506['offset'];var _0x4813b4=_0x519e28?_0x3ae033[_0xb7da('0x1f')]:_0x28a506['offset']+_0x28a506[_0xb7da('0x1e')];var _0x507b15;if(_0x4813b4>=_0x4ad279){_0x4813b4=_0x4ad279;_0x507b15=0xc8;}else{_0x507b15=0xce;}_0x2980d3[_0xb7da('0x19')](_0x507b15);return _0x2980d3[_0xb7da('0x20')](_0xb7da('0x21'),_0x244811+'-'+_0x4813b4+'/'+_0x4ad279)['json'](_0x3ae033);}return null;};}function patchUpdates(_0x495386){return function(_0x28aabd){try{jsonpatch[_0xb7da('0x22')](_0x28aabd,_0x495386,!![]);}catch(_0x521341){return BPromise[_0xb7da('0x23')](_0x521341);}return _0x28aabd[_0xb7da('0x24')]();};}function saveUpdates(_0x34fcf2,_0x5be661){return function(_0x3919af){if(_0x3919af){return _0x3919af['update'](_0x34fcf2)[_0xb7da('0x25')](function(_0x53a1a4){return _0x53a1a4;});}return null;};}function removeEntity(_0x75e501,_0x1bcbf2){return function(_0x4ae86d){if(_0x4ae86d){return _0x4ae86d[_0xb7da('0x26')]()['then'](function(){_0x75e501[_0xb7da('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x938d56,_0x5dd1f2){return function(_0x2b01e2){if(!_0x2b01e2){_0x938d56[_0xb7da('0x18')](0x194);}return _0x2b01e2;};}function handleError(_0x1db9c1,_0x10d2e4){_0x10d2e4=_0x10d2e4||0x1f4;return function(_0x1c00be){logger[_0xb7da('0x27')](_0x1c00be[_0xb7da('0x28')]);if(_0x1c00be[_0xb7da('0x29')]){delete _0x1c00be[_0xb7da('0x29')];}_0x1db9c1[_0xb7da('0x19')](_0x10d2e4)[_0xb7da('0x2a')](_0x1c00be);};}exports['index']=function(_0x8c398a,_0x1e401f){var _0x52cd78={},_0x5668fb={},_0x5bc2d9={'count':0x0,'rows':[]};var _0x546352=_[_0xb7da('0x2b')](db[_0xb7da('0x2c')]['rawAttributes'],function(_0x48c2d9){return{'name':_0x48c2d9[_0xb7da('0x2d')],'type':_0x48c2d9[_0xb7da('0x2e')]['key']};});_0x5668fb[_0xb7da('0x2f')]=_['map'](_0x546352,_0xb7da('0x29'));_0x5668fb[_0xb7da('0x30')]=_['keys'](_0x8c398a[_0xb7da('0x30')]);_0x5668fb['filters']=_[_0xb7da('0x31')](_0x5668fb[_0xb7da('0x2f')],_0x5668fb['query']);_0x52cd78['attributes']=_['intersection'](_0x5668fb[_0xb7da('0x2f')],qs['fields'](_0x8c398a['query']['fields']));_0x52cd78[_0xb7da('0x32')]=_0x52cd78['attributes']['length']?_0x52cd78[_0xb7da('0x32')]:_0x5668fb['model'];if(!_0x8c398a['query'][_0xb7da('0x33')](_0xb7da('0x34'))){_0x52cd78[_0xb7da('0x1e')]=qs[_0xb7da('0x1e')](_0x8c398a['query'][_0xb7da('0x1e')]);_0x52cd78[_0xb7da('0x1c')]=qs[_0xb7da('0x1c')](_0x8c398a[_0xb7da('0x30')][_0xb7da('0x1c')]);}_0x52cd78[_0xb7da('0x35')]=qs['sort'](_0x8c398a['query'][_0xb7da('0x36')]);_0x52cd78[_0xb7da('0x37')]=qs['filters'](_[_0xb7da('0x38')](_0x8c398a[_0xb7da('0x30')],_0x5668fb[_0xb7da('0x39')]),_0x546352);if(_0x8c398a[_0xb7da('0x30')][_0xb7da('0x3a')]){_0x52cd78['where']=_[_0xb7da('0x3b')](_0x52cd78[_0xb7da('0x37')],{'$or':_['map'](_0x546352,function(_0x135516){if(_0x135516[_0xb7da('0x2e')]!=='VIRTUAL'){var _0x32f57c={};_0x32f57c[_0x135516[_0xb7da('0x29')]]={'$like':'%'+_0x8c398a['query'][_0xb7da('0x3a')]+'%'};return _0x32f57c;}})});}_0x52cd78=_[_0xb7da('0x3b')]({},_0x52cd78,_0x8c398a[_0xb7da('0x3c')]);var _0x1b5aab={'where':_0x52cd78[_0xb7da('0x37')]};return db['AnalyticTreeReport'][_0xb7da('0x1f')](_0x1b5aab)['then'](function(_0x32a042){_0x5bc2d9['count']=_0x32a042;if(_0x8c398a[_0xb7da('0x30')][_0xb7da('0x3d')]){_0x52cd78[_0xb7da('0x3e')]=[{'all':!![]}];}return db[_0xb7da('0x2c')][_0xb7da('0x3f')](_0x52cd78);})['then'](function(_0x2c6897){_0x5bc2d9[_0xb7da('0x40')]=_0x2c6897;return _0x5bc2d9;})[_0xb7da('0x25')](respondWithFilteredResult(_0x1e401f,_0x52cd78))[_0xb7da('0x41')](handleError(_0x1e401f,null));};exports[_0xb7da('0x42')]=function(_0x2bb8d9,_0x30e6e5){var _0x5e2389={'raw':!![],'where':{'id':_0x2bb8d9[_0xb7da('0x43')]['id']}},_0x2e9c31={};_0x2e9c31['model']=_[_0xb7da('0x44')](db[_0xb7da('0x2c')]['rawAttributes']);_0x2e9c31['query']=_['keys'](_0x2bb8d9[_0xb7da('0x30')]);_0x2e9c31[_0xb7da('0x39')]=_['intersection'](_0x2e9c31['model'],_0x2e9c31['query']);_0x5e2389[_0xb7da('0x32')]=_['intersection'](_0x2e9c31[_0xb7da('0x2f')],qs[_0xb7da('0x45')](_0x2bb8d9['query']['fields']));_0x5e2389['attributes']=_0x5e2389[_0xb7da('0x32')]['length']?_0x5e2389['attributes']:_0x2e9c31['model'];if(_0x2bb8d9[_0xb7da('0x30')]['includeAll']){_0x5e2389[_0xb7da('0x3e')]=[{'all':!![]}];}_0x5e2389=_['merge']({},_0x5e2389,_0x2bb8d9[_0xb7da('0x3c')]);return db[_0xb7da('0x2c')][_0xb7da('0x46')](_0x5e2389)[_0xb7da('0x25')](handleEntityNotFound(_0x30e6e5,null))[_0xb7da('0x25')](respondWithResult(_0x30e6e5,null))['catch'](handleError(_0x30e6e5,null));};exports[_0xb7da('0x47')]=function(_0x22e710,_0x17b41e){return db['AnalyticTreeReport'][_0xb7da('0x47')](_0x22e710['body'],{})[_0xb7da('0x25')](respondWithResult(_0x17b41e,0xc9))['catch'](handleError(_0x17b41e,null));};exports['update']=function(_0x3bbdd3,_0x3c03e8){if(_0x3bbdd3['body']['id']){delete _0x3bbdd3['body']['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x3bbdd3[_0xb7da('0x43')]['id']}})['then'](handleEntityNotFound(_0x3c03e8,null))[_0xb7da('0x25')](saveUpdates(_0x3bbdd3['body'],null))[_0xb7da('0x25')](respondWithResult(_0x3c03e8,null))['catch'](handleError(_0x3c03e8,null));};exports[_0xb7da('0x26')]=function(_0x451c04,_0x5d9d5d){return db[_0xb7da('0x2c')][_0xb7da('0x46')]({'where':{'id':_0x451c04[_0xb7da('0x43')]['id']}})[_0xb7da('0x25')](handleEntityNotFound(_0x5d9d5d,null))[_0xb7da('0x25')](removeEntity(_0x5d9d5d,null))[_0xb7da('0x41')](handleError(_0x5d9d5d,null));};
\ No newline at end of file
+var _0x3d38=['api','../../config/utils','../../config/license/util','end','status','json','offset','limit','count','set','Content-Range','apply','save','then','sendStatus','stack','name','send','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','findAll','catch','params','keys','includeAll','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x47177a,_0x44684f){var _0x3c0208=function(_0x58d6e5){while(--_0x58d6e5){_0x47177a['push'](_0x47177a['shift']());}};_0x3c0208(++_0x44684f);}(_0x3d38,0xb7));var _0x83d3=function(_0x193ddf,_0x6f30bb){_0x193ddf=_0x193ddf-0x0;var _0x5bc6df=_0x3d38[_0x193ddf];return _0x5bc6df;};'use strict';var emlformat=require(_0x83d3('0x0'));var rimraf=require(_0x83d3('0x1'));var zipdir=require(_0x83d3('0x2'));var jsonpatch=require(_0x83d3('0x3'));var rp=require(_0x83d3('0x4'));var moment=require('moment');var BPromise=require(_0x83d3('0x5'));var Mustache=require(_0x83d3('0x6'));var util=require(_0x83d3('0x7'));var path=require(_0x83d3('0x8'));var sox=require('sox');var csv=require(_0x83d3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x83d3('0xa'));var deskjs=require(_0x83d3('0xb'));var toCsv=require(_0x83d3('0x9'));var querystring=require(_0x83d3('0xc'));var Papa=require('papaparse');var Redis=require(_0x83d3('0xd'));var authService=require(_0x83d3('0xe'));var qs=require(_0x83d3('0xf'));var as=require(_0x83d3('0x10'));var hardwareService=require(_0x83d3('0x11'));var logger=require('../../config/logger')(_0x83d3('0x12'));var utils=require(_0x83d3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x83d3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f7aaf,_0x396bc4){_0x396bc4=_0x396bc4||0xcc;return function(_0x492617){if(_0x492617){return _0x4f7aaf['sendStatus'](_0x396bc4);}return _0x4f7aaf['status'](_0x396bc4)[_0x83d3('0x15')]();};}function respondWithResult(_0x3d923c,_0x29d364){_0x29d364=_0x29d364||0xc8;return function(_0x569471){if(_0x569471){return _0x3d923c[_0x83d3('0x16')](_0x29d364)[_0x83d3('0x17')](_0x569471);}};}function respondWithFilteredResult(_0x52db1e,_0x1ceb65){return function(_0x35ab27){if(_0x35ab27){var _0x2661f0=typeof _0x1ceb65[_0x83d3('0x18')]==='undefined'&&typeof _0x1ceb65[_0x83d3('0x19')]==='undefined';var _0x2f9943=_0x35ab27[_0x83d3('0x1a')];var _0x22b171=_0x2661f0?0x0:_0x1ceb65['offset'];var _0x565311=_0x2661f0?_0x35ab27['count']:_0x1ceb65[_0x83d3('0x18')]+_0x1ceb65[_0x83d3('0x19')];var _0x139ce0;if(_0x565311>=_0x2f9943){_0x565311=_0x2f9943;_0x139ce0=0xc8;}else{_0x139ce0=0xce;}_0x52db1e[_0x83d3('0x16')](_0x139ce0);return _0x52db1e[_0x83d3('0x1b')](_0x83d3('0x1c'),_0x22b171+'-'+_0x565311+'/'+_0x2f9943)['json'](_0x35ab27);}return null;};}function patchUpdates(_0x3fa541){return function(_0x3cccae){try{jsonpatch[_0x83d3('0x1d')](_0x3cccae,_0x3fa541,!![]);}catch(_0x46b3f6){return BPromise['reject'](_0x46b3f6);}return _0x3cccae[_0x83d3('0x1e')]();};}function saveUpdates(_0x2f9ef9,_0x216b90){return function(_0x56b993){if(_0x56b993){return _0x56b993['update'](_0x2f9ef9)[_0x83d3('0x1f')](function(_0x134bef){return _0x134bef;});}return null;};}function removeEntity(_0x55d012,_0x5ea22b){return function(_0x2a4d3f){if(_0x2a4d3f){return _0x2a4d3f['destroy']()['then'](function(){_0x55d012[_0x83d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x623efe,_0x2df3f0){return function(_0x1dc4ce){if(!_0x1dc4ce){_0x623efe[_0x83d3('0x20')](0x194);}return _0x1dc4ce;};}function handleError(_0x50e29c,_0x342a75){_0x342a75=_0x342a75||0x1f4;return function(_0x36cd5c){logger['error'](_0x36cd5c[_0x83d3('0x21')]);if(_0x36cd5c[_0x83d3('0x22')]){delete _0x36cd5c[_0x83d3('0x22')];}_0x50e29c['status'](_0x342a75)[_0x83d3('0x23')](_0x36cd5c);};}exports['index']=function(_0x33314d,_0x554bef){var _0x2303bd={},_0x51202d={},_0x2eab72={'count':0x0,'rows':[]};var _0x1efb5a=_['map'](db[_0x83d3('0x24')][_0x83d3('0x25')],function(_0x79f40d){return{'name':_0x79f40d[_0x83d3('0x26')],'type':_0x79f40d[_0x83d3('0x27')][_0x83d3('0x28')]};});_0x51202d[_0x83d3('0x29')]=_[_0x83d3('0x2a')](_0x1efb5a,_0x83d3('0x22'));_0x51202d[_0x83d3('0x2b')]=_['keys'](_0x33314d[_0x83d3('0x2b')]);_0x51202d[_0x83d3('0x2c')]=_[_0x83d3('0x2d')](_0x51202d[_0x83d3('0x29')],_0x51202d[_0x83d3('0x2b')]);_0x2303bd[_0x83d3('0x2e')]=_[_0x83d3('0x2d')](_0x51202d[_0x83d3('0x29')],qs['fields'](_0x33314d[_0x83d3('0x2b')][_0x83d3('0x2f')]));_0x2303bd[_0x83d3('0x2e')]=_0x2303bd[_0x83d3('0x2e')][_0x83d3('0x30')]?_0x2303bd[_0x83d3('0x2e')]:_0x51202d['model'];if(!_0x33314d[_0x83d3('0x2b')][_0x83d3('0x31')]('nolimit')){_0x2303bd[_0x83d3('0x19')]=qs[_0x83d3('0x19')](_0x33314d[_0x83d3('0x2b')][_0x83d3('0x19')]);_0x2303bd[_0x83d3('0x18')]=qs['offset'](_0x33314d[_0x83d3('0x2b')]['offset']);}_0x2303bd[_0x83d3('0x32')]=qs[_0x83d3('0x33')](_0x33314d['query'][_0x83d3('0x33')]);_0x2303bd[_0x83d3('0x34')]=qs[_0x83d3('0x2c')](_[_0x83d3('0x35')](_0x33314d[_0x83d3('0x2b')],_0x51202d['filters']),_0x1efb5a);if(_0x33314d['query'][_0x83d3('0x36')]){_0x2303bd[_0x83d3('0x34')]=_[_0x83d3('0x37')](_0x2303bd[_0x83d3('0x34')],{'$or':_['map'](_0x1efb5a,function(_0x1714fb){if(_0x1714fb['type']!=='VIRTUAL'){var _0x51d8bb={};_0x51d8bb[_0x1714fb['name']]={'$like':'%'+_0x33314d['query'][_0x83d3('0x36')]+'%'};return _0x51d8bb;}})});}_0x2303bd=_[_0x83d3('0x37')]({},_0x2303bd,_0x33314d[_0x83d3('0x38')]);var _0x337b80={'where':_0x2303bd['where']};return db['AnalyticTreeReport'][_0x83d3('0x1a')](_0x337b80)[_0x83d3('0x1f')](function(_0x485b0a){_0x2eab72[_0x83d3('0x1a')]=_0x485b0a;if(_0x33314d[_0x83d3('0x2b')]['includeAll']){_0x2303bd['include']=[{'all':!![]}];}return db[_0x83d3('0x24')][_0x83d3('0x39')](_0x2303bd);})['then'](function(_0x53ad19){_0x2eab72['rows']=_0x53ad19;return _0x2eab72;})[_0x83d3('0x1f')](respondWithFilteredResult(_0x554bef,_0x2303bd))[_0x83d3('0x3a')](handleError(_0x554bef,null));};exports['show']=function(_0x45225e,_0x55552d){var _0x597df7={'raw':!![],'where':{'id':_0x45225e[_0x83d3('0x3b')]['id']}},_0x15c513={};_0x15c513[_0x83d3('0x29')]=_[_0x83d3('0x3c')](db[_0x83d3('0x24')][_0x83d3('0x25')]);_0x15c513['query']=_['keys'](_0x45225e['query']);_0x15c513[_0x83d3('0x2c')]=_[_0x83d3('0x2d')](_0x15c513[_0x83d3('0x29')],_0x15c513['query']);_0x597df7[_0x83d3('0x2e')]=_[_0x83d3('0x2d')](_0x15c513[_0x83d3('0x29')],qs[_0x83d3('0x2f')](_0x45225e[_0x83d3('0x2b')][_0x83d3('0x2f')]));_0x597df7[_0x83d3('0x2e')]=_0x597df7[_0x83d3('0x2e')][_0x83d3('0x30')]?_0x597df7[_0x83d3('0x2e')]:_0x15c513[_0x83d3('0x29')];if(_0x45225e['query'][_0x83d3('0x3d')]){_0x597df7[_0x83d3('0x3e')]=[{'all':!![]}];}_0x597df7=_[_0x83d3('0x37')]({},_0x597df7,_0x45225e[_0x83d3('0x38')]);return db['AnalyticTreeReport'][_0x83d3('0x3f')](_0x597df7)[_0x83d3('0x1f')](handleEntityNotFound(_0x55552d,null))[_0x83d3('0x1f')](respondWithResult(_0x55552d,null))[_0x83d3('0x3a')](handleError(_0x55552d,null));};exports[_0x83d3('0x40')]=function(_0x2ccc6b,_0x2f2bde){return db[_0x83d3('0x24')][_0x83d3('0x40')](_0x2ccc6b[_0x83d3('0x41')],{})[_0x83d3('0x1f')](respondWithResult(_0x2f2bde,0xc9))[_0x83d3('0x3a')](handleError(_0x2f2bde,null));};exports['update']=function(_0x32dcc2,_0x5ead29){if(_0x32dcc2['body']['id']){delete _0x32dcc2[_0x83d3('0x41')]['id'];}return db['AnalyticTreeReport'][_0x83d3('0x3f')]({'where':{'id':_0x32dcc2[_0x83d3('0x3b')]['id']}})[_0x83d3('0x1f')](handleEntityNotFound(_0x5ead29,null))[_0x83d3('0x1f')](saveUpdates(_0x32dcc2[_0x83d3('0x41')],null))[_0x83d3('0x1f')](respondWithResult(_0x5ead29,null))[_0x83d3('0x3a')](handleError(_0x5ead29,null));};exports[_0x83d3('0x42')]=function(_0x20acf4,_0x10e53e){return db[_0x83d3('0x24')][_0x83d3('0x3f')]({'where':{'id':_0x20acf4[_0x83d3('0x3b')]['id']}})[_0x83d3('0x1f')](handleEntityNotFound(_0x10e53e,null))[_0x83d3('0x1f')](removeEntity(_0x10e53e,null))[_0x83d3('0x3a')](handleError(_0x10e53e,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index a88a299..15fcbde 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 _0xc4a8=['path','rimraf','../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','bluebird','request-promise'];(function(_0x18afd1,_0x15e563){var _0x78ac02=function(_0x4bb56a){while(--_0x4bb56a){_0x18afd1['push'](_0x18afd1['shift']());}};_0x78ac02(++_0x15e563);}(_0xc4a8,0xed));var _0x8c4a=function(_0x197cc5,_0x388869){_0x197cc5=_0x197cc5-0x0;var _0x5d89f1=_0xc4a8[_0x197cc5];return _0x5d89f1;};'use strict';var _=require('lodash');var util=require(_0x8c4a('0x0'));var logger=require(_0x8c4a('0x1'))(_0x8c4a('0x2'));var moment=require('moment');var BPromise=require(_0x8c4a('0x3'));var rp=require(_0x8c4a('0x4'));var fs=require('fs');var path=require(_0x8c4a('0x5'));var rimraf=require(_0x8c4a('0x6'));var config=require(_0x8c4a('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x8c4a('0x8')]=function(_0x3cc29d,_0xbd70a4){return _0x3cc29d['define'](_0x8c4a('0x9'),attributes,{'tableName':_0x8c4a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9cca=['bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','util','api','moment'];(function(_0x13f1e4,_0x4101cc){var _0x48671f=function(_0x3fa46d){while(--_0x3fa46d){_0x13f1e4['push'](_0x13f1e4['shift']());}};_0x48671f(++_0x4101cc);}(_0x9cca,0x147));var _0xa9cc=function(_0x1c497c,_0x13a6cb){_0x1c497c=_0x1c497c-0x0;var _0x37b5e6=_0x9cca[_0x1c497c];return _0x37b5e6;};'use strict';var _=require('lodash');var util=require(_0xa9cc('0x0'));var logger=require('../../config/logger')(_0xa9cc('0x1'));var moment=require(_0xa9cc('0x2'));var BPromise=require(_0xa9cc('0x3'));var rp=require(_0xa9cc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9cc('0x5'));var config=require(_0xa9cc('0x6'));var attributes=require(_0xa9cc('0x7'));module['exports']=function(_0x2a3a60,_0x1c5769){return _0x2a3a60[_0xa9cc('0x8')](_0xa9cc('0x9'),attributes,{'tableName':_0xa9cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 31d57c2..5c638ef 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(_0x21f2cf,_0x1417ea){var _0x50d69c=function(_0x325021){while(--_0x325021){_0x21f2cf['push'](_0x21f2cf['shift']());}};_0x50d69c(++_0x1417ea);}(_0x2ef3,0xba));var _0x32ef=function(_0x57efee,_0x545eff){_0x57efee=_0x57efee-0x0;var _0x281d0b=_0x2ef3[_0x57efee];return _0x281d0b;};'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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4819e1,_0x44d88e){var _0xca4f58=function(_0x494088){while(--_0x494088){_0x4819e1['push'](_0x4819e1['shift']());}};_0xca4f58(++_0x44d88e);}(_0xadb5,0xad));var _0x5adb=function(_0xaf343d,_0x38a76b){_0xaf343d=_0xaf343d-0x0;var _0x1e2d84=_0xadb5[_0xaf343d];return _0x1e2d84;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index fbb06e8..7d982a6 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 _0x8ad1=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4ade0a,_0x49be85){var _0xe8bfa5=function(_0x135b9a){while(--_0x135b9a){_0x4ade0a['push'](_0x4ade0a['shift']());}};_0xe8bfa5(++_0x49be85);}(_0x8ad1,0xb5));var _0x18ad=function(_0x304e8c,_0x2ee660){_0x304e8c=_0x304e8c-0x0;var _0x114389=_0x8ad1[_0x304e8c];return _0x114389;};'use strict';var multer=require(_0x18ad('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x18ad('0x1'));var router=express[_0x18ad('0x2')]();var fs_extra=require(_0x18ad('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x18ad('0x4'));var config=require(_0x18ad('0x5'));var controller=require(_0x18ad('0x6'));router[_0x18ad('0x7')]('/',auth[_0x18ad('0x8')](),controller[_0x18ad('0x9')]);router['get'](_0x18ad('0xa'),auth[_0x18ad('0x8')](),controller[_0x18ad('0xb')]);router[_0x18ad('0xc')]('/',auth[_0x18ad('0x8')](),controller[_0x18ad('0xd')]);router['put'](_0x18ad('0xa'),auth[_0x18ad('0x8')](),controller['update']);router[_0x18ad('0xe')]('/:id',auth[_0x18ad('0x8')](),controller[_0x18ad('0xf')]);module[_0x18ad('0x10')]=router;
\ No newline at end of file
+var _0x1939=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','path'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x1939,0x12f));var _0x9193=function(_0x1fdff9,_0x4c4bf4){_0x1fdff9=_0x1fdff9-0x0;var _0x3d1b6e=_0x1939[_0x1fdff9];return _0x3d1b6e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9193('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9193('0x1')]();var fs_extra=require(_0x9193('0x2'));var auth=require(_0x9193('0x3'));var interaction=require(_0x9193('0x4'));var config=require(_0x9193('0x5'));var controller=require(_0x9193('0x6'));router[_0x9193('0x7')]('/',auth[_0x9193('0x8')](),controller[_0x9193('0x9')]);router['get'](_0x9193('0xa'),auth[_0x9193('0x8')](),controller[_0x9193('0xb')]);router[_0x9193('0xc')]('/',auth[_0x9193('0x8')](),controller[_0x9193('0xd')]);router[_0x9193('0xe')](_0x9193('0xa'),auth[_0x9193('0x8')](),controller[_0x9193('0xf')]);router[_0x9193('0x10')](_0x9193('0xa'),auth['isAuthenticated'](),controller[_0x9193('0x11')]);module[_0x9193('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index f9dcc09..844a97a 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 _0x6f7f=['STRING','exports'];(function(_0x377ddf,_0x102e9a){var _0x5b8465=function(_0x3e0ed3){while(--_0x3e0ed3){_0x377ddf['push'](_0x377ddf['shift']());}};_0x5b8465(++_0x102e9a);}(_0x6f7f,0x177));var _0xf6f7=function(_0x35f3f8,_0xba35a0){_0x35f3f8=_0x35f3f8-0x0;var _0x4102d8=_0x6f7f[_0x35f3f8];return _0x4102d8;};'use strict';var Sequelize=require('sequelize');module[_0xf6f7('0x0')]={'name':{'type':Sequelize[_0xf6f7('0x1')]},'basename':{'type':Sequelize[_0xf6f7('0x1')]},'type':{'type':Sequelize[_0xf6f7('0x1')]}};
\ No newline at end of file
+var _0xf1e1=['sequelize','STRING'];(function(_0x3bbc50,_0x22d9ec){var _0x997935=function(_0x552142){while(--_0x552142){_0x3bbc50['push'](_0x3bbc50['shift']());}};_0x997935(++_0x22d9ec);}(_0xf1e1,0x102));var _0x1f1e=function(_0x213ed5,_0x26712a){_0x213ed5=_0x213ed5-0x0;var _0x191514=_0xf1e1[_0x213ed5];return _0x191514;};'use strict';var Sequelize=require(_0x1f1e('0x0'));module['exports']={'name':{'type':Sequelize[_0x1f1e('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1f1e('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index ed3f058..d388254 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 _0x64fe=['include','findAll','rows','show','params','includeAll','clone','find','get','omit','updatedAt','body','createdAt','catch','file','originalname','basename','filename','mimetype','create','download','join','root','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','Attachment','rawAttributes','fieldName','type','key','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options'];(function(_0x41ffff,_0xf804b0){var _0x199ef7=function(_0x7b364f){while(--_0x7b364f){_0x41ffff['push'](_0x41ffff['shift']());}};_0x199ef7(++_0xf804b0);}(_0x64fe,0x187));var _0xe64f=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x64fe[_0x2576d7];return _0x16a08c;};'use strict';var emlformat=require(_0xe64f('0x0'));var rimraf=require(_0xe64f('0x1'));var zipdir=require(_0xe64f('0x2'));var jsonpatch=require(_0xe64f('0x3'));var rp=require(_0xe64f('0x4'));var moment=require(_0xe64f('0x5'));var BPromise=require(_0xe64f('0x6'));var Mustache=require(_0xe64f('0x7'));var util=require(_0xe64f('0x8'));var path=require(_0xe64f('0x9'));var sox=require(_0xe64f('0xa'));var csv=require(_0xe64f('0xb'));var ejs=require(_0xe64f('0xc'));var fs=require('fs');var fs_extra=require(_0xe64f('0xd'));var _=require(_0xe64f('0xe'));var squel=require(_0xe64f('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe64f('0x10'));var toCsv=require(_0xe64f('0xb'));var querystring=require(_0xe64f('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe64f('0x12'));var qs=require(_0xe64f('0x13'));var as=require(_0xe64f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe64f('0x15'))(_0xe64f('0x16'));var utils=require(_0xe64f('0x17'));var config=require(_0xe64f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe64f('0x19'))['db'];function respondWithStatusCode(_0x4a8be2,_0x37f23b){_0x37f23b=_0x37f23b||0xcc;return function(_0x55ee98){if(_0x55ee98){return _0x4a8be2[_0xe64f('0x1a')](_0x37f23b);}return _0x4a8be2[_0xe64f('0x1b')](_0x37f23b)[_0xe64f('0x1c')]();};}function respondWithResult(_0x229ef9,_0x20a3c9){_0x20a3c9=_0x20a3c9||0xc8;return function(_0x251c22){if(_0x251c22){return _0x229ef9[_0xe64f('0x1b')](_0x20a3c9)[_0xe64f('0x1d')](_0x251c22);}};}function respondWithFilteredResult(_0x6ab0ee,_0x381a4b){return function(_0x13dca9){if(_0x13dca9){var _0x2e1d4c=typeof _0x381a4b[_0xe64f('0x1e')]===_0xe64f('0x1f')&&typeof _0x381a4b[_0xe64f('0x20')]===_0xe64f('0x1f');var _0x557ca6=_0x13dca9[_0xe64f('0x21')];var _0x3add78=_0x2e1d4c?0x0:_0x381a4b['offset'];var _0x2cc71f=_0x2e1d4c?_0x13dca9['count']:_0x381a4b[_0xe64f('0x1e')]+_0x381a4b[_0xe64f('0x20')];var _0x47f21d;if(_0x2cc71f>=_0x557ca6){_0x2cc71f=_0x557ca6;_0x47f21d=0xc8;}else{_0x47f21d=0xce;}_0x6ab0ee[_0xe64f('0x1b')](_0x47f21d);return _0x6ab0ee[_0xe64f('0x22')](_0xe64f('0x23'),_0x3add78+'-'+_0x2cc71f+'/'+_0x557ca6)['json'](_0x13dca9);}return null;};}function patchUpdates(_0x2b4bf8){return function(_0x32e861){try{jsonpatch[_0xe64f('0x24')](_0x32e861,_0x2b4bf8,!![]);}catch(_0x2ab31e){return BPromise[_0xe64f('0x25')](_0x2ab31e);}return _0x32e861[_0xe64f('0x26')]();};}function saveUpdates(_0x29222c,_0x4e207a){return function(_0x45bf0c){if(_0x45bf0c){return _0x45bf0c[_0xe64f('0x27')](_0x29222c)[_0xe64f('0x28')](function(_0x4c17c0){return _0x4c17c0;});}return null;};}function removeEntity(_0x5c808f,_0x101572){return function(_0x4686bd){if(_0x4686bd){return _0x4686bd[_0xe64f('0x29')]()['then'](function(){_0x5c808f[_0xe64f('0x1b')](0xcc)[_0xe64f('0x1c')]();});}};}function handleEntityNotFound(_0x1dc4fa,_0xf16ad2){return function(_0x51d242){if(!_0x51d242){_0x1dc4fa[_0xe64f('0x1a')](0x194);}return _0x51d242;};}function handleError(_0x55931c,_0x9229a0){_0x9229a0=_0x9229a0||0x1f4;return function(_0x43b492){logger[_0xe64f('0x2a')](_0x43b492[_0xe64f('0x2b')]);if(_0x43b492['name']){delete _0x43b492[_0xe64f('0x2c')];}_0x55931c[_0xe64f('0x1b')](_0x9229a0)['send'](_0x43b492);};}exports['index']=function(_0x76dc1e,_0x291b69){var _0x361f48={},_0x5d32f4={},_0x189d43={'count':0x0,'rows':[]};var _0x5e10e6=_[_0xe64f('0x2d')](db[_0xe64f('0x2e')][_0xe64f('0x2f')],function(_0x1f0b13){return{'name':_0x1f0b13[_0xe64f('0x30')],'type':_0x1f0b13[_0xe64f('0x31')][_0xe64f('0x32')]};});_0x5d32f4['model']=_[_0xe64f('0x2d')](_0x5e10e6,'name');_0x5d32f4['query']=_[_0xe64f('0x33')](_0x76dc1e['query']);_0x5d32f4[_0xe64f('0x34')]=_[_0xe64f('0x35')](_0x5d32f4[_0xe64f('0x36')],_0x5d32f4['query']);_0x361f48[_0xe64f('0x37')]=_[_0xe64f('0x35')](_0x5d32f4[_0xe64f('0x36')],qs[_0xe64f('0x38')](_0x76dc1e[_0xe64f('0x39')][_0xe64f('0x38')]));_0x361f48[_0xe64f('0x37')]=_0x361f48[_0xe64f('0x37')][_0xe64f('0x3a')]?_0x361f48['attributes']:_0x5d32f4[_0xe64f('0x36')];if(!_0x76dc1e[_0xe64f('0x39')][_0xe64f('0x3b')](_0xe64f('0x3c'))){_0x361f48[_0xe64f('0x20')]=qs[_0xe64f('0x20')](_0x76dc1e[_0xe64f('0x39')][_0xe64f('0x20')]);_0x361f48[_0xe64f('0x1e')]=qs['offset'](_0x76dc1e['query']['offset']);}_0x361f48[_0xe64f('0x3d')]=qs[_0xe64f('0x3e')](_0x76dc1e['query'][_0xe64f('0x3e')]);_0x361f48['where']=qs[_0xe64f('0x34')](_[_0xe64f('0x3f')](_0x76dc1e[_0xe64f('0x39')],_0x5d32f4[_0xe64f('0x34')]),_0x5e10e6);if(_0x76dc1e['query'][_0xe64f('0x40')]){_0x361f48[_0xe64f('0x41')]=_[_0xe64f('0x42')](_0x361f48[_0xe64f('0x41')],{'$or':_[_0xe64f('0x2d')](_0x5e10e6,function(_0x471d2f){if(_0x471d2f[_0xe64f('0x31')]!==_0xe64f('0x43')){var _0x1371fb={};_0x1371fb[_0x471d2f[_0xe64f('0x2c')]]={'$like':'%'+_0x76dc1e['query']['filter']+'%'};return _0x1371fb;}})});}_0x361f48=_[_0xe64f('0x42')]({},_0x361f48,_0x76dc1e[_0xe64f('0x44')]);var _0x436863={'where':_0x361f48[_0xe64f('0x41')]};return db['Attachment'][_0xe64f('0x21')](_0x436863)[_0xe64f('0x28')](function(_0x9427c4){_0x189d43[_0xe64f('0x21')]=_0x9427c4;if(_0x76dc1e[_0xe64f('0x39')]['includeAll']){_0x361f48[_0xe64f('0x45')]=[{'all':!![]}];}return db[_0xe64f('0x2e')][_0xe64f('0x46')](_0x361f48);})[_0xe64f('0x28')](function(_0xc0e628){_0x189d43[_0xe64f('0x47')]=_0xc0e628;return _0x189d43;})['then'](respondWithFilteredResult(_0x291b69,_0x361f48))['catch'](handleError(_0x291b69,null));};exports[_0xe64f('0x48')]=function(_0x232149,_0x54f5f4){var _0x37e878={'raw':!![],'where':{'id':_0x232149[_0xe64f('0x49')]['id']}},_0x3cc485={};_0x3cc485['model']=_[_0xe64f('0x33')](db[_0xe64f('0x2e')]['rawAttributes']);_0x3cc485['query']=_[_0xe64f('0x33')](_0x232149[_0xe64f('0x39')]);_0x3cc485[_0xe64f('0x34')]=_['intersection'](_0x3cc485[_0xe64f('0x36')],_0x3cc485['query']);_0x37e878[_0xe64f('0x37')]=_[_0xe64f('0x35')](_0x3cc485[_0xe64f('0x36')],qs[_0xe64f('0x38')](_0x232149[_0xe64f('0x39')]['fields']));_0x37e878['attributes']=_0x37e878['attributes'][_0xe64f('0x3a')]?_0x37e878[_0xe64f('0x37')]:_0x3cc485[_0xe64f('0x36')];if(_0x232149[_0xe64f('0x39')][_0xe64f('0x4a')]){_0x37e878[_0xe64f('0x45')]=[{'all':!![]}];}_0x37e878=_['merge']({},_0x37e878,_0x232149[_0xe64f('0x44')]);return db[_0xe64f('0x2e')]['find'](_0x37e878)[_0xe64f('0x28')](handleEntityNotFound(_0x54f5f4,null))[_0xe64f('0x28')](respondWithResult(_0x54f5f4,null))['catch'](handleError(_0x54f5f4,null));};exports[_0xe64f('0x4b')]=function(_0x3a44bf,_0x21a375){var _0x14ffc8={'where':{'id':_0x3a44bf[_0xe64f('0x49')]['id']}},_0x431bdc={};_0x431bdc[_0xe64f('0x36')]=_['keys'](db[_0xe64f('0x2e')][_0xe64f('0x2f')]);_0x14ffc8[_0xe64f('0x37')]=_[_0xe64f('0x35')](_0x431bdc[_0xe64f('0x36')],qs[_0xe64f('0x38')](_0x3a44bf[_0xe64f('0x39')]['fields']));_0x14ffc8['attributes']=_0x14ffc8[_0xe64f('0x37')][_0xe64f('0x3a')]?_0x14ffc8['attributes']:_0x431bdc[_0xe64f('0x36')];if(_0x3a44bf[_0xe64f('0x39')][_0xe64f('0x4a')]){_0x14ffc8[_0xe64f('0x45')]=[{'all':!![]}];}_0x14ffc8=_[_0xe64f('0x42')]({},_0x14ffc8,_0x3a44bf[_0xe64f('0x44')]);return db[_0xe64f('0x2e')][_0xe64f('0x4c')](_0x14ffc8)[_0xe64f('0x28')](handleEntityNotFound(_0x21a375,null))[_0xe64f('0x28')](function(_0x41742e){if(_0x41742e){var _0x3fee21=_0x41742e[_0xe64f('0x4d')]({'plain':!![]});_0x3fee21=qs[_0xe64f('0x4e')](_0x3fee21,['id','createdAt',_0xe64f('0x4f')]);_0x3a44bf['body']=_[_0xe64f('0x4e')](_0x3a44bf[_0xe64f('0x50')],['id',_0xe64f('0x51'),_0xe64f('0x4f')]);return db['Attachment']['create'](_[_0xe64f('0x42')](_0x3fee21,_0x3a44bf[_0xe64f('0x50')]),{'include':_0x3a44bf[_0xe64f('0x39')][_0xe64f('0x4a')]?[{'all':!![]}]:undefined});}})[_0xe64f('0x28')](respondWithResult(_0x21a375,0xc9))[_0xe64f('0x52')](handleError(_0x21a375,null));};exports[_0xe64f('0x27')]=function(_0x5578fb,_0x45b2aa){if(_0x5578fb[_0xe64f('0x50')]['id']){delete _0x5578fb[_0xe64f('0x50')]['id'];}return db[_0xe64f('0x2e')][_0xe64f('0x4c')]({'where':{'id':_0x5578fb[_0xe64f('0x49')]['id']}})[_0xe64f('0x28')](handleEntityNotFound(_0x45b2aa,null))['then'](saveUpdates(_0x5578fb[_0xe64f('0x50')],null))[_0xe64f('0x28')](respondWithResult(_0x45b2aa,null))[_0xe64f('0x52')](handleError(_0x45b2aa,null));};exports[_0xe64f('0x29')]=function(_0x315833,_0x5c33aa){return db['Attachment']['find']({'where':{'id':_0x315833['params']['id']}})[_0xe64f('0x28')](handleEntityNotFound(_0x5c33aa,null))[_0xe64f('0x28')](removeEntity(_0x5c33aa,null))[_0xe64f('0x52')](handleError(_0x5c33aa,null));};exports['create']=function(_0x39d741,_0x3e1b8b,_0x5e8545){_0x39d741[_0xe64f('0x50')]['name']=_0x39d741[_0xe64f('0x53')][_0xe64f('0x54')];_0x39d741['body'][_0xe64f('0x55')]=_0x39d741['file'][_0xe64f('0x56')];_0x39d741[_0xe64f('0x50')][_0xe64f('0x31')]=_0x39d741['file'][_0xe64f('0x57')];return db[_0xe64f('0x2e')][_0xe64f('0x58')](_0x39d741[_0xe64f('0x50')])['then'](respondWithResult(_0x3e1b8b,0xc9))['catch'](handleError(_0x3e1b8b,null));};exports[_0xe64f('0x59')]=function(_0x518dfb,_0x1e7986,_0x55708c){return db[_0xe64f('0x2e')]['findOne']({'where':{'id':_0x518dfb[_0xe64f('0x49')]['id']},'raw':!![]})[_0xe64f('0x28')](handleEntityNotFound(_0x1e7986,null))[_0xe64f('0x28')](function(_0x24dba0){if(_0x24dba0){var _0xc4f7d9=_0x24dba0['ChatOfflineMessageId']!==null;var _0x3350d1=path[_0xe64f('0x5a')](config[_0xe64f('0x5b')],'server/files/attachments/');if(_0xc4f7d9){_0x3350d1=path[_0xe64f('0x5a')](_0x3350d1,'offline-chat/');}var _0x31dd37=path[_0xe64f('0x5a')](_0x3350d1,_0x24dba0[_0xe64f('0x55')]);return _0x1e7986[_0xe64f('0x59')](_0x31dd37);}})[_0xe64f('0x52')](handleError(_0x1e7986,null));};
\ No newline at end of file
+var _0xddbe=['name','send','index','map','Attachment','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','options','includeAll','catch','show','include','clone','find','get','omit','createdAt','updatedAt','body','update','params','create','file','originalname','basename','filename','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','json','apply','destroy','then','error','stack'];(function(_0x262ea6,_0x5820c5){var _0x46f6ea=function(_0x40fb02){while(--_0x40fb02){_0x262ea6['push'](_0x262ea6['shift']());}};_0x46f6ea(++_0x5820c5);}(_0xddbe,0x1c9));var _0xeddb=function(_0x4e5adc,_0x10133c){_0x4e5adc=_0x4e5adc-0x0;var _0x12fd35=_0xddbe[_0x4e5adc];return _0x12fd35;};'use strict';var emlformat=require(_0xeddb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeddb('0x1'));var jsonpatch=require(_0xeddb('0x2'));var rp=require(_0xeddb('0x3'));var moment=require('moment');var BPromise=require(_0xeddb('0x4'));var Mustache=require(_0xeddb('0x5'));var util=require(_0xeddb('0x6'));var path=require(_0xeddb('0x7'));var sox=require(_0xeddb('0x8'));var csv=require('to-csv');var ejs=require(_0xeddb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xeddb('0xa'));var jsforce=require(_0xeddb('0xb'));var deskjs=require(_0xeddb('0xc'));var toCsv=require(_0xeddb('0xd'));var querystring=require('querystring');var Papa=require(_0xeddb('0xe'));var Redis=require(_0xeddb('0xf'));var authService=require(_0xeddb('0x10'));var qs=require(_0xeddb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeddb('0x12'));var logger=require('../../config/logger')(_0xeddb('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xeddb('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a042e,_0x3fc132){_0x3fc132=_0x3fc132||0xcc;return function(_0x575788){if(_0x575788){return _0x1a042e[_0xeddb('0x15')](_0x3fc132);}return _0x1a042e['status'](_0x3fc132)[_0xeddb('0x16')]();};}function respondWithResult(_0x45b36e,_0xdb7455){_0xdb7455=_0xdb7455||0xc8;return function(_0x313f1d){if(_0x313f1d){return _0x45b36e[_0xeddb('0x17')](_0xdb7455)['json'](_0x313f1d);}};}function respondWithFilteredResult(_0x2b4de9,_0x36276d){return function(_0x25b594){if(_0x25b594){var _0xad1dc=typeof _0x36276d['offset']==='undefined'&&typeof _0x36276d['limit']===_0xeddb('0x18');var _0x352c7b=_0x25b594[_0xeddb('0x19')];var _0x2ef91f=_0xad1dc?0x0:_0x36276d['offset'];var _0x363ab6=_0xad1dc?_0x25b594[_0xeddb('0x19')]:_0x36276d[_0xeddb('0x1a')]+_0x36276d[_0xeddb('0x1b')];var _0x518400;if(_0x363ab6>=_0x352c7b){_0x363ab6=_0x352c7b;_0x518400=0xc8;}else{_0x518400=0xce;}_0x2b4de9[_0xeddb('0x17')](_0x518400);return _0x2b4de9[_0xeddb('0x1c')]('Content-Range',_0x2ef91f+'-'+_0x363ab6+'/'+_0x352c7b)[_0xeddb('0x1d')](_0x25b594);}return null;};}function patchUpdates(_0x19675a){return function(_0x2ccabb){try{jsonpatch[_0xeddb('0x1e')](_0x2ccabb,_0x19675a,!![]);}catch(_0x4e214d){return BPromise['reject'](_0x4e214d);}return _0x2ccabb['save']();};}function saveUpdates(_0x806559,_0x19b7af){return function(_0x4770ad){if(_0x4770ad){return _0x4770ad['update'](_0x806559)['then'](function(_0xf2bc29){return _0xf2bc29;});}return null;};}function removeEntity(_0x7f76a6,_0x38074b){return function(_0x516ca3){if(_0x516ca3){return _0x516ca3[_0xeddb('0x1f')]()[_0xeddb('0x20')](function(){_0x7f76a6['status'](0xcc)[_0xeddb('0x16')]();});}};}function handleEntityNotFound(_0x4d4dae,_0x837095){return function(_0x4757b3){if(!_0x4757b3){_0x4d4dae[_0xeddb('0x15')](0x194);}return _0x4757b3;};}function handleError(_0x1636d6,_0x4834dc){_0x4834dc=_0x4834dc||0x1f4;return function(_0x2b5328){logger[_0xeddb('0x21')](_0x2b5328[_0xeddb('0x22')]);if(_0x2b5328[_0xeddb('0x23')]){delete _0x2b5328[_0xeddb('0x23')];}_0x1636d6[_0xeddb('0x17')](_0x4834dc)[_0xeddb('0x24')](_0x2b5328);};}exports[_0xeddb('0x25')]=function(_0x5a6a94,_0x15533c){var _0x52bba2={},_0x4f4ec1={},_0x293049={'count':0x0,'rows':[]};var _0x2eb245=_[_0xeddb('0x26')](db[_0xeddb('0x27')][_0xeddb('0x28')],function(_0x4a9071){return{'name':_0x4a9071['fieldName'],'type':_0x4a9071['type'][_0xeddb('0x29')]};});_0x4f4ec1[_0xeddb('0x2a')]=_[_0xeddb('0x26')](_0x2eb245,_0xeddb('0x23'));_0x4f4ec1[_0xeddb('0x2b')]=_[_0xeddb('0x2c')](_0x5a6a94[_0xeddb('0x2b')]);_0x4f4ec1[_0xeddb('0x2d')]=_[_0xeddb('0x2e')](_0x4f4ec1['model'],_0x4f4ec1[_0xeddb('0x2b')]);_0x52bba2[_0xeddb('0x2f')]=_[_0xeddb('0x2e')](_0x4f4ec1[_0xeddb('0x2a')],qs[_0xeddb('0x30')](_0x5a6a94['query']['fields']));_0x52bba2[_0xeddb('0x2f')]=_0x52bba2[_0xeddb('0x2f')][_0xeddb('0x31')]?_0x52bba2[_0xeddb('0x2f')]:_0x4f4ec1[_0xeddb('0x2a')];if(!_0x5a6a94[_0xeddb('0x2b')]['hasOwnProperty'](_0xeddb('0x32'))){_0x52bba2[_0xeddb('0x1b')]=qs['limit'](_0x5a6a94[_0xeddb('0x2b')][_0xeddb('0x1b')]);_0x52bba2[_0xeddb('0x1a')]=qs['offset'](_0x5a6a94[_0xeddb('0x2b')]['offset']);}_0x52bba2[_0xeddb('0x33')]=qs[_0xeddb('0x34')](_0x5a6a94[_0xeddb('0x2b')][_0xeddb('0x34')]);_0x52bba2[_0xeddb('0x35')]=qs['filters'](_['pick'](_0x5a6a94['query'],_0x4f4ec1[_0xeddb('0x2d')]),_0x2eb245);if(_0x5a6a94['query'][_0xeddb('0x36')]){_0x52bba2[_0xeddb('0x35')]=_[_0xeddb('0x37')](_0x52bba2[_0xeddb('0x35')],{'$or':_[_0xeddb('0x26')](_0x2eb245,function(_0x3d7545){if(_0x3d7545[_0xeddb('0x38')]!=='VIRTUAL'){var _0x4eafe1={};_0x4eafe1[_0x3d7545[_0xeddb('0x23')]]={'$like':'%'+_0x5a6a94[_0xeddb('0x2b')][_0xeddb('0x36')]+'%'};return _0x4eafe1;}})});}_0x52bba2=_['merge']({},_0x52bba2,_0x5a6a94[_0xeddb('0x39')]);var _0x52fb43={'where':_0x52bba2[_0xeddb('0x35')]};return db['Attachment'][_0xeddb('0x19')](_0x52fb43)[_0xeddb('0x20')](function(_0x3691af){_0x293049[_0xeddb('0x19')]=_0x3691af;if(_0x5a6a94['query'][_0xeddb('0x3a')]){_0x52bba2['include']=[{'all':!![]}];}return db[_0xeddb('0x27')]['findAll'](_0x52bba2);})['then'](function(_0xc2b0c0){_0x293049['rows']=_0xc2b0c0;return _0x293049;})[_0xeddb('0x20')](respondWithFilteredResult(_0x15533c,_0x52bba2))[_0xeddb('0x3b')](handleError(_0x15533c,null));};exports[_0xeddb('0x3c')]=function(_0x3c91fd,_0x4d4c6c){var _0x309ef8={'raw':!![],'where':{'id':_0x3c91fd['params']['id']}},_0x4ff1cd={};_0x4ff1cd[_0xeddb('0x2a')]=_[_0xeddb('0x2c')](db['Attachment'][_0xeddb('0x28')]);_0x4ff1cd[_0xeddb('0x2b')]=_['keys'](_0x3c91fd[_0xeddb('0x2b')]);_0x4ff1cd[_0xeddb('0x2d')]=_[_0xeddb('0x2e')](_0x4ff1cd['model'],_0x4ff1cd[_0xeddb('0x2b')]);_0x309ef8['attributes']=_[_0xeddb('0x2e')](_0x4ff1cd[_0xeddb('0x2a')],qs[_0xeddb('0x30')](_0x3c91fd[_0xeddb('0x2b')][_0xeddb('0x30')]));_0x309ef8['attributes']=_0x309ef8[_0xeddb('0x2f')]['length']?_0x309ef8[_0xeddb('0x2f')]:_0x4ff1cd[_0xeddb('0x2a')];if(_0x3c91fd[_0xeddb('0x2b')][_0xeddb('0x3a')]){_0x309ef8[_0xeddb('0x3d')]=[{'all':!![]}];}_0x309ef8=_[_0xeddb('0x37')]({},_0x309ef8,_0x3c91fd[_0xeddb('0x39')]);return db[_0xeddb('0x27')]['find'](_0x309ef8)[_0xeddb('0x20')](handleEntityNotFound(_0x4d4c6c,null))[_0xeddb('0x20')](respondWithResult(_0x4d4c6c,null))[_0xeddb('0x3b')](handleError(_0x4d4c6c,null));};exports[_0xeddb('0x3e')]=function(_0x47c93d,_0x449b5e){var _0xe7998={'where':{'id':_0x47c93d['params']['id']}},_0x4e4b6a={};_0x4e4b6a[_0xeddb('0x2a')]=_['keys'](db['Attachment'][_0xeddb('0x28')]);_0xe7998[_0xeddb('0x2f')]=_[_0xeddb('0x2e')](_0x4e4b6a['model'],qs[_0xeddb('0x30')](_0x47c93d[_0xeddb('0x2b')][_0xeddb('0x30')]));_0xe7998[_0xeddb('0x2f')]=_0xe7998[_0xeddb('0x2f')][_0xeddb('0x31')]?_0xe7998[_0xeddb('0x2f')]:_0x4e4b6a[_0xeddb('0x2a')];if(_0x47c93d['query'][_0xeddb('0x3a')]){_0xe7998[_0xeddb('0x3d')]=[{'all':!![]}];}_0xe7998=_[_0xeddb('0x37')]({},_0xe7998,_0x47c93d[_0xeddb('0x39')]);return db[_0xeddb('0x27')][_0xeddb('0x3f')](_0xe7998)[_0xeddb('0x20')](handleEntityNotFound(_0x449b5e,null))['then'](function(_0x2ccae1){if(_0x2ccae1){var _0x5dc7ba=_0x2ccae1[_0xeddb('0x40')]({'plain':!![]});_0x5dc7ba=qs[_0xeddb('0x41')](_0x5dc7ba,['id',_0xeddb('0x42'),_0xeddb('0x43')]);_0x47c93d[_0xeddb('0x44')]=_[_0xeddb('0x41')](_0x47c93d[_0xeddb('0x44')],['id',_0xeddb('0x42'),'updatedAt']);return db['Attachment']['create'](_['merge'](_0x5dc7ba,_0x47c93d[_0xeddb('0x44')]),{'include':_0x47c93d['query'][_0xeddb('0x3a')]?[{'all':!![]}]:undefined});}})[_0xeddb('0x20')](respondWithResult(_0x449b5e,0xc9))['catch'](handleError(_0x449b5e,null));};exports[_0xeddb('0x45')]=function(_0x5b3acc,_0x54b30e){if(_0x5b3acc[_0xeddb('0x44')]['id']){delete _0x5b3acc[_0xeddb('0x44')]['id'];}return db[_0xeddb('0x27')][_0xeddb('0x3f')]({'where':{'id':_0x5b3acc[_0xeddb('0x46')]['id']}})[_0xeddb('0x20')](handleEntityNotFound(_0x54b30e,null))['then'](saveUpdates(_0x5b3acc['body'],null))[_0xeddb('0x20')](respondWithResult(_0x54b30e,null))[_0xeddb('0x3b')](handleError(_0x54b30e,null));};exports[_0xeddb('0x1f')]=function(_0xacc4aa,_0x8bdaf9){return db[_0xeddb('0x27')][_0xeddb('0x3f')]({'where':{'id':_0xacc4aa[_0xeddb('0x46')]['id']}})[_0xeddb('0x20')](handleEntityNotFound(_0x8bdaf9,null))[_0xeddb('0x20')](removeEntity(_0x8bdaf9,null))[_0xeddb('0x3b')](handleError(_0x8bdaf9,null));};exports[_0xeddb('0x47')]=function(_0x15a4fd,_0x2bc493,_0x37ffec){_0x15a4fd['body']['name']=_0x15a4fd[_0xeddb('0x48')][_0xeddb('0x49')];_0x15a4fd[_0xeddb('0x44')][_0xeddb('0x4a')]=_0x15a4fd[_0xeddb('0x48')][_0xeddb('0x4b')];_0x15a4fd[_0xeddb('0x44')][_0xeddb('0x38')]=_0x15a4fd['file']['mimetype'];return db['Attachment'][_0xeddb('0x47')](_0x15a4fd[_0xeddb('0x44')])['then'](respondWithResult(_0x2bc493,0xc9))['catch'](handleError(_0x2bc493,null));};exports[_0xeddb('0x4c')]=function(_0x4b1bbe,_0xa7f051,_0x48e479){return db[_0xeddb('0x27')]['findOne']({'where':{'id':_0x4b1bbe[_0xeddb('0x46')]['id']},'raw':!![]})[_0xeddb('0x20')](handleEntityNotFound(_0xa7f051,null))[_0xeddb('0x20')](function(_0x542e9a){if(_0x542e9a){var _0x39f7f3=_0x542e9a[_0xeddb('0x4d')]!==null;var _0x219d59=path[_0xeddb('0x4e')](config[_0xeddb('0x4f')],_0xeddb('0x50'));if(_0x39f7f3){_0x219d59=path[_0xeddb('0x4e')](_0x219d59,_0xeddb('0x51'));}var _0x2bfe21=path[_0xeddb('0x4e')](_0x219d59,_0x542e9a[_0xeddb('0x4a')]);return _0xa7f051[_0xeddb('0x4c')](_0x2bfe21);}})[_0xeddb('0x3b')](handleError(_0xa7f051,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 3e1fd00..5f0617a 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 _0xcbb3=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments'];(function(_0x35bf34,_0x34b15e){var _0x2be0e9=function(_0x399626){while(--_0x399626){_0x35bf34['push'](_0x35bf34['shift']());}};_0x2be0e9(++_0x34b15e);}(_0xcbb3,0xd1));var _0x3cbb=function(_0x2271a9,_0x30e282){_0x2271a9=_0x2271a9-0x0;var _0x3d8840=_0xcbb3[_0x2271a9];return _0x3d8840;};'use strict';var _=require('lodash');var util=require(_0x3cbb('0x0'));var logger=require(_0x3cbb('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3cbb('0x2'));var rp=require(_0x3cbb('0x3'));var fs=require('fs');var path=require(_0x3cbb('0x4'));var rimraf=require(_0x3cbb('0x5'));var config=require(_0x3cbb('0x6'));var attributes=require(_0x3cbb('0x7'));module['exports']=function(_0x4c5f7e,_0x28f80a){return _0x4c5f7e[_0x3cbb('0x8')](_0x3cbb('0x9'),attributes,{'tableName':_0x3cbb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6319=['request-promise','path','rimraf','./attachment.attributes','exports','define','Attachment','lodash','util','../../config/logger','api','bluebird'];(function(_0x273c98,_0x48b6c3){var _0x4df9ea=function(_0x4b90f9){while(--_0x4b90f9){_0x273c98['push'](_0x273c98['shift']());}};_0x4df9ea(++_0x48b6c3);}(_0x6319,0x1cf));var _0x9631=function(_0x1a2156,_0x1833ff){_0x1a2156=_0x1a2156-0x0;var _0x282b37=_0x6319[_0x1a2156];return _0x282b37;};'use strict';var _=require(_0x9631('0x0'));var util=require(_0x9631('0x1'));var logger=require(_0x9631('0x2'))(_0x9631('0x3'));var moment=require('moment');var BPromise=require(_0x9631('0x4'));var rp=require(_0x9631('0x5'));var fs=require('fs');var path=require(_0x9631('0x6'));var rimraf=require(_0x9631('0x7'));var config=require('../../config/environment');var attributes=require(_0x9631('0x8'));module[_0x9631('0x9')]=function(_0x2d184d,_0x3c6591){return _0x2d184d[_0x9631('0xa')](_0x9631('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 0eec513..04755e6 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 _0xaaa2=['code','Attachment,\x20%s,\x20%s','message','info','result','CreateAttachment','create','body','options','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error'];(function(_0x1abae8,_0x164f63){var _0x329e9b=function(_0x1bc1a9){while(--_0x1bc1a9){_0x1abae8['push'](_0x1abae8['shift']());}};_0x329e9b(++_0x164f63);}(_0xaaa2,0xac));var _0x2aaa=function(_0x5c57b7,_0x74a588){_0x5c57b7=_0x5c57b7-0x0;var _0xa39d85=_0xaaa2[_0x5c57b7];return _0xa39d85;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var moment=require(_0x2aaa('0x2'));var BPromise=require(_0x2aaa('0x3'));var rs=require(_0x2aaa('0x4'));var fs=require('fs');var Redis=require(_0x2aaa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2aaa('0x6'));var logger=require('../../config/logger')(_0x2aaa('0x7'));var config=require(_0x2aaa('0x8'));var jayson=require(_0x2aaa('0x9'));var client=jayson[_0x2aaa('0xa')][_0x2aaa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106af9,_0x4f51e6,_0x2f16d7){return new BPromise(function(_0x514c32,_0x505fe8){return client[_0x2aaa('0xc')](_0x106af9,_0x2f16d7)['then'](function(_0x1ad6e9){logger['info']('Attachment,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));logger[_0x2aaa('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'),JSON[_0x2aaa('0xf')](_0x1ad6e9));if(_0x1ad6e9[_0x2aaa('0x10')]){if(_0x1ad6e9['error'][_0x2aaa('0x11')]===0x1f4){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x505fe8(_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);}logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x514c32(_0x1ad6e9[_0x2aaa('0x10')]['message']);}else{logger[_0x2aaa('0x14')]('Attachment,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));_0x514c32(_0x1ad6e9[_0x2aaa('0x15')]['message']);}})['catch'](function(_0x50a767){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x50a767);_0x505fe8(_0x50a767);});});}exports[_0x2aaa('0x16')]=function(_0x3b94bf){var _0x1cae3e=this;return new Promise(function(_0xdaa445,_0x38a049){return db['Attachment'][_0x2aaa('0x17')](_0x3b94bf[_0x2aaa('0x18')],{'raw':_0x3b94bf['options']?_0x3b94bf[_0x2aaa('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1ec32e){logger[_0x2aaa('0x14')](_0x2aaa('0x16'),_0x3b94bf);logger[_0x2aaa('0xe')](_0x2aaa('0x16'),_0x3b94bf,JSON[_0x2aaa('0xf')](_0x1ec32e));_0xdaa445(_0x1ec32e);})[_0x2aaa('0x1a')](function(_0x24da1e){logger['error'](_0x2aaa('0x16'),_0x24da1e[_0x2aaa('0x13')],_0x3b94bf);_0x38a049(_0x1cae3e['error'](0x1f4,_0x24da1e['message']));});});};
\ No newline at end of file
+var _0xbf6e=['error','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x10cb77,_0x2e8faa){var _0x21dd3a=function(_0x58a2ad){while(--_0x58a2ad){_0x10cb77['push'](_0x10cb77['shift']());}};_0x21dd3a(++_0x2e8faa);}(_0xbf6e,0x149));var _0xebf6=function(_0x5a2c3d,_0x39b944){_0x5a2c3d=_0x5a2c3d-0x0;var _0x3e799a=_0xbf6e[_0x5a2c3d];return _0x3e799a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebf6('0x0'));var BPromise=require(_0xebf6('0x1'));var rs=require(_0xebf6('0x2'));var fs=require('fs');var Redis=require(_0xebf6('0x3'));var db=require(_0xebf6('0x4'))['db'];var utils=require(_0xebf6('0x5'));var logger=require(_0xebf6('0x6'))('rpc');var config=require(_0xebf6('0x7'));var jayson=require(_0xebf6('0x8'));var client=jayson[_0xebf6('0x9')][_0xebf6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x143344,_0x1e02b3,_0x137e39){return new BPromise(function(_0x548e9e,_0x1d8035){return client[_0xebf6('0xb')](_0x143344,_0x137e39)[_0xebf6('0xc')](function(_0x591132){logger[_0xebf6('0xd')](_0xebf6('0xe'),_0x1e02b3,'request\x20sent');logger[_0xebf6('0xf')](_0xebf6('0x10'),_0x1e02b3,_0xebf6('0x11'),JSON[_0xebf6('0x12')](_0x591132));if(_0x591132[_0xebf6('0x13')]){if(_0x591132[_0xebf6('0x13')]['code']===0x1f4){logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x591132['error'][_0xebf6('0x14')]);return _0x1d8035(_0x591132[_0xebf6('0x13')][_0xebf6('0x14')]);}logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x591132['error']['message']);return _0x548e9e(_0x591132['error'][_0xebf6('0x14')]);}else{logger[_0xebf6('0xd')]('Attachment,\x20%s,\x20%s',_0x1e02b3,_0xebf6('0x11'));_0x548e9e(_0x591132[_0xebf6('0x15')][_0xebf6('0x14')]);}})[_0xebf6('0x16')](function(_0x3100ee){logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x3100ee);_0x1d8035(_0x3100ee);});});}exports[_0xebf6('0x17')]=function(_0x2d3984){var _0x308480=this;return new Promise(function(_0x55fa31,_0x496dea){return db[_0xebf6('0x18')][_0xebf6('0x19')](_0x2d3984[_0xebf6('0x1a')],{'raw':_0x2d3984[_0xebf6('0x1b')]?_0x2d3984[_0xebf6('0x1b')][_0xebf6('0x1c')]===undefined?!![]:![]:!![]})[_0xebf6('0xc')](function(_0x80f523){logger['info'](_0xebf6('0x17'),_0x2d3984);logger[_0xebf6('0xf')](_0xebf6('0x17'),_0x2d3984,JSON[_0xebf6('0x12')](_0x80f523));_0x55fa31(_0x80f523);})[_0xebf6('0x16')](function(_0x14c8ac){logger[_0xebf6('0x13')](_0xebf6('0x17'),_0x14c8ac[_0xebf6('0x14')],_0x2d3984);_0x496dea(_0x308480[_0xebf6('0x13')](0x1f4,_0x14c8ac[_0xebf6('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 487377d..1129eab 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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x5e3be8,_0x1da1d2){_0x5e3be8=_0x5e3be8-0x0;var _0x1f72ba=_0xdb28[_0x5e3be8];return _0x1f72ba;};'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 _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(_0x48149b,_0x1097d1){_0x48149b=_0x48149b-0x0;var _0x4b3dee=_0xdb28[_0x48149b];return _0x4b3dee;};'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
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 4e3719d..6cdf3d8 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 _0x4dca=['name','password','role','disabled','blocked','admin','user','blockedAt','add','minutes','getLicense','catch','status','send','login','ad-login','json','online','use','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','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','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled'];(function(_0x3c1a95,_0x55995d){var _0xb26183=function(_0x34f395){while(--_0x34f395){_0x3c1a95['push'](_0x3c1a95['shift']());}};_0xb26183(++_0x55995d);}(_0x4dca,0x14e));var _0xa4dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4dca[_0x20a584];return _0x4b41a8;};'use strict';var passport=require(_0xa4dc('0x0'));var LocalStrategy=require(_0xa4dc('0x1'))[_0xa4dc('0x2')];var moment=require(_0xa4dc('0x3'));var ActiveDirectory=require(_0xa4dc('0x4'));var BPromise=require(_0xa4dc('0x5'));var util=require(_0xa4dc('0x6'));var db=require(_0xa4dc('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xa4dc('0x8'));var config=require(_0xa4dc('0x9'));var logger=require(_0xa4dc('0xa'))(_0xa4dc('0xb'));function isActiveDirectoryConfigured(_0x6e9c8f){var _0x1ba13c=![];if(typeof _0x6e9c8f[_0xa4dc('0xc')]!==_0xa4dc('0xd')){_0x1ba13c=_0x6e9c8f[_0xa4dc('0xc')]['baseDN']&&_0x6e9c8f[_0xa4dc('0xc')]['url']&&_0x6e9c8f['activedirectory'][_0xa4dc('0xe')];}return _0x1ba13c;}function adAuthenticate(_0x2c9310,_0x2110a5,_0x373b83){return new BPromise(function(_0x4f0edf,_0x105c7e){try{var _0x5210ea=new ActiveDirectory(_0x2c9310);_0x5210ea[_0xa4dc('0xf')](_0x2110a5,_0x373b83,function(_0x546387,_0x53b1f5){if(_0x546387){logger[_0xa4dc('0x10')](_0xa4dc('0x11'),_0x2110a5,util[_0xa4dc('0x12')](_0x546387,{'showHidden':![],'depth':null}));_0x105c7e(_0xa4dc('0x13'));}else if(!_0x53b1f5){logger[_0xa4dc('0x10')](_0xa4dc('0x14'),_0x2110a5);_0x105c7e(_0xa4dc('0x13'));}else{_0x4f0edf(_0x53b1f5);}});}catch(_0x4b44bf){_0x105c7e(_0x4b44bf);}});}function ActiveDirectoryAuthenticate(_0x527f96,_0x543b8e,_0x18e49f,_0x1db777){var _0x437502,_0x35278e;if(!isActiveDirectoryConfigured(config)){logger[_0xa4dc('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x543b8e);return _0x1db777(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting'][_0xa4dc('0x15')]({'where':{'id':0x1},'attributes':[_0xa4dc('0x16'),_0xa4dc('0x17')],'raw':!![]})[_0xa4dc('0x18')](function(_0x1334ea){_0x437502=_0x1334ea;if(!_0x437502[_0xa4dc('0x16')]){logger[_0xa4dc('0x10')](_0xa4dc('0x19'),_0x543b8e);throw new Error(_0xa4dc('0x13'));}return _0x527f96[_0xa4dc('0x15')]({'attributes':['id',_0xa4dc('0x1a'),_0xa4dc('0x1b'),'salt',_0xa4dc('0x1c'),_0xa4dc('0x1d'),_0xa4dc('0x1e'),'blockedAt','online'],'where':{'name':_0x543b8e,'role':{'$or':[_0xa4dc('0x1f'),_0xa4dc('0x20'),'agent']},'adSsoEnabled':!![]}});})[_0xa4dc('0x18')](function(_0x28556c){if(!_0x28556c||_0x28556c&&_0x28556c['name']!==_0x543b8e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x35278e=_0x28556c;var _0x34e9ff=_0x35278e[_0xa4dc('0x1a')]+'@'+config[_0xa4dc('0xc')][_0xa4dc('0xe')];return adAuthenticate(config[_0xa4dc('0xc')],_0x34e9ff,_0x18e49f);})[_0xa4dc('0x18')](function(_0x3b75a6){if(_0x35278e[_0xa4dc('0x1d')]){throw new Error(_0xa4dc('0x13'));}if(_0x437502[_0xa4dc('0x17')]>0x0){if(_0x35278e['blocked']){if(moment(_0x35278e[_0xa4dc('0x21')])[_0xa4dc('0x22')](_0x437502[_0xa4dc('0x17')],_0xa4dc('0x23'))>moment()){throw new Error(_0xa4dc('0x13'));}return utils['clearBlockUser'](_0x35278e,0x0,![],null)['then'](function(){return utils[_0xa4dc('0x24')](_0x35278e);})[_0xa4dc('0x18')](function(){return _0x1db777(null,_0x35278e);});}else{return utils[_0xa4dc('0x24')](_0x35278e)[_0xa4dc('0x18')](function(){return _0x1db777(null,_0x35278e);});}}else{return utils['getLicense'](_0x35278e)['then'](function(){return _0x1db777(null,_0x35278e);});}})[_0xa4dc('0x25')](function(_0x525a38){return _0x1db777(null,![],_0x525a38);});}function handleError(_0x522ee4,_0x4f1820,_0x25ebbe){return _0x522ee4[_0xa4dc('0x26')](_0x4f1820||0x1f4)[_0xa4dc('0x27')]({'message':_0x25ebbe?_0x25ebbe['message']||_0x25ebbe:''});}exports[_0xa4dc('0x28')]=function(_0xd82e64,_0x372c8d,_0x183bb4){passport[_0xa4dc('0xf')](_0xa4dc('0x29'),function(_0x1670f4,_0x87de2e,_0x528cfb){var _0x4bfad7=_0x1670f4||_0x528cfb;if(_0x4bfad7){return handleError(_0x372c8d,0x191,_0x4bfad7);}if(!_0x87de2e){return handleError(_0x372c8d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xa3ff8={'payload':{'id':_0x87de2e['id'],'role':_0x87de2e['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xa3ff8)['then'](function(_0x37bdcf){_0x372c8d[_0xa4dc('0x2a')]({'id':_0x87de2e['id'],'token':_0x37bdcf,'statusCall':'','isAlreadyLogged':_0x87de2e[_0xa4dc('0x2b')]});});}})(_0xd82e64,_0x372c8d,_0x183bb4);};passport[_0xa4dc('0x2c')](_0xa4dc('0x29'),new LocalStrategy({'usernameField':_0xa4dc('0x1a'),'passwordField':_0xa4dc('0x1b')},function(_0x1d5dc5,_0x4f4809,_0x2426bf){return ActiveDirectoryAuthenticate(db['User'],_0x1d5dc5,_0x4f4809,_0x2426bf);}));
\ No newline at end of file
+var _0x0e1e=['blockedAt','add','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','use','User','passport','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','undefined','activedirectory','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked','online','admin','user','agent'];(function(_0x3d9dca,_0x10508d){var _0x45c216=function(_0x5361b0){while(--_0x5361b0){_0x3d9dca['push'](_0x3d9dca['shift']());}};_0x45c216(++_0x10508d);}(_0x0e1e,0x185));var _0xe0e1=function(_0xbe2c1b,_0x15f55e){_0xbe2c1b=_0xbe2c1b-0x0;var _0x1adc30=_0x0e1e[_0xbe2c1b];return _0x1adc30;};'use strict';var passport=require(_0xe0e1('0x0'));var LocalStrategy=require('passport-local')[_0xe0e1('0x1')];var moment=require(_0xe0e1('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xe0e1('0x3'));var util=require(_0xe0e1('0x4'));var db=require(_0xe0e1('0x5'))['db'];var authService=require(_0xe0e1('0x6'));var utils=require(_0xe0e1('0x7'));var config=require('../../config/environment');var logger=require(_0xe0e1('0x8'))(_0xe0e1('0x9'));function isActiveDirectoryConfigured(_0x3f1a6e){var _0x3d9391=![];if(typeof _0x3f1a6e['activedirectory']!==_0xe0e1('0xa')){_0x3d9391=_0x3f1a6e[_0xe0e1('0xb')]['baseDN']&&_0x3f1a6e[_0xe0e1('0xb')][_0xe0e1('0xc')]&&_0x3f1a6e[_0xe0e1('0xb')][_0xe0e1('0xd')];}return _0x3d9391;}function adAuthenticate(_0x4d6bf1,_0x28755b,_0x2cb3b0){return new BPromise(function(_0x59e5c1,_0x46a0ef){try{var _0xe522c=new ActiveDirectory(_0x4d6bf1);_0xe522c[_0xe0e1('0xe')](_0x28755b,_0x2cb3b0,function(_0x3584e0,_0xde7555){if(_0x3584e0){logger[_0xe0e1('0xf')](_0xe0e1('0x10'),_0x28755b,util['inspect'](_0x3584e0,{'showHidden':![],'depth':null}));_0x46a0ef('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0xde7555){logger[_0xe0e1('0xf')](_0xe0e1('0x11'),_0x28755b);_0x46a0ef('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x59e5c1(_0xde7555);}});}catch(_0xf1db0){_0x46a0ef(_0xf1db0);}});}function ActiveDirectoryAuthenticate(_0x28cb2f,_0x3566f2,_0x526efa,_0x9a3a33){var _0x4c397c,_0x39aeb9;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x3566f2);return _0x9a3a33(null,![],{'message':_0xe0e1('0x12')});}return db[_0xe0e1('0x13')][_0xe0e1('0x14')]({'where':{'id':0x1},'attributes':[_0xe0e1('0x15'),_0xe0e1('0x16')],'raw':!![]})[_0xe0e1('0x17')](function(_0x3089f0){_0x4c397c=_0x3089f0;if(!_0x4c397c[_0xe0e1('0x15')]){logger[_0xe0e1('0xf')](_0xe0e1('0x18'),_0x3566f2);throw new Error(_0xe0e1('0x12'));}return _0x28cb2f[_0xe0e1('0x14')]({'attributes':['id',_0xe0e1('0x19'),_0xe0e1('0x1a'),'salt',_0xe0e1('0x1b'),_0xe0e1('0x1c'),_0xe0e1('0x1d'),'blockedAt',_0xe0e1('0x1e')],'where':{'name':_0x3566f2,'role':{'$or':[_0xe0e1('0x1f'),_0xe0e1('0x20'),_0xe0e1('0x21')]},'adSsoEnabled':!![]}});})[_0xe0e1('0x17')](function(_0x49eda1){if(!_0x49eda1||_0x49eda1&&_0x49eda1[_0xe0e1('0x19')]!==_0x3566f2){throw new Error(_0xe0e1('0x12'));}_0x39aeb9=_0x49eda1;var _0x569f11=_0x39aeb9[_0xe0e1('0x19')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0xe0e1('0xb')],_0x569f11,_0x526efa);})[_0xe0e1('0x17')](function(_0x337a99){if(_0x39aeb9['disabled']){throw new Error(_0xe0e1('0x12'));}if(_0x4c397c['blockDuration']>0x0){if(_0x39aeb9[_0xe0e1('0x1d')]){if(moment(_0x39aeb9[_0xe0e1('0x22')])[_0xe0e1('0x23')](_0x4c397c['blockDuration'],'minutes')>moment()){throw new Error(_0xe0e1('0x12'));}return utils[_0xe0e1('0x24')](_0x39aeb9,0x0,![],null)[_0xe0e1('0x17')](function(){return utils[_0xe0e1('0x25')](_0x39aeb9);})[_0xe0e1('0x17')](function(){return _0x9a3a33(null,_0x39aeb9);});}else{return utils['getLicense'](_0x39aeb9)[_0xe0e1('0x17')](function(){return _0x9a3a33(null,_0x39aeb9);});}}else{return utils['getLicense'](_0x39aeb9)[_0xe0e1('0x17')](function(){return _0x9a3a33(null,_0x39aeb9);});}})[_0xe0e1('0x26')](function(_0x558f4c){return _0x9a3a33(null,![],_0x558f4c);});}function handleError(_0x1b8024,_0x5f23d9,_0xf3a5ad){return _0x1b8024[_0xe0e1('0x27')](_0x5f23d9||0x1f4)[_0xe0e1('0x28')]({'message':_0xf3a5ad?_0xf3a5ad[_0xe0e1('0x29')]||_0xf3a5ad:''});}exports[_0xe0e1('0x2a')]=function(_0xbab4b,_0x5d866f,_0x481c8b){passport[_0xe0e1('0xe')](_0xe0e1('0x2b'),function(_0x432682,_0x45b660,_0x59ded8){var _0x122f3e=_0x432682||_0x59ded8;if(_0x122f3e){return handleError(_0x5d866f,0x191,_0x122f3e);}if(!_0x45b660){return handleError(_0x5d866f,0x194,{'message':_0xe0e1('0x2c')});}else{var _0x2de77f={'payload':{'id':_0x45b660['id'],'role':_0x45b660['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2de77f)[_0xe0e1('0x17')](function(_0x47befd){_0x5d866f['json']({'id':_0x45b660['id'],'token':_0x47befd,'statusCall':'','isAlreadyLogged':_0x45b660[_0xe0e1('0x1e')]});});}})(_0xbab4b,_0x5d866f,_0x481c8b);};passport[_0xe0e1('0x2d')]('ad-login',new LocalStrategy({'usernameField':_0xe0e1('0x19'),'passwordField':'password'},function(_0x56e654,_0xe6aec7,_0x5ee45a){return ActiveDirectoryAuthenticate(db[_0xe0e1('0x2e')],_0x56e654,_0xe6aec7,_0x5ee45a);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index fc60d73..f243df8 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 _0x4faf=['login','exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x2df5e9,_0x3f8482){var _0x44aac3=function(_0x4fbbf4){while(--_0x4fbbf4){_0x2df5e9['push'](_0x2df5e9['shift']());}};_0x44aac3(++_0x3f8482);}(_0x4faf,0x134));var _0xf4fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4faf[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0xf4fa('0x0'));var router=express[_0xf4fa('0x1')]();var controller=require(_0xf4fa('0x2'));router[_0xf4fa('0x3')]('/',controller[_0xf4fa('0x4')]);module[_0xf4fa('0x5')]=router;
\ No newline at end of file
+var _0xbc19=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x3d7647,_0x57491f){var _0x54bc3f=function(_0xb686e4){while(--_0xb686e4){_0x3d7647['push'](_0x3d7647['shift']());}};_0x54bc3f(++_0x57491f);}(_0xbc19,0x96));var _0x9bc1=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xbc19[_0x42cae2];return _0x5f256f;};'use strict';var express=require(_0x9bc1('0x0'));var router=express[_0x9bc1('0x1')]();var controller=require(_0x9bc1('0x2'));router[_0x9bc1('0x3')]('/',controller[_0x9bc1('0x4')]);module[_0x9bc1('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index f1270bf..ca7177a 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x7a54,0x106));var _0x47a5=function(_0xdf002b,_0x2a619f){_0xdf002b=_0xdf002b-0x0;var _0x2f2c00=_0x7a54[_0xdf002b];return _0x2f2c00;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _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(_0x282504,_0x56ebd9){var _0x35cfc3=function(_0x562bd5){while(--_0x562bd5){_0x282504['push'](_0x282504['shift']());}};_0x35cfc3(++_0x56ebd9);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 906134e..25e9635 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 _0x4133=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','express','passport','Router'];(function(_0x5202f7,_0x391c1e){var _0x5de3dc=function(_0x3f0ada){while(--_0x3f0ada){_0x5202f7['push'](_0x5202f7['shift']());}};_0x5de3dc(++_0x391c1e);}(_0x4133,0x1eb));var _0x3413=function(_0x123239,_0x5d6800){_0x123239=_0x123239-0x0;var _0x527615=_0x4133[_0x123239];return _0x527615;};'use strict';var express=require(_0x3413('0x0'));var passport=require(_0x3413('0x1'));var router=express[_0x3413('0x2')]();var controller=require(_0x3413('0x3'));var userController=require(_0x3413('0x4'));var authService=require(_0x3413('0x5'));router[_0x3413('0x6')]('/',controller['login']);router[_0x3413('0x6')](_0x3413('0x7'),controller[_0x3413('0x8')],authService[_0x3413('0x9')],userController[_0x3413('0xa')],authService[_0x3413('0xb')]);module[_0x3413('0xc')]=router;
\ No newline at end of file
+var _0xa16a=['../../components/auth/service','get','/callback','isMiddleware','login','setTokenCookie','express','passport','Router','./authGoogle.controller'];(function(_0x29321b,_0x208284){var _0x9c92a2=function(_0x5a631f){while(--_0x5a631f){_0x29321b['push'](_0x29321b['shift']());}};_0x9c92a2(++_0x208284);}(_0xa16a,0x1aa));var _0xaa16=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0xa16a[_0x3d13bb];return _0x4b5a1b;};'use strict';var express=require(_0xaa16('0x0'));var passport=require(_0xaa16('0x1'));var router=express[_0xaa16('0x2')]();var controller=require(_0xaa16('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0xaa16('0x4'));router['get']('/',controller['login']);router[_0xaa16('0x5')](_0xaa16('0x6'),controller['callback'],authService[_0xaa16('0x7')],userController[_0xaa16('0x8')],authService[_0xaa16('0x9')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index be922ff..a1a7614 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 _0x2fb9=['client','http','Setting','findOne','blockDuration','then','name','salt','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','allowedLoginAttempts','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','role','json','online','forgot','body','email','Email\x20parameter\x20is\x20missing','trim','toLowerCase','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','Reset\x20Email\x20sent!','reset','User','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','password','Password\x20reset!','passport','passport-local','Strategy','moment','../../mysqldb','../../components/auth/service','../../config/utils'];(function(_0x45a682,_0x4e441f){var _0x40f7be=function(_0x57d505){while(--_0x57d505){_0x45a682['push'](_0x45a682['shift']());}};_0x40f7be(++_0x4e441f);}(_0x2fb9,0x18e));var _0x92fb=function(_0x700d5f,_0x57e309){_0x700d5f=_0x700d5f-0x0;var _0x26814f=_0x2fb9[_0x700d5f];return _0x26814f;};'use strict';var util=require('util');var passport=require(_0x92fb('0x0'));var LocalStrategy=require(_0x92fb('0x1'))[_0x92fb('0x2')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require('randomstring');var moment=require(_0x92fb('0x3'));var db=require(_0x92fb('0x4'))['db'];var authService=require(_0x92fb('0x5'));var utils=require(_0x92fb('0x6'));var client=jayson[_0x92fb('0x7')][_0x92fb('0x8')]({'port':0x232b});function localAuthenticate(_0x55fdf7,_0x5b7615,_0x24206a,_0x453dfc){var _0x39c832,_0x12e92e;return db[_0x92fb('0x9')][_0x92fb('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x92fb('0xb')],'raw':!![]})[_0x92fb('0xc')](function(_0x53b1de){_0x39c832=_0x53b1de;return _0x55fdf7[_0x92fb('0xa')]({'attributes':['id',_0x92fb('0xd'),'password',_0x92fb('0xe'),'role','disabled','blocked',_0x92fb('0xf'),_0x92fb('0x10')],'where':{'name':_0x5b7615,'role':{'$or':[_0x92fb('0x11'),_0x92fb('0x12'),_0x92fb('0x13')]}}});})['then'](function(_0x3a31d3){if(!_0x3a31d3||_0x3a31d3&&_0x3a31d3[_0x92fb('0xd')]!==_0x5b7615){throw new Error(_0x92fb('0x14'));}else{_0x12e92e=_0x3a31d3;return _0x12e92e;}})[_0x92fb('0xc')](function(){_0x12e92e['authenticate'](_0x24206a,function(_0x17016e,_0x491fb7){var _0x2edfa2=_0x12e92e[_0x92fb('0x10')]+0x1;if(_0x17016e){return _0x453dfc(_0x17016e);}else if(!_0x491fb7){if(_0x12e92e[_0x92fb('0x15')]){return _0x453dfc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x39c832[_0x92fb('0x16')]>0x0){if(_0x12e92e[_0x92fb('0x17')]){if(_0x39c832[_0x92fb('0xb')]>0x0){if(moment(_0x12e92e['blockedAt'])[_0x92fb('0x18')](_0x39c832[_0x92fb('0xb')],_0x92fb('0x19'))>moment()){return _0x453dfc(null,![],{'message':_0x92fb('0x14')});}else{return utils['clearBlockUser'](_0x12e92e,_0x2edfa2,![],null)[_0x92fb('0xc')](function(){return _0x453dfc(null,![],{'message':_0x92fb('0x14')});});}}else{return _0x453dfc(null,![],{'message':_0x92fb('0x14')});}}else{if(_0x2edfa2>=_0x39c832[_0x92fb('0x16')]){return utils['clearBlockUser'](_0x12e92e,0x0,!![],moment())[_0x92fb('0xc')](function(){return _0x453dfc(null,![],{'message':_0x92fb('0x14')});});}else{return utils[_0x92fb('0x1a')](_0x12e92e,_0x2edfa2,![],null)['then'](function(){return _0x453dfc(null,![],{'message':_0x92fb('0x14')});});}}}else{return _0x453dfc(null,![],{'message':_0x92fb('0x14')});}}else{if(_0x12e92e[_0x92fb('0x15')]){return _0x453dfc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x39c832[_0x92fb('0x16')]>0x0){if(_0x12e92e['blocked']){if(_0x39c832[_0x92fb('0xb')]>0x0){if(moment(_0x12e92e[_0x92fb('0xf')])[_0x92fb('0x18')](_0x39c832['blockDuration'],_0x92fb('0x19'))>moment()){return _0x453dfc(null,![],{'message':_0x92fb('0x14')});}else{return utils[_0x92fb('0x1a')](_0x12e92e,0x0,![],null)[_0x92fb('0xc')](function(){return utils['getLicense'](_0x12e92e);})[_0x92fb('0xc')](function(){return _0x453dfc(null,_0x12e92e);});}}else{return _0x453dfc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x12e92e,0x0,![],null)[_0x92fb('0xc')](function(){return utils[_0x92fb('0x1b')](_0x12e92e);})['then'](function(){return _0x453dfc(null,_0x12e92e);})[_0x92fb('0x1c')](function(_0x30b6a2){return _0x453dfc(null,![],_0x30b6a2);});}}else{if(_0x12e92e[_0x92fb('0x17')]){return _0x453dfc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x92fb('0x1b')](_0x12e92e)[_0x92fb('0xc')](function(){return _0x453dfc(null,_0x12e92e);});}}}});})['catch'](function(_0x4a5ab8){return _0x453dfc(null,![],_0x4a5ab8);});}function sendServiceMail(_0x5b588f){return db[_0x92fb('0x1d')]['find']({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x92fb('0x1e')],'as':_0x92fb('0x1f'),'include':[{'model':db[_0x92fb('0x20')],'as':'CloudProvider'}]}]})['then'](function(_0x45df5f){if(!_0x45df5f){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x65448a=_0x45df5f[_0x92fb('0x21')]();var _0x4e02de={'account':_0x65448a,'message':_[_0x92fb('0x22')]({'from':util[_0x92fb('0x23')](_0x92fb('0x24'),_0x45df5f['name'],_0x45df5f['email']||_0x45df5f[_0x92fb('0x1f')][_0x92fb('0x12')])},_0x5b588f)};return client[_0x92fb('0x25')](_0x92fb('0x26'),_0x4e02de);})[_0x92fb('0xc')](function(_0x1e817c){if(_0x1e817c[_0x92fb('0x27')]){throw new Error(util[_0x92fb('0x23')](_0x92fb('0x28'),_0x1e817c[_0x92fb('0x27')][_0x92fb('0x29')]||JSON[_0x92fb('0x2a')](_0x1e817c[_0x92fb('0x27')])));}return!![];});}function handleError(_0x2123be,_0x41a044,_0x25e132){return _0x2123be[_0x92fb('0x2b')](_0x41a044||0x1f4)[_0x92fb('0x2c')]({'message':_0x25e132?_0x25e132[_0x92fb('0x29')]||_0x25e132:''});}exports[_0x92fb('0x2d')]=function(_0x20d1e6,_0x485f9f,_0x4cceb6){passport[_0x92fb('0x2e')](_0x92fb('0x2f'),function(_0x1df4e4,_0x5b4e2d,_0xf312ba){var _0xc0aa7c=_0x1df4e4||_0xf312ba;if(_0xc0aa7c){return handleError(_0x485f9f,0x191,_0xc0aa7c);}if(!_0x5b4e2d){return handleError(_0x485f9f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x20ca4d={'payload':{'id':_0x5b4e2d['id'],'role':_0x5b4e2d[_0x92fb('0x30')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x20ca4d)['then'](function(_0x414a55){_0x485f9f[_0x92fb('0x31')]({'id':_0x5b4e2d['id'],'token':_0x414a55,'statusCall':'','isAlreadyLogged':_0x5b4e2d[_0x92fb('0x32')]});});}})(_0x20d1e6,_0x485f9f,_0x4cceb6);};exports[_0x92fb('0x33')]=function(_0x1f329f,_0x48119b){if(!_0x1f329f[_0x92fb('0x34')][_0x92fb('0x35')]){return handleError(_0x48119b,0x1f4,{'message':_0x92fb('0x36')});}var _0x42d6b7=rs['generate']();_0x1f329f[_0x92fb('0x34')][_0x92fb('0x35')]=_0x1f329f[_0x92fb('0x34')]['email'][_0x92fb('0x37')]()[_0x92fb('0x38')]();var _0x40d68b;return db['Setting'][_0x92fb('0xa')]({'where':{'id':0x1},'attributes':[_0x92fb('0x16'),_0x92fb('0xb')],'raw':!![]})[_0x92fb('0xc')](function(_0x2b4007){_0x40d68b=_0x2b4007;return db['User'][_0x92fb('0x39')]({'where':{'email':_0x1f329f[_0x92fb('0x34')][_0x92fb('0x35')]}});})[_0x92fb('0xc')](function(_0xb6ba0f){if(!_0xb6ba0f){throw new Error(_0x92fb('0x3a'));}if(_0xb6ba0f[_0x92fb('0x15')]){throw new Error(_0x92fb('0x3b'));}if(_0xb6ba0f['blocked']){if(moment(_0xb6ba0f[_0x92fb('0xf')])[_0x92fb('0x18')](_0x40d68b['blockDuration'],_0x92fb('0x19'))>moment()){throw new Error(_0x92fb('0x3c'));}else{_0xb6ba0f[_0x92fb('0x17')]=![];_0xb6ba0f[_0x92fb('0xf')]=null;}}_0xb6ba0f[_0x92fb('0x3d')]=_0x42d6b7;_0xb6ba0f[_0x92fb('0x3e')]=Date[_0x92fb('0x3f')]()+0x36ee80;return _0xb6ba0f['save']();})['then'](function(){return sendServiceMail({'to':_0x1f329f['body'][_0x92fb('0x35')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x92fb('0x40')+_0x92fb('0x41')+_0x1f329f[_0x92fb('0x42')][_0x92fb('0x43')]+_0x92fb('0x44')+_0x42d6b7+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x92fb('0xc')](function(){_0x48119b[_0x92fb('0x2b')](0xc8)[_0x92fb('0x2c')]({'message':_0x92fb('0x45')});})[_0x92fb('0x1c')](function(_0x21b8ee){return handleError(_0x48119b,0x1f4,_0x21b8ee);});};exports[_0x92fb('0x46')]=function(_0x1dd548,_0x585598){return db[_0x92fb('0x47')][_0x92fb('0x39')]({'where':{'resetPasswordToken':_0x1dd548[_0x92fb('0x48')]['token'],'resetPasswordExpires':{'$gt':Date[_0x92fb('0x3f')]()}}})[_0x92fb('0xc')](function(_0x362a0d){if(!_0x362a0d){throw new Error(_0x92fb('0x49'));}return db[_0x92fb('0x9')][_0x92fb('0xa')]({'attributes':['id',_0x92fb('0x4a'),_0x92fb('0x4b'),_0x92fb('0x4c')]})[_0x92fb('0xc')](function(_0x538fb6){if(_0x538fb6[_0x92fb('0x4a')])authService[_0x92fb('0x4d')](_0x1dd548['body']['password']);if(!_0x538fb6[_0x92fb('0x4b')]||!_0x362a0d['previousPasswords'])return _0x362a0d;authService[_0x92fb('0x4e')](_0x1dd548[_0x92fb('0x34')][_0x92fb('0x4f')],_0x362a0d['previousPasswords'],_0x538fb6[_0x92fb('0x4c')]);return _0x362a0d;})[_0x92fb('0xc')](function(){_0x362a0d[_0x92fb('0x4f')]=_0x1dd548[_0x92fb('0x34')]['password'];_0x362a0d[_0x92fb('0x3d')]=null;_0x362a0d['resetPasswordExpires']=null;return _0x362a0d['save']();});})['then'](function(){_0x585598[_0x92fb('0x2b')](0xc8)['send']({'message':_0x92fb('0x50')});})[_0x92fb('0x1c')](function(_0xff8fcc){return handleError(_0x585598,0x1f4,_0xff8fcc);});};passport['use'](_0x92fb('0x2f'),new LocalStrategy({'usernameField':_0x92fb('0xd'),'passwordField':'password'},function(_0x348a03,_0x21749a,_0xf70bca){return localAuthenticate(db['User'],_0x348a03,_0x21749a,_0xf70bca);}));
\ No newline at end of file
+var _0x884c=['forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','merge','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken'];(function(_0x41ee64,_0x206c94){var _0x468e47=function(_0x1ff854){while(--_0x1ff854){_0x41ee64['push'](_0x41ee64['shift']());}};_0x468e47(++_0x206c94);}(_0x884c,0x6b));var _0xc884=function(_0x3699e8,_0x528bca){_0x3699e8=_0x3699e8-0x0;var _0x239877=_0x884c[_0x3699e8];return _0x239877;};'use strict';var util=require(_0xc884('0x0'));var passport=require('passport');var LocalStrategy=require(_0xc884('0x1'))[_0xc884('0x2')];var jayson=require(_0xc884('0x3'));var _=require(_0xc884('0x4'));var rs=require(_0xc884('0x5'));var moment=require(_0xc884('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0xc884('0x7'));var utils=require('../../config/utils');var client=jayson[_0xc884('0x8')][_0xc884('0x9')]({'port':0x232b});function localAuthenticate(_0x562cf4,_0x213e3c,_0x3045f0,_0x4c7962){var _0x5685a3,_0x39257e;return db[_0xc884('0xa')][_0xc884('0xb')]({'where':{'id':0x1},'attributes':[_0xc884('0xc'),_0xc884('0xd')],'raw':!![]})[_0xc884('0xe')](function(_0xa55d80){_0x5685a3=_0xa55d80;return _0x562cf4['findOne']({'attributes':['id',_0xc884('0xf'),_0xc884('0x10'),'salt','role',_0xc884('0x11'),_0xc884('0x12'),_0xc884('0x13'),'loginAttempts'],'where':{'name':_0x213e3c,'role':{'$or':[_0xc884('0x14'),_0xc884('0x15'),_0xc884('0x16')]}}});})[_0xc884('0xe')](function(_0x411285){if(!_0x411285||_0x411285&&_0x411285['name']!==_0x213e3c){throw new Error(_0xc884('0x17'));}else{_0x39257e=_0x411285;return _0x39257e;}})[_0xc884('0xe')](function(){_0x39257e[_0xc884('0x18')](_0x3045f0,function(_0x599260,_0x33a7cd){var _0xfa75a5=_0x39257e[_0xc884('0x19')]+0x1;if(_0x599260){return _0x4c7962(_0x599260);}else if(!_0x33a7cd){if(_0x39257e[_0xc884('0x11')]){return _0x4c7962(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5685a3[_0xc884('0xc')]>0x0){if(_0x39257e[_0xc884('0x12')]){if(_0x5685a3['blockDuration']>0x0){if(moment(_0x39257e[_0xc884('0x13')])[_0xc884('0x1a')](_0x5685a3[_0xc884('0xd')],_0xc884('0x1b'))>moment()){return _0x4c7962(null,![],{'message':_0xc884('0x17')});}else{return utils[_0xc884('0x1c')](_0x39257e,_0xfa75a5,![],null)[_0xc884('0xe')](function(){return _0x4c7962(null,![],{'message':_0xc884('0x17')});});}}else{return _0x4c7962(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xfa75a5>=_0x5685a3[_0xc884('0xc')]){return utils[_0xc884('0x1c')](_0x39257e,0x0,!![],moment())[_0xc884('0xe')](function(){return _0x4c7962(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xc884('0x1c')](_0x39257e,_0xfa75a5,![],null)['then'](function(){return _0x4c7962(null,![],{'message':_0xc884('0x17')});});}}}else{return _0x4c7962(null,![],{'message':_0xc884('0x17')});}}else{if(_0x39257e[_0xc884('0x11')]){return _0x4c7962(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5685a3['allowedLoginAttempts']>0x0){if(_0x39257e[_0xc884('0x12')]){if(_0x5685a3[_0xc884('0xd')]>0x0){if(moment(_0x39257e['blockedAt'])[_0xc884('0x1a')](_0x5685a3[_0xc884('0xd')],_0xc884('0x1b'))>moment()){return _0x4c7962(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xc884('0x1c')](_0x39257e,0x0,![],null)['then'](function(){return utils[_0xc884('0x1d')](_0x39257e);})[_0xc884('0xe')](function(){return _0x4c7962(null,_0x39257e);});}}else{return _0x4c7962(null,![],{'message':_0xc884('0x17')});}}else{return utils['clearBlockUser'](_0x39257e,0x0,![],null)['then'](function(){return utils[_0xc884('0x1d')](_0x39257e);})[_0xc884('0xe')](function(){return _0x4c7962(null,_0x39257e);})[_0xc884('0x1e')](function(_0x36d80b){return _0x4c7962(null,![],_0x36d80b);});}}else{if(_0x39257e[_0xc884('0x12')]){return _0x4c7962(null,![],{'message':_0xc884('0x17')});}else{return utils['getLicense'](_0x39257e)[_0xc884('0xe')](function(){return _0x4c7962(null,_0x39257e);});}}}});})[_0xc884('0x1e')](function(_0x45f287){return _0x4c7962(null,![],_0x45f287);});}function sendServiceMail(_0x376d07){return db[_0xc884('0x1f')][_0xc884('0x20')]({'where':{'service':!![]},'attributes':['id',_0xc884('0xf'),_0xc884('0x21')],'include':[{'model':db[_0xc884('0x22')],'as':_0xc884('0x23'),'include':[{'model':db[_0xc884('0x24')],'as':_0xc884('0x24')}]}]})[_0xc884('0xe')](function(_0x241a72){if(!_0x241a72){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x39ee65=_0x241a72['getSmtpOptions']();var _0x29011b={'account':_0x39ee65,'message':_[_0xc884('0x25')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x241a72[_0xc884('0xf')],_0x241a72[_0xc884('0x21')]||_0x241a72['Smtp'][_0xc884('0x15')])},_0x376d07)};return client[_0xc884('0x26')](_0xc884('0x27'),_0x29011b);})[_0xc884('0xe')](function(_0x545d62){if(_0x545d62[_0xc884('0x28')]){throw new Error(util[_0xc884('0x29')](_0xc884('0x2a'),_0x545d62[_0xc884('0x28')][_0xc884('0x2b')]||JSON[_0xc884('0x2c')](_0x545d62[_0xc884('0x28')])));}return!![];});}function handleError(_0x9c0747,_0x4ddb07,_0x151474){return _0x9c0747[_0xc884('0x2d')](_0x4ddb07||0x1f4)[_0xc884('0x2e')]({'message':_0x151474?_0x151474[_0xc884('0x2b')]||_0x151474:''});}exports[_0xc884('0x2f')]=function(_0x3724d9,_0x48889c,_0x1edcce){passport[_0xc884('0x18')](_0xc884('0x30'),function(_0x370299,_0xd46716,_0x2ad499){var _0x9c7de5=_0x370299||_0x2ad499;if(_0x9c7de5){return handleError(_0x48889c,0x191,_0x9c7de5);}if(!_0xd46716){return handleError(_0x48889c,0x194,{'message':_0xc884('0x31')});}else{var _0xb89d6d={'payload':{'id':_0xd46716['id'],'role':_0xd46716['role']},'options':{'expiresIn':0x15180}};return authService[_0xc884('0x32')](_0xb89d6d)[_0xc884('0xe')](function(_0x35878c){_0x48889c['json']({'id':_0xd46716['id'],'token':_0x35878c,'statusCall':'','isAlreadyLogged':_0xd46716['online']});});}})(_0x3724d9,_0x48889c,_0x1edcce);};exports[_0xc884('0x33')]=function(_0x56a838,_0x4ffc9a){if(!_0x56a838[_0xc884('0x34')][_0xc884('0x21')]){return handleError(_0x4ffc9a,0x1f4,{'message':_0xc884('0x35')});}var _0x23d927=rs['generate']();_0x56a838[_0xc884('0x34')]['email']=_0x56a838[_0xc884('0x34')][_0xc884('0x21')][_0xc884('0x36')]()[_0xc884('0x37')]();var _0x2e6bea;return db['Setting'][_0xc884('0xb')]({'where':{'id':0x1},'attributes':[_0xc884('0xc'),_0xc884('0xd')],'raw':!![]})[_0xc884('0xe')](function(_0x6d1e0c){_0x2e6bea=_0x6d1e0c;return db[_0xc884('0x38')][_0xc884('0x20')]({'where':{'email':_0x56a838['body'][_0xc884('0x21')]}});})['then'](function(_0x231188){if(!_0x231188){throw new Error(_0xc884('0x39'));}if(_0x231188[_0xc884('0x11')]){throw new Error(_0xc884('0x3a'));}if(_0x231188['blocked']){if(moment(_0x231188[_0xc884('0x13')])[_0xc884('0x1a')](_0x2e6bea['blockDuration'],_0xc884('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x231188[_0xc884('0x12')]=![];_0x231188[_0xc884('0x13')]=null;}}_0x231188[_0xc884('0x3b')]=_0x23d927;_0x231188['resetPasswordExpires']=Date[_0xc884('0x3c')]()+0x36ee80;return _0x231188['save']();})[_0xc884('0xe')](function(){return sendServiceMail({'to':_0x56a838['body'][_0xc884('0x21')],'subject':_0xc884('0x3d'),'text':_0xc884('0x3e')+_0xc884('0x3f')+_0xc884('0x40')+_0x56a838[_0xc884('0x41')][_0xc884('0x42')]+_0xc884('0x43')+_0x23d927+'\x0a\x0a'+_0xc884('0x44')});})[_0xc884('0xe')](function(){_0x4ffc9a[_0xc884('0x2d')](0xc8)[_0xc884('0x2e')]({'message':_0xc884('0x45')});})[_0xc884('0x1e')](function(_0x1ed01a){return handleError(_0x4ffc9a,0x1f4,_0x1ed01a);});};exports['reset']=function(_0x678dd2,_0x5bb1b8){return db['User'][_0xc884('0x20')]({'where':{'resetPasswordToken':_0x678dd2['params'][_0xc884('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xc884('0xe')](function(_0x968359){if(!_0x968359){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xc884('0xa')][_0xc884('0xb')]({'attributes':['id',_0xc884('0x47'),_0xc884('0x48'),_0xc884('0x49')]})[_0xc884('0xe')](function(_0x193a26){if(_0x193a26[_0xc884('0x47')])authService[_0xc884('0x4a')](_0x678dd2[_0xc884('0x34')][_0xc884('0x10')]);if(!_0x193a26[_0xc884('0x48')]||!_0x968359[_0xc884('0x4b')])return _0x968359;authService[_0xc884('0x4c')](_0x678dd2[_0xc884('0x34')][_0xc884('0x10')],_0x968359[_0xc884('0x4b')],_0x193a26['passwordHistoryLimit']);return _0x968359;})[_0xc884('0xe')](function(){_0x968359[_0xc884('0x10')]=_0x678dd2[_0xc884('0x34')][_0xc884('0x10')];_0x968359[_0xc884('0x3b')]=null;_0x968359['resetPasswordExpires']=null;return _0x968359[_0xc884('0x4d')]();});})[_0xc884('0xe')](function(){_0x5bb1b8[_0xc884('0x2d')](0xc8)[_0xc884('0x2e')]({'message':'Password\x20reset!'});})[_0xc884('0x1e')](function(_0x5e1668){return handleError(_0x5bb1b8,0x1f4,_0x5e1668);});};passport[_0xc884('0x4e')](_0xc884('0x30'),new LocalStrategy({'usernameField':_0xc884('0xf'),'passwordField':_0xc884('0x10')},function(_0x4c65d3,_0xa605d4,_0x425c99){return localAuthenticate(db['User'],_0x4c65d3,_0xa605d4,_0x425c99);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 9567798..34ae3cf 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 _0xb33e=['express','Router','post','/forgot','/reset/:token','reset','exports'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0xb33e,0x11f));var _0xeb33=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb33e[_0x138adb];return _0x1b27f2;};'use strict';var express=require(_0xeb33('0x0'));var router=express[_0xeb33('0x1')]();var controller=require('./authLocal.controller');router[_0xeb33('0x2')]('/',controller['login']);router[_0xeb33('0x2')](_0xeb33('0x3'),controller['forgot']);router['post'](_0xeb33('0x4'),controller[_0xeb33('0x5')]);module[_0xeb33('0x6')]=router;
\ No newline at end of file
+var _0xf4a8=['./authLocal.controller','post','login','/forgot','/reset/:token','reset','exports','express','Router'];(function(_0x346cb2,_0x14a0ea){var _0x43b9cc=function(_0x339b13){while(--_0x339b13){_0x346cb2['push'](_0x346cb2['shift']());}};_0x43b9cc(++_0x14a0ea);}(_0xf4a8,0x85));var _0x8f4a=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0xf4a8[_0xca1f0e];return _0x35e4ef;};'use strict';var express=require(_0x8f4a('0x0'));var router=express[_0x8f4a('0x1')]();var controller=require(_0x8f4a('0x2'));router[_0x8f4a('0x3')]('/',controller[_0x8f4a('0x4')]);router[_0x8f4a('0x3')](_0x8f4a('0x5'),controller['forgot']);router[_0x8f4a('0x3')](_0x8f4a('0x6'),controller[_0x8f4a('0x7')]);module[_0x8f4a('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 6e34a47..d1072dd 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 _0xc461=['BOOLEAN','INTEGER','exports'];(function(_0x4e4e61,_0x38aede){var _0x5bda8e=function(_0x2c2c8d){while(--_0x2c2c8d){_0x4e4e61['push'](_0x4e4e61['shift']());}};_0x5bda8e(++_0x38aede);}(_0xc461,0x12b));var _0x1c46=function(_0x1071c6,_0xa49f0a){_0x1071c6=_0x1071c6-0x0;var _0x4edee4=_0xc461[_0x1071c6];return _0x4edee4;};'use strict';var Sequelize=require('sequelize');module[_0x1c46('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x1c46('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1c46('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x93b1=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x42a8c0,_0x36c472){var _0x426d7b=function(_0x71cca2){while(--_0x71cca2){_0x42a8c0['push'](_0x42a8c0['shift']());}};_0x426d7b(++_0x36c472);}(_0x93b1,0x1aa));var _0x193b=function(_0xd9d179,_0x27ee02){_0xd9d179=_0xd9d179-0x0;var _0x3eb4f7=_0x93b1[_0xd9d179];return _0x3eb4f7;};'use strict';var Sequelize=require(_0x193b('0x0'));module[_0x193b('0x1')]={'name':{'type':Sequelize[_0x193b('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x193b('0x2')]},'description':{'type':Sequelize[_0x193b('0x2')]},'status':{'type':Sequelize[_0x193b('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x193b('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 9cbca8c..1ccaf49 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 _0x7a6d=['util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','update','then','sendStatus','error','name','index','map','Automation','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','catch','show','params','create','body','find','destroy','addConditions','omit','findOne','Condition','getConditions','addActions','Action','ids','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x596248,_0x4c64fc){var _0x6f92d2=function(_0x85ccb0){while(--_0x85ccb0){_0x596248['push'](_0x596248['shift']());}};_0x6f92d2(++_0x4c64fc);}(_0x7a6d,0x99));var _0xd7a6=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0x7a6d[_0x9cfe28];return _0x54a1d0;};'use strict';var emlformat=require(_0xd7a6('0x0'));var rimraf=require(_0xd7a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd7a6('0x2'));var rp=require(_0xd7a6('0x3'));var moment=require(_0xd7a6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd7a6('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xd7a6('0x6'));var ejs=require(_0xd7a6('0x7'));var fs=require('fs');var fs_extra=require(_0xd7a6('0x8'));var _=require(_0xd7a6('0x9'));var squel=require(_0xd7a6('0xa'));var crypto=require(_0xd7a6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd7a6('0xc'));var toCsv=require(_0xd7a6('0x6'));var querystring=require(_0xd7a6('0xd'));var Papa=require(_0xd7a6('0xe'));var Redis=require(_0xd7a6('0xf'));var authService=require(_0xd7a6('0x10'));var qs=require(_0xd7a6('0x11'));var as=require(_0xd7a6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd7a6('0x13'));var utils=require(_0xd7a6('0x14'));var config=require(_0xd7a6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd7a6('0x16'))['db'];function respondWithStatusCode(_0x3f7a57,_0x3bf0e7){_0x3bf0e7=_0x3bf0e7||0xcc;return function(_0x51ddc7){if(_0x51ddc7){return _0x3f7a57['sendStatus'](_0x3bf0e7);}return _0x3f7a57[_0xd7a6('0x17')](_0x3bf0e7)['end']();};}function respondWithResult(_0x51086d,_0x50373f){_0x50373f=_0x50373f||0xc8;return function(_0x500779){if(_0x500779){return _0x51086d['status'](_0x50373f)['json'](_0x500779);}};}function respondWithFilteredResult(_0x5e8585,_0x16c949){return function(_0x48087c){if(_0x48087c){var _0x9374fb=typeof _0x16c949[_0xd7a6('0x18')]==='undefined'&&typeof _0x16c949[_0xd7a6('0x19')]===_0xd7a6('0x1a');var _0x3b7ac1=_0x48087c['count'];var _0x1629d6=_0x9374fb?0x0:_0x16c949[_0xd7a6('0x18')];var _0x1e8a59=_0x9374fb?_0x48087c[_0xd7a6('0x1b')]:_0x16c949[_0xd7a6('0x18')]+_0x16c949[_0xd7a6('0x19')];var _0x1b17ce;if(_0x1e8a59>=_0x3b7ac1){_0x1e8a59=_0x3b7ac1;_0x1b17ce=0xc8;}else{_0x1b17ce=0xce;}_0x5e8585[_0xd7a6('0x17')](_0x1b17ce);return _0x5e8585[_0xd7a6('0x1c')](_0xd7a6('0x1d'),_0x1629d6+'-'+_0x1e8a59+'/'+_0x3b7ac1)[_0xd7a6('0x1e')](_0x48087c);}return null;};}function patchUpdates(_0xdf1545){return function(_0x3d4b2f){try{jsonpatch['apply'](_0x3d4b2f,_0xdf1545,!![]);}catch(_0x2a2f18){return BPromise['reject'](_0x2a2f18);}return _0x3d4b2f['save']();};}function saveUpdates(_0x2ffe61,_0x492749){return function(_0x338578){if(_0x338578){return _0x338578[_0xd7a6('0x1f')](_0x2ffe61)[_0xd7a6('0x20')](function(_0x40f758){return _0x40f758;});}return null;};}function removeEntity(_0x6d97a5,_0x30d557){return function(_0x7e97ed){if(_0x7e97ed){return _0x7e97ed['destroy']()[_0xd7a6('0x20')](function(){_0x6d97a5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47b72f,_0x49e65f){return function(_0x3a9caf){if(!_0x3a9caf){_0x47b72f[_0xd7a6('0x21')](0x194);}return _0x3a9caf;};}function handleError(_0xfd0902,_0x7cf498){_0x7cf498=_0x7cf498||0x1f4;return function(_0x2503f3){logger[_0xd7a6('0x22')](_0x2503f3['stack']);if(_0x2503f3['name']){delete _0x2503f3[_0xd7a6('0x23')];}_0xfd0902[_0xd7a6('0x17')](_0x7cf498)['send'](_0x2503f3);};}exports[_0xd7a6('0x24')]=function(_0x190708,_0x3aa7ce){var _0x2e7656={},_0x22ef5c={},_0xd45255={'count':0x0,'rows':[]};var _0x3fc763=_[_0xd7a6('0x25')](db[_0xd7a6('0x26')][_0xd7a6('0x27')],function(_0x50c699){return{'name':_0x50c699[_0xd7a6('0x28')],'type':_0x50c699['type'][_0xd7a6('0x29')]};});_0x22ef5c['model']=_[_0xd7a6('0x25')](_0x3fc763,'name');_0x22ef5c[_0xd7a6('0x2a')]=_[_0xd7a6('0x2b')](_0x190708[_0xd7a6('0x2a')]);_0x22ef5c[_0xd7a6('0x2c')]=_[_0xd7a6('0x2d')](_0x22ef5c[_0xd7a6('0x2e')],_0x22ef5c[_0xd7a6('0x2a')]);_0x2e7656[_0xd7a6('0x2f')]=_[_0xd7a6('0x2d')](_0x22ef5c[_0xd7a6('0x2e')],qs[_0xd7a6('0x30')](_0x190708[_0xd7a6('0x2a')][_0xd7a6('0x30')]));_0x2e7656[_0xd7a6('0x2f')]=_0x2e7656[_0xd7a6('0x2f')][_0xd7a6('0x31')]?_0x2e7656[_0xd7a6('0x2f')]:_0x22ef5c[_0xd7a6('0x2e')];if(!_0x190708['query'][_0xd7a6('0x32')](_0xd7a6('0x33'))){_0x2e7656[_0xd7a6('0x19')]=qs[_0xd7a6('0x19')](_0x190708[_0xd7a6('0x2a')]['limit']);_0x2e7656['offset']=qs[_0xd7a6('0x18')](_0x190708[_0xd7a6('0x2a')][_0xd7a6('0x18')]);}_0x2e7656[_0xd7a6('0x34')]=qs[_0xd7a6('0x35')](_0x190708['query']['sort']);_0x2e7656['where']=qs['filters'](_[_0xd7a6('0x36')](_0x190708[_0xd7a6('0x2a')],_0x22ef5c['filters']),_0x3fc763);if(_0x190708['query'][_0xd7a6('0x37')]){_0x2e7656['where']=_[_0xd7a6('0x38')](_0x2e7656[_0xd7a6('0x39')],{'$or':_[_0xd7a6('0x25')](_0x3fc763,function(_0x98572b){if(_0x98572b[_0xd7a6('0x3a')]!==_0xd7a6('0x3b')){var _0x4b1cf1={};_0x4b1cf1[_0x98572b['name']]={'$like':'%'+_0x190708[_0xd7a6('0x2a')][_0xd7a6('0x37')]+'%'};return _0x4b1cf1;}})});}_0x2e7656=_[_0xd7a6('0x38')]({},_0x2e7656,_0x190708[_0xd7a6('0x3c')]);var _0x57b4f4={'where':_0x2e7656[_0xd7a6('0x39')]};return db[_0xd7a6('0x26')][_0xd7a6('0x1b')](_0x57b4f4)[_0xd7a6('0x20')](function(_0x625350){_0xd45255['count']=_0x625350;if(_0x190708[_0xd7a6('0x2a')][_0xd7a6('0x3d')]){_0x2e7656[_0xd7a6('0x3e')]=[{'all':!![]}];}return db[_0xd7a6('0x26')]['findAll'](_0x2e7656);})['then'](function(_0x282883){_0xd45255['rows']=_0x282883;return _0xd45255;})[_0xd7a6('0x20')](respondWithFilteredResult(_0x3aa7ce,_0x2e7656))[_0xd7a6('0x3f')](handleError(_0x3aa7ce,null));};exports[_0xd7a6('0x40')]=function(_0x3b8a67,_0x276115){var _0x1e6407={'raw':![],'where':{'id':_0x3b8a67[_0xd7a6('0x41')]['id']}},_0x3b1d35={};_0x3b1d35[_0xd7a6('0x2e')]=_[_0xd7a6('0x2b')](db[_0xd7a6('0x26')]['rawAttributes']);_0x3b1d35['query']=_[_0xd7a6('0x2b')](_0x3b8a67[_0xd7a6('0x2a')]);_0x3b1d35['filters']=_['intersection'](_0x3b1d35[_0xd7a6('0x2e')],_0x3b1d35[_0xd7a6('0x2a')]);_0x1e6407[_0xd7a6('0x2f')]=_['intersection'](_0x3b1d35['model'],qs['fields'](_0x3b8a67[_0xd7a6('0x2a')][_0xd7a6('0x30')]));_0x1e6407['attributes']=_0x1e6407[_0xd7a6('0x2f')][_0xd7a6('0x31')]?_0x1e6407[_0xd7a6('0x2f')]:_0x3b1d35[_0xd7a6('0x2e')];if(_0x3b8a67[_0xd7a6('0x2a')][_0xd7a6('0x3d')]){_0x1e6407[_0xd7a6('0x3e')]=[{'all':!![]}];}_0x1e6407=_[_0xd7a6('0x38')]({},_0x1e6407,_0x3b8a67['options']);return db['Automation']['find'](_0x1e6407)[_0xd7a6('0x20')](handleEntityNotFound(_0x276115,null))[_0xd7a6('0x20')](respondWithResult(_0x276115,null))['catch'](handleError(_0x276115,null));};exports['create']=function(_0xc56036,_0x2d971e){return db[_0xd7a6('0x26')][_0xd7a6('0x42')](_0xc56036['body'],{})[_0xd7a6('0x20')](respondWithResult(_0x2d971e,0xc9))[_0xd7a6('0x3f')](handleError(_0x2d971e,null));};exports[_0xd7a6('0x1f')]=function(_0x1be632,_0x44ecde){if(_0x1be632[_0xd7a6('0x43')]['id']){delete _0x1be632[_0xd7a6('0x43')]['id'];}return db['Automation'][_0xd7a6('0x44')]({'where':{'id':_0x1be632['params']['id']}})['then'](handleEntityNotFound(_0x44ecde,null))[_0xd7a6('0x20')](saveUpdates(_0x1be632[_0xd7a6('0x43')],null))['then'](respondWithResult(_0x44ecde,null))[_0xd7a6('0x3f')](handleError(_0x44ecde,null));};exports[_0xd7a6('0x45')]=function(_0x435578,_0x3f4e12){return db[_0xd7a6('0x26')][_0xd7a6('0x44')]({'where':{'id':_0x435578[_0xd7a6('0x41')]['id']}})[_0xd7a6('0x20')](handleEntityNotFound(_0x3f4e12,null))[_0xd7a6('0x20')](removeEntity(_0x3f4e12,null))[_0xd7a6('0x3f')](handleError(_0x3f4e12,null));};exports[_0xd7a6('0x46')]=function(_0xb3a8f8,_0x22e339,_0xce3d2c){return db['Condition'][_0xd7a6('0x44')]({'where':{'id':_0xb3a8f8[_0xd7a6('0x41')]['id']}})[_0xd7a6('0x20')](handleEntityNotFound(_0x22e339,null))['then'](function(_0x352202){if(_0x352202){return _0x352202['addConditions'](_0xb3a8f8['body']['ids'],_[_0xd7a6('0x47')](_0xb3a8f8[_0xd7a6('0x43')],['ids','id'])||{});}})[_0xd7a6('0x20')](respondWithResult(_0x22e339,null))[_0xd7a6('0x3f')](handleError(_0x22e339,null));};exports['getConditions']=function(_0x5c428d,_0x3b698b,_0x1ccdcd){var _0x18220b={};var _0x5637a8={};var _0x2dd312;var _0x56ecd6;return db['Automation'][_0xd7a6('0x48')]({'where':{'id':_0x5c428d[_0xd7a6('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b698b,null))[_0xd7a6('0x20')](function(_0x1a8361){if(_0x1a8361){_0x2dd312=_0x1a8361;_0x5637a8[_0xd7a6('0x2e')]=_[_0xd7a6('0x2b')](db[_0xd7a6('0x49')][_0xd7a6('0x27')]);_0x5637a8[_0xd7a6('0x2a')]=_[_0xd7a6('0x2b')](_0x5c428d[_0xd7a6('0x2a')]);_0x5637a8[_0xd7a6('0x2c')]=_[_0xd7a6('0x2d')](_0x5637a8[_0xd7a6('0x2e')],_0x5637a8['query']);_0x18220b[_0xd7a6('0x2f')]=_[_0xd7a6('0x2d')](_0x5637a8[_0xd7a6('0x2e')],qs[_0xd7a6('0x30')](_0x5c428d['query'][_0xd7a6('0x30')]));_0x18220b[_0xd7a6('0x2f')]=_0x18220b[_0xd7a6('0x2f')]['length']?_0x18220b['attributes']:_0x5637a8['model'];_0x18220b[_0xd7a6('0x34')]=qs[_0xd7a6('0x35')](_0x5c428d[_0xd7a6('0x2a')][_0xd7a6('0x35')]);_0x18220b['where']=qs['filters'](_[_0xd7a6('0x36')](_0x5c428d[_0xd7a6('0x2a')],_0x5637a8[_0xd7a6('0x2c')]));if(_0x5c428d['query'][_0xd7a6('0x37')]){_0x18220b[_0xd7a6('0x39')]=_[_0xd7a6('0x38')](_0x18220b[_0xd7a6('0x39')],{'$or':_['map'](_0x18220b[_0xd7a6('0x2f')],function(_0x44bd0e){var _0x10ef30={};_0x10ef30[_0x44bd0e]={'$like':'%'+_0x5c428d['query'][_0xd7a6('0x37')]+'%'};return _0x10ef30;})});}_0x18220b=_[_0xd7a6('0x38')]({},_0x18220b,_0x5c428d['options']);return _0x2dd312[_0xd7a6('0x4a')](_0x18220b);}})[_0xd7a6('0x20')](function(_0x24849c){if(_0x24849c){_0x56ecd6=_0x24849c[_0xd7a6('0x31')];if(!_0x5c428d[_0xd7a6('0x2a')]['hasOwnProperty'](_0xd7a6('0x33'))){_0x18220b[_0xd7a6('0x19')]=qs[_0xd7a6('0x19')](_0x5c428d['query']['limit']);_0x18220b[_0xd7a6('0x18')]=qs[_0xd7a6('0x18')](_0x5c428d[_0xd7a6('0x2a')][_0xd7a6('0x18')]);}return _0x2dd312[_0xd7a6('0x4a')](_0x18220b);}})[_0xd7a6('0x20')](function(_0x1af11a){if(_0x1af11a){return _0x1af11a?{'count':_0x56ecd6,'rows':_0x1af11a}:null;}})['then'](respondWithResult(_0x3b698b,null))[_0xd7a6('0x3f')](handleError(_0x3b698b,null));};exports[_0xd7a6('0x4b')]=function(_0x1d34bf,_0x29d672,_0x58dab3){return db[_0xd7a6('0x4c')][_0xd7a6('0x44')]({'where':{'id':_0x1d34bf[_0xd7a6('0x41')]['id']}})['then'](handleEntityNotFound(_0x29d672,null))[_0xd7a6('0x20')](function(_0x208143){if(_0x208143){return _0x208143[_0xd7a6('0x4b')](_0x1d34bf['body'][_0xd7a6('0x4d')],_[_0xd7a6('0x47')](_0x1d34bf[_0xd7a6('0x43')],['ids','id'])||{});}})[_0xd7a6('0x20')](respondWithResult(_0x29d672,null))[_0xd7a6('0x3f')](handleError(_0x29d672,null));};exports[_0xd7a6('0x4e')]=function(_0x2ba110,_0x2f49ed,_0x53cf53){var _0x2972d8={};var _0x553ec5={};var _0x147201;var _0x3a7da1;return db[_0xd7a6('0x26')][_0xd7a6('0x48')]({'where':{'id':_0x2ba110[_0xd7a6('0x41')]['id']}})[_0xd7a6('0x20')](handleEntityNotFound(_0x2f49ed,null))[_0xd7a6('0x20')](function(_0x4bc113){if(_0x4bc113){_0x147201=_0x4bc113;_0x553ec5[_0xd7a6('0x2e')]=_[_0xd7a6('0x2b')](db['Action']['rawAttributes']);_0x553ec5['query']=_[_0xd7a6('0x2b')](_0x2ba110['query']);_0x553ec5['filters']=_[_0xd7a6('0x2d')](_0x553ec5[_0xd7a6('0x2e')],_0x553ec5[_0xd7a6('0x2a')]);_0x2972d8[_0xd7a6('0x2f')]=_[_0xd7a6('0x2d')](_0x553ec5[_0xd7a6('0x2e')],qs['fields'](_0x2ba110[_0xd7a6('0x2a')][_0xd7a6('0x30')]));_0x2972d8[_0xd7a6('0x2f')]=_0x2972d8[_0xd7a6('0x2f')][_0xd7a6('0x31')]?_0x2972d8[_0xd7a6('0x2f')]:_0x553ec5[_0xd7a6('0x2e')];_0x2972d8['order']=qs[_0xd7a6('0x35')](_0x2ba110['query'][_0xd7a6('0x35')]);_0x2972d8[_0xd7a6('0x39')]=qs[_0xd7a6('0x2c')](_[_0xd7a6('0x36')](_0x2ba110['query'],_0x553ec5[_0xd7a6('0x2c')]));if(_0x2ba110['query'][_0xd7a6('0x37')]){_0x2972d8['where']=_['merge'](_0x2972d8['where'],{'$or':_[_0xd7a6('0x25')](_0x2972d8[_0xd7a6('0x2f')],function(_0x24736d){var _0x1802d0={};_0x1802d0[_0x24736d]={'$like':'%'+_0x2ba110[_0xd7a6('0x2a')][_0xd7a6('0x37')]+'%'};return _0x1802d0;})});}_0x2972d8=_[_0xd7a6('0x38')]({},_0x2972d8,_0x2ba110[_0xd7a6('0x3c')]);return _0x147201[_0xd7a6('0x4e')](_0x2972d8);}})['then'](function(_0x5178b5){if(_0x5178b5){_0x3a7da1=_0x5178b5[_0xd7a6('0x31')];if(!_0x2ba110['query']['hasOwnProperty']('nolimit')){_0x2972d8[_0xd7a6('0x19')]=qs[_0xd7a6('0x19')](_0x2ba110[_0xd7a6('0x2a')][_0xd7a6('0x19')]);_0x2972d8[_0xd7a6('0x18')]=qs[_0xd7a6('0x18')](_0x2ba110[_0xd7a6('0x2a')][_0xd7a6('0x18')]);}return _0x147201[_0xd7a6('0x4e')](_0x2972d8);}})[_0xd7a6('0x20')](function(_0x4e608c){if(_0x4e608c){return _0x4e608c?{'count':_0x3a7da1,'rows':_0x4e608c}:null;}})['then'](respondWithResult(_0x2f49ed,null))[_0xd7a6('0x3f')](handleError(_0x2f49ed,null));};
\ No newline at end of file
+var _0xf16f=['sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','count','offset','status','set','Content-Range','save','update','then','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filters','pick','filter','options','includeAll','include','findAll','catch','params','merge','find','create','body','destroy','Condition','addConditions','ids','omit','getConditions','order','sort','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path'];(function(_0xdd598a,_0x2f4169){var _0x18c8d7=function(_0x52be9c){while(--_0x52be9c){_0xdd598a['push'](_0xdd598a['shift']());}};_0x18c8d7(++_0x2f4169);}(_0xf16f,0x1de));var _0xff16=function(_0x4f4270,_0x5bd54d){_0x4f4270=_0x4f4270-0x0;var _0x2e30de=_0xf16f[_0x4f4270];return _0x2e30de;};'use strict';var emlformat=require(_0xff16('0x0'));var rimraf=require(_0xff16('0x1'));var zipdir=require(_0xff16('0x2'));var jsonpatch=require(_0xff16('0x3'));var rp=require('request-promise');var moment=require(_0xff16('0x4'));var BPromise=require(_0xff16('0x5'));var Mustache=require(_0xff16('0x6'));var util=require('util');var path=require(_0xff16('0x7'));var sox=require(_0xff16('0x8'));var csv=require('to-csv');var ejs=require(_0xff16('0x9'));var fs=require('fs');var fs_extra=require(_0xff16('0xa'));var _=require(_0xff16('0xb'));var squel=require('squel');var crypto=require(_0xff16('0xc'));var jsforce=require(_0xff16('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xff16('0xe'));var Papa=require(_0xff16('0xf'));var Redis=require(_0xff16('0x10'));var authService=require(_0xff16('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff16('0x12'));var logger=require('../../config/logger')(_0xff16('0x13'));var utils=require(_0xff16('0x14'));var config=require(_0xff16('0x15'));var licenseUtil=require(_0xff16('0x16'));var db=require(_0xff16('0x17'))['db'];function respondWithStatusCode(_0x241777,_0x25b8a1){_0x25b8a1=_0x25b8a1||0xcc;return function(_0x138483){if(_0x138483){return _0x241777[_0xff16('0x18')](_0x25b8a1);}return _0x241777['status'](_0x25b8a1)['end']();};}function respondWithResult(_0x196fb4,_0x84b96e){_0x84b96e=_0x84b96e||0xc8;return function(_0xec90e4){if(_0xec90e4){return _0x196fb4['status'](_0x84b96e)[_0xff16('0x19')](_0xec90e4);}};}function respondWithFilteredResult(_0x2ce469,_0x16d803){return function(_0x2a4fc1){if(_0x2a4fc1){var _0xb9e508=typeof _0x16d803['offset']===_0xff16('0x1a')&&typeof _0x16d803[_0xff16('0x1b')]==='undefined';var _0x406e8b=_0x2a4fc1[_0xff16('0x1c')];var _0x1af793=_0xb9e508?0x0:_0x16d803[_0xff16('0x1d')];var _0x3d992b=_0xb9e508?_0x2a4fc1[_0xff16('0x1c')]:_0x16d803[_0xff16('0x1d')]+_0x16d803[_0xff16('0x1b')];var _0x2a0acc;if(_0x3d992b>=_0x406e8b){_0x3d992b=_0x406e8b;_0x2a0acc=0xc8;}else{_0x2a0acc=0xce;}_0x2ce469[_0xff16('0x1e')](_0x2a0acc);return _0x2ce469[_0xff16('0x1f')](_0xff16('0x20'),_0x1af793+'-'+_0x3d992b+'/'+_0x406e8b)[_0xff16('0x19')](_0x2a4fc1);}return null;};}function patchUpdates(_0x78c45){return function(_0x318879){try{jsonpatch['apply'](_0x318879,_0x78c45,!![]);}catch(_0x22e407){return BPromise['reject'](_0x22e407);}return _0x318879[_0xff16('0x21')]();};}function saveUpdates(_0x26df3c,_0x5d7d56){return function(_0x10b6b0){if(_0x10b6b0){return _0x10b6b0[_0xff16('0x22')](_0x26df3c)[_0xff16('0x23')](function(_0x34035b){return _0x34035b;});}return null;};}function removeEntity(_0x4c5097,_0x37f41c){return function(_0x1d283f){if(_0x1d283f){return _0x1d283f['destroy']()[_0xff16('0x23')](function(){_0x4c5097[_0xff16('0x1e')](0xcc)[_0xff16('0x24')]();});}};}function handleEntityNotFound(_0x2b5255,_0x3b06a7){return function(_0x256cba){if(!_0x256cba){_0x2b5255[_0xff16('0x18')](0x194);}return _0x256cba;};}function handleError(_0x50fcc6,_0x4b4cf1){_0x4b4cf1=_0x4b4cf1||0x1f4;return function(_0x150087){logger[_0xff16('0x25')](_0x150087[_0xff16('0x26')]);if(_0x150087[_0xff16('0x27')]){delete _0x150087[_0xff16('0x27')];}_0x50fcc6[_0xff16('0x1e')](_0x4b4cf1)[_0xff16('0x28')](_0x150087);};}exports[_0xff16('0x29')]=function(_0x1a4821,_0x45cbe4){var _0x58b96f={},_0x422277={},_0x11becd={'count':0x0,'rows':[]};var _0xbd1b72=_[_0xff16('0x2a')](db[_0xff16('0x2b')][_0xff16('0x2c')],function(_0x1d9b73){return{'name':_0x1d9b73[_0xff16('0x2d')],'type':_0x1d9b73['type'][_0xff16('0x2e')]};});_0x422277[_0xff16('0x2f')]=_[_0xff16('0x2a')](_0xbd1b72,_0xff16('0x27'));_0x422277[_0xff16('0x30')]=_[_0xff16('0x31')](_0x1a4821['query']);_0x422277['filters']=_[_0xff16('0x32')](_0x422277[_0xff16('0x2f')],_0x422277['query']);_0x58b96f[_0xff16('0x33')]=_[_0xff16('0x32')](_0x422277[_0xff16('0x2f')],qs[_0xff16('0x34')](_0x1a4821[_0xff16('0x30')][_0xff16('0x34')]));_0x58b96f[_0xff16('0x33')]=_0x58b96f[_0xff16('0x33')][_0xff16('0x35')]?_0x58b96f[_0xff16('0x33')]:_0x422277['model'];if(!_0x1a4821['query'][_0xff16('0x36')](_0xff16('0x37'))){_0x58b96f['limit']=qs[_0xff16('0x1b')](_0x1a4821[_0xff16('0x30')]['limit']);_0x58b96f[_0xff16('0x1d')]=qs[_0xff16('0x1d')](_0x1a4821[_0xff16('0x30')][_0xff16('0x1d')]);}_0x58b96f['order']=qs['sort'](_0x1a4821[_0xff16('0x30')]['sort']);_0x58b96f[_0xff16('0x38')]=qs[_0xff16('0x39')](_[_0xff16('0x3a')](_0x1a4821[_0xff16('0x30')],_0x422277[_0xff16('0x39')]),_0xbd1b72);if(_0x1a4821['query'][_0xff16('0x3b')]){_0x58b96f[_0xff16('0x38')]=_['merge'](_0x58b96f[_0xff16('0x38')],{'$or':_[_0xff16('0x2a')](_0xbd1b72,function(_0x28de0a){if(_0x28de0a['type']!=='VIRTUAL'){var _0x3e823e={};_0x3e823e[_0x28de0a[_0xff16('0x27')]]={'$like':'%'+_0x1a4821[_0xff16('0x30')][_0xff16('0x3b')]+'%'};return _0x3e823e;}})});}_0x58b96f=_['merge']({},_0x58b96f,_0x1a4821[_0xff16('0x3c')]);var _0x186051={'where':_0x58b96f[_0xff16('0x38')]};return db[_0xff16('0x2b')][_0xff16('0x1c')](_0x186051)[_0xff16('0x23')](function(_0x1bd464){_0x11becd[_0xff16('0x1c')]=_0x1bd464;if(_0x1a4821['query'][_0xff16('0x3d')]){_0x58b96f[_0xff16('0x3e')]=[{'all':!![]}];}return db[_0xff16('0x2b')][_0xff16('0x3f')](_0x58b96f);})[_0xff16('0x23')](function(_0xa79b0a){_0x11becd['rows']=_0xa79b0a;return _0x11becd;})['then'](respondWithFilteredResult(_0x45cbe4,_0x58b96f))[_0xff16('0x40')](handleError(_0x45cbe4,null));};exports['show']=function(_0x4dc1db,_0x38966d){var _0x3bdd05={'raw':![],'where':{'id':_0x4dc1db[_0xff16('0x41')]['id']}},_0x47cb60={};_0x47cb60['model']=_[_0xff16('0x31')](db[_0xff16('0x2b')][_0xff16('0x2c')]);_0x47cb60['query']=_['keys'](_0x4dc1db[_0xff16('0x30')]);_0x47cb60[_0xff16('0x39')]=_[_0xff16('0x32')](_0x47cb60[_0xff16('0x2f')],_0x47cb60['query']);_0x3bdd05[_0xff16('0x33')]=_[_0xff16('0x32')](_0x47cb60[_0xff16('0x2f')],qs[_0xff16('0x34')](_0x4dc1db[_0xff16('0x30')][_0xff16('0x34')]));_0x3bdd05[_0xff16('0x33')]=_0x3bdd05[_0xff16('0x33')][_0xff16('0x35')]?_0x3bdd05[_0xff16('0x33')]:_0x47cb60['model'];if(_0x4dc1db['query'][_0xff16('0x3d')]){_0x3bdd05[_0xff16('0x3e')]=[{'all':!![]}];}_0x3bdd05=_[_0xff16('0x42')]({},_0x3bdd05,_0x4dc1db[_0xff16('0x3c')]);return db[_0xff16('0x2b')][_0xff16('0x43')](_0x3bdd05)[_0xff16('0x23')](handleEntityNotFound(_0x38966d,null))[_0xff16('0x23')](respondWithResult(_0x38966d,null))[_0xff16('0x40')](handleError(_0x38966d,null));};exports[_0xff16('0x44')]=function(_0x370ace,_0x34a575){return db[_0xff16('0x2b')][_0xff16('0x44')](_0x370ace[_0xff16('0x45')],{})[_0xff16('0x23')](respondWithResult(_0x34a575,0xc9))[_0xff16('0x40')](handleError(_0x34a575,null));};exports[_0xff16('0x22')]=function(_0x2d4c16,_0x23942f){if(_0x2d4c16[_0xff16('0x45')]['id']){delete _0x2d4c16['body']['id'];}return db[_0xff16('0x2b')][_0xff16('0x43')]({'where':{'id':_0x2d4c16[_0xff16('0x41')]['id']}})[_0xff16('0x23')](handleEntityNotFound(_0x23942f,null))[_0xff16('0x23')](saveUpdates(_0x2d4c16['body'],null))[_0xff16('0x23')](respondWithResult(_0x23942f,null))['catch'](handleError(_0x23942f,null));};exports[_0xff16('0x46')]=function(_0x9c7a69,_0x4e97d7){return db[_0xff16('0x2b')]['find']({'where':{'id':_0x9c7a69['params']['id']}})[_0xff16('0x23')](handleEntityNotFound(_0x4e97d7,null))[_0xff16('0x23')](removeEntity(_0x4e97d7,null))['catch'](handleError(_0x4e97d7,null));};exports['addConditions']=function(_0x5c8b4e,_0x3857d9,_0x2ea526){return db[_0xff16('0x47')][_0xff16('0x43')]({'where':{'id':_0x5c8b4e[_0xff16('0x41')]['id']}})['then'](handleEntityNotFound(_0x3857d9,null))[_0xff16('0x23')](function(_0x29bd9f){if(_0x29bd9f){return _0x29bd9f[_0xff16('0x48')](_0x5c8b4e[_0xff16('0x45')][_0xff16('0x49')],_[_0xff16('0x4a')](_0x5c8b4e[_0xff16('0x45')],['ids','id'])||{});}})['then'](respondWithResult(_0x3857d9,null))[_0xff16('0x40')](handleError(_0x3857d9,null));};exports[_0xff16('0x4b')]=function(_0x7f3c67,_0x162932,_0x487c56){var _0x22c4e0={};var _0x1f37ac={};var _0x3cbd05;var _0x30ea7b;return db[_0xff16('0x2b')]['findOne']({'where':{'id':_0x7f3c67['params']['id']}})['then'](handleEntityNotFound(_0x162932,null))[_0xff16('0x23')](function(_0x494f11){if(_0x494f11){_0x3cbd05=_0x494f11;_0x1f37ac['model']=_['keys'](db[_0xff16('0x47')][_0xff16('0x2c')]);_0x1f37ac[_0xff16('0x30')]=_[_0xff16('0x31')](_0x7f3c67[_0xff16('0x30')]);_0x1f37ac['filters']=_[_0xff16('0x32')](_0x1f37ac[_0xff16('0x2f')],_0x1f37ac['query']);_0x22c4e0[_0xff16('0x33')]=_[_0xff16('0x32')](_0x1f37ac['model'],qs[_0xff16('0x34')](_0x7f3c67[_0xff16('0x30')][_0xff16('0x34')]));_0x22c4e0['attributes']=_0x22c4e0[_0xff16('0x33')][_0xff16('0x35')]?_0x22c4e0['attributes']:_0x1f37ac[_0xff16('0x2f')];_0x22c4e0[_0xff16('0x4c')]=qs[_0xff16('0x4d')](_0x7f3c67[_0xff16('0x30')]['sort']);_0x22c4e0[_0xff16('0x38')]=qs['filters'](_[_0xff16('0x3a')](_0x7f3c67[_0xff16('0x30')],_0x1f37ac[_0xff16('0x39')]));if(_0x7f3c67['query']['filter']){_0x22c4e0[_0xff16('0x38')]=_[_0xff16('0x42')](_0x22c4e0[_0xff16('0x38')],{'$or':_['map'](_0x22c4e0['attributes'],function(_0x5355f9){var _0x2e3bd8={};_0x2e3bd8[_0x5355f9]={'$like':'%'+_0x7f3c67[_0xff16('0x30')][_0xff16('0x3b')]+'%'};return _0x2e3bd8;})});}_0x22c4e0=_[_0xff16('0x42')]({},_0x22c4e0,_0x7f3c67[_0xff16('0x3c')]);return _0x3cbd05['getConditions'](_0x22c4e0);}})[_0xff16('0x23')](function(_0x284e0d){if(_0x284e0d){_0x30ea7b=_0x284e0d[_0xff16('0x35')];if(!_0x7f3c67['query'][_0xff16('0x36')](_0xff16('0x37'))){_0x22c4e0[_0xff16('0x1b')]=qs[_0xff16('0x1b')](_0x7f3c67['query'][_0xff16('0x1b')]);_0x22c4e0[_0xff16('0x1d')]=qs[_0xff16('0x1d')](_0x7f3c67[_0xff16('0x30')]['offset']);}return _0x3cbd05[_0xff16('0x4b')](_0x22c4e0);}})[_0xff16('0x23')](function(_0xfc7699){if(_0xfc7699){return _0xfc7699?{'count':_0x30ea7b,'rows':_0xfc7699}:null;}})[_0xff16('0x23')](respondWithResult(_0x162932,null))[_0xff16('0x40')](handleError(_0x162932,null));};exports[_0xff16('0x4e')]=function(_0x363009,_0xd9fe43,_0x58c158){return db[_0xff16('0x4f')][_0xff16('0x43')]({'where':{'id':_0x363009[_0xff16('0x41')]['id']}})[_0xff16('0x23')](handleEntityNotFound(_0xd9fe43,null))['then'](function(_0x55fec8){if(_0x55fec8){return _0x55fec8['addActions'](_0x363009[_0xff16('0x45')]['ids'],_[_0xff16('0x4a')](_0x363009[_0xff16('0x45')],[_0xff16('0x49'),'id'])||{});}})[_0xff16('0x23')](respondWithResult(_0xd9fe43,null))[_0xff16('0x40')](handleError(_0xd9fe43,null));};exports[_0xff16('0x50')]=function(_0x4d12e3,_0x4b9c69,_0x29929c){var _0x3c66f8={};var _0x2fd48f={};var _0x3a86b2;var _0x3482e9;return db['Automation']['findOne']({'where':{'id':_0x4d12e3[_0xff16('0x41')]['id']}})[_0xff16('0x23')](handleEntityNotFound(_0x4b9c69,null))['then'](function(_0x1308c7){if(_0x1308c7){_0x3a86b2=_0x1308c7;_0x2fd48f[_0xff16('0x2f')]=_[_0xff16('0x31')](db[_0xff16('0x4f')]['rawAttributes']);_0x2fd48f[_0xff16('0x30')]=_[_0xff16('0x31')](_0x4d12e3[_0xff16('0x30')]);_0x2fd48f[_0xff16('0x39')]=_[_0xff16('0x32')](_0x2fd48f[_0xff16('0x2f')],_0x2fd48f[_0xff16('0x30')]);_0x3c66f8[_0xff16('0x33')]=_[_0xff16('0x32')](_0x2fd48f[_0xff16('0x2f')],qs[_0xff16('0x34')](_0x4d12e3['query'][_0xff16('0x34')]));_0x3c66f8['attributes']=_0x3c66f8[_0xff16('0x33')][_0xff16('0x35')]?_0x3c66f8['attributes']:_0x2fd48f[_0xff16('0x2f')];_0x3c66f8[_0xff16('0x4c')]=qs[_0xff16('0x4d')](_0x4d12e3['query'][_0xff16('0x4d')]);_0x3c66f8[_0xff16('0x38')]=qs[_0xff16('0x39')](_['pick'](_0x4d12e3['query'],_0x2fd48f[_0xff16('0x39')]));if(_0x4d12e3[_0xff16('0x30')]['filter']){_0x3c66f8[_0xff16('0x38')]=_['merge'](_0x3c66f8['where'],{'$or':_['map'](_0x3c66f8['attributes'],function(_0x99d153){var _0x536fe5={};_0x536fe5[_0x99d153]={'$like':'%'+_0x4d12e3[_0xff16('0x30')]['filter']+'%'};return _0x536fe5;})});}_0x3c66f8=_[_0xff16('0x42')]({},_0x3c66f8,_0x4d12e3[_0xff16('0x3c')]);return _0x3a86b2[_0xff16('0x50')](_0x3c66f8);}})[_0xff16('0x23')](function(_0x341cc2){if(_0x341cc2){_0x3482e9=_0x341cc2['length'];if(!_0x4d12e3[_0xff16('0x30')][_0xff16('0x36')](_0xff16('0x37'))){_0x3c66f8[_0xff16('0x1b')]=qs[_0xff16('0x1b')](_0x4d12e3['query']['limit']);_0x3c66f8[_0xff16('0x1d')]=qs['offset'](_0x4d12e3[_0xff16('0x30')]['offset']);}return _0x3a86b2['getActions'](_0x3c66f8);}})['then'](function(_0xec9c5b){if(_0xec9c5b){return _0xec9c5b?{'count':_0x3482e9,'rows':_0xec9c5b}:null;}})['then'](respondWithResult(_0x4b9c69,null))[_0xff16('0x40')](handleError(_0x4b9c69,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 0d81a8a..0ca6ebc 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 _0x40d8=['util','api','moment','bluebird','request-promise','path','rimraf','exports','Automation','tools_automations'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x40d8,0xfa));var _0x840d=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x40d8[_0x3070dc];return _0x431489;};'use strict';var _=require('lodash');var util=require(_0x840d('0x0'));var logger=require('../../config/logger')(_0x840d('0x1'));var moment=require(_0x840d('0x2'));var BPromise=require(_0x840d('0x3'));var rp=require(_0x840d('0x4'));var fs=require('fs');var path=require(_0x840d('0x5'));var rimraf=require(_0x840d('0x6'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0x840d('0x7')]=function(_0x315c45,_0x5aca20){return _0x315c45['define'](_0x840d('0x8'),attributes,{'tableName':_0x840d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1959=['api','moment','request-promise','path','rimraf','./automation.attributes','define','Automation','tools_automations','lodash'];(function(_0x153da6,_0xc9bfde){var _0xf01a0d=function(_0x409ed5){while(--_0x409ed5){_0x153da6['push'](_0x153da6['shift']());}};_0xf01a0d(++_0xc9bfde);}(_0x1959,0x117));var _0x9195=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0x1959[_0x207d2f];return _0x3c3498;};'use strict';var _=require(_0x9195('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9195('0x1'));var moment=require(_0x9195('0x2'));var BPromise=require('bluebird');var rp=require(_0x9195('0x3'));var fs=require('fs');var path=require(_0x9195('0x4'));var rimraf=require(_0x9195('0x5'));var config=require('../../config/environment');var attributes=require(_0x9195('0x6'));module['exports']=function(_0x315e86,_0x1d0766){return _0x315e86[_0x9195('0x7')](_0x9195('0x8'),attributes,{'tableName':_0x9195('0x9'),'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 c7bc70f..3720c33 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 _0x75ea=['error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','Automation,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x75ea,0x7d));var _0xa75e=function(_0x3032d4,_0x47c76b){_0x3032d4=_0x3032d4-0x0;var _0x265082=_0x75ea[_0x3032d4];return _0x265082;};'use strict';var _=require(_0xa75e('0x0'));var util=require(_0xa75e('0x1'));var moment=require('moment');var BPromise=require(_0xa75e('0x2'));var rs=require(_0xa75e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa75e('0x4'))['db'];var utils=require(_0xa75e('0x5'));var logger=require(_0xa75e('0x6'))(_0xa75e('0x7'));var config=require(_0xa75e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa75e('0x9')][_0xa75e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f666f,_0x2c71ef,_0x148a23){return new BPromise(function(_0x31a28d,_0x351164){return client['request'](_0x1f666f,_0x148a23)['then'](function(_0x560baa){logger['info'](_0xa75e('0xb'),_0x2c71ef,'request\x20sent');logger[_0xa75e('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x2c71ef,_0xa75e('0xd'),JSON[_0xa75e('0xe')](_0x560baa));if(_0x560baa['error']){if(_0x560baa[_0xa75e('0xf')][_0xa75e('0x10')]===0x1f4){logger[_0xa75e('0xf')](_0xa75e('0xb'),_0x2c71ef,_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);return _0x351164(_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);}logger[_0xa75e('0xf')]('Automation,\x20%s,\x20%s',_0x2c71ef,_0x560baa[_0xa75e('0xf')]['message']);return _0x31a28d(_0x560baa[_0xa75e('0xf')][_0xa75e('0x11')]);}else{logger['info'](_0xa75e('0xb'),_0x2c71ef,_0xa75e('0xd'));_0x31a28d(_0x560baa[_0xa75e('0x12')]['message']);}})[_0xa75e('0x13')](function(_0x315fde){logger[_0xa75e('0xf')](_0xa75e('0xb'),_0x2c71ef,_0x315fde);_0x351164(_0x315fde);});});}
\ No newline at end of file
+var _0x2deb=['Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var moment=require(_0xb2de('0x2'));var BPromise=require(_0xb2de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2de('0x4'))['db'];var utils=require(_0xb2de('0x5'));var logger=require(_0xb2de('0x6'))(_0xb2de('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb2de('0x8')][_0xb2de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191004,_0x49307b,_0x253d0b){return new BPromise(function(_0x1a4c44,_0x53ab0e){return client[_0xb2de('0xa')](_0x191004,_0x253d0b)[_0xb2de('0xb')](function(_0x1d40ec){logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));logger[_0xb2de('0xe')](_0xb2de('0xf'),_0x49307b,'request\x20sent',JSON['stringify'](_0x1d40ec));if(_0x1d40ec[_0xb2de('0x10')]){if(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x11')]===0x1f4){logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);return _0x53ab0e(_0x1d40ec['error'][_0xb2de('0x12')]);}logger['error'](_0xb2de('0xc'),_0x49307b,_0x1d40ec['error'][_0xb2de('0x12')]);return _0x1a4c44(_0x1d40ec[_0xb2de('0x10')][_0xb2de('0x12')]);}else{logger['info'](_0xb2de('0xc'),_0x49307b,_0xb2de('0xd'));_0x1a4c44(_0x1d40ec[_0xb2de('0x13')][_0xb2de('0x12')]);}})[_0xb2de('0x14')](function(_0x2dc15c){logger[_0xb2de('0x10')](_0xb2de('0xc'),_0x49307b,_0x2dc15c);_0x53ab0e(_0x2dc15c);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 866eef6..f8c37ab 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 _0x56e6=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','put'];(function(_0x3f84c6,_0x10a71a){var _0x563d5a=function(_0xa7ec79){while(--_0xa7ec79){_0x3f84c6['push'](_0x3f84c6['shift']());}};_0x563d5a(++_0x10a71a);}(_0x56e6,0x6b));var _0x656e=function(_0x322483,_0x197b0d){_0x322483=_0x322483-0x0;var _0x2cbb58=_0x56e6[_0x322483];return _0x2cbb58;};'use strict';var multer=require(_0x656e('0x0'));var util=require(_0x656e('0x1'));var path=require(_0x656e('0x2'));var timeout=require(_0x656e('0x3'));var express=require(_0x656e('0x4'));var router=express[_0x656e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x656e('0x6'));var interaction=require(_0x656e('0x7'));var config=require(_0x656e('0x8'));var controller=require(_0x656e('0x9'));router[_0x656e('0xa')]('/',auth[_0x656e('0xb')](),controller[_0x656e('0xc')]);router['get'](_0x656e('0xd'),auth[_0x656e('0xb')](),controller[_0x656e('0xe')]);router[_0x656e('0xa')](_0x656e('0xf'),auth[_0x656e('0xb')](),controller[_0x656e('0x10')]);router[_0x656e('0xa')](_0x656e('0x11'),auth[_0x656e('0xb')](),controller[_0x656e('0x12')]);router[_0x656e('0x13')]('/',auth[_0x656e('0xb')](),controller[_0x656e('0x14')]);router['post']('/:id/conditions',auth[_0x656e('0xb')](),controller[_0x656e('0x15')]);router[_0x656e('0x13')](_0x656e('0x11'),auth['isAuthenticated'](),controller['addActions']);router[_0x656e('0x16')](_0x656e('0xd'),auth['isAuthenticated'](),controller[_0x656e('0x17')]);router['delete'](_0x656e('0xd'),auth[_0x656e('0xb')](),controller[_0x656e('0x18')]);module[_0x656e('0x19')]=router;
\ No newline at end of file
+var _0x8ebc=['get','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','/:id','show'];(function(_0x1c0f3d,_0x55a9e2){var _0x4d71a8=function(_0xeff131){while(--_0xeff131){_0x1c0f3d['push'](_0x1c0f3d['shift']());}};_0x4d71a8(++_0x55a9e2);}(_0x8ebc,0x18c));var _0xc8eb=function(_0x3ad00a,_0x11b46a){_0x3ad00a=_0x3ad00a-0x0;var _0x582dcc=_0x8ebc[_0x3ad00a];return _0x582dcc;};'use strict';var multer=require(_0xc8eb('0x0'));var util=require('util');var path=require(_0xc8eb('0x1'));var timeout=require(_0xc8eb('0x2'));var express=require('express');var router=express[_0xc8eb('0x3')]();var fs_extra=require(_0xc8eb('0x4'));var auth=require(_0xc8eb('0x5'));var interaction=require(_0xc8eb('0x6'));var config=require('../../config/environment');var controller=require(_0xc8eb('0x7'));router['get']('/',auth[_0xc8eb('0x8')](),controller[_0xc8eb('0x9')]);router['get'](_0xc8eb('0xa'),auth[_0xc8eb('0x8')](),controller[_0xc8eb('0xb')]);router[_0xc8eb('0xc')](_0xc8eb('0xd'),auth['isAuthenticated'](),controller[_0xc8eb('0xe')]);router[_0xc8eb('0xc')](_0xc8eb('0xf'),auth[_0xc8eb('0x8')](),controller[_0xc8eb('0x10')]);router['post']('/',auth[_0xc8eb('0x8')](),controller['create']);router[_0xc8eb('0x11')]('/:id/conditions',auth[_0xc8eb('0x8')](),controller[_0xc8eb('0x12')]);router[_0xc8eb('0x11')](_0xc8eb('0xf'),auth[_0xc8eb('0x8')](),controller[_0xc8eb('0x13')]);router[_0xc8eb('0x14')](_0xc8eb('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc8eb('0x15')](_0xc8eb('0xa'),auth[_0xc8eb('0x8')](),controller[_0xc8eb('0x16')]);module[_0xc8eb('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 3de03dc..e034fe6 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 _0x0711=['UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x0711,0x161));var _0x1071=function(_0x5f14ed,_0x5dda39){_0x5f14ed=_0x5f14ed-0x0;var _0x3c46fc=_0x0711[_0x5f14ed];return _0x3c46fc;};'use strict';var Sequelize=require(_0x1071('0x0'));module[_0x1071('0x1')]={'name':{'type':Sequelize[_0x1071('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1071('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x1071('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1071('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1071('0x6')](0x4)[_0x1071('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1071('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1071('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1071('0x6')](0x3)[_0x1071('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1071('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1071('0x6')](0x3)[_0x1071('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1071('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1071('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1071('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x1071('0x6')](0x3)[_0x1071('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1071('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1071('0x6')](0x5)[_0x1071('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1071('0x6')](0x3)[_0x1071('0x7')],'defaultValue':0x3,'comment':_0x1071('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1071('0x6')](0x5)[_0x1071('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1071('0xe')},'dialTimezone':{'type':Sequelize[_0x1071('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1071('0x2')],'defaultValue':_0x1071('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x1071('0x3')](_0x1071('0x10'),_0x1071('0x11'),_0x1071('0x12')),'defaultValue':_0x1071('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1071('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1071('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1071('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1071('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1071('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1071('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1071('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1071('0x6')](0x9)[_0x1071('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x1071('0x6')](0x9)[_0x1071('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1071('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1071('0x6')](0x9)[_0x1071('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1071('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1071('0x6')](0x9)[_0x1071('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1071('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1071('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1071('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1071('0x6')](0x9)[_0x1071('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x1071('0x1b')),'defaultValue':_0x1071('0x1c')},'dialPrefix':{'type':Sequelize[_0x1071('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1071('0x6')](0x3)[_0x1071('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1071('0x1d')},'dialCutDigit':{'type':Sequelize[_0x1071('0x6')](0x3)[_0x1071('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1071('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1071('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1071('0x6')](0x5)[_0x1071('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1071('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1071('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1071('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x1071('0x6')](0x5)[_0x1071('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1071('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1071('0x6')](0x3)[_0x1071('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1071('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1071('0x6')](0x5)[_0x1071('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1071('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1071('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1071('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1071('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1071('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1071('0x6')](0x3)[_0x1071('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1071('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1071('0x6')](0x5)[_0x1071('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1071('0x27')}};
\ No newline at end of file
+var _0x3525=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3525,0x16a));var _0x5352=function(_0x1a769d,_0x4909b2){_0x1a769d=_0x1a769d-0x0;var _0x351500=_0x3525[_0x1a769d];return _0x351500;};'use strict';var Sequelize=require(_0x5352('0x0'));module[_0x5352('0x1')]={'name':{'type':Sequelize[_0x5352('0x2')],'unique':_0x5352('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5352('0x4')](_0x5352('0x5')),'allowNull':![],'defaultValue':_0x5352('0x5')},'description':{'type':Sequelize[_0x5352('0x2')]},'active':{'type':Sequelize[_0x5352('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x5352('0x7')](0x4)[_0x5352('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5352('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x5352('0x7')](0x3)[_0x5352('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5352('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5352('0x7')](0x3)[_0x5352('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5352('0x7')](0x5)[_0x5352('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x5352('0x7')](0x3)[_0x5352('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5352('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5352('0x7')](0x5)[_0x5352('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5352('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5352('0x7')](0x5)[_0x5352('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5352('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5352('0x7')](0x3)[_0x5352('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5352('0xe')},'dialTimezone':{'type':Sequelize[_0x5352('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5352('0x2')],'defaultValue':_0x5352('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x5352('0x10'),'onlyIfOpen'),'defaultValue':_0x5352('0x11')},'dialAMDActive':{'type':Sequelize[_0x5352('0x6')],'defaultValue':0x0,'comment':_0x5352('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x5352('0x7')](0x9)[_0x5352('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5352('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x5352('0x7')](0x9)[_0x5352('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5352('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5352('0x7')](0x9)[_0x5352('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5352('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5352('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x5352('0x7')](0x9)[_0x5352('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5352('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5352('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5352('0x7')](0x9)[_0x5352('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5352('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5352('0x7')](0x5)[_0x5352('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5352('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x5352('0x4')](_0x5352('0x18'),'ASC'),'defaultValue':_0x5352('0x18')},'dialPrefix':{'type':Sequelize[_0x5352('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x5352('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5352('0x19')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x5352('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5352('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5352('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5352('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x5352('0x7')](0x3)[_0x5352('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5352('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0x5352('0x7')](0x5)[_0x5352('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5352('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5352('0x7')](0x3)[_0x5352('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5352('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5352('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5352('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x5352('0x7')](0x3)[_0x5352('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5352('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5352('0x7')](0x5)[_0x5352('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5352('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5352('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5352('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5352('0x7')](0x5)[_0x5352('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5352('0x23')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index a0ac17f..ad27b06 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 _0x112f=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','keys','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','body','IvrCampaigns','userProfileId','getHoppers','findOne','CmHopper','order','pick','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ContactId','select','field','phone','NOW()','CmListId','toString','ListId','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','cm_contacts','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x4da600,_0x3862a4){var _0x2a492a=function(_0x14604e){while(--_0x14604e){_0x4da600['push'](_0x4da600['shift']());}};_0x2a492a(++_0x3862a4);}(_0x112f,0x11e));var _0xf112=function(_0x406134,_0x41e277){_0x406134=_0x406134-0x0;var _0x36bd34=_0x112f[_0x406134];return _0x36bd34;};'use strict';var emlformat=require(_0xf112('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf112('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf112('0x2'));var moment=require(_0xf112('0x3'));var BPromise=require(_0xf112('0x4'));var Mustache=require(_0xf112('0x5'));var util=require('util');var path=require(_0xf112('0x6'));var sox=require('sox');var csv=require(_0xf112('0x7'));var ejs=require(_0xf112('0x8'));var fs=require('fs');var fs_extra=require(_0xf112('0x9'));var _=require(_0xf112('0xa'));var squel=require(_0xf112('0xb'));var crypto=require(_0xf112('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf112('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf112('0xe'));var Papa=require(_0xf112('0xf'));var Redis=require(_0xf112('0x10'));var authService=require(_0xf112('0x11'));var qs=require(_0xf112('0x12'));var as=require(_0xf112('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf112('0x14'));var config=require(_0xf112('0x15'));var licenseUtil=require(_0xf112('0x16'));var db=require(_0xf112('0x17'))['db'];function respondWithStatusCode(_0x350f60,_0x330f6c){_0x330f6c=_0x330f6c||0xcc;return function(_0x401344){if(_0x401344){return _0x350f60[_0xf112('0x18')](_0x330f6c);}return _0x350f60[_0xf112('0x19')](_0x330f6c)['end']();};}function respondWithResult(_0x1381f4,_0x5c32f2){_0x5c32f2=_0x5c32f2||0xc8;return function(_0x568a07){if(_0x568a07){return _0x1381f4['status'](_0x5c32f2)[_0xf112('0x1a')](_0x568a07);}};}function respondWithFilteredResult(_0x5111e9,_0xb7fc78){return function(_0x1dabb1){if(_0x1dabb1){var _0x3e5780=typeof _0xb7fc78[_0xf112('0x1b')]===_0xf112('0x1c')&&typeof _0xb7fc78['limit']===_0xf112('0x1c');var _0xae0e54=_0x1dabb1['count'];var _0x16d575=_0x3e5780?0x0:_0xb7fc78[_0xf112('0x1b')];var _0x23872c=_0x3e5780?_0x1dabb1['count']:_0xb7fc78[_0xf112('0x1b')]+_0xb7fc78[_0xf112('0x1d')];var _0x46a02c;if(_0x23872c>=_0xae0e54){_0x23872c=_0xae0e54;_0x46a02c=0xc8;}else{_0x46a02c=0xce;}_0x5111e9[_0xf112('0x19')](_0x46a02c);return _0x5111e9[_0xf112('0x1e')](_0xf112('0x1f'),_0x16d575+'-'+_0x23872c+'/'+_0xae0e54)[_0xf112('0x1a')](_0x1dabb1);}return null;};}function patchUpdates(_0x13cc44){return function(_0x2d3a1b){try{jsonpatch[_0xf112('0x20')](_0x2d3a1b,_0x13cc44,!![]);}catch(_0x240bd4){return BPromise['reject'](_0x240bd4);}return _0x2d3a1b[_0xf112('0x21')]();};}function saveUpdates(_0x5e9599,_0xaed84c){return function(_0x8e7b25){if(_0x8e7b25){return _0x8e7b25[_0xf112('0x22')](_0x5e9599)[_0xf112('0x23')](function(_0x390f4d){return _0x390f4d;});}return null;};}function removeEntity(_0x29b6fb,_0x3f9604){return function(_0x1163b6){if(_0x1163b6){return _0x1163b6[_0xf112('0x24')]()[_0xf112('0x23')](function(){var _0x27a894=_0x1163b6[_0xf112('0x25')]({'plain':!![]});var _0x48a5c9='IvrCampaigns';return db[_0xf112('0x26')][_0xf112('0x24')]({'where':{'type':_0x48a5c9,'resourceId':_0x27a894['id']}})['then'](function(){return _0x1163b6;});})[_0xf112('0x23')](function(){_0x29b6fb[_0xf112('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34ef2f,_0x5227f3){return function(_0x48adaa){if(!_0x48adaa){_0x34ef2f[_0xf112('0x18')](0x194);}return _0x48adaa;};}function handleError(_0x1967df,_0x49e07e){_0x49e07e=_0x49e07e||0x1f4;return function(_0x50ca78){logger[_0xf112('0x27')](_0x50ca78[_0xf112('0x28')]);if(_0x50ca78[_0xf112('0x29')]){delete _0x50ca78[_0xf112('0x29')];}_0x1967df[_0xf112('0x19')](_0x49e07e)[_0xf112('0x2a')](_0x50ca78);};}exports[_0xf112('0x2b')]=function(_0x4fd46a,_0x55db9d){var _0x40b519={},_0x32f538={},_0x54d0e6={'count':0x0,'rows':[]};var _0x27d49d=_['map'](db[_0xf112('0x2c')][_0xf112('0x2d')],function(_0x521072){return{'name':_0x521072[_0xf112('0x2e')],'type':_0x521072[_0xf112('0x2f')][_0xf112('0x30')]};});_0x32f538['model']=_[_0xf112('0x31')](_0x27d49d,_0xf112('0x29'));_0x32f538[_0xf112('0x32')]=_['keys'](_0x4fd46a[_0xf112('0x32')]);_0x32f538['filters']=_[_0xf112('0x33')](_0x32f538[_0xf112('0x34')],_0x32f538[_0xf112('0x32')]);_0x40b519['attributes']=_[_0xf112('0x33')](_0x32f538[_0xf112('0x34')],qs['fields'](_0x4fd46a['query'][_0xf112('0x35')]));_0x40b519[_0xf112('0x36')]=_0x40b519[_0xf112('0x36')][_0xf112('0x37')]?_0x40b519[_0xf112('0x36')]:_0x32f538[_0xf112('0x34')];if(!_0x4fd46a[_0xf112('0x32')][_0xf112('0x38')](_0xf112('0x39'))){_0x40b519[_0xf112('0x1d')]=qs[_0xf112('0x1d')](_0x4fd46a[_0xf112('0x32')]['limit']);_0x40b519[_0xf112('0x1b')]=qs[_0xf112('0x1b')](_0x4fd46a[_0xf112('0x32')][_0xf112('0x1b')]);}_0x40b519['order']=qs[_0xf112('0x3a')](_0x4fd46a[_0xf112('0x32')][_0xf112('0x3a')]);_0x40b519[_0xf112('0x3b')]=qs[_0xf112('0x3c')](_['pick'](_0x4fd46a[_0xf112('0x32')],_0x32f538['filters']),_0x27d49d);if(_0x4fd46a['query'][_0xf112('0x3d')]){_0x40b519[_0xf112('0x3b')]=_[_0xf112('0x3e')](_0x40b519[_0xf112('0x3b')],{'$or':_['map'](_0x27d49d,function(_0x272d8e){if(_0x272d8e['type']!==_0xf112('0x3f')){var _0x30214f={};_0x30214f[_0x272d8e['name']]={'$like':'%'+_0x4fd46a[_0xf112('0x32')][_0xf112('0x3d')]+'%'};return _0x30214f;}})});}_0x40b519=_[_0xf112('0x3e')]({},_0x40b519,_0x4fd46a[_0xf112('0x40')]);var _0x4ba85d={'where':_0x40b519[_0xf112('0x3b')]};return db[_0xf112('0x2c')]['count'](_0x4ba85d)[_0xf112('0x23')](function(_0x685a5a){_0x54d0e6[_0xf112('0x41')]=_0x685a5a;if(_0x4fd46a['query'][_0xf112('0x42')]){_0x40b519[_0xf112('0x43')]=[{'all':!![]}];}return db[_0xf112('0x2c')][_0xf112('0x44')](_0x40b519);})[_0xf112('0x23')](function(_0x1c0f45){_0x54d0e6[_0xf112('0x45')]=_0x1c0f45;return _0x54d0e6;})[_0xf112('0x23')](respondWithFilteredResult(_0x55db9d,_0x40b519))['catch'](handleError(_0x55db9d,null));};exports[_0xf112('0x46')]=function(_0x27d074,_0x5b62ce){var _0x81ae92={'raw':![],'where':{'id':_0x27d074['params']['id']}},_0x1f380d={};_0x1f380d[_0xf112('0x34')]=_[_0xf112('0x47')](db['Campaign'][_0xf112('0x2d')]);_0x1f380d[_0xf112('0x32')]=_[_0xf112('0x47')](_0x27d074[_0xf112('0x32')]);_0x1f380d[_0xf112('0x3c')]=_[_0xf112('0x33')](_0x1f380d[_0xf112('0x34')],_0x1f380d[_0xf112('0x32')]);_0x81ae92['attributes']=_['intersection'](_0x1f380d[_0xf112('0x34')],qs[_0xf112('0x35')](_0x27d074[_0xf112('0x32')][_0xf112('0x35')]));_0x81ae92[_0xf112('0x36')]=_0x81ae92[_0xf112('0x36')][_0xf112('0x37')]?_0x81ae92[_0xf112('0x36')]:_0x1f380d[_0xf112('0x34')];if(_0x27d074[_0xf112('0x32')][_0xf112('0x42')]){_0x81ae92[_0xf112('0x43')]=[{'all':!![]}];}_0x81ae92=_[_0xf112('0x3e')]({},_0x81ae92,_0x27d074[_0xf112('0x40')]);return db[_0xf112('0x2c')][_0xf112('0x48')](_0x81ae92)[_0xf112('0x23')](handleEntityNotFound(_0x5b62ce,null))['then'](respondWithResult(_0x5b62ce,null))[_0xf112('0x49')](handleError(_0x5b62ce,null));};exports[_0xf112('0x4a')]=function(_0x34c66d,_0x51a6c4){return db[_0xf112('0x2c')][_0xf112('0x4a')](_0x34c66d['body'],{})['then'](function(_0x58de11){var _0x5c8bf3=_0x34c66d['user'][_0xf112('0x25')]({'plain':!![]});if(!_0x5c8bf3)throw new Error(_0xf112('0x4b'));if(_0x5c8bf3[_0xf112('0x4c')]===_0xf112('0x4d')){var _0x5de006=_0x58de11[_0xf112('0x25')]({'plain':!![]});var _0x321469='IvrCampaigns';return db[_0xf112('0x4e')][_0xf112('0x48')]({'where':{'name':_0x321469,'userProfileId':_0x5c8bf3['userProfileId']},'raw':!![]})[_0xf112('0x23')](function(_0x5797f8){if(_0x5797f8&&_0x5797f8[_0xf112('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x5de006[_0xf112('0x29')],'resourceId':_0x5de006['id'],'type':_0x5797f8[_0xf112('0x29')],'sectionId':_0x5797f8['id']},{})[_0xf112('0x23')](function(){return _0x58de11;});}else{return _0x58de11;}})[_0xf112('0x49')](function(_0x2b4021){logger[_0xf112('0x27')](_0xf112('0x50'),_0x2b4021);throw _0x2b4021;});}return _0x58de11;})[_0xf112('0x23')](respondWithResult(_0x51a6c4,0xc9))[_0xf112('0x49')](handleError(_0x51a6c4,null));};exports[_0xf112('0x51')]=function(_0x411fa8,_0x4ab934){var _0x47e28b={'where':{'id':_0x411fa8[_0xf112('0x52')]['id']}},_0x1d8d0a={};_0x1d8d0a[_0xf112('0x34')]=_[_0xf112('0x47')](db[_0xf112('0x2c')]['rawAttributes']);_0x47e28b['attributes']=_['intersection'](_0x1d8d0a[_0xf112('0x34')],qs[_0xf112('0x35')](_0x411fa8[_0xf112('0x32')][_0xf112('0x35')]));_0x47e28b[_0xf112('0x36')]=_0x47e28b[_0xf112('0x36')]['length']?_0x47e28b[_0xf112('0x36')]:_0x1d8d0a['model'];if(_0x411fa8[_0xf112('0x32')][_0xf112('0x42')]){_0x47e28b[_0xf112('0x43')]=[{'all':!![]}];}_0x47e28b=_[_0xf112('0x3e')]({},_0x47e28b,_0x411fa8['options']);return db[_0xf112('0x2c')]['find'](_0x47e28b)[_0xf112('0x23')](handleEntityNotFound(_0x4ab934,null))[_0xf112('0x23')](function(_0x3859b7){if(_0x3859b7){var _0x475e05=_0x3859b7[_0xf112('0x25')]({'plain':!![]});_0x475e05=qs[_0xf112('0x53')](_0x475e05,['id',_0xf112('0x54'),_0xf112('0x55')]);_0x411fa8[_0xf112('0x56')]=_[_0xf112('0x53')](_0x411fa8[_0xf112('0x56')],['id',_0xf112('0x54'),_0xf112('0x55')]);return db[_0xf112('0x2c')][_0xf112('0x4a')](_[_0xf112('0x3e')](_0x475e05,_0x411fa8[_0xf112('0x56')]),{'include':_0x411fa8['query'][_0xf112('0x42')]?[{'all':!![]}]:undefined})[_0xf112('0x23')](function(_0x3d084a){var _0x242c32=_0x411fa8[_0xf112('0x4d')]['get']({'plain':!![]});if(!_0x242c32)throw new Error(_0xf112('0x4b'));if(_0x242c32[_0xf112('0x4c')]==='user'){var _0x436027=_0x3d084a['get']({'plain':!![]});var _0x483efb=_0xf112('0x57');return db[_0xf112('0x4e')]['find']({'where':{'name':_0x483efb,'userProfileId':_0x242c32[_0xf112('0x58')]},'raw':!![]})[_0xf112('0x23')](function(_0x4e2fcc){if(_0x4e2fcc&&_0x4e2fcc[_0xf112('0x4f')]===0x0){return db['UserProfileResource'][_0xf112('0x4a')]({'name':_0x436027[_0xf112('0x29')],'resourceId':_0x436027['id'],'type':_0x4e2fcc[_0xf112('0x29')],'sectionId':_0x4e2fcc['id']},{})[_0xf112('0x23')](function(){return _0x3d084a;});}else{return _0x3d084a;}})['catch'](function(_0x4aa8f2){logger[_0xf112('0x27')](_0xf112('0x50'),_0x4aa8f2);throw _0x4aa8f2;});}return _0x3d084a;});}})[_0xf112('0x23')](respondWithResult(_0x4ab934,0xc9))[_0xf112('0x49')](handleError(_0x4ab934,null));};exports[_0xf112('0x22')]=function(_0x5e5718,_0xfbd3a4){if(_0x5e5718[_0xf112('0x56')]['id']){delete _0x5e5718['body']['id'];}return db['Campaign'][_0xf112('0x48')]({'where':{'id':_0x5e5718[_0xf112('0x52')]['id']}})['then'](handleEntityNotFound(_0xfbd3a4,null))[_0xf112('0x23')](saveUpdates(_0x5e5718[_0xf112('0x56')],null))[_0xf112('0x23')](respondWithResult(_0xfbd3a4,null))['catch'](handleError(_0xfbd3a4,null));};exports[_0xf112('0x24')]=function(_0x23a966,_0x5a57f8){return db[_0xf112('0x2c')][_0xf112('0x48')]({'where':{'id':_0x23a966[_0xf112('0x52')]['id']}})[_0xf112('0x23')](handleEntityNotFound(_0x5a57f8,null))[_0xf112('0x23')](removeEntity(_0x5a57f8,null))[_0xf112('0x49')](handleError(_0x5a57f8,null));};exports[_0xf112('0x59')]=function(_0x2cea82,_0x803707,_0x3b5ddb){var _0x2f8876={'raw':!![],'where':{}};var _0x4f898f={};var _0x4c1b1b={'count':0x0,'rows':[]};return db[_0xf112('0x2c')][_0xf112('0x5a')]({'where':{'id':_0x2cea82['params']['id']}})[_0xf112('0x23')](handleEntityNotFound(_0x803707,null))[_0xf112('0x23')](function(_0xc88a05){if(_0xc88a05){_0x4f898f[_0xf112('0x34')]=_[_0xf112('0x47')](db[_0xf112('0x5b')][_0xf112('0x2d')]);_0x4f898f[_0xf112('0x32')]=_[_0xf112('0x47')](_0x2cea82[_0xf112('0x32')]);_0x4f898f[_0xf112('0x3c')]=_[_0xf112('0x33')](_0x4f898f[_0xf112('0x34')],_0x4f898f[_0xf112('0x32')]);_0x2f8876['attributes']=_[_0xf112('0x33')](_0x4f898f[_0xf112('0x34')],qs[_0xf112('0x35')](_0x2cea82[_0xf112('0x32')]['fields']));_0x2f8876[_0xf112('0x36')]=_0x2f8876['attributes'][_0xf112('0x37')]?_0x2f8876[_0xf112('0x36')]:_0x4f898f[_0xf112('0x34')];if(!_0x2cea82[_0xf112('0x32')][_0xf112('0x38')]('nolimit')){_0x2f8876[_0xf112('0x1d')]=qs[_0xf112('0x1d')](_0x2cea82[_0xf112('0x32')][_0xf112('0x1d')]);_0x2f8876['offset']=qs['offset'](_0x2cea82[_0xf112('0x32')]['offset']);}_0x2f8876[_0xf112('0x5c')]=qs['sort'](_0x2cea82['query']['sort']);_0x2f8876[_0xf112('0x3b')]=qs[_0xf112('0x3c')](_[_0xf112('0x5d')](_0x2cea82[_0xf112('0x32')],_0x4f898f[_0xf112('0x3c')]));_0x2f8876[_0xf112('0x3b')][_0xf112('0x5e')]=_0xc88a05['id'];if(_0x2cea82['query'][_0xf112('0x3d')]){_0x2f8876[_0xf112('0x3b')]=_[_0xf112('0x3e')](_0x2f8876[_0xf112('0x3b')],{'$or':_[_0xf112('0x31')](_0x2f8876[_0xf112('0x36')],function(_0x234736){var _0x1814fa={};_0x1814fa[_0x234736]={'$like':'%'+_0x2cea82[_0xf112('0x32')][_0xf112('0x3d')]+'%'};return _0x1814fa;})});}_0x2f8876=_[_0xf112('0x3e')]({},_0x2f8876,_0x2cea82[_0xf112('0x40')]);return db[_0xf112('0x5b')]['count']({'where':_0x2f8876[_0xf112('0x3b')]})['then'](function(_0x4c8fd7){_0x4c1b1b['count']=_0x4c8fd7;if(_0x2cea82[_0xf112('0x32')][_0xf112('0x42')]){_0x2f8876[_0xf112('0x43')]=[{'all':!![]}];}return db['CmHopper'][_0xf112('0x44')](_0x2f8876);})['then'](function(_0xfe6508){_0x4c1b1b[_0xf112('0x45')]=_0xfe6508;return _0x4c1b1b;});}})[_0xf112('0x23')](respondWithFilteredResult(_0x803707,_0x2f8876))[_0xf112('0x49')](handleError(_0x803707,null));};exports[_0xf112('0x5f')]=function(_0x279e63,_0x19995b,_0x50ed7c){var _0x1a9776={'raw':!![],'where':{}};var _0x51bbfa={};var _0x11173c={'count':0x0,'rows':[]};return db[_0xf112('0x2c')][_0xf112('0x5a')]({'where':{'id':_0x279e63['params']['id']}})[_0xf112('0x23')](handleEntityNotFound(_0x19995b,null))['then'](function(_0x370a49){if(_0x370a49){_0x51bbfa[_0xf112('0x34')]=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x51bbfa[_0xf112('0x32')]=_[_0xf112('0x47')](_0x279e63[_0xf112('0x32')]);_0x51bbfa[_0xf112('0x3c')]=_[_0xf112('0x33')](_0x51bbfa['model'],_0x51bbfa['query']);_0x1a9776['attributes']=_[_0xf112('0x33')](_0x51bbfa[_0xf112('0x34')],qs['fields'](_0x279e63[_0xf112('0x32')][_0xf112('0x35')]));_0x1a9776[_0xf112('0x36')]=_0x1a9776[_0xf112('0x36')][_0xf112('0x37')]?_0x1a9776[_0xf112('0x36')]:_0x51bbfa[_0xf112('0x34')];if(!_0x279e63['query'][_0xf112('0x38')]('nolimit')){_0x1a9776[_0xf112('0x1d')]=qs[_0xf112('0x1d')](_0x279e63[_0xf112('0x32')][_0xf112('0x1d')]);_0x1a9776[_0xf112('0x1b')]=qs[_0xf112('0x1b')](_0x279e63['query'][_0xf112('0x1b')]);}_0x1a9776['order']=qs[_0xf112('0x3a')](_0x279e63['query'][_0xf112('0x3a')]);_0x1a9776['where']=qs['filters'](_[_0xf112('0x5d')](_0x279e63[_0xf112('0x32')],_0x51bbfa[_0xf112('0x3c')]));_0x1a9776[_0xf112('0x3b')][_0xf112('0x5e')]=_0x370a49['id'];if(_0x279e63[_0xf112('0x32')][_0xf112('0x3d')]){_0x1a9776[_0xf112('0x3b')]=_[_0xf112('0x3e')](_0x1a9776[_0xf112('0x3b')],{'$or':_['map'](_0x1a9776['attributes'],function(_0x3c52f3){var _0x25600c={};_0x25600c[_0x3c52f3]={'$like':'%'+_0x279e63[_0xf112('0x32')][_0xf112('0x3d')]+'%'};return _0x25600c;})});}_0x1a9776=_[_0xf112('0x3e')]({},_0x1a9776,_0x279e63[_0xf112('0x40')]);return db[_0xf112('0x60')]['count']({'where':_0x1a9776[_0xf112('0x3b')]})['then'](function(_0x1e56d6){_0x11173c[_0xf112('0x41')]=_0x1e56d6;if(_0x279e63[_0xf112('0x32')]['includeAll']){_0x1a9776[_0xf112('0x43')]=[{'all':!![]}];}return db[_0xf112('0x60')]['findAll'](_0x1a9776);})[_0xf112('0x23')](function(_0x3d7853){_0x11173c[_0xf112('0x45')]=_0x3d7853;return _0x11173c;});}})['then'](respondWithFilteredResult(_0x19995b,_0x1a9776))[_0xf112('0x49')](handleError(_0x19995b,null));};exports['getHopperFinals']=function(_0x42d7c5,_0x154a47,_0x38d22d){var _0x3f888a={'raw':!![],'where':{}};var _0x301bb4={};var _0x4ffb5b={'count':0x0,'rows':[]};return db[_0xf112('0x2c')][_0xf112('0x5a')]({'where':{'id':_0x42d7c5[_0xf112('0x52')]['id']}})['then'](handleEntityNotFound(_0x154a47,null))[_0xf112('0x23')](function(_0x120815){if(_0x120815){_0x301bb4[_0xf112('0x34')]=_[_0xf112('0x47')](db[_0xf112('0x61')][_0xf112('0x2d')]);_0x301bb4[_0xf112('0x32')]=_['keys'](_0x42d7c5['query']);_0x301bb4[_0xf112('0x3c')]=_['intersection'](_0x301bb4[_0xf112('0x34')],_0x301bb4['query']);_0x3f888a[_0xf112('0x36')]=_[_0xf112('0x33')](_0x301bb4[_0xf112('0x34')],qs[_0xf112('0x35')](_0x42d7c5[_0xf112('0x32')][_0xf112('0x35')]));_0x3f888a[_0xf112('0x36')]=_0x3f888a['attributes'][_0xf112('0x37')]?_0x3f888a[_0xf112('0x36')]:_0x301bb4['model'];if(!_0x42d7c5[_0xf112('0x32')][_0xf112('0x38')]('nolimit')){_0x3f888a[_0xf112('0x1d')]=qs[_0xf112('0x1d')](_0x42d7c5['query'][_0xf112('0x1d')]);_0x3f888a[_0xf112('0x1b')]=qs[_0xf112('0x1b')](_0x42d7c5['query'][_0xf112('0x1b')]);}_0x3f888a[_0xf112('0x5c')]=qs[_0xf112('0x3a')](_0x42d7c5[_0xf112('0x32')][_0xf112('0x3a')]);_0x3f888a['where']=qs[_0xf112('0x3c')](_[_0xf112('0x5d')](_0x42d7c5['query'],_0x301bb4[_0xf112('0x3c')]));_0x3f888a[_0xf112('0x3b')][_0xf112('0x5e')]=_0x120815['id'];if(_0x42d7c5[_0xf112('0x32')][_0xf112('0x3d')]){_0x3f888a[_0xf112('0x3b')]=_[_0xf112('0x3e')](_0x3f888a[_0xf112('0x3b')],{'$or':_[_0xf112('0x31')](_0x3f888a['attributes'],function(_0x2570f4){var _0x280c0c={};_0x280c0c[_0x2570f4]={'$like':'%'+_0x42d7c5[_0xf112('0x32')][_0xf112('0x3d')]+'%'};return _0x280c0c;})});}_0x3f888a=_[_0xf112('0x3e')]({},_0x3f888a,_0x42d7c5[_0xf112('0x40')]);return db[_0xf112('0x61')][_0xf112('0x41')]({'where':_0x3f888a[_0xf112('0x3b')]})[_0xf112('0x23')](function(_0x5d965b){_0x4ffb5b['count']=_0x5d965b;if(_0x42d7c5[_0xf112('0x32')][_0xf112('0x42')]){_0x3f888a[_0xf112('0x43')]=[{'all':!![]}];}return db[_0xf112('0x61')][_0xf112('0x44')](_0x3f888a);})[_0xf112('0x23')](function(_0x42b26d){_0x4ffb5b['rows']=_0x42b26d;return _0x4ffb5b;});}})[_0xf112('0x23')](respondWithFilteredResult(_0x154a47,_0x3f888a))[_0xf112('0x49')](handleError(_0x154a47,null));};exports[_0xf112('0x62')]=function(_0x385b46,_0x50f6d5,_0x2d45ec){var _0x5f3e6a={'raw':!![],'where':{}};var _0x25879e={};var _0x4cc484={'count':0x0,'rows':[]};return db[_0xf112('0x2c')][_0xf112('0x5a')]({'where':{'id':_0x385b46[_0xf112('0x52')]['id']}})[_0xf112('0x23')](handleEntityNotFound(_0x50f6d5,null))[_0xf112('0x23')](function(_0x3e4da8){if(_0x3e4da8){_0x25879e[_0xf112('0x34')]=_[_0xf112('0x47')](db[_0xf112('0x63')][_0xf112('0x2d')]);_0x25879e[_0xf112('0x32')]=_['keys'](_0x385b46[_0xf112('0x32')]);_0x25879e[_0xf112('0x3c')]=_[_0xf112('0x33')](_0x25879e[_0xf112('0x34')],_0x25879e[_0xf112('0x32')]);_0x5f3e6a['attributes']=_[_0xf112('0x33')](_0x25879e[_0xf112('0x34')],qs[_0xf112('0x35')](_0x385b46[_0xf112('0x32')][_0xf112('0x35')]));_0x5f3e6a[_0xf112('0x36')]=_0x5f3e6a['attributes']['length']?_0x5f3e6a['attributes']:_0x25879e['model'];if(!_0x385b46['query'][_0xf112('0x38')](_0xf112('0x39'))){_0x5f3e6a['limit']=qs['limit'](_0x385b46[_0xf112('0x32')]['limit']);_0x5f3e6a['offset']=qs[_0xf112('0x1b')](_0x385b46['query']['offset']);}_0x5f3e6a[_0xf112('0x5c')]=qs[_0xf112('0x3a')](_0x385b46[_0xf112('0x32')][_0xf112('0x3a')]);_0x5f3e6a[_0xf112('0x3b')]=qs['filters'](_['pick'](_0x385b46[_0xf112('0x32')],_0x25879e[_0xf112('0x3c')]));_0x5f3e6a['where']['CampaignId']=_0x3e4da8['id'];if(_0x385b46[_0xf112('0x32')][_0xf112('0x3d')]){_0x5f3e6a[_0xf112('0x3b')]=_[_0xf112('0x3e')](_0x5f3e6a[_0xf112('0x3b')],{'$or':_[_0xf112('0x31')](_0x5f3e6a['attributes'],function(_0x150658){var _0x1edbcc={};_0x1edbcc[_0x150658]={'$like':'%'+_0x385b46[_0xf112('0x32')][_0xf112('0x3d')]+'%'};return _0x1edbcc;})});}_0x5f3e6a=_[_0xf112('0x3e')]({},_0x5f3e6a,_0x385b46['options']);return db[_0xf112('0x63')][_0xf112('0x41')]({'where':_0x5f3e6a[_0xf112('0x3b')]})[_0xf112('0x23')](function(_0x5ccec5){_0x4cc484[_0xf112('0x41')]=_0x5ccec5;if(_0x385b46[_0xf112('0x32')][_0xf112('0x42')]){_0x5f3e6a[_0xf112('0x43')]=[{'all':!![]}];}return db[_0xf112('0x63')][_0xf112('0x44')](_0x5f3e6a);})[_0xf112('0x23')](function(_0x33fcb1){_0x4cc484['rows']=_0x33fcb1;return _0x4cc484;});}})[_0xf112('0x23')](respondWithFilteredResult(_0x50f6d5,_0x5f3e6a))[_0xf112('0x49')](handleError(_0x50f6d5,null));};exports['getLists']=function(_0x484294,_0x2f24be,_0x2a1892){var _0x509d8f={};var _0x42b9f0={};var _0x5e7385;var _0x6b2d2e;return db[_0xf112('0x2c')][_0xf112('0x5a')]({'where':{'id':_0x484294['params']['id']}})['then'](handleEntityNotFound(_0x2f24be,null))['then'](function(_0x6da927){if(_0x6da927){_0x5e7385=_0x6da927;_0x42b9f0[_0xf112('0x34')]=_[_0xf112('0x47')](db[_0xf112('0x64')]['rawAttributes']);_0x42b9f0['query']=_['keys'](_0x484294[_0xf112('0x32')]);_0x42b9f0[_0xf112('0x3c')]=_[_0xf112('0x33')](_0x42b9f0['model'],_0x42b9f0[_0xf112('0x32')]);_0x509d8f['attributes']=_[_0xf112('0x33')](_0x42b9f0[_0xf112('0x34')],qs[_0xf112('0x35')](_0x484294[_0xf112('0x32')]['fields']));_0x509d8f[_0xf112('0x36')]=_0x509d8f[_0xf112('0x36')][_0xf112('0x37')]?_0x509d8f['attributes']:_0x42b9f0[_0xf112('0x34')];_0x509d8f[_0xf112('0x5c')]=qs[_0xf112('0x3a')](_0x484294[_0xf112('0x32')]['sort']);_0x509d8f[_0xf112('0x3b')]=qs[_0xf112('0x3c')](_[_0xf112('0x5d')](_0x484294[_0xf112('0x32')],_0x42b9f0[_0xf112('0x3c')]));if(_0x484294[_0xf112('0x32')][_0xf112('0x3d')]){_0x509d8f[_0xf112('0x3b')]=_[_0xf112('0x3e')](_0x509d8f[_0xf112('0x3b')],{'$or':_['map'](_0x509d8f[_0xf112('0x36')],function(_0xfe6a29){var _0x31a707={};_0x31a707[_0xfe6a29]={'$like':'%'+_0x484294[_0xf112('0x32')][_0xf112('0x3d')]+'%'};return _0x31a707;})});}_0x509d8f=_[_0xf112('0x3e')]({},_0x509d8f,_0x484294[_0xf112('0x40')]);return _0x5e7385[_0xf112('0x65')](_0x509d8f);}})[_0xf112('0x23')](function(_0x4ac26f){if(_0x4ac26f){_0x6b2d2e=_0x4ac26f[_0xf112('0x37')];if(!_0x484294[_0xf112('0x32')][_0xf112('0x38')]('nolimit')){_0x509d8f[_0xf112('0x1d')]=qs[_0xf112('0x1d')](_0x484294[_0xf112('0x32')][_0xf112('0x1d')]);_0x509d8f[_0xf112('0x1b')]=qs[_0xf112('0x1b')](_0x484294[_0xf112('0x32')][_0xf112('0x1b')]);}return _0x5e7385[_0xf112('0x65')](_0x509d8f);}})[_0xf112('0x23')](function(_0x3040ac){if(_0x3040ac){return _0x3040ac?{'count':_0x6b2d2e,'rows':_0x3040ac}:null;}})[_0xf112('0x23')](respondWithResult(_0x2f24be,null))[_0xf112('0x49')](handleError(_0x2f24be,null));};exports[_0xf112('0x66')]=function(_0xd962e1,_0x557542,_0x1caf81){var _0x21e205,_0x577395;var _0x2140ec=[];var _0x143beb=moment()['format'](_0xf112('0x67'));return db[_0xf112('0x2c')][_0xf112('0x48')]({'where':{'id':_0xd962e1[_0xf112('0x52')]['id']}})[_0xf112('0x23')](handleEntityNotFound(_0x557542,null))[_0xf112('0x23')](function(_0x26c454){if(_0x26c454){_0x577395=_0x26c454;return _0x26c454[_0xf112('0x66')](_0xd962e1[_0xf112('0x56')][_0xf112('0x68')],_[_0xf112('0x53')](_0xd962e1[_0xf112('0x56')],[_0xf112('0x68'),'id'])||{});}return null;})[_0xf112('0x69')](function(_0x31e071){var _0x436da7;var _0x57fa95;_0x21e205=_0x31e071||[];var _0x5bcc3b=[];if(_0x31e071){for(var _0x12f966=0x0;_0x12f966<_0x31e071['length'];_0x12f966+=0x1){var _0x467c89=_0x31e071[_0x12f966][_0xf112('0x25')]({'plain':!![]});_0x577395[_0xf112('0x6a')]=_0xd962e1[_0xf112('0x56')][_0xf112('0x6a')]?_0xd962e1[_0xf112('0x56')][_0xf112('0x6a')]:_0x577395[_0xf112('0x6a')];switch(_0x577395[_0xf112('0x6a')]){case _0xf112('0x6b'):_0x436da7=squel['insert']()[_0xf112('0x6c')](_0xf112('0x6d'))[_0xf112('0x6e')](['phone',_0xf112('0x6f'),_0xf112('0x70'),'ListId',_0xf112('0x5e'),'createdAt','updatedAt'],squel[_0xf112('0x71')]()[_0xf112('0x72')](_0xf112('0x73'),'phone')[_0xf112('0x72')](_0xf112('0x74'),_0xf112('0x6f'))['field']('id',_0xf112('0x70'))['field'](_0x467c89[_0xf112('0x75')][_0xf112('0x76')](),_0xf112('0x77'))[_0xf112('0x72')](_0xd962e1[_0xf112('0x52')]['id'][_0xf112('0x76')](),_0xf112('0x5e'))[_0xf112('0x72')]('\x27'+_0x143beb+'\x27',_0xf112('0x54'))[_0xf112('0x72')]('\x27'+_0x143beb+'\x27',_0xf112('0x55'))[_0xf112('0x78')]('cm_contacts')[_0xf112('0x3b')](_0xf112('0x79'))['where']('ListId\x20=\x20?',_0x467c89[_0xf112('0x75')][_0xf112('0x76')]())['where'](_0xf112('0x7a'))[_0xf112('0x3b')](_0xf112('0x7b'),squel[_0xf112('0x71')]()[_0xf112('0x72')](_0xf112('0x7c'))[_0xf112('0x78')]('cm_hopper_final')[_0xf112('0x3b')](_0xf112('0x7d'),_0xd962e1[_0xf112('0x52')]['id']['toString']()))[_0xf112('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf112('0x71')]()[_0xf112('0x72')]('COALESCE(phone,\x27\x27)')[_0xf112('0x78')](_0xf112('0x6d'))[_0xf112('0x3b')]('CampaignId\x20=\x20?',_0xd962e1[_0xf112('0x52')]['id']['toString']())))['toString']();break;case _0xf112('0x7e'):_0x436da7=squel[_0xf112('0x7f')]()[_0xf112('0x6c')](_0xf112('0x6d'))[_0xf112('0x6e')]([_0xf112('0x73'),_0xf112('0x6f'),_0xf112('0x70'),_0xf112('0x77'),_0xf112('0x5e'),_0xf112('0x54'),_0xf112('0x55')],squel[_0xf112('0x71')]()[_0xf112('0x72')]('phone','phone')[_0xf112('0x72')]('NOW()','scheduledAt')['field']('id',_0xf112('0x70'))[_0xf112('0x72')](_0x467c89[_0xf112('0x75')][_0xf112('0x76')](),_0xf112('0x77'))[_0xf112('0x72')](_0xd962e1['params']['id']['toString'](),_0xf112('0x5e'))[_0xf112('0x72')]('\x27'+_0x143beb+'\x27',_0xf112('0x54'))['field']('\x27'+_0x143beb+'\x27','updatedAt')[_0xf112('0x78')](_0xf112('0x80'))[_0xf112('0x3b')]('deletedAt\x20IS\x20NULL')[_0xf112('0x3b')](_0xf112('0x81'),_0x467c89[_0xf112('0x75')]['toString']())[_0xf112('0x3b')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xf112('0x71')]()['field'](_0xf112('0x82'))[_0xf112('0x78')]('cm_hopper')[_0xf112('0x3b')](_0xf112('0x7d'),_0xd962e1[_0xf112('0x52')]['id'][_0xf112('0x76')]())))[_0xf112('0x76')]();break;default:_0x436da7=squel[_0xf112('0x7f')]()[_0xf112('0x6c')](_0xf112('0x6d'))[_0xf112('0x6e')]([_0xf112('0x73'),_0xf112('0x6f'),_0xf112('0x70'),_0xf112('0x77'),_0xf112('0x5e'),_0xf112('0x54'),_0xf112('0x55')],squel['select']()[_0xf112('0x72')](_0xf112('0x73'),_0xf112('0x73'))['field'](_0xf112('0x74'),'scheduledAt')[_0xf112('0x72')]('id','ContactId')[_0xf112('0x72')](_0x467c89[_0xf112('0x75')][_0xf112('0x76')](),_0xf112('0x77'))[_0xf112('0x72')](_0xd962e1[_0xf112('0x52')]['id']['toString'](),_0xf112('0x5e'))[_0xf112('0x72')]('\x27'+_0x143beb+'\x27','createdAt')[_0xf112('0x72')]('\x27'+_0x143beb+'\x27','updatedAt')[_0xf112('0x78')](_0xf112('0x80'))[_0xf112('0x3b')](_0xf112('0x79'))[_0xf112('0x3b')](_0xf112('0x81'),_0x467c89[_0xf112('0x75')][_0xf112('0x76')]())[_0xf112('0x3b')](_0xf112('0x7a')))['toString']();}_0x57fa95=squel[_0xf112('0x7f')]()['into']('cm_hopper_additional_phones')[_0xf112('0x6e')]([_0xf112('0x83'),_0xf112('0x6f'),'phone',_0xf112('0x84'),_0xf112('0x54'),_0xf112('0x55')],squel[_0xf112('0x71')]()['field'](_0xf112('0x85'),'id')['field'](_0xf112('0x74'),_0xf112('0x6f'))[_0xf112('0x72')](_0xf112('0x86'),'phone')['field'](_0xf112('0x87'),_0xf112('0x84'))[_0xf112('0x72')]('\x27'+_0x143beb+'\x27',_0xf112('0x54'))[_0xf112('0x72')]('\x27'+_0x143beb+'\x27',_0xf112('0x55'))[_0xf112('0x78')]('cm_contact_has_items','ci')[_0xf112('0x88')](_0xf112('0x6d'),'h',_0xf112('0x89'))[_0xf112('0x3b')](_0xf112('0x8a'),_0x467c89['CmListId']['toString']())[_0xf112('0x3b')](_0xf112('0x8b'),_0xd962e1[_0xf112('0x52')]['id']['toString']())[_0xf112('0x3b')](_0xf112('0x8c'),_0x143beb))['toString']();_0x5bcc3b[_0xf112('0x8d')](db[_0xf112('0x8e')][_0xf112('0x32')](_0x436da7));_0x2140ec[_0xf112('0x8d')](db[_0xf112('0x8e')][_0xf112('0x32')](_0x57fa95));}return BPromise[_0xf112('0x8f')](_0x5bcc3b);}})[_0xf112('0x23')](function(){return BPromise['all'](_0x2140ec);})[_0xf112('0x23')](function(){return _0x21e205;})[_0xf112('0x23')](respondWithResult(_0x557542,null))[_0xf112('0x49')](handleError(_0x557542,null));};exports[_0xf112('0x90')]=function(_0x498a14,_0x157f4f,_0x18cdc1){return db[_0xf112('0x2c')][_0xf112('0x48')]({'where':{'id':_0x498a14[_0xf112('0x52')]['id']}})[_0xf112('0x23')](handleEntityNotFound(_0x157f4f,null))['then'](function(_0x2bf1c8){if(_0x2bf1c8){return _0x2bf1c8['removeLists'](_0x498a14[_0xf112('0x32')][_0xf112('0x68')]);}})['then'](function(_0x373d27){if(_0x373d27){return db['CmHopper'][_0xf112('0x24')]({'where':{'ListId':_0x498a14['query'][_0xf112('0x68')],'CampaignId':_0x498a14[_0xf112('0x52')]['id']}})['then'](function(){return _0x373d27;});}})[_0xf112('0x23')](respondWithStatusCode(_0x157f4f,null))[_0xf112('0x49')](handleError(_0x157f4f,null));};exports[_0xf112('0x91')]=function(_0x51b571,_0x47e2e1,_0x21cfd6){var _0x546adf={};var _0x32a30d={};var _0x2bf792;var _0x3c799a;return db['Campaign']['findOne']({'where':{'id':_0x51b571[_0xf112('0x52')]['id']}})[_0xf112('0x23')](handleEntityNotFound(_0x47e2e1,null))[_0xf112('0x23')](function(_0x2deeec){if(_0x2deeec){_0x2bf792=_0x2deeec;_0x32a30d['model']=_[_0xf112('0x47')](db[_0xf112('0x64')][_0xf112('0x2d')]);_0x32a30d[_0xf112('0x32')]=_[_0xf112('0x47')](_0x51b571[_0xf112('0x32')]);_0x32a30d[_0xf112('0x3c')]=_['intersection'](_0x32a30d[_0xf112('0x34')],_0x32a30d[_0xf112('0x32')]);_0x546adf['attributes']=_[_0xf112('0x33')](_0x32a30d['model'],qs[_0xf112('0x35')](_0x51b571['query'][_0xf112('0x35')]));_0x546adf[_0xf112('0x36')]=_0x546adf[_0xf112('0x36')]['length']?_0x546adf[_0xf112('0x36')]:_0x32a30d[_0xf112('0x34')];_0x546adf[_0xf112('0x5c')]=qs[_0xf112('0x3a')](_0x51b571[_0xf112('0x32')][_0xf112('0x3a')]);_0x546adf['where']=qs[_0xf112('0x3c')](_['pick'](_0x51b571[_0xf112('0x32')],_0x32a30d['filters']));if(_0x51b571[_0xf112('0x32')][_0xf112('0x3d')]){_0x546adf[_0xf112('0x3b')]=_[_0xf112('0x3e')](_0x546adf['where'],{'$or':_[_0xf112('0x31')](_0x546adf[_0xf112('0x36')],function(_0x44e23f){var _0x41d42b={};_0x41d42b[_0x44e23f]={'$like':'%'+_0x51b571[_0xf112('0x32')][_0xf112('0x3d')]+'%'};return _0x41d42b;})});}_0x546adf=_[_0xf112('0x3e')]({},_0x546adf,_0x51b571['options']);return _0x2bf792[_0xf112('0x91')](_0x546adf);}})['then'](function(_0xe5e0dd){if(_0xe5e0dd){_0x3c799a=_0xe5e0dd[_0xf112('0x37')];if(!_0x51b571[_0xf112('0x32')][_0xf112('0x38')](_0xf112('0x39'))){_0x546adf[_0xf112('0x1d')]=qs[_0xf112('0x1d')](_0x51b571[_0xf112('0x32')]['limit']);_0x546adf[_0xf112('0x1b')]=qs['offset'](_0x51b571['query'][_0xf112('0x1b')]);}return _0x2bf792[_0xf112('0x91')](_0x546adf);}})[_0xf112('0x23')](function(_0x45d0ee){if(_0x45d0ee){return _0x45d0ee?{'count':_0x3c799a,'rows':_0x45d0ee}:null;}})[_0xf112('0x23')](respondWithResult(_0x47e2e1,null))[_0xf112('0x49')](handleError(_0x47e2e1,null));};exports[_0xf112('0x92')]=function(_0x36a8ba,_0xdcc051,_0x2ec287){var _0x3f9929,_0x55f29a;var _0xbece0e=[];var _0x9ee581=moment()[_0xf112('0x93')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xf112('0x2c')]['find']({'where':{'id':_0x36a8ba['params']['id']}})['then'](handleEntityNotFound(_0xdcc051,null))[_0xf112('0x23')](function(_0xeb40f8){if(_0xeb40f8){_0x55f29a=_0xeb40f8;return _0xeb40f8[_0xf112('0x92')](_0x36a8ba[_0xf112('0x56')][_0xf112('0x68')],_['omit'](_0x36a8ba[_0xf112('0x56')],[_0xf112('0x68'),'id'])||{});}return null;})[_0xf112('0x69')](function(_0x475d7c){var _0x3b41c2;var _0x2d505c;_0x3f9929=_0x475d7c||[];var _0x5b5035=[];if(_0x475d7c){for(var _0x24ba68=0x0;_0x24ba68<_0x475d7c[_0xf112('0x37')];_0x24ba68+=0x1){var _0x4f3988=_0x475d7c[_0x24ba68]['get']({'plain':!![]});_0x3b41c2=squel[_0xf112('0x7f')]()[_0xf112('0x6c')]('cm_hopper_black')[_0xf112('0x6e')](['phone',_0xf112('0x70'),_0xf112('0x77'),'CampaignId',_0xf112('0x54'),'updatedAt'],squel['select']()['field'](_0xf112('0x73'),_0xf112('0x73'))['field']('id',_0xf112('0x70'))[_0xf112('0x72')](_0x4f3988[_0xf112('0x75')][_0xf112('0x76')](),_0xf112('0x77'))[_0xf112('0x72')](_0x36a8ba[_0xf112('0x52')]['id']['toString'](),_0xf112('0x5e'))[_0xf112('0x72')](_0xf112('0x74'),_0xf112('0x54'))[_0xf112('0x72')](_0xf112('0x74'),'updatedAt')['from'](_0xf112('0x80'))[_0xf112('0x3b')](_0xf112('0x79'))['where'](_0xf112('0x81'),_0x4f3988['CmListId']['toString']())[_0xf112('0x3b')](_0xf112('0x7a')))[_0xf112('0x76')]();_0x5b5035[_0xf112('0x8d')](db[_0xf112('0x8e')][_0xf112('0x32')](_0x3b41c2));}return BPromise['all'](_0x5b5035);}})[_0xf112('0x23')](function(){return _0x3f9929;})[_0xf112('0x23')](respondWithResult(_0xdcc051,null))['catch'](handleError(_0xdcc051,null));};exports[_0xf112('0x94')]=function(_0x2bf13b,_0x4ed6e3,_0x154ac0){return db[_0xf112('0x2c')][_0xf112('0x48')]({'where':{'id':_0x2bf13b['params']['id']}})[_0xf112('0x23')](handleEntityNotFound(_0x4ed6e3,null))[_0xf112('0x23')](function(_0x5a4b1f){if(_0x5a4b1f){return _0x5a4b1f['removeBlackLists'](_0x2bf13b[_0xf112('0x32')]['ids']);}})[_0xf112('0x23')](function(_0x5681fc){if(_0x5681fc){return db[_0xf112('0x63')][_0xf112('0x24')]({'where':{'ListId':_0x2bf13b[_0xf112('0x32')]['ids'],'CampaignId':_0x2bf13b[_0xf112('0x52')]['id']}})['then'](function(){return _0x5681fc;});}})[_0xf112('0x23')](respondWithStatusCode(_0x4ed6e3,null))['catch'](handleError(_0x4ed6e3,null));};
\ No newline at end of file
+var _0xe860=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','Campaign','includeAll','include','rows','catch','show','keys','find','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','params','omit','createdAt','updatedAt','error','getHoppers','findOne','pick','CmHopper','getHopperHistories','CampaignId','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','field','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection'];(function(_0x5a66f8,_0x20ba95){var _0x41e528=function(_0x69a1af){while(--_0x69a1af){_0x5a66f8['push'](_0x5a66f8['shift']());}};_0x41e528(++_0x20ba95);}(_0xe860,0x188));var _0x0e86=function(_0x101317,_0x162be8){_0x101317=_0x101317-0x0;var _0x481e49=_0xe860[_0x101317];return _0x481e49;};'use strict';var emlformat=require(_0x0e86('0x0'));var rimraf=require(_0x0e86('0x1'));var zipdir=require(_0x0e86('0x2'));var jsonpatch=require(_0x0e86('0x3'));var rp=require('request-promise');var moment=require(_0x0e86('0x4'));var BPromise=require(_0x0e86('0x5'));var Mustache=require('mustache');var util=require(_0x0e86('0x6'));var path=require(_0x0e86('0x7'));var sox=require(_0x0e86('0x8'));var csv=require(_0x0e86('0x9'));var ejs=require(_0x0e86('0xa'));var fs=require('fs');var fs_extra=require(_0x0e86('0xb'));var _=require(_0x0e86('0xc'));var squel=require(_0x0e86('0xd'));var crypto=require(_0x0e86('0xe'));var jsforce=require(_0x0e86('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0e86('0x9'));var querystring=require('querystring');var Papa=require(_0x0e86('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e86('0x11'));var logger=require('../../config/logger')(_0x0e86('0x12'));var utils=require(_0x0e86('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0e86('0x14'));var db=require(_0x0e86('0x15'))['db'];function respondWithStatusCode(_0x336308,_0x731e0b){_0x731e0b=_0x731e0b||0xcc;return function(_0x2ef563){if(_0x2ef563){return _0x336308[_0x0e86('0x16')](_0x731e0b);}return _0x336308[_0x0e86('0x17')](_0x731e0b)['end']();};}function respondWithResult(_0xee30a9,_0x27e093){_0x27e093=_0x27e093||0xc8;return function(_0xbd69f4){if(_0xbd69f4){return _0xee30a9[_0x0e86('0x17')](_0x27e093)[_0x0e86('0x18')](_0xbd69f4);}};}function respondWithFilteredResult(_0x39449f,_0x9964f7){return function(_0x3e4189){if(_0x3e4189){var _0x32cd00=typeof _0x9964f7[_0x0e86('0x19')]===_0x0e86('0x1a')&&typeof _0x9964f7[_0x0e86('0x1b')]===_0x0e86('0x1a');var _0x3b7933=_0x3e4189[_0x0e86('0x1c')];var _0xee60ba=_0x32cd00?0x0:_0x9964f7[_0x0e86('0x19')];var _0x1fbcd3=_0x32cd00?_0x3e4189[_0x0e86('0x1c')]:_0x9964f7['offset']+_0x9964f7['limit'];var _0x54579d;if(_0x1fbcd3>=_0x3b7933){_0x1fbcd3=_0x3b7933;_0x54579d=0xc8;}else{_0x54579d=0xce;}_0x39449f[_0x0e86('0x17')](_0x54579d);return _0x39449f[_0x0e86('0x1d')](_0x0e86('0x1e'),_0xee60ba+'-'+_0x1fbcd3+'/'+_0x3b7933)['json'](_0x3e4189);}return null;};}function patchUpdates(_0xe30ad9){return function(_0x53ceb1){try{jsonpatch[_0x0e86('0x1f')](_0x53ceb1,_0xe30ad9,!![]);}catch(_0x13008a){return BPromise[_0x0e86('0x20')](_0x13008a);}return _0x53ceb1[_0x0e86('0x21')]();};}function saveUpdates(_0x17edb4,_0x385530){return function(_0x538ef3){if(_0x538ef3){return _0x538ef3[_0x0e86('0x22')](_0x17edb4)[_0x0e86('0x23')](function(_0x340a93){return _0x340a93;});}return null;};}function removeEntity(_0x432253,_0xa24e68){return function(_0x185354){if(_0x185354){return _0x185354[_0x0e86('0x24')]()['then'](function(){var _0x7ad308=_0x185354[_0x0e86('0x25')]({'plain':!![]});var _0x1ae6fe=_0x0e86('0x26');return db[_0x0e86('0x27')][_0x0e86('0x24')]({'where':{'type':_0x1ae6fe,'resourceId':_0x7ad308['id']}})['then'](function(){return _0x185354;});})[_0x0e86('0x23')](function(){_0x432253['status'](0xcc)[_0x0e86('0x28')]();});}};}function handleEntityNotFound(_0x13a187,_0x5b483f){return function(_0x49aea3){if(!_0x49aea3){_0x13a187[_0x0e86('0x16')](0x194);}return _0x49aea3;};}function handleError(_0x580416,_0x405643){_0x405643=_0x405643||0x1f4;return function(_0x1a7f77){logger['error'](_0x1a7f77['stack']);if(_0x1a7f77[_0x0e86('0x29')]){delete _0x1a7f77[_0x0e86('0x29')];}_0x580416[_0x0e86('0x17')](_0x405643)[_0x0e86('0x2a')](_0x1a7f77);};}exports[_0x0e86('0x2b')]=function(_0x53139c,_0x2194fd){var _0x432696={},_0x2351ca={},_0x33ea18={'count':0x0,'rows':[]};var _0x5a81dd=_[_0x0e86('0x2c')](db['Campaign'][_0x0e86('0x2d')],function(_0x244808){return{'name':_0x244808[_0x0e86('0x2e')],'type':_0x244808['type'][_0x0e86('0x2f')]};});_0x2351ca[_0x0e86('0x30')]=_[_0x0e86('0x2c')](_0x5a81dd,_0x0e86('0x29'));_0x2351ca[_0x0e86('0x31')]=_['keys'](_0x53139c[_0x0e86('0x31')]);_0x2351ca[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x2351ca[_0x0e86('0x30')],_0x2351ca['query']);_0x432696[_0x0e86('0x34')]=_['intersection'](_0x2351ca[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x53139c[_0x0e86('0x31')][_0x0e86('0x35')]));_0x432696[_0x0e86('0x34')]=_0x432696[_0x0e86('0x34')][_0x0e86('0x36')]?_0x432696[_0x0e86('0x34')]:_0x2351ca['model'];if(!_0x53139c[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x432696['limit']=qs['limit'](_0x53139c[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x432696[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x53139c[_0x0e86('0x31')]['offset']);}_0x432696[_0x0e86('0x39')]=qs['sort'](_0x53139c[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x432696['where']=qs[_0x0e86('0x32')](_['pick'](_0x53139c[_0x0e86('0x31')],_0x2351ca[_0x0e86('0x32')]),_0x5a81dd);if(_0x53139c[_0x0e86('0x31')]['filter']){_0x432696[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x432696[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x5a81dd,function(_0xdd6fdb){if(_0xdd6fdb[_0x0e86('0x3d')]!==_0x0e86('0x3e')){var _0x1d8d42={};_0x1d8d42[_0xdd6fdb[_0x0e86('0x29')]]={'$like':'%'+_0x53139c[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x1d8d42;}})});}_0x432696=_['merge']({},_0x432696,_0x53139c[_0x0e86('0x40')]);var _0x382d94={'where':_0x432696[_0x0e86('0x3b')]};return db[_0x0e86('0x41')][_0x0e86('0x1c')](_0x382d94)[_0x0e86('0x23')](function(_0x5fa25f){_0x33ea18['count']=_0x5fa25f;if(_0x53139c[_0x0e86('0x31')][_0x0e86('0x42')]){_0x432696[_0x0e86('0x43')]=[{'all':!![]}];}return db[_0x0e86('0x41')]['findAll'](_0x432696);})[_0x0e86('0x23')](function(_0x4b4a2c){_0x33ea18[_0x0e86('0x44')]=_0x4b4a2c;return _0x33ea18;})[_0x0e86('0x23')](respondWithFilteredResult(_0x2194fd,_0x432696))[_0x0e86('0x45')](handleError(_0x2194fd,null));};exports[_0x0e86('0x46')]=function(_0x1bc5cc,_0x46de02){var _0x3e9ec3={'raw':![],'where':{'id':_0x1bc5cc['params']['id']}},_0x261899={};_0x261899[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['Campaign'][_0x0e86('0x2d')]);_0x261899[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x1bc5cc[_0x0e86('0x31')]);_0x261899[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x261899[_0x0e86('0x30')],_0x261899[_0x0e86('0x31')]);_0x3e9ec3[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x261899[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x1bc5cc[_0x0e86('0x31')][_0x0e86('0x35')]));_0x3e9ec3[_0x0e86('0x34')]=_0x3e9ec3[_0x0e86('0x34')][_0x0e86('0x36')]?_0x3e9ec3[_0x0e86('0x34')]:_0x261899[_0x0e86('0x30')];if(_0x1bc5cc[_0x0e86('0x31')][_0x0e86('0x42')]){_0x3e9ec3[_0x0e86('0x43')]=[{'all':!![]}];}_0x3e9ec3=_[_0x0e86('0x3c')]({},_0x3e9ec3,_0x1bc5cc[_0x0e86('0x40')]);return db['Campaign'][_0x0e86('0x48')](_0x3e9ec3)['then'](handleEntityNotFound(_0x46de02,null))['then'](respondWithResult(_0x46de02,null))[_0x0e86('0x45')](handleError(_0x46de02,null));};exports[_0x0e86('0x49')]=function(_0x33de57,_0x334cc2){return db['Campaign']['create'](_0x33de57[_0x0e86('0x4a')],{})[_0x0e86('0x23')](function(_0x581add){var _0x3fcf2a=_0x33de57['user'][_0x0e86('0x25')]({'plain':!![]});if(!_0x3fcf2a)throw new Error(_0x0e86('0x4b'));if(_0x3fcf2a[_0x0e86('0x4c')]===_0x0e86('0x4d')){var _0x53e1b5=_0x581add['get']({'plain':!![]});var _0x119cf1='IvrCampaigns';return db[_0x0e86('0x4e')][_0x0e86('0x48')]({'where':{'name':_0x119cf1,'userProfileId':_0x3fcf2a[_0x0e86('0x4f')]},'raw':!![]})['then'](function(_0x3d792a){if(_0x3d792a&&_0x3d792a[_0x0e86('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x53e1b5[_0x0e86('0x29')],'resourceId':_0x53e1b5['id'],'type':_0x3d792a[_0x0e86('0x29')],'sectionId':_0x3d792a['id']},{})[_0x0e86('0x23')](function(){return _0x581add;});}else{return _0x581add;}})[_0x0e86('0x45')](function(_0x1a33b3){logger['error'](_0x0e86('0x51'),_0x1a33b3);throw _0x1a33b3;});}return _0x581add;})[_0x0e86('0x23')](respondWithResult(_0x334cc2,0xc9))[_0x0e86('0x45')](handleError(_0x334cc2,null));};exports[_0x0e86('0x52')]=function(_0xb80509,_0x42fb33){var _0x9049a3={'where':{'id':_0xb80509[_0x0e86('0x53')]['id']}},_0x5a813b={};_0x5a813b['model']=_[_0x0e86('0x47')](db['Campaign'][_0x0e86('0x2d')]);_0x9049a3[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x5a813b[_0x0e86('0x30')],qs['fields'](_0xb80509[_0x0e86('0x31')]['fields']));_0x9049a3[_0x0e86('0x34')]=_0x9049a3['attributes']['length']?_0x9049a3['attributes']:_0x5a813b[_0x0e86('0x30')];if(_0xb80509[_0x0e86('0x31')][_0x0e86('0x42')]){_0x9049a3[_0x0e86('0x43')]=[{'all':!![]}];}_0x9049a3=_[_0x0e86('0x3c')]({},_0x9049a3,_0xb80509[_0x0e86('0x40')]);return db['Campaign']['find'](_0x9049a3)['then'](handleEntityNotFound(_0x42fb33,null))[_0x0e86('0x23')](function(_0x1e220c){if(_0x1e220c){var _0x373ffc=_0x1e220c[_0x0e86('0x25')]({'plain':!![]});_0x373ffc=qs[_0x0e86('0x54')](_0x373ffc,['id',_0x0e86('0x55'),_0x0e86('0x56')]);_0xb80509[_0x0e86('0x4a')]=_[_0x0e86('0x54')](_0xb80509['body'],['id',_0x0e86('0x55'),_0x0e86('0x56')]);return db[_0x0e86('0x41')]['create'](_[_0x0e86('0x3c')](_0x373ffc,_0xb80509['body']),{'include':_0xb80509[_0x0e86('0x31')][_0x0e86('0x42')]?[{'all':!![]}]:undefined})[_0x0e86('0x23')](function(_0x3b3ba2){var _0x370ca6=_0xb80509[_0x0e86('0x4d')][_0x0e86('0x25')]({'plain':!![]});if(!_0x370ca6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x370ca6[_0x0e86('0x4c')]===_0x0e86('0x4d')){var _0x3424fa=_0x3b3ba2[_0x0e86('0x25')]({'plain':!![]});var _0x86558c=_0x0e86('0x26');return db[_0x0e86('0x4e')][_0x0e86('0x48')]({'where':{'name':_0x86558c,'userProfileId':_0x370ca6[_0x0e86('0x4f')]},'raw':!![]})[_0x0e86('0x23')](function(_0x3d6b76){if(_0x3d6b76&&_0x3d6b76[_0x0e86('0x50')]===0x0){return db['UserProfileResource'][_0x0e86('0x49')]({'name':_0x3424fa['name'],'resourceId':_0x3424fa['id'],'type':_0x3d6b76[_0x0e86('0x29')],'sectionId':_0x3d6b76['id']},{})[_0x0e86('0x23')](function(){return _0x3b3ba2;});}else{return _0x3b3ba2;}})[_0x0e86('0x45')](function(_0x57ee43){logger[_0x0e86('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57ee43);throw _0x57ee43;});}return _0x3b3ba2;});}})[_0x0e86('0x23')](respondWithResult(_0x42fb33,0xc9))[_0x0e86('0x45')](handleError(_0x42fb33,null));};exports[_0x0e86('0x22')]=function(_0x379a7a,_0x259cc3){if(_0x379a7a[_0x0e86('0x4a')]['id']){delete _0x379a7a[_0x0e86('0x4a')]['id'];}return db['Campaign'][_0x0e86('0x48')]({'where':{'id':_0x379a7a[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x259cc3,null))['then'](saveUpdates(_0x379a7a[_0x0e86('0x4a')],null))[_0x0e86('0x23')](respondWithResult(_0x259cc3,null))[_0x0e86('0x45')](handleError(_0x259cc3,null));};exports[_0x0e86('0x24')]=function(_0x5e3626,_0x269bab){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x5e3626[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x269bab,null))['then'](removeEntity(_0x269bab,null))[_0x0e86('0x45')](handleError(_0x269bab,null));};exports[_0x0e86('0x58')]=function(_0x14a450,_0x2e437e,_0x4b9264){var _0x492c74={'raw':!![],'where':{}};var _0x204ed0={};var _0x2ac63f={'count':0x0,'rows':[]};return db[_0x0e86('0x41')][_0x0e86('0x59')]({'where':{'id':_0x14a450[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x2e437e,null))[_0x0e86('0x23')](function(_0x2d8d2e){if(_0x2d8d2e){_0x204ed0[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopper'][_0x0e86('0x2d')]);_0x204ed0[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x14a450[_0x0e86('0x31')]);_0x204ed0[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x204ed0[_0x0e86('0x30')],_0x204ed0['query']);_0x492c74[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x204ed0[_0x0e86('0x30')],qs['fields'](_0x14a450[_0x0e86('0x31')]['fields']));_0x492c74[_0x0e86('0x34')]=_0x492c74[_0x0e86('0x34')][_0x0e86('0x36')]?_0x492c74[_0x0e86('0x34')]:_0x204ed0['model'];if(!_0x14a450['query'][_0x0e86('0x37')](_0x0e86('0x38'))){_0x492c74[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x14a450['query'][_0x0e86('0x1b')]);_0x492c74[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x14a450['query'][_0x0e86('0x19')]);}_0x492c74[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x14a450[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x492c74[_0x0e86('0x3b')]=qs['filters'](_[_0x0e86('0x5a')](_0x14a450['query'],_0x204ed0[_0x0e86('0x32')]));_0x492c74[_0x0e86('0x3b')]['CampaignId']=_0x2d8d2e['id'];if(_0x14a450[_0x0e86('0x31')]['filter']){_0x492c74[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x492c74['where'],{'$or':_[_0x0e86('0x2c')](_0x492c74['attributes'],function(_0x5ede91){var _0x4028a6={};_0x4028a6[_0x5ede91]={'$like':'%'+_0x14a450[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x4028a6;})});}_0x492c74=_['merge']({},_0x492c74,_0x14a450['options']);return db[_0x0e86('0x5b')][_0x0e86('0x1c')]({'where':_0x492c74['where']})[_0x0e86('0x23')](function(_0x474b6b){_0x2ac63f['count']=_0x474b6b;if(_0x14a450[_0x0e86('0x31')]['includeAll']){_0x492c74[_0x0e86('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x492c74);})[_0x0e86('0x23')](function(_0xec1890){_0x2ac63f[_0x0e86('0x44')]=_0xec1890;return _0x2ac63f;});}})['then'](respondWithFilteredResult(_0x2e437e,_0x492c74))['catch'](handleError(_0x2e437e,null));};exports[_0x0e86('0x5c')]=function(_0x2b8ecc,_0x1de61f,_0x2a51ee){var _0x595dab={'raw':!![],'where':{}};var _0x575a0c={};var _0x5211d6={'count':0x0,'rows':[]};return db[_0x0e86('0x41')][_0x0e86('0x59')]({'where':{'id':_0x2b8ecc['params']['id']}})['then'](handleEntityNotFound(_0x1de61f,null))[_0x0e86('0x23')](function(_0x3d52e5){if(_0x3d52e5){_0x575a0c[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopperHistory'][_0x0e86('0x2d')]);_0x575a0c[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x2b8ecc[_0x0e86('0x31')]);_0x575a0c['filters']=_[_0x0e86('0x33')](_0x575a0c['model'],_0x575a0c['query']);_0x595dab[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x575a0c[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x2b8ecc[_0x0e86('0x31')]['fields']));_0x595dab[_0x0e86('0x34')]=_0x595dab[_0x0e86('0x34')][_0x0e86('0x36')]?_0x595dab[_0x0e86('0x34')]:_0x575a0c[_0x0e86('0x30')];if(!_0x2b8ecc['query'][_0x0e86('0x37')](_0x0e86('0x38'))){_0x595dab[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x595dab[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x19')]);}_0x595dab[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x595dab['where']=qs['filters'](_[_0x0e86('0x5a')](_0x2b8ecc[_0x0e86('0x31')],_0x575a0c[_0x0e86('0x32')]));_0x595dab[_0x0e86('0x3b')][_0x0e86('0x5d')]=_0x3d52e5['id'];if(_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x595dab[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x595dab[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x595dab['attributes'],function(_0x4ad45d){var _0x5ad0b3={};_0x5ad0b3[_0x4ad45d]={'$like':'%'+_0x2b8ecc[_0x0e86('0x31')]['filter']+'%'};return _0x5ad0b3;})});}_0x595dab=_[_0x0e86('0x3c')]({},_0x595dab,_0x2b8ecc['options']);return db[_0x0e86('0x5e')][_0x0e86('0x1c')]({'where':_0x595dab[_0x0e86('0x3b')]})['then'](function(_0x3254fb){_0x5211d6['count']=_0x3254fb;if(_0x2b8ecc['query']['includeAll']){_0x595dab['include']=[{'all':!![]}];}return db[_0x0e86('0x5e')][_0x0e86('0x5f')](_0x595dab);})[_0x0e86('0x23')](function(_0x14a189){_0x5211d6[_0x0e86('0x44')]=_0x14a189;return _0x5211d6;});}})['then'](respondWithFilteredResult(_0x1de61f,_0x595dab))['catch'](handleError(_0x1de61f,null));};exports[_0x0e86('0x60')]=function(_0x4bda62,_0x16ac42,_0x4d97f8){var _0x50818b={'raw':!![],'where':{}};var _0x573c6e={};var _0x172100={'count':0x0,'rows':[]};return db['Campaign'][_0x0e86('0x59')]({'where':{'id':_0x4bda62[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x16ac42,null))[_0x0e86('0x23')](function(_0x644f28){if(_0x644f28){_0x573c6e['model']=_[_0x0e86('0x47')](db['CmHopperFinal'][_0x0e86('0x2d')]);_0x573c6e[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x4bda62[_0x0e86('0x31')]);_0x573c6e[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x573c6e[_0x0e86('0x30')],_0x573c6e['query']);_0x50818b[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x573c6e['model'],qs[_0x0e86('0x35')](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x35')]));_0x50818b[_0x0e86('0x34')]=_0x50818b[_0x0e86('0x34')][_0x0e86('0x36')]?_0x50818b['attributes']:_0x573c6e[_0x0e86('0x30')];if(!_0x4bda62['query']['hasOwnProperty'](_0x0e86('0x38'))){_0x50818b[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x50818b['offset']=qs['offset'](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x19')]);}_0x50818b[_0x0e86('0x39')]=qs['sort'](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x50818b[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_['pick'](_0x4bda62[_0x0e86('0x31')],_0x573c6e[_0x0e86('0x32')]));_0x50818b[_0x0e86('0x3b')][_0x0e86('0x5d')]=_0x644f28['id'];if(_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x50818b['where']=_[_0x0e86('0x3c')](_0x50818b['where'],{'$or':_[_0x0e86('0x2c')](_0x50818b[_0x0e86('0x34')],function(_0x1c99f4){var _0x1be099={};_0x1be099[_0x1c99f4]={'$like':'%'+_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x1be099;})});}_0x50818b=_[_0x0e86('0x3c')]({},_0x50818b,_0x4bda62[_0x0e86('0x40')]);return db[_0x0e86('0x61')]['count']({'where':_0x50818b['where']})[_0x0e86('0x23')](function(_0x1a3ef2){_0x172100[_0x0e86('0x1c')]=_0x1a3ef2;if(_0x4bda62[_0x0e86('0x31')][_0x0e86('0x42')]){_0x50818b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x50818b);})[_0x0e86('0x23')](function(_0x2532f6){_0x172100[_0x0e86('0x44')]=_0x2532f6;return _0x172100;});}})[_0x0e86('0x23')](respondWithFilteredResult(_0x16ac42,_0x50818b))['catch'](handleError(_0x16ac42,null));};exports['getHopperBlacks']=function(_0x3e64a8,_0x2cd55f,_0x152961){var _0x2ae260={'raw':!![],'where':{}};var _0x108a0c={};var _0x506230={'count':0x0,'rows':[]};return db[_0x0e86('0x41')]['findOne']({'where':{'id':_0x3e64a8['params']['id']}})['then'](handleEntityNotFound(_0x2cd55f,null))[_0x0e86('0x23')](function(_0x68fb2a){if(_0x68fb2a){_0x108a0c[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopperBlack'][_0x0e86('0x2d')]);_0x108a0c[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x3e64a8['query']);_0x108a0c['filters']=_[_0x0e86('0x33')](_0x108a0c[_0x0e86('0x30')],_0x108a0c[_0x0e86('0x31')]);_0x2ae260[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x108a0c[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x35')]));_0x2ae260[_0x0e86('0x34')]=_0x2ae260[_0x0e86('0x34')][_0x0e86('0x36')]?_0x2ae260[_0x0e86('0x34')]:_0x108a0c[_0x0e86('0x30')];if(!_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x2ae260[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x2ae260[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x3e64a8['query'][_0x0e86('0x19')]);}_0x2ae260['order']=qs[_0x0e86('0x3a')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x2ae260['where']=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x3e64a8[_0x0e86('0x31')],_0x108a0c['filters']));_0x2ae260['where'][_0x0e86('0x5d')]=_0x68fb2a['id'];if(_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x2ae260[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x2ae260['where'],{'$or':_[_0x0e86('0x2c')](_0x2ae260[_0x0e86('0x34')],function(_0x1662ad){var _0x6318ad={};_0x6318ad[_0x1662ad]={'$like':'%'+_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x6318ad;})});}_0x2ae260=_[_0x0e86('0x3c')]({},_0x2ae260,_0x3e64a8['options']);return db[_0x0e86('0x62')][_0x0e86('0x1c')]({'where':_0x2ae260['where']})[_0x0e86('0x23')](function(_0x2cd3d4){_0x506230[_0x0e86('0x1c')]=_0x2cd3d4;if(_0x3e64a8[_0x0e86('0x31')]['includeAll']){_0x2ae260[_0x0e86('0x43')]=[{'all':!![]}];}return db[_0x0e86('0x62')][_0x0e86('0x5f')](_0x2ae260);})[_0x0e86('0x23')](function(_0x806099){_0x506230[_0x0e86('0x44')]=_0x806099;return _0x506230;});}})[_0x0e86('0x23')](respondWithFilteredResult(_0x2cd55f,_0x2ae260))[_0x0e86('0x45')](handleError(_0x2cd55f,null));};exports[_0x0e86('0x63')]=function(_0x5dc45d,_0x5a52f6,_0x40741c){var _0x49064c={};var _0x3270e5={};var _0x1f3d5b;var _0x2a74e4;return db[_0x0e86('0x41')]['findOne']({'where':{'id':_0x5dc45d[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x5a52f6,null))[_0x0e86('0x23')](function(_0x2c7653){if(_0x2c7653){_0x1f3d5b=_0x2c7653;_0x3270e5[_0x0e86('0x30')]=_[_0x0e86('0x47')](db[_0x0e86('0x64')]['rawAttributes']);_0x3270e5[_0x0e86('0x31')]=_['keys'](_0x5dc45d['query']);_0x3270e5[_0x0e86('0x32')]=_['intersection'](_0x3270e5['model'],_0x3270e5[_0x0e86('0x31')]);_0x49064c[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x3270e5[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x35')]));_0x49064c[_0x0e86('0x34')]=_0x49064c[_0x0e86('0x34')]['length']?_0x49064c[_0x0e86('0x34')]:_0x3270e5[_0x0e86('0x30')];_0x49064c['order']=qs[_0x0e86('0x3a')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x49064c[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x5dc45d[_0x0e86('0x31')],_0x3270e5[_0x0e86('0x32')]));if(_0x5dc45d['query'][_0x0e86('0x3f')]){_0x49064c['where']=_[_0x0e86('0x3c')](_0x49064c[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x49064c[_0x0e86('0x34')],function(_0x419088){var _0x2adef6={};_0x2adef6[_0x419088]={'$like':'%'+_0x5dc45d['query'][_0x0e86('0x3f')]+'%'};return _0x2adef6;})});}_0x49064c=_['merge']({},_0x49064c,_0x5dc45d['options']);return _0x1f3d5b[_0x0e86('0x63')](_0x49064c);}})[_0x0e86('0x23')](function(_0x5754f2){if(_0x5754f2){_0x2a74e4=_0x5754f2['length'];if(!_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x49064c[_0x0e86('0x1b')]=qs['limit'](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x49064c['offset']=qs[_0x0e86('0x19')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x19')]);}return _0x1f3d5b[_0x0e86('0x63')](_0x49064c);}})[_0x0e86('0x23')](function(_0x4fc66f){if(_0x4fc66f){return _0x4fc66f?{'count':_0x2a74e4,'rows':_0x4fc66f}:null;}})[_0x0e86('0x23')](respondWithResult(_0x5a52f6,null))[_0x0e86('0x45')](handleError(_0x5a52f6,null));};exports[_0x0e86('0x65')]=function(_0x18fc81,_0xd776db,_0x361a09){var _0x634087,_0x29051c;var _0xd3638f=[];var _0x19fe5d=moment()['format'](_0x0e86('0x66'));return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x18fc81['params']['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0xd776db,null))['then'](function(_0x89b797){if(_0x89b797){_0x29051c=_0x89b797;return _0x89b797[_0x0e86('0x65')](_0x18fc81['body'][_0x0e86('0x67')],_['omit'](_0x18fc81[_0x0e86('0x4a')],[_0x0e86('0x67'),'id'])||{});}return null;})[_0x0e86('0x68')](function(_0x2b21c5){var _0x4ca95c;var _0x4d46d7;_0x634087=_0x2b21c5||[];var _0x1379a3=[];if(_0x2b21c5){for(var _0x4866cc=0x0;_0x4866cc<_0x2b21c5[_0x0e86('0x36')];_0x4866cc+=0x1){var _0xdc8a00=_0x2b21c5[_0x4866cc][_0x0e86('0x25')]({'plain':!![]});_0x29051c[_0x0e86('0x69')]=_0x18fc81[_0x0e86('0x4a')][_0x0e86('0x69')]?_0x18fc81[_0x0e86('0x4a')][_0x0e86('0x69')]:_0x29051c[_0x0e86('0x69')];switch(_0x29051c[_0x0e86('0x69')]){case _0x0e86('0x6a'):_0x4ca95c=squel[_0x0e86('0x6b')]()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'scheduledAt',_0x0e86('0x70'),_0x0e86('0x71'),'CampaignId',_0x0e86('0x55'),_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),'phone')['field'](_0x0e86('0x73'),_0x0e86('0x74'))['field']('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')](),_0x0e86('0x71'))[_0x0e86('0x72')](_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')](),_0x0e86('0x5d'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')]('cm_contacts')[_0x0e86('0x3b')](_0x0e86('0x78'))[_0x0e86('0x3b')]('ListId\x20=\x20?',_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x79'))[_0x0e86('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7b'))[_0x0e86('0x77')](_0x0e86('0x7c'))['where'](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')]()))[_0x0e86('0x3b')](_0x0e86('0x7e'),squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7f'))[_0x0e86('0x77')](_0x0e86('0x6d'))[_0x0e86('0x3b')](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')]())))[_0x0e86('0x76')]();break;case _0x0e86('0x80'):_0x4ca95c=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),_0x0e86('0x74'),_0x0e86('0x70'),_0x0e86('0x71'),_0x0e86('0x5d'),_0x0e86('0x55'),_0x0e86('0x56')],squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')](_0x0e86('0x73'),_0x0e86('0x74'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')](),_0x0e86('0x71'))['field'](_0x18fc81[_0x0e86('0x53')]['id']['toString'](),_0x0e86('0x5d'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27','createdAt')[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27','updatedAt')[_0x0e86('0x77')](_0x0e86('0x81'))['where']('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0xdc8a00[_0x0e86('0x75')]['toString']())[_0x0e86('0x3b')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7f'))['from'](_0x0e86('0x6d'))[_0x0e86('0x3b')](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id']['toString']())))[_0x0e86('0x76')]();break;default:_0x4ca95c=squel[_0x0e86('0x6b')]()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'scheduledAt','ContactId',_0x0e86('0x71'),'CampaignId',_0x0e86('0x55'),_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')](_0x0e86('0x73'),_0x0e86('0x74'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00['CmListId']['toString'](),_0x0e86('0x71'))['field'](_0x18fc81['params']['id']['toString'](),_0x0e86('0x5d'))['field']('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))['field']('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')](_0x0e86('0x81'))[_0x0e86('0x3b')]('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())['where'](_0x0e86('0x79')))[_0x0e86('0x76')]();}_0x4d46d7=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x83'))[_0x0e86('0x6e')]([_0x0e86('0x84'),_0x0e86('0x74'),'phone',_0x0e86('0x85'),'createdAt',_0x0e86('0x56')],squel[_0x0e86('0x7a')]()['field']('h.id','id')[_0x0e86('0x72')]('NOW()',_0x0e86('0x74'))[_0x0e86('0x72')](_0x0e86('0x86'),_0x0e86('0x6f'))[_0x0e86('0x72')]('ci.OrderBY',_0x0e86('0x85'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')](_0x0e86('0x87'),'ci')['join']('cm_hopper','h',_0x0e86('0x88'))[_0x0e86('0x3b')](_0x0e86('0x89'),_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x8a'),_0x18fc81['params']['id'][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x8b'),_0x19fe5d))[_0x0e86('0x76')]();_0x1379a3[_0x0e86('0x8c')](db[_0x0e86('0x8d')]['query'](_0x4ca95c));_0xd3638f[_0x0e86('0x8c')](db['sequelize']['query'](_0x4d46d7));}return BPromise[_0x0e86('0x8e')](_0x1379a3);}})['then'](function(){return BPromise[_0x0e86('0x8e')](_0xd3638f);})[_0x0e86('0x23')](function(){return _0x634087;})['then'](respondWithResult(_0xd776db,null))[_0x0e86('0x45')](handleError(_0xd776db,null));};exports[_0x0e86('0x8f')]=function(_0x33134e,_0x36011d,_0x2fc9f2){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x33134e[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x36011d,null))['then'](function(_0x1d03d7){if(_0x1d03d7){return _0x1d03d7[_0x0e86('0x8f')](_0x33134e[_0x0e86('0x31')][_0x0e86('0x67')]);}})[_0x0e86('0x23')](function(_0x5e07a3){if(_0x5e07a3){return db['CmHopper'][_0x0e86('0x24')]({'where':{'ListId':_0x33134e['query'][_0x0e86('0x67')],'CampaignId':_0x33134e[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](function(){return _0x5e07a3;});}})[_0x0e86('0x23')](respondWithStatusCode(_0x36011d,null))[_0x0e86('0x45')](handleError(_0x36011d,null));};exports[_0x0e86('0x90')]=function(_0x580138,_0xb36335,_0x8aa5d){var _0x2d52af={};var _0xe18336={};var _0x43123f;var _0x52442d;return db['Campaign'][_0x0e86('0x59')]({'where':{'id':_0x580138[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0xb36335,null))[_0x0e86('0x23')](function(_0x536ed9){if(_0x536ed9){_0x43123f=_0x536ed9;_0xe18336['model']=_[_0x0e86('0x47')](db[_0x0e86('0x64')]['rawAttributes']);_0xe18336[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x580138[_0x0e86('0x31')]);_0xe18336[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0xe18336[_0x0e86('0x30')],_0xe18336[_0x0e86('0x31')]);_0x2d52af['attributes']=_[_0x0e86('0x33')](_0xe18336['model'],qs[_0x0e86('0x35')](_0x580138['query'][_0x0e86('0x35')]));_0x2d52af['attributes']=_0x2d52af[_0x0e86('0x34')][_0x0e86('0x36')]?_0x2d52af[_0x0e86('0x34')]:_0xe18336[_0x0e86('0x30')];_0x2d52af[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x580138[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x2d52af[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x580138['query'],_0xe18336[_0x0e86('0x32')]));if(_0x580138[_0x0e86('0x31')]['filter']){_0x2d52af[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x2d52af[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x2d52af[_0x0e86('0x34')],function(_0x1df37c){var _0x1f1486={};_0x1f1486[_0x1df37c]={'$like':'%'+_0x580138['query'][_0x0e86('0x3f')]+'%'};return _0x1f1486;})});}_0x2d52af=_[_0x0e86('0x3c')]({},_0x2d52af,_0x580138[_0x0e86('0x40')]);return _0x43123f[_0x0e86('0x90')](_0x2d52af);}})[_0x0e86('0x23')](function(_0x427d8c){if(_0x427d8c){_0x52442d=_0x427d8c[_0x0e86('0x36')];if(!_0x580138[_0x0e86('0x31')][_0x0e86('0x37')]('nolimit')){_0x2d52af['limit']=qs[_0x0e86('0x1b')](_0x580138[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x2d52af['offset']=qs[_0x0e86('0x19')](_0x580138[_0x0e86('0x31')]['offset']);}return _0x43123f[_0x0e86('0x90')](_0x2d52af);}})[_0x0e86('0x23')](function(_0x5544cd){if(_0x5544cd){return _0x5544cd?{'count':_0x52442d,'rows':_0x5544cd}:null;}})['then'](respondWithResult(_0xb36335,null))[_0x0e86('0x45')](handleError(_0xb36335,null));};exports['addBlackLists']=function(_0x342522,_0x369a02,_0x1564e3){var _0x4e3bc0,_0x5ddc03;var _0x470a96=[];var _0x1dfe5f=moment()[_0x0e86('0x91')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x0e86('0x41')]['find']({'where':{'id':_0x342522[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x369a02,null))[_0x0e86('0x23')](function(_0x3b8ad0){if(_0x3b8ad0){_0x5ddc03=_0x3b8ad0;return _0x3b8ad0['addBlackLists'](_0x342522['body'][_0x0e86('0x67')],_['omit'](_0x342522[_0x0e86('0x4a')],[_0x0e86('0x67'),'id'])||{});}return null;})[_0x0e86('0x68')](function(_0x5a557a){var _0x4d9f1e;var _0x175419;_0x4e3bc0=_0x5a557a||[];var _0x1e9950=[];if(_0x5a557a){for(var _0x4e3bcb=0x0;_0x4e3bcb<_0x5a557a['length'];_0x4e3bcb+=0x1){var _0x496260=_0x5a557a[_0x4e3bcb][_0x0e86('0x25')]({'plain':!![]});_0x4d9f1e=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x92'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'ContactId',_0x0e86('0x71'),_0x0e86('0x5d'),'createdAt',_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0x496260['CmListId']['toString'](),_0x0e86('0x71'))[_0x0e86('0x72')](_0x342522['params']['id']['toString'](),_0x0e86('0x5d'))['field']('NOW()',_0x0e86('0x55'))[_0x0e86('0x72')]('NOW()',_0x0e86('0x56'))['from'](_0x0e86('0x81'))['where']('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0x496260[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x79')))['toString']();_0x1e9950['push'](db['sequelize'][_0x0e86('0x31')](_0x4d9f1e));}return BPromise['all'](_0x1e9950);}})[_0x0e86('0x23')](function(){return _0x4e3bc0;})[_0x0e86('0x23')](respondWithResult(_0x369a02,null))[_0x0e86('0x45')](handleError(_0x369a02,null));};exports['removeBlackLists']=function(_0x33c463,_0x56cd27,_0x51dc39){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x33c463['params']['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x56cd27,null))[_0x0e86('0x23')](function(_0x2d4e0c){if(_0x2d4e0c){return _0x2d4e0c[_0x0e86('0x93')](_0x33c463['query'][_0x0e86('0x67')]);}})[_0x0e86('0x23')](function(_0x468f4e){if(_0x468f4e){return db['CmHopperBlack'][_0x0e86('0x24')]({'where':{'ListId':_0x33c463['query'][_0x0e86('0x67')],'CampaignId':_0x33c463['params']['id']}})['then'](function(){return _0x468f4e;});}})[_0x0e86('0x23')](respondWithStatusCode(_0x56cd27,null))['catch'](handleError(_0x56cd27,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 8b09e3b..1fbde59 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x92bc95,_0x2dbcc0){var _0x1d671e=function(_0x44546e){while(--_0x44546e){_0x92bc95['push'](_0x92bc95['shift']());}};_0x1d671e(++_0x2dbcc0);}(_0x7a54,0x106));var _0x47a5=function(_0x448828,_0x4b707e){_0x448828=_0x448828-0x0;var _0x621426=_0x7a54[_0x448828];return _0x621426;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index ce89f06..372f1d5 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 _0x0cfa=['options','where','attributes','limit','model','map','include','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','findAll'];(function(_0x26bed1,_0x125f99){var _0xd51e7=function(_0x2d1587){while(--_0x2d1587){_0x26bed1['push'](_0x26bed1['shift']());}};_0xd51e7(++_0x125f99);}(_0x0cfa,0x18f));var _0xa0cf=function(_0x3eb136,_0x1b3bce){_0x3eb136=_0x3eb136-0x0;var _0x382594=_0x0cfa[_0x3eb136];return _0x382594;};'use strict';var _=require(_0xa0cf('0x0'));var util=require(_0xa0cf('0x1'));var moment=require(_0xa0cf('0x2'));var BPromise=require(_0xa0cf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa0cf('0x4'));var logger=require('../../config/logger')(_0xa0cf('0x5'));var config=require(_0xa0cf('0x6'));var jayson=require(_0xa0cf('0x7'));var client=jayson[_0xa0cf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27eb15,_0x5d9035,_0x232245){return new BPromise(function(_0x5f0054,_0xdee9d7){return client['request'](_0x27eb15,_0x232245)[_0xa0cf('0x9')](function(_0xaf7216){logger[_0xa0cf('0xa')]('Campaign,\x20%s,\x20%s',_0x5d9035,_0xa0cf('0xb'));logger[_0xa0cf('0xc')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5d9035,'request\x20sent',JSON[_0xa0cf('0xd')](_0xaf7216));if(_0xaf7216[_0xa0cf('0xe')]){if(_0xaf7216[_0xa0cf('0xe')]['code']===0x1f4){logger[_0xa0cf('0xe')](_0xa0cf('0xf'),_0x5d9035,_0xaf7216[_0xa0cf('0xe')][_0xa0cf('0x10')]);return _0xdee9d7(_0xaf7216[_0xa0cf('0xe')][_0xa0cf('0x10')]);}logger[_0xa0cf('0xe')]('Campaign,\x20%s,\x20%s',_0x5d9035,_0xaf7216[_0xa0cf('0xe')][_0xa0cf('0x10')]);return _0x5f0054(_0xaf7216[_0xa0cf('0xe')]['message']);}else{logger[_0xa0cf('0xa')](_0xa0cf('0xf'),_0x5d9035,_0xa0cf('0xb'));_0x5f0054(_0xaf7216[_0xa0cf('0x11')][_0xa0cf('0x10')]);}})['catch'](function(_0x19e263){logger[_0xa0cf('0xe')]('Campaign,\x20%s,\x20%s',_0x5d9035,_0x19e263);_0xdee9d7(_0x19e263);});});}exports[_0xa0cf('0x12')]=function(_0x36c524){var _0x53a186=this;return new Promise(function(_0x112ced,_0x175727){return db[_0xa0cf('0x13')][_0xa0cf('0x14')]({'raw':_0x36c524[_0xa0cf('0x15')]?_0x36c524[_0xa0cf('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x36c524[_0xa0cf('0x15')]?_0x36c524[_0xa0cf('0x15')][_0xa0cf('0x16')]||null:null,'attributes':_0x36c524[_0xa0cf('0x15')]?_0x36c524[_0xa0cf('0x15')][_0xa0cf('0x17')]||null:null,'limit':_0x36c524[_0xa0cf('0x15')]?_0x36c524[_0xa0cf('0x15')][_0xa0cf('0x18')]||null:null,'include':_0x36c524[_0xa0cf('0x15')]?_0x36c524[_0xa0cf('0x15')]['include']?_['map'](_0x36c524['options']['include'],function(_0x574085){return{'model':db[_0x574085[_0xa0cf('0x19')]],'as':_0x574085['as'],'attributes':_0x574085[_0xa0cf('0x17')],'include':_0x574085['include']?_[_0xa0cf('0x1a')](_0x574085[_0xa0cf('0x1b')],function(_0xeb9af){return{'model':db[_0xeb9af[_0xa0cf('0x19')]],'as':_0xeb9af['as'],'attributes':_0xeb9af['attributes'],'include':_0xeb9af[_0xa0cf('0x1b')]?_[_0xa0cf('0x1a')](_0xeb9af['include'],function(_0x543c66){return{'model':db[_0x543c66[_0xa0cf('0x19')]],'as':_0x543c66['as'],'attributes':_0x543c66[_0xa0cf('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa0cf('0x9')](function(_0x3d78f0){logger[_0xa0cf('0xa')](_0xa0cf('0x12'),_0x36c524);logger['debug']('GetCampaign',_0x36c524,JSON[_0xa0cf('0xd')](_0x3d78f0));_0x112ced(_0x3d78f0);})['catch'](function(_0xd627d){logger[_0xa0cf('0xe')](_0xa0cf('0x12'),_0xd627d[_0xa0cf('0x10')],_0x36c524);_0x175727(_0x53a186['error'](0x1f4,_0xd627d[_0xa0cf('0x10')]));});});};
\ No newline at end of file
+var _0xc737=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','request\x20sent','debug','error','code','Campaign,\x20%s,\x20%s','message','result','catch','Campaign','findAll','options','where','limit','include','map','model','attributes','GetCampaign','stringify','lodash'];(function(_0x46ed84,_0x53381a){var _0x480b36=function(_0x158137){while(--_0x158137){_0x46ed84['push'](_0x46ed84['shift']());}};_0x480b36(++_0x53381a);}(_0xc737,0x154));var _0x7c73=function(_0x469590,_0x17dbf8){_0x469590=_0x469590-0x0;var _0x3d81a8=_0xc737[_0x469590];return _0x3d81a8;};'use strict';var _=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var moment=require(_0x7c73('0x2'));var BPromise=require(_0x7c73('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c73('0x4'));var db=require(_0x7c73('0x5'))['db'];var utils=require(_0x7c73('0x6'));var logger=require('../../config/logger')(_0x7c73('0x7'));var config=require(_0x7c73('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f6f81,_0x57e442,_0x9264a9){return new BPromise(function(_0x3281fe,_0x5bf225){return client['request'](_0x3f6f81,_0x9264a9)[_0x7c73('0xa')](function(_0x8237f){logger[_0x7c73('0xb')]('Campaign,\x20%s,\x20%s',_0x57e442,_0x7c73('0xc'));logger[_0x7c73('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x57e442,_0x7c73('0xc'),JSON['stringify'](_0x8237f));if(_0x8237f[_0x7c73('0xe')]){if(_0x8237f[_0x7c73('0xe')][_0x7c73('0xf')]===0x1f4){logger['error'](_0x7c73('0x10'),_0x57e442,_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);return _0x5bf225(_0x8237f[_0x7c73('0xe')]['message']);}logger[_0x7c73('0xe')]('Campaign,\x20%s,\x20%s',_0x57e442,_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);return _0x3281fe(_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);}else{logger[_0x7c73('0xb')](_0x7c73('0x10'),_0x57e442,_0x7c73('0xc'));_0x3281fe(_0x8237f[_0x7c73('0x12')]['message']);}})[_0x7c73('0x13')](function(_0x562b50){logger[_0x7c73('0xe')](_0x7c73('0x10'),_0x57e442,_0x562b50);_0x5bf225(_0x562b50);});});}exports['GetCampaign']=function(_0x534a39){var _0x1932c2=this;return new Promise(function(_0x4a2ebc,_0x5cc261){return db[_0x7c73('0x14')][_0x7c73('0x15')]({'raw':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')][_0x7c73('0x17')]||null:null,'attributes':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')]['attributes']||null:null,'limit':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')][_0x7c73('0x18')]||null:null,'include':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')][_0x7c73('0x19')]?_[_0x7c73('0x1a')](_0x534a39[_0x7c73('0x16')][_0x7c73('0x19')],function(_0x4c8933){return{'model':db[_0x4c8933[_0x7c73('0x1b')]],'as':_0x4c8933['as'],'attributes':_0x4c8933['attributes'],'include':_0x4c8933[_0x7c73('0x19')]?_['map'](_0x4c8933[_0x7c73('0x19')],function(_0x57dd84){return{'model':db[_0x57dd84[_0x7c73('0x1b')]],'as':_0x57dd84['as'],'attributes':_0x57dd84['attributes'],'include':_0x57dd84[_0x7c73('0x19')]?_[_0x7c73('0x1a')](_0x57dd84[_0x7c73('0x19')],function(_0x5b8bc9){return{'model':db[_0x5b8bc9[_0x7c73('0x1b')]],'as':_0x5b8bc9['as'],'attributes':_0x5b8bc9[_0x7c73('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7c73('0xa')](function(_0x5ad41e){logger[_0x7c73('0xb')](_0x7c73('0x1d'),_0x534a39);logger[_0x7c73('0xd')](_0x7c73('0x1d'),_0x534a39,JSON[_0x7c73('0x1e')](_0x5ad41e));_0x4a2ebc(_0x5ad41e);})[_0x7c73('0x13')](function(_0x5800eb){logger['error']('GetCampaign',_0x5800eb[_0x7c73('0x11')],_0x534a39);_0x5cc261(_0x1932c2[_0x7c73('0xe')](0x1f4,_0x5800eb[_0x7c73('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 78f5d7a..d14f4f2 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 _0x463e=['/:id/clone','clone','addBlackLists','delete','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getBlackLists','post'];(function(_0x43d214,_0x129225){var _0x48798e=function(_0x4ac6a8){while(--_0x4ac6a8){_0x43d214['push'](_0x43d214['shift']());}};_0x48798e(++_0x129225);}(_0x463e,0x1d6));var _0xe463=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x463e[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0xe463('0x0'));var util=require(_0xe463('0x1'));var path=require(_0xe463('0x2'));var timeout=require(_0xe463('0x3'));var express=require(_0xe463('0x4'));var router=express[_0xe463('0x5')]();var fs_extra=require(_0xe463('0x6'));var auth=require(_0xe463('0x7'));var interaction=require(_0xe463('0x8'));var config=require(_0xe463('0x9'));var controller=require(_0xe463('0xa'));router[_0xe463('0xb')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe463('0xc'),auth[_0xe463('0xd')](),controller[_0xe463('0xe')]);router[_0xe463('0xb')](_0xe463('0xf'),auth[_0xe463('0xd')](),controller['getHoppers']);router[_0xe463('0xb')]('/:id/hopper_histories',auth[_0xe463('0xd')](),controller[_0xe463('0x10')]);router[_0xe463('0xb')](_0xe463('0x11'),auth[_0xe463('0xd')](),controller[_0xe463('0x12')]);router[_0xe463('0xb')](_0xe463('0x13'),auth[_0xe463('0xd')](),controller['getHopperBlacks']);router[_0xe463('0xb')](_0xe463('0x14'),auth[_0xe463('0xd')](),controller['getLists']);router[_0xe463('0xb')]('/:id/blacklists',auth[_0xe463('0xd')](),controller[_0xe463('0x15')]);router[_0xe463('0x16')]('/',auth[_0xe463('0xd')](),controller['create']);router[_0xe463('0x16')](_0xe463('0x17'),auth[_0xe463('0xd')](),controller[_0xe463('0x18')]);router[_0xe463('0x16')](_0xe463('0x14'),auth[_0xe463('0xd')](),controller['addLists']);router[_0xe463('0x16')]('/:id/blacklists',auth[_0xe463('0xd')](),controller[_0xe463('0x19')]);router['put'](_0xe463('0xc'),auth[_0xe463('0xd')](),controller['update']);router[_0xe463('0x1a')]('/:id',auth[_0xe463('0xd')](),controller['destroy']);router[_0xe463('0x1a')](_0xe463('0x14'),auth[_0xe463('0xd')](),controller[_0xe463('0x1b')]);router[_0xe463('0x1a')]('/:id/blacklists',auth[_0xe463('0xd')](),controller[_0xe463('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xa67b=['get','/:id','show','/:id/hoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','clone','addBlackLists','put','update','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index'];(function(_0x5b64a4,_0x1eccd2){var _0x47c20c=function(_0x1b436f){while(--_0x1b436f){_0x5b64a4['push'](_0x5b64a4['shift']());}};_0x47c20c(++_0x1eccd2);}(_0xa67b,0x14a));var _0xba67=function(_0x3d2c5d,_0x26033c){_0x3d2c5d=_0x3d2c5d-0x0;var _0xac8077=_0xa67b[_0x3d2c5d];return _0xac8077;};'use strict';var multer=require(_0xba67('0x0'));var util=require(_0xba67('0x1'));var path=require(_0xba67('0x2'));var timeout=require(_0xba67('0x3'));var express=require(_0xba67('0x4'));var router=express[_0xba67('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xba67('0x6'));var interaction=require(_0xba67('0x7'));var config=require('../../config/environment');var controller=require(_0xba67('0x8'));router['get']('/',auth[_0xba67('0x9')](),controller[_0xba67('0xa')]);router[_0xba67('0xb')](_0xba67('0xc'),auth[_0xba67('0x9')](),controller[_0xba67('0xd')]);router[_0xba67('0xb')](_0xba67('0xe'),auth[_0xba67('0x9')](),controller['getHoppers']);router['get'](_0xba67('0xf'),auth[_0xba67('0x9')](),controller['getHopperHistories']);router[_0xba67('0xb')](_0xba67('0x10'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0xba67('0xb')]('/:id/hopper_black',auth[_0xba67('0x9')](),controller[_0xba67('0x11')]);router[_0xba67('0xb')](_0xba67('0x12'),auth[_0xba67('0x9')](),controller[_0xba67('0x13')]);router['get'](_0xba67('0x14'),auth['isAuthenticated'](),controller[_0xba67('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xba67('0x16')]);router[_0xba67('0x17')]('/:id/clone',auth['isAuthenticated'](),controller[_0xba67('0x18')]);router['post'](_0xba67('0x12'),auth[_0xba67('0x9')](),controller['addLists']);router[_0xba67('0x17')](_0xba67('0x14'),auth[_0xba67('0x9')](),controller[_0xba67('0x19')]);router[_0xba67('0x1a')](_0xba67('0xc'),auth['isAuthenticated'](),controller[_0xba67('0x1b')]);router['delete']('/:id',auth[_0xba67('0x9')](),controller['destroy']);router[_0xba67('0x1c')](_0xba67('0x12'),auth[_0xba67('0x9')](),controller['removeLists']);router['delete'](_0xba67('0x14'),auth['isAuthenticated'](),controller[_0xba67('0x1d')]);module[_0xba67('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index fb249e5..38c2d74 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 _0x8b47=['STRING','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x4e3c75,_0x31eb83){var _0x19861e=function(_0x10daef){while(--_0x10daef){_0x4e3c75['push'](_0x4e3c75['shift']());}};_0x19861e(++_0x31eb83);}(_0x8b47,0x160));var _0x78b4=function(_0x3ee500,_0x19bcf6){_0x3ee500=_0x3ee500-0x0;var _0x223dab=_0x8b47[_0x3ee500];return _0x223dab;};'use strict';var Sequelize=require(_0x78b4('0x0'));module[_0x78b4('0x1')]={'key':{'type':Sequelize[_0x78b4('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x78b4('0x3')],'get':function(){return this[_0x78b4('0x4')](_0x78b4('0x5'));}}};
\ No newline at end of file
+var _0x0b37=['VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x22cafd,_0x3c98cc){var _0x120344=function(_0x36533a){while(--_0x36533a){_0x22cafd['push'](_0x22cafd['shift']());}};_0x120344(++_0x3c98cc);}(_0x0b37,0x1e9));var _0x70b3=function(_0x694623,_0x4dc11a){_0x694623=_0x694623-0x0;var _0x2f270e=_0x0b37[_0x694623];return _0x2f270e;};'use strict';var Sequelize=require(_0x70b3('0x0'));module[_0x70b3('0x1')]={'key':{'type':Sequelize[_0x70b3('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x70b3('0x2')]},'name':{'type':Sequelize[_0x70b3('0x3')],'get':function(){return this[_0x70b3('0x4')](_0x70b3('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index d45d009..01e020a 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 _0xad6a=['send','map','CannedAnswer','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','includeAll','findAll','rows','catch','show','params','include','update','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','destroy','get','CannedAnswers','then','name'];(function(_0x431522,_0x4a676c){var _0x56fc1e=function(_0x278d78){while(--_0x278d78){_0x431522['push'](_0x431522['shift']());}};_0x56fc1e(++_0x4a676c);}(_0xad6a,0x81));var _0xaad6=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xad6a[_0x2faddb];return _0x273c05;};'use strict';var emlformat=require(_0xaad6('0x0'));var rimraf=require(_0xaad6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaad6('0x2'));var rp=require(_0xaad6('0x3'));var moment=require('moment');var BPromise=require(_0xaad6('0x4'));var Mustache=require(_0xaad6('0x5'));var util=require(_0xaad6('0x6'));var path=require('path');var sox=require(_0xaad6('0x7'));var csv=require(_0xaad6('0x8'));var ejs=require(_0xaad6('0x9'));var fs=require('fs');var fs_extra=require(_0xaad6('0xa'));var _=require(_0xaad6('0xb'));var squel=require('squel');var crypto=require(_0xaad6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaad6('0xd'));var toCsv=require(_0xaad6('0x8'));var querystring=require(_0xaad6('0xe'));var Papa=require(_0xaad6('0xf'));var Redis=require(_0xaad6('0x10'));var authService=require(_0xaad6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaad6('0x12'));var hardwareService=require(_0xaad6('0x13'));var logger=require(_0xaad6('0x14'))(_0xaad6('0x15'));var utils=require('../../config/utils');var config=require(_0xaad6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaad6('0x17'))['db'];function respondWithStatusCode(_0x30e7ab,_0x18a67d){_0x18a67d=_0x18a67d||0xcc;return function(_0x5a3684){if(_0x5a3684){return _0x30e7ab[_0xaad6('0x18')](_0x18a67d);}return _0x30e7ab[_0xaad6('0x19')](_0x18a67d)[_0xaad6('0x1a')]();};}function respondWithResult(_0x3378f3,_0x496528){_0x496528=_0x496528||0xc8;return function(_0x10fcaa){if(_0x10fcaa){return _0x3378f3['status'](_0x496528)[_0xaad6('0x1b')](_0x10fcaa);}};}function respondWithFilteredResult(_0x65fca1,_0x50a5e1){return function(_0xf1046b){if(_0xf1046b){var _0x433997=typeof _0x50a5e1['offset']==='undefined'&&typeof _0x50a5e1[_0xaad6('0x1c')]===_0xaad6('0x1d');var _0x29519b=_0xf1046b[_0xaad6('0x1e')];var _0x327665=_0x433997?0x0:_0x50a5e1[_0xaad6('0x1f')];var _0x37471e=_0x433997?_0xf1046b[_0xaad6('0x1e')]:_0x50a5e1['offset']+_0x50a5e1[_0xaad6('0x1c')];var _0x4e7853;if(_0x37471e>=_0x29519b){_0x37471e=_0x29519b;_0x4e7853=0xc8;}else{_0x4e7853=0xce;}_0x65fca1['status'](_0x4e7853);return _0x65fca1[_0xaad6('0x20')](_0xaad6('0x21'),_0x327665+'-'+_0x37471e+'/'+_0x29519b)[_0xaad6('0x1b')](_0xf1046b);}return null;};}function patchUpdates(_0x4181f4){return function(_0x5ed91c){try{jsonpatch[_0xaad6('0x22')](_0x5ed91c,_0x4181f4,!![]);}catch(_0x2bc662){return BPromise['reject'](_0x2bc662);}return _0x5ed91c[_0xaad6('0x23')]();};}function saveUpdates(_0x507cb3,_0x711e2f){return function(_0x1449d6){if(_0x1449d6){return _0x1449d6['update'](_0x507cb3)['then'](function(_0x35e1b){return _0x35e1b;});}return null;};}function removeEntity(_0xa36707,_0x14ff08){return function(_0x4da886){if(_0x4da886){return _0x4da886[_0xaad6('0x24')]()['then'](function(){var _0x42bf2b=_0x4da886[_0xaad6('0x25')]({'plain':!![]});var _0x2ae61e=_0xaad6('0x26');return db['UserProfileResource'][_0xaad6('0x24')]({'where':{'type':_0x2ae61e,'resourceId':_0x42bf2b['id']}})[_0xaad6('0x27')](function(){return _0x4da886;});})['then'](function(){_0xa36707[_0xaad6('0x19')](0xcc)[_0xaad6('0x1a')]();});}};}function handleEntityNotFound(_0x71a939,_0xdbd761){return function(_0x2c69cf){if(!_0x2c69cf){_0x71a939[_0xaad6('0x18')](0x194);}return _0x2c69cf;};}function handleError(_0x4eef2e,_0x1eb593){_0x1eb593=_0x1eb593||0x1f4;return function(_0x5d83cd){logger['error'](_0x5d83cd['stack']);if(_0x5d83cd['name']){delete _0x5d83cd[_0xaad6('0x28')];}_0x4eef2e['status'](_0x1eb593)[_0xaad6('0x29')](_0x5d83cd);};}exports['index']=function(_0x25a6f2,_0x3770ce){var _0x4c4a69={},_0x192461={},_0x37c86b={'count':0x0,'rows':[]};var _0x356442=_[_0xaad6('0x2a')](db[_0xaad6('0x2b')]['rawAttributes'],function(_0x5d73a3){return{'name':_0x5d73a3[_0xaad6('0x2c')],'type':_0x5d73a3['type'][_0xaad6('0x2d')]};});_0x192461['model']=_[_0xaad6('0x2a')](_0x356442,_0xaad6('0x28'));_0x192461[_0xaad6('0x2e')]=_[_0xaad6('0x2f')](_0x25a6f2[_0xaad6('0x2e')]);_0x192461[_0xaad6('0x30')]=_['intersection'](_0x192461['model'],_0x192461[_0xaad6('0x2e')]);_0x4c4a69[_0xaad6('0x31')]=_[_0xaad6('0x32')](_0x192461[_0xaad6('0x33')],qs[_0xaad6('0x34')](_0x25a6f2[_0xaad6('0x2e')][_0xaad6('0x34')]));_0x4c4a69[_0xaad6('0x31')]=_0x4c4a69[_0xaad6('0x31')][_0xaad6('0x35')]?_0x4c4a69[_0xaad6('0x31')]:_0x192461['model'];if(!_0x25a6f2['query'][_0xaad6('0x36')](_0xaad6('0x37'))){_0x4c4a69[_0xaad6('0x1c')]=qs[_0xaad6('0x1c')](_0x25a6f2[_0xaad6('0x2e')][_0xaad6('0x1c')]);_0x4c4a69[_0xaad6('0x1f')]=qs['offset'](_0x25a6f2[_0xaad6('0x2e')][_0xaad6('0x1f')]);}_0x4c4a69[_0xaad6('0x38')]=qs['sort'](_0x25a6f2[_0xaad6('0x2e')][_0xaad6('0x39')]);_0x4c4a69['where']=qs[_0xaad6('0x30')](_['pick'](_0x25a6f2[_0xaad6('0x2e')],_0x192461['filters']),_0x356442);if(_0x25a6f2[_0xaad6('0x2e')][_0xaad6('0x3a')]){_0x4c4a69['where']=_[_0xaad6('0x3b')](_0x4c4a69[_0xaad6('0x3c')],{'$or':[{'key':{'$like':'%'+_0x25a6f2[_0xaad6('0x2e')][_0xaad6('0x3a')]+'%'}},{'value':{'$like':'%'+_0x25a6f2[_0xaad6('0x2e')][_0xaad6('0x3a')]+'%'}}]});}_0x4c4a69=_[_0xaad6('0x3b')]({},_0x4c4a69,_0x25a6f2['options']);var _0xec1fa2={'where':_0x4c4a69[_0xaad6('0x3c')]};return db[_0xaad6('0x2b')][_0xaad6('0x1e')](_0xec1fa2)['then'](function(_0x3a6618){_0x37c86b[_0xaad6('0x1e')]=_0x3a6618;if(_0x25a6f2[_0xaad6('0x2e')][_0xaad6('0x3d')]){_0x4c4a69['include']=[{'all':!![]}];}return db[_0xaad6('0x2b')][_0xaad6('0x3e')](_0x4c4a69);})['then'](function(_0x38b9f2){_0x37c86b[_0xaad6('0x3f')]=_0x38b9f2;return _0x37c86b;})[_0xaad6('0x27')](respondWithFilteredResult(_0x3770ce,_0x4c4a69))[_0xaad6('0x40')](handleError(_0x3770ce,null));};exports[_0xaad6('0x41')]=function(_0x5880cc,_0x2e5cb3){var _0x34f08b={'raw':!![],'where':{'id':_0x5880cc[_0xaad6('0x42')]['id']}},_0x56c9f4={};_0x56c9f4['model']=_[_0xaad6('0x2f')](db[_0xaad6('0x2b')]['rawAttributes']);_0x56c9f4[_0xaad6('0x2e')]=_[_0xaad6('0x2f')](_0x5880cc[_0xaad6('0x2e')]);_0x56c9f4[_0xaad6('0x30')]=_[_0xaad6('0x32')](_0x56c9f4[_0xaad6('0x33')],_0x56c9f4[_0xaad6('0x2e')]);_0x34f08b[_0xaad6('0x31')]=_[_0xaad6('0x32')](_0x56c9f4[_0xaad6('0x33')],qs[_0xaad6('0x34')](_0x5880cc[_0xaad6('0x2e')][_0xaad6('0x34')]));_0x34f08b[_0xaad6('0x31')]=_0x34f08b[_0xaad6('0x31')][_0xaad6('0x35')]?_0x34f08b['attributes']:_0x56c9f4[_0xaad6('0x33')];if(_0x5880cc['query'][_0xaad6('0x3d')]){_0x34f08b[_0xaad6('0x43')]=[{'all':!![]}];}_0x34f08b=_['merge']({},_0x34f08b,_0x5880cc['options']);return db[_0xaad6('0x2b')]['find'](_0x34f08b)['then'](handleEntityNotFound(_0x2e5cb3,null))[_0xaad6('0x27')](respondWithResult(_0x2e5cb3,null))['catch'](handleError(_0x2e5cb3,null));};exports[_0xaad6('0x44')]=function(_0x480364,_0x3760a9){if(_0x480364['body']['id']){delete _0x480364['body']['id'];}return db[_0xaad6('0x2b')]['find']({'where':{'id':_0x480364[_0xaad6('0x42')]['id']}})[_0xaad6('0x27')](handleEntityNotFound(_0x3760a9,null))[_0xaad6('0x27')](saveUpdates(_0x480364[_0xaad6('0x45')],null))[_0xaad6('0x27')](respondWithResult(_0x3760a9,null))['catch'](handleError(_0x3760a9,null));};exports[_0xaad6('0x24')]=function(_0x2aa76f,_0x19f692){return db[_0xaad6('0x2b')][_0xaad6('0x46')]({'where':{'id':_0x2aa76f[_0xaad6('0x42')]['id']}})[_0xaad6('0x27')](handleEntityNotFound(_0x19f692,null))[_0xaad6('0x27')](removeEntity(_0x19f692,null))[_0xaad6('0x40')](handleError(_0x19f692,null));};exports[_0xaad6('0x47')]=function(_0x1474b5,_0x34bcfe){var _0x5ab193={'key':_0x1474b5[_0xaad6('0x45')][_0xaad6('0x2d')]};if(_0x1474b5[_0xaad6('0x45')]['MailAccountId']){_0x5ab193[_0xaad6('0x48')]=_0x1474b5[_0xaad6('0x45')][_0xaad6('0x48')];}else if(_0x1474b5[_0xaad6('0x45')][_0xaad6('0x49')]){_0x5ab193[_0xaad6('0x49')]=_0x1474b5['body'][_0xaad6('0x49')];}else if(_0x1474b5[_0xaad6('0x45')][_0xaad6('0x4a')]){_0x5ab193[_0xaad6('0x4a')]=_0x1474b5[_0xaad6('0x45')]['OpenchannelAccountId'];}else if(_0x1474b5['body'][_0xaad6('0x4b')]){_0x5ab193[_0xaad6('0x4b')]=_0x1474b5[_0xaad6('0x45')][_0xaad6('0x4b')];}return db[_0xaad6('0x2b')][_0xaad6('0x46')]({'where':_0x5ab193})[_0xaad6('0x27')](function(_0x2e827d){if(_0x2e827d){throw new db[(_0xaad6('0x4c'))][(_0xaad6('0x4d'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xaad6('0x2b')][_0xaad6('0x47')](_0x1474b5['body']);})[_0xaad6('0x27')](function(_0x5ceea5){var _0x379282=_0x1474b5['user'][_0xaad6('0x25')]({'plain':!![]});if(!_0x379282)throw new Error(_0xaad6('0x4e'));if(_0x379282[_0xaad6('0x4f')]==='user'){var _0x20dfb7=_0x5ceea5[_0xaad6('0x25')]({'plain':!![]});return db['UserProfileSection'][_0xaad6('0x46')]({'where':{'name':_0xaad6('0x26'),'userProfileId':_0x379282[_0xaad6('0x50')]},'raw':!![]})['then'](function(_0x3455c1){if(_0x3455c1&&_0x3455c1[_0xaad6('0x51')]===0x0){return db[_0xaad6('0x52')][_0xaad6('0x47')]({'name':_0x20dfb7[_0xaad6('0x28')],'resourceId':_0x20dfb7['id'],'type':_0x3455c1[_0xaad6('0x28')],'sectionId':_0x3455c1['id']},{})[_0xaad6('0x27')](function(){return _0x5ceea5;});}else{return _0x5ceea5;}})[_0xaad6('0x40')](function(_0x50f061){logger[_0xaad6('0x53')](_0xaad6('0x54'),_0x50f061);throw _0x50f061;});}return _0x5ceea5;})[_0xaad6('0x27')](respondWithResult(_0x34bcfe,0xc9))[_0xaad6('0x40')](handleError(_0x34bcfe,null));};
\ No newline at end of file
+var _0x55d6=['name','send','CannedAnswer','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','options','includeAll','include','rows','params','rawAttributes','length','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','error','stack'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x55d6,0x128));var _0x655d=function(_0x142ed3,_0x4455b6){_0x142ed3=_0x142ed3-0x0;var _0x155971=_0x55d6[_0x142ed3];return _0x155971;};'use strict';var emlformat=require(_0x655d('0x0'));var rimraf=require(_0x655d('0x1'));var zipdir=require(_0x655d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x655d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x655d('0x4'));var util=require('util');var path=require(_0x655d('0x5'));var sox=require(_0x655d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x655d('0x7'));var _=require(_0x655d('0x8'));var squel=require(_0x655d('0x9'));var crypto=require('crypto');var jsforce=require(_0x655d('0xa'));var deskjs=require(_0x655d('0xb'));var toCsv=require(_0x655d('0xc'));var querystring=require(_0x655d('0xd'));var Papa=require('papaparse');var Redis=require(_0x655d('0xe'));var authService=require(_0x655d('0xf'));var qs=require(_0x655d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x655d('0x11'))(_0x655d('0x12'));var utils=require(_0x655d('0x13'));var config=require(_0x655d('0x14'));var licenseUtil=require(_0x655d('0x15'));var db=require(_0x655d('0x16'))['db'];function respondWithStatusCode(_0x16ff66,_0x54dbbf){_0x54dbbf=_0x54dbbf||0xcc;return function(_0x531745){if(_0x531745){return _0x16ff66[_0x655d('0x17')](_0x54dbbf);}return _0x16ff66[_0x655d('0x18')](_0x54dbbf)[_0x655d('0x19')]();};}function respondWithResult(_0x2f4d1f,_0x256ea6){_0x256ea6=_0x256ea6||0xc8;return function(_0x36e788){if(_0x36e788){return _0x2f4d1f[_0x655d('0x18')](_0x256ea6)['json'](_0x36e788);}};}function respondWithFilteredResult(_0x34a02a,_0x2f2a1d){return function(_0x45357a){if(_0x45357a){var _0x51b12b=typeof _0x2f2a1d[_0x655d('0x1a')]==='undefined'&&typeof _0x2f2a1d[_0x655d('0x1b')]==='undefined';var _0x5902c1=_0x45357a[_0x655d('0x1c')];var _0x44602a=_0x51b12b?0x0:_0x2f2a1d[_0x655d('0x1a')];var _0x1f2c67=_0x51b12b?_0x45357a[_0x655d('0x1c')]:_0x2f2a1d[_0x655d('0x1a')]+_0x2f2a1d[_0x655d('0x1b')];var _0x3aaf9b;if(_0x1f2c67>=_0x5902c1){_0x1f2c67=_0x5902c1;_0x3aaf9b=0xc8;}else{_0x3aaf9b=0xce;}_0x34a02a[_0x655d('0x18')](_0x3aaf9b);return _0x34a02a['set'](_0x655d('0x1d'),_0x44602a+'-'+_0x1f2c67+'/'+_0x5902c1)[_0x655d('0x1e')](_0x45357a);}return null;};}function patchUpdates(_0x955029){return function(_0x26b4de){try{jsonpatch[_0x655d('0x1f')](_0x26b4de,_0x955029,!![]);}catch(_0x14a50f){return BPromise[_0x655d('0x20')](_0x14a50f);}return _0x26b4de[_0x655d('0x21')]();};}function saveUpdates(_0x11c89e,_0x359903){return function(_0xefc4a0){if(_0xefc4a0){return _0xefc4a0[_0x655d('0x22')](_0x11c89e)[_0x655d('0x23')](function(_0x11b42d){return _0x11b42d;});}return null;};}function removeEntity(_0x25cfee,_0x587ec6){return function(_0x4cf4b8){if(_0x4cf4b8){return _0x4cf4b8[_0x655d('0x24')]()[_0x655d('0x23')](function(){var _0x5c45c5=_0x4cf4b8['get']({'plain':!![]});var _0x43b06f='CannedAnswers';return db[_0x655d('0x25')][_0x655d('0x24')]({'where':{'type':_0x43b06f,'resourceId':_0x5c45c5['id']}})[_0x655d('0x23')](function(){return _0x4cf4b8;});})[_0x655d('0x23')](function(){_0x25cfee['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a478b,_0x34284f){return function(_0x232d36){if(!_0x232d36){_0x4a478b[_0x655d('0x17')](0x194);}return _0x232d36;};}function handleError(_0x1b5aa9,_0x5c919a){_0x5c919a=_0x5c919a||0x1f4;return function(_0xf18de0){logger[_0x655d('0x26')](_0xf18de0[_0x655d('0x27')]);if(_0xf18de0['name']){delete _0xf18de0[_0x655d('0x28')];}_0x1b5aa9['status'](_0x5c919a)[_0x655d('0x29')](_0xf18de0);};}exports['index']=function(_0x103b28,_0x3279a7){var _0x1a5f3b={},_0x475c81={},_0x2cfd95={'count':0x0,'rows':[]};var _0x38ed92=_['map'](db[_0x655d('0x2a')]['rawAttributes'],function(_0x4c6b47){return{'name':_0x4c6b47[_0x655d('0x2b')],'type':_0x4c6b47[_0x655d('0x2c')][_0x655d('0x2d')]};});_0x475c81[_0x655d('0x2e')]=_[_0x655d('0x2f')](_0x38ed92,_0x655d('0x28'));_0x475c81['query']=_[_0x655d('0x30')](_0x103b28[_0x655d('0x31')]);_0x475c81['filters']=_[_0x655d('0x32')](_0x475c81['model'],_0x475c81[_0x655d('0x31')]);_0x1a5f3b[_0x655d('0x33')]=_[_0x655d('0x32')](_0x475c81['model'],qs[_0x655d('0x34')](_0x103b28[_0x655d('0x31')][_0x655d('0x34')]));_0x1a5f3b[_0x655d('0x33')]=_0x1a5f3b[_0x655d('0x33')]['length']?_0x1a5f3b['attributes']:_0x475c81[_0x655d('0x2e')];if(!_0x103b28[_0x655d('0x31')][_0x655d('0x35')](_0x655d('0x36'))){_0x1a5f3b[_0x655d('0x1b')]=qs[_0x655d('0x1b')](_0x103b28[_0x655d('0x31')][_0x655d('0x1b')]);_0x1a5f3b[_0x655d('0x1a')]=qs[_0x655d('0x1a')](_0x103b28[_0x655d('0x31')]['offset']);}_0x1a5f3b[_0x655d('0x37')]=qs['sort'](_0x103b28['query'][_0x655d('0x38')]);_0x1a5f3b['where']=qs[_0x655d('0x39')](_['pick'](_0x103b28[_0x655d('0x31')],_0x475c81[_0x655d('0x39')]),_0x38ed92);if(_0x103b28['query'][_0x655d('0x3a')]){_0x1a5f3b['where']=_[_0x655d('0x3b')](_0x1a5f3b[_0x655d('0x3c')],{'$or':[{'key':{'$like':'%'+_0x103b28[_0x655d('0x31')][_0x655d('0x3a')]+'%'}},{'value':{'$like':'%'+_0x103b28['query'][_0x655d('0x3a')]+'%'}}]});}_0x1a5f3b=_[_0x655d('0x3b')]({},_0x1a5f3b,_0x103b28[_0x655d('0x3d')]);var _0x28abac={'where':_0x1a5f3b[_0x655d('0x3c')]};return db[_0x655d('0x2a')][_0x655d('0x1c')](_0x28abac)[_0x655d('0x23')](function(_0x2be058){_0x2cfd95[_0x655d('0x1c')]=_0x2be058;if(_0x103b28[_0x655d('0x31')][_0x655d('0x3e')]){_0x1a5f3b[_0x655d('0x3f')]=[{'all':!![]}];}return db[_0x655d('0x2a')]['findAll'](_0x1a5f3b);})[_0x655d('0x23')](function(_0x3edce3){_0x2cfd95[_0x655d('0x40')]=_0x3edce3;return _0x2cfd95;})[_0x655d('0x23')](respondWithFilteredResult(_0x3279a7,_0x1a5f3b))['catch'](handleError(_0x3279a7,null));};exports['show']=function(_0x51a765,_0x26fec9){var _0x53ae44={'raw':!![],'where':{'id':_0x51a765[_0x655d('0x41')]['id']}},_0x368542={};_0x368542[_0x655d('0x2e')]=_[_0x655d('0x30')](db[_0x655d('0x2a')][_0x655d('0x42')]);_0x368542[_0x655d('0x31')]=_[_0x655d('0x30')](_0x51a765['query']);_0x368542['filters']=_['intersection'](_0x368542[_0x655d('0x2e')],_0x368542[_0x655d('0x31')]);_0x53ae44[_0x655d('0x33')]=_[_0x655d('0x32')](_0x368542['model'],qs[_0x655d('0x34')](_0x51a765[_0x655d('0x31')][_0x655d('0x34')]));_0x53ae44['attributes']=_0x53ae44[_0x655d('0x33')][_0x655d('0x43')]?_0x53ae44[_0x655d('0x33')]:_0x368542[_0x655d('0x2e')];if(_0x51a765[_0x655d('0x31')][_0x655d('0x3e')]){_0x53ae44[_0x655d('0x3f')]=[{'all':!![]}];}_0x53ae44=_[_0x655d('0x3b')]({},_0x53ae44,_0x51a765['options']);return db[_0x655d('0x2a')][_0x655d('0x44')](_0x53ae44)['then'](handleEntityNotFound(_0x26fec9,null))[_0x655d('0x23')](respondWithResult(_0x26fec9,null))[_0x655d('0x45')](handleError(_0x26fec9,null));};exports['update']=function(_0x4ad791,_0x53d0f4){if(_0x4ad791[_0x655d('0x46')]['id']){delete _0x4ad791[_0x655d('0x46')]['id'];}return db[_0x655d('0x2a')][_0x655d('0x44')]({'where':{'id':_0x4ad791[_0x655d('0x41')]['id']}})[_0x655d('0x23')](handleEntityNotFound(_0x53d0f4,null))[_0x655d('0x23')](saveUpdates(_0x4ad791[_0x655d('0x46')],null))[_0x655d('0x23')](respondWithResult(_0x53d0f4,null))['catch'](handleError(_0x53d0f4,null));};exports[_0x655d('0x24')]=function(_0x53535b,_0x59a3f2){return db[_0x655d('0x2a')][_0x655d('0x44')]({'where':{'id':_0x53535b[_0x655d('0x41')]['id']}})[_0x655d('0x23')](handleEntityNotFound(_0x59a3f2,null))[_0x655d('0x23')](removeEntity(_0x59a3f2,null))[_0x655d('0x45')](handleError(_0x59a3f2,null));};exports[_0x655d('0x47')]=function(_0x2bcb3a,_0x5b5a67){var _0x240e2a={'key':_0x2bcb3a[_0x655d('0x46')][_0x655d('0x2d')]};if(_0x2bcb3a[_0x655d('0x46')][_0x655d('0x48')]){_0x240e2a[_0x655d('0x48')]=_0x2bcb3a[_0x655d('0x46')][_0x655d('0x48')];}else if(_0x2bcb3a[_0x655d('0x46')][_0x655d('0x49')]){_0x240e2a[_0x655d('0x49')]=_0x2bcb3a[_0x655d('0x46')][_0x655d('0x49')];}else if(_0x2bcb3a[_0x655d('0x46')][_0x655d('0x4a')]){_0x240e2a[_0x655d('0x4a')]=_0x2bcb3a['body'][_0x655d('0x4a')];}else if(_0x2bcb3a[_0x655d('0x46')]['ChatWebsiteId']){_0x240e2a[_0x655d('0x4b')]=_0x2bcb3a[_0x655d('0x46')][_0x655d('0x4b')];}return db[_0x655d('0x2a')][_0x655d('0x44')]({'where':_0x240e2a})[_0x655d('0x23')](function(_0x2e26c5){if(_0x2e26c5){throw new db['Sequelize'][(_0x655d('0x4c'))](_0x655d('0x4d'));}return db[_0x655d('0x2a')][_0x655d('0x47')](_0x2bcb3a[_0x655d('0x46')]);})['then'](function(_0x3e1353){var _0x548b4e=_0x2bcb3a[_0x655d('0x4e')]['get']({'plain':!![]});if(!_0x548b4e)throw new Error(_0x655d('0x4f'));if(_0x548b4e['role']===_0x655d('0x4e')){var _0x19d6ee=_0x3e1353[_0x655d('0x50')]({'plain':!![]});return db[_0x655d('0x51')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x548b4e['userProfileId']},'raw':!![]})[_0x655d('0x23')](function(_0x1e3f16){if(_0x1e3f16&&_0x1e3f16[_0x655d('0x52')]===0x0){return db[_0x655d('0x25')]['create']({'name':_0x19d6ee[_0x655d('0x28')],'resourceId':_0x19d6ee['id'],'type':_0x1e3f16[_0x655d('0x28')],'sectionId':_0x1e3f16['id']},{})[_0x655d('0x23')](function(){return _0x3e1353;});}else{return _0x3e1353;}})[_0x655d('0x45')](function(_0x1fc430){logger['error'](_0x655d('0x53'),_0x1fc430);throw _0x1fc430;});}return _0x3e1353;})[_0x655d('0x23')](respondWithResult(_0x5b5a67,0xc9))[_0x655d('0x45')](handleError(_0x5b5a67,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index cc15406..b9a852a 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 _0xa647=['define','CannedAnswer','tools_canned_answers','utf8mb4','util','../../config/logger','bluebird','request-promise','./cannedAnswer.attributes','exports'];(function(_0xcd85db,_0x2d7545){var _0x33b3c4=function(_0x51431b){while(--_0x51431b){_0xcd85db['push'](_0xcd85db['shift']());}};_0x33b3c4(++_0x2d7545);}(_0xa647,0x18a));var _0x7a64=function(_0x255881,_0x3a1d4c){_0x255881=_0x255881-0x0;var _0x4bd5da=_0xa647[_0x255881];return _0x4bd5da;};'use strict';var _=require('lodash');var util=require(_0x7a64('0x0'));var logger=require(_0x7a64('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7a64('0x2'));var rp=require(_0x7a64('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7a64('0x4'));module[_0x7a64('0x5')]=function(_0x15cd4d,_0x552f60){return _0x15cd4d[_0x7a64('0x6')](_0x7a64('0x7'),attributes,{'tableName':_0x7a64('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7a64('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x2657=['define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x4a095e,_0x381cd5){var _0x10ef73=function(_0x1f6964){while(--_0x1f6964){_0x4a095e['push'](_0x4a095e['shift']());}};_0x10ef73(++_0x381cd5);}(_0x2657,0x65));var _0x7265=function(_0x11591e,_0x52781d){_0x11591e=_0x11591e-0x0;var _0x1b9037=_0x2657[_0x11591e];return _0x1b9037;};'use strict';var _=require(_0x7265('0x0'));var util=require(_0x7265('0x1'));var logger=require(_0x7265('0x2'))(_0x7265('0x3'));var moment=require('moment');var BPromise=require(_0x7265('0x4'));var rp=require(_0x7265('0x5'));var fs=require('fs');var path=require(_0x7265('0x6'));var rimraf=require(_0x7265('0x7'));var config=require(_0x7265('0x8'));var attributes=require(_0x7265('0x9'));module[_0x7265('0xa')]=function(_0x192d9e,_0x1e4cd9){return _0x192d9e[_0x7265('0xb')](_0x7265('0xc'),attributes,{'tableName':_0x7265('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7265('0xe'),'collate':_0x7265('0xf')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 83c5ead..d839c41 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(_0x315906,_0x4fbcb8){var _0x1012db=function(_0x18a151){while(--_0x18a151){_0x315906['push'](_0x315906['shift']());}};_0x1012db(++_0x4fbcb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x4c7b64,_0x423e21){var _0x5e0d2c=function(_0x594175){while(--_0x594175){_0x4c7b64['push'](_0x4c7b64['shift']());}};_0x5e0d2c(++_0x423e21);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 a0691bc..7b46d80 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 _0xd516=['delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x35fe11,_0x5317e6){var _0x8b67e1=function(_0x340d3a){while(--_0x340d3a){_0x35fe11['push'](_0x35fe11['shift']());}};_0x8b67e1(++_0x5317e6);}(_0xd516,0x18a));var _0x6d51=function(_0x2f8729,_0x3ded97){_0x2f8729=_0x2f8729-0x0;var _0x449450=_0xd516[_0x2f8729];return _0x449450;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6d51('0x0'));var timeout=require(_0x6d51('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6d51('0x2'));var auth=require(_0x6d51('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6d51('0x4'));var controller=require(_0x6d51('0x5'));router[_0x6d51('0x6')]('/',auth[_0x6d51('0x7')](),controller[_0x6d51('0x8')]);router[_0x6d51('0x6')](_0x6d51('0x9'),auth[_0x6d51('0x7')](),controller[_0x6d51('0xa')]);router[_0x6d51('0xb')]('/',auth[_0x6d51('0x7')](),controller[_0x6d51('0xc')]);router[_0x6d51('0xd')](_0x6d51('0x9'),auth[_0x6d51('0x7')](),controller['update']);router[_0x6d51('0xe')](_0x6d51('0x9'),auth[_0x6d51('0x7')](),controller[_0x6d51('0xf')]);module[_0x6d51('0x10')]=router;
\ No newline at end of file
+var _0xf5f0=['get','index','isAuthenticated','show','post','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller'];(function(_0x4620c7,_0x2927cf){var _0x5d4888=function(_0x58b904){while(--_0x58b904){_0x4620c7['push'](_0x4620c7['shift']());}};_0x5d4888(++_0x2927cf);}(_0xf5f0,0x75));var _0x0f5f=function(_0x46ef31,_0x4e5553){_0x46ef31=_0x46ef31-0x0;var _0x5f2ce7=_0xf5f0[_0x46ef31];return _0x5f2ce7;};'use strict';var multer=require(_0x0f5f('0x0'));var util=require(_0x0f5f('0x1'));var path=require(_0x0f5f('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f5f('0x3'));var router=express[_0x0f5f('0x4')]();var fs_extra=require(_0x0f5f('0x5'));var auth=require(_0x0f5f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0f5f('0x7'));var controller=require(_0x0f5f('0x8'));router[_0x0f5f('0x9')]('/',auth['isAuthenticated'](),controller[_0x0f5f('0xa')]);router[_0x0f5f('0x9')]('/:id',auth[_0x0f5f('0xb')](),controller[_0x0f5f('0xc')]);router[_0x0f5f('0xd')]('/',auth[_0x0f5f('0xb')](),controller['create']);router['put'](_0x0f5f('0xe'),auth[_0x0f5f('0xb')](),controller[_0x0f5f('0xf')]);router[_0x0f5f('0x10')](_0x0f5f('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x0f5f('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 93e8263..4de76e9 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 _0xf69b=['exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x479746,_0x574758){var _0x36d2aa=function(_0x27e29d){while(--_0x27e29d){_0x479746['push'](_0x479746['shift']());}};_0x36d2aa(++_0x574758);}(_0xf69b,0xc8));var _0xbf69=function(_0x45a9b8,_0x3e569d){_0x45a9b8=_0x45a9b8-0x0;var _0x35ad60=_0xf69b[_0x45a9b8];return _0x35ad60;};'use strict';var Sequelize=require('sequelize');module[_0xbf69('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xbf69('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xbf69('0x2')]},'dst':{'type':Sequelize[_0xbf69('0x2')]},'dcontext':{'type':Sequelize[_0xbf69('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xbf69('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xbf69('0x2')]},'duration':{'type':Sequelize[_0xbf69('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xbf69('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbf69('0x2')]},'amaflags':{'type':Sequelize[_0xbf69('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xbf69('0x2')]},'userfield':{'type':Sequelize[_0xbf69('0x2')]},'uniqueid':{'type':Sequelize[_0xbf69('0x2')]},'linkedid':{'type':Sequelize[_0xbf69('0x2')]},'sequence':{'type':Sequelize[_0xbf69('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbf69('0x2')]},'tag':{'type':Sequelize[_0xbf69('0x2')]}};
\ No newline at end of file
+var _0xc2e1=['DATE','STRING','INTEGER','sequelize'];(function(_0x31ccb5,_0x3961b8){var _0x42a464=function(_0x5e186d){while(--_0x5e186d){_0x31ccb5['push'](_0x31ccb5['shift']());}};_0x42a464(++_0x3961b8);}(_0xc2e1,0x1b3));var _0x1c2e=function(_0xd929ff,_0x47015d){_0xd929ff=_0xd929ff-0x0;var _0x57216d=_0xc2e1[_0xd929ff];return _0x57216d;};'use strict';var Sequelize=require(_0x1c2e('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x1c2e('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x1c2e('0x2')]},'dst':{'type':Sequelize[_0x1c2e('0x2')]},'dcontext':{'type':Sequelize[_0x1c2e('0x2')]},'channel':{'type':Sequelize[_0x1c2e('0x2')]},'dstchannel':{'type':Sequelize[_0x1c2e('0x2')]},'lastapp':{'type':Sequelize[_0x1c2e('0x2')]},'lastdata':{'type':Sequelize[_0x1c2e('0x2')]},'duration':{'type':Sequelize[_0x1c2e('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1c2e('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1c2e('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1c2e('0x2')]},'userfield':{'type':Sequelize[_0x1c2e('0x2')]},'uniqueid':{'type':Sequelize[_0x1c2e('0x2')]},'linkedid':{'type':Sequelize[_0x1c2e('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x1c2e('0x2')]},'type':{'type':Sequelize[_0x1c2e('0x2')]},'tag':{'type':Sequelize[_0x1c2e('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index b4c7cd6..e87bfda 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 _0x4873=['lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','index','rawAttributes','type','key','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','Cdr','catch','show','model','fields','includeAll','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x4873,0x1df));var _0x3487=function(_0x22757b,_0x3c27a3){_0x22757b=_0x22757b-0x0;var _0x365cd3=_0x4873[_0x22757b];return _0x365cd3;};'use strict';var emlformat=require(_0x3487('0x0'));var rimraf=require(_0x3487('0x1'));var zipdir=require(_0x3487('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3487('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3487('0x4'));var util=require(_0x3487('0x5'));var path=require(_0x3487('0x6'));var sox=require(_0x3487('0x7'));var csv=require(_0x3487('0x8'));var ejs=require(_0x3487('0x9'));var fs=require('fs');var fs_extra=require(_0x3487('0xa'));var _=require(_0x3487('0xb'));var squel=require('squel');var crypto=require(_0x3487('0xc'));var jsforce=require(_0x3487('0xd'));var deskjs=require(_0x3487('0xe'));var toCsv=require(_0x3487('0x8'));var querystring=require(_0x3487('0xf'));var Papa=require('papaparse');var Redis=require(_0x3487('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3487('0x11'));var as=require(_0x3487('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3487('0x13'));var utils=require(_0x3487('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3487('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x557d64,_0x395774){_0x395774=_0x395774||0xcc;return function(_0x1be2e0){if(_0x1be2e0){return _0x557d64[_0x3487('0x16')](_0x395774);}return _0x557d64[_0x3487('0x17')](_0x395774)[_0x3487('0x18')]();};}function respondWithResult(_0x1e468b,_0x4fbd63){_0x4fbd63=_0x4fbd63||0xc8;return function(_0x23ce3b){if(_0x23ce3b){return _0x1e468b[_0x3487('0x17')](_0x4fbd63)[_0x3487('0x19')](_0x23ce3b);}};}function respondWithFilteredResult(_0x4f79f0,_0x156e80){return function(_0x1b19c4){if(_0x1b19c4){var _0x38c0c1=typeof _0x156e80[_0x3487('0x1a')]===_0x3487('0x1b')&&typeof _0x156e80[_0x3487('0x1c')]===_0x3487('0x1b');var _0x32ecde=_0x1b19c4[_0x3487('0x1d')];var _0x2fa630=_0x38c0c1?0x0:_0x156e80[_0x3487('0x1a')];var _0x41795b=_0x38c0c1?_0x1b19c4[_0x3487('0x1d')]:_0x156e80[_0x3487('0x1a')]+_0x156e80['limit'];var _0x320349;if(_0x41795b>=_0x32ecde){_0x41795b=_0x32ecde;_0x320349=0xc8;}else{_0x320349=0xce;}_0x4f79f0['status'](_0x320349);return _0x4f79f0[_0x3487('0x1e')](_0x3487('0x1f'),_0x2fa630+'-'+_0x41795b+'/'+_0x32ecde)[_0x3487('0x19')](_0x1b19c4);}return null;};}function patchUpdates(_0x29546f){return function(_0xd788f8){try{jsonpatch[_0x3487('0x20')](_0xd788f8,_0x29546f,!![]);}catch(_0x479354){return BPromise[_0x3487('0x21')](_0x479354);}return _0xd788f8[_0x3487('0x22')]();};}function saveUpdates(_0x28f8f7,_0x97013d){return function(_0x11437c){if(_0x11437c){return _0x11437c[_0x3487('0x23')](_0x28f8f7)['then'](function(_0x384792){return _0x384792;});}return null;};}function removeEntity(_0x3e63e8,_0x25ed9f){return function(_0x482551){if(_0x482551){return _0x482551['destroy']()[_0x3487('0x24')](function(){_0x3e63e8[_0x3487('0x17')](0xcc)[_0x3487('0x18')]();});}};}function handleEntityNotFound(_0x3a9d76,_0x4c6882){return function(_0x79a183){if(!_0x79a183){_0x3a9d76[_0x3487('0x16')](0x194);}return _0x79a183;};}function handleError(_0x5484f6,_0x1e7126){_0x1e7126=_0x1e7126||0x1f4;return function(_0x3fb245){logger['error'](_0x3fb245['stack']);if(_0x3fb245[_0x3487('0x25')]){delete _0x3fb245[_0x3487('0x25')];}_0x5484f6[_0x3487('0x17')](_0x1e7126)[_0x3487('0x26')](_0x3fb245);};}exports[_0x3487('0x27')]=function(_0x1a02d6,_0x1c5bd6){var _0x38af4a={},_0x25e123={},_0x4dada9={'count':0x0,'rows':[]};var _0x24532a=_['map'](db['Cdr'][_0x3487('0x28')],function(_0x56ee54){return{'name':_0x56ee54['fieldName'],'type':_0x56ee54[_0x3487('0x29')][_0x3487('0x2a')]};});_0x25e123['model']=_['map'](_0x24532a,_0x3487('0x25'));_0x25e123[_0x3487('0x2b')]=_[_0x3487('0x2c')](_0x1a02d6['query']);_0x25e123[_0x3487('0x2d')]=_['intersection'](_0x25e123['model'],_0x25e123['query']);_0x38af4a[_0x3487('0x2e')]=_[_0x3487('0x2f')](_0x25e123['model'],qs['fields'](_0x1a02d6[_0x3487('0x2b')]['fields']));_0x38af4a['attributes']=_0x38af4a[_0x3487('0x2e')][_0x3487('0x30')]?_0x38af4a[_0x3487('0x2e')]:_0x25e123['model'];if(!_0x1a02d6[_0x3487('0x2b')][_0x3487('0x31')](_0x3487('0x32'))){_0x38af4a[_0x3487('0x1c')]=qs['limit'](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x1c')]);_0x38af4a['offset']=qs[_0x3487('0x1a')](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x1a')]);}_0x38af4a[_0x3487('0x33')]=qs[_0x3487('0x34')](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x34')]);_0x38af4a[_0x3487('0x35')]=qs[_0x3487('0x2d')](_['pick'](_0x1a02d6[_0x3487('0x2b')],_0x25e123[_0x3487('0x2d')]),_0x24532a);if(_0x1a02d6['query']['filter']){_0x38af4a[_0x3487('0x35')]=_[_0x3487('0x36')](_0x38af4a[_0x3487('0x35')],{'$or':_['map'](_0x24532a,function(_0x58006c){if(_0x58006c['type']!==_0x3487('0x37')){var _0x268674={};_0x268674[_0x58006c['name']]={'$like':'%'+_0x1a02d6[_0x3487('0x2b')][_0x3487('0x38')]+'%'};return _0x268674;}})});}_0x38af4a=_[_0x3487('0x36')]({},_0x38af4a,_0x1a02d6[_0x3487('0x39')]);var _0x106393={'where':_0x38af4a[_0x3487('0x35')]};return db[_0x3487('0x3a')][_0x3487('0x1d')](_0x106393)[_0x3487('0x24')](function(_0x565cb2){_0x4dada9[_0x3487('0x1d')]=_0x565cb2;if(_0x1a02d6[_0x3487('0x2b')]['includeAll']){_0x38af4a['include']=[{'all':!![]}];}return db[_0x3487('0x3a')]['findAll'](_0x38af4a);})['then'](function(_0x3eb68c){_0x4dada9['rows']=_0x3eb68c;return _0x4dada9;})['then'](respondWithFilteredResult(_0x1c5bd6,_0x38af4a))[_0x3487('0x3b')](handleError(_0x1c5bd6,null));};exports[_0x3487('0x3c')]=function(_0x58a4c8,_0x51b69c){var _0xc04317={'raw':!![],'where':{'id':_0x58a4c8['params']['id']}},_0x8cd06f={};_0x8cd06f[_0x3487('0x3d')]=_[_0x3487('0x2c')](db['Cdr'][_0x3487('0x28')]);_0x8cd06f[_0x3487('0x2b')]=_[_0x3487('0x2c')](_0x58a4c8['query']);_0x8cd06f[_0x3487('0x2d')]=_[_0x3487('0x2f')](_0x8cd06f[_0x3487('0x3d')],_0x8cd06f[_0x3487('0x2b')]);_0xc04317[_0x3487('0x2e')]=_[_0x3487('0x2f')](_0x8cd06f[_0x3487('0x3d')],qs[_0x3487('0x3e')](_0x58a4c8['query'][_0x3487('0x3e')]));_0xc04317[_0x3487('0x2e')]=_0xc04317[_0x3487('0x2e')][_0x3487('0x30')]?_0xc04317[_0x3487('0x2e')]:_0x8cd06f[_0x3487('0x3d')];if(_0x58a4c8[_0x3487('0x2b')][_0x3487('0x3f')]){_0xc04317['include']=[{'all':!![]}];}_0xc04317=_['merge']({},_0xc04317,_0x58a4c8[_0x3487('0x39')]);return db[_0x3487('0x3a')][_0x3487('0x40')](_0xc04317)[_0x3487('0x24')](handleEntityNotFound(_0x51b69c,null))['then'](respondWithResult(_0x51b69c,null))['catch'](handleError(_0x51b69c,null));};exports[_0x3487('0x41')]=function(_0x122456,_0x3fe91f){return db[_0x3487('0x3a')][_0x3487('0x41')](_0x122456[_0x3487('0x42')],{})[_0x3487('0x24')](respondWithResult(_0x3fe91f,0xc9))[_0x3487('0x3b')](handleError(_0x3fe91f,null));};exports['update']=function(_0x585a44,_0x320351){if(_0x585a44[_0x3487('0x42')]['id']){delete _0x585a44['body']['id'];}return db[_0x3487('0x3a')]['find']({'where':{'id':_0x585a44['params']['id']}})[_0x3487('0x24')](handleEntityNotFound(_0x320351,null))[_0x3487('0x24')](saveUpdates(_0x585a44['body'],null))[_0x3487('0x24')](respondWithResult(_0x320351,null))[_0x3487('0x3b')](handleError(_0x320351,null));};exports[_0x3487('0x43')]=function(_0x4ab5f8,_0x761f95){return db[_0x3487('0x3a')][_0x3487('0x40')]({'where':{'id':_0x4ab5f8[_0x3487('0x44')]['id']}})['then'](handleEntityNotFound(_0x761f95,null))[_0x3487('0x24')](removeEntity(_0x761f95,null))[_0x3487('0x3b')](handleError(_0x761f95,null));};exports[_0x3487('0x45')]=function(_0x33e826,_0x11125d){return db[_0x3487('0x3a')][_0x3487('0x45')]()['then'](respondWithResult(_0x11125d,null))[_0x3487('0x3b')](handleError(_0x11125d,null));};
\ No newline at end of file
+var _0x60c2=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','filters','filter','merge','where','VIRTUAL','options','includeAll','include','Cdr','findAll','rows','params','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x492a80,_0x41796f){var _0x4d0941=function(_0x148c04){while(--_0x148c04){_0x492a80['push'](_0x492a80['shift']());}};_0x4d0941(++_0x41796f);}(_0x60c2,0x8f));var _0x260c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x60c2[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x260c('0x0'));var zipdir=require(_0x260c('0x1'));var jsonpatch=require(_0x260c('0x2'));var rp=require(_0x260c('0x3'));var moment=require(_0x260c('0x4'));var BPromise=require(_0x260c('0x5'));var Mustache=require(_0x260c('0x6'));var util=require(_0x260c('0x7'));var path=require(_0x260c('0x8'));var sox=require(_0x260c('0x9'));var csv=require(_0x260c('0xa'));var ejs=require(_0x260c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x260c('0xc'));var squel=require(_0x260c('0xd'));var crypto=require(_0x260c('0xe'));var jsforce=require(_0x260c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x260c('0xa'));var querystring=require(_0x260c('0x10'));var Papa=require(_0x260c('0x11'));var Redis=require(_0x260c('0x12'));var authService=require(_0x260c('0x13'));var qs=require(_0x260c('0x14'));var as=require(_0x260c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x260c('0x16'))(_0x260c('0x17'));var utils=require(_0x260c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x260c('0x19'));var db=require(_0x260c('0x1a'))['db'];function respondWithStatusCode(_0x191490,_0x5aed37){_0x5aed37=_0x5aed37||0xcc;return function(_0xc44e8d){if(_0xc44e8d){return _0x191490[_0x260c('0x1b')](_0x5aed37);}return _0x191490[_0x260c('0x1c')](_0x5aed37)[_0x260c('0x1d')]();};}function respondWithResult(_0x1d3775,_0x53df53){_0x53df53=_0x53df53||0xc8;return function(_0x3930b6){if(_0x3930b6){return _0x1d3775['status'](_0x53df53)[_0x260c('0x1e')](_0x3930b6);}};}function respondWithFilteredResult(_0x5a021c,_0x47edc1){return function(_0xd8b310){if(_0xd8b310){var _0x5299a4=typeof _0x47edc1[_0x260c('0x1f')]===_0x260c('0x20')&&typeof _0x47edc1[_0x260c('0x21')]===_0x260c('0x20');var _0x2bf3b8=_0xd8b310[_0x260c('0x22')];var _0x11e634=_0x5299a4?0x0:_0x47edc1[_0x260c('0x1f')];var _0x201e59=_0x5299a4?_0xd8b310[_0x260c('0x22')]:_0x47edc1[_0x260c('0x1f')]+_0x47edc1['limit'];var _0xd977b;if(_0x201e59>=_0x2bf3b8){_0x201e59=_0x2bf3b8;_0xd977b=0xc8;}else{_0xd977b=0xce;}_0x5a021c['status'](_0xd977b);return _0x5a021c[_0x260c('0x23')](_0x260c('0x24'),_0x11e634+'-'+_0x201e59+'/'+_0x2bf3b8)['json'](_0xd8b310);}return null;};}function patchUpdates(_0x1ccf81){return function(_0xe824db){try{jsonpatch[_0x260c('0x25')](_0xe824db,_0x1ccf81,!![]);}catch(_0x1c53e1){return BPromise[_0x260c('0x26')](_0x1c53e1);}return _0xe824db[_0x260c('0x27')]();};}function saveUpdates(_0x4b5b7a,_0xd5b7d8){return function(_0x158bc6){if(_0x158bc6){return _0x158bc6[_0x260c('0x28')](_0x4b5b7a)[_0x260c('0x29')](function(_0x58688c){return _0x58688c;});}return null;};}function removeEntity(_0x3f299f,_0x304961){return function(_0x461c8a){if(_0x461c8a){return _0x461c8a[_0x260c('0x2a')]()['then'](function(){_0x3f299f[_0x260c('0x1c')](0xcc)[_0x260c('0x1d')]();});}};}function handleEntityNotFound(_0x3bdfce,_0x29e10e){return function(_0x4cf0f9){if(!_0x4cf0f9){_0x3bdfce[_0x260c('0x1b')](0x194);}return _0x4cf0f9;};}function handleError(_0x2957e5,_0x480179){_0x480179=_0x480179||0x1f4;return function(_0x5def72){logger[_0x260c('0x2b')](_0x5def72[_0x260c('0x2c')]);if(_0x5def72[_0x260c('0x2d')]){delete _0x5def72[_0x260c('0x2d')];}_0x2957e5[_0x260c('0x1c')](_0x480179)[_0x260c('0x2e')](_0x5def72);};}exports['index']=function(_0xf1ad3e,_0x2e49dd){var _0x16b663={},_0x233a61={},_0x5993fd={'count':0x0,'rows':[]};var _0xc6868a=_[_0x260c('0x2f')](db['Cdr'][_0x260c('0x30')],function(_0xcb8c28){return{'name':_0xcb8c28[_0x260c('0x31')],'type':_0xcb8c28[_0x260c('0x32')][_0x260c('0x33')]};});_0x233a61[_0x260c('0x34')]=_[_0x260c('0x2f')](_0xc6868a,_0x260c('0x2d'));_0x233a61['query']=_[_0x260c('0x35')](_0xf1ad3e[_0x260c('0x36')]);_0x233a61['filters']=_[_0x260c('0x37')](_0x233a61['model'],_0x233a61['query']);_0x16b663['attributes']=_[_0x260c('0x37')](_0x233a61[_0x260c('0x34')],qs['fields'](_0xf1ad3e[_0x260c('0x36')][_0x260c('0x38')]));_0x16b663[_0x260c('0x39')]=_0x16b663[_0x260c('0x39')][_0x260c('0x3a')]?_0x16b663[_0x260c('0x39')]:_0x233a61['model'];if(!_0xf1ad3e[_0x260c('0x36')][_0x260c('0x3b')](_0x260c('0x3c'))){_0x16b663[_0x260c('0x21')]=qs[_0x260c('0x21')](_0xf1ad3e[_0x260c('0x36')][_0x260c('0x21')]);_0x16b663[_0x260c('0x1f')]=qs[_0x260c('0x1f')](_0xf1ad3e['query'][_0x260c('0x1f')]);}_0x16b663['order']=qs['sort'](_0xf1ad3e['query']['sort']);_0x16b663['where']=qs['filters'](_['pick'](_0xf1ad3e[_0x260c('0x36')],_0x233a61[_0x260c('0x3d')]),_0xc6868a);if(_0xf1ad3e[_0x260c('0x36')][_0x260c('0x3e')]){_0x16b663['where']=_[_0x260c('0x3f')](_0x16b663[_0x260c('0x40')],{'$or':_['map'](_0xc6868a,function(_0x35afd6){if(_0x35afd6[_0x260c('0x32')]!==_0x260c('0x41')){var _0x1dbc8a={};_0x1dbc8a[_0x35afd6[_0x260c('0x2d')]]={'$like':'%'+_0xf1ad3e['query']['filter']+'%'};return _0x1dbc8a;}})});}_0x16b663=_[_0x260c('0x3f')]({},_0x16b663,_0xf1ad3e[_0x260c('0x42')]);var _0x1de711={'where':_0x16b663[_0x260c('0x40')]};return db['Cdr'][_0x260c('0x22')](_0x1de711)[_0x260c('0x29')](function(_0x265bd8){_0x5993fd[_0x260c('0x22')]=_0x265bd8;if(_0xf1ad3e[_0x260c('0x36')][_0x260c('0x43')]){_0x16b663[_0x260c('0x44')]=[{'all':!![]}];}return db[_0x260c('0x45')][_0x260c('0x46')](_0x16b663);})[_0x260c('0x29')](function(_0x3392df){_0x5993fd[_0x260c('0x47')]=_0x3392df;return _0x5993fd;})[_0x260c('0x29')](respondWithFilteredResult(_0x2e49dd,_0x16b663))['catch'](handleError(_0x2e49dd,null));};exports['show']=function(_0x19ab59,_0x30b3f9){var _0xccd9c1={'raw':!![],'where':{'id':_0x19ab59[_0x260c('0x48')]['id']}},_0x50ed87={};_0x50ed87['model']=_['keys'](db[_0x260c('0x45')]['rawAttributes']);_0x50ed87[_0x260c('0x36')]=_[_0x260c('0x35')](_0x19ab59[_0x260c('0x36')]);_0x50ed87[_0x260c('0x3d')]=_['intersection'](_0x50ed87[_0x260c('0x34')],_0x50ed87[_0x260c('0x36')]);_0xccd9c1['attributes']=_[_0x260c('0x37')](_0x50ed87['model'],qs[_0x260c('0x38')](_0x19ab59[_0x260c('0x36')][_0x260c('0x38')]));_0xccd9c1['attributes']=_0xccd9c1[_0x260c('0x39')][_0x260c('0x3a')]?_0xccd9c1[_0x260c('0x39')]:_0x50ed87[_0x260c('0x34')];if(_0x19ab59[_0x260c('0x36')][_0x260c('0x43')]){_0xccd9c1[_0x260c('0x44')]=[{'all':!![]}];}_0xccd9c1=_[_0x260c('0x3f')]({},_0xccd9c1,_0x19ab59[_0x260c('0x42')]);return db[_0x260c('0x45')][_0x260c('0x49')](_0xccd9c1)[_0x260c('0x29')](handleEntityNotFound(_0x30b3f9,null))['then'](respondWithResult(_0x30b3f9,null))['catch'](handleError(_0x30b3f9,null));};exports[_0x260c('0x4a')]=function(_0x4517be,_0x18321f){return db[_0x260c('0x45')]['create'](_0x4517be[_0x260c('0x4b')],{})[_0x260c('0x29')](respondWithResult(_0x18321f,0xc9))[_0x260c('0x4c')](handleError(_0x18321f,null));};exports[_0x260c('0x28')]=function(_0x45175a,_0x1d0890){if(_0x45175a[_0x260c('0x4b')]['id']){delete _0x45175a[_0x260c('0x4b')]['id'];}return db[_0x260c('0x45')]['find']({'where':{'id':_0x45175a[_0x260c('0x48')]['id']}})[_0x260c('0x29')](handleEntityNotFound(_0x1d0890,null))['then'](saveUpdates(_0x45175a[_0x260c('0x4b')],null))['then'](respondWithResult(_0x1d0890,null))[_0x260c('0x4c')](handleError(_0x1d0890,null));};exports['destroy']=function(_0x4dcdca,_0x1e34fe){return db[_0x260c('0x45')][_0x260c('0x49')]({'where':{'id':_0x4dcdca[_0x260c('0x48')]['id']}})[_0x260c('0x29')](handleEntityNotFound(_0x1e34fe,null))[_0x260c('0x29')](removeEntity(_0x1e34fe,null))[_0x260c('0x4c')](handleError(_0x1e34fe,null));};exports['describe']=function(_0x12fbe5,_0x49b350){return db[_0x260c('0x45')][_0x260c('0x4d')]()[_0x260c('0x29')](respondWithResult(_0x49b350,null))[_0x260c('0x4c')](handleError(_0x49b350,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 8dec25e..68e969c 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(_0xf60735,_0x35e352){var _0x2cb67b=function(_0x517812){while(--_0x517812){_0xf60735['push'](_0xf60735['shift']());}};_0x2cb67b(++_0x35e352);}(_0x7a54,0x106));var _0x47a5=function(_0xa858fb,_0x3d312c){_0xa858fb=_0xa858fb-0x0;var _0x4144c6=_0x7a54[_0xa858fb];return _0x4144c6;};'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(_0x24551b,_0x49b4e5){var _0x2a1b3b=function(_0x3d60a4){while(--_0x3d60a4){_0x24551b['push'](_0x24551b['shift']());}};_0x2a1b3b(++_0x49b4e5);}(_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':'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 6fad9a6..d15a4c5 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 _0x2e7c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','randomstring','../../mysqldb'];(function(_0x2e3276,_0x38f0b7){var _0x91512e=function(_0x5e7d83){while(--_0x5e7d83){_0x2e3276['push'](_0x2e3276['shift']());}};_0x91512e(++_0x38f0b7);}(_0x2e7c,0x1a0));var _0xc2e7=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x2e7c[_0xc67528];return _0x38e26d;};'use strict';var _=require('lodash');var util=require(_0xc2e7('0x0'));var moment=require(_0xc2e7('0x1'));var BPromise=require('bluebird');var rs=require(_0xc2e7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2e7('0x3'))['db'];var utils=require(_0xc2e7('0x4'));var logger=require(_0xc2e7('0x5'))(_0xc2e7('0x6'));var config=require(_0xc2e7('0x7'));var jayson=require(_0xc2e7('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3356f2,_0x5e6e7d,_0x473fb5){return new BPromise(function(_0x92468c,_0x3f15c1){return client[_0xc2e7('0x9')](_0x3356f2,_0x473fb5)[_0xc2e7('0xa')](function(_0x6e13ad){logger['info'](_0xc2e7('0xb'),_0x5e6e7d,_0xc2e7('0xc'));logger[_0xc2e7('0xd')](_0xc2e7('0xe'),_0x5e6e7d,'request\x20sent',JSON[_0xc2e7('0xf')](_0x6e13ad));if(_0x6e13ad[_0xc2e7('0x10')]){if(_0x6e13ad[_0xc2e7('0x10')][_0xc2e7('0x11')]===0x1f4){logger[_0xc2e7('0x10')](_0xc2e7('0xb'),_0x5e6e7d,_0x6e13ad['error'][_0xc2e7('0x12')]);return _0x3f15c1(_0x6e13ad[_0xc2e7('0x10')][_0xc2e7('0x12')]);}logger[_0xc2e7('0x10')]('Cdr,\x20%s,\x20%s',_0x5e6e7d,_0x6e13ad[_0xc2e7('0x10')][_0xc2e7('0x12')]);return _0x92468c(_0x6e13ad['error'][_0xc2e7('0x12')]);}else{logger[_0xc2e7('0x13')](_0xc2e7('0xb'),_0x5e6e7d,_0xc2e7('0xc'));_0x92468c(_0x6e13ad[_0xc2e7('0x14')][_0xc2e7('0x12')]);}})['catch'](function(_0x5a7a29){logger[_0xc2e7('0x10')](_0xc2e7('0xb'),_0x5e6e7d,_0x5a7a29);_0x3f15c1(_0x5a7a29);});});}
\ No newline at end of file
+var _0x5e99=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util'];(function(_0x401302,_0x5ec0ed){var _0x17980b=function(_0x1fedb2){while(--_0x1fedb2){_0x401302['push'](_0x401302['shift']());}};_0x17980b(++_0x5ec0ed);}(_0x5e99,0x19d));var _0x95e9=function(_0x3ebe63,_0x3f3270){_0x3ebe63=_0x3ebe63-0x0;var _0x5d224a=_0x5e99[_0x3ebe63];return _0x5d224a;};'use strict';var _=require('lodash');var util=require(_0x95e9('0x0'));var moment=require(_0x95e9('0x1'));var BPromise=require(_0x95e9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95e9('0x3'));var db=require(_0x95e9('0x4'))['db'];var utils=require(_0x95e9('0x5'));var logger=require(_0x95e9('0x6'))(_0x95e9('0x7'));var config=require(_0x95e9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x95e9('0x9')][_0x95e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ae99d,_0x483a10,_0x42bc36){return new BPromise(function(_0x57f58b,_0x2d267c){return client[_0x95e9('0xb')](_0x5ae99d,_0x42bc36)[_0x95e9('0xc')](function(_0x1e62c1){logger['info'](_0x95e9('0xd'),_0x483a10,_0x95e9('0xe'));logger[_0x95e9('0xf')](_0x95e9('0x10'),_0x483a10,_0x95e9('0xe'),JSON[_0x95e9('0x11')](_0x1e62c1));if(_0x1e62c1[_0x95e9('0x12')]){if(_0x1e62c1[_0x95e9('0x12')][_0x95e9('0x13')]===0x1f4){logger[_0x95e9('0x12')]('Cdr,\x20%s,\x20%s',_0x483a10,_0x1e62c1[_0x95e9('0x12')][_0x95e9('0x14')]);return _0x2d267c(_0x1e62c1[_0x95e9('0x12')][_0x95e9('0x14')]);}logger[_0x95e9('0x12')](_0x95e9('0xd'),_0x483a10,_0x1e62c1['error']['message']);return _0x57f58b(_0x1e62c1[_0x95e9('0x12')][_0x95e9('0x14')]);}else{logger[_0x95e9('0x15')]('Cdr,\x20%s,\x20%s',_0x483a10,_0x95e9('0xe'));_0x57f58b(_0x1e62c1[_0x95e9('0x16')][_0x95e9('0x14')]);}})['catch'](function(_0x29cb02){logger[_0x95e9('0x12')](_0x95e9('0xd'),_0x483a10,_0x29cb02);_0x2d267c(_0x29cb02);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index d13a701..7625e58 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4554ad,_0x421cab){var _0x5e7a4b=function(_0x58a970){while(--_0x58a970){_0x4554ad['push'](_0x4554ad['shift']());}};_0x5e7a4b(++_0x421cab);}(_0xb10b,0x12a));var _0xbb10=function(_0x39a04c,_0x2b4002){_0x39a04c=_0x39a04c-0x0;var _0x580cb0=_0xb10b[_0x39a04c];return _0x580cb0;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x53b67d,_0x251707){var _0xff73e7=function(_0x5bafe4){while(--_0x5bafe4){_0x53b67d['push'](_0x53b67d['shift']());}};_0xff73e7(++_0x251707);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index b8d3cc6..b03010c 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 _0xd2ca=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x41572d,_0x291843){var _0x29b3a0=function(_0x36722d){while(--_0x36722d){_0x41572d['push'](_0x41572d['shift']());}};_0x29b3a0(++_0x291843);}(_0xd2ca,0xba));var _0xad2c=function(_0xee4d62,_0x253508){_0xee4d62=_0xee4d62-0x0;var _0x5334fa=_0xd2ca[_0xee4d62];return _0x5334fa;};'use strict';var Sequelize=require('sequelize');module[_0xad2c('0x0')]={'priority':{'type':Sequelize[_0xad2c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xad2c('0x2')],'allowNull':![],'defaultValue':_0xad2c('0x3')},'appdata':{'type':Sequelize[_0xad2c('0x4')]()},'description':{'type':Sequelize[_0xad2c('0x2')]},'interval':{'type':Sequelize[_0xad2c('0x2')],'defaultValue':_0xad2c('0x5')}};
\ No newline at end of file
+var _0x77bb=['exports','TEXT','STRING','sequelize'];(function(_0x28f09a,_0x21c19b){var _0x4a5c58=function(_0x3944d8){while(--_0x3944d8){_0x28f09a['push'](_0x28f09a['shift']());}};_0x4a5c58(++_0x21c19b);}(_0x77bb,0x83));var _0xb77b=function(_0xe0020b,_0x565773){_0xe0020b=_0xe0020b-0x0;var _0x21e5cb=_0x77bb[_0xe0020b];return _0x21e5cb;};'use strict';var Sequelize=require(_0xb77b('0x0'));module[_0xb77b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb77b('0x2')]()},'description':{'type':Sequelize[_0xb77b('0x3')]},'interval':{'type':Sequelize[_0xb77b('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 97f5932..00d6e2d 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 _0x8482=['length','find','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','show','params','ChatApplication','rawAttributes','query','keys','filters','intersection','model','attributes','fields'];(function(_0x3c534a,_0x40a065){var _0x444aaa=function(_0x1753ea){while(--_0x1753ea){_0x3c534a['push'](_0x3c534a['shift']());}};_0x444aaa(++_0x40a065);}(_0x8482,0x14e));var _0x2848=function(_0x58571f,_0x4df597){_0x58571f=_0x58571f-0x0;var _0x5944d6=_0x8482[_0x58571f];return _0x5944d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2848('0x0'));var zipdir=require(_0x2848('0x1'));var jsonpatch=require(_0x2848('0x2'));var rp=require(_0x2848('0x3'));var moment=require(_0x2848('0x4'));var BPromise=require(_0x2848('0x5'));var Mustache=require(_0x2848('0x6'));var util=require(_0x2848('0x7'));var path=require(_0x2848('0x8'));var sox=require(_0x2848('0x9'));var csv=require('to-csv');var ejs=require(_0x2848('0xa'));var fs=require('fs');var fs_extra=require(_0x2848('0xb'));var _=require('lodash');var squel=require(_0x2848('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2848('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2848('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2848('0xf'));var as=require(_0x2848('0x10'));var hardwareService=require(_0x2848('0x11'));var logger=require(_0x2848('0x12'))(_0x2848('0x13'));var utils=require(_0x2848('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2848('0x15'))['db'];function respondWithStatusCode(_0x465380,_0xf0658d){_0xf0658d=_0xf0658d||0xcc;return function(_0x566a0b){if(_0x566a0b){return _0x465380[_0x2848('0x16')](_0xf0658d);}return _0x465380[_0x2848('0x17')](_0xf0658d)[_0x2848('0x18')]();};}function respondWithResult(_0x5e64c7,_0xbddd26){_0xbddd26=_0xbddd26||0xc8;return function(_0x501a0e){if(_0x501a0e){return _0x5e64c7[_0x2848('0x17')](_0xbddd26)['json'](_0x501a0e);}};}function respondWithFilteredResult(_0x1002d2,_0xeba65b){return function(_0x6600c5){if(_0x6600c5){var _0x59f39a=typeof _0xeba65b['offset']==='undefined'&&typeof _0xeba65b['limit']===_0x2848('0x19');var _0x1acd41=_0x6600c5[_0x2848('0x1a')];var _0x46755c=_0x59f39a?0x0:_0xeba65b[_0x2848('0x1b')];var _0x3b4eeb=_0x59f39a?_0x6600c5[_0x2848('0x1a')]:_0xeba65b[_0x2848('0x1b')]+_0xeba65b[_0x2848('0x1c')];var _0x193ffa;if(_0x3b4eeb>=_0x1acd41){_0x3b4eeb=_0x1acd41;_0x193ffa=0xc8;}else{_0x193ffa=0xce;}_0x1002d2[_0x2848('0x17')](_0x193ffa);return _0x1002d2['set'](_0x2848('0x1d'),_0x46755c+'-'+_0x3b4eeb+'/'+_0x1acd41)[_0x2848('0x1e')](_0x6600c5);}return null;};}function patchUpdates(_0x1a1f79){return function(_0x5748ae){try{jsonpatch[_0x2848('0x1f')](_0x5748ae,_0x1a1f79,!![]);}catch(_0x1f67a7){return BPromise[_0x2848('0x20')](_0x1f67a7);}return _0x5748ae[_0x2848('0x21')]();};}function saveUpdates(_0x3b99a2,_0x555279){return function(_0x3dd7db){if(_0x3dd7db){return _0x3dd7db[_0x2848('0x22')](_0x3b99a2)[_0x2848('0x23')](function(_0x436709){return _0x436709;});}return null;};}function removeEntity(_0xea4128,_0x40f510){return function(_0x5f38e2){if(_0x5f38e2){return _0x5f38e2[_0x2848('0x24')]()['then'](function(){_0xea4128[_0x2848('0x17')](0xcc)[_0x2848('0x18')]();});}};}function handleEntityNotFound(_0x2d936a,_0x4517d3){return function(_0x51c924){if(!_0x51c924){_0x2d936a[_0x2848('0x16')](0x194);}return _0x51c924;};}function handleError(_0xecd4f4,_0xdba069){_0xdba069=_0xdba069||0x1f4;return function(_0x2dc32e){logger[_0x2848('0x25')](_0x2dc32e[_0x2848('0x26')]);if(_0x2dc32e[_0x2848('0x27')]){delete _0x2dc32e['name'];}_0xecd4f4['status'](_0xdba069)['send'](_0x2dc32e);};}exports[_0x2848('0x28')]=function(_0x18df37,_0x3b9c0d){var _0x3f915b={'raw':!![],'where':{'id':_0x18df37[_0x2848('0x29')]['id']}},_0x189701={};_0x189701['model']=_['keys'](db[_0x2848('0x2a')][_0x2848('0x2b')]);_0x189701[_0x2848('0x2c')]=_[_0x2848('0x2d')](_0x18df37[_0x2848('0x2c')]);_0x189701[_0x2848('0x2e')]=_[_0x2848('0x2f')](_0x189701[_0x2848('0x30')],_0x189701[_0x2848('0x2c')]);_0x3f915b[_0x2848('0x31')]=_[_0x2848('0x2f')](_0x189701['model'],qs[_0x2848('0x32')](_0x18df37[_0x2848('0x2c')][_0x2848('0x32')]));_0x3f915b[_0x2848('0x31')]=_0x3f915b['attributes'][_0x2848('0x33')]?_0x3f915b[_0x2848('0x31')]:_0x189701[_0x2848('0x30')];if(_0x18df37[_0x2848('0x2c')]['includeAll']){_0x3f915b['include']=[{'all':!![]}];}_0x3f915b=_['merge']({},_0x3f915b,_0x18df37['options']);return db[_0x2848('0x2a')][_0x2848('0x34')](_0x3f915b)['then'](handleEntityNotFound(_0x3b9c0d,null))['then'](respondWithResult(_0x3b9c0d,null))[_0x2848('0x35')](handleError(_0x3b9c0d,null));};exports[_0x2848('0x22')]=function(_0x31a27d,_0x274b5a){if(_0x31a27d[_0x2848('0x36')]['id']){delete _0x31a27d['body']['id'];}return db[_0x2848('0x2a')][_0x2848('0x34')]({'where':{'id':_0x31a27d[_0x2848('0x29')]['id']}})['then'](handleEntityNotFound(_0x274b5a,null))[_0x2848('0x23')](saveUpdates(_0x31a27d[_0x2848('0x36')],null))[_0x2848('0x23')](respondWithResult(_0x274b5a,null))[_0x2848('0x35')](handleError(_0x274b5a,null));};exports[_0x2848('0x24')]=function(_0x510a53,_0x5578fe){return db[_0x2848('0x2a')][_0x2848('0x34')]({'where':{'id':_0x510a53[_0x2848('0x29')]['id']}})[_0x2848('0x23')](handleEntityNotFound(_0x5578fe,null))[_0x2848('0x23')](removeEntity(_0x5578fe,null))[_0x2848('0x35')](handleError(_0x5578fe,null));};
\ No newline at end of file
+var _0x3d9c=['../../config/license/util','status','end','json','limit','undefined','offset','count','Content-Range','apply','reject','save','update','destroy','stack','name','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','fields','attributes','length','include','options','find','then','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3d9c,0x134));var _0xc3d9=function(_0x526625,_0x3b9f20){_0x526625=_0x526625-0x0;var _0x348e64=_0x3d9c[_0x526625];return _0x348e64;};'use strict';var emlformat=require(_0xc3d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc3d9('0x1'));var jsonpatch=require(_0xc3d9('0x2'));var rp=require(_0xc3d9('0x3'));var moment=require('moment');var BPromise=require(_0xc3d9('0x4'));var Mustache=require(_0xc3d9('0x5'));var util=require(_0xc3d9('0x6'));var path=require(_0xc3d9('0x7'));var sox=require(_0xc3d9('0x8'));var csv=require(_0xc3d9('0x9'));var ejs=require(_0xc3d9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc3d9('0xb'));var squel=require(_0xc3d9('0xc'));var crypto=require('crypto');var jsforce=require(_0xc3d9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc3d9('0x9'));var querystring=require(_0xc3d9('0xe'));var Papa=require(_0xc3d9('0xf'));var Redis=require('ioredis');var authService=require(_0xc3d9('0x10'));var qs=require(_0xc3d9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3d9('0x12'));var logger=require(_0xc3d9('0x13'))(_0xc3d9('0x14'));var utils=require(_0xc3d9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc3d9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x217c58,_0x140c1a){_0x140c1a=_0x140c1a||0xcc;return function(_0x2540a6){if(_0x2540a6){return _0x217c58['sendStatus'](_0x140c1a);}return _0x217c58[_0xc3d9('0x17')](_0x140c1a)[_0xc3d9('0x18')]();};}function respondWithResult(_0x5db23f,_0x58a361){_0x58a361=_0x58a361||0xc8;return function(_0x3571fa){if(_0x3571fa){return _0x5db23f['status'](_0x58a361)[_0xc3d9('0x19')](_0x3571fa);}};}function respondWithFilteredResult(_0x272b73,_0x2c7b04){return function(_0xd7c5de){if(_0xd7c5de){var _0x5b48f4=typeof _0x2c7b04['offset']==='undefined'&&typeof _0x2c7b04[_0xc3d9('0x1a')]===_0xc3d9('0x1b');var _0x15e429=_0xd7c5de['count'];var _0x29b9c9=_0x5b48f4?0x0:_0x2c7b04[_0xc3d9('0x1c')];var _0x46e416=_0x5b48f4?_0xd7c5de[_0xc3d9('0x1d')]:_0x2c7b04[_0xc3d9('0x1c')]+_0x2c7b04[_0xc3d9('0x1a')];var _0x21e41f;if(_0x46e416>=_0x15e429){_0x46e416=_0x15e429;_0x21e41f=0xc8;}else{_0x21e41f=0xce;}_0x272b73[_0xc3d9('0x17')](_0x21e41f);return _0x272b73['set'](_0xc3d9('0x1e'),_0x29b9c9+'-'+_0x46e416+'/'+_0x15e429)[_0xc3d9('0x19')](_0xd7c5de);}return null;};}function patchUpdates(_0x27483f){return function(_0x4a4f76){try{jsonpatch[_0xc3d9('0x1f')](_0x4a4f76,_0x27483f,!![]);}catch(_0xffa508){return BPromise[_0xc3d9('0x20')](_0xffa508);}return _0x4a4f76[_0xc3d9('0x21')]();};}function saveUpdates(_0xe163df,_0x2c0c9b){return function(_0x5465dd){if(_0x5465dd){return _0x5465dd[_0xc3d9('0x22')](_0xe163df)['then'](function(_0x49d1bb){return _0x49d1bb;});}return null;};}function removeEntity(_0x3b58a6,_0x106e9f){return function(_0x2ee926){if(_0x2ee926){return _0x2ee926[_0xc3d9('0x23')]()['then'](function(){_0x3b58a6[_0xc3d9('0x17')](0xcc)[_0xc3d9('0x18')]();});}};}function handleEntityNotFound(_0x30c357,_0x21fd30){return function(_0x2190f8){if(!_0x2190f8){_0x30c357['sendStatus'](0x194);}return _0x2190f8;};}function handleError(_0xb3ad76,_0x5103fa){_0x5103fa=_0x5103fa||0x1f4;return function(_0xe0c08f){logger['error'](_0xe0c08f[_0xc3d9('0x24')]);if(_0xe0c08f[_0xc3d9('0x25')]){delete _0xe0c08f[_0xc3d9('0x25')];}_0xb3ad76['status'](_0x5103fa)['send'](_0xe0c08f);};}exports[_0xc3d9('0x26')]=function(_0x4500d1,_0x2973d5){var _0x528326={'raw':!![],'where':{'id':_0x4500d1[_0xc3d9('0x27')]['id']}},_0x41d9c7={};_0x41d9c7[_0xc3d9('0x28')]=_[_0xc3d9('0x29')](db[_0xc3d9('0x2a')][_0xc3d9('0x2b')]);_0x41d9c7[_0xc3d9('0x2c')]=_[_0xc3d9('0x29')](_0x4500d1[_0xc3d9('0x2c')]);_0x41d9c7['filters']=_[_0xc3d9('0x2d')](_0x41d9c7[_0xc3d9('0x28')],_0x41d9c7[_0xc3d9('0x2c')]);_0x528326['attributes']=_['intersection'](_0x41d9c7['model'],qs[_0xc3d9('0x2e')](_0x4500d1[_0xc3d9('0x2c')]['fields']));_0x528326[_0xc3d9('0x2f')]=_0x528326[_0xc3d9('0x2f')][_0xc3d9('0x30')]?_0x528326[_0xc3d9('0x2f')]:_0x41d9c7[_0xc3d9('0x28')];if(_0x4500d1[_0xc3d9('0x2c')]['includeAll']){_0x528326[_0xc3d9('0x31')]=[{'all':!![]}];}_0x528326=_['merge']({},_0x528326,_0x4500d1[_0xc3d9('0x32')]);return db[_0xc3d9('0x2a')][_0xc3d9('0x33')](_0x528326)[_0xc3d9('0x34')](handleEntityNotFound(_0x2973d5,null))[_0xc3d9('0x34')](respondWithResult(_0x2973d5,null))[_0xc3d9('0x35')](handleError(_0x2973d5,null));};exports[_0xc3d9('0x22')]=function(_0xb860ec,_0x92dc19){if(_0xb860ec['body']['id']){delete _0xb860ec[_0xc3d9('0x36')]['id'];}return db[_0xc3d9('0x2a')][_0xc3d9('0x33')]({'where':{'id':_0xb860ec[_0xc3d9('0x27')]['id']}})['then'](handleEntityNotFound(_0x92dc19,null))['then'](saveUpdates(_0xb860ec[_0xc3d9('0x36')],null))['then'](respondWithResult(_0x92dc19,null))[_0xc3d9('0x35')](handleError(_0x92dc19,null));};exports[_0xc3d9('0x23')]=function(_0x20d82d,_0x189898){return db[_0xc3d9('0x2a')][_0xc3d9('0x33')]({'where':{'id':_0x20d82d[_0xc3d9('0x27')]['id']}})[_0xc3d9('0x34')](handleEntityNotFound(_0x189898,null))['then'](removeEntity(_0x189898,null))[_0xc3d9('0x35')](handleError(_0x189898,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index d77ae08..bba7f74 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 _0xac65=['define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes'];(function(_0x29dd53,_0x144d41){var _0xe648cb=function(_0x3b0090){while(--_0x3b0090){_0x29dd53['push'](_0x29dd53['shift']());}};_0xe648cb(++_0x144d41);}(_0xac65,0x11d));var _0x5ac6=function(_0xd3be0c,_0x4a8727){_0xd3be0c=_0xd3be0c-0x0;var _0x8a2fd6=_0xac65[_0xd3be0c];return _0x8a2fd6;};'use strict';var _=require(_0x5ac6('0x0'));var util=require(_0x5ac6('0x1'));var logger=require(_0x5ac6('0x2'))('api');var moment=require(_0x5ac6('0x3'));var BPromise=require(_0x5ac6('0x4'));var rp=require(_0x5ac6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ac6('0x6'));var config=require(_0x5ac6('0x7'));var attributes=require(_0x5ac6('0x8'));module['exports']=function(_0x2da747,_0x38711d){return _0x2da747[_0x5ac6('0x9')](_0x5ac6('0xa'),attributes,{'tableName':_0x5ac6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5ac6('0xc'),'collate':_0x5ac6('0xd')});};
\ No newline at end of file
+var _0x5977=['path','../../config/environment','exports','chat_applications','utf8mb4','lodash','util','../../config/logger','moment','bluebird'];(function(_0x258919,_0x1754e6){var _0xfbd68b=function(_0x3bc3e9){while(--_0x3bc3e9){_0x258919['push'](_0x258919['shift']());}};_0xfbd68b(++_0x1754e6);}(_0x5977,0xeb));var _0x7597=function(_0x58aead,_0x16459b){_0x58aead=_0x58aead-0x0;var _0x1e4538=_0x5977[_0x58aead];return _0x1e4538;};'use strict';var _=require(_0x7597('0x0'));var util=require(_0x7597('0x1'));var logger=require(_0x7597('0x2'))('api');var moment=require(_0x7597('0x3'));var BPromise=require(_0x7597('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7597('0x5'));var rimraf=require('rimraf');var config=require(_0x7597('0x6'));var attributes=require('./chatApplication.attributes');module[_0x7597('0x7')]=function(_0x3875e1,_0x5302c6){return _0x3875e1['define']('ChatApplication',attributes,{'tableName':_0x7597('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7597('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 9d8358d..6f9402c 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 _0x0e76=['result','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x16b994,_0x22872a){var _0xfc3e0f=function(_0x32d1d8){while(--_0x32d1d8){_0x16b994['push'](_0x16b994['shift']());}};_0xfc3e0f(++_0x22872a);}(_0x0e76,0x78));var _0x60e7=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0x0e76[_0x4653f7];return _0x5454da;};'use strict';var _=require('lodash');var util=require(_0x60e7('0x0'));var moment=require(_0x60e7('0x1'));var BPromise=require(_0x60e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60e7('0x3'));var db=require(_0x60e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x60e7('0x5'));var config=require('../../config/environment');var jayson=require(_0x60e7('0x6'));var client=jayson[_0x60e7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56d914,_0xea9fe9,_0x360ddc){return new BPromise(function(_0x20b236,_0x1d1636){return client['request'](_0x56d914,_0x360ddc)['then'](function(_0x107dfa){logger[_0x60e7('0x8')](_0x60e7('0x9'),_0xea9fe9,_0x60e7('0xa'));logger['debug'](_0x60e7('0xb'),_0xea9fe9,_0x60e7('0xa'),JSON[_0x60e7('0xc')](_0x107dfa));if(_0x107dfa[_0x60e7('0xd')]){if(_0x107dfa[_0x60e7('0xd')][_0x60e7('0xe')]===0x1f4){logger[_0x60e7('0xd')](_0x60e7('0x9'),_0xea9fe9,_0x107dfa[_0x60e7('0xd')][_0x60e7('0xf')]);return _0x1d1636(_0x107dfa[_0x60e7('0xd')]['message']);}logger[_0x60e7('0xd')]('ChatApplication,\x20%s,\x20%s',_0xea9fe9,_0x107dfa[_0x60e7('0xd')][_0x60e7('0xf')]);return _0x20b236(_0x107dfa[_0x60e7('0xd')][_0x60e7('0xf')]);}else{logger[_0x60e7('0x8')](_0x60e7('0x9'),_0xea9fe9,'request\x20sent');_0x20b236(_0x107dfa[_0x60e7('0x10')][_0x60e7('0xf')]);}})['catch'](function(_0x5df500){logger[_0x60e7('0xd')]('ChatApplication,\x20%s,\x20%s',_0xea9fe9,_0x5df500);_0x1d1636(_0x5df500);});});}
\ No newline at end of file
+var _0xe3bd=['http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x182455,_0x162dfe){var _0x1b4bd6=function(_0x18bb58){while(--_0x18bb58){_0x182455['push'](_0x182455['shift']());}};_0x1b4bd6(++_0x162dfe);}(_0xe3bd,0x170));var _0xde3b=function(_0x699200,_0x39c101){_0x699200=_0x699200-0x0;var _0x266fd1=_0xe3bd[_0x699200];return _0x266fd1;};'use strict';var _=require('lodash');var util=require(_0xde3b('0x0'));var moment=require(_0xde3b('0x1'));var BPromise=require(_0xde3b('0x2'));var rs=require(_0xde3b('0x3'));var fs=require('fs');var Redis=require(_0xde3b('0x4'));var db=require(_0xde3b('0x5'))['db'];var utils=require(_0xde3b('0x6'));var logger=require('../../config/logger')(_0xde3b('0x7'));var config=require(_0xde3b('0x8'));var jayson=require(_0xde3b('0x9'));var client=jayson['client'][_0xde3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b06d3,_0x539177,_0x481cdc){return new BPromise(function(_0x37a01d,_0x26accc){return client[_0xde3b('0xb')](_0x4b06d3,_0x481cdc)['then'](function(_0x4af5cf){logger[_0xde3b('0xc')](_0xde3b('0xd'),_0x539177,_0xde3b('0xe'));logger['debug'](_0xde3b('0xf'),_0x539177,_0xde3b('0xe'),JSON[_0xde3b('0x10')](_0x4af5cf));if(_0x4af5cf[_0xde3b('0x11')]){if(_0x4af5cf[_0xde3b('0x11')]['code']===0x1f4){logger[_0xde3b('0x11')](_0xde3b('0xd'),_0x539177,_0x4af5cf['error'][_0xde3b('0x12')]);return _0x26accc(_0x4af5cf[_0xde3b('0x11')][_0xde3b('0x12')]);}logger[_0xde3b('0x11')](_0xde3b('0xd'),_0x539177,_0x4af5cf[_0xde3b('0x11')][_0xde3b('0x12')]);return _0x37a01d(_0x4af5cf['error'][_0xde3b('0x12')]);}else{logger['info'](_0xde3b('0xd'),_0x539177,_0xde3b('0xe'));_0x37a01d(_0x4af5cf[_0xde3b('0x13')][_0xde3b('0x12')]);}})[_0xde3b('0x14')](function(_0x46d364){logger[_0xde3b('0x11')](_0xde3b('0xd'),_0x539177,_0x46d364);_0x26accc(_0x46d364);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 2c3f028..c834a37 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 _0x0506=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','util','path','connect-timeout','express','Router'];(function(_0x3702a,_0x5520fc){var _0x376497=function(_0x561288){while(--_0x561288){_0x3702a['push'](_0x3702a['shift']());}};_0x376497(++_0x5520fc);}(_0x0506,0xa0));var _0x6050=function(_0x44e5fa,_0xfdba7){_0x44e5fa=_0x44e5fa-0x0;var _0x4911e3=_0x0506[_0x44e5fa];return _0x4911e3;};'use strict';var multer=require('multer');var util=require(_0x6050('0x0'));var path=require(_0x6050('0x1'));var timeout=require(_0x6050('0x2'));var express=require(_0x6050('0x3'));var router=express[_0x6050('0x4')]();var fs_extra=require(_0x6050('0x5'));var auth=require(_0x6050('0x6'));var interaction=require(_0x6050('0x7'));var config=require('../../config/environment');var controller=require(_0x6050('0x8'));router['get'](_0x6050('0x9'),auth[_0x6050('0xa')](),controller[_0x6050('0xb')]);router[_0x6050('0xc')]('/:id',auth[_0x6050('0xa')](),controller[_0x6050('0xd')]);router[_0x6050('0xe')](_0x6050('0x9'),auth[_0x6050('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xddc1=['path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','multer'];(function(_0x36494a,_0x3b4ad6){var _0x1f4695=function(_0x1a90e6){while(--_0x1a90e6){_0x36494a['push'](_0x36494a['shift']());}};_0x1f4695(++_0x3b4ad6);}(_0xddc1,0x1c6));var _0x1ddc=function(_0x5017e8,_0x44bf12){_0x5017e8=_0x5017e8-0x0;var _0x4f36f0=_0xddc1[_0x5017e8];return _0x4f36f0;};'use strict';var multer=require(_0x1ddc('0x0'));var util=require('util');var path=require(_0x1ddc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1ddc('0x2'));var auth=require(_0x1ddc('0x3'));var interaction=require(_0x1ddc('0x4'));var config=require(_0x1ddc('0x5'));var controller=require(_0x1ddc('0x6'));router[_0x1ddc('0x7')](_0x1ddc('0x8'),auth['isAuthenticated'](),controller[_0x1ddc('0x9')]);router[_0x1ddc('0xa')]('/:id',auth[_0x1ddc('0xb')](),controller[_0x1ddc('0xc')]);router['delete'](_0x1ddc('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 3c9962d..b12ed8f 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 _0x71b0=['STRING','sequelize','exports'];(function(_0x219b27,_0x5b3923){var _0x50a3ad=function(_0x19fb03){while(--_0x19fb03){_0x219b27['push'](_0x219b27['shift']());}};_0x50a3ad(++_0x5b3923);}(_0x71b0,0x1ba));var _0x071b=function(_0xbc2a54,_0x332598){_0xbc2a54=_0xbc2a54-0x0;var _0x1fe0f=_0x71b0[_0xbc2a54];return _0x1fe0f;};'use strict';var Sequelize=require(_0x071b('0x0'));module[_0x071b('0x1')]={'name':{'type':Sequelize[_0x071b('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xe6c0=['exports','STRING'];(function(_0x4b33c7,_0x4c7837){var _0x4adaff=function(_0x7eb867){while(--_0x7eb867){_0x4b33c7['push'](_0x4b33c7['shift']());}};_0x4adaff(++_0x4c7837);}(_0xe6c0,0x88));var _0x0e6c=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xe6c0[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require('sequelize');module[_0x0e6c('0x0')]={'name':{'type':Sequelize[_0x0e6c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0e6c('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 113d3be..83fb69f 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 _0x27dc=['fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','error','stack','send','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','ChatGroup','include','findAll','params','options','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','getMessages','$gte','eml-format','rimraf'];(function(_0x411b9e,_0x4003fb){var _0x549d96=function(_0x5e7975){while(--_0x5e7975){_0x411b9e['push'](_0x411b9e['shift']());}};_0x549d96(++_0x4003fb);}(_0x27dc,0x1ca));var _0xc27d=function(_0x2c0d2e,_0x32b789){_0x2c0d2e=_0x2c0d2e-0x0;var _0x296c6e=_0x27dc[_0x2c0d2e];return _0x296c6e;};'use strict';var emlformat=require(_0xc27d('0x0'));var rimraf=require(_0xc27d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc27d('0x2'));var rp=require(_0xc27d('0x3'));var moment=require(_0xc27d('0x4'));var BPromise=require(_0xc27d('0x5'));var Mustache=require(_0xc27d('0x6'));var util=require(_0xc27d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc27d('0x8'));var ejs=require(_0xc27d('0x9'));var fs=require('fs');var fs_extra=require(_0xc27d('0xa'));var _=require(_0xc27d('0xb'));var squel=require(_0xc27d('0xc'));var crypto=require('crypto');var jsforce=require(_0xc27d('0xd'));var deskjs=require(_0xc27d('0xe'));var toCsv=require(_0xc27d('0x8'));var querystring=require(_0xc27d('0xf'));var Papa=require(_0xc27d('0x10'));var Redis=require(_0xc27d('0x11'));var authService=require(_0xc27d('0x12'));var qs=require(_0xc27d('0x13'));var as=require(_0xc27d('0x14'));var hardwareService=require(_0xc27d('0x15'));var logger=require(_0xc27d('0x16'))(_0xc27d('0x17'));var utils=require('../../config/utils');var config=require(_0xc27d('0x18'));var licenseUtil=require(_0xc27d('0x19'));var db=require('../../mysqldb')['db'];config[_0xc27d('0x1a')]=_[_0xc27d('0x1b')](config[_0xc27d('0x1a')],{'host':_0xc27d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc27d('0x1d'))['register'](socket);function respondWithStatusCode(_0x37df05,_0x1834e5){_0x1834e5=_0x1834e5||0xcc;return function(_0x31b3fb){if(_0x31b3fb){return _0x37df05[_0xc27d('0x1e')](_0x1834e5);}return _0x37df05['status'](_0x1834e5)[_0xc27d('0x1f')]();};}function respondWithResult(_0x168f70,_0xacb475){_0xacb475=_0xacb475||0xc8;return function(_0x5131f9){if(_0x5131f9){return _0x168f70[_0xc27d('0x20')](_0xacb475)['json'](_0x5131f9);}};}function respondWithFilteredResult(_0x42ac94,_0x4bee1e){return function(_0x42f5dd){if(_0x42f5dd){var _0x402799=typeof _0x4bee1e[_0xc27d('0x21')]==='undefined'&&typeof _0x4bee1e[_0xc27d('0x22')]===_0xc27d('0x23');var _0x22fd99=_0x42f5dd[_0xc27d('0x24')];var _0x2ac515=_0x402799?0x0:_0x4bee1e[_0xc27d('0x21')];var _0x399456=_0x402799?_0x42f5dd[_0xc27d('0x24')]:_0x4bee1e[_0xc27d('0x21')]+_0x4bee1e[_0xc27d('0x22')];var _0x22a7fc;if(_0x399456>=_0x22fd99){_0x399456=_0x22fd99;_0x22a7fc=0xc8;}else{_0x22a7fc=0xce;}_0x42ac94[_0xc27d('0x20')](_0x22a7fc);return _0x42ac94[_0xc27d('0x25')](_0xc27d('0x26'),_0x2ac515+'-'+_0x399456+'/'+_0x22fd99)['json'](_0x42f5dd);}return null;};}function patchUpdates(_0x1d5c0f){return function(_0x329893){try{jsonpatch[_0xc27d('0x27')](_0x329893,_0x1d5c0f,!![]);}catch(_0x20f0d0){return BPromise['reject'](_0x20f0d0);}return _0x329893[_0xc27d('0x28')]();};}function saveUpdates(_0x47d646,_0x38ff56){return function(_0x41c140){if(_0x41c140){return _0x41c140[_0xc27d('0x29')](_0x47d646)['then'](function(_0x5016f6){return _0x5016f6;});}return null;};}function removeEntity(_0x51ee5c,_0x3b3142){return function(_0x1f48bc){if(_0x1f48bc){return _0x1f48bc[_0xc27d('0x2a')]()[_0xc27d('0x2b')](function(){_0x51ee5c[_0xc27d('0x20')](0xcc)[_0xc27d('0x1f')]();});}};}function handleEntityNotFound(_0x49a35f,_0x38cfe6){return function(_0x1ccbdb){if(!_0x1ccbdb){_0x49a35f[_0xc27d('0x1e')](0x194);}return _0x1ccbdb;};}function handleError(_0x2aaa4a,_0x434dd4){_0x434dd4=_0x434dd4||0x1f4;return function(_0x4a4da1){logger[_0xc27d('0x2c')](_0x4a4da1[_0xc27d('0x2d')]);if(_0x4a4da1['name']){delete _0x4a4da1['name'];}_0x2aaa4a['status'](_0x434dd4)[_0xc27d('0x2e')](_0x4a4da1);};}exports['index']=function(_0x439c31,_0x447bb4){var _0x16fc28={},_0x315201={},_0x45f7f9={'count':0x0,'rows':[]};var _0x2e92c9=_['map'](db['ChatGroup'][_0xc27d('0x2f')],function(_0x535247){return{'name':_0x535247[_0xc27d('0x30')],'type':_0x535247[_0xc27d('0x31')]['key']};});_0x315201[_0xc27d('0x32')]=_[_0xc27d('0x33')](_0x2e92c9,_0xc27d('0x34'));_0x315201[_0xc27d('0x35')]=_[_0xc27d('0x36')](_0x439c31['query']);_0x315201[_0xc27d('0x37')]=_[_0xc27d('0x38')](_0x315201['model'],_0x315201[_0xc27d('0x35')]);_0x16fc28[_0xc27d('0x39')]=_[_0xc27d('0x38')](_0x315201[_0xc27d('0x32')],qs['fields'](_0x439c31[_0xc27d('0x35')][_0xc27d('0x3a')]));_0x16fc28['attributes']=_0x16fc28['attributes'][_0xc27d('0x3b')]?_0x16fc28[_0xc27d('0x39')]:_0x315201[_0xc27d('0x32')];if(!_0x439c31[_0xc27d('0x35')][_0xc27d('0x3c')](_0xc27d('0x3d'))){_0x16fc28[_0xc27d('0x22')]=qs['limit'](_0x439c31[_0xc27d('0x35')][_0xc27d('0x22')]);_0x16fc28[_0xc27d('0x21')]=qs[_0xc27d('0x21')](_0x439c31[_0xc27d('0x35')][_0xc27d('0x21')]);}_0x16fc28[_0xc27d('0x3e')]=qs[_0xc27d('0x3f')](_0x439c31['query'][_0xc27d('0x3f')]);_0x16fc28['where']=qs['filters'](_[_0xc27d('0x40')](_0x439c31[_0xc27d('0x35')],_0x315201['filters']),_0x2e92c9);if(_0x439c31[_0xc27d('0x35')][_0xc27d('0x41')]){_0x16fc28[_0xc27d('0x42')]=_[_0xc27d('0x43')](_0x16fc28[_0xc27d('0x42')],{'$or':_[_0xc27d('0x33')](_0x2e92c9,function(_0x573087){if(_0x573087[_0xc27d('0x31')]!=='VIRTUAL'){var _0xa85e43={};_0xa85e43[_0x573087['name']]={'$like':'%'+_0x439c31[_0xc27d('0x35')][_0xc27d('0x41')]+'%'};return _0xa85e43;}})});}_0x16fc28=_[_0xc27d('0x43')]({},_0x16fc28,_0x439c31['options']);var _0x221f84={'where':_0x16fc28['where']};return db[_0xc27d('0x44')][_0xc27d('0x24')](_0x221f84)[_0xc27d('0x2b')](function(_0x525e34){_0x45f7f9[_0xc27d('0x24')]=_0x525e34;if(_0x439c31[_0xc27d('0x35')]['includeAll']){_0x16fc28[_0xc27d('0x45')]=[{'all':!![]}];}return db[_0xc27d('0x44')][_0xc27d('0x46')](_0x16fc28);})[_0xc27d('0x2b')](function(_0x5cc2f8){_0x45f7f9['rows']=_0x5cc2f8;return _0x45f7f9;})[_0xc27d('0x2b')](respondWithFilteredResult(_0x447bb4,_0x16fc28))['catch'](handleError(_0x447bb4,null));};exports['show']=function(_0x3246f0,_0x1e2fe8){var _0x1efa16={'raw':!![],'where':{'id':_0x3246f0[_0xc27d('0x47')]['id']}},_0x12c6f6={};_0x12c6f6[_0xc27d('0x32')]=_[_0xc27d('0x36')](db['ChatGroup'][_0xc27d('0x2f')]);_0x12c6f6[_0xc27d('0x35')]=_[_0xc27d('0x36')](_0x3246f0[_0xc27d('0x35')]);_0x12c6f6[_0xc27d('0x37')]=_[_0xc27d('0x38')](_0x12c6f6[_0xc27d('0x32')],_0x12c6f6[_0xc27d('0x35')]);_0x1efa16[_0xc27d('0x39')]=_[_0xc27d('0x38')](_0x12c6f6[_0xc27d('0x32')],qs[_0xc27d('0x3a')](_0x3246f0['query'][_0xc27d('0x3a')]));_0x1efa16[_0xc27d('0x39')]=_0x1efa16[_0xc27d('0x39')][_0xc27d('0x3b')]?_0x1efa16[_0xc27d('0x39')]:_0x12c6f6[_0xc27d('0x32')];if(_0x3246f0[_0xc27d('0x35')]['includeAll']){_0x1efa16[_0xc27d('0x45')]=[{'all':!![]}];}_0x1efa16=_[_0xc27d('0x43')]({},_0x1efa16,_0x3246f0[_0xc27d('0x48')]);return db['ChatGroup'][_0xc27d('0x49')](_0x1efa16)[_0xc27d('0x2b')](handleEntityNotFound(_0x1e2fe8,null))[_0xc27d('0x2b')](respondWithResult(_0x1e2fe8,null))[_0xc27d('0x4a')](handleError(_0x1e2fe8,null));};exports[_0xc27d('0x4b')]=function(_0x4f176b,_0x3abf87){return db['ChatGroup'][_0xc27d('0x4b')](_0x4f176b['body'],{})[_0xc27d('0x2b')](respondWithResult(_0x3abf87,0xc9))[_0xc27d('0x4a')](handleError(_0x3abf87,null));};exports[_0xc27d('0x29')]=function(_0x961d1b,_0x3a0210){if(_0x961d1b['body']['id']){delete _0x961d1b[_0xc27d('0x4c')]['id'];}return db[_0xc27d('0x44')][_0xc27d('0x49')]({'where':{'id':_0x961d1b[_0xc27d('0x47')]['id']}})[_0xc27d('0x2b')](handleEntityNotFound(_0x3a0210,null))[_0xc27d('0x2b')](saveUpdates(_0x961d1b[_0xc27d('0x4c')],null))['then'](respondWithResult(_0x3a0210,null))[_0xc27d('0x4a')](handleError(_0x3a0210,null));};exports[_0xc27d('0x2a')]=function(_0x3e5523,_0x526937){return db['ChatGroup'][_0xc27d('0x49')]({'where':{'id':_0x3e5523[_0xc27d('0x47')]['id']}})['then'](handleEntityNotFound(_0x526937,null))['then'](removeEntity(_0x526937,null))['catch'](handleError(_0x526937,null));};exports[_0xc27d('0x4d')]=function(_0x20cf62,_0x1551a9){return db[_0xc27d('0x44')][_0xc27d('0x4d')]()[_0xc27d('0x2b')](respondWithResult(_0x1551a9,null))['catch'](handleError(_0x1551a9,null));};exports[_0xc27d('0x4e')]=function(_0x471af8,_0x9b319e,_0x142ca2){return db[_0xc27d('0x4f')]['count']({'where':{'ChatGroupId':_0x471af8[_0xc27d('0x47')]['id'],'ToId':_0x471af8[_0xc27d('0x50')]['id'],'read':![]}})['then'](function(_0x21ac5f){return{'id':_[_0xc27d('0x51')](_0x471af8[_0xc27d('0x47')]['id']),'count':_0x21ac5f};})[_0xc27d('0x2b')](respondWithResult(_0x9b319e,null))[_0xc27d('0x4a')](handleError(_0x9b319e,null));};exports[_0xc27d('0x52')]=function(_0x207e60,_0x1b9faf,_0x1d76b8){return db['ChatGroup'][_0xc27d('0x49')]({'where':{'id':_0x207e60[_0xc27d('0x47')]['id']}})[_0xc27d('0x2b')](handleEntityNotFound(_0x1b9faf,null))[_0xc27d('0x2b')](function(_0x2e80b4){if(_0x2e80b4){return _0x2e80b4[_0xc27d('0x52')](_0x207e60[_0xc27d('0x4c')][_0xc27d('0x53')],_[_0xc27d('0x54')](_0x207e60[_0xc27d('0x4c')],[_0xc27d('0x53'),'id'])||{});}})[_0xc27d('0x2b')](respondWithResult(_0x1b9faf,null))[_0xc27d('0x4a')](handleError(_0x1b9faf,null));};exports[_0xc27d('0x55')]=function(_0x2bd98e,_0x498cbb,_0x39c463){var _0x468a9f={};var _0x57aa0a={};var _0x1ef6e8;var _0x1c40c8;return db['ChatGroup'][_0xc27d('0x56')]({'where':{'id':_0x2bd98e[_0xc27d('0x47')]['id']}})[_0xc27d('0x2b')](handleEntityNotFound(_0x498cbb,null))[_0xc27d('0x2b')](function(_0x1bba05){if(_0x1bba05){_0x1ef6e8=_0x1bba05;_0x57aa0a[_0xc27d('0x32')]=_['keys'](db[_0xc27d('0x57')][_0xc27d('0x2f')]);_0x57aa0a[_0xc27d('0x35')]=_[_0xc27d('0x36')](_0x2bd98e[_0xc27d('0x35')]);_0x57aa0a[_0xc27d('0x37')]=_[_0xc27d('0x38')](_0x57aa0a[_0xc27d('0x32')],_0x57aa0a[_0xc27d('0x35')]);_0x468a9f[_0xc27d('0x39')]=_['intersection'](_0x57aa0a[_0xc27d('0x32')],qs[_0xc27d('0x3a')](_0x2bd98e[_0xc27d('0x35')][_0xc27d('0x3a')]));_0x468a9f[_0xc27d('0x39')]=_0x468a9f[_0xc27d('0x39')][_0xc27d('0x3b')]?_0x468a9f[_0xc27d('0x39')]:_0x57aa0a[_0xc27d('0x32')];_0x468a9f[_0xc27d('0x3e')]=qs[_0xc27d('0x3f')](_0x2bd98e[_0xc27d('0x35')]['sort']);_0x468a9f[_0xc27d('0x42')]=qs[_0xc27d('0x37')](_[_0xc27d('0x40')](_0x2bd98e['query'],_0x57aa0a[_0xc27d('0x37')]));if(_0x2bd98e[_0xc27d('0x35')][_0xc27d('0x41')]){_0x468a9f[_0xc27d('0x42')]=_[_0xc27d('0x43')](_0x468a9f[_0xc27d('0x42')],{'$or':_[_0xc27d('0x33')](_0x468a9f[_0xc27d('0x39')],function(_0x215238){var _0x3d6811={};_0x3d6811[_0x215238]={'$like':'%'+_0x2bd98e[_0xc27d('0x35')]['filter']+'%'};return _0x3d6811;})});}_0x468a9f=_['merge']({},_0x468a9f,_0x2bd98e[_0xc27d('0x48')]);return _0x1ef6e8[_0xc27d('0x55')](_0x468a9f);}})[_0xc27d('0x2b')](function(_0x59fbbc){if(_0x59fbbc){_0x1c40c8=_0x59fbbc['length'];if(!_0x2bd98e[_0xc27d('0x35')][_0xc27d('0x3c')](_0xc27d('0x3d'))){_0x468a9f[_0xc27d('0x22')]=qs[_0xc27d('0x22')](_0x2bd98e['query']['limit']);_0x468a9f[_0xc27d('0x21')]=qs[_0xc27d('0x21')](_0x2bd98e[_0xc27d('0x35')][_0xc27d('0x21')]);}return _0x1ef6e8['getMembers'](_0x468a9f);}})['then'](function(_0x4dff46){if(_0x4dff46){return _0x4dff46?{'count':_0x1c40c8,'rows':_0x4dff46}:null;}})[_0xc27d('0x2b')](respondWithResult(_0x498cbb,null))[_0xc27d('0x4a')](handleError(_0x498cbb,null));};exports[_0xc27d('0x58')]=function(_0xfb1d75,_0xbf9361,_0x346096){return db[_0xc27d('0x44')][_0xc27d('0x49')]({'where':{'id':_0xfb1d75[_0xc27d('0x47')]['id']}})[_0xc27d('0x2b')](handleEntityNotFound(_0xbf9361,null))[_0xc27d('0x2b')](function(_0x244eec){if(_0x244eec){return _0x244eec[_0xc27d('0x58')](_0xfb1d75[_0xc27d('0x35')][_0xc27d('0x53')]);}})[_0xc27d('0x2b')](respondWithStatusCode(_0xbf9361,null))[_0xc27d('0x4a')](handleError(_0xbf9361,null));};exports[_0xc27d('0x59')]=function(_0x3a4c88,_0x2af9c5,_0xc8881b){if(_0x3a4c88[_0xc27d('0x4c')]['id']){delete _0x3a4c88[_0xc27d('0x4c')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x3a4c88[_0xc27d('0x47')]['id']}})[_0xc27d('0x2b')](handleEntityNotFound(_0x2af9c5,null))[_0xc27d('0x2b')](function(_0xe64eb5){if(_0xe64eb5){_0x3a4c88['body']['ChatGroupId']=_0xe64eb5['id'];return db[_0xc27d('0x4f')]['create'](_0x3a4c88[_0xc27d('0x4c')]);}})[_0xc27d('0x2b')](respondWithResult(_0x2af9c5,null))[_0xc27d('0x4a')](handleError(_0x2af9c5,null));};exports[_0xc27d('0x5a')]=function(_0x26a16f,_0x53c650,_0x3090cb){var _0x59cf1f={};var _0x5e2824={};var _0x4d526d;var _0x3c4df4;return db[_0xc27d('0x44')][_0xc27d('0x56')]({'where':{'id':_0x26a16f[_0xc27d('0x47')]['id']}})[_0xc27d('0x2b')](handleEntityNotFound(_0x53c650,null))['then'](function(_0x4af5f7){if(_0x4af5f7){_0x4d526d=_0x4af5f7;_0x5e2824[_0xc27d('0x32')]=_['keys'](db[_0xc27d('0x4f')]['rawAttributes']);_0x5e2824[_0xc27d('0x35')]=_[_0xc27d('0x36')](_0x26a16f[_0xc27d('0x35')]);_0x5e2824[_0xc27d('0x37')]=_[_0xc27d('0x38')](_0x5e2824[_0xc27d('0x32')],_0x5e2824[_0xc27d('0x35')]);_0x59cf1f[_0xc27d('0x39')]=_[_0xc27d('0x38')](_0x5e2824[_0xc27d('0x32')],qs[_0xc27d('0x3a')](_0x26a16f['query'][_0xc27d('0x3a')]));_0x59cf1f[_0xc27d('0x39')]=_0x59cf1f[_0xc27d('0x39')][_0xc27d('0x3b')]?_0x59cf1f[_0xc27d('0x39')]:_0x5e2824['model'];_0x59cf1f['order']=qs[_0xc27d('0x3f')](_0x26a16f[_0xc27d('0x35')][_0xc27d('0x3f')]);_0x59cf1f['where']=qs['filters'](_[_0xc27d('0x40')](_0x26a16f[_0xc27d('0x35')],_0x5e2824[_0xc27d('0x37')]));if(_0x26a16f[_0xc27d('0x35')][_0xc27d('0x41')]){_0x59cf1f[_0xc27d('0x42')]=_[_0xc27d('0x43')](_0x59cf1f[_0xc27d('0x42')],{'$or':_[_0xc27d('0x33')](_0x59cf1f[_0xc27d('0x39')],function(_0x2e5307){var _0xd94bc4={};_0xd94bc4[_0x2e5307]={'$like':'%'+_0x26a16f['query'][_0xc27d('0x41')]+'%'};return _0xd94bc4;})});}if(_0x26a16f[_0xc27d('0x35')][_0xc27d('0x5b')]){var _0x33a71b=_0x26a16f[_0xc27d('0x35')]['$gte']['split'](',');var _0x24a79d={};_0x24a79d[_0x33a71b[0x0]]={'$gte':moment(_0x33a71b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x59cf1f[_0xc27d('0x42')]=_[_0xc27d('0x43')](_0x59cf1f[_0xc27d('0x42')],_0x24a79d);}_0x59cf1f=_[_0xc27d('0x43')]({},_0x59cf1f,_0x26a16f[_0xc27d('0x48')]);return _0x4d526d[_0xc27d('0x5a')](_0x59cf1f);}})[_0xc27d('0x2b')](function(_0x11d512){if(_0x11d512){_0x3c4df4=_0x11d512[_0xc27d('0x3b')];if(!_0x26a16f[_0xc27d('0x35')][_0xc27d('0x3c')](_0xc27d('0x3d'))){_0x59cf1f['limit']=qs[_0xc27d('0x22')](_0x26a16f['query'][_0xc27d('0x22')]);_0x59cf1f[_0xc27d('0x21')]=qs[_0xc27d('0x21')](_0x26a16f['query']['offset']);}return _0x4d526d[_0xc27d('0x5a')](_0x59cf1f);}})[_0xc27d('0x2b')](function(_0x1360e2){if(_0x1360e2){return _0x1360e2?{'count':_0x3c4df4,'rows':_0x1360e2}:null;}})['then'](respondWithResult(_0x53c650,null))[_0xc27d('0x4a')](handleError(_0x53c650,null));};
\ No newline at end of file
+var _0x7b5f=['update','then','destroy','error','stack','index','ChatGroup','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','getMembers','findOne','User','filter','nolimit','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','localhost','socket.io-emitter','redis','./chatGroup.socket','sendStatus','end','json','offset','undefined','count','status','Content-Range','reject'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0x7b5f,0x95));var _0xf7b5=function(_0x454703,_0x1c2682){_0x454703=_0x454703-0x0;var _0x4355ab=_0x7b5f[_0x454703];return _0x4355ab;};'use strict';var emlformat=require(_0xf7b5('0x0'));var rimraf=require(_0xf7b5('0x1'));var zipdir=require(_0xf7b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf7b5('0x3'));var moment=require(_0xf7b5('0x4'));var BPromise=require(_0xf7b5('0x5'));var Mustache=require('mustache');var util=require(_0xf7b5('0x6'));var path=require(_0xf7b5('0x7'));var sox=require(_0xf7b5('0x8'));var csv=require(_0xf7b5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7b5('0xa'));var squel=require(_0xf7b5('0xb'));var crypto=require(_0xf7b5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf7b5('0xd'));var toCsv=require(_0xf7b5('0x9'));var querystring=require(_0xf7b5('0xe'));var Papa=require('papaparse');var Redis=require(_0xf7b5('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7b5('0x10'));var logger=require(_0xf7b5('0x11'))('api');var utils=require(_0xf7b5('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf7b5('0x13'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xf7b5('0x14'),'port':0x18eb});var socket=require(_0xf7b5('0x15'))(new Redis(config[_0xf7b5('0x16')]));require(_0xf7b5('0x17'))['register'](socket);function respondWithStatusCode(_0x3b311c,_0x1f40c0){_0x1f40c0=_0x1f40c0||0xcc;return function(_0x4ba7f5){if(_0x4ba7f5){return _0x3b311c[_0xf7b5('0x18')](_0x1f40c0);}return _0x3b311c['status'](_0x1f40c0)[_0xf7b5('0x19')]();};}function respondWithResult(_0x2f6f95,_0x27ac90){_0x27ac90=_0x27ac90||0xc8;return function(_0x42fa00){if(_0x42fa00){return _0x2f6f95['status'](_0x27ac90)[_0xf7b5('0x1a')](_0x42fa00);}};}function respondWithFilteredResult(_0x45aa6a,_0x4fb638){return function(_0x1948d3){if(_0x1948d3){var _0x3b7ccf=typeof _0x4fb638[_0xf7b5('0x1b')]===_0xf7b5('0x1c')&&typeof _0x4fb638['limit']===_0xf7b5('0x1c');var _0x303405=_0x1948d3[_0xf7b5('0x1d')];var _0x2de4b3=_0x3b7ccf?0x0:_0x4fb638[_0xf7b5('0x1b')];var _0x48e09f=_0x3b7ccf?_0x1948d3[_0xf7b5('0x1d')]:_0x4fb638['offset']+_0x4fb638['limit'];var _0x2db777;if(_0x48e09f>=_0x303405){_0x48e09f=_0x303405;_0x2db777=0xc8;}else{_0x2db777=0xce;}_0x45aa6a[_0xf7b5('0x1e')](_0x2db777);return _0x45aa6a['set'](_0xf7b5('0x1f'),_0x2de4b3+'-'+_0x48e09f+'/'+_0x303405)[_0xf7b5('0x1a')](_0x1948d3);}return null;};}function patchUpdates(_0x4847b){return function(_0x466442){try{jsonpatch['apply'](_0x466442,_0x4847b,!![]);}catch(_0x5a3801){return BPromise[_0xf7b5('0x20')](_0x5a3801);}return _0x466442['save']();};}function saveUpdates(_0x2f7716,_0xaf7943){return function(_0x39731b){if(_0x39731b){return _0x39731b[_0xf7b5('0x21')](_0x2f7716)[_0xf7b5('0x22')](function(_0x83f4b8){return _0x83f4b8;});}return null;};}function removeEntity(_0x5561ba,_0x3a709a){return function(_0x51e35f){if(_0x51e35f){return _0x51e35f[_0xf7b5('0x23')]()[_0xf7b5('0x22')](function(){_0x5561ba['status'](0xcc)[_0xf7b5('0x19')]();});}};}function handleEntityNotFound(_0x4cdf5c,_0xbddf17){return function(_0x3c075b){if(!_0x3c075b){_0x4cdf5c['sendStatus'](0x194);}return _0x3c075b;};}function handleError(_0x570c0f,_0x1f05e6){_0x1f05e6=_0x1f05e6||0x1f4;return function(_0x2b40af){logger[_0xf7b5('0x24')](_0x2b40af[_0xf7b5('0x25')]);if(_0x2b40af['name']){delete _0x2b40af['name'];}_0x570c0f[_0xf7b5('0x1e')](_0x1f05e6)['send'](_0x2b40af);};}exports[_0xf7b5('0x26')]=function(_0x4cc7a3,_0x479bac){var _0x57ae07={},_0x2115e9={},_0x48c004={'count':0x0,'rows':[]};var _0x572237=_['map'](db[_0xf7b5('0x27')][_0xf7b5('0x28')],function(_0x3023c2){return{'name':_0x3023c2[_0xf7b5('0x29')],'type':_0x3023c2[_0xf7b5('0x2a')]['key']};});_0x2115e9[_0xf7b5('0x2b')]=_[_0xf7b5('0x2c')](_0x572237,_0xf7b5('0x2d'));_0x2115e9[_0xf7b5('0x2e')]=_[_0xf7b5('0x2f')](_0x4cc7a3[_0xf7b5('0x2e')]);_0x2115e9[_0xf7b5('0x30')]=_[_0xf7b5('0x31')](_0x2115e9[_0xf7b5('0x2b')],_0x2115e9[_0xf7b5('0x2e')]);_0x57ae07[_0xf7b5('0x32')]=_[_0xf7b5('0x31')](_0x2115e9[_0xf7b5('0x2b')],qs[_0xf7b5('0x33')](_0x4cc7a3['query'][_0xf7b5('0x33')]));_0x57ae07['attributes']=_0x57ae07[_0xf7b5('0x32')][_0xf7b5('0x34')]?_0x57ae07[_0xf7b5('0x32')]:_0x2115e9[_0xf7b5('0x2b')];if(!_0x4cc7a3[_0xf7b5('0x2e')][_0xf7b5('0x35')]('nolimit')){_0x57ae07[_0xf7b5('0x36')]=qs[_0xf7b5('0x36')](_0x4cc7a3['query'][_0xf7b5('0x36')]);_0x57ae07[_0xf7b5('0x1b')]=qs['offset'](_0x4cc7a3['query'][_0xf7b5('0x1b')]);}_0x57ae07[_0xf7b5('0x37')]=qs[_0xf7b5('0x38')](_0x4cc7a3[_0xf7b5('0x2e')]['sort']);_0x57ae07[_0xf7b5('0x39')]=qs[_0xf7b5('0x30')](_[_0xf7b5('0x3a')](_0x4cc7a3['query'],_0x2115e9[_0xf7b5('0x30')]),_0x572237);if(_0x4cc7a3['query']['filter']){_0x57ae07['where']=_[_0xf7b5('0x3b')](_0x57ae07[_0xf7b5('0x39')],{'$or':_[_0xf7b5('0x2c')](_0x572237,function(_0x25699e){if(_0x25699e['type']!=='VIRTUAL'){var _0x2ce4ef={};_0x2ce4ef[_0x25699e[_0xf7b5('0x2d')]]={'$like':'%'+_0x4cc7a3[_0xf7b5('0x2e')]['filter']+'%'};return _0x2ce4ef;}})});}_0x57ae07=_[_0xf7b5('0x3b')]({},_0x57ae07,_0x4cc7a3[_0xf7b5('0x3c')]);var _0x273d41={'where':_0x57ae07['where']};return db['ChatGroup'][_0xf7b5('0x1d')](_0x273d41)[_0xf7b5('0x22')](function(_0x2a86b4){_0x48c004[_0xf7b5('0x1d')]=_0x2a86b4;if(_0x4cc7a3[_0xf7b5('0x2e')][_0xf7b5('0x3d')]){_0x57ae07['include']=[{'all':!![]}];}return db['ChatGroup'][_0xf7b5('0x3e')](_0x57ae07);})['then'](function(_0x19ea52){_0x48c004[_0xf7b5('0x3f')]=_0x19ea52;return _0x48c004;})['then'](respondWithFilteredResult(_0x479bac,_0x57ae07))[_0xf7b5('0x40')](handleError(_0x479bac,null));};exports[_0xf7b5('0x41')]=function(_0x3f9b80,_0x538116){var _0x33c1ae={'raw':!![],'where':{'id':_0x3f9b80[_0xf7b5('0x42')]['id']}},_0x1615b4={};_0x1615b4[_0xf7b5('0x2b')]=_[_0xf7b5('0x2f')](db[_0xf7b5('0x27')][_0xf7b5('0x28')]);_0x1615b4[_0xf7b5('0x2e')]=_[_0xf7b5('0x2f')](_0x3f9b80[_0xf7b5('0x2e')]);_0x1615b4[_0xf7b5('0x30')]=_['intersection'](_0x1615b4['model'],_0x1615b4['query']);_0x33c1ae['attributes']=_[_0xf7b5('0x31')](_0x1615b4[_0xf7b5('0x2b')],qs[_0xf7b5('0x33')](_0x3f9b80[_0xf7b5('0x2e')]['fields']));_0x33c1ae[_0xf7b5('0x32')]=_0x33c1ae['attributes'][_0xf7b5('0x34')]?_0x33c1ae[_0xf7b5('0x32')]:_0x1615b4['model'];if(_0x3f9b80[_0xf7b5('0x2e')]['includeAll']){_0x33c1ae[_0xf7b5('0x43')]=[{'all':!![]}];}_0x33c1ae=_[_0xf7b5('0x3b')]({},_0x33c1ae,_0x3f9b80[_0xf7b5('0x3c')]);return db[_0xf7b5('0x27')][_0xf7b5('0x44')](_0x33c1ae)['then'](handleEntityNotFound(_0x538116,null))[_0xf7b5('0x22')](respondWithResult(_0x538116,null))[_0xf7b5('0x40')](handleError(_0x538116,null));};exports[_0xf7b5('0x45')]=function(_0x512d1b,_0x2bf14b){return db[_0xf7b5('0x27')][_0xf7b5('0x45')](_0x512d1b[_0xf7b5('0x46')],{})[_0xf7b5('0x22')](respondWithResult(_0x2bf14b,0xc9))[_0xf7b5('0x40')](handleError(_0x2bf14b,null));};exports[_0xf7b5('0x21')]=function(_0x1f38b9,_0x2ab240){if(_0x1f38b9[_0xf7b5('0x46')]['id']){delete _0x1f38b9[_0xf7b5('0x46')]['id'];}return db[_0xf7b5('0x27')][_0xf7b5('0x44')]({'where':{'id':_0x1f38b9[_0xf7b5('0x42')]['id']}})['then'](handleEntityNotFound(_0x2ab240,null))[_0xf7b5('0x22')](saveUpdates(_0x1f38b9['body'],null))[_0xf7b5('0x22')](respondWithResult(_0x2ab240,null))[_0xf7b5('0x40')](handleError(_0x2ab240,null));};exports['destroy']=function(_0x4ea39e,_0x257a49){return db[_0xf7b5('0x27')][_0xf7b5('0x44')]({'where':{'id':_0x4ea39e['params']['id']}})[_0xf7b5('0x22')](handleEntityNotFound(_0x257a49,null))[_0xf7b5('0x22')](removeEntity(_0x257a49,null))[_0xf7b5('0x40')](handleError(_0x257a49,null));};exports[_0xf7b5('0x47')]=function(_0x58785d,_0x375429){return db[_0xf7b5('0x27')][_0xf7b5('0x47')]()[_0xf7b5('0x22')](respondWithResult(_0x375429,null))[_0xf7b5('0x40')](handleError(_0x375429,null));};exports[_0xf7b5('0x48')]=function(_0x4713ff,_0x1b070b,_0x70942c){return db[_0xf7b5('0x49')]['count']({'where':{'ChatGroupId':_0x4713ff[_0xf7b5('0x42')]['id'],'ToId':_0x4713ff[_0xf7b5('0x4a')]['id'],'read':![]}})[_0xf7b5('0x22')](function(_0x28f961){return{'id':_[_0xf7b5('0x4b')](_0x4713ff['params']['id']),'count':_0x28f961};})[_0xf7b5('0x22')](respondWithResult(_0x1b070b,null))['catch'](handleError(_0x1b070b,null));};exports['addMembers']=function(_0xaaa12b,_0xa2942f,_0x4a00f4){return db[_0xf7b5('0x27')][_0xf7b5('0x44')]({'where':{'id':_0xaaa12b['params']['id']}})['then'](handleEntityNotFound(_0xa2942f,null))['then'](function(_0x4f6a06){if(_0x4f6a06){return _0x4f6a06[_0xf7b5('0x4c')](_0xaaa12b[_0xf7b5('0x46')]['ids'],_[_0xf7b5('0x4d')](_0xaaa12b[_0xf7b5('0x46')],['ids','id'])||{});}})['then'](respondWithResult(_0xa2942f,null))[_0xf7b5('0x40')](handleError(_0xa2942f,null));};exports[_0xf7b5('0x4e')]=function(_0x1db8a1,_0x179c44,_0xa122c0){var _0x1da8be={};var _0xed6b17={};var _0x58b59b;var _0x222944;return db[_0xf7b5('0x27')][_0xf7b5('0x4f')]({'where':{'id':_0x1db8a1[_0xf7b5('0x42')]['id']}})[_0xf7b5('0x22')](handleEntityNotFound(_0x179c44,null))[_0xf7b5('0x22')](function(_0x549055){if(_0x549055){_0x58b59b=_0x549055;_0xed6b17[_0xf7b5('0x2b')]=_['keys'](db[_0xf7b5('0x50')]['rawAttributes']);_0xed6b17['query']=_[_0xf7b5('0x2f')](_0x1db8a1[_0xf7b5('0x2e')]);_0xed6b17[_0xf7b5('0x30')]=_[_0xf7b5('0x31')](_0xed6b17[_0xf7b5('0x2b')],_0xed6b17[_0xf7b5('0x2e')]);_0x1da8be[_0xf7b5('0x32')]=_[_0xf7b5('0x31')](_0xed6b17[_0xf7b5('0x2b')],qs[_0xf7b5('0x33')](_0x1db8a1['query'][_0xf7b5('0x33')]));_0x1da8be[_0xf7b5('0x32')]=_0x1da8be[_0xf7b5('0x32')][_0xf7b5('0x34')]?_0x1da8be[_0xf7b5('0x32')]:_0xed6b17[_0xf7b5('0x2b')];_0x1da8be[_0xf7b5('0x37')]=qs[_0xf7b5('0x38')](_0x1db8a1[_0xf7b5('0x2e')][_0xf7b5('0x38')]);_0x1da8be[_0xf7b5('0x39')]=qs[_0xf7b5('0x30')](_['pick'](_0x1db8a1[_0xf7b5('0x2e')],_0xed6b17['filters']));if(_0x1db8a1[_0xf7b5('0x2e')][_0xf7b5('0x51')]){_0x1da8be[_0xf7b5('0x39')]=_[_0xf7b5('0x3b')](_0x1da8be[_0xf7b5('0x39')],{'$or':_[_0xf7b5('0x2c')](_0x1da8be['attributes'],function(_0x29078e){var _0x291013={};_0x291013[_0x29078e]={'$like':'%'+_0x1db8a1[_0xf7b5('0x2e')][_0xf7b5('0x51')]+'%'};return _0x291013;})});}_0x1da8be=_['merge']({},_0x1da8be,_0x1db8a1[_0xf7b5('0x3c')]);return _0x58b59b[_0xf7b5('0x4e')](_0x1da8be);}})[_0xf7b5('0x22')](function(_0x2b215a){if(_0x2b215a){_0x222944=_0x2b215a['length'];if(!_0x1db8a1[_0xf7b5('0x2e')]['hasOwnProperty'](_0xf7b5('0x52'))){_0x1da8be[_0xf7b5('0x36')]=qs[_0xf7b5('0x36')](_0x1db8a1['query'][_0xf7b5('0x36')]);_0x1da8be[_0xf7b5('0x1b')]=qs['offset'](_0x1db8a1[_0xf7b5('0x2e')]['offset']);}return _0x58b59b[_0xf7b5('0x4e')](_0x1da8be);}})[_0xf7b5('0x22')](function(_0xcd0b4d){if(_0xcd0b4d){return _0xcd0b4d?{'count':_0x222944,'rows':_0xcd0b4d}:null;}})[_0xf7b5('0x22')](respondWithResult(_0x179c44,null))[_0xf7b5('0x40')](handleError(_0x179c44,null));};exports[_0xf7b5('0x53')]=function(_0x1c6b53,_0x2531d6,_0x2d1b2a){return db['ChatGroup'][_0xf7b5('0x44')]({'where':{'id':_0x1c6b53[_0xf7b5('0x42')]['id']}})[_0xf7b5('0x22')](handleEntityNotFound(_0x2531d6,null))[_0xf7b5('0x22')](function(_0x377cf3){if(_0x377cf3){return _0x377cf3['removeMembers'](_0x1c6b53[_0xf7b5('0x2e')]['ids']);}})[_0xf7b5('0x22')](respondWithStatusCode(_0x2531d6,null))[_0xf7b5('0x40')](handleError(_0x2531d6,null));};exports[_0xf7b5('0x54')]=function(_0x573569,_0x24504c,_0x5f2a42){if(_0x573569[_0xf7b5('0x46')]['id']){delete _0x573569[_0xf7b5('0x46')]['id'];}return db[_0xf7b5('0x27')][_0xf7b5('0x44')]({'where':{'id':_0x573569['params']['id']}})[_0xf7b5('0x22')](handleEntityNotFound(_0x24504c,null))[_0xf7b5('0x22')](function(_0x11f587){if(_0x11f587){_0x573569[_0xf7b5('0x46')][_0xf7b5('0x55')]=_0x11f587['id'];return db[_0xf7b5('0x49')][_0xf7b5('0x45')](_0x573569[_0xf7b5('0x46')]);}})[_0xf7b5('0x22')](respondWithResult(_0x24504c,null))[_0xf7b5('0x40')](handleError(_0x24504c,null));};exports['getMessages']=function(_0x1b67b7,_0x1d9d6e,_0x1cfbf1){var _0x21bc17={};var _0x31adaa={};var _0x322d2f;var _0x63f9fd;return db['ChatGroup']['findOne']({'where':{'id':_0x1b67b7['params']['id']}})[_0xf7b5('0x22')](handleEntityNotFound(_0x1d9d6e,null))[_0xf7b5('0x22')](function(_0x11a99f){if(_0x11a99f){_0x322d2f=_0x11a99f;_0x31adaa[_0xf7b5('0x2b')]=_[_0xf7b5('0x2f')](db['ChatInternalMessage'][_0xf7b5('0x28')]);_0x31adaa[_0xf7b5('0x2e')]=_[_0xf7b5('0x2f')](_0x1b67b7[_0xf7b5('0x2e')]);_0x31adaa[_0xf7b5('0x30')]=_[_0xf7b5('0x31')](_0x31adaa[_0xf7b5('0x2b')],_0x31adaa[_0xf7b5('0x2e')]);_0x21bc17['attributes']=_[_0xf7b5('0x31')](_0x31adaa[_0xf7b5('0x2b')],qs[_0xf7b5('0x33')](_0x1b67b7[_0xf7b5('0x2e')][_0xf7b5('0x33')]));_0x21bc17[_0xf7b5('0x32')]=_0x21bc17[_0xf7b5('0x32')][_0xf7b5('0x34')]?_0x21bc17[_0xf7b5('0x32')]:_0x31adaa[_0xf7b5('0x2b')];_0x21bc17[_0xf7b5('0x37')]=qs['sort'](_0x1b67b7[_0xf7b5('0x2e')][_0xf7b5('0x38')]);_0x21bc17[_0xf7b5('0x39')]=qs[_0xf7b5('0x30')](_['pick'](_0x1b67b7[_0xf7b5('0x2e')],_0x31adaa[_0xf7b5('0x30')]));if(_0x1b67b7[_0xf7b5('0x2e')][_0xf7b5('0x51')]){_0x21bc17['where']=_[_0xf7b5('0x3b')](_0x21bc17['where'],{'$or':_[_0xf7b5('0x2c')](_0x21bc17[_0xf7b5('0x32')],function(_0x4b0083){var _0x1442d9={};_0x1442d9[_0x4b0083]={'$like':'%'+_0x1b67b7[_0xf7b5('0x2e')][_0xf7b5('0x51')]+'%'};return _0x1442d9;})});}if(_0x1b67b7[_0xf7b5('0x2e')]['$gte']){var _0x505cbe=_0x1b67b7[_0xf7b5('0x2e')][_0xf7b5('0x56')][_0xf7b5('0x57')](',');var _0x21ef9c={};_0x21ef9c[_0x505cbe[0x0]]={'$gte':moment(_0x505cbe[0x1])[_0xf7b5('0x58')](_0xf7b5('0x59'))};_0x21bc17[_0xf7b5('0x39')]=_[_0xf7b5('0x3b')](_0x21bc17[_0xf7b5('0x39')],_0x21ef9c);}_0x21bc17=_[_0xf7b5('0x3b')]({},_0x21bc17,_0x1b67b7[_0xf7b5('0x3c')]);return _0x322d2f[_0xf7b5('0x5a')](_0x21bc17);}})[_0xf7b5('0x22')](function(_0x16f6a9){if(_0x16f6a9){_0x63f9fd=_0x16f6a9['length'];if(!_0x1b67b7[_0xf7b5('0x2e')][_0xf7b5('0x35')](_0xf7b5('0x52'))){_0x21bc17['limit']=qs[_0xf7b5('0x36')](_0x1b67b7[_0xf7b5('0x2e')][_0xf7b5('0x36')]);_0x21bc17['offset']=qs[_0xf7b5('0x1b')](_0x1b67b7['query']['offset']);}return _0x322d2f[_0xf7b5('0x5a')](_0x21bc17);}})[_0xf7b5('0x22')](function(_0x46f239){if(_0x46f239){return _0x46f239?{'count':_0x63f9fd,'rows':_0x46f239}:null;}})[_0xf7b5('0x22')](respondWithResult(_0x1d9d6e,null))[_0xf7b5('0x40')](handleError(_0x1d9d6e,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 96dc07a..2a12987 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 _0x5e36=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2cb467,_0x3c459f){var _0x3f3bde=function(_0x38090a){while(--_0x38090a){_0x2cb467['push'](_0x2cb467['shift']());}};_0x3f3bde(++_0x3c459f);}(_0x5e36,0xc8));var _0x65e3=function(_0x141dc2,_0x5463ce){_0x141dc2=_0x141dc2-0x0;var _0xe38758=_0x5e36[_0x141dc2];return _0xe38758;};'use strict';var EventEmitter=require(_0x65e3('0x0'));var ChatGroup=require(_0x65e3('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x65e3('0x2')](0x0);var events={'afterCreate':_0x65e3('0x3'),'afterUpdate':_0x65e3('0x4'),'afterDestroy':_0x65e3('0x5')};function emitEvent(_0x2e5411){return function(_0x12aad3,_0x795b2d,_0x431a4f){ChatGroupEvents[_0x65e3('0x6')](_0x2e5411+':'+_0x12aad3['id'],_0x12aad3);ChatGroupEvents['emit'](_0x2e5411,_0x12aad3);_0x431a4f(null);};}for(var e in events){if(events[_0x65e3('0x7')](e)){var event=events[e];ChatGroup[_0x65e3('0x8')](e,emitEvent(event));}}module[_0x65e3('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x5ae9=['hasOwnProperty','hook','exports','events','setMaxListeners','save','remove','emit'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5ae9,0x19b));var _0x95ae=function(_0x19cd2a,_0x52bf9e){_0x19cd2a=_0x19cd2a-0x0;var _0x41f8b7=_0x5ae9[_0x19cd2a];return _0x41f8b7;};'use strict';var EventEmitter=require(_0x95ae('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x95ae('0x1')](0x0);var events={'afterCreate':_0x95ae('0x2'),'afterUpdate':'update','afterDestroy':_0x95ae('0x3')};function emitEvent(_0x43c580){return function(_0x559cb2,_0x22469d,_0x4a965c){ChatGroupEvents[_0x95ae('0x4')](_0x43c580+':'+_0x559cb2['id'],_0x559cb2);ChatGroupEvents[_0x95ae('0x4')](_0x43c580,_0x559cb2);_0x4a965c(null);};}for(var e in events){if(events[_0x95ae('0x5')](e)){var event=events[e];ChatGroup[_0x95ae('0x6')](e,emitEvent(event));}}module[_0x95ae('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index fce6345..9aeab3a 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 _0x2caf=['api','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2caf,0x141));var _0xf2ca=function(_0x52e01b,_0x19fed3){_0x52e01b=_0x52e01b-0x0;var _0x1b4aa8=_0x2caf[_0x52e01b];return _0x1b4aa8;};'use strict';var _=require(_0xf2ca('0x0'));var util=require(_0xf2ca('0x1'));var logger=require(_0xf2ca('0x2'))(_0xf2ca('0x3'));var moment=require('moment');var BPromise=require(_0xf2ca('0x4'));var rp=require(_0xf2ca('0x5'));var fs=require('fs');var path=require(_0xf2ca('0x6'));var rimraf=require(_0xf2ca('0x7'));var config=require('../../config/environment');var attributes=require(_0xf2ca('0x8'));module[_0xf2ca('0x9')]=function(_0x240206,_0x7c684d){return _0x240206['define'](_0xf2ca('0xa'),attributes,{'tableName':_0xf2ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd957=['ChatGroup','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./chatGroup.attributes','exports'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0xd957,0x1a5));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7d95('0x0'));var util=require(_0x7d95('0x1'));var logger=require(_0x7d95('0x2'))('api');var moment=require(_0x7d95('0x3'));var BPromise=require('bluebird');var rp=require(_0x7d95('0x4'));var fs=require('fs');var path=require(_0x7d95('0x5'));var rimraf=require(_0x7d95('0x6'));var config=require('../../config/environment');var attributes=require(_0x7d95('0x7'));module[_0x7d95('0x8')]=function(_0x1ca64b,_0x14ac21){return _0x1ca64b['define'](_0x7d95('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 469bd83..2520240 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 _0x8bda=['http','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8bda,0x104));var _0xa8bd=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0x8bda[_0xf55e73];return _0x116b99;};'use strict';var _=require(_0xa8bd('0x0'));var util=require(_0xa8bd('0x1'));var moment=require(_0xa8bd('0x2'));var BPromise=require(_0xa8bd('0x3'));var rs=require(_0xa8bd('0x4'));var fs=require('fs');var Redis=require(_0xa8bd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8bd('0x6'));var logger=require(_0xa8bd('0x7'))('rpc');var config=require(_0xa8bd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8bd('0x9')][_0xa8bd('0xa')]({'port':0x232a});config['redis']=_[_0xa8bd('0xb')](config[_0xa8bd('0xc')],{'host':_0xa8bd('0xd'),'port':0x18eb});var socket=require(_0xa8bd('0xe'))(new Redis(config[_0xa8bd('0xc')]));require('./chatGroup.socket')[_0xa8bd('0xf')](socket);function respondWithRpcPromise(_0x47316a,_0x8253b4,_0x3bcc02){return new BPromise(function(_0x56dba9,_0xbff49b){return client[_0xa8bd('0x10')](_0x47316a,_0x3bcc02)['then'](function(_0x141d4f){logger[_0xa8bd('0x11')](_0xa8bd('0x12'),_0x8253b4,_0xa8bd('0x13'));logger[_0xa8bd('0x14')](_0xa8bd('0x15'),_0x8253b4,_0xa8bd('0x13'),JSON[_0xa8bd('0x16')](_0x141d4f));if(_0x141d4f[_0xa8bd('0x17')]){if(_0x141d4f[_0xa8bd('0x17')][_0xa8bd('0x18')]===0x1f4){logger[_0xa8bd('0x17')](_0xa8bd('0x12'),_0x8253b4,_0x141d4f[_0xa8bd('0x17')][_0xa8bd('0x19')]);return _0xbff49b(_0x141d4f['error'][_0xa8bd('0x19')]);}logger['error'](_0xa8bd('0x12'),_0x8253b4,_0x141d4f['error']['message']);return _0x56dba9(_0x141d4f[_0xa8bd('0x17')][_0xa8bd('0x19')]);}else{logger[_0xa8bd('0x11')](_0xa8bd('0x12'),_0x8253b4,'request\x20sent');_0x56dba9(_0x141d4f[_0xa8bd('0x1a')]['message']);}})['catch'](function(_0x57bdeb){logger['error'](_0xa8bd('0x12'),_0x8253b4,_0x57bdeb);_0xbff49b(_0x57bdeb);});});}
\ No newline at end of file
+var _0xf9fd=['stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','client','http','defaults','redis','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x243226,_0x3c42ef){var _0x375e75=function(_0x56c7d3){while(--_0x56c7d3){_0x243226['push'](_0x243226['shift']());}};_0x375e75(++_0x3c42ef);}(_0xf9fd,0x118));var _0xdf9f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf9fd[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xdf9f('0x0'));var util=require(_0xdf9f('0x1'));var moment=require(_0xdf9f('0x2'));var BPromise=require('bluebird');var rs=require(_0xdf9f('0x3'));var fs=require('fs');var Redis=require(_0xdf9f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf9f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdf9f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdf9f('0x7')][_0xdf9f('0x8')]({'port':0x232a});config['redis']=_[_0xdf9f('0x9')](config[_0xdf9f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf9f('0xb'))(new Redis(config[_0xdf9f('0xa')]));require('./chatGroup.socket')[_0xdf9f('0xc')](socket);function respondWithRpcPromise(_0x83167b,_0x20e4a2,_0x4a6e2c){return new BPromise(function(_0x3020c4,_0x452283){return client[_0xdf9f('0xd')](_0x83167b,_0x4a6e2c)[_0xdf9f('0xe')](function(_0x178b59){logger[_0xdf9f('0xf')](_0xdf9f('0x10'),_0x20e4a2,_0xdf9f('0x11'));logger['debug'](_0xdf9f('0x12'),_0x20e4a2,'request\x20sent',JSON[_0xdf9f('0x13')](_0x178b59));if(_0x178b59[_0xdf9f('0x14')]){if(_0x178b59[_0xdf9f('0x14')][_0xdf9f('0x15')]===0x1f4){logger[_0xdf9f('0x14')](_0xdf9f('0x10'),_0x20e4a2,_0x178b59[_0xdf9f('0x14')]['message']);return _0x452283(_0x178b59[_0xdf9f('0x14')][_0xdf9f('0x16')]);}logger[_0xdf9f('0x14')](_0xdf9f('0x10'),_0x20e4a2,_0x178b59['error'][_0xdf9f('0x16')]);return _0x3020c4(_0x178b59['error'][_0xdf9f('0x16')]);}else{logger[_0xdf9f('0xf')](_0xdf9f('0x10'),_0x20e4a2,_0xdf9f('0x11'));_0x3020c4(_0x178b59['result'][_0xdf9f('0x16')]);}})['catch'](function(_0x3ee1fc){logger[_0xdf9f('0x14')](_0xdf9f('0x10'),_0x20e4a2,_0x3ee1fc);_0x452283(_0x3ee1fc);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 0551a42..c1f2319 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 _0x3e6e=['./chatGroup.events','save','remove','update','emit','removeListener','chatGroup:'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x3e6e,0x134));var _0xe3e6=function(_0x35d3b9,_0x35c1e6){_0x35d3b9=_0x35d3b9-0x0;var _0x13910d=_0x3e6e[_0x35d3b9];return _0x13910d;};'use strict';var ChatGroupEvents=require(_0xe3e6('0x0'));var events=[_0xe3e6('0x1'),_0xe3e6('0x2'),_0xe3e6('0x3')];function createListener(_0x3211ad,_0x59fdbc){return function(_0x513cbe){_0x59fdbc[_0xe3e6('0x4')](_0x3211ad,_0x513cbe);};}function removeListener(_0x43eb57,_0x3ea1ce){return function(){ChatGroupEvents[_0xe3e6('0x5')](_0x43eb57,_0x3ea1ce);};}exports['register']=function(_0x4fd3f4){for(var _0x4435e1=0x0,_0x2c4ce2=events['length'];_0x4435e1<_0x2c4ce2;_0x4435e1++){var _0x8b4d60=events[_0x4435e1];var _0x5ccf46=createListener(_0xe3e6('0x6')+_0x8b4d60,_0x4fd3f4);ChatGroupEvents['on'](_0x8b4d60,_0x5ccf46);}};
\ No newline at end of file
+var _0x8062=['update','length','./chatGroup.events','remove'];(function(_0x52fdaf,_0x56d9b1){var _0x5cf2b0=function(_0x26eb9f){while(--_0x26eb9f){_0x52fdaf['push'](_0x52fdaf['shift']());}};_0x5cf2b0(++_0x56d9b1);}(_0x8062,0x8a));var _0x2806=function(_0xda6ad8,_0x102e5e){_0xda6ad8=_0xda6ad8-0x0;var _0x513b3f=_0x8062[_0xda6ad8];return _0x513b3f;};'use strict';var ChatGroupEvents=require(_0x2806('0x0'));var events=['save',_0x2806('0x1'),_0x2806('0x2')];function createListener(_0x4bab78,_0x4c15d0){return function(_0x51b10d){_0x4c15d0['emit'](_0x4bab78,_0x51b10d);};}function removeListener(_0x419a34,_0x4e9c19){return function(){ChatGroupEvents['removeListener'](_0x419a34,_0x4e9c19);};}exports['register']=function(_0xa2b859){for(var _0x442a2e=0x0,_0x2719cc=events[_0x2806('0x3')];_0x442a2e<_0x2719cc;_0x442a2e++){var _0x895eea=events[_0x442a2e];var _0x21d8cf=createListener('chatGroup:'+_0x895eea,_0xa2b859);ChatGroupEvents['on'](_0x895eea,_0x21d8cf);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index dac8b25..488d3bb 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 _0xe8dc=['removeMembers','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','create','/:id/members','addMembers','post','addMessage','put','update','delete'];(function(_0x55b372,_0x4aaa3d){var _0x517e0a=function(_0x45a31c){while(--_0x45a31c){_0x55b372['push'](_0x55b372['shift']());}};_0x517e0a(++_0x4aaa3d);}(_0xe8dc,0x97));var _0xce8d=function(_0x216799,_0x44b817){_0x216799=_0x216799-0x0;var _0x3661c3=_0xe8dc[_0x216799];return _0x3661c3;};'use strict';var multer=require(_0xce8d('0x0'));var util=require(_0xce8d('0x1'));var path=require(_0xce8d('0x2'));var timeout=require('connect-timeout');var express=require(_0xce8d('0x3'));var router=express[_0xce8d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xce8d('0x5'));var interaction=require(_0xce8d('0x6'));var config=require(_0xce8d('0x7'));var controller=require('./chatGroup.controller');router[_0xce8d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xce8d('0x8')]('/describe',auth[_0xce8d('0x9')](),controller['describe']);router[_0xce8d('0x8')](_0xce8d('0xa'),auth['isAuthenticated'](),controller[_0xce8d('0xb')]);router[_0xce8d('0x8')](_0xce8d('0xc'),auth[_0xce8d('0x9')](),controller[_0xce8d('0xd')]);router[_0xce8d('0x8')]('/:id/members',auth[_0xce8d('0x9')](),controller[_0xce8d('0xe')]);router[_0xce8d('0x8')](_0xce8d('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth[_0xce8d('0x9')](),controller[_0xce8d('0x10')]);router['post'](_0xce8d('0x11'),auth[_0xce8d('0x9')](),controller[_0xce8d('0x12')]);router[_0xce8d('0x13')]('/:id/messages',auth[_0xce8d('0x9')](),controller[_0xce8d('0x14')]);router[_0xce8d('0x15')](_0xce8d('0xa'),auth[_0xce8d('0x9')](),controller[_0xce8d('0x16')]);router[_0xce8d('0x17')](_0xce8d('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xce8d('0x17')](_0xce8d('0x11'),auth[_0xce8d('0x9')](),controller[_0xce8d('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x4b47=['describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','put','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x1190e3,_0x195efb){var _0x54dc96=function(_0x2da9ff){while(--_0x2da9ff){_0x1190e3['push'](_0x1190e3['shift']());}};_0x54dc96(++_0x195efb);}(_0x4b47,0x15c));var _0x74b4=function(_0x41c52d,_0x1ee6cb){_0x41c52d=_0x41c52d-0x0;var _0xa7ccc9=_0x4b47[_0x41c52d];return _0xa7ccc9;};'use strict';var multer=require('multer');var util=require(_0x74b4('0x0'));var path=require(_0x74b4('0x1'));var timeout=require(_0x74b4('0x2'));var express=require(_0x74b4('0x3'));var router=express[_0x74b4('0x4')]();var fs_extra=require(_0x74b4('0x5'));var auth=require(_0x74b4('0x6'));var interaction=require(_0x74b4('0x7'));var config=require(_0x74b4('0x8'));var controller=require('./chatGroup.controller');router[_0x74b4('0x9')]('/',auth['isAuthenticated'](),controller[_0x74b4('0xa')]);router['get']('/describe',auth[_0x74b4('0xb')](),controller[_0x74b4('0xc')]);router[_0x74b4('0x9')](_0x74b4('0xd'),auth[_0x74b4('0xb')](),controller[_0x74b4('0xe')]);router[_0x74b4('0x9')](_0x74b4('0xf'),auth[_0x74b4('0xb')](),controller[_0x74b4('0x10')]);router[_0x74b4('0x9')](_0x74b4('0x11'),auth[_0x74b4('0xb')](),controller[_0x74b4('0x12')]);router[_0x74b4('0x9')](_0x74b4('0x13'),auth[_0x74b4('0xb')](),controller[_0x74b4('0x14')]);router[_0x74b4('0x15')]('/',auth[_0x74b4('0xb')](),controller[_0x74b4('0x16')]);router['post'](_0x74b4('0x11'),auth[_0x74b4('0xb')](),controller['addMembers']);router[_0x74b4('0x15')](_0x74b4('0x13'),auth[_0x74b4('0xb')](),controller[_0x74b4('0x17')]);router[_0x74b4('0x18')](_0x74b4('0xd'),auth[_0x74b4('0xb')](),controller[_0x74b4('0x19')]);router[_0x74b4('0x1a')](_0x74b4('0xd'),auth[_0x74b4('0xb')](),controller[_0x74b4('0x1b')]);router[_0x74b4('0x1a')](_0x74b4('0x11'),auth[_0x74b4('0xb')](),controller[_0x74b4('0x1c')]);module[_0x74b4('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 186c177..71c3957 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 _0x74f4=['sequelize','exports','INTEGER','ENUM','thumb','TEXT','STRING','long','DATE','out'];(function(_0x7855ae,_0x28e4e3){var _0x17c7d9=function(_0xe99597){while(--_0xe99597){_0x7855ae['push'](_0x7855ae['shift']());}};_0x17c7d9(++_0x28e4e3);}(_0x74f4,0xaa));var _0x474f=function(_0x586b36,_0x3b3662){_0x586b36=_0x586b36-0x0;var _0x125189=_0x74f4[_0x586b36];return _0x125189;};'use strict';var Sequelize=require(_0x474f('0x0'));module[_0x474f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x474f('0x2')]},'ratingType':{'type':Sequelize[_0x474f('0x3')]('star',_0x474f('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x474f('0x5')]},'pathTranscript':{'type':Sequelize[_0x474f('0x5')]},'mailTranscript':{'type':Sequelize[_0x474f('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x474f('0x6')]},'secondDisposition':{'type':Sequelize[_0x474f('0x6')]},'thirdDisposition':{'type':Sequelize[_0x474f('0x6')]},'note':{'type':Sequelize[_0x474f('0x6')]},'browserName':{'type':Sequelize[_0x474f('0x6')]},'browserVersion':{'type':Sequelize[_0x474f('0x6')]},'osName':{'type':Sequelize[_0x474f('0x6')]},'osVersion':{'type':Sequelize[_0x474f('0x6')]},'deviceModel':{'type':Sequelize[_0x474f('0x6')]},'deviceVendor':{'type':Sequelize[_0x474f('0x6')]},'deviceType':{'type':Sequelize[_0x474f('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x474f('0x6')]},'formData':{'type':Sequelize[_0x474f('0x5')](_0x474f('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x474f('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x474f('0x3')]('in',_0x474f('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x474f('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x474f('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xe28e=['DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x25858d,_0x5d2b57){var _0x41ef82=function(_0x12f829){while(--_0x12f829){_0x25858d['push'](_0x25858d['shift']());}};_0x41ef82(++_0x5d2b57);}(_0xe28e,0x1ba));var _0xee28=function(_0x5ae9c1,_0x1ff731){_0x5ae9c1=_0x5ae9c1-0x0;var _0x42b03e=_0xe28e[_0x5ae9c1];return _0x42b03e;};'use strict';var Sequelize=require(_0xee28('0x0'));module[_0xee28('0x1')]={'closed':{'type':Sequelize[_0xee28('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xee28('0x3')]},'ratingType':{'type':Sequelize[_0xee28('0x4')](_0xee28('0x5'),_0xee28('0x6')),'defaultValue':_0xee28('0x5')},'ratingMessage':{'type':Sequelize[_0xee28('0x7')]},'pathTranscript':{'type':Sequelize[_0xee28('0x7')]},'mailTranscript':{'type':Sequelize[_0xee28('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xee28('0x9')]},'disposition':{'type':Sequelize[_0xee28('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xee28('0x8')]},'note':{'type':Sequelize[_0xee28('0x8')]},'browserName':{'type':Sequelize[_0xee28('0x8')]},'browserVersion':{'type':Sequelize[_0xee28('0x8')]},'osName':{'type':Sequelize[_0xee28('0x8')]},'osVersion':{'type':Sequelize[_0xee28('0x8')]},'deviceModel':{'type':Sequelize[_0xee28('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xee28('0x8')]},'formData':{'type':Sequelize[_0xee28('0x7')]('long')},'read1stAt':{'type':Sequelize[_0xee28('0x9')]},'lastMsgAt':{'type':Sequelize[_0xee28('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xee28('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xee28('0x8')]},'customerPort':{'type':Sequelize[_0xee28('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xee28('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xee28('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 bf43fd5..d595d5a 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 _0x9f62=['findAll','getMyMessages','addTags','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','firstName','lastName','read','Account','Owner','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','downloadInteraction.ejs','.pdf','err','zip-dir','moment','bluebird','mustache','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','stack','name','send','render','merge','body','contact','account','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','talking','answered','unmanaged','abandoned','total','UserId','closed','waiting','disposition','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','some','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','user','sequelize','toString','ChatInteraction','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','o.fullname','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','params','includeAll','include','find','create','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','metadata','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','ValidationError','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','join','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','User','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','nolimit','sort','$gte','options'];(function(_0x1a72b8,_0x1e4f4b){var _0x39f72d=function(_0x35aef1){while(--_0x35aef1){_0x1a72b8['push'](_0x1a72b8['shift']());}};_0x39f72d(++_0x1e4f4b);}(_0x9f62,0x154));var _0x29f6=function(_0x6b14c7,_0x593b8){_0x6b14c7=_0x6b14c7-0x0;var _0x47668c=_0x9f62[_0x6b14c7];return _0x47668c;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x29f6('0x0'));var rp=require('request-promise');var moment=require(_0x29f6('0x1'));var BPromise=require(_0x29f6('0x2'));var Mustache=require(_0x29f6('0x3'));var util=require('util');var path=require('path');var ejs=require(_0x29f6('0x4'));var fs=require('fs');var _=require(_0x29f6('0x5'));var squel=require(_0x29f6('0x6'));var Redis=require(_0x29f6('0x7'));var qs=require('../../components/parsers/qs');var as=require(_0x29f6('0x8'));var pdf=require(_0x29f6('0x9'));var logger=require(_0x29f6('0xa'))(_0x29f6('0xb'));var config=require(_0x29f6('0xc'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x29f6('0xd'),'port':0x18eb});var socket=require(_0x29f6('0xe'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x29f6('0xf')](socket);var jayson=require(_0x29f6('0x10'));var client=jayson['client'][_0x29f6('0x11')]({'port':0x232b});var client9004=jayson[_0x29f6('0x12')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5b9b6a,_0x559585,_0x57b2d2,_0x2ae0e4){return new BPromise(function(_0x55cf4,_0x189344){var _0x11a1fd=_0x2ae0e4||client;return _0x11a1fd[_0x29f6('0x13')](_0x5b9b6a,_0x57b2d2)[_0x29f6('0x14')](function(_0x35d2e2){logger[_0x29f6('0x15')](_0x29f6('0x16'),_0x559585,_0x29f6('0x17'));logger[_0x29f6('0x18')](_0x29f6('0x19'),_0x559585,_0x29f6('0x17'),JSON[_0x29f6('0x1a')](_0x35d2e2));if(_0x35d2e2[_0x29f6('0x1b')]){if(_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x559585,_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x189344(_0x35d2e2[_0x29f6('0x1b')]['message']);}logger[_0x29f6('0x1b')](_0x29f6('0x16'),_0x559585,_0x35d2e2['error'][_0x29f6('0x1d')]);return _0x55cf4(_0x35d2e2[_0x29f6('0x1b')][_0x29f6('0x1d')]);}else{logger[_0x29f6('0x15')](_0x29f6('0x16'),_0x559585,_0x29f6('0x17'));_0x55cf4(_0x35d2e2['result'][_0x29f6('0x1d')]);}})['catch'](function(_0x4acb15){logger[_0x29f6('0x1b')](_0x29f6('0x16'),_0x559585,_0x4acb15);_0x189344(_0x4acb15);});});}function respondWithStatusCode(_0x39c6b3,_0xafb5dd){_0xafb5dd=_0xafb5dd||0xcc;return function(_0x54ddeb){if(_0x54ddeb){return _0x39c6b3[_0x29f6('0x1e')](_0xafb5dd);}return _0x39c6b3['status'](_0xafb5dd)[_0x29f6('0x1f')]();};}function respondWithResult(_0xcce041,_0x4200cc){_0x4200cc=_0x4200cc||0xc8;return function(_0x1b80aa){if(_0x1b80aa){return _0xcce041['status'](_0x4200cc)[_0x29f6('0x20')](_0x1b80aa);}};}function respondWithFilteredResult(_0x4d494f,_0x47c385){return function(_0x1401fb){if(_0x1401fb){var _0x45f792=typeof _0x47c385[_0x29f6('0x21')]===_0x29f6('0x22')&&typeof _0x47c385[_0x29f6('0x23')]===_0x29f6('0x22');var _0x23c630=_0x1401fb['count'];var _0x2183b7=_0x45f792?0x0:_0x47c385[_0x29f6('0x21')];var _0x1ab8d8=_0x45f792?_0x1401fb[_0x29f6('0x24')]:_0x47c385[_0x29f6('0x21')]+_0x47c385[_0x29f6('0x23')];var _0x3790f5;if(_0x1ab8d8>=_0x23c630){_0x1ab8d8=_0x23c630;_0x3790f5=0xc8;}else{_0x3790f5=0xce;}_0x4d494f[_0x29f6('0x25')](_0x3790f5);return _0x4d494f[_0x29f6('0x26')](_0x29f6('0x27'),_0x2183b7+'-'+_0x1ab8d8+'/'+_0x23c630)[_0x29f6('0x20')](_0x1401fb);}return null;};}function saveUpdates(_0x1c3f0b){return function(_0x40c830){if(_0x40c830){return _0x40c830[_0x29f6('0x28')](_0x1c3f0b)[_0x29f6('0x14')](function(_0x218931){return _0x218931;});}return null;};}function removeEntity(_0x3a7249){return function(_0x5492c2){if(_0x5492c2){return _0x5492c2['destroy']()[_0x29f6('0x14')](function(){_0x3a7249['status'](0xcc)[_0x29f6('0x1f')]();});}};}function handleEntityNotFound(_0xc8d2c5){return function(_0x1e1bb6){if(!_0x1e1bb6){_0xc8d2c5[_0x29f6('0x1e')](0x194);}return _0x1e1bb6;};}function handleError(_0x5e5d89,_0x53e11f){_0x53e11f=_0x53e11f||0x1f4;return function(_0x1bde69){logger[_0x29f6('0x1b')](_0x1bde69[_0x29f6('0x29')]);if(_0x1bde69[_0x29f6('0x2a')]){delete _0x1bde69[_0x29f6('0x2a')];}_0x5e5d89[_0x29f6('0x25')](_0x53e11f)[_0x29f6('0x2b')](_0x1bde69);};}function getMustacheRender(_0x1c3f0f,_0xad83a3){return Mustache[_0x29f6('0x2c')](_0x1c3f0f,_[_0x29f6('0x2d')](_0xad83a3[_0x29f6('0x2e')],{'contact':_0xad83a3[_0x29f6('0x2f')],'message':_0xad83a3[_0x29f6('0x1d')],'agent':_0xad83a3['agent'],'interaction':_0xad83a3['interaction'],'account':_0xad83a3[_0x29f6('0x30')]}))||'';}function getInteractionUsers(_0x44cf19,_0x1cd62a){return new BPromise(function(_0x5416dc,_0x3e1e25){try{if(_0x1cd62a[_0x44cf19['id']]){_0x44cf19[_0x29f6('0x31')]=_[_0x29f6('0x32')](_0x1cd62a[_0x44cf19['id']],function(_0x27d945){return{'id':_0x27d945['id'],'fullname':_0x27d945[_0x29f6('0x33')]};});}}catch(_0x48fbd1){_0x3e1e25(_0x48fbd1);}_0x5416dc(_0x44cf19);});}function getInteractionTags(_0x7695ee,_0x2ad06f){return new BPromise(function(_0x2c3441,_0x1b51cc){try{if(_0x7695ee['TagIds']){_0x7695ee[_0x29f6('0x34')]=[];_0x7695ee[_0x29f6('0x35')][_0x29f6('0x36')](',')[_0x29f6('0x37')](function(_0x5ddc09){_0x7695ee['Tags'][_0x29f6('0x38')](_0x2ad06f[_0x5ddc09]);});}delete _0x7695ee['TagIds'];}catch(_0x10f077){_0x1b51cc(_0x10f077);}_0x2c3441(_0x7695ee);});}function updateChatInteraction(_0x551411,_0x3a1a75,_0x537210){return new BPromise(function(_0x34b1ea,_0x11fb2d){return getInteractionUsers(_0x551411,_0x537210)['then'](function(_0x1431fc){return getInteractionTags(_0x1431fc,_0x3a1a75);})['then'](function(_0x3f3475){return getStateInteraction(_0x3f3475);})[_0x29f6('0x14')](function(_0x4aea11){_0x34b1ea(_0x4aea11);})[_0x29f6('0x39')](function(_0xc6a6b1){_0x11fb2d(_0xc6a6b1);});});}function getStateInteraction(_0x2cad42){return new BPromise(function(_0x1e9d5a){_0x2cad42['waiting']=0x0;_0x2cad42[_0x29f6('0x3a')]=0x0;_0x2cad42[_0x29f6('0x3b')]=0x0;_0x2cad42[_0x29f6('0x3c')]=0x0;_0x2cad42[_0x29f6('0x3d')]=0x0;_0x2cad42[_0x29f6('0x3e')]=0x0;if(!_0x2cad42['closed']&&!_0x2cad42[_0x29f6('0x3f')]){_0x2cad42['waiting']+=0x1;}if(!_0x2cad42[_0x29f6('0x40')]&&_0x2cad42['UserId']){_0x2cad42[_0x29f6('0x3a')]+=0x1;if(_0x2cad42[_0x29f6('0x41')]){_0x2cad42['waiting']-=0x1;}}if(_0x2cad42[_0x29f6('0x40')]&&_0x2cad42[_0x29f6('0x42')]===_0x29f6('0x3d')){_0x2cad42[_0x29f6('0x3d')]+=0x1;if(_0x2cad42['waiting']){_0x2cad42[_0x29f6('0x41')]-=0x1;}}else if(_0x2cad42[_0x29f6('0x40')]&&!_0x2cad42[_0x29f6('0x3f')]&&_0x2cad42['disposition']){_0x2cad42[_0x29f6('0x3c')]+=0x1;if(_0x2cad42['waiting']){_0x2cad42[_0x29f6('0x41')]-=0x1;}}else if(_0x2cad42['closed']&&_0x2cad42['UserId']){_0x2cad42['answered']+=0x1;if(_0x2cad42[_0x29f6('0x3a')]){_0x2cad42[_0x29f6('0x3a')]-=0x1;}}_0x2cad42[_0x29f6('0x3e')]+=0x1;_0x1e9d5a(_0x2cad42);});}exports[_0x29f6('0x43')]=function(_0x19fd60,_0x270842){var _0x29b3f6={},_0x155ffb={},_0x352119={'count':0x0,'rows':[]};var _0x1bde93=_['map'](db['ChatInteraction'][_0x29f6('0x44')],function(_0x450e76){return{'name':_0x450e76[_0x29f6('0x45')],'type':_0x450e76[_0x29f6('0x46')]['key']};});_0x155ffb[_0x29f6('0x47')]=_[_0x29f6('0x32')](_0x1bde93,'name');_0x155ffb[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x19fd60[_0x29f6('0x48')]);_0x155ffb[_0x29f6('0x4a')]=_[_0x29f6('0x4b')](_0x155ffb[_0x29f6('0x47')],_0x155ffb[_0x29f6('0x48')]);_0x29b3f6[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x155ffb[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x19fd60[_0x29f6('0x48')]['fields']));_0x29b3f6[_0x29f6('0x4c')]=_0x29b3f6[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x29b3f6[_0x29f6('0x4c')]:_0x155ffb[_0x29f6('0x47')];if(!_0x19fd60['query'][_0x29f6('0x4f')]('nolimit')){_0x29b3f6['limit']=qs[_0x29f6('0x23')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x23')]);_0x29b3f6[_0x29f6('0x21')]=qs[_0x29f6('0x21')](_0x19fd60['query'][_0x29f6('0x21')]);}_0x29b3f6[_0x29f6('0x50')]=qs['sort'](_0x19fd60[_0x29f6('0x48')]['sort']);_0x29b3f6[_0x29f6('0x51')]=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x19fd60[_0x29f6('0x48')],_0x155ffb['filters']),_0x1bde93);var _0x199060=[];var _0xaa915c=squel[_0x29f6('0x53')]()[_0x29f6('0x54')]('id')[_0x29f6('0x54')](_0x29f6('0x2a'))[_0x29f6('0x54')]('color')[_0x29f6('0x55')](_0x29f6('0x56'));var _0x3bca11=squel[_0x29f6('0x53')]()[_0x29f6('0x54')](_0x29f6('0x57'))[_0x29f6('0x54')](_0x29f6('0x58'))[_0x29f6('0x54')](_0x29f6('0x59'))['from']('user_has_chat_interactions','ui')[_0x29f6('0x5a')](_0x29f6('0x5b'),'u',_0x29f6('0x5c'));var _0x5ab84e=squel[_0x29f6('0x53')]()['from']('chat_interactions','i')[_0x29f6('0x5a')](_0x29f6('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x29f6('0x5b'),'o',_0x29f6('0x5e'))[_0x29f6('0x5a')]('chat_websites','a',_0x29f6('0x5f'))[_0x29f6('0x5a')](_0x29f6('0x60'),'me',_0x29f6('0x61'))[_0x29f6('0x5a')](_0x29f6('0x62'),'it',_0x29f6('0x63'))[_0x29f6('0x5a')](_0x29f6('0x56'),'t',_0x29f6('0x64'));var _0x2d4c8d=squel[_0x29f6('0x65')]();var _0x434e04=[];var _0x5078d1=squel['expr']();var _0x2bd7d9;if(_0x19fd60['query'][_0x29f6('0x66')]){_0x2bd7d9=as[_0x29f6('0x67')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x66')]);var _0x2f757b=_0x2bd7d9['sqlOperator'];for(var _0x56c442=0x0;_0x56c442<_0x2bd7d9[_0x29f6('0x68')][_0x29f6('0x4e')];_0x56c442++){var _0x293f9d=_0x2bd7d9[_0x29f6('0x68')][_0x56c442];var _0x56342e='i';var _0x32291b=_['find'](_0x1bde93,['name',_0x293f9d[_0x29f6('0x54')]]);if(!_0x32291b){switch(_0x293f9d[_0x29f6('0x54')]){case'unreadMessages':if(_0x293f9d[_0x29f6('0x69')]==0x1){_0x5ab84e[_0x29f6('0x6a')]('`'+_0x293f9d['field']+_0x29f6('0x6b'));}else{_0x5ab84e[_0x29f6('0x6a')]('`'+_0x293f9d[_0x29f6('0x54')]+_0x29f6('0x6c'));}break;case _0x29f6('0x6d'):if(_0x293f9d[_0x29f6('0x6e')]===_0x29f6('0x6f')){if(_0x293f9d['value'][_0x29f6('0x36')]('\x20')['length']>0x1){_0x2d4c8d[_0x2f757b](_0x29f6('0x70'),qs['getFullTextValue'](_0x293f9d['value']),null);}else{var _0x1a3357='%'+_0x293f9d[_0x29f6('0x69')]+'%';_0x2d4c8d[_0x2f757b](_0x29f6('0x71'),_0x1a3357,_0x1a3357,_0x1a3357);}}else{_0x32291b=_['find'](_0x1bde93,[_0x29f6('0x2a'),_0x29f6('0x72')]);_0x293f9d[_0x29f6('0x54')]='ContactId';_0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b[_0x29f6('0x46')],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}break;case _0x29f6('0x76'):var _0x56f3cb=_0x293f9d[_0x29f6('0x69')][_0x29f6('0x36')](',')[_0x29f6('0x32')](function(_0x456578){return Number(_0x456578);});_0x56f3cb[_0x29f6('0x37')](function(_0x122a1a){_0x5078d1['or'](_0x29f6('0x77'),'%,'+_0x122a1a+',%');});_0x434e04=_[_0x29f6('0x78')](_0x434e04,_0x56f3cb);break;case'User':if(_0x293f9d[_0x29f6('0x6e')]===_0x29f6('0x6f')){_0x2d4c8d[_0x2f757b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x293f9d[_0x29f6('0x69')]+'%',null);}else{_0x32291b=_['find'](_0x1bde93,[_0x29f6('0x2a'),_0x29f6('0x3f')]);_0x293f9d['field']=_0x29f6('0x3f');_0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b['type'],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e['text'],_0x411f3e['value'][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}break;case _0x29f6('0x2e'):_0x411f3e=as[_0x29f6('0x73')]('me',null,_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')]['start'],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);break;}}else{var _0x411f3e=as[_0x29f6('0x73')](_0x56342e,_0x32291b['type'],_0x293f9d);_0x2d4c8d[_0x2f757b](_0x411f3e[_0x29f6('0x74')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x75')],_0x411f3e[_0x29f6('0x69')][_0x29f6('0x1f')]);}}}else{var _0x478ed0=_(_0x19fd60[_0x29f6('0x48')])[_0x29f6('0x49')]()[_0x29f6('0x32')](function(_0x1f401c){return _[_0x29f6('0x79')](_0x1bde93,[_0x29f6('0x2a'),_0x1f401c])?_0x1f401c:undefined;})['compact']()[_0x29f6('0x69')]();if(!_['isEmpty'](_0x478ed0)){_0x478ed0['forEach'](function(_0x4f9907){if(_0x4f9907===_0x29f6('0x7a')){_0x5ab84e['where'](_0x29f6('0x7b'),[][_0x29f6('0x7c')](_0x19fd60[_0x29f6('0x48')][_0x4f9907]));}else if(_0x4f9907===_0x29f6('0x7d')){var _0x8a5e58=JSON[_0x29f6('0x7e')](_0x19fd60[_0x29f6('0x48')][_0x4f9907])['$gte'];var _0x3a23f3=JSON['parse'](_0x19fd60[_0x29f6('0x48')][_0x4f9907])[_0x29f6('0x7f')];_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x80'),_0x8a5e58,_0x3a23f3);}else{if(_0x19fd60[_0x29f6('0x48')][_0x4f9907]===_0x29f6('0x81')){_0x5ab84e[_0x29f6('0x51')]('i.'+_0x4f9907+_0x29f6('0x82'));}else{_0x5ab84e[_0x29f6('0x51')]('i.'+_0x4f9907+_0x29f6('0x83'),_0x19fd60[_0x29f6('0x48')][_0x4f9907]);}}});}if(_0x19fd60[_0x29f6('0x48')]['read']){if(_0x19fd60['query']['read']==0x1){_0x5ab84e[_0x29f6('0x6a')](_0x29f6('0x84'));}else{_0x5ab84e['having'](_0x29f6('0x85'));}}if(_0x19fd60['query'][_0x29f6('0x86')]){_0x434e04=_[_0x29f6('0x87')](_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')])?_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')]:new Array(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x86')]);_0x434e04[_0x29f6('0x37')](function(_0xa2ab9e){_0x5078d1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xa2ab9e+',%');});}if(_0x19fd60[_0x29f6('0x48')]['filter']){var _0x16bb3c=_0x19fd60[_0x29f6('0x48')][_0x29f6('0x88')][_0x29f6('0x89')]('\x5c','\x5c\x5c')[_0x29f6('0x89')](/'/g,'\x27\x27');if(qs[_0x29f6('0x8a')](_0x16bb3c)){_0x2d4c8d['or'](_0x29f6('0x8b'),_0x16bb3c+'%');}else{_0x2d4c8d['or'](_0x29f6('0x8c'),qs['getFullTextValue'](_0x16bb3c))['or'](_0x29f6('0x8d'),_0x16bb3c+'%');}}}_0x5ab84e[_0x29f6('0x51')](_0x2d4c8d);_0x5ab84e['group']('i.id');var _0x216f51={'type':db[_0x29f6('0x8e')][_0x29f6('0x8f')][_0x29f6('0x90')],'raw':!![]};var _0x467dd2=_0x5ab84e[_0x29f6('0x91')]();_0x467dd2[_0x29f6('0x54')](_0x29f6('0x92'));_0x467dd2[_0x29f6('0x54')](_0x29f6('0x93'),_0x29f6('0x94'));if(_0x29b3f6[_0x29f6('0x50')]){_0x29b3f6['order']['forEach'](function(_0x2e2f16){var _0x180658=_0x2e2f16[0x0]==='contactName'?_0x2e2f16[0x0]:'i.'+_0x2e2f16[0x0];_0x5ab84e[_0x29f6('0x50')](_0x180658,_0x2e2f16[0x1]===_0x29f6('0x95')?![]:!![]);});}if(!_[_0x29f6('0x96')](_0x434e04)){_0x5ab84e[_0x29f6('0x6a')](_0x5078d1);_0x467dd2[_0x29f6('0x51')](_0x29f6('0x97'),_0x434e04);}BPromise[_0x29f6('0x98')]()['then'](function(){if(!_0x2bd7d9){if(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x7a')])return;_0x467dd2[_0x29f6('0x51')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x99'));return;}if(_0x19fd60['user'][_0x29f6('0x9a')]!==_0x29f6('0x9b'))return;return _0x19fd60['user'][_0x29f6('0x9c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x405124){if(_[_0x29f6('0x96')](_0x405124)){_0x467dd2[_0x29f6('0x51')](_0x29f6('0x9d'));_0x5ab84e[_0x29f6('0x51')](_0x29f6('0x9d'));}else{_0x467dd2['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x29f6('0x32')](_0x405124,'id'));_0x5ab84e[_0x29f6('0x51')]('i.ChatWebsiteId\x20IN\x20?',_[_0x29f6('0x32')](_0x405124,'id'));}});})['then'](function(){if(_0x19fd60[_0x29f6('0x9e')][_0x29f6('0x9a')]===_0x29f6('0x9b')&&!_0x2bd7d9&&!_0x19fd60[_0x29f6('0x48')][_0x29f6('0x7a')])return[];return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x467dd2['toString'](),_0x216f51);})[_0x29f6('0x14')](function(_0x365b6d){_0x352119[_0x29f6('0x24')]=_0x365b6d['length'];if(_0x352119['count']===0x0)return[];return db['sequelize']['query'](_0xaa915c[_0x29f6('0xa0')](),_0x216f51)['then'](function(_0x537a8d){_0x199060=_['keyBy'](_0x537a8d,'id');_0x216f51=_[_0x29f6('0x2d')](_0x216f51,{'model':db[_0x29f6('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19fd60[_0x29f6('0x48')][_0x29f6('0x4d')]){_0x29b3f6[_0x29f6('0x4c')]['forEach'](function(_0x28cf80){_0x5ab84e['field']('i.'+_0x28cf80);});}else{_0x5ab84e[_0x29f6('0x54')](_0x29f6('0x93'),_0x29f6('0x94'));_0x5ab84e[_0x29f6('0x54')]('a.key','Account.key');_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa2'),_0x29f6('0xa3'));_0x5ab84e['field'](_0x29f6('0xa4'),_0x29f6('0xa5'));_0x5ab84e['field'](_0x29f6('0xa6'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa7'),_0x29f6('0xa8'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xa9'),_0x29f6('0xaa'));_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xab'),_0x29f6('0xac'));_0x5ab84e['field'](_0x29f6('0xad'),'Contact.phone');_0x5ab84e['field']('c.mobile',_0x29f6('0xae'));_0x5ab84e[_0x29f6('0x54')]('c.fax','Contact.fax');_0x5ab84e[_0x29f6('0x54')](_0x29f6('0xaf'),'Owner.fullname');_0x5ab84e['field']('o.internal','Owner.internal');_0x5ab84e[_0x29f6('0x54')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x29f6('0x35'));}if(_0x29b3f6[_0x29f6('0x23')])_0x5ab84e['limit'](_0x29b3f6[_0x29f6('0x23')]);if(_0x29b3f6[_0x29f6('0x21')])_0x5ab84e['offset'](_0x29b3f6[_0x29f6('0x21')]);return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x5ab84e[_0x29f6('0xa0')](),_0x216f51);})[_0x29f6('0x14')](function(_0x399328){if(_0x399328[_0x29f6('0x4e')]>0x0)_0x3bca11[_0x29f6('0x51')](_0x29f6('0xb0'),_[_0x29f6('0x32')](_0x399328,'id'));return db[_0x29f6('0x9f')][_0x29f6('0x48')](_0x3bca11[_0x29f6('0xa0')](),_0x216f51)[_0x29f6('0x14')](function(_0x5076ed){var _0x24757e=_[_0x29f6('0xb1')](_0x5076ed,_0x29f6('0xb2'));var _0x264617=[];_0x399328[_0x29f6('0x37')](function(_0x3569f7){_0x264617[_0x29f6('0x38')](updateChatInteraction(_0x3569f7,_0x199060,_0x24757e));});return BPromise['all'](_0x264617);});});})[_0x29f6('0x14')](function(_0x4ec09d){_0x352119[_0x29f6('0xb3')]=_0x4ec09d;return _0x352119;})[_0x29f6('0x14')](respondWithFilteredResult(_0x270842,_0x29b3f6))[_0x29f6('0x39')](handleError(_0x270842,null));};exports[_0x29f6('0xb4')]=function(_0x43c44d,_0x63517e){var _0x2dc960={'raw':![],'where':{'id':_0x43c44d[_0x29f6('0xb5')]['id']}},_0x312a6f={};_0x312a6f['model']=_[_0x29f6('0x49')](db[_0x29f6('0xa1')]['rawAttributes']);_0x312a6f['query']=_[_0x29f6('0x49')](_0x43c44d[_0x29f6('0x48')]);_0x312a6f[_0x29f6('0x4a')]=_[_0x29f6('0x4b')](_0x312a6f['model'],_0x312a6f[_0x29f6('0x48')]);_0x2dc960[_0x29f6('0x4c')]=_['intersection'](_0x312a6f[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x43c44d[_0x29f6('0x48')][_0x29f6('0x4d')]));_0x2dc960[_0x29f6('0x4c')]=_0x2dc960[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x2dc960[_0x29f6('0x4c')]:_0x312a6f[_0x29f6('0x47')];if(_0x43c44d[_0x29f6('0x48')][_0x29f6('0xb6')]){_0x2dc960[_0x29f6('0xb7')]=[{'all':!![]}];}_0x2dc960=_[_0x29f6('0x2d')]({},_0x2dc960,_0x43c44d['options']);return db[_0x29f6('0xa1')][_0x29f6('0xb8')](_0x2dc960)[_0x29f6('0x14')](handleEntityNotFound(_0x63517e,null))[_0x29f6('0x14')](respondWithResult(_0x63517e,null))['catch'](handleError(_0x63517e,null));};exports[_0x29f6('0xb9')]=function(_0x2ffad1,_0x37ea1b){return db['ChatInteraction'][_0x29f6('0xb9')](_0x2ffad1[_0x29f6('0x2e')],{})['then'](respondWithResult(_0x37ea1b,0xc9))[_0x29f6('0x39')](handleError(_0x37ea1b,null));};exports[_0x29f6('0x28')]=function(_0x26f030,_0x247bce){if(_0x26f030[_0x29f6('0x2e')]['id']){delete _0x26f030[_0x29f6('0x2e')]['id'];}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x26f030[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x247bce,null))[_0x29f6('0x14')](saveUpdates(_0x26f030['body'],null))['then'](respondWithResult(_0x247bce,null))[_0x29f6('0x39')](handleError(_0x247bce,null));};exports[_0x29f6('0xba')]=function(_0x1621b7,_0x1f0e72){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x1621b7[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x1f0e72,null))['then'](removeEntity(_0x1f0e72,null))['catch'](handleError(_0x1f0e72,null));};exports['describe']=function(_0x1fd477,_0x45dfd1){return db[_0x29f6('0xa1')][_0x29f6('0xbb')]()['then'](respondWithResult(_0x45dfd1,null))[_0x29f6('0x39')](handleError(_0x45dfd1,null));};exports[_0x29f6('0xbc')]=function(_0x4f2471,_0x1ef540){var _0x5a51c0=_0x4f2471[_0x29f6('0xb5')]['id'];var _0x2a2e0e;var _0xaccfb7;var _0x19c10d;return db['ChatInteraction'][_0x29f6('0xbd')]({'where':{'id':_0x5a51c0}})['then'](function(_0x47785a){_0x2a2e0e=_0x47785a;return db[_0x29f6('0xbe')][_0x29f6('0xbd')]({'where':{'id':_0x47785a[_0x29f6('0x7a')]},'attributes':['id',_0x29f6('0xbf'),_0x29f6('0xc0'),'vidaooTopic','vidaooNote',_0x29f6('0xc1')],'raw':!![]});})['then'](function(_0x5db958){if(_0x5db958&&_0x5db958[_0x29f6('0xbf')]&&_0x5db958['vidaooEscalation']){_0xaccfb7=_0x5db958;var _0x67c30a={'interaction':{'id':_0x5a51c0},'agent':{'id':_0x4f2471[_0x29f6('0x9e')]['id'],'name':_0x4f2471[_0x29f6('0x9e')][_0x29f6('0x2a')],'fullname':_0x4f2471[_0x29f6('0x9e')][_0x29f6('0x33')],'email':_0x4f2471['user'][_0x29f6('0xc2')]},'contact':_0x4f2471[_0x29f6('0x2e')][_0x29f6('0x2f')],'account':_0x4f2471[_0x29f6('0x2e')][_0x29f6('0x30')]};var _0x1cec09={'rejectUnauthorized':![],'method':_0x29f6('0xc3'),'url':_0x29f6('0xc4'),'headers':{'X-APIKEY':_0x5db958[_0x29f6('0xbf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4f2471[_0x29f6('0x9e')][_0x29f6('0xc2')]],'buttons':null,'topic':_0xaccfb7['vidaooTopic'],'note':_[_0x29f6('0xc5')](_0xaccfb7[_0x29f6('0xc6')])?null:getMustacheRender(_0xaccfb7['vidaooNote'],_0x67c30a),'metadata':null},'redirect':_0x29f6('0xc7'),'json':!![]};try{if(!_[_0x29f6('0xc5')](_0xaccfb7[_0x29f6('0xc1')])){var _0x50d48d=getMustacheRender(_0xaccfb7['vidaooMetadata'],_0x67c30a);var _0x1413a5=JSON[_0x29f6('0x7e')](_0x50d48d);_0x1cec09[_0x29f6('0x2e')][_0x29f6('0xc8')]=_0x1413a5;}}catch(_0x2b6357){throw new db[(_0x29f6('0x8e'))]['ValidationError'](_0x29f6('0xc9'));}return rp(_0x1cec09);}else{throw new db[(_0x29f6('0x8e'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x231f26){_0x19c10d=_0x231f26;if(_0x19c10d['id']){var _0x578d49={'body':_0x19c10d[_0x29f6('0xca')],'ChatWebsiteId':_0xaccfb7['id'],'ChatInteractionId':_0x2a2e0e['id'],'direction':'out','UserId':_0x4f2471[_0x29f6('0x9e')]['id']};return db[_0x29f6('0xcb')][_0x29f6('0xb9')](_0x578d49,{});}else{throw new db[(_0x29f6('0x8e'))][(_0x29f6('0xcc'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x29f6('0x14')](function(){return _0x2a2e0e['updateAttributes']({'vidaooSessionId':_0x19c10d['id']});})[_0x29f6('0x14')](respondWithResult(_0x1ef540,null))[_0x29f6('0x39')](handleError(_0x1ef540,null));};exports[_0x29f6('0xcd')]=function(_0x19d1cb,_0x478660){if(_0x19d1cb[_0x29f6('0x2e')]['id']){delete _0x19d1cb[_0x29f6('0x2e')]['id'];}return db[_0x29f6('0xa1')]['find']({'where':{'id':_0x19d1cb[_0x29f6('0xb5')]['id']},'include':[{'model':db['CmContact'],'as':_0x29f6('0x6d')}]})[_0x29f6('0x14')](handleEntityNotFound(_0x478660,null))['then'](saveUpdates(_0x19d1cb[_0x29f6('0x2e')],null))['then'](respondWithResult(_0x478660,null))[_0x29f6('0x39')](handleError(_0x478660,null));};exports[_0x29f6('0xce')]=function(_0x52c66d,_0x955f7){if(_0x52c66d[_0x29f6('0x2e')]['id']){delete _0x52c66d['body']['id'];}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x52c66d[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](function(_0x352a07){if(!_0x352a07){logger[_0x29f6('0x1b')](_0x29f6('0xcf'),_0x29f6('0xce'),0x194,'entity\x20not\x20found');_0x955f7[_0x29f6('0x1e')](0x194);}else{if(_0x352a07[_0x29f6('0x3f')]){throw new db[(_0x29f6('0x8e'))][(_0x29f6('0xcc'))]('Interaction\x20already\x20assigned');}}return _0x352a07;})[_0x29f6('0x14')](function(_0x10648e){if(_0x10648e){return _0x10648e[_0x29f6('0x28')]({'closed':_0x52c66d[_0x29f6('0x2e')][_0x29f6('0x40')],'disposition':_0x52c66d['body']['disposition']})[_0x29f6('0x14')](function(_0x1b3b27){return _0x1b3b27;});}})['then'](function(){return respondWithRpcPromise(_0x29f6('0xd0'),'abandon',_0x52c66d['body'],client9004);})[_0x29f6('0x14')](respondWithResult(_0x955f7,null))['catch'](handleError(_0x955f7,null));};exports[_0x29f6('0xd1')]=function(_0x24a7fb,_0x454c4c){_0x24a7fb[_0x29f6('0x2e')]['name']=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd3')];_0x24a7fb[_0x29f6('0x2e')][_0x29f6('0xd4')]=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd5')];_0x24a7fb['body']['type']=_0x24a7fb[_0x29f6('0xd2')][_0x29f6('0xd6')];return db[_0x29f6('0xd7')][_0x29f6('0xb9')](_0x24a7fb[_0x29f6('0x2e')])[_0x29f6('0x14')](respondWithResult(_0x454c4c,0xc9))[_0x29f6('0x39')](handleError(_0x454c4c,null));};exports[_0x29f6('0xd8')]=function(_0x3d131a,_0x2bc181){return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x3d131a[_0x29f6('0xb5')]['id']},'raw':!![]})[_0x29f6('0x14')](handleEntityNotFound(_0x2bc181,null))[_0x29f6('0x14')](function(_0x583f5f){if(_0x583f5f){if(_0x583f5f[_0x29f6('0x40')]){return _0x2bc181[_0x29f6('0x25')](0x193)[_0x29f6('0x20')]({'status':0x193,'message':_0x29f6('0xd9')});}return db[_0x29f6('0xd7')]['findOne']({'where':{'id':_0x3d131a[_0x29f6('0x48')][_0x29f6('0xda')]},'raw':!![]})[_0x29f6('0x14')](handleEntityNotFound(_0x2bc181,null));}})['then'](function(_0x2378b8){if(_0x2378b8){var _0x2a5414=_0x2378b8[_0x29f6('0xdb')]!==null;var _0x189048=path['join'](config[_0x29f6('0xdc')],'server/files/attachments/');if(_0x2a5414){_0x189048=path[_0x29f6('0xdd')](_0x189048,'offline-chat/');}var _0x2aa18b=path[_0x29f6('0xdd')](_0x189048,_0x2378b8[_0x29f6('0xd4')]);return _0x2bc181[_0x29f6('0xde')](_0x2aa18b);}})['catch'](handleError(_0x2bc181,null));};exports[_0x29f6('0xdf')]=function(_0x2216ef,_0x4577ee){var _0x2ef994=null;var _0x28e4c5=null;var _0x168724=null;if(_0x2216ef[_0x29f6('0x2e')]['id']){delete _0x2216ef[_0x29f6('0x2e')]['id'];}if(_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe0')]){_0x168724=path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],'server/files/chat/upload/',util[_0x29f6('0xe1')](_0x29f6('0xe2'),Date[_0x29f6('0xe3')]()));_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe4')]=_0x168724;}return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x2216ef[_0x29f6('0xb5')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x29f6('0xe5'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x29f6('0x14')](handleEntityNotFound(_0x4577ee,null))['then'](saveUpdates(_0x2216ef[_0x29f6('0x2e')],null))[_0x29f6('0x14')](function(_0x4a3381){if(_0x4a3381){_0x2ef994=_0x4a3381;return db[_0x29f6('0xbe')][_0x29f6('0xb8')]({'where':{'id':_0x2ef994[_0x29f6('0x7a')]}});}})[_0x29f6('0x14')](function(_0xdb766a){if(_0xdb766a){_0x28e4c5=_0xdb766a;return db[_0x29f6('0xe6')][_0x29f6('0xb8')]({'where':{'id':_0x2ef994['ContactId']}});}})[_0x29f6('0x14')](function(_0x37735f){if(_0x37735f){if(_0x168724){var _0x399aed=null;for(var _0xe432b0=0x1;_0xe432b0<_0x2ef994[_0x29f6('0xe5')][_0x29f6('0x4e')];++_0xe432b0){_0x399aed=_0x2ef994['Messages'][_0xe432b0];var _0x21bc96=_0x399aed[_0x29f6('0x3f')]?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed['UserId']):_0x29f6('0xe9');var _0x46a5da=_0x2216ef['body'][_0x29f6('0xea')]||util['format']('%s%d',_0x29f6('0xeb'),_0x399aed[_0x29f6('0x72')]);switch(_0x28e4c5[_0x29f6('0xec')]){case _0x29f6('0xed'):_0x21bc96=_0x399aed['UserId']?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed[_0x29f6('0x3f')]):_0x29f6('0xe9');break;case _0x29f6('0xee'):_0x21bc96=_0x399aed[_0x29f6('0x3f')]?_0x399aed[_0x29f6('0xef')][_0x29f6('0xf0')]||_0x399aed[_0x29f6('0xef')][_0x29f6('0x33')]:_0x29f6('0xe9');break;case _0x29f6('0xf1'):_0x21bc96=_0x399aed[_0x29f6('0x3f')]?_0x399aed['User']['fullname']:_0x29f6('0xe9');break;default:_0x21bc96=_0x399aed[_0x29f6('0x3f')]?util['format'](_0x29f6('0xe7'),_0x28e4c5[_0x29f6('0xe8')],_0x399aed['UserId']):'System';}var _0x593d86=util[_0x29f6('0xe1')](_0x29f6('0xf2'),moment(_0x399aed[_0x29f6('0x7d')])[_0x29f6('0xe1')]('MM/DD/YYYY\x20HH:mm:ss'),_0x399aed[_0x29f6('0xf3')]==='in'?_0x46a5da:_0x21bc96,_0x399aed[_0x29f6('0x2e')]);if(!_0x399aed[_0x29f6('0xf4')]){fs[_0x29f6('0xf5')](_0x168724,_0x593d86);}}return db[_0x29f6('0xf6')][_0x29f6('0xbd')]({'where':{'service':!![]},'include':[{'model':db[_0x29f6('0xf7')],'as':_0x29f6('0xf8'),'raw':!![],'include':[{'model':db[_0x29f6('0xf9')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x29f6('0x14')](function(_0x294136){if(!_0x294136||!_0x294136[_0x29f6('0xf8')]||!_0x2216ef[_0x29f6('0x2e')])return _0x2ef994;var _0x59fb2a=_0x294136['getSmtpOptions']();return respondWithRpcPromise(_0x29f6('0xfa'),_0x29f6('0xfb'),{'account':_0x59fb2a,'message':{'from':util[_0x29f6('0xe1')](_0x29f6('0xfc'),_0x294136[_0x29f6('0x2a')],_0x294136['email']||_0x294136[_0x29f6('0xf8')][_0x29f6('0x9e')]),'to':_0x2216ef[_0x29f6('0x2e')][_0x29f6('0xe0')],'subject':_0x29f6('0xfd'),'text':util[_0x29f6('0xe1')](_0x29f6('0xfe'),_0x2216ef['body'][_0x29f6('0xe0')]),'attachments':[{'path':_0x168724}]}})[_0x29f6('0x14')](function(){return _0x2ef994;})[_0x29f6('0x39')](function(_0x3d027f){logger['error'](_0x3d027f);});})[_0x29f6('0x14')](respondWithStatusCode(_0x4577ee,0xc8))[_0x29f6('0x39')](handleError(_0x4577ee,null));};exports[_0x29f6('0xff')]=function(_0x2df557,_0x589222){return db[_0x29f6('0xcb')][_0x29f6('0xb8')]({'where':{'id':_0x2df557[_0x29f6('0xb5')]['id']}})['then'](handleEntityNotFound(_0x589222,null))[_0x29f6('0x14')](function(_0x318fd1){if(_0x318fd1){return _0x318fd1[_0x29f6('0xff')](_0x2df557[_0x29f6('0x2e')]['ids'],_[_0x29f6('0x100')](_0x2df557[_0x29f6('0x2e')],['ids','id'])||{});}})['then'](respondWithResult(_0x589222,null))['catch'](handleError(_0x589222,null));};exports[_0x29f6('0x101')]=function(_0x29017d,_0x5863a2){var _0x2f7729={'raw':![],'where':{}};var _0x171342={};var _0x1dafb9={'count':0x0,'rows':[]};return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x29017d['params']['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x5863a2,null))[_0x29f6('0x14')](function(_0x1207f7){if(_0x1207f7){_0x171342[_0x29f6('0x47')]=_[_0x29f6('0x49')](db[_0x29f6('0xcb')][_0x29f6('0x44')]);_0x171342[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x29017d[_0x29f6('0x48')]);_0x171342['filters']=_[_0x29f6('0x4b')](_0x171342[_0x29f6('0x47')],_0x171342['query']);_0x2f7729[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x171342[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x29017d[_0x29f6('0x48')]['fields']));_0x2f7729[_0x29f6('0x4c')]=_0x2f7729[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x2f7729['attributes']:_0x171342['model'];if(!_0x29017d[_0x29f6('0x48')][_0x29f6('0x4f')](_0x29f6('0x102'))){_0x2f7729[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x29017d[_0x29f6('0x48')]['limit']);_0x2f7729['offset']=qs[_0x29f6('0x21')](_0x29017d[_0x29f6('0x48')][_0x29f6('0x21')]);}_0x2f7729[_0x29f6('0x50')]=qs[_0x29f6('0x103')](_0x29017d[_0x29f6('0x48')]['sort']);_0x2f7729['where']=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x29017d[_0x29f6('0x48')],_0x171342['filters']));_0x2f7729['where']['ChatInteractionId']=_0x1207f7['id'];if(_0x29017d[_0x29f6('0x48')]['filter']){_0x2f7729[_0x29f6('0x51')]=_[_0x29f6('0x2d')](_0x2f7729[_0x29f6('0x51')],{'$or':_[_0x29f6('0x32')](_0x2f7729[_0x29f6('0x4c')],function(_0x25532f){var _0x31ebb3={};_0x31ebb3[_0x25532f]={'$like':'%'+_0x29017d[_0x29f6('0x48')][_0x29f6('0x88')]+'%'};return _0x31ebb3;})});}if(_0x29017d['query'][_0x29f6('0x104')]){var _0x173977=_0x29017d['query'][_0x29f6('0x104')][_0x29f6('0x36')](',');var _0x43acdc={};_0x43acdc[_0x173977[0x0]]={'$gte':moment(_0x173977[0x1])[_0x29f6('0xe1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2f7729['where']=_[_0x29f6('0x2d')](_0x2f7729[_0x29f6('0x51')],_0x43acdc);}_0x2f7729=_[_0x29f6('0x2d')]({},_0x2f7729,_0x29017d[_0x29f6('0x105')]);return db[_0x29f6('0xcb')]['count']({'where':_0x2f7729['where']})[_0x29f6('0x14')](function(_0x216ad8){_0x1dafb9['count']=_0x216ad8;if(_0x29017d['query']['includeAll']){_0x2f7729[_0x29f6('0xb7')]=[{'all':!![]}];}return db[_0x29f6('0xcb')][_0x29f6('0x106')](_0x2f7729);})[_0x29f6('0x14')](function(_0x2b1808){_0x1dafb9['rows']=_0x2b1808;return _0x1dafb9;});}})[_0x29f6('0x14')](respondWithFilteredResult(_0x5863a2,_0x2f7729))[_0x29f6('0x39')](handleError(_0x5863a2,null));};exports[_0x29f6('0x107')]=function(_0x3d68f3,_0x1cb0c0){var _0x47e4e5={'where':{}},_0x3a19d2={},_0x3450c3={'count':0x0,'rows':[]};return db[_0x29f6('0xa1')][_0x29f6('0xbd')]({'where':{'id':_0x3d68f3[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x1cb0c0,null))[_0x29f6('0x14')](function(_0x6a318b){if(_0x6a318b){_0x3a19d2['model']=_[_0x29f6('0x49')](db[_0x29f6('0xcb')]['rawAttributes']);_0x3a19d2[_0x29f6('0x48')]=_[_0x29f6('0x49')](_0x3d68f3[_0x29f6('0x48')]);_0x3a19d2['filters']=_['intersection'](_0x3a19d2['model'],_0x3a19d2['query']);_0x47e4e5[_0x29f6('0x4c')]=_[_0x29f6('0x4b')](_0x3a19d2[_0x29f6('0x47')],qs[_0x29f6('0x4d')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x4d')]));_0x47e4e5[_0x29f6('0x4c')]=_0x47e4e5[_0x29f6('0x4c')][_0x29f6('0x4e')]?_0x47e4e5[_0x29f6('0x4c')]:_0x3a19d2['model'];if(!_0x3d68f3[_0x29f6('0x48')]['hasOwnProperty'](_0x29f6('0x102'))){_0x47e4e5[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x23')]);_0x47e4e5[_0x29f6('0x21')]=qs[_0x29f6('0x21')](_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x21')]);}_0x47e4e5['order']=qs['sort'](_0x3d68f3[_0x29f6('0x48')]['sort']);_0x47e4e5[_0x29f6('0x51')]=qs[_0x29f6('0x4a')](_[_0x29f6('0x52')](_0x3d68f3[_0x29f6('0x48')],_0x3a19d2[_0x29f6('0x4a')]));_0x47e4e5['where'][_0x29f6('0xb2')]=_0x6a318b['id'];if(_0x3d68f3[_0x29f6('0x48')][_0x29f6('0x88')]){_0x47e4e5[_0x29f6('0x51')]=_[_0x29f6('0x2d')](_0x47e4e5[_0x29f6('0x51')],{'$or':_[_0x29f6('0x32')](_0x47e4e5[_0x29f6('0x4c')],function(_0x346ece){var _0xc22605={};_0xc22605[_0x346ece]={'$like':'%'+_0x3d68f3[_0x29f6('0x48')]['filter']+'%'};return _0xc22605;})});}_0x47e4e5[_0x29f6('0x51')]['secret']=![];if(_0x3d68f3[_0x29f6('0x48')]['id']){_0x47e4e5[_0x29f6('0x51')]['id']={'$gt':_0x3d68f3['query']['id']};}_0x47e4e5=_['merge']({},_0x47e4e5,_0x3d68f3[_0x29f6('0x105')]);return db[_0x29f6('0xcb')]['count']({'where':_0x47e4e5[_0x29f6('0x51')]})[_0x29f6('0x14')](function(_0x15db8c){_0x3450c3[_0x29f6('0x24')]=_0x15db8c;_0x47e4e5[_0x29f6('0xb7')]=[];if(_0x3d68f3['query']['includeAgent']){_0x47e4e5[_0x29f6('0xb7')]['push']({'model':db[_0x29f6('0xef')],'as':_0x29f6('0xef'),'attributes':['id','fullname',_0x29f6('0xf0')]});}if(_0x3d68f3[_0x29f6('0x48')]['includeAll']){_0x47e4e5[_0x29f6('0xb7')]=[{'all':!![]}];}return db[_0x29f6('0xcb')]['findAll'](_0x47e4e5);})['then'](function(_0x37c860){_0x3450c3[_0x29f6('0xb3')]=_0x37c860;return _0x3450c3;});}})[_0x29f6('0x14')](respondWithFilteredResult(_0x1cb0c0,_0x47e4e5))[_0x29f6('0x39')](handleError(_0x1cb0c0,null));};exports[_0x29f6('0x108')]=function(_0x371548,_0x7a0ebf){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x371548[_0x29f6('0xb5')]['id']}})[_0x29f6('0x14')](handleEntityNotFound(_0x7a0ebf,null))[_0x29f6('0x14')](function(_0x1e05e2){if(_0x1e05e2){return _0x1e05e2[_0x29f6('0x109')](_0x371548[_0x29f6('0x2e')][_0x29f6('0x10a')],_[_0x29f6('0x100')](_0x371548[_0x29f6('0x2e')],[_0x29f6('0x10a'),'id'])||{})[_0x29f6('0x10b')](function(){return db[_0x29f6('0x76')]['findAll']({'attributes':['id',_0x29f6('0x2a'),_0x29f6('0x10c')],'where':{'id':_0x371548[_0x29f6('0x2e')][_0x29f6('0x10a')]}});})['then'](function(_0x5248ba){socket[_0x29f6('0x10d')](_0x29f6('0x10e'),{'id':Number(_0x371548[_0x29f6('0xb5')]['id']),'tags':_0x5248ba||[]});return{'id':Number(_0x371548['params']['id']),'tags':_0x5248ba||[]};});}})[_0x29f6('0x14')](respondWithResult(_0x7a0ebf,null))[_0x29f6('0x39')](handleError(_0x7a0ebf,null));};exports[_0x29f6('0x10f')]=function(_0x47028e,_0x410ab5){return db[_0x29f6('0xa1')][_0x29f6('0xb8')]({'where':{'id':_0x47028e[_0x29f6('0xb5')]['id']}})['then'](handleEntityNotFound(_0x410ab5,null))[_0x29f6('0x14')](function(_0x281c49){if(_0x281c49){return _0x281c49[_0x29f6('0x10f')](_0x47028e[_0x29f6('0x48')]['ids']);}})['then'](respondWithStatusCode(_0x410ab5,null))[_0x29f6('0x39')](handleError(_0x410ab5,null));};exports['download']=function(_0x5250bc,_0x31ba94){var _0x31dcfe=moment()[_0x29f6('0x110')]()[_0x29f6('0xa0')]();var _0x5cf3d4=path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],_0x29f6('0x111'),'files',_0x29f6('0x112'));var _0x5dcaf2=path['join'](config['root'],'server',_0x29f6('0x113'),_0x29f6('0x114'));var _0xcf75fe=path[_0x29f6('0xdd')](_0x5cf3d4,_0x31dcfe);var _0x48ecb0=util['format']('transcript-%d-%s.zip',_0x5250bc[_0x29f6('0xb5')]['id'],_0x31dcfe);var _0x5de30e=path[_0x29f6('0xdd')](_0x5cf3d4,_0x48ecb0);var _0x10989a=[];_0x10989a[_0x29f6('0x38')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x10989a[_0x29f6('0x38')]({'model':db[_0x29f6('0xe6')],'as':_0x29f6('0x6d'),'attributes':['id',_0x29f6('0x115'),_0x29f6('0x116')],'raw':!![]});if(_0x5250bc['query'][_0x29f6('0x114')]){_0x10989a[_0x29f6('0x38')]({'model':db['Attachment'],'as':_0x29f6('0xd7'),'raw':!![]});}var _0x15c951=[{'model':db[_0x29f6('0xcb')],'as':'Messages','attributes':['id','body',_0x29f6('0x7d'),'direction',_0x29f6('0xf4'),_0x29f6('0x117')],'include':_0x10989a}];_0x15c951['push']({'model':db['ChatWebsite'],'as':_0x29f6('0x118'),'attributes':['id',_0x29f6('0x2a')]});_0x15c951[_0x29f6('0x38')]({'model':db['User'],'as':_0x29f6('0x119'),'attributes':['id',_0x29f6('0x33')]});return db[_0x29f6('0xa1')]['find']({'where':{'id':_0x5250bc[_0x29f6('0xb5')]['id']},'include':_0x15c951})['then'](handleEntityNotFound(_0x31ba94,null))[_0x29f6('0x14')](function(_0x4ad41d){if(_0x4ad41d){var _0x598bcd=_0x4ad41d['get']({'plain':!![]});fs['mkdirSync'](_0xcf75fe);var _0x53751c={'channel':_0x29f6('0x11a'),'account':_0x598bcd['Account'][_0x29f6('0x2a')],'agent':_0x598bcd[_0x29f6('0x119')]?_0x598bcd[_0x29f6('0x119')][_0x29f6('0x33')]:_0x29f6('0x11b'),'createdAt':moment(_0x598bcd['createdAt'])[_0x29f6('0xe1')](_0x29f6('0x11c'))[_0x29f6('0xa0')](),'closedAt':_0x598bcd['closed']?moment(_0x598bcd[_0x29f6('0x11d')])[_0x29f6('0xe1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x29f6('0xa0')]():'','disposition':_0x598bcd['disposition'],'chatInfo':{'browser':_0x598bcd[_0x29f6('0x11e')],'os':_0x598bcd[_0x29f6('0x11f')],'referer':_0x598bcd[_0x29f6('0x120')],'customerIp':_0x598bcd[_0x29f6('0x121')],'customerPort':_0x598bcd[_0x29f6('0x122')]?_0x598bcd[_0x29f6('0x122')]:_0x29f6('0x11b')},'messages':_(_0x598bcd[_0x29f6('0xe5')])[_0x29f6('0x123')]()[_0x29f6('0x88')]({'secret':![]})[_0x29f6('0x32')](function(_0x2fd414){if(_0x2fd414['Attachment']){var _0x49c5f6=path[_0x29f6('0xdd')](_0x5dcaf2,_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')]);if(fs[_0x29f6('0x124')](_0x49c5f6)){fs[_0x29f6('0x125')](_0x49c5f6)[_0x29f6('0x126')](fs[_0x29f6('0x127')](path[_0x29f6('0xdd')](_0xcf75fe,_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')])));}}return{'date':moment(_0x2fd414[_0x29f6('0x7d')])[_0x29f6('0xe1')](_0x29f6('0x11c'))[_0x29f6('0xa0')](),'sender':_0x2fd414[_0x29f6('0xf3')]===_0x29f6('0x128')?_0x2fd414[_0x29f6('0xef')]?_0x2fd414[_0x29f6('0xef')]['fullname']:_0x29f6('0xe9'):_0x2fd414[_0x29f6('0x6d')]['firstName']+(_0x2fd414['Contact'][_0x29f6('0x116')]?'\x20'+_0x2fd414[_0x29f6('0x6d')][_0x29f6('0x116')]:''),'body':_0x2fd414[_0x29f6('0xd7')]?_0x2fd414[_0x29f6('0xd7')][_0x29f6('0xd4')]:_0x2fd414[_0x29f6('0x2e')],'direction':_0x2fd414['direction']==='out'?'A':'C','secret':_0x2fd414['secret'],'read':_0x2fd414[_0x29f6('0x117')],'attachment':_0x2fd414[_0x29f6('0xd7')]};})[_0x29f6('0x69')]()};return ejs[_0x29f6('0x129')](path[_0x29f6('0xdd')](config[_0x29f6('0xdc')],'server','views',_0x29f6('0x12a')),{'interaction':_0x53751c})[_0x29f6('0x14')](function(_0x3307a1){var _0x595aff=path[_0x29f6('0xdd')](_0xcf75fe,'transcript-'+_0x598bcd['id']+'-'+_0x31dcfe+_0x29f6('0x12b'));var _0x3101aa={'path':_0x595aff,'channel':'Chat','interactionId':_0x598bcd['id']};return pdf['createPdfFromHTML'](_0x3307a1,_0x3101aa);})[_0x29f6('0x14')](function(){return new Promise(function(_0x4c7b46,_0x41d45f){zipdir(_0xcf75fe,{'saveTo':_0x5de30e},function(_0x1f1679,_0x2dfc83){if(_0x1f1679)return _0x41d45f(_0x1f1679);return _0x4c7b46(_0x2dfc83);});})[_0x29f6('0x14')](function(){return new BPromise(function(_0x53cde9,_0x26eef7){rimraf(_0xcf75fe,function(_0x17b595){if(_0x17b595)_0x26eef7(_0x17b595);return _0x53cde9();});});})['then'](function(){return _0x31ba94[_0x29f6('0xde')](_0x5de30e,_0x48ecb0,function(_0x22fcde){if(_0x22fcde){logger[_0x29f6('0x1b')](_0x29f6('0x12c'),_0x22fcde);}else{fs['unlinkSync'](_0x5de30e);}});});});}else{return _0x31ba94[_0x29f6('0x1e')](0xc8);}})[_0x29f6('0x39')](handleError(_0x31ba94,null));};
\ No newline at end of file
+var _0x9c44=['join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','CmContact','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','findAll','options','addTags','spread','emit','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','sendStatus','request-promise','moment','bluebird','mustache','util','path','squel','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','update','name','send','merge','body','contact','interaction','account','Users','map','TagIds','split','forEach','Tags','push','waiting','talking','answered','unmanaged','abandoned','total','UserId','closed','disposition','index','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','some','compact','isEmpty','ChatWebsiteId','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','destroy','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','create','ValidationError','updateAttributes','abandon','AbandonInteraction','file','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x49c4('0x0'));var moment=require(_0x49c4('0x1'));var BPromise=require(_0x49c4('0x2'));var Mustache=require(_0x49c4('0x3'));var util=require(_0x49c4('0x4'));var path=require(_0x49c4('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x49c4('0x6'));var Redis=require('ioredis');var qs=require(_0x49c4('0x7'));var as=require(_0x49c4('0x8'));var pdf=require(_0x49c4('0x9'));var logger=require(_0x49c4('0xa'))(_0x49c4('0xb'));var config=require('../../config/environment');var db=require(_0x49c4('0xc'))['db'];config[_0x49c4('0xd')]=_[_0x49c4('0xe')](config[_0x49c4('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x49c4('0xd')]));require(_0x49c4('0xf'))['register'](socket);var jayson=require(_0x49c4('0x10'));var client=jayson[_0x49c4('0x11')]['http']({'port':0x232b});var client9004=jayson['client'][_0x49c4('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x6d1b08,_0x5487cd,_0x7df3a9,_0x403bfb){return new BPromise(function(_0x5f2fd9,_0x1909fe){var _0x280996=_0x403bfb||client;return _0x280996[_0x49c4('0x13')](_0x6d1b08,_0x7df3a9)[_0x49c4('0x14')](function(_0x12777c){logger[_0x49c4('0x15')](_0x49c4('0x16'),_0x5487cd,_0x49c4('0x17'));logger['debug'](_0x49c4('0x18'),_0x5487cd,_0x49c4('0x17'),JSON[_0x49c4('0x19')](_0x12777c));if(_0x12777c[_0x49c4('0x1a')]){if(_0x12777c[_0x49c4('0x1a')]['code']===0x1f4){logger[_0x49c4('0x1a')](_0x49c4('0x16'),_0x5487cd,_0x12777c['error']['message']);return _0x1909fe(_0x12777c[_0x49c4('0x1a')][_0x49c4('0x1b')]);}logger[_0x49c4('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5487cd,_0x12777c[_0x49c4('0x1a')]['message']);return _0x5f2fd9(_0x12777c[_0x49c4('0x1a')][_0x49c4('0x1b')]);}else{logger[_0x49c4('0x15')](_0x49c4('0x16'),_0x5487cd,_0x49c4('0x17'));_0x5f2fd9(_0x12777c[_0x49c4('0x1c')][_0x49c4('0x1b')]);}})[_0x49c4('0x1d')](function(_0x2197d2){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5487cd,_0x2197d2);_0x1909fe(_0x2197d2);});});}function respondWithStatusCode(_0x57f502,_0x1c99b1){_0x1c99b1=_0x1c99b1||0xcc;return function(_0x4f0b62){if(_0x4f0b62){return _0x57f502['sendStatus'](_0x1c99b1);}return _0x57f502[_0x49c4('0x1e')](_0x1c99b1)[_0x49c4('0x1f')]();};}function respondWithResult(_0x26c640,_0xd335e4){_0xd335e4=_0xd335e4||0xc8;return function(_0x4811c4){if(_0x4811c4){return _0x26c640['status'](_0xd335e4)[_0x49c4('0x20')](_0x4811c4);}};}function respondWithFilteredResult(_0x9cb797,_0x565423){return function(_0x207358){if(_0x207358){var _0x43e014=typeof _0x565423[_0x49c4('0x21')]===_0x49c4('0x22')&&typeof _0x565423['limit']==='undefined';var _0x449960=_0x207358['count'];var _0x3800b7=_0x43e014?0x0:_0x565423[_0x49c4('0x21')];var _0x3f1708=_0x43e014?_0x207358[_0x49c4('0x23')]:_0x565423['offset']+_0x565423[_0x49c4('0x24')];var _0x2b2793;if(_0x3f1708>=_0x449960){_0x3f1708=_0x449960;_0x2b2793=0xc8;}else{_0x2b2793=0xce;}_0x9cb797[_0x49c4('0x1e')](_0x2b2793);return _0x9cb797[_0x49c4('0x25')](_0x49c4('0x26'),_0x3800b7+'-'+_0x3f1708+'/'+_0x449960)[_0x49c4('0x20')](_0x207358);}return null;};}function saveUpdates(_0x26ba17){return function(_0x427b26){if(_0x427b26){return _0x427b26[_0x49c4('0x27')](_0x26ba17)[_0x49c4('0x14')](function(_0x46f7ea){return _0x46f7ea;});}return null;};}function removeEntity(_0x4ea6ea){return function(_0x4f4495){if(_0x4f4495){return _0x4f4495['destroy']()[_0x49c4('0x14')](function(){_0x4ea6ea[_0x49c4('0x1e')](0xcc)[_0x49c4('0x1f')]();});}};}function handleEntityNotFound(_0x27e467){return function(_0x28eb47){if(!_0x28eb47){_0x27e467['sendStatus'](0x194);}return _0x28eb47;};}function handleError(_0x38ad77,_0x116eb4){_0x116eb4=_0x116eb4||0x1f4;return function(_0x2e7a69){logger[_0x49c4('0x1a')](_0x2e7a69['stack']);if(_0x2e7a69['name']){delete _0x2e7a69[_0x49c4('0x28')];}_0x38ad77[_0x49c4('0x1e')](_0x116eb4)[_0x49c4('0x29')](_0x2e7a69);};}function getMustacheRender(_0x13b3b4,_0xd38540){return Mustache['render'](_0x13b3b4,_[_0x49c4('0x2a')](_0xd38540[_0x49c4('0x2b')],{'contact':_0xd38540[_0x49c4('0x2c')],'message':_0xd38540['message'],'agent':_0xd38540['agent'],'interaction':_0xd38540[_0x49c4('0x2d')],'account':_0xd38540[_0x49c4('0x2e')]}))||'';}function getInteractionUsers(_0x3bec0a,_0x1238c0){return new BPromise(function(_0x2b45a1,_0x2cf897){try{if(_0x1238c0[_0x3bec0a['id']]){_0x3bec0a[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x1238c0[_0x3bec0a['id']],function(_0x3209cd){return{'id':_0x3209cd['id'],'fullname':_0x3209cd['fullname']};});}}catch(_0x2d34ca){_0x2cf897(_0x2d34ca);}_0x2b45a1(_0x3bec0a);});}function getInteractionTags(_0x5b96df,_0xdda586){return new BPromise(function(_0x349791,_0x2625a6){try{if(_0x5b96df[_0x49c4('0x31')]){_0x5b96df['Tags']=[];_0x5b96df[_0x49c4('0x31')][_0x49c4('0x32')](',')[_0x49c4('0x33')](function(_0x4e913a){_0x5b96df[_0x49c4('0x34')][_0x49c4('0x35')](_0xdda586[_0x4e913a]);});}delete _0x5b96df[_0x49c4('0x31')];}catch(_0x5e5366){_0x2625a6(_0x5e5366);}_0x349791(_0x5b96df);});}function updateChatInteraction(_0x1ba7a0,_0x24c177,_0x143916){return new BPromise(function(_0x2ba76a,_0x70e552){return getInteractionUsers(_0x1ba7a0,_0x143916)[_0x49c4('0x14')](function(_0x1e506a){return getInteractionTags(_0x1e506a,_0x24c177);})['then'](function(_0x2d2510){return getStateInteraction(_0x2d2510);})[_0x49c4('0x14')](function(_0x32b172){_0x2ba76a(_0x32b172);})[_0x49c4('0x1d')](function(_0x41ad28){_0x70e552(_0x41ad28);});});}function getStateInteraction(_0x29dd5d){return new BPromise(function(_0x1be62d){_0x29dd5d[_0x49c4('0x36')]=0x0;_0x29dd5d[_0x49c4('0x37')]=0x0;_0x29dd5d[_0x49c4('0x38')]=0x0;_0x29dd5d[_0x49c4('0x39')]=0x0;_0x29dd5d[_0x49c4('0x3a')]=0x0;_0x29dd5d[_0x49c4('0x3b')]=0x0;if(!_0x29dd5d['closed']&&!_0x29dd5d[_0x49c4('0x3c')]){_0x29dd5d['waiting']+=0x1;}if(!_0x29dd5d[_0x49c4('0x3d')]&&_0x29dd5d[_0x49c4('0x3c')]){_0x29dd5d[_0x49c4('0x37')]+=0x1;if(_0x29dd5d[_0x49c4('0x36')]){_0x29dd5d[_0x49c4('0x36')]-=0x1;}}if(_0x29dd5d[_0x49c4('0x3d')]&&_0x29dd5d['disposition']==='abandoned'){_0x29dd5d[_0x49c4('0x3a')]+=0x1;if(_0x29dd5d[_0x49c4('0x36')]){_0x29dd5d[_0x49c4('0x36')]-=0x1;}}else if(_0x29dd5d[_0x49c4('0x3d')]&&!_0x29dd5d['UserId']&&_0x29dd5d[_0x49c4('0x3e')]){_0x29dd5d[_0x49c4('0x39')]+=0x1;if(_0x29dd5d[_0x49c4('0x36')]){_0x29dd5d[_0x49c4('0x36')]-=0x1;}}else if(_0x29dd5d[_0x49c4('0x3d')]&&_0x29dd5d[_0x49c4('0x3c')]){_0x29dd5d[_0x49c4('0x38')]+=0x1;if(_0x29dd5d[_0x49c4('0x37')]){_0x29dd5d[_0x49c4('0x37')]-=0x1;}}_0x29dd5d['total']+=0x1;_0x1be62d(_0x29dd5d);});}exports[_0x49c4('0x3f')]=function(_0x4d27d0,_0x33696e){var _0x628423={},_0x301def={},_0x258abe={'count':0x0,'rows':[]};var _0x2d93d8=_['map'](db[_0x49c4('0x40')][_0x49c4('0x41')],function(_0x384862){return{'name':_0x384862[_0x49c4('0x42')],'type':_0x384862[_0x49c4('0x43')][_0x49c4('0x44')]};});_0x301def[_0x49c4('0x45')]=_['map'](_0x2d93d8,_0x49c4('0x28'));_0x301def['query']=_[_0x49c4('0x46')](_0x4d27d0[_0x49c4('0x47')]);_0x301def[_0x49c4('0x48')]=_[_0x49c4('0x49')](_0x301def[_0x49c4('0x45')],_0x301def[_0x49c4('0x47')]);_0x628423[_0x49c4('0x4a')]=_['intersection'](_0x301def[_0x49c4('0x45')],qs[_0x49c4('0x4b')](_0x4d27d0['query'][_0x49c4('0x4b')]));_0x628423[_0x49c4('0x4a')]=_0x628423[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x628423['attributes']:_0x301def['model'];if(!_0x4d27d0[_0x49c4('0x47')]['hasOwnProperty'](_0x49c4('0x4d'))){_0x628423[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x24')]);_0x628423[_0x49c4('0x21')]=qs[_0x49c4('0x21')](_0x4d27d0['query'][_0x49c4('0x21')]);}_0x628423[_0x49c4('0x4e')]=qs[_0x49c4('0x4f')](_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x4f')]);_0x628423[_0x49c4('0x50')]=qs[_0x49c4('0x48')](_[_0x49c4('0x51')](_0x4d27d0[_0x49c4('0x47')],_0x301def[_0x49c4('0x48')]),_0x2d93d8);var _0x5b822f=[];var _0x5e63f0=squel[_0x49c4('0x52')]()[_0x49c4('0x53')]('id')['field']('name')[_0x49c4('0x53')]('color')['from'](_0x49c4('0x54'));var _0x4081a5=squel[_0x49c4('0x52')]()[_0x49c4('0x53')](_0x49c4('0x55'))[_0x49c4('0x53')](_0x49c4('0x56'))['field'](_0x49c4('0x57'))[_0x49c4('0x58')](_0x49c4('0x59'),'ui')[_0x49c4('0x5a')](_0x49c4('0x5b'),'u',_0x49c4('0x5c'));var _0x5d24f3=squel['select']()[_0x49c4('0x58')](_0x49c4('0x5d'),'i')[_0x49c4('0x5a')](_0x49c4('0x5e'),'c',_0x49c4('0x5f'))[_0x49c4('0x5a')](_0x49c4('0x5b'),'o','o.id\x20=\x20i.UserId')[_0x49c4('0x5a')](_0x49c4('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x49c4('0x5a')]('chat_messages','me',_0x49c4('0x61'))[_0x49c4('0x5a')](_0x49c4('0x62'),'it',_0x49c4('0x63'))[_0x49c4('0x5a')](_0x49c4('0x54'),'t',_0x49c4('0x64'));var _0x2f520f=squel['expr']();var _0x3894e0=[];var _0x27b9c2=squel['expr']();var _0x10dec7;if(_0x4d27d0[_0x49c4('0x47')]['search']){_0x10dec7=as[_0x49c4('0x65')](_0x4d27d0[_0x49c4('0x47')]['search']);var _0x4dc54d=_0x10dec7['sqlOperator'];for(var _0x513879=0x0;_0x513879<_0x10dec7[_0x49c4('0x66')]['length'];_0x513879++){var _0xb20a5d=_0x10dec7[_0x49c4('0x66')][_0x513879];var _0x515240='i';var _0x679134=_[_0x49c4('0x67')](_0x2d93d8,['name',_0xb20a5d[_0x49c4('0x53')]]);if(!_0x679134){switch(_0xb20a5d[_0x49c4('0x53')]){case _0x49c4('0x68'):if(_0xb20a5d[_0x49c4('0x69')]==0x1){_0x5d24f3['having']('`'+_0xb20a5d[_0x49c4('0x53')]+_0x49c4('0x6a'));}else{_0x5d24f3[_0x49c4('0x6b')]('`'+_0xb20a5d[_0x49c4('0x53')]+'`\x20>\x200');}break;case _0x49c4('0x6c'):if(_0xb20a5d['operator']==='$substring'){if(_0xb20a5d['value']['split']('\x20')[_0x49c4('0x4c')]>0x1){_0x2f520f[_0x4dc54d](_0x49c4('0x6d'),qs[_0x49c4('0x6e')](_0xb20a5d[_0x49c4('0x69')]),null);}else{var _0x5b056e='%'+_0xb20a5d['value']+'%';_0x2f520f[_0x4dc54d](_0x49c4('0x6f'),_0x5b056e,_0x5b056e,_0x5b056e);}}else{_0x679134=_[_0x49c4('0x67')](_0x2d93d8,[_0x49c4('0x28'),_0x49c4('0x70')]);_0xb20a5d[_0x49c4('0x53')]=_0x49c4('0x70');_0x191afb=as[_0x49c4('0x71')](_0x515240,_0x679134[_0x49c4('0x43')],_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb['text'],_0x191afb[_0x49c4('0x69')]['start'],_0x191afb[_0x49c4('0x69')][_0x49c4('0x1f')]);}break;case _0x49c4('0x72'):var _0x1ea1b4=_0xb20a5d[_0x49c4('0x69')][_0x49c4('0x32')](',')[_0x49c4('0x30')](function(_0x3feb0b){return Number(_0x3feb0b);});_0x1ea1b4[_0x49c4('0x33')](function(_0x1743d0){_0x27b9c2['or'](_0x49c4('0x73'),'%,'+_0x1743d0+',%');});_0x3894e0=_[_0x49c4('0x74')](_0x3894e0,_0x1ea1b4);break;case _0x49c4('0x75'):if(_0xb20a5d[_0x49c4('0x76')]===_0x49c4('0x77')){_0x2f520f[_0x4dc54d](_0x49c4('0x78'),'%'+_0xb20a5d[_0x49c4('0x69')]+'%',null);}else{_0x679134=_[_0x49c4('0x67')](_0x2d93d8,['name','UserId']);_0xb20a5d[_0x49c4('0x53')]=_0x49c4('0x3c');_0x191afb=as['buildExpression'](_0x515240,_0x679134[_0x49c4('0x43')],_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb[_0x49c4('0x79')],_0x191afb[_0x49c4('0x69')][_0x49c4('0x7a')],_0x191afb['value']['end']);}break;case'body':_0x191afb=as[_0x49c4('0x71')]('me',null,_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb[_0x49c4('0x79')],_0x191afb[_0x49c4('0x69')][_0x49c4('0x7a')],_0x191afb[_0x49c4('0x69')][_0x49c4('0x1f')]);break;}}else{var _0x191afb=as[_0x49c4('0x71')](_0x515240,_0x679134[_0x49c4('0x43')],_0xb20a5d);_0x2f520f[_0x4dc54d](_0x191afb['text'],_0x191afb[_0x49c4('0x69')][_0x49c4('0x7a')],_0x191afb[_0x49c4('0x69')]['end']);}}}else{var _0x4448b9=_(_0x4d27d0[_0x49c4('0x47')])[_0x49c4('0x46')]()[_0x49c4('0x30')](function(_0x1f25be){return _[_0x49c4('0x7b')](_0x2d93d8,[_0x49c4('0x28'),_0x1f25be])?_0x1f25be:undefined;})[_0x49c4('0x7c')]()['value']();if(!_[_0x49c4('0x7d')](_0x4448b9)){_0x4448b9[_0x49c4('0x33')](function(_0x85540f){if(_0x85540f===_0x49c4('0x7e')){_0x5d24f3[_0x49c4('0x50')]('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x4d27d0[_0x49c4('0x47')][_0x85540f]));}else if(_0x85540f==='createdAt'){var _0x34cf49=JSON['parse'](_0x4d27d0[_0x49c4('0x47')][_0x85540f])[_0x49c4('0x7f')];var _0x3b03dd=JSON[_0x49c4('0x80')](_0x4d27d0['query'][_0x85540f])[_0x49c4('0x81')];_0x5d24f3[_0x49c4('0x50')](_0x49c4('0x82'),_0x34cf49,_0x3b03dd);}else{if(_0x4d27d0[_0x49c4('0x47')][_0x85540f]===_0x49c4('0x83')){_0x5d24f3[_0x49c4('0x50')]('i.'+_0x85540f+_0x49c4('0x84'));}else{_0x5d24f3[_0x49c4('0x50')]('i.'+_0x85540f+_0x49c4('0x85'),_0x4d27d0[_0x49c4('0x47')][_0x85540f]);}}});}if(_0x4d27d0['query'][_0x49c4('0x86')]){if(_0x4d27d0[_0x49c4('0x47')]['read']==0x1){_0x5d24f3[_0x49c4('0x6b')]('`unreadMessages`\x20=\x200');}else{_0x5d24f3[_0x49c4('0x6b')](_0x49c4('0x87'));}}if(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x88')]){_0x3894e0=_[_0x49c4('0x89')](_0x4d27d0['query'][_0x49c4('0x88')])?_0x4d27d0[_0x49c4('0x47')]['tag']:new Array(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x88')]);_0x3894e0['forEach'](function(_0xbd12b9){_0x27b9c2['or'](_0x49c4('0x73'),'%,'+_0xbd12b9+',%');});}if(_0x4d27d0['query'][_0x49c4('0x8a')]){var _0x993d00=_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x8a')]['replace']('\x5c','\x5c\x5c')[_0x49c4('0x8b')](/'/g,'\x27\x27');if(qs[_0x49c4('0x8c')](_0x993d00)){_0x2f520f['or']('i.id\x20LIKE\x20?',_0x993d00+'%');}else{_0x2f520f['or'](_0x49c4('0x8d'),qs['getFullTextValue'](_0x993d00))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x993d00+'%');}}}_0x5d24f3[_0x49c4('0x50')](_0x2f520f);_0x5d24f3['group']('i.id');var _0x39cacf={'type':db[_0x49c4('0x8e')]['QueryTypes'][_0x49c4('0x8f')],'raw':!![]};var _0x5c3509=_0x5d24f3['clone']();_0x5c3509['field'](_0x49c4('0x90'));_0x5c3509[_0x49c4('0x53')](_0x49c4('0x91'),_0x49c4('0x68'));if(_0x628423['order']){_0x628423['order'][_0x49c4('0x33')](function(_0x48705c){var _0x2c560e=_0x48705c[0x0]==='contactName'?_0x48705c[0x0]:'i.'+_0x48705c[0x0];_0x5d24f3[_0x49c4('0x4e')](_0x2c560e,_0x48705c[0x1]===_0x49c4('0x92')?![]:!![]);});}if(!_[_0x49c4('0x7d')](_0x3894e0)){_0x5d24f3[_0x49c4('0x6b')](_0x27b9c2);_0x5c3509[_0x49c4('0x50')](_0x49c4('0x93'),_0x3894e0);}BPromise[_0x49c4('0x94')]()['then'](function(){if(!_0x10dec7){if(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x7e')])return;_0x5c3509[_0x49c4('0x50')](_0x49c4('0x95'));_0x5d24f3[_0x49c4('0x50')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x4d27d0[_0x49c4('0x96')][_0x49c4('0x97')]!==_0x49c4('0x98'))return;return _0x4d27d0['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x49c4('0x14')](function(_0x27b31d){if(_[_0x49c4('0x7d')](_0x27b31d)){_0x5c3509[_0x49c4('0x50')](_0x49c4('0x99'));_0x5d24f3['where'](_0x49c4('0x99'));}else{_0x5c3509[_0x49c4('0x50')](_0x49c4('0x9a'),_[_0x49c4('0x30')](_0x27b31d,'id'));_0x5d24f3['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x49c4('0x30')](_0x27b31d,'id'));}});})[_0x49c4('0x14')](function(){if(_0x4d27d0[_0x49c4('0x96')][_0x49c4('0x97')]===_0x49c4('0x98')&&!_0x10dec7&&!_0x4d27d0['query'][_0x49c4('0x7e')])return[];return db[_0x49c4('0x9b')][_0x49c4('0x47')](_0x5c3509[_0x49c4('0x9c')](),_0x39cacf);})[_0x49c4('0x14')](function(_0x8f37e5){_0x258abe['count']=_0x8f37e5[_0x49c4('0x4c')];if(_0x258abe[_0x49c4('0x23')]===0x0)return[];return db[_0x49c4('0x9b')][_0x49c4('0x47')](_0x5e63f0['toString'](),_0x39cacf)['then'](function(_0xa96f53){_0x5b822f=_['keyBy'](_0xa96f53,'id');_0x39cacf=_[_0x49c4('0x2a')](_0x39cacf,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4d27d0[_0x49c4('0x47')][_0x49c4('0x4b')]){_0x628423[_0x49c4('0x4a')][_0x49c4('0x33')](function(_0x4eebc9){_0x5d24f3['field']('i.'+_0x4eebc9);});}else{_0x5d24f3[_0x49c4('0x53')](_0x49c4('0x91'),_0x49c4('0x68'));_0x5d24f3['field']('a.key',_0x49c4('0x9d'));_0x5d24f3['field']('a.mandatoryDisposition',_0x49c4('0x9e'));_0x5d24f3['field'](_0x49c4('0x9f'),_0x49c4('0xa0'));_0x5d24f3['field'](_0x49c4('0xa1'));_0x5d24f3[_0x49c4('0x53')]('c.firstName','Contact.firstName');_0x5d24f3[_0x49c4('0x53')]('c.lastName',_0x49c4('0xa2'));_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xa3'),_0x49c4('0xa4'));_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xa5'),_0x49c4('0xa6'));_0x5d24f3['field'](_0x49c4('0xa7'),_0x49c4('0xa8'));_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xa9'),_0x49c4('0xaa'));_0x5d24f3['field'](_0x49c4('0xab'),'Owner.fullname');_0x5d24f3[_0x49c4('0x53')](_0x49c4('0xac'),_0x49c4('0xad'));_0x5d24f3[_0x49c4('0x53')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x49c4('0x31'));}if(_0x628423[_0x49c4('0x24')])_0x5d24f3[_0x49c4('0x24')](_0x628423[_0x49c4('0x24')]);if(_0x628423[_0x49c4('0x21')])_0x5d24f3[_0x49c4('0x21')](_0x628423['offset']);return db[_0x49c4('0x9b')]['query'](_0x5d24f3[_0x49c4('0x9c')](),_0x39cacf);})[_0x49c4('0x14')](function(_0x1db53d){if(_0x1db53d[_0x49c4('0x4c')]>0x0)_0x4081a5['where'](_0x49c4('0xae'),_[_0x49c4('0x30')](_0x1db53d,'id'));return db['sequelize'][_0x49c4('0x47')](_0x4081a5[_0x49c4('0x9c')](),_0x39cacf)['then'](function(_0x562f47){var _0x25f1c7=_[_0x49c4('0xaf')](_0x562f47,_0x49c4('0xb0'));var _0x1aa3a3=[];_0x1db53d[_0x49c4('0x33')](function(_0x15e403){_0x1aa3a3[_0x49c4('0x35')](updateChatInteraction(_0x15e403,_0x5b822f,_0x25f1c7));});return BPromise[_0x49c4('0xb1')](_0x1aa3a3);});});})[_0x49c4('0x14')](function(_0x117c64){_0x258abe[_0x49c4('0xb2')]=_0x117c64;return _0x258abe;})['then'](respondWithFilteredResult(_0x33696e,_0x628423))['catch'](handleError(_0x33696e,null));};exports[_0x49c4('0xb3')]=function(_0x1e286e,_0xccdf6d){var _0x5be042={'raw':![],'where':{'id':_0x1e286e[_0x49c4('0xb4')]['id']}},_0x1276bf={};_0x1276bf['model']=_[_0x49c4('0x46')](db['ChatInteraction'][_0x49c4('0x41')]);_0x1276bf[_0x49c4('0x47')]=_[_0x49c4('0x46')](_0x1e286e[_0x49c4('0x47')]);_0x1276bf['filters']=_[_0x49c4('0x49')](_0x1276bf[_0x49c4('0x45')],_0x1276bf[_0x49c4('0x47')]);_0x5be042[_0x49c4('0x4a')]=_[_0x49c4('0x49')](_0x1276bf['model'],qs['fields'](_0x1e286e['query'][_0x49c4('0x4b')]));_0x5be042[_0x49c4('0x4a')]=_0x5be042[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x5be042[_0x49c4('0x4a')]:_0x1276bf['model'];if(_0x1e286e[_0x49c4('0x47')][_0x49c4('0xb5')]){_0x5be042[_0x49c4('0xb6')]=[{'all':!![]}];}_0x5be042=_[_0x49c4('0x2a')]({},_0x5be042,_0x1e286e['options']);return db[_0x49c4('0x40')][_0x49c4('0x67')](_0x5be042)[_0x49c4('0x14')](handleEntityNotFound(_0xccdf6d,null))[_0x49c4('0x14')](respondWithResult(_0xccdf6d,null))[_0x49c4('0x1d')](handleError(_0xccdf6d,null));};exports['create']=function(_0x1d9e1a,_0x9b622d){return db[_0x49c4('0x40')]['create'](_0x1d9e1a[_0x49c4('0x2b')],{})[_0x49c4('0x14')](respondWithResult(_0x9b622d,0xc9))[_0x49c4('0x1d')](handleError(_0x9b622d,null));};exports['update']=function(_0x97f579,_0x491231){if(_0x97f579['body']['id']){delete _0x97f579[_0x49c4('0x2b')]['id'];}return db[_0x49c4('0x40')]['find']({'where':{'id':_0x97f579[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x491231,null))[_0x49c4('0x14')](saveUpdates(_0x97f579[_0x49c4('0x2b')],null))[_0x49c4('0x14')](respondWithResult(_0x491231,null))[_0x49c4('0x1d')](handleError(_0x491231,null));};exports[_0x49c4('0xb7')]=function(_0x219133,_0x59dbef){return db['ChatInteraction'][_0x49c4('0x67')]({'where':{'id':_0x219133[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x59dbef,null))['then'](removeEntity(_0x59dbef,null))['catch'](handleError(_0x59dbef,null));};exports[_0x49c4('0xb8')]=function(_0x3222ec,_0xd979f7){return db[_0x49c4('0x40')][_0x49c4('0xb8')]()[_0x49c4('0x14')](respondWithResult(_0xd979f7,null))[_0x49c4('0x1d')](handleError(_0xd979f7,null));};exports[_0x49c4('0xb9')]=function(_0x318008,_0x1e2dd3){var _0xa42e74=_0x318008[_0x49c4('0xb4')]['id'];var _0x352b67;var _0xbfb25b;var _0x4cc855;return db[_0x49c4('0x40')][_0x49c4('0xba')]({'where':{'id':_0xa42e74}})[_0x49c4('0x14')](function(_0x318aaf){_0x352b67=_0x318aaf;return db['ChatWebsite']['findOne']({'where':{'id':_0x318aaf[_0x49c4('0x7e')]},'attributes':['id','vidaooApiKey',_0x49c4('0xbb'),_0x49c4('0xbc'),_0x49c4('0xbd'),_0x49c4('0xbe')],'raw':!![]});})[_0x49c4('0x14')](function(_0x45a2ef){if(_0x45a2ef&&_0x45a2ef[_0x49c4('0xbf')]&&_0x45a2ef[_0x49c4('0xbb')]){_0xbfb25b=_0x45a2ef;var _0x31ba95={'interaction':{'id':_0xa42e74},'agent':{'id':_0x318008[_0x49c4('0x96')]['id'],'name':_0x318008[_0x49c4('0x96')][_0x49c4('0x28')],'fullname':_0x318008['user'][_0x49c4('0xc0')],'email':_0x318008[_0x49c4('0x96')][_0x49c4('0xc1')]},'contact':_0x318008['body'][_0x49c4('0x2c')],'account':_0x318008['body'][_0x49c4('0x2e')]};var _0x82925={'rejectUnauthorized':![],'method':_0x49c4('0xc2'),'url':_0x49c4('0xc3'),'headers':{'X-APIKEY':_0x45a2ef['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x318008[_0x49c4('0x96')]['email']],'buttons':null,'topic':_0xbfb25b['vidaooTopic'],'note':_[_0x49c4('0xc4')](_0xbfb25b[_0x49c4('0xbd')])?null:getMustacheRender(_0xbfb25b[_0x49c4('0xbd')],_0x31ba95),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0xbfb25b[_0x49c4('0xbe')])){var _0x1221de=getMustacheRender(_0xbfb25b[_0x49c4('0xbe')],_0x31ba95);var _0x330512=JSON[_0x49c4('0x80')](_0x1221de);_0x82925[_0x49c4('0x2b')][_0x49c4('0xc5')]=_0x330512;}}catch(_0x19f30b){throw new db[(_0x49c4('0x8e'))]['ValidationError'](_0x49c4('0xc6'));}return rp(_0x82925);}else{throw new db[(_0x49c4('0x8e'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x49c4('0x14')](function(_0x4d5481){_0x4cc855=_0x4d5481;if(_0x4cc855['id']){var _0xefec38={'body':_0x4cc855['join_url'],'ChatWebsiteId':_0xbfb25b['id'],'ChatInteractionId':_0x352b67['id'],'direction':_0x49c4('0xc7'),'UserId':_0x318008['user']['id']};return db[_0x49c4('0xc8')][_0x49c4('0xc9')](_0xefec38,{});}else{throw new db[(_0x49c4('0x8e'))][(_0x49c4('0xca'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x352b67[_0x49c4('0xcb')]({'vidaooSessionId':_0x4cc855['id']});})[_0x49c4('0x14')](respondWithResult(_0x1e2dd3,null))[_0x49c4('0x1d')](handleError(_0x1e2dd3,null));};exports['customUpdate']=function(_0x367d3d,_0x1814c4){if(_0x367d3d['body']['id']){delete _0x367d3d['body']['id'];}return db[_0x49c4('0x40')][_0x49c4('0x67')]({'where':{'id':_0x367d3d[_0x49c4('0xb4')]['id']},'include':[{'model':db['CmContact'],'as':_0x49c4('0x6c')}]})[_0x49c4('0x14')](handleEntityNotFound(_0x1814c4,null))[_0x49c4('0x14')](saveUpdates(_0x367d3d[_0x49c4('0x2b')],null))['then'](respondWithResult(_0x1814c4,null))[_0x49c4('0x1d')](handleError(_0x1814c4,null));};exports['abandon']=function(_0x4d0a28,_0xf5f718){if(_0x4d0a28[_0x49c4('0x2b')]['id']){delete _0x4d0a28[_0x49c4('0x2b')]['id'];}return db[_0x49c4('0x40')]['find']({'where':{'id':_0x4d0a28[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](function(_0xa6f48){if(!_0xa6f48){logger[_0x49c4('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x49c4('0xcc'),0x194,'entity\x20not\x20found');_0xf5f718['sendStatus'](0x194);}else{if(_0xa6f48[_0x49c4('0x3c')]){throw new db[(_0x49c4('0x8e'))][(_0x49c4('0xca'))]('Interaction\x20already\x20assigned');}}return _0xa6f48;})[_0x49c4('0x14')](function(_0x4a874a){if(_0x4a874a){return _0x4a874a[_0x49c4('0x27')]({'closed':_0x4d0a28[_0x49c4('0x2b')][_0x49c4('0x3d')],'disposition':_0x4d0a28[_0x49c4('0x2b')][_0x49c4('0x3e')]})[_0x49c4('0x14')](function(_0x2b31ac){return _0x2b31ac;});}})['then'](function(){return respondWithRpcPromise(_0x49c4('0xcd'),_0x49c4('0xcc'),_0x4d0a28[_0x49c4('0x2b')],client9004);})[_0x49c4('0x14')](respondWithResult(_0xf5f718,null))['catch'](handleError(_0xf5f718,null));};exports['attachmentUpload']=function(_0x4c15ff,_0x2d4f8a){_0x4c15ff[_0x49c4('0x2b')][_0x49c4('0x28')]=_0x4c15ff[_0x49c4('0xce')][_0x49c4('0xcf')];_0x4c15ff[_0x49c4('0x2b')][_0x49c4('0xd0')]=_0x4c15ff['file'][_0x49c4('0xd1')];_0x4c15ff[_0x49c4('0x2b')]['type']=_0x4c15ff['file']['mimetype'];return db[_0x49c4('0xd2')][_0x49c4('0xc9')](_0x4c15ff[_0x49c4('0x2b')])[_0x49c4('0x14')](respondWithResult(_0x2d4f8a,0xc9))[_0x49c4('0x1d')](handleError(_0x2d4f8a,null));};exports[_0x49c4('0xd3')]=function(_0x2f36c6,_0x5039fc){return db[_0x49c4('0x40')][_0x49c4('0xba')]({'where':{'id':_0x2f36c6[_0x49c4('0xb4')]['id']},'raw':!![]})[_0x49c4('0x14')](handleEntityNotFound(_0x5039fc,null))['then'](function(_0x3440ad){if(_0x3440ad){if(_0x3440ad[_0x49c4('0x3d')]){return _0x5039fc[_0x49c4('0x1e')](0x193)[_0x49c4('0x20')]({'status':0x193,'message':_0x49c4('0xd4')});}return db['Attachment'][_0x49c4('0xba')]({'where':{'id':_0x2f36c6['query']['attachId']},'raw':!![]})[_0x49c4('0x14')](handleEntityNotFound(_0x5039fc,null));}})[_0x49c4('0x14')](function(_0x113beb){if(_0x113beb){var _0x35289f=_0x113beb[_0x49c4('0xd5')]!==null;var _0x5b9591=path[_0x49c4('0xd6')](config[_0x49c4('0xd7')],_0x49c4('0xd8'));if(_0x35289f){_0x5b9591=path['join'](_0x5b9591,_0x49c4('0xd9'));}var _0x45c34a=path['join'](_0x5b9591,_0x113beb[_0x49c4('0xd0')]);return _0x5039fc[_0x49c4('0xda')](_0x45c34a);}})[_0x49c4('0x1d')](handleError(_0x5039fc,null));};exports[_0x49c4('0xdb')]=function(_0x2ef538,_0x163128){var _0x1679ca=null;var _0x4b0114=null;var _0x261d61=null;if(_0x2ef538[_0x49c4('0x2b')]['id']){delete _0x2ef538[_0x49c4('0x2b')]['id'];}if(_0x2ef538[_0x49c4('0x2b')][_0x49c4('0xdc')]){_0x261d61=path['join'](config[_0x49c4('0xd7')],_0x49c4('0xdd'),util[_0x49c4('0xde')](_0x49c4('0xdf'),Date[_0x49c4('0xe0')]()));_0x2ef538['body'][_0x49c4('0xe1')]=_0x261d61;}return db[_0x49c4('0x40')][_0x49c4('0x67')]({'where':{'id':_0x2ef538[_0x49c4('0xb4')]['id']},'include':[{'model':db[_0x49c4('0xc8')],'as':_0x49c4('0xe2'),'include':[{'model':db[_0x49c4('0x75')],'as':_0x49c4('0x75')}]}]})[_0x49c4('0x14')](handleEntityNotFound(_0x163128,null))[_0x49c4('0x14')](saveUpdates(_0x2ef538['body'],null))[_0x49c4('0x14')](function(_0x1b6966){if(_0x1b6966){_0x1679ca=_0x1b6966;return db[_0x49c4('0xe3')][_0x49c4('0x67')]({'where':{'id':_0x1679ca[_0x49c4('0x7e')]}});}})['then'](function(_0x501786){if(_0x501786){_0x4b0114=_0x501786;return db[_0x49c4('0xe4')][_0x49c4('0x67')]({'where':{'id':_0x1679ca[_0x49c4('0x70')]}});}})[_0x49c4('0x14')](function(_0xd87f7e){if(_0xd87f7e){if(_0x261d61){var _0x25d2a1=null;for(var _0x58d24f=0x1;_0x58d24f<_0x1679ca[_0x49c4('0xe2')][_0x49c4('0x4c')];++_0x58d24f){_0x25d2a1=_0x1679ca['Messages'][_0x58d24f];var _0x386595=_0x25d2a1['UserId']?util[_0x49c4('0xde')](_0x49c4('0xe5'),_0x4b0114[_0x49c4('0xe6')],_0x25d2a1['UserId']):_0x49c4('0xe7');var _0x4f431e=_0x2ef538[_0x49c4('0x2b')]['customer']||util['format'](_0x49c4('0xe5'),_0x49c4('0xe8'),_0x25d2a1[_0x49c4('0x70')]);switch(_0x4b0114[_0x49c4('0xe9')]){case _0x49c4('0xea'):_0x386595=_0x25d2a1[_0x49c4('0x3c')]?util['format']('%s%d',_0x4b0114[_0x49c4('0xe6')],_0x25d2a1[_0x49c4('0x3c')]):_0x49c4('0xe7');break;case _0x49c4('0xeb'):_0x386595=_0x25d2a1[_0x49c4('0x3c')]?_0x25d2a1[_0x49c4('0x75')][_0x49c4('0xec')]||_0x25d2a1['User']['fullname']:'System';break;case'agent_fullname':_0x386595=_0x25d2a1[_0x49c4('0x3c')]?_0x25d2a1['User'][_0x49c4('0xc0')]:_0x49c4('0xe7');break;default:_0x386595=_0x25d2a1[_0x49c4('0x3c')]?util['format']('%s%d',_0x4b0114[_0x49c4('0xe6')],_0x25d2a1[_0x49c4('0x3c')]):'System';}var _0x4323ec=util[_0x49c4('0xde')](_0x49c4('0xed'),moment(_0x25d2a1[_0x49c4('0xee')])[_0x49c4('0xde')](_0x49c4('0xef')),_0x25d2a1['direction']==='in'?_0x4f431e:_0x386595,_0x25d2a1[_0x49c4('0x2b')]);if(!_0x25d2a1[_0x49c4('0xf0')]){fs[_0x49c4('0xf1')](_0x261d61,_0x4323ec);}}return db['MailAccount'][_0x49c4('0xba')]({'where':{'service':!![]},'include':[{'model':db[_0x49c4('0xf2')],'as':_0x49c4('0xf3'),'raw':!![],'include':[{'model':db[_0x49c4('0xf4')],'as':_0x49c4('0xf4'),'raw':!![]}]}]});}}})[_0x49c4('0x14')](function(_0x82c4bf){if(!_0x82c4bf||!_0x82c4bf[_0x49c4('0xf3')]||!_0x2ef538['body'])return _0x1679ca;var _0x2fc500=_0x82c4bf[_0x49c4('0xf5')]();return respondWithRpcPromise(_0x49c4('0xf6'),_0x49c4('0xf7'),{'account':_0x2fc500,'message':{'from':util[_0x49c4('0xde')](_0x49c4('0xf8'),_0x82c4bf['name'],_0x82c4bf[_0x49c4('0xc1')]||_0x82c4bf[_0x49c4('0xf3')][_0x49c4('0x96')]),'to':_0x2ef538[_0x49c4('0x2b')][_0x49c4('0xdc')],'subject':_0x49c4('0xf9'),'text':util[_0x49c4('0xde')](_0x49c4('0xfa'),_0x2ef538[_0x49c4('0x2b')][_0x49c4('0xdc')]),'attachments':[{'path':_0x261d61}]}})[_0x49c4('0x14')](function(){return _0x1679ca;})[_0x49c4('0x1d')](function(_0x471e28){logger[_0x49c4('0x1a')](_0x471e28);});})['then'](respondWithStatusCode(_0x163128,0xc8))['catch'](handleError(_0x163128,null));};exports[_0x49c4('0xfb')]=function(_0x3b6fd2,_0x4c07b3){return db['ChatMessage'][_0x49c4('0x67')]({'where':{'id':_0x3b6fd2['params']['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x4c07b3,null))[_0x49c4('0x14')](function(_0x1ac2c0){if(_0x1ac2c0){return _0x1ac2c0[_0x49c4('0xfb')](_0x3b6fd2[_0x49c4('0x2b')][_0x49c4('0xfc')],_[_0x49c4('0xfd')](_0x3b6fd2[_0x49c4('0x2b')],['ids','id'])||{});}})[_0x49c4('0x14')](respondWithResult(_0x4c07b3,null))[_0x49c4('0x1d')](handleError(_0x4c07b3,null));};exports[_0x49c4('0xfe')]=function(_0xd2ee5e,_0x201909){var _0x5b2cc8={'raw':![],'where':{}};var _0x2bfa4f={};var _0x2b507f={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x49c4('0xba')]({'where':{'id':_0xd2ee5e[_0x49c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0x201909,null))[_0x49c4('0x14')](function(_0x3119a5){if(_0x3119a5){_0x2bfa4f[_0x49c4('0x45')]=_['keys'](db[_0x49c4('0xc8')][_0x49c4('0x41')]);_0x2bfa4f[_0x49c4('0x47')]=_[_0x49c4('0x46')](_0xd2ee5e['query']);_0x2bfa4f[_0x49c4('0x48')]=_['intersection'](_0x2bfa4f[_0x49c4('0x45')],_0x2bfa4f[_0x49c4('0x47')]);_0x5b2cc8[_0x49c4('0x4a')]=_[_0x49c4('0x49')](_0x2bfa4f['model'],qs[_0x49c4('0x4b')](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x4b')]));_0x5b2cc8[_0x49c4('0x4a')]=_0x5b2cc8[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x5b2cc8['attributes']:_0x2bfa4f['model'];if(!_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0xff')](_0x49c4('0x4d'))){_0x5b2cc8[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x24')]);_0x5b2cc8[_0x49c4('0x21')]=qs[_0x49c4('0x21')](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x21')]);}_0x5b2cc8[_0x49c4('0x4e')]=qs['sort'](_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x4f')]);_0x5b2cc8['where']=qs[_0x49c4('0x48')](_['pick'](_0xd2ee5e[_0x49c4('0x47')],_0x2bfa4f[_0x49c4('0x48')]));_0x5b2cc8['where'][_0x49c4('0xb0')]=_0x3119a5['id'];if(_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x8a')]){_0x5b2cc8[_0x49c4('0x50')]=_[_0x49c4('0x2a')](_0x5b2cc8['where'],{'$or':_[_0x49c4('0x30')](_0x5b2cc8['attributes'],function(_0x1c74ce){var _0x216896={};_0x216896[_0x1c74ce]={'$like':'%'+_0xd2ee5e[_0x49c4('0x47')]['filter']+'%'};return _0x216896;})});}if(_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0x7f')]){var _0x37ec56=_0xd2ee5e['query']['$gte'][_0x49c4('0x32')](',');var _0x590586={};_0x590586[_0x37ec56[0x0]]={'$gte':moment(_0x37ec56[0x1])[_0x49c4('0xde')](_0x49c4('0x100'))};_0x5b2cc8[_0x49c4('0x50')]=_[_0x49c4('0x2a')](_0x5b2cc8['where'],_0x590586);}_0x5b2cc8=_['merge']({},_0x5b2cc8,_0xd2ee5e['options']);return db[_0x49c4('0xc8')][_0x49c4('0x23')]({'where':_0x5b2cc8[_0x49c4('0x50')]})[_0x49c4('0x14')](function(_0x5255f7){_0x2b507f[_0x49c4('0x23')]=_0x5255f7;if(_0xd2ee5e[_0x49c4('0x47')][_0x49c4('0xb5')]){_0x5b2cc8[_0x49c4('0xb6')]=[{'all':!![]}];}return db[_0x49c4('0xc8')][_0x49c4('0x101')](_0x5b2cc8);})[_0x49c4('0x14')](function(_0x1d2931){_0x2b507f[_0x49c4('0xb2')]=_0x1d2931;return _0x2b507f;});}})[_0x49c4('0x14')](respondWithFilteredResult(_0x201909,_0x5b2cc8))[_0x49c4('0x1d')](handleError(_0x201909,null));};exports['getMyMessages']=function(_0x16e808,_0x514446){var _0x3308c4={'where':{}},_0x3683d7={},_0x4feb6f={'count':0x0,'rows':[]};return db[_0x49c4('0x40')]['findOne']({'where':{'id':_0x16e808[_0x49c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0x514446,null))['then'](function(_0x577ae6){if(_0x577ae6){_0x3683d7[_0x49c4('0x45')]=_[_0x49c4('0x46')](db[_0x49c4('0xc8')]['rawAttributes']);_0x3683d7[_0x49c4('0x47')]=_['keys'](_0x16e808[_0x49c4('0x47')]);_0x3683d7[_0x49c4('0x48')]=_[_0x49c4('0x49')](_0x3683d7['model'],_0x3683d7[_0x49c4('0x47')]);_0x3308c4[_0x49c4('0x4a')]=_[_0x49c4('0x49')](_0x3683d7[_0x49c4('0x45')],qs[_0x49c4('0x4b')](_0x16e808['query'][_0x49c4('0x4b')]));_0x3308c4[_0x49c4('0x4a')]=_0x3308c4[_0x49c4('0x4a')][_0x49c4('0x4c')]?_0x3308c4['attributes']:_0x3683d7['model'];if(!_0x16e808[_0x49c4('0x47')][_0x49c4('0xff')]('nolimit')){_0x3308c4[_0x49c4('0x24')]=qs[_0x49c4('0x24')](_0x16e808[_0x49c4('0x47')][_0x49c4('0x24')]);_0x3308c4['offset']=qs[_0x49c4('0x21')](_0x16e808[_0x49c4('0x47')]['offset']);}_0x3308c4['order']=qs[_0x49c4('0x4f')](_0x16e808[_0x49c4('0x47')][_0x49c4('0x4f')]);_0x3308c4[_0x49c4('0x50')]=qs[_0x49c4('0x48')](_['pick'](_0x16e808[_0x49c4('0x47')],_0x3683d7['filters']));_0x3308c4[_0x49c4('0x50')][_0x49c4('0xb0')]=_0x577ae6['id'];if(_0x16e808[_0x49c4('0x47')][_0x49c4('0x8a')]){_0x3308c4['where']=_['merge'](_0x3308c4['where'],{'$or':_[_0x49c4('0x30')](_0x3308c4[_0x49c4('0x4a')],function(_0x14d5ca){var _0x2cb936={};_0x2cb936[_0x14d5ca]={'$like':'%'+_0x16e808['query']['filter']+'%'};return _0x2cb936;})});}_0x3308c4[_0x49c4('0x50')]['secret']=![];if(_0x16e808[_0x49c4('0x47')]['id']){_0x3308c4[_0x49c4('0x50')]['id']={'$gt':_0x16e808['query']['id']};}_0x3308c4=_[_0x49c4('0x2a')]({},_0x3308c4,_0x16e808[_0x49c4('0x102')]);return db[_0x49c4('0xc8')]['count']({'where':_0x3308c4[_0x49c4('0x50')]})[_0x49c4('0x14')](function(_0x1a5755){_0x4feb6f['count']=_0x1a5755;_0x3308c4[_0x49c4('0xb6')]=[];if(_0x16e808[_0x49c4('0x47')]['includeAgent']){_0x3308c4[_0x49c4('0xb6')][_0x49c4('0x35')]({'model':db['User'],'as':_0x49c4('0x75'),'attributes':['id',_0x49c4('0xc0'),_0x49c4('0xec')]});}if(_0x16e808[_0x49c4('0x47')][_0x49c4('0xb5')]){_0x3308c4['include']=[{'all':!![]}];}return db[_0x49c4('0xc8')][_0x49c4('0x101')](_0x3308c4);})['then'](function(_0x5a4b35){_0x4feb6f[_0x49c4('0xb2')]=_0x5a4b35;return _0x4feb6f;});}})[_0x49c4('0x14')](respondWithFilteredResult(_0x514446,_0x3308c4))['catch'](handleError(_0x514446,null));};exports[_0x49c4('0x103')]=function(_0x55bb71,_0x4059b0){return db[_0x49c4('0x40')]['find']({'where':{'id':_0x55bb71[_0x49c4('0xb4')]['id']}})['then'](handleEntityNotFound(_0x4059b0,null))[_0x49c4('0x14')](function(_0x17ab2c){if(_0x17ab2c){return _0x17ab2c['setTags'](_0x55bb71[_0x49c4('0x2b')][_0x49c4('0xfc')],_['omit'](_0x55bb71['body'],[_0x49c4('0xfc'),'id'])||{})[_0x49c4('0x104')](function(){return db[_0x49c4('0x72')][_0x49c4('0x101')]({'attributes':['id',_0x49c4('0x28'),'color'],'where':{'id':_0x55bb71[_0x49c4('0x2b')][_0x49c4('0xfc')]}});})[_0x49c4('0x14')](function(_0xd62ca){socket[_0x49c4('0x105')]('chatInteractionTags:save',{'id':Number(_0x55bb71[_0x49c4('0xb4')]['id']),'tags':_0xd62ca||[]});return{'id':Number(_0x55bb71[_0x49c4('0xb4')]['id']),'tags':_0xd62ca||[]};});}})[_0x49c4('0x14')](respondWithResult(_0x4059b0,null))[_0x49c4('0x1d')](handleError(_0x4059b0,null));};exports[_0x49c4('0x106')]=function(_0x39abbf,_0x3de5d8){return db[_0x49c4('0x40')]['find']({'where':{'id':_0x39abbf[_0x49c4('0xb4')]['id']}})[_0x49c4('0x14')](handleEntityNotFound(_0x3de5d8,null))[_0x49c4('0x14')](function(_0x5a4b4c){if(_0x5a4b4c){return _0x5a4b4c['removeTags'](_0x39abbf[_0x49c4('0x47')]['ids']);}})[_0x49c4('0x14')](respondWithStatusCode(_0x3de5d8,null))[_0x49c4('0x1d')](handleError(_0x3de5d8,null));};exports[_0x49c4('0xda')]=function(_0x3f0e74,_0x55f423){var _0x3ce0f9=moment()[_0x49c4('0x107')]()[_0x49c4('0x9c')]();var _0x156a4f=path['join'](config[_0x49c4('0xd7')],_0x49c4('0x108'),'files',_0x49c4('0x109'));var _0x22005f=path[_0x49c4('0xd6')](config[_0x49c4('0xd7')],_0x49c4('0x108'),_0x49c4('0x10a'),_0x49c4('0x10b'));var _0x1d3b1a=path['join'](_0x156a4f,_0x3ce0f9);var _0x4eb6ba=util['format'](_0x49c4('0x10c'),_0x3f0e74[_0x49c4('0xb4')]['id'],_0x3ce0f9);var _0x418ead=path[_0x49c4('0xd6')](_0x156a4f,_0x4eb6ba);var _0x39ff8b=[];_0x39ff8b['push']({'model':db[_0x49c4('0x75')],'as':_0x49c4('0x75'),'attributes':['id',_0x49c4('0xc0')],'raw':!![]});_0x39ff8b[_0x49c4('0x35')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x49c4('0x10d'),_0x49c4('0x10e')],'raw':!![]});if(_0x3f0e74[_0x49c4('0x47')][_0x49c4('0x10b')]){_0x39ff8b[_0x49c4('0x35')]({'model':db[_0x49c4('0xd2')],'as':'Attachment','raw':!![]});}var _0x58a5c9=[{'model':db[_0x49c4('0xc8')],'as':_0x49c4('0xe2'),'attributes':['id',_0x49c4('0x2b'),_0x49c4('0xee'),_0x49c4('0x10f'),'secret',_0x49c4('0x86')],'include':_0x39ff8b}];_0x58a5c9[_0x49c4('0x35')]({'model':db[_0x49c4('0xe3')],'as':_0x49c4('0x110'),'attributes':['id',_0x49c4('0x28')]});_0x58a5c9[_0x49c4('0x35')]({'model':db[_0x49c4('0x75')],'as':_0x49c4('0x111'),'attributes':['id',_0x49c4('0xc0')]});return db['ChatInteraction'][_0x49c4('0x67')]({'where':{'id':_0x3f0e74[_0x49c4('0xb4')]['id']},'include':_0x58a5c9})[_0x49c4('0x14')](handleEntityNotFound(_0x55f423,null))[_0x49c4('0x14')](function(_0xe5bb64){if(_0xe5bb64){var _0x5e5ca3=_0xe5bb64[_0x49c4('0x112')]({'plain':!![]});fs[_0x49c4('0x113')](_0x1d3b1a);var _0x485c2d={'channel':_0x49c4('0x114'),'account':_0x5e5ca3['Account'][_0x49c4('0x28')],'agent':_0x5e5ca3['Owner']?_0x5e5ca3[_0x49c4('0x111')][_0x49c4('0xc0')]:'N.A.','createdAt':moment(_0x5e5ca3[_0x49c4('0xee')])['format'](_0x49c4('0x100'))[_0x49c4('0x9c')](),'closedAt':_0x5e5ca3[_0x49c4('0x3d')]?moment(_0x5e5ca3[_0x49c4('0x115')])[_0x49c4('0xde')]('YYYY-MM-DD\x20HH:mm:ss')[_0x49c4('0x9c')]():'','disposition':_0x5e5ca3[_0x49c4('0x3e')],'chatInfo':{'browser':_0x5e5ca3[_0x49c4('0x116')],'os':_0x5e5ca3[_0x49c4('0x117')],'referer':_0x5e5ca3[_0x49c4('0x118')],'customerIp':_0x5e5ca3[_0x49c4('0x119')],'customerPort':_0x5e5ca3[_0x49c4('0x11a')]?_0x5e5ca3[_0x49c4('0x11a')]:'N.A.'},'messages':_(_0x5e5ca3[_0x49c4('0xe2')])[_0x49c4('0x11b')]()[_0x49c4('0x8a')]({'secret':![]})[_0x49c4('0x30')](function(_0x341528){if(_0x341528[_0x49c4('0xd2')]){var _0x2a0ef8=path[_0x49c4('0xd6')](_0x22005f,_0x341528[_0x49c4('0xd2')][_0x49c4('0xd0')]);if(fs[_0x49c4('0x11c')](_0x2a0ef8)){fs[_0x49c4('0x11d')](_0x2a0ef8)['pipe'](fs[_0x49c4('0x11e')](path['join'](_0x1d3b1a,_0x341528[_0x49c4('0xd2')][_0x49c4('0xd0')])));}}return{'date':moment(_0x341528[_0x49c4('0xee')])[_0x49c4('0xde')](_0x49c4('0x100'))[_0x49c4('0x9c')](),'sender':_0x341528[_0x49c4('0x10f')]===_0x49c4('0xc7')?_0x341528[_0x49c4('0x75')]?_0x341528[_0x49c4('0x75')][_0x49c4('0xc0')]:_0x49c4('0xe7'):_0x341528[_0x49c4('0x6c')][_0x49c4('0x10d')]+(_0x341528[_0x49c4('0x6c')]['lastName']?'\x20'+_0x341528[_0x49c4('0x6c')][_0x49c4('0x10e')]:''),'body':_0x341528['Attachment']?_0x341528[_0x49c4('0xd2')]['basename']:_0x341528[_0x49c4('0x2b')],'direction':_0x341528[_0x49c4('0x10f')]===_0x49c4('0xc7')?'A':'C','secret':_0x341528[_0x49c4('0xf0')],'read':_0x341528[_0x49c4('0x86')],'attachment':_0x341528['Attachment']};})['value']()};return ejs[_0x49c4('0x11f')](path[_0x49c4('0xd6')](config[_0x49c4('0xd7')],'server',_0x49c4('0x120'),_0x49c4('0x121')),{'interaction':_0x485c2d})['then'](function(_0x6a1d66){var _0x563f95=path['join'](_0x1d3b1a,'transcript-'+_0x5e5ca3['id']+'-'+_0x3ce0f9+_0x49c4('0x122'));var _0x442210={'path':_0x563f95,'channel':_0x49c4('0x114'),'interactionId':_0x5e5ca3['id']};return pdf[_0x49c4('0x123')](_0x6a1d66,_0x442210);})[_0x49c4('0x14')](function(){return new Promise(function(_0x547d37,_0x223fa2){zipdir(_0x1d3b1a,{'saveTo':_0x418ead},function(_0x147d5e,_0x29674d){if(_0x147d5e)return _0x223fa2(_0x147d5e);return _0x547d37(_0x29674d);});})['then'](function(){return new BPromise(function(_0x17b015,_0x724d15){rimraf(_0x1d3b1a,function(_0x3350da){if(_0x3350da)_0x724d15(_0x3350da);return _0x17b015();});});})[_0x49c4('0x14')](function(){return _0x55f423[_0x49c4('0xda')](_0x418ead,_0x4eb6ba,function(_0x146c6e){if(_0x146c6e){logger[_0x49c4('0x1a')](_0x49c4('0x124'),_0x146c6e);}else{fs[_0x49c4('0x125')](_0x418ead);}});});});}else{return _0x55f423[_0x49c4('0x126')](0xc8);}})[_0x49c4('0x1d')](handleError(_0x55f423,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 97940b3..28474b7 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 _0x7e8a=['emit','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length'];(function(_0x40b5d7,_0x222e3f){var _0x39b22e=function(_0x386243){while(--_0x386243){_0x40b5d7['push'](_0x40b5d7['shift']());}};_0x39b22e(++_0x222e3f);}(_0x7e8a,0x123));var _0xa7e8=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x7e8a[_0x5f0089];return _0x193892;};'use strict';var EventEmitter=require(_0xa7e8('0x0'));var ChatInteraction=require(_0xa7e8('0x1'))['db'][_0xa7e8('0x2')];var ChatMessage=require(_0xa7e8('0x1'))['db'][_0xa7e8('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xa7e8('0x4')](0x0);var events={'afterCreate':_0xa7e8('0x5'),'afterUpdate':_0xa7e8('0x6'),'afterDestroy':_0xa7e8('0x7')};function emitEvent(_0x5cfb20){return function(_0x3e8150,_0x51e61b,_0x536a2a){_0x3e8150[_0xa7e8('0x8')]({'attributes':['id'],'raw':!![]})[_0xa7e8('0x9')](function(_0xe5f9e5){_0x3e8150[_0xa7e8('0xa')](_0xa7e8('0xb'),_0xe5f9e5[_0xa7e8('0xc')](function(_0x453bad){return{'id':_0x453bad['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3e8150['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa7e8('0x9')](function(_0x22ba2f){_0x3e8150[_0xa7e8('0xa')](_0xa7e8('0xd'),_0x22ba2f[_0xa7e8('0xe')]);ChatInteractionEvents[_0xa7e8('0xf')](_0x5cfb20+':'+_0x3e8150['id'],_0x3e8150);ChatInteractionEvents[_0xa7e8('0xf')](_0x5cfb20,_0x3e8150);_0x536a2a(null);})['catch'](_0x536a2a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xa7e8('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x29bc=['emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x467667,_0x1da834){var _0x22d832=function(_0x3e55a8){while(--_0x3e55a8){_0x467667['push'](_0x467667['shift']());}};_0x22d832(++_0x1da834);}(_0x29bc,0x1cd));var _0xc29b=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x29bc[_0xaa0309];return _0x5de7ce;};'use strict';var EventEmitter=require(_0xc29b('0x0'));var ChatInteraction=require(_0xc29b('0x1'))['db'][_0xc29b('0x2')];var ChatMessage=require(_0xc29b('0x1'))['db'][_0xc29b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc29b('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc29b('0x5')};function emitEvent(_0x41b61d){return function(_0x239960,_0x12ea7a,_0x391e18){_0x239960[_0xc29b('0x6')]({'attributes':['id'],'raw':!![]})[_0xc29b('0x7')](function(_0x3985b1){_0x239960[_0xc29b('0x8')](_0xc29b('0x9'),_0x3985b1[_0xc29b('0xa')](function(_0x559639){return{'id':_0x559639['id']};}));return ChatMessage[_0xc29b('0xb')]({'where':{'ChatInteractionId':_0x239960['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc29b('0x7')](function(_0xe1ba4e){_0x239960[_0xc29b('0x8')](_0xc29b('0xc'),_0xe1ba4e[_0xc29b('0xd')]);ChatInteractionEvents[_0xc29b('0xe')](_0x41b61d+':'+_0x239960['id'],_0x239960);ChatInteractionEvents['emit'](_0x41b61d,_0x239960);_0x391e18(null);})[_0xc29b('0xf')](_0x391e18(null));};}for(var e in events){if(events[_0xc29b('0x10')](e)){var event=events[e];ChatInteraction[_0xc29b('0x11')](e,emitEvent(event));}}module[_0xc29b('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 b45baaf..6ca95b7 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 _0xbd5b=['bluebird','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x2f1172,_0x5f5b26){var _0x58e374=function(_0x1a61fa){while(--_0x1a61fa){_0x2f1172['push'](_0x2f1172['shift']());}};_0x58e374(++_0x5f5b26);}(_0xbd5b,0x164));var _0xbbd5=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0xbd5b[_0x225f50];return _0x19d003;};'use strict';var _=require('lodash');var util=require(_0xbbd5('0x0'));var logger=require(_0xbbd5('0x1'))(_0xbbd5('0x2'));var moment=require(_0xbbd5('0x3'));var BPromise=require(_0xbbd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbbd5('0x5'));var attributes=require(_0xbbd5('0x6'));module[_0xbbd5('0x7')]=function(_0x315dea,_0x3fcf3c){return _0x315dea[_0xbbd5('0x8')](_0xbbd5('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d1329,_0x25f6e7,_0x427abd){if(_0x3d1329[_0xbbd5('0xa')]('closed')){_0x3d1329[_0xbbd5('0xb')]=moment()[_0xbbd5('0xc')](_0xbbd5('0xd'));}_0x427abd(null,_0x3d1329);}},'charset':'utf8mb4','collate':_0xbbd5('0xe')});};
\ No newline at end of file
+var _0x1fb8=['request-promise','path','../../config/environment','define','chat_interactions','changed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x283a2b,_0x384d7c){var _0x64f752=function(_0x3b5f58){while(--_0x3b5f58){_0x283a2b['push'](_0x283a2b['shift']());}};_0x64f752(++_0x384d7c);}(_0x1fb8,0xb1));var _0x81fb=function(_0x32be7d,_0x1e1fd6){_0x32be7d=_0x32be7d-0x0;var _0x3ddf=_0x1fb8[_0x32be7d];return _0x3ddf;};'use strict';var _=require(_0x81fb('0x0'));var util=require(_0x81fb('0x1'));var logger=require('../../config/logger')(_0x81fb('0x2'));var moment=require(_0x81fb('0x3'));var BPromise=require(_0x81fb('0x4'));var rp=require(_0x81fb('0x5'));var fs=require('fs');var path=require(_0x81fb('0x6'));var rimraf=require('rimraf');var config=require(_0x81fb('0x7'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x1c5528,_0x5aafff){return _0x1c5528[_0x81fb('0x8')]('ChatInteraction',attributes,{'tableName':_0x81fb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52907d,_0x1dc3ce,_0x53207a){if(_0x52907d[_0x81fb('0xa')]('closed')){_0x52907d['closedAt']=moment()['format'](_0x81fb('0xb'));}_0x53207a(null,_0x52907d);}},'charset':'utf8mb4','collate':_0x81fb('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index cfd472c..0862f7a 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 _0x70cf=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','catch','AddTagsToChatInteraction','addTags','ids','AddTags','lodash','util'];(function(_0x962edb,_0x5dd356){var _0x359dcf=function(_0x978f40){while(--_0x978f40){_0x962edb['push'](_0x962edb['shift']());}};_0x359dcf(++_0x5dd356);}(_0x70cf,0x10f));var _0xf70c=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x70cf[_0x504df1];return _0x1063b5;};'use strict';var _=require(_0xf70c('0x0'));var util=require(_0xf70c('0x1'));var moment=require('moment');var BPromise=require(_0xf70c('0x2'));var rs=require(_0xf70c('0x3'));var fs=require('fs');var Redis=require(_0xf70c('0x4'));var db=require(_0xf70c('0x5'))['db'];var utils=require(_0xf70c('0x6'));var logger=require('../../config/logger')(_0xf70c('0x7'));var config=require(_0xf70c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf70c('0x9')]['http']({'port':0x232a});config[_0xf70c('0xa')]=_[_0xf70c('0xb')](config[_0xf70c('0xa')],{'host':_0xf70c('0xc'),'port':0x18eb});var socket=require(_0xf70c('0xd'))(new Redis(config['redis']));require(_0xf70c('0xe'))['register'](socket);function respondWithRpcPromise(_0x20112c,_0x3312eb,_0x34a6e5){return new BPromise(function(_0x3702e2,_0x36ba97){return client[_0xf70c('0xf')](_0x20112c,_0x34a6e5)[_0xf70c('0x10')](function(_0x2ec9fc){logger[_0xf70c('0x11')](_0xf70c('0x12'),_0x3312eb,_0xf70c('0x13'));logger[_0xf70c('0x14')](_0xf70c('0x15'),_0x3312eb,'request\x20sent',JSON[_0xf70c('0x16')](_0x2ec9fc));if(_0x2ec9fc[_0xf70c('0x17')]){if(_0x2ec9fc[_0xf70c('0x17')][_0xf70c('0x18')]===0x1f4){logger[_0xf70c('0x17')](_0xf70c('0x12'),_0x3312eb,_0x2ec9fc[_0xf70c('0x17')]['message']);return _0x36ba97(_0x2ec9fc[_0xf70c('0x17')][_0xf70c('0x19')]);}logger[_0xf70c('0x17')](_0xf70c('0x12'),_0x3312eb,_0x2ec9fc[_0xf70c('0x17')]['message']);return _0x3702e2(_0x2ec9fc['error'][_0xf70c('0x19')]);}else{logger[_0xf70c('0x11')](_0xf70c('0x12'),_0x3312eb,_0xf70c('0x13'));_0x3702e2(_0x2ec9fc[_0xf70c('0x1a')][_0xf70c('0x19')]);}})['catch'](function(_0xbc8a27){logger[_0xf70c('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x3312eb,_0xbc8a27);_0x36ba97(_0xbc8a27);});});}exports[_0xf70c('0x1b')]=function(_0x2334e1){var _0x227b67=this;return new Promise(function(_0x1e2178,_0x45f5f9){return db[_0xf70c('0x1c')][_0xf70c('0x1d')](_0x2334e1[_0xf70c('0x1e')],{'raw':_0x2334e1['options']?_0x2334e1[_0xf70c('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2334e1['options']?_0x2334e1['options'][_0xf70c('0x20')]||null:null,'attributes':_0x2334e1['options']?_0x2334e1['options'][_0xf70c('0x21')]||null:null,'limit':_0x2334e1[_0xf70c('0x1f')]?_0x2334e1[_0xf70c('0x1f')]['limit']||null:null})[_0xf70c('0x10')](function(_0x34212d){logger['info']('UpdateChatInteraction',_0x2334e1);logger[_0xf70c('0x14')](_0xf70c('0x1b'),_0x2334e1,JSON[_0xf70c('0x16')](_0x34212d));_0x1e2178(_0x34212d);})[_0xf70c('0x22')](function(_0xad21c){logger[_0xf70c('0x17')]('UpdateChatInteraction',_0xad21c['message'],_0x2334e1);_0x45f5f9(_0x227b67[_0xf70c('0x17')](0x1f4,_0xad21c[_0xf70c('0x19')]));});});};exports[_0xf70c('0x23')]=function(_0x55cd7f){return new Promise(function(_0x497a80,_0x2c3e67){return db['ChatInteraction']['find']({'where':_0x55cd7f[_0xf70c('0x1f')]?_0x55cd7f[_0xf70c('0x1f')][_0xf70c('0x20')]||null:null})[_0xf70c('0x10')](function(_0x3e5a8b){if(_0x3e5a8b){return _0x3e5a8b[_0xf70c('0x24')](_0x55cd7f[_0xf70c('0x1e')][_0xf70c('0x25')],_['omit'](_0x55cd7f[_0xf70c('0x1e')],[_0xf70c('0x25'),'id'])||{});}})['spread'](function(_0x4f007b){logger[_0xf70c('0x11')](_0xf70c('0x26'),_0x55cd7f);logger[_0xf70c('0x14')](_0xf70c('0x26'),_0x55cd7f,JSON[_0xf70c('0x16')](_0x4f007b));_0x497a80(_0x4f007b);})[_0xf70c('0x22')](function(_0x17d25a){logger[_0xf70c('0x17')](_0xf70c('0x26'),_0x17d25a[_0xf70c('0x19')],_0x55cd7f);_0x2c3e67(_this[_0xf70c('0x17')](0x1f4,_0x17d25a[_0xf70c('0x19')]));});});};
\ No newline at end of file
+var _0xd358=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','addTags','ids','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4bfade,_0xb26c0e){var _0x272465=function(_0x3b38cb){while(--_0x3b38cb){_0x4bfade['push'](_0x4bfade['shift']());}};_0x272465(++_0xb26c0e);}(_0xd358,0x1e4));var _0x8d35=function(_0x5f063e,_0x36171a){_0x5f063e=_0x5f063e-0x0;var _0x1c8396=_0xd358[_0x5f063e];return _0x1c8396;};'use strict';var _=require('lodash');var util=require(_0x8d35('0x0'));var moment=require(_0x8d35('0x1'));var BPromise=require(_0x8d35('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d35('0x3'));var db=require(_0x8d35('0x4'))['db'];var utils=require(_0x8d35('0x5'));var logger=require(_0x8d35('0x6'))(_0x8d35('0x7'));var config=require(_0x8d35('0x8'));var jayson=require(_0x8d35('0x9'));var client=jayson[_0x8d35('0xa')][_0x8d35('0xb')]({'port':0x232a});config[_0x8d35('0xc')]=_['defaults'](config[_0x8d35('0xc')],{'host':_0x8d35('0xd'),'port':0x18eb});var socket=require(_0x8d35('0xe'))(new Redis(config[_0x8d35('0xc')]));require(_0x8d35('0xf'))[_0x8d35('0x10')](socket);function respondWithRpcPromise(_0x55c56b,_0x24a6f1,_0x44fb1a){return new BPromise(function(_0x1be5a2,_0x792b3c){return client['request'](_0x55c56b,_0x44fb1a)[_0x8d35('0x11')](function(_0x573f1f){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x24a6f1,_0x8d35('0x12'));logger[_0x8d35('0x13')](_0x8d35('0x14'),_0x24a6f1,'request\x20sent',JSON[_0x8d35('0x15')](_0x573f1f));if(_0x573f1f[_0x8d35('0x16')]){if(_0x573f1f[_0x8d35('0x16')][_0x8d35('0x17')]===0x1f4){logger[_0x8d35('0x16')](_0x8d35('0x18'),_0x24a6f1,_0x573f1f[_0x8d35('0x16')][_0x8d35('0x19')]);return _0x792b3c(_0x573f1f['error']['message']);}logger['error'](_0x8d35('0x18'),_0x24a6f1,_0x573f1f[_0x8d35('0x16')][_0x8d35('0x19')]);return _0x1be5a2(_0x573f1f['error'][_0x8d35('0x19')]);}else{logger[_0x8d35('0x1a')](_0x8d35('0x18'),_0x24a6f1,_0x8d35('0x12'));_0x1be5a2(_0x573f1f['result'][_0x8d35('0x19')]);}})[_0x8d35('0x1b')](function(_0x4e4e66){logger['error'](_0x8d35('0x18'),_0x24a6f1,_0x4e4e66);_0x792b3c(_0x4e4e66);});});}exports[_0x8d35('0x1c')]=function(_0x4ae9b6){var _0x1d773f=this;return new Promise(function(_0x2f51ce,_0x1e8380){return db[_0x8d35('0x1d')][_0x8d35('0x1e')](_0x4ae9b6[_0x8d35('0x1f')],{'raw':_0x4ae9b6['options']?_0x4ae9b6[_0x8d35('0x20')][_0x8d35('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ae9b6[_0x8d35('0x20')]?_0x4ae9b6['options'][_0x8d35('0x22')]||null:null,'attributes':_0x4ae9b6[_0x8d35('0x20')]?_0x4ae9b6['options'][_0x8d35('0x23')]||null:null,'limit':_0x4ae9b6['options']?_0x4ae9b6[_0x8d35('0x20')][_0x8d35('0x24')]||null:null})['then'](function(_0x372037){logger['info'](_0x8d35('0x1c'),_0x4ae9b6);logger['debug'](_0x8d35('0x1c'),_0x4ae9b6,JSON['stringify'](_0x372037));_0x2f51ce(_0x372037);})[_0x8d35('0x1b')](function(_0x5cbe95){logger[_0x8d35('0x16')]('UpdateChatInteraction',_0x5cbe95[_0x8d35('0x19')],_0x4ae9b6);_0x1e8380(_0x1d773f[_0x8d35('0x16')](0x1f4,_0x5cbe95[_0x8d35('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x420bd0){return new Promise(function(_0x1cd4b8,_0x153e97){return db[_0x8d35('0x1d')]['find']({'where':_0x420bd0['options']?_0x420bd0[_0x8d35('0x20')]['where']||null:null})[_0x8d35('0x11')](function(_0x31fa34){if(_0x31fa34){return _0x31fa34[_0x8d35('0x25')](_0x420bd0[_0x8d35('0x1f')]['ids'],_['omit'](_0x420bd0[_0x8d35('0x1f')],[_0x8d35('0x26'),'id'])||{});}})[_0x8d35('0x27')](function(_0x5a940c){logger['info'](_0x8d35('0x28'),_0x420bd0);logger[_0x8d35('0x13')](_0x8d35('0x28'),_0x420bd0,JSON[_0x8d35('0x15')](_0x5a940c));_0x1cd4b8(_0x5a940c);})['catch'](function(_0x5b87d6){logger[_0x8d35('0x16')](_0x8d35('0x28'),_0x5b87d6[_0x8d35('0x19')],_0x420bd0);_0x153e97(_this['error'](0x1f4,_0x5b87d6['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 14c07e5..3f0a067 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 _0xf150=['remove','update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf150,0x196));var _0x0f15=function(_0x10b351,_0x80ac56){_0x10b351=_0x10b351-0x0;var _0xd5d408=_0xf150[_0x10b351];return _0xd5d408;};'use strict';var ChatInteractionEvents=require(_0x0f15('0x0'));var events=[_0x0f15('0x1'),_0x0f15('0x2'),_0x0f15('0x3')];function createListener(_0xfeab7,_0x4f4753){return function(_0x4a7f60){_0x4f4753[_0x0f15('0x4')](_0xfeab7,_0x4a7f60);};}function removeListener(_0x1ae882,_0x1f1d52){return function(){ChatInteractionEvents[_0x0f15('0x5')](_0x1ae882,_0x1f1d52);};}exports['register']=function(_0xd88f20){for(var _0x437b6f=0x0,_0x4ccc45=events[_0x0f15('0x6')];_0x437b6f<_0x4ccc45;_0x437b6f++){var _0x5e8dd9=events[_0x437b6f];var _0x3ab492=createListener(_0x0f15('0x7')+_0x5e8dd9,_0xd88f20);ChatInteractionEvents['on'](_0x5e8dd9,_0x3ab492);}};
\ No newline at end of file
+var _0x1a1c=['removeListener','length','chatInteraction:','./chatInteraction.events','remove','update','emit'];(function(_0x2646db,_0xb55473){var _0x3336f9=function(_0x372784){while(--_0x372784){_0x2646db['push'](_0x2646db['shift']());}};_0x3336f9(++_0xb55473);}(_0x1a1c,0x1bc));var _0xc1a1=function(_0x4b6295,_0x456ed9){_0x4b6295=_0x4b6295-0x0;var _0x5b4941=_0x1a1c[_0x4b6295];return _0x5b4941;};'use strict';var ChatInteractionEvents=require(_0xc1a1('0x0'));var events=['save',_0xc1a1('0x1'),_0xc1a1('0x2')];function createListener(_0x3dc7de,_0x32d6c5){return function(_0x53adc7){_0x32d6c5[_0xc1a1('0x3')](_0x3dc7de,_0x53adc7);};}function removeListener(_0x44b278,_0x499eb2){return function(){ChatInteractionEvents[_0xc1a1('0x4')](_0x44b278,_0x499eb2);};}exports['register']=function(_0x35284f){for(var _0x17e8a0=0x0,_0x2dafbd=events[_0xc1a1('0x5')];_0x17e8a0<_0x2dafbd;_0x17e8a0++){var _0x11a953=events[_0x17e8a0];var _0x5af133=createListener(_0xc1a1('0x6')+_0x11a953,_0x35284f);ChatInteractionEvents['on'](_0x11a953,_0x5af133);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index b546a2d..1fd6e96 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 _0xfc59=['../../components/interaction/service','../../config/environment','./chatInteraction.controller','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','get','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','/:id/attachment_upload','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','/:id/custom_update','put','/:id/abandon','abandon','/:id/close','close','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xfc59,0xbe));var _0x9fc5=function(_0x3c11f4,_0x2d2bcb){_0x3c11f4=_0x3c11f4-0x0;var _0x432957=_0xfc59[_0x3c11f4];return _0x432957;};'use strict';var multer=require(_0x9fc5('0x0'));var util=require(_0x9fc5('0x1'));var path=require(_0x9fc5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9fc5('0x3')]();var fs_extra=require(_0x9fc5('0x4'));var auth=require(_0x9fc5('0x5'));var interaction=require(_0x9fc5('0x6'));var config=require(_0x9fc5('0x7'));var controller=require(_0x9fc5('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9fc5('0x9')]);router['get'](_0x9fc5('0xa'),auth[_0x9fc5('0xb')](),controller[_0x9fc5('0xc')]);router['get'](_0x9fc5('0xd'),auth[_0x9fc5('0xe')](),controller[_0x9fc5('0xf')]);router[_0x9fc5('0x10')](_0x9fc5('0x11'),auth[_0x9fc5('0xe')](),controller[_0x9fc5('0x12')]);router['get'](_0x9fc5('0x13'),auth['isAuthenticated'](),controller[_0x9fc5('0x14')]);router[_0x9fc5('0x10')](_0x9fc5('0x15'),auth['isChatInteractionAuthorized'](),controller[_0x9fc5('0x16')]);router[_0x9fc5('0x10')](_0x9fc5('0x17'),auth[_0x9fc5('0xb')](),controller['download']);router[_0x9fc5('0x18')]('/',auth[_0x9fc5('0xb')](),controller[_0x9fc5('0x19')]);router['post'](_0x9fc5('0x1a'),auth['isAuthenticated'](),controller[_0x9fc5('0x1b')]);var upload=multer({'storage':multer[_0x9fc5('0x1c')]({'destination':function(_0x4395f8,_0x26fa92,_0x534074){_0x534074(null,path[_0x9fc5('0x1d')](config[_0x9fc5('0x1e')],_0x9fc5('0x1f')));},'filename':function(_0x4b72bd,_0x130cec,_0xcfb089){_0xcfb089(null,util[_0x9fc5('0x20')](_0x9fc5('0x21'),Date['now'](),_0x130cec['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x9fc5('0x22'),upload['single']('file'),controller['attachmentUpload']);router[_0x9fc5('0x18')](_0x9fc5('0x13'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x9fc5('0x18')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x9fc5('0x23')](_0x9fc5('0x24'),_0x9fc5('0x25')),controller[_0x9fc5('0x26')]);router['put'](_0x9fc5('0xd'),auth['isAuthenticated'](),interaction[_0x9fc5('0x23')](_0x9fc5('0x24'),_0x9fc5('0x27')),controller[_0x9fc5('0x28')]);router['put'](_0x9fc5('0x29'),controller['customUpdate']);router[_0x9fc5('0x2a')](_0x9fc5('0x2b'),auth[_0x9fc5('0xe')](),controller[_0x9fc5('0x2c')]);router[_0x9fc5('0x2a')](_0x9fc5('0x2d'),controller[_0x9fc5('0x2e')]);router[_0x9fc5('0x2f')]('/:id',auth['isAuthenticated'](),interaction[_0x9fc5('0x23')](_0x9fc5('0x24'),'chatinteraction:destroy'),controller['destroy']);router['delete']('/:id/tags',auth[_0x9fc5('0xb')](),controller['removeTags']);module[_0x9fc5('0x30')]=router;
\ No newline at end of file
+var _0x970a=['isChatInteractionAuthorized','/:id/messages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','chatinteraction:addtags','addTags','put','tracked','chat','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/attachment_download'];(function(_0x2100a9,_0x7c25cf){var _0x44f037=function(_0x46bbf8){while(--_0x46bbf8){_0x2100a9['push'](_0x2100a9['shift']());}};_0x44f037(++_0x7c25cf);}(_0x970a,0x19a));var _0xa970=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x970a[_0x484c03];return _0x294127;};'use strict';var multer=require(_0xa970('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa970('0x1'));var router=express[_0xa970('0x2')]();var fs_extra=require(_0xa970('0x3'));var auth=require(_0xa970('0x4'));var interaction=require(_0xa970('0x5'));var config=require('../../config/environment');var controller=require(_0xa970('0x6'));router[_0xa970('0x7')]('/',auth[_0xa970('0x8')](),controller['index']);router[_0xa970('0x7')](_0xa970('0x9'),auth[_0xa970('0x8')](),controller[_0xa970('0xa')]);router[_0xa970('0x7')](_0xa970('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xa970('0xc')]);router[_0xa970('0x7')](_0xa970('0xd'),auth[_0xa970('0xe')](),controller['attachmentDownload']);router[_0xa970('0x7')](_0xa970('0xf'),auth[_0xa970('0x8')](),controller['getMessages']);router['get'](_0xa970('0x10'),auth['isChatInteractionAuthorized'](),controller[_0xa970('0x11')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xa970('0x12')]);router[_0xa970('0x13')]('/',auth[_0xa970('0x8')](),controller[_0xa970('0x14')]);router[_0xa970('0x13')](_0xa970('0x15'),auth[_0xa970('0x8')](),controller[_0xa970('0x16')]);var upload=multer({'storage':multer[_0xa970('0x17')]({'destination':function(_0x469be5,_0x47749f,_0x1ca57b){_0x1ca57b(null,path[_0xa970('0x18')](config[_0xa970('0x19')],_0xa970('0x1a')));},'filename':function(_0x22945e,_0x844cd3,_0x430bec){_0x430bec(null,util[_0xa970('0x1b')]('%s-%s',Date[_0xa970('0x1c')](),_0x844cd3[_0xa970('0x1d')][_0xa970('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xa970('0x1f'),upload['single'](_0xa970('0x20')),controller[_0xa970('0x21')]);router[_0xa970('0x13')](_0xa970('0xf'),auth[_0xa970('0xe')](),controller[_0xa970('0x22')]);router[_0xa970('0x13')]('/:id/tags',auth[_0xa970('0x8')](),interaction['tracked']('chat',_0xa970('0x23')),controller[_0xa970('0x24')]);router[_0xa970('0x25')](_0xa970('0xb'),auth[_0xa970('0x8')](),interaction[_0xa970('0x26')](_0xa970('0x27'),_0xa970('0x28')),controller['update']);router[_0xa970('0x25')](_0xa970('0x29'),controller[_0xa970('0x2a')]);router['put'](_0xa970('0x2b'),auth[_0xa970('0xe')](),controller[_0xa970('0x2c')]);router[_0xa970('0x25')](_0xa970('0x2d'),controller[_0xa970('0x2e')]);router[_0xa970('0x2f')](_0xa970('0xb'),auth[_0xa970('0x8')](),interaction[_0xa970('0x26')](_0xa970('0x27'),_0xa970('0x30')),controller[_0xa970('0x31')]);router[_0xa970('0x2f')](_0xa970('0x32'),auth[_0xa970('0x8')](),controller[_0xa970('0x33')]);module[_0xa970('0x34')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index f391b02..fd4333e 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 _0x60af=['exports','TEXT','BOOLEAN','INTEGER'];(function(_0x43acd6,_0x2bcc7b){var _0x3da9e5=function(_0x28170c){while(--_0x28170c){_0x43acd6['push'](_0x43acd6['shift']());}};_0x3da9e5(++_0x2bcc7b);}(_0x60af,0x64));var _0xf60a=function(_0x32eb8b,_0x5ac0b5){_0x32eb8b=_0x32eb8b-0x0;var _0x5bc68b=_0x60af[_0x32eb8b];return _0x5bc68b;};'use strict';var Sequelize=require('sequelize');module[_0xf60a('0x0')]={'body':{'type':Sequelize[_0xf60a('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf60a('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf60a('0x3')]}};
\ No newline at end of file
+var _0x7832=['medium','BOOLEAN','sequelize','exports','TEXT'];(function(_0x28656b,_0x4f773a){var _0x287965=function(_0x6be24){while(--_0x6be24){_0x28656b['push'](_0x28656b['shift']());}};_0x287965(++_0x4f773a);}(_0x7832,0x110));var _0x2783=function(_0x1b18ce,_0x4b4869){_0x1b18ce=_0x1b18ce-0x0;var _0x18c92c=_0x7832[_0x1b18ce];return _0x18c92c;};'use strict';var Sequelize=require(_0x2783('0x0'));module[_0x2783('0x1')]={'body':{'type':Sequelize[_0x2783('0x2')](_0x2783('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2783('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 9fc3231..47a3e2d 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 _0x284a=['isEmpty','agent','resourceId','push','messages','ToId','-createdAt','all','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','params','options','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','role','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','findAll'];(function(_0x440a75,_0x1768a0){var _0x5e386d=function(_0x427fa7){while(--_0x427fa7){_0x440a75['push'](_0x440a75['shift']());}};_0x5e386d(++_0x1768a0);}(_0x284a,0x146));var _0xa284=function(_0x564434,_0x102c3f){_0x564434=_0x564434-0x0;var _0x224ccc=_0x284a[_0x564434];return _0x224ccc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa284('0x0'));var zipdir=require(_0xa284('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa284('0x2'));var moment=require(_0xa284('0x3'));var BPromise=require(_0xa284('0x4'));var Mustache=require('mustache');var util=require(_0xa284('0x5'));var path=require('path');var sox=require(_0xa284('0x6'));var csv=require(_0xa284('0x7'));var ejs=require(_0xa284('0x8'));var fs=require('fs');var fs_extra=require(_0xa284('0x9'));var _=require(_0xa284('0xa'));var squel=require(_0xa284('0xb'));var crypto=require(_0xa284('0xc'));var jsforce=require(_0xa284('0xd'));var deskjs=require(_0xa284('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa284('0xf'));var Papa=require(_0xa284('0x10'));var Redis=require(_0xa284('0x11'));var authService=require(_0xa284('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa284('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa284('0x14'));var licenseUtil=require(_0xa284('0x15'));var db=require(_0xa284('0x16'))['db'];config[_0xa284('0x17')]=_[_0xa284('0x18')](config[_0xa284('0x17')],{'host':_0xa284('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa284('0x17')]));require('./chatInternalMessage.socket')[_0xa284('0x1a')](socket);function respondWithStatusCode(_0x4191a4,_0x19de40){_0x19de40=_0x19de40||0xcc;return function(_0x5e6385){if(_0x5e6385){return _0x4191a4[_0xa284('0x1b')](_0x19de40);}return _0x4191a4[_0xa284('0x1c')](_0x19de40)['end']();};}function respondWithResult(_0x1718a2,_0x100793){_0x100793=_0x100793||0xc8;return function(_0x105c53){if(_0x105c53){return _0x1718a2[_0xa284('0x1c')](_0x100793)[_0xa284('0x1d')](_0x105c53);}};}function respondWithFilteredResult(_0x1abd1d,_0x2e1b67){return function(_0xf4962a){if(_0xf4962a){var _0x126258=typeof _0x2e1b67[_0xa284('0x1e')]===_0xa284('0x1f')&&typeof _0x2e1b67[_0xa284('0x20')]===_0xa284('0x1f');var _0x268a70=_0xf4962a[_0xa284('0x21')];var _0x57f138=_0x126258?0x0:_0x2e1b67[_0xa284('0x1e')];var _0x2d3157=_0x126258?_0xf4962a[_0xa284('0x21')]:_0x2e1b67['offset']+_0x2e1b67[_0xa284('0x20')];var _0x1c8bdd;if(_0x2d3157>=_0x268a70){_0x2d3157=_0x268a70;_0x1c8bdd=0xc8;}else{_0x1c8bdd=0xce;}_0x1abd1d[_0xa284('0x1c')](_0x1c8bdd);return _0x1abd1d[_0xa284('0x22')]('Content-Range',_0x57f138+'-'+_0x2d3157+'/'+_0x268a70)[_0xa284('0x1d')](_0xf4962a);}return null;};}function patchUpdates(_0x652119){return function(_0x2e1695){try{jsonpatch['apply'](_0x2e1695,_0x652119,!![]);}catch(_0x326cbb){return BPromise[_0xa284('0x23')](_0x326cbb);}return _0x2e1695[_0xa284('0x24')]();};}function saveUpdates(_0x3670d2,_0x2aadbe){return function(_0xcdd2c4){if(_0xcdd2c4){return _0xcdd2c4[_0xa284('0x25')](_0x3670d2)[_0xa284('0x26')](function(_0x4cabac){return _0x4cabac;});}return null;};}function removeEntity(_0x9d2928,_0x243be2){return function(_0x2f2297){if(_0x2f2297){return _0x2f2297[_0xa284('0x27')]()[_0xa284('0x26')](function(){_0x9d2928[_0xa284('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e772f,_0x1e7e5f){return function(_0xbcb394){if(!_0xbcb394){_0x5e772f['sendStatus'](0x194);}return _0xbcb394;};}function handleError(_0x11566e,_0x2d7cd9){_0x2d7cd9=_0x2d7cd9||0x1f4;return function(_0x5bd22d){logger['error'](_0x5bd22d[_0xa284('0x28')]);if(_0x5bd22d[_0xa284('0x29')]){delete _0x5bd22d['name'];}_0x11566e['status'](_0x2d7cd9)[_0xa284('0x2a')](_0x5bd22d);};}exports[_0xa284('0x2b')]=function(_0x55a44c,_0x15d282){var _0x432d80={},_0x6d4fe0={},_0x9c2ca0={'count':0x0,'rows':[]};var _0x2a6273=_[_0xa284('0x2c')](db[_0xa284('0x2d')][_0xa284('0x2e')],function(_0x25860b){return{'name':_0x25860b[_0xa284('0x2f')],'type':_0x25860b[_0xa284('0x30')][_0xa284('0x31')]};});_0x6d4fe0['model']=_[_0xa284('0x2c')](_0x2a6273,_0xa284('0x29'));_0x6d4fe0['query']=_[_0xa284('0x32')](_0x55a44c['query']);_0x6d4fe0['filters']=_[_0xa284('0x33')](_0x6d4fe0[_0xa284('0x34')],_0x6d4fe0[_0xa284('0x35')]);_0x432d80[_0xa284('0x36')]=_['intersection'](_0x6d4fe0[_0xa284('0x34')],qs[_0xa284('0x37')](_0x55a44c['query']['fields']));_0x432d80[_0xa284('0x36')]=_0x432d80[_0xa284('0x36')][_0xa284('0x38')]?_0x432d80[_0xa284('0x36')]:_0x6d4fe0[_0xa284('0x34')];if(!_0x55a44c[_0xa284('0x35')][_0xa284('0x39')](_0xa284('0x3a'))){_0x432d80[_0xa284('0x20')]=qs[_0xa284('0x20')](_0x55a44c[_0xa284('0x35')]['limit']);_0x432d80[_0xa284('0x1e')]=qs[_0xa284('0x1e')](_0x55a44c[_0xa284('0x35')]['offset']);}_0x432d80[_0xa284('0x3b')]=qs[_0xa284('0x3c')](_0x55a44c[_0xa284('0x35')][_0xa284('0x3c')]);_0x432d80['where']=qs[_0xa284('0x3d')](_['pick'](_0x55a44c[_0xa284('0x35')],_0x6d4fe0[_0xa284('0x3d')]),_0x2a6273);if(_0x55a44c['query'][_0xa284('0x3e')]){_0x432d80[_0xa284('0x3f')]=_[_0xa284('0x40')](_0x432d80[_0xa284('0x3f')],{'$or':_[_0xa284('0x2c')](_0x2a6273,function(_0x1c4eda){if(_0x1c4eda[_0xa284('0x30')]!==_0xa284('0x41')){var _0x3e8222={};_0x3e8222[_0x1c4eda[_0xa284('0x29')]]={'$like':'%'+_0x55a44c['query'][_0xa284('0x3e')]+'%'};return _0x3e8222;}})});}_0x432d80=_[_0xa284('0x40')]({},_0x432d80,_0x55a44c['options']);var _0x4e744a={'where':_0x432d80[_0xa284('0x3f')]};return db['ChatInternalMessage'][_0xa284('0x21')](_0x4e744a)[_0xa284('0x26')](function(_0x350cc4){_0x9c2ca0[_0xa284('0x21')]=_0x350cc4;if(_0x55a44c['query'][_0xa284('0x42')]){_0x432d80[_0xa284('0x43')]=[{'all':!![]}];}return db[_0xa284('0x2d')]['findAll'](_0x432d80);})[_0xa284('0x26')](function(_0x5c4d66){_0x9c2ca0[_0xa284('0x44')]=_0x5c4d66;return _0x9c2ca0;})['then'](respondWithFilteredResult(_0x15d282,_0x432d80))[_0xa284('0x45')](handleError(_0x15d282,null));};exports['show']=function(_0x3cda0c,_0xb48610){var _0xf12953={'raw':!![],'where':{'id':_0x3cda0c[_0xa284('0x46')]['id']}},_0x35050c={};_0x35050c['model']=_[_0xa284('0x32')](db[_0xa284('0x2d')][_0xa284('0x2e')]);_0x35050c['query']=_['keys'](_0x3cda0c[_0xa284('0x35')]);_0x35050c[_0xa284('0x3d')]=_[_0xa284('0x33')](_0x35050c[_0xa284('0x34')],_0x35050c[_0xa284('0x35')]);_0xf12953[_0xa284('0x36')]=_[_0xa284('0x33')](_0x35050c[_0xa284('0x34')],qs[_0xa284('0x37')](_0x3cda0c[_0xa284('0x35')][_0xa284('0x37')]));_0xf12953['attributes']=_0xf12953[_0xa284('0x36')]['length']?_0xf12953[_0xa284('0x36')]:_0x35050c[_0xa284('0x34')];if(_0x3cda0c[_0xa284('0x35')][_0xa284('0x42')]){_0xf12953[_0xa284('0x43')]=[{'all':!![]}];}_0xf12953=_['merge']({},_0xf12953,_0x3cda0c[_0xa284('0x47')]);return db['ChatInternalMessage'][_0xa284('0x48')](_0xf12953)['then'](handleEntityNotFound(_0xb48610,null))[_0xa284('0x26')](respondWithResult(_0xb48610,null))[_0xa284('0x45')](handleError(_0xb48610,null));};exports[_0xa284('0x49')]=function(_0x388c9d,_0x208286){return db['ChatInternalMessage'][_0xa284('0x49')](_0x388c9d[_0xa284('0x4a')],{})['then'](respondWithResult(_0x208286,0xc9))[_0xa284('0x45')](handleError(_0x208286,null));};exports['update']=function(_0x1bd2a8,_0x8cc69c){if(_0x1bd2a8[_0xa284('0x4a')]['id']){delete _0x1bd2a8[_0xa284('0x4a')]['id'];}return db[_0xa284('0x2d')]['find']({'where':{'id':_0x1bd2a8[_0xa284('0x46')]['id']}})[_0xa284('0x26')](handleEntityNotFound(_0x8cc69c,null))[_0xa284('0x26')](saveUpdates(_0x1bd2a8[_0xa284('0x4a')],null))[_0xa284('0x26')](respondWithResult(_0x8cc69c,null))[_0xa284('0x45')](handleError(_0x8cc69c,null));};exports[_0xa284('0x27')]=function(_0x459e6a,_0x5a23c3){return db[_0xa284('0x2d')][_0xa284('0x48')]({'where':{'id':_0x459e6a[_0xa284('0x46')]['id']}})[_0xa284('0x26')](handleEntityNotFound(_0x5a23c3,null))[_0xa284('0x26')](removeEntity(_0x5a23c3,null))['catch'](handleError(_0x5a23c3,null));};exports['describe']=function(_0x5041f3,_0x2dad11){return db['ChatInternalMessage'][_0xa284('0x4b')]()['then'](respondWithResult(_0x2dad11,null))[_0xa284('0x45')](handleError(_0x2dad11,null));};function wrapUser(_0xe9b0fb){return function(_0x40809f){var _0x5f25b1=_0xe9b0fb[_0xa284('0x4c')]({'plain':!![]});_0x5f25b1['messages']=[];if(_0x40809f){_0x5f25b1[_0xa284('0x4d')]=_0x40809f[_0xa284('0x4e')];_0x5f25b1[_0xa284('0x4f')]=_0x40809f;}else{_0x5f25b1[_0xa284('0x4d')]=moment(0x0)[_0xa284('0x50')](_0xa284('0x51'));_0x5f25b1[_0xa284('0x4f')]={};}return _0x5f25b1;};}exports[_0xa284('0x52')]=function(_0x3564ce,_0x3305c7,_0x292b22){var _0x1f91df=[];return db[_0xa284('0x53')]['findAll']({'where':{'role':['agent',_0xa284('0x54'),'user']},'attributes':['id',_0xa284('0x55'),'name',_0xa284('0x56'),'userpic',_0xa284('0x57'),'online',_0xa284('0x58'),_0xa284('0x59'),_0xa284('0x5a')],'order':qs[_0xa284('0x3c')]('-online'),'include':[{'model':db[_0xa284('0x5b')],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xa284('0x26')](function(_0x24abf3){if(_0x24abf3){var _0x3c906f=_0x3564ce[_0xa284('0x5c')][_0xa284('0x4c')]({'plain':!![]});if(!_0x3c906f)throw new Error(_0xa284('0x5d'));if(_0x3c906f[_0xa284('0x56')]===_0xa284('0x5c')){return db[_0xa284('0x5e')][_0xa284('0x48')]({'where':{'name':_0xa284('0x5f'),'userProfileId':_0x3c906f['userProfileId']},'raw':!![]})['then'](function(_0x3fc1c0){if(_0x3fc1c0){if(_0x3fc1c0[_0xa284('0x60')]===0x0){return db['UserProfileResource'][_0xa284('0x61')]({'where':{'sectionId':_0x3fc1c0['id']},'raw':!![]})[_0xa284('0x26')](function(_0x429ae8){var _0x999d61=[];if(_[_0xa284('0x62')](_0x429ae8)){_0x999d61=_[_0xa284('0x3e')](_0x24abf3,function(_0x385b10){if(_0x385b10['role']!==_0xa284('0x63')){return _0x385b10;}});return _0x999d61;}else{for(var _0x54656b=0x0;_0x54656b<_0x24abf3[_0xa284('0x38')];_0x54656b++){var _0x1effb9=_0x24abf3[_0x54656b];if(_0x1effb9[_0xa284('0x56')]===_0xa284('0x63')){var _0x2f9d0c=_[_0xa284('0x48')](_0x429ae8,function(_0x356c5c){return _0x356c5c[_0xa284('0x64')]===_0x1effb9['id'];});if(_0x2f9d0c)_0x999d61[_0xa284('0x65')](_0x1effb9);}else{_0x999d61['push'](_0x1effb9);}}return _0x999d61;}});}else{return _0x24abf3;}}else{var _0x5b5d5b=_[_0xa284('0x3e')](_0x24abf3,function(_0x2d8c86){if(_0x2d8c86[_0xa284('0x56')]!==_0xa284('0x63')){return _0x2d8c86;}});return _0x5b5d5b;}});}else{return _0x24abf3;}}})[_0xa284('0x26')](function(_0xe830c7){var _0x2befb9=[];if(_0xe830c7){_0x1f91df=_0xe830c7;for(var _0x57e144=0x0;_0x57e144<_0xe830c7[_0xa284('0x38')];_0x57e144+=0x1){_0x1f91df[_0x57e144][_0xa284('0x66')]=[];_0x2befb9[_0xa284('0x65')](db[_0xa284('0x2d')][_0xa284('0x48')]({'where':{'FromId':[_0x3564ce[_0xa284('0x5c')]['id'],_0xe830c7[_0x57e144]['id']],'ToId':[_0x3564ce[_0xa284('0x5c')]['id'],_0xe830c7[_0x57e144]['id']],'ChatGroupId':null},'attributes':['id',_0xa284('0x4e'),'FromId',_0xa284('0x67'),'read',_0xa284('0x4a')],'order':qs['sort'](_0xa284('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0xe830c7[_0x57e144])));}return BPromise[_0xa284('0x69')](_0x2befb9);}return[];})[_0xa284('0x26')](function(_0x541346){return{'rows':_0x541346,'count':_0x541346['length']};})[_0xa284('0x26')](respondWithResult(_0x3305c7,null))[_0xa284('0x45')](handleError(_0x3305c7,null));};
\ No newline at end of file
+var _0x09bf=['includeAll','create','body','update','find','destroy','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','admin','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','role','user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','error','stack','name','map','ChatInternalMessage','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes'];(function(_0x238407,_0x4e39df){var _0x107e86=function(_0x3d8534){while(--_0x3d8534){_0x238407['push'](_0x238407['shift']());}};_0x107e86(++_0x4e39df);}(_0x09bf,0x93));var _0xf09b=function(_0x4a7c8c,_0x2cb9e5){_0x4a7c8c=_0x4a7c8c-0x0;var _0x46af56=_0x09bf[_0x4a7c8c];return _0x46af56;};'use strict';var emlformat=require(_0xf09b('0x0'));var rimraf=require(_0xf09b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf09b('0x2'));var rp=require(_0xf09b('0x3'));var moment=require(_0xf09b('0x4'));var BPromise=require(_0xf09b('0x5'));var Mustache=require(_0xf09b('0x6'));var util=require(_0xf09b('0x7'));var path=require('path');var sox=require(_0xf09b('0x8'));var csv=require(_0xf09b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf09b('0xa'));var crypto=require(_0xf09b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf09b('0xc'));var toCsv=require(_0xf09b('0x9'));var querystring=require('querystring');var Papa=require(_0xf09b('0xd'));var Redis=require('ioredis');var authService=require(_0xf09b('0xe'));var qs=require(_0xf09b('0xf'));var as=require(_0xf09b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf09b('0x11'));var utils=require('../../config/utils');var config=require(_0xf09b('0x12'));var licenseUtil=require(_0xf09b('0x13'));var db=require(_0xf09b('0x14'))['db'];config[_0xf09b('0x15')]=_[_0xf09b('0x16')](config['redis'],{'host':_0xf09b('0x17'),'port':0x18eb});var socket=require(_0xf09b('0x18'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xf09b('0x19')](socket);function respondWithStatusCode(_0x1a8a20,_0x2f2018){_0x2f2018=_0x2f2018||0xcc;return function(_0xec7d07){if(_0xec7d07){return _0x1a8a20['sendStatus'](_0x2f2018);}return _0x1a8a20[_0xf09b('0x1a')](_0x2f2018)[_0xf09b('0x1b')]();};}function respondWithResult(_0x2c617b,_0x2e86e1){_0x2e86e1=_0x2e86e1||0xc8;return function(_0x4e8f83){if(_0x4e8f83){return _0x2c617b[_0xf09b('0x1a')](_0x2e86e1)[_0xf09b('0x1c')](_0x4e8f83);}};}function respondWithFilteredResult(_0x4b1ef8,_0x1bf318){return function(_0x153c21){if(_0x153c21){var _0x337378=typeof _0x1bf318[_0xf09b('0x1d')]==='undefined'&&typeof _0x1bf318['limit']===_0xf09b('0x1e');var _0x3c2c8d=_0x153c21[_0xf09b('0x1f')];var _0x499de3=_0x337378?0x0:_0x1bf318[_0xf09b('0x1d')];var _0x36016d=_0x337378?_0x153c21[_0xf09b('0x1f')]:_0x1bf318['offset']+_0x1bf318['limit'];var _0x45acef;if(_0x36016d>=_0x3c2c8d){_0x36016d=_0x3c2c8d;_0x45acef=0xc8;}else{_0x45acef=0xce;}_0x4b1ef8['status'](_0x45acef);return _0x4b1ef8['set'](_0xf09b('0x20'),_0x499de3+'-'+_0x36016d+'/'+_0x3c2c8d)['json'](_0x153c21);}return null;};}function patchUpdates(_0x4ca408){return function(_0x16da4e){try{jsonpatch[_0xf09b('0x21')](_0x16da4e,_0x4ca408,!![]);}catch(_0x2b8257){return BPromise[_0xf09b('0x22')](_0x2b8257);}return _0x16da4e[_0xf09b('0x23')]();};}function saveUpdates(_0x3c5817,_0x1f4748){return function(_0x2c6cbb){if(_0x2c6cbb){return _0x2c6cbb['update'](_0x3c5817)[_0xf09b('0x24')](function(_0x13241d){return _0x13241d;});}return null;};}function removeEntity(_0x5b4815,_0xbc0742){return function(_0x2a7518){if(_0x2a7518){return _0x2a7518['destroy']()[_0xf09b('0x24')](function(){_0x5b4815[_0xf09b('0x1a')](0xcc)[_0xf09b('0x1b')]();});}};}function handleEntityNotFound(_0x252d32,_0x4ba311){return function(_0x3eb84c){if(!_0x3eb84c){_0x252d32['sendStatus'](0x194);}return _0x3eb84c;};}function handleError(_0x3248d9,_0x16bc55){_0x16bc55=_0x16bc55||0x1f4;return function(_0x14d6ae){logger[_0xf09b('0x25')](_0x14d6ae[_0xf09b('0x26')]);if(_0x14d6ae['name']){delete _0x14d6ae[_0xf09b('0x27')];}_0x3248d9['status'](_0x16bc55)['send'](_0x14d6ae);};}exports['index']=function(_0x1bd83e,_0x26e672){var _0x4ca626={},_0x8ba00b={},_0x13b7e7={'count':0x0,'rows':[]};var _0x23d9b5=_[_0xf09b('0x28')](db[_0xf09b('0x29')]['rawAttributes'],function(_0x511d29){return{'name':_0x511d29[_0xf09b('0x2a')],'type':_0x511d29['type'][_0xf09b('0x2b')]};});_0x8ba00b[_0xf09b('0x2c')]=_[_0xf09b('0x28')](_0x23d9b5,_0xf09b('0x27'));_0x8ba00b[_0xf09b('0x2d')]=_[_0xf09b('0x2e')](_0x1bd83e[_0xf09b('0x2d')]);_0x8ba00b[_0xf09b('0x2f')]=_['intersection'](_0x8ba00b[_0xf09b('0x2c')],_0x8ba00b['query']);_0x4ca626[_0xf09b('0x30')]=_[_0xf09b('0x31')](_0x8ba00b[_0xf09b('0x2c')],qs['fields'](_0x1bd83e[_0xf09b('0x2d')][_0xf09b('0x32')]));_0x4ca626[_0xf09b('0x30')]=_0x4ca626[_0xf09b('0x30')][_0xf09b('0x33')]?_0x4ca626[_0xf09b('0x30')]:_0x8ba00b['model'];if(!_0x1bd83e[_0xf09b('0x2d')]['hasOwnProperty'](_0xf09b('0x34'))){_0x4ca626['limit']=qs[_0xf09b('0x35')](_0x1bd83e[_0xf09b('0x2d')][_0xf09b('0x35')]);_0x4ca626[_0xf09b('0x1d')]=qs[_0xf09b('0x1d')](_0x1bd83e['query'][_0xf09b('0x1d')]);}_0x4ca626[_0xf09b('0x36')]=qs['sort'](_0x1bd83e[_0xf09b('0x2d')]['sort']);_0x4ca626[_0xf09b('0x37')]=qs[_0xf09b('0x2f')](_['pick'](_0x1bd83e[_0xf09b('0x2d')],_0x8ba00b[_0xf09b('0x2f')]),_0x23d9b5);if(_0x1bd83e[_0xf09b('0x2d')][_0xf09b('0x38')]){_0x4ca626[_0xf09b('0x37')]=_[_0xf09b('0x39')](_0x4ca626['where'],{'$or':_['map'](_0x23d9b5,function(_0x2177a1){if(_0x2177a1[_0xf09b('0x3a')]!==_0xf09b('0x3b')){var _0x1f8f7c={};_0x1f8f7c[_0x2177a1[_0xf09b('0x27')]]={'$like':'%'+_0x1bd83e[_0xf09b('0x2d')][_0xf09b('0x38')]+'%'};return _0x1f8f7c;}})});}_0x4ca626=_['merge']({},_0x4ca626,_0x1bd83e[_0xf09b('0x3c')]);var _0x12f9e2={'where':_0x4ca626[_0xf09b('0x37')]};return db[_0xf09b('0x29')][_0xf09b('0x1f')](_0x12f9e2)[_0xf09b('0x24')](function(_0xc4ae3d){_0x13b7e7[_0xf09b('0x1f')]=_0xc4ae3d;if(_0x1bd83e[_0xf09b('0x2d')]['includeAll']){_0x4ca626[_0xf09b('0x3d')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xf09b('0x3e')](_0x4ca626);})[_0xf09b('0x24')](function(_0x26e302){_0x13b7e7[_0xf09b('0x3f')]=_0x26e302;return _0x13b7e7;})[_0xf09b('0x24')](respondWithFilteredResult(_0x26e672,_0x4ca626))[_0xf09b('0x40')](handleError(_0x26e672,null));};exports['show']=function(_0x4f45e8,_0x34ceda){var _0xc2c5eb={'raw':!![],'where':{'id':_0x4f45e8[_0xf09b('0x41')]['id']}},_0x471a83={};_0x471a83[_0xf09b('0x2c')]=_[_0xf09b('0x2e')](db[_0xf09b('0x29')][_0xf09b('0x42')]);_0x471a83[_0xf09b('0x2d')]=_[_0xf09b('0x2e')](_0x4f45e8[_0xf09b('0x2d')]);_0x471a83[_0xf09b('0x2f')]=_[_0xf09b('0x31')](_0x471a83[_0xf09b('0x2c')],_0x471a83['query']);_0xc2c5eb[_0xf09b('0x30')]=_[_0xf09b('0x31')](_0x471a83['model'],qs[_0xf09b('0x32')](_0x4f45e8[_0xf09b('0x2d')][_0xf09b('0x32')]));_0xc2c5eb[_0xf09b('0x30')]=_0xc2c5eb[_0xf09b('0x30')][_0xf09b('0x33')]?_0xc2c5eb[_0xf09b('0x30')]:_0x471a83[_0xf09b('0x2c')];if(_0x4f45e8[_0xf09b('0x2d')][_0xf09b('0x43')]){_0xc2c5eb[_0xf09b('0x3d')]=[{'all':!![]}];}_0xc2c5eb=_[_0xf09b('0x39')]({},_0xc2c5eb,_0x4f45e8['options']);return db[_0xf09b('0x29')]['find'](_0xc2c5eb)[_0xf09b('0x24')](handleEntityNotFound(_0x34ceda,null))[_0xf09b('0x24')](respondWithResult(_0x34ceda,null))[_0xf09b('0x40')](handleError(_0x34ceda,null));};exports[_0xf09b('0x44')]=function(_0x20cd1b,_0x3db4cf){return db[_0xf09b('0x29')][_0xf09b('0x44')](_0x20cd1b[_0xf09b('0x45')],{})[_0xf09b('0x24')](respondWithResult(_0x3db4cf,0xc9))[_0xf09b('0x40')](handleError(_0x3db4cf,null));};exports[_0xf09b('0x46')]=function(_0x328560,_0x5d5690){if(_0x328560[_0xf09b('0x45')]['id']){delete _0x328560[_0xf09b('0x45')]['id'];}return db[_0xf09b('0x29')][_0xf09b('0x47')]({'where':{'id':_0x328560[_0xf09b('0x41')]['id']}})['then'](handleEntityNotFound(_0x5d5690,null))['then'](saveUpdates(_0x328560[_0xf09b('0x45')],null))['then'](respondWithResult(_0x5d5690,null))[_0xf09b('0x40')](handleError(_0x5d5690,null));};exports[_0xf09b('0x48')]=function(_0x5c3c84,_0x226935){return db['ChatInternalMessage'][_0xf09b('0x47')]({'where':{'id':_0x5c3c84[_0xf09b('0x41')]['id']}})[_0xf09b('0x24')](handleEntityNotFound(_0x226935,null))[_0xf09b('0x24')](removeEntity(_0x226935,null))[_0xf09b('0x40')](handleError(_0x226935,null));};exports[_0xf09b('0x49')]=function(_0x73c752,_0x59a7d6){return db[_0xf09b('0x29')][_0xf09b('0x49')]()[_0xf09b('0x24')](respondWithResult(_0x59a7d6,null))[_0xf09b('0x40')](handleError(_0x59a7d6,null));};function wrapUser(_0x5e5c35){return function(_0x52715e){var _0xf08711=_0x5e5c35['get']({'plain':!![]});_0xf08711[_0xf09b('0x4a')]=[];if(_0x52715e){_0xf08711[_0xf09b('0x4b')]=_0x52715e[_0xf09b('0x4c')];_0xf08711['lastMessage']=_0x52715e;}else{_0xf08711[_0xf09b('0x4b')]=moment(0x0)[_0xf09b('0x4d')](_0xf09b('0x4e'));_0xf08711[_0xf09b('0x4f')]={};}return _0xf08711;};}exports['getUsers']=function(_0x3aadb7,_0x1e3601,_0x2dc46d){var _0x4f57ab=[];return db[_0xf09b('0x50')][_0xf09b('0x3e')]({'where':{'role':['agent',_0xf09b('0x51'),'user']},'attributes':['id',_0xf09b('0x52'),_0xf09b('0x27'),'role',_0xf09b('0x53'),_0xf09b('0x54'),_0xf09b('0x55'),_0xf09b('0x56'),_0xf09b('0x57'),_0xf09b('0x58')],'order':qs['sort'](_0xf09b('0x59')),'include':[{'model':db[_0xf09b('0x5a')],'as':_0xf09b('0x5b'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xf09b('0x24')](function(_0x7ef306){if(_0x7ef306){var _0x14a24d=_0x3aadb7['user'][_0xf09b('0x5c')]({'plain':!![]});if(!_0x14a24d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14a24d[_0xf09b('0x5d')]===_0xf09b('0x5e')){return db[_0xf09b('0x5f')][_0xf09b('0x47')]({'where':{'name':_0xf09b('0x60'),'userProfileId':_0x14a24d['userProfileId']},'raw':!![]})[_0xf09b('0x24')](function(_0x1b9bea){if(_0x1b9bea){if(_0x1b9bea[_0xf09b('0x61')]===0x0){return db[_0xf09b('0x62')][_0xf09b('0x3e')]({'where':{'sectionId':_0x1b9bea['id']},'raw':!![]})[_0xf09b('0x24')](function(_0x1dc1b8){var _0x3b1e62=[];if(_[_0xf09b('0x63')](_0x1dc1b8)){_0x3b1e62=_[_0xf09b('0x38')](_0x7ef306,function(_0x13f2eb){if(_0x13f2eb['role']!==_0xf09b('0x64')){return _0x13f2eb;}});return _0x3b1e62;}else{for(var _0x3afa30=0x0;_0x3afa30<_0x7ef306[_0xf09b('0x33')];_0x3afa30++){var _0x55a6b1=_0x7ef306[_0x3afa30];if(_0x55a6b1['role']===_0xf09b('0x64')){var _0x4d8149=_[_0xf09b('0x47')](_0x1dc1b8,function(_0x1765ab){return _0x1765ab[_0xf09b('0x65')]===_0x55a6b1['id'];});if(_0x4d8149)_0x3b1e62[_0xf09b('0x66')](_0x55a6b1);}else{_0x3b1e62['push'](_0x55a6b1);}}return _0x3b1e62;}});}else{return _0x7ef306;}}else{var _0x28a2f2=_[_0xf09b('0x38')](_0x7ef306,function(_0x211f47){if(_0x211f47[_0xf09b('0x5d')]!==_0xf09b('0x64')){return _0x211f47;}});return _0x28a2f2;}});}else{return _0x7ef306;}}})['then'](function(_0x2a85b1){var _0x2ced02=[];if(_0x2a85b1){_0x4f57ab=_0x2a85b1;for(var _0x50a74f=0x0;_0x50a74f<_0x2a85b1['length'];_0x50a74f+=0x1){_0x4f57ab[_0x50a74f][_0xf09b('0x4a')]=[];_0x2ced02['push'](db[_0xf09b('0x29')]['find']({'where':{'FromId':[_0x3aadb7['user']['id'],_0x2a85b1[_0x50a74f]['id']],'ToId':[_0x3aadb7[_0xf09b('0x5e')]['id'],_0x2a85b1[_0x50a74f]['id']],'ChatGroupId':null},'attributes':['id',_0xf09b('0x4c'),_0xf09b('0x67'),'ToId',_0xf09b('0x68'),_0xf09b('0x45')],'order':qs['sort'](_0xf09b('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf09b('0x24')](wrapUser(_0x2a85b1[_0x50a74f])));}return BPromise[_0xf09b('0x6a')](_0x2ced02);}return[];})[_0xf09b('0x24')](function(_0x2cf0c4){return{'rows':_0x2cf0c4,'count':_0x2cf0c4['length']};})[_0xf09b('0x24')](respondWithResult(_0x1e3601,null))[_0xf09b('0x40')](handleError(_0x1e3601,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index ea772f3..bb656a7 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 _0xcb2e=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x1c9dc1,_0x4ed5b0){var _0x23747d=function(_0x5af1ae){while(--_0x5af1ae){_0x1c9dc1['push'](_0x1c9dc1['shift']());}};_0x23747d(++_0x4ed5b0);}(_0xcb2e,0x1e8));var _0xecb2=function(_0x5de34b,_0x3a0d2d){_0x5de34b=_0x5de34b-0x0;var _0x57b510=_0xcb2e[_0x5de34b];return _0x57b510;};'use strict';var EventEmitter=require(_0xecb2('0x0'));var ChatInternalMessage=require(_0xecb2('0x1'))['db'][_0xecb2('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xecb2('0x3')](0x0);var events={'afterCreate':_0xecb2('0x4'),'afterUpdate':_0xecb2('0x5'),'afterDestroy':_0xecb2('0x6')};function emitEvent(_0x557f13){return function(_0x46abe3,_0x46fd15,_0x5cc532){ChatInternalMessageEvents[_0xecb2('0x7')](_0x557f13+':'+_0x46abe3['id'],_0x46abe3);ChatInternalMessageEvents[_0xecb2('0x7')](_0x557f13,_0x46abe3);_0x5cc532(null);};}for(var e in events){if(events[_0xecb2('0x8')](e)){var event=events[e];ChatInternalMessage[_0xecb2('0x9')](e,emitEvent(event));}}module[_0xecb2('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x4792=['hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove'];(function(_0x57d546,_0x2620b3){var _0x14dada=function(_0x2abbbd){while(--_0x2abbbd){_0x57d546['push'](_0x57d546['shift']());}};_0x14dada(++_0x2620b3);}(_0x4792,0xcd));var _0x2479=function(_0x1c3281,_0x5c69a0){_0x1c3281=_0x1c3281-0x0;var _0x27588d=_0x4792[_0x1c3281];return _0x27588d;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x2479('0x0'))['db'][_0x2479('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2479('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2479('0x3'),'afterDestroy':_0x2479('0x4')};function emitEvent(_0x4a05ab){return function(_0x496c13,_0x32a674,_0x30ad86){ChatInternalMessageEvents['emit'](_0x4a05ab+':'+_0x496c13['id'],_0x496c13);ChatInternalMessageEvents['emit'](_0x4a05ab,_0x496c13);_0x30ad86(null);};}for(var e in events){if(events[_0x2479('0x5')](e)){var event=events[e];ChatInternalMessage[_0x2479('0x6')](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 94a1b6a..d59db72 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 _0x8ae9=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x39dd42,_0x37b32d){var _0x5b8ef3=function(_0x5086d5){while(--_0x5086d5){_0x39dd42['push'](_0x39dd42['shift']());}};_0x5b8ef3(++_0x37b32d);}(_0x8ae9,0x92));var _0x98ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8ae9[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x98ae('0x0'));var logger=require('../../config/logger')(_0x98ae('0x1'));var moment=require(_0x98ae('0x2'));var BPromise=require(_0x98ae('0x3'));var rp=require(_0x98ae('0x4'));var fs=require('fs');var path=require(_0x98ae('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x98ae('0x6'));module[_0x98ae('0x7')]=function(_0x30fe0a,_0x4bd77e){return _0x30fe0a[_0x98ae('0x8')](_0x98ae('0x9'),attributes,{'tableName':_0x98ae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x98ae('0xb'),'collate':_0x98ae('0xc')});};
\ No newline at end of file
+var _0xb189=['util','bluebird','request-promise','path','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5a63ed,_0x3a7749){var _0x1b8b14=function(_0x568393){while(--_0x568393){_0x5a63ed['push'](_0x5a63ed['shift']());}};_0x1b8b14(++_0x3a7749);}(_0xb189,0x1df));var _0x9b18=function(_0x201c2f,_0x1d0eca){_0x201c2f=_0x201c2f-0x0;var _0x34dd31=_0xb189[_0x201c2f];return _0x34dd31;};'use strict';var _=require(_0x9b18('0x0'));var util=require(_0x9b18('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9b18('0x2'));var rp=require(_0x9b18('0x3'));var fs=require('fs');var path=require(_0x9b18('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9b18('0x5'));module[_0x9b18('0x6')]=function(_0x1523b6,_0x22b247){return _0x1523b6[_0x9b18('0x7')](_0x9b18('0x8'),attributes,{'tableName':_0x9b18('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9b18('0xa'),'collate':_0x9b18('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 2059fbc..318ca06 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 _0xb806=['code','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1ab35d,_0x3f401d){var _0x133d6d=function(_0x381b41){while(--_0x381b41){_0x1ab35d['push'](_0x1ab35d['shift']());}};_0x133d6d(++_0x3f401d);}(_0xb806,0x95));var _0x6b80=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xb806[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0x6b80('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6b80('0x1'));var rs=require(_0x6b80('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6b80('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x6b80('0x4'));var jayson=require(_0x6b80('0x5'));var client=jayson[_0x6b80('0x6')]['http']({'port':0x232a});config[_0x6b80('0x7')]=_[_0x6b80('0x8')](config[_0x6b80('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x6b80('0x9'))(new Redis(config[_0x6b80('0x7')]));require(_0x6b80('0xa'))[_0x6b80('0xb')](socket);function respondWithRpcPromise(_0x415fdb,_0xbe1b37,_0x261a49){return new BPromise(function(_0x462f02,_0x189358){return client[_0x6b80('0xc')](_0x415fdb,_0x261a49)[_0x6b80('0xd')](function(_0x3cd119){logger[_0x6b80('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0xbe1b37,_0x6b80('0xf'));logger['debug'](_0x6b80('0x10'),_0xbe1b37,_0x6b80('0xf'),JSON[_0x6b80('0x11')](_0x3cd119));if(_0x3cd119['error']){if(_0x3cd119[_0x6b80('0x12')][_0x6b80('0x13')]===0x1f4){logger[_0x6b80('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0xbe1b37,_0x3cd119[_0x6b80('0x12')]['message']);return _0x189358(_0x3cd119[_0x6b80('0x12')][_0x6b80('0x14')]);}logger[_0x6b80('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0xbe1b37,_0x3cd119[_0x6b80('0x12')][_0x6b80('0x14')]);return _0x462f02(_0x3cd119[_0x6b80('0x12')][_0x6b80('0x14')]);}else{logger[_0x6b80('0xe')](_0x6b80('0x15'),_0xbe1b37,_0x6b80('0xf'));_0x462f02(_0x3cd119[_0x6b80('0x16')][_0x6b80('0x14')]);}})[_0x6b80('0x17')](function(_0x10ec8a){logger[_0x6b80('0x12')](_0x6b80('0x15'),_0xbe1b37,_0x10ec8a);_0x189358(_0x10ec8a);});});}
\ No newline at end of file
+var _0xf15e=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x59710f,_0x44c7f0){var _0xaae66a=function(_0x1c2397){while(--_0x1c2397){_0x59710f['push'](_0x59710f['shift']());}};_0xaae66a(++_0x44c7f0);}(_0xf15e,0xb9));var _0xef15=function(_0x50a4ca,_0x5f3797){_0x50a4ca=_0x50a4ca-0x0;var _0x211ede=_0xf15e[_0x50a4ca];return _0x211ede;};'use strict';var _=require(_0xef15('0x0'));var util=require('util');var moment=require(_0xef15('0x1'));var BPromise=require(_0xef15('0x2'));var rs=require(_0xef15('0x3'));var fs=require('fs');var Redis=require(_0xef15('0x4'));var db=require(_0xef15('0x5'))['db'];var utils=require(_0xef15('0x6'));var logger=require('../../config/logger')(_0xef15('0x7'));var config=require(_0xef15('0x8'));var jayson=require(_0xef15('0x9'));var client=jayson[_0xef15('0xa')]['http']({'port':0x232a});config[_0xef15('0xb')]=_[_0xef15('0xc')](config[_0xef15('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xef15('0xd'))(new Redis(config[_0xef15('0xb')]));require(_0xef15('0xe'))[_0xef15('0xf')](socket);function respondWithRpcPromise(_0x4989da,_0xf5c4a7,_0x2290c3){return new BPromise(function(_0x416c5c,_0x4b51ab){return client[_0xef15('0x10')](_0x4989da,_0x2290c3)[_0xef15('0x11')](function(_0x16e4ee){logger[_0xef15('0x12')](_0xef15('0x13'),_0xf5c4a7,'request\x20sent');logger['debug'](_0xef15('0x14'),_0xf5c4a7,_0xef15('0x15'),JSON[_0xef15('0x16')](_0x16e4ee));if(_0x16e4ee['error']){if(_0x16e4ee[_0xef15('0x17')]['code']===0x1f4){logger[_0xef15('0x17')](_0xef15('0x13'),_0xf5c4a7,_0x16e4ee[_0xef15('0x17')]['message']);return _0x4b51ab(_0x16e4ee[_0xef15('0x17')]['message']);}logger['error'](_0xef15('0x13'),_0xf5c4a7,_0x16e4ee['error'][_0xef15('0x18')]);return _0x416c5c(_0x16e4ee[_0xef15('0x17')][_0xef15('0x18')]);}else{logger[_0xef15('0x12')](_0xef15('0x13'),_0xf5c4a7,'request\x20sent');_0x416c5c(_0x16e4ee[_0xef15('0x19')][_0xef15('0x18')]);}})[_0xef15('0x1a')](function(_0x40b9ca){logger['error'](_0xef15('0x13'),_0xf5c4a7,_0x40b9ca);_0x4b51ab(_0x40b9ca);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 29f4cb2..bbe3bce 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 _0xa495=['register','length','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x23c262,_0x74765a){var _0x9b913f=function(_0x3ecb98){while(--_0x3ecb98){_0x23c262['push'](_0x23c262['shift']());}};_0x9b913f(++_0x74765a);}(_0xa495,0xc6));var _0x5a49=function(_0x443bdd,_0x517654){_0x443bdd=_0x443bdd-0x0;var _0x3a1e48=_0xa495[_0x443bdd];return _0x3a1e48;};'use strict';var ChatInternalMessageEvents=require(_0x5a49('0x0'));var events=[_0x5a49('0x1'),_0x5a49('0x2'),_0x5a49('0x3')];function createListener(_0x11661a,_0x3ca292){return function(_0x167e1a){_0x3ca292[_0x5a49('0x4')](_0x11661a,_0x167e1a);};}function removeListener(_0x43dbaf,_0x30adab){return function(){ChatInternalMessageEvents['removeListener'](_0x43dbaf,_0x30adab);};}exports[_0x5a49('0x5')]=function(_0x4b78b6){for(var _0xc68c73=0x0,_0xe62863=events[_0x5a49('0x6')];_0xc68c73<_0xe62863;_0xc68c73++){var _0xf10f51=events[_0xc68c73];var _0x140e51=createListener('chatInternalMessage:'+_0xf10f51,_0x4b78b6);ChatInternalMessageEvents['on'](_0xf10f51,_0x140e51);}};
\ No newline at end of file
+var _0x4f45=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','emit'];(function(_0x5bcfff,_0x486d4b){var _0x402ecc=function(_0x35dd5f){while(--_0x35dd5f){_0x5bcfff['push'](_0x5bcfff['shift']());}};_0x402ecc(++_0x486d4b);}(_0x4f45,0x13c));var _0x54f4=function(_0x21dbbf,_0x14447a){_0x21dbbf=_0x21dbbf-0x0;var _0x4514bf=_0x4f45[_0x21dbbf];return _0x4514bf;};'use strict';var ChatInternalMessageEvents=require(_0x54f4('0x0'));var events=[_0x54f4('0x1'),_0x54f4('0x2'),'update'];function createListener(_0x170b95,_0x77919){return function(_0x348605){_0x77919[_0x54f4('0x3')](_0x170b95,_0x348605);};}function removeListener(_0x266f13,_0x94865b){return function(){ChatInternalMessageEvents[_0x54f4('0x4')](_0x266f13,_0x94865b);};}exports[_0x54f4('0x5')]=function(_0x4c3a5b){for(var _0xbd5410=0x0,_0x4a2685=events[_0x54f4('0x6')];_0xbd5410<_0x4a2685;_0xbd5410++){var _0x4475ba=events[_0xbd5410];var _0x59cda2=createListener(_0x54f4('0x7')+_0x4475ba,_0x4c3a5b);ChatInternalMessageEvents['on'](_0x4475ba,_0x59cda2);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 258e654..22e2b85 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 _0x3fa4=['./chatInternalMessage.controller','get','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','put','update','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3e7a6c,_0x457a08){var _0x3abdc7=function(_0x1f2bb0){while(--_0x1f2bb0){_0x3e7a6c['push'](_0x3e7a6c['shift']());}};_0x3abdc7(++_0x457a08);}(_0x3fa4,0x175));var _0x43fa=function(_0x33d5e0,_0x2ac8e7){_0x33d5e0=_0x33d5e0-0x0;var _0x5ad6d9=_0x3fa4[_0x33d5e0];return _0x5ad6d9;};'use strict';var multer=require(_0x43fa('0x0'));var util=require('util');var path=require(_0x43fa('0x1'));var timeout=require('connect-timeout');var express=require(_0x43fa('0x2'));var router=express[_0x43fa('0x3')]();var fs_extra=require(_0x43fa('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x43fa('0x5'));var config=require(_0x43fa('0x6'));var controller=require(_0x43fa('0x7'));router[_0x43fa('0x8')]('/',auth[_0x43fa('0x9')](),controller['index']);router['get']('/describe',auth[_0x43fa('0x9')](),controller[_0x43fa('0xa')]);router[_0x43fa('0x8')](_0x43fa('0xb'),auth[_0x43fa('0x9')](),controller[_0x43fa('0xc')]);router[_0x43fa('0x8')](_0x43fa('0xd'),auth[_0x43fa('0x9')](),controller[_0x43fa('0xe')]);router[_0x43fa('0xf')]('/',auth['isAuthenticated'](),controller[_0x43fa('0x10')]);router[_0x43fa('0x11')]('/:id',controller[_0x43fa('0x12')]);router['delete']('/:id',auth[_0x43fa('0x9')](),controller['destroy']);module[_0x43fa('0x13')]=router;
\ No newline at end of file
+var _0x9f7e=['show','create','put','/:id','update','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','getUsers'];(function(_0x2dedf5,_0x39168e){var _0x9ce21f=function(_0x4b3465){while(--_0x4b3465){_0x2dedf5['push'](_0x2dedf5['shift']());}};_0x9ce21f(++_0x39168e);}(_0x9f7e,0x156));var _0xe9f7=function(_0x54c02e,_0x1a9233){_0x54c02e=_0x54c02e-0x0;var _0x5c5f5b=_0x9f7e[_0x54c02e];return _0x5c5f5b;};'use strict';var multer=require('multer');var util=require(_0xe9f7('0x0'));var path=require(_0xe9f7('0x1'));var timeout=require('connect-timeout');var express=require(_0xe9f7('0x2'));var router=express[_0xe9f7('0x3')]();var fs_extra=require(_0xe9f7('0x4'));var auth=require(_0xe9f7('0x5'));var interaction=require(_0xe9f7('0x6'));var config=require(_0xe9f7('0x7'));var controller=require(_0xe9f7('0x8'));router[_0xe9f7('0x9')]('/',auth[_0xe9f7('0xa')](),controller[_0xe9f7('0xb')]);router[_0xe9f7('0x9')](_0xe9f7('0xc'),auth[_0xe9f7('0xa')](),controller[_0xe9f7('0xd')]);router[_0xe9f7('0x9')]('/users',auth[_0xe9f7('0xa')](),controller[_0xe9f7('0xe')]);router[_0xe9f7('0x9')]('/:id',auth[_0xe9f7('0xa')](),controller[_0xe9f7('0xf')]);router['post']('/',auth[_0xe9f7('0xa')](),controller[_0xe9f7('0x10')]);router[_0xe9f7('0x11')](_0xe9f7('0x12'),controller[_0xe9f7('0x13')]);router['delete']('/:id',auth[_0xe9f7('0xa')](),controller[_0xe9f7('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 1760ca8..b1efa16 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 _0xcf2f=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x562c55,_0x141526){var _0x533dc9=function(_0x3c8d6a){while(--_0x3c8d6a){_0x562c55['push'](_0x562c55['shift']());}};_0x533dc9(++_0x141526);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x4da60e,_0x16bd7b){_0x4da60e=_0x4da60e-0x0;var _0x1a6561=_0xcf2f[_0x4da60e];return _0x1a6561;};'use strict';var Sequelize=require(_0xfcf2('0x0'));module[_0xfcf2('0x1')]={'body':{'type':Sequelize[_0xfcf2('0x2')](_0xfcf2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xfcf2('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xfcf2('0x5')]('in',_0xfcf2('0x6')),'defaultValue':_0xfcf2('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfcf2('0x7')]},'providerName':{'type':Sequelize[_0xfcf2('0x8')]},'providerResponse':{'type':Sequelize[_0xfcf2('0x2')]}};
\ No newline at end of file
+var _0x3c8b=['DATE','STRING','TEXT','exports','medium','BOOLEAN','out'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x3c8b,0x18b));var _0xb3c8=function(_0xd39177,_0x281a38){_0xd39177=_0xd39177-0x0;var _0x318da8=_0x3c8b[_0xd39177];return _0x318da8;};'use strict';var Sequelize=require('sequelize');module[_0xb3c8('0x0')]={'body':{'type':Sequelize['TEXT'](_0xb3c8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb3c8('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb3c8('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb3c8('0x3')),'defaultValue':_0xb3c8('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb3c8('0x4')]},'providerName':{'type':Sequelize[_0xb3c8('0x5')]},'providerResponse':{'type':Sequelize[_0xb3c8('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index e03172e..4959e58 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 _0x8465=['Content-Range','reject','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','merge','create','find','body','describe','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','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','QueryTypes','contact','fullname','email','internal','interface','SIP/%s','motionChannel','event','EventManager','formData','ChatInteraction','ChatInteractionId','rejectMessage','ContactId','sequelize','SELECT','User','channel','parse','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x25e11c,_0x144c45){var _0x2a4826=function(_0x40b1f0){while(--_0x40b1f0){_0x25e11c['push'](_0x25e11c['shift']());}};_0x2a4826(++_0x144c45);}(_0x8465,0x152));var _0x5846=function(_0x41e8c4,_0x30d9ff){_0x41e8c4=_0x41e8c4-0x0;var _0x54ffbe=_0x8465[_0x41e8c4];return _0x54ffbe;};'use strict';var emlformat=require(_0x5846('0x0'));var rimraf=require(_0x5846('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5846('0x2'));var rp=require('request-promise');var moment=require(_0x5846('0x3'));var BPromise=require(_0x5846('0x4'));var Mustache=require('mustache');var util=require(_0x5846('0x5'));var path=require(_0x5846('0x6'));var sox=require('sox');var csv=require(_0x5846('0x7'));var ejs=require(_0x5846('0x8'));var fs=require('fs');var fs_extra=require(_0x5846('0x9'));var _=require('lodash');var squel=require(_0x5846('0xa'));var crypto=require('crypto');var jsforce=require(_0x5846('0xb'));var deskjs=require(_0x5846('0xc'));var toCsv=require(_0x5846('0x7'));var querystring=require(_0x5846('0xd'));var Papa=require(_0x5846('0xe'));var Redis=require(_0x5846('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5846('0x10'));var as=require(_0x5846('0x11'));var hardwareService=require(_0x5846('0x12'));var logger=require(_0x5846('0x13'))('api');var utils=require(_0x5846('0x14'));var config=require(_0x5846('0x15'));var licenseUtil=require(_0x5846('0x16'));var db=require(_0x5846('0x17'))['db'];config[_0x5846('0x18')]=_[_0x5846('0x19')](config[_0x5846('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5846('0x18')]));require(_0x5846('0x1a'))[_0x5846('0x1b')](socket);var jayson=require(_0x5846('0x1c'));var client=jayson[_0x5846('0x1d')][_0x5846('0x1e')]({'port':0x232c});var client9002=jayson[_0x5846('0x1d')][_0x5846('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2ab495,_0xa9a679,_0x1407e1,_0x5f17ad){return new BPromise(function(_0x2870a6,_0x2527e9){var _0x27877e=_0x5f17ad||client;return _0x27877e[_0x5846('0x1f')](_0x2ab495,_0x1407e1)[_0x5846('0x20')](function(_0x5616e6){logger[_0x5846('0x21')]('ChatMessage,\x20%s,\x20%s',_0xa9a679,'request\x20sent');logger[_0x5846('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xa9a679,_0x5846('0x23'),JSON[_0x5846('0x24')](_0x5616e6));if(_0x5616e6[_0x5846('0x25')]){if(_0x5616e6['error'][_0x5846('0x26')]===0x1f4){logger[_0x5846('0x25')](_0x5846('0x27'),_0xa9a679,_0x5616e6['error'][_0x5846('0x28')]);return _0x2527e9(_0x5616e6[_0x5846('0x25')][_0x5846('0x28')]);}logger[_0x5846('0x25')]('ChatMessage,\x20%s,\x20%s',_0xa9a679,_0x5616e6[_0x5846('0x25')][_0x5846('0x28')]);return _0x2870a6(_0x5616e6[_0x5846('0x25')]['message']);}else{logger[_0x5846('0x21')](_0x5846('0x27'),_0xa9a679,_0x5846('0x23'));_0x2870a6(_0x5616e6[_0x5846('0x29')][_0x5846('0x28')]);}})[_0x5846('0x2a')](function(_0x4dc9db){logger[_0x5846('0x25')](_0x5846('0x27'),_0xa9a679,_0x4dc9db);_0x2527e9(_0x4dc9db);});});}function respondWithStatusCode(_0x1724f8,_0x1d27e7){_0x1d27e7=_0x1d27e7||0xcc;return function(_0x2b4514){if(_0x2b4514){return _0x1724f8[_0x5846('0x2b')](_0x1d27e7);}return _0x1724f8['status'](_0x1d27e7)[_0x5846('0x2c')]();};}function respondWithResult(_0x3fcfab,_0x58511c){_0x58511c=_0x58511c||0xc8;return function(_0x26e446){if(_0x26e446){return _0x3fcfab[_0x5846('0x2d')](_0x58511c)[_0x5846('0x2e')](_0x26e446);}};}function respondWithFilteredResult(_0x268b92,_0x147dbe){return function(_0x2d832a){if(_0x2d832a){var _0x41d06f=typeof _0x147dbe[_0x5846('0x2f')]===_0x5846('0x30')&&typeof _0x147dbe[_0x5846('0x31')]===_0x5846('0x30');var _0x280eae=_0x2d832a[_0x5846('0x32')];var _0x4b3205=_0x41d06f?0x0:_0x147dbe[_0x5846('0x2f')];var _0x3d104d=_0x41d06f?_0x2d832a[_0x5846('0x32')]:_0x147dbe[_0x5846('0x2f')]+_0x147dbe[_0x5846('0x31')];var _0x46fe0e;if(_0x3d104d>=_0x280eae){_0x3d104d=_0x280eae;_0x46fe0e=0xc8;}else{_0x46fe0e=0xce;}_0x268b92[_0x5846('0x2d')](_0x46fe0e);return _0x268b92[_0x5846('0x33')](_0x5846('0x34'),_0x4b3205+'-'+_0x3d104d+'/'+_0x280eae)[_0x5846('0x2e')](_0x2d832a);}return null;};}function patchUpdates(_0x5b7234){return function(_0x4d2f41){try{jsonpatch['apply'](_0x4d2f41,_0x5b7234,!![]);}catch(_0x4c0f18){return BPromise[_0x5846('0x35')](_0x4c0f18);}return _0x4d2f41['save']();};}function saveUpdates(_0x3c3dba,_0x1e58b6){return function(_0x476013){if(_0x476013){return _0x476013[_0x5846('0x36')](_0x3c3dba)['then'](function(_0x3ddfa1){return _0x3ddfa1;});}return null;};}function removeEntity(_0x471761,_0x246087){return function(_0x24902e){if(_0x24902e){return _0x24902e[_0x5846('0x37')]()[_0x5846('0x20')](function(){_0x471761[_0x5846('0x2d')](0xcc)[_0x5846('0x2c')]();});}};}function handleEntityNotFound(_0x24f4fd,_0x3d922c){return function(_0x450804){if(!_0x450804){_0x24f4fd[_0x5846('0x2b')](0x194);}return _0x450804;};}function handleError(_0x519a63,_0x34360c){_0x34360c=_0x34360c||0x1f4;return function(_0x4ce30c){logger[_0x5846('0x25')](_0x4ce30c[_0x5846('0x38')]);if(_0x4ce30c[_0x5846('0x39')]){delete _0x4ce30c[_0x5846('0x39')];}_0x519a63[_0x5846('0x2d')](_0x34360c)[_0x5846('0x3a')](_0x4ce30c);};}exports[_0x5846('0x3b')]=function(_0x456dc0,_0x51f8e2){var _0x59174d={},_0x1f2aab={},_0x412493={'count':0x0,'rows':[]};var _0x50869c=_[_0x5846('0x3c')](db[_0x5846('0x3d')][_0x5846('0x3e')],function(_0xe0e81d){return{'name':_0xe0e81d['fieldName'],'type':_0xe0e81d[_0x5846('0x3f')]['key']};});_0x1f2aab[_0x5846('0x40')]=_[_0x5846('0x3c')](_0x50869c,_0x5846('0x39'));_0x1f2aab[_0x5846('0x41')]=_[_0x5846('0x42')](_0x456dc0[_0x5846('0x41')]);_0x1f2aab[_0x5846('0x43')]=_[_0x5846('0x44')](_0x1f2aab['model'],_0x1f2aab['query']);_0x59174d[_0x5846('0x45')]=_['intersection'](_0x1f2aab[_0x5846('0x40')],qs[_0x5846('0x46')](_0x456dc0[_0x5846('0x41')]['fields']));_0x59174d[_0x5846('0x45')]=_0x59174d['attributes']['length']?_0x59174d[_0x5846('0x45')]:_0x1f2aab[_0x5846('0x40')];if(!_0x456dc0['query'][_0x5846('0x47')](_0x5846('0x48'))){_0x59174d[_0x5846('0x31')]=qs['limit'](_0x456dc0[_0x5846('0x41')][_0x5846('0x31')]);_0x59174d[_0x5846('0x2f')]=qs[_0x5846('0x2f')](_0x456dc0[_0x5846('0x41')]['offset']);}_0x59174d['order']=qs[_0x5846('0x49')](_0x456dc0['query']['sort']);_0x59174d[_0x5846('0x4a')]=qs[_0x5846('0x43')](_[_0x5846('0x4b')](_0x456dc0[_0x5846('0x41')],_0x1f2aab['filters']),_0x50869c);if(_0x456dc0[_0x5846('0x41')][_0x5846('0x4c')]){_0x59174d['where']=_['merge'](_0x59174d[_0x5846('0x4a')],{'$or':_['map'](_0x50869c,function(_0x3065e4){if(_0x3065e4[_0x5846('0x3f')]!==_0x5846('0x4d')){var _0x575ac9={};_0x575ac9[_0x3065e4[_0x5846('0x39')]]={'$like':'%'+_0x456dc0[_0x5846('0x41')][_0x5846('0x4c')]+'%'};return _0x575ac9;}})});}_0x59174d=_['merge']({},_0x59174d,_0x456dc0[_0x5846('0x4e')]);var _0x2a21b7={'where':_0x59174d[_0x5846('0x4a')]};return db['ChatMessage']['count'](_0x2a21b7)[_0x5846('0x20')](function(_0x447b0e){_0x412493[_0x5846('0x32')]=_0x447b0e;if(_0x456dc0[_0x5846('0x41')][_0x5846('0x4f')]){_0x59174d['include']=[{'all':!![]}];}return db[_0x5846('0x3d')][_0x5846('0x50')](_0x59174d);})[_0x5846('0x20')](function(_0x5be23b){_0x412493[_0x5846('0x51')]=_0x5be23b;return _0x412493;})[_0x5846('0x20')](respondWithFilteredResult(_0x51f8e2,_0x59174d))[_0x5846('0x2a')](handleError(_0x51f8e2,null));};exports[_0x5846('0x52')]=function(_0x5cbf49,_0x3162bd){var _0x55bd42={'raw':!![],'where':{'id':_0x5cbf49[_0x5846('0x53')]['id']}},_0x2474c8={};_0x2474c8[_0x5846('0x40')]=_['keys'](db[_0x5846('0x3d')]['rawAttributes']);_0x2474c8[_0x5846('0x41')]=_[_0x5846('0x42')](_0x5cbf49[_0x5846('0x41')]);_0x2474c8[_0x5846('0x43')]=_[_0x5846('0x44')](_0x2474c8[_0x5846('0x40')],_0x2474c8[_0x5846('0x41')]);_0x55bd42['attributes']=_[_0x5846('0x44')](_0x2474c8[_0x5846('0x40')],qs[_0x5846('0x46')](_0x5cbf49[_0x5846('0x41')]['fields']));_0x55bd42[_0x5846('0x45')]=_0x55bd42[_0x5846('0x45')][_0x5846('0x54')]?_0x55bd42[_0x5846('0x45')]:_0x2474c8[_0x5846('0x40')];if(_0x5cbf49[_0x5846('0x41')]['includeAll']){_0x55bd42[_0x5846('0x55')]=[{'all':!![]}];}_0x55bd42=_[_0x5846('0x56')]({},_0x55bd42,_0x5cbf49[_0x5846('0x4e')]);return db[_0x5846('0x3d')]['find'](_0x55bd42)[_0x5846('0x20')](handleEntityNotFound(_0x3162bd,null))['then'](respondWithResult(_0x3162bd,null))[_0x5846('0x2a')](handleError(_0x3162bd,null));};exports['create']=function(_0x256265,_0x31068e){return db[_0x5846('0x3d')][_0x5846('0x57')](_0x256265['body'],{})[_0x5846('0x20')](respondWithResult(_0x31068e,0xc9))[_0x5846('0x2a')](handleError(_0x31068e,null));};exports['update']=function(_0x2d0fe8,_0x5c0703){if(_0x2d0fe8['body']['id']){delete _0x2d0fe8['body']['id'];}return db[_0x5846('0x3d')][_0x5846('0x58')]({'where':{'id':_0x2d0fe8[_0x5846('0x53')]['id']}})['then'](handleEntityNotFound(_0x5c0703,null))[_0x5846('0x20')](saveUpdates(_0x2d0fe8[_0x5846('0x59')],null))[_0x5846('0x20')](respondWithResult(_0x5c0703,null))[_0x5846('0x2a')](handleError(_0x5c0703,null));};exports[_0x5846('0x37')]=function(_0xb77776,_0x3649dd){return db[_0x5846('0x3d')][_0x5846('0x58')]({'where':{'id':_0xb77776[_0x5846('0x53')]['id']}})[_0x5846('0x20')](handleEntityNotFound(_0x3649dd,null))['then'](removeEntity(_0x3649dd,null))[_0x5846('0x2a')](handleError(_0x3649dd,null));};exports[_0x5846('0x5a')]=function(_0x20c906,_0x49520b){return db[_0x5846('0x3d')][_0x5846('0x5a')]()['then'](respondWithResult(_0x49520b,null))[_0x5846('0x2a')](handleError(_0x49520b,null));};var interaction_log=require('../../config/logger')(_0x5846('0x5b'));exports[_0x5846('0x5c')]=function(_0x49ab3b,_0x40837f,_0x435c91){var _0x26a449={'agent':{},'channel':'chat'};if(_0x49ab3b[_0x5846('0x59')]['id']){delete _0x49ab3b[_0x5846('0x59')]['id'];}_0x49ab3b[_0x5846('0x59')][_0x5846('0x5d')]=!![];_0x49ab3b[_0x5846('0x59')][_0x5846('0x5e')]=moment()[_0x5846('0x5f')](_0x5846('0x60'));_0x49ab3b[_0x5846('0x59')][_0x5846('0x61')]=_0x49ab3b[_0x5846('0x59')][_0x5846('0x61')]||_0x49ab3b[_0x5846('0x62')]['id'];_0x26a449[_0x5846('0x63')]['id']=_0x49ab3b[_0x5846('0x59')][_0x5846('0x61')];return db[_0x5846('0x3d')][_0x5846('0x58')]({'where':{'id':_0x49ab3b['params']['id'],'UserId':null}})[_0x5846('0x20')](handleEntityNotFound(_0x40837f,null))[_0x5846('0x20')](saveUpdates(_0x49ab3b[_0x5846('0x59')],null))[_0x5846('0x20')](function(_0x596047){if(_0x596047){_0x26a449[_0x5846('0x28')]=_0x596047[_0x5846('0x64')]({'plain':!![]});return db['ChatInteraction'][_0x5846('0x58')]({'where':{'id':_0x596047['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x40837f,null))[_0x5846('0x20')](function(_0x1f0d22){if(_0x1f0d22){return _0x1f0d22['update']({'UserId':_0x49ab3b[_0x5846('0x59')][_0x5846('0x61')],'read1stAt':_[_0x5846('0x65')](_0x1f0d22[_0x5846('0x66')])?moment()['format'](_0x5846('0x60')):undefined});}return null;})[_0x5846('0x20')](function(_0x322cfd){if(_0x322cfd){_0x26a449[_0x5846('0x67')]=_0x322cfd[_0x5846('0x64')]({'plain':!![]});interaction_log[_0x5846('0x21')](_0x5846('0x68'),_0x49ab3b[_0x5846('0x62')]['id'],_0x49ab3b['user']['name'],_0x49ab3b['user'][_0x5846('0x69')],_0x26a449[_0x5846('0x67')]['id'],_0x49ab3b[_0x5846('0x59')]?JSON[_0x5846('0x24')](_0x49ab3b[_0x5846('0x59')]):_0x5846('0x6a'));return respondWithRpcPromise(_0x5846('0x6b'),_0x5846('0x6c'),_0x26a449);}return null;})[_0x5846('0x20')](function(_0x5ec1ec){var _0x1fe1a0=_0x5846('0x6d')+_0x5ec1ec[_0x5846('0x28')]['ContactId'];return db['sequelize'][_0x5846('0x41')](_0x1fe1a0,{'type':db['Sequelize'][_0x5846('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x4867d9){return _0x4867d9;});})[_0x5846('0x20')](function(_0x1c0488){if(_0x1c0488){_0x26a449['message'][_0x5846('0x6f')]=_0x1c0488[0x0];if(!_0x49ab3b[_0x5846('0x59')][_0x5846('0x61')])return;return db['User'][_0x5846('0x58')]({'where':{'id':_0x49ab3b[_0x5846('0x59')]['UserId'],'role':_0x5846('0x63')},'attributes':['id',_0x5846('0x39'),_0x5846('0x70'),_0x5846('0x71'),_0x5846('0x72')],'raw':!![]});}return null;})[_0x5846('0x20')](function(_0x4d2dac){if(!_0x4d2dac)return null;_0x26a449['message'][_0x5846('0x63')]=_0x4d2dac;return _0x26a449;})[_0x5846('0x20')](function(_0x49b114){if(_0x49b114){if(_0x49ab3b['body']['manual']){_0x26a449[_0x5846('0x28')][_0x5846('0x73')]=util['format'](_0x5846('0x74'),_0x49ab3b[_0x5846('0x62')][_0x5846('0x39')]);_0x26a449[_0x5846('0x28')]['channel']=_0x26a449['channel'];_0x26a449[_0x5846('0x28')][_0x5846('0x75')]=_0x26a449['channel'];_0x26a449[_0x5846('0x28')][_0x5846('0x76')]=_0x5846('0x5c');return respondWithRpcPromise(_0x5846('0x77'),'EventManager',{'event':'acceptmessage','message':_[_0x5846('0x56')](_0x26a449['message'],JSON['parse'](_0x26a449[_0x5846('0x67')][_0x5846('0x78')]))},client9002)[_0x5846('0x20')](function(){return _0x26a449;});}return _0x26a449;}return null;})['then'](respondWithResult(_0x40837f,null))['catch'](handleError(_0x40837f,null));};var interaction_log=require(_0x5846('0x13'))(_0x5846('0x5b'));exports[_0x5846('0x35')]=function(_0x2a0695,_0x3cd46f,_0x8d397f){var _0x298b3f={'agent':{},'channel':'chat'};if(_0x2a0695[_0x5846('0x59')]['id']){delete _0x2a0695[_0x5846('0x59')]['id'];}_0x2a0695[_0x5846('0x59')][_0x5846('0x61')]=_0x2a0695[_0x5846('0x59')]['UserId']||_0x2a0695['user']['id'];_0x298b3f['agent']['id']=_0x2a0695[_0x5846('0x59')][_0x5846('0x61')];return db['ChatMessage']['find']({'where':{'id':_0x2a0695[_0x5846('0x53')]['id'],'UserId':null}})[_0x5846('0x20')](handleEntityNotFound(_0x3cd46f,null))[_0x5846('0x20')](function(_0x2339c4){if(_0x2339c4){_0x298b3f['message']=_0x2339c4[_0x5846('0x64')]({'plain':!![]});return db[_0x5846('0x79')]['find']({'where':{'id':_0x2339c4[_0x5846('0x7a')]}});}return null;})['then'](handleEntityNotFound(_0x3cd46f,null))[_0x5846('0x20')](function(_0x134250){if(_0x134250){_0x298b3f['interaction']=_0x134250[_0x5846('0x64')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2a0695[_0x5846('0x62')]['id'],_0x2a0695[_0x5846('0x62')]['name'],_0x2a0695[_0x5846('0x62')][_0x5846('0x69')],_0x298b3f[_0x5846('0x67')]['id'],_0x2a0695[_0x5846('0x59')]?JSON[_0x5846('0x24')](_0x2a0695[_0x5846('0x59')]):_0x5846('0x6a'));return respondWithRpcPromise('RejectMessage',_0x5846('0x7b'),_0x298b3f);}return null;})['then'](function(_0x272641){var _0x17b494='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x272641['message'][_0x5846('0x7c')];return db[_0x5846('0x7d')][_0x5846('0x41')](_0x17b494,{'type':db['Sequelize']['QueryTypes'][_0x5846('0x7e')],'raw':!![]})[_0x5846('0x20')](function(_0x4f84c0){return _0x4f84c0;});})[_0x5846('0x20')](function(_0x1c9b7a){if(_0x1c9b7a){_0x298b3f['message'][_0x5846('0x6f')]=_0x1c9b7a[0x0];if(!_0x2a0695[_0x5846('0x59')][_0x5846('0x61')])return;return db[_0x5846('0x7f')][_0x5846('0x58')]({'where':{'id':_0x2a0695[_0x5846('0x59')][_0x5846('0x61')],'role':_0x5846('0x63')},'attributes':['id',_0x5846('0x39'),'fullname',_0x5846('0x71'),'internal'],'raw':!![]});}return null;})[_0x5846('0x20')](function(_0x107518){if(!_0x107518)return null;_0x298b3f[_0x5846('0x28')][_0x5846('0x63')]=_0x107518;return _0x298b3f;})[_0x5846('0x20')](function(_0x3bff0b){if(_0x3bff0b){_0x3bff0b[_0x5846('0x28')][_0x5846('0x73')]=util[_0x5846('0x5f')](_0x5846('0x74'),_0x2a0695[_0x5846('0x62')][_0x5846('0x39')]);_0x3bff0b[_0x5846('0x28')]['channel']=_0x298b3f[_0x5846('0x80')];_0x3bff0b[_0x5846('0x28')][_0x5846('0x75')]=_0x298b3f[_0x5846('0x80')];_0x3bff0b[_0x5846('0x28')][_0x5846('0x76')]='reject';respondWithRpcPromise(_0x5846('0x77'),_0x5846('0x77'),{'event':'rejectmessage','message':_['merge'](_0x298b3f[_0x5846('0x28')],JSON[_0x5846('0x81')](_0x298b3f[_0x5846('0x67')]['formData']))},client9002);return _0x298b3f;}return null;})[_0x5846('0x20')](respondWithResult(_0x3cd46f,null))[_0x5846('0x2a')](handleError(_0x3cd46f,null));};
\ No newline at end of file
+var _0x4b75=['[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','ContactId','interface','rejectmessage','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','destroy','name','send','index','map','ChatMessage','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','../../config/logger','chat-interactions','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','ChatInteractionId','update','isNil','format','interaction'];(function(_0x3c3e3f,_0x3bdc20){var _0x2577c0=function(_0x597df2){while(--_0x597df2){_0x3c3e3f['push'](_0x3c3e3f['shift']());}};_0x2577c0(++_0x3bdc20);}(_0x4b75,0xa3));var _0x54b7=function(_0x35bc99,_0x1d3db3){_0x35bc99=_0x35bc99-0x0;var _0x5f4169=_0x4b75[_0x35bc99];return _0x5f4169;};'use strict';var emlformat=require(_0x54b7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x54b7('0x1'));var rp=require(_0x54b7('0x2'));var moment=require(_0x54b7('0x3'));var BPromise=require(_0x54b7('0x4'));var Mustache=require(_0x54b7('0x5'));var util=require('util');var path=require(_0x54b7('0x6'));var sox=require(_0x54b7('0x7'));var csv=require(_0x54b7('0x8'));var ejs=require(_0x54b7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54b7('0xa'));var squel=require(_0x54b7('0xb'));var crypto=require(_0x54b7('0xc'));var jsforce=require(_0x54b7('0xd'));var deskjs=require(_0x54b7('0xe'));var toCsv=require(_0x54b7('0x8'));var querystring=require(_0x54b7('0xf'));var Papa=require(_0x54b7('0x10'));var Redis=require('ioredis');var authService=require(_0x54b7('0x11'));var qs=require(_0x54b7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54b7('0x13'));var logger=require('../../config/logger')(_0x54b7('0x14'));var utils=require(_0x54b7('0x15'));var config=require(_0x54b7('0x16'));var licenseUtil=require(_0x54b7('0x17'));var db=require(_0x54b7('0x18'))['db'];config[_0x54b7('0x19')]=_[_0x54b7('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x54b7('0x19')]));require('./chatMessage.socket')[_0x54b7('0x1b')](socket);var jayson=require(_0x54b7('0x1c'));var client=jayson[_0x54b7('0x1d')][_0x54b7('0x1e')]({'port':0x232c});var client9002=jayson[_0x54b7('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc5daaa,_0x42950a,_0x40fb90,_0x5d5e06){return new BPromise(function(_0x5ba0a4,_0x4fcd8a){var _0x637d73=_0x5d5e06||client;return _0x637d73[_0x54b7('0x1f')](_0xc5daaa,_0x40fb90)[_0x54b7('0x20')](function(_0x27ecf5){logger[_0x54b7('0x21')](_0x54b7('0x22'),_0x42950a,_0x54b7('0x23'));logger[_0x54b7('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x42950a,_0x54b7('0x23'),JSON[_0x54b7('0x25')](_0x27ecf5));if(_0x27ecf5[_0x54b7('0x26')]){if(_0x27ecf5[_0x54b7('0x26')][_0x54b7('0x27')]===0x1f4){logger[_0x54b7('0x26')]('ChatMessage,\x20%s,\x20%s',_0x42950a,_0x27ecf5['error'][_0x54b7('0x28')]);return _0x4fcd8a(_0x27ecf5['error']['message']);}logger['error'](_0x54b7('0x22'),_0x42950a,_0x27ecf5[_0x54b7('0x26')][_0x54b7('0x28')]);return _0x5ba0a4(_0x27ecf5['error']['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x42950a,_0x54b7('0x23'));_0x5ba0a4(_0x27ecf5[_0x54b7('0x29')][_0x54b7('0x28')]);}})['catch'](function(_0x900dc7){logger[_0x54b7('0x26')](_0x54b7('0x22'),_0x42950a,_0x900dc7);_0x4fcd8a(_0x900dc7);});});}function respondWithStatusCode(_0x1f438c,_0x4b0c0b){_0x4b0c0b=_0x4b0c0b||0xcc;return function(_0x4ffea6){if(_0x4ffea6){return _0x1f438c[_0x54b7('0x2a')](_0x4b0c0b);}return _0x1f438c[_0x54b7('0x2b')](_0x4b0c0b)[_0x54b7('0x2c')]();};}function respondWithResult(_0x5375db,_0xd0b75a){_0xd0b75a=_0xd0b75a||0xc8;return function(_0x1c81d3){if(_0x1c81d3){return _0x5375db[_0x54b7('0x2b')](_0xd0b75a)[_0x54b7('0x2d')](_0x1c81d3);}};}function respondWithFilteredResult(_0x4b2e0d,_0x1702b4){return function(_0x6814b5){if(_0x6814b5){var _0x16e7c1=typeof _0x1702b4['offset']===_0x54b7('0x2e')&&typeof _0x1702b4['limit']===_0x54b7('0x2e');var _0xa531d9=_0x6814b5[_0x54b7('0x2f')];var _0x379142=_0x16e7c1?0x0:_0x1702b4[_0x54b7('0x30')];var _0x224b58=_0x16e7c1?_0x6814b5[_0x54b7('0x2f')]:_0x1702b4['offset']+_0x1702b4[_0x54b7('0x31')];var _0x2e3ca1;if(_0x224b58>=_0xa531d9){_0x224b58=_0xa531d9;_0x2e3ca1=0xc8;}else{_0x2e3ca1=0xce;}_0x4b2e0d[_0x54b7('0x2b')](_0x2e3ca1);return _0x4b2e0d[_0x54b7('0x32')]('Content-Range',_0x379142+'-'+_0x224b58+'/'+_0xa531d9)[_0x54b7('0x2d')](_0x6814b5);}return null;};}function patchUpdates(_0x2b2a49){return function(_0x1e7933){try{jsonpatch['apply'](_0x1e7933,_0x2b2a49,!![]);}catch(_0x192eef){return BPromise[_0x54b7('0x33')](_0x192eef);}return _0x1e7933['save']();};}function saveUpdates(_0x328190,_0x1eec60){return function(_0x56a9d3){if(_0x56a9d3){return _0x56a9d3['update'](_0x328190)[_0x54b7('0x20')](function(_0x3de573){return _0x3de573;});}return null;};}function removeEntity(_0x24ecf6,_0x1ab5a6){return function(_0xaa3d61){if(_0xaa3d61){return _0xaa3d61[_0x54b7('0x34')]()[_0x54b7('0x20')](function(){_0x24ecf6[_0x54b7('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x165b5a,_0x48b1f9){return function(_0x426771){if(!_0x426771){_0x165b5a[_0x54b7('0x2a')](0x194);}return _0x426771;};}function handleError(_0x57d683,_0x5ce4e0){_0x5ce4e0=_0x5ce4e0||0x1f4;return function(_0x25e9d3){logger[_0x54b7('0x26')](_0x25e9d3['stack']);if(_0x25e9d3[_0x54b7('0x35')]){delete _0x25e9d3[_0x54b7('0x35')];}_0x57d683[_0x54b7('0x2b')](_0x5ce4e0)[_0x54b7('0x36')](_0x25e9d3);};}exports[_0x54b7('0x37')]=function(_0x2dcb09,_0x589b6d){var _0x334030={},_0x5792dc={},_0x14f7ea={'count':0x0,'rows':[]};var _0x3f5cfd=_[_0x54b7('0x38')](db[_0x54b7('0x39')]['rawAttributes'],function(_0x47f42c){return{'name':_0x47f42c[_0x54b7('0x3a')],'type':_0x47f42c[_0x54b7('0x3b')]['key']};});_0x5792dc[_0x54b7('0x3c')]=_[_0x54b7('0x38')](_0x3f5cfd,_0x54b7('0x35'));_0x5792dc[_0x54b7('0x3d')]=_[_0x54b7('0x3e')](_0x2dcb09[_0x54b7('0x3d')]);_0x5792dc[_0x54b7('0x3f')]=_[_0x54b7('0x40')](_0x5792dc[_0x54b7('0x3c')],_0x5792dc[_0x54b7('0x3d')]);_0x334030[_0x54b7('0x41')]=_[_0x54b7('0x40')](_0x5792dc[_0x54b7('0x3c')],qs[_0x54b7('0x42')](_0x2dcb09[_0x54b7('0x3d')][_0x54b7('0x42')]));_0x334030[_0x54b7('0x41')]=_0x334030[_0x54b7('0x41')][_0x54b7('0x43')]?_0x334030['attributes']:_0x5792dc[_0x54b7('0x3c')];if(!_0x2dcb09[_0x54b7('0x3d')][_0x54b7('0x44')]('nolimit')){_0x334030[_0x54b7('0x31')]=qs['limit'](_0x2dcb09[_0x54b7('0x3d')][_0x54b7('0x31')]);_0x334030['offset']=qs[_0x54b7('0x30')](_0x2dcb09['query'][_0x54b7('0x30')]);}_0x334030[_0x54b7('0x45')]=qs[_0x54b7('0x46')](_0x2dcb09[_0x54b7('0x3d')]['sort']);_0x334030['where']=qs[_0x54b7('0x3f')](_[_0x54b7('0x47')](_0x2dcb09[_0x54b7('0x3d')],_0x5792dc[_0x54b7('0x3f')]),_0x3f5cfd);if(_0x2dcb09['query'][_0x54b7('0x48')]){_0x334030[_0x54b7('0x49')]=_[_0x54b7('0x4a')](_0x334030['where'],{'$or':_[_0x54b7('0x38')](_0x3f5cfd,function(_0x1e5715){if(_0x1e5715[_0x54b7('0x3b')]!==_0x54b7('0x4b')){var _0x2c00be={};_0x2c00be[_0x1e5715['name']]={'$like':'%'+_0x2dcb09[_0x54b7('0x3d')][_0x54b7('0x48')]+'%'};return _0x2c00be;}})});}_0x334030=_[_0x54b7('0x4a')]({},_0x334030,_0x2dcb09[_0x54b7('0x4c')]);var _0x18a959={'where':_0x334030['where']};return db[_0x54b7('0x39')]['count'](_0x18a959)['then'](function(_0x166c86){_0x14f7ea[_0x54b7('0x2f')]=_0x166c86;if(_0x2dcb09[_0x54b7('0x3d')][_0x54b7('0x4d')]){_0x334030[_0x54b7('0x4e')]=[{'all':!![]}];}return db['ChatMessage'][_0x54b7('0x4f')](_0x334030);})['then'](function(_0x27068f){_0x14f7ea[_0x54b7('0x50')]=_0x27068f;return _0x14f7ea;})[_0x54b7('0x20')](respondWithFilteredResult(_0x589b6d,_0x334030))[_0x54b7('0x51')](handleError(_0x589b6d,null));};exports[_0x54b7('0x52')]=function(_0x2c2dca,_0x53cbf5){var _0xc27ac4={'raw':!![],'where':{'id':_0x2c2dca[_0x54b7('0x53')]['id']}},_0x2c7647={};_0x2c7647[_0x54b7('0x3c')]=_[_0x54b7('0x3e')](db['ChatMessage'][_0x54b7('0x54')]);_0x2c7647[_0x54b7('0x3d')]=_[_0x54b7('0x3e')](_0x2c2dca[_0x54b7('0x3d')]);_0x2c7647['filters']=_[_0x54b7('0x40')](_0x2c7647['model'],_0x2c7647[_0x54b7('0x3d')]);_0xc27ac4[_0x54b7('0x41')]=_[_0x54b7('0x40')](_0x2c7647[_0x54b7('0x3c')],qs[_0x54b7('0x42')](_0x2c2dca[_0x54b7('0x3d')][_0x54b7('0x42')]));_0xc27ac4[_0x54b7('0x41')]=_0xc27ac4['attributes'][_0x54b7('0x43')]?_0xc27ac4[_0x54b7('0x41')]:_0x2c7647[_0x54b7('0x3c')];if(_0x2c2dca[_0x54b7('0x3d')][_0x54b7('0x4d')]){_0xc27ac4[_0x54b7('0x4e')]=[{'all':!![]}];}_0xc27ac4=_[_0x54b7('0x4a')]({},_0xc27ac4,_0x2c2dca[_0x54b7('0x4c')]);return db[_0x54b7('0x39')][_0x54b7('0x55')](_0xc27ac4)[_0x54b7('0x20')](handleEntityNotFound(_0x53cbf5,null))['then'](respondWithResult(_0x53cbf5,null))[_0x54b7('0x51')](handleError(_0x53cbf5,null));};exports[_0x54b7('0x56')]=function(_0x1e66bb,_0x371208){return db[_0x54b7('0x39')]['create'](_0x1e66bb[_0x54b7('0x57')],{})[_0x54b7('0x20')](respondWithResult(_0x371208,0xc9))['catch'](handleError(_0x371208,null));};exports['update']=function(_0x1d25e7,_0x68e43d){if(_0x1d25e7[_0x54b7('0x57')]['id']){delete _0x1d25e7[_0x54b7('0x57')]['id'];}return db[_0x54b7('0x39')]['find']({'where':{'id':_0x1d25e7[_0x54b7('0x53')]['id']}})['then'](handleEntityNotFound(_0x68e43d,null))[_0x54b7('0x20')](saveUpdates(_0x1d25e7['body'],null))[_0x54b7('0x20')](respondWithResult(_0x68e43d,null))[_0x54b7('0x51')](handleError(_0x68e43d,null));};exports[_0x54b7('0x34')]=function(_0x3083df,_0x4c3021){return db[_0x54b7('0x39')][_0x54b7('0x55')]({'where':{'id':_0x3083df[_0x54b7('0x53')]['id']}})[_0x54b7('0x20')](handleEntityNotFound(_0x4c3021,null))[_0x54b7('0x20')](removeEntity(_0x4c3021,null))[_0x54b7('0x51')](handleError(_0x4c3021,null));};exports[_0x54b7('0x58')]=function(_0x4b0045,_0x196c32){return db[_0x54b7('0x39')][_0x54b7('0x58')]()['then'](respondWithResult(_0x196c32,null))[_0x54b7('0x51')](handleError(_0x196c32,null));};var interaction_log=require(_0x54b7('0x59'))(_0x54b7('0x5a'));exports['accept']=function(_0x26d1cc,_0x1cc33d,_0x5aea1c){var _0x3d7a3b={'agent':{},'channel':_0x54b7('0x5b')};if(_0x26d1cc[_0x54b7('0x57')]['id']){delete _0x26d1cc['body']['id'];}_0x26d1cc[_0x54b7('0x57')][_0x54b7('0x5c')]=!![];_0x26d1cc['body'][_0x54b7('0x5d')]=moment()['format'](_0x54b7('0x5e'));_0x26d1cc[_0x54b7('0x57')][_0x54b7('0x5f')]=_0x26d1cc[_0x54b7('0x57')][_0x54b7('0x5f')]||_0x26d1cc['user']['id'];_0x3d7a3b['agent']['id']=_0x26d1cc[_0x54b7('0x57')][_0x54b7('0x5f')];return db['ChatMessage'][_0x54b7('0x55')]({'where':{'id':_0x26d1cc[_0x54b7('0x53')]['id'],'UserId':null}})[_0x54b7('0x20')](handleEntityNotFound(_0x1cc33d,null))['then'](saveUpdates(_0x26d1cc[_0x54b7('0x57')],null))[_0x54b7('0x20')](function(_0x16e257){if(_0x16e257){_0x3d7a3b['message']=_0x16e257[_0x54b7('0x60')]({'plain':!![]});return db[_0x54b7('0x61')][_0x54b7('0x55')]({'where':{'id':_0x16e257[_0x54b7('0x62')]}});}return null;})[_0x54b7('0x20')](handleEntityNotFound(_0x1cc33d,null))[_0x54b7('0x20')](function(_0x29e5ef){if(_0x29e5ef){return _0x29e5ef[_0x54b7('0x63')]({'UserId':_0x26d1cc[_0x54b7('0x57')]['UserId'],'read1stAt':_[_0x54b7('0x64')](_0x29e5ef['read1stAt'])?moment()[_0x54b7('0x65')](_0x54b7('0x5e')):undefined});}return null;})['then'](function(_0x596604){if(_0x596604){_0x3d7a3b[_0x54b7('0x66')]=_0x596604[_0x54b7('0x60')]({'plain':!![]});interaction_log['info'](_0x54b7('0x67'),_0x26d1cc[_0x54b7('0x68')]['id'],_0x26d1cc[_0x54b7('0x68')][_0x54b7('0x35')],_0x26d1cc[_0x54b7('0x68')][_0x54b7('0x69')],_0x3d7a3b[_0x54b7('0x66')]['id'],_0x26d1cc[_0x54b7('0x57')]?JSON[_0x54b7('0x25')](_0x26d1cc[_0x54b7('0x57')]):'null');return respondWithRpcPromise(_0x54b7('0x6a'),_0x54b7('0x6b'),_0x3d7a3b);}return null;})[_0x54b7('0x20')](function(_0x2d1706){var _0x576aa5=_0x54b7('0x6c')+_0x2d1706[_0x54b7('0x28')]['ContactId'];return db[_0x54b7('0x6d')]['query'](_0x576aa5,{'type':db[_0x54b7('0x6e')][_0x54b7('0x6f')][_0x54b7('0x70')],'raw':!![]})[_0x54b7('0x20')](function(_0x52f44d){return _0x52f44d;});})['then'](function(_0x1eabb3){if(_0x1eabb3){_0x3d7a3b['message'][_0x54b7('0x71')]=_0x1eabb3[0x0];if(!_0x26d1cc[_0x54b7('0x57')][_0x54b7('0x5f')])return;return db[_0x54b7('0x72')][_0x54b7('0x55')]({'where':{'id':_0x26d1cc['body'][_0x54b7('0x5f')],'role':'agent'},'attributes':['id','name',_0x54b7('0x73'),'email',_0x54b7('0x74')],'raw':!![]});}return null;})[_0x54b7('0x20')](function(_0x4d6a89){if(!_0x4d6a89)return null;_0x3d7a3b[_0x54b7('0x28')]['agent']=_0x4d6a89;return _0x3d7a3b;})['then'](function(_0x70c9cc){if(_0x70c9cc){if(_0x26d1cc[_0x54b7('0x57')]['manual']){_0x3d7a3b[_0x54b7('0x28')]['interface']=util[_0x54b7('0x65')](_0x54b7('0x75'),_0x26d1cc[_0x54b7('0x68')][_0x54b7('0x35')]);_0x3d7a3b['message'][_0x54b7('0x76')]=_0x3d7a3b['channel'];_0x3d7a3b[_0x54b7('0x28')][_0x54b7('0x77')]=_0x3d7a3b[_0x54b7('0x76')];_0x3d7a3b[_0x54b7('0x28')][_0x54b7('0x78')]=_0x54b7('0x79');return respondWithRpcPromise(_0x54b7('0x7a'),_0x54b7('0x7a'),{'event':_0x54b7('0x7b'),'message':_['merge'](_0x3d7a3b[_0x54b7('0x28')],JSON[_0x54b7('0x7c')](_0x3d7a3b['interaction'][_0x54b7('0x7d')]))},client9002)[_0x54b7('0x20')](function(){return _0x3d7a3b;});}return _0x3d7a3b;}return null;})[_0x54b7('0x20')](respondWithResult(_0x1cc33d,null))['catch'](handleError(_0x1cc33d,null));};var interaction_log=require(_0x54b7('0x59'))('chat-interactions');exports['reject']=function(_0x47deb6,_0x25005d,_0x40ded3){var _0x50a26f={'agent':{},'channel':'chat'};if(_0x47deb6[_0x54b7('0x57')]['id']){delete _0x47deb6[_0x54b7('0x57')]['id'];}_0x47deb6[_0x54b7('0x57')]['UserId']=_0x47deb6[_0x54b7('0x57')][_0x54b7('0x5f')]||_0x47deb6['user']['id'];_0x50a26f[_0x54b7('0x7e')]['id']=_0x47deb6['body']['UserId'];return db['ChatMessage'][_0x54b7('0x55')]({'where':{'id':_0x47deb6[_0x54b7('0x53')]['id'],'UserId':null}})[_0x54b7('0x20')](handleEntityNotFound(_0x25005d,null))[_0x54b7('0x20')](function(_0x32d744){if(_0x32d744){_0x50a26f['message']=_0x32d744[_0x54b7('0x60')]({'plain':!![]});return db[_0x54b7('0x61')][_0x54b7('0x55')]({'where':{'id':_0x32d744[_0x54b7('0x62')]}});}return null;})[_0x54b7('0x20')](handleEntityNotFound(_0x25005d,null))[_0x54b7('0x20')](function(_0x3929ee){if(_0x3929ee){_0x50a26f[_0x54b7('0x66')]=_0x3929ee[_0x54b7('0x60')]({'plain':!![]});interaction_log[_0x54b7('0x21')](_0x54b7('0x7f'),_0x47deb6[_0x54b7('0x68')]['id'],_0x47deb6[_0x54b7('0x68')][_0x54b7('0x35')],_0x47deb6[_0x54b7('0x68')]['role'],_0x50a26f[_0x54b7('0x66')]['id'],_0x47deb6['body']?JSON['stringify'](_0x47deb6[_0x54b7('0x57')]):_0x54b7('0x80'));return respondWithRpcPromise('RejectMessage',_0x54b7('0x81'),_0x50a26f);}return null;})[_0x54b7('0x20')](function(_0x2d1657){var _0x4e32d=_0x54b7('0x6c')+_0x2d1657[_0x54b7('0x28')][_0x54b7('0x82')];return db['sequelize'][_0x54b7('0x3d')](_0x4e32d,{'type':db['Sequelize'][_0x54b7('0x6f')][_0x54b7('0x70')],'raw':!![]})['then'](function(_0x653478){return _0x653478;});})[_0x54b7('0x20')](function(_0x3550ef){if(_0x3550ef){_0x50a26f['message'][_0x54b7('0x71')]=_0x3550ef[0x0];if(!_0x47deb6['body']['UserId'])return;return db['User'][_0x54b7('0x55')]({'where':{'id':_0x47deb6['body'][_0x54b7('0x5f')],'role':'agent'},'attributes':['id','name',_0x54b7('0x73'),'email',_0x54b7('0x74')],'raw':!![]});}return null;})[_0x54b7('0x20')](function(_0x3b1882){if(!_0x3b1882)return null;_0x50a26f[_0x54b7('0x28')][_0x54b7('0x7e')]=_0x3b1882;return _0x50a26f;})[_0x54b7('0x20')](function(_0x1d35b1){if(_0x1d35b1){_0x1d35b1[_0x54b7('0x28')][_0x54b7('0x83')]=util[_0x54b7('0x65')](_0x54b7('0x75'),_0x47deb6[_0x54b7('0x68')][_0x54b7('0x35')]);_0x1d35b1[_0x54b7('0x28')][_0x54b7('0x76')]=_0x50a26f[_0x54b7('0x76')];_0x1d35b1[_0x54b7('0x28')][_0x54b7('0x77')]=_0x50a26f[_0x54b7('0x76')];_0x1d35b1[_0x54b7('0x28')][_0x54b7('0x78')]='reject';respondWithRpcPromise(_0x54b7('0x7a'),_0x54b7('0x7a'),{'event':_0x54b7('0x84'),'message':_['merge'](_0x50a26f[_0x54b7('0x28')],JSON[_0x54b7('0x7c')](_0x50a26f[_0x54b7('0x66')][_0x54b7('0x7d')]))},client9002);return _0x50a26f;}return null;})[_0x54b7('0x20')](respondWithResult(_0x25005d,null))[_0x54b7('0x51')](handleError(_0x25005d,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 42c77aa..e9cc7fc 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 _0x6bd2=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0x6bd2,0x12e));var _0x26bd=function(_0x382b7a,_0x373cdf){_0x382b7a=_0x382b7a-0x0;var _0x4db5f0=_0x6bd2[_0x382b7a];return _0x4db5f0;};'use strict';var EventEmitter=require(_0x26bd('0x0'));var ChatMessage=require(_0x26bd('0x1'))['db'][_0x26bd('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x26bd('0x3')](0x0);var events={'afterCreate':_0x26bd('0x4'),'afterUpdate':_0x26bd('0x5'),'afterDestroy':_0x26bd('0x6')};function emitEvent(_0x4d1052){return function(_0x1ae9a7,_0x16d58c,_0x445c39){ChatMessageEvents['emit'](_0x4d1052+':'+_0x1ae9a7['id'],_0x1ae9a7);ChatMessageEvents[_0x26bd('0x7')](_0x4d1052,_0x1ae9a7);_0x445c39(null);};}for(var e in events){if(events[_0x26bd('0x8')](e)){var event=events[e];ChatMessage[_0x26bd('0x9')](e,emitEvent(event));}}module[_0x26bd('0xa')]=ChatMessageEvents;
\ No newline at end of file
+var _0x142f=['ChatMessage','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x6bd5d8,_0x53cf31){var _0x7863e7=function(_0x1345d8){while(--_0x1345d8){_0x6bd5d8['push'](_0x6bd5d8['shift']());}};_0x7863e7(++_0x53cf31);}(_0x142f,0x17a));var _0xf142=function(_0x2b0c2e,_0x586346){_0x2b0c2e=_0x2b0c2e-0x0;var _0xd6c0aa=_0x142f[_0x2b0c2e];return _0xd6c0aa;};'use strict';var EventEmitter=require(_0xf142('0x0'));var ChatMessage=require(_0xf142('0x1'))['db'][_0xf142('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf142('0x3'),'afterUpdate':_0xf142('0x4'),'afterDestroy':_0xf142('0x5')};function emitEvent(_0x45e3cd){return function(_0x58bae6,_0x51b149,_0x208213){ChatMessageEvents[_0xf142('0x6')](_0x45e3cd+':'+_0x58bae6['id'],_0x58bae6);ChatMessageEvents[_0xf142('0x6')](_0x45e3cd,_0x58bae6);_0x208213(null);};}for(var e in events){if(events[_0xf142('0x7')](e)){var event=events[e];ChatMessage[_0xf142('0x8')](e,emitEvent(event));}}module[_0xf142('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 728a64f..2131605 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 _0x2054=['findOne','ChatInteractionId','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0x2054,0x176));var _0x4205=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0x2054[_0x3f993e];return _0x39c135;};'use strict';var _=require(_0x4205('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4205('0x1'));var BPromise=require(_0x4205('0x2'));var rp=require(_0x4205('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4205('0x4'));module[_0x4205('0x5')]=function(_0x2db8ab,_0x29e1c2){return _0x2db8ab['define'](_0x4205('0x6'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x4205('0x7'),'fields':[_0x4205('0x8')],'type':_0x4205('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1eef24,_0x463385,_0x3ab22b){var _0x10260c=_0x2db8ab[_0x4205('0xa')];var _0x3310bc=_0x1eef24[_0x4205('0xb')]({'plain':!![]});if(_0x3310bc[_0x4205('0xc')][_0x4205('0xd')]()==='in'||_0x3310bc['direction']['toLowerCase']()===_0x4205('0xe')&&!_0x3310bc[_0x4205('0xf')]&&!_['isNil'](_0x3310bc[_0x4205('0x10')])){_0x10260c['ChatInteraction'][_0x4205('0x11')]({'where':{'id':_0x3310bc[_0x4205('0x12')]}})['then'](function(_0xcc2fa1){if(_0xcc2fa1){_0xcc2fa1[_0x4205('0x13')]({'lastMsgAt':_0x3310bc['createdAt'],'lastMsgDirection':_0x3310bc['direction'][_0x4205('0xd')]()});}})['catch'](function(_0x2ef7dd){console[_0x4205('0x14')](_0x2ef7dd);});}_0x3ab22b();}},'charset':_0x4205('0x15'),'collate':_0x4205('0x16')});};
\ No newline at end of file
+var _0xfd9e=['ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','UserId'];(function(_0x2646f6,_0x287adf){var _0x577237=function(_0x4d2d6f){while(--_0x4d2d6f){_0x2646f6['push'](_0x2646f6['shift']());}};_0x577237(++_0x287adf);}(_0xfd9e,0x15d));var _0xefd9=function(_0x3ba0af,_0xccb8a1){_0x3ba0af=_0x3ba0af-0x0;var _0x650db7=_0xfd9e[_0x3ba0af];return _0x650db7;};'use strict';var _=require(_0xefd9('0x0'));var util=require(_0xefd9('0x1'));var logger=require('../../config/logger')(_0xefd9('0x2'));var moment=require(_0xefd9('0x3'));var BPromise=require(_0xefd9('0x4'));var rp=require(_0xefd9('0x5'));var fs=require('fs');var path=require(_0xefd9('0x6'));var rimraf=require(_0xefd9('0x7'));var config=require(_0xefd9('0x8'));var attributes=require(_0xefd9('0x9'));module[_0xefd9('0xa')]=function(_0x4470b8,_0x5e1557){return _0x4470b8[_0xefd9('0xb')](_0xefd9('0xc'),attributes,{'tableName':_0xefd9('0xd'),'paranoid':![],'indexes':[{'name':_0xefd9('0xe'),'fields':[_0xefd9('0xf')],'type':_0xefd9('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2bee04,_0x4e5112,_0x58d49d){var _0x352f74=_0x4470b8[_0xefd9('0x11')];var _0x31a4f8=_0x2bee04['get']({'plain':!![]});if(_0x31a4f8[_0xefd9('0x12')][_0xefd9('0x13')]()==='in'||_0x31a4f8[_0xefd9('0x12')][_0xefd9('0x13')]()===_0xefd9('0x14')&&!_0x31a4f8[_0xefd9('0x15')]&&!_['isNil'](_0x31a4f8[_0xefd9('0x16')])){_0x352f74[_0xefd9('0x17')][_0xefd9('0x18')]({'where':{'id':_0x31a4f8[_0xefd9('0x19')]}})[_0xefd9('0x1a')](function(_0x5973a8){if(_0x5973a8){_0x5973a8[_0xefd9('0x1b')]({'lastMsgAt':_0x31a4f8[_0xefd9('0x1c')],'lastMsgDirection':_0x31a4f8[_0xefd9('0x12')]['toLowerCase']()});}})['catch'](function(_0x28a2f9){console['error'](_0x28a2f9);});}_0x58d49d();}},'charset':_0xefd9('0x1d'),'collate':_0xefd9('0x1e')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index c01de55..5f341db 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 _0xfac6=['code','message','catch','ChatMessage','body','options','raw','CreateChatMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x148acb,_0x2694f7){var _0x3b9378=function(_0x5bb255){while(--_0x5bb255){_0x148acb['push'](_0x148acb['shift']());}};_0x3b9378(++_0x2694f7);}(_0xfac6,0xef));var _0x6fac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfac6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6fac('0x0'));var util=require(_0x6fac('0x1'));var moment=require(_0x6fac('0x2'));var BPromise=require(_0x6fac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6fac('0x4'));var db=require(_0x6fac('0x5'))['db'];var utils=require(_0x6fac('0x6'));var logger=require('../../config/logger')(_0x6fac('0x7'));var config=require(_0x6fac('0x8'));var jayson=require(_0x6fac('0x9'));var client=jayson['client'][_0x6fac('0xa')]({'port':0x232a});config[_0x6fac('0xb')]=_[_0x6fac('0xc')](config[_0x6fac('0xb')],{'host':_0x6fac('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6fac('0xb')]));require(_0x6fac('0xe'))[_0x6fac('0xf')](socket);function respondWithRpcPromise(_0x209020,_0xfb8d3a,_0x2a906d){return new BPromise(function(_0x1be0fa,_0x3b3cdd){return client[_0x6fac('0x10')](_0x209020,_0x2a906d)[_0x6fac('0x11')](function(_0x628baf){logger[_0x6fac('0x12')](_0x6fac('0x13'),_0xfb8d3a,_0x6fac('0x14'));logger[_0x6fac('0x15')](_0x6fac('0x16'),_0xfb8d3a,_0x6fac('0x14'),JSON[_0x6fac('0x17')](_0x628baf));if(_0x628baf[_0x6fac('0x18')]){if(_0x628baf[_0x6fac('0x18')][_0x6fac('0x19')]===0x1f4){logger[_0x6fac('0x18')](_0x6fac('0x13'),_0xfb8d3a,_0x628baf['error'][_0x6fac('0x1a')]);return _0x3b3cdd(_0x628baf[_0x6fac('0x18')][_0x6fac('0x1a')]);}logger[_0x6fac('0x18')](_0x6fac('0x13'),_0xfb8d3a,_0x628baf['error'][_0x6fac('0x1a')]);return _0x1be0fa(_0x628baf[_0x6fac('0x18')]['message']);}else{logger['info'](_0x6fac('0x13'),_0xfb8d3a,_0x6fac('0x14'));_0x1be0fa(_0x628baf['result'][_0x6fac('0x1a')]);}})[_0x6fac('0x1b')](function(_0x13d4ce){logger[_0x6fac('0x18')](_0x6fac('0x13'),_0xfb8d3a,_0x13d4ce);_0x3b3cdd(_0x13d4ce);});});}exports['CreateChatMessage']=function(_0x56c890){var _0x4fa4cb=this;return new Promise(function(_0x4b751a,_0x51ed9f){return db[_0x6fac('0x1c')]['create'](_0x56c890[_0x6fac('0x1d')],{'raw':_0x56c890['options']?_0x56c890[_0x6fac('0x1e')][_0x6fac('0x1f')]===undefined?!![]:![]:!![]})[_0x6fac('0x11')](function(_0x1ae833){logger[_0x6fac('0x12')]('CreateChatMessage',_0x56c890);logger['debug'](_0x6fac('0x20'),_0x56c890,JSON['stringify'](_0x1ae833));_0x4b751a(_0x1ae833);})[_0x6fac('0x1b')](function(_0x234575){logger[_0x6fac('0x18')](_0x6fac('0x20'),_0x234575[_0x6fac('0x1a')],_0x56c890);_0x51ed9f(_0x4fa4cb[_0x6fac('0x18')](0x1f4,_0x234575[_0x6fac('0x1a')]));});});};
\ No newline at end of file
+var _0x2b4d=['./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatMessage','create','body','options','raw','info','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x499a43,_0x3cbee7){var _0x4e607e=function(_0xd7f146){while(--_0xd7f146){_0x499a43['push'](_0x499a43['shift']());}};_0x4e607e(++_0x3cbee7);}(_0x2b4d,0xfa));var _0xd2b4=function(_0x2300c7,_0x255f74){_0x2300c7=_0x2300c7-0x0;var _0x23f720=_0x2b4d[_0x2300c7];return _0x23f720;};'use strict';var _=require(_0xd2b4('0x0'));var util=require(_0xd2b4('0x1'));var moment=require(_0xd2b4('0x2'));var BPromise=require(_0xd2b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2b4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd2b4('0x5'))(_0xd2b4('0x6'));var config=require(_0xd2b4('0x7'));var jayson=require(_0xd2b4('0x8'));var client=jayson[_0xd2b4('0x9')]['http']({'port':0x232a});config[_0xd2b4('0xa')]=_[_0xd2b4('0xb')](config[_0xd2b4('0xa')],{'host':_0xd2b4('0xc'),'port':0x18eb});var socket=require(_0xd2b4('0xd'))(new Redis(config[_0xd2b4('0xa')]));require(_0xd2b4('0xe'))[_0xd2b4('0xf')](socket);function respondWithRpcPromise(_0x3e256c,_0x266b4e,_0x141238){return new BPromise(function(_0xf38b,_0x302902){return client[_0xd2b4('0x10')](_0x3e256c,_0x141238)[_0xd2b4('0x11')](function(_0x44aad2){logger['info'](_0xd2b4('0x12'),_0x266b4e,_0xd2b4('0x13'));logger[_0xd2b4('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x266b4e,_0xd2b4('0x13'),JSON[_0xd2b4('0x15')](_0x44aad2));if(_0x44aad2[_0xd2b4('0x16')]){if(_0x44aad2[_0xd2b4('0x16')][_0xd2b4('0x17')]===0x1f4){logger[_0xd2b4('0x16')](_0xd2b4('0x12'),_0x266b4e,_0x44aad2[_0xd2b4('0x16')][_0xd2b4('0x18')]);return _0x302902(_0x44aad2['error'][_0xd2b4('0x18')]);}logger['error'](_0xd2b4('0x12'),_0x266b4e,_0x44aad2[_0xd2b4('0x16')][_0xd2b4('0x18')]);return _0xf38b(_0x44aad2[_0xd2b4('0x16')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x266b4e,_0xd2b4('0x13'));_0xf38b(_0x44aad2[_0xd2b4('0x19')][_0xd2b4('0x18')]);}})[_0xd2b4('0x1a')](function(_0x5dd666){logger[_0xd2b4('0x16')](_0xd2b4('0x12'),_0x266b4e,_0x5dd666);_0x302902(_0x5dd666);});});}exports[_0xd2b4('0x1b')]=function(_0x2499bd){var _0x43a18d=this;return new Promise(function(_0x2a71ba,_0x1927a8){return db['ChatMessage'][_0xd2b4('0x1c')](_0x2499bd[_0xd2b4('0x1d')],{'raw':_0x2499bd[_0xd2b4('0x1e')]?_0x2499bd[_0xd2b4('0x1e')][_0xd2b4('0x1f')]===undefined?!![]:![]:!![]})[_0xd2b4('0x11')](function(_0x689c31){logger[_0xd2b4('0x20')](_0xd2b4('0x1b'),_0x2499bd);logger[_0xd2b4('0x14')](_0xd2b4('0x1b'),_0x2499bd,JSON[_0xd2b4('0x15')](_0x689c31));_0x2a71ba(_0x689c31);})[_0xd2b4('0x1a')](function(_0x3123d1){logger['error'](_0xd2b4('0x1b'),_0x3123d1[_0xd2b4('0x18')],_0x2499bd);_0x1927a8(_0x43a18d['error'](0x1f4,_0x3123d1[_0xd2b4('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index a2574af..0b14faa 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 _0xf006=['register','chatMessage:','remove','update','emit','removeListener'];(function(_0x196939,_0x291748){var _0x3fff3c=function(_0x4e7504){while(--_0x4e7504){_0x196939['push'](_0x196939['shift']());}};_0x3fff3c(++_0x291748);}(_0xf006,0x146));var _0x6f00=function(_0x4467c2,_0x9b2183){_0x4467c2=_0x4467c2-0x0;var _0xb79418=_0xf006[_0x4467c2];return _0xb79418;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x6f00('0x0'),_0x6f00('0x1')];function createListener(_0x5914f3,_0xbab575){return function(_0x4e9dbc){_0xbab575[_0x6f00('0x2')](_0x5914f3,_0x4e9dbc);};}function removeListener(_0x4f4466,_0x5039fb){return function(){ChatMessageEvents[_0x6f00('0x3')](_0x4f4466,_0x5039fb);};}exports[_0x6f00('0x4')]=function(_0x141e71){for(var _0x52c9a2=0x0,_0x3c29ff=events['length'];_0x52c9a2<_0x3c29ff;_0x52c9a2++){var _0x3875fb=events[_0x52c9a2];var _0x3001b1=createListener(_0x6f00('0x5')+_0x3875fb,_0x141e71);ChatMessageEvents['on'](_0x3875fb,_0x3001b1);}};
\ No newline at end of file
+var _0x0ec6=['register','chatMessage:','./chatMessage.events','update','emit'];(function(_0x398a1a,_0x565533){var _0xc43fd2=function(_0x5938d1){while(--_0x5938d1){_0x398a1a['push'](_0x398a1a['shift']());}};_0xc43fd2(++_0x565533);}(_0x0ec6,0x1f1));var _0x60ec=function(_0xcfea9e,_0x529203){_0xcfea9e=_0xcfea9e-0x0;var _0xd8683e=_0x0ec6[_0xcfea9e];return _0xd8683e;};'use strict';var ChatMessageEvents=require(_0x60ec('0x0'));var events=['save','remove',_0x60ec('0x1')];function createListener(_0x21264a,_0x2ee4a3){return function(_0x13a3a5){_0x2ee4a3[_0x60ec('0x2')](_0x21264a,_0x13a3a5);};}function removeListener(_0x262ed6,_0x392a91){return function(){ChatMessageEvents['removeListener'](_0x262ed6,_0x392a91);};}exports[_0x60ec('0x3')]=function(_0xb4a258){for(var _0x1d8fb5=0x0,_0x74adc4=events['length'];_0x1d8fb5<_0x74adc4;_0x1d8fb5++){var _0xcb974c=events[_0x1d8fb5];var _0x488ab8=createListener(_0x60ec('0x4')+_0xcb974c,_0xb4a258);ChatMessageEvents['on'](_0xcb974c,_0x488ab8);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 20a08b6..9809b45 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 _0xc82c=['isAuthenticated','/describe','describe','/:id','post','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get'];(function(_0x32f649,_0x4ccb75){var _0x5009ff=function(_0x3d4d1a){while(--_0x3d4d1a){_0x32f649['push'](_0x32f649['shift']());}};_0x5009ff(++_0x4ccb75);}(_0xc82c,0x75));var _0xcc82=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xc82c[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0xcc82('0x0'));var util=require(_0xcc82('0x1'));var path=require(_0xcc82('0x2'));var timeout=require(_0xcc82('0x3'));var express=require('express');var router=express[_0xcc82('0x4')]();var fs_extra=require(_0xcc82('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcc82('0x6'));var controller=require('./chatMessage.controller');router[_0xcc82('0x7')]('/',auth[_0xcc82('0x8')](),controller['index']);router['get'](_0xcc82('0x9'),auth[_0xcc82('0x8')](),controller[_0xcc82('0xa')]);router['get'](_0xcc82('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xcc82('0xc')]('/',auth[_0xcc82('0x8')](),interaction[_0xcc82('0xd')]('chat',_0xcc82('0xe')),controller[_0xcc82('0xf')]);router[_0xcc82('0x10')](_0xcc82('0xb'),controller[_0xcc82('0x11')]);router['put'](_0xcc82('0x12'),auth['isAuthenticated'](),controller[_0xcc82('0x13')]);router[_0xcc82('0x10')](_0xcc82('0x14'),auth[_0xcc82('0x8')](),controller[_0xcc82('0x15')]);router[_0xcc82('0x16')](_0xcc82('0xb'),auth['isAuthenticated'](),controller[_0xcc82('0x17')]);module[_0xcc82('0x18')]=router;
\ No newline at end of file
+var _0xfa15=['tracked','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x1d7423,_0x23da50){var _0x455b84=function(_0x19b098){while(--_0x19b098){_0x1d7423['push'](_0x1d7423['shift']());}};_0x455b84(++_0x23da50);}(_0xfa15,0x132));var _0x5fa1=function(_0x7fadd5,_0x1a0bce){_0x7fadd5=_0x7fadd5-0x0;var _0x54916c=_0xfa15[_0x7fadd5];return _0x54916c;};'use strict';var multer=require(_0x5fa1('0x0'));var util=require(_0x5fa1('0x1'));var path=require(_0x5fa1('0x2'));var timeout=require('connect-timeout');var express=require(_0x5fa1('0x3'));var router=express[_0x5fa1('0x4')]();var fs_extra=require(_0x5fa1('0x5'));var auth=require(_0x5fa1('0x6'));var interaction=require(_0x5fa1('0x7'));var config=require(_0x5fa1('0x8'));var controller=require(_0x5fa1('0x9'));router[_0x5fa1('0xa')]('/',auth[_0x5fa1('0xb')](),controller[_0x5fa1('0xc')]);router[_0x5fa1('0xa')](_0x5fa1('0xd'),auth[_0x5fa1('0xb')](),controller[_0x5fa1('0xe')]);router[_0x5fa1('0xa')](_0x5fa1('0xf'),auth[_0x5fa1('0xb')](),controller[_0x5fa1('0x10')]);router[_0x5fa1('0x11')]('/',auth['isAuthenticated'](),interaction[_0x5fa1('0x12')](_0x5fa1('0x13'),_0x5fa1('0x14')),controller['create']);router[_0x5fa1('0x15')](_0x5fa1('0xf'),controller[_0x5fa1('0x16')]);router[_0x5fa1('0x15')](_0x5fa1('0x17'),auth['isAuthenticated'](),controller[_0x5fa1('0x18')]);router[_0x5fa1('0x15')](_0x5fa1('0x19'),auth[_0x5fa1('0xb')](),controller[_0x5fa1('0x1a')]);router['delete'](_0x5fa1('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 597b660..386a3b8 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 _0x2032=['medium','exports','TEXT'];(function(_0x27fb22,_0xab9f66){var _0x2046fc=function(_0x1a692c){while(--_0x1a692c){_0x27fb22['push'](_0x27fb22['shift']());}};_0x2046fc(++_0xab9f66);}(_0x2032,0xd9));var _0x2203=function(_0x102cdf,_0x5b4ccc){_0x102cdf=_0x102cdf-0x0;var _0x300a44=_0x2032[_0x102cdf];return _0x300a44;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x2032=['medium','exports','TEXT'];(function(_0x2b04dd,_0xa39e7){var _0xf67a99=function(_0x14f7d8){while(--_0x14f7d8){_0x2b04dd['push'](_0x2b04dd['shift']());}};_0xf67a99(++_0xa39e7);}(_0x2032,0xd9));var _0x2203=function(_0x3bc95c,_0xab3023){_0x3bc95c=_0x3bc95c-0x0;var _0x36ff6b=_0x2032[_0x3bc95c];return _0x36ff6b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('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 f7e92e4..f982fdf 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(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7a54,0x106));var _0x47a5=function(_0x4e3c4b,_0x5e4fc4){_0x4e3c4b=_0x4e3c4b-0x0;var _0xe3b56d=_0x7a54[_0x4e3c4b];return _0xe3b56d;};'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(_0x2f35d3,_0xf89dd9){var _0xe52a40=function(_0x399c89){while(--_0x399c89){_0x2f35d3['push'](_0x2f35d3['shift']());}};_0xe52a40(++_0xf89dd9);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 438f528..8657822 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 _0xcc66=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x47f762,_0x106ece){var _0x4d2585=function(_0x4de06b){while(--_0x4de06b){_0x47f762['push'](_0x47f762['shift']());}};_0x4d2585(++_0x106ece);}(_0xcc66,0x1f4));var _0x6cc6=function(_0x3200ea,_0x4fb38c){_0x3200ea=_0x3200ea-0x0;var _0x4b0858=_0xcc66[_0x3200ea];return _0x4b0858;};'use strict';var EventEmitter=require(_0x6cc6('0x0'));var ChatOfflineMessage=require(_0x6cc6('0x1'))['db'][_0x6cc6('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x6cc6('0x3')](0x0);var events={'afterCreate':_0x6cc6('0x4'),'afterUpdate':_0x6cc6('0x5'),'afterDestroy':_0x6cc6('0x6')};function emitEvent(_0x2afeeb){return function(_0x4828a4,_0x5187b8,_0x1a7fc9){ChatOfflineMessageEvents[_0x6cc6('0x7')](_0x2afeeb+':'+_0x4828a4['id'],_0x4828a4);ChatOfflineMessageEvents[_0x6cc6('0x7')](_0x2afeeb,_0x4828a4);_0x1a7fc9(null);};}for(var e in events){if(events[_0x6cc6('0x8')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x6cc6('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x5fa1=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x50ebdc,_0xa97455){var _0x135f61=function(_0x3f3436){while(--_0x3f3436){_0x50ebdc['push'](_0x50ebdc['shift']());}};_0x135f61(++_0xa97455);}(_0x5fa1,0xd2));var _0x15fa=function(_0xcb05d3,_0x22fe14){_0xcb05d3=_0xcb05d3-0x0;var _0x5078f7=_0x5fa1[_0xcb05d3];return _0x5078f7;};'use strict';var EventEmitter=require(_0x15fa('0x0'));var ChatOfflineMessage=require(_0x15fa('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x15fa('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x15fa('0x3'),'afterDestroy':_0x15fa('0x4')};function emitEvent(_0x3a4b63){return function(_0x5df7b3,_0x5e7c3e,_0x435d84){ChatOfflineMessageEvents[_0x15fa('0x5')](_0x3a4b63+':'+_0x5df7b3['id'],_0x5df7b3);ChatOfflineMessageEvents[_0x15fa('0x5')](_0x3a4b63,_0x5df7b3);_0x435d84(null);};}for(var e in events){if(events[_0x15fa('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x15fa('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index d019f14..38a7c79 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 _0x2564=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x4480b9,_0x5c2949){var _0x3f0f02=function(_0x43502f){while(--_0x43502f){_0x4480b9['push'](_0x4480b9['shift']());}};_0x3f0f02(++_0x5c2949);}(_0x2564,0x1ee));var _0x4256=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2564[_0x20a584];return _0x4b41a8;};'use strict';var attributes=require(_0x4256('0x0'));module[_0x4256('0x1')]=function(_0x289b22){return _0x289b22[_0x4256('0x2')](_0x4256('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4256('0x4'),'collate':_0x4256('0x5')});};
\ No newline at end of file
+var _0x765f=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x765f,0x181));var _0xf765=function(_0xf6cbf7,_0x5ebaca){_0xf6cbf7=_0xf6cbf7-0x0;var _0x2453b1=_0x765f[_0xf6cbf7];return _0x2453b1;};'use strict';var attributes=require(_0xf765('0x0'));module[_0xf765('0x1')]=function(_0x5ba2ba){return _0x5ba2ba[_0xf765('0x2')](_0xf765('0x3'),attributes,{'tableName':_0xf765('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf765('0x5'),'collate':_0xf765('0x6')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index ac8c448..523e5a0 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 _0xfb0b=['then','info','request\x20sent','debug','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x55804a,_0x4e3dbe){var _0x1150c8=function(_0x296043){while(--_0x296043){_0x55804a['push'](_0x55804a['shift']());}};_0x1150c8(++_0x4e3dbe);}(_0xfb0b,0x1d8));var _0xbfb0=function(_0x216dc9,_0x385e89){_0x216dc9=_0x216dc9-0x0;var _0x51f0c3=_0xfb0b[_0x216dc9];return _0x51f0c3;};'use strict';var _=require(_0xbfb0('0x0'));var util=require('util');var moment=require(_0xbfb0('0x1'));var BPromise=require('bluebird');var rs=require(_0xbfb0('0x2'));var fs=require('fs');var Redis=require(_0xbfb0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfb0('0x4'));var logger=require(_0xbfb0('0x5'))('rpc');var config=require(_0xbfb0('0x6'));var jayson=require(_0xbfb0('0x7'));var client=jayson[_0xbfb0('0x8')][_0xbfb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x224c2a,_0x527964,_0x3e15e5){return new BPromise(function(_0x573298,_0xdd2f1a){return client[_0xbfb0('0xa')](_0x224c2a,_0x3e15e5)[_0xbfb0('0xb')](function(_0x3d318d){logger[_0xbfb0('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x527964,_0xbfb0('0xd'));logger[_0xbfb0('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x527964,_0xbfb0('0xd'),JSON[_0xbfb0('0xf')](_0x3d318d));if(_0x3d318d[_0xbfb0('0x10')]){if(_0x3d318d[_0xbfb0('0x10')][_0xbfb0('0x11')]===0x1f4){logger[_0xbfb0('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x527964,_0x3d318d['error'][_0xbfb0('0x12')]);return _0xdd2f1a(_0x3d318d['error'][_0xbfb0('0x12')]);}logger[_0xbfb0('0x10')](_0xbfb0('0x13'),_0x527964,_0x3d318d['error'][_0xbfb0('0x12')]);return _0x573298(_0x3d318d[_0xbfb0('0x10')][_0xbfb0('0x12')]);}else{logger[_0xbfb0('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x527964,'request\x20sent');_0x573298(_0x3d318d[_0xbfb0('0x14')][_0xbfb0('0x12')]);}})['catch'](function(_0x214929){logger[_0xbfb0('0x10')](_0xbfb0('0x13'),_0x527964,_0x214929);_0xdd2f1a(_0x214929);});});}
\ No newline at end of file
+var _0xe64a=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','request\x20sent','stringify','error','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0xe64a,0x1e0));var _0xae64=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe64a[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xae64('0x0'));var util=require(_0xae64('0x1'));var moment=require(_0xae64('0x2'));var BPromise=require(_0xae64('0x3'));var rs=require(_0xae64('0x4'));var fs=require('fs');var Redis=require(_0xae64('0x5'));var db=require(_0xae64('0x6'))['db'];var utils=require(_0xae64('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae64('0x8')][_0xae64('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1064e3,_0x3cb2a6,_0x272ae9){return new BPromise(function(_0x65a9d1,_0x385871){return client[_0xae64('0xa')](_0x1064e3,_0x272ae9)[_0xae64('0xb')](function(_0x407543){logger[_0xae64('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3cb2a6,_0xae64('0xd'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3cb2a6,_0xae64('0xd'),JSON[_0xae64('0xe')](_0x407543));if(_0x407543[_0xae64('0xf')]){if(_0x407543[_0xae64('0xf')]['code']===0x1f4){logger[_0xae64('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3cb2a6,_0x407543['error'][_0xae64('0x10')]);return _0x385871(_0x407543[_0xae64('0xf')][_0xae64('0x10')]);}logger['error'](_0xae64('0x11'),_0x3cb2a6,_0x407543[_0xae64('0xf')][_0xae64('0x10')]);return _0x65a9d1(_0x407543[_0xae64('0xf')][_0xae64('0x10')]);}else{logger['info'](_0xae64('0x11'),_0x3cb2a6,_0xae64('0xd'));_0x65a9d1(_0x407543[_0xae64('0x12')][_0xae64('0x10')]);}})[_0xae64('0x13')](function(_0x561408){logger[_0xae64('0xf')](_0xae64('0x11'),_0x3cb2a6,_0x561408);_0x385871(_0x561408);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index dc294f0..bf70c5c 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 _0x2527=['util','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','exports'];(function(_0x639fff,_0x1678d0){var _0x535ba8=function(_0x216649){while(--_0x216649){_0x639fff['push'](_0x639fff['shift']());}};_0x535ba8(++_0x1678d0);}(_0x2527,0x1d4));var _0x7252=function(_0x493eb0,_0x24dfb9){_0x493eb0=_0x493eb0-0x0;var _0x303d5c=_0x2527[_0x493eb0];return _0x303d5c;};'use strict';var multer=require('multer');var util=require(_0x7252('0x0'));var path=require('path');var timeout=require(_0x7252('0x1'));var express=require('express');var router=express[_0x7252('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7252('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7252('0x4'));var controller=require(_0x7252('0x5'));router[_0x7252('0x6')]('/',auth['isAuthenticated'](),controller[_0x7252('0x7')]);router['get'](_0x7252('0x8'),auth[_0x7252('0x9')](),controller[_0x7252('0xa')]);router[_0x7252('0x6')](_0x7252('0xb'),auth[_0x7252('0x9')](),controller[_0x7252('0xc')]);router[_0x7252('0xd')]('/',auth[_0x7252('0x9')](),controller[_0x7252('0xe')]);router['put']('/:id',auth[_0x7252('0x9')](),controller[_0x7252('0xf')]);router[_0x7252('0x10')](_0x7252('0xb'),auth[_0x7252('0x9')](),controller['destroy']);module[_0x7252('0x11')]=router;
\ No newline at end of file
+var _0xa561=['index','/describe','describe','/:id','post','update','delete','destroy','multer','util','path','express','../../components/interaction/service','get','isAuthenticated'];(function(_0x16d460,_0x4b67e8){var _0x58dfb8=function(_0x2c14d8){while(--_0x2c14d8){_0x16d460['push'](_0x16d460['shift']());}};_0x58dfb8(++_0x4b67e8);}(_0xa561,0x116));var _0x1a56=function(_0xd1b293,_0x21dd59){_0xd1b293=_0xd1b293-0x0;var _0x5b2f58=_0xa561[_0xd1b293];return _0x5b2f58;};'use strict';var multer=require(_0x1a56('0x0'));var util=require(_0x1a56('0x1'));var path=require(_0x1a56('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a56('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1a56('0x4'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x1a56('0x5')]('/',auth[_0x1a56('0x6')](),controller[_0x1a56('0x7')]);router[_0x1a56('0x5')](_0x1a56('0x8'),auth[_0x1a56('0x6')](),controller[_0x1a56('0x9')]);router[_0x1a56('0x5')](_0x1a56('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x1a56('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1a56('0xa'),auth[_0x1a56('0x6')](),controller[_0x1a56('0xc')]);router[_0x1a56('0xd')](_0x1a56('0xa'),auth[_0x1a56('0x6')](),controller[_0x1a56('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 5ca36ce..bc71abe 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 _0xdd28=['STRING','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x4febae,_0x26b122){var _0x2f4594=function(_0x11953a){while(--_0x11953a){_0x4febae['push'](_0x4febae['shift']());}};_0x2f4594(++_0x26b122);}(_0xdd28,0xdc));var _0x8dd2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd28[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8dd2('0x0'));module[_0x8dd2('0x1')]={'name':{'type':Sequelize[_0x8dd2('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8dd2('0x3'),_0x8dd2('0x4')),'defaultValue':_0x8dd2('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8dd2('0x5')]}};
\ No newline at end of file
+var _0x6b4f=['mouseOver','timeout','sequelize','STRING'];(function(_0x17017e,_0x509679){var _0xbc7086=function(_0x30679d){while(--_0x30679d){_0x17017e['push'](_0x17017e['shift']());}};_0xbc7086(++_0x509679);}(_0x6b4f,0x14a));var _0xf6b4=function(_0x371571,_0x4e0ebf){_0x371571=_0x371571-0x0;var _0x1322a6=_0x6b4f[_0x371571];return _0x1322a6;};'use strict';var Sequelize=require(_0xf6b4('0x0'));module['exports']={'name':{'type':Sequelize[_0xf6b4('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf6b4('0x2'),_0xf6b4('0x3')),'defaultValue':_0xf6b4('0x2')},'selector':{'type':Sequelize[_0xf6b4('0x1')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index f4fff61..a49beee 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 _0xd13e=['fast-json-patch','moment','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','end','sendStatus','error','name','show','params','keys','ChatProactiveAction','query','filters','intersection','model','attributes','length','includeAll','include','options','find','catch','create','body','eml-format','rimraf','zip-dir'];(function(_0x3fd6f1,_0x869f96){var _0x35989e=function(_0x1ece21){while(--_0x1ece21){_0x3fd6f1['push'](_0x3fd6f1['shift']());}};_0x35989e(++_0x869f96);}(_0xd13e,0x193));var _0xed13=function(_0x29e67d,_0x40f68e){_0x29e67d=_0x29e67d-0x0;var _0x44cf76=_0xd13e[_0x29e67d];return _0x44cf76;};'use strict';var emlformat=require(_0xed13('0x0'));var rimraf=require(_0xed13('0x1'));var zipdir=require(_0xed13('0x2'));var jsonpatch=require(_0xed13('0x3'));var rp=require('request-promise');var moment=require(_0xed13('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed13('0x5'));var util=require('util');var path=require(_0xed13('0x6'));var sox=require(_0xed13('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed13('0x8'));var squel=require(_0xed13('0x9'));var crypto=require(_0xed13('0xa'));var jsforce=require(_0xed13('0xb'));var deskjs=require(_0xed13('0xc'));var toCsv=require(_0xed13('0xd'));var querystring=require(_0xed13('0xe'));var Papa=require(_0xed13('0xf'));var Redis=require(_0xed13('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xed13('0x11'));var as=require(_0xed13('0x12'));var hardwareService=require(_0xed13('0x13'));var logger=require(_0xed13('0x14'))(_0xed13('0x15'));var utils=require('../../config/utils');var config=require(_0xed13('0x16'));var licenseUtil=require(_0xed13('0x17'));var db=require(_0xed13('0x18'))['db'];function respondWithStatusCode(_0x3c0b22,_0x936103){_0x936103=_0x936103||0xcc;return function(_0x3295ba){if(_0x3295ba){return _0x3c0b22['sendStatus'](_0x936103);}return _0x3c0b22[_0xed13('0x19')](_0x936103)['end']();};}function respondWithResult(_0x257074,_0x56fdc6){_0x56fdc6=_0x56fdc6||0xc8;return function(_0x6e2978){if(_0x6e2978){return _0x257074['status'](_0x56fdc6)[_0xed13('0x1a')](_0x6e2978);}};}function respondWithFilteredResult(_0x4d5435,_0x38901a){return function(_0xf900d2){if(_0xf900d2){var _0x1d3d67=typeof _0x38901a[_0xed13('0x1b')]===_0xed13('0x1c')&&typeof _0x38901a[_0xed13('0x1d')]===_0xed13('0x1c');var _0x1148a3=_0xf900d2[_0xed13('0x1e')];var _0x1e161f=_0x1d3d67?0x0:_0x38901a[_0xed13('0x1b')];var _0x31de07=_0x1d3d67?_0xf900d2[_0xed13('0x1e')]:_0x38901a[_0xed13('0x1b')]+_0x38901a[_0xed13('0x1d')];var _0x2f38c9;if(_0x31de07>=_0x1148a3){_0x31de07=_0x1148a3;_0x2f38c9=0xc8;}else{_0x2f38c9=0xce;}_0x4d5435['status'](_0x2f38c9);return _0x4d5435['set'](_0xed13('0x1f'),_0x1e161f+'-'+_0x31de07+'/'+_0x1148a3)[_0xed13('0x1a')](_0xf900d2);}return null;};}function patchUpdates(_0x4f455b){return function(_0x40dd86){try{jsonpatch['apply'](_0x40dd86,_0x4f455b,!![]);}catch(_0x4e9e3b){return BPromise[_0xed13('0x20')](_0x4e9e3b);}return _0x40dd86[_0xed13('0x21')]();};}function saveUpdates(_0x2d62cd,_0x192d12){return function(_0x1d7621){if(_0x1d7621){return _0x1d7621[_0xed13('0x22')](_0x2d62cd)['then'](function(_0x5c0daf){return _0x5c0daf;});}return null;};}function removeEntity(_0x5d7ae1,_0x19d51b){return function(_0x3b1f23){if(_0x3b1f23){return _0x3b1f23[_0xed13('0x23')]()[_0xed13('0x24')](function(){_0x5d7ae1[_0xed13('0x19')](0xcc)[_0xed13('0x25')]();});}};}function handleEntityNotFound(_0x1f0405,_0x276c57){return function(_0x2410e2){if(!_0x2410e2){_0x1f0405[_0xed13('0x26')](0x194);}return _0x2410e2;};}function handleError(_0x1f064c,_0x3bc666){_0x3bc666=_0x3bc666||0x1f4;return function(_0x2c6c33){logger[_0xed13('0x27')](_0x2c6c33['stack']);if(_0x2c6c33['name']){delete _0x2c6c33[_0xed13('0x28')];}_0x1f064c[_0xed13('0x19')](_0x3bc666)['send'](_0x2c6c33);};}exports[_0xed13('0x29')]=function(_0x40444a,_0x4ed119){var _0x7ce996={'raw':!![],'where':{'id':_0x40444a[_0xed13('0x2a')]['id']}},_0x2066ca={};_0x2066ca['model']=_[_0xed13('0x2b')](db[_0xed13('0x2c')]['rawAttributes']);_0x2066ca[_0xed13('0x2d')]=_[_0xed13('0x2b')](_0x40444a['query']);_0x2066ca[_0xed13('0x2e')]=_[_0xed13('0x2f')](_0x2066ca[_0xed13('0x30')],_0x2066ca[_0xed13('0x2d')]);_0x7ce996[_0xed13('0x31')]=_[_0xed13('0x2f')](_0x2066ca[_0xed13('0x30')],qs['fields'](_0x40444a[_0xed13('0x2d')]['fields']));_0x7ce996['attributes']=_0x7ce996[_0xed13('0x31')][_0xed13('0x32')]?_0x7ce996[_0xed13('0x31')]:_0x2066ca['model'];if(_0x40444a[_0xed13('0x2d')][_0xed13('0x33')]){_0x7ce996[_0xed13('0x34')]=[{'all':!![]}];}_0x7ce996=_['merge']({},_0x7ce996,_0x40444a[_0xed13('0x35')]);return db[_0xed13('0x2c')][_0xed13('0x36')](_0x7ce996)[_0xed13('0x24')](handleEntityNotFound(_0x4ed119,null))['then'](respondWithResult(_0x4ed119,null))[_0xed13('0x37')](handleError(_0x4ed119,null));};exports[_0xed13('0x38')]=function(_0x2508b4,_0xed7343){return db[_0xed13('0x2c')][_0xed13('0x38')](_0x2508b4[_0xed13('0x39')],{})[_0xed13('0x24')](respondWithResult(_0xed7343,0xc9))[_0xed13('0x37')](handleError(_0xed7343,null));};exports[_0xed13('0x22')]=function(_0x5a09e4,_0x2342a5){if(_0x5a09e4[_0xed13('0x39')]['id']){delete _0x5a09e4['body']['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x5a09e4[_0xed13('0x2a')]['id']}})[_0xed13('0x24')](handleEntityNotFound(_0x2342a5,null))['then'](saveUpdates(_0x5a09e4['body'],null))[_0xed13('0x24')](respondWithResult(_0x2342a5,null))[_0xed13('0x37')](handleError(_0x2342a5,null));};exports[_0xed13('0x23')]=function(_0x32ec49,_0x358098){return db['ChatProactiveAction']['find']({'where':{'id':_0x32ec49[_0xed13('0x2a')]['id']}})['then'](handleEntityNotFound(_0x358098,null))[_0xed13('0x24')](removeEntity(_0x358098,null))['catch'](handleError(_0x358098,null));};
\ No newline at end of file
+var _0x6208=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','show','model','ChatProactiveAction','query','keys','filters','intersection','fields','attributes','merge','options','find','catch','create','body','params','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','count','status'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x6208,0x17d));var _0x8620=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x6208[_0x2555d0];return _0x3bb486;};'use strict';var emlformat=require(_0x8620('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8620('0x1'));var jsonpatch=require(_0x8620('0x2'));var rp=require('request-promise');var moment=require(_0x8620('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8620('0x4'));var util=require(_0x8620('0x5'));var path=require(_0x8620('0x6'));var sox=require(_0x8620('0x7'));var csv=require(_0x8620('0x8'));var ejs=require(_0x8620('0x9'));var fs=require('fs');var fs_extra=require(_0x8620('0xa'));var _=require('lodash');var squel=require(_0x8620('0xb'));var crypto=require(_0x8620('0xc'));var jsforce=require(_0x8620('0xd'));var deskjs=require(_0x8620('0xe'));var toCsv=require(_0x8620('0x8'));var querystring=require(_0x8620('0xf'));var Papa=require(_0x8620('0x10'));var Redis=require(_0x8620('0x11'));var authService=require(_0x8620('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8620('0x13'));var hardwareService=require(_0x8620('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x8620('0x15'));var config=require(_0x8620('0x16'));var licenseUtil=require(_0x8620('0x17'));var db=require(_0x8620('0x18'))['db'];function respondWithStatusCode(_0x3d7a76,_0x36abcb){_0x36abcb=_0x36abcb||0xcc;return function(_0x578636){if(_0x578636){return _0x3d7a76[_0x8620('0x19')](_0x36abcb);}return _0x3d7a76['status'](_0x36abcb)[_0x8620('0x1a')]();};}function respondWithResult(_0x2747b3,_0x2490bb){_0x2490bb=_0x2490bb||0xc8;return function(_0x1e6721){if(_0x1e6721){return _0x2747b3['status'](_0x2490bb)[_0x8620('0x1b')](_0x1e6721);}};}function respondWithFilteredResult(_0x41ea96,_0x5908c0){return function(_0x4ae1d1){if(_0x4ae1d1){var _0x213668=typeof _0x5908c0[_0x8620('0x1c')]==='undefined'&&typeof _0x5908c0[_0x8620('0x1d')]==='undefined';var _0x400d93=_0x4ae1d1[_0x8620('0x1e')];var _0x114e25=_0x213668?0x0:_0x5908c0[_0x8620('0x1c')];var _0x1e6295=_0x213668?_0x4ae1d1[_0x8620('0x1e')]:_0x5908c0[_0x8620('0x1c')]+_0x5908c0[_0x8620('0x1d')];var _0x2f6d60;if(_0x1e6295>=_0x400d93){_0x1e6295=_0x400d93;_0x2f6d60=0xc8;}else{_0x2f6d60=0xce;}_0x41ea96[_0x8620('0x1f')](_0x2f6d60);return _0x41ea96[_0x8620('0x20')](_0x8620('0x21'),_0x114e25+'-'+_0x1e6295+'/'+_0x400d93)[_0x8620('0x1b')](_0x4ae1d1);}return null;};}function patchUpdates(_0x7deddb){return function(_0x1ff783){try{jsonpatch[_0x8620('0x22')](_0x1ff783,_0x7deddb,!![]);}catch(_0x4443c1){return BPromise[_0x8620('0x23')](_0x4443c1);}return _0x1ff783[_0x8620('0x24')]();};}function saveUpdates(_0x88ef0f,_0x49334a){return function(_0xa63ba9){if(_0xa63ba9){return _0xa63ba9[_0x8620('0x25')](_0x88ef0f)[_0x8620('0x26')](function(_0x3fb864){return _0x3fb864;});}return null;};}function removeEntity(_0xca485e,_0x291e6b){return function(_0x28c3e1){if(_0x28c3e1){return _0x28c3e1[_0x8620('0x27')]()[_0x8620('0x26')](function(){_0xca485e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b9e92,_0x42a703){return function(_0x35ebda){if(!_0x35ebda){_0x5b9e92[_0x8620('0x19')](0x194);}return _0x35ebda;};}function handleError(_0x56cf13,_0x2d8cbd){_0x2d8cbd=_0x2d8cbd||0x1f4;return function(_0x2671fb){logger[_0x8620('0x28')](_0x2671fb[_0x8620('0x29')]);if(_0x2671fb[_0x8620('0x2a')]){delete _0x2671fb[_0x8620('0x2a')];}_0x56cf13[_0x8620('0x1f')](_0x2d8cbd)['send'](_0x2671fb);};}exports[_0x8620('0x2b')]=function(_0x524fc5,_0x9affe1){var _0x40e639={'raw':!![],'where':{'id':_0x524fc5['params']['id']}},_0x25e3c1={};_0x25e3c1[_0x8620('0x2c')]=_['keys'](db[_0x8620('0x2d')]['rawAttributes']);_0x25e3c1[_0x8620('0x2e')]=_[_0x8620('0x2f')](_0x524fc5[_0x8620('0x2e')]);_0x25e3c1[_0x8620('0x30')]=_[_0x8620('0x31')](_0x25e3c1[_0x8620('0x2c')],_0x25e3c1['query']);_0x40e639['attributes']=_['intersection'](_0x25e3c1['model'],qs[_0x8620('0x32')](_0x524fc5[_0x8620('0x2e')][_0x8620('0x32')]));_0x40e639['attributes']=_0x40e639['attributes']['length']?_0x40e639[_0x8620('0x33')]:_0x25e3c1['model'];if(_0x524fc5['query']['includeAll']){_0x40e639['include']=[{'all':!![]}];}_0x40e639=_[_0x8620('0x34')]({},_0x40e639,_0x524fc5[_0x8620('0x35')]);return db[_0x8620('0x2d')][_0x8620('0x36')](_0x40e639)[_0x8620('0x26')](handleEntityNotFound(_0x9affe1,null))[_0x8620('0x26')](respondWithResult(_0x9affe1,null))[_0x8620('0x37')](handleError(_0x9affe1,null));};exports[_0x8620('0x38')]=function(_0x124e18,_0x4c6c78){return db[_0x8620('0x2d')][_0x8620('0x38')](_0x124e18[_0x8620('0x39')],{})[_0x8620('0x26')](respondWithResult(_0x4c6c78,0xc9))['catch'](handleError(_0x4c6c78,null));};exports[_0x8620('0x25')]=function(_0x2cc394,_0x22a325){if(_0x2cc394[_0x8620('0x39')]['id']){delete _0x2cc394[_0x8620('0x39')]['id'];}return db[_0x8620('0x2d')][_0x8620('0x36')]({'where':{'id':_0x2cc394[_0x8620('0x3a')]['id']}})[_0x8620('0x26')](handleEntityNotFound(_0x22a325,null))[_0x8620('0x26')](saveUpdates(_0x2cc394[_0x8620('0x39')],null))[_0x8620('0x26')](respondWithResult(_0x22a325,null))[_0x8620('0x37')](handleError(_0x22a325,null));};exports[_0x8620('0x27')]=function(_0x5e5b5b,_0xf24da1){return db['ChatProactiveAction'][_0x8620('0x36')]({'where':{'id':_0x5e5b5b[_0x8620('0x3a')]['id']}})['then'](handleEntityNotFound(_0xf24da1,null))['then'](removeEntity(_0xf24da1,null))[_0x8620('0x37')](handleError(_0xf24da1,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 8c4df16..11722b9 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 _0xe2d3=['exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x1c06e3,_0x4b5c9e){var _0x5a8217=function(_0x239207){while(--_0x239207){_0x1c06e3['push'](_0x1c06e3['shift']());}};_0x5a8217(++_0x4b5c9e);}(_0xe2d3,0x1b1));var _0x3e2d=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xe2d3[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0x3e2d('0x0'));var util=require(_0x3e2d('0x1'));var logger=require(_0x3e2d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3e2d('0x3'));var rp=require(_0x3e2d('0x4'));var fs=require('fs');var path=require(_0x3e2d('0x5'));var rimraf=require(_0x3e2d('0x6'));var config=require(_0x3e2d('0x7'));var attributes=require(_0x3e2d('0x8'));module[_0x3e2d('0x9')]=function(_0x36e268,_0x4cacd2){return _0x36e268[_0x3e2d('0xa')](_0x3e2d('0xb'),attributes,{'tableName':_0x3e2d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x52ab=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2cd993,_0x26a4da){var _0x1f1cb1=function(_0x907326){while(--_0x907326){_0x2cd993['push'](_0x2cd993['shift']());}};_0x1f1cb1(++_0x26a4da);}(_0x52ab,0x87));var _0xb52a=function(_0xa2f497,_0x4d757d){_0xa2f497=_0xa2f497-0x0;var _0x202e66=_0x52ab[_0xa2f497];return _0x202e66;};'use strict';var _=require(_0xb52a('0x0'));var util=require(_0xb52a('0x1'));var logger=require(_0xb52a('0x2'))('api');var moment=require(_0xb52a('0x3'));var BPromise=require(_0xb52a('0x4'));var rp=require(_0xb52a('0x5'));var fs=require('fs');var path=require(_0xb52a('0x6'));var rimraf=require('rimraf');var config=require(_0xb52a('0x7'));var attributes=require(_0xb52a('0x8'));module[_0xb52a('0x9')]=function(_0x180d71,_0x539f67){return _0x180d71[_0xb52a('0xa')](_0xb52a('0xb'),attributes,{'tableName':_0xb52a('0xc'),'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 bc00321..5143041 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 _0x8e43=['ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x8e43,0x11d));var _0x38e4=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x8e43[_0xbd08b4];return _0x314f1e;};'use strict';var _=require('lodash');var util=require(_0x38e4('0x0'));var moment=require(_0x38e4('0x1'));var BPromise=require(_0x38e4('0x2'));var rs=require(_0x38e4('0x3'));var fs=require('fs');var Redis=require(_0x38e4('0x4'));var db=require(_0x38e4('0x5'))['db'];var utils=require(_0x38e4('0x6'));var logger=require(_0x38e4('0x7'))(_0x38e4('0x8'));var config=require(_0x38e4('0x9'));var jayson=require(_0x38e4('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36bf4d,_0x500e03,_0xd5ac79){return new BPromise(function(_0x5767e7,_0x4bdb69){return client[_0x38e4('0xb')](_0x36bf4d,_0xd5ac79)[_0x38e4('0xc')](function(_0x3ee87c){logger[_0x38e4('0xd')](_0x38e4('0xe'),_0x500e03,'request\x20sent');logger['debug'](_0x38e4('0xf'),_0x500e03,_0x38e4('0x10'),JSON[_0x38e4('0x11')](_0x3ee87c));if(_0x3ee87c[_0x38e4('0x12')]){if(_0x3ee87c[_0x38e4('0x12')][_0x38e4('0x13')]===0x1f4){logger[_0x38e4('0x12')](_0x38e4('0xe'),_0x500e03,_0x3ee87c[_0x38e4('0x12')][_0x38e4('0x14')]);return _0x4bdb69(_0x3ee87c['error'][_0x38e4('0x14')]);}logger[_0x38e4('0x12')](_0x38e4('0xe'),_0x500e03,_0x3ee87c[_0x38e4('0x12')][_0x38e4('0x14')]);return _0x5767e7(_0x3ee87c[_0x38e4('0x12')][_0x38e4('0x14')]);}else{logger[_0x38e4('0xd')](_0x38e4('0xe'),_0x500e03,_0x38e4('0x10'));_0x5767e7(_0x3ee87c[_0x38e4('0x15')][_0x38e4('0x14')]);}})[_0x38e4('0x16')](function(_0x29e415){logger['error'](_0x38e4('0xe'),_0x500e03,_0x29e415);_0x4bdb69(_0x29e415);});});}
\ No newline at end of file
+var _0x01d9=['http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4551d3,_0x56c2de){var _0xd53a7c=function(_0x4e74f4){while(--_0x4e74f4){_0x4551d3['push'](_0x4551d3['shift']());}};_0xd53a7c(++_0x56c2de);}(_0x01d9,0x84));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x901d('0x4'));var logger=require(_0x901d('0x5'))(_0x901d('0x6'));var config=require(_0x901d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x901d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbe68a6,_0x50c3c7,_0x779bf0){return new BPromise(function(_0x17e94d,_0xe8b37c){return client[_0x901d('0x9')](_0xbe68a6,_0x779bf0)['then'](function(_0x2545c3){logger[_0x901d('0xa')](_0x901d('0xb'),_0x50c3c7,_0x901d('0xc'));logger[_0x901d('0xd')](_0x901d('0xe'),_0x50c3c7,'request\x20sent',JSON['stringify'](_0x2545c3));if(_0x2545c3['error']){if(_0x2545c3[_0x901d('0xf')][_0x901d('0x10')]===0x1f4){logger['error'](_0x901d('0xb'),_0x50c3c7,_0x2545c3[_0x901d('0xf')][_0x901d('0x11')]);return _0xe8b37c(_0x2545c3[_0x901d('0xf')][_0x901d('0x11')]);}logger[_0x901d('0xf')](_0x901d('0xb'),_0x50c3c7,_0x2545c3[_0x901d('0xf')][_0x901d('0x11')]);return _0x17e94d(_0x2545c3[_0x901d('0xf')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x50c3c7,_0x901d('0xc'));_0x17e94d(_0x2545c3[_0x901d('0x12')][_0x901d('0x11')]);}})[_0x901d('0x13')](function(_0x112cb6){logger[_0x901d('0xf')](_0x901d('0xb'),_0x50c3c7,_0x112cb6);_0xe8b37c(_0x112cb6);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 10151cb..3363079 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 _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x6580a7,_0x5348e5){_0x6580a7=_0x6580a7-0x0;var _0x984e11=_0x8d0e[_0x6580a7];return _0x984e11;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe14b=['/:id','isAuthenticated','show','post','update','delete','exports','multer','util','express','Router','../../components/auth/service','./chatProactiveAction.controller','get'];(function(_0x2c63ac,_0x1df97a){var _0xdf3040=function(_0x4c8f63){while(--_0x4c8f63){_0x2c63ac['push'](_0x2c63ac['shift']());}};_0xdf3040(++_0x1df97a);}(_0xe14b,0x93));var _0xbe14=function(_0x211c77,_0x580dd5){_0x211c77=_0x211c77-0x0;var _0x18ff21=_0xe14b[_0x211c77];return _0x18ff21;};'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')](_0xbe14('0x7'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x9')]);router[_0xbe14('0xa')]('/',auth[_0xbe14('0x8')](),controller['create']);router['put']('/:id',auth[_0xbe14('0x8')](),controller[_0xbe14('0xb')]);router[_0xbe14('0xc')](_0xbe14('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xbe14('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 67ce0e4..ed2751b 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 _0xaf43=['exports','STRING','INTEGER','ENUM','beepall'];(function(_0x2c2db7,_0x7181d1){var _0x38ee39=function(_0xe89388){while(--_0xe89388){_0x2c2db7['push'](_0x2c2db7['shift']());}};_0x38ee39(++_0x7181d1);}(_0xaf43,0xaf));var _0x3af4=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xaf43[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require('sequelize');module[_0x3af4('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3af4('0x1')]},'timeout':{'type':Sequelize[_0x3af4('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3af4('0x3')]('rrmemory',_0x3af4('0x4'),'roundrobin')}};
\ No newline at end of file
+var _0x41ce=['rrmemory','beepall','roundrobin','sequelize','STRING','name'];(function(_0x44dbd0,_0x42b70b){var _0x55a151=function(_0x4911e1){while(--_0x4911e1){_0x44dbd0['push'](_0x44dbd0['shift']());}};_0x55a151(++_0x42b70b);}(_0x41ce,0x189));var _0xe41c=function(_0x15cc77,_0x266ca2){_0x15cc77=_0x15cc77-0x0;var _0x276650=_0x41ce[_0x15cc77];return _0x276650;};'use strict';var Sequelize=require(_0xe41c('0x0'));module['exports']={'name':{'type':Sequelize[_0xe41c('0x1')],'unique':_0xe41c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe41c('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe41c('0x3'),_0xe41c('0x4'),_0xe41c('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index ff54ecd..0d39e74 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 _0xf650=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','UserProfileResource','stack','name','send','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','map','VIRTUAL','merge','options','include','rows','show','params','includeAll','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserChatQueue','nolimit','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','compact','removeAgents','userChatQueue:remove','addAgents','spread','userChatQueue:save','isArray','getAgents','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x44121f,_0xd00d0){var _0x84fe7f=function(_0x36e2fb){while(--_0x36e2fb){_0x44121f['push'](_0x44121f['shift']());}};_0x84fe7f(++_0xd00d0);}(_0xf650,0x12b));var _0x0f65=function(_0x4e88f4,_0x36cb5a){_0x4e88f4=_0x4e88f4-0x0;var _0x2ea87b=_0xf650[_0x4e88f4];return _0x2ea87b;};'use strict';var emlformat=require(_0x0f65('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f65('0x1'));var jsonpatch=require(_0x0f65('0x2'));var rp=require(_0x0f65('0x3'));var moment=require(_0x0f65('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0f65('0x5'));var util=require(_0x0f65('0x6'));var path=require('path');var sox=require(_0x0f65('0x7'));var csv=require(_0x0f65('0x8'));var ejs=require(_0x0f65('0x9'));var fs=require('fs');var fs_extra=require(_0x0f65('0xa'));var _=require(_0x0f65('0xb'));var squel=require(_0x0f65('0xc'));var crypto=require(_0x0f65('0xd'));var jsforce=require(_0x0f65('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0f65('0x8'));var querystring=require(_0x0f65('0xf'));var Papa=require(_0x0f65('0x10'));var Redis=require(_0x0f65('0x11'));var authService=require(_0x0f65('0x12'));var qs=require(_0x0f65('0x13'));var as=require(_0x0f65('0x14'));var hardwareService=require(_0x0f65('0x15'));var logger=require(_0x0f65('0x16'))(_0x0f65('0x17'));var utils=require(_0x0f65('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0f65('0x19'))['db'];config[_0x0f65('0x1a')]=_[_0x0f65('0x1b')](config['redis'],{'host':_0x0f65('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f65('0x1a')]));require(_0x0f65('0x1d'))[_0x0f65('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0f65('0x1f')][_0x0f65('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1ea1e5,_0x4a1987,_0x45e551,_0xea4882){return new BPromise(function(_0x5e17e8,_0x2addc3){var _0x4852c4=_0xea4882||client;return _0x4852c4[_0x0f65('0x21')](_0x1ea1e5,_0x45e551)[_0x0f65('0x22')](function(_0x9003d7){logger['info'](_0x0f65('0x23'),_0x4a1987,_0x0f65('0x24'));logger[_0x0f65('0x25')](_0x0f65('0x26'),_0x4a1987,_0x0f65('0x24'),JSON[_0x0f65('0x27')](_0x9003d7));if(_0x9003d7[_0x0f65('0x28')]){if(_0x9003d7['error'][_0x0f65('0x29')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4a1987,_0x9003d7['error']['message']);return _0x2addc3(_0x9003d7[_0x0f65('0x28')][_0x0f65('0x2a')]);}logger[_0x0f65('0x28')](_0x0f65('0x23'),_0x4a1987,_0x9003d7[_0x0f65('0x28')][_0x0f65('0x2a')]);return _0x5e17e8(_0x9003d7[_0x0f65('0x28')][_0x0f65('0x2a')]);}else{logger['info'](_0x0f65('0x23'),_0x4a1987,'request\x20sent');_0x5e17e8(_0x9003d7[_0x0f65('0x2b')][_0x0f65('0x2a')]);}})['catch'](function(_0x2ebe31){logger[_0x0f65('0x28')](_0x0f65('0x23'),_0x4a1987,_0x2ebe31);_0x2addc3(_0x2ebe31);});});}function respondWithStatusCode(_0x58831f,_0xf3d984){_0xf3d984=_0xf3d984||0xcc;return function(_0x2d1857){if(_0x2d1857){return _0x58831f[_0x0f65('0x2c')](_0xf3d984);}return _0x58831f['status'](_0xf3d984)[_0x0f65('0x2d')]();};}function respondWithResult(_0x120a29,_0x5c6441){_0x5c6441=_0x5c6441||0xc8;return function(_0x3f139f){if(_0x3f139f){return _0x120a29[_0x0f65('0x2e')](_0x5c6441)[_0x0f65('0x2f')](_0x3f139f);}};}function respondWithFilteredResult(_0x4d8348,_0x325c02){return function(_0x5d67f0){if(_0x5d67f0){var _0x2e7a38=typeof _0x325c02[_0x0f65('0x30')]===_0x0f65('0x31')&&typeof _0x325c02[_0x0f65('0x32')]===_0x0f65('0x31');var _0x4f3ff2=_0x5d67f0[_0x0f65('0x33')];var _0x9cc4d9=_0x2e7a38?0x0:_0x325c02[_0x0f65('0x30')];var _0x2ed992=_0x2e7a38?_0x5d67f0[_0x0f65('0x33')]:_0x325c02['offset']+_0x325c02['limit'];var _0x5b01ba;if(_0x2ed992>=_0x4f3ff2){_0x2ed992=_0x4f3ff2;_0x5b01ba=0xc8;}else{_0x5b01ba=0xce;}_0x4d8348['status'](_0x5b01ba);return _0x4d8348[_0x0f65('0x34')](_0x0f65('0x35'),_0x9cc4d9+'-'+_0x2ed992+'/'+_0x4f3ff2)[_0x0f65('0x2f')](_0x5d67f0);}return null;};}function patchUpdates(_0x55c95a){return function(_0x4bf87e){try{jsonpatch[_0x0f65('0x36')](_0x4bf87e,_0x55c95a,!![]);}catch(_0x365217){return BPromise[_0x0f65('0x37')](_0x365217);}return _0x4bf87e['save']();};}function saveUpdates(_0x22dd04,_0x326ca4){return function(_0x5bb31d){if(_0x5bb31d){return _0x5bb31d['update'](_0x22dd04)[_0x0f65('0x22')](function(_0x526b92){return _0x526b92;});}return null;};}function removeEntity(_0x32addd,_0x41a79c){return function(_0x187ce3){if(_0x187ce3){return _0x187ce3[_0x0f65('0x38')]()['then'](function(){var _0x394446=_0x187ce3['get']({'plain':!![]});var _0x137608='ChatQueues';return db[_0x0f65('0x39')][_0x0f65('0x38')]({'where':{'type':_0x137608,'resourceId':_0x394446['id']}})['then'](function(){return _0x187ce3;});})[_0x0f65('0x22')](function(){_0x32addd[_0x0f65('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b2516,_0xde0681){return function(_0x3f5c44){if(!_0x3f5c44){_0x2b2516['sendStatus'](0x194);}return _0x3f5c44;};}function handleError(_0x41be2d,_0x223df6){_0x223df6=_0x223df6||0x1f4;return function(_0x6b126c){logger[_0x0f65('0x28')](_0x6b126c[_0x0f65('0x3a')]);if(_0x6b126c[_0x0f65('0x3b')]){delete _0x6b126c[_0x0f65('0x3b')];}_0x41be2d[_0x0f65('0x2e')](_0x223df6)[_0x0f65('0x3c')](_0x6b126c);};}exports['index']=function(_0x4579c6,_0x291d20){var _0x465a2b={},_0x16af94={},_0x3b7f17={'count':0x0,'rows':[]};var _0x4b6f85=_['map'](db[_0x0f65('0x3d')][_0x0f65('0x3e')],function(_0x501b44){return{'name':_0x501b44[_0x0f65('0x3f')],'type':_0x501b44[_0x0f65('0x40')][_0x0f65('0x41')]};});_0x16af94[_0x0f65('0x42')]=_['map'](_0x4b6f85,_0x0f65('0x3b'));_0x16af94[_0x0f65('0x43')]=_[_0x0f65('0x44')](_0x4579c6['query']);_0x16af94[_0x0f65('0x45')]=_[_0x0f65('0x46')](_0x16af94[_0x0f65('0x42')],_0x16af94['query']);_0x465a2b[_0x0f65('0x47')]=_['intersection'](_0x16af94[_0x0f65('0x42')],qs['fields'](_0x4579c6[_0x0f65('0x43')][_0x0f65('0x48')]));_0x465a2b[_0x0f65('0x47')]=_0x465a2b[_0x0f65('0x47')][_0x0f65('0x49')]?_0x465a2b[_0x0f65('0x47')]:_0x16af94[_0x0f65('0x42')];if(!_0x4579c6[_0x0f65('0x43')]['hasOwnProperty']('nolimit')){_0x465a2b[_0x0f65('0x32')]=qs[_0x0f65('0x32')](_0x4579c6[_0x0f65('0x43')][_0x0f65('0x32')]);_0x465a2b[_0x0f65('0x30')]=qs[_0x0f65('0x30')](_0x4579c6[_0x0f65('0x43')][_0x0f65('0x30')]);}_0x465a2b[_0x0f65('0x4a')]=qs['sort'](_0x4579c6['query'][_0x0f65('0x4b')]);_0x465a2b[_0x0f65('0x4c')]=qs[_0x0f65('0x45')](_[_0x0f65('0x4d')](_0x4579c6[_0x0f65('0x43')],_0x16af94['filters']),_0x4b6f85);if(_0x4579c6[_0x0f65('0x43')][_0x0f65('0x4e')]){_0x465a2b[_0x0f65('0x4c')]=_['merge'](_0x465a2b[_0x0f65('0x4c')],{'$or':_[_0x0f65('0x4f')](_0x4b6f85,function(_0x3a6a53){if(_0x3a6a53['type']!==_0x0f65('0x50')){var _0xfd3446={};_0xfd3446[_0x3a6a53['name']]={'$like':'%'+_0x4579c6[_0x0f65('0x43')][_0x0f65('0x4e')]+'%'};return _0xfd3446;}})});}_0x465a2b=_[_0x0f65('0x51')]({},_0x465a2b,_0x4579c6[_0x0f65('0x52')]);var _0x4a4aa3={'where':_0x465a2b[_0x0f65('0x4c')]};return db[_0x0f65('0x3d')][_0x0f65('0x33')](_0x4a4aa3)['then'](function(_0x20fa83){_0x3b7f17[_0x0f65('0x33')]=_0x20fa83;if(_0x4579c6[_0x0f65('0x43')]['includeAll']){_0x465a2b[_0x0f65('0x53')]=[{'all':!![]}];}return db[_0x0f65('0x3d')]['findAll'](_0x465a2b);})[_0x0f65('0x22')](function(_0x39802b){_0x3b7f17[_0x0f65('0x54')]=_0x39802b;return _0x3b7f17;})[_0x0f65('0x22')](respondWithFilteredResult(_0x291d20,_0x465a2b))['catch'](handleError(_0x291d20,null));};exports[_0x0f65('0x55')]=function(_0x5f21dc,_0x3426ed){var _0x3bd728={'raw':!![],'where':{'id':_0x5f21dc[_0x0f65('0x56')]['id']}},_0x49f8e9={};_0x49f8e9[_0x0f65('0x42')]=_['keys'](db['ChatQueue']['rawAttributes']);_0x49f8e9['query']=_['keys'](_0x5f21dc['query']);_0x49f8e9[_0x0f65('0x45')]=_[_0x0f65('0x46')](_0x49f8e9[_0x0f65('0x42')],_0x49f8e9['query']);_0x3bd728[_0x0f65('0x47')]=_[_0x0f65('0x46')](_0x49f8e9[_0x0f65('0x42')],qs[_0x0f65('0x48')](_0x5f21dc[_0x0f65('0x43')][_0x0f65('0x48')]));_0x3bd728['attributes']=_0x3bd728[_0x0f65('0x47')]['length']?_0x3bd728['attributes']:_0x49f8e9[_0x0f65('0x42')];if(_0x5f21dc['query'][_0x0f65('0x57')]){_0x3bd728[_0x0f65('0x53')]=[{'all':!![]}];}_0x3bd728=_[_0x0f65('0x51')]({},_0x3bd728,_0x5f21dc[_0x0f65('0x52')]);return db[_0x0f65('0x3d')][_0x0f65('0x58')](_0x3bd728)['then'](handleEntityNotFound(_0x3426ed,null))[_0x0f65('0x22')](respondWithResult(_0x3426ed,null))[_0x0f65('0x59')](handleError(_0x3426ed,null));};exports[_0x0f65('0x5a')]=function(_0x242657,_0xec7068){return db[_0x0f65('0x3d')][_0x0f65('0x5a')](_0x242657['body'],{})[_0x0f65('0x22')](function(_0x4feb67){var _0x594b85=_0x242657[_0x0f65('0x5b')][_0x0f65('0x5c')]({'plain':!![]});if(!_0x594b85)throw new Error(_0x0f65('0x5d'));if(_0x594b85[_0x0f65('0x5e')]===_0x0f65('0x5b')){var _0x80f563=_0x4feb67['get']({'plain':!![]});var _0x5e96c6=_0x0f65('0x5f');return db[_0x0f65('0x60')][_0x0f65('0x58')]({'where':{'name':_0x5e96c6,'userProfileId':_0x594b85[_0x0f65('0x61')]},'raw':!![]})[_0x0f65('0x22')](function(_0x38ebf0){if(_0x38ebf0&&_0x38ebf0[_0x0f65('0x62')]===0x0){return db[_0x0f65('0x39')]['create']({'name':_0x80f563[_0x0f65('0x3b')],'resourceId':_0x80f563['id'],'type':_0x38ebf0[_0x0f65('0x3b')],'sectionId':_0x38ebf0['id']},{})['then'](function(){return _0x4feb67;});}else{return _0x4feb67;}})['catch'](function(_0x4a0580){logger[_0x0f65('0x28')](_0x0f65('0x63'),_0x4a0580);throw _0x4a0580;});}return _0x4feb67;})[_0x0f65('0x22')](respondWithResult(_0xec7068,0xc9))[_0x0f65('0x59')](handleError(_0xec7068,null));};exports[_0x0f65('0x64')]=function(_0x2203ad,_0x592849){if(_0x2203ad[_0x0f65('0x65')]['id']){delete _0x2203ad[_0x0f65('0x65')]['id'];}return db[_0x0f65('0x3d')][_0x0f65('0x58')]({'where':{'id':_0x2203ad['params']['id']}})[_0x0f65('0x22')](handleEntityNotFound(_0x592849,null))[_0x0f65('0x22')](saveUpdates(_0x2203ad['body'],null))[_0x0f65('0x22')](respondWithResult(_0x592849,null))['catch'](handleError(_0x592849,null));};exports['destroy']=function(_0x1f2053,_0x218670){return db['ChatQueue']['find']({'where':{'id':_0x1f2053[_0x0f65('0x56')]['id']}})[_0x0f65('0x22')](handleEntityNotFound(_0x218670,null))[_0x0f65('0x22')](removeEntity(_0x218670,null))['catch'](handleError(_0x218670,null));};exports[_0x0f65('0x66')]=function(_0x22d240,_0xcb4105){return db[_0x0f65('0x3d')][_0x0f65('0x66')]()[_0x0f65('0x22')](respondWithResult(_0xcb4105,null))[_0x0f65('0x59')](handleError(_0xcb4105,null));};exports[_0x0f65('0x67')]=function(_0x3e01b5,_0x1733a2,_0x296624){var _0x491459={'raw':!![],'where':{}},_0x2371cf={},_0x3f4786;return db[_0x0f65('0x3d')][_0x0f65('0x68')]({'where':{'id':_0x3e01b5[_0x0f65('0x56')]['id']}})[_0x0f65('0x22')](handleEntityNotFound(_0x1733a2,null))[_0x0f65('0x22')](function(_0x2f46c2){if(_0x2f46c2){_0x3f4786=_0x2f46c2[_0x0f65('0x5c')]({'plain':!![]});_0x2371cf[_0x0f65('0x42')]=_[_0x0f65('0x44')](db[_0x0f65('0x69')][_0x0f65('0x3e')]);_0x2371cf[_0x0f65('0x43')]=_[_0x0f65('0x44')](_0x3e01b5[_0x0f65('0x43')]);_0x2371cf['filters']=_[_0x0f65('0x46')](_0x2371cf[_0x0f65('0x42')],_0x2371cf[_0x0f65('0x43')]);_0x491459['attributes']=_['intersection'](_0x2371cf[_0x0f65('0x42')],qs['fields'](_0x3e01b5[_0x0f65('0x43')][_0x0f65('0x48')]));_0x491459[_0x0f65('0x47')]=_0x491459[_0x0f65('0x47')][_0x0f65('0x49')]?_0x491459[_0x0f65('0x47')]:_0x2371cf['model'];if(!_0x3e01b5[_0x0f65('0x43')]['hasOwnProperty'](_0x0f65('0x6a'))){_0x491459['limit']=qs[_0x0f65('0x32')](_0x3e01b5[_0x0f65('0x43')][_0x0f65('0x32')]);_0x491459[_0x0f65('0x30')]=qs[_0x0f65('0x30')](_0x3e01b5[_0x0f65('0x43')][_0x0f65('0x30')]);}_0x491459[_0x0f65('0x4a')]=qs[_0x0f65('0x4b')](_0x3e01b5[_0x0f65('0x43')][_0x0f65('0x4b')]);_0x491459[_0x0f65('0x4c')]=qs[_0x0f65('0x45')](_['pick'](_0x3e01b5['query'],_0x2371cf['filters']));_0x491459[_0x0f65('0x4c')]['ChatQueueId']=_0x2f46c2['id'];if(_0x3e01b5['query'][_0x0f65('0x4e')]){_0x491459[_0x0f65('0x4c')]=_[_0x0f65('0x51')](_0x491459[_0x0f65('0x4c')],{'$or':_['map'](_0x491459[_0x0f65('0x47')],function(_0x542f74){var _0xc68098={};_0xc68098[_0x542f74]={'$like':'%'+_0x3e01b5[_0x0f65('0x43')][_0x0f65('0x4e')]+'%'};return _0xc68098;})});}_0x491459=_[_0x0f65('0x51')]({},_0x491459,_0x3e01b5[_0x0f65('0x52')]);return db[_0x0f65('0x69')][_0x0f65('0x6b')](_0x491459);}})[_0x0f65('0x22')](function(_0x4442d9){if(_0x4442d9){return db[_0x0f65('0x6c')][_0x0f65('0x6d')]({'where':{'id':_[_0x0f65('0x4f')](_0x4442d9,_0x0f65('0x6e')),'role':_0x0f65('0x6f')},'attributes':['id',_0x0f65('0x3b'),_0x0f65('0x70'),_0x0f65('0x71'),'createdAt']});}})['then'](function(_0x5b66db){if(_0x5b66db){return{'count':_0x5b66db['count'],'rows':_[_0x0f65('0x4f')](_0x5b66db[_0x0f65('0x54')],function(_0xfb82ce){return{'membername':_0xfb82ce[_0x0f65('0x3b')],'UserId':_0xfb82ce['id'],'queue_name':_0x3f4786['name'],'ChatQueueId':_0x3f4786['id'],'interface':util[_0x0f65('0x72')](_0x0f65('0x73'),_0x0f65('0x74'),_0xfb82ce[_0x0f65('0x3b')]),'penalty':0x0,'paused':_0xfb82ce[_0x0f65('0x70')],'createdAt':_0xfb82ce[_0x0f65('0x75')],'updatedAt':_0xfb82ce[_0x0f65('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0f65('0x22')](respondWithFilteredResult(_0x1733a2,_0x491459))[_0x0f65('0x59')](handleError(_0x1733a2,null));};exports[_0x0f65('0x76')]=function(_0x255116,_0xf0b588,_0x36f34b){var _0x41fc60={};var _0x1da4b3={};var _0xef3abe;var _0x27598d;return db['ChatQueue'][_0x0f65('0x68')]({'where':{'id':_0x255116['params']['id']}})[_0x0f65('0x22')](handleEntityNotFound(_0xf0b588,null))['then'](function(_0x59f637){if(_0x59f637){_0xef3abe=_0x59f637;_0x1da4b3[_0x0f65('0x42')]=_[_0x0f65('0x44')](db[_0x0f65('0x77')]['rawAttributes']);_0x1da4b3[_0x0f65('0x43')]=_[_0x0f65('0x44')](_0x255116[_0x0f65('0x43')]);_0x1da4b3[_0x0f65('0x45')]=_[_0x0f65('0x46')](_0x1da4b3['model'],_0x1da4b3[_0x0f65('0x43')]);_0x41fc60[_0x0f65('0x47')]=_[_0x0f65('0x46')](_0x1da4b3[_0x0f65('0x42')],qs[_0x0f65('0x48')](_0x255116[_0x0f65('0x43')][_0x0f65('0x48')]));_0x41fc60[_0x0f65('0x47')]=_0x41fc60[_0x0f65('0x47')]['length']?_0x41fc60[_0x0f65('0x47')]:_0x1da4b3['model'];_0x41fc60[_0x0f65('0x4a')]=qs[_0x0f65('0x4b')](_0x255116[_0x0f65('0x43')][_0x0f65('0x4b')]);_0x41fc60['where']=qs[_0x0f65('0x45')](_[_0x0f65('0x4d')](_0x255116[_0x0f65('0x43')],_0x1da4b3[_0x0f65('0x45')]));if(_0x255116['query'][_0x0f65('0x4e')]){_0x41fc60[_0x0f65('0x4c')]=_['merge'](_0x41fc60[_0x0f65('0x4c')],{'$or':_[_0x0f65('0x4f')](_0x41fc60[_0x0f65('0x47')],function(_0x4f8d23){var _0x425713={};_0x425713[_0x4f8d23]={'$like':'%'+_0x255116[_0x0f65('0x43')]['filter']+'%'};return _0x425713;})});}_0x41fc60=_[_0x0f65('0x51')]({},_0x41fc60,_0x255116['options']);return _0xef3abe[_0x0f65('0x76')](_0x41fc60);}})[_0x0f65('0x22')](function(_0xf2f894){if(_0xf2f894){_0x27598d=_0xf2f894['length'];if(!_0x255116[_0x0f65('0x43')]['hasOwnProperty']('nolimit')){_0x41fc60[_0x0f65('0x32')]=qs[_0x0f65('0x32')](_0x255116[_0x0f65('0x43')][_0x0f65('0x32')]);_0x41fc60[_0x0f65('0x30')]=qs['offset'](_0x255116[_0x0f65('0x43')][_0x0f65('0x30')]);}return _0xef3abe[_0x0f65('0x76')](_0x41fc60);}})[_0x0f65('0x22')](function(_0x2d1349){if(_0x2d1349){return _0x2d1349?{'count':_0x27598d,'rows':_0x2d1349}:null;}})['then'](respondWithResult(_0xf0b588,null))[_0x0f65('0x59')](handleError(_0xf0b588,null));};exports[_0x0f65('0x78')]=function(_0x51e964,_0x15b351,_0x38f71e){var _0x19e229=_0x51e964['body'][_0x0f65('0x79')];return db[_0x0f65('0x77')][_0x0f65('0x6b')]({'where':{'id':_0x19e229},'attributes':['id'],'include':[{'model':db[_0x0f65('0x6c')],'as':'Agents','attributes':['id',_0x0f65('0x3b'),'online','voicePause','interface'],'raw':!![]}]})[_0x0f65('0x22')](function(_0x446192){if(_0x446192){var _0x59a57a=_[_0x0f65('0x7a')](_0x446192,function(_0x222b20){var _0x292f1c=_0x222b20[_0x0f65('0x5c')]({'plain':!![]});return _0x292f1c[_0x0f65('0x7b')];});return db[_0x0f65('0x3d')][_0x0f65('0x58')]({'where':{'id':_0x51e964[_0x0f65('0x56')]['id']}})['then'](function(_0x422965){return db[_0x0f65('0x7c')][_0x0f65('0x7d')](function(_0x3e8f95){return _0x422965['addTeams'](_0x19e229,{'transaction':_0x3e8f95})['then'](function(){return BPromise[_0x0f65('0x7e')](_0x59a57a,function(_0x4abc9b){return db[_0x0f65('0x69')][_0x0f65('0x7f')]({'where':{'UserId':_0x4abc9b['id'],'ChatQueueId':_0x51e964['params']['id']},'transaction':_0x3e8f95});});})['then'](function(){_0x59a57a[_0x0f65('0x80')](function(_0x11685e){socket[_0x0f65('0x81')]('userChatQueue:save',{'UserId':_0x11685e['id'],'ChatQueueId':_0x422965['id']});});});});});}})[_0x0f65('0x22')](respondWithStatusCode(_0x15b351,null))[_0x0f65('0x59')](handleError(_0x15b351,null));};exports[_0x0f65('0x82')]=function(_0x37e056,_0x235912,_0x58867f){return db[_0x0f65('0x77')][_0x0f65('0x6b')]({'where':{'id':_0x37e056[_0x0f65('0x43')][_0x0f65('0x79')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0f65('0x7b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x235912,null))[_0x0f65('0x22')](function(_0x9119c5){var _0x225c29=_[_0x0f65('0x4f')](_0x9119c5,'id');var _0x5cee0b=[];var _0x5eaef3=[];var _0x40f4c1=squel[_0x0f65('0x83')]();_0x40f4c1['field'](_0x0f65('0x84'))['from'](_0x0f65('0x85'),'tq')['join'](_0x0f65('0x86'),'ut',_0x0f65('0x87'))[_0x0f65('0x4c')](_0x0f65('0x88'),_0x37e056[_0x0f65('0x56')]['id']);for(var _0x562961=0x0;_0x562961<_0x9119c5[_0x0f65('0x49')];_0x562961+=0x1){let _0x53c52d=_0x9119c5[_0x562961];for(var _0x45d0f9=0x0;_0x45d0f9<_0x53c52d[_0x0f65('0x7b')]['length'];_0x45d0f9+=0x1){let _0x1ca203=_0x53c52d[_0x0f65('0x7b')][_0x45d0f9];var _0x5d941d=_0x40f4c1[_0x0f65('0x89')]();_0x5d941d[_0x0f65('0x4c')](_0x0f65('0x8a'),_0x1ca203['id']);_0x5eaef3[_0x0f65('0x8b')](db[_0x0f65('0x7c')][_0x0f65('0x43')](_0x5d941d['toString'](),{'type':db[_0x0f65('0x7c')][_0x0f65('0x8c')][_0x0f65('0x8d')]})[_0x0f65('0x22')](function(_0x20b214){if(_0x20b214[_0x0f65('0x49')]===0x1){return _0x1ca203['id'];}else{var _0x4a0cd9=_[_0x0f65('0x8e')](_[_0x0f65('0x4f')](_0x20b214,_0x0f65('0x8f')),function(_0xd61aa5){return _[_0x0f65('0x90')](_0x225c29,_0xd61aa5);});if(_0x4a0cd9){return _0x1ca203['id'];}}}));}}return BPromise[_0x0f65('0x91')](_0x5eaef3)[_0x0f65('0x22')](function(_0x164e2d){_0x5cee0b=_(_0x5cee0b)['union'](_0x164e2d)[_0x0f65('0x92')]()['value']();return db['ChatQueue'][_0x0f65('0x58')]({'where':{'id':_0x37e056[_0x0f65('0x56')]['id']}})['then'](function(_0x3ba48f){return db[_0x0f65('0x7c')][_0x0f65('0x7d')](function(_0x25be46){return _0x3ba48f[_0x0f65('0x82')](_0x37e056['query']['ids'],{'transaction':_0x25be46})[_0x0f65('0x22')](function(){if(!_['isEmpty'](_0x5cee0b)){return _0x3ba48f[_0x0f65('0x93')](_0x5cee0b,{'transaction':_0x25be46});}})['then'](function(){_0x5cee0b[_0x0f65('0x80')](function(_0x2b9b4d){socket[_0x0f65('0x81')](_0x0f65('0x94'),{'UserId':_0x2b9b4d,'ChatQueueId':_0x3ba48f['id']});});});});});});})['then'](respondWithStatusCode(_0x235912,null))['catch'](handleError(_0x235912,null));};exports[_0x0f65('0x95')]=function(_0xbb57ad,_0x2d2fa6,_0x1cd0ee){return db[_0x0f65('0x3d')]['find']({'where':{'id':_0xbb57ad[_0x0f65('0x56')]['id']}})[_0x0f65('0x22')](handleEntityNotFound(_0x2d2fa6,null))[_0x0f65('0x22')](function(_0xe2e934){if(_0xe2e934){return _0xe2e934[_0x0f65('0x95')](_0xbb57ad['body'][_0x0f65('0x79')],_['omit'](_0xbb57ad[_0x0f65('0x65')],[_0x0f65('0x79'),'id'])||{})[_0x0f65('0x96')](function(_0x56f35a){for(var _0x4f6191=0x0;_0x4f6191<_0xbb57ad['body'][_0x0f65('0x79')]['length'];_0x4f6191+=0x1){socket[_0x0f65('0x81')](_0x0f65('0x97'),{'UserId':Number(_0xbb57ad['body'][_0x0f65('0x79')][_0x4f6191]),'ChatQueueId':Number(_0xbb57ad[_0x0f65('0x56')]['id'])});}return _0x56f35a;});}})['then'](respondWithResult(_0x2d2fa6,null))['catch'](handleError(_0x2d2fa6,null));};exports['removeAgents']=function(_0x407438,_0x1358bb,_0x38fbb9){return db[_0x0f65('0x3d')][_0x0f65('0x58')]({'where':{'id':_0x407438[_0x0f65('0x56')]['id']}})[_0x0f65('0x22')](handleEntityNotFound(_0x1358bb,null))['then'](function(_0x29bf85){if(_0x29bf85){return _0x29bf85[_0x0f65('0x93')](_0x407438[_0x0f65('0x43')]['ids'])[_0x0f65('0x22')](function(){if(_[_0x0f65('0x98')](_0x407438[_0x0f65('0x43')]['ids'])){for(var _0xd7f856=0x0;_0xd7f856<_0x407438[_0x0f65('0x43')]['ids']['length'];_0xd7f856+=0x1){socket[_0x0f65('0x81')]('userChatQueue:remove',{'UserId':Number(_0x407438[_0x0f65('0x43')][_0x0f65('0x79')][_0xd7f856]),'ChatQueueId':Number(_0x407438[_0x0f65('0x56')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x407438['query'][_0x0f65('0x79')]),'ChatQueueId':Number(_0x407438['params']['id'])});}});}})[_0x0f65('0x22')](respondWithStatusCode(_0x1358bb,null))[_0x0f65('0x59')](handleError(_0x1358bb,null));};exports[_0x0f65('0x99')]=function(_0x34a5d6,_0x39847d,_0x43559c){var _0x6a1f22={};var _0x133a71={};var _0x2898bc;var _0x5de31c;return db[_0x0f65('0x3d')][_0x0f65('0x68')]({'where':{'id':_0x34a5d6[_0x0f65('0x56')]['id']}})['then'](handleEntityNotFound(_0x39847d,null))['then'](function(_0x5ea9e1){if(_0x5ea9e1){_0x2898bc=_0x5ea9e1;_0x133a71[_0x0f65('0x42')]=_[_0x0f65('0x44')](db[_0x0f65('0x6c')][_0x0f65('0x3e')]);_0x133a71[_0x0f65('0x43')]=_[_0x0f65('0x44')](_0x34a5d6['query']);_0x133a71[_0x0f65('0x45')]=_[_0x0f65('0x46')](_0x133a71[_0x0f65('0x42')],_0x133a71[_0x0f65('0x43')]);_0x6a1f22['attributes']=_[_0x0f65('0x46')](_0x133a71['model'],qs[_0x0f65('0x48')](_0x34a5d6['query']['fields']));_0x6a1f22[_0x0f65('0x47')]=_0x6a1f22[_0x0f65('0x47')][_0x0f65('0x49')]?_0x6a1f22[_0x0f65('0x47')]:_0x133a71[_0x0f65('0x42')];_0x6a1f22[_0x0f65('0x4a')]=qs[_0x0f65('0x4b')](_0x34a5d6['query']['sort']);_0x6a1f22[_0x0f65('0x4c')]=qs[_0x0f65('0x45')](_['pick'](_0x34a5d6['query'],_0x133a71[_0x0f65('0x45')]));if(_0x34a5d6[_0x0f65('0x43')][_0x0f65('0x4e')]){_0x6a1f22[_0x0f65('0x4c')]=_[_0x0f65('0x51')](_0x6a1f22[_0x0f65('0x4c')],{'$or':_[_0x0f65('0x4f')](_0x6a1f22['attributes'],function(_0x3810f2){var _0xa09e42={};_0xa09e42[_0x3810f2]={'$like':'%'+_0x34a5d6[_0x0f65('0x43')][_0x0f65('0x4e')]+'%'};return _0xa09e42;})});}_0x6a1f22=_[_0x0f65('0x51')]({},_0x6a1f22,_0x34a5d6['options']);return _0x2898bc[_0x0f65('0x99')](_0x6a1f22);}})[_0x0f65('0x22')](function(_0x1ba175){if(_0x1ba175){_0x5de31c=_0x1ba175[_0x0f65('0x49')];if(!_0x34a5d6[_0x0f65('0x43')][_0x0f65('0x9a')](_0x0f65('0x6a'))){_0x6a1f22[_0x0f65('0x32')]=qs['limit'](_0x34a5d6[_0x0f65('0x43')][_0x0f65('0x32')]);_0x6a1f22['offset']=qs['offset'](_0x34a5d6[_0x0f65('0x43')][_0x0f65('0x30')]);}return _0x2898bc[_0x0f65('0x99')](_0x6a1f22);}})[_0x0f65('0x22')](function(_0x19d67e){if(_0x19d67e){return _0x19d67e?{'count':_0x5de31c,'rows':_0x19d67e}:null;}})['then'](respondWithResult(_0x39847d,null))['catch'](handleError(_0x39847d,null));};
\ No newline at end of file
+var _0x1a21=['zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','show','fields','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','agent','updatedAt','createdAt','%s/%s','SIP','chatPause','getTeams','Team','addTeams','ids','User','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','value','sequelize','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf'];(function(_0x1e79a0,_0x336c84){var _0x2805da=function(_0x4e1397){while(--_0x4e1397){_0x1e79a0['push'](_0x1e79a0['shift']());}};_0x2805da(++_0x336c84);}(_0x1a21,0x1bd));var _0x11a2=function(_0x1d30a3,_0x5f428c){_0x1d30a3=_0x1d30a3-0x0;var _0x32bba1=_0x1a21[_0x1d30a3];return _0x32bba1;};'use strict';var emlformat=require(_0x11a2('0x0'));var rimraf=require(_0x11a2('0x1'));var zipdir=require(_0x11a2('0x2'));var jsonpatch=require(_0x11a2('0x3'));var rp=require(_0x11a2('0x4'));var moment=require(_0x11a2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x11a2('0x6'));var util=require('util');var path=require(_0x11a2('0x7'));var sox=require(_0x11a2('0x8'));var csv=require(_0x11a2('0x9'));var ejs=require(_0x11a2('0xa'));var fs=require('fs');var fs_extra=require(_0x11a2('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x11a2('0xc'));var deskjs=require(_0x11a2('0xd'));var toCsv=require(_0x11a2('0x9'));var querystring=require('querystring');var Papa=require(_0x11a2('0xe'));var Redis=require(_0x11a2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x11a2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x11a2('0x11'));var logger=require(_0x11a2('0x12'))(_0x11a2('0x13'));var utils=require(_0x11a2('0x14'));var config=require(_0x11a2('0x15'));var licenseUtil=require(_0x11a2('0x16'));var db=require('../../mysqldb')['db'];config[_0x11a2('0x17')]=_[_0x11a2('0x18')](config[_0x11a2('0x17')],{'host':_0x11a2('0x19'),'port':0x18eb});var socket=require(_0x11a2('0x1a'))(new Redis(config[_0x11a2('0x17')]));require(_0x11a2('0x1b'))[_0x11a2('0x1c')](socket);var jayson=require(_0x11a2('0x1d'));var client=jayson[_0x11a2('0x1e')][_0x11a2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x33b592,_0x65dac5,_0x146774,_0x3c9588){return new BPromise(function(_0xde182b,_0x5575c4){var _0x2731cc=_0x3c9588||client;return _0x2731cc[_0x11a2('0x20')](_0x33b592,_0x146774)[_0x11a2('0x21')](function(_0x28b934){logger['info'](_0x11a2('0x22'),_0x65dac5,_0x11a2('0x23'));logger[_0x11a2('0x24')](_0x11a2('0x25'),_0x65dac5,_0x11a2('0x23'),JSON[_0x11a2('0x26')](_0x28b934));if(_0x28b934[_0x11a2('0x27')]){if(_0x28b934['error'][_0x11a2('0x28')]===0x1f4){logger['error'](_0x11a2('0x22'),_0x65dac5,_0x28b934['error']['message']);return _0x5575c4(_0x28b934['error'][_0x11a2('0x29')]);}logger[_0x11a2('0x27')](_0x11a2('0x22'),_0x65dac5,_0x28b934[_0x11a2('0x27')][_0x11a2('0x29')]);return _0xde182b(_0x28b934[_0x11a2('0x27')][_0x11a2('0x29')]);}else{logger[_0x11a2('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x65dac5,_0x11a2('0x23'));_0xde182b(_0x28b934[_0x11a2('0x2b')][_0x11a2('0x29')]);}})[_0x11a2('0x2c')](function(_0x57b73c){logger[_0x11a2('0x27')](_0x11a2('0x22'),_0x65dac5,_0x57b73c);_0x5575c4(_0x57b73c);});});}function respondWithStatusCode(_0x1edf0c,_0x4906a5){_0x4906a5=_0x4906a5||0xcc;return function(_0x18dfb3){if(_0x18dfb3){return _0x1edf0c[_0x11a2('0x2d')](_0x4906a5);}return _0x1edf0c[_0x11a2('0x2e')](_0x4906a5)[_0x11a2('0x2f')]();};}function respondWithResult(_0x1c4703,_0x2b4537){_0x2b4537=_0x2b4537||0xc8;return function(_0x52d537){if(_0x52d537){return _0x1c4703[_0x11a2('0x2e')](_0x2b4537)[_0x11a2('0x30')](_0x52d537);}};}function respondWithFilteredResult(_0x6db9ca,_0xa8b874){return function(_0x5a0f0f){if(_0x5a0f0f){var _0x1c35ab=typeof _0xa8b874['offset']===_0x11a2('0x31')&&typeof _0xa8b874[_0x11a2('0x32')]===_0x11a2('0x31');var _0x2b6a8a=_0x5a0f0f[_0x11a2('0x33')];var _0x44d561=_0x1c35ab?0x0:_0xa8b874[_0x11a2('0x34')];var _0x59e8f1=_0x1c35ab?_0x5a0f0f[_0x11a2('0x33')]:_0xa8b874[_0x11a2('0x34')]+_0xa8b874['limit'];var _0x4712ad;if(_0x59e8f1>=_0x2b6a8a){_0x59e8f1=_0x2b6a8a;_0x4712ad=0xc8;}else{_0x4712ad=0xce;}_0x6db9ca[_0x11a2('0x2e')](_0x4712ad);return _0x6db9ca[_0x11a2('0x35')](_0x11a2('0x36'),_0x44d561+'-'+_0x59e8f1+'/'+_0x2b6a8a)['json'](_0x5a0f0f);}return null;};}function patchUpdates(_0x54b60e){return function(_0x543d8e){try{jsonpatch[_0x11a2('0x37')](_0x543d8e,_0x54b60e,!![]);}catch(_0x433139){return BPromise[_0x11a2('0x38')](_0x433139);}return _0x543d8e[_0x11a2('0x39')]();};}function saveUpdates(_0x1ffb8c,_0x50c411){return function(_0x4ffac0){if(_0x4ffac0){return _0x4ffac0[_0x11a2('0x3a')](_0x1ffb8c)[_0x11a2('0x21')](function(_0x457e32){return _0x457e32;});}return null;};}function removeEntity(_0x2e15e9,_0x1ad4fb){return function(_0x39b544){if(_0x39b544){return _0x39b544[_0x11a2('0x3b')]()[_0x11a2('0x21')](function(){var _0x1f273d=_0x39b544[_0x11a2('0x3c')]({'plain':!![]});var _0x29c8fe=_0x11a2('0x3d');return db[_0x11a2('0x3e')][_0x11a2('0x3b')]({'where':{'type':_0x29c8fe,'resourceId':_0x1f273d['id']}})[_0x11a2('0x21')](function(){return _0x39b544;});})[_0x11a2('0x21')](function(){_0x2e15e9[_0x11a2('0x2e')](0xcc)[_0x11a2('0x2f')]();});}};}function handleEntityNotFound(_0x427e51,_0x147775){return function(_0x3d376f){if(!_0x3d376f){_0x427e51[_0x11a2('0x2d')](0x194);}return _0x3d376f;};}function handleError(_0x372fe8,_0x41653){_0x41653=_0x41653||0x1f4;return function(_0x2af8a9){logger[_0x11a2('0x27')](_0x2af8a9[_0x11a2('0x3f')]);if(_0x2af8a9[_0x11a2('0x40')]){delete _0x2af8a9['name'];}_0x372fe8[_0x11a2('0x2e')](_0x41653)[_0x11a2('0x41')](_0x2af8a9);};}exports['index']=function(_0x52748c,_0x444cad){var _0xb1fda1={},_0x26e380={},_0x6a1bd7={'count':0x0,'rows':[]};var _0x3d0a5d=_[_0x11a2('0x42')](db[_0x11a2('0x43')][_0x11a2('0x44')],function(_0x3af557){return{'name':_0x3af557[_0x11a2('0x45')],'type':_0x3af557[_0x11a2('0x46')][_0x11a2('0x47')]};});_0x26e380[_0x11a2('0x48')]=_[_0x11a2('0x42')](_0x3d0a5d,_0x11a2('0x40'));_0x26e380['query']=_[_0x11a2('0x49')](_0x52748c[_0x11a2('0x4a')]);_0x26e380[_0x11a2('0x4b')]=_[_0x11a2('0x4c')](_0x26e380[_0x11a2('0x48')],_0x26e380[_0x11a2('0x4a')]);_0xb1fda1[_0x11a2('0x4d')]=_[_0x11a2('0x4c')](_0x26e380['model'],qs['fields'](_0x52748c[_0x11a2('0x4a')]['fields']));_0xb1fda1[_0x11a2('0x4d')]=_0xb1fda1[_0x11a2('0x4d')][_0x11a2('0x4e')]?_0xb1fda1[_0x11a2('0x4d')]:_0x26e380[_0x11a2('0x48')];if(!_0x52748c[_0x11a2('0x4a')][_0x11a2('0x4f')](_0x11a2('0x50'))){_0xb1fda1['limit']=qs['limit'](_0x52748c[_0x11a2('0x4a')]['limit']);_0xb1fda1[_0x11a2('0x34')]=qs[_0x11a2('0x34')](_0x52748c[_0x11a2('0x4a')][_0x11a2('0x34')]);}_0xb1fda1['order']=qs[_0x11a2('0x51')](_0x52748c[_0x11a2('0x4a')][_0x11a2('0x51')]);_0xb1fda1['where']=qs[_0x11a2('0x4b')](_[_0x11a2('0x52')](_0x52748c[_0x11a2('0x4a')],_0x26e380[_0x11a2('0x4b')]),_0x3d0a5d);if(_0x52748c['query'][_0x11a2('0x53')]){_0xb1fda1[_0x11a2('0x54')]=_[_0x11a2('0x55')](_0xb1fda1[_0x11a2('0x54')],{'$or':_[_0x11a2('0x42')](_0x3d0a5d,function(_0x78aa0f){if(_0x78aa0f[_0x11a2('0x46')]!=='VIRTUAL'){var _0x2cd18f={};_0x2cd18f[_0x78aa0f['name']]={'$like':'%'+_0x52748c[_0x11a2('0x4a')][_0x11a2('0x53')]+'%'};return _0x2cd18f;}})});}_0xb1fda1=_[_0x11a2('0x55')]({},_0xb1fda1,_0x52748c[_0x11a2('0x56')]);var _0x7e692b={'where':_0xb1fda1['where']};return db[_0x11a2('0x43')]['count'](_0x7e692b)[_0x11a2('0x21')](function(_0x369da5){_0x6a1bd7[_0x11a2('0x33')]=_0x369da5;if(_0x52748c[_0x11a2('0x4a')]['includeAll']){_0xb1fda1[_0x11a2('0x57')]=[{'all':!![]}];}return db['ChatQueue'][_0x11a2('0x58')](_0xb1fda1);})[_0x11a2('0x21')](function(_0x372825){_0x6a1bd7[_0x11a2('0x59')]=_0x372825;return _0x6a1bd7;})[_0x11a2('0x21')](respondWithFilteredResult(_0x444cad,_0xb1fda1))[_0x11a2('0x2c')](handleError(_0x444cad,null));};exports[_0x11a2('0x5a')]=function(_0x330410,_0x4670ee){var _0x51f375={'raw':!![],'where':{'id':_0x330410['params']['id']}},_0x697a0f={};_0x697a0f[_0x11a2('0x48')]=_[_0x11a2('0x49')](db[_0x11a2('0x43')][_0x11a2('0x44')]);_0x697a0f[_0x11a2('0x4a')]=_[_0x11a2('0x49')](_0x330410[_0x11a2('0x4a')]);_0x697a0f[_0x11a2('0x4b')]=_[_0x11a2('0x4c')](_0x697a0f[_0x11a2('0x48')],_0x697a0f[_0x11a2('0x4a')]);_0x51f375[_0x11a2('0x4d')]=_[_0x11a2('0x4c')](_0x697a0f[_0x11a2('0x48')],qs[_0x11a2('0x5b')](_0x330410[_0x11a2('0x4a')]['fields']));_0x51f375[_0x11a2('0x4d')]=_0x51f375['attributes'][_0x11a2('0x4e')]?_0x51f375[_0x11a2('0x4d')]:_0x697a0f[_0x11a2('0x48')];if(_0x330410[_0x11a2('0x4a')][_0x11a2('0x5c')]){_0x51f375[_0x11a2('0x57')]=[{'all':!![]}];}_0x51f375=_['merge']({},_0x51f375,_0x330410[_0x11a2('0x56')]);return db[_0x11a2('0x43')][_0x11a2('0x5d')](_0x51f375)[_0x11a2('0x21')](handleEntityNotFound(_0x4670ee,null))[_0x11a2('0x21')](respondWithResult(_0x4670ee,null))['catch'](handleError(_0x4670ee,null));};exports[_0x11a2('0x5e')]=function(_0x4afec4,_0x113f9c){return db['ChatQueue'][_0x11a2('0x5e')](_0x4afec4[_0x11a2('0x5f')],{})[_0x11a2('0x21')](function(_0x3e6156){var _0x3ecd78=_0x4afec4[_0x11a2('0x60')][_0x11a2('0x3c')]({'plain':!![]});if(!_0x3ecd78)throw new Error(_0x11a2('0x61'));if(_0x3ecd78['role']==='user'){var _0x4a5e64=_0x3e6156[_0x11a2('0x3c')]({'plain':!![]});var _0x3a8eec='ChatQueues';return db['UserProfileSection'][_0x11a2('0x5d')]({'where':{'name':_0x3a8eec,'userProfileId':_0x3ecd78['userProfileId']},'raw':!![]})[_0x11a2('0x21')](function(_0x109838){if(_0x109838&&_0x109838[_0x11a2('0x62')]===0x0){return db[_0x11a2('0x3e')][_0x11a2('0x5e')]({'name':_0x4a5e64['name'],'resourceId':_0x4a5e64['id'],'type':_0x109838[_0x11a2('0x40')],'sectionId':_0x109838['id']},{})[_0x11a2('0x21')](function(){return _0x3e6156;});}else{return _0x3e6156;}})[_0x11a2('0x2c')](function(_0x4d4079){logger['error'](_0x11a2('0x63'),_0x4d4079);throw _0x4d4079;});}return _0x3e6156;})[_0x11a2('0x21')](respondWithResult(_0x113f9c,0xc9))[_0x11a2('0x2c')](handleError(_0x113f9c,null));};exports[_0x11a2('0x3a')]=function(_0x4154d1,_0x34b7b1){if(_0x4154d1['body']['id']){delete _0x4154d1[_0x11a2('0x5f')]['id'];}return db['ChatQueue'][_0x11a2('0x5d')]({'where':{'id':_0x4154d1['params']['id']}})[_0x11a2('0x21')](handleEntityNotFound(_0x34b7b1,null))[_0x11a2('0x21')](saveUpdates(_0x4154d1[_0x11a2('0x5f')],null))[_0x11a2('0x21')](respondWithResult(_0x34b7b1,null))[_0x11a2('0x2c')](handleError(_0x34b7b1,null));};exports[_0x11a2('0x3b')]=function(_0x29e7c9,_0x45deef){return db[_0x11a2('0x43')]['find']({'where':{'id':_0x29e7c9[_0x11a2('0x64')]['id']}})[_0x11a2('0x21')](handleEntityNotFound(_0x45deef,null))[_0x11a2('0x21')](removeEntity(_0x45deef,null))['catch'](handleError(_0x45deef,null));};exports[_0x11a2('0x65')]=function(_0x4e5a4d,_0x6c15ac){return db[_0x11a2('0x43')][_0x11a2('0x65')]()['then'](respondWithResult(_0x6c15ac,null))[_0x11a2('0x2c')](handleError(_0x6c15ac,null));};exports[_0x11a2('0x66')]=function(_0x2625a3,_0x24f12b,_0x2864c5){var _0x4e2efa={'raw':!![],'where':{}},_0x3c8bd0={},_0x54d8d1;return db[_0x11a2('0x43')][_0x11a2('0x67')]({'where':{'id':_0x2625a3['params']['id']}})[_0x11a2('0x21')](handleEntityNotFound(_0x24f12b,null))['then'](function(_0x457e1f){if(_0x457e1f){_0x54d8d1=_0x457e1f[_0x11a2('0x3c')]({'plain':!![]});_0x3c8bd0['model']=_['keys'](db[_0x11a2('0x68')][_0x11a2('0x44')]);_0x3c8bd0['query']=_[_0x11a2('0x49')](_0x2625a3['query']);_0x3c8bd0[_0x11a2('0x4b')]=_[_0x11a2('0x4c')](_0x3c8bd0['model'],_0x3c8bd0[_0x11a2('0x4a')]);_0x4e2efa['attributes']=_[_0x11a2('0x4c')](_0x3c8bd0[_0x11a2('0x48')],qs[_0x11a2('0x5b')](_0x2625a3[_0x11a2('0x4a')]['fields']));_0x4e2efa[_0x11a2('0x4d')]=_0x4e2efa[_0x11a2('0x4d')][_0x11a2('0x4e')]?_0x4e2efa['attributes']:_0x3c8bd0[_0x11a2('0x48')];if(!_0x2625a3[_0x11a2('0x4a')][_0x11a2('0x4f')](_0x11a2('0x50'))){_0x4e2efa['limit']=qs[_0x11a2('0x32')](_0x2625a3[_0x11a2('0x4a')][_0x11a2('0x32')]);_0x4e2efa[_0x11a2('0x34')]=qs[_0x11a2('0x34')](_0x2625a3[_0x11a2('0x4a')]['offset']);}_0x4e2efa[_0x11a2('0x69')]=qs['sort'](_0x2625a3['query'][_0x11a2('0x51')]);_0x4e2efa[_0x11a2('0x54')]=qs[_0x11a2('0x4b')](_[_0x11a2('0x52')](_0x2625a3[_0x11a2('0x4a')],_0x3c8bd0[_0x11a2('0x4b')]));_0x4e2efa[_0x11a2('0x54')][_0x11a2('0x6a')]=_0x457e1f['id'];if(_0x2625a3[_0x11a2('0x4a')][_0x11a2('0x53')]){_0x4e2efa[_0x11a2('0x54')]=_[_0x11a2('0x55')](_0x4e2efa[_0x11a2('0x54')],{'$or':_['map'](_0x4e2efa[_0x11a2('0x4d')],function(_0x9ca496){var _0x51265b={};_0x51265b[_0x9ca496]={'$like':'%'+_0x2625a3[_0x11a2('0x4a')][_0x11a2('0x53')]+'%'};return _0x51265b;})});}_0x4e2efa=_['merge']({},_0x4e2efa,_0x2625a3['options']);return db['UserChatQueue']['findAll'](_0x4e2efa);}})[_0x11a2('0x21')](function(_0x308cbe){if(_0x308cbe){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x308cbe,'UserId'),'role':_0x11a2('0x6b')},'attributes':['id',_0x11a2('0x40'),'chatPause',_0x11a2('0x6c'),_0x11a2('0x6d')]});}})['then'](function(_0x178f8e){if(_0x178f8e){return{'count':_0x178f8e[_0x11a2('0x33')],'rows':_[_0x11a2('0x42')](_0x178f8e['rows'],function(_0x436cea){return{'membername':_0x436cea['name'],'UserId':_0x436cea['id'],'queue_name':_0x54d8d1[_0x11a2('0x40')],'ChatQueueId':_0x54d8d1['id'],'interface':util['format'](_0x11a2('0x6e'),_0x11a2('0x6f'),_0x436cea[_0x11a2('0x40')]),'penalty':0x0,'paused':_0x436cea[_0x11a2('0x70')],'createdAt':_0x436cea['createdAt'],'updatedAt':_0x436cea[_0x11a2('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x11a2('0x21')](respondWithFilteredResult(_0x24f12b,_0x4e2efa))[_0x11a2('0x2c')](handleError(_0x24f12b,null));};exports[_0x11a2('0x71')]=function(_0x1ef96d,_0x4fb857,_0x1a8b5b){var _0x102e41={};var _0x164492={};var _0x548359;var _0x1cbc4f;return db[_0x11a2('0x43')][_0x11a2('0x67')]({'where':{'id':_0x1ef96d[_0x11a2('0x64')]['id']}})['then'](handleEntityNotFound(_0x4fb857,null))['then'](function(_0xbe4b5f){if(_0xbe4b5f){_0x548359=_0xbe4b5f;_0x164492['model']=_[_0x11a2('0x49')](db[_0x11a2('0x72')]['rawAttributes']);_0x164492[_0x11a2('0x4a')]=_[_0x11a2('0x49')](_0x1ef96d['query']);_0x164492[_0x11a2('0x4b')]=_[_0x11a2('0x4c')](_0x164492[_0x11a2('0x48')],_0x164492[_0x11a2('0x4a')]);_0x102e41[_0x11a2('0x4d')]=_['intersection'](_0x164492[_0x11a2('0x48')],qs['fields'](_0x1ef96d[_0x11a2('0x4a')]['fields']));_0x102e41[_0x11a2('0x4d')]=_0x102e41[_0x11a2('0x4d')][_0x11a2('0x4e')]?_0x102e41[_0x11a2('0x4d')]:_0x164492[_0x11a2('0x48')];_0x102e41[_0x11a2('0x69')]=qs[_0x11a2('0x51')](_0x1ef96d[_0x11a2('0x4a')][_0x11a2('0x51')]);_0x102e41[_0x11a2('0x54')]=qs[_0x11a2('0x4b')](_['pick'](_0x1ef96d[_0x11a2('0x4a')],_0x164492[_0x11a2('0x4b')]));if(_0x1ef96d['query'][_0x11a2('0x53')]){_0x102e41[_0x11a2('0x54')]=_[_0x11a2('0x55')](_0x102e41[_0x11a2('0x54')],{'$or':_[_0x11a2('0x42')](_0x102e41['attributes'],function(_0x45e4a0){var _0x27cf48={};_0x27cf48[_0x45e4a0]={'$like':'%'+_0x1ef96d[_0x11a2('0x4a')][_0x11a2('0x53')]+'%'};return _0x27cf48;})});}_0x102e41=_[_0x11a2('0x55')]({},_0x102e41,_0x1ef96d['options']);return _0x548359[_0x11a2('0x71')](_0x102e41);}})['then'](function(_0x574183){if(_0x574183){_0x1cbc4f=_0x574183[_0x11a2('0x4e')];if(!_0x1ef96d[_0x11a2('0x4a')]['hasOwnProperty'](_0x11a2('0x50'))){_0x102e41[_0x11a2('0x32')]=qs[_0x11a2('0x32')](_0x1ef96d['query'][_0x11a2('0x32')]);_0x102e41['offset']=qs[_0x11a2('0x34')](_0x1ef96d[_0x11a2('0x4a')][_0x11a2('0x34')]);}return _0x548359[_0x11a2('0x71')](_0x102e41);}})[_0x11a2('0x21')](function(_0x5f511c){if(_0x5f511c){return _0x5f511c?{'count':_0x1cbc4f,'rows':_0x5f511c}:null;}})['then'](respondWithResult(_0x4fb857,null))['catch'](handleError(_0x4fb857,null));};exports[_0x11a2('0x73')]=function(_0x98ec1,_0x4c4373,_0x1cb630){var _0xc7ae43=_0x98ec1[_0x11a2('0x5f')][_0x11a2('0x74')];return db[_0x11a2('0x72')][_0x11a2('0x58')]({'where':{'id':_0xc7ae43},'attributes':['id'],'include':[{'model':db[_0x11a2('0x75')],'as':'Agents','attributes':['id',_0x11a2('0x40'),'online',_0x11a2('0x76'),_0x11a2('0x77')],'raw':!![]}]})[_0x11a2('0x21')](function(_0x27dea2){if(_0x27dea2){var _0x183c10=_[_0x11a2('0x78')](_0x27dea2,function(_0x37b2f1){var _0x1bcd49=_0x37b2f1[_0x11a2('0x3c')]({'plain':!![]});return _0x1bcd49[_0x11a2('0x79')];});return db[_0x11a2('0x43')][_0x11a2('0x5d')]({'where':{'id':_0x98ec1[_0x11a2('0x64')]['id']}})[_0x11a2('0x21')](function(_0x92f9f){return db['sequelize'][_0x11a2('0x7a')](function(_0x63efee){return _0x92f9f[_0x11a2('0x73')](_0xc7ae43,{'transaction':_0x63efee})[_0x11a2('0x21')](function(){return BPromise[_0x11a2('0x7b')](_0x183c10,function(_0x210e1f){return db[_0x11a2('0x68')][_0x11a2('0x7c')]({'where':{'UserId':_0x210e1f['id'],'ChatQueueId':_0x98ec1[_0x11a2('0x64')]['id']},'transaction':_0x63efee});});})[_0x11a2('0x21')](function(){_0x183c10['forEach'](function(_0x33467a){socket[_0x11a2('0x7d')](_0x11a2('0x7e'),{'UserId':_0x33467a['id'],'ChatQueueId':_0x92f9f['id']});});});});});}})[_0x11a2('0x21')](respondWithStatusCode(_0x4c4373,null))[_0x11a2('0x2c')](handleError(_0x4c4373,null));};exports[_0x11a2('0x7f')]=function(_0x5c9c16,_0x59f5b8,_0x1396fb){return db[_0x11a2('0x72')][_0x11a2('0x58')]({'where':{'id':_0x5c9c16['query'][_0x11a2('0x74')]},'attributes':['id'],'include':[{'model':db[_0x11a2('0x75')],'as':_0x11a2('0x79'),'attributes':['id'],'raw':!![]}]})[_0x11a2('0x21')](handleEntityNotFound(_0x59f5b8,null))[_0x11a2('0x21')](function(_0x4bad9c){var _0x563e56=_['map'](_0x4bad9c,'id');var _0x35e33b=[];var _0x3c7936=[];var _0x455b29=squel['select']();_0x455b29[_0x11a2('0x80')]('tq.TeamId')['from']('team_has_chat_queues','tq')[_0x11a2('0x81')](_0x11a2('0x82'),'ut',_0x11a2('0x83'))['where']('ChatQueueId\x20=\x20?',_0x5c9c16[_0x11a2('0x64')]['id']);for(var _0x143464=0x0;_0x143464<_0x4bad9c['length'];_0x143464+=0x1){let _0x1bab79=_0x4bad9c[_0x143464];for(var _0x45be8e=0x0;_0x45be8e<_0x1bab79['Agents'][_0x11a2('0x4e')];_0x45be8e+=0x1){let _0x4df616=_0x1bab79['Agents'][_0x45be8e];var _0x3634e3=_0x455b29['clone']();_0x3634e3[_0x11a2('0x54')](_0x11a2('0x84'),_0x4df616['id']);_0x3c7936[_0x11a2('0x85')](db['sequelize'][_0x11a2('0x4a')](_0x3634e3['toString'](),{'type':db['sequelize'][_0x11a2('0x86')][_0x11a2('0x87')]})[_0x11a2('0x21')](function(_0x475854){if(_0x475854[_0x11a2('0x4e')]===0x1){return _0x4df616['id'];}else{var _0x781200=_[_0x11a2('0x88')](_[_0x11a2('0x42')](_0x475854,'TeamId'),function(_0x1a2ed5){return _[_0x11a2('0x89')](_0x563e56,_0x1a2ed5);});if(_0x781200){return _0x4df616['id'];}}}));}}return BPromise[_0x11a2('0x8a')](_0x3c7936)[_0x11a2('0x21')](function(_0x55582d){_0x35e33b=_(_0x35e33b)[_0x11a2('0x8b')](_0x55582d)['compact']()[_0x11a2('0x8c')]();return db[_0x11a2('0x43')]['find']({'where':{'id':_0x5c9c16[_0x11a2('0x64')]['id']}})[_0x11a2('0x21')](function(_0x39efc6){return db[_0x11a2('0x8d')][_0x11a2('0x7a')](function(_0x28e932){return _0x39efc6[_0x11a2('0x7f')](_0x5c9c16[_0x11a2('0x4a')][_0x11a2('0x74')],{'transaction':_0x28e932})[_0x11a2('0x21')](function(){if(!_['isEmpty'](_0x35e33b)){return _0x39efc6[_0x11a2('0x8e')](_0x35e33b,{'transaction':_0x28e932});}})['then'](function(){_0x35e33b['forEach'](function(_0x3904cb){socket[_0x11a2('0x7d')](_0x11a2('0x8f'),{'UserId':_0x3904cb,'ChatQueueId':_0x39efc6['id']});});});});});});})[_0x11a2('0x21')](respondWithStatusCode(_0x59f5b8,null))[_0x11a2('0x2c')](handleError(_0x59f5b8,null));};exports[_0x11a2('0x90')]=function(_0x38210d,_0x7ba53e,_0x46f463){return db[_0x11a2('0x43')][_0x11a2('0x5d')]({'where':{'id':_0x38210d['params']['id']}})['then'](handleEntityNotFound(_0x7ba53e,null))['then'](function(_0x3d8a6a){if(_0x3d8a6a){return _0x3d8a6a[_0x11a2('0x90')](_0x38210d[_0x11a2('0x5f')][_0x11a2('0x74')],_[_0x11a2('0x91')](_0x38210d[_0x11a2('0x5f')],[_0x11a2('0x74'),'id'])||{})[_0x11a2('0x92')](function(_0x47fc5c){for(var _0x23a23d=0x0;_0x23a23d<_0x38210d[_0x11a2('0x5f')][_0x11a2('0x74')]['length'];_0x23a23d+=0x1){socket[_0x11a2('0x7d')](_0x11a2('0x7e'),{'UserId':Number(_0x38210d[_0x11a2('0x5f')][_0x11a2('0x74')][_0x23a23d]),'ChatQueueId':Number(_0x38210d['params']['id'])});}return _0x47fc5c;});}})[_0x11a2('0x21')](respondWithResult(_0x7ba53e,null))[_0x11a2('0x2c')](handleError(_0x7ba53e,null));};exports['removeAgents']=function(_0x2b8353,_0x5840cb,_0x3b5e80){return db[_0x11a2('0x43')]['find']({'where':{'id':_0x2b8353[_0x11a2('0x64')]['id']}})[_0x11a2('0x21')](handleEntityNotFound(_0x5840cb,null))[_0x11a2('0x21')](function(_0x561084){if(_0x561084){return _0x561084['removeAgents'](_0x2b8353['query'][_0x11a2('0x74')])['then'](function(){if(_[_0x11a2('0x93')](_0x2b8353[_0x11a2('0x4a')][_0x11a2('0x74')])){for(var _0x488b13=0x0;_0x488b13<_0x2b8353['query'][_0x11a2('0x74')]['length'];_0x488b13+=0x1){socket[_0x11a2('0x7d')](_0x11a2('0x8f'),{'UserId':Number(_0x2b8353[_0x11a2('0x4a')][_0x11a2('0x74')][_0x488b13]),'ChatQueueId':Number(_0x2b8353[_0x11a2('0x64')]['id'])});}}else{socket[_0x11a2('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x2b8353[_0x11a2('0x4a')][_0x11a2('0x74')]),'ChatQueueId':Number(_0x2b8353[_0x11a2('0x64')]['id'])});}});}})[_0x11a2('0x21')](respondWithStatusCode(_0x5840cb,null))[_0x11a2('0x2c')](handleError(_0x5840cb,null));};exports[_0x11a2('0x94')]=function(_0x51bcf2,_0x4b67cd,_0x2b03c8){var _0x1798ee={};var _0x3b1230={};var _0x466bfd;var _0x57d665;return db['ChatQueue']['findOne']({'where':{'id':_0x51bcf2['params']['id']}})[_0x11a2('0x21')](handleEntityNotFound(_0x4b67cd,null))[_0x11a2('0x21')](function(_0x14bc5d){if(_0x14bc5d){_0x466bfd=_0x14bc5d;_0x3b1230['model']=_[_0x11a2('0x49')](db['User'][_0x11a2('0x44')]);_0x3b1230['query']=_[_0x11a2('0x49')](_0x51bcf2[_0x11a2('0x4a')]);_0x3b1230[_0x11a2('0x4b')]=_[_0x11a2('0x4c')](_0x3b1230[_0x11a2('0x48')],_0x3b1230['query']);_0x1798ee[_0x11a2('0x4d')]=_[_0x11a2('0x4c')](_0x3b1230[_0x11a2('0x48')],qs[_0x11a2('0x5b')](_0x51bcf2['query'][_0x11a2('0x5b')]));_0x1798ee[_0x11a2('0x4d')]=_0x1798ee[_0x11a2('0x4d')][_0x11a2('0x4e')]?_0x1798ee[_0x11a2('0x4d')]:_0x3b1230['model'];_0x1798ee['order']=qs[_0x11a2('0x51')](_0x51bcf2[_0x11a2('0x4a')][_0x11a2('0x51')]);_0x1798ee['where']=qs['filters'](_['pick'](_0x51bcf2['query'],_0x3b1230['filters']));if(_0x51bcf2['query']['filter']){_0x1798ee['where']=_[_0x11a2('0x55')](_0x1798ee[_0x11a2('0x54')],{'$or':_[_0x11a2('0x42')](_0x1798ee['attributes'],function(_0x310550){var _0x3ac765={};_0x3ac765[_0x310550]={'$like':'%'+_0x51bcf2['query'][_0x11a2('0x53')]+'%'};return _0x3ac765;})});}_0x1798ee=_[_0x11a2('0x55')]({},_0x1798ee,_0x51bcf2['options']);return _0x466bfd[_0x11a2('0x94')](_0x1798ee);}})[_0x11a2('0x21')](function(_0x1cd36f){if(_0x1cd36f){_0x57d665=_0x1cd36f[_0x11a2('0x4e')];if(!_0x51bcf2[_0x11a2('0x4a')]['hasOwnProperty']('nolimit')){_0x1798ee[_0x11a2('0x32')]=qs[_0x11a2('0x32')](_0x51bcf2[_0x11a2('0x4a')][_0x11a2('0x32')]);_0x1798ee[_0x11a2('0x34')]=qs['offset'](_0x51bcf2[_0x11a2('0x4a')][_0x11a2('0x34')]);}return _0x466bfd[_0x11a2('0x94')](_0x1798ee);}})[_0x11a2('0x21')](function(_0x344f2e){if(_0x344f2e){return _0x344f2e?{'count':_0x57d665,'rows':_0x344f2e}:null;}})[_0x11a2('0x21')](respondWithResult(_0x4b67cd,null))[_0x11a2('0x2c')](handleError(_0x4b67cd,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 1db8b17..97160ee 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 _0x2cb4=['ChatQueue','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x5415d0,_0x1270ad){var _0xbbd0b4=function(_0x40a890){while(--_0x40a890){_0x5415d0['push'](_0x5415d0['shift']());}};_0xbbd0b4(++_0x1270ad);}(_0x2cb4,0x13e));var _0x42cb=function(_0x15876c,_0x510dd4){_0x15876c=_0x15876c-0x0;var _0x39d91b=_0x2cb4[_0x15876c];return _0x39d91b;};'use strict';var EventEmitter=require(_0x42cb('0x0'));var ChatQueue=require(_0x42cb('0x1'))['db'][_0x42cb('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x42cb('0x3')](0x0);var events={'afterCreate':_0x42cb('0x4'),'afterUpdate':_0x42cb('0x5'),'afterDestroy':_0x42cb('0x6')};function emitEvent(_0x524a33){return function(_0x272358,_0x2b4ebb,_0x43c035){ChatQueueEvents[_0x42cb('0x7')](_0x524a33+':'+_0x272358['id'],_0x272358);ChatQueueEvents[_0x42cb('0x7')](_0x524a33,_0x272358);_0x43c035(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x42cb('0x8')](e,emitEvent(event));}}module[_0x42cb('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x9248=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0xb47fb2,_0x6a5f1c){var _0x2f58a0=function(_0xf6f046){while(--_0xf6f046){_0xb47fb2['push'](_0xb47fb2['shift']());}};_0x2f58a0(++_0x6a5f1c);}(_0x9248,0x18f));var _0x8924=function(_0x29e537,_0x326f0c){_0x29e537=_0x29e537-0x0;var _0x468bbc=_0x9248[_0x29e537];return _0x468bbc;};'use strict';var EventEmitter=require(_0x8924('0x0'));var ChatQueue=require(_0x8924('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8924('0x2')](0x0);var events={'afterCreate':_0x8924('0x3'),'afterUpdate':_0x8924('0x4'),'afterDestroy':_0x8924('0x5')};function emitEvent(_0x5804ed){return function(_0x50769f,_0x539a6d,_0x5e5c8a){ChatQueueEvents[_0x8924('0x6')](_0x5804ed+':'+_0x50769f['id'],_0x50769f);ChatQueueEvents[_0x8924('0x6')](_0x5804ed,_0x50769f);_0x5e5c8a(null);};}for(var e in events){if(events[_0x8924('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x8924('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index bd7b78a..f486e17 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 _0xb909=['api','bluebird','request-promise','path','rimraf','./chatQueue.attributes','define','chat_queues','util','../../config/logger'];(function(_0x4cf444,_0x2fccf2){var _0x3b50f4=function(_0x3afdc8){while(--_0x3afdc8){_0x4cf444['push'](_0x4cf444['shift']());}};_0x3b50f4(++_0x2fccf2);}(_0xb909,0x13e));var _0x9b90=function(_0x447ae5,_0x406dd1){_0x447ae5=_0x447ae5-0x0;var _0xe6631e=_0xb909[_0x447ae5];return _0xe6631e;};'use strict';var _=require('lodash');var util=require(_0x9b90('0x0'));var logger=require(_0x9b90('0x1'))(_0x9b90('0x2'));var moment=require('moment');var BPromise=require(_0x9b90('0x3'));var rp=require(_0x9b90('0x4'));var fs=require('fs');var path=require(_0x9b90('0x5'));var rimraf=require(_0x9b90('0x6'));var config=require('../../config/environment');var attributes=require(_0x9b90('0x7'));module['exports']=function(_0x5aea34,_0x354ef3){return _0x5aea34[_0x9b90('0x8')]('ChatQueue',attributes,{'tableName':_0x9b90('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x111f=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','define','ChatQueue','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x111f,0x167));var _0xf111=function(_0x370a2e,_0x3f6e13){_0x370a2e=_0x370a2e-0x0;var _0x5f1691=_0x111f[_0x370a2e];return _0x5f1691;};'use strict';var _=require('lodash');var util=require(_0xf111('0x0'));var logger=require(_0xf111('0x1'))('api');var moment=require(_0xf111('0x2'));var BPromise=require('bluebird');var rp=require(_0xf111('0x3'));var fs=require('fs');var path=require(_0xf111('0x4'));var rimraf=require(_0xf111('0x5'));var config=require(_0xf111('0x6'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x3fbaef,_0x4fa343){return _0x3fbaef[_0xf111('0x7')](_0xf111('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 914af18..cc08aac 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 _0xc648=['stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','attributes','limit','map','include','model','GetChatQueue','where','ShowChatQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x121249,_0x3b4cea){var _0x52f27c=function(_0x48db46){while(--_0x48db46){_0x121249['push'](_0x121249['shift']());}};_0x52f27c(++_0x3b4cea);}(_0xc648,0x171));var _0x8c64=function(_0x194cec,_0x22f898){_0x194cec=_0x194cec-0x0;var _0x44930f=_0xc648[_0x194cec];return _0x44930f;};'use strict';var _=require('lodash');var util=require(_0x8c64('0x0'));var moment=require(_0x8c64('0x1'));var BPromise=require(_0x8c64('0x2'));var rs=require(_0x8c64('0x3'));var fs=require('fs');var Redis=require(_0x8c64('0x4'));var db=require(_0x8c64('0x5'))['db'];var utils=require(_0x8c64('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8c64('0x7'));var client=jayson[_0x8c64('0x8')][_0x8c64('0x9')]({'port':0x232a});config[_0x8c64('0xa')]=_['defaults'](config[_0x8c64('0xa')],{'host':_0x8c64('0xb'),'port':0x18eb});var socket=require(_0x8c64('0xc'))(new Redis(config[_0x8c64('0xa')]));require(_0x8c64('0xd'))['register'](socket);function respondWithRpcPromise(_0x6147f8,_0x40bb59,_0x4f7cb7){return new BPromise(function(_0x446101,_0x21905a){return client[_0x8c64('0xe')](_0x6147f8,_0x4f7cb7)[_0x8c64('0xf')](function(_0x177085){logger[_0x8c64('0x10')](_0x8c64('0x11'),_0x40bb59,_0x8c64('0x12'));logger[_0x8c64('0x13')](_0x8c64('0x14'),_0x40bb59,'request\x20sent',JSON[_0x8c64('0x15')](_0x177085));if(_0x177085[_0x8c64('0x16')]){if(_0x177085[_0x8c64('0x16')][_0x8c64('0x17')]===0x1f4){logger[_0x8c64('0x16')](_0x8c64('0x11'),_0x40bb59,_0x177085[_0x8c64('0x16')]['message']);return _0x21905a(_0x177085[_0x8c64('0x16')][_0x8c64('0x18')]);}logger['error'](_0x8c64('0x11'),_0x40bb59,_0x177085[_0x8c64('0x16')]['message']);return _0x446101(_0x177085[_0x8c64('0x16')][_0x8c64('0x18')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x40bb59,_0x8c64('0x12'));_0x446101(_0x177085[_0x8c64('0x19')]['message']);}})[_0x8c64('0x1a')](function(_0x30f7ad){logger['error']('ChatQueue,\x20%s,\x20%s',_0x40bb59,_0x30f7ad);_0x21905a(_0x30f7ad);});});}exports['GetChatQueue']=function(_0xb94635){var _0x530747=this;return new Promise(function(_0x47f6fa,_0x45839d){return db[_0x8c64('0x1b')][_0x8c64('0x1c')]({'raw':_0xb94635[_0x8c64('0x1d')]?_0xb94635[_0x8c64('0x1d')][_0x8c64('0x1e')]===undefined?!![]:![]:!![],'where':_0xb94635['options']?_0xb94635[_0x8c64('0x1d')]['where']||null:null,'attributes':_0xb94635[_0x8c64('0x1d')]?_0xb94635['options'][_0x8c64('0x1f')]||null:null,'limit':_0xb94635[_0x8c64('0x1d')]?_0xb94635['options'][_0x8c64('0x20')]||null:null,'include':_0xb94635[_0x8c64('0x1d')]?_0xb94635[_0x8c64('0x1d')]['include']?_[_0x8c64('0x21')](_0xb94635['options'][_0x8c64('0x22')],function(_0xd3001c){return{'model':db[_0xd3001c[_0x8c64('0x23')]],'as':_0xd3001c['as'],'attributes':_0xd3001c[_0x8c64('0x1f')],'include':_0xd3001c[_0x8c64('0x22')]?_['map'](_0xd3001c[_0x8c64('0x22')],function(_0x5cf51b){return{'model':db[_0x5cf51b['model']],'as':_0x5cf51b['as'],'attributes':_0x5cf51b[_0x8c64('0x1f')],'include':_0x5cf51b['include']?_[_0x8c64('0x21')](_0x5cf51b[_0x8c64('0x22')],function(_0x1cf017){return{'model':db[_0x1cf017['model']],'as':_0x1cf017['as'],'attributes':_0x1cf017[_0x8c64('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8c64('0xf')](function(_0x13f0b0){logger[_0x8c64('0x10')](_0x8c64('0x24'),_0xb94635);logger[_0x8c64('0x13')](_0x8c64('0x24'),_0xb94635,JSON[_0x8c64('0x15')](_0x13f0b0));_0x47f6fa(_0x13f0b0);})['catch'](function(_0x4f86cd){logger['error'](_0x8c64('0x24'),_0x4f86cd[_0x8c64('0x18')],_0xb94635);_0x45839d(_0x530747[_0x8c64('0x16')](0x1f4,_0x4f86cd[_0x8c64('0x18')]));});});};exports['ShowChatQueue']=function(_0x173b58){var _0x2ee384=this;return new Promise(function(_0x485044,_0x221559){return db['ChatQueue']['find']({'raw':_0x173b58[_0x8c64('0x1d')]?_0x173b58[_0x8c64('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x173b58['options']?_0x173b58['options'][_0x8c64('0x25')]||null:null,'attributes':_0x173b58[_0x8c64('0x1d')]?_0x173b58[_0x8c64('0x1d')][_0x8c64('0x1f')]||null:null,'include':_0x173b58[_0x8c64('0x1d')]?_0x173b58[_0x8c64('0x1d')][_0x8c64('0x22')]?_[_0x8c64('0x21')](_0x173b58[_0x8c64('0x1d')]['include'],function(_0x251d0f){return{'model':db[_0x251d0f[_0x8c64('0x23')]],'as':_0x251d0f['as'],'attributes':_0x251d0f[_0x8c64('0x1f')],'include':_0x251d0f['include']?_[_0x8c64('0x21')](_0x251d0f[_0x8c64('0x22')],function(_0x3d53f0){return{'model':db[_0x3d53f0['model']],'as':_0x3d53f0['as'],'attributes':_0x3d53f0[_0x8c64('0x1f')],'include':_0x3d53f0[_0x8c64('0x22')]?_[_0x8c64('0x21')](_0x3d53f0[_0x8c64('0x22')],function(_0x17dcca){return{'model':db[_0x17dcca[_0x8c64('0x23')]],'as':_0x17dcca['as'],'attributes':_0x17dcca[_0x8c64('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8c64('0xf')](function(_0x1f199e){logger[_0x8c64('0x10')](_0x8c64('0x26'),_0x173b58);logger[_0x8c64('0x13')](_0x8c64('0x26'),_0x173b58,JSON[_0x8c64('0x15')](_0x1f199e));_0x485044(_0x1f199e);})['catch'](function(_0x5ac70f){logger[_0x8c64('0x16')](_0x8c64('0x26'),_0x5ac70f[_0x8c64('0x18')],_0x173b58);_0x221559(_0x2ee384[_0x8c64('0x16')](0x1f4,_0x5ac70f['message']));});});};
\ No newline at end of file
+var _0xb235=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetChatQueue','ChatQueue','options','where','attributes','include','model','map','debug','ShowChatQueue','find','raw','lodash','util','bluebird','randomstring'];(function(_0x512163,_0x6da7c1){var _0x19fbaa=function(_0x3c1fa7){while(--_0x3c1fa7){_0x512163['push'](_0x512163['shift']());}};_0x19fbaa(++_0x6da7c1);}(_0xb235,0xb5));var _0x5b23=function(_0x336082,_0x5c364b){_0x336082=_0x336082-0x0;var _0x2ea2eb=_0xb235[_0x336082];return _0x2ea2eb;};'use strict';var _=require(_0x5b23('0x0'));var util=require(_0x5b23('0x1'));var moment=require('moment');var BPromise=require(_0x5b23('0x2'));var rs=require(_0x5b23('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b23('0x4'))['db'];var utils=require(_0x5b23('0x5'));var logger=require(_0x5b23('0x6'))('rpc');var config=require(_0x5b23('0x7'));var jayson=require(_0x5b23('0x8'));var client=jayson[_0x5b23('0x9')][_0x5b23('0xa')]({'port':0x232a});config[_0x5b23('0xb')]=_[_0x5b23('0xc')](config['redis'],{'host':_0x5b23('0xd'),'port':0x18eb});var socket=require(_0x5b23('0xe'))(new Redis(config[_0x5b23('0xb')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1a1b97,_0x1b5868,_0x16a79e){return new BPromise(function(_0x52d872,_0x20549e){return client['request'](_0x1a1b97,_0x16a79e)[_0x5b23('0xf')](function(_0xad5190){logger[_0x5b23('0x10')](_0x5b23('0x11'),_0x1b5868,_0x5b23('0x12'));logger['debug'](_0x5b23('0x13'),_0x1b5868,_0x5b23('0x12'),JSON[_0x5b23('0x14')](_0xad5190));if(_0xad5190[_0x5b23('0x15')]){if(_0xad5190[_0x5b23('0x15')][_0x5b23('0x16')]===0x1f4){logger[_0x5b23('0x15')]('ChatQueue,\x20%s,\x20%s',_0x1b5868,_0xad5190[_0x5b23('0x15')][_0x5b23('0x17')]);return _0x20549e(_0xad5190['error'][_0x5b23('0x17')]);}logger[_0x5b23('0x15')]('ChatQueue,\x20%s,\x20%s',_0x1b5868,_0xad5190['error'][_0x5b23('0x17')]);return _0x52d872(_0xad5190['error'][_0x5b23('0x17')]);}else{logger[_0x5b23('0x10')](_0x5b23('0x11'),_0x1b5868,_0x5b23('0x12'));_0x52d872(_0xad5190['result']['message']);}})[_0x5b23('0x18')](function(_0x2b839e){logger[_0x5b23('0x15')](_0x5b23('0x11'),_0x1b5868,_0x2b839e);_0x20549e(_0x2b839e);});});}exports[_0x5b23('0x19')]=function(_0x1b3f63){var _0x43df90=this;return new Promise(function(_0x1dddf3,_0x2eff29){return db[_0x5b23('0x1a')]['findAll']({'raw':_0x1b3f63[_0x5b23('0x1b')]?_0x1b3f63['options']['raw']===undefined?!![]:![]:!![],'where':_0x1b3f63[_0x5b23('0x1b')]?_0x1b3f63[_0x5b23('0x1b')][_0x5b23('0x1c')]||null:null,'attributes':_0x1b3f63[_0x5b23('0x1b')]?_0x1b3f63[_0x5b23('0x1b')][_0x5b23('0x1d')]||null:null,'limit':_0x1b3f63[_0x5b23('0x1b')]?_0x1b3f63[_0x5b23('0x1b')]['limit']||null:null,'include':_0x1b3f63[_0x5b23('0x1b')]?_0x1b3f63[_0x5b23('0x1b')][_0x5b23('0x1e')]?_['map'](_0x1b3f63['options'][_0x5b23('0x1e')],function(_0x54206c){return{'model':db[_0x54206c['model']],'as':_0x54206c['as'],'attributes':_0x54206c['attributes'],'include':_0x54206c['include']?_['map'](_0x54206c[_0x5b23('0x1e')],function(_0x29a5b4){return{'model':db[_0x29a5b4[_0x5b23('0x1f')]],'as':_0x29a5b4['as'],'attributes':_0x29a5b4[_0x5b23('0x1d')],'include':_0x29a5b4['include']?_[_0x5b23('0x20')](_0x29a5b4['include'],function(_0xd0d37){return{'model':db[_0xd0d37[_0x5b23('0x1f')]],'as':_0xd0d37['as'],'attributes':_0xd0d37['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b23('0xf')](function(_0xdd9ad2){logger[_0x5b23('0x10')]('GetChatQueue',_0x1b3f63);logger[_0x5b23('0x21')](_0x5b23('0x19'),_0x1b3f63,JSON[_0x5b23('0x14')](_0xdd9ad2));_0x1dddf3(_0xdd9ad2);})[_0x5b23('0x18')](function(_0x47fbdb){logger[_0x5b23('0x15')](_0x5b23('0x19'),_0x47fbdb[_0x5b23('0x17')],_0x1b3f63);_0x2eff29(_0x43df90[_0x5b23('0x15')](0x1f4,_0x47fbdb[_0x5b23('0x17')]));});});};exports[_0x5b23('0x22')]=function(_0x21e4b1){var _0x58baa9=this;return new Promise(function(_0x46055e,_0x17840f){return db[_0x5b23('0x1a')][_0x5b23('0x23')]({'raw':_0x21e4b1[_0x5b23('0x1b')]?_0x21e4b1['options'][_0x5b23('0x24')]===undefined?!![]:![]:!![],'where':_0x21e4b1[_0x5b23('0x1b')]?_0x21e4b1[_0x5b23('0x1b')][_0x5b23('0x1c')]||null:null,'attributes':_0x21e4b1[_0x5b23('0x1b')]?_0x21e4b1[_0x5b23('0x1b')][_0x5b23('0x1d')]||null:null,'include':_0x21e4b1[_0x5b23('0x1b')]?_0x21e4b1['options'][_0x5b23('0x1e')]?_[_0x5b23('0x20')](_0x21e4b1[_0x5b23('0x1b')][_0x5b23('0x1e')],function(_0x73e613){return{'model':db[_0x73e613[_0x5b23('0x1f')]],'as':_0x73e613['as'],'attributes':_0x73e613[_0x5b23('0x1d')],'include':_0x73e613[_0x5b23('0x1e')]?_[_0x5b23('0x20')](_0x73e613[_0x5b23('0x1e')],function(_0x1c3dfd){return{'model':db[_0x1c3dfd[_0x5b23('0x1f')]],'as':_0x1c3dfd['as'],'attributes':_0x1c3dfd['attributes'],'include':_0x1c3dfd[_0x5b23('0x1e')]?_[_0x5b23('0x20')](_0x1c3dfd[_0x5b23('0x1e')],function(_0x5261ab){return{'model':db[_0x5261ab[_0x5b23('0x1f')]],'as':_0x5261ab['as'],'attributes':_0x5261ab[_0x5b23('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5b23('0xf')](function(_0xb8af77){logger[_0x5b23('0x10')]('ShowChatQueue',_0x21e4b1);logger[_0x5b23('0x21')]('ShowChatQueue',_0x21e4b1,JSON[_0x5b23('0x14')](_0xb8af77));_0x46055e(_0xb8af77);})[_0x5b23('0x18')](function(_0x8e3e){logger[_0x5b23('0x15')](_0x5b23('0x22'),_0x8e3e[_0x5b23('0x17')],_0x21e4b1);_0x17840f(_0x58baa9[_0x5b23('0x15')](0x1f4,_0x8e3e[_0x5b23('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 2ef0e1c..b0737ac 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 _0x0ba7=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','remove','update'];(function(_0x1bb1ea,_0x5a2918){var _0x313151=function(_0x446287){while(--_0x446287){_0x1bb1ea['push'](_0x1bb1ea['shift']());}};_0x313151(++_0x5a2918);}(_0x0ba7,0x16d));var _0x70ba=function(_0x5ac496,_0x12d379){_0x5ac496=_0x5ac496-0x0;var _0x5091dc=_0x0ba7[_0x5ac496];return _0x5091dc;};'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
+var _0x0b78=['removeListener','length','chatQueue:','./chatQueue.events','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0b78,0x1ad));var _0x80b7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0b78[_0x4b369d];return _0x571a98;};'use strict';var ChatQueueEvents=require(_0x80b7('0x0'));var events=[_0x80b7('0x1'),'remove',_0x80b7('0x2')];function createListener(_0x4f55ab,_0x4bffac){return function(_0x261012){_0x4bffac['emit'](_0x4f55ab,_0x261012);};}function removeListener(_0x6a187e,_0x89d4d7){return function(){ChatQueueEvents[_0x80b7('0x3')](_0x6a187e,_0x89d4d7);};}exports['register']=function(_0x49bc7f){for(var _0x167ddd=0x0,_0x584401=events[_0x80b7('0x4')];_0x167ddd<_0x584401;_0x167ddd++){var _0x122ebe=events[_0x167ddd];var _0x3c248d=createListener(_0x80b7('0x5')+_0x122ebe,_0x49bc7f);ChatQueueEvents['on'](_0x122ebe,_0x3c248d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index ccd366e..355cdbc 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 _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(_0x9fa51b,_0x38889e){var _0x2f0160=function(_0x28e72c){while(--_0x28e72c){_0x9fa51b['push'](_0x9fa51b['shift']());}};_0x2f0160(++_0x38889e);}(_0x008c,0x188));var _0xc008=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x008c[_0x9d14e3];return _0x19bf32;};'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
+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(_0x1a30cf,_0x106fe6){var _0x1e3fd9=function(_0x4e1ea8){while(--_0x4e1ea8){_0x1a30cf['push'](_0x1a30cf['shift']());}};_0x1e3fd9(++_0x106fe6);}(_0x008c,0x188));var _0xc008=function(_0x67d2b,_0xc3be07){_0x67d2b=_0x67d2b-0x0;var _0x23e7c1=_0x008c[_0x67d2b];return _0x23e7c1;};'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 bf4605c..ca8c4f4 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 _0x2fb2=['DATE','moment','STRING'];(function(_0x496ed3,_0x5589e6){var _0x4ddb3d=function(_0x5c630e){while(--_0x5c630e){_0x496ed3['push'](_0x496ed3['shift']());}};_0x4ddb3d(++_0x5589e6);}(_0x2fb2,0x19c));var _0x22fb=function(_0x3024ac,_0x11128c){_0x3024ac=_0x3024ac-0x0;var _0x5e196c=_0x2fb2[_0x3024ac];return _0x5e196c;};'use strict';var moment=require(_0x22fb('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x22fb('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x22fb('0x1')]},'joinAt':{'type':Sequelize[_0x22fb('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x22fb('0x2')]},'exitAt':{'type':Sequelize[_0x22fb('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9a9c=['DATE','moment','sequelize','exports','STRING'];(function(_0x43bf1f,_0x2c6036){var _0x53c257=function(_0x62049a){while(--_0x62049a){_0x43bf1f['push'](_0x43bf1f['shift']());}};_0x53c257(++_0x2c6036);}(_0x9a9c,0x15f));var _0xc9a9=function(_0x385839,_0x502e3e){_0x385839=_0x385839-0x0;var _0x31ff87=_0x9a9c[_0x385839];return _0x31ff87;};'use strict';var moment=require(_0xc9a9('0x0'));var Sequelize=require(_0xc9a9('0x1'));module[_0xc9a9('0x2')]={'uniqueid':{'type':Sequelize[_0xc9a9('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc9a9('0x3')]},'joinAt':{'type':Sequelize[_0xc9a9('0x4')]},'leaveAt':{'type':Sequelize[_0xc9a9('0x4')]},'acceptAt':{'type':Sequelize[_0xc9a9('0x4')]},'exitAt':{'type':Sequelize[_0xc9a9('0x4')]},'reason':{'type':Sequelize[_0xc9a9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index bdf11c0..c5696a4 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 _0x6829=['end','json','offset','limit','undefined','set','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','ChatQueueReport','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status'];(function(_0x166f7c,_0x474d3b){var _0x31e804=function(_0x4921d9){while(--_0x4921d9){_0x166f7c['push'](_0x166f7c['shift']());}};_0x31e804(++_0x474d3b);}(_0x6829,0x14c));var _0x9682=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6829[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0x9682('0x0'));var rimraf=require(_0x9682('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9682('0x2'));var BPromise=require(_0x9682('0x3'));var Mustache=require(_0x9682('0x4'));var util=require(_0x9682('0x5'));var path=require(_0x9682('0x6'));var sox=require(_0x9682('0x7'));var csv=require(_0x9682('0x8'));var ejs=require(_0x9682('0x9'));var fs=require('fs');var fs_extra=require(_0x9682('0xa'));var _=require(_0x9682('0xb'));var squel=require(_0x9682('0xc'));var crypto=require(_0x9682('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9682('0xe'));var Papa=require(_0x9682('0xf'));var Redis=require('ioredis');var authService=require(_0x9682('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9682('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9682('0x12'))(_0x9682('0x13'));var utils=require(_0x9682('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9682('0x15'))['db'];function respondWithStatusCode(_0x1391c3,_0x57e123){_0x57e123=_0x57e123||0xcc;return function(_0x15663f){if(_0x15663f){return _0x1391c3['sendStatus'](_0x57e123);}return _0x1391c3[_0x9682('0x16')](_0x57e123)[_0x9682('0x17')]();};}function respondWithResult(_0x289d8b,_0x21451a){_0x21451a=_0x21451a||0xc8;return function(_0x30bfd7){if(_0x30bfd7){return _0x289d8b[_0x9682('0x16')](_0x21451a)[_0x9682('0x18')](_0x30bfd7);}};}function respondWithFilteredResult(_0xa26517,_0x1adcf8){return function(_0x13a1a9){if(_0x13a1a9){var _0x526391=typeof _0x1adcf8[_0x9682('0x19')]==='undefined'&&typeof _0x1adcf8[_0x9682('0x1a')]===_0x9682('0x1b');var _0x1f4971=_0x13a1a9['count'];var _0x1c73ee=_0x526391?0x0:_0x1adcf8['offset'];var _0x107291=_0x526391?_0x13a1a9['count']:_0x1adcf8[_0x9682('0x19')]+_0x1adcf8[_0x9682('0x1a')];var _0x57d4cf;if(_0x107291>=_0x1f4971){_0x107291=_0x1f4971;_0x57d4cf=0xc8;}else{_0x57d4cf=0xce;}_0xa26517[_0x9682('0x16')](_0x57d4cf);return _0xa26517[_0x9682('0x1c')]('Content-Range',_0x1c73ee+'-'+_0x107291+'/'+_0x1f4971)['json'](_0x13a1a9);}return null;};}function patchUpdates(_0x497ff7){return function(_0x3fca2b){try{jsonpatch['apply'](_0x3fca2b,_0x497ff7,!![]);}catch(_0x36230c){return BPromise[_0x9682('0x1d')](_0x36230c);}return _0x3fca2b['save']();};}function saveUpdates(_0x4650c9,_0x238361){return function(_0x1aacb6){if(_0x1aacb6){return _0x1aacb6[_0x9682('0x1e')](_0x4650c9)[_0x9682('0x1f')](function(_0x1c2eaf){return _0x1c2eaf;});}return null;};}function removeEntity(_0x738838,_0x40e927){return function(_0x107352){if(_0x107352){return _0x107352[_0x9682('0x20')]()['then'](function(){_0x738838[_0x9682('0x16')](0xcc)[_0x9682('0x17')]();});}};}function handleEntityNotFound(_0x88419f,_0x21a10b){return function(_0x39291f){if(!_0x39291f){_0x88419f['sendStatus'](0x194);}return _0x39291f;};}function handleError(_0x756fea,_0x1dbf57){_0x1dbf57=_0x1dbf57||0x1f4;return function(_0x44808c){logger[_0x9682('0x21')](_0x44808c[_0x9682('0x22')]);if(_0x44808c[_0x9682('0x23')]){delete _0x44808c['name'];}_0x756fea[_0x9682('0x16')](_0x1dbf57)[_0x9682('0x24')](_0x44808c);};}exports[_0x9682('0x25')]=function(_0x1d827e,_0x9e3d59){var _0x1fdb4d={},_0x176624={},_0x14d974={'count':0x0,'rows':[]};var _0x5f4294=_[_0x9682('0x26')](db['ChatQueueReport'][_0x9682('0x27')],function(_0x27d7f0){return{'name':_0x27d7f0['fieldName'],'type':_0x27d7f0['type']['key']};});_0x176624['model']=_[_0x9682('0x26')](_0x5f4294,'name');_0x176624[_0x9682('0x28')]=_[_0x9682('0x29')](_0x1d827e[_0x9682('0x28')]);_0x176624[_0x9682('0x2a')]=_['intersection'](_0x176624['model'],_0x176624[_0x9682('0x28')]);_0x1fdb4d[_0x9682('0x2b')]=_[_0x9682('0x2c')](_0x176624[_0x9682('0x2d')],qs[_0x9682('0x2e')](_0x1d827e['query']['fields']));_0x1fdb4d[_0x9682('0x2b')]=_0x1fdb4d[_0x9682('0x2b')][_0x9682('0x2f')]?_0x1fdb4d[_0x9682('0x2b')]:_0x176624[_0x9682('0x2d')];if(!_0x1d827e[_0x9682('0x28')][_0x9682('0x30')]('nolimit')){_0x1fdb4d[_0x9682('0x1a')]=qs[_0x9682('0x1a')](_0x1d827e[_0x9682('0x28')][_0x9682('0x1a')]);_0x1fdb4d[_0x9682('0x19')]=qs['offset'](_0x1d827e[_0x9682('0x28')]['offset']);}_0x1fdb4d[_0x9682('0x31')]=qs[_0x9682('0x32')](_0x1d827e[_0x9682('0x28')][_0x9682('0x32')]);_0x1fdb4d[_0x9682('0x33')]=qs[_0x9682('0x2a')](_[_0x9682('0x34')](_0x1d827e['query'],_0x176624[_0x9682('0x2a')]),_0x5f4294);if(_0x1d827e['query'][_0x9682('0x35')]){_0x1fdb4d['where']=_[_0x9682('0x36')](_0x1fdb4d[_0x9682('0x33')],{'$or':_[_0x9682('0x26')](_0x5f4294,function(_0x110fff){if(_0x110fff[_0x9682('0x37')]!==_0x9682('0x38')){var _0x123367={};_0x123367[_0x110fff[_0x9682('0x23')]]={'$like':'%'+_0x1d827e[_0x9682('0x28')][_0x9682('0x35')]+'%'};return _0x123367;}})});}_0x1fdb4d=_[_0x9682('0x36')]({},_0x1fdb4d,_0x1d827e['options']);var _0x30bdf0={'where':_0x1fdb4d[_0x9682('0x33')]};return db[_0x9682('0x39')][_0x9682('0x3a')](_0x30bdf0)[_0x9682('0x1f')](function(_0x479ac7){_0x14d974[_0x9682('0x3a')]=_0x479ac7;if(_0x1d827e[_0x9682('0x28')][_0x9682('0x3b')]){_0x1fdb4d['include']=[{'all':!![]}];}return db[_0x9682('0x39')][_0x9682('0x3c')](_0x1fdb4d);})[_0x9682('0x1f')](function(_0x240431){_0x14d974[_0x9682('0x3d')]=_0x240431;return _0x14d974;})[_0x9682('0x1f')](respondWithFilteredResult(_0x9e3d59,_0x1fdb4d))[_0x9682('0x3e')](handleError(_0x9e3d59,null));};exports[_0x9682('0x3f')]=function(_0x6e3eaa,_0x2d9b43){var _0x46b5c6={'raw':!![],'where':{'id':_0x6e3eaa[_0x9682('0x40')]['id']}},_0x3324b2={};_0x3324b2[_0x9682('0x2d')]=_[_0x9682('0x29')](db[_0x9682('0x39')]['rawAttributes']);_0x3324b2[_0x9682('0x28')]=_['keys'](_0x6e3eaa[_0x9682('0x28')]);_0x3324b2[_0x9682('0x2a')]=_[_0x9682('0x2c')](_0x3324b2['model'],_0x3324b2['query']);_0x46b5c6[_0x9682('0x2b')]=_[_0x9682('0x2c')](_0x3324b2[_0x9682('0x2d')],qs[_0x9682('0x2e')](_0x6e3eaa[_0x9682('0x28')][_0x9682('0x2e')]));_0x46b5c6[_0x9682('0x2b')]=_0x46b5c6['attributes'][_0x9682('0x2f')]?_0x46b5c6['attributes']:_0x3324b2[_0x9682('0x2d')];if(_0x6e3eaa[_0x9682('0x28')][_0x9682('0x3b')]){_0x46b5c6[_0x9682('0x41')]=[{'all':!![]}];}_0x46b5c6=_[_0x9682('0x36')]({},_0x46b5c6,_0x6e3eaa[_0x9682('0x42')]);return db[_0x9682('0x39')][_0x9682('0x43')](_0x46b5c6)['then'](handleEntityNotFound(_0x2d9b43,null))[_0x9682('0x1f')](respondWithResult(_0x2d9b43,null))[_0x9682('0x3e')](handleError(_0x2d9b43,null));};exports[_0x9682('0x44')]=function(_0x1d09a4,_0xd99414){return db[_0x9682('0x39')]['create'](_0x1d09a4[_0x9682('0x45')],{})[_0x9682('0x1f')](respondWithResult(_0xd99414,0xc9))[_0x9682('0x3e')](handleError(_0xd99414,null));};exports[_0x9682('0x1e')]=function(_0x3c79ce,_0x2cc99b){if(_0x3c79ce[_0x9682('0x45')]['id']){delete _0x3c79ce[_0x9682('0x45')]['id'];}return db[_0x9682('0x39')][_0x9682('0x43')]({'where':{'id':_0x3c79ce['params']['id']}})['then'](handleEntityNotFound(_0x2cc99b,null))['then'](saveUpdates(_0x3c79ce['body'],null))['then'](respondWithResult(_0x2cc99b,null))[_0x9682('0x3e')](handleError(_0x2cc99b,null));};exports[_0x9682('0x20')]=function(_0x731dd0,_0x5154c7){return db[_0x9682('0x39')][_0x9682('0x43')]({'where':{'id':_0x731dd0[_0x9682('0x40')]['id']}})['then'](handleEntityNotFound(_0x5154c7,null))[_0x9682('0x1f')](removeEntity(_0x5154c7,null))[_0x9682('0x3e')](handleError(_0x5154c7,null));};exports[_0x9682('0x46')]=function(_0x29fa7f,_0x3357d5){return db[_0x9682('0x39')][_0x9682('0x46')]()['then'](respondWithResult(_0x3357d5,null))[_0x9682('0x3e')](handleError(_0x3357d5,null));};
\ No newline at end of file
+var _0x1fa9=['params','length','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1fa9,0x136));var _0x91fa=function(_0x1a8dd7,_0x17622d){_0x1a8dd7=_0x1a8dd7-0x0;var _0x1d3ec4=_0x1fa9[_0x1a8dd7];return _0x1d3ec4;};'use strict';var emlformat=require(_0x91fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91fa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x91fa('0x2'));var moment=require(_0x91fa('0x3'));var BPromise=require(_0x91fa('0x4'));var Mustache=require('mustache');var util=require(_0x91fa('0x5'));var path=require(_0x91fa('0x6'));var sox=require(_0x91fa('0x7'));var csv=require(_0x91fa('0x8'));var ejs=require(_0x91fa('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x91fa('0xa'));var squel=require(_0x91fa('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x91fa('0xc'));var toCsv=require(_0x91fa('0x8'));var querystring=require(_0x91fa('0xd'));var Papa=require(_0x91fa('0xe'));var Redis=require(_0x91fa('0xf'));var authService=require(_0x91fa('0x10'));var qs=require(_0x91fa('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x91fa('0x12'))(_0x91fa('0x13'));var utils=require(_0x91fa('0x14'));var config=require(_0x91fa('0x15'));var licenseUtil=require(_0x91fa('0x16'));var db=require(_0x91fa('0x17'))['db'];function respondWithStatusCode(_0x1bdb51,_0x578035){_0x578035=_0x578035||0xcc;return function(_0x5a904d){if(_0x5a904d){return _0x1bdb51['sendStatus'](_0x578035);}return _0x1bdb51[_0x91fa('0x18')](_0x578035)['end']();};}function respondWithResult(_0x5f215d,_0x4d95f5){_0x4d95f5=_0x4d95f5||0xc8;return function(_0x4650bf){if(_0x4650bf){return _0x5f215d[_0x91fa('0x18')](_0x4d95f5)['json'](_0x4650bf);}};}function respondWithFilteredResult(_0x308812,_0x252ec7){return function(_0x74c75d){if(_0x74c75d){var _0x2667da=typeof _0x252ec7[_0x91fa('0x19')]===_0x91fa('0x1a')&&typeof _0x252ec7['limit']===_0x91fa('0x1a');var _0x17c4d4=_0x74c75d[_0x91fa('0x1b')];var _0x3916cc=_0x2667da?0x0:_0x252ec7[_0x91fa('0x19')];var _0x4dcbcf=_0x2667da?_0x74c75d[_0x91fa('0x1b')]:_0x252ec7[_0x91fa('0x19')]+_0x252ec7[_0x91fa('0x1c')];var _0x1e3d6f;if(_0x4dcbcf>=_0x17c4d4){_0x4dcbcf=_0x17c4d4;_0x1e3d6f=0xc8;}else{_0x1e3d6f=0xce;}_0x308812[_0x91fa('0x18')](_0x1e3d6f);return _0x308812[_0x91fa('0x1d')](_0x91fa('0x1e'),_0x3916cc+'-'+_0x4dcbcf+'/'+_0x17c4d4)[_0x91fa('0x1f')](_0x74c75d);}return null;};}function patchUpdates(_0xba1e97){return function(_0x274d6f){try{jsonpatch[_0x91fa('0x20')](_0x274d6f,_0xba1e97,!![]);}catch(_0x4a8f08){return BPromise[_0x91fa('0x21')](_0x4a8f08);}return _0x274d6f[_0x91fa('0x22')]();};}function saveUpdates(_0x4ac68d,_0x1a6480){return function(_0x50596c){if(_0x50596c){return _0x50596c[_0x91fa('0x23')](_0x4ac68d)['then'](function(_0x4e619c){return _0x4e619c;});}return null;};}function removeEntity(_0x5d89f9,_0x2ed86d){return function(_0x6d4e53){if(_0x6d4e53){return _0x6d4e53[_0x91fa('0x24')]()[_0x91fa('0x25')](function(){_0x5d89f9[_0x91fa('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3048c4,_0xb7a98){return function(_0x252c71){if(!_0x252c71){_0x3048c4[_0x91fa('0x26')](0x194);}return _0x252c71;};}function handleError(_0x4b0090,_0x5a9554){_0x5a9554=_0x5a9554||0x1f4;return function(_0x2aa3d7){logger[_0x91fa('0x27')](_0x2aa3d7[_0x91fa('0x28')]);if(_0x2aa3d7[_0x91fa('0x29')]){delete _0x2aa3d7[_0x91fa('0x29')];}_0x4b0090['status'](_0x5a9554)[_0x91fa('0x2a')](_0x2aa3d7);};}exports[_0x91fa('0x2b')]=function(_0x402884,_0x5601c4){var _0x518cae={},_0x342670={},_0x45a0e8={'count':0x0,'rows':[]};var _0x3ec667=_[_0x91fa('0x2c')](db[_0x91fa('0x2d')][_0x91fa('0x2e')],function(_0x27ed0e){return{'name':_0x27ed0e[_0x91fa('0x2f')],'type':_0x27ed0e[_0x91fa('0x30')][_0x91fa('0x31')]};});_0x342670[_0x91fa('0x32')]=_['map'](_0x3ec667,'name');_0x342670[_0x91fa('0x33')]=_[_0x91fa('0x34')](_0x402884[_0x91fa('0x33')]);_0x342670[_0x91fa('0x35')]=_[_0x91fa('0x36')](_0x342670[_0x91fa('0x32')],_0x342670['query']);_0x518cae[_0x91fa('0x37')]=_[_0x91fa('0x36')](_0x342670[_0x91fa('0x32')],qs[_0x91fa('0x38')](_0x402884[_0x91fa('0x33')][_0x91fa('0x38')]));_0x518cae[_0x91fa('0x37')]=_0x518cae[_0x91fa('0x37')]['length']?_0x518cae['attributes']:_0x342670[_0x91fa('0x32')];if(!_0x402884[_0x91fa('0x33')]['hasOwnProperty'](_0x91fa('0x39'))){_0x518cae['limit']=qs['limit'](_0x402884[_0x91fa('0x33')][_0x91fa('0x1c')]);_0x518cae[_0x91fa('0x19')]=qs['offset'](_0x402884[_0x91fa('0x33')][_0x91fa('0x19')]);}_0x518cae[_0x91fa('0x3a')]=qs[_0x91fa('0x3b')](_0x402884[_0x91fa('0x33')][_0x91fa('0x3b')]);_0x518cae[_0x91fa('0x3c')]=qs['filters'](_[_0x91fa('0x3d')](_0x402884[_0x91fa('0x33')],_0x342670['filters']),_0x3ec667);if(_0x402884['query'][_0x91fa('0x3e')]){_0x518cae[_0x91fa('0x3c')]=_['merge'](_0x518cae[_0x91fa('0x3c')],{'$or':_[_0x91fa('0x2c')](_0x3ec667,function(_0x4baaf3){if(_0x4baaf3[_0x91fa('0x30')]!=='VIRTUAL'){var _0x5846ee={};_0x5846ee[_0x4baaf3[_0x91fa('0x29')]]={'$like':'%'+_0x402884[_0x91fa('0x33')]['filter']+'%'};return _0x5846ee;}})});}_0x518cae=_[_0x91fa('0x3f')]({},_0x518cae,_0x402884[_0x91fa('0x40')]);var _0x5e4495={'where':_0x518cae[_0x91fa('0x3c')]};return db['ChatQueueReport'][_0x91fa('0x1b')](_0x5e4495)['then'](function(_0x396a91){_0x45a0e8['count']=_0x396a91;if(_0x402884[_0x91fa('0x33')][_0x91fa('0x41')]){_0x518cae[_0x91fa('0x42')]=[{'all':!![]}];}return db[_0x91fa('0x2d')]['findAll'](_0x518cae);})[_0x91fa('0x25')](function(_0x337c8b){_0x45a0e8[_0x91fa('0x43')]=_0x337c8b;return _0x45a0e8;})[_0x91fa('0x25')](respondWithFilteredResult(_0x5601c4,_0x518cae))[_0x91fa('0x44')](handleError(_0x5601c4,null));};exports[_0x91fa('0x45')]=function(_0x5dad2e,_0x382fb5){var _0x47bd8a={'raw':!![],'where':{'id':_0x5dad2e[_0x91fa('0x46')]['id']}},_0x4cdd67={};_0x4cdd67[_0x91fa('0x32')]=_[_0x91fa('0x34')](db[_0x91fa('0x2d')][_0x91fa('0x2e')]);_0x4cdd67[_0x91fa('0x33')]=_[_0x91fa('0x34')](_0x5dad2e['query']);_0x4cdd67[_0x91fa('0x35')]=_['intersection'](_0x4cdd67[_0x91fa('0x32')],_0x4cdd67[_0x91fa('0x33')]);_0x47bd8a[_0x91fa('0x37')]=_[_0x91fa('0x36')](_0x4cdd67[_0x91fa('0x32')],qs[_0x91fa('0x38')](_0x5dad2e[_0x91fa('0x33')][_0x91fa('0x38')]));_0x47bd8a[_0x91fa('0x37')]=_0x47bd8a[_0x91fa('0x37')][_0x91fa('0x47')]?_0x47bd8a[_0x91fa('0x37')]:_0x4cdd67[_0x91fa('0x32')];if(_0x5dad2e[_0x91fa('0x33')][_0x91fa('0x41')]){_0x47bd8a['include']=[{'all':!![]}];}_0x47bd8a=_[_0x91fa('0x3f')]({},_0x47bd8a,_0x5dad2e[_0x91fa('0x40')]);return db[_0x91fa('0x2d')][_0x91fa('0x48')](_0x47bd8a)[_0x91fa('0x25')](handleEntityNotFound(_0x382fb5,null))[_0x91fa('0x25')](respondWithResult(_0x382fb5,null))[_0x91fa('0x44')](handleError(_0x382fb5,null));};exports[_0x91fa('0x49')]=function(_0x50aa1b,_0x3c554c){return db[_0x91fa('0x2d')][_0x91fa('0x49')](_0x50aa1b[_0x91fa('0x4a')],{})['then'](respondWithResult(_0x3c554c,0xc9))[_0x91fa('0x44')](handleError(_0x3c554c,null));};exports[_0x91fa('0x23')]=function(_0x27645d,_0x3f8ad7){if(_0x27645d[_0x91fa('0x4a')]['id']){delete _0x27645d['body']['id'];}return db[_0x91fa('0x2d')]['find']({'where':{'id':_0x27645d[_0x91fa('0x46')]['id']}})[_0x91fa('0x25')](handleEntityNotFound(_0x3f8ad7,null))[_0x91fa('0x25')](saveUpdates(_0x27645d[_0x91fa('0x4a')],null))[_0x91fa('0x25')](respondWithResult(_0x3f8ad7,null))[_0x91fa('0x44')](handleError(_0x3f8ad7,null));};exports[_0x91fa('0x24')]=function(_0x6c02b9,_0x36f280){return db[_0x91fa('0x2d')][_0x91fa('0x48')]({'where':{'id':_0x6c02b9['params']['id']}})[_0x91fa('0x25')](handleEntityNotFound(_0x36f280,null))['then'](removeEntity(_0x36f280,null))['catch'](handleError(_0x36f280,null));};exports['describe']=function(_0x49b160,_0x5e4c9a){return db[_0x91fa('0x2d')][_0x91fa('0x4b')]()[_0x91fa('0x25')](respondWithResult(_0x5e4c9a,null))[_0x91fa('0x44')](handleError(_0x5e4c9a,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 270e8c0..91f38d8 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x39f178,_0x29ce97){var _0x40ba9a=function(_0x109872){while(--_0x109872){_0x39f178['push'](_0x39f178['shift']());}};_0x40ba9a(++_0x29ce97);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0xdfbca7,_0x791315){var _0x124c4c=function(_0x5e8742){while(--_0x5e8742){_0xdfbca7['push'](_0xdfbca7['shift']());}};_0x124c4c(++_0x791315);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xb7e7[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index d2b5b01..87930cf 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 _0x3c55=['request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatQueueReport','create','body','raw','CreateChatQueueReport','UpdateChatQueueReport','update','options','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x3c55,0x7d));var _0x53c5=function(_0x2291d7,_0x41b380){_0x2291d7=_0x2291d7-0x0;var _0x2bb65d=_0x3c55[_0x2291d7];return _0x2bb65d;};'use strict';var _=require(_0x53c5('0x0'));var util=require('util');var moment=require(_0x53c5('0x1'));var BPromise=require(_0x53c5('0x2'));var rs=require(_0x53c5('0x3'));var fs=require('fs');var Redis=require(_0x53c5('0x4'));var db=require(_0x53c5('0x5'))['db'];var utils=require(_0x53c5('0x6'));var logger=require(_0x53c5('0x7'))('rpc');var config=require(_0x53c5('0x8'));var jayson=require(_0x53c5('0x9'));var client=jayson['client'][_0x53c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x470098,_0x13b30b,_0x391bf0){return new BPromise(function(_0x4391ff,_0x53f017){return client[_0x53c5('0xb')](_0x470098,_0x391bf0)[_0x53c5('0xc')](function(_0x239b10){logger[_0x53c5('0xd')](_0x53c5('0xe'),_0x13b30b,'request\x20sent');logger[_0x53c5('0xf')](_0x53c5('0x10'),_0x13b30b,_0x53c5('0x11'),JSON[_0x53c5('0x12')](_0x239b10));if(_0x239b10[_0x53c5('0x13')]){if(_0x239b10[_0x53c5('0x13')][_0x53c5('0x14')]===0x1f4){logger[_0x53c5('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x13b30b,_0x239b10[_0x53c5('0x13')][_0x53c5('0x15')]);return _0x53f017(_0x239b10[_0x53c5('0x13')][_0x53c5('0x15')]);}logger[_0x53c5('0x13')](_0x53c5('0xe'),_0x13b30b,_0x239b10[_0x53c5('0x13')][_0x53c5('0x15')]);return _0x4391ff(_0x239b10[_0x53c5('0x13')]['message']);}else{logger[_0x53c5('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x13b30b,'request\x20sent');_0x4391ff(_0x239b10[_0x53c5('0x16')][_0x53c5('0x15')]);}})[_0x53c5('0x17')](function(_0x4b6b1c){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x13b30b,_0x4b6b1c);_0x53f017(_0x4b6b1c);});});}exports['CreateChatQueueReport']=function(_0x164a92){var _0x4a329d=this;return new Promise(function(_0x3059ff,_0xbe7bbc){return db[_0x53c5('0x18')][_0x53c5('0x19')](_0x164a92[_0x53c5('0x1a')],{'raw':_0x164a92['options']?_0x164a92['options'][_0x53c5('0x1b')]===undefined?!![]:![]:!![]})[_0x53c5('0xc')](function(_0xe7ecc5){logger[_0x53c5('0xd')](_0x53c5('0x1c'),_0x164a92);logger['debug'](_0x53c5('0x1c'),_0x164a92,JSON['stringify'](_0xe7ecc5));_0x3059ff(_0xe7ecc5);})[_0x53c5('0x17')](function(_0x127e84){logger['error']('CreateChatQueueReport',_0x127e84[_0x53c5('0x15')],_0x164a92);_0xbe7bbc(_0x4a329d[_0x53c5('0x13')](0x1f4,_0x127e84[_0x53c5('0x15')]));});});};exports[_0x53c5('0x1d')]=function(_0x517539){var _0x507119=this;return new Promise(function(_0x3b1ce9,_0x25fcc4){return db[_0x53c5('0x18')][_0x53c5('0x1e')](_0x517539['body'],{'raw':_0x517539[_0x53c5('0x1f')]?_0x517539[_0x53c5('0x1f')][_0x53c5('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x517539[_0x53c5('0x1f')]?_0x517539[_0x53c5('0x1f')][_0x53c5('0x20')]||null:null,'attributes':_0x517539[_0x53c5('0x1f')]?_0x517539[_0x53c5('0x1f')][_0x53c5('0x21')]||null:null,'limit':_0x517539['options']?_0x517539[_0x53c5('0x1f')]['limit']||null:null})[_0x53c5('0xc')](function(_0x24084c){logger[_0x53c5('0xd')](_0x53c5('0x1d'),_0x517539);logger['debug'](_0x53c5('0x1d'),_0x517539,JSON[_0x53c5('0x12')](_0x24084c));_0x3b1ce9(_0x24084c);})[_0x53c5('0x17')](function(_0x4b73b8){logger[_0x53c5('0x13')](_0x53c5('0x1d'),_0x4b73b8['message'],_0x517539);_0x25fcc4(_0x507119[_0x53c5('0x13')](0x1f4,_0x4b73b8['message']));});});};
\ No newline at end of file
+var _0xc8b8=['rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','debug','UpdateChatQueueReport','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xc8b8,0x99));var _0x8c8b=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0xc8b8[_0x59616b];return _0x5c4523;};'use strict';var _=require(_0x8c8b('0x0'));var util=require(_0x8c8b('0x1'));var moment=require(_0x8c8b('0x2'));var BPromise=require(_0x8c8b('0x3'));var rs=require(_0x8c8b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c8b('0x5'))['db'];var utils=require(_0x8c8b('0x6'));var logger=require('../../config/logger')(_0x8c8b('0x7'));var config=require(_0x8c8b('0x8'));var jayson=require(_0x8c8b('0x9'));var client=jayson['client'][_0x8c8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a8b38,_0x58bb2e,_0x16c4f8){return new BPromise(function(_0x4d379f,_0x3d4a95){return client[_0x8c8b('0xb')](_0x2a8b38,_0x16c4f8)[_0x8c8b('0xc')](function(_0x4c09d2){logger[_0x8c8b('0xd')](_0x8c8b('0xe'),_0x58bb2e,_0x8c8b('0xf'));logger['debug'](_0x8c8b('0x10'),_0x58bb2e,_0x8c8b('0xf'),JSON[_0x8c8b('0x11')](_0x4c09d2));if(_0x4c09d2[_0x8c8b('0x12')]){if(_0x4c09d2[_0x8c8b('0x12')]['code']===0x1f4){logger[_0x8c8b('0x12')](_0x8c8b('0xe'),_0x58bb2e,_0x4c09d2[_0x8c8b('0x12')][_0x8c8b('0x13')]);return _0x3d4a95(_0x4c09d2[_0x8c8b('0x12')][_0x8c8b('0x13')]);}logger['error'](_0x8c8b('0xe'),_0x58bb2e,_0x4c09d2[_0x8c8b('0x12')][_0x8c8b('0x13')]);return _0x4d379f(_0x4c09d2['error'][_0x8c8b('0x13')]);}else{logger[_0x8c8b('0xd')](_0x8c8b('0xe'),_0x58bb2e,_0x8c8b('0xf'));_0x4d379f(_0x4c09d2[_0x8c8b('0x14')]['message']);}})[_0x8c8b('0x15')](function(_0x5577c8){logger[_0x8c8b('0x12')](_0x8c8b('0xe'),_0x58bb2e,_0x5577c8);_0x3d4a95(_0x5577c8);});});}exports['CreateChatQueueReport']=function(_0x104b1f){var _0x40730d=this;return new Promise(function(_0x733514,_0x8076c){return db[_0x8c8b('0x16')][_0x8c8b('0x17')](_0x104b1f[_0x8c8b('0x18')],{'raw':_0x104b1f[_0x8c8b('0x19')]?_0x104b1f['options'][_0x8c8b('0x1a')]===undefined?!![]:![]:!![]})[_0x8c8b('0xc')](function(_0x193e72){logger[_0x8c8b('0xd')](_0x8c8b('0x1b'),_0x104b1f);logger[_0x8c8b('0x1c')](_0x8c8b('0x1b'),_0x104b1f,JSON['stringify'](_0x193e72));_0x733514(_0x193e72);})['catch'](function(_0x415991){logger[_0x8c8b('0x12')]('CreateChatQueueReport',_0x415991['message'],_0x104b1f);_0x8076c(_0x40730d[_0x8c8b('0x12')](0x1f4,_0x415991[_0x8c8b('0x13')]));});});};exports[_0x8c8b('0x1d')]=function(_0x5d7d6e){var _0x33f9f7=this;return new Promise(function(_0x5108e3,_0x1afbb9){return db['ChatQueueReport']['update'](_0x5d7d6e[_0x8c8b('0x18')],{'raw':_0x5d7d6e[_0x8c8b('0x19')]?_0x5d7d6e[_0x8c8b('0x19')][_0x8c8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d7d6e[_0x8c8b('0x19')]?_0x5d7d6e[_0x8c8b('0x19')][_0x8c8b('0x1e')]||null:null,'attributes':_0x5d7d6e[_0x8c8b('0x19')]?_0x5d7d6e['options'][_0x8c8b('0x1f')]||null:null,'limit':_0x5d7d6e[_0x8c8b('0x19')]?_0x5d7d6e['options']['limit']||null:null})[_0x8c8b('0xc')](function(_0x496161){logger[_0x8c8b('0xd')](_0x8c8b('0x1d'),_0x5d7d6e);logger[_0x8c8b('0x1c')](_0x8c8b('0x1d'),_0x5d7d6e,JSON[_0x8c8b('0x11')](_0x496161));_0x5108e3(_0x496161);})[_0x8c8b('0x15')](function(_0x4c56fc){logger['error'](_0x8c8b('0x1d'),_0x4c56fc['message'],_0x5d7d6e);_0x1afbb9(_0x33f9f7[_0x8c8b('0x12')](0x1f4,_0x4c56fc[_0x8c8b('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 39174d9..97aee7e 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 _0xdbbc=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x2402dd,_0x3eb7d8){var _0x21b85c=function(_0x282768){while(--_0x282768){_0x2402dd['push'](_0x2402dd['shift']());}};_0x21b85c(++_0x3eb7d8);}(_0xdbbc,0x170));var _0xcdbb=function(_0x3b3f90,_0x388364){_0x3b3f90=_0x3b3f90-0x0;var _0x52522e=_0xdbbc[_0x3b3f90];return _0x52522e;};'use strict';var multer=require(_0xcdbb('0x0'));var util=require(_0xcdbb('0x1'));var path=require(_0xcdbb('0x2'));var timeout=require('connect-timeout');var express=require(_0xcdbb('0x3'));var router=express['Router']();var fs_extra=require(_0xcdbb('0x4'));var auth=require(_0xcdbb('0x5'));var interaction=require(_0xcdbb('0x6'));var config=require(_0xcdbb('0x7'));var controller=require(_0xcdbb('0x8'));router[_0xcdbb('0x9')]('/',auth[_0xcdbb('0xa')](),controller[_0xcdbb('0xb')]);router['get'](_0xcdbb('0xc'),auth[_0xcdbb('0xa')](),controller[_0xcdbb('0xd')]);router[_0xcdbb('0x9')](_0xcdbb('0xe'),auth[_0xcdbb('0xa')](),controller[_0xcdbb('0xf')]);router[_0xcdbb('0x10')]('/',auth['isAuthenticated'](),controller[_0xcdbb('0x11')]);router[_0xcdbb('0x12')](_0xcdbb('0xe'),auth['isAuthenticated'](),controller[_0xcdbb('0x13')]);router[_0xcdbb('0x14')](_0xcdbb('0xe'),auth['isAuthenticated'](),controller[_0xcdbb('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x7009=['post','put','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index'];(function(_0x3d3028,_0x489e13){var _0x341599=function(_0x4f0c43){while(--_0x4f0c43){_0x3d3028['push'](_0x3d3028['shift']());}};_0x341599(++_0x489e13);}(_0x7009,0x73));var _0x9700=function(_0x5a7aa4,_0x190480){_0x5a7aa4=_0x5a7aa4-0x0;var _0x496dc6=_0x7009[_0x5a7aa4];return _0x496dc6;};'use strict';var multer=require('multer');var util=require(_0x9700('0x0'));var path=require(_0x9700('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9700('0x2')]();var fs_extra=require(_0x9700('0x3'));var auth=require(_0x9700('0x4'));var interaction=require(_0x9700('0x5'));var config=require(_0x9700('0x6'));var controller=require(_0x9700('0x7'));router[_0x9700('0x8')]('/',auth[_0x9700('0x9')](),controller[_0x9700('0xa')]);router[_0x9700('0x8')]('/describe',auth[_0x9700('0x9')](),controller['describe']);router[_0x9700('0x8')]('/:id',auth[_0x9700('0x9')](),controller['show']);router[_0x9700('0xb')]('/',auth[_0x9700('0x9')](),controller['create']);router[_0x9700('0xc')]('/:id',auth[_0x9700('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9700('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 32e98fb..770b374 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x2eb3db,_0x4a32c0){var _0x358f33=function(_0x1d0588){while(--_0x1d0588){_0x2eb3db['push'](_0x2eb3db['shift']());}};_0x358f33(++_0x4a32c0);}(_0xb43b,0x1b2));var _0xbb43=function(_0x6c7c2c,_0x1c956b){_0x6c7c2c=_0x6c7c2c-0x0;var _0x5df439=_0xb43b[_0x6c7c2c];return _0x5df439;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x2f8bc5,_0x12e3d1){var _0x2e4207=function(_0x217405){while(--_0x217405){_0x2f8bc5['push'](_0x2f8bc5['shift']());}};_0x2e4207(++_0x12e3d1);}(_0x008c,0x188));var _0xc008=function(_0x3ab6cb,_0x591249){_0x3ab6cb=_0x3ab6cb-0x0;var _0x108ae5=_0x008c[_0x3ab6cb];return _0x108ae5;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index a7c5d81..2029ece 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 _0xe277=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','save','update','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','merge','VIRTUAL','options','includeAll','include','ChatTransferReport','findAll','catch','show','params','find','then','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x4f0b54,_0x301666){var _0x3e2440=function(_0x1369e2){while(--_0x1369e2){_0x4f0b54['push'](_0x4f0b54['shift']());}};_0x3e2440(++_0x301666);}(_0xe277,0xca));var _0x7e27=function(_0x2fb29e,_0x2b1bea){_0x2fb29e=_0x2fb29e-0x0;var _0x718e4e=_0xe277[_0x2fb29e];return _0x718e4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e27('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e27('0x1'));var rp=require(_0x7e27('0x2'));var moment=require(_0x7e27('0x3'));var BPromise=require(_0x7e27('0x4'));var Mustache=require(_0x7e27('0x5'));var util=require(_0x7e27('0x6'));var path=require(_0x7e27('0x7'));var sox=require(_0x7e27('0x8'));var csv=require(_0x7e27('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7e27('0xa'));var _=require(_0x7e27('0xb'));var squel=require(_0x7e27('0xc'));var crypto=require(_0x7e27('0xd'));var jsforce=require(_0x7e27('0xe'));var deskjs=require(_0x7e27('0xf'));var toCsv=require(_0x7e27('0x9'));var querystring=require('querystring');var Papa=require(_0x7e27('0x10'));var Redis=require(_0x7e27('0x11'));var authService=require(_0x7e27('0x12'));var qs=require(_0x7e27('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e27('0x14'));var logger=require(_0x7e27('0x15'))('api');var utils=require(_0x7e27('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7e27('0x17'));var db=require(_0x7e27('0x18'))['db'];function respondWithStatusCode(_0x20c1eb,_0x2358ed){_0x2358ed=_0x2358ed||0xcc;return function(_0x560dc1){if(_0x560dc1){return _0x20c1eb['sendStatus'](_0x2358ed);}return _0x20c1eb[_0x7e27('0x19')](_0x2358ed)[_0x7e27('0x1a')]();};}function respondWithResult(_0x28f54a,_0x4541bd){_0x4541bd=_0x4541bd||0xc8;return function(_0x104d8c){if(_0x104d8c){return _0x28f54a[_0x7e27('0x19')](_0x4541bd)[_0x7e27('0x1b')](_0x104d8c);}};}function respondWithFilteredResult(_0x2bca97,_0x129ee7){return function(_0x2e860e){if(_0x2e860e){var _0x29ac9b=typeof _0x129ee7[_0x7e27('0x1c')]===_0x7e27('0x1d')&&typeof _0x129ee7[_0x7e27('0x1e')]===_0x7e27('0x1d');var _0x36bd76=_0x2e860e[_0x7e27('0x1f')];var _0x5ddfae=_0x29ac9b?0x0:_0x129ee7[_0x7e27('0x1c')];var _0x402fa4=_0x29ac9b?_0x2e860e[_0x7e27('0x1f')]:_0x129ee7[_0x7e27('0x1c')]+_0x129ee7[_0x7e27('0x1e')];var _0x27ebfc;if(_0x402fa4>=_0x36bd76){_0x402fa4=_0x36bd76;_0x27ebfc=0xc8;}else{_0x27ebfc=0xce;}_0x2bca97['status'](_0x27ebfc);return _0x2bca97['set']('Content-Range',_0x5ddfae+'-'+_0x402fa4+'/'+_0x36bd76)['json'](_0x2e860e);}return null;};}function patchUpdates(_0x1ae8da){return function(_0x536926){try{jsonpatch['apply'](_0x536926,_0x1ae8da,!![]);}catch(_0x3be779){return BPromise['reject'](_0x3be779);}return _0x536926[_0x7e27('0x20')]();};}function saveUpdates(_0x3f557f,_0x123baa){return function(_0x1f643e){if(_0x1f643e){return _0x1f643e[_0x7e27('0x21')](_0x3f557f)['then'](function(_0x5dde9b){return _0x5dde9b;});}return null;};}function removeEntity(_0x4a4cee,_0x3f9c01){return function(_0x57f5e6){if(_0x57f5e6){return _0x57f5e6[_0x7e27('0x22')]()['then'](function(){_0x4a4cee[_0x7e27('0x19')](0xcc)[_0x7e27('0x1a')]();});}};}function handleEntityNotFound(_0x53751a,_0x513bd9){return function(_0x24f7cf){if(!_0x24f7cf){_0x53751a[_0x7e27('0x23')](0x194);}return _0x24f7cf;};}function handleError(_0x382c90,_0x2ce8da){_0x2ce8da=_0x2ce8da||0x1f4;return function(_0xa87596){logger[_0x7e27('0x24')](_0xa87596['stack']);if(_0xa87596[_0x7e27('0x25')]){delete _0xa87596[_0x7e27('0x25')];}_0x382c90[_0x7e27('0x19')](_0x2ce8da)[_0x7e27('0x26')](_0xa87596);};}exports[_0x7e27('0x27')]=function(_0x621960,_0xad8f54){var _0x220870={},_0x22b67c={},_0x585030={'count':0x0,'rows':[]};var _0x2e7864=_[_0x7e27('0x28')](db['ChatTransferReport'][_0x7e27('0x29')],function(_0x2c31e0){return{'name':_0x2c31e0[_0x7e27('0x2a')],'type':_0x2c31e0[_0x7e27('0x2b')]['key']};});_0x22b67c[_0x7e27('0x2c')]=_[_0x7e27('0x28')](_0x2e7864,_0x7e27('0x25'));_0x22b67c[_0x7e27('0x2d')]=_[_0x7e27('0x2e')](_0x621960[_0x7e27('0x2d')]);_0x22b67c[_0x7e27('0x2f')]=_[_0x7e27('0x30')](_0x22b67c[_0x7e27('0x2c')],_0x22b67c['query']);_0x220870['attributes']=_[_0x7e27('0x30')](_0x22b67c['model'],qs[_0x7e27('0x31')](_0x621960['query'][_0x7e27('0x31')]));_0x220870[_0x7e27('0x32')]=_0x220870[_0x7e27('0x32')][_0x7e27('0x33')]?_0x220870['attributes']:_0x22b67c['model'];if(!_0x621960[_0x7e27('0x2d')]['hasOwnProperty']('nolimit')){_0x220870[_0x7e27('0x1e')]=qs[_0x7e27('0x1e')](_0x621960['query']['limit']);_0x220870[_0x7e27('0x1c')]=qs[_0x7e27('0x1c')](_0x621960[_0x7e27('0x2d')][_0x7e27('0x1c')]);}_0x220870[_0x7e27('0x34')]=qs[_0x7e27('0x35')](_0x621960[_0x7e27('0x2d')][_0x7e27('0x35')]);_0x220870[_0x7e27('0x36')]=qs[_0x7e27('0x2f')](_['pick'](_0x621960[_0x7e27('0x2d')],_0x22b67c[_0x7e27('0x2f')]),_0x2e7864);if(_0x621960[_0x7e27('0x2d')]['filter']){_0x220870[_0x7e27('0x36')]=_[_0x7e27('0x37')](_0x220870[_0x7e27('0x36')],{'$or':_['map'](_0x2e7864,function(_0x3d8eb8){if(_0x3d8eb8[_0x7e27('0x2b')]!==_0x7e27('0x38')){var _0x1da0d={};_0x1da0d[_0x3d8eb8['name']]={'$like':'%'+_0x621960['query']['filter']+'%'};return _0x1da0d;}})});}_0x220870=_[_0x7e27('0x37')]({},_0x220870,_0x621960[_0x7e27('0x39')]);var _0x575869={'where':_0x220870['where']};return db['ChatTransferReport']['count'](_0x575869)['then'](function(_0x454bcc){_0x585030[_0x7e27('0x1f')]=_0x454bcc;if(_0x621960[_0x7e27('0x2d')][_0x7e27('0x3a')]){_0x220870[_0x7e27('0x3b')]=[{'all':!![]}];}return db[_0x7e27('0x3c')][_0x7e27('0x3d')](_0x220870);})['then'](function(_0x1ac66b){_0x585030['rows']=_0x1ac66b;return _0x585030;})['then'](respondWithFilteredResult(_0xad8f54,_0x220870))[_0x7e27('0x3e')](handleError(_0xad8f54,null));};exports[_0x7e27('0x3f')]=function(_0x337f9d,_0x5a7465){var _0x5f4ff6={'raw':!![],'where':{'id':_0x337f9d[_0x7e27('0x40')]['id']}},_0x167c6a={};_0x167c6a[_0x7e27('0x2c')]=_[_0x7e27('0x2e')](db[_0x7e27('0x3c')][_0x7e27('0x29')]);_0x167c6a['query']=_['keys'](_0x337f9d[_0x7e27('0x2d')]);_0x167c6a[_0x7e27('0x2f')]=_[_0x7e27('0x30')](_0x167c6a[_0x7e27('0x2c')],_0x167c6a['query']);_0x5f4ff6[_0x7e27('0x32')]=_[_0x7e27('0x30')](_0x167c6a[_0x7e27('0x2c')],qs['fields'](_0x337f9d[_0x7e27('0x2d')][_0x7e27('0x31')]));_0x5f4ff6[_0x7e27('0x32')]=_0x5f4ff6['attributes'][_0x7e27('0x33')]?_0x5f4ff6[_0x7e27('0x32')]:_0x167c6a[_0x7e27('0x2c')];if(_0x337f9d[_0x7e27('0x2d')]['includeAll']){_0x5f4ff6[_0x7e27('0x3b')]=[{'all':!![]}];}_0x5f4ff6=_[_0x7e27('0x37')]({},_0x5f4ff6,_0x337f9d['options']);return db[_0x7e27('0x3c')][_0x7e27('0x41')](_0x5f4ff6)[_0x7e27('0x42')](handleEntityNotFound(_0x5a7465,null))['then'](respondWithResult(_0x5a7465,null))[_0x7e27('0x3e')](handleError(_0x5a7465,null));};exports[_0x7e27('0x43')]=function(_0x42a6f1,_0x38c237){return db[_0x7e27('0x3c')][_0x7e27('0x43')](_0x42a6f1[_0x7e27('0x44')],{})[_0x7e27('0x42')](respondWithResult(_0x38c237,0xc9))[_0x7e27('0x3e')](handleError(_0x38c237,null));};exports[_0x7e27('0x21')]=function(_0x55cfa5,_0x571559){if(_0x55cfa5[_0x7e27('0x44')]['id']){delete _0x55cfa5[_0x7e27('0x44')]['id'];}return db[_0x7e27('0x3c')]['find']({'where':{'id':_0x55cfa5[_0x7e27('0x40')]['id']}})[_0x7e27('0x42')](handleEntityNotFound(_0x571559,null))['then'](saveUpdates(_0x55cfa5[_0x7e27('0x44')],null))[_0x7e27('0x42')](respondWithResult(_0x571559,null))['catch'](handleError(_0x571559,null));};exports[_0x7e27('0x22')]=function(_0x236d1f,_0x3b0b14){return db[_0x7e27('0x3c')]['find']({'where':{'id':_0x236d1f['params']['id']}})[_0x7e27('0x42')](handleEntityNotFound(_0x3b0b14,null))[_0x7e27('0x42')](removeEntity(_0x3b0b14,null))[_0x7e27('0x3e')](handleError(_0x3b0b14,null));};exports[_0x7e27('0x45')]=function(_0x814079,_0x1abc0d){return db[_0x7e27('0x3c')][_0x7e27('0x45')]()[_0x7e27('0x42')](respondWithResult(_0x1abc0d,null))[_0x7e27('0x3e')](handleError(_0x1abc0d,null));};
\ No newline at end of file
+var _0xb697=['rimraf','request-promise','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','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','update','destroy','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','length','order','sort','where','pick','merge','filter','options','rows','catch','show','params','includeAll','include','create','body','find','describe','eml-format'];(function(_0xc5f15,_0x3f18b5){var _0x466999=function(_0x24250d){while(--_0x24250d){_0xc5f15['push'](_0xc5f15['shift']());}};_0x466999(++_0x3f18b5);}(_0xb697,0xcb));var _0x7b69=function(_0x5805b0,_0x2d205d){_0x5805b0=_0x5805b0-0x0;var _0x1679c7=_0xb697[_0x5805b0];return _0x1679c7;};'use strict';var emlformat=require(_0x7b69('0x0'));var rimraf=require(_0x7b69('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7b69('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7b69('0x3'));var path=require(_0x7b69('0x4'));var sox=require(_0x7b69('0x5'));var csv=require(_0x7b69('0x6'));var ejs=require(_0x7b69('0x7'));var fs=require('fs');var fs_extra=require(_0x7b69('0x8'));var _=require(_0x7b69('0x9'));var squel=require(_0x7b69('0xa'));var crypto=require(_0x7b69('0xb'));var jsforce=require(_0x7b69('0xc'));var deskjs=require(_0x7b69('0xd'));var toCsv=require(_0x7b69('0x6'));var querystring=require(_0x7b69('0xe'));var Papa=require('papaparse');var Redis=require(_0x7b69('0xf'));var authService=require(_0x7b69('0x10'));var qs=require(_0x7b69('0x11'));var as=require(_0x7b69('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7b69('0x13'));var utils=require('../../config/utils');var config=require(_0x7b69('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7b69('0x15'))['db'];function respondWithStatusCode(_0x395721,_0x5bd135){_0x5bd135=_0x5bd135||0xcc;return function(_0x1d9e85){if(_0x1d9e85){return _0x395721[_0x7b69('0x16')](_0x5bd135);}return _0x395721[_0x7b69('0x17')](_0x5bd135)[_0x7b69('0x18')]();};}function respondWithResult(_0x1d7142,_0x30f57f){_0x30f57f=_0x30f57f||0xc8;return function(_0x361f6c){if(_0x361f6c){return _0x1d7142[_0x7b69('0x17')](_0x30f57f)['json'](_0x361f6c);}};}function respondWithFilteredResult(_0x1e3a74,_0x20d466){return function(_0x3c6e6c){if(_0x3c6e6c){var _0x1e3df5=typeof _0x20d466[_0x7b69('0x19')]===_0x7b69('0x1a')&&typeof _0x20d466[_0x7b69('0x1b')]==='undefined';var _0x476b61=_0x3c6e6c[_0x7b69('0x1c')];var _0x31b88e=_0x1e3df5?0x0:_0x20d466[_0x7b69('0x19')];var _0x11a874=_0x1e3df5?_0x3c6e6c[_0x7b69('0x1c')]:_0x20d466['offset']+_0x20d466[_0x7b69('0x1b')];var _0xe00fd7;if(_0x11a874>=_0x476b61){_0x11a874=_0x476b61;_0xe00fd7=0xc8;}else{_0xe00fd7=0xce;}_0x1e3a74[_0x7b69('0x17')](_0xe00fd7);return _0x1e3a74['set'](_0x7b69('0x1d'),_0x31b88e+'-'+_0x11a874+'/'+_0x476b61)['json'](_0x3c6e6c);}return null;};}function patchUpdates(_0x3a2ed2){return function(_0x27d9b4){try{jsonpatch['apply'](_0x27d9b4,_0x3a2ed2,!![]);}catch(_0x166436){return BPromise[_0x7b69('0x1e')](_0x166436);}return _0x27d9b4['save']();};}function saveUpdates(_0x29f7ea,_0x5d83a6){return function(_0x4147a6){if(_0x4147a6){return _0x4147a6[_0x7b69('0x1f')](_0x29f7ea)['then'](function(_0x2be697){return _0x2be697;});}return null;};}function removeEntity(_0x23e1d3,_0x219570){return function(_0x5c5920){if(_0x5c5920){return _0x5c5920[_0x7b69('0x20')]()[_0x7b69('0x21')](function(){_0x23e1d3[_0x7b69('0x17')](0xcc)[_0x7b69('0x18')]();});}};}function handleEntityNotFound(_0x422294,_0x5e6ae3){return function(_0x26c953){if(!_0x26c953){_0x422294['sendStatus'](0x194);}return _0x26c953;};}function handleError(_0x868858,_0x505f36){_0x505f36=_0x505f36||0x1f4;return function(_0x31abff){logger[_0x7b69('0x22')](_0x31abff[_0x7b69('0x23')]);if(_0x31abff[_0x7b69('0x24')]){delete _0x31abff[_0x7b69('0x24')];}_0x868858[_0x7b69('0x17')](_0x505f36)[_0x7b69('0x25')](_0x31abff);};}exports[_0x7b69('0x26')]=function(_0x1b899a,_0x5ebd12){var _0x5ed6d1={},_0x10872c={},_0x588966={'count':0x0,'rows':[]};var _0x540f4c=_[_0x7b69('0x27')](db[_0x7b69('0x28')][_0x7b69('0x29')],function(_0x29c581){return{'name':_0x29c581[_0x7b69('0x2a')],'type':_0x29c581[_0x7b69('0x2b')]['key']};});_0x10872c[_0x7b69('0x2c')]=_['map'](_0x540f4c,_0x7b69('0x24'));_0x10872c['query']=_['keys'](_0x1b899a['query']);_0x10872c[_0x7b69('0x2d')]=_[_0x7b69('0x2e')](_0x10872c[_0x7b69('0x2c')],_0x10872c[_0x7b69('0x2f')]);_0x5ed6d1[_0x7b69('0x30')]=_[_0x7b69('0x2e')](_0x10872c[_0x7b69('0x2c')],qs[_0x7b69('0x31')](_0x1b899a[_0x7b69('0x2f')][_0x7b69('0x31')]));_0x5ed6d1[_0x7b69('0x30')]=_0x5ed6d1['attributes'][_0x7b69('0x32')]?_0x5ed6d1[_0x7b69('0x30')]:_0x10872c[_0x7b69('0x2c')];if(!_0x1b899a[_0x7b69('0x2f')]['hasOwnProperty']('nolimit')){_0x5ed6d1[_0x7b69('0x1b')]=qs[_0x7b69('0x1b')](_0x1b899a['query'][_0x7b69('0x1b')]);_0x5ed6d1[_0x7b69('0x19')]=qs[_0x7b69('0x19')](_0x1b899a[_0x7b69('0x2f')]['offset']);}_0x5ed6d1[_0x7b69('0x33')]=qs['sort'](_0x1b899a[_0x7b69('0x2f')][_0x7b69('0x34')]);_0x5ed6d1[_0x7b69('0x35')]=qs[_0x7b69('0x2d')](_[_0x7b69('0x36')](_0x1b899a[_0x7b69('0x2f')],_0x10872c[_0x7b69('0x2d')]),_0x540f4c);if(_0x1b899a[_0x7b69('0x2f')]['filter']){_0x5ed6d1[_0x7b69('0x35')]=_[_0x7b69('0x37')](_0x5ed6d1['where'],{'$or':_[_0x7b69('0x27')](_0x540f4c,function(_0x2e97cf){if(_0x2e97cf[_0x7b69('0x2b')]!=='VIRTUAL'){var _0x1eb39f={};_0x1eb39f[_0x2e97cf[_0x7b69('0x24')]]={'$like':'%'+_0x1b899a[_0x7b69('0x2f')][_0x7b69('0x38')]+'%'};return _0x1eb39f;}})});}_0x5ed6d1=_[_0x7b69('0x37')]({},_0x5ed6d1,_0x1b899a[_0x7b69('0x39')]);var _0x3246d2={'where':_0x5ed6d1[_0x7b69('0x35')]};return db[_0x7b69('0x28')][_0x7b69('0x1c')](_0x3246d2)['then'](function(_0x4fd981){_0x588966[_0x7b69('0x1c')]=_0x4fd981;if(_0x1b899a[_0x7b69('0x2f')]['includeAll']){_0x5ed6d1['include']=[{'all':!![]}];}return db[_0x7b69('0x28')]['findAll'](_0x5ed6d1);})[_0x7b69('0x21')](function(_0x529b99){_0x588966[_0x7b69('0x3a')]=_0x529b99;return _0x588966;})['then'](respondWithFilteredResult(_0x5ebd12,_0x5ed6d1))[_0x7b69('0x3b')](handleError(_0x5ebd12,null));};exports[_0x7b69('0x3c')]=function(_0xb7d534,_0x3afef1){var _0x9b4f4b={'raw':!![],'where':{'id':_0xb7d534[_0x7b69('0x3d')]['id']}},_0x1472b5={};_0x1472b5[_0x7b69('0x2c')]=_['keys'](db['ChatTransferReport'][_0x7b69('0x29')]);_0x1472b5[_0x7b69('0x2f')]=_['keys'](_0xb7d534[_0x7b69('0x2f')]);_0x1472b5[_0x7b69('0x2d')]=_[_0x7b69('0x2e')](_0x1472b5[_0x7b69('0x2c')],_0x1472b5['query']);_0x9b4f4b[_0x7b69('0x30')]=_['intersection'](_0x1472b5[_0x7b69('0x2c')],qs[_0x7b69('0x31')](_0xb7d534[_0x7b69('0x2f')][_0x7b69('0x31')]));_0x9b4f4b[_0x7b69('0x30')]=_0x9b4f4b[_0x7b69('0x30')][_0x7b69('0x32')]?_0x9b4f4b['attributes']:_0x1472b5[_0x7b69('0x2c')];if(_0xb7d534[_0x7b69('0x2f')][_0x7b69('0x3e')]){_0x9b4f4b[_0x7b69('0x3f')]=[{'all':!![]}];}_0x9b4f4b=_['merge']({},_0x9b4f4b,_0xb7d534[_0x7b69('0x39')]);return db[_0x7b69('0x28')]['find'](_0x9b4f4b)[_0x7b69('0x21')](handleEntityNotFound(_0x3afef1,null))['then'](respondWithResult(_0x3afef1,null))[_0x7b69('0x3b')](handleError(_0x3afef1,null));};exports[_0x7b69('0x40')]=function(_0x15c156,_0x2670b6){return db['ChatTransferReport']['create'](_0x15c156[_0x7b69('0x41')],{})[_0x7b69('0x21')](respondWithResult(_0x2670b6,0xc9))[_0x7b69('0x3b')](handleError(_0x2670b6,null));};exports[_0x7b69('0x1f')]=function(_0x1b2717,_0x2b0b95){if(_0x1b2717[_0x7b69('0x41')]['id']){delete _0x1b2717['body']['id'];}return db[_0x7b69('0x28')]['find']({'where':{'id':_0x1b2717[_0x7b69('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2b0b95,null))['then'](saveUpdates(_0x1b2717[_0x7b69('0x41')],null))[_0x7b69('0x21')](respondWithResult(_0x2b0b95,null))[_0x7b69('0x3b')](handleError(_0x2b0b95,null));};exports[_0x7b69('0x20')]=function(_0x2e2278,_0x432f85){return db['ChatTransferReport'][_0x7b69('0x42')]({'where':{'id':_0x2e2278['params']['id']}})[_0x7b69('0x21')](handleEntityNotFound(_0x432f85,null))[_0x7b69('0x21')](removeEntity(_0x432f85,null))[_0x7b69('0x3b')](handleError(_0x432f85,null));};exports[_0x7b69('0x43')]=function(_0x12ee3b,_0x656b61){return db[_0x7b69('0x28')][_0x7b69('0x43')]()[_0x7b69('0x21')](respondWithResult(_0x656b61,null))[_0x7b69('0x3b')](handleError(_0x656b61,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index cbb402b..788894d 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 _0x1643=['uniqueid','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x46b3c8,_0x58199f){var _0x287b01=function(_0x38c92f){while(--_0x38c92f){_0x46b3c8['push'](_0x46b3c8['shift']());}};_0x287b01(++_0x58199f);}(_0x1643,0x1e1));var _0x3164=function(_0xbfbfd9,_0x33d7e0){_0xbfbfd9=_0xbfbfd9-0x0;var _0x1a7cec=_0x1643[_0xbfbfd9];return _0x1a7cec;};'use strict';var _=require(_0x3164('0x0'));var util=require(_0x3164('0x1'));var logger=require(_0x3164('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3164('0x3'));var rp=require(_0x3164('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3164('0x5'));var attributes=require(_0x3164('0x6'));module[_0x3164('0x7')]=function(_0x42f0da,_0x40e899){return _0x42f0da[_0x3164('0x8')](_0x3164('0x9'),attributes,{'tableName':_0x3164('0xa'),'paranoid':![],'indexes':[{'name':_0x3164('0xb'),'fields':[_0x3164('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4c26=['../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x4c26,0x74));var _0x64c2=function(_0x4c31cd,_0x46b209){_0x4c31cd=_0x4c31cd-0x0;var _0x41c1a1=_0x4c26[_0x4c31cd];return _0x41c1a1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x64c2('0x0'))('api');var moment=require(_0x64c2('0x1'));var BPromise=require(_0x64c2('0x2'));var rp=require(_0x64c2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64c2('0x4'));var config=require(_0x64c2('0x5'));var attributes=require(_0x64c2('0x6'));module['exports']=function(_0x871c1f,_0x306942){return _0x871c1f[_0x64c2('0x7')](_0x64c2('0x8'),attributes,{'tableName':_0x64c2('0x9'),'paranoid':![],'indexes':[{'name':_0x64c2('0xa'),'fields':[_0x64c2('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 37e6ed8..a8c4e47 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 _0x0869=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0x141a1b,_0x48ce01){var _0x54319f=function(_0x841771){while(--_0x841771){_0x141a1b['push'](_0x141a1b['shift']());}};_0x54319f(++_0x48ce01);}(_0x0869,0xd0));var _0x9086=function(_0x128673,_0x1215f0){_0x128673=_0x128673-0x0;var _0x45e047=_0x0869[_0x128673];return _0x45e047;};'use strict';var _=require(_0x9086('0x0'));var util=require(_0x9086('0x1'));var moment=require('moment');var BPromise=require(_0x9086('0x2'));var rs=require(_0x9086('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9086('0x4'))['db'];var utils=require(_0x9086('0x5'));var logger=require('../../config/logger')(_0x9086('0x6'));var config=require('../../config/environment');var jayson=require(_0x9086('0x7'));var client=jayson[_0x9086('0x8')][_0x9086('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f24ce,_0x57a8ac,_0x398411){return new BPromise(function(_0x3f5c03,_0x4421cc){return client[_0x9086('0xa')](_0x1f24ce,_0x398411)[_0x9086('0xb')](function(_0x26235e){logger[_0x9086('0xc')](_0x9086('0xd'),_0x57a8ac,_0x9086('0xe'));logger[_0x9086('0xf')](_0x9086('0x10'),_0x57a8ac,_0x9086('0xe'),JSON[_0x9086('0x11')](_0x26235e));if(_0x26235e[_0x9086('0x12')]){if(_0x26235e[_0x9086('0x12')]['code']===0x1f4){logger[_0x9086('0x12')](_0x9086('0xd'),_0x57a8ac,_0x26235e[_0x9086('0x12')][_0x9086('0x13')]);return _0x4421cc(_0x26235e[_0x9086('0x12')][_0x9086('0x13')]);}logger['error'](_0x9086('0xd'),_0x57a8ac,_0x26235e[_0x9086('0x12')][_0x9086('0x13')]);return _0x3f5c03(_0x26235e[_0x9086('0x12')]['message']);}else{logger[_0x9086('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x57a8ac,_0x9086('0xe'));_0x3f5c03(_0x26235e['result'][_0x9086('0x13')]);}})[_0x9086('0x14')](function(_0x1a9c38){logger['error'](_0x9086('0xd'),_0x57a8ac,_0x1a9c38);_0x4421cc(_0x1a9c38);});});}
\ No newline at end of file
+var _0x3d97=['http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x31adfc,_0x2a3aae){var _0x669fc5=function(_0x37850a){while(--_0x37850a){_0x31adfc['push'](_0x31adfc['shift']());}};_0x669fc5(++_0x2a3aae);}(_0x3d97,0x18d));var _0x73d9=function(_0x3bdae4,_0x340726){_0x3bdae4=_0x3bdae4-0x0;var _0x10fcbb=_0x3d97[_0x3bdae4];return _0x10fcbb;};'use strict';var _=require(_0x73d9('0x0'));var util=require(_0x73d9('0x1'));var moment=require(_0x73d9('0x2'));var BPromise=require(_0x73d9('0x3'));var rs=require(_0x73d9('0x4'));var fs=require('fs');var Redis=require(_0x73d9('0x5'));var db=require(_0x73d9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x73d9('0x7'))(_0x73d9('0x8'));var config=require(_0x73d9('0x9'));var jayson=require(_0x73d9('0xa'));var client=jayson['client'][_0x73d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37857f,_0x49e8bf,_0x186958){return new BPromise(function(_0x37f4bd,_0x501321){return client[_0x73d9('0xc')](_0x37857f,_0x186958)[_0x73d9('0xd')](function(_0x354bfa){logger['info'](_0x73d9('0xe'),_0x49e8bf,_0x73d9('0xf'));logger[_0x73d9('0x10')](_0x73d9('0x11'),_0x49e8bf,'request\x20sent',JSON['stringify'](_0x354bfa));if(_0x354bfa[_0x73d9('0x12')]){if(_0x354bfa[_0x73d9('0x12')][_0x73d9('0x13')]===0x1f4){logger[_0x73d9('0x12')](_0x73d9('0xe'),_0x49e8bf,_0x354bfa[_0x73d9('0x12')][_0x73d9('0x14')]);return _0x501321(_0x354bfa[_0x73d9('0x12')][_0x73d9('0x14')]);}logger['error'](_0x73d9('0xe'),_0x49e8bf,_0x354bfa['error'][_0x73d9('0x14')]);return _0x37f4bd(_0x354bfa['error'][_0x73d9('0x14')]);}else{logger[_0x73d9('0x15')](_0x73d9('0xe'),_0x49e8bf,_0x73d9('0xf'));_0x37f4bd(_0x354bfa[_0x73d9('0x16')][_0x73d9('0x14')]);}})[_0x73d9('0x17')](function(_0x4c8865){logger['error'](_0x73d9('0xe'),_0x49e8bf,_0x4c8865);_0x501321(_0x4c8865);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 707b7a2..fb0d1ee 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 _0x10df=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','update','delete','destroy'];(function(_0x3636ed,_0x2bebfb){var _0x439afe=function(_0x512757){while(--_0x512757){_0x3636ed['push'](_0x3636ed['shift']());}};_0x439afe(++_0x2bebfb);}(_0x10df,0xc9));var _0xf10d=function(_0x2c0c25,_0x5b0a19){_0x2c0c25=_0x2c0c25-0x0;var _0x2d8cf8=_0x10df[_0x2c0c25];return _0x2d8cf8;};'use strict';var multer=require(_0xf10d('0x0'));var util=require(_0xf10d('0x1'));var path=require(_0xf10d('0x2'));var timeout=require(_0xf10d('0x3'));var express=require('express');var router=express[_0xf10d('0x4')]();var fs_extra=require(_0xf10d('0x5'));var auth=require(_0xf10d('0x6'));var interaction=require(_0xf10d('0x7'));var config=require('../../config/environment');var controller=require(_0xf10d('0x8'));router[_0xf10d('0x9')]('/',auth[_0xf10d('0xa')](),controller['index']);router[_0xf10d('0x9')](_0xf10d('0xb'),auth['isAuthenticated'](),controller[_0xf10d('0xc')]);router[_0xf10d('0x9')](_0xf10d('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf10d('0xe')]('/',auth[_0xf10d('0xa')](),controller[_0xf10d('0xf')]);router['put'](_0xf10d('0xd'),auth[_0xf10d('0xa')](),controller[_0xf10d('0x10')]);router[_0xf10d('0x11')](_0xf10d('0xd'),auth[_0xf10d('0xa')](),controller[_0xf10d('0x12')]);module[_0xf10d('0x13')]=router;
\ No newline at end of file
+var _0x064d=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','update','/:id','destroy','exports'];(function(_0x42999c,_0x23ca06){var _0x357e1e=function(_0x5a5c95){while(--_0x5a5c95){_0x42999c['push'](_0x42999c['shift']());}};_0x357e1e(++_0x23ca06);}(_0x064d,0x1e3));var _0xd064=function(_0x120769,_0x60698e){_0x120769=_0x120769-0x0;var _0x5b8146=_0x064d[_0x120769];return _0x5b8146;};'use strict';var multer=require(_0xd064('0x0'));var util=require(_0xd064('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd064('0x2'));var router=express[_0xd064('0x3')]();var fs_extra=require(_0xd064('0x4'));var auth=require(_0xd064('0x5'));var interaction=require(_0xd064('0x6'));var config=require(_0xd064('0x7'));var controller=require(_0xd064('0x8'));router[_0xd064('0x9')]('/',auth[_0xd064('0xa')](),controller[_0xd064('0xb')]);router[_0xd064('0x9')](_0xd064('0xc'),auth['isAuthenticated'](),controller[_0xd064('0xd')]);router[_0xd064('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd064('0xe')]);router[_0xd064('0xf')]('/',auth[_0xd064('0xa')](),controller['create']);router[_0xd064('0x10')]('/:id',auth[_0xd064('0xa')](),controller[_0xd064('0x11')]);router['delete'](_0xd064('0x12'),auth[_0xd064('0xa')](),controller[_0xd064('0x13')]);module[_0xd064('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 0c54846..ac356fe 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 _0x5b02=['Feedback','star','thumb','stringify','name','text','input','parse','getDataValue','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','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','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','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip'];(function(_0x1a90d9,_0x24eb6f){var _0x158f07=function(_0x493436){while(--_0x493436){_0x1a90d9['push'](_0x1a90d9['shift']());}};_0x158f07(++_0x24eb6f);}(_0x5b02,0xe9));var _0x25b0=function(_0xa48fb0,_0x13b897){_0xa48fb0=_0xa48fb0-0x0;var _0x24559b=_0x5b02[_0xa48fb0];return _0x24559b;};'use strict';var Sequelize=require(_0x25b0('0x0'));var rs=require(_0x25b0('0x1'));module[_0x25b0('0x2')]={'name':{'type':Sequelize[_0x25b0('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x25b0('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x25b0('0x4')},'mapKeyOffline':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x4')},'key':{'type':Sequelize[_0x25b0('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x25b0('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x25b0('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x25b0('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x25b0('0x3')],'allowNull':![],'defaultValue':_0x25b0('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x25b0('0x3')]},'animation':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x25b0('0x7')](_0x25b0('0x8'),_0x25b0('0x9')),'defaultValue':_0x25b0('0x8')},'header_online':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xa')},'start_chat_button':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xb')},'offline_chat_button':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xc')},'header_offline':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xd')},'download_transcript':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x25b0('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x25b0('0x10')]},'closingQuestion':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x25b0('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x25b0('0x12')},'noteTitle':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x13')},'placeholderMessage':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x14')},'closingMessageButton':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xc')},'skipMessageButton':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x16')},'ratingType':{'type':Sequelize[_0x25b0('0x7')](_0x25b0('0x17'),_0x25b0('0x18')),'defaultValue':_0x25b0('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x25b0('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x25b0('0x10')],'defaultValue':function(){return JSON[_0x25b0('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x25b0('0x1a'),'type':_0x25b0('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x25b0('0x1c'),'props':{'title':_0x25b0('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x25b0('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0x25b0('0x1d')](this[_0x25b0('0x1e')](_0x25b0('0x1f'))):{};},'set':function(_0x24f847){return this[_0x25b0('0x20')](_0x25b0('0x1f'),JSON[_0x25b0('0x19')](_0x24f847));}},'offlineForm':{'type':Sequelize[_0x25b0('0x10')],'defaultValue':function(){return JSON[_0x25b0('0x19')]({'items':[{'type':'input','props':{'title':_0x25b0('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x25b0('0x4'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x25b0('0x21'),'helpText':_0x25b0('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x25b0('0x1e')](_0x25b0('0x23'))?JSON[_0x25b0('0x1d')](this[_0x25b0('0x1e')](_0x25b0('0x23'))):{};},'set':function(_0x227287){return this[_0x25b0('0x20')](_0x25b0('0x23'),JSON[_0x25b0('0x19')](_0x227287));}},'token':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':function(){return rs[_0x25b0('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x25b0('0x3')]},'waitingTitle':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x25')},'waitingMessage':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x25b0('0x27')},'offlineMessageBody':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x25b0('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x25b0('0x3')]},'notificationTemplate':{'type':Sequelize[_0x25b0('0x10')],'defaultValue':function(){return _0x25b0('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x25b0('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x2a')},'verticalAlignment':{'type':Sequelize[_0x25b0('0xe')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':_0x25b0('0x2b')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x25b0('0x2c')},'defaultTitle':{'type':Sequelize[_0x25b0('0x3')]},'customerAvatar':{'type':Sequelize[_0x25b0('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x25b0('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x25b0('0x3')],'allowNull':![],'defaultValue':_0x25b0('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x25b0('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x25b0('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x25b0('0xe')],'comment':_0x25b0('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x9c6ab4){if(!_0x9c6ab4)this['setDataValue'](_0x25b0('0x2f'),null);this[_0x25b0('0x20')](_0x25b0('0x30'),_0x9c6ab4);}},'vidaooEscalation':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x25b0('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x25b0('0x31')},'vidaooNote':{'type':Sequelize[_0x25b0('0x3')],'defaultValue':function(){return _0x25b0('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x25b0('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x25b0('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x0bb5=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Feedback','star','input','text','name','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','stringify','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','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x934754,_0x15bd40){var _0x5cf1fc=function(_0x2c1de6){while(--_0x2c1de6){_0x934754['push'](_0x934754['shift']());}};_0x5cf1fc(++_0x15bd40);}(_0x0bb5,0x148));var _0x50bb=function(_0x2ccab4,_0x61a8d3){_0x2ccab4=_0x2ccab4-0x0;var _0x59a901=_0x0bb5[_0x2ccab4];return _0x59a901;};'use strict';var Sequelize=require(_0x50bb('0x0'));var rs=require(_0x50bb('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'unique':_0x50bb('0x3')},'description':{'type':Sequelize[_0x50bb('0x2')]},'mapKey':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x4')},'mapKeyOffline':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x4')},'key':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50bb('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x50bb('0x9')](_0x50bb('0xa'),_0x50bb('0xb')),'defaultValue':_0x50bb('0xa')},'header_online':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0xe')},'header_offline':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x50bb('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x15')},'placeholderMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x16')},'ratingType':{'type':Sequelize[_0x50bb('0x9')](_0x50bb('0x17'),'thumb'),'defaultValue':_0x50bb('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x50bb('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x50bb('0x19'),'required':!![]},'props':{'title':_0x50bb('0x1a'),'helpText':''}},{'type':_0x50bb('0x18'),'props':{'title':_0x50bb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50bb('0x4'),'type':_0x50bb('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x50bb('0x1b'))?JSON[_0x50bb('0x1c')](this[_0x50bb('0x1d')](_0x50bb('0x1b'))):{};},'set':function(_0x5234d7){return this[_0x50bb('0x1e')]('onlineForm',JSON['stringify'](_0x5234d7));}},'offlineForm':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x50bb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50bb('0x4'),'type':_0x50bb('0x4')},'variable':null},{'type':_0x50bb('0x1f'),'config':{'placeholder':_0x50bb('0x20')},'props':{'title':_0x50bb('0x20'),'helpText':_0x50bb('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x50bb('0x1d')]('offlineForm')?JSON[_0x50bb('0x1c')](this[_0x50bb('0x1d')](_0x50bb('0x22'))):{};},'set':function(_0x1b7c0f){return this['setDataValue'](_0x50bb('0x22'),JSON[_0x50bb('0x23')](_0x1b7c0f));}},'token':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':function(){return rs[_0x50bb('0x24')]();}},'autoclose':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x50bb('0x2')]},'forwardOffline':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x50bb('0x2')]},'waitingTitle':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x27')},'offlineMessageBody':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x29')},'skipUnmanaged':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2a')},'sendUnmanaged':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x50bb('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x50bb('0x2')]},'notificationTemplate':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x50bb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2d')},'defaultTitle':{'type':Sequelize[_0x50bb('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x50bb('0x7')],'comment':_0x50bb('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![],'comment':_0x50bb('0x31'),'set':function(_0x3a9fe4){if(!_0x3a9fe4)this[_0x50bb('0x1e')](_0x50bb('0x32'),null);this[_0x50bb('0x1e')](_0x50bb('0x33'),_0x3a9fe4);}},'vidaooEscalation':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50bb('0x34')},'vidaooNote':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':function(){return _0x50bb('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x50bb('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 357d154..7e76a71 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 _0xd43c=['offset','limit','set','Content-Range','update','ChatWebsites','UserProfileResource','destroy','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','include','findAll','params','Pause','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','findOne','Disposition','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','../../config/license/util','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','isNil','getSystemAvatar','notify','user-agent-parser','setUA','headers','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','CompanyId','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','updatedAt','DESC','Applications','applications','list','asc','account','Contacts','defaults','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','browser','version','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','basename','openNewInteraction','sequelize','transaction','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','format','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','attachments','offline-chat','addInteraction','User','Owner','Tag','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','getLicense','virtual','custom','License','increment','chatLicenseExceeded','Intervals','all','some','readFileSync','remote','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','bulkCreate','priority','stack','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachment','Attachments','omit','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','util','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','redis','socket.io-emitter','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count'];(function(_0x41d02a,_0x355e19){var _0x4c3983=function(_0x4802a7){while(--_0x4802a7){_0x41d02a['push'](_0x41d02a['shift']());}};_0x4c3983(++_0x355e19);}(_0xd43c,0x104));var _0xcd43=function(_0x9ffb7f,_0x4d05b9){_0x9ffb7f=_0x9ffb7f-0x0;var _0x2b0564=_0xd43c[_0x9ffb7f];return _0x2b0564;};'use strict';var BPromise=require(_0xcd43('0x0'));var Mustache=require('mustache');var util=require(_0xcd43('0x1'));var path=require(_0xcd43('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd43('0x3'));var _=require(_0xcd43('0x4'));var querystring=require(_0xcd43('0x5'));var Redis=require(_0xcd43('0x6'));var qs=require(_0xcd43('0x7'));var logger=require('../../config/logger')(_0xcd43('0x8'));var config=require(_0xcd43('0x9'));var db=require('../../mysqldb')['db'];config[_0xcd43('0xa')]=_['defaults'](config[_0xcd43('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xcd43('0xb'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xcd43('0xc')](socket);var htmlToText=require(_0xcd43('0xd'));var jayson=require(_0xcd43('0xe'));var client=jayson[_0xcd43('0xf')]['http']({'port':0x232c});var client9002=jayson[_0xcd43('0xf')][_0xcd43('0x10')]({'port':0x232a});var client9003=jayson[_0xcd43('0xf')][_0xcd43('0x10')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x3ab667,_0x3a89a4,_0x56750a,_0x10ae8d){return new BPromise(function(_0x722007,_0x298171){var _0x29fc3c=_0x10ae8d||client;return _0x29fc3c['request'](_0x3ab667,_0x56750a)[_0xcd43('0x11')](function(_0x13b6e0){logger[_0xcd43('0x12')](_0xcd43('0x13'),_0x3a89a4,'request\x20sent');logger[_0xcd43('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3a89a4,_0xcd43('0x15'),JSON[_0xcd43('0x16')](_0x13b6e0));if(_0x13b6e0[_0xcd43('0x17')]){if(_0x13b6e0['error'][_0xcd43('0x18')]===0x1f4){logger[_0xcd43('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x3a89a4,_0x13b6e0['error'][_0xcd43('0x19')]);return _0x298171(_0x13b6e0[_0xcd43('0x17')][_0xcd43('0x19')]);}logger[_0xcd43('0x17')](_0xcd43('0x13'),_0x3a89a4,_0x13b6e0[_0xcd43('0x17')][_0xcd43('0x19')]);return _0x722007(_0x13b6e0[_0xcd43('0x17')][_0xcd43('0x19')]);}else{logger[_0xcd43('0x12')](_0xcd43('0x13'),_0x3a89a4,_0xcd43('0x15'));_0x722007(_0x13b6e0[_0xcd43('0x1a')]['message']);}})[_0xcd43('0x1b')](function(_0xb22afe){logger[_0xcd43('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x3a89a4,_0xb22afe);_0x298171(_0xb22afe);});});}function respondWithStatusCode(_0x4cd519,_0x38ce2c){_0x38ce2c=_0x38ce2c||0xcc;return function(_0xdcb540){if(_0xdcb540){return _0x4cd519[_0xcd43('0x1c')](_0x38ce2c);}return _0x4cd519[_0xcd43('0x1d')](_0x38ce2c)[_0xcd43('0x1e')]();};}function respondWithResult(_0x1a994a,_0x218ca8){_0x218ca8=_0x218ca8||0xc8;return function(_0x28702e){if(_0x28702e){return _0x1a994a[_0xcd43('0x1d')](_0x218ca8)[_0xcd43('0x1f')](_0x28702e);}};}function respondWithFilteredResult(_0x3d8f80,_0x55f635){return function(_0x14142e){if(_0x14142e){var _0x132e07=typeof _0x55f635['offset']==='undefined'&&typeof _0x55f635['limit']===_0xcd43('0x20');var _0x182337=_0x14142e[_0xcd43('0x21')];var _0xf7b9ce=_0x132e07?0x0:_0x55f635['offset'];var _0x49c1af=_0x132e07?_0x14142e['count']:_0x55f635[_0xcd43('0x22')]+_0x55f635[_0xcd43('0x23')];var _0x563536;if(_0x49c1af>=_0x182337){_0x49c1af=_0x182337;_0x563536=0xc8;}else{_0x563536=0xce;}_0x3d8f80[_0xcd43('0x1d')](_0x563536);return _0x3d8f80[_0xcd43('0x24')](_0xcd43('0x25'),_0xf7b9ce+'-'+_0x49c1af+'/'+_0x182337)[_0xcd43('0x1f')](_0x14142e);}return null;};}function saveUpdates(_0x5957b2){return function(_0x3fe572){if(_0x3fe572){return _0x3fe572[_0xcd43('0x26')](_0x5957b2)[_0xcd43('0x11')](function(_0x2e4fca){return _0x2e4fca;});}return null;};}function removeEntity(_0x180f71){return function(_0x432292){if(_0x432292){return _0x432292['destroy']()[_0xcd43('0x11')](function(){var _0x312b83=_0x432292['get']({'plain':!![]});var _0x54d94a=_0xcd43('0x27');return db[_0xcd43('0x28')][_0xcd43('0x29')]({'where':{'type':_0x54d94a,'resourceId':_0x312b83['id']}})[_0xcd43('0x11')](function(){return _0x432292;});})['then'](function(){_0x180f71[_0xcd43('0x1d')](0xcc)[_0xcd43('0x1e')]();});}};}function handleEntityNotFound(_0x394f7b){return function(_0xa985a7){if(!_0xa985a7){_0x394f7b['sendStatus'](0x194);}return _0xa985a7;};}function handleError(_0x34354e,_0xe5beb6){_0xe5beb6=_0xe5beb6||0x1f4;return function(_0x26ad0c){logger[_0xcd43('0x17')](_0x26ad0c['stack']);if(_0x26ad0c[_0xcd43('0x2a')]){delete _0x26ad0c[_0xcd43('0x2a')];}_0x34354e[_0xcd43('0x1d')](_0xe5beb6)[_0xcd43('0x2b')](_0x26ad0c);};}exports[_0xcd43('0x2c')]=function(_0x1d6e5e,_0x237925){var _0x5a1918={'include':[{'model':db['Pause'],'as':_0xcd43('0x2d')}]},_0x1037e1={},_0x5d719c={'count':0x0,'rows':[]};var _0x320d75=_[_0xcd43('0x2e')](db[_0xcd43('0x2f')][_0xcd43('0x30')],function(_0x498ed8){return{'name':_0x498ed8[_0xcd43('0x31')],'type':_0x498ed8[_0xcd43('0x32')][_0xcd43('0x33')]};});_0x1037e1['model']=_[_0xcd43('0x2e')](_0x320d75,_0xcd43('0x2a'));_0x1037e1[_0xcd43('0x34')]=_[_0xcd43('0x35')](_0x1d6e5e[_0xcd43('0x34')]);_0x1037e1['filters']=_['intersection'](_0x1037e1[_0xcd43('0x36')],_0x1037e1[_0xcd43('0x34')]);_0x5a1918[_0xcd43('0x37')]=_[_0xcd43('0x38')](_0x1037e1['model'],qs['fields'](_0x1d6e5e[_0xcd43('0x34')][_0xcd43('0x39')]));_0x5a1918['attributes']=_0x5a1918['attributes'][_0xcd43('0x3a')]?_0x5a1918['attributes']:_0x1037e1[_0xcd43('0x36')];if(!_0x1d6e5e['query'][_0xcd43('0x3b')](_0xcd43('0x3c'))){_0x5a1918[_0xcd43('0x23')]=qs[_0xcd43('0x23')](_0x1d6e5e['query'][_0xcd43('0x23')]);_0x5a1918[_0xcd43('0x22')]=qs[_0xcd43('0x22')](_0x1d6e5e[_0xcd43('0x34')]['offset']);}_0x5a1918[_0xcd43('0x3d')]=qs[_0xcd43('0x3e')](_0x1d6e5e[_0xcd43('0x34')][_0xcd43('0x3e')]);_0x5a1918[_0xcd43('0x3f')]=qs[_0xcd43('0x40')](_['pick'](_0x1d6e5e[_0xcd43('0x34')],_0x1037e1[_0xcd43('0x40')]),_0x320d75);if(_0x1d6e5e[_0xcd43('0x34')][_0xcd43('0x41')]){_0x5a1918[_0xcd43('0x3f')]=_['merge'](_0x5a1918[_0xcd43('0x3f')],{'$or':_[_0xcd43('0x2e')](_0x320d75,function(_0x5b443e){if(_0x5b443e[_0xcd43('0x32')]!==_0xcd43('0x42')){var _0x2fc0f2={};_0x2fc0f2[_0x5b443e['name']]={'$like':'%'+_0x1d6e5e[_0xcd43('0x34')][_0xcd43('0x41')]+'%'};return _0x2fc0f2;}})});}_0x5a1918=_[_0xcd43('0x43')]({},_0x5a1918,_0x1d6e5e[_0xcd43('0x44')]);var _0xfcfcdd={'where':_0x5a1918['where']};return db[_0xcd43('0x2f')]['count'](_0xfcfcdd)[_0xcd43('0x11')](function(_0x14dfff){_0x5d719c[_0xcd43('0x21')]=_0x14dfff;if(_0x1d6e5e['query']['includeAll']){_0x5a1918[_0xcd43('0x45')]=[{'all':!![]}];}return db[_0xcd43('0x2f')][_0xcd43('0x46')](_0x5a1918);})[_0xcd43('0x11')](function(_0x3d831c){_0x5d719c['rows']=_0x3d831c;return _0x5d719c;})[_0xcd43('0x11')](respondWithFilteredResult(_0x237925,_0x5a1918))[_0xcd43('0x1b')](handleError(_0x237925,null));};exports['show']=function(_0x3b2bc0,_0x4ced6f){var _0x3eaa4f={'raw':![],'where':{'id':_0x3b2bc0[_0xcd43('0x47')]['id']},'include':[{'model':db[_0xcd43('0x48')],'as':_0xcd43('0x2d')}]},_0x408313={};_0x408313['model']=_[_0xcd43('0x35')](db[_0xcd43('0x2f')]['rawAttributes']);_0x408313[_0xcd43('0x34')]=_['keys'](_0x3b2bc0['query']);_0x408313[_0xcd43('0x40')]=_['intersection'](_0x408313[_0xcd43('0x36')],_0x408313[_0xcd43('0x34')]);_0x3eaa4f[_0xcd43('0x37')]=_[_0xcd43('0x38')](_0x408313[_0xcd43('0x36')],qs[_0xcd43('0x39')](_0x3b2bc0[_0xcd43('0x34')][_0xcd43('0x39')]));_0x3eaa4f[_0xcd43('0x37')]=_0x3eaa4f[_0xcd43('0x37')][_0xcd43('0x3a')]?_0x3eaa4f[_0xcd43('0x37')]:_0x408313[_0xcd43('0x36')];if(_0x3b2bc0[_0xcd43('0x34')][_0xcd43('0x49')]){_0x3eaa4f[_0xcd43('0x45')]=[{'all':!![]}];}_0x3eaa4f=_['merge']({},_0x3eaa4f,_0x3b2bc0[_0xcd43('0x44')]);return db['ChatWebsite'][_0xcd43('0x4a')](_0x3eaa4f)[_0xcd43('0x11')](handleEntityNotFound(_0x4ced6f,null))[_0xcd43('0x11')](respondWithResult(_0x4ced6f,null))['catch'](handleError(_0x4ced6f,null));};exports[_0xcd43('0x4b')]=function(_0x7bc314,_0x14266f){return db['ChatWebsite'][_0xcd43('0x4b')](_0x7bc314[_0xcd43('0x4c')],{})[_0xcd43('0x11')](function(_0x20d53e){var _0x549480=_0x7bc314['user'][_0xcd43('0x4d')]({'plain':!![]});if(!_0x549480)throw new Error(_0xcd43('0x4e'));if(_0x549480[_0xcd43('0x4f')]===_0xcd43('0x50')){var _0x4e83d0=_0x20d53e[_0xcd43('0x4d')]({'plain':!![]});var _0x2a108f=_0xcd43('0x27');return db['UserProfileSection'][_0xcd43('0x4a')]({'where':{'name':_0x2a108f,'userProfileId':_0x549480[_0xcd43('0x51')]},'raw':!![]})['then'](function(_0x5a1d63){if(_0x5a1d63&&_0x5a1d63['autoAssociation']===0x0){return db[_0xcd43('0x28')]['create']({'name':_0x4e83d0[_0xcd43('0x2a')],'resourceId':_0x4e83d0['id'],'type':_0x5a1d63['name'],'sectionId':_0x5a1d63['id']},{})[_0xcd43('0x11')](function(){return _0x20d53e;});}else{return _0x20d53e;}})[_0xcd43('0x1b')](function(_0x15a281){logger[_0xcd43('0x17')](_0xcd43('0x52'),_0x15a281);throw _0x15a281;});}return _0x20d53e;})[_0xcd43('0x11')](respondWithResult(_0x14266f,0xc9))['catch'](handleError(_0x14266f,null));};exports[_0xcd43('0x26')]=function(_0x395397,_0x10a0ea){if(_0x395397[_0xcd43('0x4c')]['id']){delete _0x395397[_0xcd43('0x4c')]['id'];}return db[_0xcd43('0x2f')][_0xcd43('0x4a')]({'where':{'id':_0x395397[_0xcd43('0x47')]['id']},'include':[{'model':db['Pause'],'as':_0xcd43('0x2d')}]})[_0xcd43('0x11')](handleEntityNotFound(_0x10a0ea,null))[_0xcd43('0x11')](saveUpdates(_0x395397[_0xcd43('0x4c')],null))['then'](respondWithResult(_0x10a0ea,null))[_0xcd43('0x1b')](handleError(_0x10a0ea,null));};exports['destroy']=function(_0x3e37b1,_0x317afc){return db[_0xcd43('0x2f')][_0xcd43('0x4a')]({'where':{'id':_0x3e37b1[_0xcd43('0x47')]['id']}})['then'](handleEntityNotFound(_0x317afc,null))[_0xcd43('0x11')](removeEntity(_0x317afc,null))[_0xcd43('0x1b')](handleError(_0x317afc,null));};exports[_0xcd43('0x53')]=function(_0x19d962,_0x11b364){return db['ChatWebsite'][_0xcd43('0x53')]()[_0xcd43('0x11')](respondWithResult(_0x11b364,null))[_0xcd43('0x1b')](handleError(_0x11b364,null));};exports[_0xcd43('0x54')]=function(_0x58ee2f,_0x5c1de9){if(_0x58ee2f[_0xcd43('0x4c')]['id']){delete _0x58ee2f[_0xcd43('0x4c')]['id'];}return db[_0xcd43('0x2f')][_0xcd43('0x4a')]({'where':{'id':_0x58ee2f['params']['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x5c1de9,null))[_0xcd43('0x11')](function(_0x446a8b){if(_0x446a8b){_0x58ee2f[_0xcd43('0x4c')][_0xcd43('0x55')]=_0x446a8b['id'];return db['Disposition'][_0xcd43('0x4b')](_0x58ee2f[_0xcd43('0x4c')]);}})[_0xcd43('0x11')](respondWithResult(_0x5c1de9,null))[_0xcd43('0x1b')](handleError(_0x5c1de9,null));};exports['getDispositions']=function(_0x14e463,_0x499a4b){var _0xb9e4b9={'raw':![],'where':{}};var _0x4285d4={};var _0x3ed268={'count':0x0,'rows':[]};return db[_0xcd43('0x2f')][_0xcd43('0x56')]({'where':{'id':_0x14e463['params']['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x499a4b,null))[_0xcd43('0x11')](function(_0x138bd5){if(_0x138bd5){_0x4285d4['model']=_[_0xcd43('0x35')](db[_0xcd43('0x57')]['rawAttributes']);_0x4285d4['query']=_['keys'](_0x14e463[_0xcd43('0x34')]);_0x4285d4[_0xcd43('0x40')]=_[_0xcd43('0x38')](_0x4285d4[_0xcd43('0x36')],_0x4285d4[_0xcd43('0x34')]);_0xb9e4b9[_0xcd43('0x37')]=_[_0xcd43('0x38')](_0x4285d4[_0xcd43('0x36')],qs[_0xcd43('0x39')](_0x14e463[_0xcd43('0x34')]['fields']));_0xb9e4b9[_0xcd43('0x37')]=_0xb9e4b9[_0xcd43('0x37')]['length']?_0xb9e4b9[_0xcd43('0x37')]:_0x4285d4[_0xcd43('0x36')];if(!_0x14e463[_0xcd43('0x34')][_0xcd43('0x3b')](_0xcd43('0x3c'))){_0xb9e4b9[_0xcd43('0x23')]=qs[_0xcd43('0x23')](_0x14e463[_0xcd43('0x34')]['limit']);_0xb9e4b9[_0xcd43('0x22')]=qs[_0xcd43('0x22')](_0x14e463[_0xcd43('0x34')]['offset']);}_0xb9e4b9['order']=qs[_0xcd43('0x3e')](_0x14e463[_0xcd43('0x34')][_0xcd43('0x3e')]);_0xb9e4b9['where']=qs['filters'](_[_0xcd43('0x58')](_0x14e463[_0xcd43('0x34')],_0x4285d4[_0xcd43('0x40')]));_0xb9e4b9[_0xcd43('0x3f')][_0xcd43('0x55')]=_0x138bd5['id'];if(_0x14e463[_0xcd43('0x34')][_0xcd43('0x41')]){_0xb9e4b9['where']=_[_0xcd43('0x43')](_0xb9e4b9[_0xcd43('0x3f')],{'$or':_['map'](_0xb9e4b9['attributes'],function(_0x478e72){var _0x435c55={};_0x435c55[_0x478e72]={'$like':'%'+_0x14e463[_0xcd43('0x34')][_0xcd43('0x41')]+'%'};return _0x435c55;})});}_0xb9e4b9=_['merge']({},_0xb9e4b9,_0x14e463[_0xcd43('0x44')]);return db[_0xcd43('0x57')][_0xcd43('0x21')]({'where':_0xb9e4b9[_0xcd43('0x3f')]})[_0xcd43('0x11')](function(_0xfdbb04){_0x3ed268[_0xcd43('0x21')]=_0xfdbb04;if(_0x14e463[_0xcd43('0x34')][_0xcd43('0x49')]){_0xb9e4b9[_0xcd43('0x45')]=[{'all':!![]}];}return db['Disposition'][_0xcd43('0x46')](_0xb9e4b9);})[_0xcd43('0x11')](function(_0x276ecc){_0x3ed268['rows']=_0x276ecc;return _0x3ed268;});}})['then'](respondWithFilteredResult(_0x499a4b,_0xb9e4b9))[_0xcd43('0x1b')](handleError(_0x499a4b,null));};exports[_0xcd43('0x59')]=function(_0x3d7773,_0x3059e1){return db[_0xcd43('0x2f')][_0xcd43('0x4a')]({'where':{'id':_0x3d7773[_0xcd43('0x47')]['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x3059e1,null))[_0xcd43('0x11')](function(_0x3baef2){if(_0x3baef2){return _0x3baef2[_0xcd43('0x59')](_0x3d7773[_0xcd43('0x34')][_0xcd43('0x5a')]);}})['then'](respondWithStatusCode(_0x3059e1,null))['catch'](handleError(_0x3059e1,null));};exports[_0xcd43('0x5b')]=function(_0x137e7d,_0x4c1fc3){if(_0x137e7d['body']['id']){delete _0x137e7d[_0xcd43('0x4c')]['id'];}return db[_0xcd43('0x2f')]['find']({'where':{'id':_0x137e7d[_0xcd43('0x47')]['id']}})['then'](handleEntityNotFound(_0x4c1fc3,null))[_0xcd43('0x11')](function(_0x4db4fe){if(_0x4db4fe){_0x137e7d['body']['ChatWebsiteId']=_0x4db4fe['id'];return db[_0xcd43('0x5c')][_0xcd43('0x4b')](_0x137e7d['body']);}})['then'](respondWithResult(_0x4c1fc3,null))[_0xcd43('0x1b')](handleError(_0x4c1fc3,null));};exports[_0xcd43('0x5d')]=function(_0x33d4b4,_0x2642c2){var _0x5ba2af={'raw':![],'where':{}};var _0x4dcfdf={};var _0x5430f={'count':0x0,'rows':[]};return db[_0xcd43('0x2f')][_0xcd43('0x56')]({'where':{'id':_0x33d4b4[_0xcd43('0x47')]['id']}})['then'](handleEntityNotFound(_0x2642c2,null))[_0xcd43('0x11')](function(_0x5edd18){if(_0x5edd18){_0x4dcfdf['model']=_[_0xcd43('0x35')](db['CannedAnswer']['rawAttributes']);_0x4dcfdf[_0xcd43('0x34')]=_[_0xcd43('0x35')](_0x33d4b4[_0xcd43('0x34')]);_0x4dcfdf[_0xcd43('0x40')]=_[_0xcd43('0x38')](_0x4dcfdf[_0xcd43('0x36')],_0x4dcfdf[_0xcd43('0x34')]);_0x5ba2af['attributes']=_[_0xcd43('0x38')](_0x4dcfdf[_0xcd43('0x36')],qs[_0xcd43('0x39')](_0x33d4b4[_0xcd43('0x34')]['fields']));_0x5ba2af[_0xcd43('0x37')]=_0x5ba2af['attributes'][_0xcd43('0x3a')]?_0x5ba2af[_0xcd43('0x37')]:_0x4dcfdf[_0xcd43('0x36')];if(!_0x33d4b4['query']['hasOwnProperty']('nolimit')){_0x5ba2af[_0xcd43('0x23')]=qs['limit'](_0x33d4b4['query'][_0xcd43('0x23')]);_0x5ba2af[_0xcd43('0x22')]=qs[_0xcd43('0x22')](_0x33d4b4[_0xcd43('0x34')][_0xcd43('0x22')]);}_0x5ba2af[_0xcd43('0x3d')]=qs[_0xcd43('0x3e')](_0x33d4b4[_0xcd43('0x34')][_0xcd43('0x3e')]);_0x5ba2af['where']=qs['filters'](_['pick'](_0x33d4b4[_0xcd43('0x34')],_0x4dcfdf[_0xcd43('0x40')]));_0x5ba2af[_0xcd43('0x3f')][_0xcd43('0x55')]=_0x5edd18['id'];if(_0x33d4b4[_0xcd43('0x34')][_0xcd43('0x41')]){_0x5ba2af[_0xcd43('0x3f')]=_[_0xcd43('0x43')](_0x5ba2af['where'],{'$or':_[_0xcd43('0x2e')](_0x5ba2af['attributes'],function(_0x5064a4){var _0x2d2d4c={};_0x2d2d4c[_0x5064a4]={'$like':'%'+_0x33d4b4[_0xcd43('0x34')][_0xcd43('0x41')]+'%'};return _0x2d2d4c;})});}_0x5ba2af=_[_0xcd43('0x43')]({},_0x5ba2af,_0x33d4b4['options']);return db[_0xcd43('0x5c')][_0xcd43('0x21')]({'where':_0x5ba2af[_0xcd43('0x3f')]})[_0xcd43('0x11')](function(_0xf17d2b){_0x5430f[_0xcd43('0x21')]=_0xf17d2b;if(_0x33d4b4[_0xcd43('0x34')][_0xcd43('0x49')]){_0x5ba2af['include']=[{'all':!![]}];}return db[_0xcd43('0x5c')][_0xcd43('0x46')](_0x5ba2af);})['then'](function(_0x15a3b4){_0x5430f[_0xcd43('0x5e')]=_0x15a3b4;return _0x5430f;});}})[_0xcd43('0x11')](respondWithFilteredResult(_0x2642c2,_0x5ba2af))[_0xcd43('0x1b')](handleError(_0x2642c2,null));};exports[_0xcd43('0x5f')]=function(_0x4e46ce,_0x37d334){return db[_0xcd43('0x2f')][_0xcd43('0x4a')]({'where':{'id':_0x4e46ce['params']['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x37d334,null))[_0xcd43('0x11')](function(_0x40527d){if(_0x40527d){return _0x40527d[_0xcd43('0x5f')](_0x4e46ce[_0xcd43('0x34')][_0xcd43('0x5a')]);}})[_0xcd43('0x11')](respondWithStatusCode(_0x37d334,null))[_0xcd43('0x1b')](handleError(_0x37d334,null));};exports[_0xcd43('0x60')]=function(_0x1e2e79,_0x227bc2){_0x1e2e79[_0xcd43('0x4c')][_0xcd43('0x61')]=_0x1e2e79[_0xcd43('0x62')][_0xcd43('0x63')];return db[_0xcd43('0x2f')]['find']({'where':{'id':_0x1e2e79[_0xcd43('0x47')]['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x227bc2,null))[_0xcd43('0x11')](saveUpdates(_0x1e2e79['body'],null))[_0xcd43('0x11')](respondWithResult(_0x227bc2,null))[_0xcd43('0x1b')](handleError(_0x227bc2,null));};exports[_0xcd43('0x64')]=function(_0x4f9b8b,_0x816df3){_0x4f9b8b[_0xcd43('0x4c')]['agentAvatar']=_0x4f9b8b[_0xcd43('0x62')][_0xcd43('0x63')];return db[_0xcd43('0x2f')]['find']({'where':{'id':_0x4f9b8b[_0xcd43('0x47')]['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x816df3,null))[_0xcd43('0x11')](saveUpdates(_0x4f9b8b['body'],null))[_0xcd43('0x11')](respondWithResult(_0x816df3,null))['catch'](handleError(_0x816df3,null));};exports[_0xcd43('0x65')]=function(_0x3341ac,_0xb93785){_0x3341ac['body'][_0xcd43('0x66')]=_0x3341ac[_0xcd43('0x62')][_0xcd43('0x63')];return db['ChatWebsite'][_0xcd43('0x4a')]({'where':{'id':_0x3341ac['params']['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0xb93785,null))[_0xcd43('0x11')](saveUpdates(_0x3341ac[_0xcd43('0x4c')],null))['then'](respondWithResult(_0xb93785,null))['catch'](handleError(_0xb93785,null));};exports[_0xcd43('0x67')]=function(_0x1ca621,_0x5b59ea){_0x1ca621[_0xcd43('0x4c')][_0xcd43('0x68')]=_0x1ca621[_0xcd43('0x62')][_0xcd43('0x63')];return db['ChatWebsite'][_0xcd43('0x4a')]({'where':{'id':_0x1ca621[_0xcd43('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b59ea,null))[_0xcd43('0x11')](saveUpdates(_0x1ca621['body'],null))['then'](respondWithResult(_0x5b59ea,null))['catch'](handleError(_0x5b59ea,null));};exports['getLogo']=function(_0x1acfc3,_0x3d679a){var _0xf13f6d=path[_0xcd43('0x69')](config[_0xcd43('0x6a')],'server/files/images/logos/default_logo.svg');var _0x40749e={'where':{'id':_0x1acfc3[_0xcd43('0x47')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x487042=![];return require(_0xcd43('0x6b'))['getLicense']()[_0xcd43('0x11')](function(_0x132605){if(_0x132605){_0x487042=_0x132605['custom'];}})[_0xcd43('0x11')](function(){return db[_0xcd43('0x2f')][_0xcd43('0x4a')](_0x40749e);})[_0xcd43('0x11')](handleEntityNotFound(_0x3d679a,null))[_0xcd43('0x11')](function(_0x225db4){if(_0x225db4){if(!_['isNil'](_0x225db4[_0xcd43('0x61')])){if(fs[_0xcd43('0x6c')](path[_0xcd43('0x69')](config[_0xcd43('0x6a')],_0xcd43('0x6d'),_0x225db4[_0xcd43('0x61')]))&&_0x487042){_0xf13f6d=path['join'](config['root'],_0xcd43('0x6d'),_0x225db4[_0xcd43('0x61')]);}}return _0x3d679a[_0xcd43('0x6e')](_0xf13f6d);}})[_0xcd43('0x1b')](handleError(_0x3d679a,null));};exports['getAvatar']=function(_0x2925f5,_0x5b1383){var _0x12294c=path[_0xcd43('0x69')](config['root'],_0xcd43('0x6f'));var _0xa47ced={'where':{'id':_0x2925f5[_0xcd43('0x47')]['id']},'attributes':['id',_0xcd43('0x70')],'raw':!![]};return db[_0xcd43('0x2f')][_0xcd43('0x4a')](_0xa47ced)[_0xcd43('0x11')](handleEntityNotFound(_0x5b1383,null))[_0xcd43('0x11')](function(_0x47b689){if(_0x47b689){if(!_['isNil'](_0x47b689[_0xcd43('0x70')])){if(fs[_0xcd43('0x6c')](path['join'](config[_0xcd43('0x6a')],'server/files/images/avatars/',_0x47b689[_0xcd43('0x70')]))){_0x12294c=path['join'](config[_0xcd43('0x6a')],_0xcd43('0x71'),_0x47b689[_0xcd43('0x70')]);}}return _0x5b1383[_0xcd43('0x6e')](_0x12294c);}})['catch'](handleError(_0x5b1383,null));};exports[_0xcd43('0x72')]=function(_0x2af875,_0x386588){var _0x29d590=path['join'](config['root'],_0xcd43('0x73'));var _0x2c6258={'where':{'id':_0x2af875[_0xcd43('0x47')]['id']},'attributes':['id','customerAvatar',_0xcd43('0x74')],'raw':!![]};return db[_0xcd43('0x2f')][_0xcd43('0x4a')](_0x2c6258)[_0xcd43('0x11')](handleEntityNotFound(_0x386588,null))[_0xcd43('0x11')](function(_0x2be358){if(_0x2be358){if(!_[_0xcd43('0x75')](_0x2be358[_0xcd43('0x66')])){if(fs['existsSync'](path[_0xcd43('0x69')](config[_0xcd43('0x6a')],_0xcd43('0x71'),_0x2be358[_0xcd43('0x66')]))&&_0x2be358[_0xcd43('0x74')]){_0x29d590=path[_0xcd43('0x69')](config[_0xcd43('0x6a')],'server/files/images/avatars/',_0x2be358[_0xcd43('0x66')]);}}return _0x386588[_0xcd43('0x6e')](_0x29d590);}})['catch'](handleError(_0x386588,null));};exports[_0xcd43('0x76')]=function(_0x238e50,_0x4be1e8){var _0x109392=path[_0xcd43('0x69')](config[_0xcd43('0x6a')],'server/files/images/avatars/system_avatar.png');var _0x34a21b={'where':{'id':_0x238e50['params']['id']},'attributes':['id',_0xcd43('0x68')],'raw':!![]};return db[_0xcd43('0x2f')]['find'](_0x34a21b)[_0xcd43('0x11')](handleEntityNotFound(_0x4be1e8,null))['then'](function(_0x4ce2e4){if(_0x4ce2e4){if(!_['isNil'](_0x4ce2e4[_0xcd43('0x68')])){if(fs[_0xcd43('0x6c')](path[_0xcd43('0x69')](config[_0xcd43('0x6a')],'server/files/images/avatars/',_0x4ce2e4[_0xcd43('0x68')]))){_0x109392=path[_0xcd43('0x69')](config[_0xcd43('0x6a')],_0xcd43('0x71'),_0x4ce2e4['systemAvatar']);}}return _0x4be1e8[_0xcd43('0x6e')](_0x109392);}})['catch'](handleError(_0x4be1e8,null));};exports[_0xcd43('0x77')]=function(_0x5d6c05,_0x5440bd){var _0x3f2b64=require(_0xcd43('0x78'));var _0x2a9821=new _0x3f2b64();var _0x19a052=_0x2a9821[_0xcd43('0x79')](_0x5d6c05[_0xcd43('0x7a')][_0xcd43('0x7b')])['getResult']();var _0x4e6c88={'body':_0x5d6c05[_0xcd43('0x4c')],'channel':'chat'};var _0x3f7f64=[];var _0x512de9=[];var _0x5d7c16={};var _0x24e65c=![];return db[_0xcd43('0x7c')][_0xcd43('0x53')]()[_0xcd43('0x11')](function(_0x17b80d){if(!_0x17b80d){throw new db[(_0xcd43('0x7d'))][(_0xcd43('0x7e'))](_0xcd43('0x7f'));}_0x3f7f64=_['difference'](_[_0xcd43('0x35')](_0x17b80d),[_0xcd43('0x80'),'updatedAt']);_0x512de9=_['difference'](_[_0xcd43('0x35')](_0x17b80d),[_0xcd43('0x80'),'updatedAt',_0xcd43('0x81'),'ListId']);if(_0x5d6c05[_0xcd43('0x4c')]['id']){delete _0x5d6c05['body']['id'];}if(_[_0xcd43('0x75')](_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0x82')])){throw new db[(_0xcd43('0x7d'))][(_0xcd43('0x7e'))]('from\x20is\x20mandatory');}if(_[_0xcd43('0x75')](_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0x4c')])||_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0x4c')]===''){throw new db['Sequelize'][(_0xcd43('0x7e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xcd43('0x75')](_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0x83')])){throw new db[(_0xcd43('0x7d'))][(_0xcd43('0x7e'))](_0xcd43('0x84')+_0x512de9);}if(!_['includes'](_0x512de9,_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0x83')])){throw new db[(_0xcd43('0x7d'))][(_0xcd43('0x7e'))](_0xcd43('0x85')+_0x512de9);}_0x5d7c16[_0x5d6c05[_0xcd43('0x4c')]['mapKey']]=_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0x82')];})[_0xcd43('0x11')](function(){return db[_0xcd43('0x2f')][_0xcd43('0x4a')]({'where':{'id':_0x5d6c05[_0xcd43('0x47')]['id']},'include':[{'model':db[_0xcd43('0x86')],'as':_0xcd43('0x87'),'include':[{'model':db[_0xcd43('0x7c')],'as':'Contacts','where':_0x5d7c16,'limit':0x1,'order':[[_0xcd43('0x88'),_0xcd43('0x89')]]}]},{'model':db['ChatApplication'],'as':_0xcd43('0x8a')}]});})[_0xcd43('0x11')](handleEntityNotFound(_0x5440bd,null))[_0xcd43('0x11')](function(_0x3f0cae){if(_0x3f0cae&&_0x3f0cae[_0xcd43('0x87')]){_0x4e6c88['account']=_0x3f0cae;_0x4e6c88[_0xcd43('0x8b')]=_0x3f0cae[_0xcd43('0x8a')];_0x4e6c88[_0xcd43('0x8c')]=_0x3f0cae['List'];_0x4e6c88['applications']=_['orderBy'](_0x4e6c88[_0xcd43('0x8b')],['priority'],[_0xcd43('0x8d')]);if(_0x4e6c88[_0xcd43('0x8e')][_0xcd43('0x8a')]){delete _0x4e6c88['account'][_0xcd43('0x8a')];}if(_0x4e6c88[_0xcd43('0x8e')][_0xcd43('0x87')]&&_0x4e6c88[_0xcd43('0x8e')][_0xcd43('0x87')]['Contacts'][_0xcd43('0x3a')]){return _0x4e6c88[_0xcd43('0x8e')][_0xcd43('0x87')][_0xcd43('0x8f')][0x0];}var _0x17a019=_[_0xcd43('0x90')](_0x5d6c05[_0xcd43('0x4c')],{'firstName':_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0x82')],'ListId':_0x3f0cae[_0xcd43('0x91')]});_0x17a019[_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0x83')]]=_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0x82')];return db[_0xcd43('0x7c')][_0xcd43('0x4b')](_0x17a019,{'fields':_0x3f7f64,'raw':!![]});}})['then'](handleEntityNotFound(_0x5440bd,null))[_0xcd43('0x11')](function(_0x25ed99){_0x4e6c88[_0xcd43('0x92')]=_0x25ed99;var _0x34cb3b=_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0x93')];if(_0x5d6c05[_0xcd43('0x7a')][_0xcd43('0x94')]){_0x34cb3b=_0x5d6c05[_0xcd43('0x7a')][_0xcd43('0x94')];}else if(_0x5d6c05['headers'][_0xcd43('0x95')]){_0x34cb3b=_[_0xcd43('0x96')](_0x5d6c05[_0xcd43('0x7a')][_0xcd43('0x95')]['split'](','));}if(_0x25ed99){var _0x3d0f25={'ContactId':_0x25ed99['id'],'ChatWebsiteId':_0x5d6c05['params']['id'],'from':(_0x25ed99[_0xcd43('0x97')]||'')+'\x20'+(_0x25ed99[_0xcd43('0x98')]||''),'customerIp':_0x34cb3b,'customerPort':_0x5d6c05['headers'][_0xcd43('0x99')]?_0x5d6c05[_0xcd43('0x7a')]['x-real-port']:null,'referer':_0x5d6c05['body']['referer'],'browserName':_0x19a052[_0xcd43('0x9a')][_0xcd43('0x2a')]&&_0x19a052['browser'][_0xcd43('0x9b')]?util['format'](_0xcd43('0x9c'),_0x19a052[_0xcd43('0x9a')][_0xcd43('0x2a')],_0x19a052['browser'][_0xcd43('0x9b')]):_0xcd43('0x9d'),'browserVersion':_0x19a052[_0xcd43('0x9a')][_0xcd43('0x9b')]||'unknown','osName':util['format'](_0xcd43('0x9c'),_0x19a052['os'][_0xcd43('0x2a')],_0x19a052['os'][_0xcd43('0x9b')]),'osVersion':_0x19a052['os'][_0xcd43('0x9b')],'deviceModel':_0x19a052[_0xcd43('0x9e')][_0xcd43('0x36')]&&_0x19a052[_0xcd43('0x9e')][_0xcd43('0x9f')]?util['format']('%s\x20%s\x20%s',_0x19a052[_0xcd43('0x9e')][_0xcd43('0x36')],_0x19a052[_0xcd43('0x9e')][_0xcd43('0x9f')],_0x19a052['device'][_0xcd43('0x32')]):null,'deviceVendor':_0x19a052[_0xcd43('0x9e')]['vendor'],'deviceType':_0x19a052[_0xcd43('0x9e')][_0xcd43('0x32')],'formData':JSON[_0xcd43('0x16')](_0x5d6c05[_0xcd43('0x4c')])};var _0x18cf96={'ChatWebsiteId':_0x5d6c05[_0xcd43('0x47')]['id'],'closed':![]};if(_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0xa0')]){_0x18cf96['threadId']=_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0xa0')];return db[_0xcd43('0xa1')]['find']({'where':_0x18cf96})['then'](function(_0xd85f6){if(_0xd85f6){return[_0xd85f6,![]];}_0x3d0f25['threadId']=_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0xa0')];_0x3d0f25[_0xcd43('0xa2')]=_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0xa2')];return db[_0xcd43('0xa1')]['create'](_0x3d0f25)['then'](function(_0x2b6e84){return[_0x2b6e84,!![]];});});}_0x18cf96['ContactId']=_0x25ed99['id'];if(_0x5d6c05['body'][_0xcd43('0xa3')]&&_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0xa3')]['id']){_0x18cf96['id']=_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0xa3')]['id'];return db[_0xcd43('0xa1')][_0xcd43('0x4a')]({'where':_0x18cf96})[_0xcd43('0x11')](function(_0x5983c9){if(_0x5983c9){return[_0x5983c9,![]];}return db['ChatInteraction'][_0xcd43('0x4b')](_0x3d0f25)[_0xcd43('0x11')](function(_0x3a1978){return[_0x3a1978,!![]];});});}return db['ChatInteraction'][_0xcd43('0x4b')](_0x3d0f25)[_0xcd43('0x11')](function(_0x2e57d2){return[_0x2e57d2,!![]];});}})[_0xcd43('0xa4')](function(_0x9321ad,_0x4c9929){if(_0x9321ad){_0x24e65c=_0x4c9929;if(!_0x4c9929){var _0x714402={'from':(_0x4e6c88[_0xcd43('0x92')][_0xcd43('0x97')]||'')+'\x20'+(_0x4e6c88[_0xcd43('0x92')][_0xcd43('0x98')]||'')};if(_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0xa0')]&&_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0xa5')]&&_0x5d6c05['body'][_0xcd43('0xa0')]!=_0x5d6c05[_0xcd43('0x4c')]['messageId']){_0x714402[_0xcd43('0xa0')]=_0x5d6c05[_0xcd43('0x4c')][_0xcd43('0xa5')];}return _0x9321ad[_0xcd43('0x26')](_0x714402);}else{return _0x9321ad;}}})['then'](function(_0x30bef4){_0x4e6c88[_0xcd43('0xa3')]=_0x30bef4[_0xcd43('0x4d')]({'plain':!![]});_0x4e6c88['interaction']['created']=_0x24e65c;if(_0x4e6c88[_0xcd43('0xa3')][_0xcd43('0xa6')]){if(_0x4e6c88[_0xcd43('0x8e')][_0xcd43('0xa7')]){_0x4e6c88['applications'][_0xcd43('0xa8')]({'id':0x0,'priority':_0x4e6c88[_0xcd43('0x8b')][_0xcd43('0x3a')]+0x1,'app':_0xcd43('0xa9'),'appdata':_0xcd43('0xaa'),'interval':_0xcd43('0xab')});}}return db[_0xcd43('0xac')][_0xcd43('0x4b')]({'body':_0x5d6c05['body'][_0xcd43('0x4c')],'ChatWebsiteId':_0x5d6c05[_0xcd43('0x47')]['id'],'ChatInteractionId':_0x30bef4['id'],'direction':'in','ContactId':_0x4e6c88[_0xcd43('0x92')]['id'],'AttachmentId':_0x5d6c05['body'][_0xcd43('0xad')]});})[_0xcd43('0x11')](function(_0x26d630){_0x4e6c88['message']=_0x26d630;if(_0x4e6c88[_0xcd43('0xa3')][_0xcd43('0xae')]){return db['User']['find']({'attributes':['id',_0xcd43('0x2a')],'where':{'id':_0x4e6c88[_0xcd43('0xa3')][_0xcd43('0xae')]}})['then'](function(_0x12e7b9){if(_0x12e7b9){_0x4e6c88[_0xcd43('0x8b')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcd43('0xaf'),'appdata':_0x12e7b9[_0xcd43('0x2a')]+','+(_0x4e6c88[_0xcd43('0x8e')][_0xcd43('0xb0')]||0xa),'interval':_0xcd43('0xab')});_0x4e6c88[_0xcd43('0xb1')]=!![];}return respondWithRpcPromise(_0xcd43('0xb2'),'startRouting',_0x4e6c88);});}return respondWithRpcPromise(_0xcd43('0xb2'),_0xcd43('0xb3'),_0x4e6c88);})[_0xcd43('0x11')](function(_0x4dc838){respondWithRpcPromise(_0xcd43('0xb4'),_0xcd43('0xb4'),{'event':_0xcd43('0x77'),'message':_0x4dc838},client9002);return _0x4dc838;})[_0xcd43('0x11')](respondWithResult(_0x5440bd,null))[_0xcd43('0x1b')](handleError(_0x5440bd,null));};exports[_0xcd43('0xb5')]=function(_0x957bd8,_0x5cb4d0){var _0x400120,_0x10c09e,_0x3b1939;var _0x4fb120=[];var _0x31dcce={};var _0x2ac4bc=_0x957bd8[_0xcd43('0xb6')]||[];var _0x42f351=[];var _0x1e6d35;return db[_0xcd43('0x7c')][_0xcd43('0x53')]()[_0xcd43('0x11')](function(_0x2b5643){if(!_0x2b5643){throw new db['Sequelize'][(_0xcd43('0x7e'))](_0xcd43('0x7f'));}_0x4fb120=_[_0xcd43('0xb7')](_[_0xcd43('0x35')](_0x2b5643),[_0xcd43('0x80'),_0xcd43('0x88'),_0xcd43('0x81'),'ListId']);if(_0x957bd8[_0xcd43('0x4c')]['id']){delete _0x957bd8[_0xcd43('0x4c')]['id'];}if(_[_0xcd43('0x75')](_0x957bd8[_0xcd43('0x4c')][_0xcd43('0x82')])){throw _0x5cb4d0[_0xcd43('0x1d')](0x1f4)[_0xcd43('0x2b')](new db[(_0xcd43('0x7d'))][(_0xcd43('0x7e'))](_0xcd43('0xb8')));}if(_[_0xcd43('0x75')](_0x957bd8[_0xcd43('0x4c')][_0xcd43('0x4c')])||_0x957bd8[_0xcd43('0x4c')][_0xcd43('0x4c')]===''){throw _0x5cb4d0[_0xcd43('0x1d')](0x1f4)['send'](new db[(_0xcd43('0x7d'))][(_0xcd43('0x7e'))](_0xcd43('0xb9')));}if(_['isNil'](_0x957bd8[_0xcd43('0x4c')]['mapKeyOffline'])){throw _0x5cb4d0['status'](0x1f4)[_0xcd43('0x2b')](new db[(_0xcd43('0x7d'))][(_0xcd43('0x7e'))](_0xcd43('0xba')+_0x4fb120));}if(!_[_0xcd43('0xbb')](_0x4fb120,_0x957bd8[_0xcd43('0x4c')][_0xcd43('0xbc')])){throw _0x5cb4d0[_0xcd43('0x1d')](0x1f4)[_0xcd43('0x2b')](new db[(_0xcd43('0x7d'))][(_0xcd43('0x7e'))](_0xcd43('0xbd')+_0x4fb120));}_0x31dcce[_0x957bd8['body'][_0xcd43('0xbc')]]=_0x957bd8[_0xcd43('0x4c')][_0xcd43('0x82')];})['then'](function(){return db[_0xcd43('0x2f')][_0xcd43('0x4a')]({'where':{'id':_0x957bd8[_0xcd43('0x47')]['id']},'include':[{'model':db[_0xcd43('0x86')],'as':_0xcd43('0x87')},{'model':db[_0xcd43('0xbe')],'as':_0xcd43('0xbe')}]});})[_0xcd43('0x11')](handleEntityNotFound(_0x5cb4d0,null))[_0xcd43('0x11')](function(_0x12517b){if(_0x12517b&&_0x12517b[_0xcd43('0x87')]){_0x10c09e=_0x12517b;var _0x3d548e=_['defaults'](_0x957bd8[_0xcd43('0x4c')],{'firstName':_0x957bd8[_0xcd43('0x4c')][_0xcd43('0x82')],'phone':_0x957bd8['body'][_0xcd43('0x82')],'ListId':_0x12517b['ListId']});_0x3d548e[_0x957bd8[_0xcd43('0x4c')][_0xcd43('0xbc')]]=_0x957bd8['body'][_0xcd43('0x82')];return db['CmContact'][_0xcd43('0xbf')]({'where':_0x31dcce,'defaults':_0x3d548e});}})[_0xcd43('0xa4')](function(_0x5cf460){if(_0x5cf460){_0x3b1939=_0x5cf460;var _0x431f91=fs['readFileSync'](path['join'](config[_0xcd43('0x6a')],_0xcd43('0xc0')),_0xcd43('0xc1'));var _0x3ed551=ejs[_0xcd43('0xc2')](_0x431f91,{'body':_[_0xcd43('0xc3')](_0x957bd8[_0xcd43('0x4c')][_0xcd43('0x4c')]),'bodyTitle':_0x10c09e[_0xcd43('0xc4')]});return db['ChatOfflineMessage'][_0xcd43('0x4b')]({'body':_0x3ed551,'plainBody':htmlToText[_0xcd43('0xc5')](_0x3ed551),'ContactId':_0x5cf460['id'],'ChatWebsiteId':_0x10c09e['id']});}})[_0xcd43('0x11')](function(_0x1c9c55){_0x1e6d35=_0x1c9c55;if(_0x2ac4bc[_0xcd43('0x3a')]){var _0x29c8d1=_0x2ac4bc[_0xcd43('0x2e')](function(_0x445984){return{'name':_0x445984[_0xcd43('0xc6')],'basename':_0x445984[_0xcd43('0x63')],'type':_0x445984[_0xcd43('0xc7')],'ChatOfflineMessageId':_0x1c9c55['id']};});_0x42f351=_0x29c8d1[_0xcd43('0x2e')](_0x56c269=>{var _0x4a98cd={'filename':_0x56c269[_0xcd43('0x2a')],'path':path['join'](config[_0xcd43('0x6a')],_0xcd43('0xc8'),_0xcd43('0xb6'),'attachments','offline-chat',_0x56c269[_0xcd43('0xc9')])};return _0x4a98cd;});if(!_0x10c09e[_0xcd43('0xca')]){return db[_0xcd43('0xcb')][_0xcd43('0xcc')](function(_0x13a56e){return db['Attachment']['bulkCreate'](_0x29c8d1,{'transaction':_0x13a56e});});}}})[_0xcd43('0x11')](function(){if(_0x1e6d35){_0x400120=_0x1e6d35;return db[_0xcd43('0xbe')][_0xcd43('0x56')]({'where':{'service':!![]},'include':[{'model':db[_0xcd43('0xcd')],'as':_0xcd43('0xce'),'raw':!![],'include':[{'model':db[_0xcd43('0xcf')],'as':_0xcd43('0xcf'),'raw':!![]}]}]});}})[_0xcd43('0x11')](function(_0x28f085){if(_0x28f085&&_0x28f085[_0xcd43('0xce')]&&_0x10c09e[_0xcd43('0xd0')]&&_0x10c09e[_0xcd43('0xd1')]){var _0x2dae61=_0x28f085['getSmtpOptions']();return respondWithRpcPromise(_0xcd43('0xd2'),_0xcd43('0xd3'),{'account':_0x2dae61,'message':{'from':util[_0xcd43('0xd4')]('\x22%s\x22\x20<%s>',_0x28f085[_0xcd43('0x2a')],_0x28f085[_0xcd43('0xd5')]||_0x28f085[_0xcd43('0xce')][_0xcd43('0x50')]),'to':_0x10c09e[_0xcd43('0xd1')],'subject':_0x10c09e[_0xcd43('0xd6')],'html':_0x400120[_0xcd43('0x4c')],'attachments':_0x42f351}},client9003)[_0xcd43('0x11')](function(){return _0x400120;})[_0xcd43('0x1b')](function(_0x5baa4c){logger[_0xcd43('0x17')](_0x5baa4c);});}})[_0xcd43('0x11')](function(){if(_0x10c09e&&_0x10c09e[_0xcd43('0xca')]&&_0x10c09e[_0xcd43('0xd7')]){var _0x35d344=[];if(_0x2ac4bc[_0xcd43('0x3a')]){_0x35d344=_0x2ac4bc[_0xcd43('0x2e')](function(_0x288e28){return{'name':_0x288e28[_0xcd43('0xc6')],'basename':_0x288e28[_0xcd43('0x63')],'type':_0x288e28['mimetype'],'ChatOfflineMessageId':_0x1e6d35['id']};});}var _0x1e47d8;if(!_[_0xcd43('0x75')](_0x10c09e[_0xcd43('0xd8')])){var _0x52492c=_[_0xcd43('0x2e')](_0x957bd8['body'],function(_0x3dd3f4){return _0x3dd3f4;});var _0x226704=_[_0xcd43('0xd9')](_0x52492c)[0x0];var _0x1abb55=_[_0xcd43('0xda')](_0x226704,function(_0xbea66){return _0xbea66;});_0x1e47d8=_0x1abb55[0x1][_0x10c09e[_0xcd43('0xd8')]];}var _0x23d8e3={'from':_0x3b1939[_0xcd43('0xd5')],'firstName':_0x3b1939[_0xcd43('0x97')],'lastName':_0x3b1939[_0xcd43('0x98')],'mapKey':_0xcd43('0xd5'),'message':{'from':_0x3b1939['email'],'to':_0x10c09e[_0xcd43('0xbe')][_0xcd43('0xd5')],'cc':'','subject':_[_0xcd43('0x75')](_0x1e47d8)?_0x10c09e['offlineMessageSubject']:_0x1e47d8,'messageId':'','sentAt':new Date(),'attach':_0x35d344[_0xcd43('0x3a')],'attachments':_0x35d344,'originChannel':_0xcd43('0xdb'),'ChatWebsiteId':_0x10c09e['id'],'ChatOfflineMessageId':_0x400120['id'],'originTo':_0x10c09e[_0xcd43('0xbe')]['email']},'body':_0x400120['body']};var _0x48675f={'account':{'id':_0x10c09e['MailAccountId']},'body':_0x23d8e3,'log':_0xcd43('0xdc')};return respondWithRpcPromise(_0xcd43('0xdc'),_0xcd43('0xdd'),_0x48675f,client9001)[_0xcd43('0x11')](function(){return _0x400120;})[_0xcd43('0x1b')](function(_0x25028f){logger[_0xcd43('0x17')](_0x25028f);});}return;})['then'](function(){if(_0x400120){return _0x400120;}})[_0xcd43('0x11')](respondWithResult(_0x5cb4d0,null))[_0xcd43('0x1b')](function(_0xad501b){logger[_0xcd43('0x17')](_0xcd43('0x1b'),_0xad501b);for(var _0x350909 of _0x2ac4bc){var _0xad4ac6=path[_0xcd43('0x69')](config[_0xcd43('0x6a')],_0xcd43('0xc8'),_0xcd43('0xb6'),_0xcd43('0xde'),_0xcd43('0xdf'),_0x350909[_0xcd43('0x63')]);fs_extra['remove'](_0xad4ac6)[_0xcd43('0x1b')](function(_0x17ba64){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0xad4ac6,_0x17ba64);});}});};exports[_0xcd43('0xe0')]=function(_0x507033,_0x503ba2){return db[_0xcd43('0xa1')][_0xcd43('0x4a')]({'where':{'id':_0x507033['params']['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x503ba2,null))[_0xcd43('0x11')](function(_0xa0a485){if(_0xa0a485){return _0xa0a485[_0xcd43('0xe0')](_0x507033[_0xcd43('0x4c')][_0xcd43('0x5a')],_['omit'](_0x507033[_0xcd43('0x4c')],[_0xcd43('0x5a'),'id'])||{});}})[_0xcd43('0x11')](respondWithResult(_0x503ba2,null))[_0xcd43('0x1b')](handleError(_0x503ba2,null));};exports['getInteractions']=function(_0x11f4a7,_0x165fcd){var _0x2c0bad={'raw':![],'where':{}};var _0x53f7f5={};var _0x3b4a4f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcd43('0x56')]({'where':{'id':_0x11f4a7[_0xcd43('0x47')]['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x165fcd,null))[_0xcd43('0x11')](function(_0x29932a){if(_0x29932a){_0x53f7f5['model']=_[_0xcd43('0x35')](db[_0xcd43('0xa1')][_0xcd43('0x30')]);_0x53f7f5[_0xcd43('0x34')]=_[_0xcd43('0x35')](_0x11f4a7[_0xcd43('0x34')]);_0x53f7f5[_0xcd43('0x40')]=_['intersection'](_0x53f7f5[_0xcd43('0x36')],_0x53f7f5[_0xcd43('0x34')]);_0x2c0bad[_0xcd43('0x37')]=_['intersection'](_0x53f7f5[_0xcd43('0x36')],qs[_0xcd43('0x39')](_0x11f4a7[_0xcd43('0x34')][_0xcd43('0x39')]));_0x2c0bad[_0xcd43('0x37')]=_0x2c0bad[_0xcd43('0x37')][_0xcd43('0x3a')]?_0x2c0bad[_0xcd43('0x37')]:_0x53f7f5[_0xcd43('0x36')];if(!_0x11f4a7[_0xcd43('0x34')][_0xcd43('0x3b')](_0xcd43('0x3c'))){_0x2c0bad[_0xcd43('0x23')]=qs['limit'](_0x11f4a7[_0xcd43('0x34')][_0xcd43('0x23')]);_0x2c0bad[_0xcd43('0x22')]=qs[_0xcd43('0x22')](_0x11f4a7[_0xcd43('0x34')][_0xcd43('0x22')]);}_0x2c0bad[_0xcd43('0x3d')]=qs['sort'](_0x11f4a7[_0xcd43('0x34')][_0xcd43('0x3e')]);_0x2c0bad[_0xcd43('0x3f')]=qs[_0xcd43('0x40')](_['pick'](_0x11f4a7[_0xcd43('0x34')],_0x53f7f5[_0xcd43('0x40')]));_0x2c0bad['where'][_0xcd43('0x55')]=_0x29932a['id'];if(_0x11f4a7['query'][_0xcd43('0x41')]){_0x2c0bad[_0xcd43('0x3f')]=_[_0xcd43('0x43')](_0x2c0bad[_0xcd43('0x3f')],{'$or':_['map'](_0x2c0bad[_0xcd43('0x37')],function(_0x3945ed){var _0x39be2d={};_0x39be2d[_0x3945ed]={'$like':'%'+_0x11f4a7[_0xcd43('0x34')]['filter']+'%'};return _0x39be2d;})});}_0x2c0bad=_[_0xcd43('0x43')]({},_0x2c0bad,_0x11f4a7[_0xcd43('0x44')]);return db['ChatInteraction']['count']({'where':_0x2c0bad[_0xcd43('0x3f')]})[_0xcd43('0x11')](function(_0x426571){_0x3b4a4f[_0xcd43('0x21')]=_0x426571;if(_0x11f4a7[_0xcd43('0x34')]['includeAll']){_0x2c0bad[_0xcd43('0x45')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xcd43('0xe1')],'as':_0xcd43('0xe2'),'attributes':[_0xcd43('0x2a'),'fullname','internal'],'required':![]},{'model':db[_0xcd43('0xe3')],'as':'Tags','attributes':['id',_0xcd43('0x2a'),_0xcd43('0xe4')],'where':_0x11f4a7[_0xcd43('0x34')]['tag']?{'id':_0x11f4a7[_0xcd43('0x34')][_0xcd43('0xe5')]}:undefined,'required':_0x11f4a7[_0xcd43('0x34')][_0xcd43('0xe5')]?!![]:![]}];}return db['ChatInteraction'][_0xcd43('0x46')](_0x2c0bad);})['then'](function(_0x44c1b6){_0x3b4a4f[_0xcd43('0x5e')]=_0x44c1b6;return _0x3b4a4f;});}})[_0xcd43('0x11')](respondWithFilteredResult(_0x165fcd,_0x2c0bad))[_0xcd43('0x1b')](handleError(_0x165fcd,null));};function iftimePromise(_0x1db92d,_0x4340ef){return respondWithRpcPromise(_0xcd43('0xe6'),_0xcd43('0xe7'),{'command':_0x4340ef[_0xcd43('0xe8')]?util[_0xcd43('0xd4')]('iftime\x20%s,%s',_0x1db92d[_0xcd43('0xe9')],_0x4340ef[_0xcd43('0xe8')]):util['format'](_0xcd43('0xea'),_0x1db92d[_0xcd43('0xe9')])},client9002)[_0xcd43('0x11')](function(_0x213da8){var _0x46bdd4=_0x213da8&&_0x213da8['indexOf'](_0xcd43('0xeb'))>=0x0?!![]:![];logger[_0xcd43('0x12')](_0xcd43('0xec'),_0x4340ef['id'],_0x1db92d['id'],_0x1db92d[_0xcd43('0xe9')],_0x46bdd4?_0xcd43('0xed'):_0xcd43('0xee'),_0x4340ef[_0xcd43('0xe8')]?_0x4340ef[_0xcd43('0xe8')]:_0xcd43('0xef'));return _0x46bdd4;})[_0xcd43('0x1b')](function(_0x4f3824){logger[_0xcd43('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4340ef['id'],_0x1db92d['id'],_0x1db92d['interval'],util[_0xcd43('0xf0')](_0x4f3824,{'showHidden':![],'depth':null}),_0x4340ef[_0xcd43('0xe8')]?_0x4340ef['timezone']:_0xcd43('0xef'));return![];});}exports[_0xcd43('0xe7')]=function(_0x38d0e3,_0x4d5c56){var _0x31cbb8=0x0;var _0x13db89=0x0;var _0x4c2579=![];var _0x4bc248;var _0x3191fe;return db[_0xcd43('0x2f')]['find']({'where':{'id':_0x38d0e3[_0xcd43('0x47')]['id']},'include':[{'model':db['Interval'],'as':_0xcd43('0xf1'),'include':[{'model':db[_0xcd43('0xf1')],'as':'Intervals','attributes':['id',_0xcd43('0xe9')],'raw':!![]}]}]})[_0xcd43('0x11')](handleEntityNotFound(_0x4d5c56,null))['then'](function(_0x50b4a6){if(_0x50b4a6){_0x4bc248=_0x50b4a6;return _0x50b4a6[_0xcd43('0xf2')]({'raw':!![]});}})[_0xcd43('0x11')](function(_0x5c5311){if(_0x4bc248){if(_0x5c5311){_0x3191fe=_0x5c5311;}}return require(_0xcd43('0x6b'))[_0xcd43('0xf3')]();})['then'](function(_0x199340){if(_0x199340){_0x13db89=_0x199340[_0xcd43('0xf4')];_0x4c2579=_0x199340[_0xcd43('0xf5')];}})['then'](function(){return db[_0xcd43('0xa1')][_0xcd43('0x21')]({'where':{'closed':![]}});})[_0xcd43('0x11')](function(_0x361c5b){_0x31cbb8=_0x361c5b;if(_0x13db89&&_0x361c5b>_0x13db89){return db[_0xcd43('0xf6')][_0xcd43('0x56')]({'where':{'id':0x1}})[_0xcd43('0x11')](function(_0x4dc739){if(_0x4dc739){_0x4dc739[_0xcd43('0xf7')](_0xcd43('0xf8'));}});}})[_0xcd43('0x11')](function(){if(_0x4bc248[_0xcd43('0xf1')]&&_0x4bc248['Interval'][_0xcd43('0xf9')]){var _0x2509f8=[];for(var _0x156411=0x0;_0x156411<_0x4bc248['Interval'][_0xcd43('0xf9')][_0xcd43('0x3a')];_0x156411++){var _0x520ada=_0x4bc248[_0xcd43('0xf1')][_0xcd43('0xf9')][_0x156411][_0xcd43('0x4d')]({'plain':!![]});_0x2509f8['push'](iftimePromise(_0x520ada,_0x4bc248));}return BPromise[_0xcd43('0xfa')](_0x2509f8)[_0xcd43('0x11')](function(_0xea2357){return _[_0xcd43('0xfb')](_0xea2357);});}else{return!![];}})[_0xcd43('0x11')](function(_0xca55c){var _0x1702cc=fs[_0xcd43('0xfc')](path['join'](config[_0xcd43('0x6a')],'server/files/chat/iframe.ejs'),_0xcd43('0xc1'));var _0x49a661={'remote':_0x4bc248[_0xcd43('0xfd')],'query':querystring[_0xcd43('0x16')](_[_0xcd43('0x43')](_0x4bc248[_0xcd43('0x4d')]({'plain':!![]}),{'customerIp':_0x38d0e3['headers'][_0xcd43('0x95')]||_0x38d0e3[_0xcd43('0x7a')][_0xcd43('0xfe')]||_0x38d0e3['connection'][_0xcd43('0xff')]||_0x38d0e3['ip'],'referer':_0x38d0e3[_0xcd43('0x7a')]['referer'],'openedInteractions':_0x31cbb8,'maxInteractions':_0x13db89,'virtual':_0x4c2579[_0xcd43('0xf4')],'online':_0xca55c,'custom':_0x4c2579}))[_0xcd43('0x100')](/'/g,'\x5c\x27')};_0x4d5c56['send'](ejs['render'](Mustache['render'](_0x1702cc,_0x49a661),{'proactiveActions':_0x3191fe,'alignment':_0x4bc248[_0xcd43('0x101')],'verticalAlignment':_0x4bc248[_0xcd43('0x102')],'div_color':_0x4bc248[_0xcd43('0xe4')],'labelText':_0x4bc248['labelText'],'text_color':_0x4bc248['textColor'],'text_button_color':_0x4bc248[_0xcd43('0x103')],'button_color':_0x4bc248[_0xcd43('0x104')],'background_color':_0x4bc248['backgroundColor'],'hideWhenOffline':_0x4bc248[_0xcd43('0x105')],'interval':_0x4bc248[_0xcd43('0x106')]}));})[_0xcd43('0x1b')](handleError(_0x4d5c56,null));};exports[_0xcd43('0x107')]=function(_0x340d34,_0x48a1ef){var _0x20ee6c=_0x340d34['params']['id'];var _0x23c2bc=_0x340d34['body'];var _0x2e5790=0xc8;var _0x49f0e7=null;return db[_0xcd43('0xcb')]['transaction']({'isolationLevel':db['sequelize'][_0xcd43('0x108')][_0xcd43('0x109')][_0xcd43('0x10a')]},function(_0x5c8811){return db[_0xcd43('0x2f')][_0xcd43('0x56')]({'where':{'id':_0x20ee6c},'transaction':_0x5c8811})[_0xcd43('0x11')](function(_0x19f967){if(_0x19f967){return db[_0xcd43('0x10b')]['destroy']({'where':{'ChatWebsiteId':_0x20ee6c},'transaction':_0x5c8811})[_0xcd43('0x11')](function(){var _0x536446=_[_0xcd43('0x2e')](_0x23c2bc,function(_0x246e24){_0x246e24['ChatWebsiteId']=_0x20ee6c;return _0x246e24;});return db[_0xcd43('0x10b')][_0xcd43('0x10c')](_0x536446,{'transaction':_0x5c8811});});}else{_0x2e5790=0x194;_0x49f0e7=[];}});})[_0xcd43('0x11')](function(){if(_0x2e5790!==0x194){return db[_0xcd43('0x10b')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x20ee6c},'order':_0xcd43('0x10d')})[_0xcd43('0x11')](function(_0x35f4a7){_0x49f0e7=_0x35f4a7;});}})[_0xcd43('0x1b')](function(_0x4c7e7f){_0x2e5790=0x1f4;logger['error'](_0x4c7e7f[_0xcd43('0x10e')]);if(_0x4c7e7f[_0xcd43('0x2a')]){delete _0x4c7e7f[_0xcd43('0x2a')];}_0x49f0e7=_0x4c7e7f;})[_0xcd43('0x10f')](function(){if(_0x49f0e7===null){_0x48a1ef['sendStatus'](_0x2e5790);}else{if(_0x2e5790===0x1f4){_0x48a1ef[_0xcd43('0x1d')](_0x2e5790)[_0xcd43('0x2b')](_0x49f0e7);}else{_0x48a1ef['status'](_0x2e5790)[_0xcd43('0x1f')](_0x49f0e7);}}});};exports[_0xcd43('0x110')]=function(_0x25645d,_0x578512){var _0x263c1f={};var _0x1cbc79={};var _0x1ffd81;var _0x51f940;return db['ChatWebsite'][_0xcd43('0x56')]({'where':{'id':_0x25645d[_0xcd43('0x47')]['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x578512,null))['then'](function(_0x5bb5e6){if(_0x5bb5e6){_0x1ffd81=_0x5bb5e6;_0x1cbc79['model']=_['keys'](db[_0xcd43('0x10b')][_0xcd43('0x30')]);_0x1cbc79[_0xcd43('0x34')]=_[_0xcd43('0x35')](_0x25645d['query']);_0x1cbc79['filters']=_[_0xcd43('0x38')](_0x1cbc79[_0xcd43('0x36')],_0x1cbc79[_0xcd43('0x34')]);_0x263c1f[_0xcd43('0x37')]=_['intersection'](_0x1cbc79[_0xcd43('0x36')],qs[_0xcd43('0x39')](_0x25645d[_0xcd43('0x34')][_0xcd43('0x39')]));_0x263c1f[_0xcd43('0x37')]=_0x263c1f['attributes'][_0xcd43('0x3a')]?_0x263c1f['attributes']:_0x1cbc79[_0xcd43('0x36')];_0x263c1f[_0xcd43('0x3d')]=qs[_0xcd43('0x3e')](_0x25645d['query'][_0xcd43('0x3e')]);_0x263c1f[_0xcd43('0x3f')]=qs[_0xcd43('0x40')](_[_0xcd43('0x58')](_0x25645d['query'],_0x1cbc79[_0xcd43('0x40')]));if(_0x25645d[_0xcd43('0x34')][_0xcd43('0x41')]){_0x263c1f[_0xcd43('0x3f')]=_['merge'](_0x263c1f['where'],{'$or':_[_0xcd43('0x2e')](_0x263c1f[_0xcd43('0x37')],function(_0x47c382){var _0x4eabfd={};_0x4eabfd[_0x47c382]={'$like':'%'+_0x25645d[_0xcd43('0x34')][_0xcd43('0x41')]+'%'};return _0x4eabfd;})});}_0x263c1f=_[_0xcd43('0x43')]({},_0x263c1f,_0x25645d[_0xcd43('0x44')]);return _0x1ffd81['getApplications'](_0x263c1f);}})[_0xcd43('0x11')](function(_0x9ee0ba){if(_0x9ee0ba){_0x51f940=_0x9ee0ba[_0xcd43('0x3a')];if(!_0x25645d[_0xcd43('0x34')][_0xcd43('0x3b')](_0xcd43('0x3c'))){_0x263c1f[_0xcd43('0x23')]=qs[_0xcd43('0x23')](_0x25645d[_0xcd43('0x34')][_0xcd43('0x23')]);_0x263c1f[_0xcd43('0x22')]=qs['offset'](_0x25645d['query'][_0xcd43('0x22')]);}return _0x1ffd81[_0xcd43('0x110')](_0x263c1f);}})['then'](function(_0x11da57){if(_0x11da57){return _0x11da57?{'count':_0x51f940,'rows':_0x11da57}:null;}})[_0xcd43('0x11')](respondWithResult(_0x578512,null))[_0xcd43('0x1b')](handleError(_0x578512,null));};exports[_0xcd43('0x111')]=function(_0x287555,_0x354e51){return db['chatProactiveAction'][_0xcd43('0x4a')]({'where':{'id':_0x287555[_0xcd43('0x47')]['id']}})['then'](handleEntityNotFound(_0x354e51,null))[_0xcd43('0x11')](function(_0x4fcc66){if(_0x4fcc66){return _0x4fcc66[_0xcd43('0x111')](_0x287555[_0xcd43('0x4c')][_0xcd43('0x5a')],_['omit'](_0x287555[_0xcd43('0x4c')],[_0xcd43('0x5a'),'id'])||{});}})[_0xcd43('0x11')](respondWithResult(_0x354e51,null))[_0xcd43('0x1b')](handleError(_0x354e51,null));};exports['getProactiveActions']=function(_0x5a4610,_0x22b2c7){var _0x41218d={};var _0x699126={};var _0x46fda9;var _0x399b9f;return db[_0xcd43('0x2f')][_0xcd43('0x56')]({'where':{'id':_0x5a4610[_0xcd43('0x47')]['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x22b2c7,null))[_0xcd43('0x11')](function(_0x204ea1){if(_0x204ea1){_0x46fda9=_0x204ea1;_0x699126[_0xcd43('0x36')]=_['keys'](db[_0xcd43('0x112')][_0xcd43('0x30')]);_0x699126['query']=_['keys'](_0x5a4610[_0xcd43('0x34')]);_0x699126[_0xcd43('0x40')]=_[_0xcd43('0x38')](_0x699126[_0xcd43('0x36')],_0x699126['query']);_0x41218d['attributes']=_[_0xcd43('0x38')](_0x699126[_0xcd43('0x36')],qs[_0xcd43('0x39')](_0x5a4610[_0xcd43('0x34')]['fields']));_0x41218d[_0xcd43('0x37')]=_0x41218d[_0xcd43('0x37')][_0xcd43('0x3a')]?_0x41218d[_0xcd43('0x37')]:_0x699126['model'];_0x41218d[_0xcd43('0x3d')]=qs['sort'](_0x5a4610['query'][_0xcd43('0x3e')]);_0x41218d['where']=qs['filters'](_[_0xcd43('0x58')](_0x5a4610[_0xcd43('0x34')],_0x699126[_0xcd43('0x40')]));if(_0x5a4610['query'][_0xcd43('0x41')]){_0x41218d[_0xcd43('0x3f')]=_[_0xcd43('0x43')](_0x41218d['where'],{'$or':_['map'](_0x41218d['attributes'],function(_0x57e3c3){var _0x50669d={};_0x50669d[_0x57e3c3]={'$like':'%'+_0x5a4610[_0xcd43('0x34')]['filter']+'%'};return _0x50669d;})});}_0x41218d=_[_0xcd43('0x43')]({},_0x41218d,_0x5a4610[_0xcd43('0x44')]);return _0x46fda9[_0xcd43('0xf2')](_0x41218d);}})['then'](function(_0xabfd89){if(_0xabfd89){_0x399b9f=_0xabfd89[_0xcd43('0x3a')];if(!_0x5a4610[_0xcd43('0x34')][_0xcd43('0x3b')](_0xcd43('0x3c'))){_0x41218d[_0xcd43('0x23')]=qs['limit'](_0x5a4610[_0xcd43('0x34')][_0xcd43('0x23')]);_0x41218d[_0xcd43('0x22')]=qs[_0xcd43('0x22')](_0x5a4610[_0xcd43('0x34')][_0xcd43('0x22')]);}return _0x46fda9[_0xcd43('0xf2')](_0x41218d);}})[_0xcd43('0x11')](function(_0x1a23d6){if(_0x1a23d6){return _0x1a23d6?{'count':_0x399b9f,'rows':_0x1a23d6}:null;}})[_0xcd43('0x11')](respondWithResult(_0x22b2c7,null))[_0xcd43('0x1b')](handleError(_0x22b2c7,null));};exports[_0xcd43('0x113')]=function(_0x212c0d,_0x4e597b){var _0x3a6145=_0x212c0d[_0xcd43('0x34')][_0xcd43('0x114')]===_0xcd43('0x115')?_0xcd43('0x116'):_0xcd43('0x117');return db['ChatWebsite'][_0xcd43('0x4a')]({'attributes':['id',_0x3a6145],'where':{'id':_0x212c0d[_0xcd43('0x47')]['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x4e597b,null))['then'](function(_0x49d381){if(_0x49d381){var _0x15a5b5=_0x49d381[_0x3a6145];var _0x33b388=_0x15a5b5&&_0x15a5b5['items']?_0x15a5b5[_0xcd43('0x118')]:[];_0x4e597b[_0xcd43('0x2b')]({'fromKey':_['isNil'](_0x15a5b5[_0xcd43('0x119')])?undefined:_0x15a5b5[_0xcd43('0x119')],'count':_0x33b388['length'],'rows':_0x33b388});}})[_0xcd43('0x1b')](handleError(_0x4e597b,null));};exports[_0xcd43('0x11a')]=function(_0x1dbcb3,_0x3c65e3){var _0x53115d={'raw':![],'where':{}};var _0x3c7a8d={};var _0x35a0b0={'count':0x0,'rows':[]};return db[_0xcd43('0x2f')]['findOne']({'where':{'id':_0x1dbcb3[_0xcd43('0x47')]['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x3c65e3,null))[_0xcd43('0x11')](function(_0x3901f4){if(_0x3901f4){_0x3c7a8d[_0xcd43('0x36')]=_[_0xcd43('0x35')](db[_0xcd43('0x11b')][_0xcd43('0x30')]);_0x3c7a8d[_0xcd43('0x34')]=_[_0xcd43('0x35')](_0x1dbcb3[_0xcd43('0x34')]);_0x3c7a8d[_0xcd43('0x40')]=_[_0xcd43('0x38')](_0x3c7a8d[_0xcd43('0x36')],_0x3c7a8d[_0xcd43('0x34')]);_0x53115d[_0xcd43('0x37')]=_[_0xcd43('0x38')](_0x3c7a8d[_0xcd43('0x36')],qs[_0xcd43('0x39')](_0x1dbcb3['query']['fields']));_0x53115d[_0xcd43('0x37')]=_0x53115d[_0xcd43('0x37')][_0xcd43('0x3a')]?_0x53115d[_0xcd43('0x37')]:_0x3c7a8d[_0xcd43('0x36')];if(!_0x1dbcb3[_0xcd43('0x34')]['hasOwnProperty'](_0xcd43('0x3c'))){_0x53115d[_0xcd43('0x23')]=qs[_0xcd43('0x23')](_0x1dbcb3[_0xcd43('0x34')][_0xcd43('0x23')]);_0x53115d[_0xcd43('0x22')]=qs[_0xcd43('0x22')](_0x1dbcb3[_0xcd43('0x34')][_0xcd43('0x22')]);}_0x53115d[_0xcd43('0x3d')]=qs[_0xcd43('0x3e')](_0x1dbcb3['query'][_0xcd43('0x3e')]);_0x53115d[_0xcd43('0x3f')]=qs[_0xcd43('0x40')](_['pick'](_0x1dbcb3[_0xcd43('0x34')],_0x3c7a8d['filters']));_0x53115d[_0xcd43('0x3f')][_0xcd43('0x55')]=_0x3901f4['id'];if(_0x1dbcb3['query']['filter']){_0x53115d['where']=_[_0xcd43('0x43')](_0x53115d[_0xcd43('0x3f')],{'$or':_[_0xcd43('0x2e')](_0x53115d[_0xcd43('0x37')],function(_0x521f8e){var _0x4f1b9e={};_0x4f1b9e[_0x521f8e]={'$like':'%'+_0x1dbcb3[_0xcd43('0x34')]['filter']+'%'};return _0x4f1b9e;})});}_0x53115d=_[_0xcd43('0x43')]({},_0x53115d,_0x1dbcb3[_0xcd43('0x44')]);return db[_0xcd43('0x11b')][_0xcd43('0x21')]({'where':_0x53115d['where']})[_0xcd43('0x11')](function(_0x1ecba3){_0x35a0b0[_0xcd43('0x21')]=_0x1ecba3;if(_0x1dbcb3[_0xcd43('0x34')]['includeAll']){_0x53115d[_0xcd43('0x45')]=[{'all':!![]}];}else{_0x53115d['include']=[{'model':db[_0xcd43('0x7c')],'as':_0xcd43('0x11c'),'required':![]},{'model':db[_0xcd43('0x11d')],'as':_0xcd43('0x11e'),'required':![]}];}return db[_0xcd43('0x11b')][_0xcd43('0x46')](_0x53115d);})[_0xcd43('0x11')](function(_0x1bee81){_0x35a0b0[_0xcd43('0x5e')]=_0x1bee81;return _0x35a0b0;});}})[_0xcd43('0x11')](respondWithFilteredResult(_0x3c65e3,_0x53115d))['catch'](handleError(_0x3c65e3,null));};exports['addAgents']=function(_0x42284d,_0x3a92fa){return db['ChatWebsite'][_0xcd43('0x4a')]({'where':{'id':_0x42284d[_0xcd43('0x47')]['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x3a92fa,null))['then'](function(_0x390bf5){if(_0x390bf5){return _0x390bf5['addAgents'](_0x42284d['body'][_0xcd43('0x5a')],_[_0xcd43('0x11f')](_0x42284d[_0xcd43('0x4c')],[_0xcd43('0x5a'),'id'])||{})[_0xcd43('0xa4')](function(_0x3e142f){for(var _0x50723f=0x0;_0x50723f<_0x42284d['body'][_0xcd43('0x5a')][_0xcd43('0x3a')];_0x50723f+=0x1){socket['emit'](_0xcd43('0x120'),{'UserId':Number(_0x42284d[_0xcd43('0x4c')][_0xcd43('0x5a')][_0x50723f]),'ChatWebsiteId':Number(_0x42284d[_0xcd43('0x47')]['id'])});}return _0x3e142f;});}})[_0xcd43('0x11')](respondWithResult(_0x3a92fa,null))[_0xcd43('0x1b')](handleError(_0x3a92fa,null));};exports[_0xcd43('0x121')]=function(_0x1486c2,_0x16f59f){return db[_0xcd43('0x2f')][_0xcd43('0x4a')]({'where':{'id':_0x1486c2[_0xcd43('0x47')]['id']}})[_0xcd43('0x11')](handleEntityNotFound(_0x16f59f,null))['then'](function(_0x4d6806){if(_0x4d6806){return _0x4d6806['removeAgents'](_0x1486c2[_0xcd43('0x34')][_0xcd43('0x5a')])[_0xcd43('0x11')](function(){if(_[_0xcd43('0x122')](_0x1486c2[_0xcd43('0x34')][_0xcd43('0x5a')])){for(var _0xaad0f1=0x0;_0xaad0f1<_0x1486c2[_0xcd43('0x34')][_0xcd43('0x5a')][_0xcd43('0x3a')];_0xaad0f1+=0x1){socket[_0xcd43('0x123')](_0xcd43('0x124'),{'UserId':Number(_0x1486c2[_0xcd43('0x34')][_0xcd43('0x5a')][_0xaad0f1]),'ChatWebsiteId':Number(_0x1486c2[_0xcd43('0x47')]['id'])});}}else{socket[_0xcd43('0x123')](_0xcd43('0x124'),{'UserId':Number(_0x1486c2['query'][_0xcd43('0x5a')]),'ChatWebsiteId':Number(_0x1486c2[_0xcd43('0x47')]['id'])});}});}})[_0xcd43('0x11')](respondWithStatusCode(_0x16f59f,null))[_0xcd43('0x1b')](handleError(_0x16f59f,null));};exports[_0xcd43('0x125')]=function(_0x3af87d,_0x1e3710){var _0x58190b={};var _0x539bc4={};var _0x45e2c4;var _0x143d0a;return db[_0xcd43('0x2f')][_0xcd43('0x56')]({'where':{'id':_0x3af87d[_0xcd43('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e3710,null))[_0xcd43('0x11')](function(_0xc9a400){if(_0xc9a400){_0x45e2c4=_0xc9a400;_0x539bc4[_0xcd43('0x36')]=_[_0xcd43('0x35')](db[_0xcd43('0xe1')][_0xcd43('0x30')]);_0x539bc4['query']=_['keys'](_0x3af87d[_0xcd43('0x34')]);_0x539bc4['filters']=_[_0xcd43('0x38')](_0x539bc4[_0xcd43('0x36')],_0x539bc4[_0xcd43('0x34')]);_0x58190b[_0xcd43('0x37')]=_[_0xcd43('0x38')](_0x539bc4[_0xcd43('0x36')],qs['fields'](_0x3af87d[_0xcd43('0x34')][_0xcd43('0x39')]));_0x58190b[_0xcd43('0x37')]=_0x58190b[_0xcd43('0x37')][_0xcd43('0x3a')]?_0x58190b['attributes']:_0x539bc4[_0xcd43('0x36')];_0x58190b['order']=qs[_0xcd43('0x3e')](_0x3af87d[_0xcd43('0x34')][_0xcd43('0x3e')]);_0x58190b['where']=qs['filters'](_[_0xcd43('0x58')](_0x3af87d[_0xcd43('0x34')],_0x539bc4['filters']));if(_0x3af87d[_0xcd43('0x34')][_0xcd43('0x41')]){_0x58190b[_0xcd43('0x3f')]=_[_0xcd43('0x43')](_0x58190b['where'],{'$or':_[_0xcd43('0x2e')](_0x58190b[_0xcd43('0x37')],function(_0x396eea){var _0x1adb15={};_0x1adb15[_0x396eea]={'$like':'%'+_0x3af87d[_0xcd43('0x34')]['filter']+'%'};return _0x1adb15;})});}_0x58190b=_[_0xcd43('0x43')]({},_0x58190b,_0x3af87d[_0xcd43('0x44')]);return _0x45e2c4[_0xcd43('0x125')](_0x58190b);}})[_0xcd43('0x11')](function(_0x9e8eb7){if(_0x9e8eb7){_0x143d0a=_0x9e8eb7['length'];if(!_0x3af87d[_0xcd43('0x34')][_0xcd43('0x3b')](_0xcd43('0x3c'))){_0x58190b[_0xcd43('0x23')]=qs['limit'](_0x3af87d[_0xcd43('0x34')]['limit']);_0x58190b[_0xcd43('0x22')]=qs['offset'](_0x3af87d[_0xcd43('0x34')]['offset']);}return _0x45e2c4[_0xcd43('0x125')](_0x58190b);}})[_0xcd43('0x11')](function(_0x4429ab){if(_0x4429ab){return _0x4429ab?{'count':_0x143d0a,'rows':_0x4429ab}:null;}})[_0xcd43('0x11')](respondWithResult(_0x1e3710,null))['catch'](handleError(_0x1e3710,null));};
\ No newline at end of file
+var _0x72fa=['Start','startRouting','EventManager','offline','files','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','openNewInteraction','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','forwardOfflineAddress','MailAccountId','subjectOffline','toPairsIn','mapValues','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','inspect','Interval','Intervals','virtual','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','ejs','fs-extra','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','get','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','ChatWebsite','findAll','rows','show','params','find','create','role','user','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','systemAvatar','user-agent-parser','setUA','headers','user-agent','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','asc','contact','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership'];(function(_0x3ac3f6,_0x5d09a5){var _0x63ea4a=function(_0x667edc){while(--_0x667edc){_0x3ac3f6['push'](_0x3ac3f6['shift']());}};_0x63ea4a(++_0x5d09a5);}(_0x72fa,0x74));var _0xa72f=function(_0x1ed034,_0x5d495d){_0x1ed034=_0x1ed034-0x0;var _0x4a82b7=_0x72fa[_0x1ed034];return _0x4a82b7;};'use strict';var BPromise=require(_0xa72f('0x0'));var Mustache=require('mustache');var util=require(_0xa72f('0x1'));var path=require('path');var ejs=require(_0xa72f('0x2'));var fs=require('fs');var fs_extra=require(_0xa72f('0x3'));var _=require('lodash');var querystring=require('querystring');var Redis=require(_0xa72f('0x4'));var qs=require(_0xa72f('0x5'));var logger=require(_0xa72f('0x6'))('api');var config=require('../../config/environment');var db=require(_0xa72f('0x7'))['db'];config[_0xa72f('0x8')]=_[_0xa72f('0x9')](config['redis'],{'host':_0xa72f('0xa'),'port':0x18eb});var socket=require(_0xa72f('0xb'))(new Redis(config[_0xa72f('0x8')]));require('./chatWebsite.socket')[_0xa72f('0xc')](socket);var htmlToText=require('html-to-text');var jayson=require(_0xa72f('0xd'));var client=jayson[_0xa72f('0xe')]['http']({'port':0x232c});var client9002=jayson['client'][_0xa72f('0xf')]({'port':0x232a});var client9003=jayson[_0xa72f('0xe')][_0xa72f('0xf')]({'port':0x232b});var client9001=jayson[_0xa72f('0xe')]['http']({'port':0x2329});function respondWithRpcPromise(_0x56f3ec,_0x21ca2f,_0x53112f,_0x57e110){return new BPromise(function(_0x423e51,_0x3db1eb){var _0x593679=_0x57e110||client;return _0x593679[_0xa72f('0x10')](_0x56f3ec,_0x53112f)[_0xa72f('0x11')](function(_0x2be183){logger[_0xa72f('0x12')](_0xa72f('0x13'),_0x21ca2f,_0xa72f('0x14'));logger[_0xa72f('0x15')](_0xa72f('0x16'),_0x21ca2f,_0xa72f('0x14'),JSON[_0xa72f('0x17')](_0x2be183));if(_0x2be183[_0xa72f('0x18')]){if(_0x2be183['error'][_0xa72f('0x19')]===0x1f4){logger[_0xa72f('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x21ca2f,_0x2be183[_0xa72f('0x18')][_0xa72f('0x1a')]);return _0x3db1eb(_0x2be183[_0xa72f('0x18')][_0xa72f('0x1a')]);}logger[_0xa72f('0x18')](_0xa72f('0x13'),_0x21ca2f,_0x2be183['error'][_0xa72f('0x1a')]);return _0x423e51(_0x2be183[_0xa72f('0x18')][_0xa72f('0x1a')]);}else{logger['info'](_0xa72f('0x13'),_0x21ca2f,_0xa72f('0x14'));_0x423e51(_0x2be183[_0xa72f('0x1b')][_0xa72f('0x1a')]);}})[_0xa72f('0x1c')](function(_0x3e3cba){logger['error'](_0xa72f('0x13'),_0x21ca2f,_0x3e3cba);_0x3db1eb(_0x3e3cba);});});}function respondWithStatusCode(_0x25c1bf,_0x2e1082){_0x2e1082=_0x2e1082||0xcc;return function(_0x395a56){if(_0x395a56){return _0x25c1bf[_0xa72f('0x1d')](_0x2e1082);}return _0x25c1bf[_0xa72f('0x1e')](_0x2e1082)[_0xa72f('0x1f')]();};}function respondWithResult(_0x214d5f,_0x45c753){_0x45c753=_0x45c753||0xc8;return function(_0x499bad){if(_0x499bad){return _0x214d5f[_0xa72f('0x1e')](_0x45c753)[_0xa72f('0x20')](_0x499bad);}};}function respondWithFilteredResult(_0x5de922,_0x19e738){return function(_0x40f489){if(_0x40f489){var _0x14bbd2=typeof _0x19e738[_0xa72f('0x21')]===_0xa72f('0x22')&&typeof _0x19e738['limit']===_0xa72f('0x22');var _0x219634=_0x40f489['count'];var _0x2765c6=_0x14bbd2?0x0:_0x19e738[_0xa72f('0x21')];var _0x375b85=_0x14bbd2?_0x40f489[_0xa72f('0x23')]:_0x19e738[_0xa72f('0x21')]+_0x19e738[_0xa72f('0x24')];var _0x165b2f;if(_0x375b85>=_0x219634){_0x375b85=_0x219634;_0x165b2f=0xc8;}else{_0x165b2f=0xce;}_0x5de922[_0xa72f('0x1e')](_0x165b2f);return _0x5de922[_0xa72f('0x25')](_0xa72f('0x26'),_0x2765c6+'-'+_0x375b85+'/'+_0x219634)['json'](_0x40f489);}return null;};}function saveUpdates(_0x168959){return function(_0x5c16e7){if(_0x5c16e7){return _0x5c16e7[_0xa72f('0x27')](_0x168959)[_0xa72f('0x11')](function(_0x1df195){return _0x1df195;});}return null;};}function removeEntity(_0x404aed){return function(_0x5a9e4c){if(_0x5a9e4c){return _0x5a9e4c['destroy']()['then'](function(){var _0x12f17e=_0x5a9e4c[_0xa72f('0x28')]({'plain':!![]});var _0x92094='ChatWebsites';return db[_0xa72f('0x29')]['destroy']({'where':{'type':_0x92094,'resourceId':_0x12f17e['id']}})[_0xa72f('0x11')](function(){return _0x5a9e4c;});})['then'](function(){_0x404aed[_0xa72f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x452736){return function(_0x310840){if(!_0x310840){_0x452736['sendStatus'](0x194);}return _0x310840;};}function handleError(_0x47e484,_0x55520c){_0x55520c=_0x55520c||0x1f4;return function(_0x518dd1){logger[_0xa72f('0x18')](_0x518dd1[_0xa72f('0x2a')]);if(_0x518dd1[_0xa72f('0x2b')]){delete _0x518dd1[_0xa72f('0x2b')];}_0x47e484[_0xa72f('0x1e')](_0x55520c)['send'](_0x518dd1);};}exports[_0xa72f('0x2c')]=function(_0x436bb3,_0x5d767f){var _0x1df7a4={'include':[{'model':db[_0xa72f('0x2d')],'as':_0xa72f('0x2e')}]},_0x3ecdb9={},_0x533476={'count':0x0,'rows':[]};var _0x3b42b4=_[_0xa72f('0x2f')](db['ChatWebsite'][_0xa72f('0x30')],function(_0x186276){return{'name':_0x186276['fieldName'],'type':_0x186276['type']['key']};});_0x3ecdb9[_0xa72f('0x31')]=_[_0xa72f('0x2f')](_0x3b42b4,'name');_0x3ecdb9['query']=_[_0xa72f('0x32')](_0x436bb3[_0xa72f('0x33')]);_0x3ecdb9[_0xa72f('0x34')]=_[_0xa72f('0x35')](_0x3ecdb9['model'],_0x3ecdb9['query']);_0x1df7a4['attributes']=_[_0xa72f('0x35')](_0x3ecdb9[_0xa72f('0x31')],qs[_0xa72f('0x36')](_0x436bb3[_0xa72f('0x33')]['fields']));_0x1df7a4[_0xa72f('0x37')]=_0x1df7a4['attributes'][_0xa72f('0x38')]?_0x1df7a4[_0xa72f('0x37')]:_0x3ecdb9[_0xa72f('0x31')];if(!_0x436bb3[_0xa72f('0x33')][_0xa72f('0x39')](_0xa72f('0x3a'))){_0x1df7a4[_0xa72f('0x24')]=qs['limit'](_0x436bb3['query'][_0xa72f('0x24')]);_0x1df7a4[_0xa72f('0x21')]=qs[_0xa72f('0x21')](_0x436bb3[_0xa72f('0x33')][_0xa72f('0x21')]);}_0x1df7a4[_0xa72f('0x3b')]=qs['sort'](_0x436bb3['query'][_0xa72f('0x3c')]);_0x1df7a4[_0xa72f('0x3d')]=qs[_0xa72f('0x34')](_[_0xa72f('0x3e')](_0x436bb3[_0xa72f('0x33')],_0x3ecdb9[_0xa72f('0x34')]),_0x3b42b4);if(_0x436bb3[_0xa72f('0x33')][_0xa72f('0x3f')]){_0x1df7a4['where']=_[_0xa72f('0x40')](_0x1df7a4[_0xa72f('0x3d')],{'$or':_[_0xa72f('0x2f')](_0x3b42b4,function(_0x1a8a0e){if(_0x1a8a0e[_0xa72f('0x41')]!=='VIRTUAL'){var _0x2e09b7={};_0x2e09b7[_0x1a8a0e[_0xa72f('0x2b')]]={'$like':'%'+_0x436bb3[_0xa72f('0x33')]['filter']+'%'};return _0x2e09b7;}})});}_0x1df7a4=_[_0xa72f('0x40')]({},_0x1df7a4,_0x436bb3[_0xa72f('0x42')]);var _0xbf0957={'where':_0x1df7a4['where']};return db['ChatWebsite'][_0xa72f('0x23')](_0xbf0957)[_0xa72f('0x11')](function(_0x55ebea){_0x533476[_0xa72f('0x23')]=_0x55ebea;if(_0x436bb3[_0xa72f('0x33')][_0xa72f('0x43')]){_0x1df7a4[_0xa72f('0x44')]=[{'all':!![]}];}return db[_0xa72f('0x45')][_0xa72f('0x46')](_0x1df7a4);})[_0xa72f('0x11')](function(_0x27cfd3){_0x533476[_0xa72f('0x47')]=_0x27cfd3;return _0x533476;})['then'](respondWithFilteredResult(_0x5d767f,_0x1df7a4))['catch'](handleError(_0x5d767f,null));};exports[_0xa72f('0x48')]=function(_0x36b7ad,_0x281f93){var _0x27602b={'raw':![],'where':{'id':_0x36b7ad[_0xa72f('0x49')]['id']},'include':[{'model':db[_0xa72f('0x2d')],'as':_0xa72f('0x2e')}]},_0x57bca0={};_0x57bca0[_0xa72f('0x31')]=_[_0xa72f('0x32')](db[_0xa72f('0x45')][_0xa72f('0x30')]);_0x57bca0[_0xa72f('0x33')]=_['keys'](_0x36b7ad['query']);_0x57bca0[_0xa72f('0x34')]=_['intersection'](_0x57bca0[_0xa72f('0x31')],_0x57bca0[_0xa72f('0x33')]);_0x27602b[_0xa72f('0x37')]=_['intersection'](_0x57bca0[_0xa72f('0x31')],qs[_0xa72f('0x36')](_0x36b7ad['query'][_0xa72f('0x36')]));_0x27602b[_0xa72f('0x37')]=_0x27602b[_0xa72f('0x37')]['length']?_0x27602b[_0xa72f('0x37')]:_0x57bca0['model'];if(_0x36b7ad[_0xa72f('0x33')]['includeAll']){_0x27602b[_0xa72f('0x44')]=[{'all':!![]}];}_0x27602b=_[_0xa72f('0x40')]({},_0x27602b,_0x36b7ad[_0xa72f('0x42')]);return db['ChatWebsite'][_0xa72f('0x4a')](_0x27602b)[_0xa72f('0x11')](handleEntityNotFound(_0x281f93,null))[_0xa72f('0x11')](respondWithResult(_0x281f93,null))['catch'](handleError(_0x281f93,null));};exports[_0xa72f('0x4b')]=function(_0x5a13d,_0x4296a3){return db['ChatWebsite'][_0xa72f('0x4b')](_0x5a13d['body'],{})[_0xa72f('0x11')](function(_0x5f0ae1){var _0x314970=_0x5a13d['user'][_0xa72f('0x28')]({'plain':!![]});if(!_0x314970)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x314970[_0xa72f('0x4c')]===_0xa72f('0x4d')){var _0x5ca609=_0x5f0ae1[_0xa72f('0x28')]({'plain':!![]});var _0x46c447=_0xa72f('0x4e');return db[_0xa72f('0x4f')][_0xa72f('0x4a')]({'where':{'name':_0x46c447,'userProfileId':_0x314970['userProfileId']},'raw':!![]})[_0xa72f('0x11')](function(_0x2b53b3){if(_0x2b53b3&&_0x2b53b3[_0xa72f('0x50')]===0x0){return db[_0xa72f('0x29')][_0xa72f('0x4b')]({'name':_0x5ca609[_0xa72f('0x2b')],'resourceId':_0x5ca609['id'],'type':_0x2b53b3[_0xa72f('0x2b')],'sectionId':_0x2b53b3['id']},{})[_0xa72f('0x11')](function(){return _0x5f0ae1;});}else{return _0x5f0ae1;}})['catch'](function(_0x5651bb){logger[_0xa72f('0x18')](_0xa72f('0x51'),_0x5651bb);throw _0x5651bb;});}return _0x5f0ae1;})[_0xa72f('0x11')](respondWithResult(_0x4296a3,0xc9))['catch'](handleError(_0x4296a3,null));};exports[_0xa72f('0x27')]=function(_0x4af94a,_0x2c6371){if(_0x4af94a[_0xa72f('0x52')]['id']){delete _0x4af94a['body']['id'];}return db[_0xa72f('0x45')]['find']({'where':{'id':_0x4af94a['params']['id']},'include':[{'model':db[_0xa72f('0x2d')],'as':_0xa72f('0x2e')}]})[_0xa72f('0x11')](handleEntityNotFound(_0x2c6371,null))['then'](saveUpdates(_0x4af94a[_0xa72f('0x52')],null))['then'](respondWithResult(_0x2c6371,null))[_0xa72f('0x1c')](handleError(_0x2c6371,null));};exports[_0xa72f('0x53')]=function(_0x1ab76f,_0x2bc4ef){return db['ChatWebsite']['find']({'where':{'id':_0x1ab76f['params']['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x2bc4ef,null))['then'](removeEntity(_0x2bc4ef,null))[_0xa72f('0x1c')](handleError(_0x2bc4ef,null));};exports[_0xa72f('0x54')]=function(_0x60d236,_0x27f842){return db[_0xa72f('0x45')][_0xa72f('0x54')]()[_0xa72f('0x11')](respondWithResult(_0x27f842,null))['catch'](handleError(_0x27f842,null));};exports[_0xa72f('0x55')]=function(_0x4ae18f,_0x2dcb68){if(_0x4ae18f['body']['id']){delete _0x4ae18f['body']['id'];}return db['ChatWebsite'][_0xa72f('0x4a')]({'where':{'id':_0x4ae18f[_0xa72f('0x49')]['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x2dcb68,null))[_0xa72f('0x11')](function(_0x41fb67){if(_0x41fb67){_0x4ae18f[_0xa72f('0x52')][_0xa72f('0x56')]=_0x41fb67['id'];return db[_0xa72f('0x57')]['create'](_0x4ae18f['body']);}})[_0xa72f('0x11')](respondWithResult(_0x2dcb68,null))[_0xa72f('0x1c')](handleError(_0x2dcb68,null));};exports['getDispositions']=function(_0x41dd07,_0x41c661){var _0x206065={'raw':![],'where':{}};var _0x2d85a0={};var _0x188de6={'count':0x0,'rows':[]};return db[_0xa72f('0x45')][_0xa72f('0x58')]({'where':{'id':_0x41dd07[_0xa72f('0x49')]['id']}})['then'](handleEntityNotFound(_0x41c661,null))['then'](function(_0x2b95e2){if(_0x2b95e2){_0x2d85a0['model']=_['keys'](db[_0xa72f('0x57')][_0xa72f('0x30')]);_0x2d85a0[_0xa72f('0x33')]=_[_0xa72f('0x32')](_0x41dd07[_0xa72f('0x33')]);_0x2d85a0[_0xa72f('0x34')]=_[_0xa72f('0x35')](_0x2d85a0[_0xa72f('0x31')],_0x2d85a0[_0xa72f('0x33')]);_0x206065['attributes']=_[_0xa72f('0x35')](_0x2d85a0[_0xa72f('0x31')],qs[_0xa72f('0x36')](_0x41dd07[_0xa72f('0x33')][_0xa72f('0x36')]));_0x206065[_0xa72f('0x37')]=_0x206065[_0xa72f('0x37')][_0xa72f('0x38')]?_0x206065[_0xa72f('0x37')]:_0x2d85a0[_0xa72f('0x31')];if(!_0x41dd07['query'][_0xa72f('0x39')](_0xa72f('0x3a'))){_0x206065[_0xa72f('0x24')]=qs[_0xa72f('0x24')](_0x41dd07[_0xa72f('0x33')]['limit']);_0x206065[_0xa72f('0x21')]=qs[_0xa72f('0x21')](_0x41dd07[_0xa72f('0x33')][_0xa72f('0x21')]);}_0x206065[_0xa72f('0x3b')]=qs[_0xa72f('0x3c')](_0x41dd07[_0xa72f('0x33')][_0xa72f('0x3c')]);_0x206065[_0xa72f('0x3d')]=qs[_0xa72f('0x34')](_[_0xa72f('0x3e')](_0x41dd07[_0xa72f('0x33')],_0x2d85a0[_0xa72f('0x34')]));_0x206065['where'][_0xa72f('0x56')]=_0x2b95e2['id'];if(_0x41dd07[_0xa72f('0x33')][_0xa72f('0x3f')]){_0x206065['where']=_[_0xa72f('0x40')](_0x206065[_0xa72f('0x3d')],{'$or':_[_0xa72f('0x2f')](_0x206065['attributes'],function(_0x5e7a1e){var _0x152daf={};_0x152daf[_0x5e7a1e]={'$like':'%'+_0x41dd07[_0xa72f('0x33')][_0xa72f('0x3f')]+'%'};return _0x152daf;})});}_0x206065=_[_0xa72f('0x40')]({},_0x206065,_0x41dd07[_0xa72f('0x42')]);return db[_0xa72f('0x57')]['count']({'where':_0x206065[_0xa72f('0x3d')]})[_0xa72f('0x11')](function(_0x44328d){_0x188de6[_0xa72f('0x23')]=_0x44328d;if(_0x41dd07['query'][_0xa72f('0x43')]){_0x206065[_0xa72f('0x44')]=[{'all':!![]}];}return db[_0xa72f('0x57')][_0xa72f('0x46')](_0x206065);})['then'](function(_0x124c03){_0x188de6['rows']=_0x124c03;return _0x188de6;});}})[_0xa72f('0x11')](respondWithFilteredResult(_0x41c661,_0x206065))['catch'](handleError(_0x41c661,null));};exports[_0xa72f('0x59')]=function(_0x5bbb83,_0x4e002d){return db[_0xa72f('0x45')][_0xa72f('0x4a')]({'where':{'id':_0x5bbb83['params']['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x4e002d,null))[_0xa72f('0x11')](function(_0x15e73d){if(_0x15e73d){return _0x15e73d[_0xa72f('0x59')](_0x5bbb83[_0xa72f('0x33')][_0xa72f('0x5a')]);}})['then'](respondWithStatusCode(_0x4e002d,null))[_0xa72f('0x1c')](handleError(_0x4e002d,null));};exports[_0xa72f('0x5b')]=function(_0x24f1a2,_0x42cb06){if(_0x24f1a2[_0xa72f('0x52')]['id']){delete _0x24f1a2[_0xa72f('0x52')]['id'];}return db[_0xa72f('0x45')][_0xa72f('0x4a')]({'where':{'id':_0x24f1a2[_0xa72f('0x49')]['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x42cb06,null))[_0xa72f('0x11')](function(_0x3fe045){if(_0x3fe045){_0x24f1a2[_0xa72f('0x52')][_0xa72f('0x56')]=_0x3fe045['id'];return db['CannedAnswer'][_0xa72f('0x4b')](_0x24f1a2[_0xa72f('0x52')]);}})[_0xa72f('0x11')](respondWithResult(_0x42cb06,null))[_0xa72f('0x1c')](handleError(_0x42cb06,null));};exports[_0xa72f('0x5c')]=function(_0x2210b7,_0x266e49){var _0x361102={'raw':![],'where':{}};var _0x309e65={};var _0x678dfe={'count':0x0,'rows':[]};return db[_0xa72f('0x45')]['findOne']({'where':{'id':_0x2210b7[_0xa72f('0x49')]['id']}})['then'](handleEntityNotFound(_0x266e49,null))[_0xa72f('0x11')](function(_0x3a7045){if(_0x3a7045){_0x309e65[_0xa72f('0x31')]=_['keys'](db[_0xa72f('0x5d')]['rawAttributes']);_0x309e65[_0xa72f('0x33')]=_[_0xa72f('0x32')](_0x2210b7['query']);_0x309e65[_0xa72f('0x34')]=_['intersection'](_0x309e65[_0xa72f('0x31')],_0x309e65[_0xa72f('0x33')]);_0x361102[_0xa72f('0x37')]=_[_0xa72f('0x35')](_0x309e65[_0xa72f('0x31')],qs['fields'](_0x2210b7['query'][_0xa72f('0x36')]));_0x361102[_0xa72f('0x37')]=_0x361102[_0xa72f('0x37')][_0xa72f('0x38')]?_0x361102[_0xa72f('0x37')]:_0x309e65[_0xa72f('0x31')];if(!_0x2210b7[_0xa72f('0x33')][_0xa72f('0x39')](_0xa72f('0x3a'))){_0x361102[_0xa72f('0x24')]=qs[_0xa72f('0x24')](_0x2210b7[_0xa72f('0x33')]['limit']);_0x361102[_0xa72f('0x21')]=qs[_0xa72f('0x21')](_0x2210b7[_0xa72f('0x33')][_0xa72f('0x21')]);}_0x361102[_0xa72f('0x3b')]=qs[_0xa72f('0x3c')](_0x2210b7['query'][_0xa72f('0x3c')]);_0x361102[_0xa72f('0x3d')]=qs['filters'](_[_0xa72f('0x3e')](_0x2210b7[_0xa72f('0x33')],_0x309e65[_0xa72f('0x34')]));_0x361102[_0xa72f('0x3d')]['ChatWebsiteId']=_0x3a7045['id'];if(_0x2210b7[_0xa72f('0x33')][_0xa72f('0x3f')]){_0x361102[_0xa72f('0x3d')]=_[_0xa72f('0x40')](_0x361102['where'],{'$or':_[_0xa72f('0x2f')](_0x361102[_0xa72f('0x37')],function(_0x2078e0){var _0x11c971={};_0x11c971[_0x2078e0]={'$like':'%'+_0x2210b7[_0xa72f('0x33')][_0xa72f('0x3f')]+'%'};return _0x11c971;})});}_0x361102=_[_0xa72f('0x40')]({},_0x361102,_0x2210b7[_0xa72f('0x42')]);return db[_0xa72f('0x5d')]['count']({'where':_0x361102[_0xa72f('0x3d')]})['then'](function(_0x105932){_0x678dfe['count']=_0x105932;if(_0x2210b7[_0xa72f('0x33')][_0xa72f('0x43')]){_0x361102[_0xa72f('0x44')]=[{'all':!![]}];}return db[_0xa72f('0x5d')]['findAll'](_0x361102);})[_0xa72f('0x11')](function(_0x32d9ee){_0x678dfe[_0xa72f('0x47')]=_0x32d9ee;return _0x678dfe;});}})[_0xa72f('0x11')](respondWithFilteredResult(_0x266e49,_0x361102))['catch'](handleError(_0x266e49,null));};exports[_0xa72f('0x5e')]=function(_0x39a024,_0x47f7df){return db[_0xa72f('0x45')][_0xa72f('0x4a')]({'where':{'id':_0x39a024[_0xa72f('0x49')]['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x47f7df,null))[_0xa72f('0x11')](function(_0x566d4d){if(_0x566d4d){return _0x566d4d[_0xa72f('0x5e')](_0x39a024[_0xa72f('0x33')]['ids']);}})[_0xa72f('0x11')](respondWithStatusCode(_0x47f7df,null))[_0xa72f('0x1c')](handleError(_0x47f7df,null));};exports[_0xa72f('0x5f')]=function(_0x3737fd,_0x3614c4){_0x3737fd['body'][_0xa72f('0x60')]=_0x3737fd['file'][_0xa72f('0x61')];return db[_0xa72f('0x45')]['find']({'where':{'id':_0x3737fd[_0xa72f('0x49')]['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x3614c4,null))['then'](saveUpdates(_0x3737fd[_0xa72f('0x52')],null))[_0xa72f('0x11')](respondWithResult(_0x3614c4,null))[_0xa72f('0x1c')](handleError(_0x3614c4,null));};exports[_0xa72f('0x62')]=function(_0x4bd077,_0x54b94d){_0x4bd077[_0xa72f('0x52')][_0xa72f('0x63')]=_0x4bd077[_0xa72f('0x64')][_0xa72f('0x61')];return db[_0xa72f('0x45')][_0xa72f('0x4a')]({'where':{'id':_0x4bd077[_0xa72f('0x49')]['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x54b94d,null))[_0xa72f('0x11')](saveUpdates(_0x4bd077['body'],null))['then'](respondWithResult(_0x54b94d,null))[_0xa72f('0x1c')](handleError(_0x54b94d,null));};exports[_0xa72f('0x65')]=function(_0x52fc76,_0x111f58){_0x52fc76['body'][_0xa72f('0x66')]=_0x52fc76[_0xa72f('0x64')][_0xa72f('0x61')];return db[_0xa72f('0x45')][_0xa72f('0x4a')]({'where':{'id':_0x52fc76[_0xa72f('0x49')]['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x111f58,null))[_0xa72f('0x11')](saveUpdates(_0x52fc76['body'],null))['then'](respondWithResult(_0x111f58,null))['catch'](handleError(_0x111f58,null));};exports[_0xa72f('0x67')]=function(_0x42f5f5,_0x1081b7){_0x42f5f5[_0xa72f('0x52')]['systemAvatar']=_0x42f5f5['file'][_0xa72f('0x61')];return db[_0xa72f('0x45')][_0xa72f('0x4a')]({'where':{'id':_0x42f5f5[_0xa72f('0x49')]['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x1081b7,null))[_0xa72f('0x11')](saveUpdates(_0x42f5f5[_0xa72f('0x52')],null))[_0xa72f('0x11')](respondWithResult(_0x1081b7,null))[_0xa72f('0x1c')](handleError(_0x1081b7,null));};exports['getLogo']=function(_0x15f30c,_0x4cd182){var _0x4194b5=path[_0xa72f('0x68')](config[_0xa72f('0x69')],_0xa72f('0x6a'));var _0xb1560b={'where':{'id':_0x15f30c[_0xa72f('0x49')]['id']},'attributes':['id',_0xa72f('0x60')],'raw':!![]};var _0x1e2dc0=![];return require('../../config/license/util')[_0xa72f('0x6b')]()[_0xa72f('0x11')](function(_0x3be9ca){if(_0x3be9ca){_0x1e2dc0=_0x3be9ca[_0xa72f('0x6c')];}})['then'](function(){return db['ChatWebsite'][_0xa72f('0x4a')](_0xb1560b);})[_0xa72f('0x11')](handleEntityNotFound(_0x4cd182,null))[_0xa72f('0x11')](function(_0x99b31a){if(_0x99b31a){if(!_[_0xa72f('0x6d')](_0x99b31a[_0xa72f('0x60')])){if(fs[_0xa72f('0x6e')](path[_0xa72f('0x68')](config[_0xa72f('0x69')],_0xa72f('0x6f'),_0x99b31a[_0xa72f('0x60')]))&&_0x1e2dc0){_0x4194b5=path['join'](config['root'],_0xa72f('0x6f'),_0x99b31a['sitepic']);}}return _0x4cd182['download'](_0x4194b5);}})['catch'](handleError(_0x4cd182,null));};exports[_0xa72f('0x70')]=function(_0x2e4980,_0x6a5aa8){var _0x2ee335=path[_0xa72f('0x68')](config[_0xa72f('0x69')],_0xa72f('0x71'));var _0x11f8b2={'where':{'id':_0x2e4980[_0xa72f('0x49')]['id']},'attributes':['id',_0xa72f('0x63')],'raw':!![]};return db['ChatWebsite']['find'](_0x11f8b2)[_0xa72f('0x11')](handleEntityNotFound(_0x6a5aa8,null))[_0xa72f('0x11')](function(_0xae839b){if(_0xae839b){if(!_[_0xa72f('0x6d')](_0xae839b[_0xa72f('0x63')])){if(fs[_0xa72f('0x6e')](path[_0xa72f('0x68')](config['root'],_0xa72f('0x72'),_0xae839b[_0xa72f('0x63')]))){_0x2ee335=path[_0xa72f('0x68')](config['root'],_0xa72f('0x72'),_0xae839b[_0xa72f('0x63')]);}}return _0x6a5aa8[_0xa72f('0x73')](_0x2ee335);}})[_0xa72f('0x1c')](handleError(_0x6a5aa8,null));};exports['getCustomerAvatar']=function(_0x49865e,_0x47626e){var _0x156466=path['join'](config['root'],_0xa72f('0x74'));var _0x5c435b={'where':{'id':_0x49865e[_0xa72f('0x49')]['id']},'attributes':['id','customerAvatar',_0xa72f('0x75')],'raw':!![]};return db[_0xa72f('0x45')][_0xa72f('0x4a')](_0x5c435b)['then'](handleEntityNotFound(_0x47626e,null))[_0xa72f('0x11')](function(_0x26521b){if(_0x26521b){if(!_[_0xa72f('0x6d')](_0x26521b[_0xa72f('0x66')])){if(fs[_0xa72f('0x6e')](path[_0xa72f('0x68')](config[_0xa72f('0x69')],_0xa72f('0x72'),_0x26521b[_0xa72f('0x66')]))&&_0x26521b[_0xa72f('0x75')]){_0x156466=path[_0xa72f('0x68')](config[_0xa72f('0x69')],_0xa72f('0x72'),_0x26521b[_0xa72f('0x66')]);}}return _0x47626e[_0xa72f('0x73')](_0x156466);}})['catch'](handleError(_0x47626e,null));};exports[_0xa72f('0x76')]=function(_0x43bbc8,_0x5a2923){var _0x379626=path[_0xa72f('0x68')](config[_0xa72f('0x69')],'server/files/images/avatars/system_avatar.png');var _0x314084={'where':{'id':_0x43bbc8['params']['id']},'attributes':['id',_0xa72f('0x77')],'raw':!![]};return db[_0xa72f('0x45')][_0xa72f('0x4a')](_0x314084)[_0xa72f('0x11')](handleEntityNotFound(_0x5a2923,null))[_0xa72f('0x11')](function(_0x5210b6){if(_0x5210b6){if(!_[_0xa72f('0x6d')](_0x5210b6['systemAvatar'])){if(fs[_0xa72f('0x6e')](path[_0xa72f('0x68')](config['root'],_0xa72f('0x72'),_0x5210b6[_0xa72f('0x77')]))){_0x379626=path[_0xa72f('0x68')](config[_0xa72f('0x69')],_0xa72f('0x72'),_0x5210b6[_0xa72f('0x77')]);}}return _0x5a2923[_0xa72f('0x73')](_0x379626);}})[_0xa72f('0x1c')](handleError(_0x5a2923,null));};exports['notify']=function(_0x2973bc,_0x48b2c2){var _0x5c5327=require(_0xa72f('0x78'));var _0x2c5544=new _0x5c5327();var _0x10ee55=_0x2c5544[_0xa72f('0x79')](_0x2973bc[_0xa72f('0x7a')][_0xa72f('0x7b')])['getResult']();var _0xe85fc7={'body':_0x2973bc[_0xa72f('0x52')],'channel':'chat'};var _0x45510b=[];var _0x402b27=[];var _0x4feb58={};var _0x4d300b=![];return db[_0xa72f('0x7c')]['describe']()[_0xa72f('0x11')](function(_0x2be75c){if(!_0x2be75c){throw new db[(_0xa72f('0x7d'))]['ValidationError'](_0xa72f('0x7e'));}_0x45510b=_[_0xa72f('0x7f')](_[_0xa72f('0x32')](_0x2be75c),[_0xa72f('0x80'),'updatedAt']);_0x402b27=_[_0xa72f('0x7f')](_[_0xa72f('0x32')](_0x2be75c),[_0xa72f('0x80'),_0xa72f('0x81'),'CompanyId',_0xa72f('0x82')]);if(_0x2973bc[_0xa72f('0x52')]['id']){delete _0x2973bc['body']['id'];}if(_[_0xa72f('0x6d')](_0x2973bc[_0xa72f('0x52')][_0xa72f('0x83')])){throw new db[(_0xa72f('0x7d'))][(_0xa72f('0x84'))]('from\x20is\x20mandatory');}if(_[_0xa72f('0x6d')](_0x2973bc[_0xa72f('0x52')][_0xa72f('0x52')])||_0x2973bc[_0xa72f('0x52')][_0xa72f('0x52')]===''){throw new db[(_0xa72f('0x7d'))][(_0xa72f('0x84'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa72f('0x6d')](_0x2973bc[_0xa72f('0x52')][_0xa72f('0x85')])){throw new db[(_0xa72f('0x7d'))]['ValidationError'](_0xa72f('0x86')+_0x402b27);}if(!_[_0xa72f('0x87')](_0x402b27,_0x2973bc[_0xa72f('0x52')][_0xa72f('0x85')])){throw new db['Sequelize'][(_0xa72f('0x84'))](_0xa72f('0x88')+_0x402b27);}_0x4feb58[_0x2973bc[_0xa72f('0x52')]['mapKey']]=_0x2973bc[_0xa72f('0x52')]['from'];})[_0xa72f('0x11')](function(){return db[_0xa72f('0x45')][_0xa72f('0x4a')]({'where':{'id':_0x2973bc[_0xa72f('0x49')]['id']},'include':[{'model':db[_0xa72f('0x89')],'as':_0xa72f('0x8a'),'include':[{'model':db[_0xa72f('0x7c')],'as':_0xa72f('0x8b'),'where':_0x4feb58,'limit':0x1,'order':[['updatedAt',_0xa72f('0x8c')]]}]},{'model':db[_0xa72f('0x8d')],'as':_0xa72f('0x8e')}]});})['then'](handleEntityNotFound(_0x48b2c2,null))[_0xa72f('0x11')](function(_0x2a2383){if(_0x2a2383&&_0x2a2383[_0xa72f('0x8a')]){_0xe85fc7[_0xa72f('0x8f')]=_0x2a2383;_0xe85fc7[_0xa72f('0x90')]=_0x2a2383[_0xa72f('0x8e')];_0xe85fc7[_0xa72f('0x91')]=_0x2a2383['List'];_0xe85fc7[_0xa72f('0x90')]=_[_0xa72f('0x92')](_0xe85fc7['applications'],['priority'],[_0xa72f('0x93')]);if(_0xe85fc7[_0xa72f('0x8f')][_0xa72f('0x8e')]){delete _0xe85fc7[_0xa72f('0x8f')]['Applications'];}if(_0xe85fc7[_0xa72f('0x8f')][_0xa72f('0x8a')]&&_0xe85fc7[_0xa72f('0x8f')][_0xa72f('0x8a')][_0xa72f('0x8b')][_0xa72f('0x38')]){return _0xe85fc7[_0xa72f('0x8f')][_0xa72f('0x8a')]['Contacts'][0x0];}var _0x3d741b=_[_0xa72f('0x9')](_0x2973bc[_0xa72f('0x52')],{'firstName':_0x2973bc['body'][_0xa72f('0x83')],'ListId':_0x2a2383['ListId']});_0x3d741b[_0x2973bc[_0xa72f('0x52')][_0xa72f('0x85')]]=_0x2973bc[_0xa72f('0x52')][_0xa72f('0x83')];return db[_0xa72f('0x7c')][_0xa72f('0x4b')](_0x3d741b,{'fields':_0x45510b,'raw':!![]});}})[_0xa72f('0x11')](handleEntityNotFound(_0x48b2c2,null))[_0xa72f('0x11')](function(_0x3ea7bf){_0xe85fc7[_0xa72f('0x94')]=_0x3ea7bf;var _0x460dc3=_0x2973bc['body']['customerIp'];if(_0x2973bc[_0xa72f('0x7a')][_0xa72f('0x95')]){_0x460dc3=_0x2973bc[_0xa72f('0x7a')][_0xa72f('0x95')];}else if(_0x2973bc['headers'][_0xa72f('0x96')]){_0x460dc3=_[_0xa72f('0x97')](_0x2973bc[_0xa72f('0x7a')][_0xa72f('0x96')][_0xa72f('0x98')](','));}if(_0x3ea7bf){var _0x34a7be={'ContactId':_0x3ea7bf['id'],'ChatWebsiteId':_0x2973bc[_0xa72f('0x49')]['id'],'from':(_0x3ea7bf[_0xa72f('0x99')]||'')+'\x20'+(_0x3ea7bf[_0xa72f('0x9a')]||''),'customerIp':_0x460dc3,'customerPort':_0x2973bc[_0xa72f('0x7a')]['x-real-port']?_0x2973bc[_0xa72f('0x7a')][_0xa72f('0x9b')]:null,'referer':_0x2973bc['body'][_0xa72f('0x9c')],'browserName':_0x10ee55[_0xa72f('0x9d')][_0xa72f('0x2b')]&&_0x10ee55['browser'][_0xa72f('0x9e')]?util[_0xa72f('0x9f')](_0xa72f('0xa0'),_0x10ee55['browser'][_0xa72f('0x2b')],_0x10ee55[_0xa72f('0x9d')][_0xa72f('0x9e')]):_0xa72f('0xa1'),'browserVersion':_0x10ee55['browser']['version']||_0xa72f('0xa1'),'osName':util[_0xa72f('0x9f')](_0xa72f('0xa0'),_0x10ee55['os'][_0xa72f('0x2b')],_0x10ee55['os'][_0xa72f('0x9e')]),'osVersion':_0x10ee55['os'][_0xa72f('0x9e')],'deviceModel':_0x10ee55[_0xa72f('0xa2')]['model']&&_0x10ee55[_0xa72f('0xa2')]['vendor']?util[_0xa72f('0x9f')](_0xa72f('0xa3'),_0x10ee55[_0xa72f('0xa2')][_0xa72f('0x31')],_0x10ee55['device'][_0xa72f('0xa4')],_0x10ee55[_0xa72f('0xa2')][_0xa72f('0x41')]):null,'deviceVendor':_0x10ee55[_0xa72f('0xa2')][_0xa72f('0xa4')],'deviceType':_0x10ee55[_0xa72f('0xa2')]['type'],'formData':JSON[_0xa72f('0x17')](_0x2973bc['body'])};var _0x4f86a5={'ChatWebsiteId':_0x2973bc[_0xa72f('0x49')]['id'],'closed':![]};if(_0x2973bc[_0xa72f('0x52')][_0xa72f('0xa5')]){_0x4f86a5[_0xa72f('0xa5')]=_0x2973bc['body'][_0xa72f('0xa5')];return db[_0xa72f('0xa6')]['find']({'where':_0x4f86a5})[_0xa72f('0x11')](function(_0x3f2714){if(_0x3f2714){return[_0x3f2714,![]];}_0x34a7be[_0xa72f('0xa5')]=_0x2973bc[_0xa72f('0x52')][_0xa72f('0xa5')];_0x34a7be[_0xa72f('0xa7')]=_0x2973bc[_0xa72f('0x52')][_0xa72f('0xa7')];return db['ChatInteraction'][_0xa72f('0x4b')](_0x34a7be)['then'](function(_0x3bedf4){return[_0x3bedf4,!![]];});});}_0x4f86a5[_0xa72f('0xa8')]=_0x3ea7bf['id'];if(_0x2973bc[_0xa72f('0x52')]['interaction']&&_0x2973bc[_0xa72f('0x52')]['interaction']['id']){_0x4f86a5['id']=_0x2973bc['body'][_0xa72f('0xa9')]['id'];return db[_0xa72f('0xa6')][_0xa72f('0x4a')]({'where':_0x4f86a5})['then'](function(_0x1c3c47){if(_0x1c3c47){return[_0x1c3c47,![]];}return db['ChatInteraction'][_0xa72f('0x4b')](_0x34a7be)[_0xa72f('0x11')](function(_0x222765){return[_0x222765,!![]];});});}return db[_0xa72f('0xa6')]['create'](_0x34a7be)[_0xa72f('0x11')](function(_0x2acb5f){return[_0x2acb5f,!![]];});}})[_0xa72f('0xaa')](function(_0xda96b5,_0x2da22e){if(_0xda96b5){_0x4d300b=_0x2da22e;if(!_0x2da22e){var _0xe8f4f={'from':(_0xe85fc7[_0xa72f('0x94')]['firstName']||'')+'\x20'+(_0xe85fc7[_0xa72f('0x94')][_0xa72f('0x9a')]||'')};if(_0x2973bc[_0xa72f('0x52')][_0xa72f('0xa5')]&&_0x2973bc[_0xa72f('0x52')]['messageId']&&_0x2973bc[_0xa72f('0x52')][_0xa72f('0xa5')]!=_0x2973bc[_0xa72f('0x52')][_0xa72f('0xab')]){_0xe8f4f[_0xa72f('0xa5')]=_0x2973bc['body'][_0xa72f('0xab')];}return _0xda96b5[_0xa72f('0x27')](_0xe8f4f);}else{return _0xda96b5;}}})[_0xa72f('0x11')](function(_0x1cbecc){_0xe85fc7[_0xa72f('0xa9')]=_0x1cbecc[_0xa72f('0x28')]({'plain':!![]});_0xe85fc7[_0xa72f('0xa9')]['created']=_0x4d300b;if(_0xe85fc7[_0xa72f('0xa9')][_0xa72f('0xac')]){if(_0xe85fc7[_0xa72f('0x8f')][_0xa72f('0xad')]){_0xe85fc7[_0xa72f('0x90')][_0xa72f('0xae')]({'id':0x0,'priority':_0xe85fc7[_0xa72f('0x90')][_0xa72f('0x38')]+0x1,'app':'close','appdata':_0xa72f('0xaf'),'interval':_0xa72f('0xb0')});}}return db['ChatMessage'][_0xa72f('0x4b')]({'body':_0x2973bc[_0xa72f('0x52')][_0xa72f('0x52')],'ChatWebsiteId':_0x2973bc[_0xa72f('0x49')]['id'],'ChatInteractionId':_0x1cbecc['id'],'direction':'in','ContactId':_0xe85fc7['contact']['id'],'AttachmentId':_0x2973bc[_0xa72f('0x52')][_0xa72f('0xb1')]});})[_0xa72f('0x11')](function(_0x1f8e55){_0xe85fc7[_0xa72f('0x1a')]=_0x1f8e55;if(_0xe85fc7['interaction'][_0xa72f('0xb2')]){return db[_0xa72f('0xb3')][_0xa72f('0x4a')]({'attributes':['id',_0xa72f('0x2b')],'where':{'id':_0xe85fc7[_0xa72f('0xa9')]['UserId']}})[_0xa72f('0x11')](function(_0x1893e4){if(_0x1893e4){_0xe85fc7[_0xa72f('0x90')][_0xa72f('0xb4')]({'id':0x0,'priority':0x0,'app':_0xa72f('0xb5'),'appdata':_0x1893e4[_0xa72f('0x2b')]+','+(_0xe85fc7[_0xa72f('0x8f')][_0xa72f('0xb6')]||0xa),'interval':_0xa72f('0xb0')});_0xe85fc7[_0xa72f('0xb7')]=!![];}return respondWithRpcPromise(_0xa72f('0xb8'),_0xa72f('0xb9'),_0xe85fc7);});}return respondWithRpcPromise(_0xa72f('0xb8'),'startRouting',_0xe85fc7);})[_0xa72f('0x11')](function(_0x5d676c){respondWithRpcPromise(_0xa72f('0xba'),'EventManager',{'event':'notify','message':_0x5d676c},client9002);return _0x5d676c;})[_0xa72f('0x11')](respondWithResult(_0x48b2c2,null))[_0xa72f('0x1c')](handleError(_0x48b2c2,null));};exports[_0xa72f('0xbb')]=function(_0xdd1ece,_0x165151){var _0x65f6f4,_0x493929,_0x5d070c;var _0x11c827=[];var _0x22d729={};var _0x48b7f6=_0xdd1ece[_0xa72f('0xbc')]||[];var _0x588239=[];var _0x3ad099;return db[_0xa72f('0x7c')]['describe']()[_0xa72f('0x11')](function(_0xc78a90){if(!_0xc78a90){throw new db[(_0xa72f('0x7d'))]['ValidationError'](_0xa72f('0x7e'));}_0x11c827=_[_0xa72f('0x7f')](_['keys'](_0xc78a90),[_0xa72f('0x80'),_0xa72f('0x81'),'CompanyId',_0xa72f('0x82')]);if(_0xdd1ece[_0xa72f('0x52')]['id']){delete _0xdd1ece['body']['id'];}if(_[_0xa72f('0x6d')](_0xdd1ece[_0xa72f('0x52')]['from'])){throw _0x165151[_0xa72f('0x1e')](0x1f4)['send'](new db[(_0xa72f('0x7d'))][(_0xa72f('0x84'))]('from\x20is\x20mandatory'));}if(_[_0xa72f('0x6d')](_0xdd1ece[_0xa72f('0x52')][_0xa72f('0x52')])||_0xdd1ece[_0xa72f('0x52')]['body']===''){throw _0x165151[_0xa72f('0x1e')](0x1f4)[_0xa72f('0xbd')](new db['Sequelize']['ValidationError'](_0xa72f('0xbe')));}if(_[_0xa72f('0x6d')](_0xdd1ece['body'][_0xa72f('0xbf')])){throw _0x165151[_0xa72f('0x1e')](0x1f4)[_0xa72f('0xbd')](new db[(_0xa72f('0x7d'))][(_0xa72f('0x84'))](_0xa72f('0xc0')+_0x11c827));}if(!_[_0xa72f('0x87')](_0x11c827,_0xdd1ece[_0xa72f('0x52')][_0xa72f('0xbf')])){throw _0x165151[_0xa72f('0x1e')](0x1f4)[_0xa72f('0xbd')](new db['Sequelize']['ValidationError'](_0xa72f('0xc1')+_0x11c827));}_0x22d729[_0xdd1ece[_0xa72f('0x52')][_0xa72f('0xbf')]]=_0xdd1ece['body'][_0xa72f('0x83')];})[_0xa72f('0x11')](function(){return db[_0xa72f('0x45')][_0xa72f('0x4a')]({'where':{'id':_0xdd1ece[_0xa72f('0x49')]['id']},'include':[{'model':db[_0xa72f('0x89')],'as':'List'},{'model':db[_0xa72f('0xc2')],'as':_0xa72f('0xc2')}]});})['then'](handleEntityNotFound(_0x165151,null))['then'](function(_0x1a23ee){if(_0x1a23ee&&_0x1a23ee[_0xa72f('0x8a')]){_0x493929=_0x1a23ee;var _0x25094a=_[_0xa72f('0x9')](_0xdd1ece[_0xa72f('0x52')],{'firstName':_0xdd1ece[_0xa72f('0x52')]['from'],'phone':_0xdd1ece[_0xa72f('0x52')][_0xa72f('0x83')],'ListId':_0x1a23ee[_0xa72f('0x82')]});_0x25094a[_0xdd1ece[_0xa72f('0x52')][_0xa72f('0xbf')]]=_0xdd1ece[_0xa72f('0x52')][_0xa72f('0x83')];return db['CmContact']['findOrCreate']({'where':_0x22d729,'defaults':_0x25094a});}})['spread'](function(_0xc3b93d){if(_0xc3b93d){_0x5d070c=_0xc3b93d;var _0x5161dd=fs[_0xa72f('0xc3')](path['join'](config['root'],_0xa72f('0xc4')),_0xa72f('0xc5'));var _0x23a020=ejs[_0xa72f('0xc6')](_0x5161dd,{'body':_['toPairs'](_0xdd1ece[_0xa72f('0x52')]['body']),'bodyTitle':_0x493929[_0xa72f('0xc7')]});return db[_0xa72f('0xc8')]['create']({'body':_0x23a020,'plainBody':htmlToText['fromString'](_0x23a020),'ContactId':_0xc3b93d['id'],'ChatWebsiteId':_0x493929['id']});}})[_0xa72f('0x11')](function(_0x4fff3a){_0x3ad099=_0x4fff3a;if(_0x48b7f6[_0xa72f('0x38')]){var _0x457897=_0x48b7f6[_0xa72f('0x2f')](function(_0x41b6e7){return{'name':_0x41b6e7[_0xa72f('0xc9')],'basename':_0x41b6e7['filename'],'type':_0x41b6e7[_0xa72f('0xca')],'ChatOfflineMessageId':_0x4fff3a['id']};});_0x588239=_0x457897['map'](_0x55bddf=>{var _0x5e1937={'filename':_0x55bddf[_0xa72f('0x2b')],'path':path[_0xa72f('0x68')](config['root'],_0xa72f('0xcb'),'files',_0xa72f('0xcc'),'offline-chat',_0x55bddf[_0xa72f('0xcd')])};return _0x5e1937;});if(!_0x493929[_0xa72f('0xce')]){return db['sequelize'][_0xa72f('0xcf')](function(_0x52ca6e){return db[_0xa72f('0xd0')][_0xa72f('0xd1')](_0x457897,{'transaction':_0x52ca6e});});}}})[_0xa72f('0x11')](function(){if(_0x3ad099){_0x65f6f4=_0x3ad099;return db[_0xa72f('0xc2')][_0xa72f('0x58')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xa72f('0xd2'),'raw':!![],'include':[{'model':db[_0xa72f('0xd3')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xa72f('0x11')](function(_0x2dc585){if(_0x2dc585&&_0x2dc585[_0xa72f('0xd2')]&&_0x493929[_0xa72f('0xd4')]&&_0x493929['forwardOfflineAddress']){var _0x2b019d=_0x2dc585[_0xa72f('0xd5')]();return respondWithRpcPromise(_0xa72f('0xd6'),_0xa72f('0xd7'),{'account':_0x2b019d,'message':{'from':util[_0xa72f('0x9f')]('\x22%s\x22\x20<%s>',_0x2dc585[_0xa72f('0x2b')],_0x2dc585['email']||_0x2dc585[_0xa72f('0xd2')]['user']),'to':_0x493929[_0xa72f('0xd8')],'subject':_0x493929['offlineMessageSubject'],'html':_0x65f6f4[_0xa72f('0x52')],'attachments':_0x588239}},client9003)[_0xa72f('0x11')](function(){return _0x65f6f4;})[_0xa72f('0x1c')](function(_0x20a458){logger['error'](_0x20a458);});}})['then'](function(){if(_0x493929&&_0x493929[_0xa72f('0xce')]&&_0x493929[_0xa72f('0xd9')]){var _0x2df428=[];if(_0x48b7f6[_0xa72f('0x38')]){_0x2df428=_0x48b7f6[_0xa72f('0x2f')](function(_0xb72bd7){return{'name':_0xb72bd7[_0xa72f('0xc9')],'basename':_0xb72bd7[_0xa72f('0x61')],'type':_0xb72bd7[_0xa72f('0xca')],'ChatOfflineMessageId':_0x3ad099['id']};});}var _0x15b248;if(!_[_0xa72f('0x6d')](_0x493929[_0xa72f('0xda')])){var _0x246e51=_['map'](_0xdd1ece[_0xa72f('0x52')],function(_0xf9fb0d){return _0xf9fb0d;});var _0x1d3182=_[_0xa72f('0xdb')](_0x246e51)[0x0];var _0x875204=_[_0xa72f('0xdc')](_0x1d3182,function(_0x316867){return _0x316867;});_0x15b248=_0x875204[0x1][_0x493929['subjectOffline']];}var _0x23a319={'from':_0x5d070c[_0xa72f('0xdd')],'firstName':_0x5d070c[_0xa72f('0x99')],'lastName':_0x5d070c['lastName'],'mapKey':_0xa72f('0xdd'),'message':{'from':_0x5d070c['email'],'to':_0x493929['MailAccount'][_0xa72f('0xdd')],'cc':'','subject':_[_0xa72f('0x6d')](_0x15b248)?_0x493929[_0xa72f('0xde')]:_0x15b248,'messageId':'','sentAt':new Date(),'attach':_0x2df428[_0xa72f('0x38')],'attachments':_0x2df428,'originChannel':_0xa72f('0xdf'),'ChatWebsiteId':_0x493929['id'],'ChatOfflineMessageId':_0x65f6f4['id'],'originTo':_0x493929[_0xa72f('0xc2')][_0xa72f('0xdd')]},'body':_0x65f6f4[_0xa72f('0x52')]};var _0x285f25={'account':{'id':_0x493929['MailAccountId']},'body':_0x23a319,'log':_0xa72f('0xe0')};return respondWithRpcPromise(_0xa72f('0xe0'),_0xa72f('0xe1'),_0x285f25,client9001)[_0xa72f('0x11')](function(){return _0x65f6f4;})[_0xa72f('0x1c')](function(_0x41ab2d){logger[_0xa72f('0x18')](_0x41ab2d);});}return;})[_0xa72f('0x11')](function(){if(_0x65f6f4){return _0x65f6f4;}})['then'](respondWithResult(_0x165151,null))[_0xa72f('0x1c')](function(_0x3a5fc5){logger[_0xa72f('0x18')](_0xa72f('0x1c'),_0x3a5fc5);for(var _0x4b292f of _0x48b7f6){var _0x997b11=path[_0xa72f('0x68')](config[_0xa72f('0x69')],_0xa72f('0xcb'),_0xa72f('0xbc'),_0xa72f('0xcc'),_0xa72f('0xe2'),_0x4b292f[_0xa72f('0x61')]);fs_extra[_0xa72f('0xe3')](_0x997b11)[_0xa72f('0x1c')](function(_0x2e1d44){logger['error'](_0xa72f('0xe4'),_0x997b11,_0x2e1d44);});}});};exports[_0xa72f('0xe5')]=function(_0x733195,_0x530eea){return db['ChatInteraction'][_0xa72f('0x4a')]({'where':{'id':_0x733195[_0xa72f('0x49')]['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x530eea,null))[_0xa72f('0x11')](function(_0x22c8f2){if(_0x22c8f2){return _0x22c8f2[_0xa72f('0xe5')](_0x733195['body'][_0xa72f('0x5a')],_['omit'](_0x733195[_0xa72f('0x52')],['ids','id'])||{});}})[_0xa72f('0x11')](respondWithResult(_0x530eea,null))[_0xa72f('0x1c')](handleError(_0x530eea,null));};exports[_0xa72f('0xe6')]=function(_0x267654,_0x38301f){var _0x2a8838={'raw':![],'where':{}};var _0x55b9b3={};var _0x178c03={'count':0x0,'rows':[]};return db[_0xa72f('0x45')][_0xa72f('0x58')]({'where':{'id':_0x267654['params']['id']}})['then'](handleEntityNotFound(_0x38301f,null))[_0xa72f('0x11')](function(_0x237669){if(_0x237669){_0x55b9b3[_0xa72f('0x31')]=_[_0xa72f('0x32')](db[_0xa72f('0xa6')][_0xa72f('0x30')]);_0x55b9b3[_0xa72f('0x33')]=_[_0xa72f('0x32')](_0x267654[_0xa72f('0x33')]);_0x55b9b3[_0xa72f('0x34')]=_[_0xa72f('0x35')](_0x55b9b3['model'],_0x55b9b3[_0xa72f('0x33')]);_0x2a8838[_0xa72f('0x37')]=_['intersection'](_0x55b9b3['model'],qs['fields'](_0x267654['query']['fields']));_0x2a8838[_0xa72f('0x37')]=_0x2a8838[_0xa72f('0x37')][_0xa72f('0x38')]?_0x2a8838[_0xa72f('0x37')]:_0x55b9b3[_0xa72f('0x31')];if(!_0x267654[_0xa72f('0x33')]['hasOwnProperty'](_0xa72f('0x3a'))){_0x2a8838[_0xa72f('0x24')]=qs['limit'](_0x267654[_0xa72f('0x33')][_0xa72f('0x24')]);_0x2a8838[_0xa72f('0x21')]=qs[_0xa72f('0x21')](_0x267654[_0xa72f('0x33')][_0xa72f('0x21')]);}_0x2a8838[_0xa72f('0x3b')]=qs[_0xa72f('0x3c')](_0x267654[_0xa72f('0x33')]['sort']);_0x2a8838['where']=qs['filters'](_[_0xa72f('0x3e')](_0x267654[_0xa72f('0x33')],_0x55b9b3['filters']));_0x2a8838[_0xa72f('0x3d')][_0xa72f('0x56')]=_0x237669['id'];if(_0x267654['query'][_0xa72f('0x3f')]){_0x2a8838['where']=_['merge'](_0x2a8838[_0xa72f('0x3d')],{'$or':_[_0xa72f('0x2f')](_0x2a8838['attributes'],function(_0x381e05){var _0x2aa517={};_0x2aa517[_0x381e05]={'$like':'%'+_0x267654['query']['filter']+'%'};return _0x2aa517;})});}_0x2a8838=_['merge']({},_0x2a8838,_0x267654[_0xa72f('0x42')]);return db[_0xa72f('0xa6')]['count']({'where':_0x2a8838[_0xa72f('0x3d')]})['then'](function(_0x46e236){_0x178c03[_0xa72f('0x23')]=_0x46e236;if(_0x267654[_0xa72f('0x33')]['includeAll']){_0x2a8838['include']=[{'model':db[_0xa72f('0x7c')],'as':_0xa72f('0xe7'),'required':![]},{'model':db['User'],'as':_0xa72f('0xe8'),'attributes':[_0xa72f('0x2b'),_0xa72f('0xe9'),_0xa72f('0xea')],'required':![]},{'model':db[_0xa72f('0xeb')],'as':'Tags','attributes':['id','name',_0xa72f('0xec')],'where':_0x267654[_0xa72f('0x33')]['tag']?{'id':_0x267654[_0xa72f('0x33')][_0xa72f('0xed')]}:undefined,'required':_0x267654[_0xa72f('0x33')][_0xa72f('0xed')]?!![]:![]}];}return db[_0xa72f('0xa6')]['findAll'](_0x2a8838);})[_0xa72f('0x11')](function(_0x4a090a){_0x178c03[_0xa72f('0x47')]=_0x4a090a;return _0x178c03;});}})['then'](respondWithFilteredResult(_0x38301f,_0x2a8838))[_0xa72f('0x1c')](handleError(_0x38301f,null));};function iftimePromise(_0x372e1d,_0x58023d){return respondWithRpcPromise(_0xa72f('0xee'),_0xa72f('0xef'),{'command':_0x58023d['timezone']?util[_0xa72f('0x9f')](_0xa72f('0xf0'),_0x372e1d[_0xa72f('0xf1')],_0x58023d['timezone']):util[_0xa72f('0x9f')](_0xa72f('0xf2'),_0x372e1d[_0xa72f('0xf1')])},client9002)[_0xa72f('0x11')](function(_0xa204c7){var _0x2447dd=_0xa204c7&&_0xa204c7[_0xa72f('0xf3')](_0xa72f('0xf4'))>=0x0?!![]:![];logger[_0xa72f('0x12')](_0xa72f('0xf5'),_0x58023d['id'],_0x372e1d['id'],_0x372e1d['interval'],_0x2447dd?_0xa72f('0xf6'):_0xa72f('0xf7'),_0x58023d[_0xa72f('0xf8')]?_0x58023d[_0xa72f('0xf8')]:_0xa72f('0xf9'));return _0x2447dd;})[_0xa72f('0x1c')](function(_0x3cbdb2){logger[_0xa72f('0x18')](_0xa72f('0xf5'),_0x58023d['id'],_0x372e1d['id'],_0x372e1d[_0xa72f('0xf1')],util[_0xa72f('0xfa')](_0x3cbdb2,{'showHidden':![],'depth':null}),_0x58023d['timezone']?_0x58023d[_0xa72f('0xf8')]:_0xa72f('0xf9'));return![];});}exports[_0xa72f('0xef')]=function(_0x6473,_0x1d1ebd){var _0x3b66b2=0x0;var _0x44b198=0x0;var _0xc1199e=![];var _0x3bc554;var _0x372b2d;return db[_0xa72f('0x45')]['find']({'where':{'id':_0x6473[_0xa72f('0x49')]['id']},'include':[{'model':db[_0xa72f('0xfb')],'as':'Interval','include':[{'model':db['Interval'],'as':_0xa72f('0xfc'),'attributes':['id',_0xa72f('0xf1')],'raw':!![]}]}]})[_0xa72f('0x11')](handleEntityNotFound(_0x1d1ebd,null))['then'](function(_0x569c79){if(_0x569c79){_0x3bc554=_0x569c79;return _0x569c79['getProactiveActions']({'raw':!![]});}})['then'](function(_0x3d1410){if(_0x3bc554){if(_0x3d1410){_0x372b2d=_0x3d1410;}}return require('../../config/license/util')[_0xa72f('0x6b')]();})[_0xa72f('0x11')](function(_0x5df218){if(_0x5df218){_0x44b198=_0x5df218[_0xa72f('0xfd')];_0xc1199e=_0x5df218[_0xa72f('0x6c')];}})[_0xa72f('0x11')](function(){return db[_0xa72f('0xa6')][_0xa72f('0x23')]({'where':{'closed':![]}});})[_0xa72f('0x11')](function(_0x182b17){_0x3b66b2=_0x182b17;if(_0x44b198&&_0x182b17>_0x44b198){return db['License'][_0xa72f('0x58')]({'where':{'id':0x1}})[_0xa72f('0x11')](function(_0x459fa8){if(_0x459fa8){_0x459fa8[_0xa72f('0xfe')](_0xa72f('0xff'));}});}})[_0xa72f('0x11')](function(){if(_0x3bc554[_0xa72f('0xfb')]&&_0x3bc554[_0xa72f('0xfb')]['Intervals']){var _0x4b8188=[];for(var _0x342430=0x0;_0x342430<_0x3bc554['Interval'][_0xa72f('0xfc')]['length'];_0x342430++){var _0x1a69c9=_0x3bc554[_0xa72f('0xfb')][_0xa72f('0xfc')][_0x342430]['get']({'plain':!![]});_0x4b8188[_0xa72f('0xae')](iftimePromise(_0x1a69c9,_0x3bc554));}return BPromise[_0xa72f('0x100')](_0x4b8188)[_0xa72f('0x11')](function(_0x81ab7b){return _[_0xa72f('0x101')](_0x81ab7b);});}else{return!![];}})[_0xa72f('0x11')](function(_0x4b60f0){var _0x2f4f89=fs['readFileSync'](path[_0xa72f('0x68')](config[_0xa72f('0x69')],_0xa72f('0x102')),_0xa72f('0xc5'));var _0x5c7c4c={'remote':_0x3bc554[_0xa72f('0x103')],'query':querystring['stringify'](_[_0xa72f('0x40')](_0x3bc554[_0xa72f('0x28')]({'plain':!![]}),{'customerIp':_0x6473[_0xa72f('0x7a')][_0xa72f('0x96')]||_0x6473[_0xa72f('0x7a')][_0xa72f('0x104')]||_0x6473[_0xa72f('0x105')][_0xa72f('0x106')]||_0x6473['ip'],'referer':_0x6473[_0xa72f('0x7a')]['referer'],'openedInteractions':_0x3b66b2,'maxInteractions':_0x44b198,'virtual':_0xc1199e[_0xa72f('0xfd')],'online':_0x4b60f0,'custom':_0xc1199e}))[_0xa72f('0x107')](/'/g,'\x5c\x27')};_0x1d1ebd[_0xa72f('0xbd')](ejs[_0xa72f('0xc6')](Mustache[_0xa72f('0xc6')](_0x2f4f89,_0x5c7c4c),{'proactiveActions':_0x372b2d,'alignment':_0x3bc554[_0xa72f('0x108')],'verticalAlignment':_0x3bc554[_0xa72f('0x109')],'div_color':_0x3bc554[_0xa72f('0xec')],'labelText':_0x3bc554[_0xa72f('0x10a')],'text_color':_0x3bc554[_0xa72f('0x10b')],'text_button_color':_0x3bc554[_0xa72f('0x10c')],'button_color':_0x3bc554[_0xa72f('0x10d')],'background_color':_0x3bc554['backgroundColor'],'hideWhenOffline':_0x3bc554[_0xa72f('0x10e')],'interval':_0x3bc554[_0xa72f('0x10f')]}));})[_0xa72f('0x1c')](handleError(_0x1d1ebd,null));};exports[_0xa72f('0x110')]=function(_0x3779cc,_0x2d279c){var _0x135543=_0x3779cc['params']['id'];var _0x44fc8d=_0x3779cc[_0xa72f('0x52')];var _0x1dc6c1=0xc8;var _0x1f80f7=null;return db[_0xa72f('0x111')][_0xa72f('0xcf')]({'isolationLevel':db[_0xa72f('0x111')]['Transaction'][_0xa72f('0x112')][_0xa72f('0x113')]},function(_0x378a38){return db['ChatWebsite'][_0xa72f('0x58')]({'where':{'id':_0x135543},'transaction':_0x378a38})['then'](function(_0x1ed9f8){if(_0x1ed9f8){return db[_0xa72f('0x8d')][_0xa72f('0x53')]({'where':{'ChatWebsiteId':_0x135543},'transaction':_0x378a38})[_0xa72f('0x11')](function(){var _0x53edad=_[_0xa72f('0x2f')](_0x44fc8d,function(_0x406b8b){_0x406b8b[_0xa72f('0x56')]=_0x135543;return _0x406b8b;});return db[_0xa72f('0x8d')][_0xa72f('0xd1')](_0x53edad,{'transaction':_0x378a38});});}else{_0x1dc6c1=0x194;_0x1f80f7=[];}});})[_0xa72f('0x11')](function(){if(_0x1dc6c1!==0x194){return db[_0xa72f('0x8d')][_0xa72f('0x114')]({'where':{'ChatWebsiteId':_0x135543},'order':_0xa72f('0x115')})['then'](function(_0x101146){_0x1f80f7=_0x101146;});}})['catch'](function(_0x281db8){_0x1dc6c1=0x1f4;logger[_0xa72f('0x18')](_0x281db8[_0xa72f('0x2a')]);if(_0x281db8['name']){delete _0x281db8[_0xa72f('0x2b')];}_0x1f80f7=_0x281db8;})[_0xa72f('0x116')](function(){if(_0x1f80f7===null){_0x2d279c[_0xa72f('0x1d')](_0x1dc6c1);}else{if(_0x1dc6c1===0x1f4){_0x2d279c['status'](_0x1dc6c1)[_0xa72f('0xbd')](_0x1f80f7);}else{_0x2d279c['status'](_0x1dc6c1)[_0xa72f('0x20')](_0x1f80f7);}}});};exports[_0xa72f('0x117')]=function(_0x7d0a7b,_0x262834){var _0x1b5164={};var _0x21f65d={};var _0x2cc7a2;var _0x115f67;return db['ChatWebsite'][_0xa72f('0x58')]({'where':{'id':_0x7d0a7b[_0xa72f('0x49')]['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x262834,null))[_0xa72f('0x11')](function(_0x125708){if(_0x125708){_0x2cc7a2=_0x125708;_0x21f65d[_0xa72f('0x31')]=_['keys'](db[_0xa72f('0x8d')][_0xa72f('0x30')]);_0x21f65d[_0xa72f('0x33')]=_['keys'](_0x7d0a7b[_0xa72f('0x33')]);_0x21f65d[_0xa72f('0x34')]=_[_0xa72f('0x35')](_0x21f65d[_0xa72f('0x31')],_0x21f65d['query']);_0x1b5164[_0xa72f('0x37')]=_[_0xa72f('0x35')](_0x21f65d['model'],qs['fields'](_0x7d0a7b[_0xa72f('0x33')]['fields']));_0x1b5164[_0xa72f('0x37')]=_0x1b5164[_0xa72f('0x37')][_0xa72f('0x38')]?_0x1b5164['attributes']:_0x21f65d[_0xa72f('0x31')];_0x1b5164[_0xa72f('0x3b')]=qs[_0xa72f('0x3c')](_0x7d0a7b[_0xa72f('0x33')][_0xa72f('0x3c')]);_0x1b5164[_0xa72f('0x3d')]=qs[_0xa72f('0x34')](_[_0xa72f('0x3e')](_0x7d0a7b[_0xa72f('0x33')],_0x21f65d[_0xa72f('0x34')]));if(_0x7d0a7b[_0xa72f('0x33')]['filter']){_0x1b5164[_0xa72f('0x3d')]=_[_0xa72f('0x40')](_0x1b5164[_0xa72f('0x3d')],{'$or':_[_0xa72f('0x2f')](_0x1b5164[_0xa72f('0x37')],function(_0x2f4fa7){var _0x1a7dac={};_0x1a7dac[_0x2f4fa7]={'$like':'%'+_0x7d0a7b[_0xa72f('0x33')][_0xa72f('0x3f')]+'%'};return _0x1a7dac;})});}_0x1b5164=_['merge']({},_0x1b5164,_0x7d0a7b[_0xa72f('0x42')]);return _0x2cc7a2[_0xa72f('0x117')](_0x1b5164);}})[_0xa72f('0x11')](function(_0x14b96a){if(_0x14b96a){_0x115f67=_0x14b96a[_0xa72f('0x38')];if(!_0x7d0a7b[_0xa72f('0x33')][_0xa72f('0x39')]('nolimit')){_0x1b5164[_0xa72f('0x24')]=qs[_0xa72f('0x24')](_0x7d0a7b[_0xa72f('0x33')]['limit']);_0x1b5164[_0xa72f('0x21')]=qs[_0xa72f('0x21')](_0x7d0a7b[_0xa72f('0x33')][_0xa72f('0x21')]);}return _0x2cc7a2[_0xa72f('0x117')](_0x1b5164);}})['then'](function(_0x12dc85){if(_0x12dc85){return _0x12dc85?{'count':_0x115f67,'rows':_0x12dc85}:null;}})[_0xa72f('0x11')](respondWithResult(_0x262834,null))[_0xa72f('0x1c')](handleError(_0x262834,null));};exports[_0xa72f('0x118')]=function(_0xaede73,_0x15a1a5){return db[_0xa72f('0x119')][_0xa72f('0x4a')]({'where':{'id':_0xaede73[_0xa72f('0x49')]['id']}})['then'](handleEntityNotFound(_0x15a1a5,null))[_0xa72f('0x11')](function(_0xd30b86){if(_0xd30b86){return _0xd30b86[_0xa72f('0x118')](_0xaede73[_0xa72f('0x52')][_0xa72f('0x5a')],_['omit'](_0xaede73[_0xa72f('0x52')],[_0xa72f('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x15a1a5,null))['catch'](handleError(_0x15a1a5,null));};exports[_0xa72f('0x11a')]=function(_0x16f48d,_0x2fa110){var _0x201206={};var _0x26addb={};var _0x3bca5b;var _0x4d2867;return db[_0xa72f('0x45')][_0xa72f('0x58')]({'where':{'id':_0x16f48d['params']['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x2fa110,null))[_0xa72f('0x11')](function(_0x4c35a9){if(_0x4c35a9){_0x3bca5b=_0x4c35a9;_0x26addb[_0xa72f('0x31')]=_[_0xa72f('0x32')](db[_0xa72f('0x11b')][_0xa72f('0x30')]);_0x26addb[_0xa72f('0x33')]=_[_0xa72f('0x32')](_0x16f48d[_0xa72f('0x33')]);_0x26addb[_0xa72f('0x34')]=_[_0xa72f('0x35')](_0x26addb['model'],_0x26addb[_0xa72f('0x33')]);_0x201206[_0xa72f('0x37')]=_[_0xa72f('0x35')](_0x26addb[_0xa72f('0x31')],qs['fields'](_0x16f48d[_0xa72f('0x33')][_0xa72f('0x36')]));_0x201206[_0xa72f('0x37')]=_0x201206['attributes'][_0xa72f('0x38')]?_0x201206['attributes']:_0x26addb['model'];_0x201206[_0xa72f('0x3b')]=qs['sort'](_0x16f48d['query'][_0xa72f('0x3c')]);_0x201206['where']=qs['filters'](_[_0xa72f('0x3e')](_0x16f48d[_0xa72f('0x33')],_0x26addb['filters']));if(_0x16f48d['query'][_0xa72f('0x3f')]){_0x201206[_0xa72f('0x3d')]=_[_0xa72f('0x40')](_0x201206['where'],{'$or':_[_0xa72f('0x2f')](_0x201206['attributes'],function(_0x102026){var _0x5a06a1={};_0x5a06a1[_0x102026]={'$like':'%'+_0x16f48d[_0xa72f('0x33')][_0xa72f('0x3f')]+'%'};return _0x5a06a1;})});}_0x201206=_['merge']({},_0x201206,_0x16f48d[_0xa72f('0x42')]);return _0x3bca5b[_0xa72f('0x11a')](_0x201206);}})[_0xa72f('0x11')](function(_0xb4b3){if(_0xb4b3){_0x4d2867=_0xb4b3['length'];if(!_0x16f48d['query'][_0xa72f('0x39')]('nolimit')){_0x201206[_0xa72f('0x24')]=qs[_0xa72f('0x24')](_0x16f48d[_0xa72f('0x33')]['limit']);_0x201206[_0xa72f('0x21')]=qs[_0xa72f('0x21')](_0x16f48d[_0xa72f('0x33')][_0xa72f('0x21')]);}return _0x3bca5b[_0xa72f('0x11a')](_0x201206);}})['then'](function(_0x101a9a){if(_0x101a9a){return _0x101a9a?{'count':_0x4d2867,'rows':_0x101a9a}:null;}})[_0xa72f('0x11')](respondWithResult(_0x2fa110,null))[_0xa72f('0x1c')](handleError(_0x2fa110,null));};exports[_0xa72f('0x11c')]=function(_0x251a51,_0x3666d7){var _0x5d1c09=_0x251a51['query'][_0xa72f('0x11d')]===_0xa72f('0x11e')?_0xa72f('0x11f'):_0xa72f('0x120');return db[_0xa72f('0x45')][_0xa72f('0x4a')]({'attributes':['id',_0x5d1c09],'where':{'id':_0x251a51['params']['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x3666d7,null))[_0xa72f('0x11')](function(_0x1c1ea6){if(_0x1c1ea6){var _0x11be75=_0x1c1ea6[_0x5d1c09];var _0x125b36=_0x11be75&&_0x11be75[_0xa72f('0x121')]?_0x11be75[_0xa72f('0x121')]:[];_0x3666d7[_0xa72f('0xbd')]({'fromKey':_['isNil'](_0x11be75[_0xa72f('0x122')])?undefined:_0x11be75['fromKey'],'count':_0x125b36[_0xa72f('0x38')],'rows':_0x125b36});}})[_0xa72f('0x1c')](handleError(_0x3666d7,null));};exports[_0xa72f('0x123')]=function(_0x191c91,_0x53964d){var _0x29e1cd={'raw':![],'where':{}};var _0x2e00d4={};var _0xef5331={'count':0x0,'rows':[]};return db[_0xa72f('0x45')]['findOne']({'where':{'id':_0x191c91[_0xa72f('0x49')]['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0x53964d,null))['then'](function(_0xb697fa){if(_0xb697fa){_0x2e00d4['model']=_['keys'](db[_0xa72f('0xc8')][_0xa72f('0x30')]);_0x2e00d4[_0xa72f('0x33')]=_[_0xa72f('0x32')](_0x191c91[_0xa72f('0x33')]);_0x2e00d4[_0xa72f('0x34')]=_[_0xa72f('0x35')](_0x2e00d4['model'],_0x2e00d4[_0xa72f('0x33')]);_0x29e1cd[_0xa72f('0x37')]=_[_0xa72f('0x35')](_0x2e00d4[_0xa72f('0x31')],qs['fields'](_0x191c91[_0xa72f('0x33')]['fields']));_0x29e1cd[_0xa72f('0x37')]=_0x29e1cd[_0xa72f('0x37')]['length']?_0x29e1cd[_0xa72f('0x37')]:_0x2e00d4[_0xa72f('0x31')];if(!_0x191c91[_0xa72f('0x33')][_0xa72f('0x39')](_0xa72f('0x3a'))){_0x29e1cd[_0xa72f('0x24')]=qs['limit'](_0x191c91[_0xa72f('0x33')][_0xa72f('0x24')]);_0x29e1cd['offset']=qs[_0xa72f('0x21')](_0x191c91[_0xa72f('0x33')][_0xa72f('0x21')]);}_0x29e1cd[_0xa72f('0x3b')]=qs[_0xa72f('0x3c')](_0x191c91['query'][_0xa72f('0x3c')]);_0x29e1cd[_0xa72f('0x3d')]=qs[_0xa72f('0x34')](_[_0xa72f('0x3e')](_0x191c91[_0xa72f('0x33')],_0x2e00d4['filters']));_0x29e1cd['where']['ChatWebsiteId']=_0xb697fa['id'];if(_0x191c91['query'][_0xa72f('0x3f')]){_0x29e1cd['where']=_[_0xa72f('0x40')](_0x29e1cd[_0xa72f('0x3d')],{'$or':_[_0xa72f('0x2f')](_0x29e1cd[_0xa72f('0x37')],function(_0xe233e6){var _0x1a4e63={};_0x1a4e63[_0xe233e6]={'$like':'%'+_0x191c91[_0xa72f('0x33')][_0xa72f('0x3f')]+'%'};return _0x1a4e63;})});}_0x29e1cd=_['merge']({},_0x29e1cd,_0x191c91[_0xa72f('0x42')]);return db[_0xa72f('0xc8')][_0xa72f('0x23')]({'where':_0x29e1cd['where']})[_0xa72f('0x11')](function(_0x1023af){_0xef5331['count']=_0x1023af;if(_0x191c91[_0xa72f('0x33')][_0xa72f('0x43')]){_0x29e1cd[_0xa72f('0x44')]=[{'all':!![]}];}else{_0x29e1cd[_0xa72f('0x44')]=[{'model':db[_0xa72f('0x7c')],'as':'Contact','required':![]},{'model':db[_0xa72f('0xd0')],'as':_0xa72f('0x124'),'required':![]}];}return db['ChatOfflineMessage'][_0xa72f('0x46')](_0x29e1cd);})[_0xa72f('0x11')](function(_0x4dfcc9){_0xef5331[_0xa72f('0x47')]=_0x4dfcc9;return _0xef5331;});}})[_0xa72f('0x11')](respondWithFilteredResult(_0x53964d,_0x29e1cd))[_0xa72f('0x1c')](handleError(_0x53964d,null));};exports[_0xa72f('0x125')]=function(_0x3b5017,_0x346b12){return db[_0xa72f('0x45')][_0xa72f('0x4a')]({'where':{'id':_0x3b5017[_0xa72f('0x49')]['id']}})['then'](handleEntityNotFound(_0x346b12,null))[_0xa72f('0x11')](function(_0x4f7503){if(_0x4f7503){return _0x4f7503[_0xa72f('0x125')](_0x3b5017[_0xa72f('0x52')][_0xa72f('0x5a')],_['omit'](_0x3b5017[_0xa72f('0x52')],['ids','id'])||{})[_0xa72f('0xaa')](function(_0x3fb3f4){for(var _0x4399fb=0x0;_0x4399fb<_0x3b5017[_0xa72f('0x52')][_0xa72f('0x5a')]['length'];_0x4399fb+=0x1){socket[_0xa72f('0x126')](_0xa72f('0x127'),{'UserId':Number(_0x3b5017[_0xa72f('0x52')]['ids'][_0x4399fb]),'ChatWebsiteId':Number(_0x3b5017['params']['id'])});}return _0x3fb3f4;});}})[_0xa72f('0x11')](respondWithResult(_0x346b12,null))[_0xa72f('0x1c')](handleError(_0x346b12,null));};exports[_0xa72f('0x128')]=function(_0x335520,_0xb076ff){return db[_0xa72f('0x45')][_0xa72f('0x4a')]({'where':{'id':_0x335520[_0xa72f('0x49')]['id']}})[_0xa72f('0x11')](handleEntityNotFound(_0xb076ff,null))[_0xa72f('0x11')](function(_0x25a8cd){if(_0x25a8cd){return _0x25a8cd['removeAgents'](_0x335520[_0xa72f('0x33')][_0xa72f('0x5a')])[_0xa72f('0x11')](function(){if(_[_0xa72f('0x129')](_0x335520[_0xa72f('0x33')][_0xa72f('0x5a')])){for(var _0x1ac2e3=0x0;_0x1ac2e3<_0x335520[_0xa72f('0x33')][_0xa72f('0x5a')]['length'];_0x1ac2e3+=0x1){socket[_0xa72f('0x126')]('userChatWebsite:remove',{'UserId':Number(_0x335520['query']['ids'][_0x1ac2e3]),'ChatWebsiteId':Number(_0x335520[_0xa72f('0x49')]['id'])});}}else{socket[_0xa72f('0x126')](_0xa72f('0x12a'),{'UserId':Number(_0x335520[_0xa72f('0x33')]['ids']),'ChatWebsiteId':Number(_0x335520['params']['id'])});}});}})['then'](respondWithStatusCode(_0xb076ff,null))[_0xa72f('0x1c')](handleError(_0xb076ff,null));};exports[_0xa72f('0x12b')]=function(_0x191e8e,_0xf99dde){var _0x2b56b9={};var _0x5749a5={};var _0x45c836;var _0x1b9924;return db['ChatWebsite'][_0xa72f('0x58')]({'where':{'id':_0x191e8e[_0xa72f('0x49')]['id']}})['then'](handleEntityNotFound(_0xf99dde,null))[_0xa72f('0x11')](function(_0x5c5c6a){if(_0x5c5c6a){_0x45c836=_0x5c5c6a;_0x5749a5[_0xa72f('0x31')]=_[_0xa72f('0x32')](db[_0xa72f('0xb3')][_0xa72f('0x30')]);_0x5749a5[_0xa72f('0x33')]=_[_0xa72f('0x32')](_0x191e8e['query']);_0x5749a5[_0xa72f('0x34')]=_[_0xa72f('0x35')](_0x5749a5['model'],_0x5749a5[_0xa72f('0x33')]);_0x2b56b9[_0xa72f('0x37')]=_[_0xa72f('0x35')](_0x5749a5[_0xa72f('0x31')],qs[_0xa72f('0x36')](_0x191e8e[_0xa72f('0x33')]['fields']));_0x2b56b9[_0xa72f('0x37')]=_0x2b56b9[_0xa72f('0x37')]['length']?_0x2b56b9['attributes']:_0x5749a5[_0xa72f('0x31')];_0x2b56b9['order']=qs[_0xa72f('0x3c')](_0x191e8e['query']['sort']);_0x2b56b9[_0xa72f('0x3d')]=qs[_0xa72f('0x34')](_[_0xa72f('0x3e')](_0x191e8e['query'],_0x5749a5[_0xa72f('0x34')]));if(_0x191e8e[_0xa72f('0x33')][_0xa72f('0x3f')]){_0x2b56b9[_0xa72f('0x3d')]=_[_0xa72f('0x40')](_0x2b56b9['where'],{'$or':_[_0xa72f('0x2f')](_0x2b56b9[_0xa72f('0x37')],function(_0x2639ee){var _0xed4e9f={};_0xed4e9f[_0x2639ee]={'$like':'%'+_0x191e8e[_0xa72f('0x33')]['filter']+'%'};return _0xed4e9f;})});}_0x2b56b9=_['merge']({},_0x2b56b9,_0x191e8e[_0xa72f('0x42')]);return _0x45c836[_0xa72f('0x12b')](_0x2b56b9);}})[_0xa72f('0x11')](function(_0x4aeffa){if(_0x4aeffa){_0x1b9924=_0x4aeffa[_0xa72f('0x38')];if(!_0x191e8e[_0xa72f('0x33')][_0xa72f('0x39')]('nolimit')){_0x2b56b9['limit']=qs[_0xa72f('0x24')](_0x191e8e[_0xa72f('0x33')]['limit']);_0x2b56b9['offset']=qs[_0xa72f('0x21')](_0x191e8e['query']['offset']);}return _0x45c836[_0xa72f('0x12b')](_0x2b56b9);}})['then'](function(_0xd728f4){if(_0xd728f4){return _0xd728f4?{'count':_0x1b9924,'rows':_0xd728f4}:null;}})[_0xa72f('0x11')](respondWithResult(_0xf99dde,null))[_0xa72f('0x1c')](handleError(_0xf99dde,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 6faa38b..f21ca75 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 _0xf3dc=['events','../../mysqldb','ChatWebsite','save','update','remove'];(function(_0x18b2a3,_0x2a639b){var _0x50659f=function(_0x6cb26e){while(--_0x6cb26e){_0x18b2a3['push'](_0x18b2a3['shift']());}};_0x50659f(++_0x2a639b);}(_0xf3dc,0x9c));var _0xcf3d=function(_0x4046b6,_0x238c36){_0x4046b6=_0x4046b6-0x0;var _0x1443be=_0xf3dc[_0x4046b6];return _0x1443be;};'use strict';var EventEmitter=require(_0xcf3d('0x0'));var ChatWebsite=require(_0xcf3d('0x1'))['db'][_0xcf3d('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcf3d('0x3'),'afterUpdate':_0xcf3d('0x4'),'afterDestroy':_0xcf3d('0x5')};function emitEvent(_0x226c79){return function(_0x17b83e,_0x44b3da,_0x4b34a3){ChatWebsiteEvents['emit'](_0x226c79+':'+_0x17b83e['id'],_0x17b83e);ChatWebsiteEvents['emit'](_0x226c79,_0x17b83e);_0x4b34a3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x3036=['save','remove','emit','hasOwnProperty','hook','ChatWebsite','setMaxListeners'];(function(_0x946926,_0x7d3931){var _0x378426=function(_0x196986){while(--_0x196986){_0x946926['push'](_0x946926['shift']());}};_0x378426(++_0x7d3931);}(_0x3036,0x1a9));var _0x6303=function(_0x82f20e,_0x426323){_0x82f20e=_0x82f20e-0x0;var _0x4d624f=_0x3036[_0x82f20e];return _0x4d624f;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x6303('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6303('0x1')](0x0);var events={'afterCreate':_0x6303('0x2'),'afterUpdate':'update','afterDestroy':_0x6303('0x3')};function emitEvent(_0x4b6d75){return function(_0x48aa0c,_0x4d040b,_0x29f435){ChatWebsiteEvents['emit'](_0x4b6d75+':'+_0x48aa0c['id'],_0x48aa0c);ChatWebsiteEvents[_0x6303('0x4')](_0x4b6d75,_0x48aa0c);_0x29f435(null);};}for(var e in events){if(events[_0x6303('0x5')](e)){var event=events[e];ChatWebsite[_0x6303('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 0a65b02..c66069b 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 _0x5c41=['util','../../config/logger','api','moment','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash'];(function(_0x2765ff,_0x34527a){var _0x35890e=function(_0x445436){while(--_0x445436){_0x2765ff['push'](_0x2765ff['shift']());}};_0x35890e(++_0x34527a);}(_0x5c41,0x151));var _0x15c4=function(_0x39a71b,_0xeb62c3){_0x39a71b=_0x39a71b-0x0;var _0x1ff3db=_0x5c41[_0x39a71b];return _0x1ff3db;};'use strict';var _=require(_0x15c4('0x0'));var util=require(_0x15c4('0x1'));var logger=require(_0x15c4('0x2'))(_0x15c4('0x3'));var moment=require(_0x15c4('0x4'));var BPromise=require('bluebird');var rp=require(_0x15c4('0x5'));var fs=require('fs');var path=require(_0x15c4('0x6'));var rimraf=require(_0x15c4('0x7'));var config=require('../../config/environment');var attributes=require(_0x15c4('0x8'));module[_0x15c4('0x9')]=function(_0xb8f2b2,_0x118930){return _0xb8f2b2[_0x15c4('0xa')](_0x15c4('0xb'),attributes,{'tableName':_0x15c4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe052=['moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','api'];(function(_0x543759,_0x40cfbc){var _0x35003c=function(_0x34e7ba){while(--_0x34e7ba){_0x543759['push'](_0x543759['shift']());}};_0x35003c(++_0x40cfbc);}(_0xe052,0xe6));var _0x2e05=function(_0xf88a2e,_0x26a724){_0xf88a2e=_0xf88a2e-0x0;var _0x2ce6e2=_0xe052[_0xf88a2e];return _0x2ce6e2;};'use strict';var _=require(_0x2e05('0x0'));var util=require(_0x2e05('0x1'));var logger=require(_0x2e05('0x2'))(_0x2e05('0x3'));var moment=require(_0x2e05('0x4'));var BPromise=require(_0x2e05('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e05('0x6'));var rimraf=require(_0x2e05('0x7'));var config=require(_0x2e05('0x8'));var attributes=require(_0x2e05('0x9'));module[_0x2e05('0xa')]=function(_0x29f9e5,_0x466053){return _0x29f9e5[_0x2e05('0xb')]('ChatWebsite',attributes,{'tableName':_0x2e05('0xc'),'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 29d3a18..b4a5ffe 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 _0x2d86=['rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x381f03,_0x4c3f61){var _0x21a630=function(_0x34a2fa){while(--_0x34a2fa){_0x381f03['push'](_0x381f03['shift']());}};_0x21a630(++_0x4c3f61);}(_0x2d86,0x13c));var _0x62d8=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0x2d86[_0x5e709a];return _0x57401a;};'use strict';var _=require(_0x62d8('0x0'));var util=require(_0x62d8('0x1'));var moment=require('moment');var BPromise=require(_0x62d8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62d8('0x3'));var db=require(_0x62d8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x62d8('0x5'))(_0x62d8('0x6'));var config=require(_0x62d8('0x7'));var jayson=require(_0x62d8('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x62d8('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x62d8('0xa'))(new Redis(config['redis']));require(_0x62d8('0xb'))[_0x62d8('0xc')](socket);function respondWithRpcPromise(_0x132836,_0xd8ca39,_0x18c5ab){return new BPromise(function(_0x1472ba,_0x53dc2d){return client[_0x62d8('0xd')](_0x132836,_0x18c5ab)[_0x62d8('0xe')](function(_0x2df72e){logger[_0x62d8('0xf')](_0x62d8('0x10'),_0xd8ca39,_0x62d8('0x11'));logger['debug'](_0x62d8('0x12'),_0xd8ca39,_0x62d8('0x11'),JSON['stringify'](_0x2df72e));if(_0x2df72e['error']){if(_0x2df72e[_0x62d8('0x13')]['code']===0x1f4){logger[_0x62d8('0x13')](_0x62d8('0x10'),_0xd8ca39,_0x2df72e['error'][_0x62d8('0x14')]);return _0x53dc2d(_0x2df72e['error'][_0x62d8('0x14')]);}logger[_0x62d8('0x13')](_0x62d8('0x10'),_0xd8ca39,_0x2df72e[_0x62d8('0x13')]['message']);return _0x1472ba(_0x2df72e[_0x62d8('0x13')][_0x62d8('0x14')]);}else{logger[_0x62d8('0xf')](_0x62d8('0x10'),_0xd8ca39,'request\x20sent');_0x1472ba(_0x2df72e[_0x62d8('0x15')][_0x62d8('0x14')]);}})[_0x62d8('0x16')](function(_0x56c261){logger['error']('ChatWebsite,\x20%s,\x20%s',_0xd8ca39,_0x56c261);_0x53dc2d(_0x56c261);});});}
\ No newline at end of file
+var _0xb166=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then'];(function(_0x3248c3,_0x355905){var _0x123814=function(_0x232e85){while(--_0x232e85){_0x3248c3['push'](_0x3248c3['shift']());}};_0x123814(++_0x355905);}(_0xb166,0x6c));var _0x6b16=function(_0x845505,_0x19e5f3){_0x845505=_0x845505-0x0;var _0x2513b9=_0xb166[_0x845505];return _0x2513b9;};'use strict';var _=require('lodash');var util=require(_0x6b16('0x0'));var moment=require('moment');var BPromise=require(_0x6b16('0x1'));var rs=require(_0x6b16('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6b16('0x3'));var logger=require(_0x6b16('0x4'))('rpc');var config=require(_0x6b16('0x5'));var jayson=require(_0x6b16('0x6'));var client=jayson[_0x6b16('0x7')][_0x6b16('0x8')]({'port':0x232a});config[_0x6b16('0x9')]=_[_0x6b16('0xa')](config['redis'],{'host':_0x6b16('0xb'),'port':0x18eb});var socket=require(_0x6b16('0xc'))(new Redis(config['redis']));require(_0x6b16('0xd'))[_0x6b16('0xe')](socket);function respondWithRpcPromise(_0x330a1c,_0x25b7e6,_0x4aa725){return new BPromise(function(_0x5c53de,_0x5ddecc){return client[_0x6b16('0xf')](_0x330a1c,_0x4aa725)[_0x6b16('0x10')](function(_0x2f6725){logger[_0x6b16('0x11')](_0x6b16('0x12'),_0x25b7e6,_0x6b16('0x13'));logger[_0x6b16('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x25b7e6,_0x6b16('0x13'),JSON[_0x6b16('0x15')](_0x2f6725));if(_0x2f6725['error']){if(_0x2f6725[_0x6b16('0x16')][_0x6b16('0x17')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x25b7e6,_0x2f6725[_0x6b16('0x16')][_0x6b16('0x18')]);return _0x5ddecc(_0x2f6725['error']['message']);}logger[_0x6b16('0x16')](_0x6b16('0x12'),_0x25b7e6,_0x2f6725[_0x6b16('0x16')][_0x6b16('0x18')]);return _0x5c53de(_0x2f6725[_0x6b16('0x16')][_0x6b16('0x18')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x25b7e6,_0x6b16('0x13'));_0x5c53de(_0x2f6725['result'][_0x6b16('0x18')]);}})['catch'](function(_0x3e3c60){logger[_0x6b16('0x16')](_0x6b16('0x12'),_0x25b7e6,_0x3e3c60);_0x5ddecc(_0x3e3c60);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index e1817e5..32108dd 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 _0xf3e4=['removeListener','length','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0x35cd75,_0x1b1f1a){var _0x12dbef=function(_0x289db2){while(--_0x289db2){_0x35cd75['push'](_0x35cd75['shift']());}};_0x12dbef(++_0x1b1f1a);}(_0xf3e4,0x15f));var _0x4f3e=function(_0x57e349,_0x3849ff){_0x57e349=_0x57e349-0x0;var _0x410855=_0xf3e4[_0x57e349];return _0x410855;};'use strict';var ChatWebsiteEvents=require(_0x4f3e('0x0'));var events=['save',_0x4f3e('0x1'),_0x4f3e('0x2')];function createListener(_0x46f1aa,_0xbd0a6b){return function(_0x6d35da){_0xbd0a6b['emit'](_0x46f1aa,_0x6d35da);};}function removeListener(_0x5d7b17,_0x232602){return function(){ChatWebsiteEvents[_0x4f3e('0x3')](_0x5d7b17,_0x232602);};}exports['register']=function(_0x5809f0){for(var _0x21fe43=0x0,_0x149a84=events[_0x4f3e('0x4')];_0x21fe43<_0x149a84;_0x21fe43++){var _0x4b124e=events[_0x21fe43];var _0x3530fc=createListener(_0x4f3e('0x5')+_0x4b124e,_0x5809f0);ChatWebsiteEvents['on'](_0x4b124e,_0x3530fc);}};
\ No newline at end of file
+var _0xeff4=['./chatWebsite.events','save','remove','update','emit','removeListener','register','length'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xeff4,0x180));var _0x4eff=function(_0x4382bc,_0x231a2d){_0x4382bc=_0x4382bc-0x0;var _0x13c82a=_0xeff4[_0x4382bc];return _0x13c82a;};'use strict';var ChatWebsiteEvents=require(_0x4eff('0x0'));var events=[_0x4eff('0x1'),_0x4eff('0x2'),_0x4eff('0x3')];function createListener(_0x544741,_0x1f7fdc){return function(_0x11c96e){_0x1f7fdc[_0x4eff('0x4')](_0x544741,_0x11c96e);};}function removeListener(_0x438b11,_0x519b58){return function(){ChatWebsiteEvents[_0x4eff('0x5')](_0x438b11,_0x519b58);};}exports[_0x4eff('0x6')]=function(_0x35a4b0){for(var _0x2d7f61=0x0,_0x2ec9d3=events[_0x4eff('0x7')];_0x2d7f61<_0x2ec9d3;_0x2d7f61++){var _0x5cdcd2=events[_0x2d7f61];var _0x4c267a=createListener('chatWebsite:'+_0x5cdcd2,_0x35a4b0);ChatWebsiteEvents['on'](_0x5cdcd2,_0x4c267a);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 0a41008..2616741 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 _0x1a20=['getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','server/files','attachments','offline-chat','replace','/:id/offline','any','offline','addInteraction','put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar'];(function(_0xff0854,_0x50fd52){var _0x12f6bf=function(_0x3940f8){while(--_0x3940f8){_0xff0854['push'](_0xff0854['shift']());}};_0x12f6bf(++_0x50fd52);}(_0x1a20,0xff));var _0x01a2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1a20[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x01a2('0x0'));var util=require(_0x01a2('0x1'));var path=require(_0x01a2('0x2'));var timeout=require(_0x01a2('0x3'));var express=require('express');var router=express[_0x01a2('0x4')]();var fs_extra=require(_0x01a2('0x5'));var auth=require(_0x01a2('0x6'));var interaction=require(_0x01a2('0x7'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x01a2('0x8')]);router[_0x01a2('0x9')](_0x01a2('0xa'),auth['isAuthenticated'](),controller[_0x01a2('0xb')]);router[_0x01a2('0x9')](_0x01a2('0xc'),auth[_0x01a2('0xd')](),controller[_0x01a2('0xe')]);router['get'](_0x01a2('0xf'),auth[_0x01a2('0xd')](),controller['getDispositions']);router[_0x01a2('0x9')]('/:id/canned_answers',auth[_0x01a2('0xd')](),controller[_0x01a2('0x10')]);router[_0x01a2('0x9')]('/:id/logo',controller[_0x01a2('0x11')]);router[_0x01a2('0x9')](_0x01a2('0x12'),controller[_0x01a2('0x13')]);router['get'](_0x01a2('0x14'),controller[_0x01a2('0x15')]);router[_0x01a2('0x9')](_0x01a2('0x16'),controller[_0x01a2('0x17')]);router[_0x01a2('0x9')](_0x01a2('0x18'),auth[_0x01a2('0xd')](),controller[_0x01a2('0x19')]);router[_0x01a2('0x9')](_0x01a2('0x1a'),controller['getSnippet']);router[_0x01a2('0x9')](_0x01a2('0x1b'),auth[_0x01a2('0xd')](),controller[_0x01a2('0x1c')]);router[_0x01a2('0x9')](_0x01a2('0x1d'),auth[_0x01a2('0xd')](),controller[_0x01a2('0x1e')]);router['get'](_0x01a2('0x1f'),controller['getFields']);router[_0x01a2('0x9')](_0x01a2('0x20'),auth[_0x01a2('0xd')](),controller[_0x01a2('0x21')]);router[_0x01a2('0x9')](_0x01a2('0x22'),auth[_0x01a2('0xd')](),controller[_0x01a2('0x23')]);router[_0x01a2('0x24')]('/',auth[_0x01a2('0xd')](),controller[_0x01a2('0x25')]);router[_0x01a2('0x24')]('/:id/dispositions',auth[_0x01a2('0xd')](),controller['addDisposition']);router[_0x01a2('0x24')]('/:id/canned_answers',auth[_0x01a2('0xd')](),controller[_0x01a2('0x26')]);var upload=multer({'storage':multer[_0x01a2('0x27')]({'destination':function(_0x4d3b41,_0x171ccf,_0x526a64){_0x526a64(null,path[_0x01a2('0x28')](config[_0x01a2('0x29')],_0x01a2('0x2a')));},'filename':function(_0x33ef36,_0x217d84,_0x426f39){_0x426f39(null,util[_0x01a2('0x2b')](_0x01a2('0x2c'),Date[_0x01a2('0x2d')](),_0x217d84[_0x01a2('0x2e')]));}})});router[_0x01a2('0x24')](_0x01a2('0x2f'),upload[_0x01a2('0x30')](_0x01a2('0x31')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x431aba,_0xddabad,_0x14cb7a){_0x14cb7a(null,path[_0x01a2('0x28')](config[_0x01a2('0x29')],_0x01a2('0x32')));},'filename':function(_0x5da399,_0xcdef87,_0x2e12da){_0x2e12da(null,util[_0x01a2('0x2b')](_0x01a2('0x2c'),Date[_0x01a2('0x2d')](),_0xcdef87[_0x01a2('0x2e')]));}})});router[_0x01a2('0x24')](_0x01a2('0x12'),upload['single'](_0x01a2('0x31')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x334990,_0x5f96e,_0x263223){_0x263223(null,path[_0x01a2('0x28')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x35704a,_0x93121a,_0x95bc02){_0x95bc02(null,util['format'](_0x01a2('0x2c'),Date[_0x01a2('0x2d')](),_0x93121a[_0x01a2('0x2e')]));}})});router['post'](_0x01a2('0x14'),upload[_0x01a2('0x30')](_0x01a2('0x31')),controller[_0x01a2('0x33')]);var upload=multer({'storage':multer[_0x01a2('0x27')]({'destination':function(_0x4ac1bb,_0x5e6a86,_0x18c4c2){_0x18c4c2(null,path[_0x01a2('0x28')](config[_0x01a2('0x29')],_0x01a2('0x32')));},'filename':function(_0x18d1ff,_0x1ba277,_0x3b60ae){_0x3b60ae(null,util[_0x01a2('0x2b')](_0x01a2('0x2c'),Date[_0x01a2('0x2d')](),_0x1ba277[_0x01a2('0x2e')]));}})});router[_0x01a2('0x24')](_0x01a2('0x16'),upload['single'](_0x01a2('0x31')),controller[_0x01a2('0x34')]);router['post']('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x01a2('0x27')]({'destination':function(_0x35d0e4,_0x4ce34d,_0x2fe74e){const _0x3bb03e=path[_0x01a2('0x28')](config[_0x01a2('0x29')],_0x01a2('0x35'),_0x01a2('0x36'),_0x01a2('0x37'));fs_extra['ensureDir'](_0x3bb03e,function(){_0x2fe74e(null,_0x3bb03e);});},'filename':function(_0x181a64,_0x1e10b7,_0x22bbe5){const _0x350476=_0x1e10b7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5b0710=path['extname'](_0x350476);const _0x3d21d7=Date[_0x01a2('0x2d')]()+'-'+_0x350476[_0x01a2('0x38')](_0x5b0710,'')+_0x5b0710;_0x22bbe5(null,_0x3d21d7);}})});router[_0x01a2('0x24')](_0x01a2('0x39'),offlineUploadMulter[_0x01a2('0x3a')](),controller[_0x01a2('0x3b')]);router[_0x01a2('0x24')](_0x01a2('0x18'),auth[_0x01a2('0xd')](),controller[_0x01a2('0x3c')]);router['post'](_0x01a2('0x1b'),auth[_0x01a2('0xd')](),controller['addApplications']);router[_0x01a2('0x24')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router['post'](_0x01a2('0x22'),auth[_0x01a2('0xd')](),controller['addAgents']);router[_0x01a2('0x3d')](_0x01a2('0xc'),auth[_0x01a2('0xd')](),controller[_0x01a2('0x3e')]);router[_0x01a2('0x3f')]('/:id',auth['isAuthenticated'](),controller[_0x01a2('0x40')]);router[_0x01a2('0x3f')](_0x01a2('0xf'),auth[_0x01a2('0xd')](),controller[_0x01a2('0x41')]);router[_0x01a2('0x3f')](_0x01a2('0x42'),auth[_0x01a2('0xd')](),controller['removeAnswers']);router[_0x01a2('0x3f')]('/:id/users',auth['isAuthenticated'](),controller[_0x01a2('0x43')]);module[_0x01a2('0x44')]=router;
\ No newline at end of file
+var _0x119b=['./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','format','originalname','file','server/files/images/avatars/','%s-%s','now','/:id/avatar','addAvatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','any','addApplications','addProactiveActions','addAgents','update','destroy','delete','removeDispositions','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1484c4,_0x2d844b){var _0x598b70=function(_0x3245f9){while(--_0x3245f9){_0x1484c4['push'](_0x1484c4['shift']());}};_0x598b70(++_0x2d844b);}(_0x119b,0x1f1));var _0xb119=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x119b[_0x7e2eb0];return _0xd92de4;};'use strict';var multer=require('multer');var util=require(_0xb119('0x0'));var path=require('path');var timeout=require(_0xb119('0x1'));var express=require(_0xb119('0x2'));var router=express[_0xb119('0x3')]();var fs_extra=require(_0xb119('0x4'));var auth=require(_0xb119('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb119('0x6'));var controller=require(_0xb119('0x7'));router[_0xb119('0x8')]('/',auth[_0xb119('0x9')](),controller[_0xb119('0xa')]);router[_0xb119('0x8')](_0xb119('0xb'),auth[_0xb119('0x9')](),controller[_0xb119('0xc')]);router['get'](_0xb119('0xd'),auth['isAuthenticated'](),controller[_0xb119('0xe')]);router['get']('/:id/dispositions',auth[_0xb119('0x9')](),controller[_0xb119('0xf')]);router[_0xb119('0x8')](_0xb119('0x10'),auth[_0xb119('0x9')](),controller['getAnswers']);router['get'](_0xb119('0x11'),controller[_0xb119('0x12')]);router[_0xb119('0x8')]('/:id/avatar',controller[_0xb119('0x13')]);router[_0xb119('0x8')](_0xb119('0x14'),controller['getCustomerAvatar']);router[_0xb119('0x8')](_0xb119('0x15'),controller[_0xb119('0x16')]);router[_0xb119('0x8')](_0xb119('0x17'),auth[_0xb119('0x9')](),controller[_0xb119('0x18')]);router[_0xb119('0x8')](_0xb119('0x19'),controller[_0xb119('0x1a')]);router['get'](_0xb119('0x1b'),auth[_0xb119('0x9')](),controller['getApplications']);router[_0xb119('0x8')](_0xb119('0x1c'),auth[_0xb119('0x9')](),controller[_0xb119('0x1d')]);router[_0xb119('0x8')](_0xb119('0x1e'),controller['getFields']);router[_0xb119('0x8')](_0xb119('0x1f'),auth[_0xb119('0x9')](),controller[_0xb119('0x20')]);router[_0xb119('0x8')](_0xb119('0x21'),auth[_0xb119('0x9')](),controller[_0xb119('0x22')]);router['post']('/',auth[_0xb119('0x9')](),controller[_0xb119('0x23')]);router[_0xb119('0x24')](_0xb119('0x25'),auth[_0xb119('0x9')](),controller[_0xb119('0x26')]);router[_0xb119('0x24')](_0xb119('0x10'),auth[_0xb119('0x9')](),controller[_0xb119('0x27')]);var upload=multer({'storage':multer[_0xb119('0x28')]({'destination':function(_0x299f4b,_0x46f808,_0x4b4ca1){_0x4b4ca1(null,path[_0xb119('0x29')](config[_0xb119('0x2a')],'server/files/images/logos/'));},'filename':function(_0x546413,_0x58fe51,_0x41452d){_0x41452d(null,util[_0xb119('0x2b')]('%s-%s',Date['now'](),_0x58fe51[_0xb119('0x2c')]));}})});router[_0xb119('0x24')](_0xb119('0x11'),upload['single'](_0xb119('0x2d')),controller['addLogo']);var upload=multer({'storage':multer[_0xb119('0x28')]({'destination':function(_0x23140e,_0x274374,_0x432d0c){_0x432d0c(null,path['join'](config[_0xb119('0x2a')],_0xb119('0x2e')));},'filename':function(_0x3b1b57,_0x5e5e48,_0x119cce){_0x119cce(null,util[_0xb119('0x2b')](_0xb119('0x2f'),Date[_0xb119('0x30')](),_0x5e5e48[_0xb119('0x2c')]));}})});router['post'](_0xb119('0x31'),upload['single']('file'),controller[_0xb119('0x32')]);var upload=multer({'storage':multer[_0xb119('0x28')]({'destination':function(_0x227b62,_0x1a0bb6,_0x560f59){_0x560f59(null,path[_0xb119('0x29')](config[_0xb119('0x2a')],_0xb119('0x2e')));},'filename':function(_0xc8c668,_0x206893,_0x1344d){_0x1344d(null,util[_0xb119('0x2b')](_0xb119('0x2f'),Date[_0xb119('0x30')](),_0x206893[_0xb119('0x2c')]));}})});router[_0xb119('0x24')](_0xb119('0x14'),upload[_0xb119('0x33')](_0xb119('0x2d')),controller[_0xb119('0x34')]);var upload=multer({'storage':multer[_0xb119('0x28')]({'destination':function(_0x14e648,_0x3d9b70,_0x99b83e){_0x99b83e(null,path[_0xb119('0x29')](config[_0xb119('0x2a')],'server/files/images/avatars/'));},'filename':function(_0xa72d9c,_0x47a7ff,_0x5c4d30){_0x5c4d30(null,util['format'](_0xb119('0x2f'),Date[_0xb119('0x30')](),_0x47a7ff[_0xb119('0x2c')]));}})});router[_0xb119('0x24')](_0xb119('0x15'),upload['single'](_0xb119('0x2d')),controller[_0xb119('0x35')]);router[_0xb119('0x24')](_0xb119('0x36'),controller[_0xb119('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0xb119('0x28')]({'destination':function(_0x398c1f,_0x4ed3b5,_0x314753){const _0x9d5f37=path[_0xb119('0x29')](config[_0xb119('0x2a')],_0xb119('0x38'),_0xb119('0x39'),_0xb119('0x3a'));fs_extra[_0xb119('0x3b')](_0x9d5f37,function(){_0x314753(null,_0x9d5f37);});},'filename':function(_0x3d7d1c,_0x279d6c,_0x2690df){const _0x34150e=_0x279d6c['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4139a1=path[_0xb119('0x3c')](_0x34150e);const _0x5a19bc=Date[_0xb119('0x30')]()+'-'+_0x34150e[_0xb119('0x3d')](_0x4139a1,'')+_0x4139a1;_0x2690df(null,_0x5a19bc);}})});router[_0xb119('0x24')]('/:id/offline',offlineUploadMulter[_0xb119('0x3e')](),controller['offline']);router['post']('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router['post']('/:id/applications',auth[_0xb119('0x9')](),controller[_0xb119('0x3f')]);router['post']('/:id/proactive_actions',auth[_0xb119('0x9')](),controller[_0xb119('0x40')]);router[_0xb119('0x24')](_0xb119('0x21'),auth['isAuthenticated'](),controller[_0xb119('0x41')]);router['put'](_0xb119('0xd'),auth['isAuthenticated'](),controller[_0xb119('0x42')]);router['delete'](_0xb119('0xd'),auth[_0xb119('0x9')](),controller[_0xb119('0x43')]);router[_0xb119('0x44')]('/:id/dispositions',auth[_0xb119('0x9')](),controller[_0xb119('0x45')]);router[_0xb119('0x44')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0xb119('0x44')](_0xb119('0x21'),auth[_0xb119('0x9')](),controller[_0xb119('0x46')]);module[_0xb119('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 88cc67c..7f67c2b 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 _0x0999=['app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','beaver-logger/server','express','../config/environment','env','production'];(function(_0x465811,_0x434579){var _0x29834d=function(_0x16194a){while(--_0x16194a){_0x465811['push'](_0x465811['shift']());}};_0x29834d(++_0x434579);}(_0x0999,0xd8));var _0x9099=function(_0x45161c,_0x5494fc){_0x45161c=_0x45161c-0x0;var _0x186581=_0x0999[_0x45161c];return _0x186581;};var beaverLogger=require(_0x9099('0x0'));var express=require(_0x9099('0x1'));var auth=require('../components/auth/service');var config=require(_0x9099('0x2'));var router=express['Router']();var isProduction=config[_0x9099('0x3')]===_0x9099('0x4')||![];function clientSideLogs(_0x1e8105,_0x587fe8,_0x32a12c){var _0x4c22c9=_0x1e8105[_0x9099('0x5')][_0x9099('0x6')](_0x9099('0x7'));if(!_0x4c22c9){throw new Error(_0x9099('0x8'));}return beaverLogger[_0x9099('0x9')]({'uri':_0x9099('0xa'),'logger':_0x4c22c9,'enableCors':!isProduction})(_0x1e8105,_0x587fe8,_0x32a12c);}router['use'](auth[_0x9099('0xb')](),clientSideLogs);module[_0x9099('0xc')]=router;
\ No newline at end of file
+var _0x6e92=['../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service'];(function(_0x3d1d36,_0xf5a9aa){var _0x5e0ade=function(_0x8c4932){while(--_0x8c4932){_0x3d1d36['push'](_0x3d1d36['shift']());}};_0x5e0ade(++_0xf5a9aa);}(_0x6e92,0x16d));var _0x26e9=function(_0x312d76,_0x1bc862){_0x312d76=_0x312d76-0x0;var _0xdc8d9d=_0x6e92[_0x312d76];return _0xdc8d9d;};var beaverLogger=require(_0x26e9('0x0'));var express=require(_0x26e9('0x1'));var auth=require(_0x26e9('0x2'));var config=require(_0x26e9('0x3'));var router=express[_0x26e9('0x4')]();var isProduction=config[_0x26e9('0x5')]===_0x26e9('0x6')||![];function clientSideLogs(_0x93ca44,_0x1ffa1c,_0x65c88b){var _0x2e8400=_0x93ca44[_0x26e9('0x7')][_0x26e9('0x8')](_0x26e9('0x9'));if(!_0x2e8400){throw new Error(_0x26e9('0xa'));}return beaverLogger[_0x26e9('0xb')]({'uri':_0x26e9('0xc'),'logger':_0x2e8400,'enableCors':!isProduction})(_0x93ca44,_0x1ffa1c,_0x65c88b);}router[_0x26e9('0xd')](auth[_0x26e9('0xe')](),clientSideLogs);module[_0x26e9('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 4753b85..8aedcad 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 _0xbc37=['AmazonAWS','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','ENUM'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0xbc37,0x1c0));var _0x7bc3=function(_0x35d06e,_0x2e3503){_0x35d06e=_0x35d06e-0x0;var _0x9e9053=_0xbc37[_0x35d06e];return _0x9e9053;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7bc3('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7bc3('0x1')](_0x7bc3('0x2'),'Google',_0x7bc3('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x7bc3('0x1')]('Outlook365',_0x7bc3('0x4'))},'data1':{'type':Sequelize[_0x7bc3('0x0')],'comment':_0x7bc3('0x5')},'data2':{'type':Sequelize[_0x7bc3('0x0')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x7bc3('0x0')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x7bc3('0x6')],'comment':_0x7bc3('0x7')},'data6':{'type':Sequelize[_0x7bc3('0x6')],'comment':_0x7bc3('0x8')},'data7':{'type':Sequelize[_0x7bc3('0x6')],'comment':_0x7bc3('0x9')}};
\ No newline at end of file
+var _0x5e2b=['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','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x1043dd,_0x597e86){var _0x2a7b0f=function(_0x1cb3e7){while(--_0x1cb3e7){_0x1043dd['push'](_0x1043dd['shift']());}};_0x2a7b0f(++_0x597e86);}(_0x5e2b,0x75));var _0xb5e2=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x5e2b[_0x2aec52];return _0x3b8835;};'use strict';var Sequelize=require(_0xb5e2('0x0'));module[_0xb5e2('0x1')]={'name':{'type':Sequelize[_0xb5e2('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb5e2('0x3')](_0xb5e2('0x4'),_0xb5e2('0x5'),_0xb5e2('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xb5e2('0x3')](_0xb5e2('0x7'),_0xb5e2('0x8'))},'data1':{'type':Sequelize[_0xb5e2('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xb5e2('0x2')],'comment':_0xb5e2('0x9')},'data3':{'type':Sequelize[_0xb5e2('0x2')],'comment':_0xb5e2('0xa')},'data4':{'type':Sequelize[_0xb5e2('0x2')],'comment':_0xb5e2('0xb')},'data5':{'type':Sequelize[_0xb5e2('0xc')],'comment':_0xb5e2('0xd')},'data6':{'type':Sequelize[_0xb5e2('0xc')],'comment':_0xb5e2('0xe')},'data7':{'type':Sequelize[_0xb5e2('0xc')],'comment':_0xb5e2('0xf')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 1176ad7..64900d5 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 _0x8044=['parse','from','base64','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','ioredis','../../config/environment','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','service','MicrosoftAzure','decryptString','data3','params','rawAttributes','find','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter'];(function(_0x1e08fc,_0x181678){var _0x1e3e4a=function(_0x74d564){while(--_0x74d564){_0x1e08fc['push'](_0x1e08fc['shift']());}};_0x1e3e4a(++_0x181678);}(_0x8044,0x1f0));var _0x4804=function(_0xce6f11,_0x3c3137){_0xce6f11=_0xce6f11-0x0;var _0x35b709=_0x8044[_0xce6f11];return _0x35b709;};'use strict';var _=require('lodash');var Redis=require(_0x4804('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0x4804('0x1'));var logger=require('../../config/logger')(_0x4804('0x2'));var db=require('../../mysqldb')['db'];var oauth=require(_0x4804('0x3'));config[_0x4804('0x4')]=_[_0x4804('0x5')](config[_0x4804('0x4')],{'host':_0x4804('0x6'),'port':0x18eb});var socket=require(_0x4804('0x7'))(new Redis(config[_0x4804('0x4')]));var redis=new Redis(config[_0x4804('0x4')]);function respondWithStatusCode(_0xf71081,_0x14c831){_0x14c831=_0x14c831||0xcc;return function(_0x5b0282){if(_0x5b0282){return _0xf71081['sendStatus'](_0x14c831);}return _0xf71081[_0x4804('0x8')](_0x14c831)[_0x4804('0x9')]();};}function respondWithResult(_0xa5fff4,_0x4f3267){_0x4f3267=_0x4f3267||0xc8;return function(_0x198007){if(_0x198007){return _0xa5fff4['status'](_0x4f3267)[_0x4804('0xa')](_0x198007);}};}function respondWithFilteredResult(_0x7e886a,_0x187fac){return function(_0x2e6886){if(_0x2e6886){var _0x24595b=typeof _0x187fac[_0x4804('0xb')]===_0x4804('0xc')&&typeof _0x187fac[_0x4804('0xd')]===_0x4804('0xc');var _0x324a26=_0x2e6886[_0x4804('0xe')];var _0x119d06=_0x24595b?0x0:_0x187fac[_0x4804('0xb')];var _0x31ca64=_0x24595b?_0x2e6886[_0x4804('0xe')]:_0x187fac['offset']+_0x187fac[_0x4804('0xd')];var _0x411fcb;if(_0x31ca64>=_0x324a26){_0x31ca64=_0x324a26;_0x411fcb=0xc8;}else{_0x411fcb=0xce;}_0x7e886a['status'](_0x411fcb);return _0x7e886a[_0x4804('0xf')](_0x4804('0x10'),_0x119d06+'-'+_0x31ca64+'/'+_0x324a26)[_0x4804('0xa')](_0x2e6886);}return null;};}function saveUpdates(_0x351e23){return function(_0x4b77fb){if(_0x4b77fb){return _0x4b77fb[_0x4804('0x11')](_0x351e23)['then'](function(_0x84ec75){return _0x84ec75;});}return null;};}function removeEntity(_0x3a4bb0){return function(_0x47ed4f){if(_0x47ed4f){return _0x47ed4f[_0x4804('0x12')]()[_0x4804('0x13')](function(){_0x3a4bb0[_0x4804('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x373d66){return function(_0x49c9c8){if(!_0x49c9c8){_0x373d66[_0x4804('0x14')](0x194);}return _0x49c9c8;};}function handleError(_0x1bb182,_0x5596bc){_0x5596bc=_0x5596bc||0x1f4;return function(_0x2d7aad){logger[_0x4804('0x15')](_0x2d7aad[_0x4804('0x16')]);if(_0x2d7aad[_0x4804('0x17')]){delete _0x2d7aad[_0x4804('0x17')];}_0x1bb182[_0x4804('0x8')](_0x5596bc)[_0x4804('0x18')](_0x2d7aad);};}function maskClientSecret(_0x30c0c0){return _[_0x4804('0x19')](_0x30c0c0[_0x4804('0x1a')](0x0,0x3),0x14,'*');}exports[_0x4804('0x1b')]=function(_0x450bc3,_0x41be53){var _0x2319b5={},_0x4df94d={},_0x1c0514={'count':0x0,'rows':[]};var _0x48774a=_[_0x4804('0x1c')](db[_0x4804('0x1d')]['rawAttributes'],function(_0x16ffa7){return{'name':_0x16ffa7[_0x4804('0x1e')],'type':_0x16ffa7[_0x4804('0x1f')][_0x4804('0x20')]};});_0x4df94d[_0x4804('0x21')]=_['map'](_0x48774a,_0x4804('0x17'));_0x4df94d[_0x4804('0x22')]=_[_0x4804('0x23')](_0x450bc3[_0x4804('0x22')]);_0x4df94d[_0x4804('0x24')]=_[_0x4804('0x25')](_0x4df94d[_0x4804('0x21')],_0x4df94d[_0x4804('0x22')]);_0x2319b5['attributes']=_[_0x4804('0x25')](_0x4df94d[_0x4804('0x21')],qs[_0x4804('0x26')](_0x450bc3[_0x4804('0x22')]['fields']));_0x2319b5[_0x4804('0x27')]=_0x2319b5[_0x4804('0x27')][_0x4804('0x28')]?_0x2319b5[_0x4804('0x27')]:_0x4df94d[_0x4804('0x21')];if(!_0x450bc3[_0x4804('0x22')][_0x4804('0x29')](_0x4804('0x2a'))){_0x2319b5[_0x4804('0xd')]=qs[_0x4804('0xd')](_0x450bc3[_0x4804('0x22')][_0x4804('0xd')]);_0x2319b5['offset']=qs['offset'](_0x450bc3[_0x4804('0x22')]['offset']);}_0x2319b5[_0x4804('0x2b')]=qs[_0x4804('0x2c')](_0x450bc3[_0x4804('0x22')][_0x4804('0x2c')]);_0x2319b5[_0x4804('0x2d')]=qs['filters'](_[_0x4804('0x2e')](_0x450bc3['query'],_0x4df94d[_0x4804('0x24')]),_0x48774a);if(_0x450bc3[_0x4804('0x22')][_0x4804('0x2f')]){_0x2319b5[_0x4804('0x2d')]=_['merge'](_0x2319b5[_0x4804('0x2d')],{'$or':_[_0x4804('0x1c')](_0x48774a,function(_0x261fe4){if(_0x261fe4['type']!==_0x4804('0x30')){var _0x3169aa={};_0x3169aa[_0x261fe4[_0x4804('0x17')]]={'$like':'%'+_0x450bc3[_0x4804('0x22')]['filter']+'%'};return _0x3169aa;}})});}_0x2319b5=_[_0x4804('0x31')]({},_0x2319b5,_0x450bc3[_0x4804('0x32')]);var _0x2d0ba2={'where':_0x2319b5['where']};return db[_0x4804('0x1d')][_0x4804('0xe')](_0x2d0ba2)['then'](function(_0x165052){_0x1c0514[_0x4804('0xe')]=_0x165052;if(_0x450bc3[_0x4804('0x22')]['includeAll']){_0x2319b5[_0x4804('0x33')]=[{'all':!![]}];}return db[_0x4804('0x1d')]['findAll'](_0x2319b5);})[_0x4804('0x13')](function(_0x254fc2){_0x1c0514[_0x4804('0x34')]=_[_0x4804('0x1c')](_0x254fc2,function(_0x38b436){if(_0x38b436[_0x4804('0x35')]===_0x4804('0x36')){var _0x9855b=encryptor[_0x4804('0x37')](_0x38b436[_0x4804('0x38')]);_0x38b436[_0x4804('0x38')]=maskClientSecret(_0x9855b);}return _0x38b436;});return _0x1c0514;})[_0x4804('0x13')](respondWithFilteredResult(_0x41be53,_0x2319b5))['catch'](handleError(_0x41be53,null));};exports['show']=function(_0x276470,_0x13c5f3){var _0x385407={'raw':!![],'where':{'id':_0x276470[_0x4804('0x39')]['id']}},_0x239a52={};_0x239a52[_0x4804('0x21')]=_[_0x4804('0x23')](db[_0x4804('0x1d')][_0x4804('0x3a')]);_0x239a52[_0x4804('0x22')]=_[_0x4804('0x23')](_0x276470[_0x4804('0x22')]);_0x239a52['filters']=_[_0x4804('0x25')](_0x239a52[_0x4804('0x21')],_0x239a52[_0x4804('0x22')]);_0x385407[_0x4804('0x27')]=_['intersection'](_0x239a52[_0x4804('0x21')],qs[_0x4804('0x26')](_0x276470[_0x4804('0x22')]['fields']));_0x385407['attributes']=_0x385407['attributes'][_0x4804('0x28')]?_0x385407['attributes']:_0x239a52[_0x4804('0x21')];if(_0x276470[_0x4804('0x22')]['includeAll']){_0x385407[_0x4804('0x33')]=[{'all':!![]}];}_0x385407=_[_0x4804('0x31')]({},_0x385407,_0x276470[_0x4804('0x32')]);return db[_0x4804('0x1d')][_0x4804('0x3b')](_0x385407)[_0x4804('0x13')](handleEntityNotFound(_0x13c5f3,null))[_0x4804('0x13')](function(_0x7448a1){if(_0x7448a1[_0x4804('0x35')]===_0x4804('0x36')){var _0x293455=encryptor['decryptString'](_0x7448a1[_0x4804('0x38')]);_0x7448a1[_0x4804('0x38')]=maskClientSecret(_0x293455);}return _0x7448a1;})[_0x4804('0x13')](respondWithResult(_0x13c5f3,null))[_0x4804('0x3c')](handleError(_0x13c5f3,null));};exports[_0x4804('0x3d')]=function(_0x545f47,_0x16b0b4){if(!_0x545f47[_0x4804('0x3e')][_0x4804('0x17')])throw new Error(_0x4804('0x3f'));if(!_0x545f47[_0x4804('0x3e')][_0x4804('0x35')])throw new Error(_0x4804('0x40'));var _0x3b2d89=db[_0x4804('0x1d')][_0x4804('0x3a')][_0x4804('0x35')][_0x4804('0x41')];if(!_0x3b2d89['includes'](_0x545f47[_0x4804('0x3e')][_0x4804('0x35')]))throw new Error(_0x4804('0x42')+_0x3b2d89['join'](',\x20'));if(_0x545f47[_0x4804('0x3e')][_0x4804('0x35')]===_0x4804('0x36')&&_0x545f47['body']['data3']){_0x545f47[_0x4804('0x3e')][_0x4804('0x38')]=encryptor['encryptString'](_0x545f47[_0x4804('0x3e')][_0x4804('0x38')]);}return db[_0x4804('0x1d')][_0x4804('0x3d')](_0x545f47[_0x4804('0x3e')],{})['then'](respondWithResult(_0x16b0b4,0xc9))[_0x4804('0x3c')](handleError(_0x16b0b4,null));};exports[_0x4804('0x11')]=function(_0x1c554d,_0x454763){if(_0x1c554d[_0x4804('0x3e')]['id']){delete _0x1c554d[_0x4804('0x3e')]['id'];}return db['CloudProvider'][_0x4804('0x3b')]({'where':{'id':_0x1c554d[_0x4804('0x39')]['id']}})['then'](handleEntityNotFound(_0x454763,null))['then'](function(_0x36ffce){if(_0x36ffce['service']===_0x4804('0x36')&&_0x1c554d[_0x4804('0x3e')]['data3']){_0x1c554d[_0x4804('0x3e')][_0x4804('0x38')]=encryptor['encryptString'](_0x1c554d[_0x4804('0x3e')][_0x4804('0x38')]);}return _0x36ffce;})[_0x4804('0x13')](saveUpdates(_0x1c554d[_0x4804('0x3e')],null))[_0x4804('0x13')](respondWithResult(_0x454763,null))['catch'](handleError(_0x454763,null));};exports['destroy']=function(_0x2422ff,_0x275e27){return db[_0x4804('0x1d')][_0x4804('0x3b')]({'where':{'id':_0x2422ff[_0x4804('0x39')]['id']}})['then'](handleEntityNotFound(_0x275e27,null))[_0x4804('0x13')](removeEntity(_0x275e27,null))[_0x4804('0x3c')](handleError(_0x275e27,null));};exports[_0x4804('0x43')]=function(_0x5c0fc2,_0x37610b){return db[_0x4804('0x1d')][_0x4804('0x44')]({'where':{'id':_0x5c0fc2[_0x4804('0x39')]['id']},'raw':!![]})[_0x4804('0x13')](function(_0x25a055){if(!_0x25a055)return _0x37610b['sendStatus'](0x194);return{'url':oauth[_0x4804('0x45')](_0x25a055,_0x5c0fc2[_0x4804('0x46')]['id'])};})[_0x4804('0x13')](respondWithResult(_0x37610b,null))[_0x4804('0x3c')](handleError(_0x37610b,null));};exports[_0x4804('0x47')]=function(_0xb7e661,_0x28b2ff){var _0x5adb48=_0xb7e661[_0x4804('0x3e')];var _0x360ee4;var _0x39293f;if(_0x5adb48[_0x4804('0x15')])throw _0x5adb48;redis['get'](_0x5adb48[_0x4804('0x48')])[_0x4804('0x13')](function(_0x2eabff){if(!_0x2eabff)throw new Error(_0x4804('0x49'));_0x360ee4=JSON[_0x4804('0x4a')](_0x2eabff);var _0x429885=Buffer[_0x4804('0x4b')](_0x5adb48[_0x4804('0x48')],_0x4804('0x4c'))['toString'](_0x4804('0x4d'));_0x39293f=JSON[_0x4804('0x4a')](_0x429885);if(!oauth[_0x4804('0x4e')](_0x5adb48[_0x4804('0x4f')],_0x360ee4[_0x4804('0x50')]))throw new Error(_0x4804('0x51'));redis['del'](_0x5adb48[_0x4804('0x48')]);return oauth[_0x4804('0x52')](_0x5adb48[_0x4804('0x53')],_0x360ee4);})[_0x4804('0x13')](function(_0x298fd9){_0x360ee4[_0x4804('0x54')]=_0x298fd9[_0x4804('0x55')];_0x360ee4[_0x4804('0x56')]=_0x298fd9[_0x4804('0x57')];return db[_0x4804('0x1d')][_0x4804('0x11')]({'data5':_0x360ee4[_0x4804('0x54')],'data6':_0x360ee4[_0x4804('0x56')]},{'where':{'id':_0x360ee4['id']}});})[_0x4804('0x13')](function(){oauth[_0x4804('0x58')](_0x360ee4);socket[_0x4804('0x59')](_0x4804('0x5a'),{'id':_0x39293f['id']});return;})[_0x4804('0x13')](respondWithStatusCode(_0x28b2ff,null))[_0x4804('0x3c')](function(_0x4009a8){if(_0x39293f){socket[_0x4804('0x59')](_0x4804('0x5b'),{'id':_0x39293f['id']});}if(!_0x360ee4){logger['error'](_0x4804('0x5c'),_0x4009a8);return _0x28b2ff[_0x4804('0x8')](0x1f4)[_0x4804('0x18')](_0x4009a8[_0x4804('0x5d')]);}logger[_0x4804('0x15')](_0x4804('0x5e'),_0x360ee4['id'],JSON['stringify'](_0x4009a8));});};
\ No newline at end of file
+var _0xa278=['base64','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','end','offset','limit','undefined','count','status','Content-Range','update','then','destroy','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','params','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','catch','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from'];(function(_0x2defb5,_0x1cda14){var _0x229c53=function(_0x5dd408){while(--_0x5dd408){_0x2defb5['push'](_0x2defb5['shift']());}};_0x229c53(++_0x1cda14);}(_0xa278,0x18b));var _0x8a27=function(_0x376db5,_0x2b8874){_0x376db5=_0x376db5-0x0;var _0x304c17=_0xa278[_0x376db5];return _0x304c17;};'use strict';var _=require(_0x8a27('0x0'));var Redis=require(_0x8a27('0x1'));var qs=require(_0x8a27('0x2'));var encryptor=require(_0x8a27('0x3'));var config=require(_0x8a27('0x4'));var logger=require(_0x8a27('0x5'))(_0x8a27('0x6'));var db=require(_0x8a27('0x7'))['db'];var oauth=require(_0x8a27('0x8'));config[_0x8a27('0x9')]=_['defaults'](config[_0x8a27('0x9')],{'host':_0x8a27('0xa'),'port':0x18eb});var socket=require(_0x8a27('0xb'))(new Redis(config[_0x8a27('0x9')]));var redis=new Redis(config[_0x8a27('0x9')]);function respondWithStatusCode(_0xd1fee8,_0x5963bc){_0x5963bc=_0x5963bc||0xcc;return function(_0x5a2b50){if(_0x5a2b50){return _0xd1fee8[_0x8a27('0xc')](_0x5963bc);}return _0xd1fee8['status'](_0x5963bc)[_0x8a27('0xd')]();};}function respondWithResult(_0x316a13,_0xdd8aa1){_0xdd8aa1=_0xdd8aa1||0xc8;return function(_0x58581b){if(_0x58581b){return _0x316a13['status'](_0xdd8aa1)['json'](_0x58581b);}};}function respondWithFilteredResult(_0x52ec82,_0x1cbd44){return function(_0x2a42df){if(_0x2a42df){var _0x2e7925=typeof _0x1cbd44[_0x8a27('0xe')]==='undefined'&&typeof _0x1cbd44[_0x8a27('0xf')]===_0x8a27('0x10');var _0x2f36cc=_0x2a42df[_0x8a27('0x11')];var _0x11a57d=_0x2e7925?0x0:_0x1cbd44[_0x8a27('0xe')];var _0x331acd=_0x2e7925?_0x2a42df[_0x8a27('0x11')]:_0x1cbd44['offset']+_0x1cbd44[_0x8a27('0xf')];var _0x2ffd96;if(_0x331acd>=_0x2f36cc){_0x331acd=_0x2f36cc;_0x2ffd96=0xc8;}else{_0x2ffd96=0xce;}_0x52ec82[_0x8a27('0x12')](_0x2ffd96);return _0x52ec82['set'](_0x8a27('0x13'),_0x11a57d+'-'+_0x331acd+'/'+_0x2f36cc)['json'](_0x2a42df);}return null;};}function saveUpdates(_0x2c44a7){return function(_0x4efd17){if(_0x4efd17){return _0x4efd17[_0x8a27('0x14')](_0x2c44a7)[_0x8a27('0x15')](function(_0x500e0c){return _0x500e0c;});}return null;};}function removeEntity(_0x22cca8){return function(_0x4ca7db){if(_0x4ca7db){return _0x4ca7db[_0x8a27('0x16')]()['then'](function(){_0x22cca8[_0x8a27('0x12')](0xcc)[_0x8a27('0xd')]();});}};}function handleEntityNotFound(_0x4c56c5){return function(_0x33d3f8){if(!_0x33d3f8){_0x4c56c5[_0x8a27('0xc')](0x194);}return _0x33d3f8;};}function handleError(_0x307a72,_0x47c77d){_0x47c77d=_0x47c77d||0x1f4;return function(_0xe7e108){logger[_0x8a27('0x17')](_0xe7e108['stack']);if(_0xe7e108[_0x8a27('0x18')]){delete _0xe7e108[_0x8a27('0x18')];}_0x307a72[_0x8a27('0x12')](_0x47c77d)[_0x8a27('0x19')](_0xe7e108);};}function maskClientSecret(_0x39f661){return _[_0x8a27('0x1a')](_0x39f661[_0x8a27('0x1b')](0x0,0x3),0x14,'*');}exports[_0x8a27('0x1c')]=function(_0x5228d1,_0x2299a6){var _0x4a88ef={},_0x11134a={},_0xba86db={'count':0x0,'rows':[]};var _0x219e43=_[_0x8a27('0x1d')](db[_0x8a27('0x1e')][_0x8a27('0x1f')],function(_0x5aeabd){return{'name':_0x5aeabd['fieldName'],'type':_0x5aeabd[_0x8a27('0x20')][_0x8a27('0x21')]};});_0x11134a[_0x8a27('0x22')]=_[_0x8a27('0x1d')](_0x219e43,'name');_0x11134a[_0x8a27('0x23')]=_[_0x8a27('0x24')](_0x5228d1[_0x8a27('0x23')]);_0x11134a[_0x8a27('0x25')]=_[_0x8a27('0x26')](_0x11134a['model'],_0x11134a[_0x8a27('0x23')]);_0x4a88ef['attributes']=_[_0x8a27('0x26')](_0x11134a[_0x8a27('0x22')],qs['fields'](_0x5228d1['query'][_0x8a27('0x27')]));_0x4a88ef[_0x8a27('0x28')]=_0x4a88ef['attributes'][_0x8a27('0x29')]?_0x4a88ef[_0x8a27('0x28')]:_0x11134a[_0x8a27('0x22')];if(!_0x5228d1[_0x8a27('0x23')][_0x8a27('0x2a')](_0x8a27('0x2b'))){_0x4a88ef[_0x8a27('0xf')]=qs['limit'](_0x5228d1[_0x8a27('0x23')]['limit']);_0x4a88ef['offset']=qs[_0x8a27('0xe')](_0x5228d1[_0x8a27('0x23')]['offset']);}_0x4a88ef['order']=qs['sort'](_0x5228d1[_0x8a27('0x23')]['sort']);_0x4a88ef[_0x8a27('0x2c')]=qs[_0x8a27('0x25')](_['pick'](_0x5228d1['query'],_0x11134a[_0x8a27('0x25')]),_0x219e43);if(_0x5228d1[_0x8a27('0x23')][_0x8a27('0x2d')]){_0x4a88ef[_0x8a27('0x2c')]=_['merge'](_0x4a88ef[_0x8a27('0x2c')],{'$or':_[_0x8a27('0x1d')](_0x219e43,function(_0x42d725){if(_0x42d725[_0x8a27('0x20')]!==_0x8a27('0x2e')){var _0x46e809={};_0x46e809[_0x42d725[_0x8a27('0x18')]]={'$like':'%'+_0x5228d1[_0x8a27('0x23')][_0x8a27('0x2d')]+'%'};return _0x46e809;}})});}_0x4a88ef=_[_0x8a27('0x2f')]({},_0x4a88ef,_0x5228d1[_0x8a27('0x30')]);var _0x262556={'where':_0x4a88ef['where']};return db['CloudProvider'][_0x8a27('0x11')](_0x262556)[_0x8a27('0x15')](function(_0x3c4dd4){_0xba86db[_0x8a27('0x11')]=_0x3c4dd4;if(_0x5228d1[_0x8a27('0x23')][_0x8a27('0x31')]){_0x4a88ef[_0x8a27('0x32')]=[{'all':!![]}];}return db['CloudProvider'][_0x8a27('0x33')](_0x4a88ef);})[_0x8a27('0x15')](function(_0x121d2c){_0xba86db[_0x8a27('0x34')]=_[_0x8a27('0x1d')](_0x121d2c,function(_0xa8c72d){if(_0xa8c72d[_0x8a27('0x35')]===_0x8a27('0x36')){var _0x4b43d2=encryptor[_0x8a27('0x37')](_0xa8c72d[_0x8a27('0x38')]);_0xa8c72d[_0x8a27('0x38')]=maskClientSecret(_0x4b43d2);}return _0xa8c72d;});return _0xba86db;})[_0x8a27('0x15')](respondWithFilteredResult(_0x2299a6,_0x4a88ef))['catch'](handleError(_0x2299a6,null));};exports[_0x8a27('0x39')]=function(_0x32f8fb,_0x238e62){var _0x2f640a={'raw':!![],'where':{'id':_0x32f8fb['params']['id']}},_0xba44b7={};_0xba44b7['model']=_[_0x8a27('0x24')](db['CloudProvider'][_0x8a27('0x1f')]);_0xba44b7[_0x8a27('0x23')]=_[_0x8a27('0x24')](_0x32f8fb['query']);_0xba44b7[_0x8a27('0x25')]=_[_0x8a27('0x26')](_0xba44b7[_0x8a27('0x22')],_0xba44b7[_0x8a27('0x23')]);_0x2f640a[_0x8a27('0x28')]=_[_0x8a27('0x26')](_0xba44b7[_0x8a27('0x22')],qs['fields'](_0x32f8fb[_0x8a27('0x23')][_0x8a27('0x27')]));_0x2f640a[_0x8a27('0x28')]=_0x2f640a['attributes'][_0x8a27('0x29')]?_0x2f640a[_0x8a27('0x28')]:_0xba44b7[_0x8a27('0x22')];if(_0x32f8fb['query']['includeAll']){_0x2f640a[_0x8a27('0x32')]=[{'all':!![]}];}_0x2f640a=_[_0x8a27('0x2f')]({},_0x2f640a,_0x32f8fb['options']);return db[_0x8a27('0x1e')][_0x8a27('0x3a')](_0x2f640a)[_0x8a27('0x15')](handleEntityNotFound(_0x238e62,null))['then'](function(_0x1b1dda){if(_0x1b1dda[_0x8a27('0x35')]===_0x8a27('0x36')){var _0x50f980=encryptor[_0x8a27('0x37')](_0x1b1dda[_0x8a27('0x38')]);_0x1b1dda['data3']=maskClientSecret(_0x50f980);}return _0x1b1dda;})[_0x8a27('0x15')](respondWithResult(_0x238e62,null))['catch'](handleError(_0x238e62,null));};exports[_0x8a27('0x3b')]=function(_0xe9c937,_0x3fd34a){if(!_0xe9c937[_0x8a27('0x3c')][_0x8a27('0x18')])throw new Error(_0x8a27('0x3d'));if(!_0xe9c937[_0x8a27('0x3c')]['service'])throw new Error(_0x8a27('0x3e'));var _0x497c7e=db['CloudProvider']['rawAttributes']['service']['values'];if(!_0x497c7e[_0x8a27('0x3f')](_0xe9c937['body']['service']))throw new Error(_0x8a27('0x40')+_0x497c7e['join'](',\x20'));if(_0xe9c937[_0x8a27('0x3c')][_0x8a27('0x35')]===_0x8a27('0x36')&&_0xe9c937[_0x8a27('0x3c')]['data3']){_0xe9c937[_0x8a27('0x3c')][_0x8a27('0x38')]=encryptor[_0x8a27('0x41')](_0xe9c937[_0x8a27('0x3c')][_0x8a27('0x38')]);}return db[_0x8a27('0x1e')][_0x8a27('0x3b')](_0xe9c937[_0x8a27('0x3c')],{})[_0x8a27('0x15')](respondWithResult(_0x3fd34a,0xc9))['catch'](handleError(_0x3fd34a,null));};exports[_0x8a27('0x14')]=function(_0x3631c0,_0x53f223){if(_0x3631c0[_0x8a27('0x3c')]['id']){delete _0x3631c0[_0x8a27('0x3c')]['id'];}return db[_0x8a27('0x1e')]['find']({'where':{'id':_0x3631c0[_0x8a27('0x42')]['id']}})['then'](handleEntityNotFound(_0x53f223,null))[_0x8a27('0x15')](function(_0x1832fa){if(_0x1832fa['service']===_0x8a27('0x36')&&_0x3631c0[_0x8a27('0x3c')]['data3']){_0x3631c0['body'][_0x8a27('0x38')]=encryptor['encryptString'](_0x3631c0[_0x8a27('0x3c')][_0x8a27('0x38')]);}return _0x1832fa;})[_0x8a27('0x15')](saveUpdates(_0x3631c0[_0x8a27('0x3c')],null))[_0x8a27('0x15')](respondWithResult(_0x53f223,null))['catch'](handleError(_0x53f223,null));};exports[_0x8a27('0x16')]=function(_0x4c74ae,_0x2c71c7){return db['CloudProvider']['find']({'where':{'id':_0x4c74ae[_0x8a27('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c71c7,null))[_0x8a27('0x15')](removeEntity(_0x2c71c7,null))['catch'](handleError(_0x2c71c7,null));};exports[_0x8a27('0x43')]=function(_0x530074,_0xb4a8d9){return db[_0x8a27('0x1e')]['findOne']({'where':{'id':_0x530074[_0x8a27('0x42')]['id']},'raw':!![]})[_0x8a27('0x15')](function(_0x4f7fa6){if(!_0x4f7fa6)return _0xb4a8d9[_0x8a27('0xc')](0x194);return{'url':oauth[_0x8a27('0x44')](_0x4f7fa6,_0x530074['user']['id'])};})[_0x8a27('0x15')](respondWithResult(_0xb4a8d9,null))[_0x8a27('0x45')](handleError(_0xb4a8d9,null));};exports[_0x8a27('0x46')]=function(_0x1d4a87,_0x35fa90){var _0x4bf3fc=_0x1d4a87[_0x8a27('0x3c')];var _0x4ff0fc;var _0x5f3e70;if(_0x4bf3fc[_0x8a27('0x17')])throw _0x4bf3fc;redis['get'](_0x4bf3fc[_0x8a27('0x47')])['then'](function(_0x2a5800){if(!_0x2a5800)throw new Error(_0x8a27('0x48'));_0x4ff0fc=JSON[_0x8a27('0x49')](_0x2a5800);var _0x5def25=Buffer[_0x8a27('0x4a')](_0x4bf3fc[_0x8a27('0x47')],_0x8a27('0x4b'))[_0x8a27('0x4c')](_0x8a27('0x4d'));_0x5f3e70=JSON[_0x8a27('0x49')](_0x5def25);if(!oauth['isValidIdToken'](_0x4bf3fc[_0x8a27('0x4e')],_0x4ff0fc[_0x8a27('0x4f')]))throw new Error(_0x8a27('0x50'));redis['del'](_0x4bf3fc[_0x8a27('0x47')]);return oauth[_0x8a27('0x51')](_0x4bf3fc[_0x8a27('0x52')],_0x4ff0fc);})[_0x8a27('0x15')](function(_0x533193){_0x4ff0fc['data5']=_0x533193[_0x8a27('0x53')];_0x4ff0fc[_0x8a27('0x54')]=_0x533193[_0x8a27('0x55')];return db[_0x8a27('0x1e')][_0x8a27('0x14')]({'data5':_0x4ff0fc[_0x8a27('0x56')],'data6':_0x4ff0fc[_0x8a27('0x54')]},{'where':{'id':_0x4ff0fc['id']}});})[_0x8a27('0x15')](function(){oauth['startRefreshInterval'](_0x4ff0fc);socket[_0x8a27('0x57')](_0x8a27('0x58'),{'id':_0x5f3e70['id']});return;})[_0x8a27('0x15')](respondWithStatusCode(_0x35fa90,null))[_0x8a27('0x45')](function(_0x3765aa){if(_0x5f3e70){socket[_0x8a27('0x57')](_0x8a27('0x59'),{'id':_0x5f3e70['id']});}if(!_0x4ff0fc){logger[_0x8a27('0x17')](_0x8a27('0x5a'),_0x3765aa);return _0x35fa90['status'](0x1f4)[_0x8a27('0x19')](_0x3765aa[_0x8a27('0x5b')]);}logger[_0x8a27('0x17')](_0x8a27('0x5c'),_0x4ff0fc['id'],JSON[_0x8a27('0x5d')](_0x3765aa));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index bb18aa0..2d6222c 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 _0xe420=['rimraf','define','CloudProvider','lodash','util','bluebird','request-promise'];(function(_0x698e7a,_0x1351bb){var _0x196a50=function(_0x28d790){while(--_0x28d790){_0x698e7a['push'](_0x698e7a['shift']());}};_0x196a50(++_0x1351bb);}(_0xe420,0x7a));var _0x0e42=function(_0x418ad6,_0x234284){_0x418ad6=_0x418ad6-0x0;var _0x9aa86f=_0xe420[_0x418ad6];return _0x9aa86f;};'use strict';var _=require(_0x0e42('0x0'));var util=require(_0x0e42('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0e42('0x2'));var rp=require(_0x0e42('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e42('0x4'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x1a16bf,_0x34ffe2){return _0x1a16bf[_0x0e42('0x5')](_0x0e42('0x6'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x31a5=['api','moment','request-promise','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','../../config/logger'];(function(_0x58f65e,_0x467d61){var _0x35684b=function(_0x17cafe){while(--_0x17cafe){_0x58f65e['push'](_0x58f65e['shift']());}};_0x35684b(++_0x467d61);}(_0x31a5,0xe9));var _0x531a=function(_0x418fd0,_0xf95890){_0x418fd0=_0x418fd0-0x0;var _0x1e569d=_0x31a5[_0x418fd0];return _0x1e569d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x531a('0x0'))(_0x531a('0x1'));var moment=require(_0x531a('0x2'));var BPromise=require('bluebird');var rp=require(_0x531a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x531a('0x4'));var config=require('../../config/environment');var attributes=require(_0x531a('0x5'));module[_0x531a('0x6')]=function(_0x4706d7,_0x373f0b){return _0x4706d7[_0x531a('0x7')](_0x531a('0x8'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 7dbb3e8..bb5ea4d 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 _0x0dbf=['unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','POST','update','catch','authorization_code','intervals','bind','findAll','all','error','exports','lodash','crypto','jsonwebtoken','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','openid','profile','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','push','data7','/.default','Outlook365','Dynamics365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','client_id','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','state','prompt','login','map','key','value','oauth2Claims','oauth2/','decode','payload','iss','issuer','aud','audience','nonce','isAfter'];(function(_0x1629c9,_0x484a8c){var _0x350a80=function(_0x2ddcb7){while(--_0x2ddcb7){_0x1629c9['push'](_0x1629c9['shift']());}};_0x350a80(++_0x484a8c);}(_0x0dbf,0x1a9));var _0xf0db=function(_0x367336,_0x18c229){_0x367336=_0x367336-0x0;var _0x3423a7=_0x0dbf[_0x367336];return _0x3423a7;};'use strict';var _=require(_0xf0db('0x0'));var crypto=require(_0xf0db('0x1'));var jwt=require(_0xf0db('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0xf0db('0x3'));var encryptor=require(_0xf0db('0x4'));var config=require(_0xf0db('0x5'));var logger=require('../../config/logger')(_0xf0db('0x6'));var schedule=require(_0xf0db('0x7'));var db=require(_0xf0db('0x8'))['db'];config[_0xf0db('0x9')]=_[_0xf0db('0xa')](config[_0xf0db('0x9')],{'host':_0xf0db('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xf0db('0xc'),_0xf0db('0xd'),'email',_0xf0db('0xe'),_0xf0db('0xf'),_0xf0db('0x10'),_0xf0db('0x11')],'Dynamics365':['openid',_0xf0db('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0xf0db('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xf0db('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3dfec7){var _0x1b257d=_['map'](AZURE_AUTH_SCOPES[_0x3dfec7[_0xf0db('0x14')]]);if(_0x3dfec7[_0xf0db('0x14')]==='Dynamics365')_0x1b257d[_0xf0db('0x15')](_0x3dfec7[_0xf0db('0x16')]+_0xf0db('0x17'));return _0x1b257d['join']('\x20');}function getAccessTokenScope(_0xc8f9e1){if(_0xc8f9e1['type']===_0xf0db('0x18'))return _0xf0db('0xf');if(_0xc8f9e1[_0xf0db('0x14')]===_0xf0db('0x19'))return _0xc8f9e1['data7']+_0xf0db('0x17');}function generateMicrosoftAuthorizationUrl(_0xa19108,_0x2fc126){var _0x4982fa=MICROSOFT_AUTH_URL[_0xf0db('0x1a')](_0xf0db('0x1b'),_0xa19108[_0xf0db('0x1c')]);var _0x3f3166=[_0xf0db('0x1d'),_0xf0db('0x1e')];var _0x5e9b78=Buffer[_0xf0db('0x1f')](JSON[_0xf0db('0x20')]({'id':_0x2fc126}))[_0xf0db('0x21')](_0xf0db('0x22'));var _0x21dbc3=crypto[_0xf0db('0x23')](0x10)[_0xf0db('0x21')]('hex');var _0x30f9a2=getAuthorizationScopes(_0xa19108);var _0x4213ee=[{'key':_0xf0db('0x24'),'value':_0xa19108[_0xf0db('0x25')]},{'key':_0xf0db('0x26'),'value':encodeURIComponent(_0x3f3166[_0xf0db('0x27')]('\x20'))},{'key':_0xf0db('0x28'),'value':_0xa19108[_0xf0db('0x29')]},{'key':_0xf0db('0x2a'),'value':_0xf0db('0x2b')},{'key':_0xf0db('0x2c'),'value':encodeURIComponent(_0x30f9a2)},{'key':_0xf0db('0x2d'),'value':_0x5e9b78},{'key':'nonce','value':_0x21dbc3},{'key':_0xf0db('0x2e'),'value':_0xf0db('0x2f')}];var _0x207408=_0x4982fa+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf0db('0x30')](_0x4213ee,function(_0x1cc976){return _0x1cc976[_0xf0db('0x31')]+'='+_0x1cc976[_0xf0db('0x32')];})['join']('&');_0xa19108[_0xf0db('0x33')]={'issuer':_0x4982fa['replace'](_0xf0db('0x34'),''),'audience':_0xa19108[_0xf0db('0x25')],'state':_0x5e9b78,'nonce':_0x21dbc3};redis['set'](_0x5e9b78,JSON[_0xf0db('0x20')](_0xa19108));return _0x207408;}function isValidIdToken(_0x18eac2,_0x4217d8){try{var _0x4dfcc4=jwt[_0xf0db('0x35')](_0x18eac2,{'complete':!![]});var _0x343fb8=_0x4dfcc4[_0xf0db('0x36')];if(_0x343fb8[_0xf0db('0x37')]!==_0x4217d8[_0xf0db('0x38')])return![];if(_0x343fb8[_0xf0db('0x39')]!==_0x4217d8[_0xf0db('0x3a')])return![];if(_0x343fb8[_0xf0db('0x3b')]!==_0x4217d8[_0xf0db('0x3b')])return![];if(moment()[_0xf0db('0x3c')](moment[_0xf0db('0x3d')](_0x343fb8[_0xf0db('0x3e')])))return![];return!![];}catch(_0x4dd201){throw _0x4dd201;}}function refreshOauth2MicrosoftAccessToken(_0x2ae2ef){return Promise[_0xf0db('0x3f')]()[_0xf0db('0x40')](function(){if(_0x2ae2ef['data3'])return _0x2ae2ef;return db[_0xf0db('0x41')][_0xf0db('0x42')]({'where':{'id':_0x2ae2ef['id']},'raw':!![]});})[_0xf0db('0x40')](function(_0x2e6f49){var _0x3115f8={'grant_type':_0xf0db('0x43'),'refresh_token':_0x2e6f49[_0xf0db('0x44')],'scope':getAccessTokenScope(_0x2e6f49),'redirect_uri':_0x2e6f49[_0xf0db('0x29')],'client_id':_0x2e6f49[_0xf0db('0x25')],'client_secret':encryptor[_0xf0db('0x45')](_0x2e6f49[_0xf0db('0x46')])};var _0x186c83={'method':_0xf0db('0x47'),'uri':MICROSOFT_AUTH_URL[_0xf0db('0x1a')](_0xf0db('0x1b'),_0x2e6f49[_0xf0db('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3115f8,'json':!![]};return rp(_0x186c83);})[_0xf0db('0x40')](function(_0x5ab100){_0x2ae2ef['data5']=_0x5ab100['access_token'];_0x2ae2ef[_0xf0db('0x44')]=_0x5ab100[_0xf0db('0x43')];return db[_0xf0db('0x41')][_0xf0db('0x48')]({'data5':_0x2ae2ef['data5'],'data6':_0x2ae2ef[_0xf0db('0x44')]},{'where':{'id':_0x2ae2ef['id']}});})[_0xf0db('0x40')](function(){return _0x2ae2ef;})[_0xf0db('0x49')](function(_0x36fd77){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x2ae2ef['id'],_0x36fd77);});}function getOauth2MicrosoftAccessToken(_0x3216db,_0x1a5070){var _0x4b6b26={'grant_type':_0xf0db('0x4a'),'code':_0x3216db,'scope':getAccessTokenScope(_0x1a5070),'redirect_uri':_0x1a5070['data4'],'client_id':_0x1a5070[_0xf0db('0x25')],'client_secret':encryptor[_0xf0db('0x45')](_0x1a5070[_0xf0db('0x46')])};var _0x1ee384={'method':_0xf0db('0x47'),'uri':MICROSOFT_AUTH_URL[_0xf0db('0x1a')](_0xf0db('0x1b'),_0x1a5070[_0xf0db('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4b6b26,'json':!![]};return rp(_0x1ee384);}function startRefreshInterval(_0x59ffb3){var _0x15dcc0=schedule[_0xf0db('0x4b')];if(_0x15dcc0[_0x59ffb3['id']])clearInterval(_0x15dcc0[_0x59ffb3['id']]);_0x15dcc0[_0x59ffb3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xf0db('0x4c')](this,{'id':_0x59ffb3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf0db('0x4b')]=_0x15dcc0;}function startAllRefreshIntervals(){return db[_0xf0db('0x41')][_0xf0db('0x4d')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x22f4b2){var _0x416c8b=_0x22f4b2[_0xf0db('0x30')](function(_0x35a11d){return refreshOauth2MicrosoftAccessToken(_0x35a11d)['then'](function(_0x3abb80){startRefreshInterval(_0x3abb80);});});return Promise[_0xf0db('0x4e')](_0x416c8b);})[_0xf0db('0x49')](function(_0xeeb2ce){var _0x359105=_0xeeb2ce?util['inspect'](_0xeeb2ce,{'showHidden':![],'depth':null}):'';logger[_0xf0db('0x4f')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x359105);});}module[_0xf0db('0x50')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xc82a=['data2','code','id_token','from','toString','randomBytes','client_id','response_mode','form_post','state','nonce','prompt','login','key','replace','oauth2/','set','stringify','decode','payload','issuer','aud','audience','isAfter','unix','exp','resolve','then','CloudProvider','refresh_token','data6','data4','data1','decryptString','data3','POST','data5','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','inspect','error','exports','lodash','jsonwebtoken','ioredis','request-promise','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/token','map','type','Dynamics365','push','data7','join','Outlook365','/.default','{TENANT_ID}'];(function(_0x33a974,_0x24ae0d){var _0x315850=function(_0x1aa4b8){while(--_0x1aa4b8){_0x33a974['push'](_0x33a974['shift']());}};_0x315850(++_0x24ae0d);}(_0xc82a,0x15c));var _0xac82=function(_0x318807,_0x51678f){_0x318807=_0x318807-0x0;var _0x33ea7e=_0xc82a[_0x318807];return _0x33ea7e;};'use strict';var _=require(_0xac82('0x0'));var crypto=require('crypto');var jwt=require(_0xac82('0x1'));var moment=require('moment');var Redis=require(_0xac82('0x2'));var rp=require(_0xac82('0x3'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0xac82('0x4'));var logger=require(_0xac82('0x5'))(_0xac82('0x6'));var schedule=require(_0xac82('0x7'));var db=require(_0xac82('0x8'))['db'];config[_0xac82('0x9')]=_[_0xac82('0xa')](config[_0xac82('0x9')],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xac82('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xac82('0xc'),_0xac82('0xd'),'email',_0xac82('0xe'),_0xac82('0xf'),_0xac82('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xac82('0xc'),_0xac82('0xe')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xac82('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5d2b17){var _0x30e9a8=_[_0xac82('0x12')](AZURE_AUTH_SCOPES[_0x5d2b17[_0xac82('0x13')]]);if(_0x5d2b17[_0xac82('0x13')]===_0xac82('0x14'))_0x30e9a8[_0xac82('0x15')](_0x5d2b17[_0xac82('0x16')]+'/.default');return _0x30e9a8[_0xac82('0x17')]('\x20');}function getAccessTokenScope(_0x543b62){if(_0x543b62[_0xac82('0x13')]===_0xac82('0x18'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x543b62['type']===_0xac82('0x14'))return _0x543b62[_0xac82('0x16')]+_0xac82('0x19');}function generateMicrosoftAuthorizationUrl(_0xb5967d,_0x4faabf){var _0x544226=MICROSOFT_AUTH_URL['replace'](_0xac82('0x1a'),_0xb5967d[_0xac82('0x1b')]);var _0x4f4a14=[_0xac82('0x1c'),_0xac82('0x1d')];var _0x4a6961=Buffer[_0xac82('0x1e')](JSON['stringify']({'id':_0x4faabf}))[_0xac82('0x1f')]('base64');var _0x1d438b=crypto[_0xac82('0x20')](0x10)[_0xac82('0x1f')]('hex');var _0x4b71df=getAuthorizationScopes(_0xb5967d);var _0x32f989=[{'key':_0xac82('0x21'),'value':_0xb5967d['data1']},{'key':'response_type','value':encodeURIComponent(_0x4f4a14[_0xac82('0x17')]('\x20'))},{'key':'redirect_uri','value':_0xb5967d['data4']},{'key':_0xac82('0x22'),'value':_0xac82('0x23')},{'key':'scope','value':encodeURIComponent(_0x4b71df)},{'key':_0xac82('0x24'),'value':_0x4a6961},{'key':_0xac82('0x25'),'value':_0x1d438b},{'key':_0xac82('0x26'),'value':_0xac82('0x27')}];var _0x30d932=_0x544226+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xac82('0x12')](_0x32f989,function(_0x1b2f1f){return _0x1b2f1f[_0xac82('0x28')]+'='+_0x1b2f1f['value'];})['join']('&');_0xb5967d['oauth2Claims']={'issuer':_0x544226[_0xac82('0x29')](_0xac82('0x2a'),''),'audience':_0xb5967d['data1'],'state':_0x4a6961,'nonce':_0x1d438b};redis[_0xac82('0x2b')](_0x4a6961,JSON[_0xac82('0x2c')](_0xb5967d));return _0x30d932;}function isValidIdToken(_0x26878e,_0x31715b){try{var _0x155dba=jwt[_0xac82('0x2d')](_0x26878e,{'complete':!![]});var _0x1f100c=_0x155dba[_0xac82('0x2e')];if(_0x1f100c['iss']!==_0x31715b[_0xac82('0x2f')])return![];if(_0x1f100c[_0xac82('0x30')]!==_0x31715b[_0xac82('0x31')])return![];if(_0x1f100c['nonce']!==_0x31715b[_0xac82('0x25')])return![];if(moment()[_0xac82('0x32')](moment[_0xac82('0x33')](_0x1f100c[_0xac82('0x34')])))return![];return!![];}catch(_0x4c6c4f){throw _0x4c6c4f;}}function refreshOauth2MicrosoftAccessToken(_0x2c348f){return Promise[_0xac82('0x35')]()[_0xac82('0x36')](function(){if(_0x2c348f['data3'])return _0x2c348f;return db[_0xac82('0x37')]['findOne']({'where':{'id':_0x2c348f['id']},'raw':!![]});})[_0xac82('0x36')](function(_0x44e787){var _0x243c84={'grant_type':_0xac82('0x38'),'refresh_token':_0x44e787[_0xac82('0x39')],'scope':getAccessTokenScope(_0x44e787),'redirect_uri':_0x44e787[_0xac82('0x3a')],'client_id':_0x44e787[_0xac82('0x3b')],'client_secret':encryptor[_0xac82('0x3c')](_0x44e787[_0xac82('0x3d')])};var _0x3c76ff={'method':_0xac82('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xac82('0x29')](_0xac82('0x1a'),_0x44e787['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x243c84,'json':!![]};return rp(_0x3c76ff);})[_0xac82('0x36')](function(_0xe55ad5){_0x2c348f[_0xac82('0x3f')]=_0xe55ad5['access_token'];_0x2c348f['data6']=_0xe55ad5[_0xac82('0x38')];return db[_0xac82('0x37')][_0xac82('0x40')]({'data5':_0x2c348f[_0xac82('0x3f')],'data6':_0x2c348f[_0xac82('0x39')]},{'where':{'id':_0x2c348f['id']}});})[_0xac82('0x36')](function(){return _0x2c348f;})[_0xac82('0x41')](function(_0x50455d){logger['error'](_0xac82('0x42'),_0x2c348f['id'],_0x50455d);});}function getOauth2MicrosoftAccessToken(_0x6399a1,_0x3a21e4){var _0x14e9cb={'grant_type':_0xac82('0x43'),'code':_0x6399a1,'scope':getAccessTokenScope(_0x3a21e4),'redirect_uri':_0x3a21e4[_0xac82('0x3a')],'client_id':_0x3a21e4[_0xac82('0x3b')],'client_secret':encryptor[_0xac82('0x3c')](_0x3a21e4[_0xac82('0x3d')])};var _0x53e23b={'method':_0xac82('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xac82('0x29')](_0xac82('0x1a'),_0x3a21e4[_0xac82('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x14e9cb,'json':!![]};return rp(_0x53e23b);}function startRefreshInterval(_0x58a3e0){var _0x3b744a=schedule[_0xac82('0x44')];if(_0x3b744a[_0x58a3e0['id']])clearInterval(_0x3b744a[_0x58a3e0['id']]);_0x3b744a[_0x58a3e0['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xac82('0x45')](this,{'id':_0x58a3e0['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xac82('0x44')]=_0x3b744a;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xac82('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x14d945){var _0x20b0f5=_0x14d945[_0xac82('0x12')](function(_0x26b4bf){return refreshOauth2MicrosoftAccessToken(_0x26b4bf)['then'](function(_0x2236a3){startRefreshInterval(_0x2236a3);});});return Promise[_0xac82('0x47')](_0x20b0f5);})[_0xac82('0x41')](function(_0x1caf6a){var _0x1d3b87=_0x1caf6a?util[_0xac82('0x48')](_0x1caf6a,{'showHidden':![],'depth':null}):'';logger[_0xac82('0x49')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x1d3b87);});}module[_0xac82('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 37f0dcc..d46a790 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 _0x3fce=['info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then'];(function(_0x4d3a1a,_0x42a3cf){var _0x1e85ca=function(_0x3b27d3){while(--_0x3b27d3){_0x4d3a1a['push'](_0x4d3a1a['shift']());}};_0x1e85ca(++_0x42a3cf);}(_0x3fce,0x121));var _0xe3fc=function(_0x272d8a,_0x45184b){_0x272d8a=_0x272d8a-0x0;var _0x26286e=_0x3fce[_0x272d8a];return _0x26286e;};'use strict';var _=require('lodash');var util=require(_0xe3fc('0x0'));var moment=require(_0xe3fc('0x1'));var BPromise=require(_0xe3fc('0x2'));var rs=require(_0xe3fc('0x3'));var fs=require('fs');var Redis=require(_0xe3fc('0x4'));var db=require(_0xe3fc('0x5'))['db'];var utils=require(_0xe3fc('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe3fc('0x7')][_0xe3fc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x523982,_0x200715,_0x49c611){return new BPromise(function(_0x40660f,_0x4a192d){return client[_0xe3fc('0x9')](_0x523982,_0x49c611)[_0xe3fc('0xa')](function(_0x1bb7be){logger[_0xe3fc('0xb')](_0xe3fc('0xc'),_0x200715,'request\x20sent');logger['debug'](_0xe3fc('0xd'),_0x200715,_0xe3fc('0xe'),JSON[_0xe3fc('0xf')](_0x1bb7be));if(_0x1bb7be['error']){if(_0x1bb7be[_0xe3fc('0x10')][_0xe3fc('0x11')]===0x1f4){logger[_0xe3fc('0x10')](_0xe3fc('0xc'),_0x200715,_0x1bb7be[_0xe3fc('0x10')][_0xe3fc('0x12')]);return _0x4a192d(_0x1bb7be[_0xe3fc('0x10')]['message']);}logger[_0xe3fc('0x10')](_0xe3fc('0xc'),_0x200715,_0x1bb7be['error'][_0xe3fc('0x12')]);return _0x40660f(_0x1bb7be[_0xe3fc('0x10')]['message']);}else{logger[_0xe3fc('0xb')](_0xe3fc('0xc'),_0x200715,'request\x20sent');_0x40660f(_0x1bb7be['result']['message']);}})[_0xe3fc('0x13')](function(_0x4283be){logger[_0xe3fc('0x10')]('CloudProvider,\x20%s,\x20%s',_0x200715,_0x4283be);_0x4a192d(_0x4283be);});});}
\ No newline at end of file
+var _0x4213=['CloudProvider,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5b8bec,_0x57d320){var _0x44b227=function(_0x26fb73){while(--_0x26fb73){_0x5b8bec['push'](_0x5b8bec['shift']());}};_0x44b227(++_0x57d320);}(_0x4213,0x77));var _0x3421=function(_0x573d7a,_0x2b01ac){_0x573d7a=_0x573d7a-0x0;var _0x4b10f6=_0x4213[_0x573d7a];return _0x4b10f6;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var moment=require(_0x3421('0x2'));var BPromise=require(_0x3421('0x3'));var rs=require(_0x3421('0x4'));var fs=require('fs');var Redis=require(_0x3421('0x5'));var db=require(_0x3421('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3421('0x7'))('rpc');var config=require(_0x3421('0x8'));var jayson=require(_0x3421('0x9'));var client=jayson[_0x3421('0xa')][_0x3421('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5469d8,_0x50e464,_0x1b152f){return new BPromise(function(_0x130625,_0x1cf6a0){return client[_0x3421('0xc')](_0x5469d8,_0x1b152f)['then'](function(_0x1f20cf){logger['info']('CloudProvider,\x20%s,\x20%s',_0x50e464,_0x3421('0xd'));logger['debug'](_0x3421('0xe'),_0x50e464,_0x3421('0xd'),JSON[_0x3421('0xf')](_0x1f20cf));if(_0x1f20cf[_0x3421('0x10')]){if(_0x1f20cf[_0x3421('0x10')][_0x3421('0x11')]===0x1f4){logger[_0x3421('0x10')]('CloudProvider,\x20%s,\x20%s',_0x50e464,_0x1f20cf[_0x3421('0x10')][_0x3421('0x12')]);return _0x1cf6a0(_0x1f20cf[_0x3421('0x10')][_0x3421('0x12')]);}logger[_0x3421('0x10')](_0x3421('0x13'),_0x50e464,_0x1f20cf[_0x3421('0x10')]['message']);return _0x130625(_0x1f20cf[_0x3421('0x10')]['message']);}else{logger[_0x3421('0x14')](_0x3421('0x13'),_0x50e464,'request\x20sent');_0x130625(_0x1f20cf[_0x3421('0x15')]['message']);}})[_0x3421('0x16')](function(_0x23694b){logger['error'](_0x3421('0x13'),_0x50e464,_0x23694b);_0x1cf6a0(_0x23694b);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 1d1de86..f856dd0 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x47ec04,_0x21b19e){var _0x3d48d2=function(_0x2ff0c2){while(--_0x2ff0c2){_0x47ec04['push'](_0x47ec04['shift']());}};_0x3d48d2(++_0x21b19e);}(_0xdb28,0x106));var _0x8db2=function(_0x1d3c48,_0x116b13){_0x1d3c48=_0x1d3c48-0x0;var _0xf9c7a4=_0xdb28[_0x1d3c48];return _0xf9c7a4;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x1261,0x144));var _0x1126=function(_0x2e3545,_0x20a6ec){_0x2e3545=_0x2e3545-0x0;var _0xcf18f=_0x1261[_0x2e3545];return _0xcf18f;};'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
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 396d2f3..025964a 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 _0xd289=['exports','name','STRING'];(function(_0x19de15,_0x566051){var _0x5d6edf=function(_0x327dba){while(--_0x327dba){_0x19de15['push'](_0x19de15['shift']());}};_0x5d6edf(++_0x566051);}(_0xd289,0xf6));var _0x9d28=function(_0x4b5813,_0x5769de){_0x4b5813=_0x4b5813-0x0;var _0x423465=_0xd289[_0x4b5813];return _0x423465;};'use strict';var Sequelize=require('sequelize');module[_0x9d28('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x9d28('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9d28('0x2')]},'companyId':{'type':Sequelize[_0x9d28('0x2')]},'website':{'type':Sequelize[_0x9d28('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x9d28('0x2')]},'postalCode':{'type':Sequelize[_0x9d28('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9d28('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9d28('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x9d28('0x2')]},'sCity':{'type':Sequelize[_0x9d28('0x2')]},'sCountry':{'type':Sequelize[_0x9d28('0x2')]},'description':{'type':Sequelize[_0x9d28('0x2')]}};
\ No newline at end of file
+var _0xbd19=['sequelize','exports','STRING'];(function(_0x317497,_0x2d6cf7){var _0x3445b0=function(_0x22fe4d){while(--_0x22fe4d){_0x317497['push'](_0x317497['shift']());}};_0x3445b0(++_0x2d6cf7);}(_0xbd19,0x9c));var _0x9bd1=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xbd19[_0x35da42];return _0x370035;};'use strict';var Sequelize=require(_0x9bd1('0x0'));module[_0x9bd1('0x1')]={'name':{'type':Sequelize[_0x9bd1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9bd1('0x2')]},'companyId':{'type':Sequelize[_0x9bd1('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x9bd1('0x2')]},'type':{'type':Sequelize[_0x9bd1('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x9bd1('0x2')]},'country':{'type':Sequelize[_0x9bd1('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9bd1('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x9bd1('0x2')]},'sCity':{'type':Sequelize[_0x9bd1('0x2')]},'sCountry':{'type':Sequelize[_0x9bd1('0x2')]},'description':{'type':Sequelize[_0x9bd1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index a3f7874..2ac5900 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 _0x7b11=['../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','end','name','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CmCompany','includeAll','findAll','rows','catch','show','params','include','find','create','get','role','user','Companies','UserProfileSection','autoAssociation','error','body','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','map','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3575ae,_0x6cb4b3){var _0x437e3c=function(_0xc74cca){while(--_0xc74cca){_0x3575ae['push'](_0x3575ae['shift']());}};_0x437e3c(++_0x6cb4b3);}(_0x7b11,0x13a));var _0x17b1=function(_0x106664,_0x26af02){_0x106664=_0x106664-0x0;var _0x4dd09a=_0x7b11[_0x106664];return _0x4dd09a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x17b1('0x0'));var zipdir=require(_0x17b1('0x1'));var jsonpatch=require(_0x17b1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x17b1('0x3'));var Mustache=require(_0x17b1('0x4'));var util=require(_0x17b1('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x17b1('0x6'));var fs=require('fs');var fs_extra=require(_0x17b1('0x7'));var _=require(_0x17b1('0x8'));var squel=require(_0x17b1('0x9'));var crypto=require('crypto');var jsforce=require(_0x17b1('0xa'));var deskjs=require(_0x17b1('0xb'));var toCsv=require(_0x17b1('0xc'));var querystring=require('querystring');var Papa=require(_0x17b1('0xd'));var Redis=require('ioredis');var authService=require(_0x17b1('0xe'));var qs=require(_0x17b1('0xf'));var as=require(_0x17b1('0x10'));var hardwareService=require(_0x17b1('0x11'));var logger=require(_0x17b1('0x12'))(_0x17b1('0x13'));var utils=require(_0x17b1('0x14'));var config=require(_0x17b1('0x15'));var licenseUtil=require(_0x17b1('0x16'));var db=require(_0x17b1('0x17'))['db'];function respondWithStatusCode(_0x5346ec,_0x30bba9){_0x30bba9=_0x30bba9||0xcc;return function(_0x556809){if(_0x556809){return _0x5346ec[_0x17b1('0x18')](_0x30bba9);}return _0x5346ec[_0x17b1('0x19')](_0x30bba9)['end']();};}function respondWithResult(_0x3ce50b,_0xaf30b9){_0xaf30b9=_0xaf30b9||0xc8;return function(_0xf060e8){if(_0xf060e8){return _0x3ce50b[_0x17b1('0x19')](_0xaf30b9)['json'](_0xf060e8);}};}function respondWithFilteredResult(_0x2a5d6f,_0x4c02b9){return function(_0x2de642){if(_0x2de642){var _0x4ed670=typeof _0x4c02b9[_0x17b1('0x1a')]===_0x17b1('0x1b')&&typeof _0x4c02b9[_0x17b1('0x1c')]==='undefined';var _0x1615f3=_0x2de642[_0x17b1('0x1d')];var _0x537e2f=_0x4ed670?0x0:_0x4c02b9[_0x17b1('0x1a')];var _0x4f3c49=_0x4ed670?_0x2de642[_0x17b1('0x1d')]:_0x4c02b9[_0x17b1('0x1a')]+_0x4c02b9['limit'];var _0x5f092a;if(_0x4f3c49>=_0x1615f3){_0x4f3c49=_0x1615f3;_0x5f092a=0xc8;}else{_0x5f092a=0xce;}_0x2a5d6f[_0x17b1('0x19')](_0x5f092a);return _0x2a5d6f[_0x17b1('0x1e')](_0x17b1('0x1f'),_0x537e2f+'-'+_0x4f3c49+'/'+_0x1615f3)[_0x17b1('0x20')](_0x2de642);}return null;};}function patchUpdates(_0x513df6){return function(_0x55a3f1){try{jsonpatch[_0x17b1('0x21')](_0x55a3f1,_0x513df6,!![]);}catch(_0x22afb8){return BPromise['reject'](_0x22afb8);}return _0x55a3f1['save']();};}function saveUpdates(_0x5b4742,_0x589490){return function(_0x476d35){if(_0x476d35){return _0x476d35[_0x17b1('0x22')](_0x5b4742)[_0x17b1('0x23')](function(_0x100384){return _0x100384;});}return null;};}function removeEntity(_0x2db1e7,_0x11cc6b){return function(_0x2e71b8){if(_0x2e71b8){return _0x2e71b8[_0x17b1('0x24')]()[_0x17b1('0x23')](function(){var _0x52a74c=_0x2e71b8['get']({'plain':!![]});var _0x51b7fe='Companies';return db['UserProfileResource'][_0x17b1('0x24')]({'where':{'type':_0x51b7fe,'resourceId':_0x52a74c['id']}})[_0x17b1('0x23')](function(){return _0x2e71b8;});})['then'](function(){_0x2db1e7['status'](0xcc)[_0x17b1('0x25')]();});}};}function handleEntityNotFound(_0x309fa8,_0x2e85a9){return function(_0x276a4e){if(!_0x276a4e){_0x309fa8[_0x17b1('0x18')](0x194);}return _0x276a4e;};}function handleError(_0xeb8975,_0x54c90c){_0x54c90c=_0x54c90c||0x1f4;return function(_0x48bf8f){logger['error'](_0x48bf8f['stack']);if(_0x48bf8f[_0x17b1('0x26')]){delete _0x48bf8f['name'];}_0xeb8975[_0x17b1('0x19')](_0x54c90c)['send'](_0x48bf8f);};}exports[_0x17b1('0x27')]=function(_0x5a46d9,_0x27fdf0){var _0xd484ae={},_0x2bbbe9={},_0x243950={'count':0x0,'rows':[]};return db['CmCompany'][_0x17b1('0x28')]()['then'](function(_0x281d7c){_0x2bbbe9[_0x17b1('0x29')]=_[_0x17b1('0x2a')](_0x281d7c);_0x2bbbe9['query']=_['keys'](_0x5a46d9[_0x17b1('0x2b')]);_0x2bbbe9[_0x17b1('0x2c')]=_[_0x17b1('0x2d')](_0x2bbbe9[_0x17b1('0x29')],_0x2bbbe9[_0x17b1('0x2b')]);_0xd484ae[_0x17b1('0x2e')]=_['intersection'](_0x2bbbe9[_0x17b1('0x29')],qs[_0x17b1('0x2f')](_0x5a46d9[_0x17b1('0x2b')][_0x17b1('0x2f')]));_0xd484ae[_0x17b1('0x2e')]=_0xd484ae['attributes'][_0x17b1('0x30')]?_0xd484ae['attributes']:_0x2bbbe9[_0x17b1('0x29')];if(!_0x5a46d9['query'][_0x17b1('0x31')](_0x17b1('0x32'))){_0xd484ae[_0x17b1('0x1c')]=qs[_0x17b1('0x1c')](_0x5a46d9['query'][_0x17b1('0x1c')]);_0xd484ae[_0x17b1('0x1a')]=qs[_0x17b1('0x1a')](_0x5a46d9['query']['offset']);}_0xd484ae[_0x17b1('0x33')]=qs[_0x17b1('0x34')](_0x5a46d9[_0x17b1('0x2b')][_0x17b1('0x34')]);_0xd484ae[_0x17b1('0x35')]=qs[_0x17b1('0x2c')](_[_0x17b1('0x36')](_0x5a46d9[_0x17b1('0x2b')],_0x2bbbe9[_0x17b1('0x2c')]),_0x281d7c);if(_0x5a46d9[_0x17b1('0x2b')][_0x17b1('0x37')]){_0xd484ae[_0x17b1('0x35')]=_[_0x17b1('0x38')](_0xd484ae['where'],{'$or':_['map'](_0xd484ae['attributes'],function(_0x2d530b){var _0x4cb957={};_0x4cb957[_0x2d530b]={'$like':'%'+_0x5a46d9[_0x17b1('0x2b')]['filter']+'%'};return _0x4cb957;})});}_0xd484ae=_[_0x17b1('0x38')]({},_0xd484ae,_0x5a46d9[_0x17b1('0x39')]);var _0x493ce7={'where':_0xd484ae[_0x17b1('0x35')]};return db[_0x17b1('0x3a')][_0x17b1('0x1d')](_0x493ce7)[_0x17b1('0x23')](function(_0x360a55){_0x243950['count']=_0x360a55;if(_0x5a46d9[_0x17b1('0x2b')][_0x17b1('0x3b')]){_0xd484ae['include']=[{'all':!![]}];}return db['CmCompany'][_0x17b1('0x3c')](_0xd484ae);})[_0x17b1('0x23')](function(_0x28765d){_0x243950[_0x17b1('0x3d')]=_0x28765d;return _0x243950;})['then'](respondWithFilteredResult(_0x27fdf0,_0xd484ae))[_0x17b1('0x3e')](handleError(_0x27fdf0,null));})['catch'](handleError(_0x27fdf0,null));};exports[_0x17b1('0x3f')]=function(_0x1b7dac,_0x14e120){var _0x88eb52={'raw':![],'where':{'id':_0x1b7dac[_0x17b1('0x40')]['id']}},_0x360917={};_0x360917['model']=_[_0x17b1('0x2a')](db[_0x17b1('0x3a')]['rawAttributes']);_0x360917[_0x17b1('0x2b')]=_[_0x17b1('0x2a')](_0x1b7dac[_0x17b1('0x2b')]);_0x360917[_0x17b1('0x2c')]=_['intersection'](_0x360917['model'],_0x360917[_0x17b1('0x2b')]);_0x88eb52[_0x17b1('0x2e')]=_[_0x17b1('0x2d')](_0x360917[_0x17b1('0x29')],qs[_0x17b1('0x2f')](_0x1b7dac[_0x17b1('0x2b')][_0x17b1('0x2f')]));_0x88eb52['attributes']=_0x88eb52[_0x17b1('0x2e')][_0x17b1('0x30')]?_0x88eb52[_0x17b1('0x2e')]:_0x360917[_0x17b1('0x29')];if(_0x1b7dac[_0x17b1('0x2b')][_0x17b1('0x3b')]){_0x88eb52[_0x17b1('0x41')]=[{'all':!![]}];}_0x88eb52=_[_0x17b1('0x38')]({},_0x88eb52,_0x1b7dac[_0x17b1('0x39')]);return db['CmCompany'][_0x17b1('0x42')](_0x88eb52)[_0x17b1('0x23')](handleEntityNotFound(_0x14e120,null))[_0x17b1('0x23')](respondWithResult(_0x14e120,null))['catch'](handleError(_0x14e120,null));};exports[_0x17b1('0x43')]=function(_0x973b6a,_0x174438){return db[_0x17b1('0x3a')][_0x17b1('0x43')](_0x973b6a['body'],{})[_0x17b1('0x23')](function(_0x2af846){var _0x503c24=_0x973b6a['user'][_0x17b1('0x44')]({'plain':!![]});if(!_0x503c24)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x503c24[_0x17b1('0x45')]===_0x17b1('0x46')){var _0x5e5f3c=_0x2af846[_0x17b1('0x44')]({'plain':!![]});var _0x5c5d38=_0x17b1('0x47');return db[_0x17b1('0x48')][_0x17b1('0x42')]({'where':{'name':_0x5c5d38,'userProfileId':_0x503c24['userProfileId']},'raw':!![]})['then'](function(_0x5c0118){if(_0x5c0118&&_0x5c0118[_0x17b1('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x5e5f3c[_0x17b1('0x26')],'resourceId':_0x5e5f3c['id'],'type':_0x5c0118['name'],'sectionId':_0x5c0118['id']},{})[_0x17b1('0x23')](function(){return _0x2af846;});}else{return _0x2af846;}})[_0x17b1('0x3e')](function(_0x1dfedf){logger[_0x17b1('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1dfedf);throw _0x1dfedf;});}return _0x2af846;})['then'](respondWithResult(_0x174438,0xc9))[_0x17b1('0x3e')](handleError(_0x174438,null));};exports[_0x17b1('0x22')]=function(_0x133ead,_0x38630b){if(_0x133ead['body']['id']){delete _0x133ead[_0x17b1('0x4b')]['id'];}return db[_0x17b1('0x3a')]['find']({'where':{'id':_0x133ead[_0x17b1('0x40')]['id']}})[_0x17b1('0x23')](handleEntityNotFound(_0x38630b,null))[_0x17b1('0x23')](saveUpdates(_0x133ead['body'],null))[_0x17b1('0x23')](respondWithResult(_0x38630b,null))['catch'](handleError(_0x38630b,null));};exports[_0x17b1('0x24')]=function(_0xc2996e,_0x606a99){return db[_0x17b1('0x3a')][_0x17b1('0x42')]({'where':{'id':_0xc2996e[_0x17b1('0x40')]['id']}})['then'](handleEntityNotFound(_0x606a99,null))[_0x17b1('0x23')](removeEntity(_0x606a99,null))[_0x17b1('0x3e')](handleError(_0x606a99,null));};exports[_0x17b1('0x28')]=function(_0xf654e8,_0x378685){return db[_0x17b1('0x3a')]['describe']()['then'](respondWithResult(_0x378685,null))[_0x17b1('0x3e')](handleError(_0x378685,null));};exports[_0x17b1('0x4c')]=function(_0x58634b,_0x3acb32,_0x1a3b29){return db[_0x17b1('0x4d')][_0x17b1('0x42')]({'where':{'id':_0x58634b[_0x17b1('0x40')]['id']}})[_0x17b1('0x23')](handleEntityNotFound(_0x3acb32,null))[_0x17b1('0x23')](function(_0x42b76b){if(_0x42b76b){return _0x42b76b['addContacts'](_0x58634b[_0x17b1('0x4b')][_0x17b1('0x4e')],_[_0x17b1('0x4f')](_0x58634b[_0x17b1('0x4b')],[_0x17b1('0x4e'),'id'])||{});}})[_0x17b1('0x23')](respondWithResult(_0x3acb32,null))[_0x17b1('0x3e')](handleError(_0x3acb32,null));};exports[_0x17b1('0x50')]=function(_0x4a0e4b,_0x7be9a3,_0x17a4b4){var _0x54cf34={};var _0x5daf1f={};var _0x47db3f;var _0x18d641;return db[_0x17b1('0x3a')][_0x17b1('0x51')]({'where':{'id':_0x4a0e4b[_0x17b1('0x40')]['id']}})['then'](handleEntityNotFound(_0x7be9a3,null))[_0x17b1('0x23')](function(_0x414c53){if(_0x414c53){_0x47db3f=_0x414c53;_0x5daf1f[_0x17b1('0x29')]=_[_0x17b1('0x2a')](db[_0x17b1('0x4d')][_0x17b1('0x52')]);_0x5daf1f[_0x17b1('0x2b')]=_['keys'](_0x4a0e4b[_0x17b1('0x2b')]);_0x5daf1f[_0x17b1('0x2c')]=_['intersection'](_0x5daf1f[_0x17b1('0x29')],_0x5daf1f[_0x17b1('0x2b')]);_0x54cf34[_0x17b1('0x2e')]=_[_0x17b1('0x2d')](_0x5daf1f['model'],qs['fields'](_0x4a0e4b[_0x17b1('0x2b')][_0x17b1('0x2f')]));_0x54cf34[_0x17b1('0x2e')]=_0x54cf34[_0x17b1('0x2e')][_0x17b1('0x30')]?_0x54cf34[_0x17b1('0x2e')]:_0x5daf1f['model'];_0x54cf34[_0x17b1('0x33')]=qs[_0x17b1('0x34')](_0x4a0e4b[_0x17b1('0x2b')][_0x17b1('0x34')]);_0x54cf34[_0x17b1('0x35')]=qs[_0x17b1('0x2c')](_['pick'](_0x4a0e4b[_0x17b1('0x2b')],_0x5daf1f['filters']));if(_0x4a0e4b[_0x17b1('0x2b')][_0x17b1('0x37')]){_0x54cf34[_0x17b1('0x35')]=_[_0x17b1('0x38')](_0x54cf34[_0x17b1('0x35')],{'$or':_[_0x17b1('0x53')](_0x54cf34[_0x17b1('0x2e')],function(_0x5a48db){var _0x35e16d={};_0x35e16d[_0x5a48db]={'$like':'%'+_0x4a0e4b[_0x17b1('0x2b')][_0x17b1('0x37')]+'%'};return _0x35e16d;})});}_0x54cf34=_[_0x17b1('0x38')]({},_0x54cf34,_0x4a0e4b[_0x17b1('0x39')]);return _0x47db3f[_0x17b1('0x50')](_0x54cf34);}})[_0x17b1('0x23')](function(_0xfdffe3){if(_0xfdffe3){_0x18d641=_0xfdffe3['length'];if(!_0x4a0e4b['query'][_0x17b1('0x31')](_0x17b1('0x32'))){_0x54cf34[_0x17b1('0x1c')]=qs[_0x17b1('0x1c')](_0x4a0e4b[_0x17b1('0x2b')][_0x17b1('0x1c')]);_0x54cf34[_0x17b1('0x1a')]=qs[_0x17b1('0x1a')](_0x4a0e4b[_0x17b1('0x2b')][_0x17b1('0x1a')]);}return _0x47db3f[_0x17b1('0x50')](_0x54cf34);}})[_0x17b1('0x23')](function(_0x53aee2){if(_0x53aee2){return _0x53aee2?{'count':_0x18d641,'rows':_0x53aee2}:null;}})[_0x17b1('0x23')](respondWithResult(_0x7be9a3,null))[_0x17b1('0x3e')](handleError(_0x7be9a3,null));};
\ No newline at end of file
+var _0xf2d4=['where','merge','filter','options','include','findAll','catch','show','params','includeAll','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','findOne','rawAttributes','getContacts','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','get','Companies','UserProfileResource','status','error','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0xa58ffc,_0x336897){var _0x44fc5f=function(_0x40ab2d){while(--_0x40ab2d){_0xa58ffc['push'](_0xa58ffc['shift']());}};_0x44fc5f(++_0x336897);}(_0xf2d4,0xbe));var _0x4f2d=function(_0x3d9f17,_0x138fb5){_0x3d9f17=_0x3d9f17-0x0;var _0x2e1bde=_0xf2d4[_0x3d9f17];return _0x2e1bde;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4f2d('0x0'));var jsonpatch=require(_0x4f2d('0x1'));var rp=require(_0x4f2d('0x2'));var moment=require(_0x4f2d('0x3'));var BPromise=require(_0x4f2d('0x4'));var Mustache=require(_0x4f2d('0x5'));var util=require(_0x4f2d('0x6'));var path=require(_0x4f2d('0x7'));var sox=require(_0x4f2d('0x8'));var csv=require(_0x4f2d('0x9'));var ejs=require(_0x4f2d('0xa'));var fs=require('fs');var fs_extra=require(_0x4f2d('0xb'));var _=require(_0x4f2d('0xc'));var squel=require('squel');var crypto=require(_0x4f2d('0xd'));var jsforce=require(_0x4f2d('0xe'));var deskjs=require(_0x4f2d('0xf'));var toCsv=require(_0x4f2d('0x9'));var querystring=require(_0x4f2d('0x10'));var Papa=require(_0x4f2d('0x11'));var Redis=require(_0x4f2d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4f2d('0x13'));var as=require(_0x4f2d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f2d('0x15'))(_0x4f2d('0x16'));var utils=require(_0x4f2d('0x17'));var config=require(_0x4f2d('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x133552,_0x44a7a3){_0x44a7a3=_0x44a7a3||0xcc;return function(_0xd221da){if(_0xd221da){return _0x133552[_0x4f2d('0x19')](_0x44a7a3);}return _0x133552['status'](_0x44a7a3)[_0x4f2d('0x1a')]();};}function respondWithResult(_0x12f0ff,_0x3d5fc5){_0x3d5fc5=_0x3d5fc5||0xc8;return function(_0x397929){if(_0x397929){return _0x12f0ff['status'](_0x3d5fc5)[_0x4f2d('0x1b')](_0x397929);}};}function respondWithFilteredResult(_0x2d22be,_0x14381a){return function(_0x2b6683){if(_0x2b6683){var _0x210679=typeof _0x14381a[_0x4f2d('0x1c')]==='undefined'&&typeof _0x14381a[_0x4f2d('0x1d')]===_0x4f2d('0x1e');var _0x1e6d5a=_0x2b6683[_0x4f2d('0x1f')];var _0x9f7994=_0x210679?0x0:_0x14381a[_0x4f2d('0x1c')];var _0x24d14b=_0x210679?_0x2b6683[_0x4f2d('0x1f')]:_0x14381a[_0x4f2d('0x1c')]+_0x14381a['limit'];var _0x544082;if(_0x24d14b>=_0x1e6d5a){_0x24d14b=_0x1e6d5a;_0x544082=0xc8;}else{_0x544082=0xce;}_0x2d22be['status'](_0x544082);return _0x2d22be[_0x4f2d('0x20')](_0x4f2d('0x21'),_0x9f7994+'-'+_0x24d14b+'/'+_0x1e6d5a)[_0x4f2d('0x1b')](_0x2b6683);}return null;};}function patchUpdates(_0x8ea065){return function(_0x4e592f){try{jsonpatch[_0x4f2d('0x22')](_0x4e592f,_0x8ea065,!![]);}catch(_0x2aa38f){return BPromise[_0x4f2d('0x23')](_0x2aa38f);}return _0x4e592f['save']();};}function saveUpdates(_0xe95f20,_0x84a136){return function(_0x32dd79){if(_0x32dd79){return _0x32dd79['update'](_0xe95f20)[_0x4f2d('0x24')](function(_0x44c65d){return _0x44c65d;});}return null;};}function removeEntity(_0x313dea,_0x4aae4c){return function(_0x4bd255){if(_0x4bd255){return _0x4bd255[_0x4f2d('0x25')]()[_0x4f2d('0x24')](function(){var _0x50bd9a=_0x4bd255[_0x4f2d('0x26')]({'plain':!![]});var _0x154d2d=_0x4f2d('0x27');return db[_0x4f2d('0x28')][_0x4f2d('0x25')]({'where':{'type':_0x154d2d,'resourceId':_0x50bd9a['id']}})['then'](function(){return _0x4bd255;});})[_0x4f2d('0x24')](function(){_0x313dea[_0x4f2d('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9bdd60,_0x417cca){return function(_0x458414){if(!_0x458414){_0x9bdd60[_0x4f2d('0x19')](0x194);}return _0x458414;};}function handleError(_0x9dc00e,_0x28c159){_0x28c159=_0x28c159||0x1f4;return function(_0x2c86e9){logger[_0x4f2d('0x2a')](_0x2c86e9['stack']);if(_0x2c86e9[_0x4f2d('0x2b')]){delete _0x2c86e9[_0x4f2d('0x2b')];}_0x9dc00e[_0x4f2d('0x29')](_0x28c159)[_0x4f2d('0x2c')](_0x2c86e9);};}exports[_0x4f2d('0x2d')]=function(_0x2cdd52,_0x1ff806){var _0x36bfff={},_0x49df2c={},_0x5da706={'count':0x0,'rows':[]};return db[_0x4f2d('0x2e')][_0x4f2d('0x2f')]()[_0x4f2d('0x24')](function(_0x18f290){_0x49df2c[_0x4f2d('0x30')]=_[_0x4f2d('0x31')](_0x18f290);_0x49df2c[_0x4f2d('0x32')]=_['keys'](_0x2cdd52[_0x4f2d('0x32')]);_0x49df2c[_0x4f2d('0x33')]=_[_0x4f2d('0x34')](_0x49df2c[_0x4f2d('0x30')],_0x49df2c['query']);_0x36bfff[_0x4f2d('0x35')]=_[_0x4f2d('0x34')](_0x49df2c['model'],qs[_0x4f2d('0x36')](_0x2cdd52['query'][_0x4f2d('0x36')]));_0x36bfff['attributes']=_0x36bfff['attributes'][_0x4f2d('0x37')]?_0x36bfff[_0x4f2d('0x35')]:_0x49df2c['model'];if(!_0x2cdd52[_0x4f2d('0x32')][_0x4f2d('0x38')]('nolimit')){_0x36bfff['limit']=qs[_0x4f2d('0x1d')](_0x2cdd52['query'][_0x4f2d('0x1d')]);_0x36bfff['offset']=qs['offset'](_0x2cdd52[_0x4f2d('0x32')][_0x4f2d('0x1c')]);}_0x36bfff[_0x4f2d('0x39')]=qs[_0x4f2d('0x3a')](_0x2cdd52['query'][_0x4f2d('0x3a')]);_0x36bfff[_0x4f2d('0x3b')]=qs[_0x4f2d('0x33')](_['pick'](_0x2cdd52[_0x4f2d('0x32')],_0x49df2c[_0x4f2d('0x33')]),_0x18f290);if(_0x2cdd52[_0x4f2d('0x32')]['filter']){_0x36bfff[_0x4f2d('0x3b')]=_[_0x4f2d('0x3c')](_0x36bfff[_0x4f2d('0x3b')],{'$or':_['map'](_0x36bfff[_0x4f2d('0x35')],function(_0x3dbb96){var _0x5a5612={};_0x5a5612[_0x3dbb96]={'$like':'%'+_0x2cdd52[_0x4f2d('0x32')][_0x4f2d('0x3d')]+'%'};return _0x5a5612;})});}_0x36bfff=_[_0x4f2d('0x3c')]({},_0x36bfff,_0x2cdd52[_0x4f2d('0x3e')]);var _0x3443c9={'where':_0x36bfff[_0x4f2d('0x3b')]};return db[_0x4f2d('0x2e')][_0x4f2d('0x1f')](_0x3443c9)['then'](function(_0x2b4af2){_0x5da706[_0x4f2d('0x1f')]=_0x2b4af2;if(_0x2cdd52[_0x4f2d('0x32')]['includeAll']){_0x36bfff[_0x4f2d('0x3f')]=[{'all':!![]}];}return db[_0x4f2d('0x2e')][_0x4f2d('0x40')](_0x36bfff);})[_0x4f2d('0x24')](function(_0x233786){_0x5da706['rows']=_0x233786;return _0x5da706;})[_0x4f2d('0x24')](respondWithFilteredResult(_0x1ff806,_0x36bfff))[_0x4f2d('0x41')](handleError(_0x1ff806,null));})[_0x4f2d('0x41')](handleError(_0x1ff806,null));};exports[_0x4f2d('0x42')]=function(_0x1f9353,_0x5c8c3e){var _0x52f43e={'raw':![],'where':{'id':_0x1f9353[_0x4f2d('0x43')]['id']}},_0x4f9230={};_0x4f9230[_0x4f2d('0x30')]=_[_0x4f2d('0x31')](db[_0x4f2d('0x2e')]['rawAttributes']);_0x4f9230['query']=_[_0x4f2d('0x31')](_0x1f9353[_0x4f2d('0x32')]);_0x4f9230[_0x4f2d('0x33')]=_['intersection'](_0x4f9230[_0x4f2d('0x30')],_0x4f9230[_0x4f2d('0x32')]);_0x52f43e[_0x4f2d('0x35')]=_[_0x4f2d('0x34')](_0x4f9230['model'],qs['fields'](_0x1f9353[_0x4f2d('0x32')]['fields']));_0x52f43e[_0x4f2d('0x35')]=_0x52f43e['attributes']['length']?_0x52f43e[_0x4f2d('0x35')]:_0x4f9230[_0x4f2d('0x30')];if(_0x1f9353[_0x4f2d('0x32')][_0x4f2d('0x44')]){_0x52f43e[_0x4f2d('0x3f')]=[{'all':!![]}];}_0x52f43e=_[_0x4f2d('0x3c')]({},_0x52f43e,_0x1f9353[_0x4f2d('0x3e')]);return db['CmCompany'][_0x4f2d('0x45')](_0x52f43e)[_0x4f2d('0x24')](handleEntityNotFound(_0x5c8c3e,null))[_0x4f2d('0x24')](respondWithResult(_0x5c8c3e,null))[_0x4f2d('0x41')](handleError(_0x5c8c3e,null));};exports['create']=function(_0x48c596,_0x1cb5d0){return db['CmCompany'][_0x4f2d('0x46')](_0x48c596[_0x4f2d('0x47')],{})[_0x4f2d('0x24')](function(_0x23d69f){var _0x595ee0=_0x48c596[_0x4f2d('0x48')][_0x4f2d('0x26')]({'plain':!![]});if(!_0x595ee0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x595ee0['role']===_0x4f2d('0x48')){var _0x24842b=_0x23d69f['get']({'plain':!![]});var _0x492730=_0x4f2d('0x27');return db[_0x4f2d('0x49')][_0x4f2d('0x45')]({'where':{'name':_0x492730,'userProfileId':_0x595ee0[_0x4f2d('0x4a')]},'raw':!![]})[_0x4f2d('0x24')](function(_0x3a7f16){if(_0x3a7f16&&_0x3a7f16[_0x4f2d('0x4b')]===0x0){return db[_0x4f2d('0x28')]['create']({'name':_0x24842b[_0x4f2d('0x2b')],'resourceId':_0x24842b['id'],'type':_0x3a7f16['name'],'sectionId':_0x3a7f16['id']},{})[_0x4f2d('0x24')](function(){return _0x23d69f;});}else{return _0x23d69f;}})['catch'](function(_0x2e2067){logger[_0x4f2d('0x2a')](_0x4f2d('0x4c'),_0x2e2067);throw _0x2e2067;});}return _0x23d69f;})[_0x4f2d('0x24')](respondWithResult(_0x1cb5d0,0xc9))[_0x4f2d('0x41')](handleError(_0x1cb5d0,null));};exports['update']=function(_0x3538e8,_0x136b8f){if(_0x3538e8[_0x4f2d('0x47')]['id']){delete _0x3538e8[_0x4f2d('0x47')]['id'];}return db['CmCompany'][_0x4f2d('0x45')]({'where':{'id':_0x3538e8[_0x4f2d('0x43')]['id']}})[_0x4f2d('0x24')](handleEntityNotFound(_0x136b8f,null))[_0x4f2d('0x24')](saveUpdates(_0x3538e8['body'],null))[_0x4f2d('0x24')](respondWithResult(_0x136b8f,null))[_0x4f2d('0x41')](handleError(_0x136b8f,null));};exports['destroy']=function(_0x33030c,_0x3c7229){return db[_0x4f2d('0x2e')][_0x4f2d('0x45')]({'where':{'id':_0x33030c[_0x4f2d('0x43')]['id']}})['then'](handleEntityNotFound(_0x3c7229,null))[_0x4f2d('0x24')](removeEntity(_0x3c7229,null))[_0x4f2d('0x41')](handleError(_0x3c7229,null));};exports[_0x4f2d('0x2f')]=function(_0x240a2c,_0x201a4e){return db[_0x4f2d('0x2e')][_0x4f2d('0x2f')]()[_0x4f2d('0x24')](respondWithResult(_0x201a4e,null))[_0x4f2d('0x41')](handleError(_0x201a4e,null));};exports['addContacts']=function(_0x55cb6e,_0x1a25ef,_0x37f2f4){return db[_0x4f2d('0x4d')][_0x4f2d('0x45')]({'where':{'id':_0x55cb6e[_0x4f2d('0x43')]['id']}})[_0x4f2d('0x24')](handleEntityNotFound(_0x1a25ef,null))[_0x4f2d('0x24')](function(_0x582dfd){if(_0x582dfd){return _0x582dfd[_0x4f2d('0x4e')](_0x55cb6e[_0x4f2d('0x47')][_0x4f2d('0x4f')],_['omit'](_0x55cb6e[_0x4f2d('0x47')],[_0x4f2d('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x1a25ef,null))[_0x4f2d('0x41')](handleError(_0x1a25ef,null));};exports['getContacts']=function(_0x564265,_0xe19c1,_0x932477){var _0x3a60c8={};var _0x4d9349={};var _0x3ef4de;var _0xab79d;return db['CmCompany'][_0x4f2d('0x50')]({'where':{'id':_0x564265['params']['id']}})[_0x4f2d('0x24')](handleEntityNotFound(_0xe19c1,null))[_0x4f2d('0x24')](function(_0xb57c98){if(_0xb57c98){_0x3ef4de=_0xb57c98;_0x4d9349['model']=_[_0x4f2d('0x31')](db[_0x4f2d('0x4d')][_0x4f2d('0x51')]);_0x4d9349['query']=_[_0x4f2d('0x31')](_0x564265['query']);_0x4d9349['filters']=_['intersection'](_0x4d9349['model'],_0x4d9349['query']);_0x3a60c8[_0x4f2d('0x35')]=_[_0x4f2d('0x34')](_0x4d9349['model'],qs['fields'](_0x564265['query'][_0x4f2d('0x36')]));_0x3a60c8['attributes']=_0x3a60c8[_0x4f2d('0x35')]['length']?_0x3a60c8['attributes']:_0x4d9349[_0x4f2d('0x30')];_0x3a60c8[_0x4f2d('0x39')]=qs['sort'](_0x564265[_0x4f2d('0x32')][_0x4f2d('0x3a')]);_0x3a60c8[_0x4f2d('0x3b')]=qs[_0x4f2d('0x33')](_['pick'](_0x564265['query'],_0x4d9349[_0x4f2d('0x33')]));if(_0x564265['query'][_0x4f2d('0x3d')]){_0x3a60c8['where']=_['merge'](_0x3a60c8[_0x4f2d('0x3b')],{'$or':_['map'](_0x3a60c8[_0x4f2d('0x35')],function(_0x24c47d){var _0x513cbc={};_0x513cbc[_0x24c47d]={'$like':'%'+_0x564265['query'][_0x4f2d('0x3d')]+'%'};return _0x513cbc;})});}_0x3a60c8=_[_0x4f2d('0x3c')]({},_0x3a60c8,_0x564265[_0x4f2d('0x3e')]);return _0x3ef4de[_0x4f2d('0x52')](_0x3a60c8);}})[_0x4f2d('0x24')](function(_0x4c417e){if(_0x4c417e){_0xab79d=_0x4c417e[_0x4f2d('0x37')];if(!_0x564265[_0x4f2d('0x32')]['hasOwnProperty']('nolimit')){_0x3a60c8[_0x4f2d('0x1d')]=qs[_0x4f2d('0x1d')](_0x564265['query'][_0x4f2d('0x1d')]);_0x3a60c8[_0x4f2d('0x1c')]=qs[_0x4f2d('0x1c')](_0x564265[_0x4f2d('0x32')]['offset']);}return _0x3ef4de['getContacts'](_0x3a60c8);}})[_0x4f2d('0x24')](function(_0x2ba6c2){if(_0x2ba6c2){return _0x2ba6c2?{'count':_0xab79d,'rows':_0x2ba6c2}:null;}})[_0x4f2d('0x24')](respondWithResult(_0xe19c1,null))[_0x4f2d('0x41')](handleError(_0xe19c1,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 0eac624..7bf1ca8 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 _0x32f8=['cm_companies','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmCompany'];(function(_0x7538c5,_0xa5d8ac){var _0x8b56be=function(_0x2036c0){while(--_0x2036c0){_0x7538c5['push'](_0x7538c5['shift']());}};_0x8b56be(++_0xa5d8ac);}(_0x32f8,0x177));var _0x832f=function(_0x3b5aed,_0x3afd9c){_0x3b5aed=_0x3b5aed-0x0;var _0x5c78a6=_0x32f8[_0x3b5aed];return _0x5c78a6;};'use strict';var _=require('lodash');var util=require(_0x832f('0x0'));var logger=require('../../config/logger')(_0x832f('0x1'));var moment=require(_0x832f('0x2'));var BPromise=require(_0x832f('0x3'));var rp=require(_0x832f('0x4'));var fs=require('fs');var path=require(_0x832f('0x5'));var rimraf=require(_0x832f('0x6'));var config=require(_0x832f('0x7'));var attributes=require('./cmCompany.attributes');module[_0x832f('0x8')]=function(_0x201f7e,_0x44f47b){return _0x201f7e['define'](_0x832f('0x9'),attributes,{'tableName':_0x832f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa4c8=['api','moment','request-promise','path','../../config/environment','exports','CmCompany','cm_companies','lodash','util'];(function(_0x385f81,_0x394333){var _0x390b9e=function(_0x5541b7){while(--_0x5541b7){_0x385f81['push'](_0x385f81['shift']());}};_0x390b9e(++_0x394333);}(_0xa4c8,0x184));var _0x8a4c=function(_0x21ce98,_0x436b58){_0x21ce98=_0x21ce98-0x0;var _0x2b3e63=_0xa4c8[_0x21ce98];return _0x2b3e63;};'use strict';var _=require(_0x8a4c('0x0'));var util=require(_0x8a4c('0x1'));var logger=require('../../config/logger')(_0x8a4c('0x2'));var moment=require(_0x8a4c('0x3'));var BPromise=require('bluebird');var rp=require(_0x8a4c('0x4'));var fs=require('fs');var path=require(_0x8a4c('0x5'));var rimraf=require('rimraf');var config=require(_0x8a4c('0x6'));var attributes=require('./cmCompany.attributes');module[_0x8a4c('0x7')]=function(_0x15411c,_0x2492cf){return _0x15411c['define'](_0x8a4c('0x8'),attributes,{'tableName':_0x8a4c('0x9'),'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 fb9bb1a..ba54798 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 _0x0a55=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment'];(function(_0x6f9285,_0xc7a118){var _0x1f324d=function(_0x271524){while(--_0x271524){_0x6f9285['push'](_0x6f9285['shift']());}};_0x1f324d(++_0xc7a118);}(_0x0a55,0xb5));var _0x50a5=function(_0x124705,_0x368268){_0x124705=_0x124705-0x0;var _0x49278a=_0x0a55[_0x124705];return _0x49278a;};'use strict';var _=require(_0x50a5('0x0'));var util=require(_0x50a5('0x1'));var moment=require(_0x50a5('0x2'));var BPromise=require(_0x50a5('0x3'));var rs=require(_0x50a5('0x4'));var fs=require('fs');var Redis=require(_0x50a5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x50a5('0x6'));var logger=require(_0x50a5('0x7'))(_0x50a5('0x8'));var config=require(_0x50a5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x50a5('0xa')][_0x50a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18c53f,_0x4f05f8,_0x46af76){return new BPromise(function(_0x121035,_0x1066f8){return client[_0x50a5('0xc')](_0x18c53f,_0x46af76)[_0x50a5('0xd')](function(_0x38f089){logger[_0x50a5('0xe')](_0x50a5('0xf'),_0x4f05f8,_0x50a5('0x10'));logger[_0x50a5('0x11')](_0x50a5('0x12'),_0x4f05f8,_0x50a5('0x10'),JSON[_0x50a5('0x13')](_0x38f089));if(_0x38f089['error']){if(_0x38f089[_0x50a5('0x14')][_0x50a5('0x15')]===0x1f4){logger[_0x50a5('0x14')](_0x50a5('0xf'),_0x4f05f8,_0x38f089['error'][_0x50a5('0x16')]);return _0x1066f8(_0x38f089['error'][_0x50a5('0x16')]);}logger[_0x50a5('0x14')](_0x50a5('0xf'),_0x4f05f8,_0x38f089[_0x50a5('0x14')][_0x50a5('0x16')]);return _0x121035(_0x38f089[_0x50a5('0x14')]['message']);}else{logger[_0x50a5('0xe')]('CmCompany,\x20%s,\x20%s',_0x4f05f8,_0x50a5('0x10'));_0x121035(_0x38f089['result'][_0x50a5('0x16')]);}})['catch'](function(_0x3863a9){logger[_0x50a5('0x14')](_0x50a5('0xf'),_0x4f05f8,_0x3863a9);_0x1066f8(_0x3863a9);});});}
\ No newline at end of file
+var _0x8325=['bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x159f9b,_0x5b015c){var _0x5af408=function(_0x3d8a15){while(--_0x3d8a15){_0x159f9b['push'](_0x159f9b['shift']());}};_0x5af408(++_0x5b015c);}(_0x8325,0xa5));var _0x5832=function(_0x45ef17,_0x3eb0e5){_0x45ef17=_0x45ef17-0x0;var _0x238108=_0x8325[_0x45ef17];return _0x238108;};'use strict';var _=require(_0x5832('0x0'));var util=require(_0x5832('0x1'));var moment=require(_0x5832('0x2'));var BPromise=require(_0x5832('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5832('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5832('0x5'))('rpc');var config=require(_0x5832('0x6'));var jayson=require(_0x5832('0x7'));var client=jayson['client'][_0x5832('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x164c90,_0x37115a,_0x1ccda6){return new BPromise(function(_0x1d62b9,_0x9f192e){return client[_0x5832('0x9')](_0x164c90,_0x1ccda6)[_0x5832('0xa')](function(_0xc28e42){logger[_0x5832('0xb')]('CmCompany,\x20%s,\x20%s',_0x37115a,_0x5832('0xc'));logger[_0x5832('0xd')](_0x5832('0xe'),_0x37115a,'request\x20sent',JSON['stringify'](_0xc28e42));if(_0xc28e42[_0x5832('0xf')]){if(_0xc28e42[_0x5832('0xf')][_0x5832('0x10')]===0x1f4){logger[_0x5832('0xf')](_0x5832('0x11'),_0x37115a,_0xc28e42[_0x5832('0xf')][_0x5832('0x12')]);return _0x9f192e(_0xc28e42[_0x5832('0xf')][_0x5832('0x12')]);}logger[_0x5832('0xf')]('CmCompany,\x20%s,\x20%s',_0x37115a,_0xc28e42['error'][_0x5832('0x12')]);return _0x1d62b9(_0xc28e42['error'][_0x5832('0x12')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x37115a,_0x5832('0xc'));_0x1d62b9(_0xc28e42[_0x5832('0x13')]['message']);}})[_0x5832('0x14')](function(_0x176e05){logger[_0x5832('0xf')](_0x5832('0x11'),_0x37115a,_0x176e05);_0x9f192e(_0x176e05);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 2f1e592..fd7b26d 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 _0xcb18=['addContacts','put','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','index','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post'];(function(_0x5a2d91,_0x513039){var _0x3422e4=function(_0x540310){while(--_0x540310){_0x5a2d91['push'](_0x5a2d91['shift']());}};_0x3422e4(++_0x513039);}(_0xcb18,0x191));var _0x8cb1=function(_0x4d431b,_0x52aca){_0x4d431b=_0x4d431b-0x0;var _0x4fdad5=_0xcb18[_0x4d431b];return _0x4fdad5;};'use strict';var multer=require(_0x8cb1('0x0'));var util=require('util');var path=require(_0x8cb1('0x1'));var timeout=require(_0x8cb1('0x2'));var express=require('express');var router=express[_0x8cb1('0x3')]();var fs_extra=require(_0x8cb1('0x4'));var auth=require(_0x8cb1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8cb1('0x6'));var controller=require(_0x8cb1('0x7'));router[_0x8cb1('0x8')]('/',auth['isAuthenticated'](),controller[_0x8cb1('0x9')]);router[_0x8cb1('0x8')]('/describe',auth[_0x8cb1('0xa')](),controller[_0x8cb1('0xb')]);router[_0x8cb1('0x8')](_0x8cb1('0xc'),auth['isAuthenticated'](),controller[_0x8cb1('0xd')]);router[_0x8cb1('0x8')](_0x8cb1('0xe'),auth[_0x8cb1('0xa')](),controller[_0x8cb1('0xf')]);router[_0x8cb1('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8cb1('0x10')](_0x8cb1('0xe'),auth['isAuthenticated'](),controller[_0x8cb1('0x11')]);router[_0x8cb1('0x12')]('/:id',auth[_0x8cb1('0xa')](),controller[_0x8cb1('0x13')]);router[_0x8cb1('0x14')](_0x8cb1('0xc'),auth[_0x8cb1('0xa')](),controller['destroy']);module[_0x8cb1('0x15')]=router;
\ No newline at end of file
+var _0x866e=['post','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','create'];(function(_0x4e86d8,_0x1c3bd4){var _0x937bd1=function(_0xdab00a){while(--_0xdab00a){_0x4e86d8['push'](_0x4e86d8['shift']());}};_0x937bd1(++_0x1c3bd4);}(_0x866e,0xaf));var _0xe866=function(_0x144804,_0x5b78bd){_0x144804=_0x144804-0x0;var _0x4598ec=_0x866e[_0x144804];return _0x4598ec;};'use strict';var multer=require(_0xe866('0x0'));var util=require(_0xe866('0x1'));var path=require(_0xe866('0x2'));var timeout=require(_0xe866('0x3'));var express=require(_0xe866('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe866('0x5'));var interaction=require(_0xe866('0x6'));var config=require(_0xe866('0x7'));var controller=require('./cmCompany.controller');router[_0xe866('0x8')]('/',auth[_0xe866('0x9')](),controller[_0xe866('0xa')]);router['get'](_0xe866('0xb'),auth[_0xe866('0x9')](),controller['describe']);router[_0xe866('0x8')](_0xe866('0xc'),auth[_0xe866('0x9')](),controller[_0xe866('0xd')]);router[_0xe866('0x8')](_0xe866('0xe'),auth[_0xe866('0x9')](),controller[_0xe866('0xf')]);router['post']('/',auth[_0xe866('0x9')](),controller[_0xe866('0x10')]);router[_0xe866('0x11')](_0xe866('0xe'),auth[_0xe866('0x9')](),controller[_0xe866('0x12')]);router[_0xe866('0x13')](_0xe866('0xc'),auth[_0xe866('0x9')](),controller[_0xe866('0x14')]);router[_0xe866('0x15')](_0xe866('0xc'),auth['isAuthenticated'](),controller[_0xe866('0x16')]);module[_0xe866('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 84735df..372466d 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 _0x633a=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash','sequelize'];(function(_0x271f14,_0x55d96a){var _0x3a2bb5=function(_0x126651){while(--_0x126651){_0x271f14['push'](_0x271f14['shift']());}};_0x3a2bb5(++_0x55d96a);}(_0x633a,0x15e));var _0xa633=function(_0x3b6c24,_0x24a890){_0x3b6c24=_0x3b6c24-0x0;var _0x5eb881=_0x633a[_0x3b6c24];return _0x5eb881;};'use strict';var _=require(_0xa633('0x0'));var Sequelize=require(_0xa633('0x1'));module[_0xa633('0x2')]={'firstName':{'type':Sequelize[_0xa633('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xa633('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa633('0x3')]},'country':{'type':Sequelize[_0xa633('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa633('0x4')]},'phone':{'type':Sequelize[_0xa633('0x3')]},'mobile':{'type':Sequelize[_0xa633('0x3')]},'fax':{'type':Sequelize[_0xa633('0x3')]},'email':{'type':Sequelize[_0xa633('0x3')]},'url':{'type':Sequelize[_0xa633('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xa633('0x3')]},'twitter':{'type':Sequelize[_0xa633('0x3')]},'skype':{'type':Sequelize[_0xa633('0x3')]},'teams':{'type':Sequelize[_0xa633('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa633('0x3')]},'wechat':{'type':Sequelize[_0xa633('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xa633('0x3')]},'priority':{'type':Sequelize[_0xa633('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa633('0x6')],'defaultValue':Sequelize[_0xa633('0x7')]},'dialTimezone':{'type':Sequelize[_0xa633('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x487c=['INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x101e60,_0x2878e2){var _0x39a4a0=function(_0x117072){while(--_0x117072){_0x101e60['push'](_0x101e60['shift']());}};_0x39a4a0(++_0x2878e2);}(_0x487c,0x187));var _0xc487=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x487c[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xc487('0x0'));var Sequelize=require(_0xc487('0x1'));module[_0xc487('0x2')]={'firstName':{'type':Sequelize[_0xc487('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc487('0x3')]},'street':{'type':Sequelize[_0xc487('0x3')]},'postalCode':{'type':Sequelize[_0xc487('0x3')]},'city':{'type':Sequelize[_0xc487('0x3')]},'country':{'type':Sequelize[_0xc487('0x3')]},'dateOfBirth':{'type':Sequelize[_0xc487('0x3')]},'description':{'type':Sequelize[_0xc487('0x4')]},'phone':{'type':Sequelize[_0xc487('0x3')]},'mobile':{'type':Sequelize[_0xc487('0x3')]},'fax':{'type':Sequelize[_0xc487('0x3')]},'email':{'type':Sequelize[_0xc487('0x3')]},'url':{'type':Sequelize[_0xc487('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xc487('0x3')]},'twitter':{'type':Sequelize[_0xc487('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xc487('0x3')]},'line':{'type':Sequelize[_0xc487('0x3')]},'wechat':{'type':Sequelize[_0xc487('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xc487('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xc487('0x3')]},'priority':{'type':Sequelize[_0xc487('0x5')](0x2)[_0xc487('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc487('0x7')],'defaultValue':Sequelize[_0xc487('0x8')]},'dialTimezone':{'type':Sequelize[_0xc487('0x3')]},'utcOffset':{'type':Sequelize[_0xc487('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index f2ea0a6..b876d92 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 _0x7d82=['toString','keyBy','CmContact','c.firstName','c.lastName','c.fax','c.email','c.deletedAt','TagIds','Tags','push','rows','catch','destroy','params','analytics','columnName','custom','values','merge','body','findAll','get','mergeWith','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappQueueReport','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','findOrCreate','spread','contact','show','Tag','color','ItemType','literal','Phones.OrderBy','$and','format','cf_%d','pickBy','setFields','id\x20=\x20?','toParam','phone','pick','options','getTags','setTags','ContactItemType','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','`ItemType`.OrderBy','CmHopperId','item','OrderBy','ItemType.OrderBy','getAdditionalPhones','fromContactId','CmContactId','toContactId','rawAttributes','includeAll','include','ContactId','getHopperFinals','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','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','filename','chmodSync','0777','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','upload','createReadStream','parse','meta','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','start\x20child\x20process\x20correctly!','pid','error\x20child\x20process','importUpdates','stringify','message','exit','getJourney','mail','chat','sms','openchannel','fax','-createdAt','toLowerCase','channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','endtime','duration','note','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','createdAt','findAndCountAll','startCase','Account','closed','disposition','key','Owner','DESC','browserName','customerIp','deviceModel','osName','ratingType','ratingValue','subject','threadId','Interaction','slice','moment','bluebird','path','lodash','squel','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','status','offset','undefined','count','limit','Content-Range','json','update','then','end','sendStatus','error','name','index','describe','keys','length','startsWith','CmCustomField','findOne','trimStart','cf_','all','fieldType','type','model','query','intersection','attributes','fields','nolimit','order','sort','filters','select','field','from','tools_tags','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','where','expr','search','parseSearch','sqlOperator','conditions','find','value','split','union','User','dateOfBirth','datetime','DATE','text','start','map','hasOwnProperty','filter','isNil','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','t.id\x20IN\x20?','resolve','user','role','agent','getLists','c.ListId\x20IS\x20NULL','sequelize'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x7d82,0x1d6));var _0x27d8=function(_0x16897d,_0x3e5323){_0x16897d=_0x16897d-0x0;var _0x401a46=_0x7d82[_0x16897d];return _0x401a46;};'use strict';var moment=require(_0x27d8('0x0'));var BPromise=require(_0x27d8('0x1'));var util=require('util');var path=require(_0x27d8('0x2'));var fs=require('fs');var _=require(_0x27d8('0x3'));var squel=require(_0x27d8('0x4'));var Papa=require(_0x27d8('0x5'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var as=require(_0x27d8('0x6'));var logger=require(_0x27d8('0x7'))(_0x27d8('0x8'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var db=require(_0x27d8('0x9'))['db'];config[_0x27d8('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x27d8('0xb'))(new Redis(config[_0x27d8('0xa')]));require(_0x27d8('0xc'))['register'](socket);function respondWithResult(_0x297f90,_0x3923bc){_0x3923bc=_0x3923bc||0xc8;return function(_0x50a093){if(_0x50a093){return _0x297f90[_0x27d8('0xd')](_0x3923bc)['json'](_0x50a093);}};}function respondWithFilteredResult(_0x155c82,_0x18761d){return function(_0x4cb919){if(_0x4cb919){var _0x4d3ed9=typeof _0x18761d[_0x27d8('0xe')]==='undefined'&&typeof _0x18761d['limit']===_0x27d8('0xf');var _0x24f5ec=_0x4cb919[_0x27d8('0x10')];var _0x29df92=_0x4d3ed9?0x0:_0x18761d[_0x27d8('0xe')];var _0x35c10a=_0x4d3ed9?_0x4cb919[_0x27d8('0x10')]:_0x18761d[_0x27d8('0xe')]+_0x18761d[_0x27d8('0x11')];var _0x32c4fc;if(_0x35c10a>=_0x24f5ec){_0x35c10a=_0x24f5ec;_0x32c4fc=0xc8;}else{_0x32c4fc=0xce;}_0x155c82['status'](_0x32c4fc);return _0x155c82['set'](_0x27d8('0x12'),_0x29df92+'-'+_0x35c10a+'/'+_0x24f5ec)[_0x27d8('0x13')](_0x4cb919);}return null;};}function saveUpdates(_0x351315){return function(_0x2b2825){if(_0x2b2825){return _0x2b2825[_0x27d8('0x14')](_0x351315)[_0x27d8('0x15')](function(_0xc74767){return _0xc74767;});}return null;};}function removeEntity(_0x59d48b){return function(_0x4236ba){if(_0x4236ba){return _0x4236ba['destroy']()[_0x27d8('0x15')](function(){_0x59d48b[_0x27d8('0xd')](0xcc)[_0x27d8('0x16')]();});}};}function handleEntityNotFound(_0x34084c){return function(_0x32d66f){if(!_0x32d66f){_0x34084c[_0x27d8('0x17')](0x194);}return _0x32d66f;};}function handleError(_0x2a57cd,_0x46fe6e){_0x46fe6e=_0x46fe6e||0x1f4;return function(_0x462a86){logger[_0x27d8('0x18')](_0x462a86['stack']);if(_0x462a86[_0x27d8('0x19')]){delete _0x462a86['name'];}_0x2a57cd[_0x27d8('0xd')](_0x46fe6e)['send'](_0x462a86);};}exports[_0x27d8('0x1a')]=function(_0xd38929,_0xf09755){var _0x21cb2d={},_0xf0fd81={},_0x58f6ce={'count':0x0,'rows':[]};return db['CmContact'][_0x27d8('0x1b')]()[_0x27d8('0x15')](function(_0x1d387c){var _0x3e059d=[];for(var _0x2f08d1=0x0;_0x2f08d1
','Attachments'];(function(_0x1ca6a2,_0x413e1a){var _0x3b55ba=function(_0x346463){while(--_0x346463){_0x1ca6a2['push'](_0x1ca6a2['shift']());}};_0x3b55ba(++_0x413e1a);}(_0xbd28,0xe9));var _0x8bd2=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0xbd28[_0x2132a3];return _0x21890c;};'use strict';var _=require(_0x8bd2('0x0'));var moment=require(_0x8bd2('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x8bd2('0x2'));var util=require(_0x8bd2('0x3'));var tnef=require(_0x8bd2('0x4'));var logger=require(_0x8bd2('0x5'))(_0x8bd2('0x6'));var config=require(_0x8bd2('0x7'));function getAddress(_0x593fe1){var _0x1b432a=_['head'](_0x593fe1[_0x8bd2('0x8')]);return _0x1b432a&&_0x1b432a[_0x8bd2('0x9')]?_0x1b432a[_0x8bd2('0x9')]:_0x8bd2('0xa')+random[_0x8bd2('0xb')](0x6)+_0x8bd2('0xc');}function getFirstName(_0x4bdab8){var _0x154746=_[_0x8bd2('0xd')](_0x4bdab8[_0x8bd2('0x8')]);if(_0x154746&&_0x154746[_0x8bd2('0xe')]){if(_0x154746[_0x8bd2('0xe')]==_0x154746[_0x8bd2('0x9')]){return _0x154746[_0x8bd2('0xe')][_0x8bd2('0xf')](0x0,_0x154746[_0x8bd2('0xe')]['indexOf']('@'));}var _0x16eac3=_0x154746[_0x8bd2('0xe')][_0x8bd2('0x10')](/\s+/);return _0x16eac3[_0x8bd2('0x11')]>0x1?_0x16eac3[_0x8bd2('0x12')](0x0,-0x1)[_0x8bd2('0x13')]('\x20'):_0x154746[_0x8bd2('0xe')];}return _0x8bd2('0x14');}function getLastName(_0x166445){var _0x244283=_[_0x8bd2('0xd')](_0x166445[_0x8bd2('0x8')]);if(_0x244283&&_0x244283[_0x8bd2('0xe')]){var _0x39aebe=_0x244283[_0x8bd2('0xe')][_0x8bd2('0x10')](/\s+/);return _0x39aebe[_0x8bd2('0x11')]>0x1?_0x39aebe[_0x8bd2('0x15')]():'';}return'';}function getMails(_0x5c0025,_0x423411){var _0x425f5a='';for(var _0xe97eeb=0x0;_0xe97eeb<_0x423411[_0x8bd2('0x8')][_0x8bd2('0x11')];_0xe97eeb+=0x1){if(_0x423411[_0x8bd2('0x8')][_0xe97eeb][_0x8bd2('0x9')]!==_0x5c0025){if(!_[_0x8bd2('0x16')](_0x425f5a)){_0x425f5a+=',';}_0x425f5a+=_0x423411['value'][_0xe97eeb][_0x8bd2('0xe')]||_0x423411[_0x8bd2('0x8')][_0xe97eeb]['address']||'';_0x425f5a+='\x20<';_0x425f5a+=_0x423411[_0x8bd2('0x8')][_0xe97eeb][_0x8bd2('0x9')]?_0x423411[_0x8bd2('0x8')][_0xe97eeb][_0x8bd2('0x9')]:_0x8bd2('0xa')+random[_0x8bd2('0xb')](0x6)+'@xcally.com';_0x425f5a+='>';}}return _0x425f5a;}function parseEmail(_0x59b876,_0x199c6e,_0x56e294){if(_0x199c6e[_0x8bd2('0x17')]){var _0xf53414=/